[evolution-data-server] Port Camel to GObject.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Port Camel to GObject.
- Date: Sat, 24 Apr 2010 15:05:42 +0000 (UTC)
commit df77c03229838cb82705c979f4f37c39ede44cb6
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Apr 22 09:28:45 2010 -0400
Port Camel to GObject.
addressbook/libebook/e-destination.c | 8 +-
camel/Makefile.am | 2 +
camel/camel-address.c | 49 +-
camel/camel-address.h | 23 +-
camel/camel-block-file.c | 84 +-
camel/camel-block-file.h | 41 +-
camel/camel-certdb.c | 53 +-
camel/camel-certdb.h | 24 +-
camel/camel-cipher-context.c | 154 +-
camel/camel-cipher-context.h | 27 +-
camel/camel-data-cache.c | 124 +-
camel/camel-data-cache.h | 24 +-
camel/camel-data-wrapper.c | 96 +-
camel/camel-data-wrapper.h | 31 +-
camel/camel-disco-diary.c | 40 +-
camel/camel-disco-diary.h | 24 +-
camel/camel-disco-folder.c | 32 +-
camel/camel-disco-folder.h | 24 +-
camel/camel-disco-store.c | 36 +-
camel/camel-disco-store.h | 24 +-
camel/camel-filter-driver.c | 181 +-
camel/camel-filter-driver.h | 24 +-
camel/camel-filter-search.c | 6 +-
camel/camel-folder-search.c | 106 +-
camel/camel-folder-search.h | 24 +-
camel/camel-folder-summary.c | 1823 ++++---
camel/camel-folder-summary.h | 24 +-
camel/camel-folder-thread.c | 4 +-
camel/camel-folder.c | 154 +-
camel/camel-folder.h | 33 +-
camel/camel-gpg-context.c | 180 +-
camel/camel-gpg-context.h | 24 +-
camel/camel-html-parser.c | 38 +-
camel/camel-html-parser.h | 23 +-
camel/camel-http-stream.c | 103 +-
camel/camel-http-stream.h | 23 +-
camel/camel-index-control.c | 22 +-
camel/camel-index.c | 144 +-
camel/camel-index.h | 71 +-
camel/camel-internet-address.c | 26 +-
camel/camel-internet-address.h | 23 +-
camel/camel-medium.c | 116 +-
camel/camel-medium.h | 32 +-
camel/camel-mime-filter-basic.c | 40 +-
camel/camel-mime-filter-basic.h | 23 +-
camel/camel-mime-filter-bestenc.c | 42 +-
camel/camel-mime-filter-bestenc.h | 23 +-
camel/camel-mime-filter-canon.c | 36 +-
camel/camel-mime-filter-canon.h | 25 +-
camel/camel-mime-filter-charset.c | 52 +-
camel/camel-mime-filter-charset.h | 23 +-
camel/camel-mime-filter-crlf.c | 40 +-
camel/camel-mime-filter-crlf.h | 24 +-
camel/camel-mime-filter-enriched.c | 45 +-
camel/camel-mime-filter-enriched.h | 24 +-
camel/camel-mime-filter-from.c | 40 +-
camel/camel-mime-filter-from.h | 23 +-
camel/camel-mime-filter-gzip.c | 59 +-
camel/camel-mime-filter-gzip.h | 26 +-
camel/camel-mime-filter-html.c | 55 +-
camel/camel-mime-filter-html.h | 23 +-
camel/camel-mime-filter-index.c | 74 +-
camel/camel-mime-filter-index.h | 23 +-
camel/camel-mime-filter-linewrap.c | 42 +-
camel/camel-mime-filter-linewrap.h | 24 +-
camel/camel-mime-filter-pgp.c | 43 +-
camel/camel-mime-filter-pgp.h | 24 +-
camel/camel-mime-filter-progress.c | 48 +-
camel/camel-mime-filter-progress.h | 23 +-
camel/camel-mime-filter-save.c | 45 +-
camel/camel-mime-filter-save.h | 24 +-
camel/camel-mime-filter-tohtml.c | 66 +-
camel/camel-mime-filter-tohtml.h | 23 +-
camel/camel-mime-filter-windows.c | 57 +-
camel/camel-mime-filter-windows.h | 23 +-
camel/camel-mime-filter-yenc.c | 42 +-
camel/camel-mime-filter-yenc.h | 26 +-
camel/camel-mime-filter.c | 43 +-
camel/camel-mime-filter.h | 24 +-
camel/camel-mime-message.c | 95 +-
camel/camel-mime-message.h | 25 +-
camel/camel-mime-parser.c | 50 +-
camel/camel-mime-parser.h | 23 +-
camel/camel-mime-part-utils.c | 8 +-
camel/camel-mime-part.c | 206 +-
camel/camel-mime-part.h | 24 +-
camel/camel-movemail.c | 8 +-
camel/camel-multipart-encrypted.c | 54 +-
camel/camel-multipart-encrypted.h | 24 +-
camel/camel-multipart-signed.c | 97 +-
camel/camel-multipart-signed.h | 24 +-
camel/camel-multipart.c | 57 +-
camel/camel-multipart.h | 24 +-
camel/camel-nntp-address.c | 26 +-
camel/camel-nntp-address.h | 23 +-
camel/camel-object-bag.c | 525 ++
camel/camel-object-bag.h | 61 +
camel/camel-object.c | 1205 +----
camel/camel-object.h | 164 +-
camel/camel-offline-folder.c | 31 +-
camel/camel-offline-folder.h | 24 +-
camel/camel-offline-journal.c | 34 +-
camel/camel-offline-journal.h | 26 +-
camel/camel-offline-store.c | 31 +-
camel/camel-offline-store.h | 26 +-
camel/camel-partition-table.c | 481 +-
camel/camel-partition-table.h | 41 +-
camel/camel-provider.h | 7 +-
camel/camel-sasl-anonymous.c | 35 +-
camel/camel-sasl-anonymous.h | 24 +-
camel/camel-sasl-cram-md5.c | 27 +-
camel/camel-sasl-cram-md5.h | 24 +-
camel/camel-sasl-digest-md5.c | 40 +-
camel/camel-sasl-digest-md5.h | 24 +-
camel/camel-sasl-gssapi.c | 43 +-
camel/camel-sasl-gssapi.h | 24 +-
camel/camel-sasl-login.c | 41 +-
camel/camel-sasl-login.h | 24 +-
camel/camel-sasl-ntlm.c | 25 +-
camel/camel-sasl-ntlm.h | 24 +-
camel/camel-sasl-plain.c | 27 +-
camel/camel-sasl-plain.h | 24 +-
camel/camel-sasl-popb4smtp.c | 29 +-
camel/camel-sasl-popb4smtp.h | 24 +-
camel/camel-sasl.c | 213 +-
camel/camel-sasl.h | 24 +-
camel/camel-search-private.c | 4 +-
camel/camel-seekable-stream.c | 23 +-
camel/camel-seekable-stream.h | 24 +-
camel/camel-seekable-substream.c | 43 +-
camel/camel-seekable-substream.h | 24 +-
camel/camel-service.c | 94 +-
camel/camel-service.h | 31 +-
camel/camel-session.c | 103 +-
camel/camel-session.h | 33 +-
camel/camel-smime-context.c | 87 +-
camel/camel-smime-context.h | 24 +-
camel/camel-store-summary.c | 112 +-
camel/camel-store-summary.h | 25 +-
camel/camel-store.c | 133 +-
camel/camel-store.h | 33 +-
camel/camel-stream-buffer.c | 85 +-
camel/camel-stream-buffer.h | 24 +-
camel/camel-stream-filter.c | 74 +-
camel/camel-stream-filter.h | 25 +-
camel/camel-stream-fs.c | 55 +-
camel/camel-stream-fs.h | 24 +-
camel/camel-stream-mem.c | 54 +-
camel/camel-stream-mem.h | 24 +-
camel/camel-stream-null.c | 25 +-
camel/camel-stream-null.h | 23 +-
camel/camel-stream-process.c | 32 +-
camel/camel-stream-process.h | 23 +-
camel/camel-stream-vfs.c | 40 +-
camel/camel-stream-vfs.h | 25 +-
camel/camel-stream.c | 30 +-
camel/camel-stream.h | 24 +-
camel/camel-tcp-stream-raw.c | 35 +-
camel/camel-tcp-stream-raw.h | 24 +-
camel/camel-tcp-stream-ssl.c | 74 +-
camel/camel-tcp-stream-ssl.h | 24 +-
camel/camel-tcp-stream.c | 22 +-
camel/camel-tcp-stream.h | 24 +-
camel/camel-text-index.c | 466 +-
camel/camel-text-index.h | 83 +-
camel/camel-transport.c | 77 +-
camel/camel-transport.h | 54 +-
camel/camel-vee-folder.c | 147 +-
camel/camel-vee-folder.h | 25 +-
camel/camel-vee-store.c | 47 +-
camel/camel-vee-store.h | 23 +-
camel/camel-vee-summary.c | 36 +-
camel/camel-vee-summary.h | 23 +-
camel/camel-vtrash-folder.c | 31 +-
camel/camel-vtrash-folder.h | 23 +-
camel/camel.c | 5 +-
camel/camel.h | 1 +
camel/providers/groupwise/camel-groupwise-folder.c | 104 +-
camel/providers/groupwise/camel-groupwise-folder.h | 24 +-
.../providers/groupwise/camel-groupwise-journal.c | 39 +-
.../providers/groupwise/camel-groupwise-journal.h | 26 +-
.../groupwise/camel-groupwise-store-summary.c | 25 +-
.../groupwise/camel-groupwise-store-summary.h | 23 +-
camel/providers/groupwise/camel-groupwise-store.c | 93 +-
camel/providers/groupwise/camel-groupwise-store.h | 24 +-
.../providers/groupwise/camel-groupwise-summary.c | 25 +-
.../providers/groupwise/camel-groupwise-summary.h | 23 +-
.../groupwise/camel-groupwise-transport.c | 24 +-
.../groupwise/camel-groupwise-transport.h | 24 +-
camel/providers/groupwise/camel-groupwise-utils.c | 18 +-
camel/providers/imap/camel-imap-command.c | 10 +-
camel/providers/imap/camel-imap-folder.c | 151 +-
camel/providers/imap/camel-imap-folder.h | 25 +-
camel/providers/imap/camel-imap-journal.c | 38 +-
camel/providers/imap/camel-imap-journal.h | 26 +-
camel/providers/imap/camel-imap-message-cache.c | 58 +-
camel/providers/imap/camel-imap-message-cache.h | 24 +-
camel/providers/imap/camel-imap-search.c | 62 +-
camel/providers/imap/camel-imap-search.h | 24 +-
camel/providers/imap/camel-imap-store-summary.c | 25 +-
camel/providers/imap/camel-imap-store-summary.h | 29 +-
camel/providers/imap/camel-imap-store.c | 122 +-
camel/providers/imap/camel-imap-store.h | 25 +-
camel/providers/imap/camel-imap-summary.c | 25 +-
camel/providers/imap/camel-imap-summary.h | 23 +-
camel/providers/imap/camel-imap-wrapper.c | 76 +-
camel/providers/imap/camel-imap-wrapper.h | 24 +-
camel/providers/imapx/camel-imapx-folder.c | 119 +-
camel/providers/imapx/camel-imapx-folder.h | 58 +-
camel/providers/imapx/camel-imapx-server.c | 157 +-
camel/providers/imapx/camel-imapx-server.h | 142 +-
camel/providers/imapx/camel-imapx-store-summary.c | 100 +-
camel/providers/imapx/camel-imapx-store-summary.h | 92 +-
camel/providers/imapx/camel-imapx-store.c | 159 +-
camel/providers/imapx/camel-imapx-store.h | 51 +-
camel/providers/imapx/camel-imapx-stream.c | 131 +-
camel/providers/imapx/camel-imapx-stream.h | 90 +-
camel/providers/imapx/camel-imapx-summary.c | 161 +-
camel/providers/imapx/camel-imapx-summary.h | 72 +-
camel/providers/imapx/camel-imapx-utils.c | 8 +-
camel/providers/imapx/camel-imapx-view-summary.h | 36 +-
camel/providers/imapx/test-imapx.c | 2 +-
camel/providers/local/camel-local-folder.c | 80 +-
camel/providers/local/camel-local-folder.h | 25 +-
camel/providers/local/camel-local-provider.c | 2 +-
camel/providers/local/camel-local-store.c | 38 +-
camel/providers/local/camel-local-store.h | 24 +-
camel/providers/local/camel-local-summary.c | 56 +-
camel/providers/local/camel-local-summary.h | 23 +-
camel/providers/local/camel-maildir-folder.c | 34 +-
camel/providers/local/camel-maildir-folder.h | 24 +-
camel/providers/local/camel-maildir-store.c | 27 +-
camel/providers/local/camel-maildir-store.h | 24 +-
camel/providers/local/camel-maildir-summary.c | 51 +-
camel/providers/local/camel-maildir-summary.h | 23 +-
camel/providers/local/camel-mbox-folder.c | 42 +-
camel/providers/local/camel-mbox-folder.h | 24 +-
camel/providers/local/camel-mbox-store.c | 35 +-
camel/providers/local/camel-mbox-store.h | 24 +-
camel/providers/local/camel-mbox-summary.c | 34 +-
camel/providers/local/camel-mbox-summary.h | 23 +-
camel/providers/local/camel-mh-folder.c | 34 +-
camel/providers/local/camel-mh-folder.h | 23 +-
camel/providers/local/camel-mh-store.c | 39 +-
camel/providers/local/camel-mh-store.h | 24 +-
camel/providers/local/camel-mh-summary.c | 38 +-
camel/providers/local/camel-mh-summary.h | 23 +-
camel/providers/local/camel-spool-folder.c | 26 +-
camel/providers/local/camel-spool-folder.h | 24 +-
camel/providers/local/camel-spool-store.c | 27 +-
camel/providers/local/camel-spool-store.h | 24 +-
camel/providers/local/camel-spool-summary.c | 24 +-
camel/providers/local/camel-spool-summary.h | 23 +-
camel/providers/nntp/camel-nntp-folder.c | 75 +-
camel/providers/nntp/camel-nntp-folder.h | 24 +-
camel/providers/nntp/camel-nntp-store-summary.c | 25 +-
camel/providers/nntp/camel-nntp-store-summary.h | 23 +-
camel/providers/nntp/camel-nntp-store.c | 119 +-
camel/providers/nntp/camel-nntp-store.h | 24 +-
camel/providers/nntp/camel-nntp-stream.c | 72 +-
camel/providers/nntp/camel-nntp-stream.h | 23 +-
camel/providers/nntp/camel-nntp-summary.c | 38 +-
camel/providers/nntp/camel-nntp-summary.h | 23 +-
camel/providers/pop3/camel-pop3-engine.c | 55 +-
camel/providers/pop3/camel-pop3-engine.h | 23 +-
camel/providers/pop3/camel-pop3-folder.c | 52 +-
camel/providers/pop3/camel-pop3-folder.h | 24 +-
camel/providers/pop3/camel-pop3-store.c | 54 +-
camel/providers/pop3/camel-pop3-store.h | 24 +-
camel/providers/pop3/camel-pop3-stream.c | 63 +-
camel/providers/pop3/camel-pop3-stream.h | 23 +-
.../providers/sendmail/camel-sendmail-transport.c | 28 +-
.../providers/sendmail/camel-sendmail-transport.h | 24 +-
camel/providers/smtp/camel-smtp-transport.c | 54 +-
camel/providers/smtp/camel-smtp-transport.h | 24 +-
camel/tests/folder/test1.c | 4 +-
camel/tests/folder/test10.c | 15 +-
camel/tests/folder/test11.c | 3 +-
camel/tests/folder/test2.c | 2 +-
camel/tests/folder/test3.c | 4 +-
camel/tests/folder/test4.c | 4 +-
camel/tests/folder/test5.c | 4 +-
camel/tests/folder/test6.c | 2 +-
camel/tests/folder/test7.c | 2 +-
camel/tests/folder/test8.c | 6 +-
camel/tests/folder/test9.c | 16 +-
camel/tests/lib/camel-test-provider.c | 5 +-
camel/tests/lib/camel-test-provider.h | 2 +-
camel/tests/lib/camel-test.h | 6 +-
camel/tests/lib/folders.c | 2 +-
camel/tests/lib/folders.h | 2 +
camel/tests/lib/messages.c | 24 +-
camel/tests/lib/session.c | 28 +-
camel/tests/lib/session.h | 41 +-
camel/tests/lib/streams.c | 2 +-
camel/tests/message/test3.c | 16 +-
camel/tests/message/test4.c | 6 +-
camel/tests/mime-filter/test-charset.c | 10 +-
camel/tests/mime-filter/test-crlf.c | 8 +-
camel/tests/mime-filter/test-tohtml.c | 6 +-
camel/tests/mime-filter/test1.c | 8 +-
camel/tests/misc/split.c | 9 +-
camel/tests/misc/test1.c | 4 +-
camel/tests/misc/test2.c | 8 +-
camel/tests/misc/url-scan.c | 2 +-
camel/tests/misc/url.c | 4 +-
camel/tests/misc/utf7.c | 3 +-
camel/tests/smime/pgp-mime.c | 37 +-
camel/tests/smime/pgp.c | 70 +-
camel/tests/smime/pkcs7.c | 31 +-
camel/tests/stream/test1.c | 3 +-
camel/tests/stream/test2.c | 9 +-
camel/tests/stream/test3.c | 3 +-
docs/reference/camel/Makefile.am | 21 +-
docs/reference/camel/camel-sections.txt | 1931 ++-----
docs/reference/camel/camel.types | 90 +
docs/reference/camel/tmpl/camel-address.sgml | 3 -
docs/reference/camel/tmpl/camel-block-file.sgml | 19 -
docs/reference/camel/tmpl/camel-certdb.sgml | 10 -
.../reference/camel/tmpl/camel-cipher-context.sgml | 39 +-
docs/reference/camel/tmpl/camel-data-cache.sgml | 7 +-
docs/reference/camel/tmpl/camel-data-wrapper.sgml | 6 -
docs/reference/camel/tmpl/camel-disco-diary.sgml | 5 -
docs/reference/camel/tmpl/camel-disco-folder.sgml | 2 -
docs/reference/camel/tmpl/camel-disco-store.sgml | 3 -
docs/reference/camel/tmpl/camel-filter-driver.sgml | 2 -
docs/reference/camel/tmpl/camel-folder-search.sgml | 10 -
.../reference/camel/tmpl/camel-folder-summary.sgml | 25 -
docs/reference/camel/tmpl/camel-folder.sgml | 10 -
docs/reference/camel/tmpl/camel-gpg-context.sgml | 7 +-
docs/reference/camel/tmpl/camel-html-parser.sgml | 2 -
docs/reference/camel/tmpl/camel-http-stream.sgml | 14 -
docs/reference/camel/tmpl/camel-imap-store.sgml | 12 +
docs/reference/camel/tmpl/camel-index.sgml | 17 -
.../camel/tmpl/camel-internet-address.sgml | 2 -
docs/reference/camel/tmpl/camel-medium.sgml | 25 +-
.../camel/tmpl/camel-mime-filter-basic.sgml | 2 -
.../camel/tmpl/camel-mime-filter-bestenc.sgml | 2 -
.../camel/tmpl/camel-mime-filter-canon.sgml | 2 -
.../camel/tmpl/camel-mime-filter-charset.sgml | 2 -
.../camel/tmpl/camel-mime-filter-crlf.sgml | 2 -
.../camel/tmpl/camel-mime-filter-enriched.sgml | 2 -
.../camel/tmpl/camel-mime-filter-from.sgml | 2 -
.../camel/tmpl/camel-mime-filter-gzip.sgml | 2 -
.../camel/tmpl/camel-mime-filter-html.sgml | 2 -
.../camel/tmpl/camel-mime-filter-index.sgml | 2 -
.../camel/tmpl/camel-mime-filter-linewrap.sgml | 2 -
.../camel/tmpl/camel-mime-filter-pgp.sgml | 2 -
.../camel/tmpl/camel-mime-filter-progress.sgml | 2 -
.../camel/tmpl/camel-mime-filter-save.sgml | 2 -
.../camel/tmpl/camel-mime-filter-tohtml.sgml | 2 -
.../camel/tmpl/camel-mime-filter-windows.sgml | 2 -
.../camel/tmpl/camel-mime-filter-yenc.sgml | 2 -
docs/reference/camel/tmpl/camel-mime-filter.sgml | 10 -
docs/reference/camel/tmpl/camel-mime-message.sgml | 10 -
docs/reference/camel/tmpl/camel-mime-parser.sgml | 2 -
docs/reference/camel/tmpl/camel-mime-part.sgml | 41 +-
.../camel/tmpl/camel-multipart-encrypted.sgml | 5 -
.../camel/tmpl/camel-multipart-signed.sgml | 10 -
docs/reference/camel/tmpl/camel-multipart.sgml | 4 -
docs/reference/camel/tmpl/camel-nntp-address.sgml | 2 -
docs/reference/camel/tmpl/camel-object.sgml | 261 +-
.../reference/camel/tmpl/camel-offline-folder.sgml | 2 -
.../camel/tmpl/camel-offline-journal.sgml | 4 -
docs/reference/camel/tmpl/camel-offline-store.sgml | 2 -
.../camel/tmpl/camel-partition-table.sgml | 13 -
.../reference/camel/tmpl/camel-sasl-anonymous.sgml | 3 -
docs/reference/camel/tmpl/camel-sasl-cram-md5.sgml | 2 -
.../camel/tmpl/camel-sasl-digest-md5.sgml | 2 -
docs/reference/camel/tmpl/camel-sasl-gssapi.sgml | 2 -
docs/reference/camel/tmpl/camel-sasl-login.sgml | 2 -
docs/reference/camel/tmpl/camel-sasl-ntlm.sgml | 2 -
docs/reference/camel/tmpl/camel-sasl-plain.sgml | 2 -
.../reference/camel/tmpl/camel-sasl-popb4smtp.sgml | 2 -
docs/reference/camel/tmpl/camel-sasl.sgml | 22 +-
.../camel/tmpl/camel-seekable-stream.sgml | 4 -
.../camel/tmpl/camel-seekable-substream.sgml | 2 -
docs/reference/camel/tmpl/camel-service.sgml | 7 -
docs/reference/camel/tmpl/camel-session.sgml | 7 -
docs/reference/camel/tmpl/camel-smime-context.sgml | 2 -
docs/reference/camel/tmpl/camel-store-summary.sgml | 12 -
docs/reference/camel/tmpl/camel-store.sgml | 8 -
docs/reference/camel/tmpl/camel-stream-buffer.sgml | 2 -
docs/reference/camel/tmpl/camel-stream-filter.sgml | 2 -
docs/reference/camel/tmpl/camel-stream-fs.sgml | 2 -
docs/reference/camel/tmpl/camel-stream-mem.sgml | 2 -
docs/reference/camel/tmpl/camel-stream-null.sgml | 2 -
.../reference/camel/tmpl/camel-stream-process.sgml | 3 -
docs/reference/camel/tmpl/camel-stream-vfs.sgml | 2 -
docs/reference/camel/tmpl/camel-stream.sgml | 2 -
.../reference/camel/tmpl/camel-tcp-stream-raw.sgml | 3 -
docs/reference/camel/tmpl/camel-tcp-stream.sgml | 1 -
docs/reference/camel/tmpl/camel-text-index.sgml | 8 -
docs/reference/camel/tmpl/camel-transport.sgml | 2 -
docs/reference/camel/tmpl/camel-unused.sgml | 5668 +++++++++++++++++++-
docs/reference/camel/tmpl/camel-vee-folder.sgml | 10 -
docs/reference/camel/tmpl/camel-vee-store.sgml | 3 -
docs/reference/camel/tmpl/camel-vee-summary.sgml | 3 -
docs/reference/camel/tmpl/camel-vtrash-folder.sgml | 3 -
399 files changed, 15327 insertions(+), 10163 deletions(-)
---
diff --git a/addressbook/libebook/e-destination.c b/addressbook/libebook/e-destination.c
index a3fdc25..d4b7421 100644
--- a/addressbook/libebook/e-destination.c
+++ b/addressbook/libebook/e-destination.c
@@ -751,7 +751,7 @@ e_destination_get_name (const EDestination *dest)
priv->name = g_strdup (camel_name);
}
- camel_object_unref (CAMEL_OBJECT (addr));
+ g_object_unref (addr);
}
}
@@ -826,7 +826,7 @@ e_destination_get_email (const EDestination *dest)
priv->email = g_strdup (camel_email);
}
- camel_object_unref (CAMEL_OBJECT (addr));
+ g_object_unref (addr);
}
/* Force e-mail to be non-null... */
@@ -903,7 +903,7 @@ e_destination_get_address (const EDestination *dest)
priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
}
- camel_object_unref (CAMEL_OBJECT (addr));
+ g_object_unref (addr);
}
return priv->addr;
@@ -965,7 +965,7 @@ e_destination_get_textrep (const EDestination *dest, gboolean include_email)
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));
+ g_object_unref (addr);
}
if (dest->priv->textrep != NULL)
diff --git a/camel/Makefile.am b/camel/Makefile.am
index a885174..b19f81c 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -209,6 +209,7 @@ libcamel_1_2_la_SOURCES = \
camel-net-utils.c \
camel-nntp-address.c \
camel-object.c \
+ camel-object-bag.c \
camel-operation.c \
camel-partition-table.c \
camel-seekable-stream.c \
@@ -281,6 +282,7 @@ libcamelinclude_HEADERS = \
camel-net-utils.h \
camel-nntp-address.h \
camel-object.h \
+ camel-object-bag.h \
camel-operation.h \
camel-partition-table.h \
camel-search-private.h \
diff --git a/camel/camel-address.c b/camel/camel-address.c
index 4edc0d7..03008ee 100644
--- a/camel/camel-address.c
+++ b/camel/camel-address.c
@@ -20,21 +20,27 @@
#include "camel-address.h"
-static CamelObjectClass *camel_address_parent;
+G_DEFINE_TYPE (CamelAddress, camel_address, CAMEL_TYPE_OBJECT)
static void
-camel_address_finalize (CamelObject *object)
+address_finalize (GObject *object)
{
CamelAddress *address = CAMEL_ADDRESS (object);
camel_address_remove (address, -1);
g_ptr_array_free (address->addresses, TRUE);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_address_parent_class)->finalize (object);
}
static void
-camel_address_class_init (CamelAddressClass *klass)
+camel_address_class_init (CamelAddressClass *class)
{
- camel_address_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = address_finalize;
}
static void
@@ -43,24 +49,6 @@ camel_address_init (CamelAddress *address)
address->addresses = g_ptr_array_new();
}
-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),
- sizeof (CamelAddressClass),
- (CamelObjectClassInitFunc) camel_address_class_init,
- NULL,
- (CamelObjectInitFunc) camel_address_init,
- (CamelObjectFinalizeFunc) camel_address_finalize);
- }
-
- return type;
-}
-
/**
* camel_address_new:
*
@@ -71,8 +59,7 @@ camel_address_get_type (void)
CamelAddress *
camel_address_new (void)
{
- CamelAddress *new = CAMEL_ADDRESS(camel_object_new(camel_address_get_type()));
- return new;
+ return g_object_new (CAMEL_TYPE_ADDRESS, NULL);
}
/**
@@ -88,7 +75,7 @@ camel_address_new_clone (CamelAddress *addr)
{
CamelAddress *new;
- new = CAMEL_ADDRESS (camel_object_new (CAMEL_OBJECT_GET_TYPE (addr)));
+ new = g_object_new (CAMEL_TYPE_ADDRESS, NULL);
camel_address_cat (new, addr);
return new;
@@ -124,7 +111,7 @@ camel_address_decode (CamelAddress *addr, const gchar *raw)
g_return_val_if_fail (CAMEL_IS_ADDRESS (addr), -1);
- class = CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (addr));
+ class = CAMEL_ADDRESS_GET_CLASS (addr);
g_return_val_if_fail (class->decode != NULL, -1);
return class->decode (addr, raw);
@@ -145,7 +132,7 @@ camel_address_encode (CamelAddress *addr)
g_return_val_if_fail (CAMEL_IS_ADDRESS (addr), NULL);
- class = CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (addr));
+ class = CAMEL_ADDRESS_GET_CLASS (addr);
g_return_val_if_fail (class->encode != NULL, NULL);
return class->encode (addr);
@@ -168,7 +155,7 @@ camel_address_unformat(CamelAddress *addr, const gchar *raw)
g_return_val_if_fail (CAMEL_IS_ADDRESS (addr), -1);
- class = CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (addr));
+ class = CAMEL_ADDRESS_GET_CLASS (addr);
g_return_val_if_fail (class->unformat != NULL, -1);
return class->unformat (addr, raw);
@@ -189,7 +176,7 @@ camel_address_format (CamelAddress *addr)
g_return_val_if_fail (CAMEL_IS_ADDRESS (addr), NULL);
- class = CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (addr));
+ class = CAMEL_ADDRESS_GET_CLASS (addr);
g_return_val_if_fail (class->format != NULL, NULL);
return class->format (addr);
@@ -213,7 +200,7 @@ camel_address_cat (CamelAddress *dest, CamelAddress *source)
g_return_val_if_fail (CAMEL_IS_ADDRESS (dest), -1);
g_return_val_if_fail (CAMEL_IS_ADDRESS (source), -1);
- class = CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (dest));
+ class = CAMEL_ADDRESS_GET_CLASS (dest);
g_return_val_if_fail (class->cat != NULL, -1);
return class->cat (dest, source);
@@ -252,7 +239,7 @@ camel_address_remove (CamelAddress *addr, gint index)
g_return_if_fail (CAMEL_IS_ADDRESS (addr));
- class = CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (addr));
+ class = CAMEL_ADDRESS_GET_CLASS (addr);
g_return_if_fail (class->remove != NULL);
if (index == -1) {
diff --git a/camel/camel-address.h b/camel/camel-address.h
index f628926..cf9ed02 100644
--- a/camel/camel-address.h
+++ b/camel/camel-address.h
@@ -28,9 +28,24 @@
#include <camel/camel-object.h>
-#define CAMEL_ADDRESS(obj) CAMEL_CHECK_CAST (obj, camel_address_get_type (), CamelAddress)
-#define CAMEL_ADDRESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_address_get_type (), CamelAddressClass)
-#define CAMEL_IS_ADDRESS(obj) CAMEL_CHECK_TYPE (obj, camel_address_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_ADDRESS \
+ (camel_address_get_type ())
+#define CAMEL_ADDRESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_ADDRESS, CamelAddress))
+#define CAMEL_ADDRESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_ADDRESS, CamelAddressClass))
+#define CAMEL_IS_ADDRESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_ADDRESS))
+#define CAMEL_IS_ADDRESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_ADDRESS))
+#define CAMEL_ADDRESS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_ADDRESS, CamelAddressClass))
G_BEGIN_DECLS
@@ -61,7 +76,7 @@ struct _CamelAddressClass {
gint index);
};
-CamelType camel_address_get_type (void);
+GType camel_address_get_type (void);
CamelAddress * camel_address_new (void);
CamelAddress * camel_address_new_clone (CamelAddress *addr);
gint camel_address_length (CamelAddress *addr);
diff --git a/camel/camel-block-file.c b/camel/camel-block-file.c
index 0613e3f..4bbf928 100644
--- a/camel/camel-block-file.c
+++ b/camel/camel-block-file.c
@@ -31,7 +31,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <glib.h>
#include <glib/gstdio.h>
#include "camel-block-file.h"
@@ -72,12 +71,11 @@ static CamelDList block_file_active_list = CAMEL_DLIST_INITIALISER(block_file_ac
static gint block_file_count = 0;
static gint block_file_threshhold = 10;
-#define CAMEL_BLOCK_FILE_GET_CLASS(obj) \
- ((CamelBlockFileClass *) CAMEL_OBJECT_GET_CLASS (obj))
-
static gint sync_nolock(CamelBlockFile *bs);
static gint sync_block_nolock(CamelBlockFile *bs, CamelBlock *bl);
+G_DEFINE_TYPE (CamelBlockFile, camel_block_file, CAMEL_TYPE_OBJECT)
+
static gint
block_file_validate_root(CamelBlockFile *bs)
{
@@ -143,8 +141,9 @@ block_file_init_root(CamelBlockFile *bs)
}
static void
-camel_block_file_finalize(CamelBlockFile *bs)
+block_file_finalize(GObject *object)
{
+ CamelBlockFile *bs = CAMEL_BLOCK_FILE (object);
CamelBlock *bl, *bn;
struct _CamelBlockFilePrivate *p;
@@ -183,11 +182,19 @@ camel_block_file_finalize(CamelBlockFile *bs)
g_static_mutex_free (&p->root_lock);
g_free(p);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_block_file_parent_class)->finalize (object);
}
static void
camel_block_file_class_init(CamelBlockFileClass *class)
{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = block_file_finalize;
+
class->validate_root = block_file_validate_root;
class->init_root = block_file_init_root;
}
@@ -237,24 +244,6 @@ camel_block_file_init(CamelBlockFile *bs)
UNLOCK(block_file_lock);
}
-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),
- sizeof (CamelBlockFileClass),
- (CamelObjectClassInitFunc) camel_block_file_class_init,
- NULL,
- (CamelObjectInitFunc) camel_block_file_init,
- (CamelObjectFinalizeFunc) camel_block_file_finalize);
- }
-
- return type;
-}
-
/* 'use' a block file for io */
static gint
block_file_use(CamelBlockFile *bs)
@@ -370,14 +359,14 @@ camel_block_file_new (const gchar *path,
CamelBlockFileClass *class;
CamelBlockFile *bs;
- bs = (CamelBlockFile *)camel_object_new(camel_block_file_get_type());
+ bs = g_object_new (CAMEL_TYPE_BLOCK_FILE, NULL);
memcpy(bs->version, version, 8);
bs->path = g_strdup(path);
bs->flags = flags;
- bs->root_block = camel_block_file_get_block(bs, 0);
+ bs->root_block = camel_block_file_get_block (bs, 0);
if (bs->root_block == NULL) {
- camel_object_unref (bs);
+ g_object_unref (bs);
return NULL;
}
camel_block_file_detach_block(bs, bs->root_block);
@@ -395,13 +384,13 @@ camel_block_file_new (const gchar *path,
class->init_root(bs);
camel_block_file_touch_block(bs, bs->root_block);
if (block_file_use(bs) == -1) {
- camel_object_unref (bs);
+ g_object_unref (bs);
return NULL;
}
if (sync_block_nolock(bs, bs->root_block) == -1
|| ftruncate(bs->fd, bs->root->last) == -1) {
block_file_unuse(bs);
- camel_object_unref (bs);
+ g_object_unref (bs);
return NULL;
}
block_file_unuse(bs);
@@ -474,7 +463,8 @@ camel_block_file_delete(CamelBlockFile *bs)
*
* Returns: The block, or NULL if an error occured.
**/
-CamelBlock *camel_block_file_new_block(CamelBlockFile *bs)
+CamelBlock *
+camel_block_file_new_block (CamelBlockFile *bs)
{
CamelBlock *bl;
@@ -826,9 +816,12 @@ static CamelDList key_file_active_list = CAMEL_DLIST_INITIALISER(key_file_active
static gint key_file_count = 0;
static const gint key_file_threshhold = 10;
+G_DEFINE_TYPE (CamelKeyFile, camel_key_file, CAMEL_TYPE_OBJECT)
+
static void
-camel_key_file_finalize(CamelKeyFile *bs)
+key_file_finalize(GObject *object)
{
+ CamelKeyFile *bs = CAMEL_KEY_FILE (object);
struct _CamelKeyFilePrivate *p = bs->priv;
LOCK(key_file_lock);
@@ -846,11 +839,18 @@ camel_key_file_finalize(CamelKeyFile *bs)
g_static_mutex_free (&p->lock);
g_free(p);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_key_file_parent_class)->finalize (object);
}
static void
camel_key_file_class_init(CamelKeyFileClass *class)
{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = key_file_finalize;
}
static void
@@ -868,24 +868,6 @@ camel_key_file_init(CamelKeyFile *bs)
UNLOCK(key_file_lock);
}
-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),
- sizeof (CamelKeyFileClass),
- (CamelObjectClassInitFunc) camel_key_file_class_init,
- NULL,
- (CamelObjectInitFunc) camel_key_file_init,
- (CamelObjectFinalizeFunc) camel_key_file_finalize);
- }
-
- return type;
-}
-
/* 'use' a key file for io */
static gint
key_file_use(CamelKeyFile *bs)
@@ -996,14 +978,14 @@ camel_key_file_new(const gchar *path, gint flags, const gchar version[8])
d(printf("New key file '%s'\n", path));
- kf = (CamelKeyFile *)camel_object_new(camel_key_file_get_type());
+ kf = g_object_new (CAMEL_TYPE_KEY_FILE, NULL);
kf->path = g_strdup(path);
kf->fp = NULL;
kf->flags = flags;
kf->last = 8;
if (key_file_use(kf) == -1) {
- camel_object_unref (kf);
+ g_object_unref (kf);
kf = NULL;
} else {
fseek(kf->fp, 0, SEEK_END);
@@ -1021,7 +1003,7 @@ camel_key_file_new(const gchar *path, gint flags, const gchar version[8])
kf->flags &= ~(O_CREAT|O_EXCL|O_TRUNC);
if (err) {
- camel_object_unref (kf);
+ g_object_unref (kf);
kf = NULL;
}
}
diff --git a/camel/camel-block-file.h b/camel/camel-block-file.h
index 0fa3e1e..4a9e2da 100644
--- a/camel/camel-block-file.h
+++ b/camel/camel-block-file.h
@@ -30,6 +30,43 @@
#include <stdio.h>
#include <sys/types.h>
+/* Standard GObject macros */
+#define CAMEL_TYPE_BLOCK_FILE \
+ (camel_block_file_get_type ())
+#define CAMEL_BLOCK_FILE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_BLOCK_FILE, CamelBlockFile))
+#define CAMEL_BLOCK_FILE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_BLOCK_FILE, CamelBlockFileClass))
+#define CAMEL_IS_BLOCK_FILE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_BLOCK_FILE))
+#define CAMEL_IS_BLOCK_FILE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_BLOCK_FILE))
+#define CAMEL_BLOCK_FILE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_BLOCK_FILE, CamelBlockFileClass))
+
+#define CAMEL_TYPE_KEY_FILE \
+ (camel_key_file_get_type ())
+#define CAMEL_KEY_FILE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_KEY_FILE, CamelKeyFile))
+#define CAMEL_KEY_FILE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_KEY_FILE, CamelKeyFileClass))
+#define CAMEL_IS_KEY_FILE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_KEY_FILE))
+#define CAMEL_IS_KEY_FILE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_KEY_FILE))
+#define CAMEL_KEY_FILE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_KEY_FILE, CamelKeyFileClass))
+
G_BEGIN_DECLS
typedef guint32 camel_block_t; /* block offset, absolute, bottom BLOCK_SIZE_BITS always 0 */
@@ -101,7 +138,7 @@ struct _CamelBlockFileClass {
gint (*init_root)(CamelBlockFile *);
};
-CamelType camel_block_file_get_type (void);
+GType camel_block_file_get_type (void);
CamelBlockFile *camel_block_file_new (const gchar *path,
gint flags,
const gchar version[8],
@@ -146,7 +183,7 @@ struct _CamelKeyFileClass {
CamelObjectClass parent;
};
-CamelType camel_key_file_get_type(void);
+GType camel_key_file_get_type(void);
CamelKeyFile * camel_key_file_new(const gchar *path, gint flags, const gchar version[8]);
gint camel_key_file_rename(CamelKeyFile *kf, const gchar *path);
diff --git a/camel/camel-certdb.c b/camel/camel-certdb.c
index 6658190..68119ea 100644
--- a/camel/camel-certdb.c
+++ b/camel/camel-certdb.c
@@ -42,6 +42,10 @@
#define CAMEL_CERTDB_VERSION 0x100
+#define CAMEL_CERTDB_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_CERTDB, CamelCertDBPrivate))
+
struct _CamelCertDBPrivate {
GMutex *db_lock; /* for the db hashtable/array */
GMutex *io_lock; /* load/save lock, for access to saved_count, etc */
@@ -59,15 +63,15 @@ static void certdb_cert_free (CamelCertDB *certdb, CamelCert *cert);
static const gchar *cert_get_string (CamelCertDB *certdb, CamelCert *cert, gint string);
static void cert_set_string (CamelCertDB *certdb, CamelCert *cert, gint string, const gchar *value);
-static CamelObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelCertDB, camel_certdb, CAMEL_TYPE_OBJECT)
static void
-certdb_finalize (CamelObject *object)
+certdb_finalize (GObject *object)
{
CamelCertDB *certdb = CAMEL_CERTDB (object);
CamelCertDBPrivate *priv;
- priv = certdb->priv;
+ priv = CAMEL_CERTDB_GET_PRIVATE (object);
if (certdb->flags & CAMEL_CERTDB_DIRTY)
camel_certdb_save (certdb);
@@ -86,13 +90,19 @@ certdb_finalize (CamelObject *object)
g_mutex_free (priv->alloc_lock);
g_mutex_free (priv->ref_lock);
- g_free (priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_certdb_parent_class)->finalize (object);
}
static void
camel_certdb_class_init (CamelCertDBClass *class)
{
- parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelCertDBPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = certdb_finalize;
class->header_load = certdb_header_load;
class->header_save = certdb_header_save;
@@ -108,7 +118,7 @@ camel_certdb_class_init (CamelCertDBClass *class)
static void
camel_certdb_init (CamelCertDB *certdb)
{
- certdb->priv = g_malloc (sizeof (CamelCertDBPrivate));
+ certdb->priv = CAMEL_CERTDB_GET_PRIVATE (certdb);
certdb->filename = NULL;
certdb->version = CAMEL_CERTDB_VERSION;
@@ -127,29 +137,10 @@ camel_certdb_init (CamelCertDB *certdb)
certdb->priv->ref_lock = g_mutex_new ();
}
-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",
- sizeof (CamelCertDB),
- sizeof (CamelCertDBClass),
- (CamelObjectClassInitFunc) camel_certdb_class_init,
- NULL,
- (CamelObjectInitFunc) camel_certdb_init,
- (CamelObjectFinalizeFunc) certdb_finalize);
- }
-
- return type;
-}
-
CamelCertDB *
camel_certdb_new (void)
{
- return (CamelCertDB *) camel_object_new (camel_certdb_get_type ());
+ return g_object_new (CAMEL_TYPE_CERTDB, NULL);
}
static CamelCertDB *default_certdb = NULL;
@@ -161,10 +152,10 @@ camel_certdb_set_default (CamelCertDB *certdb)
g_static_mutex_lock (&default_certdb_lock);
if (default_certdb)
- camel_object_unref (default_certdb);
+ g_object_unref (default_certdb);
if (certdb)
- camel_object_ref (certdb);
+ g_object_ref (certdb);
default_certdb = certdb;
@@ -179,7 +170,7 @@ camel_certdb_get_default (void)
g_static_mutex_lock (&default_certdb_lock);
if (default_certdb)
- camel_object_ref (default_certdb);
+ g_object_ref (default_certdb);
certdb = default_certdb;
@@ -693,7 +684,7 @@ camel_cert_set_trust (CamelCertDB *certdb, CamelCert *cert, CamelCertTrust trust
*
* Locks #certdb's #lock. Unlock it with camel_certdb_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
camel_certdb_lock (CamelCertDB *certdb, CamelCertDBLock lock)
@@ -727,7 +718,7 @@ camel_certdb_lock (CamelCertDB *certdb, CamelCertDBLock lock)
*
* Unlocks #certdb's #lock, previously locked with camel_certdb_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
camel_certdb_unlock (CamelCertDB *certdb, CamelCertDBLock lock)
diff --git a/camel/camel-certdb.h b/camel/camel-certdb.h
index 90e711f..2f578d0 100644
--- a/camel/camel-certdb.h
+++ b/camel/camel-certdb.h
@@ -30,12 +30,24 @@
#include <stdio.h>
#include <camel/camel-object.h>
-#define CAMEL_CERTDB_TYPE (camel_certdb_get_type ())
-#define CAMEL_CERTDB(obj) (CAMEL_CHECK_CAST (obj, camel_certdb_get_type (), CamelCertDB))
-#define CAMEL_CERTDB_CLASS(klass) (CAMEL_CHECK_CLASS_CAST (klass, camel_certdb_get_type (), CamelCertDBClass))
-#define CAMEL_IS_CERTDB(obj) (CAMEL_CHECK_TYPE (obj, camel_certdb_get_type ()))
+/* Standard GObject macros */
+#define CAMEL_TYPE_CERTDB \
+ (camel_certdb_get_type ())
+#define CAMEL_CERTDB(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_CERTDB, CamelCertDB))
+#define CAMEL_CERTDB_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_CERTDB, CamelCertDBClass))
+#define CAMEL_IS_CERTDB(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_CERTDB))
+#define CAMEL_IS_CERTDB_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_CERTDB))
#define CAMEL_CERTDB_GET_CLASS(obj) \
- ((CamelCertDBClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_CERTDB, CamelCertDBClass))
G_BEGIN_DECLS
@@ -114,7 +126,7 @@ struct _CamelCertDBClass {
void (*cert_set_string) (CamelCertDB *certdb, CamelCert *cert, gint string, const gchar *value);
};
-CamelType camel_certdb_get_type (void);
+GType camel_certdb_get_type (void);
CamelCertDB *camel_certdb_new (void);
diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c
index c0cfba3..50c0db3 100644
--- a/camel/camel-cipher-context.c
+++ b/camel/camel-cipher-context.c
@@ -45,12 +45,21 @@
#define d(x)
+#define CAMEL_CIPHER_CONTEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContextPrivate))
+
struct _CamelCipherContextPrivate {
CamelSession *session;
GMutex *lock;
};
-static CamelObjectClass *parent_class = NULL;
+enum {
+ PROP_0,
+ PROP_SESSION
+};
+
+G_DEFINE_TYPE (CamelCipherContext, camel_cipher_context, CAMEL_TYPE_OBJECT)
static gint
cipher_sign (CamelCipherContext *ctx,
@@ -631,25 +640,84 @@ cipher_context_set_session (CamelCipherContext *context,
g_return_if_fail (CAMEL_IS_SESSION (session));
g_return_if_fail (context->priv->session == NULL);
- context->priv->session = camel_object_ref (session);
+ context->priv->session = g_object_ref (session);
+}
+
+static void
+cipher_context_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SESSION:
+ cipher_context_set_session (
+ CAMEL_CIPHER_CONTEXT (object),
+ g_value_get_object (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
static void
-cipher_context_finalize (CamelObject *object)
+cipher_context_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SESSION:
+ g_value_set_object (
+ value, camel_cipher_context_get_session (
+ CAMEL_CIPHER_CONTEXT (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+cipher_context_dispose (GObject *object)
{
- CamelCipherContext *context = (CamelCipherContext *) object;
+ CamelCipherContextPrivate *priv;
- camel_object_unref (context->priv->session);
+ priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (object);
- g_mutex_free (context->priv->lock);
+ if (priv->session != NULL) {
+ g_object_unref (priv->session);
+ priv->session = NULL;
+ }
- g_free (context->priv);
+ /* Chain up to parent's dispose () method. */
+ G_OBJECT_CLASS (camel_cipher_context_parent_class)->dispose (object);
+}
+
+static void
+cipher_context_finalize (GObject *object)
+{
+ CamelCipherContextPrivate *priv;
+
+ priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (object);
+
+ g_mutex_free (priv->lock);
+
+ /* Chain up to parent's finalize () method. */
+ G_OBJECT_CLASS (camel_cipher_context_parent_class)->finalize (object);
}
static void
camel_cipher_context_class_init (CamelCipherContextClass *class)
{
- parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelCipherContextPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = cipher_context_set_property;
+ object_class->get_property = cipher_context_get_property;
+ object_class->dispose = cipher_context_dispose;
+ object_class->finalize = cipher_context_finalize;
class->hash_to_id = cipher_hash_to_id;
class->id_to_hash = cipher_id_to_hash;
@@ -659,37 +727,29 @@ camel_cipher_context_class_init (CamelCipherContextClass *class)
class->decrypt = cipher_decrypt;
class->import_keys = cipher_import_keys;
class->export_keys = cipher_export_keys;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SESSION,
+ g_param_spec_object (
+ "session",
+ "Session",
+ NULL,
+ CAMEL_TYPE_SESSION,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
}
static void
camel_cipher_context_init (CamelCipherContext *context)
{
- context->priv = g_new0 (struct _CamelCipherContextPrivate, 1);
+ context->priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (context);
context->priv->lock = g_mutex_new ();
}
-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",
- sizeof (CamelCipherContext),
- sizeof (CamelCipherContextClass),
- (CamelObjectClassInitFunc) camel_cipher_context_class_init,
- NULL,
- (CamelObjectInitFunc) camel_cipher_context_init,
- (CamelObjectFinalizeFunc) cipher_context_finalize);
- }
-
- return type;
-}
-
/**
* camel_cipher_context_new:
- * @session: CamelSession
+ * @session: a #CamelSession
*
* This creates a new CamelCipherContext object which is used to sign,
* verify, encrypt and decrypt streams.
@@ -699,17 +759,19 @@ camel_cipher_context_get_type (void)
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));
-
- cipher_context_set_session (context, session);
-
- return context;
+ return g_object_new (
+ CAMEL_TYPE_CIPHER_CONTEXT,
+ "session", session, NULL);
}
+/**
+ * camel_cipher_context_get_session:
+ * @context: a #CamelCipherContext
+ *
+ * Since: 3.0
+ **/
CamelSession *
camel_cipher_context_get_session (CamelCipherContext *context)
{
@@ -718,22 +780,6 @@ camel_cipher_context_get_session (CamelCipherContext *context)
return context->priv->session;
}
-/**
- * camel_cipher_context_construct:
- * @context: CamelCipherContext
- * @session: CamelSession
- *
- * Constucts the CamelCipherContext
- **/
-void
-camel_cipher_context_construct (CamelCipherContext *context, CamelSession *session)
-{
- g_return_if_fail (CAMEL_IS_CIPHER_CONTEXT (context));
- g_return_if_fail (CAMEL_IS_SESSION (session));
-
- cipher_context_set_session (context, session);
-}
-
/* See rfc3156, section 2 and others */
/* We do this simply: Anything not base64 must be qp
This is so that we can safely translate any occurance of "From "
@@ -792,13 +838,13 @@ camel_cipher_canonical_to_stream (CamelMimePart *part,
filter = camel_stream_filter_new (ostream);
canon = camel_mime_filter_canon_new (flags);
camel_stream_filter_add (CAMEL_STREAM_FILTER (filter), canon);
- camel_object_unref (canon);
+ g_object_unref (canon);
if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *)part, filter) != -1
&& camel_stream_flush (filter) != -1)
res = 0;
- camel_object_unref (filter);
+ g_object_unref (filter);
camel_stream_reset (ostream);
return res;
diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h
index d32b145..6841d44 100644
--- a/camel/camel-cipher-context.h
+++ b/camel/camel-cipher-context.h
@@ -30,15 +30,25 @@
#include <camel/camel-list-utils.h>
#include <camel/camel-mime-part.h>
#include <camel/camel-session.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-stream.h>
-#define CAMEL_CIPHER_CONTEXT_TYPE (camel_cipher_context_get_type ())
-#define CAMEL_CIPHER_CONTEXT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_CIPHER_CONTEXT_TYPE, CamelCipherContext))
-#define CAMEL_CIPHER_CONTEXT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_CIPHER_CONTEXT_TYPE, CamelCipherContextClass))
-#define CAMEL_IS_CIPHER_CONTEXT(o) (CAMEL_CHECK_TYPE((o), CAMEL_CIPHER_CONTEXT_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_CIPHER_CONTEXT \
+ (camel_cipher_context_get_type ())
+#define CAMEL_CIPHER_CONTEXT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContext))
+#define CAMEL_CIPHER_CONTEXT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContextClass))
+#define CAMEL_IS_CIPHER_CONTEXT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_CIPHER_CONTEXT))
+#define CAMEL_IS_CIPHER_CONTEXT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_CIPHER_CONTEXT))
#define CAMEL_CIPHER_CONTEXT_GET_CLASS(obj) \
- ((CamelCipherContextClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContextClass))
G_BEGIN_DECLS
@@ -155,10 +165,9 @@ struct _CamelCipherContextClass {
CamelException *ex);
};
-CamelType camel_cipher_context_get_type (void);
+GType camel_cipher_context_get_type (void);
CamelCipherContext *
camel_cipher_context_new (CamelSession *session);
-void camel_cipher_context_construct (CamelCipherContext *context, CamelSession *session);
CamelSession * camel_cipher_context_get_session(CamelCipherContext *context);
/* cipher context util routines */
diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c
index 60cd7d6..dbc3a56 100644
--- a/camel/camel-data-cache.c
+++ b/camel/camel-data-cache.c
@@ -37,6 +37,7 @@
#include <glib/gi18n-lib.h>
#include "camel-data-cache.h"
+#include "camel-object-bag.h"
#include "camel-stream-fs.h"
#include "camel-stream-mem.h"
#include "camel-file-utils.h"
@@ -51,6 +52,10 @@
once an hour should be enough */
#define CAMEL_DATA_CACHE_CYCLE_TIME (60*60)
+#define CAMEL_DATA_CACHE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_DATA_CACHE, CamelDataCachePrivate))
+
struct _CamelDataCachePrivate {
CamelObjectBag *busy_bag;
@@ -62,23 +67,83 @@ struct _CamelDataCachePrivate {
time_t expire_last[1<<CAMEL_DATA_CACHE_BITS];
};
-static CamelObject *camel_data_cache_parent;
+enum {
+ PROP_0,
+ PROP_PATH
+};
+
+G_DEFINE_TYPE (CamelDataCache, camel_data_cache, CAMEL_TYPE_OBJECT)
static void
-data_cache_finalize (CamelDataCache *cdc)
+data_cache_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- CamelDataCachePrivate *priv = cdc->priv;
+ switch (property_id) {
+ case PROP_PATH:
+ camel_data_cache_set_path (
+ CAMEL_DATA_CACHE (object),
+ g_value_get_string (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+data_cache_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_PATH:
+ g_value_set_string (
+ value, camel_data_cache_get_path (
+ CAMEL_DATA_CACHE (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+data_cache_finalize (GObject *object)
+{
+ CamelDataCachePrivate *priv;
+
+ priv = CAMEL_DATA_CACHE_GET_PRIVATE (object);
camel_object_bag_destroy (priv->busy_bag);
g_free (priv->path);
- g_free (priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_data_cache_parent_class)->finalize (object);
}
static void
camel_data_cache_class_init (CamelDataCacheClass *class)
{
- camel_data_cache_parent = (CamelObject *)camel_object_get_type ();
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelDataCachePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = data_cache_set_property;
+ object_class->get_property = data_cache_get_property;
+ object_class->finalize = data_cache_finalize;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_PATH,
+ g_param_spec_string (
+ "path",
+ "Path",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
}
static void
@@ -91,31 +156,12 @@ camel_data_cache_init (CamelDataCache *data_cache)
(CamelCopyFunc) g_strdup,
(GFreeFunc) g_free);
- data_cache->priv = g_malloc0(sizeof(*data_cache->priv));
+ data_cache->priv = CAMEL_DATA_CACHE_GET_PRIVATE (data_cache);
data_cache->priv->busy_bag = busy_bag;
data_cache->priv->expire_age = -1;
data_cache->priv->expire_access = -1;
}
-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_TYPE_OBJECT, "CamelDataCache",
- sizeof (CamelDataCache),
- sizeof (CamelDataCacheClass),
- (CamelObjectClassInitFunc) camel_data_cache_class_init,
- NULL,
- (CamelObjectInitFunc) camel_data_cache_init,
- (CamelObjectFinalizeFunc) data_cache_finalize);
- }
-
- return camel_data_cache_type;
-}
-
/**
* camel_data_cache_new:
* @path: Base path of cache, subdirectories will be created here.
@@ -127,9 +173,10 @@ camel_data_cache_get_type(void)
* be written to.
**/
CamelDataCache *
-camel_data_cache_new(const gchar *path, CamelException *ex)
+camel_data_cache_new (const gchar *path,
+ CamelException *ex)
{
- CamelDataCache *cdc;
+ g_return_val_if_fail (path != NULL, NULL);
if (g_mkdir_with_parents (path, 0700) == -1) {
camel_exception_setv (
@@ -138,11 +185,7 @@ camel_data_cache_new(const gchar *path, CamelException *ex)
return NULL;
}
- cdc = (CamelDataCache *)camel_object_new(CAMEL_DATA_CACHE_TYPE);
-
- cdc->priv->path = g_strdup (path);
-
- return cdc;
+ return g_object_new (CAMEL_TYPE_DATA_CACHE, "path", path, NULL);
}
const gchar *
@@ -233,7 +276,7 @@ data_cache_expire(CamelDataCache *cdc, const gchar *path, const gchar *keep, tim
stream = camel_object_bag_get(cdc->priv->busy_bag, s->str);
if (stream) {
camel_object_bag_remove(cdc->priv->busy_bag, stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
}
}
}
@@ -300,7 +343,10 @@ data_cache_path(CamelDataCache *cdc, gint create, const gchar *path, const gchar
* The caller must unref this when finished.
**/
CamelStream *
-camel_data_cache_add(CamelDataCache *cdc, const gchar *path, const gchar *key, CamelException *ex)
+camel_data_cache_add (CamelDataCache *cdc,
+ const gchar *path,
+ const gchar *key,
+ CamelException *ex)
{
gchar *real;
CamelStream *stream;
@@ -314,11 +360,12 @@ camel_data_cache_add(CamelDataCache *cdc, const gchar *path, const gchar *key, C
if (stream) {
g_unlink(real);
camel_object_bag_remove(cdc->priv->busy_bag, stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
}
} while (stream != NULL);
- stream = camel_stream_fs_new_with_name(real, O_RDWR|O_CREAT|O_TRUNC, 0600);
+ stream = camel_stream_fs_new_with_name (
+ real, O_RDWR|O_CREAT|O_TRUNC, 0600);
if (stream)
camel_object_bag_add(cdc->priv->busy_bag, real, stream);
else
@@ -355,7 +402,8 @@ camel_data_cache_get (CamelDataCache *cdc,
real = data_cache_path(cdc, FALSE, path, key);
stream = camel_object_bag_reserve(cdc->priv->busy_bag, real);
if (!stream) {
- stream = camel_stream_fs_new_with_name (real, O_RDWR, 0600);
+ stream = camel_stream_fs_new_with_name (
+ real, O_RDWR, 0600);
if (stream)
camel_object_bag_add(cdc->priv->busy_bag, real, stream);
else
@@ -417,7 +465,7 @@ camel_data_cache_remove (CamelDataCache *cdc,
stream = camel_object_bag_get(cdc->priv->busy_bag, real);
if (stream) {
camel_object_bag_remove(cdc->priv->busy_bag, stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
}
/* maybe we were a mem stream */
diff --git a/camel/camel-data-cache.h b/camel/camel-data-cache.h
index 2504935..1772fd8 100644
--- a/camel/camel-data-cache.h
+++ b/camel/camel-data-cache.h
@@ -30,10 +30,24 @@
#include <camel/camel-stream.h>
#include <camel/camel-exception.h>
-#define CAMEL_DATA_CACHE_TYPE (camel_data_cache_get_type ())
-#define CAMEL_DATA_CACHE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DATA_CACHE_TYPE, CamelFolder))
-#define CAMEL_DATA_CACHE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DATA_CACHE_TYPE, CamelFolderClass))
-#define CAMEL_IS_DATA_CACHE(o) (CAMEL_CHECK_TYPE((o), CAMEL_DATA_CACHE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_DATA_CACHE \
+ (camel_data_cache_get_type ())
+#define CAMEL_DATA_CACHE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_DATA_CACHE, CamelDataCache))
+#define CAMEL_DATA_CACHE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_DATA_CACHE, CamelDataCacheClass))
+#define CAMEL_IS_DATA_CACHE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_DATA_CACHE))
+#define CAMEL_IS_DATA_CACHE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_DATA_CACHE))
+#define CAMEL_DATA_CACHE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_DATA_CACHE, CamelDataCacheClass))
G_BEGIN_DECLS
@@ -50,7 +64,7 @@ struct _CamelDataCacheClass {
CamelObjectClass parent_class;
};
-CamelType camel_data_cache_get_type (void);
+GType camel_data_cache_get_type (void);
CamelDataCache *camel_data_cache_new (const gchar *path,
CamelException *ex);
const gchar * camel_data_cache_get_path (CamelDataCache *cdc);
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
index f3f530b..c5d3284 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -34,26 +34,44 @@
#define d(x)
+#define CAMEL_DATA_WRAPPER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapperPrivate))
+
struct _CamelDataWrapperPrivate {
GStaticMutex stream_lock;
};
-static CamelObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelDataWrapper, camel_data_wrapper, CAMEL_TYPE_OBJECT)
static void
-camel_data_wrapper_finalize (CamelObject *object)
+data_wrapper_dispose (GObject *object)
{
- CamelDataWrapper *camel_data_wrapper = CAMEL_DATA_WRAPPER (object);
+ CamelDataWrapper *data_wrapper = CAMEL_DATA_WRAPPER (object);
- g_static_mutex_free (&camel_data_wrapper->priv->stream_lock);
+ if (data_wrapper->mime_type != NULL) {
+ camel_content_type_unref (data_wrapper->mime_type);
+ data_wrapper->mime_type = NULL;
+ }
+
+ if (data_wrapper->stream != NULL) {
+ g_object_unref (data_wrapper->stream);
+ data_wrapper->stream = NULL;
+ }
- g_free (camel_data_wrapper->priv);
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_data_wrapper_parent_class)->dispose (object);
+}
+
+static void
+data_wrapper_finalize (GObject *object)
+{
+ CamelDataWrapper *data_wrapper = CAMEL_DATA_WRAPPER (object);
- if (camel_data_wrapper->mime_type)
- camel_content_type_unref (camel_data_wrapper->mime_type);
+ g_static_mutex_free (&data_wrapper->priv->stream_lock);
- if (camel_data_wrapper->stream)
- camel_object_unref (camel_data_wrapper->stream);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_data_wrapper_parent_class)->finalize (object);
}
static gssize
@@ -93,17 +111,17 @@ data_wrapper_decode_to_stream (CamelDataWrapper *data_wrapper,
case CAMEL_TRANSFER_ENCODING_BASE64:
filter = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_BASE64_DEC);
camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
- camel_object_unref (filter);
+ g_object_unref (filter);
break;
case CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE:
filter = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_QP_DEC);
camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
- camel_object_unref (filter);
+ g_object_unref (filter);
break;
case CAMEL_TRANSFER_ENCODING_UUENCODE:
filter = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_UU_DEC);
camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
- camel_object_unref (filter);
+ g_object_unref (filter);
break;
default:
break;
@@ -113,12 +131,13 @@ data_wrapper_decode_to_stream (CamelDataWrapper *data_wrapper,
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);
+ g_object_unref (filter);
}
ret = camel_data_wrapper_write_to_stream (data_wrapper, fstream);
+
camel_stream_flush (fstream);
- camel_object_unref (fstream);
+ g_object_unref (fstream);
return ret;
}
@@ -160,9 +179,9 @@ data_wrapper_construct_from_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream)
{
if (data_wrapper->stream)
- camel_object_unref (data_wrapper->stream);
+ g_object_unref (data_wrapper->stream);
- data_wrapper->stream = camel_object_ref (stream);
+ data_wrapper->stream = g_object_ref (stream);
return 0;
}
@@ -176,7 +195,13 @@ data_wrapper_is_offline (CamelDataWrapper *data_wrapper)
static void
camel_data_wrapper_class_init (CamelDataWrapperClass *class)
{
- parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelDataWrapperPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = data_wrapper_dispose;
+ object_class->finalize = data_wrapper_finalize;
class->write_to_stream = data_wrapper_write_to_stream;
class->decode_to_stream = data_wrapper_decode_to_stream;
@@ -191,7 +216,7 @@ camel_data_wrapper_class_init (CamelDataWrapperClass *class)
static void
camel_data_wrapper_init (CamelDataWrapper *data_wrapper)
{
- data_wrapper->priv = g_malloc (sizeof (struct _CamelDataWrapperPrivate));
+ data_wrapper->priv = CAMEL_DATA_WRAPPER_GET_PRIVATE (data_wrapper);
g_static_mutex_init (&data_wrapper->priv->stream_lock);
@@ -201,25 +226,6 @@ camel_data_wrapper_init (CamelDataWrapper *data_wrapper)
data_wrapper->offline = FALSE;
}
-CamelType
-camel_data_wrapper_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_TYPE_OBJECT,
- "CamelDataWrapper",
- sizeof (CamelDataWrapper),
- sizeof (CamelDataWrapperClass),
- (CamelObjectClassInitFunc) camel_data_wrapper_class_init,
- NULL,
- (CamelObjectInitFunc) camel_data_wrapper_init,
- (CamelObjectFinalizeFunc) camel_data_wrapper_finalize);
- }
-
- return type;
-}
-
/**
* camel_data_wrapper_new:
*
@@ -230,7 +236,7 @@ camel_data_wrapper_get_type (void)
CamelDataWrapper *
camel_data_wrapper_new (void)
{
- return (CamelDataWrapper *) camel_object_new (CAMEL_DATA_WRAPPER_TYPE);
+ return g_object_new (CAMEL_TYPE_DATA_WRAPPER, NULL);
}
/**
@@ -425,14 +431,13 @@ camel_data_wrapper_is_offline (CamelDataWrapper *data_wrapper)
*
* Locks #data_wrapper's #lock. Unlock it with camel_data_wrapper_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_data_wrapper_lock (CamelDataWrapper *data_wrapper, CamelDataWrapperLock lock)
+camel_data_wrapper_lock (CamelDataWrapper *data_wrapper,
+ CamelDataWrapperLock lock)
{
- g_return_if_fail (data_wrapper != NULL);
g_return_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper));
- g_return_if_fail (data_wrapper->priv != NULL);
switch (lock) {
case CDW_STREAM_LOCK:
@@ -450,14 +455,13 @@ camel_data_wrapper_lock (CamelDataWrapper *data_wrapper, CamelDataWrapperLock lo
*
* Unlocks #data_wrapper's #lock, previously locked with camel_data_wrapper_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_data_wrapper_unlock (CamelDataWrapper *data_wrapper, CamelDataWrapperLock lock)
+camel_data_wrapper_unlock (CamelDataWrapper *data_wrapper,
+ CamelDataWrapperLock lock)
{
- g_return_if_fail (data_wrapper != NULL);
g_return_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper));
- g_return_if_fail (data_wrapper->priv != NULL);
switch (lock) {
case CDW_STREAM_LOCK:
diff --git a/camel/camel-data-wrapper.h b/camel/camel-data-wrapper.h
index b1444e0..2310797 100644
--- a/camel/camel-data-wrapper.h
+++ b/camel/camel-data-wrapper.h
@@ -34,12 +34,24 @@
#include <camel/camel-mime-utils.h>
#include <camel/camel-stream.h>
-#define CAMEL_DATA_WRAPPER_TYPE (camel_data_wrapper_get_type ())
-#define CAMEL_DATA_WRAPPER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DATA_WRAPPER_TYPE, CamelDataWrapper))
-#define CAMEL_DATA_WRAPPER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DATA_WRAPPER_TYPE, CamelDataWrapperClass))
-#define CAMEL_IS_DATA_WRAPPER(o) (CAMEL_CHECK_TYPE((o), CAMEL_DATA_WRAPPER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_DATA_WRAPPER \
+ (camel_data_wrapper_get_type ())
+#define CAMEL_DATA_WRAPPER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapper))
+#define CAMEL_DATA_WRAPPER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapperClass))
+#define CAMEL_IS_DATA_WRAPPER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_DATA_WRAPPER))
+#define CAMEL_IS_DATA_WRAPPER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_DATA_WRAPPER))
#define CAMEL_DATA_WRAPPER_GET_CLASS(obj) \
- ((CamelDataWrapperClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapperClass))
G_BEGIN_DECLS
@@ -82,7 +94,7 @@ struct _CamelDataWrapperClass {
gboolean (*is_offline) (CamelDataWrapper *data_wrapper);
};
-CamelType camel_data_wrapper_get_type (void);
+GType camel_data_wrapper_get_type (void);
CamelDataWrapper *
camel_data_wrapper_new (void);
gssize camel_data_wrapper_write_to_stream
@@ -104,9 +116,10 @@ gint camel_data_wrapper_construct_from_stream
(CamelDataWrapper *data_wrapper,
CamelStream *stream);
gboolean camel_data_wrapper_is_offline (CamelDataWrapper *data_wrapper);
-
-void camel_data_wrapper_lock (CamelDataWrapper *data_wrapper, CamelDataWrapperLock lock);
-void camel_data_wrapper_unlock (CamelDataWrapper *data_wrapper, CamelDataWrapperLock lock);
+void camel_data_wrapper_lock (CamelDataWrapper *data_wrapper,
+ CamelDataWrapperLock lock);
+void camel_data_wrapper_unlock (CamelDataWrapper *data_wrapper,
+ CamelDataWrapperLock lock);
G_END_DECLS
diff --git a/camel/camel-disco-diary.c b/camel/camel-disco-diary.c
index 725b45d..2b9e03f 100644
--- a/camel/camel-disco-diary.c
+++ b/camel/camel-disco-diary.c
@@ -43,10 +43,12 @@
#define d(x)
+G_DEFINE_TYPE (CamelDiscoDiary, camel_disco_diary, CAMEL_TYPE_OBJECT)
+
static void
unref_folder (gpointer key, gpointer value, gpointer data)
{
- camel_object_unref (value);
+ g_object_unref (value);
}
static void
@@ -57,8 +59,10 @@ free_uid (gpointer key, gpointer value, gpointer data)
}
static void
-disco_diary_finalize (CamelDiscoDiary *diary)
+disco_diary_finalize (GObject *object)
{
+ CamelDiscoDiary *diary = CAMEL_DISCO_DIARY (object);
+
if (diary->file)
fclose (diary->file);
@@ -71,11 +75,18 @@ disco_diary_finalize (CamelDiscoDiary *diary)
g_hash_table_foreach (diary->uidmap, free_uid, NULL);
g_hash_table_destroy (diary->uidmap);
}
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_disco_diary_parent_class)->finalize (object);
}
static void
camel_disco_diary_class_init (CamelDiscoDiaryClass *class)
{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = disco_diary_finalize;
}
static void
@@ -85,25 +96,6 @@ camel_disco_diary_init (CamelDiscoDiary *diary)
diary->uidmap = g_hash_table_new (g_str_hash, g_str_equal);
}
-CamelType
-camel_disco_diary_get_type (void)
-{
- static CamelType camel_disco_diary_type = CAMEL_INVALID_TYPE;
-
- if (camel_disco_diary_type == CAMEL_INVALID_TYPE) {
- camel_disco_diary_type = camel_type_register (
- CAMEL_TYPE_OBJECT, "CamelDiscoDiary",
- sizeof (CamelDiscoDiary),
- sizeof (CamelDiscoDiaryClass),
- (CamelObjectClassInitFunc) camel_disco_diary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_disco_diary_init,
- (CamelObjectFinalizeFunc) disco_diary_finalize);
- }
-
- return camel_disco_diary_type;
-}
-
static gint
diary_encode_uids (CamelDiscoDiary *diary, GPtrArray *uids)
{
@@ -279,7 +271,7 @@ close_folder (gpointer name, gpointer folder, gpointer data)
{
g_free (name);
camel_folder_sync (folder, FALSE, NULL);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
void
@@ -424,7 +416,7 @@ camel_disco_diary_new (CamelDiscoStore *store,
g_return_val_if_fail (CAMEL_IS_DISCO_STORE (store), NULL);
g_return_val_if_fail (filename != NULL, NULL);
- diary = CAMEL_DISCO_DIARY (camel_object_new (CAMEL_DISCO_DIARY_TYPE));
+ diary = g_object_new (CAMEL_TYPE_DISCO_DIARY, NULL);
diary->store = store;
d(printf("diary log file '%s'\n", filename));
@@ -443,7 +435,7 @@ camel_disco_diary_new (CamelDiscoStore *store,
diary->file = g_fopen (filename, "a+b");
if (!diary->file) {
- camel_object_unref (diary);
+ g_object_unref (diary);
camel_exception_setv (
ex, CAMEL_EXCEPTION_SYSTEM,
"Could not open journal file: %s",
diff --git a/camel/camel-disco-diary.h b/camel/camel-disco-diary.h
index bc9f97b..91dc285 100644
--- a/camel/camel-disco-diary.h
+++ b/camel/camel-disco-diary.h
@@ -35,10 +35,24 @@
#include <camel/camel-disco-store.h>
-#define CAMEL_DISCO_DIARY_TYPE (camel_disco_diary_get_type ())
-#define CAMEL_DISCO_DIARY(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_DIARY_TYPE, CamelDiscoDiary))
-#define CAMEL_DISCO_DIARY_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_DIARY_TYPE, CamelDiscoDiaryClass))
-#define CAMEL_IS_DISCO_DIARY(o) (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_DIARY_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_DISCO_DIARY \
+ (camel_disco_diary_get_type ())
+#define CAMEL_DISCO_DIARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_DISCO_DIARY, CamelDiscoDiary))
+#define CAMEL_DISCO_DIARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_DISCO_DIARY, CamelDiscoDiaryClass))
+#define CAMEL_IS_DISCO_DIARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_DISCO_DIARY))
+#define CAMEL_IS_DISCO_DIARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_DISCO_DIARY))
+#define CAMEL_DISCO_DIARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_DISCO_DIARY, CamelDiscoDiaryClass))
G_BEGIN_DECLS
@@ -73,7 +87,7 @@ struct _CamelDiscoDiaryClass {
CamelObjectClass parent_class;
};
-CamelType camel_disco_diary_get_type (void);
+GType camel_disco_diary_get_type (void);
CamelDiscoDiary *
camel_disco_diary_new (CamelDiscoStore *store,
const gchar *filename,
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index c358c1d..364cc23 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -32,7 +32,6 @@
#include "camel-exception.h"
#include "camel-session.h"
-static CamelFolderClass *parent_class = NULL;
static GSList *disco_folder_properties;
static CamelProperty disco_property_list[] = {
@@ -49,6 +48,8 @@ struct _cdf_sync_msg {
CamelFolderChangeInfo *changes;
};
+G_DEFINE_TYPE (CamelDiscoFolder, camel_disco_folder, CAMEL_TYPE_FOLDER)
+
static void
cdf_sync_offline(CamelSession *session, CamelSessionThreadMsg *mm)
{
@@ -82,7 +83,7 @@ cdf_sync_free(CamelSession *session, CamelSessionThreadMsg *mm)
if (m->changes)
camel_folder_change_info_free(m->changes);
- camel_object_unref (m->folder);
+ g_object_unref (m->folder);
}
static CamelSessionThreadOps cdf_sync_ops = {
@@ -102,7 +103,7 @@ cdf_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, gpointer
m = camel_session_thread_msg_new(session, &cdf_sync_ops, sizeof(*m));
m->changes = camel_folder_change_info_new();
camel_folder_change_info_cat(m->changes, changes);
- m->folder = camel_object_ref (folder);
+ m->folder = g_object_ref (folder);
camel_session_thread_queue(session, &m->msg, 0);
}
}
@@ -127,7 +128,7 @@ disco_getv (CamelObject *object,
props.argc = 1;
props.argv[0] = *arg;
- ((CamelObjectClass *)parent_class)->getv(object, ex, &props);
+ CAMEL_OBJECT_CLASS (camel_disco_folder_parent_class)->getv(object, ex, &props);
*arg->ca_ptr = g_slist_concat(*arg->ca_ptr, g_slist_copy(disco_folder_properties));
break; }
/* disco args */
@@ -143,7 +144,7 @@ disco_getv (CamelObject *object,
}
if (count)
- return ((CamelObjectClass *)parent_class)->getv(object, ex, args);
+ return CAMEL_OBJECT_CLASS (camel_disco_folder_parent_class)->getv(object, ex, args);
return 0;
}
@@ -179,7 +180,7 @@ disco_setv (CamelObject *object,
if (save)
camel_object_state_write(object);
- return ((CamelObjectClass *)parent_class)->setv(object, ex, args);
+ return CAMEL_OBJECT_CLASS (camel_disco_folder_parent_class)->setv(object, ex, args);
}
static gboolean
@@ -400,8 +401,6 @@ camel_disco_folder_class_init (CamelDiscoFolderClass *class)
CamelFolderClass *folder_class;
gint ii;
- parent_class = CAMEL_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_folder_get_type ()));
-
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = disco_getv;
camel_object_class->setv = disco_setv;
@@ -432,23 +431,6 @@ camel_disco_folder_init (CamelDiscoFolder *disco_folder)
(CamelObjectEventHookFunc) cdf_folder_changed, NULL);
}
-CamelType
-camel_disco_folder_get_type (void)
-{
- static CamelType camel_disco_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_disco_folder_type == CAMEL_INVALID_TYPE) {
- camel_disco_folder_type = camel_type_register (
- CAMEL_FOLDER_TYPE, "CamelDiscoFolder",
- sizeof (CamelDiscoFolder),
- sizeof (CamelDiscoFolderClass),
- (CamelObjectClassInitFunc)camel_disco_folder_class_init, NULL,
- (CamelObjectInitFunc)camel_disco_folder_init, NULL);
- }
-
- return camel_disco_folder_type;
-}
-
/**
* camel_disco_folder_expunge_uids:
* @folder: a (disconnectable) folder
diff --git a/camel/camel-disco-folder.h b/camel/camel-disco-folder.h
index 7d34285..e2b34d7 100644
--- a/camel/camel-disco-folder.h
+++ b/camel/camel-disco-folder.h
@@ -32,12 +32,24 @@
#include <camel/camel-folder.h>
-#define CAMEL_DISCO_FOLDER_TYPE (camel_disco_folder_get_type ())
-#define CAMEL_DISCO_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_FOLDER_TYPE, CamelDiscoFolder))
-#define CAMEL_DISCO_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_FOLDER_TYPE, CamelDiscoFolderClass))
-#define CAMEL_IS_DISCO_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_DISCO_FOLDER \
+ (camel_disco_folder_get_type ())
+#define CAMEL_DISCO_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_DISCO_FOLDER, CamelDiscoFolder))
+#define CAMEL_DISCO_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_DISCO_FOLDER, CamelDiscoFolderClass))
+#define CAMEL_IS_DISCO_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_DISCO_FOLDER))
+#define CAMEL_IS_DISCO_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_DISCO_FOLDER))
#define CAMEL_DISCO_FOLDER_GET_CLASS(obj) \
- ((CamelDiscoFolderClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_DISCO_FOLDER, CamelDiscoFolderClass))
G_BEGIN_DECLS
@@ -124,7 +136,7 @@ struct _CamelDiscoFolderClass {
const gchar *new_uid);
};
-CamelType camel_disco_folder_get_type (void);
+GType camel_disco_folder_get_type (void);
gboolean camel_disco_folder_expunge_uids (CamelFolder *folder,
GPtrArray *uids,
CamelException *ex);
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
index 1c44e54..4a29c2c 100644
--- a/camel/camel-disco-store.c
+++ b/camel/camel-disco-store.c
@@ -36,7 +36,7 @@
#define d(x)
-static gpointer camel_disco_store_parent_class;
+G_DEFINE_TYPE (CamelDiscoStore, camel_disco_store, CAMEL_TYPE_STORE)
static gboolean
disco_store_construct (CamelService *service,
@@ -93,9 +93,9 @@ disco_store_connect (CamelService *service,
/* Need to resync. Note we do the ref thing since during the replay
disconnect could be called, which will remove store->diary and unref it */
store->status = CAMEL_DISCO_STORE_RESYNCING;
- diary = camel_object_ref (store->diary);
+ diary = g_object_ref (store->diary);
camel_disco_diary_replay(diary, ex);
- camel_object_unref (diary);
+ g_object_unref (diary);
store->status = CAMEL_DISCO_STORE_ONLINE;
if (camel_exception_is_set (ex))
return FALSE;
@@ -238,12 +238,12 @@ disco_store_set_status (CamelDiscoStore *disco_store,
folders = camel_object_bag_list(((CamelStore *)disco_store)->folders);
for (i=0;i<folders->len;i++) {
folder = folders->pdata[i];
- if (CAMEL_CHECK_TYPE(folder, CAMEL_DISCO_FOLDER_TYPE)
+ if (G_TYPE_CHECK_INSTANCE_TYPE(folder, CAMEL_TYPE_DISCO_FOLDER)
&& (sync || ((CamelDiscoFolder *)folder)->offline_sync)) {
camel_disco_folder_prepare_for_offline((CamelDiscoFolder *)folder, "", &x);
camel_exception_clear(&x);
}
- camel_object_unref (folder);
+ g_object_unref (folder);
}
g_ptr_array_free(folders, TRUE);
}
@@ -266,8 +266,6 @@ camel_disco_store_class_init (CamelDiscoStoreClass *class)
CamelServiceClass *service_class;
CamelStoreClass *store_class;
- camel_disco_store_parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
-
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = disco_store_construct;
service_class->connect = disco_store_connect;
@@ -281,24 +279,9 @@ camel_disco_store_class_init (CamelDiscoStoreClass *class)
class->set_status = disco_store_set_status;
}
-CamelType
-camel_disco_store_get_type (void)
+static void
+camel_disco_store_init (CamelDiscoStore *disco_store)
{
- 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,
- "CamelDiscoStore",
- sizeof (CamelDiscoStore),
- sizeof (CamelDiscoStoreClass),
- (CamelObjectClassInitFunc) camel_disco_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_disco_store_type;
}
/**
@@ -418,12 +401,12 @@ camel_disco_store_prepare_for_offline (CamelDiscoStore *disco_store,
folders = camel_object_bag_list(((CamelStore *)disco_store)->folders);
for (i=0;i<folders->len;i++) {
folder = folders->pdata[i];
- if (CAMEL_CHECK_TYPE(folder, CAMEL_DISCO_FOLDER_TYPE)
+ if (G_TYPE_CHECK_INSTANCE_TYPE(folder, CAMEL_TYPE_DISCO_FOLDER)
&& (sync || ((CamelDiscoFolder *)folder)->offline_sync)) {
camel_disco_folder_prepare_for_offline((CamelDiscoFolder *)folder, "(match-all)", &x);
camel_exception_clear(&x);
}
- camel_object_unref (folder);
+ g_object_unref (folder);
}
g_ptr_array_free(folders, TRUE);
}
@@ -433,4 +416,3 @@ camel_disco_store_prepare_for_offline (CamelDiscoStore *disco_store,
camel_exception_clear(&x);
}
}
-
diff --git a/camel/camel-disco-store.h b/camel/camel-disco-store.h
index 8c5adff..66ebc2a 100644
--- a/camel/camel-disco-store.h
+++ b/camel/camel-disco-store.h
@@ -32,12 +32,24 @@
#include <camel/camel-store.h>
-#define CAMEL_DISCO_STORE_TYPE (camel_disco_store_get_type ())
-#define CAMEL_DISCO_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_STORE_TYPE, CamelDiscoStore))
-#define CAMEL_DISCO_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_STORE_TYPE, CamelDiscoStoreClass))
-#define CAMEL_IS_DISCO_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_DISCO_STORE \
+ (camel_disco_store_get_type ())
+#define CAMEL_DISCO_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_DISCO_STORE, CamelDiscoStore))
+#define CAMEL_DISCO_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_DISCO_STORE, CamelDiscoStoreClass))
+#define CAMEL_IS_DISCO_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_DISCO_STORE))
+#define CAMEL_IS_DISCO_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_DISCO_STORE))
#define CAMEL_DISCO_STORE_GET_CLASS(obj) \
- ((CamelDiscoStoreClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_DISCO_STORE, CamelDiscoStoreClass))
G_BEGIN_DECLS
@@ -108,7 +120,7 @@ struct _CamelDiscoStoreClass {
CamelException *ex);
};
-CamelType camel_disco_store_get_type (void);
+GType camel_disco_store_get_type (void);
/* Public methods */
CamelDiscoStoreStatus camel_disco_store_status (CamelDiscoStore *store);
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index f31c230..680ea0a 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -56,6 +56,10 @@
/* an invalid pointer */
#define FOLDER_INVALID ((gpointer)~0)
+#define CAMEL_FILTER_DRIVER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_FILTER_DRIVER, CamelFilterDriverPrivate))
+
/* type of status for a log report */
enum filter_log_t {
FILTER_LOG_NONE,
@@ -123,8 +127,6 @@ struct _CamelFilterDriverPrivate {
ESExp *eval;
};
-#define CAMEL_FILTER_DRIVER_GET_PRIVATE(o) (((CamelFilterDriver *)(o))->priv)
-
static void camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const gchar *desc, ...);
static CamelFolder *open_folder (CamelFilterDriver *d, const gchar *folder_url);
@@ -172,7 +174,7 @@ static struct {
{ "only-once", (ESExpFunc *) do_only_once, 0 }
};
-static CamelObjectClass *camel_filter_driver_parent;
+G_DEFINE_TYPE (CamelFilterDriver, camel_filter_driver, CAMEL_TYPE_OBJECT)
static void
free_hash_strings (gpointer key, gpointer value, gpointer data)
@@ -182,91 +184,104 @@ free_hash_strings (gpointer key, gpointer value, gpointer data)
}
static void
-camel_filter_driver_finalize (CamelObject *obj)
+filter_driver_dispose (GObject *object)
{
- CamelFilterDriver *driver = (CamelFilterDriver *) obj;
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *priv;
+
+ priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (object);
+
+ if (priv->defaultfolder != NULL) {
+ camel_folder_thaw (priv->defaultfolder);
+ g_object_unref (priv->defaultfolder);
+ priv->defaultfolder = NULL;
+ }
+
+ if (priv->session != NULL) {
+ g_object_unref (priv->session);
+ priv->session = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_filter_driver_parent_class)->dispose (object);
+}
+
+static void
+filter_driver_finalize (GObject *object)
+{
+ CamelFilterDriverPrivate *priv;
struct _filter_rule *node;
+ priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (object);
+
/* close all folders that were opened for appending */
- close_folders (driver);
- g_hash_table_destroy (p->folders);
+ close_folders (CAMEL_FILTER_DRIVER (object));
+ g_hash_table_destroy (priv->folders);
- g_hash_table_foreach (p->globals, free_hash_strings, driver);
- g_hash_table_destroy (p->globals);
+ g_hash_table_foreach (priv->globals, free_hash_strings, object);
+ g_hash_table_destroy (priv->globals);
- g_hash_table_foreach (p->only_once, free_hash_strings, driver);
- g_hash_table_destroy (p->only_once);
+ g_hash_table_foreach (priv->only_once, free_hash_strings, object);
+ g_hash_table_destroy (priv->only_once);
- e_sexp_unref(p->eval);
+ e_sexp_unref (priv->eval);
- if (p->defaultfolder) {
- camel_folder_thaw (p->defaultfolder);
- camel_object_unref (p->defaultfolder);
- }
-
- while ((node = (struct _filter_rule *)camel_dlist_remhead(&p->rules))) {
- g_free(node->match);
- g_free(node->action);
- g_free(node->name);
- g_free(node);
+ while ((node = (struct _filter_rule *) camel_dlist_remhead (&priv->rules))) {
+ g_free (node->match);
+ g_free (node->action);
+ g_free (node->name);
+ g_free (node);
}
- camel_object_unref (p->session);
-
- g_free (p);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_filter_driver_parent_class)->finalize (object);
}
static void
-camel_filter_driver_class_init (CamelFilterDriverClass *klass)
+camel_filter_driver_class_init (CamelFilterDriverClass *class)
{
- camel_filter_driver_parent = camel_type_get_global_classfuncs(camel_object_get_type());
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelFilterDriverPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = filter_driver_dispose;
+ object_class->finalize = filter_driver_finalize;
}
static void
-camel_filter_driver_init (CamelFilterDriver *obj)
+camel_filter_driver_init (CamelFilterDriver *filter_driver)
{
- struct _CamelFilterDriverPrivate *p;
- gint i;
+ gint ii;
- p = CAMEL_FILTER_DRIVER_GET_PRIVATE (obj) = g_malloc0 (sizeof (*p));
+ filter_driver->priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (filter_driver);
- camel_dlist_init(&p->rules);
+ camel_dlist_init (&filter_driver->priv->rules);
+
+ filter_driver->priv->eval = e_sexp_new ();
- p->eval = e_sexp_new ();
/* Load in builtin symbols */
- for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
- if (symbols[i].type == 1) {
- e_sexp_add_ifunction (p->eval, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, obj);
+ for (ii = 0; ii < G_N_ELEMENTS (symbols); ii++) {
+ if (symbols[ii].type == 1) {
+ e_sexp_add_ifunction (
+ filter_driver->priv->eval, 0,
+ symbols[ii].name, (ESExpIFunc *)
+ symbols[ii].func, filter_driver);
} else {
- e_sexp_add_function (p->eval, 0, symbols[i].name, symbols[i].func, obj);
+ e_sexp_add_function (
+ filter_driver->priv->eval, 0,
+ symbols[ii].name, symbols[ii].func,
+ filter_driver);
}
}
- p->globals = g_hash_table_new (g_str_hash, g_str_equal);
-
- p->folders = g_hash_table_new (g_str_hash, g_str_equal);
+ filter_driver->priv->globals =
+ g_hash_table_new (g_str_hash, g_str_equal);
- p->only_once = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-CamelType
-camel_filter_driver_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_TYPE_OBJECT,
- "CamelFilterDriver",
- sizeof (CamelFilterDriver),
- sizeof (CamelFilterDriverClass),
- (CamelObjectClassInitFunc) camel_filter_driver_class_init,
- NULL,
- (CamelObjectInitFunc) camel_filter_driver_init,
- (CamelObjectFinalizeFunc) camel_filter_driver_finalize);
- }
+ filter_driver->priv->folders =
+ g_hash_table_new (g_str_hash, g_str_equal);
- return type;
+ filter_driver->priv->only_once =
+ g_hash_table_new (g_str_hash, g_str_equal);
}
/**
@@ -279,8 +294,8 @@ camel_filter_driver_new (CamelSession *session)
{
CamelFilterDriver *d;
- d = (CamelFilterDriver *)camel_object_new(camel_filter_driver_get_type());
- d->priv->session = camel_object_ref (session);
+ d = g_object_new (CAMEL_TYPE_FILTER_DRIVER, NULL);
+ d->priv->session = g_object_ref (session);
return d;
}
@@ -345,14 +360,14 @@ camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def)
if (p->defaultfolder) {
camel_folder_thaw (p->defaultfolder);
- camel_object_unref (p->defaultfolder);
+ g_object_unref (p->defaultfolder);
}
p->defaultfolder = def;
if (p->defaultfolder) {
camel_folder_freeze (p->defaultfolder);
- camel_object_ref (p->defaultfolder);
+ g_object_ref (p->defaultfolder);
}
}
@@ -795,34 +810,34 @@ pipe_to_system (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFi
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);
+ g_object_unref (stream);
close (pipe_from_child);
goto wait;
}
if (camel_stream_flush (stream) == -1) {
- camel_object_unref (stream);
+ g_object_unref (stream);
close (pipe_from_child);
goto wait;
}
- camel_object_unref (stream);
+ g_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) {
- camel_object_unref (stream);
- camel_object_unref (mem);
+ g_object_unref (stream);
+ g_object_unref (mem);
goto wait;
}
- camel_object_unref (stream);
+ g_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);
+ g_object_unref (mem);
message = camel_mime_message_new ();
if (camel_mime_part_construct_from_parser ((CamelMimePart *) message, parser) == -1) {
@@ -831,15 +846,15 @@ pipe_to_system (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFi
_("Invalid message stream received from %s: %s"),
argv[0]->value.string,
g_strerror (camel_mime_parser_errno (parser)));
- camel_object_unref (message);
+ g_object_unref (message);
message = NULL;
} else {
- camel_object_unref (p->message);
+ g_object_unref (p->message);
p->message = message;
p->modified = TRUE;
}
- camel_object_unref (parser);
+ g_object_unref (parser);
wait:
context = g_main_context_new ();
@@ -1014,7 +1029,7 @@ close_folder (gpointer key, gpointer value, gpointer data)
if (folder != FOLDER_INVALID) {
camel_folder_sync (folder, FALSE, camel_exception_is_set(p->ex)?NULL : p->ex);
camel_folder_thaw (folder);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, g_hash_table_size(p->folders)* 100 / p->closed, _("Syncing folders"));
@@ -1252,7 +1267,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
if (camel_mime_part_construct_from_parser (mime_part, mp) == -1) {
camel_exception_set (ex, (errno==EINTR)?CAMEL_EXCEPTION_USER_CANCEL:CAMEL_EXCEPTION_SYSTEM, _("Cannot open message"));
report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed on message %d"), i);
- camel_object_unref (message);
+ g_object_unref (message);
goto fail;
}
@@ -1268,7 +1283,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
status = camel_filter_driver_filter_message (
driver, message, info, NULL, NULL, source_url,
original_source_url ? original_source_url : source_url, ex);
- camel_object_unref (message);
+ g_object_unref (message);
if (camel_exception_is_set (ex) || status == -1) {
report_status (
driver, CAMEL_FILTER_STATUS_END, 100,
@@ -1298,7 +1313,7 @@ fail:
if (fd != -1)
close (fd);
if (mp)
- camel_object_unref (mp);
+ g_object_unref (mp);
return ret;
}
@@ -1412,7 +1427,7 @@ get_message_cb (gpointer data, CamelException *ex)
CamelMimeMessage *message;
if (p->message) {
- message = camel_object_ref (p->message);
+ message = g_object_ref (p->message);
} else {
const gchar *uid;
@@ -1478,7 +1493,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
struct _camel_header_raw *h;
if (message) {
- camel_object_ref (message);
+ g_object_ref (message);
} else {
message = camel_folder_get_message (source, uid, ex);
if (!message)
@@ -1495,7 +1510,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
uid = camel_message_info_uid (info);
if (message)
- camel_object_ref (message);
+ g_object_ref (message);
}
p->ex = ex;
@@ -1605,7 +1620,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
}
if (p->message)
- camel_object_unref (p->message);
+ g_object_unref (p->message);
if (freeinfo)
camel_message_info_free (info);
@@ -1617,7 +1632,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
camel_filter_driver_log (driver, FILTER_LOG_END, NULL);
if (p->message)
- camel_object_unref (p->message);
+ g_object_unref (p->message);
if (freeinfo)
camel_message_info_free (info);
diff --git a/camel/camel-filter-driver.h b/camel/camel-filter-driver.h
index e991f68..53e0aca 100644
--- a/camel/camel-filter-driver.h
+++ b/camel/camel-filter-driver.h
@@ -29,10 +29,24 @@
#include <camel/camel-folder.h>
#include <camel/camel-uid-cache.h>
-#define CAMEL_FILTER_DRIVER_TYPE (camel_filter_driver_get_type ())
-#define CAMEL_FILTER_DRIVER(obj) CAMEL_CHECK_CAST (obj, CAMEL_FILTER_DRIVER_TYPE, CamelFilterDriver)
-#define CAMEL_FILTER_DRIVER_CLASS(klass) CAMEL__CHECK_CLASS_CAST (klass, CAMEL_FILTER_DRIVER_TYPE, CamelFilterDriverClass)
-#define CAMEL_IS_FILTER_DRIVER(obj) CAMEL_CHECK_TYPE (obj, CAMEL_FILTER_DRIVER_TYPE)
+/* Standard GObject macros */
+#define CAMEL_TYPE_FILTER_DRIVER \
+ (camel_filter_driver_get_type ())
+#define CAMEL_FILTER_DRIVER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_FILTER_DRIVER, CamelFilterDriver))
+#define CAMEL_FILTER_DRIVER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_FILTER_DRIVER, CamelFilterDriverClass)
+#define CAMEL_IS_FILTER_DRIVER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_FILTER_DRIVER))
+#define CAMEL_IS_FILTER_DRIVER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_FILTER_DRIVER))
+#define CAMEL_FILTER_DRIVER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_FILTER_DRIVER, CamelFilterDriverClass))
G_BEGIN_DECLS
@@ -71,7 +85,7 @@ typedef void (CamelFilterShellFunc) (CamelFilterDriver *driver, gint argc,
typedef void (CamelFilterPlaySoundFunc) (CamelFilterDriver *driver, const gchar *filename, gpointer data);
typedef void (CamelFilterSystemBeepFunc) (CamelFilterDriver *driver, gpointer data);
-CamelType camel_filter_driver_get_type (void);
+GType camel_filter_driver_get_type (void);
CamelFilterDriver *camel_filter_driver_new (struct _CamelSession *);
/* modifiers */
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index e92c159..85d7c22 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -594,7 +594,7 @@ run_command (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMess
camel_data_wrapper_write_to_stream (
CAMEL_DATA_WRAPPER (message), stream);
camel_stream_flush (stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
context = g_main_context_new ();
child_watch_data.loop = g_main_loop_new (context, FALSE);
@@ -762,13 +762,13 @@ camel_filter_search_match (CamelSession *session,
e_sexp_unref (sexp);
if (fms.message)
- camel_object_unref (fms.message);
+ g_object_unref (fms.message);
return retval;
error:
if (fms.message)
- camel_object_unref (fms.message);
+ g_object_unref (fms.message);
e_sexp_unref (sexp);
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 94c18a6..7483c70 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -58,6 +58,10 @@
#define r(x)
#define dd(x) if (camel_debug("search")) x
+#define CAMEL_FOLDER_SEARCH_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_FOLDER_SEARCH, CamelFolderSearchPrivate))
+
struct _CamelFolderSearchPrivate {
CamelException *ex;
@@ -65,8 +69,6 @@ struct _CamelFolderSearchPrivate {
GHashTable *threads_hash;
};
-#define _PRIVATE(o) (((CamelFolderSearch *)(o))->priv)
-
static ESExpResult *search_not(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
static ESExpResult *search_header_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
@@ -95,28 +97,45 @@ static ESExpResult *search_dummy(struct _ESExp *f, gint argc, struct _ESExpResul
static gint read_uid_callback (gpointer ref, gint ncol, gchar ** cols, gchar **name);
-static CamelObjectClass *camel_folder_search_parent;
+G_DEFINE_TYPE (CamelFolderSearch, camel_folder_search, CAMEL_TYPE_OBJECT)
static void
-folder_search_finalize (CamelObject *obj)
+folder_search_dispose (GObject *object)
{
- CamelFolderSearch *search = (CamelFolderSearch *)obj;
- struct _CamelFolderSearchPrivate *p = _PRIVATE(obj);
+ CamelFolderSearch *search = CAMEL_FOLDER_SEARCH (object);
- if (search->sexp)
- e_sexp_unref(search->sexp);
+ if (search->sexp != NULL) {
+ e_sexp_unref (search->sexp);
+ search->sexp = NULL;
+ }
- g_free(search->last_search);
- g_free(p);
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_folder_search_parent_class)->dispose (object);
+}
+
+static void
+folder_search_finalize (GObject *object)
+{
+ CamelFolderSearch *search = CAMEL_FOLDER_SEARCH (object);
+
+ g_free (search->last_search);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_folder_search_parent_class)->finalize (object);
}
static void
camel_folder_search_class_init (CamelFolderSearchClass *class)
{
- camel_folder_search_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
+ GObjectClass *object_class;
- class->not = search_not;
+ g_type_class_add_private (class, sizeof (CamelFolderSearchPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = folder_search_dispose;
+ object_class->finalize = folder_search_finalize;
+ class->not = search_not;
class->match_all = search_match_all;
class->match_threads = search_match_threads;
class->body_contains = search_body_contains;
@@ -141,31 +160,10 @@ camel_folder_search_class_init (CamelFolderSearchClass *class)
}
static void
-camel_folder_search_init (CamelFolderSearch *obj)
+camel_folder_search_init (CamelFolderSearch *search)
{
- struct _CamelFolderSearchPrivate *p;
-
- p = _PRIVATE(obj) = g_malloc0(sizeof(*p));
-
- obj->sexp = e_sexp_new();
-}
-
-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),
- sizeof (CamelFolderSearchClass),
- (CamelObjectClassInitFunc) camel_folder_search_class_init,
- NULL,
- (CamelObjectInitFunc) camel_folder_search_init,
- (CamelObjectFinalizeFunc) folder_search_finalize);
- }
-
- return type;
+ search->priv = CAMEL_FOLDER_SEARCH_GET_PRIVATE (search);
+ search->sexp = e_sexp_new();
}
static struct {
@@ -220,7 +218,7 @@ camel_folder_search_construct (CamelFolderSearch *search)
/* c is sure messy sometimes */
func = *((gpointer *)(((gchar *)class)+builtins[i].offset));
if (func == NULL && builtins[i].flags&1) {
- g_warning("Search class doesn't implement '%s' method: %s", builtins[i].name, camel_type_to_name(CAMEL_OBJECT_GET_CLASS(search)));
+ g_warning("Search class doesn't implement '%s' method: %s", builtins[i].name, G_OBJECT_TYPE_NAME (search));
func = (gpointer)search_dummy;
}
if (func != NULL) {
@@ -250,7 +248,7 @@ camel_folder_search_new (void)
{
CamelFolderSearch *new;
- new = CAMEL_FOLDER_SEARCH (camel_object_new (camel_folder_search_get_type ()));
+ new = g_object_new (CAMEL_TYPE_FOLDER_SEARCH, NULL);
camel_folder_search_construct(new);
return new;
@@ -301,10 +299,10 @@ void
camel_folder_search_set_body_index(CamelFolderSearch *search, CamelIndex *index)
{
if (search->body_index)
- camel_object_unref (search->body_index);
+ g_object_unref (search->body_index);
search->body_index = index;
if (index)
- camel_object_ref (index);
+ g_object_ref (index);
}
/**
@@ -334,7 +332,7 @@ camel_folder_search_execute_expression (CamelFolderSearch *search,
GPtrArray *matches;
gint i;
GHashTable *results;
- struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
+ CamelFolderSearchPrivate *p = search->priv;
p->ex = ex;
@@ -437,7 +435,7 @@ camel_folder_search_count (CamelFolderSearch *search,
GHashTable *results;
guint32 count = 0;
- struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
+ CamelFolderSearchPrivate *p = search->priv;
g_assert(search->folder);
@@ -589,7 +587,7 @@ camel_folder_search_search (CamelFolderSearch *search,
gchar *sql_query, *tmp, *tmp1;
GHashTable *results;
- struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
+ CamelFolderSearchPrivate *p = search->priv;
g_assert(search->folder);
@@ -1136,7 +1134,7 @@ check_header (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFold
}
if (message)
- camel_object_unref (message);
+ g_object_unref (message);
}
/* TODO: else, find all matches */
@@ -1226,7 +1224,7 @@ search_header_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, Ca
} else
r->value.boolean = FALSE;
- camel_object_unref (msg);
+ g_object_unref (msg);
} else {
r = e_sexp_result_new (f, ESEXP_RES_ARRAY_PTR);
r->value.ptrarray = g_ptr_array_new();
@@ -1281,7 +1279,7 @@ search_header_full_regex (struct _ESExp *f, gint argc, struct _ESExpResult **arg
} else
r->value.boolean = FALSE;
- camel_object_unref (msg);
+ g_object_unref (msg);
} else {
r = e_sexp_result_new (f, ESEXP_RES_ARRAY_PTR);
r->value.ptrarray = g_ptr_array_new();
@@ -1330,11 +1328,11 @@ match_message_index (CamelIndex *idx,
if (nc) {
while (!truth && (name = camel_index_cursor_next(nc)))
truth = strcmp(name, uid) == 0;
- camel_object_unref (nc);
+ g_object_unref (nc);
}
}
}
- camel_object_unref (wc);
+ g_object_unref (wc);
}
return truth;
@@ -1379,12 +1377,12 @@ match_words_index (CamelFolderSearch *search,
mask = (GPOINTER_TO_INT(g_hash_table_lookup(ht, name))) | (1<<i);
g_hash_table_insert(ht, (gchar *) camel_pstring_peek(name), GINT_TO_POINTER(mask));
}
- camel_object_unref (nc);
+ g_object_unref (nc);
}
}
}
}
- camel_object_unref (wc);
+ g_object_unref (wc);
lambdafoo.uids = result;
lambdafoo.count = (1<<words->len) - 1;
@@ -1439,7 +1437,7 @@ match_words_1message (CamelDataWrapper *object, struct _camel_search_words *word
}
}
- camel_object_unref (stream);
+ g_object_unref (stream);
}
return truth;
@@ -1460,7 +1458,7 @@ match_words_message (CamelFolder *folder,
if (msg) {
mask = 0;
truth = match_words_1message((CamelDataWrapper *)msg, words, &mask);
- camel_object_unref (msg);
+ g_object_unref (msg);
} else
camel_exception_clear (&x);
@@ -1594,7 +1592,7 @@ search_body_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, Came
} else
r->value.boolean = FALSE;
- camel_object_unref (msg);
+ g_object_unref (msg);
} else {
regex_t pattern;
@@ -1616,7 +1614,7 @@ search_body_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, Came
g_ptr_array_add (r->value.ptrarray, uid);
}
- camel_object_unref (message);
+ g_object_unref (message);
} else {
camel_exception_clear (&x);
}
diff --git a/camel/camel-folder-search.h b/camel/camel-folder-search.h
index 2fb7078..27a5ea0 100644
--- a/camel/camel-folder-search.h
+++ b/camel/camel-folder-search.h
@@ -30,12 +30,24 @@
#include <camel/camel-folder.h>
#include <camel/camel-index.h>
-#define CAMEL_FOLDER_SEARCH_TYPE (camel_folder_search_get_type ())
-#define CAMEL_FOLDER_SEARCH(obj) CAMEL_CHECK_CAST (obj, camel_folder_search_get_type (), CamelFolderSearch)
-#define CAMEL_FOLDER_SEARCH_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_folder_search_get_type (), CamelFolderSearchClass)
-#define CAMEL_IS_FOLDER_SEARCH(obj) CAMEL_CHECK_TYPE (obj, camel_folder_search_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_FOLDER_SEARCH \
+ (camel_folder_search_get_type ())
+#define CAMEL_FOLDER_SEARCH(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_FOLDER_SEARCH, CamelFolderSearch))
+#define CAMEL_FOLDER_SEARCH_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_FOLDER_SEARCH, CamelFolderSearchClass))
+#define CAMEL_IS_FOLDER_SEARCH(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_FOLDER_SEARCH))
+#define CAMEL_IS_FOLDER_SEARCH_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_FOLDER_SEARCH))
#define CAMEL_FOLDER_SEARCH_GET_CLASS(obj) \
- ((CamelFolderSearchClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_FOLDER_SEARCH, CamelFolderSearchClass))
G_BEGIN_DECLS
@@ -136,7 +148,7 @@ struct _CamelFolderSearchClass {
};
-CamelType camel_folder_search_get_type (void);
+GType camel_folder_search_get_type (void);
CamelFolderSearch *camel_folder_search_new (void);
void camel_folder_search_construct (CamelFolderSearch *search);
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index aeb38bd..e37583d 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -57,7 +57,10 @@
#include "camel-store.h"
#include "camel-vee-folder.h"
#include "camel-mime-part-utils.h"
-#include "camel-win32.h"
+
+#define CAMEL_FOLDER_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_FOLDER_SUMMARY, CamelFolderSummaryPrivate))
/* Make 5 minutes as default cache drop */
#define SUMMARY_CACHE_DROP 300
@@ -107,8 +110,6 @@ extern gint strdup_count, malloc_count, free_count;
#define CAMEL_FOLDER_SUMMARY_VERSION (14)
-#define CAMEL_FOLDER_SUMMARY_GET_PRIVATE(o) (((CamelFolderSummary *)(o))->priv)
-
#define META_SUMMARY_SUFFIX_LEN 5 /* strlen("-meta") */
#define EXTRACT_FIRST_STRING(val) len=strtoul (part, &part, 10); if (*part) part++; val=g_strndup (part, len); part+=len;
@@ -154,126 +155,824 @@ static gchar *next_uid_string(CamelFolderSummary *s);
static CamelMessageContentInfo * summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimeParser *mp);
static CamelMessageContentInfo * summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimePart *object);
-static void camel_folder_summary_class_init (CamelFolderSummaryClass *class);
-static void camel_folder_summary_init (CamelFolderSummary *obj);
-static void camel_folder_summary_finalize (CamelObject *obj);
-
-static CamelObjectClass *camel_folder_summary_parent;
static CamelMessageInfo * message_info_from_uid (CamelFolderSummary *s, const gchar *uid);
+G_DEFINE_TYPE (CamelFolderSummary, camel_folder_summary, CAMEL_TYPE_OBJECT)
+
static void
-camel_folder_summary_init (CamelFolderSummary *s)
+free_o_name(gpointer key, gpointer value, gpointer data)
{
- struct _CamelFolderSummaryPrivate *p;
+ g_object_unref (value);
+ g_free(key);
+}
- p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s) = g_malloc0(sizeof(*p));
+static void
+folder_summary_dispose (GObject *object)
+{
+ CamelFolderSummaryPrivate *priv;
- p->filter_charset = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
+ priv = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (object);
- p->flag_cache = g_hash_table_new (g_str_hash, g_str_equal);
+ if (priv->filter_index != NULL) {
+ g_object_unref (priv->filter_index);
+ priv->filter_index = NULL;
+ }
- s->message_info_chunks = NULL;
- s->content_info_chunks = NULL;
- p->need_preview = FALSE;
- p->preview_updates = g_hash_table_new (g_str_hash, g_str_equal);
+ if (priv->filter_64 != NULL) {
+ g_object_unref (priv->filter_64);
+ priv->filter_64 = NULL;
+ }
- s->version = CAMEL_FOLDER_SUMMARY_VERSION;
- s->flags = 0;
- s->time = 0;
- s->nextuid = 1;
+ if (priv->filter_qp != NULL) {
+ g_object_unref (priv->filter_qp);
+ priv->filter_qp = NULL;
+ }
- s->uids = g_ptr_array_new ();
- s->loaded_infos = g_hash_table_new (g_str_hash, g_str_equal);
+ if (priv->filter_uu != NULL) {
+ g_object_unref (priv->filter_uu);
+ priv->filter_uu = NULL;
+ }
- p->summary_lock = g_mutex_new();
- p->io_lock = g_mutex_new();
- p->filter_lock = g_mutex_new();
- p->alloc_lock = g_mutex_new();
- p->ref_lock = g_mutex_new();
+ if (priv->filter_save != NULL) {
+ g_object_unref (priv->filter_save);
+ priv->filter_save = NULL;
+ }
- s->meta_summary = g_malloc0(sizeof(CamelFolderMetaSummary));
+ if (priv->filter_html != NULL) {
+ g_object_unref (priv->filter_html);
+ priv->filter_html = NULL;
+ }
- /* Default is 20, any implementor having UIDs that has length
- exceeding 20, has to override this value
- */
- s->meta_summary->uid_len = 20;
- s->cache_load_time = 0;
- s->timeout_handle = 0;
-}
+ if (priv->filter_stream != NULL) {
+ g_object_unref (priv->filter_stream);
+ priv->filter_stream = NULL;
+ }
-static void free_o_name(gpointer key, gpointer value, gpointer data)
-{
- camel_object_unref (value);
- g_free(key);
+ if (priv->index != NULL) {
+ g_object_unref (priv->index);
+ priv->index = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_folder_summary_parent_class)->dispose (object);
}
static void
-camel_folder_summary_finalize (CamelObject *obj)
+folder_summary_finalize (GObject *object)
{
- struct _CamelFolderSummaryPrivate *p;
- CamelFolderSummary *s = (CamelFolderSummary *)obj;
+ CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (object);
- p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE(obj);
- g_hash_table_destroy (p->flag_cache);
- if (s->timeout_handle)
- g_source_remove (s->timeout_handle);
+ g_hash_table_destroy (summary->priv->flag_cache);
+ if (summary->timeout_handle)
+ g_source_remove (summary->timeout_handle);
/*camel_folder_summary_clear(s);*/
- g_ptr_array_foreach (s->uids, (GFunc) camel_pstring_free, NULL);
- g_ptr_array_free (s->uids, TRUE);
- g_hash_table_destroy (s->loaded_infos);
+ g_ptr_array_foreach (summary->uids, (GFunc) camel_pstring_free, NULL);
+ g_ptr_array_free (summary->uids, TRUE);
+ g_hash_table_destroy (summary->loaded_infos);
- g_hash_table_foreach(p->filter_charset, free_o_name, NULL);
- g_hash_table_destroy(p->filter_charset);
+ g_hash_table_foreach(summary->priv->filter_charset, free_o_name, NULL);
+ g_hash_table_destroy(summary->priv->filter_charset);
- g_free(s->summary_path);
-
- if (p->filter_index)
- camel_object_unref (p->filter_index);
- if (p->filter_64)
- camel_object_unref (p->filter_64);
- if (p->filter_qp)
- camel_object_unref (p->filter_qp);
- if (p->filter_uu)
- camel_object_unref (p->filter_uu);
- if (p->filter_save)
- camel_object_unref (p->filter_save);
- if (p->filter_html)
- camel_object_unref (p->filter_html);
-
- if (p->filter_stream)
- camel_object_unref (p->filter_stream);
- if (p->index)
- camel_object_unref (p->index);
+ g_free(summary->summary_path);
/* Freeing memory occupied by meta-summary-header */
- g_free(s->meta_summary->path);
- g_free(s->meta_summary);
+ g_free(summary->meta_summary->path);
+ g_free(summary->meta_summary);
+
+ g_mutex_free(summary->priv->summary_lock);
+ g_mutex_free(summary->priv->io_lock);
+ g_mutex_free(summary->priv->filter_lock);
+ g_mutex_free(summary->priv->alloc_lock);
+ g_mutex_free(summary->priv->ref_lock);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_folder_summary_parent_class)->finalize (object);
+}
+
+static gint
+summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *record)
+{
+ io(printf("Loading header from db \n"));
+
+ s->version = record->version;
+
+ /* We may not worry, as we are setting a new standard here */
+#if 0
+ /* Legacy version check, before version 12 we have no upgrade knowledge */
+ if ((s->version > 0xff) && (s->version & 0xff) < 12) {
+ io(printf ("Summary header version mismatch"));
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (!(s->version < 0x100 && s->version >= 13))
+ io(printf("Loading legacy summary\n"));
+ else
+ io(printf("loading new-format summary\n"));
+#endif
+
+ s->flags = record->flags;
+ s->nextuid = record->nextuid;
+ s->time = record->time;
+ s->saved_count = record->saved_count;
+
+ s->unread_count = record->unread_count;
+ s->deleted_count = record->deleted_count;
+ s->junk_count = record->junk_count;
+ s->visible_count = record->visible_count;
+ s->junk_not_deleted_count = record->jnd_count;
+
+ return 0;
+}
+
+static CamelFIRecord *
+summary_header_to_db (CamelFolderSummary *s,
+ CamelException *ex)
+{
+ CamelFIRecord * record = g_new0 (CamelFIRecord, 1);
+ CamelDB *db;
+ gchar *table_name;
+
+ /* Though we are going to read, we do this during write, so lets use it that way */
+ db = s->folder->parent_store->cdb_w;
+ table_name = s->folder->full_name;
+
+ io(printf("Savining header to db\n"));
+
+ record->folder_name = table_name;
+
+ /* we always write out the current version */
+ record->version = CAMEL_FOLDER_SUMMARY_VERSION;
+ record->flags = s->flags;
+ record->nextuid = s->nextuid;
+ record->time = s->time;
+
+ /* FIXME: Ever heard of Constructors and initializing ? */
+ if (camel_db_count_total_message_info (db, table_name, &(record->saved_count), NULL))
+ record->saved_count = 0;
+ if (camel_db_count_junk_message_info (db, table_name, &(record->junk_count), NULL))
+ record->junk_count = 0;
+ if (camel_db_count_deleted_message_info (db, table_name, &(record->deleted_count), NULL))
+ record->deleted_count = 0;
+ if (camel_db_count_unread_message_info (db, table_name, &(record->unread_count), NULL))
+ record->unread_count = 0;
+ if (camel_db_count_visible_message_info (db, table_name, &(record->visible_count), NULL))
+ record->visible_count = 0;
+ if (camel_db_count_junk_not_deleted_message_info (db, table_name, &(record->jnd_count), NULL))
+ record->jnd_count = 0;
+
+ s->unread_count = record->unread_count;
+ s->deleted_count = record->deleted_count;
+ s->junk_count = record->junk_count;
+ s->visible_count = record->visible_count;
+ s->junk_not_deleted_count = record->jnd_count;
+
+ return record;
+}
+
+static CamelMessageInfo *
+message_info_from_db (CamelFolderSummary *s, CamelMIRecord *record)
+{
+ CamelMessageInfoBase *mi;
+ gint i;
+ gint count;
+ gchar *part, *label;
+
+ mi = (CamelMessageInfoBase *)camel_message_info_new(s);
+
+ io(printf("Loading message info from db\n"));
+
+ mi->flags = record->flags;
+ mi->size = record->size;
+ mi->date_sent = record->dsent;
+ mi->date_received = record->dreceived;
+
+ mi->uid = (gchar *) camel_pstring_strdup (record->uid);
+ mi->subject = (gchar *) camel_pstring_add (record->subject, FALSE);
+ mi->from = (gchar *) camel_pstring_add (record->from, FALSE);
+ mi->to = (gchar *) camel_pstring_add (record->to, FALSE);
+ mi->cc = (gchar *) camel_pstring_add (record->cc, FALSE);
+ mi->mlist = (gchar *) camel_pstring_add (record->mlist, FALSE);
+
+ /* Evolution itself doesn't yet use this, so we ignore it (saving some memory) */
+ mi->bodystructure = NULL;
+
+ /* Extract Message id & References */
+ mi->content = NULL;
+ part = record->part;
+ if (part) {
+ EXTRACT_FIRST_DIGIT (mi->message_id.id.part.hi)
+ EXTRACT_DIGIT (mi->message_id.id.part.lo)
+ EXTRACT_DIGIT (count)
+
+ if (count > 0) {
+ mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
+ mi->references->size = count;
+ for (i=0;i<count;i++) {
+ EXTRACT_DIGIT (mi->references->references[i].id.part.hi)
+ EXTRACT_DIGIT (mi->references->references[i].id.part.lo)
+ }
+ } else
+ mi->references = NULL;
+
+ }
+
+ /* Extract User flags/labels */
+ part = record->labels;
+ if (part) {
+ label = part;
+ for (i=0;part[i];i++) {
+
+ if (part[i] == ' ') {
+ part[i] = 0;
+ camel_flag_set(&mi->user_flags, label, TRUE);
+ label = &(part[i+1]);
+ }
+ }
+ camel_flag_set(&mi->user_flags, label, TRUE);
+ }
+
+ /* Extract User tags */
+ part = record->usertags;
+ EXTRACT_FIRST_DIGIT (count)
+ for (i=0;i<count;i++) {
+ gint len;
+ gchar *name, *value;
+ EXTRACT_STRING (name)
+ EXTRACT_STRING (value)
+ camel_tag_set(&mi->user_tags, name, value);
+ g_free(name);
+ g_free(value);
+ }
+
+ return (CamelMessageInfo *) mi;
+}
+
+static CamelMIRecord *
+message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
+{
+ CamelMIRecord *record = g_new0(CamelMIRecord, 1);
+ CamelMessageInfoBase *mi = (CamelMessageInfoBase *) info;
+ GString *tmp;
+ CamelFlag *flag;
+ CamelTag *tag;
+ gint count, i;
+
+ /* Assume that we dont have to take care of DB Safeness. It will be done while doing the DB transaction */
+ record->uid = (gchar *) camel_pstring_strdup(camel_message_info_uid(mi));
+ record->flags = mi->flags;
+
+ record->read = ((mi->flags & (CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_JUNK))) ? 1 : 0;
+ record->deleted = mi->flags & CAMEL_MESSAGE_DELETED ? 1 : 0;
+ record->replied = mi->flags & CAMEL_MESSAGE_ANSWERED ? 1 : 0;
+ record->important = mi->flags & CAMEL_MESSAGE_FLAGGED ? 1 : 0;
+ record->junk = mi->flags & CAMEL_MESSAGE_JUNK ? 1 : 0;
+ record->dirty = mi->flags & CAMEL_MESSAGE_FOLDER_FLAGGED ? 1 : 0;
+ record->attachment = mi->flags & CAMEL_MESSAGE_ATTACHMENTS ? 1 : 0;
+
+ record->size = mi->size;
+ record->dsent = mi->date_sent;
+ record->dreceived = mi->date_received;
+
+ record->subject = (gchar *) camel_pstring_strdup(camel_message_info_subject (mi));
+ record->from = (gchar *) camel_pstring_strdup(camel_message_info_from (mi));
+ record->to = (gchar *) camel_pstring_strdup(camel_message_info_to (mi));
+ record->cc = (gchar *) camel_pstring_strdup(camel_message_info_cc (mi));
+ record->mlist = (gchar *) camel_pstring_strdup(camel_message_info_mlist (mi));
+
+ record->followup_flag = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "follow-up"));
+ record->followup_completed_on = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "completed-on"));
+ record->followup_due_by = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "due-by"));
+
+ record->bodystructure = mi->bodystructure ? g_strdup (mi->bodystructure) : NULL;
+
+ tmp = g_string_new (NULL);
+ if (mi->references) {
+ g_string_append_printf (tmp, "%lu %lu %lu", (gulong)mi->message_id.id.part.hi, (gulong)mi->message_id.id.part.lo, (gulong)mi->references->size);
+ for (i=0;i<mi->references->size;i++)
+ g_string_append_printf (tmp, " %lu %lu", (gulong)mi->references->references[i].id.part.hi, (gulong)mi->references->references[i].id.part.lo);
+ } else {
+ g_string_append_printf (tmp, "%lu %lu %lu", (gulong)mi->message_id.id.part.hi, (gulong)mi->message_id.id.part.lo, (gulong) 0);
+ }
+ record->part = tmp->str;
+ g_string_free (tmp, FALSE);
+
+ tmp = g_string_new (NULL);
+ flag = mi->user_flags;
+ while (flag) {
+ g_string_append_printf (tmp, "%s ", flag->name);
+ flag = flag->next;
+ }
+
+ /* Strip off the last space */
+ if (tmp->len)
+ tmp->len--;
+
+ record->labels = tmp->str;
+ g_string_free (tmp, FALSE);
+
+ tmp = g_string_new (NULL);
+ count = camel_tag_list_size(&mi->user_tags);
+ g_string_append_printf (tmp, "%lu", (gulong)count);
+ tag = mi->user_tags;
+ while (tag) {
+ /* FIXME: Should we handle empty tags? Can it be empty? If it potential crasher ahead*/
+ g_string_append_printf (tmp, " %lu-%s %lu-%s", (gulong)strlen(tag->name), tag->name, (gulong)strlen(tag->value), tag->value);
+ tag = tag->next;
+ }
+ record->usertags = tmp->str;
+ g_string_free (tmp, FALSE);
+
+ return record;
+}
+
+static CamelMessageContentInfo *
+content_info_from_db(CamelFolderSummary *s, CamelMIRecord *record)
+{
+ CamelMessageContentInfo *ci;
+ gchar *type, *subtype;
+ guint32 count, i;
+ CamelContentType *ct;
+ gchar *part = record->cinfo;
+ gint len;
+
+ io(printf("Loading content info from db\n"));
+
+ if (!part)
+ return NULL;
+
+ ci = camel_folder_summary_content_info_new(s);
+ if (*part == ' ') part++; /* Move off the space in the record*/
+
+ EXTRACT_FIRST_STRING (type)
+ EXTRACT_STRING (subtype)
+ ct = camel_content_type_new(type, subtype);
+ g_free(type); /* can this be removed? */
+ g_free(subtype);
+ EXTRACT_DIGIT (count)
+
+ for (i = 0; i < count; i++) {
+ gchar *name, *value;
+ EXTRACT_STRING (name)
+ EXTRACT_STRING (value)
+
+ camel_content_type_set_param(ct, name, value);
+ /* TODO: do this so we dont have to double alloc/free */
+ g_free(name);
+ g_free(value);
+ }
+ ci->type = ct;
+
+ /* FIXME[disk-summary] move all these to camel pstring */
+ EXTRACT_STRING (ci->id);
+ EXTRACT_STRING (ci->description)
+ EXTRACT_STRING (ci->encoding)
+ EXTRACT_DIGIT (ci->size)
+
+ record->cinfo = part; /* Keep moving the cursor in the record */
+
+ ci->childs = NULL;
+
+ return ci;
+}
+
+static gint
+content_info_to_db(CamelFolderSummary *s, CamelMessageContentInfo *ci, CamelMIRecord *record)
+{
+ CamelContentType *ct;
+ struct _camel_header_param *hp;
+ GString *str = g_string_new (NULL);
+ gchar *oldr;
+
+ io(printf("Saving content info to db\n"));
+
+ ct = ci->type;
+ if (ct) {
+ if (ct->type)
+ g_string_append_printf (str, " %d-%s", (gint) strlen (ct->type), ct->type);
+ else
+ g_string_append_printf (str, " 0-");
+ if (ct->subtype)
+ g_string_append_printf (str, " %d-%s", (gint) strlen (ct->subtype), ct->subtype);
+ else
+ g_string_append_printf (str, " 0-");
+ g_string_append_printf (str, " %d", my_list_size((struct _node **)&ct->params));
+ hp = ct->params;
+ while (hp) {
+ if (hp->name)
+ g_string_append_printf (str, " %d-%s", (gint)strlen(hp->name), hp->name);
+ else
+ g_string_append_printf (str, " 0-");
+ if (hp->value)
+ g_string_append_printf (str, " %d-%s", (gint)strlen (hp->value), hp->value);
+ else
+ g_string_append_printf (str, " 0-");
+ hp = hp->next;
+ }
+ } else {
+ g_string_append_printf (str, " %d-", 0);
+ g_string_append_printf (str, " %d-", 0);
+ g_string_append_printf (str, " %d", 0);
+ }
+
+ if (ci->id)
+ g_string_append_printf (str, " %d-%s", (gint)strlen (ci->id), ci->id);
+ else
+ g_string_append_printf (str, " 0-");
+ if (ci->description)
+ g_string_append_printf (str, " %d-%s", (gint)strlen (ci->description), ci->description);
+ else
+ g_string_append_printf (str, " 0-");
+ if (ci->encoding)
+ g_string_append_printf (str, " %d-%s", (gint)strlen (ci->encoding), ci->encoding);
+ else
+ g_string_append_printf (str, " 0-");
+ g_string_append_printf (str, " %u", ci->size);
+
+ if (record->cinfo) {
+ oldr = record->cinfo;
+ record->cinfo = g_strconcat(oldr, str->str, NULL);
+ g_free (oldr); g_string_free (str, TRUE);
+ } else {
+ record->cinfo = str->str;
+ g_string_free (str, FALSE);
+ }
+
+ return 0;
+}
+
+static gint
+summary_header_save(CamelFolderSummary *s, FILE *out)
+{
+ gint unread = 0, deleted = 0, junk = 0, count, i;
+
+ fseek(out, 0, SEEK_SET);
+
+ io(printf("Savining header\n"));
+
+ /* we always write out the current version */
+ camel_file_util_encode_fixed_int32(out, CAMEL_FOLDER_SUMMARY_VERSION);
+ camel_file_util_encode_fixed_int32(out, s->flags);
+ camel_file_util_encode_fixed_int32(out, s->nextuid);
+ camel_file_util_encode_time_t(out, s->time);
+
+ count = camel_folder_summary_count(s);
+ for (i=0; i<count; i++) {
+ CamelMessageInfo *info = camel_folder_summary_index(s, i);
+ guint32 flags;
+
+ if (info == NULL)
+ continue;
+
+ flags = camel_message_info_flags(info);
+ if ((flags & CAMEL_MESSAGE_SEEN) == 0)
+ unread++;
+ if ((flags & CAMEL_MESSAGE_DELETED) != 0)
+ deleted++;
+ if ((flags & CAMEL_MESSAGE_JUNK) != 0)
+ junk++;
+
+ camel_message_info_free(info);
+ }
+
+ camel_file_util_encode_fixed_int32(out, count);
+ camel_file_util_encode_fixed_int32(out, unread);
+ camel_file_util_encode_fixed_int32(out, deleted);
+
+ return camel_file_util_encode_fixed_int32(out, junk);
+}
+
+static CamelMessageInfo *
+message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
+{
+ CamelMessageInfoBase *to, *from = (CamelMessageInfoBase *)mi;
+ CamelFlag *flag;
+ CamelTag *tag;
+
+ to = (CamelMessageInfoBase *)camel_message_info_new(s);
+
+ to->flags = from->flags;
+ to->size = from->size;
+ to->date_sent = from->date_sent;
+ to->date_received = from->date_received;
+ to->refcount = 1;
+
+ /* NB: We don't clone the uid */
+
+ to->subject = camel_pstring_strdup(from->subject);
+ to->from = camel_pstring_strdup(from->from);
+ to->to = camel_pstring_strdup(from->to);
+ to->cc = camel_pstring_strdup(from->cc);
+ to->mlist = camel_pstring_strdup(from->mlist);
+ memcpy(&to->message_id, &from->message_id, sizeof(to->message_id));
+ to->preview = g_strdup (from->preview);
+ if (from->references) {
+ gint len = sizeof(*from->references) + ((from->references->size-1) * sizeof(from->references->references[0]));
+
+ to->references = g_malloc(len);
+ memcpy(to->references, from->references, len);
+ }
+
+ flag = from->user_flags;
+ while (flag) {
+ camel_flag_set(&to->user_flags, flag->name, TRUE);
+ flag = flag->next;
+ }
+
+ tag = from->user_tags;
+ while (tag) {
+ camel_tag_set(&to->user_tags, tag->name, tag->value);
+ tag = tag->next;
+ }
+
+ if (from->content) {
+ /* FIXME: copy content-infos */
+ }
+
+ return (CamelMessageInfo *)to;
+}
+
+static gconstpointer
+info_ptr(const CamelMessageInfo *mi, gint id)
+{
+ switch (id) {
+ case CAMEL_MESSAGE_INFO_SUBJECT:
+ return ((const CamelMessageInfoBase *)mi)->subject;
+ case CAMEL_MESSAGE_INFO_FROM:
+ return ((const CamelMessageInfoBase *)mi)->from;
+ case CAMEL_MESSAGE_INFO_TO:
+ return ((const CamelMessageInfoBase *)mi)->to;
+ case CAMEL_MESSAGE_INFO_CC:
+ return ((const CamelMessageInfoBase *)mi)->cc;
+ case CAMEL_MESSAGE_INFO_MLIST:
+ return ((const CamelMessageInfoBase *)mi)->mlist;
+ case CAMEL_MESSAGE_INFO_MESSAGE_ID:
+ return &((const CamelMessageInfoBase *)mi)->message_id;
+ case CAMEL_MESSAGE_INFO_REFERENCES:
+ return ((const CamelMessageInfoBase *)mi)->references;
+ case CAMEL_MESSAGE_INFO_USER_FLAGS:
+ return ((const CamelMessageInfoBase *)mi)->user_flags;
+ case CAMEL_MESSAGE_INFO_USER_TAGS:
+ return ((const CamelMessageInfoBase *)mi)->user_tags;
+ case CAMEL_MESSAGE_INFO_HEADERS:
+ return ((const CamelMessageInfoBase *)mi)->headers;
+ case CAMEL_MESSAGE_INFO_CONTENT:
+ return ((const CamelMessageInfoBase *)mi)->content;
+ case CAMEL_MESSAGE_INFO_PREVIEW:
+ return ((const CamelMessageInfoBase *)mi)->preview;
+ default:
+ g_return_val_if_reached (NULL);
+ }
+}
+
+static guint32
+info_uint32(const CamelMessageInfo *mi, gint id)
+{
+ switch (id) {
+ case CAMEL_MESSAGE_INFO_FLAGS:
+ return ((const CamelMessageInfoBase *)mi)->flags;
+ case CAMEL_MESSAGE_INFO_SIZE:
+ return ((const CamelMessageInfoBase *)mi)->size;
+ default:
+ g_return_val_if_reached (0);
+ }
+}
+
+static time_t
+info_time(const CamelMessageInfo *mi, gint id)
+{
+ switch (id) {
+ case CAMEL_MESSAGE_INFO_DATE_SENT:
+ return ((const CamelMessageInfoBase *)mi)->date_sent;
+ case CAMEL_MESSAGE_INFO_DATE_RECEIVED:
+ return ((const CamelMessageInfoBase *)mi)->date_received;
+ default:
+ g_return_val_if_reached (0);
+ }
+}
+
+static gboolean
+info_user_flag(const CamelMessageInfo *mi, const gchar *id)
+{
+ return camel_flag_get(&((CamelMessageInfoBase *)mi)->user_flags, id);
+}
+
+static const gchar *
+info_user_tag(const CamelMessageInfo *mi, const gchar *id)
+{
+ return camel_tag_get(&((CamelMessageInfoBase *)mi)->user_tags, id);
+}
+
+static gboolean
+info_set_user_flag(CamelMessageInfo *info, const gchar *name, gboolean value)
+{
+ CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
+ gint res;
+
+ res = camel_flag_set(&mi->user_flags, name, value);
+
+ /* TODO: check this item is still in the summary first */
+ if (mi->summary && res && mi->summary->folder && mi->uid) {
+ CamelFolderChangeInfo *changes = camel_folder_change_info_new();
- 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);
+ mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+ mi->dirty = TRUE;
+ camel_folder_summary_touch(mi->summary);
+ camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
+ camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
+ camel_folder_change_info_free(changes);
+ }
- g_free(p);
+ return res;
}
-CamelType
-camel_folder_summary_get_type (void)
+static gboolean
+info_set_user_tag(CamelMessageInfo *info, const gchar *name, const gchar *value)
+{
+ CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
+ gint res;
+
+ res = camel_tag_set(&mi->user_tags, name, value);
+
+ if (mi->summary && res && mi->summary->folder && mi->uid) {
+ CamelFolderChangeInfo *changes = camel_folder_change_info_new();
+
+ mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+ mi->dirty = TRUE;
+ camel_folder_summary_touch(mi->summary);
+ camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
+ camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
+ camel_folder_change_info_free(changes);
+ }
+
+ return res;
+}
+
+static gboolean
+info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set)
{
- static CamelType type = CAMEL_INVALID_TYPE;
+ guint32 old;
+ CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
+ gint read=0, deleted=0, junk=0;
+ /* TODO: locking? */
+
+ if (flags & CAMEL_MESSAGE_SEEN && ((set & CAMEL_MESSAGE_SEEN) != (mi->flags & CAMEL_MESSAGE_SEEN)))
+ { read = set & CAMEL_MESSAGE_SEEN ? 1 : -1; d(printf("Setting read as %d\n", set & CAMEL_MESSAGE_SEEN ? 1 : 0));}
+
+ if (flags & CAMEL_MESSAGE_DELETED && ((set & CAMEL_MESSAGE_DELETED) != (mi->flags & CAMEL_MESSAGE_DELETED)))
+ { deleted = set & CAMEL_MESSAGE_DELETED ? 1 : -1; d(printf("Setting deleted as %d\n", set & CAMEL_MESSAGE_DELETED ? 1 : 0));}
+
+ if (flags & CAMEL_MESSAGE_JUNK && ((set & CAMEL_MESSAGE_JUNK) != (mi->flags & CAMEL_MESSAGE_JUNK)))
+ { junk = set & CAMEL_MESSAGE_JUNK ? 1 : -1; d(printf("Setting junk as %d\n", set & CAMEL_MESSAGE_JUNK ? 1 : 0));}
+
+ old = mi->flags;
+ mi->flags = (old & ~flags) | (set & flags);
+ if (old != mi->flags) {
+ mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+ mi->dirty = TRUE;
+ if (mi->summary)
+ camel_folder_summary_touch(mi->summary);
+ }
+
+ if (((old & ~CAMEL_MESSAGE_SYSTEM_MASK) == (mi->flags & ~CAMEL_MESSAGE_SYSTEM_MASK)) && !((set & CAMEL_MESSAGE_JUNK_LEARN) && !(set & CAMEL_MESSAGE_JUNK)))
+ return FALSE;
+
+ if (mi->summary) {
+ if (read && junk == 0 && !(mi->flags & CAMEL_MESSAGE_JUNK))
+ mi->summary->unread_count -= read;
+ else if (junk > 0)
+ mi->summary->unread_count -= (old & CAMEL_MESSAGE_SEEN) ? 0 : 1;
+ else if (junk < 0)
+ mi->summary->unread_count -= (old & CAMEL_MESSAGE_SEEN) ? 0 : -1;
+
+ if (deleted)
+ mi->summary->deleted_count += deleted;
+ if (junk)
+ mi->summary->junk_count += junk;
+ if (junk && !deleted)
+ mi->summary->junk_not_deleted_count += junk;
+ else if ((mi->flags & CAMEL_MESSAGE_JUNK) && deleted)
+ mi->summary->junk_not_deleted_count -= deleted;
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (), "CamelFolderSummary",
- sizeof (CamelFolderSummary),
- sizeof (CamelFolderSummaryClass),
- (CamelObjectClassInitFunc) camel_folder_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_folder_summary_init,
- (CamelObjectFinalizeFunc) camel_folder_summary_finalize);
+ if (((junk && !(mi->flags & CAMEL_MESSAGE_DELETED)))|| (deleted && !(mi->flags & CAMEL_MESSAGE_JUNK)) )
+ mi->summary->visible_count -= junk ? junk : deleted;
+ }
+ if (mi->uid)
+ g_hash_table_replace (CAMEL_FOLDER_SUMMARY_GET_PRIVATE(mi->summary)->flag_cache, (gchar *)mi->uid, GUINT_TO_POINTER(mi->flags));
+ if (mi->summary && mi->summary->folder && mi->uid) {
+ CamelFolderChangeInfo *changes = camel_folder_change_info_new();
+
+ camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
+ camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
+ camel_folder_change_info_free(changes);
}
- return type;
+ d(printf("%d %d %d %d %d\n", mi->summary->unread_count, mi->summary->deleted_count, mi->summary->junk_count, mi->summary->junk_not_deleted_count, mi->summary->visible_count));
+ return TRUE;
+}
+
+static void
+camel_folder_summary_class_init (CamelFolderSummaryClass *class)
+{
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelFolderSummaryPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = folder_summary_dispose;
+ object_class->finalize = folder_summary_finalize;
+
+ class->message_info_size = sizeof (CamelMessageInfoBase);
+ class->content_info_size = sizeof (CamelMessageContentInfo);
+
+ class->summary_header_load = summary_header_load;
+ class->summary_header_save = summary_header_save;
+
+ class->summary_header_from_db = summary_header_from_db;
+ class->summary_header_to_db = summary_header_to_db;
+ class->message_info_from_db = message_info_from_db;
+ class->message_info_to_db = message_info_to_db;
+ class->content_info_from_db = content_info_from_db;
+ class->content_info_to_db = content_info_to_db;
+
+ class->message_info_new_from_header = message_info_new_from_header;
+ class->message_info_new_from_parser = message_info_new_from_parser;
+ class->message_info_new_from_message = message_info_new_from_message;
+ class->message_info_load = message_info_load;
+ class->message_info_save = message_info_save;
+ class->meta_message_info_save = meta_message_info_save;
+ class->message_info_free = message_info_free;
+ class->message_info_clone = message_info_clone;
+ class->message_info_from_uid = message_info_from_uid;
+
+ class->content_info_new_from_header = content_info_new_from_header;
+ class->content_info_new_from_parser = content_info_new_from_parser;
+ class->content_info_new_from_message = content_info_new_from_message;
+ class->content_info_load = content_info_load;
+ class->content_info_save = content_info_save;
+ class->content_info_free = content_info_free;
+
+ class->next_uid_string = next_uid_string;
+
+ class->info_ptr = info_ptr;
+ class->info_uint32 = info_uint32;
+ class->info_time = info_time;
+ class->info_user_flag = info_user_flag;
+ class->info_user_tag = info_user_tag;
+
+#if 0
+ class->info_set_string = info_set_string;
+ class->info_set_uint32 = info_set_uint32;
+ class->info_set_time = info_set_time;
+ class->info_set_ptr = info_set_ptr;
+#endif
+ class->info_set_user_flag = info_set_user_flag;
+ class->info_set_user_tag = info_set_user_tag;
+
+ class->info_set_flags = info_set_flags;
+
+}
+
+static void
+camel_folder_summary_init (CamelFolderSummary *summary)
+{
+ summary->priv = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (summary);
+
+ summary->priv->filter_charset = g_hash_table_new (
+ camel_strcase_hash, camel_strcase_equal);
+
+ summary->priv->flag_cache = g_hash_table_new (g_str_hash, g_str_equal);
+
+ summary->message_info_chunks = NULL;
+ summary->content_info_chunks = NULL;
+ summary->priv->need_preview = FALSE;
+ summary->priv->preview_updates = g_hash_table_new (g_str_hash, g_str_equal);
+#if defined (DOESTRV) || defined (DOEPOOLV)
+ summary->message_info_strings = CAMEL_MESSAGE_INFO_LAST;
+#endif
+
+ summary->version = CAMEL_FOLDER_SUMMARY_VERSION;
+ summary->flags = 0;
+ summary->time = 0;
+ summary->nextuid = 1;
+
+ summary->uids = g_ptr_array_new ();
+ summary->loaded_infos = g_hash_table_new (g_str_hash, g_str_equal);
+
+ summary->priv->summary_lock = g_mutex_new();
+ summary->priv->io_lock = g_mutex_new();
+ summary->priv->filter_lock = g_mutex_new();
+ summary->priv->alloc_lock = g_mutex_new();
+ summary->priv->ref_lock = g_mutex_new();
+
+ summary->meta_summary = g_malloc0(sizeof(CamelFolderMetaSummary));
+
+ /* Default is 20, any implementor having UIDs that has length
+ exceeding 20, has to override this value
+ */
+ summary->meta_summary->uid_len = 20;
+ summary->cache_load_time = 0;
+ summary->timeout_handle = 0;
}
/**
@@ -287,8 +986,9 @@ camel_folder_summary_get_type (void)
CamelFolderSummary *
camel_folder_summary_new (struct _CamelFolder *folder)
{
- CamelFolderSummary *new = CAMEL_FOLDER_SUMMARY ( camel_object_new (camel_folder_summary_get_type ()));
+ CamelFolderSummary *new;
+ new = g_object_new (CAMEL_TYPE_FOLDER_SUMMARY, NULL);
new->folder = folder;
return new;
@@ -331,11 +1031,11 @@ camel_folder_summary_set_index(CamelFolderSummary *s, CamelIndex *index)
struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s);
if (p->index)
- camel_object_unref (p->index);
+ g_object_unref (p->index);
p->index = index;
if (index)
- camel_object_ref (index);
+ g_object_ref (index);
}
/**
@@ -589,7 +1289,9 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
data.double_ref = TRUE;
data.add = FALSE;
- ret = camel_db_read_message_info_record_with_uid (cdb, folder_name, uid, &data, camel_read_mir_callback, &ex);
+ ret = camel_db_read_message_info_record_with_uid (
+ cdb, folder_name, uid, &data,
+ camel_read_mir_callback, &ex);
if (ret != 0) {
camel_exception_clear (&ex);
return NULL;
@@ -632,11 +1334,18 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
* Returns: the summary item, or %NULL if the uid @uid is not available
**/
CamelMessageInfo *
-camel_folder_summary_uid (CamelFolderSummary *s, const gchar *uid)
+camel_folder_summary_uid (CamelFolderSummary *summary,
+ const gchar *uid)
{
- if (!s)
- return NULL;
- return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_from_uid(s, uid);
+ CamelFolderSummaryClass *class;
+
+ g_return_val_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary), NULL);
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ class = CAMEL_FOLDER_SUMMARY_GET_CLASS (summary);
+ g_return_val_if_fail (class->message_info_from_uid != NULL, NULL);
+
+ return class->message_info_from_uid (summary, uid);
}
/**
@@ -694,9 +1403,16 @@ camel_folder_summary_set_uid(CamelFolderSummary *s, guint32 uid)
* This string must be freed by the caller.
**/
gchar *
-camel_folder_summary_next_uid_string(CamelFolderSummary *s)
+camel_folder_summary_next_uid_string (CamelFolderSummary *summary)
{
- return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->next_uid_string(s);
+ CamelFolderSummaryClass *class;
+
+ g_return_val_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary), NULL);
+
+ class = CAMEL_FOLDER_SUMMARY_GET_CLASS (summary);
+ g_return_val_if_fail (class->next_uid_string != NULL, NULL);
+
+ return class->next_uid_string (summary);
}
static CamelMessageContentInfo *
@@ -707,7 +1423,7 @@ perform_content_info_load_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
CamelMessageContentInfo *ci, *pci;
gchar *part;
- ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_from_db (s, mir);
+ ci = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->content_info_from_db (s, mir);
if (ci == NULL)
return NULL;
part = mir->cinfo;
@@ -739,7 +1455,7 @@ perform_content_info_load(CamelFolderSummary *s, FILE *in)
guint32 count;
CamelMessageContentInfo *ci, *part;
- ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_load(s, in);
+ ci = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->content_info_load (s, in);
if (ci == NULL)
return NULL;
@@ -865,7 +1581,7 @@ remove_cache (CamelSession *session, CamelSessionThreadMsg *msg)
static void remove_cache_end (CamelSession *session, CamelSessionThreadMsg *msg)
{
struct _folder_summary_free_msg *m = (struct _folder_summary_free_msg *)msg;
- camel_object_unref (m->summary);
+ g_object_unref (m->summary);
}
static CamelSessionThreadOps remove_timeout_ops = {
@@ -892,7 +1608,7 @@ cfs_try_release_memory (CamelFolderSummary *s)
return TRUE;
m = camel_session_thread_msg_new(session, &remove_timeout_ops, sizeof(*m));
- m->summary = camel_object_ref (s);
+ m->summary = g_object_ref (s);
camel_session_thread_queue(session, &m->msg, 0);
return TRUE;
@@ -1015,7 +1731,8 @@ static CamelSessionThreadOps preview_update_ops = {
* Since: 2.24
**/
gint
-camel_folder_summary_reload_from_db (CamelFolderSummary *s, CamelException *ex)
+camel_folder_summary_reload_from_db (CamelFolderSummary *s,
+ CamelException *ex)
{
CamelDB *cdb;
gchar *folder_name;
@@ -1077,7 +1794,9 @@ camel_folder_summary_add_preview (CamelFolderSummary *s, CamelMessageInfo *info)
* Since: 2.28
**/
void
-camel_folder_summary_ensure_infos_loaded (CamelFolderSummary *s, gint at_least, CamelException *ex)
+camel_folder_summary_ensure_infos_loaded (CamelFolderSummary *s,
+ gint at_least,
+ CamelException *ex)
{
guint loaded, known;
@@ -1123,7 +1842,8 @@ camel_folder_summary_get_flag_cache (CamelFolderSummary *summary)
* Since: 2.24
**/
gint
-camel_folder_summary_load_from_db (CamelFolderSummary *s, CamelException *ex)
+camel_folder_summary_load_from_db (CamelFolderSummary *s,
+ CamelException *ex)
{
CamelDB *cdb;
gchar *folder_name;
@@ -1145,7 +1865,9 @@ camel_folder_summary_load_from_db (CamelFolderSummary *s, CamelException *ex)
camel_exception_init (&ex2);
- ret = camel_db_get_folder_uids_flags (cdb, folder_name, s->sort_by, s->collate, s->uids, p->flag_cache, &ex2);
+ ret = camel_db_get_folder_uids_flags (
+ cdb, folder_name, s->sort_by, s->collate,
+ s->uids, p->flag_cache, &ex2);
if (camel_exception_is_set (&ex2) && camel_exception_get_description (&ex2) &&
strstr (camel_exception_get_description (&ex2), "no such table") != NULL) {
@@ -1252,7 +1974,7 @@ camel_read_mir_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
}
camel_folder_summary_unlock (s, CFS_SUMMARY_LOCK);
- info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_from_db (s, mir);
+ info = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_from_db (s, mir);
if (info) {
@@ -1321,12 +2043,13 @@ camel_folder_summary_load(CamelFolderSummary *s)
return -1;
camel_folder_summary_lock (s, CFS_IO_LOCK);
- if ( ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in) == -1)
+
+ if (CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_load (s, in) == -1)
goto error;
/* now read in each message ... */
for (i=0;i<s->saved_count;i++) {
- mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_load(s, in);
+ mi = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_load (s, in);
if (mi == NULL)
goto error;
@@ -1398,14 +2121,14 @@ camel_folder_summary_migrate_infos(CamelFolderSummary *s)
if (in == NULL)
return -1;
- if ( ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in) == -1)
+ if (CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_load (s, in) == -1)
goto error;
/* now read in each message ... */
for (i=0;i<s->saved_count;i++) {
CamelTag *tag;
- mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_load(s, in);
+ mi = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_load (s, in);
if (mi == NULL)
goto error;
@@ -1435,7 +2158,7 @@ camel_folder_summary_migrate_infos(CamelFolderSummary *s)
if (fclose (in) != 0)
return -1;
- record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, &ex));
+ record = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_to_db (s, NULL);
if (!record) {
return -1;
}
@@ -1476,7 +2199,7 @@ perform_content_info_save_to_db (CamelFolderSummary *s, CamelMessageContentInfo
CamelMessageContentInfo *part;
gchar *oldr;
- if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->content_info_to_db (s, ci, record) == -1)
+ if (CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->content_info_to_db (s, ci, record) == -1)
return -1;
oldr = record->cinfo;
@@ -1500,7 +2223,7 @@ perform_content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentI
{
CamelMessageContentInfo *part;
- if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->content_info_save (s, out, ci) == -1)
+ if (CAMEL_FOLDER_SUMMARY_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)
@@ -1537,7 +2260,7 @@ save_to_db_cb (gpointer key, gpointer value, gpointer data)
if (!args->migration && !mi->dirty)
return;
- mir = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_to_db (s, (CamelMessageInfo *)mi);
+ mir = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_to_db (s, (CamelMessageInfo *) mi);
if (mir && s->build_content) {
if (perform_content_info_save_to_db (s, ((CamelMessageInfoBase *)mi)->content, mir) == -1) {
@@ -1578,7 +2301,9 @@ save_to_db_cb (gpointer key, gpointer value, gpointer data)
}
static gint
-save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mirs, CamelException *ex)
+save_message_infos_to_db (CamelFolderSummary *s,
+ gboolean fresh_mirs,
+ CamelException *ex)
{
CamelDB *cdb = s->folder->parent_store->cdb_w;
gchar *folder_name;
@@ -1614,7 +2339,8 @@ msg_save_preview (const gchar *uid, gpointer value, CamelFolder *folder)
* Since: 2.24
**/
gint
-camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex)
+camel_folder_summary_save_to_db (CamelFolderSummary *s,
+ CamelException *ex)
{
CamelDB *cdb = s->folder->parent_store->cdb_w;
CamelFIRecord *record;
@@ -1670,7 +2396,7 @@ camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex)
camel_db_end_transaction (cdb, ex);
- record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, ex));
+ record = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_to_db (s, ex);
if (!record) {
s->flags |= CAMEL_SUMMARY_DIRTY;
return -1;
@@ -1698,7 +2424,8 @@ camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex)
* Since: 2.24
**/
gint
-camel_folder_summary_header_save_to_db (CamelFolderSummary *s, CamelException *ex)
+camel_folder_summary_header_save_to_db (CamelFolderSummary *s,
+ CamelException *ex)
{
CamelDB *cdb = s->folder->parent_store->cdb_w;
CamelFIRecord *record;
@@ -1706,7 +2433,7 @@ camel_folder_summary_header_save_to_db (CamelFolderSummary *s, CamelException *e
d(printf ("\ncamel_folder_summary_header_save_to_db called \n"));
- record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, ex));
+ record = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_to_db (s, ex);
if (!record) {
return -1;
}
@@ -1796,7 +2523,7 @@ camel_folder_summary_save(CamelFolderSummary *s)
camel_folder_summary_lock (s, CFS_IO_LOCK);
- if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_save(s, out) == -1)
+ if (CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_save (s, out) == -1)
goto exception;
if (summary_meta_header_save(s, out_meta) == -1)
@@ -1808,10 +2535,10 @@ camel_folder_summary_save(CamelFolderSummary *s)
count = s->messages->len;
for (i = 0; i < count; i++) {
mi = s->messages->pdata[i];
- if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->meta_message_info_save (s, out_meta, out, mi) == -1)
+ if (CAMEL_FOLDER_SUMMARY_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)
+ if (CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_save (s, out, mi) == -1)
goto exception;
if (s->build_content) {
@@ -1874,7 +2601,10 @@ exception:
* Since: 2.24
**/
gint
-camel_folder_summary_header_load_from_db (CamelFolderSummary *s, CamelStore *store, const gchar *folder_name, CamelException *ex)
+camel_folder_summary_header_load_from_db (CamelFolderSummary *s,
+ CamelStore *store,
+ const gchar *folder_name,
+ CamelException *ex)
{
CamelDB *cdb;
CamelFIRecord *record;
@@ -1889,7 +2619,7 @@ camel_folder_summary_header_load_from_db (CamelFolderSummary *s, CamelStore *sto
camel_db_read_folder_info_record (cdb, folder_name, &record, ex);
if (record) {
- if ( ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_from_db (s, record) == -1)
+ if (CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_from_db (s, record) == -1)
ret = -1;
} else {
ret = -1;
@@ -1935,8 +2665,10 @@ camel_folder_summary_header_load(CamelFolderSummary *s)
}
camel_folder_summary_lock (s, CFS_IO_LOCK);
- ret = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in);
+
+ ret = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->summary_header_load (s, in);
ret = summary_meta_header_load(s, in_meta);
+
camel_folder_summary_unlock (s, CFS_IO_LOCK);
fclose(in);
@@ -2171,9 +2903,17 @@ camel_folder_summary_add_from_message (CamelFolderSummary *s, CamelMimeMessage *
* #camel_message_info_free
**/
CamelMessageInfo *
-camel_folder_summary_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
+camel_folder_summary_info_new_from_header (CamelFolderSummary *summary,
+ struct _camel_header_raw *h)
{
- return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new_from_header(s, h);
+ CamelFolderSummaryClass *class;
+
+ g_return_val_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary), NULL);
+
+ class = CAMEL_FOLDER_SUMMARY_GET_CLASS (summary);
+ g_return_val_if_fail (class->message_info_new_from_header != NULL, NULL);
+
+ return class->message_info_new_from_header (summary, h);
}
/**
@@ -2211,7 +2951,7 @@ camel_folder_summary_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser
start = camel_mime_parser_tell(mp);
if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_EOF) {
- info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new_from_parser(s, mp);
+ info = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_new_from_parser (s, mp);
camel_mime_parser_unstep(mp);
@@ -2227,8 +2967,7 @@ camel_folder_summary_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser
p->filter_index = camel_mime_filter_index_new (p->index);
camel_index_delete_name(p->index, camel_message_info_uid(info));
name = camel_index_add_name(p->index, camel_message_info_uid(info));
- camel_mime_filter_index_set_name (
- CAMEL_MIME_FILTER_INDEX (p->filter_index), name);
+ camel_mime_filter_index_set_name(CAMEL_MIME_FILTER_INDEX (p->filter_index), name);
}
/* always scan the content info, even if we dont save it */
@@ -2236,7 +2975,7 @@ camel_folder_summary_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser
if (name && p->index) {
camel_index_write_name(p->index, name);
- camel_object_unref (name);
+ g_object_unref (name);
camel_mime_filter_index_set_name (
CAMEL_MIME_FILTER_INDEX (p->filter_index), NULL);
}
@@ -2266,7 +3005,7 @@ camel_folder_summary_info_new_from_message(CamelFolderSummary *s, CamelMimeMessa
struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s);
CamelIndexName *name = NULL;
- info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new_from_message(s, msg, bodystructure);
+ info = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_new_from_message (s, msg, bodystructure);
/* assign a unique uid, this is slightly 'wrong' as we do not really
* know if we are going to store this in the summary, but we need it set for indexing */
@@ -2287,7 +3026,7 @@ camel_folder_summary_info_new_from_message(CamelFolderSummary *s, CamelMimeMessa
CamelStream *null = camel_stream_null_new();
p->filter_stream = camel_stream_filter_new (null);
- camel_object_unref (null);
+ g_object_unref (null);
}
}
@@ -2295,7 +3034,7 @@ camel_folder_summary_info_new_from_message(CamelFolderSummary *s, CamelMimeMessa
if (name) {
camel_index_write_name(p->index, name);
- camel_object_unref (name);
+ g_object_unref (name);
camel_mime_filter_index_set_name (
CAMEL_MIME_FILTER_INDEX (p->filter_index), NULL);
}
@@ -2318,7 +3057,7 @@ camel_folder_summary_content_info_free(CamelFolderSummary *s, CamelMessageConten
CamelMessageContentInfo *pw, *pn;
pw = ci->childs;
- ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_free(s, ci);
+ CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->content_info_free (s, ci);
while (pw) {
pn = pw->next;
camel_folder_summary_content_info_free(s, pw);
@@ -2854,42 +3593,6 @@ summary_meta_header_load(CamelFolderSummary *s, FILE *in)
}
#endif
-static gint
-summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *record)
-{
- io(printf("Loading header from db \n"));
-
- s->version = record->version;
-
- /* We may not worry, as we are setting a new standard here */
-#if 0
- /* Legacy version check, before version 12 we have no upgrade knowledge */
- if ((s->version > 0xff) && (s->version & 0xff) < 12) {
- io(printf ("Summary header version mismatch"));
- errno = EINVAL;
- return -1;
- }
-
- if (!(s->version < 0x100 && s->version >= 13))
- io(printf("Loading legacy summary\n"));
- else
- io(printf("loading new-format summary\n"));
-#endif
-
- s->flags = record->flags;
- s->nextuid = record->nextuid;
- s->time = record->time;
- s->saved_count = record->saved_count;
-
- s->unread_count = record->unread_count;
- s->deleted_count = record->deleted_count;
- s->junk_count = record->junk_count;
- s->visible_count = record->visible_count;
- s->junk_not_deleted_count = record->jnd_count;
-
- return 0;
-}
-
static gint
summary_header_load(CamelFolderSummary *s, FILE *in)
{
@@ -2935,91 +3638,6 @@ summary_header_load(CamelFolderSummary *s, FILE *in)
return 0;
}
-static CamelFIRecord *
-summary_header_to_db (CamelFolderSummary *s, CamelException *ex)
-{
- CamelFIRecord * record = g_new0 (CamelFIRecord, 1);
- CamelDB *db;
- gchar *table_name;
-
- /* Though we are going to read, we do this during write, so lets use it that way */
- db = s->folder->parent_store->cdb_w;
- table_name = s->folder->full_name;
-
- io(printf("Savining header to db\n"));
-
- record->folder_name = table_name;
-
- /* we always write out the current version */
- record->version = CAMEL_FOLDER_SUMMARY_VERSION;
- record->flags = s->flags;
- record->nextuid = s->nextuid;
- record->time = s->time;
-
- /* FIXME: Ever heard of Constructors and initializing ? */
- if (camel_db_count_total_message_info (db, table_name, &(record->saved_count), NULL))
- record->saved_count = 0;
- if (camel_db_count_junk_message_info (db, table_name, &(record->junk_count), NULL))
- record->junk_count = 0;
- if (camel_db_count_deleted_message_info (db, table_name, &(record->deleted_count), NULL))
- record->deleted_count = 0;
- if (camel_db_count_unread_message_info (db, table_name, &(record->unread_count), NULL))
- record->unread_count = 0;
- if (camel_db_count_visible_message_info (db, table_name, &(record->visible_count), NULL))
- record->visible_count = 0;
- if (camel_db_count_junk_not_deleted_message_info (db, table_name, &(record->jnd_count), NULL))
- record->jnd_count = 0;
-
- s->unread_count = record->unread_count;
- s->deleted_count = record->deleted_count;
- s->junk_count = record->junk_count;
- s->visible_count = record->visible_count;
- s->junk_not_deleted_count = record->jnd_count;
-
- return record;
-}
-
-static gint
-summary_header_save(CamelFolderSummary *s, FILE *out)
-{
- gint unread = 0, deleted = 0, junk = 0, count, i;
-
- fseek(out, 0, SEEK_SET);
-
- io(printf("Savining header\n"));
-
- /* we always write out the current version */
- camel_file_util_encode_fixed_int32(out, CAMEL_FOLDER_SUMMARY_VERSION);
- camel_file_util_encode_fixed_int32(out, s->flags);
- camel_file_util_encode_fixed_int32(out, s->nextuid);
- camel_file_util_encode_time_t(out, s->time);
-
- count = camel_folder_summary_count(s);
- for (i=0; i<count; i++) {
- CamelMessageInfo *info = camel_folder_summary_index(s, i);
- guint32 flags;
-
- if (info == NULL)
- continue;
-
- flags = camel_message_info_flags(info);
- if ((flags & CAMEL_MESSAGE_SEEN) == 0)
- unread++;
- if ((flags & CAMEL_MESSAGE_DELETED) != 0)
- deleted++;
- if ((flags & CAMEL_MESSAGE_JUNK) != 0)
- junk++;
-
- camel_message_info_free(info);
- }
-
- camel_file_util_encode_fixed_int32(out, count);
- camel_file_util_encode_fixed_int32(out, unread);
- camel_file_util_encode_fixed_int32(out, deleted);
-
- return camel_file_util_encode_fixed_int32(out, junk);
-}
-
#if 0
static gint
summary_meta_header_save(CamelFolderSummary *s, FILE *out_meta)
@@ -3053,7 +3671,7 @@ message_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
case CAMEL_MIME_PARSER_STATE_HEADER:
case CAMEL_MIME_PARSER_STATE_MESSAGE:
case CAMEL_MIME_PARSER_STATE_MULTIPART:
- mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new_from_header(s, camel_mime_parser_headers_raw(mp));
+ mi = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_new_from_header (s, camel_mime_parser_headers_raw (mp));
break;
default:
g_error("Invalid parser state");
@@ -3071,7 +3689,7 @@ content_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
case CAMEL_MIME_PARSER_STATE_HEADER:
case CAMEL_MIME_PARSER_STATE_MESSAGE:
case CAMEL_MIME_PARSER_STATE_MULTIPART:
- ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_header(s, camel_mime_parser_headers_raw(mp));
+ ci = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->content_info_new_from_header (s, camel_mime_parser_headers_raw (mp));
if (ci) {
ci->type = camel_mime_parser_content_type(mp);
camel_content_type_ref(ci->type);
@@ -3281,85 +3899,6 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
}
static CamelMessageInfo *
-message_info_from_db (CamelFolderSummary *s, CamelMIRecord *record)
-{
- CamelMessageInfoBase *mi;
- gint i;
- gint count;
- gchar *part, *label;
-
- mi = (CamelMessageInfoBase *)camel_message_info_new(s);
-
- io(printf("Loading message info from db\n"));
-
- mi->flags = record->flags;
- mi->size = record->size;
- mi->date_sent = record->dsent;
- mi->date_received = record->dreceived;
-
- mi->uid = (gchar *) camel_pstring_strdup (record->uid);
- mi->subject = (gchar *) camel_pstring_add (record->subject, FALSE);
- mi->from = (gchar *) camel_pstring_add (record->from, FALSE);
- mi->to = (gchar *) camel_pstring_add (record->to, FALSE);
- mi->cc = (gchar *) camel_pstring_add (record->cc, FALSE);
- mi->mlist = (gchar *) camel_pstring_add (record->mlist, FALSE);
-
- /* Evolution itself doesn't yet use this, so we ignore it (saving some memory) */
- mi->bodystructure = NULL;
-
- /* Extract Message id & References */
- mi->content = NULL;
- part = record->part;
- if (part) {
- EXTRACT_FIRST_DIGIT (mi->message_id.id.part.hi)
- EXTRACT_DIGIT (mi->message_id.id.part.lo)
- EXTRACT_DIGIT (count)
-
- if (count > 0) {
- mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
- mi->references->size = count;
- for (i=0;i<count;i++) {
- EXTRACT_DIGIT (mi->references->references[i].id.part.hi)
- EXTRACT_DIGIT (mi->references->references[i].id.part.lo)
- }
- } else
- mi->references = NULL;
-
- }
-
- /* Extract User flags/labels */
- part = record->labels;
- if (part) {
- label = part;
- for (i=0;part[i];i++) {
-
- if (part[i] == ' ') {
- part[i] = 0;
- if (*label)
- camel_flag_set (&mi->user_flags, label, TRUE);
- label = &(part[i+1]);
- }
- }
- camel_flag_set(&mi->user_flags, label, TRUE);
- }
-
- /* Extract User tags */
- part = record->usertags;
- EXTRACT_FIRST_DIGIT (count)
- for (i=0;i<count;i++) {
- gint len;
- gchar *name, *value;
- EXTRACT_STRING (name)
- EXTRACT_STRING (value)
- camel_tag_set(&mi->user_tags, name, value);
- g_free(name);
- g_free(value);
- }
-
- return (CamelMessageInfo *) mi;
-}
-
-static CamelMessageInfo *
message_info_load(CamelFolderSummary *s, FILE *in)
{
CamelMessageInfoBase *mi;
@@ -3458,84 +3997,6 @@ meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMe
return ferror(out);
}
-static CamelMIRecord *
-message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
-{
- CamelMIRecord *record = g_new0(CamelMIRecord, 1);
- CamelMessageInfoBase *mi = (CamelMessageInfoBase *) info;
- GString *tmp;
- CamelFlag *flag;
- CamelTag *tag;
- gint count, i;
-
- /* Assume that we dont have to take care of DB Safeness. It will be done while doing the DB transaction */
- record->uid = (gchar *) camel_pstring_strdup(camel_message_info_uid(mi));
- record->flags = mi->flags;
-
- record->read = ((mi->flags & (CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_JUNK))) ? 1 : 0;
- record->deleted = mi->flags & CAMEL_MESSAGE_DELETED ? 1 : 0;
- record->replied = mi->flags & CAMEL_MESSAGE_ANSWERED ? 1 : 0;
- record->important = mi->flags & CAMEL_MESSAGE_FLAGGED ? 1 : 0;
- record->junk = mi->flags & CAMEL_MESSAGE_JUNK ? 1 : 0;
- record->dirty = mi->flags & CAMEL_MESSAGE_FOLDER_FLAGGED ? 1 : 0;
- record->attachment = mi->flags & CAMEL_MESSAGE_ATTACHMENTS ? 1 : 0;
-
- record->size = mi->size;
- record->dsent = mi->date_sent;
- record->dreceived = mi->date_received;
-
- record->subject = (gchar *) camel_pstring_strdup(camel_message_info_subject (mi));
- record->from = (gchar *) camel_pstring_strdup(camel_message_info_from (mi));
- record->to = (gchar *) camel_pstring_strdup(camel_message_info_to (mi));
- record->cc = (gchar *) camel_pstring_strdup(camel_message_info_cc (mi));
- record->mlist = (gchar *) camel_pstring_strdup(camel_message_info_mlist (mi));
-
- record->followup_flag = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "follow-up"));
- record->followup_completed_on = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "completed-on"));
- record->followup_due_by = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "due-by"));
-
- record->bodystructure = mi->bodystructure ? g_strdup (mi->bodystructure) : NULL;
-
- tmp = g_string_new (NULL);
- if (mi->references) {
- g_string_append_printf (tmp, "%lu %lu %lu", (gulong)mi->message_id.id.part.hi, (gulong)mi->message_id.id.part.lo, (gulong)mi->references->size);
- for (i=0;i<mi->references->size;i++)
- g_string_append_printf (tmp, " %lu %lu", (gulong)mi->references->references[i].id.part.hi, (gulong)mi->references->references[i].id.part.lo);
- } else {
- g_string_append_printf (tmp, "%lu %lu %lu", (gulong)mi->message_id.id.part.hi, (gulong)mi->message_id.id.part.lo, (gulong) 0);
- }
- record->part = tmp->str;
- g_string_free (tmp, FALSE);
-
- tmp = g_string_new (NULL);
- flag = mi->user_flags;
- while (flag) {
- g_string_append_printf (tmp, "%s ", flag->name);
- flag = flag->next;
- }
-
- /* Strip off the last space */
- if (tmp->len)
- tmp->len--;
-
- record->labels = tmp->str;
- g_string_free (tmp, FALSE);
-
- tmp = g_string_new (NULL);
- count = camel_tag_list_size(&mi->user_tags);
- g_string_append_printf (tmp, "%lu", (gulong)count);
- tag = mi->user_tags;
- while (tag) {
- /* FIXME: Should we handle empty tags? Can it be empty? If it potential crasher ahead*/
- g_string_append_printf (tmp, " %lu-%s %lu-%s", (gulong)strlen(tag->name), tag->name, (gulong)strlen(tag->value), tag->value);
- tag = tag->next;
- }
- record->usertags = tmp->str;
- g_string_free (tmp, FALSE);
-
- return record;
-}
-
static gint
message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
{
@@ -3641,56 +4102,6 @@ content_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
}
static CamelMessageContentInfo *
-content_info_from_db(CamelFolderSummary *s, CamelMIRecord *record)
-{
- CamelMessageContentInfo *ci;
- gchar *type, *subtype;
- guint32 count, i;
- CamelContentType *ct;
- gchar *part = record->cinfo;
- gint len;
-
- io(printf("Loading content info from db\n"));
-
- if (!part)
- return NULL;
-
- ci = camel_folder_summary_content_info_new(s);
- if (*part == ' ') part++; /* Move off the space in the record*/
-
- EXTRACT_FIRST_STRING (type)
- EXTRACT_STRING (subtype)
- ct = camel_content_type_new(type, subtype);
- g_free(type); /* can this be removed? */
- g_free(subtype);
- EXTRACT_DIGIT (count)
-
- for (i = 0; i < count; i++) {
- gchar *name, *value;
- EXTRACT_STRING (name)
- EXTRACT_STRING (value)
-
- camel_content_type_set_param(ct, name, value);
- /* TODO: do this so we dont have to double alloc/free */
- g_free(name);
- g_free(value);
- }
- ci->type = ct;
-
- /* FIXME[disk-summary] move all these to camel pstring */
- EXTRACT_STRING (ci->id);
- EXTRACT_STRING (ci->description)
- EXTRACT_STRING (ci->encoding)
- EXTRACT_DIGIT (ci->size)
-
- record->cinfo = part; /* Keep moving the cursor in the record */
-
- ci->childs = NULL;
-
- return ci;
-}
-
-static CamelMessageContentInfo *
content_info_load(CamelFolderSummary *s, FILE *in)
{
CamelMessageContentInfo *ci;
@@ -3742,71 +4153,6 @@ content_info_load(CamelFolderSummary *s, FILE *in)
}
static gint
-content_info_to_db(CamelFolderSummary *s, CamelMessageContentInfo *ci, CamelMIRecord *record)
-{
- CamelContentType *ct;
- struct _camel_header_param *hp;
- GString *str = g_string_new (NULL);
- gchar *oldr;
-
- io(printf("Saving content info to db\n"));
-
- ct = ci->type;
- if (ct) {
- if (ct->type)
- g_string_append_printf (str, " %d-%s", (gint) strlen (ct->type), ct->type);
- else
- g_string_append_printf (str, " 0-");
- if (ct->subtype)
- g_string_append_printf (str, " %d-%s", (gint) strlen (ct->subtype), ct->subtype);
- else
- g_string_append_printf (str, " 0-");
- g_string_append_printf (str, " %d", my_list_size((struct _node **)&ct->params));
- hp = ct->params;
- while (hp) {
- if (hp->name)
- g_string_append_printf (str, " %d-%s", (gint)strlen(hp->name), hp->name);
- else
- g_string_append_printf (str, " 0-");
- if (hp->value)
- g_string_append_printf (str, " %d-%s", (gint)strlen (hp->value), hp->value);
- else
- g_string_append_printf (str, " 0-");
- hp = hp->next;
- }
- } else {
- g_string_append_printf (str, " %d-", 0);
- g_string_append_printf (str, " %d-", 0);
- g_string_append_printf (str, " %d", 0);
- }
-
- if (ci->id)
- g_string_append_printf (str, " %d-%s", (gint)strlen (ci->id), ci->id);
- else
- g_string_append_printf (str, " 0-");
- if (ci->description)
- g_string_append_printf (str, " %d-%s", (gint)strlen (ci->description), ci->description);
- else
- g_string_append_printf (str, " 0-");
- if (ci->encoding)
- g_string_append_printf (str, " %d-%s", (gint)strlen (ci->encoding), ci->encoding);
- else
- g_string_append_printf (str, " 0-");
- g_string_append_printf (str, " %u", ci->size);
-
- if (record->cinfo) {
- oldr = record->cinfo;
- record->cinfo = g_strconcat(oldr, str->str, NULL);
- g_free (oldr); g_string_free (str, TRUE);
- } else {
- record->cinfo = str->str;
- g_string_free (str, FALSE);
- }
-
- return 0;
-}
-
-static gint
content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
{
CamelContentType *ct;
@@ -3884,7 +4230,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
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);
+ info = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->content_info_new_from_parser (s, mp);
switch (state) {
case CAMEL_MIME_PARSER_STATE_HEADER:
@@ -3922,22 +4268,22 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
if (p->filter_64 == NULL)
p->filter_64 = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_BASE64_DEC);
else
- camel_mime_filter_reset((CamelMimeFilter *)p->filter_64);
- enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_64);
+ camel_mime_filter_reset(p->filter_64);
+ enc_id = camel_mime_parser_filter_add(mp, p->filter_64);
} else if (!g_ascii_strcasecmp(encoding, "quoted-printable")) {
d(printf(" decoding quoted-printable\n"));
if (p->filter_qp == NULL)
p->filter_qp = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_QP_DEC);
else
- camel_mime_filter_reset((CamelMimeFilter *)p->filter_qp);
- enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_qp);
+ camel_mime_filter_reset(p->filter_qp);
+ enc_id = camel_mime_parser_filter_add(mp, p->filter_qp);
} else if (!g_ascii_strcasecmp (encoding, "x-uuencode")) {
d(printf(" decoding x-uuencode\n"));
if (p->filter_uu == NULL)
p->filter_uu = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_UU_DEC);
else
- camel_mime_filter_reset((CamelMimeFilter *)p->filter_uu);
- enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_uu);
+ camel_mime_filter_reset(p->filter_uu);
+ enc_id = camel_mime_parser_filter_add(mp, p->filter_uu);
} else {
d(printf(" ignoring encoding %s\n", encoding));
}
@@ -3958,7 +4304,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
camel_mime_filter_reset((CamelMimeFilter *)mfc);
}
if (mfc) {
- chr_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)mfc);
+ chr_id = camel_mime_parser_filter_add(mp, mfc);
} else {
w(g_warning("Cannot convert '%s' to 'UTF-8', message index may be corrupt", charset));
}
@@ -3975,7 +4321,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
}
/* and this filter actually does the indexing */
- idx_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_index);
+ idx_id = camel_mime_parser_filter_add(mp, p->filter_index);
}
/* and scan/index everything */
while (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_BODY_END)
@@ -4041,7 +4387,7 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
const struct _camel_header_raw *header;
if (s->build_content)
- info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_message(s, object);
+ info = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->content_info_new_from_message (s, object);
containee = camel_medium_get_content (CAMEL_MEDIUM(object));
@@ -4120,7 +4466,7 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
}
idx_id = camel_stream_filter_add (
CAMEL_STREAM_FILTER (p->filter_stream),
- (CamelMimeFilter *)p->filter_index);
+ p->filter_index);
camel_data_wrapper_decode_to_stream(containee, p->filter_stream);
camel_stream_flush(p->filter_stream);
@@ -4600,7 +4946,7 @@ camel_message_info_free(gpointer o)
camel_folder_summary_content_info_free(mi->summary, ((CamelMessageInfoBase *)mi)->content);
}
- ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(mi->summary)))->message_info_free(mi->summary, mi);
+ CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->message_info_free (mi->summary, mi);
} else {
GLOBAL_INFO_LOCK(info);
mi->refcount--;
@@ -4614,56 +4960,6 @@ camel_message_info_free(gpointer o)
}
}
-static CamelMessageInfo *
-message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
-{
- CamelMessageInfoBase *to, *from = (CamelMessageInfoBase *)mi;
- CamelFlag *flag;
- CamelTag *tag;
-
- to = (CamelMessageInfoBase *)camel_message_info_new(s);
-
- to->flags = from->flags;
- to->size = from->size;
- to->date_sent = from->date_sent;
- to->date_received = from->date_received;
- to->refcount = 1;
-
- /* NB: We don't clone the uid */
-
- to->subject = camel_pstring_strdup(from->subject);
- to->from = camel_pstring_strdup(from->from);
- to->to = camel_pstring_strdup(from->to);
- to->cc = camel_pstring_strdup(from->cc);
- to->mlist = camel_pstring_strdup(from->mlist);
- memcpy(&to->message_id, &from->message_id, sizeof(to->message_id));
- to->preview = g_strdup (from->preview);
- if (from->references) {
- gint len = sizeof(*from->references) + ((from->references->size-1) * sizeof(from->references->references[0]));
-
- to->references = g_malloc(len);
- memcpy(to->references, from->references, len);
- }
-
- flag = from->user_flags;
- while (flag) {
- camel_flag_set(&to->user_flags, flag->name, TRUE);
- flag = flag->next;
- }
-
- tag = from->user_tags;
- while (tag) {
- camel_tag_set(&to->user_tags, tag->name, tag->value);
- tag = tag->next;
- }
-
- if (from->content) {
- /* FIXME: copy content-infos */
- }
-
- return (CamelMessageInfo *)to;
-}
-
/**
* camel_message_info_clone:
* @info: a #CamelMessageInfo
@@ -4678,83 +4974,11 @@ camel_message_info_clone(gconstpointer o)
const CamelMessageInfo *mi = o;
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->message_info_clone(mi->summary, mi);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->message_info_clone (mi->summary, mi);
else
return message_info_clone(NULL, mi);
}
-static gconstpointer
-info_ptr(const CamelMessageInfo *mi, gint id)
-{
- switch (id) {
- case CAMEL_MESSAGE_INFO_SUBJECT:
- return ((const CamelMessageInfoBase *)mi)->subject;
- case CAMEL_MESSAGE_INFO_FROM:
- return ((const CamelMessageInfoBase *)mi)->from;
- case CAMEL_MESSAGE_INFO_TO:
- return ((const CamelMessageInfoBase *)mi)->to;
- case CAMEL_MESSAGE_INFO_CC:
- return ((const CamelMessageInfoBase *)mi)->cc;
- case CAMEL_MESSAGE_INFO_MLIST:
- return ((const CamelMessageInfoBase *)mi)->mlist;
- case CAMEL_MESSAGE_INFO_MESSAGE_ID:
- return &((const CamelMessageInfoBase *)mi)->message_id;
- case CAMEL_MESSAGE_INFO_REFERENCES:
- return ((const CamelMessageInfoBase *)mi)->references;
- case CAMEL_MESSAGE_INFO_USER_FLAGS:
- return ((const CamelMessageInfoBase *)mi)->user_flags;
- case CAMEL_MESSAGE_INFO_USER_TAGS:
- return ((const CamelMessageInfoBase *)mi)->user_tags;
- case CAMEL_MESSAGE_INFO_HEADERS:
- return ((const CamelMessageInfoBase *)mi)->headers;
- case CAMEL_MESSAGE_INFO_CONTENT:
- return ((const CamelMessageInfoBase *)mi)->content;
- case CAMEL_MESSAGE_INFO_PREVIEW:
- return ((const CamelMessageInfoBase *)mi)->preview;
-
- default:
- abort();
- }
-}
-
-static guint32
-info_uint32(const CamelMessageInfo *mi, gint id)
-{
- switch (id) {
- case CAMEL_MESSAGE_INFO_FLAGS:
- return ((const CamelMessageInfoBase *)mi)->flags;
- case CAMEL_MESSAGE_INFO_SIZE:
- return ((const CamelMessageInfoBase *)mi)->size;
- default:
- abort();
- }
-}
-
-static time_t
-info_time(const CamelMessageInfo *mi, gint id)
-{
- switch (id) {
- case CAMEL_MESSAGE_INFO_DATE_SENT:
- return ((const CamelMessageInfoBase *)mi)->date_sent;
- case CAMEL_MESSAGE_INFO_DATE_RECEIVED:
- return ((const CamelMessageInfoBase *)mi)->date_received;
- default:
- abort();
- }
-}
-
-static gboolean
-info_user_flag(const CamelMessageInfo *mi, const gchar *id)
-{
- return camel_flag_get(&((CamelMessageInfoBase *)mi)->user_flags, id);
-}
-
-static const gchar *
-info_user_tag(const CamelMessageInfo *mi, const gchar *id)
-{
- return camel_tag_get(&((CamelMessageInfoBase *)mi)->user_tags, id);
-}
-
/**
* camel_message_info_ptr:
* @mi: a #CamelMessageInfo
@@ -4768,7 +4992,7 @@ gconstpointer
camel_message_info_ptr(const CamelMessageInfo *mi, gint id)
{
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_ptr(mi, id);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_ptr (mi, id);
else
return info_ptr(mi, id);
}
@@ -4786,7 +5010,7 @@ guint32
camel_message_info_uint32(const CamelMessageInfo *mi, gint id)
{
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_uint32(mi, id);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_uint32 (mi, id);
else
return info_uint32(mi, id);
}
@@ -4804,7 +5028,7 @@ time_t
camel_message_info_time(const CamelMessageInfo *mi, gint id)
{
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_time(mi, id);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_time (mi, id);
else
return info_time(mi, id);
}
@@ -4822,7 +5046,7 @@ gboolean
camel_message_info_user_flag(const CamelMessageInfo *mi, const gchar *id)
{
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_user_flag(mi, id);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_user_flag (mi, id);
else
return info_user_flag(mi, id);
}
@@ -4840,74 +5064,11 @@ const gchar *
camel_message_info_user_tag(const CamelMessageInfo *mi, const gchar *id)
{
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_user_tag(mi, id);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_user_tag (mi, id);
else
return info_user_tag(mi, id);
}
-static gboolean
-info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set)
-{
- guint32 old;
- CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
- gint read=0, deleted=0, junk=0;
- /* TODO: locking? */
-
- if (flags & CAMEL_MESSAGE_SEEN && ((set & CAMEL_MESSAGE_SEEN) != (mi->flags & CAMEL_MESSAGE_SEEN)))
- { read = set & CAMEL_MESSAGE_SEEN ? 1 : -1; d(printf("Setting read as %d\n", set & CAMEL_MESSAGE_SEEN ? 1 : 0));}
-
- if (flags & CAMEL_MESSAGE_DELETED && ((set & CAMEL_MESSAGE_DELETED) != (mi->flags & CAMEL_MESSAGE_DELETED)))
- { deleted = set & CAMEL_MESSAGE_DELETED ? 1 : -1; d(printf("Setting deleted as %d\n", set & CAMEL_MESSAGE_DELETED ? 1 : 0));}
-
- if (flags & CAMEL_MESSAGE_JUNK && ((set & CAMEL_MESSAGE_JUNK) != (mi->flags & CAMEL_MESSAGE_JUNK)))
- { junk = set & CAMEL_MESSAGE_JUNK ? 1 : -1; d(printf("Setting junk as %d\n", set & CAMEL_MESSAGE_JUNK ? 1 : 0));}
-
- old = mi->flags;
- mi->flags = (old & ~flags) | (set & flags);
- if (old != mi->flags) {
- mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
- mi->dirty = TRUE;
- if (mi->summary)
- camel_folder_summary_touch(mi->summary);
- }
-
- if (((old & ~CAMEL_MESSAGE_SYSTEM_MASK) == (mi->flags & ~CAMEL_MESSAGE_SYSTEM_MASK)) && !((set & CAMEL_MESSAGE_JUNK_LEARN) && !(set & CAMEL_MESSAGE_JUNK)))
- return FALSE;
-
- if (mi->summary) {
- if (read && junk == 0 && !(mi->flags & CAMEL_MESSAGE_JUNK))
- mi->summary->unread_count -= read;
- else if (junk > 0)
- mi->summary->unread_count -= (old & CAMEL_MESSAGE_SEEN) ? 0 : 1;
- else if (junk < 0)
- mi->summary->unread_count -= (old & CAMEL_MESSAGE_SEEN) ? 0 : -1;
-
- if (deleted)
- mi->summary->deleted_count += deleted;
- if (junk)
- mi->summary->junk_count += junk;
- if (junk && !deleted)
- mi->summary->junk_not_deleted_count += junk;
- else if ((mi->flags & CAMEL_MESSAGE_JUNK) && deleted)
- mi->summary->junk_not_deleted_count -= deleted;
-
- if (((junk && !(mi->flags & CAMEL_MESSAGE_DELETED)))|| (deleted && !(mi->flags & CAMEL_MESSAGE_JUNK)) )
- mi->summary->visible_count -= junk ? junk : deleted;
- }
- if (mi->uid)
- g_hash_table_replace (CAMEL_FOLDER_SUMMARY_GET_PRIVATE(mi->summary)->flag_cache, (gchar *)mi->uid, GUINT_TO_POINTER(mi->flags));
- if (mi->summary && mi->summary->folder && mi->uid) {
- CamelFolderChangeInfo *changes = camel_folder_change_info_new();
-
- camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
- camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
- camel_folder_change_info_free(changes);
- }
-
- d(printf("%d %d %d %d %d\n", mi->summary->unread_count, mi->summary->deleted_count, mi->summary->junk_count, mi->summary->junk_not_deleted_count, mi->summary->visible_count));
- return TRUE;
-}
-
/**
* camel_folder_summary_update_flag_cache:
*
@@ -4933,34 +5094,11 @@ gboolean
camel_message_info_set_flags(CamelMessageInfo *mi, guint32 flags, guint32 set)
{
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_set_flags(mi, flags, set);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_set_flags (mi, flags, set);
else
return info_set_flags(mi, flags, set);
}
-static gboolean
-info_set_user_flag(CamelMessageInfo *info, const gchar *name, gboolean value)
-{
- CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
- gint res;
-
- res = camel_flag_set(&mi->user_flags, name, value);
-
- /* TODO: check this item is still in the summary first */
- if (mi->summary && res && mi->summary->folder && mi->uid) {
- CamelFolderChangeInfo *changes = camel_folder_change_info_new();
-
- mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
- mi->dirty = TRUE;
- camel_folder_summary_touch(mi->summary);
- camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
- camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
- camel_folder_change_info_free(changes);
- }
-
- return res;
-}
-
/**
* camel_message_info_set_user_flag:
* @mi: a #CamelMessageInfo
@@ -4975,33 +5113,11 @@ gboolean
camel_message_info_set_user_flag(CamelMessageInfo *mi, const gchar *id, gboolean state)
{
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_set_user_flag(mi, id, state);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_set_user_flag (mi, id, state);
else
return info_set_user_flag(mi, id, state);
}
-static gboolean
-info_set_user_tag(CamelMessageInfo *info, const gchar *name, const gchar *value)
-{
- CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
- gint res;
-
- res = camel_tag_set(&mi->user_tags, name, value);
-
- if (mi->summary && res && mi->summary->folder && mi->uid) {
- CamelFolderChangeInfo *changes = camel_folder_change_info_new();
-
- mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
- mi->dirty = TRUE;
- camel_folder_summary_touch(mi->summary);
- camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
- camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
- camel_folder_change_info_free(changes);
- }
-
- return res;
-}
-
/**
* camel_message_info_set_user_tag:
* @mi: a #CamelMessageInfo
@@ -5016,7 +5132,7 @@ gboolean
camel_message_info_set_user_tag(CamelMessageInfo *mi, const gchar *id, const gchar *val)
{
if (mi->summary)
- return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_set_user_tag(mi, id, val);
+ return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_set_user_tag (mi, id, val);
else
return info_set_user_tag(mi, id, val);
}
@@ -5068,61 +5184,6 @@ camel_message_info_dump (CamelMessageInfo *mi)
camel_content_info_dump(((CamelMessageInfoBase *) mi)->content, 0);
}
-static void
-camel_folder_summary_class_init (CamelFolderSummaryClass *class)
-{
- camel_folder_summary_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- class->message_info_size = sizeof (CamelMessageInfoBase);
- class->content_info_size = sizeof (CamelMessageContentInfo);
-
- class->summary_header_load = summary_header_load;
- class->summary_header_save = summary_header_save;
-
- class->summary_header_from_db = summary_header_from_db;
- class->summary_header_to_db = summary_header_to_db;
- class->message_info_from_db = message_info_from_db;
- class->message_info_to_db = message_info_to_db;
- class->content_info_from_db = content_info_from_db;
- class->content_info_to_db = content_info_to_db;
-
- class->message_info_new_from_header = message_info_new_from_header;
- class->message_info_new_from_parser = message_info_new_from_parser;
- class->message_info_new_from_message = message_info_new_from_message;
- class->message_info_load = message_info_load;
- class->message_info_save = message_info_save;
- class->meta_message_info_save = meta_message_info_save;
- class->message_info_free = message_info_free;
- class->message_info_clone = message_info_clone;
- class->message_info_from_uid = message_info_from_uid;
-
- class->content_info_new_from_header = content_info_new_from_header;
- class->content_info_new_from_parser = content_info_new_from_parser;
- class->content_info_new_from_message = content_info_new_from_message;
- class->content_info_load = content_info_load;
- class->content_info_save = content_info_save;
- class->content_info_free = content_info_free;
-
- class->next_uid_string = next_uid_string;
-
- class->info_ptr = info_ptr;
- class->info_uint32 = info_uint32;
- class->info_time = info_time;
- class->info_user_flag = info_user_flag;
- class->info_user_tag = info_user_tag;
-
-#if 0
- class->info_set_string = info_set_string;
- class->info_set_uint32 = info_set_uint32;
- class->info_set_time = info_set_time;
- class->info_set_ptr = info_set_ptr;
-#endif
- class->info_set_user_flag = info_set_user_flag;
- class->info_set_user_tag = info_set_user_tag;
-
- class->info_set_flags = info_set_flags;
-
-}
/**
* camel_folder_summary_set_need_preview:
@@ -5212,33 +5273,32 @@ camel_folder_summary_guess_content_info (CamelMessageInfo *mi, CamelContentType
*
* Locks #summary's #lock. Unlock it with camel_folder_summary_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_folder_summary_lock (CamelFolderSummary *summary, CamelFolderSummaryLock lock)
+camel_folder_summary_lock (CamelFolderSummary *summary,
+ CamelFolderSummaryLock lock)
{
- g_return_if_fail (summary != NULL);
g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary));
- g_return_if_fail (summary->priv != NULL);
switch (lock) {
- case CFS_SUMMARY_LOCK:
- g_mutex_lock (summary->priv->summary_lock);
- break;
- case CFS_IO_LOCK:
- g_mutex_lock (summary->priv->io_lock);
- break;
- case CFS_FILTER_LOCK:
- g_mutex_lock (summary->priv->filter_lock);
- break;
- case CFS_ALLOC_LOCK:
- g_mutex_lock (summary->priv->alloc_lock);
- break;
- case CFS_REF_LOCK:
- g_mutex_lock (summary->priv->ref_lock);
- break;
- default:
- g_return_if_reached ();
+ case CFS_SUMMARY_LOCK:
+ g_mutex_lock (summary->priv->summary_lock);
+ break;
+ case CFS_IO_LOCK:
+ g_mutex_lock (summary->priv->io_lock);
+ break;
+ case CFS_FILTER_LOCK:
+ g_mutex_lock (summary->priv->filter_lock);
+ break;
+ case CFS_ALLOC_LOCK:
+ g_mutex_lock (summary->priv->alloc_lock);
+ break;
+ case CFS_REF_LOCK:
+ g_mutex_lock (summary->priv->ref_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
@@ -5249,32 +5309,31 @@ camel_folder_summary_lock (CamelFolderSummary *summary, CamelFolderSummaryLock l
*
* Unlocks #summary's #lock, previously locked with camel_folder_summary_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_folder_summary_unlock (CamelFolderSummary *summary, CamelFolderSummaryLock lock)
+camel_folder_summary_unlock (CamelFolderSummary *summary,
+ CamelFolderSummaryLock lock)
{
- g_return_if_fail (summary != NULL);
g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary));
- g_return_if_fail (summary->priv != NULL);
switch (lock) {
- case CFS_SUMMARY_LOCK:
- g_mutex_unlock (summary->priv->summary_lock);
- break;
- case CFS_IO_LOCK:
- g_mutex_unlock (summary->priv->io_lock);
- break;
- case CFS_FILTER_LOCK:
- g_mutex_unlock (summary->priv->filter_lock);
- break;
- case CFS_ALLOC_LOCK:
- g_mutex_unlock (summary->priv->alloc_lock);
- break;
- case CFS_REF_LOCK:
- g_mutex_unlock (summary->priv->ref_lock);
- break;
- default:
- g_return_if_reached ();
+ case CFS_SUMMARY_LOCK:
+ g_mutex_unlock (summary->priv->summary_lock);
+ break;
+ case CFS_IO_LOCK:
+ g_mutex_unlock (summary->priv->io_lock);
+ break;
+ case CFS_FILTER_LOCK:
+ g_mutex_unlock (summary->priv->filter_lock);
+ break;
+ case CFS_ALLOC_LOCK:
+ g_mutex_unlock (summary->priv->alloc_lock);
+ break;
+ case CFS_REF_LOCK:
+ g_mutex_unlock (summary->priv->ref_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 887b345..3441b3a 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -33,12 +33,24 @@
#include <camel/camel-mime-parser.h>
#include <camel/camel-index.h>
-#define CAMEL_FOLDER_SUMMARY_TYPE camel_folder_summary_get_type ()
-#define CAMEL_FOLDER_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_folder_summary_get_type (), CamelFolderSummary)
-#define CAMEL_FOLDER_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_folder_summary_get_type (), CamelFolderSummaryClass)
-#define CAMEL_IS_FOLDER_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_folder_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_FOLDER_SUMMARY \
+ (camel_folder_summary_get_type ())
+#define CAMEL_FOLDER_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_FOLDER_SUMMARY, CamelFolderSummary))
+#define CAMEL_FOLDER_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_FOLDER_SUMMARY, CamelFolderSummaryClass))
+#define CAMEL_IS_FOLDER_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_FOLDER_SUMMARY))
+#define CAMEL_IS_FOLDER_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_FOLDER_SUMMARY))
#define CAMEL_FOLDER_SUMMARY_GET_CLASS(obj) \
- ((CamelFolderSummaryClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_FOLDER_SUMMARY, CamelFolderSummaryClass))
G_BEGIN_DECLS
@@ -337,7 +349,7 @@ struct _CamelFolderMetaSummary {
gchar *path; /* Path to meta-summary-file */
};
-CamelType camel_folder_summary_get_type (void);
+GType camel_folder_summary_get_type (void);
CamelFolderSummary *camel_folder_summary_new (struct _CamelFolder *folder);
/* Deprecated */
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c
index 07c7e5f..2e7e2aa 100644
--- a/camel/camel-folder-thread.c
+++ b/camel/camel-folder-thread.c
@@ -605,7 +605,7 @@ camel_folder_thread_messages_new (CamelFolder *folder, GPtrArray *uids, gboolean
thread->subject = thread_subject;
thread->tree = NULL;
thread->node_chunks = e_memchunk_new(32, sizeof(CamelFolderThreadNode));
- thread->folder = camel_object_ref (folder);
+ thread->folder = g_object_ref (folder);
fsummary = camel_folder_summary_array (folder->summary);
thread->summary = summary = g_ptr_array_new();
@@ -710,7 +710,7 @@ camel_folder_thread_messages_unref(CamelFolderThread *thread)
for (i=0;i<thread->summary->len;i++)
camel_folder_free_message_info(thread->folder, thread->summary->pdata[i]);
g_ptr_array_free(thread->summary, TRUE);
- camel_object_unref (thread->folder);
+ g_object_unref (thread->folder);
}
e_memchunk_destroy(thread->node_chunks);
g_free(thread);
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 11cffbd..776a6ed 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -43,6 +43,10 @@
#include "camel-vtrash-folder.h"
#include "camel-string-utils.h"
+#define CAMEL_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_FOLDER, CamelFolderPrivate))
+
#define d(x)
#define w(x)
@@ -55,7 +59,7 @@ struct _CamelFolderPrivate {
gboolean skip_folder_lock;
};
-static CamelObjectClass *parent_class = NULL;
+G_DEFINE_ABSTRACT_TYPE (CamelFolder, camel_folder, CAMEL_TYPE_OBJECT)
/* Forward Declarations */
static gboolean folder_changed (CamelObject *object, gpointer event_data);
@@ -103,7 +107,7 @@ folder_transfer_message_to (CamelFolder *source,
camel_message_info_set_flags (info, CAMEL_MESSAGE_DELETED, 0);
camel_folder_append_message (dest, msg, info, transferred_uid, ex);
- camel_object_unref (msg);
+ g_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);
@@ -112,29 +116,47 @@ folder_transfer_message_to (CamelFolder *source,
}
static void
-folder_finalize (CamelObject *object)
+folder_dispose (GObject *object)
{
- CamelFolder *camel_folder = CAMEL_FOLDER (object);
- struct _CamelFolderPrivate *p = camel_folder->priv;
+ CamelFolder *folder;
- g_free (camel_folder->name);
- g_free (camel_folder->full_name);
- g_free (camel_folder->description);
+ folder = CAMEL_FOLDER (object);
- if (camel_folder->parent_store)
- camel_object_unref (camel_folder->parent_store);
+ if (folder->parent_store != NULL) {
+ g_object_unref (folder->parent_store);
+ folder->parent_store = NULL;
+ }
- if (camel_folder->summary) {
- camel_folder->summary->folder = NULL;
- camel_object_unref (camel_folder->summary);
+ if (folder->summary) {
+ folder->summary->folder = NULL;
+ g_object_unref (folder->summary);
+ folder->summary = NULL;
}
- camel_folder_change_info_free (p->changed_frozen);
+ /* Chain up to parent's dispose () method. */
+ G_OBJECT_CLASS (camel_folder_parent_class)->dispose (object);
+}
+
+static void
+folder_finalize (GObject *object)
+{
+ CamelFolder *folder;
+ CamelFolderPrivate *priv;
- g_static_rec_mutex_free (&p->lock);
- g_static_mutex_free (&p->change_lock);
+ folder = CAMEL_FOLDER (object);
+ priv = CAMEL_FOLDER_GET_PRIVATE (object);
- g_free (p);
+ g_free (folder->name);
+ g_free (folder->full_name);
+ g_free (folder->description);
+
+ camel_folder_change_info_free (priv->changed_frozen);
+
+ g_static_rec_mutex_free (&priv->lock);
+ g_static_mutex_free (&priv->change_lock);
+
+ /* Chain up to parent's finalize () method. */
+ G_OBJECT_CLASS (camel_folder_parent_class)->finalize (object);
}
static gint
@@ -281,7 +303,7 @@ folder_getv (CamelObject *object,
arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
}
- return parent_class->getv (object, ex, args);
+ return CAMEL_OBJECT_CLASS (camel_folder_parent_class)->getv (object, ex, args);
}
static void
@@ -307,7 +329,7 @@ folder_free (CamelObject *object,
g_slist_free (val);
break;
default:
- parent_class->free (object, tag, val);
+ CAMEL_OBJECT_CLASS (camel_folder_parent_class)->free (object, tag, val);
}
}
@@ -706,9 +728,14 @@ folder_get_quota_info (CamelFolder *folder)
static void
camel_folder_class_init (CamelFolderClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
- parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
+ g_type_class_add_private (class, sizeof (CamelFolderPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = folder_dispose;
+ object_class->finalize = folder_finalize;
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = folder_getv;
@@ -756,7 +783,8 @@ camel_folder_class_init (CamelFolderClass *class)
static void
camel_folder_init (CamelFolder *folder)
{
- folder->priv = g_malloc0 (sizeof (*folder->priv));
+ folder->priv = CAMEL_FOLDER_GET_PRIVATE (folder);
+
folder->priv->frozen = 0;
folder->priv->changed_frozen = camel_folder_change_info_new ();
@@ -764,24 +792,6 @@ camel_folder_init (CamelFolder *folder)
g_static_mutex_init (&folder->priv->change_lock);
}
-CamelType
-camel_folder_get_type (void)
-{
- static CamelType camel_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_folder_type == CAMEL_INVALID_TYPE) {
- camel_folder_type = camel_type_register (CAMEL_TYPE_OBJECT, "CamelFolder",
- sizeof (CamelFolder),
- sizeof (CamelFolderClass),
- (CamelObjectClassInitFunc) camel_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_folder_init,
- (CamelObjectFinalizeFunc) folder_finalize );
- }
-
- return camel_folder_type;
-}
-
/**
* camel_folder_set_lock_async:
* @folder: a #CamelFolder
@@ -843,7 +853,7 @@ camel_folder_construct (CamelFolder *folder,
folder->parent_store = parent_store;
if (parent_store)
- camel_object_ref (parent_store);
+ g_object_ref (parent_store);
folder->name = g_strdup (name);
folder->full_name = g_strdup (full_name);
@@ -905,7 +915,9 @@ camel_folder_refresh_info (CamelFolder *folder,
g_return_val_if_fail (class->refresh_info != NULL, FALSE);
camel_folder_lock (folder, CF_REC_LOCK);
+
success = class->refresh_info (folder, ex);
+
camel_folder_unlock (folder, CF_REC_LOCK);
return success;
@@ -1096,8 +1108,10 @@ camel_folder_append_message (CamelFolder *folder,
g_return_val_if_fail (class->append_message != NULL, FALSE);
camel_folder_lock (folder, CF_REC_LOCK);
+
success = class->append_message (
folder, message, info, appended_uid, ex);
+
camel_folder_unlock (folder, CF_REC_LOCK);
return success;
@@ -1481,7 +1495,7 @@ camel_folder_sync_message (CamelFolder *folder,
message = class->get_message (folder, uid, ex);
if (message != NULL) {
- camel_object_unref (message);
+ g_object_unref (message);
success = TRUE;
}
}
@@ -2120,7 +2134,7 @@ filter_filter (CamelSession *session, CamelSessionThreadMsg *tmsg)
if (msg) {
camel_junk_plugin_report_junk (csp, msg);
- camel_object_unref (msg);
+ g_object_unref (msg);
}
}
camel_operation_end (NULL);
@@ -2138,7 +2152,7 @@ filter_filter (CamelSession *session, CamelSessionThreadMsg *tmsg)
if (msg) {
camel_junk_plugin_report_notjunk (csp, msg);
- camel_object_unref (msg);
+ g_object_unref (msg);
}
}
camel_operation_end (NULL);
@@ -2197,7 +2211,7 @@ filter_free (CamelSession *session, CamelSessionThreadMsg *msg)
struct _folder_filter_msg *m = (struct _folder_filter_msg *)msg;
if (m->driver)
- camel_object_unref (m->driver);
+ g_object_unref (m->driver);
if (m->recents)
camel_folder_free_deep (m->folder, m->recents);
if (m->junk)
@@ -2207,7 +2221,7 @@ filter_free (CamelSession *session, CamelSessionThreadMsg *msg)
camel_folder_summary_save_to_db (m->folder->summary, &m->ex);
camel_folder_thaw (m->folder);
- camel_object_unref (m->folder);
+ g_object_unref (m->folder);
}
static CamelSessionThreadOps filter_ops = {
@@ -2302,7 +2316,7 @@ folder_changed (CamelObject *obj, gpointer event_data)
msg->recents = recents;
msg->junk = junk;
msg->notjunk = notjunk;
- msg->folder = camel_object_ref (folder);
+ msg->folder = g_object_ref (folder);
camel_folder_freeze (folder);
/* Copy changes back to changed_frozen list to retain
* them while we are filtering */
@@ -2822,24 +2836,24 @@ camel_folder_change_info_free (CamelFolderChangeInfo *info)
*
* Locks #folder's #lock. Unlock it with camel_folder_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_folder_lock (CamelFolder *folder, CamelFolderLock lock)
+camel_folder_lock (CamelFolder *folder,
+ CamelFolderLock lock)
{
- g_return_if_fail (folder != NULL);
g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (folder->priv != NULL);
switch (lock) {
- case CF_CHANGE_LOCK:
- g_static_mutex_lock (&folder->priv->change_lock);
- break;
- case CF_REC_LOCK:
- if (folder->priv->skip_folder_lock == FALSE) g_static_rec_mutex_lock (&folder->priv->lock);
- break;
- default:
- g_return_if_reached ();
+ case CF_CHANGE_LOCK:
+ g_static_mutex_lock (&folder->priv->change_lock);
+ break;
+ case CF_REC_LOCK:
+ if (folder->priv->skip_folder_lock == FALSE)
+ g_static_rec_mutex_lock (&folder->priv->lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
@@ -2850,23 +2864,23 @@ camel_folder_lock (CamelFolder *folder, CamelFolderLock lock)
*
* Unlocks #folder's #lock, previously locked with camel_folder_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_folder_unlock (CamelFolder *folder, CamelFolderLock lock)
+camel_folder_unlock (CamelFolder *folder,
+ CamelFolderLock lock)
{
- g_return_if_fail (folder != NULL);
g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (folder->priv != NULL);
switch (lock) {
- case CF_CHANGE_LOCK:
- g_static_mutex_unlock (&folder->priv->change_lock);
- break;
- case CF_REC_LOCK:
- if (folder->priv->skip_folder_lock == FALSE) g_static_rec_mutex_unlock (&folder->priv->lock);
- break;
- default:
- g_return_if_reached ();
+ case CF_CHANGE_LOCK:
+ g_static_mutex_unlock (&folder->priv->change_lock);
+ break;
+ case CF_REC_LOCK:
+ if (folder->priv->skip_folder_lock == FALSE)
+ g_static_rec_mutex_unlock (&folder->priv->lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index 24e40af..7e210ea 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -31,12 +31,24 @@
#include <camel/camel-folder-summary.h>
-#define CAMEL_FOLDER_TYPE (camel_folder_get_type ())
-#define CAMEL_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_FOLDER_TYPE, CamelFolder))
-#define CAMEL_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_FOLDER_TYPE, CamelFolderClass))
-#define CAMEL_IS_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_FOLDER \
+ (camel_folder_get_type ())
+#define CAMEL_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_FOLDER, CamelFolder))
+#define CAMEL_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_FOLDER, CamelFolderClass))
+#define CAMEL_IS_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_FOLDER))
+#define CAMEL_IS_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_FOLDER))
#define CAMEL_FOLDER_GET_CLASS(obj) \
- ((CamelFolderClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_FOLDER, CamelFolderClass))
G_BEGIN_DECLS
@@ -86,7 +98,7 @@ enum {
CAMEL_FOLDER_PROPERTIES = CAMEL_FOLDER_ARG_PROPERTIES | CAMEL_ARG_PTR
};
-typedef enum _CamelFolderLock {
+typedef enum {
CF_CHANGE_LOCK,
CF_REC_LOCK
} CamelFolderLock;
@@ -242,7 +254,7 @@ struct _CamelFolderClass {
CamelException *ex);
};
-CamelType camel_folder_get_type (void);
+GType camel_folder_get_type (void);
void camel_folder_construct (CamelFolder *folder,
struct _CamelStore *parent_store,
const gchar *full_name,
@@ -457,9 +469,10 @@ void camel_folder_change_info_change_uid
void camel_folder_change_info_recent_uid
(CamelFolderChangeInfo *info,
const gchar *uid);
-
-void camel_folder_lock (CamelFolder *folder, CamelFolderLock lock);
-void camel_folder_unlock (CamelFolder *folder, CamelFolderLock lock);
+void camel_folder_lock (CamelFolder *folder,
+ CamelFolderLock lock);
+void camel_folder_unlock (CamelFolder *folder,
+ CamelFolderLock lock);
G_END_DECLS
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index 07edc01..0f7cc41 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -73,15 +73,21 @@
static gint logid;
#endif
-#define CAMEL_CIPHER_CONTEXT_GET_CLASS(obj) \
- ((CamelCipherContextClass *) CAMEL_OBJECT_GET_CLASS (obj))
-
-static CamelCipherContextClass *parent_class = NULL;
+#define CAMEL_GPG_CONTEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_GPG_CONTEXT, CamelGpgContextPrivate))
struct _CamelGpgContextPrivate {
gboolean always_trust;
};
+enum {
+ PROP_0,
+ PROP_ALWAYS_TRUST
+};
+
+G_DEFINE_TYPE (CamelGpgContext, camel_gpg_context, CAMEL_TYPE_CIPHER_CONTEXT)
+
static const gchar *
gpg_hash_to_id (CamelCipherContext *context, CamelCipherHash hash)
{
@@ -217,7 +223,7 @@ gpg_ctx_new (CamelCipherContext *context)
gpg = g_new (struct _GpgCtx, 1);
gpg->mode = GPG_CTX_MODE_SIGN;
- gpg->session = camel_object_ref (session);
+ gpg->session = g_object_ref (session);
gpg->userid_hint = g_hash_table_new (g_str_hash, g_str_equal);
gpg->complete = FALSE;
gpg->seen_eof1 = TRUE;
@@ -278,8 +284,8 @@ gpg_ctx_new (CamelCipherContext *context)
fstream = camel_stream_filter_new (stream);
camel_stream_filter_add (
CAMEL_STREAM_FILTER (fstream), filter);
- camel_object_unref (filter);
- camel_object_unref (stream);
+ g_object_unref (filter);
+ g_object_unref (stream);
stream = (CamelStream *) fstream;
}
@@ -346,18 +352,18 @@ gpg_ctx_set_armor (struct _GpgCtx *gpg, gboolean armor)
static void
gpg_ctx_set_istream (struct _GpgCtx *gpg, CamelStream *istream)
{
- camel_object_ref (istream);
+ g_object_ref (istream);
if (gpg->istream)
- camel_object_unref (gpg->istream);
+ g_object_unref (gpg->istream);
gpg->istream = istream;
}
static void
gpg_ctx_set_ostream (struct _GpgCtx *gpg, CamelStream *ostream)
{
- camel_object_ref (ostream);
+ g_object_ref (ostream);
if (gpg->ostream)
- camel_object_unref (gpg->ostream);
+ g_object_unref (gpg->ostream);
gpg->ostream = ostream;
gpg->seen_eof1 = FALSE;
}
@@ -393,7 +399,7 @@ gpg_ctx_free (struct _GpgCtx *gpg)
return;
if (gpg->session)
- camel_object_unref (gpg->session);
+ g_object_unref (gpg->session);
g_hash_table_foreach (gpg->userid_hint, userid_hint_free, NULL);
g_hash_table_destroy (gpg->userid_hint);
@@ -430,12 +436,12 @@ gpg_ctx_free (struct _GpgCtx *gpg)
}
if (gpg->istream)
- camel_object_unref (gpg->istream);
+ g_object_unref (gpg->istream);
if (gpg->ostream)
- camel_object_unref (gpg->ostream);
+ g_object_unref (gpg->ostream);
- camel_object_unref (gpg->diagnostics);
+ g_object_unref (gpg->diagnostics);
if (gpg->signers)
g_string_free (gpg->signers, TRUE);
@@ -726,6 +732,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg,
if (strncmp ((const gchar *) status, "[GNUPG:] ", 9) != 0) {
gchar *message;
+
message = g_locale_to_utf8 (
(const gchar *) status, -1, NULL, NULL, NULL);
camel_exception_setv (
@@ -1372,7 +1379,7 @@ gpg_sign (CamelCipherContext *context,
printf("Writing gpg signing data to '%s'\n", name);
camel_stream_write_to_stream(istream, out);
camel_stream_reset(istream);
- camel_object_unref (out);
+ g_object_unref (out);
}
g_free(name);
camel_debug_end();
@@ -1427,7 +1434,7 @@ gpg_sign (CamelCipherContext *context,
camel_content_type_unref(ct);
camel_medium_set_content ((CamelMedium *)sigpart, dw);
- camel_object_unref (dw);
+ g_object_unref (dw);
camel_mime_part_set_description(sigpart, "This is a digitally signed message part");
@@ -1442,11 +1449,11 @@ gpg_sign (CamelCipherContext *context,
mps->signature = sigpart;
mps->contentraw = istream;
camel_stream_reset(istream);
- camel_object_ref (istream);
+ g_object_ref (istream);
camel_medium_set_content ((CamelMedium *)opart, (CamelDataWrapper *)mps);
fail:
- camel_object_unref (ostream);
+ g_object_unref (ostream);
if (gpg)
gpg_ctx_free (gpg);
@@ -1478,7 +1485,7 @@ swrite (CamelMimePart *sigpart)
ret = camel_stream_close (ostream);
}
- camel_object_unref (ostream);
+ g_object_unref (ostream);
if (ret == -1) {
g_unlink (template);
@@ -1513,7 +1520,7 @@ add_signers (CamelCipherValidity *validity, const GString *signers)
camel_cipher_validity_add_certinfo (validity, CAMEL_CIPHER_VALIDITY_SIGN, name, email);
}
- camel_object_unref (address);
+ g_object_unref (address);
}
static CamelCipherValidity *
@@ -1567,7 +1574,7 @@ gpg_verify (CamelCipherContext *context,
ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot verify message signature: "
"Incorrect message format"));
- camel_object_unref (istream);
+ g_object_unref (istream);
return NULL;
}
} else if (camel_content_type_is(ct, "application", "x-inlinepgp-signed")) {
@@ -1599,7 +1606,7 @@ gpg_verify (CamelCipherContext *context,
printf("Writing gpg verify data to '%s'\n", name);
camel_stream_write_to_stream(istream, out);
camel_stream_reset(istream);
- camel_object_unref (out);
+ g_object_unref (out);
}
g_free(name);
@@ -1610,7 +1617,7 @@ gpg_verify (CamelCipherContext *context,
if (out) {
printf("Writing gpg verify signature to '%s'\n", name);
camel_data_wrapper_write_to_stream((CamelDataWrapper *)sigpart, out);
- camel_object_unref (out);
+ g_object_unref (out);
}
g_free(name);
}
@@ -1637,11 +1644,11 @@ gpg_verify (CamelCipherContext *context,
filter = camel_stream_filter_new (canon_stream);
canon = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF | CAMEL_MIME_FILTER_CANON_STRIP);
camel_stream_filter_add (CAMEL_STREAM_FILTER (filter), canon);
- camel_object_unref (canon);
+ g_object_unref (canon);
camel_stream_write_to_stream (istream, filter);
- camel_object_unref (filter);
+ g_object_unref (filter);
camel_stream_reset (istream);
camel_stream_reset (canon_stream);
@@ -1702,8 +1709,8 @@ gpg_verify (CamelCipherContext *context,
g_unlink (sigfile);
g_free (sigfile);
}
- camel_object_unref (istream);
- camel_object_unref (canon_stream);
+ g_object_unref (istream);
+ g_object_unref (canon_stream);
return validity;
@@ -1713,7 +1720,7 @@ gpg_verify (CamelCipherContext *context,
gpg_ctx_free (gpg);
if (istream)
- camel_object_unref (istream);
+ g_object_unref (istream);
if (sigfile) {
g_unlink (sigfile);
@@ -1802,7 +1809,7 @@ gpg_encrypt (CamelCipherContext *context,
camel_content_type_unref(ct);
camel_medium_set_content ((CamelMedium *)encpart, dw);
- camel_object_unref (dw);
+ g_object_unref (dw);
camel_mime_part_set_description(encpart, _("This is a digitally encrypted message part"));
@@ -1814,9 +1821,9 @@ gpg_encrypt (CamelCipherContext *context,
dw = camel_data_wrapper_new();
camel_data_wrapper_set_mime_type(dw, class->encrypt_protocol);
camel_data_wrapper_construct_from_stream (dw, vstream);
- camel_object_unref (vstream);
+ g_object_unref (vstream);
camel_medium_set_content ((CamelMedium *)verpart, dw);
- camel_object_unref (dw);
+ g_object_unref (dw);
mpe = camel_multipart_encrypted_new();
ct = camel_content_type_new("multipart", "encrypted");
@@ -1825,19 +1832,19 @@ gpg_encrypt (CamelCipherContext *context,
camel_content_type_unref(ct);
camel_multipart_set_boundary((CamelMultipart *)mpe, NULL);
- mpe->decrypted = camel_object_ref (ipart);
+ mpe->decrypted = g_object_ref (ipart);
camel_multipart_add_part((CamelMultipart *)mpe, verpart);
- camel_object_unref (verpart);
+ g_object_unref (verpart);
camel_multipart_add_part((CamelMultipart *)mpe, encpart);
- camel_object_unref (encpart);
+ g_object_unref (encpart);
camel_medium_set_content ((CamelMedium *)opart, (CamelDataWrapper *)mpe);
fail:
gpg_ctx_free(gpg);
fail1:
- camel_object_unref (istream);
- camel_object_unref (ostream);
+ g_object_unref (istream);
+ g_object_unref (ostream);
return res;
}
@@ -1897,7 +1904,7 @@ gpg_decrypt (CamelCipherContext *context,
istream = camel_stream_mem_new();
camel_data_wrapper_decode_to_stream (content, istream);
- camel_stream_reset(istream);
+ camel_stream_reset (istream);
ostream = camel_stream_mem_new();
camel_stream_mem_set_secure((CamelStreamMem *)ostream);
@@ -1932,7 +1939,7 @@ gpg_decrypt (CamelCipherContext *context,
goto fail;
}
- camel_stream_reset(ostream);
+ camel_stream_reset (ostream);
if (camel_content_type_is(ct, "multipart", "encrypted")) {
CamelDataWrapper *dw;
CamelStream *null = camel_stream_null_new ();
@@ -1949,7 +1956,7 @@ gpg_decrypt (CamelCipherContext *context,
rv = camel_data_wrapper_construct_from_stream (dw, ostream);
}
- camel_object_unref (null);
+ g_object_unref (null);
} else {
/* Inline signed - raw data (may not be a mime part) */
CamelDataWrapper *dw;
@@ -1957,7 +1964,7 @@ gpg_decrypt (CamelCipherContext *context,
rv = camel_data_wrapper_construct_from_stream (dw, ostream);
camel_data_wrapper_set_mime_type(dw, "application/octet-stream");
camel_medium_set_content ((CamelMedium *)opart, dw);
- camel_object_unref (dw);
+ g_object_unref (dw);
/* 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");
}
@@ -1990,8 +1997,8 @@ gpg_decrypt (CamelCipherContext *context,
}
fail:
- camel_object_unref (ostream);
- camel_object_unref (istream);
+ g_object_unref (ostream);
+ g_object_unref (istream);
gpg_ctx_free (gpg);
return valid;
@@ -2097,17 +2104,51 @@ fail:
/* ********************************************************************** */
static void
-gpg_context_finalize (CamelObject *object)
+gpg_context_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- g_free (CAMEL_GPG_CONTEXT (object)->priv);
+ switch (property_id) {
+ case PROP_ALWAYS_TRUST:
+ camel_gpg_context_set_always_trust (
+ CAMEL_GPG_CONTEXT (object),
+ g_value_get_boolean (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+gpg_context_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_ALWAYS_TRUST:
+ g_value_set_boolean (
+ value,
+ camel_gpg_context_get_always_trust (
+ CAMEL_GPG_CONTEXT (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
static void
camel_gpg_context_class_init (CamelGpgContextClass *class)
{
+ GObjectClass *object_class;
CamelCipherContextClass *cipher_context_class;
- parent_class = CAMEL_CIPHER_CONTEXT_CLASS (camel_type_get_global_classfuncs (camel_cipher_context_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelGpgContextClass));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = gpg_context_set_property;
+ object_class->get_property = gpg_context_get_property;
cipher_context_class = CAMEL_CIPHER_CONTEXT_CLASS (class);
cipher_context_class->sign_protocol = "application/pgp-signature";
@@ -2121,31 +2162,23 @@ camel_gpg_context_class_init (CamelGpgContextClass *class)
cipher_context_class->decrypt = gpg_decrypt;
cipher_context_class->import_keys = gpg_import_keys;
cipher_context_class->export_keys = gpg_export_keys;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_ALWAYS_TRUST,
+ g_param_spec_boolean (
+ "always-trust",
+ "Always Trust",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
}
static void
camel_gpg_context_init (CamelGpgContext *context)
{
- context->priv = g_new0 (CamelGpgContextPrivate, 1);
-}
-
-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",
- sizeof (CamelGpgContext),
- sizeof (CamelGpgContextClass),
- (CamelObjectClassInitFunc) camel_gpg_context_class_init,
- NULL,
- (CamelObjectInitFunc) camel_gpg_context_init,
- (CamelObjectFinalizeFunc) gpg_context_finalize);
- }
-
- return type;
+ context->priv = CAMEL_GPG_CONTEXT_GET_PRIVATE (context);
}
/**
@@ -2159,17 +2192,11 @@ camel_gpg_context_get_type (void)
CamelCipherContext *
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 = CAMEL_CIPHER_CONTEXT (ctx);
- camel_cipher_context_construct (CAMEL_CIPHER_CONTEXT (ctx), session);
-
- return cipher;
+ return g_object_new (
+ CAMEL_TYPE_GPG_CONTEXT,
+ "session", session, NULL);
}
gboolean
@@ -2195,5 +2222,6 @@ camel_gpg_context_set_always_trust (CamelGpgContext *context,
g_return_if_fail (CAMEL_IS_GPG_CONTEXT (context));
context->priv->always_trust = always_trust;
-}
+ g_object_notify (G_OBJECT (context), "always-trust");
+}
diff --git a/camel/camel-gpg-context.h b/camel/camel-gpg-context.h
index 8e48786..dc6495b 100644
--- a/camel/camel-gpg-context.h
+++ b/camel/camel-gpg-context.h
@@ -30,10 +30,24 @@
#include <camel/camel-cipher-context.h>
#include <camel/camel-session.h>
-#define CAMEL_GPG_CONTEXT_TYPE (camel_gpg_context_get_type ())
-#define CAMEL_GPG_CONTEXT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_GPG_CONTEXT_TYPE, CamelGpgContext))
-#define CAMEL_GPG_CONTEXT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_GPG_CONTEXT_TYPE, CamelGpgContextClass))
-#define CAMEL_IS_GPG_CONTEXT(o) (CAMEL_CHECK_TYPE((o), CAMEL_GPG_CONTEXT_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_GPG_CONTEXT \
+ (camel_gpg_context_get_type ())
+#define CAMEL_GPG_CONTEXT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_GPG_CONTEXT, CamelGpgContext))
+#define CAMEL_GPG_CONTEXT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_GPG_CONTEXT, CamelGpgContextClass))
+#define CAMEL_IS_GPG_CONTEXT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_GPG_CONTEXT))
+#define CAMEL_IS_GPG_CONTEXT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_GPG_CONTEXT))
+#define CAMEL_GPG_CONTEXT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_GPG_CONTEXT, CamelGpgContextClass))
G_BEGIN_DECLS
@@ -50,7 +64,7 @@ struct _CamelGpgContextClass {
CamelCipherContextClass parent_class;
};
-CamelType camel_gpg_context_get_type (void);
+GType camel_gpg_context_get_type (void);
CamelCipherContext *
camel_gpg_context_new (CamelSession *session);
gboolean camel_gpg_context_get_always_trust
diff --git a/camel/camel-html-parser.c b/camel/camel-html-parser.c
index b33212b..2504549 100644
--- a/camel/camel-html-parser.c
+++ b/camel/camel-html-parser.c
@@ -34,8 +34,6 @@
/* if defined, must also compile in dump_tag() below somewhere */
#define d(x)
-static CamelObjectClass *camel_html_parser_parent;
-
/* Parser definitions, see below object code for details */
struct _CamelHTMLParserPrivate {
@@ -60,20 +58,28 @@ static CamelHTMLParserPrivate *tokenize_init(void);
static void tokenize_free(CamelHTMLParserPrivate *p);
static gint tokenize_step(CamelHTMLParserPrivate *p, gchar **datap, gint *lenp);
+G_DEFINE_TYPE (CamelHTMLParser, camel_html_parser, CAMEL_TYPE_OBJECT)
+
/* ********************************************************************** */
static void
-html_parser_finalize (CamelObject *o)
+html_parser_finalize (GObject *object)
{
- CamelHTMLParser *parser = (CamelHTMLParser *)o;
+ CamelHTMLParser *parser = CAMEL_HTML_PARSER (object);
tokenize_free (parser->priv);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_html_parser_parent_class)->finalize (object);
}
static void
-camel_html_parser_class_init (CamelHTMLParserClass *klass)
+camel_html_parser_class_init (CamelHTMLParserClass *class)
{
- camel_html_parser_parent = CAMEL_OBJECT_CLASS (camel_type_get_global_classfuncs (camel_object_get_type ()));
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = html_parser_finalize;
tokenize_setup();
}
@@ -84,24 +90,6 @@ camel_html_parser_init (CamelHTMLParser *parser)
parser->priv = tokenize_init();
}
-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),
- sizeof (CamelHTMLParserClass),
- (CamelObjectClassInitFunc) camel_html_parser_class_init,
- NULL,
- (CamelObjectInitFunc) camel_html_parser_init,
- (CamelObjectFinalizeFunc) html_parser_finalize);
- }
-
- return type;
-}
-
/**
* camel_html_parser_new:
*
@@ -112,7 +100,7 @@ camel_html_parser_get_type (void)
CamelHTMLParser *
camel_html_parser_new (void)
{
- return CAMEL_HTML_PARSER ( camel_object_new (camel_html_parser_get_type ()));
+ return g_object_new (CAMEL_TYPE_HTML_PARSER, NULL);
}
void camel_html_parser_set_data(CamelHTMLParser *hp, const gchar *start, gint len, gint last)
diff --git a/camel/camel-html-parser.h b/camel/camel-html-parser.h
index f5c0207..b440b32 100644
--- a/camel/camel-html-parser.h
+++ b/camel/camel-html-parser.h
@@ -34,9 +34,24 @@
#include <camel/camel-object.h>
-#define CAMEL_HTML_PARSER(obj) CAMEL_CHECK_CAST (obj, camel_html_parser_get_type (), CamelHTMLParser)
-#define CAMEL_HTML_PARSER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_html_parser_get_type (), CamelHTMLParserClass)
-#define CAMEL_IS_HTML_PARSER(obj) CAMEL_CHECK_TYPE (obj, camel_html_parser_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_HTML_PARSER \
+ (camel_html_parser_get_type ())
+#define CAMEL_HTML_PARSER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_HTML_PARSER, CamelHTMLParser))
+#define CAMEL_HTML_PARSER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_HTML_PARSER, CamelHTMLParserClass))
+#define CAMEL_IS_HTML_PARSER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_HTML_PARSER))
+#define CAMEL_IS_HTML_PARSER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_HTML_PARSER))
+#define CAMEL_HTML_PARSER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_HTML_PARSER, CamelHTMLParserClass))
G_BEGIN_DECLS
@@ -71,7 +86,7 @@ struct _CamelHTMLParserClass {
CamelObjectClass parent_class;
};
-CamelType camel_html_parser_get_type (void);
+GType camel_html_parser_get_type (void);
CamelHTMLParser *camel_html_parser_new (void);
void camel_html_parser_set_data(CamelHTMLParser *hp, const gchar *start, gint len, gint last);
diff --git a/camel/camel-http-stream.c b/camel/camel-http-stream.c
index 29d1a03..b6a56e5 100644
--- a/camel/camel-http-stream.c
+++ b/camel/camel-http-stream.c
@@ -52,7 +52,7 @@
#define d(x)
-static CamelStreamClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelHttpStream, camel_http_stream, CAMEL_TYPE_STREAM)
static CamelStream *
http_connect (CamelHttpStream *http,
@@ -89,7 +89,7 @@ http_connect (CamelHttpStream *http,
ai = camel_getaddrinfo(url->host, serv, &hints, NULL);
if (ai == NULL) {
- camel_object_unref (stream);
+ g_object_unref (stream);
return NULL;
}
@@ -97,7 +97,7 @@ http_connect (CamelHttpStream *http,
if (camel_tcp_stream_connect (tcp_stream, ai) == -1) {
errsave = errno;
- camel_object_unref (stream);
+ g_object_unref (stream);
camel_freeaddrinfo(ai);
errno = errsave;
return NULL;
@@ -115,17 +115,17 @@ static void
http_disconnect (CamelHttpStream *http)
{
if (http->raw) {
- camel_object_unref (http->raw);
+ g_object_unref (http->raw);
http->raw = NULL;
}
if (http->read) {
- camel_object_unref (http->read);
+ g_object_unref (http->read);
http->read = NULL;
}
if (http->parser) {
- camel_object_unref (http->parser);
+ g_object_unref (http->parser);
http->parser = NULL;
}
}
@@ -215,7 +215,7 @@ http_get_headers (CamelHttpStream *http)
gint err;
if (http->parser)
- camel_object_unref (http->parser);
+ g_object_unref (http->parser);
http->parser = camel_mime_parser_new ();
camel_mime_parser_init_with_stream (http->parser, http->read);
@@ -259,7 +259,7 @@ http_get_headers (CamelHttpStream *http)
err = camel_mime_parser_errno (http->parser);
if (err != 0) {
- camel_object_unref (http->parser);
+ g_object_unref (http->parser);
http->parser = NULL;
goto exception;
}
@@ -314,19 +314,45 @@ http_get_statuscode (CamelHttpStream *http)
}
static void
-http_stream_finalize (CamelHttpStream *http)
+http_stream_dispose (GObject *object)
{
- if (http->parser)
- camel_object_unref (http->parser);
+ CamelHttpStream *http = CAMEL_HTTP_STREAM (object);
+
+ if (http->parser != NULL) {
+ g_object_unref (http->parser);
+ http->parser = NULL;
+ }
- if (http->content_type)
+ if (http->content_type != NULL) {
camel_content_type_unref (http->content_type);
+ http->content_type = NULL;
+ }
+
+ if (http->session != NULL) {
+ g_object_unref (http->session);
+ http->session = NULL;
+ }
- if (http->headers)
- camel_header_raw_clear (&http->headers);
+ if (http->raw != NULL) {
+ g_object_unref (http->raw);
+ http->raw = NULL;
+ }
- if (http->session != NULL)
- camel_object_unref (http->session);
+ if (http->read != NULL) {
+ g_object_unref (http->read);
+ http->read = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_http_stream_parent_class)->dispose (object);
+}
+
+static void
+http_stream_finalize (GObject *object)
+{
+ CamelHttpStream *http = CAMEL_HTTP_STREAM (object);
+
+ camel_header_raw_clear (&http->headers);
if (http->url != NULL)
camel_url_free (http->url);
@@ -337,11 +363,8 @@ http_stream_finalize (CamelHttpStream *http)
g_free (http->authrealm);
g_free (http->authpass);
- if (http->raw != NULL)
- camel_object_unref (http->raw);
-
- if (http->read != NULL)
- camel_object_unref (http->read);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_http_stream_parent_class)->finalize (object);
}
static gssize
@@ -489,9 +512,12 @@ http_stream_reset (CamelStream *stream)
static void
camel_http_stream_class_init (CamelHttpStreamClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
- parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (camel_stream_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = http_stream_dispose;
+ object_class->finalize = http_stream_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = http_stream_read;
@@ -504,35 +530,6 @@ camel_http_stream_class_init (CamelHttpStreamClass *class)
static void
camel_http_stream_init (CamelHttpStream *http)
{
- http->parser = NULL;
- http->content_type = NULL;
- http->headers = NULL;
- http->session = NULL;
- http->url = NULL;
- http->proxy = NULL;
- http->authrealm = NULL;
- http->authpass = NULL;
- http->statuscode = 0;
- http->raw = NULL;
-}
-
-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",
- sizeof (CamelHttpStream),
- sizeof (CamelHttpStreamClass),
- (CamelObjectClassInitFunc) camel_http_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_http_stream_init,
- (CamelObjectFinalizeFunc) http_stream_finalize);
- }
-
- return type;
}
/**
@@ -552,10 +549,10 @@ camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, Ca
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 = g_object_new (CAMEL_TYPE_HTTP_STREAM, NULL);
stream->method = method;
- stream->session = camel_object_ref (session);
+ stream->session = g_object_ref (session);
str = camel_url_to_string (url, 0);
stream->url = camel_url_new (str, NULL);
diff --git a/camel/camel-http-stream.h b/camel/camel-http-stream.h
index 12327a1..d925be2 100644
--- a/camel/camel-http-stream.h
+++ b/camel/camel-http-stream.h
@@ -32,10 +32,23 @@
#include <camel/camel-stream.h>
#include <camel/camel-url.h>
-#define CAMEL_HTTP_STREAM_TYPE (camel_http_stream_get_type ())
-#define CAMEL_HTTP_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_HTTP_STREAM_TYPE, CamelHttpStream))
-#define CAMEL_HTTP_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_HTTP_STREAM_TYPE, CamelHttpStreamClass))
-#define CAMEL_IS_HTTP_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_HTTP_STREAM_TYPE))
+#define CAMEL_TYPE_HTTP_STREAM \
+ (camel_http_stream_get_type ())
+#define CAMEL_HTTP_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_HTTP_STREAM, CamelHttpStream))
+#define CAMEL_HTTP_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_HTTP_STREAM, CamelHttpStreamClass))
+#define CAMEL_IS_HTTP_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_HTTP_STREAM))
+#define CAMEL_IS_HTTP_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_HTTP_STREAM))
+#define CAMEL_HTTP_STREAM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_HTTP_STREAM, CamelHttpStreamClass))
G_BEGIN_DECLS
@@ -82,7 +95,7 @@ struct _CamelHttpStreamClass {
CamelStreamClass parent_class;
};
-CamelType camel_http_stream_get_type (void);
+GType camel_http_stream_get_type (void);
CamelStream * camel_http_stream_new (CamelHttpMethod method,
struct _CamelSession *session,
CamelURL *url);
diff --git a/camel/camel-index-control.c b/camel/camel-index-control.c
index 269d370..dd0e885 100644
--- a/camel/camel-index-control.c
+++ b/camel/camel-index-control.c
@@ -44,10 +44,10 @@ do_compress(gint argc, gchar **argv)
if (idx) {
printf(" Compressing ...\n");
if (camel_index_compress (idx) == -1) {
- camel_object_unref (idx);
+ g_object_unref (idx);
return 1;
}
- camel_object_unref (idx);
+ g_object_unref (idx);
} else {
printf(" Failed: %s\n", g_strerror (errno));
return 1;
@@ -68,7 +68,7 @@ do_dump(gint argc, gchar **argv)
if (idx) {
printf(" Dumping ...\n");
camel_text_index_dump((CamelTextIndex *)idx);
- camel_object_unref (idx);
+ g_object_unref (idx);
} else {
printf(" Failed: %s\n", g_strerror (errno));
return 1;
@@ -88,7 +88,7 @@ do_info(gint argc, gchar **argv)
idx = (CamelIndex *)camel_text_index_new(argv[i], O_RDONLY);
if (idx) {
camel_text_index_info((CamelTextIndex *)idx);
- camel_object_unref (idx);
+ g_object_unref (idx);
} else {
printf(" Failed: %s\n", g_strerror (errno));
return 0;
@@ -108,7 +108,7 @@ do_check(gint argc, gchar **argv)
idx = (CamelIndex *)camel_text_index_new(argv[i], O_RDONLY);
if (idx) {
camel_text_index_validate((CamelTextIndex *)idx);
- camel_object_unref (idx);
+ g_object_unref (idx);
} else {
printf(" Failed: %s\n", g_strerror (errno));
return 0;
@@ -177,7 +177,7 @@ do_perf(gint argc, gchar **argv)
null = camel_stream_null_new();
filter = camel_stream_filter_new (null);
- camel_object_unref (null);
+ g_object_unref (null);
filter_index = camel_mime_filter_index_new (idx);
camel_stream_filter_add((CamelStreamFilter *)filter, filter_index);
@@ -190,11 +190,11 @@ do_perf(gint argc, gchar **argv)
name = g_strdup_printf("%s/%s", path, d->d_name);
stream = camel_stream_fs_new_with_name(name, O_RDONLY, 0);
camel_stream_write_to_stream(stream, filter);
- camel_object_unref (stream);
+ g_object_unref (stream);
g_free(name);
camel_index_write_name(idx, idn);
- camel_object_unref (idn);
+ g_object_unref (idn);
camel_mime_filter_index_set_name (
CAMEL_MIME_FILTER_INDEX (filter_index), NULL);
}
@@ -202,10 +202,10 @@ do_perf(gint argc, gchar **argv)
closedir(dir);
camel_index_sync(idx);
- camel_object_unref (idx);
+ g_object_unref (idx);
- camel_object_unref (filter);
- camel_object_unref (filter_index);
+ g_object_unref (filter);
+ g_object_unref (filter_index);
return 0;
}
diff --git a/camel/camel-index.c b/camel/camel-index.c
index ee9d83d..f65d0a3 100644
--- a/camel/camel-index.c
+++ b/camel/camel-index.c
@@ -39,65 +39,55 @@
#define CAMEL_INDEX_VERSION (0x01)
+#define CAMEL_INDEX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_INDEX, CamelIndexPrivate))
+
struct _CamelIndexPrivate {
gpointer dummy;
};
-#define _PRIVATE(o) (((CamelIndex *)(o))->priv)
-
/* ********************************************************************** */
/* CamelIndex */
/* ********************************************************************** */
-static CamelObjectClass *camel_index_parent;
+G_DEFINE_TYPE (CamelIndex, camel_index, CAMEL_TYPE_OBJECT)
static void
-index_finalize (CamelIndex *index)
+index_finalize (GObject *object)
{
+ CamelIndex *index = CAMEL_INDEX (object);
+
g_free (index->path);
- g_free (index->priv);
-}
-static void
-camel_index_class_init (CamelIndexClass *klass)
-{
- camel_index_parent = CAMEL_OBJECT_CLASS(camel_type_get_global_classfuncs(camel_object_get_type()));
+ /* Chain up to parent's finalize () method. */
+ G_OBJECT_CLASS (camel_index_parent_class)->finalize (object);
}
static void
-camel_index_init (CamelIndex *idx)
+camel_index_class_init (CamelIndexClass *class)
{
- struct _CamelIndexPrivate *p;
+ GObjectClass *object_class;
- p = _PRIVATE(idx) = g_malloc0(sizeof(*p));
+ g_type_class_add_private (class, sizeof (CamelIndexPrivate));
- idx->version = CAMEL_INDEX_VERSION;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = index_finalize;
}
-CamelType
-camel_index_get_type(void)
+static void
+camel_index_init (CamelIndex *index)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelIndex",
- sizeof (CamelIndex),
- sizeof (CamelIndexClass),
- (CamelObjectClassInitFunc) camel_index_class_init,
- NULL,
- (CamelObjectInitFunc) camel_index_init,
- (CamelObjectFinalizeFunc) index_finalize);
- }
-
- return type;
+ index->priv = CAMEL_INDEX_GET_PRIVATE (index);
+ index->version = CAMEL_INDEX_VERSION;
}
CamelIndex *
-camel_index_new(const gchar *path, gint flags)
+camel_index_new (const gchar *path, gint flags)
{
CamelIndex *idx;
- idx = (CamelIndex *)camel_object_new(camel_index_get_type());
+ idx = g_object_new (CAMEL_TYPE_INDEX, NULL);
camel_index_construct (idx, path, flags);
return idx;
@@ -338,42 +328,34 @@ camel_index_names (CamelIndex *idx)
/* CamelIndexName */
/* ********************************************************************** */
-static CamelObjectClass *camel_index_name_parent;
+G_DEFINE_TYPE (CamelIndexName, camel_index_name, CAMEL_TYPE_OBJECT)
static void
-index_name_finalize(CamelIndexName *idn)
+index_name_dispose (GObject *object)
{
- if (idn->index)
- camel_object_unref (idn->index);
-}
+ CamelIndexName *index_name = CAMEL_INDEX_NAME (object);
-static void
-camel_index_name_class_init(CamelIndexNameClass *klass)
-{
- camel_index_name_parent = CAMEL_OBJECT_CLASS(camel_type_get_global_classfuncs(camel_object_get_type()));
+ if (index_name->index != NULL) {
+ g_object_unref (index_name->index);
+ index_name->index = NULL;
+ }
+
+ /* Chain up to parent's dispose () method. */
+ G_OBJECT_CLASS (camel_index_name_parent_class)->dispose (object);
}
static void
-camel_index_name_init(CamelIndexName *idn)
+camel_index_name_class_init (CamelIndexNameClass *class)
{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = index_name_dispose;
}
-CamelType
-camel_index_name_get_type(void)
+static void
+camel_index_name_init (CamelIndexName *index_name)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelIndexName",
- sizeof (CamelIndexName),
- sizeof (CamelIndexNameClass),
- (CamelObjectClassInitFunc) camel_index_name_class_init,
- NULL,
- (CamelObjectInitFunc) camel_index_name_init,
- (CamelObjectFinalizeFunc) index_name_finalize);
- }
-
- return type;
}
CamelIndexName *
@@ -381,8 +363,8 @@ camel_index_name_new (CamelIndex *idx, const gchar *name)
{
CamelIndexName *idn;
- idn = (CamelIndexName *)camel_object_new(camel_index_name_get_type());
- idn->index = camel_object_ref (idx);
+ idn = g_object_new (CAMEL_TYPE_INDEX_NAME, NULL);
+ idn->index = g_object_ref (idx);
return idn;
}
@@ -427,42 +409,34 @@ camel_index_name_add_buffer (CamelIndexName *idn,
/* CamelIndexCursor */
/* ********************************************************************** */
-static CamelObjectClass *camel_index_cursor_parent;
+G_DEFINE_TYPE (CamelIndexCursor, camel_index_cursor, CAMEL_TYPE_OBJECT)
static void
-index_cursor_finalize (CamelIndexCursor *idc)
+index_cursor_dispose (GObject *object)
{
- if (idc->index)
- camel_object_unref (idc->index);
-}
+ CamelIndexCursor *index_cursor = CAMEL_INDEX_CURSOR (object);
-static void
-camel_index_cursor_class_init (CamelIndexCursorClass *klass)
-{
- camel_index_cursor_parent = CAMEL_OBJECT_CLASS(camel_type_get_global_classfuncs(camel_object_get_type()));
+ if (index_cursor->index != NULL) {
+ g_object_unref (index_cursor->index);
+ index_cursor->index = NULL;
+ }
+
+ /* Chain up to parent's dispose () method. */
+ G_OBJECT_CLASS (camel_index_cursor_parent_class)->dispose (object);
}
static void
-camel_index_cursor_init (CamelIndexCursor *idc)
+camel_index_cursor_class_init (CamelIndexCursorClass *class)
{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = index_cursor_dispose;
}
-CamelType
-camel_index_cursor_get_type(void)
+static void
+camel_index_cursor_init (CamelIndexCursor *index_cursor)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelIndexCursor",
- sizeof (CamelIndexCursor),
- sizeof (CamelIndexCursorClass),
- (CamelObjectClassInitFunc) camel_index_cursor_class_init,
- NULL,
- (CamelObjectInitFunc) camel_index_cursor_init,
- (CamelObjectFinalizeFunc) index_cursor_finalize);
- }
-
- return type;
}
CamelIndexCursor *
@@ -470,8 +444,8 @@ camel_index_cursor_new (CamelIndex *idx, const gchar *name)
{
CamelIndexCursor *idc;
- idc = (CamelIndexCursor *)camel_object_new(camel_index_cursor_get_type());
- idc->index = camel_object_ref (idx);
+ idc = g_object_new (CAMEL_TYPE_INDEX_CURSOR, NULL);
+ idc->index = g_object_ref (idx);
return idc;
}
diff --git a/camel/camel-index.h b/camel/camel-index.h
index 81ea5b4..1821d8d 100644
--- a/camel/camel-index.h
+++ b/camel/camel-index.h
@@ -28,23 +28,60 @@
#include <camel/camel-exception.h>
#include <camel/camel-object.h>
-#define CAMEL_INDEX(obj) CAMEL_CHECK_CAST (obj, camel_index_get_type (), CamelIndex)
-#define CAMEL_INDEX_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_index_get_type (), CamelIndexClass)
-#define CAMEL_IS_INDEX(obj) CAMEL_CHECK_TYPE (obj, camel_index_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_INDEX \
+ (camel_index_get_type ())
+#define CAMEL_INDEX(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_INDEX, CamelIndex))
+#define CAMEL_INDEX_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_INDEX, CamelIndexClass))
+#define CAMEL_IS_INDEX(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_INDEX))
+#define CAMEL_IS_INDEX_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_INDEX))
#define CAMEL_INDEX_GET_CLASS(obj) \
- ((CamelIndexClass *) CAMEL_OBJECT_GET_CLASS (obj))
-
-#define CAMEL_INDEX_NAME(obj) CAMEL_CHECK_CAST (obj, camel_index_name_get_type (), CamelIndexName)
-#define CAMEL_INDEX_NAME_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_index_name_get_type (), CamelIndexNameClass)
-#define CAMEL_IS_INDEX_NAME(obj) CAMEL_CHECK_TYPE (obj, camel_index_name_get_type ())
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_INDEX, CamelIndexClass))
+
+#define CAMEL_TYPE_INDEX_NAME \
+ (camel_index_name_get_type ())
+#define CAMEL_INDEX_NAME(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_INDEX_NAME, CamelIndexName))
+#define CAMEL_INDEX_NAME_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_INDEX_NAME, CamelIndexNameClass))
+#define CAMEL_IS_INDEX_NAME(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_INDEX_NAME))
+#define CAMEL_IS_INDEX_NAME_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_INDEX_NAME))
#define CAMEL_INDEX_NAME_GET_CLASS(obj) \
- ((CamelIndexNameClass *) CAMEL_OBJECT_GET_CLASS (obj))
-
-#define CAMEL_INDEX_CURSOR(obj) CAMEL_CHECK_CAST (obj, camel_index_cursor_get_type (), CamelIndexCursor)
-#define CAMEL_INDEX_CURSOR_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_index_cursor_get_type (), CamelIndexCursorClass)
-#define CAMEL_IS_INDEX_CURSOR(obj) CAMEL_CHECK_TYPE (obj, camel_index_cursor_get_type ())
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_INDEX_NAME, CamelIndexNameClass))
+
+#define CAMEL_TYPE_INDEX_CURSOR \
+ (camel_index_cursor_get_type ())
+#define CAMEL_INDEX_CURSOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_INDEX_CURSOR, CamelIndexCursor))
+#define CAMEL_INDEX_CURSOR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_INDEX_CURSOR, CamelIndexCursorClass))
+#define CAMEL_IS_INDEX_CURSOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_INDEX_CURSOR))
+#define CAMEL_IS_INDEX_CURSOR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_INDEX_CURSOR))
#define CAMEL_INDEX_CURSOR_GET_CLASS(obj) \
- ((CamelIndexCursorClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_INDEX_CURSOR, CamelIndexCursorClass))
G_BEGIN_DECLS
@@ -78,7 +115,7 @@ struct _CamelIndexCursorClass {
void (*reset) (CamelIndexCursor *idc);
};
-CamelType camel_index_cursor_get_type(void);
+GType camel_index_cursor_get_type(void);
CamelIndexCursor *camel_index_cursor_new(CamelIndex *index, const gchar *name);
@@ -107,7 +144,7 @@ struct _CamelIndexNameClass {
gsize (*add_buffer)(CamelIndexName *name, const gchar *buffer, gsize len);
};
-CamelType camel_index_name_get_type (void);
+GType camel_index_name_get_type (void);
CamelIndexName *camel_index_name_new(CamelIndex *index, const gchar *name);
@@ -160,7 +197,7 @@ struct _CamelIndexClass {
/* flags, stored in 'state', set with set_state */
#define CAMEL_INDEX_DELETED (1<<0)
-CamelType camel_index_get_type (void);
+GType camel_index_get_type (void);
CamelIndex * camel_index_new (const gchar *path,
gint flags);
void camel_index_construct (CamelIndex *index,
diff --git a/camel/camel-internet-address.c b/camel/camel-internet-address.c
index 3eb6302..5518231 100644
--- a/camel/camel-internet-address.c
+++ b/camel/camel-internet-address.c
@@ -26,13 +26,13 @@
#define d(x)
-static CamelAddressClass *camel_internet_address_parent;
-
struct _address {
gchar *name;
gchar *address;
};
+G_DEFINE_TYPE (CamelInternetAddress, camel_internet_address, CAMEL_TYPE_ADDRESS)
+
static gint
internet_address_decode (CamelAddress *a, const gchar *raw)
{
@@ -225,8 +225,6 @@ camel_internet_address_class_init (CamelInternetAddressClass *class)
{
CamelAddressClass *address_class;
- camel_internet_address_parent = CAMEL_ADDRESS_CLASS(camel_type_get_global_classfuncs(camel_address_get_type()));
-
address_class = CAMEL_ADDRESS_CLASS (class);
address_class->decode = internet_address_decode;
address_class->encode = internet_address_encode;
@@ -241,24 +239,6 @@ camel_internet_address_init (CamelInternetAddress *internet_address)
{
}
-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),
- sizeof (CamelInternetAddressClass),
- (CamelObjectClassInitFunc) camel_internet_address_class_init,
- NULL,
- (CamelObjectInitFunc) camel_internet_address_init,
- NULL);
- }
-
- return type;
-}
-
/**
* camel_internet_address_new:
*
@@ -269,7 +249,7 @@ camel_internet_address_get_type(void)
CamelInternetAddress *
camel_internet_address_new (void)
{
- return CAMEL_INTERNET_ADDRESS(camel_object_new(camel_internet_address_get_type()));
+ return g_object_new (CAMEL_TYPE_INTERNET_ADDRESS, NULL);
}
/**
diff --git a/camel/camel-internet-address.h b/camel/camel-internet-address.h
index bffcf3b..60d3e2c 100644
--- a/camel/camel-internet-address.h
+++ b/camel/camel-internet-address.h
@@ -28,9 +28,24 @@
#include <camel/camel-address.h>
-#define CAMEL_INTERNET_ADDRESS(obj) CAMEL_CHECK_CAST (obj, camel_internet_address_get_type (), CamelInternetAddress)
-#define CAMEL_INTERNET_ADDRESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_internet_address_get_type (), CamelInternetAddressClass)
-#define CAMEL_IS_INTERNET_ADDRESS(obj) CAMEL_CHECK_TYPE (obj, camel_internet_address_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_INTERNET_ADDRESS \
+ (camel_internet_address_get_type ())
+#define CAMEL_INTERNET_ADDRESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_INTERNET_ADDRESS, CamelInternetAddress))
+#define CAMEL_INTERNET_ADDRESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_INTERNET_ADDRESS, CamelInternetAddressClass))
+#define CAMEL_IS_INTERNET_ADDRESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_INTERNET_ADDRESS))
+#define CAMEL_IS_INTERNET_ADDRESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_INTERNET_ADDRESS))
+#define CAMEL_INTERNET_ADDRESS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_INTERNET_ADDRESS, CamelInternetAddressClass))
G_BEGIN_DECLS
@@ -47,7 +62,7 @@ struct _CamelInternetAddressClass {
CamelAddressClass parent_class;
};
-CamelType camel_internet_address_get_type (void);
+GType camel_internet_address_get_type (void);
CamelInternetAddress *
camel_internet_address_new (void);
gint camel_internet_address_add (CamelInternetAddress *addr,
diff --git a/camel/camel-medium.c b/camel/camel-medium.c
index 5ed5d2d..ef0f162 100644
--- a/camel/camel-medium.c
+++ b/camel/camel-medium.c
@@ -33,15 +33,72 @@
#define d(x)
-static CamelDataWrapperClass *camel_medium_parent_class = NULL;
+#define CAMEL_MEDIUM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MEDIUM, CamelMediumPrivate))
+
+struct _CamelMediumPrivate {
+ /* The content of the medium, as opposed to our parent
+ * CamelDataWrapper, which wraps both the headers and
+ * the content. */
+ CamelDataWrapper *content;
+};
+
+enum {
+ PROP_0,
+ PROP_CONTENT
+};
+
+G_DEFINE_ABSTRACT_TYPE (CamelMedium, camel_medium, CAMEL_TYPE_DATA_WRAPPER)
+
+static void
+medium_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_CONTENT:
+ camel_medium_set_content (
+ CAMEL_MEDIUM (object),
+ g_value_get_object (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+medium_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_CONTENT:
+ g_value_set_object (
+ value, camel_medium_get_content (
+ CAMEL_MEDIUM (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
static void
-medium_finalize (CamelObject *object)
+medium_dispose (GObject *object)
{
- CamelMedium *medium = CAMEL_MEDIUM (object);
+ CamelMediumPrivate *priv;
- if (medium->content != NULL)
- camel_object_unref (medium->content);
+ priv = CAMEL_MEDIUM_GET_PRIVATE (object);
+
+ if (priv->content != NULL) {
+ g_object_unref (priv->content);
+ priv->content = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_medium_parent_class)->dispose (object);
}
static gboolean
@@ -60,55 +117,56 @@ medium_set_content (CamelMedium *medium,
CamelDataWrapper *content)
{
if (content != NULL)
- camel_object_ref (content);
+ g_object_ref (content);
+
+ if (medium->priv->content != NULL)
+ g_object_unref (medium->priv->content);
- if (medium->content != NULL)
- camel_object_unref (medium->content);
+ medium->priv->content = content;
- medium->content = content;
+ g_object_notify (G_OBJECT (medium), "content");
}
static CamelDataWrapper *
medium_get_content (CamelMedium *medium)
{
- return medium->content;
+ return medium->priv->content;
}
static void
camel_medium_class_init (CamelMediumClass *class)
{
+ GObjectClass *object_class;
CamelDataWrapperClass *data_wrapper_class;
- camel_medium_parent_class = CAMEL_DATA_WRAPPER_CLASS (camel_type_get_global_classfuncs (camel_data_wrapper_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMediumPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = medium_set_property;
+ object_class->get_property = medium_get_property;
+ object_class->dispose = medium_dispose;
data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (class);
data_wrapper_class->is_offline = medium_is_offline;
class->set_content = medium_set_content;
class->get_content = medium_get_content;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CONTENT,
+ g_param_spec_object (
+ "content",
+ "Content",
+ NULL,
+ CAMEL_TYPE_DATA_WRAPPER,
+ G_PARAM_READWRITE));
}
static void
camel_medium_init (CamelMedium *medium)
{
-}
-
-CamelType
-camel_medium_get_type (void)
-{
- static CamelType camel_medium_type = CAMEL_INVALID_TYPE;
-
- if (camel_medium_type == CAMEL_INVALID_TYPE) {
- camel_medium_type = camel_type_register (CAMEL_DATA_WRAPPER_TYPE, "medium",
- sizeof (CamelMedium),
- sizeof (CamelMediumClass),
- (CamelObjectClassInitFunc) camel_medium_class_init,
- NULL,
- (CamelObjectInitFunc) camel_medium_init,
- (CamelObjectFinalizeFunc) medium_finalize);
- }
-
- return camel_medium_type;
+ medium->priv = CAMEL_MEDIUM_GET_PRIVATE (medium);
}
/**
diff --git a/camel/camel-medium.h b/camel/camel-medium.h
index 2968b43..02b0c8b 100644
--- a/camel/camel-medium.h
+++ b/camel/camel-medium.h
@@ -32,17 +32,30 @@
#include <camel/camel-data-wrapper.h>
-#define CAMEL_MEDIUM_TYPE (camel_medium_get_type ())
-#define CAMEL_MEDIUM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MEDIUM_TYPE, CamelMedium))
-#define CAMEL_MEDIUM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MEDIUM_TYPE, CamelMediumClass))
-#define CAMEL_IS_MEDIUM(o) (CAMEL_CHECK_TYPE((o), CAMEL_MEDIUM_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MEDIUM \
+ (camel_medium_get_type ())
+#define CAMEL_MEDIUM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MEDIUM, CamelMedium))
+#define CAMEL_MEDIUM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MEDIUM, CamelMediumClass))
+#define CAMEL_IS_MEDIUM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MEDIUM))
+#define CAMEL_IS_MEDIUM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MEDIUM))
#define CAMEL_MEDIUM_GET_CLASS(obj) \
- ((CamelMediumClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MEDIUM, CamelMediumClass))
G_BEGIN_DECLS
typedef struct _CamelMedium CamelMedium;
typedef struct _CamelMediumClass CamelMediumClass;
+typedef struct _CamelMediumPrivate CamelMediumPrivate;
typedef struct {
const gchar *name;
@@ -51,12 +64,7 @@ typedef struct {
struct _CamelMedium {
CamelDataWrapper parent;
-
- /* The content of the medium, as opposed to our parent
- * CamelDataWrapper, which wraps both the headers and the
- * content.
- */
- CamelDataWrapper *content;
+ CamelMediumPrivate *priv;
};
struct _CamelMediumClass {
@@ -81,7 +89,7 @@ struct _CamelMediumClass {
CamelDataWrapper *content);
};
-CamelType camel_medium_get_type (void);
+GType camel_medium_get_type (void);
void camel_medium_add_header (CamelMedium *medium,
const gchar *name,
gconstpointer value);
diff --git a/camel/camel-mime-filter-basic.c b/camel/camel-mime-filter-basic.c
index cc8bc23..9f3e086 100644
--- a/camel/camel-mime-filter-basic.c
+++ b/camel/camel-mime-filter-basic.c
@@ -24,7 +24,9 @@
#include "camel-mime-filter-basic.h"
#include "camel-mime-utils.h"
-static CamelMimeFilterClass *camel_mime_filter_basic_parent;
+#define CAMEL_MIME_FILTER_BASIC_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BASIC, CamelMimeFilterBasicPrivate))
struct _CamelMimeFilterBasicPrivate {
CamelMimeFilterBasicType type;
@@ -33,11 +35,7 @@ struct _CamelMimeFilterBasicPrivate {
gint save;
};
-static void
-mime_filter_basic_finalize (CamelMimeFilterBasic *filter)
-{
- g_free (filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterBasic, camel_mime_filter_basic, CAMEL_TYPE_MIME_FILTER)
/* here we do all of the basic mime filtering */
static void
@@ -52,7 +50,7 @@ mime_filter_basic_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterBasicPrivate *priv;
gsize newlen;
- priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
@@ -157,7 +155,7 @@ mime_filter_basic_complete (CamelMimeFilter *mime_filter,
CamelMimeFilterBasicPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
@@ -223,7 +221,7 @@ mime_filter_basic_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterBasicPrivate *priv;
- priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_QP_ENC:
@@ -240,7 +238,7 @@ camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *class)
{
CamelMimeFilterClass *mime_filter_class;
- camel_mime_filter_basic_parent = CAMEL_MIME_FILTER_CLASS(camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterBasicPrivate));
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_basic_filter;
@@ -251,25 +249,7 @@ camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *class)
static void
camel_mime_filter_basic_init (CamelMimeFilterBasic *filter)
{
- filter->priv = g_new0 (CamelMimeFilterBasicPrivate, 1);
-}
-
-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),
- sizeof (CamelMimeFilterBasicClass),
- (CamelObjectClassInitFunc) camel_mime_filter_basic_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_basic_init,
- (CamelObjectFinalizeFunc) mime_filter_basic_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (filter);
}
/**
@@ -292,7 +272,7 @@ camel_mime_filter_basic_new (CamelMimeFilterBasicType type)
case CAMEL_MIME_FILTER_BASIC_QP_DEC:
case CAMEL_MIME_FILTER_BASIC_UU_ENC:
case CAMEL_MIME_FILTER_BASIC_UU_DEC:
- new = CAMEL_MIME_FILTER (camel_object_new (camel_mime_filter_basic_get_type ()));
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_BASIC, NULL);
CAMEL_MIME_FILTER_BASIC (new)->priv->type = type;
break;
default:
diff --git a/camel/camel-mime-filter-basic.h b/camel/camel-mime-filter-basic.h
index c93e506..53d1e76 100644
--- a/camel/camel-mime-filter-basic.h
+++ b/camel/camel-mime-filter-basic.h
@@ -28,9 +28,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_BASIC(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_basic_get_type (), CamelMimeFilterBasic)
-#define CAMEL_MIME_FILTER_BASIC_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_basic_get_type (), CamelMimeFilterBasicClass)
-#define CAMEL_IS_MIME_FILTER_BASIC(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_basic_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_BASIC \
+ (camel_mime_filter_basic_get_type ())
+#define CAMEL_MIME_FILTER_BASIC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BASIC, CamelMimeFilterBasic))
+#define CAMEL_MIME_FILTER_BASIC_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_BASIC, CamelMimeFilterBasicClass))
+#define CAMEL_IS_MIME_FILTER_BASIC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BASIC))
+#define CAMEL_IS_MIME_FILTER_BASIC_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_BASIC))
+#define CAMEL_MIME_FILTER_BASIC_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BASIC, CamelMimeFilterBasicClass))
G_BEGIN_DECLS
@@ -56,7 +71,7 @@ struct _CamelMimeFilterBasicClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_basic_get_type(void);
+GType camel_mime_filter_basic_get_type(void);
CamelMimeFilter *
camel_mime_filter_basic_new (CamelMimeFilterBasicType type);
diff --git a/camel/camel-mime-filter-bestenc.c b/camel/camel-mime-filter-bestenc.c
index f792130..bbc505c 100644
--- a/camel/camel-mime-filter-bestenc.c
+++ b/camel/camel-mime-filter-bestenc.c
@@ -27,7 +27,9 @@
#include "camel-mime-filter-bestenc.h"
-static CamelMimeFilterClass *camel_mime_filter_bestenc_parent;
+#define CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BESTENC, CamelMimeFilterBestencPrivate))
struct _CamelMimeFilterBestencPrivate {
@@ -52,11 +54,7 @@ struct _CamelMimeFilterBestencPrivate {
CamelCharset charset; /* used to determine the best charset to use */
};
-static void
-mime_filter_bestenc_finalize (CamelMimeFilterBestenc *mime_filter)
-{
- g_free (mime_filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterBestenc, camel_mime_filter_bestenc, CAMEL_TYPE_MIME_FILTER)
static void
mime_filter_bestenc_filter (CamelMimeFilter *mime_filter,
@@ -70,7 +68,7 @@ mime_filter_bestenc_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterBestencPrivate *priv;
register guchar *p, *pend;
- priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
if (len == 0)
goto donothing;
@@ -171,7 +169,7 @@ mime_filter_bestenc_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterBestencPrivate *priv;
- priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
mime_filter_bestenc_filter (
mime_filter, in, len, prespace, out, outlen, outprespace);
@@ -186,7 +184,7 @@ mime_filter_bestenc_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterBestencPrivate *priv;
- priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
priv->count0 = 0;
priv->count8 = 0;
@@ -206,7 +204,7 @@ camel_mime_filter_bestenc_class_init (CamelMimeFilterBestencClass *class)
{
CamelMimeFilterClass *mime_filter_class;
- camel_mime_filter_bestenc_parent = (CamelMimeFilterClass *)(camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterBestencPrivate));
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_bestenc_filter;
@@ -217,29 +215,11 @@ camel_mime_filter_bestenc_class_init (CamelMimeFilterBestencClass *class)
static void
camel_mime_filter_bestenc_init (CamelMimeFilterBestenc *filter)
{
- filter->priv = g_new0 (CamelMimeFilterBestencPrivate, 1);
+ filter->priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (filter);
mime_filter_bestenc_reset (CAMEL_MIME_FILTER (filter));
}
-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),
- sizeof (CamelMimeFilterBestencClass),
- (CamelObjectClassInitFunc) camel_mime_filter_bestenc_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_bestenc_init,
- (CamelObjectFinalizeFunc) mime_filter_bestenc_finalize);
- }
-
- return type;
-}
-
/**
* camel_mime_filter_bestenc_new:
* @flags: a bitmask of data required.
@@ -253,7 +233,7 @@ camel_mime_filter_bestenc_new (guint flags)
{
CamelMimeFilter *new;
- new = (CamelMimeFilter *)camel_object_new(camel_mime_filter_bestenc_get_type());
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_BESTENC, NULL);
CAMEL_MIME_FILTER_BESTENC (new)->priv->flags = flags;
return new;
@@ -277,7 +257,7 @@ camel_mime_filter_bestenc_get_best_encoding (CamelMimeFilterBestenc *filter,
CamelTransferEncoding bestenc;
gint istext;
- priv = CAMEL_MIME_FILTER_BESTENC (filter)->priv;
+ priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (filter);
istext = (required & CAMEL_BESTENC_TEXT) ? 1 : 0;
required = required & ~CAMEL_BESTENC_TEXT;
diff --git a/camel/camel-mime-filter-bestenc.h b/camel/camel-mime-filter-bestenc.h
index 65d53bc..2171f69 100644
--- a/camel/camel-mime-filter-bestenc.h
+++ b/camel/camel-mime-filter-bestenc.h
@@ -30,9 +30,24 @@
#include <camel/camel-mime-part.h>
#include <camel/camel-charset-map.h>
-#define CAMEL_MIME_FILTER_BESTENC(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_bestenc_get_type (), CamelMimeFilterBestenc)
-#define CAMEL_MIME_FILTER_BESTENC_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_bestenc_get_type (), CamelMimeFilterBestencClass)
-#define CAMEL_IS_MIME_FILTER_BESTENC(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_bestenc_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_BESTENC \
+ (camel_mime_filter_bestenc_get_type ())
+#define CAMEL_MIME_FILTER_BESTENC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BESTENC, CamelMimeFilterBestenc))
+#define CAMEL_MIME_FILTER_BESTENC_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_BESTENC, CamelMimeFilterBestencClass))
+#define CAMEL_IS_MIME_FILTER_BESTENC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BESTENC))
+#define CAMEL_IS_MIME_FILTER_BESTENC_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_BESTENC))
+#define CAMEL_MIME_FILTER_BESTENC_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BESTENC, CamelMimeFilterBestencClass))
G_BEGIN_DECLS
@@ -68,7 +83,7 @@ struct _CamelMimeFilterBestencClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_bestenc_get_type (void);
+GType camel_mime_filter_bestenc_get_type (void);
CamelMimeFilter *
camel_mime_filter_bestenc_new (guint flags);
CamelTransferEncoding
diff --git a/camel/camel-mime-filter-canon.c b/camel/camel-mime-filter-canon.c
index c85a826..b272a6c 100644
--- a/camel/camel-mime-filter-canon.c
+++ b/camel/camel-mime-filter-canon.c
@@ -31,15 +31,15 @@
#include "camel-mime-filter-canon.h"
+#define CAMEL_MIME_FILTER_CANON_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CANON, CamelMimeFilterCanonPrivate))
+
struct _CamelMimeFilterCanonPrivate {
guint32 flags;
};
-static void
-mime_filter_canon_finalize (CamelMimeFilterCanon *mime_filter)
-{
- g_free (mime_filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterCanon, camel_mime_filter_canon, CAMEL_TYPE_MIME_FILTER)
static void
mime_filter_canon_run (CamelMimeFilter *mime_filter,
@@ -58,7 +58,7 @@ mime_filter_canon_run (CamelMimeFilter *mime_filter,
register gchar *o;
gint lf = 0;
- priv = CAMEL_MIME_FILTER_CANON (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CANON_GET_PRIVATE (mime_filter);
/* first, work out how much space we need */
inptr = (guchar *)in;
@@ -182,6 +182,8 @@ camel_mime_filter_canon_class_init (CamelMimeFilterCanonClass *class)
{
CamelMimeFilterClass *mime_filter_class;
+ g_type_class_add_private (class, sizeof (CamelMimeFilterCanonPrivate));
+
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_canon_filter;
mime_filter_class->complete = mime_filter_canon_complete;
@@ -191,25 +193,7 @@ camel_mime_filter_canon_class_init (CamelMimeFilterCanonClass *class)
static void
camel_mime_filter_canon_init (CamelMimeFilterCanon *filter)
{
- filter->priv = g_new0 (CamelMimeFilterCanonPrivate, 1);
-}
-
-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),
- sizeof (CamelMimeFilterCanonClass),
- (CamelObjectClassInitFunc) camel_mime_filter_canon_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_canon_init,
- (CamelObjectFinalizeFunc) mime_filter_canon_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_CANON_GET_PRIVATE (filter);
}
/**
@@ -225,7 +209,7 @@ camel_mime_filter_canon_new(guint32 flags)
{
CamelMimeFilter *filter;
- filter = CAMEL_MIME_FILTER (camel_object_new (CAMEL_MIME_FILTER_CANON_TYPE));
+ filter = g_object_new (CAMEL_TYPE_MIME_FILTER_CANON, NULL);
CAMEL_MIME_FILTER_CANON (filter)->priv->flags = flags;
return filter;
diff --git a/camel/camel-mime-filter-canon.h b/camel/camel-mime-filter-canon.h
index 19a2237..8587c7e 100644
--- a/camel/camel-mime-filter-canon.h
+++ b/camel/camel-mime-filter-canon.h
@@ -29,10 +29,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_CANON_TYPE (camel_mime_filter_canon_get_type ())
-#define CAMEL_MIME_FILTER_CANON(obj) CAMEL_CHECK_CAST (obj, CAMEL_MIME_FILTER_CANON_TYPE, CamelMimeFilterCanon)
-#define CAMEL_MIME_FILTER_CANON_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, CAMEL_MIME_FILTER_CANON_TYPE, CamelMimeFilterCanonClass)
-#define CAMEL_IS_MIME_FILTER_CANON(obj) CAMEL_CHECK_TYPE (obj, CAMEL_MIME_FILTER_CANON_TYPE)
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_CANON \
+ (camel_mime_filter_canon_get_type ())
+#define CAMEL_MIME_FILTER_CANON(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CANON, CamelMimeFilterCanon))
+#define CAMEL_MIME_FILTER_CANON_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_CANON, CamelMimeFilterCanonClass))
+#define CAMEL_IS_MIME_FILTER_CANON(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CANON))
+#define CAMEL_IS_MIME_FILTER_CANON_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_CANON))
+#define CAMEL_MIME_FILTER_CANON_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CANON, CamelMimeFilterCanonClass))
G_BEGIN_DECLS
@@ -55,8 +69,7 @@ struct _CamelMimeFilterCanonClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_canon_get_type(void);
-
+GType camel_mime_filter_canon_get_type(void);
CamelMimeFilter *
camel_mime_filter_canon_new (guint32 flags);
diff --git a/camel/camel-mime-filter-charset.c b/camel/camel-mime-filter-charset.c
index 26ffe0f..a553c6c 100644
--- a/camel/camel-mime-filter-charset.c
+++ b/camel/camel-mime-filter-charset.c
@@ -30,6 +30,10 @@
#include "camel-iconv.h"
#include "camel-mime-filter-charset.h"
+#define CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CHARSET, CamelMimeFilterCharsetPrivate))
+
#define d(x)
#define w(x)
@@ -39,14 +43,14 @@ struct _CamelMimeFilterCharsetPrivate {
gchar *to;
};
-static CamelMimeFilterClass *camel_mime_filter_charset_parent;
+G_DEFINE_TYPE (CamelMimeFilterCharset, camel_mime_filter_charset, CAMEL_TYPE_MIME_FILTER)
static void
-mime_filter_charset_finalize (CamelMimeFilterCharset *filter)
+mime_filter_charset_finalize (GObject *object)
{
CamelMimeFilterCharsetPrivate *priv;
- priv = CAMEL_MIME_FILTER_CHARSET (filter)->priv;
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (object);
g_free (priv->from);
g_free (priv->to);
@@ -55,7 +59,9 @@ mime_filter_charset_finalize (CamelMimeFilterCharset *filter)
camel_iconv_close (priv->ic);
priv->ic = (iconv_t) -1;
}
- g_free (priv);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_mime_filter_charset_parent_class)->finalize (object);
}
static void
@@ -72,7 +78,7 @@ mime_filter_charset_complete (CamelMimeFilter *mime_filter,
const gchar *inbuf;
gchar *outbuf;
- priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
if (priv->ic == (iconv_t) -1)
goto noop;
@@ -155,7 +161,7 @@ mime_filter_charset_filter (CamelMimeFilter *mime_filter,
const gchar *inbuf;
gchar *outbuf;
- priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
if (priv->ic == (iconv_t) -1)
goto noop;
@@ -218,7 +224,7 @@ mime_filter_charset_reset (CamelMimeFilter *mime_filter)
gchar *buffer;
gsize outlen = 16;
- priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
/* what happens with the output bytes if this resets the state? */
if (priv->ic != (iconv_t) -1) {
@@ -230,9 +236,13 @@ mime_filter_charset_reset (CamelMimeFilter *mime_filter)
static void
camel_mime_filter_charset_class_init (CamelMimeFilterCharsetClass *class)
{
+ GObjectClass *object_class;
CamelMimeFilterClass *mime_filter_class;
- camel_mime_filter_charset_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterCharsetPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = mime_filter_charset_finalize;
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_charset_filter;
@@ -243,28 +253,10 @@ camel_mime_filter_charset_class_init (CamelMimeFilterCharsetClass *class)
static void
camel_mime_filter_charset_init (CamelMimeFilterCharset *filter)
{
- filter->priv = g_new0 (CamelMimeFilterCharsetPrivate, 1);
+ filter->priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (filter);
filter->priv->ic = (iconv_t) -1;
}
-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),
- sizeof (CamelMimeFilterCharsetClass),
- (CamelObjectClassInitFunc) camel_mime_filter_charset_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_charset_init,
- (CamelObjectFinalizeFunc) mime_filter_charset_finalize);
- }
-
- return type;
-}
-
/**
* camel_mime_filter_charset_new:
* @from_charset: charset to convert from
@@ -282,8 +274,8 @@ camel_mime_filter_charset_new (const gchar *from_charset,
CamelMimeFilter *new;
CamelMimeFilterCharsetPrivate *priv;
- new = CAMEL_MIME_FILTER (camel_object_new (camel_mime_filter_charset_get_type ()));
- priv = CAMEL_MIME_FILTER_CHARSET (new)->priv;
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_CHARSET, NULL);
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (new);
priv->ic = camel_iconv_open (to_charset, from_charset);
if (priv->ic == (iconv_t) -1) {
@@ -291,7 +283,7 @@ camel_mime_filter_charset_new (const gchar *from_charset,
from_charset ? from_charset : "(null)",
to_charset ? to_charset : "(null)",
g_strerror (errno)));
- camel_object_unref (new);
+ g_object_unref (new);
new = NULL;
} else {
priv->from = g_strdup (from_charset);
diff --git a/camel/camel-mime-filter-charset.h b/camel/camel-mime-filter-charset.h
index 31c35b8..44d5149 100644
--- a/camel/camel-mime-filter-charset.h
+++ b/camel/camel-mime-filter-charset.h
@@ -29,9 +29,24 @@
#include <camel/camel-mime-filter.h>
#include <iconv.h>
-#define CAMEL_MIME_FILTER_CHARSET(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_charset_get_type (), CamelMimeFilterCharset)
-#define CAMEL_MIME_FILTER_CHARSET_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_charset_get_type (), CamelMimeFilterCharsetClass)
-#define CAMEL_IS_MIME_FILTER_CHARSET(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_charset_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_CHARSET \
+ (camel_mime_filter_charset_get_type ())
+#define CAMEL_MIME_FILTER_CHARSET(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CHARSET, CamelMimeFilterCharset))
+#define CAMEL_MIME_FILTER_CHARSET_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_CHARSET, CamelMimeFilterCharsetClass))
+#define CAMEL_IS_MIME_FILTER_CHARSET(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CHARSET))
+#define CAMEL_IS_MIME_FILTER_CHARSET_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_CHARSET))
+#define CAMEL_MIME_FILTER_CHARSET_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CHARSET, CamelMimeFilterCharsetClass))
G_BEGIN_DECLS
@@ -48,7 +63,7 @@ struct _CamelMimeFilterCharsetClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_charset_get_type (void);
+GType camel_mime_filter_charset_get_type (void);
CamelMimeFilter *
camel_mime_filter_charset_new (const gchar *from_charset,
const gchar *to_charset);
diff --git a/camel/camel-mime-filter-crlf.c b/camel/camel-mime-filter-crlf.c
index be44ea5..a233dcb 100644
--- a/camel/camel-mime-filter-crlf.c
+++ b/camel/camel-mime-filter-crlf.c
@@ -22,6 +22,10 @@
#include "camel-mime-filter-crlf.h"
+#define CAMEL_MIME_FILTER_CRLF_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CRLF, CamelMimeFilterCRLFPrivate))
+
struct _CamelMimeFilterCRLFPrivate {
CamelMimeFilterCRLFDirection direction;
CamelMimeFilterCRLFMode mode;
@@ -30,11 +34,7 @@ struct _CamelMimeFilterCRLFPrivate {
gboolean saw_dot;
};
-static void
-mime_filter_crlf_finalize (CamelMimeFilterCRLF *filter)
-{
- g_free (filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterCRLF, camel_mime_filter_crlf, CAMEL_TYPE_MIME_FILTER)
static void
mime_filter_crlf_filter (CamelMimeFilter *mime_filter,
@@ -51,7 +51,7 @@ mime_filter_crlf_filter (CamelMimeFilter *mime_filter,
gboolean do_dots;
gchar *outptr;
- priv = CAMEL_MIME_FILTER_CRLF (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (mime_filter);
do_dots = priv->mode == CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS;
@@ -147,7 +147,7 @@ mime_filter_crlf_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterCRLFPrivate *priv;
- priv = CAMEL_MIME_FILTER_CRLF (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (mime_filter);
priv->saw_cr = FALSE;
priv->saw_lf = TRUE;
@@ -159,6 +159,8 @@ camel_mime_filter_crlf_class_init (CamelMimeFilterCRLFClass *class)
{
CamelMimeFilterClass *mime_filter_class;
+ g_type_class_add_private (class, sizeof (CamelMimeFilterCRLFPrivate));
+
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_crlf_filter;
mime_filter_class->complete = mime_filter_crlf_complete;
@@ -168,31 +170,13 @@ camel_mime_filter_crlf_class_init (CamelMimeFilterCRLFClass *class)
static void
camel_mime_filter_crlf_init (CamelMimeFilterCRLF *filter)
{
- filter->priv = g_new0 (CamelMimeFilterCRLFPrivate, 1);
+ filter->priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (filter);
filter->priv->saw_cr = FALSE;
filter->priv->saw_lf = TRUE;
filter->priv->saw_dot = FALSE;
}
-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),
- sizeof (CamelMimeFilterCRLFClass),
- (CamelObjectClassInitFunc) camel_mime_filter_crlf_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_crlf_init,
- (CamelObjectFinalizeFunc) mime_filter_crlf_finalize);
- }
-
- return type;
-}
-
/**
* camel_mime_filter_crlf_new:
* @direction: encode vs decode
@@ -209,8 +193,8 @@ camel_mime_filter_crlf_new (CamelMimeFilterCRLFDirection direction,
CamelMimeFilter *filter;
CamelMimeFilterCRLFPrivate *priv;
- filter = CAMEL_MIME_FILTER (camel_object_new (CAMEL_MIME_FILTER_CRLF_TYPE));
- priv = CAMEL_MIME_FILTER_CRLF (filter)->priv;
+ filter = g_object_new (CAMEL_TYPE_MIME_FILTER_CRLF, NULL);
+ priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (filter);
priv->direction = direction;
priv->mode = mode;
diff --git a/camel/camel-mime-filter-crlf.h b/camel/camel-mime-filter-crlf.h
index 34a5f32..810aab7 100644
--- a/camel/camel-mime-filter-crlf.h
+++ b/camel/camel-mime-filter-crlf.h
@@ -29,10 +29,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_CRLF_TYPE (camel_mime_filter_crlf_get_type ())
-#define CAMEL_MIME_FILTER_CRLF(obj) CAMEL_CHECK_CAST (obj, CAMEL_MIME_FILTER_CRLF_TYPE, CamelMimeFilterCRLF)
-#define CAMEL_MIME_FILTER_CRLF_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, CAMEL_MIME_FILTER_CRLF_TYPE, CamelMimeFilterCRLFClass)
-#define CAMEL_IS_MIME_FILTER_CRLF(obj) CAMEL_CHECK_TYPE (obj, CAMEL_MIME_FILTER_CRLF_TYPE)
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_CRLF \
+ (camel_mime_filter_crlf_get_type ())
+#define CAMEL_MIME_FILTER_CRLF(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CRLF, CamelMimeFilterCRLF))
+#define CAMEL_MIME_FILTER_CRLF_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_CRLF, CamelMimeFilterCRLFClass))
+#define CAMEL_IS_MIME_FILTER_CRLF(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CRLF))
+#define CAMEL_IS_MIME_FILTER_CRLF_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_CRLF))
+#define CAMEL_MIME_FILTER_CRLF_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CRLF, CamelMimeFilterCRLFClass))
G_BEGIN_DECLS
@@ -59,7 +73,7 @@ struct _CamelMimeFilterCRLFClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_crlf_get_type (void);
+GType camel_mime_filter_crlf_get_type (void);
CamelMimeFilter *
camel_mime_filter_crlf_new (CamelMimeFilterCRLFDirection direction,
CamelMimeFilterCRLFMode mode);
diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c
index 9f1bbc5..115a348 100644
--- a/camel/camel-mime-filter-enriched.c
+++ b/camel/camel-mime-filter-enriched.c
@@ -30,6 +30,10 @@
#include "camel-mime-filter-enriched.h"
#include "camel-string-utils.h"
+#define CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnrichedPrivate))
+
struct _CamelMimeFilterEnrichedPrivate {
guint32 flags;
gint nofill;
@@ -95,13 +99,7 @@ static struct {
static GHashTable *enriched_hash = NULL;
-static CamelMimeFilterClass *parent_class = NULL;
-
-static void
-mime_filter_enriched_finalize (CamelMimeFilterEnriched *filter)
-{
- g_free (filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterEnriched, camel_mime_filter_enriched, CAMEL_TYPE_MIME_FILTER)
#if 0
static gboolean
@@ -230,7 +228,7 @@ enriched_to_html (CamelMimeFilter *mime_filter,
register const gchar *inptr;
register gchar *outptr;
- priv = CAMEL_MIME_FILTER_ENRICHED (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (mime_filter);
camel_mime_filter_set_size (mime_filter, inlen * 2 + 6, FALSE);
@@ -521,7 +519,7 @@ mime_filter_enriched_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterEnrichedPrivate *priv;
- priv = CAMEL_MIME_FILTER_ENRICHED (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (mime_filter);
priv->nofill = 0;
}
@@ -532,7 +530,7 @@ camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *class)
CamelMimeFilterClass *mime_filter_class;
gint i;
- parent_class = CAMEL_MIME_FILTER_CLASS (camel_mime_filter_get_type ());
+ g_type_class_add_private (class, sizeof (CamelMimeFilterEnrichedPrivate));
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_enriched_filter;
@@ -551,26 +549,7 @@ camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *class)
static void
camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter)
{
- filter->priv = g_new0 (CamelMimeFilterEnrichedPrivate, 1);
-}
-
-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",
- sizeof (CamelMimeFilterEnriched),
- sizeof (CamelMimeFilterEnrichedClass),
- (CamelObjectClassInitFunc) camel_mime_filter_enriched_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_enriched_init,
- (CamelObjectFinalizeFunc) mime_filter_enriched_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (filter);
}
/**
@@ -588,8 +567,8 @@ camel_mime_filter_enriched_new (guint32 flags)
CamelMimeFilter *new;
CamelMimeFilterEnrichedPrivate *priv;
- new = CAMEL_MIME_FILTER (camel_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED));
- priv = CAMEL_MIME_FILTER_ENRICHED (new)->priv;
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED, NULL);
+ priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (new);
priv->flags = flags;
@@ -621,7 +600,7 @@ camel_enriched_to_html(const gchar *in, guint32 flags)
camel_mime_filter_complete(filter, (gchar *)in, strlen(in), 0, &outbuf, &outlen, &outpre);
outbuf = g_strndup (outbuf, outlen);
- camel_object_unref (filter);
+ g_object_unref (filter);
return outbuf;
}
diff --git a/camel/camel-mime-filter-enriched.h b/camel/camel-mime-filter-enriched.h
index 0916150..eeb5906 100644
--- a/camel/camel-mime-filter-enriched.h
+++ b/camel/camel-mime-filter-enriched.h
@@ -29,10 +29,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_TYPE_MIME_FILTER_ENRICHED (camel_mime_filter_enriched_get_type ())
-#define CAMEL_MIME_FILTER_ENRICHED(obj) (CAMEL_CHECK_CAST (obj, CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnriched))
-#define CAMEL_MIME_FILTER_ENRICHED_CLASS(klass) (CAMEL_CHECK_CLASS_CAST (klass, CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnrichedClass))
-#define CAMEL_IS_MIME_FILTER_ENRICHED(obj) (CAMEL_CHECK_TYPE (obj, CAMEL_TYPE_MIME_FILTER_ENRICHED))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_ENRICHED \
+ (camel_mime_filter_enriched_get_type ())
+#define CAMEL_MIME_FILTER_ENRICHED(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnriched))
+#define CAMEL_MIME_FILTER_ENRICHED_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnrichedClass))
+#define CAMEL_IS_MIME_FILTER_ENRICHED(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_ENRICHED))
+#define CAMEL_IS_MIME_FILTER_ENRICHED_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_ENRICHED))
+#define CAMEL_MIME_FILTER_ENRICHED_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnrichedClass))
#define CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT (1 << 0)
@@ -51,7 +65,7 @@ struct _CamelMimeFilterEnrichedClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_enriched_get_type (void);
+GType camel_mime_filter_enriched_get_type (void);
CamelMimeFilter *
camel_mime_filter_enriched_new (guint32 flags);
gchar * camel_enriched_to_html (const gchar *in,
diff --git a/camel/camel-mime-filter-from.c b/camel/camel-mime-filter-from.c
index 8ba5b45..ff078a2 100644
--- a/camel/camel-mime-filter-from.c
+++ b/camel/camel-mime-filter-from.c
@@ -27,9 +27,11 @@
#include "camel-mime-filter-from.h"
-#define d(x)
+#define CAMEL_MIME_FILTER_FROM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_FROM, CamelMimeFilterFromPrivate))
-static CamelMimeFilterClass *camel_mime_filter_from_parent;
+#define d(x)
struct _CamelMimeFilterFromPrivate {
gboolean midline; /* are we between lines? */
@@ -40,11 +42,7 @@ struct fromnode {
const gchar *pointer;
};
-static void
-mime_filter_from_finalize (CamelMimeFilterFrom *filter)
-{
- g_free (filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterFrom, camel_mime_filter_from, CAMEL_TYPE_MIME_FILTER)
/* Yes, it is complicated ... */
static void
@@ -63,7 +61,7 @@ mime_filter_from_filter (CamelMimeFilter *mime_filter,
struct fromnode *head = NULL, *tail = (struct fromnode *)&head, *node;
gchar *outptr;
- priv = CAMEL_MIME_FILTER_FROM (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_FROM_GET_PRIVATE (mime_filter);
inptr = in;
inend = inptr+len;
@@ -156,7 +154,7 @@ camel_mime_filter_from_class_init (CamelMimeFilterFromClass *class)
{
CamelMimeFilterClass *mime_filter_class;
- camel_mime_filter_from_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterFromPrivate));
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_from_filter;
@@ -166,25 +164,7 @@ camel_mime_filter_from_class_init (CamelMimeFilterFromClass *class)
static void
camel_mime_filter_from_init (CamelMimeFilterFrom *filter)
{
- filter->priv = g_new0 (CamelMimeFilterFromPrivate, 1);
-}
-
-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),
- sizeof (CamelMimeFilterFromClass),
- (CamelObjectClassInitFunc) camel_mime_filter_from_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_from_init,
- (CamelObjectFinalizeFunc) mime_filter_from_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_FROM_GET_PRIVATE (filter);
}
/**
@@ -194,10 +174,10 @@ camel_mime_filter_from_get_type (void)
*
* Returns: a new #CamelMimeFilterFrom object
**/
-CamelMimeFilter*
+CamelMimeFilter *
camel_mime_filter_from_new (void)
{
- return (CamelMimeFilter *) camel_object_new (camel_mime_filter_from_get_type ());
+ return g_object_new (CAMEL_TYPE_MIME_FILTER_FROM, NULL);
}
#if 0
diff --git a/camel/camel-mime-filter-from.h b/camel/camel-mime-filter-from.h
index efccdcc..34bdee8 100644
--- a/camel/camel-mime-filter-from.h
+++ b/camel/camel-mime-filter-from.h
@@ -28,9 +28,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_FROM(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_from_get_type (), CamelMimeFilterFrom)
-#define CAMEL_MIME_FILTER_FROM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_from_get_type (), CamelMimeFilterFromClass)
-#define CAMEL_IS_MIME_FILTER_FROM(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_from_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_FROM \
+ (camel_mime_filter_from_get_type ())
+#define CAMEL_MIME_FILTER_FROM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_FROM, CamelMimeFilterFrom))
+#define CAMEL_MIME_FILTER_FROM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_FROM, CamelMimeFilterFromClass))
+#define CAMEL_IS_MIME_FILTER_FROM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_FROM))
+#define CAMEL_IS_MIME_FILTER_FROM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_FROM))
+#define CAMEL_MIME_FILTER_FROM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_FROM, CamelMimeFilterFromClass))
G_BEGIN_DECLS
@@ -47,7 +62,7 @@ struct _CamelMimeFilterFromClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_from_get_type (void);
+GType camel_mime_filter_from_get_type (void);
CamelMimeFilter *
camel_mime_filter_from_new (void);
diff --git a/camel/camel-mime-filter-gzip.c b/camel/camel-mime-filter-gzip.c
index 291df28..358bf2c 100644
--- a/camel/camel-mime-filter-gzip.c
+++ b/camel/camel-mime-filter-gzip.c
@@ -31,6 +31,10 @@
#include "camel-mime-filter-gzip.h"
+#define CAMEL_MIME_FILTER_GZIP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZipPrivate))
+
/* rfc1952 */
enum {
@@ -91,7 +95,7 @@ struct _CamelMimeFilterGZipPrivate {
guint32 isize;
};
-static CamelMimeFilterClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelMimeFilterGZip, camel_mime_filter_gzip, CAMEL_TYPE_MIME_FILTER)
static void
gzip_filter (CamelMimeFilter *mime_filter,
@@ -106,7 +110,7 @@ gzip_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterGZipPrivate *priv;
gint retval;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
if (!priv->state.zip.wrote_hdr) {
priv->hdr.v.id1 = 31;
@@ -198,7 +202,7 @@ gunzip_filter (CamelMimeFilter *mime_filter,
guint16 need, val;
gint retval;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
if (!priv->state.unzip.got_hdr) {
if (len < 10) {
@@ -339,11 +343,11 @@ gunzip_filter (CamelMimeFilter *mime_filter,
}
static void
-mime_filter_gzip_finalize (CamelObject *object)
+mime_filter_gzip_finalize (GObject *object)
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP (object)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (object);
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
deflateEnd (priv->stream);
@@ -351,7 +355,9 @@ mime_filter_gzip_finalize (CamelObject *object)
inflateEnd (priv->stream);
g_free (priv->stream);
- g_free (priv);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_mime_filter_gzip_parent_class)->finalize (object);
}
static void
@@ -365,7 +371,7 @@ mime_filter_gzip_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
gzip_filter (
@@ -388,7 +394,7 @@ mime_filter_gzip_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
gzip_filter (
@@ -406,7 +412,7 @@ mime_filter_gzip_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
memset (&priv->state, 0, sizeof (priv->state));
@@ -422,9 +428,13 @@ mime_filter_gzip_reset (CamelMimeFilter *mime_filter)
static void
camel_mime_filter_gzip_class_init (CamelMimeFilterGZipClass *class)
{
+ GObjectClass *object_class;
CamelMimeFilterClass *mime_filter_class;
- parent_class = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterGZipPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = mime_filter_gzip_finalize;
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_gzip_filter;
@@ -435,30 +445,11 @@ camel_mime_filter_gzip_class_init (CamelMimeFilterGZipClass *class)
static void
camel_mime_filter_gzip_init (CamelMimeFilterGZip *mime_filter)
{
- mime_filter->priv = g_new0 (CamelMimeFilterGZipPrivate, 1);
+ mime_filter->priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
mime_filter->priv->stream = g_new0 (z_stream, 1);
mime_filter->priv->crc32 = crc32 (0, Z_NULL, 0);
}
-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",
- sizeof (CamelMimeFilterGZip),
- sizeof (CamelMimeFilterGZipClass),
- (CamelObjectClassInitFunc) camel_mime_filter_gzip_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_gzip_init,
- (CamelObjectFinalizeFunc) mime_filter_gzip_finalize);
- }
-
- return type;
-}
-
/**
* camel_mime_filter_gzip_new:
* @mode: zip or unzip
@@ -475,8 +466,8 @@ camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode, gint level)
CamelMimeFilterGZipPrivate *priv;
gint retval;
- new = (CamelMimeFilter *) camel_object_new (CAMEL_TYPE_MIME_FILTER_GZIP);
- priv = CAMEL_MIME_FILTER_GZIP (new)->priv;
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_GZIP, NULL);
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (new);
priv->mode = mode;
priv->level = level;
@@ -487,9 +478,9 @@ camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode, gint level)
retval = inflateInit2 (priv->stream, -MAX_WBITS);
if (retval != Z_OK) {
- camel_object_unref (new);
+ g_object_unref (new);
return NULL;
}
- return (CamelMimeFilter *) new;
+ return new;
}
diff --git a/camel/camel-mime-filter-gzip.h b/camel/camel-mime-filter-gzip.h
index 041a5bb..d7ded75 100644
--- a/camel/camel-mime-filter-gzip.h
+++ b/camel/camel-mime-filter-gzip.h
@@ -29,12 +29,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_TYPE_MIME_FILTER_GZIP (camel_mime_filter_gzip_get_type ())
-#define CAMEL_MIME_FILTER_GZIP(obj) (CAMEL_CHECK_CAST ((obj), CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZip))
-#define CAMEL_MIME_FILTER_GZIP_CLASS(klass) (CAMEL_CHECK_CLASS_CAST ((klass), CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZipClass))
-#define CAMEL_IS_MIME_FILTER_GZIP(obj) (CAMEL_CHECK_TYPE ((obj), CAMEL_TYPE_MIME_FILTER_GZIP))
-#define CAMEL_IS_MIME_FILTER_GZIP_CLASS(klass) (CAMEL_CHECK_CLASS_TYPE ((klass), CAMEL_TYPE_MIME_FILTER_GZIP))
-#define CAMEL_MIME_FILTER_GZIP_GET_CLASS(obj) (CAMEL_CHECK_GET_CLASS ((obj), CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZipClass))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_GZIP \
+ (camel_mime_filter_gzip_get_type ())
+#define CAMEL_MIME_FILTER_GZIP(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZip))
+#define CAMEL_MIME_FILTER_GZIP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZipClass))
+#define CAMEL_IS_MIME_FILTER_GZIP(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_GZIP))
+#define CAMEL_IS_MIME_FILTER_GZIP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_GZIP))
+#define CAMEL_MIME_FILTER_GZIP_GET_CLASS(obj) \
+ (CAMEL_CHECK_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZipClass))
G_BEGIN_DECLS
@@ -56,7 +68,7 @@ struct _CamelMimeFilterGZipClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_gzip_get_type (void);
+GType camel_mime_filter_gzip_get_type (void);
CamelMimeFilter *
camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode,
gint level);
diff --git a/camel/camel-mime-filter-html.c b/camel/camel-mime-filter-html.c
index 314b477..2aca726 100644
--- a/camel/camel-mime-filter-html.c
+++ b/camel/camel-mime-filter-html.c
@@ -33,12 +33,16 @@
#define d(x)
-static CamelMimeFilterClass *camel_mime_filter_html_parent;
+#define CAMEL_MIME_FILTER_HTML_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_HTML, CamelMimeFilterHTMLPrivate))
struct _CamelMimeFilterHTMLPrivate {
CamelHTMLParser *ctxt;
};
+G_DEFINE_TYPE (CamelMimeFilterHTML, camel_mime_filter_html, CAMEL_TYPE_MIME_FILTER)
+
/* ********************************************************************** */
#if 0
@@ -78,7 +82,7 @@ mime_filter_html_run (CamelMimeFilter *mime_filter,
camel_html_parser_t state;
gchar *outp;
- priv = CAMEL_MIME_FILTER_HTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
d(printf("converting html:\n%.*s\n", (gint)inlen, in));
@@ -116,10 +120,19 @@ mime_filter_html_run (CamelMimeFilter *mime_filter,
}
static void
-mime_filter_html_finalize (CamelMimeFilterHTML *filter)
+mime_filter_html_dispose (GObject *object)
{
- camel_object_unref (filter->priv->ctxt);
- g_free (filter->priv);
+ CamelMimeFilterHTMLPrivate *priv;
+
+ priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (object);
+
+ if (priv->ctxt != NULL) {
+ g_object_unref (priv->ctxt);
+ priv->ctxt = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_mime_filter_html_parent_class)->dispose (object);
}
static void
@@ -155,18 +168,22 @@ mime_filter_html_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_HTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
- camel_object_unref (priv->ctxt);
+ g_object_unref (priv->ctxt);
priv->ctxt = camel_html_parser_new ();
}
static void
camel_mime_filter_html_class_init (CamelMimeFilterHTMLClass *class)
{
+ GObjectClass *object_class;
CamelMimeFilterClass *mime_filter_class;
- camel_mime_filter_html_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterHTMLPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = mime_filter_html_dispose;
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_html_filter;
@@ -177,28 +194,10 @@ camel_mime_filter_html_class_init (CamelMimeFilterHTMLClass *class)
static void
camel_mime_filter_html_init (CamelMimeFilterHTML *mime_filter)
{
- mime_filter->priv = g_new0 (CamelMimeFilterHTMLPrivate, 1);
+ mime_filter->priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
mime_filter->priv->ctxt = camel_html_parser_new ();
}
-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),
- sizeof (CamelMimeFilterHTMLClass),
- (CamelObjectClassInitFunc) camel_mime_filter_html_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_html_init,
- (CamelObjectFinalizeFunc) mime_filter_html_finalize);
- }
-
- return type;
-}
-
/**
* camel_mime_filter_html_new:
*
@@ -209,5 +208,5 @@ camel_mime_filter_html_get_type (void)
CamelMimeFilter *
camel_mime_filter_html_new (void)
{
- return (CamelMimeFilter *) camel_object_new (camel_mime_filter_html_get_type ());
+ return g_object_new (CAMEL_TYPE_MIME_FILTER_HTML, NULL);
}
diff --git a/camel/camel-mime-filter-html.h b/camel/camel-mime-filter-html.h
index a6d2b0f..a3144ca 100644
--- a/camel/camel-mime-filter-html.h
+++ b/camel/camel-mime-filter-html.h
@@ -28,9 +28,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_HTML(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_html_get_type (), CamelMimeFilterHTML)
-#define CAMEL_MIME_FILTER_HTML_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_html_get_type (), CamelMimeFilterHTMLClass)
-#define CAMEL_IS_MIME_FILTER_HTML(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_html_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_HTML \
+ (camel_mime_filter_html_get_type ())
+#define CAMEL_MIME_FILTER_HTML(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_HTML, CamelMimeFilterHTML))
+#define CAMEL_MIME_FILTER_HTML_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_HTML, CamelMimeFilterHTMLClass))
+#define CAMEL_IS_MIME_FILTER_HTML(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_HTML))
+#define CAMEL_IS_MIME_FILTER_HTML_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_HTML))
+#define CAMEL_MIME_FILTER_HTML_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_HTML, CamelMimeFilterHTMLClass))
G_BEGIN_DECLS
@@ -47,7 +62,7 @@ struct _CamelMimeFilterHTMLClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_html_get_type (void);
+GType camel_mime_filter_html_get_type (void);
CamelMimeFilter *
camel_mime_filter_html_new (void);
diff --git a/camel/camel-mime-filter-index.c b/camel/camel-mime-filter-index.c
index 6c0e50e..47c15dd 100644
--- a/camel/camel-mime-filter-index.c
+++ b/camel/camel-mime-filter-index.c
@@ -21,20 +21,36 @@
#include "camel-mime-filter-index.h"
#include "camel-text-index.h"
+#define CAMEL_MIME_FILTER_INDEX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_INDEX, CamelMimeFilterIndexPrivate))
+
struct _CamelMimeFilterIndexPrivate {
CamelIndex *index;
CamelIndexName *name;
};
-static CamelMimeFilterClass *camel_mime_filter_index_parent;
+G_DEFINE_TYPE (CamelMimeFilterIndex, camel_mime_filter_index, CAMEL_TYPE_MIME_FILTER)
static void
-mime_filter_index_finalize (CamelMimeFilterIndex *mime_filter)
+mime_filter_index_dispose (GObject *object)
{
- if (mime_filter->priv->name)
- camel_object_unref (mime_filter->priv->name);
- camel_object_unref (mime_filter->priv->index);
- g_free (mime_filter->priv);
+ CamelMimeFilterIndexPrivate *priv;
+
+ priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (object);
+
+ if (priv->name != NULL) {
+ g_object_unref (priv->name);
+ priv->name = NULL;
+ }
+
+ if (priv->index != NULL) {
+ g_object_unref (priv->index);
+ priv->index = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_mime_filter_index_parent_class)->dispose (object);
}
static void
@@ -48,7 +64,7 @@ mime_filter_index_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterIndexPrivate *priv;
- priv = CAMEL_MIME_FILTER_INDEX (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (mime_filter);
if (priv->index == NULL || priv->name==NULL) {
goto donothing;
@@ -73,7 +89,7 @@ mime_filter_index_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterIndexPrivate *priv;
- priv = CAMEL_MIME_FILTER_INDEX (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (mime_filter);
if (priv->index == NULL || priv->name==NULL) {
goto donothing;
@@ -91,9 +107,13 @@ donothing:
static void
camel_mime_filter_index_class_init (CamelMimeFilterIndexClass *class)
{
+ GObjectClass *object_class;
CamelMimeFilterClass *mime_filter_class;
- camel_mime_filter_index_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterIndexPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = mime_filter_index_dispose;
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_index_filter;
@@ -101,27 +121,9 @@ camel_mime_filter_index_class_init (CamelMimeFilterIndexClass *class)
}
static void
-camel_mime_filter_index_init (CamelMimeFilterIndex *mime_filter)
+camel_mime_filter_index_init (CamelMimeFilterIndex *filter)
{
- mime_filter->priv = g_new0 (CamelMimeFilterIndexPrivate, 1);
-}
-
-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),
- sizeof (CamelMimeFilterIndexClass),
- (CamelObjectClassInitFunc) camel_mime_filter_index_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_index_init,
- (CamelObjectFinalizeFunc) mime_filter_index_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (filter);
}
/**
@@ -138,13 +140,13 @@ camel_mime_filter_index_new (CamelIndex *index)
CamelMimeFilter *new;
CamelMimeFilterIndexPrivate *priv;
- new = CAMEL_MIME_FILTER (camel_object_new (camel_mime_filter_index_get_type ()));
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_INDEX, NULL);
if (new) {
- priv = CAMEL_MIME_FILTER_INDEX (new)->priv;
+ priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (new);
priv->index = index;
if (index)
- camel_object_ref (index);
+ g_object_ref (index);
}
return new;
}
@@ -166,11 +168,11 @@ camel_mime_filter_index_set_name (CamelMimeFilterIndex *filter,
if (name != NULL) {
g_return_if_fail (CAMEL_IS_INDEX_NAME (name));
- camel_object_ref (name);
+ g_object_ref (name);
}
if (filter->priv->name != NULL)
- camel_object_unref (filter->priv->name);
+ g_object_unref (filter->priv->name);
filter->priv->name = name;
}
@@ -190,7 +192,7 @@ camel_mime_filter_index_set_index (CamelMimeFilterIndex *filter,
if (index != NULL) {
g_return_if_fail (CAMEL_IS_INDEX (index));
- camel_object_ref (index);
+ g_object_ref (index);
}
if (filter->priv->index) {
@@ -200,7 +202,7 @@ camel_mime_filter_index_set_index (CamelMimeFilterIndex *filter,
camel_mime_filter_complete (
CAMEL_MIME_FILTER (filter),
"", 0, 0, &out, &outlen, &outspace);
- camel_object_unref (index);
+ g_object_unref (filter->priv->index);
}
filter->priv->index = index;
diff --git a/camel/camel-mime-filter-index.h b/camel/camel-mime-filter-index.h
index c24006e..6cf994c 100644
--- a/camel/camel-mime-filter-index.h
+++ b/camel/camel-mime-filter-index.h
@@ -29,9 +29,24 @@
#include <camel/camel-index.h>
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_INDEX(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_index_get_type (), CamelMimeFilterIndex)
-#define CAMEL_MIME_FILTER_INDEX_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_index_get_type (), CamelMimeFilterIndexClass)
-#define CAMEL_IS_MIME_FILTER_INDEX(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_index_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_INDEX \
+ (camel_mime_filter_index_get_type ())
+#define CAMEL_MIME_FILTER_INDEX(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_INDEX, CamelMimeFilterIndex))
+#define CAMEL_MIME_FILTER_INDEX_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_INDEX, CamelMimeFilterIndexClass))
+#define CAMEL_IS_MIME_FILTER_INDEX(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_INDEX))
+#define CAMEL_IS_MIME_FILTER_INDEX_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_INDEX))
+#define CAMEL_MIME_FILTER_INDEX_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_INDEX, CamelMimeFilterIndexClass))
G_BEGIN_DECLS
@@ -48,7 +63,7 @@ struct _CamelMimeFilterIndexClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_index_get_type(void);
+GType camel_mime_filter_index_get_type (void);
CamelMimeFilter *
camel_mime_filter_index_new (CamelIndex *index);
diff --git a/camel/camel-mime-filter-linewrap.c b/camel/camel-mime-filter-linewrap.c
index 3ffd6bf..0449d89 100644
--- a/camel/camel-mime-filter-linewrap.c
+++ b/camel/camel-mime-filter-linewrap.c
@@ -27,6 +27,10 @@
#include "camel-mime-filter-linewrap.h"
+#define CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_LINEWRAP, CamelMimeFilterLinewrapPrivate))
+
struct _CamelMimeFilterLinewrapPrivate {
guint wrap_len;
guint max_len;
@@ -35,11 +39,7 @@ struct _CamelMimeFilterLinewrapPrivate {
guint32 flags;
};
-static void
-mime_filter_linewrap_finalize (CamelMimeFilterLinewrap *mime_filter)
-{
- g_free (mime_filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterLinewrap, camel_mime_filter_linewrap, CAMEL_TYPE_MIME_FILTER)
static void
mime_filter_linewrap_filter (CamelMimeFilter *mime_filter,
@@ -55,7 +55,7 @@ mime_filter_linewrap_filter (CamelMimeFilter *mime_filter,
const gchar *inend, *p;
gint nchars;
- priv = CAMEL_MIME_FILTER_LINEWRAP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (mime_filter);
nchars = priv->nchars;
@@ -158,7 +158,7 @@ mime_filter_linewrap_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterLinewrapPrivate *priv;
- priv = CAMEL_MIME_FILTER_LINEWRAP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (mime_filter);
priv->nchars = 0;
}
@@ -168,6 +168,8 @@ camel_mime_filter_linewrap_class_init (CamelMimeFilterLinewrapClass *class)
{
CamelMimeFilterClass *mime_filter_class;
+ g_type_class_add_private (class, sizeof (CamelMimeFilterLinewrapPrivate));
+
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_linewrap_filter;
mime_filter_class->complete = mime_filter_linewrap_complete;
@@ -175,27 +177,9 @@ camel_mime_filter_linewrap_class_init (CamelMimeFilterLinewrapClass *class)
}
static void
-camel_mime_filter_linewrap_init (CamelMimeFilterLinewrap *mime_filter)
+camel_mime_filter_linewrap_init (CamelMimeFilterLinewrap *filter)
{
- mime_filter->priv = g_new0 (CamelMimeFilterLinewrapPrivate, 1);
-}
-
-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),
- sizeof (CamelMimeFilterLinewrapClass),
- (CamelObjectClassInitFunc) camel_mime_filter_linewrap_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_linewrap_init,
- (CamelObjectFinalizeFunc) mime_filter_linewrap_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (filter);
}
CamelMimeFilter *
@@ -207,8 +191,8 @@ camel_mime_filter_linewrap_new (guint preferred_len,
CamelMimeFilter *filter;
CamelMimeFilterLinewrapPrivate *priv;
- filter = CAMEL_MIME_FILTER (camel_object_new (CAMEL_MIME_FILTER_LINEWRAP_TYPE));
- priv = CAMEL_MIME_FILTER_LINEWRAP (filter)->priv;
+ filter = g_object_new (CAMEL_TYPE_MIME_FILTER_LINEWRAP, NULL);
+ priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (filter);
priv->indent = indent_char;
priv->wrap_len = preferred_len;
diff --git a/camel/camel-mime-filter-linewrap.h b/camel/camel-mime-filter-linewrap.h
index cf1a57d..a9831af 100644
--- a/camel/camel-mime-filter-linewrap.h
+++ b/camel/camel-mime-filter-linewrap.h
@@ -28,10 +28,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_LINEWRAP_TYPE (camel_mime_filter_linewrap_get_type ())
-#define CAMEL_MIME_FILTER_LINEWRAP(obj) CAMEL_CHECK_CAST (obj, CAMEL_MIME_FILTER_LINEWRAP_TYPE, CamelMimeFilterLinewrap)
-#define CAMEL_MIME_FILTER_LINEWRAP_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, CAMEL_MIME_FILTER_LINEWRAP_TYPE, CamelMimeFilterLinewrapClass)
-#define CAMEL_IS_MIME_FILTER_LINEWRAP(obj) CAMEL_CHECK_TYPE (obj, CAMEL_MIME_FILTER_LINEWRAP_TYPE)
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_LINEWRAP \
+ (camel_mime_filter_linewrap_get_type ())
+#define CAMEL_MIME_FILTER_LINEWRAP(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_LINEWRAP, CamelMimeFilterLinewrap))
+#define CAMEL_MIME_FILTER_LINEWRAP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_LINEWRAP, CamelMimeFilterLinewrapClass))
+#define CAMEL_IS_MIME_FILTER_LINEWRAP(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_LINEWRAP))
+#define CAMEL_IS_MIME_FILTER_LINEWRAP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_LINEWRAP))
+#define CAMEL_MIME_FILTER_LINEWRAP_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_LINEWRAP, CamelMimeFilterLinewrapClass))
G_BEGIN_DECLS
@@ -53,7 +67,7 @@ struct _CamelMimeFilterLinewrapClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_linewrap_get_type (void);
+GType camel_mime_filter_linewrap_get_type (void);
CamelMimeFilter *
camel_mime_filter_linewrap_new (guint preferred_len,
guint max_len,
diff --git a/camel/camel-mime-filter-pgp.c b/camel/camel-mime-filter-pgp.c
index 8becbc8..c9a539a 100644
--- a/camel/camel-mime-filter-pgp.c
+++ b/camel/camel-mime-filter-pgp.c
@@ -32,6 +32,10 @@
#include "camel-mime-filter-pgp.h"
+#define CAMEL_MIME_FILTER_PGP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PGP, CamelMimeFilterPgpPrivate))
+
#define BEGIN_PGP_SIGNED_MESSAGE "-----BEGIN PGP SIGNED MESSAGE-----"
#define BEGIN_PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----"
#define END_PGP_SIGNATURE "-----END PGP SIGNATURE-----"
@@ -51,6 +55,8 @@ enum {
PGP_FOOTER
};
+G_DEFINE_TYPE (CamelMimeFilterPgp, camel_mime_filter_pgp, CAMEL_TYPE_MIME_FILTER)
+
static void
mime_filter_pgp_run (CamelMimeFilter *mime_filter,
const gchar *in,
@@ -68,7 +74,7 @@ mime_filter_pgp_run (CamelMimeFilter *mime_filter,
gboolean blank;
gsize len;
- priv = CAMEL_MIME_FILTER_PGP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (mime_filter);
/* only need as much space as the input, we're stripping chars */
camel_mime_filter_set_size (mime_filter, inlen, FALSE);
@@ -145,12 +151,6 @@ mime_filter_pgp_run (CamelMimeFilter *mime_filter,
}
static void
-mime_filter_pgp_finalize (CamelMimeFilterPgp *mime_filter)
-{
- g_free (mime_filter->priv);
-}
-
-static void
mime_filter_pgp_filter (CamelMimeFilter *mime_filter,
const gchar *in,
gsize len,
@@ -183,7 +183,7 @@ mime_filter_pgp_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterPgpPrivate *priv;
- priv = CAMEL_MIME_FILTER_PGP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (mime_filter);
priv->state = PGP_PREFACE;
}
@@ -193,6 +193,8 @@ camel_mime_filter_pgp_class_init (CamelMimeFilterPgpClass *class)
{
CamelMimeFilterClass *mime_filter_class;
+ g_type_class_add_private (class, sizeof (CamelMimeFilterPgpPrivate));
+
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_pgp_filter;
mime_filter_class->complete = mime_filter_pgp_complete;
@@ -200,32 +202,13 @@ camel_mime_filter_pgp_class_init (CamelMimeFilterPgpClass *class)
}
static void
-camel_mime_filter_pgp_init (CamelMimeFilterPgp *mime_filter)
-{
- mime_filter->priv = g_new0 (CamelMimeFilterPgpPrivate, 1);
-}
-
-CamelType
-camel_mime_filter_pgp_get_type (void)
+camel_mime_filter_pgp_init (CamelMimeFilterPgp *filter)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (),
- "CamelMimeFilterPgp",
- sizeof (CamelMimeFilterPgp),
- sizeof (CamelMimeFilterPgpClass),
- (CamelObjectClassInitFunc) camel_mime_filter_pgp_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_pgp_init,
- (CamelObjectFinalizeFunc) mime_filter_pgp_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (filter);
}
CamelMimeFilter *
camel_mime_filter_pgp_new (void)
{
- return (CamelMimeFilter *) camel_object_new (camel_mime_filter_pgp_get_type ());
+ return g_object_new (CAMEL_TYPE_MIME_FILTER_PGP, NULL);
}
diff --git a/camel/camel-mime-filter-pgp.h b/camel/camel-mime-filter-pgp.h
index a296513..3c11358 100644
--- a/camel/camel-mime-filter-pgp.h
+++ b/camel/camel-mime-filter-pgp.h
@@ -28,10 +28,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_PGP_TYPE (camel_mime_filter_pgp_get_type ())
-#define CAMEL_MIME_FILTER_PGP(obj) CAMEL_CHECK_CAST (obj, CAMEL_MIME_FILTER_PGP_TYPE, CamelMimeFilterPgp)
-#define CAMEL_MIME_FILTER_PGP_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, CAMEL_MIME_FILTER_PGP_TYPE, CamelMimeFilterPgpClass)
-#define CAMEL_IS_MIME_FILTER_PGP(obj) CAMEL_CHECK_TYPE (obj, CAMEL_MIME_FILTER_PGP_TYPE)
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_PGP \
+ (camel_mime_filter_pgp_get_type ())
+#define CAMEL_MIME_FILTER_PGP(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PGP, CamelMimeFilterPgp))
+#define CAMEL_MIME_FILTER_PGP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_PGP, CamelMimeFilterPgpClass))
+#define CAMEL_IS_MIME_FILTER_PGP(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PGP))
+#define CAMEL_IS_MIME_FILTER_PGP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_PGP))
+#define CAMEL_MIME_FILTER_PGP_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PGP, CamelMimeFilterPgpClass))
G_BEGIN_DECLS
@@ -48,7 +62,7 @@ struct _CamelMimeFilterPgpClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_pgp_get_type (void);
+GType camel_mime_filter_pgp_get_type (void);
CamelMimeFilter *
camel_mime_filter_pgp_new (void);
diff --git a/camel/camel-mime-filter-progress.c b/camel/camel-mime-filter-progress.c
index 5b2da8e..ccf4ba7 100644
--- a/camel/camel-mime-filter-progress.c
+++ b/camel/camel-mime-filter-progress.c
@@ -29,6 +29,10 @@
#include "camel-mime-filter-progress.h"
+#define CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PROGRESS, CamelMimeFilterProgressPrivate))
+
#define d(x)
#define w(x)
@@ -38,13 +42,7 @@ struct _CamelMimeFilterProgressPrivate {
gsize count;
};
-static CamelMimeFilterClass *parent_class = NULL;
-
-static void
-mime_filter_progress_finalize (CamelMimeFilterProgress *mime_filter)
-{
- g_free (mime_filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterProgress, camel_mime_filter_progress, CAMEL_TYPE_MIME_FILTER)
static void
mime_filter_progress_filter (CamelMimeFilter *mime_filter,
@@ -58,8 +56,7 @@ mime_filter_progress_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterProgressPrivate *priv;
gdouble percent;
- priv = CAMEL_MIME_FILTER_PROGRESS (mime_filter)->priv;
-
+ priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (mime_filter);
priv->count += len;
if (priv->count < priv->total)
@@ -93,7 +90,7 @@ mime_filter_progress_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterProgressPrivate *priv;
- priv = CAMEL_MIME_FILTER_PROGRESS (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (mime_filter);
priv->count = 0;
}
@@ -103,7 +100,7 @@ camel_mime_filter_progress_class_init (CamelMimeFilterProgressClass *class)
{
CamelMimeFilterClass *mime_filter_class;
- parent_class = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterProgressPrivate));
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_progress_filter;
@@ -112,28 +109,9 @@ camel_mime_filter_progress_class_init (CamelMimeFilterProgressClass *class)
}
static void
-camel_mime_filter_progress_init (CamelMimeFilterProgress *mime_filter)
+camel_mime_filter_progress_init (CamelMimeFilterProgress *filter)
{
- mime_filter->priv = g_new0 (CamelMimeFilterProgressPrivate, 1);
-}
-
-CamelType
-camel_mime_filter_progress_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (),
- "CamelMimeFilterProgress",
- sizeof (CamelMimeFilterProgress),
- sizeof (CamelMimeFilterProgressClass),
- (CamelObjectClassInitFunc) camel_mime_filter_progress_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_progress_init,
- (CamelObjectFinalizeFunc) mime_filter_progress_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (filter);
}
/**
@@ -155,8 +133,10 @@ camel_mime_filter_progress_new (CamelOperation *operation,
CamelMimeFilter *filter;
CamelMimeFilterProgressPrivate *priv;
- filter = (CamelMimeFilter *) camel_object_new (camel_mime_filter_progress_get_type ());
- priv = CAMEL_MIME_FILTER_PROGRESS (filter)->priv;
+ g_return_val_if_fail (operation != NULL, NULL);
+
+ filter = g_object_new (CAMEL_TYPE_MIME_FILTER_PROGRESS, NULL);
+ priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (filter);
priv->operation = operation;
priv->total = total;
diff --git a/camel/camel-mime-filter-progress.h b/camel/camel-mime-filter-progress.h
index 7c033e6..701aa94 100644
--- a/camel/camel-mime-filter-progress.h
+++ b/camel/camel-mime-filter-progress.h
@@ -30,9 +30,24 @@
#include <camel/camel-operation.h>
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_PROGRESS(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_progress_get_type (), CamelMimeFilterProgress)
-#define CAMEL_MIME_FILTER_PROGRESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_progress_get_type (), CamelMimeFilterProgressClass)
-#define CAMEL_IS_MIME_FILTER_PROGRESS(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_progress_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_PROGRESS \
+ (camel_mime_filter_progress_get_type ())
+#define CAMEL_MIME_FILTER_PROGRESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PROGRESS, CamelMimeFilterProgress))
+#define CAMEL_MIME_FILTER_PROGRESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_PROGRESS, CamelMimeFilterProgressClass))
+#define CAMEL_IS_MIME_FILTER_PROGRESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PROGRESS))
+#define CAMEL_IS_MIME_FILTER_PROGRESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_PROGRESS))
+#define CAMEL_MIME_FILTER_PROGRESS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PROGRESS, CamelMimeFilterProgressClass))
G_BEGIN_DECLS
@@ -54,7 +69,7 @@ struct _CamelMimeFilterProgressClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_progress_get_type (void);
+GType camel_mime_filter_progress_get_type (void);
CamelMimeFilter *
camel_mime_filter_progress_new (CamelOperation *operation,
gsize total);
diff --git a/camel/camel-mime-filter-save.c b/camel/camel-mime-filter-save.c
index f0a6eb1..2260cf3 100644
--- a/camel/camel-mime-filter-save.c
+++ b/camel/camel-mime-filter-save.c
@@ -27,15 +27,15 @@
#include "camel-mime-filter-save.h"
#include "camel-stream-mem.h"
+#define CAMEL_MIME_FILTER_SAVE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_SAVE, CamelMimeFilterSavePrivate))
+
struct _CamelMimeFilterSavePrivate {
CamelStream *stream;
};
-static void
-mime_filter_save_finalize (CamelMimeFilterSave *mime_filter)
-{
- g_free (mime_filter->priv);
-}
+G_DEFINE_TYPE (CamelMimeFilterSave, camel_mime_filter_save, CAMEL_TYPE_MIME_FILTER)
static void
mime_filter_save_filter (CamelMimeFilter *mime_filter,
@@ -48,7 +48,7 @@ mime_filter_save_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterSavePrivate *priv;
- priv = CAMEL_MIME_FILTER_SAVE (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_SAVE_GET_PRIVATE (mime_filter);
if (priv->stream != NULL)
camel_stream_write (priv->stream, in, len);
@@ -84,6 +84,8 @@ camel_mime_filter_save_class_init (CamelMimeFilterSaveClass *class)
{
CamelMimeFilterClass *mime_filter_class;
+ g_type_class_add_private (class, sizeof (CamelMimeFilterSavePrivate));
+
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_save_filter;
mime_filter_class->complete = mime_filter_save_complete;
@@ -91,27 +93,9 @@ camel_mime_filter_save_class_init (CamelMimeFilterSaveClass *class)
}
static void
-camel_mime_filter_save_init (CamelMimeFilterSave *mime_filter)
-{
- mime_filter->priv = g_new0 (CamelMimeFilterSavePrivate, 1);
-}
-
-CamelType
-camel_mime_filter_save_get_type (void)
+camel_mime_filter_save_init (CamelMimeFilterSave *filter)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterSave",
- sizeof (CamelMimeFilterSave),
- sizeof (CamelMimeFilterSaveClass),
- (CamelObjectClassInitFunc) camel_mime_filter_save_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_save_init,
- (CamelObjectFinalizeFunc) mime_filter_save_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_SAVE_GET_PRIVATE (filter);
}
/**
@@ -132,12 +116,13 @@ camel_mime_filter_save_new (CamelStream *stream)
if (stream != NULL)
g_return_val_if_fail (CAMEL_IS_STREAM (stream), NULL);
- filter = CAMEL_MIME_FILTER (camel_object_new (CAMEL_MIME_FILTER_SAVE_TYPE));
- priv = CAMEL_MIME_FILTER_SAVE (filter)->priv;
+ filter = g_object_new (CAMEL_TYPE_MIME_FILTER_SAVE, NULL);
+ priv = CAMEL_MIME_FILTER_SAVE_GET_PRIVATE (filter);
- priv->stream = stream;
if (stream != NULL)
- camel_object_ref (stream);
+ priv->stream = g_object_ref (stream);
+ else
+ priv->stream = camel_stream_mem_new ();
return filter;
}
diff --git a/camel/camel-mime-filter-save.h b/camel/camel-mime-filter-save.h
index 6b5527c..4da8213 100644
--- a/camel/camel-mime-filter-save.h
+++ b/camel/camel-mime-filter-save.h
@@ -30,10 +30,24 @@
#include <camel/camel-mime-filter.h>
#include <camel/camel-seekable-stream.h>
-#define CAMEL_MIME_FILTER_SAVE_TYPE (camel_mime_filter_save_get_type ())
-#define CAMEL_MIME_FILTER_SAVE(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_save_get_type (), CamelMimeFilterSave)
-#define CAMEL_MIME_FILTER_SAVE_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_save_get_type (), CamelMimeFilterSaveClass)
-#define CAMEL_IS_MIME_FILTER_SAVE(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_save_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_SAVE \
+ (camel_mime_filter_save_get_type ())
+#define CAMEL_MIME_FILTER_SAVE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_SAVE, CamelMimeFilterSave))
+#define CAMEL_MIME_FILTER_SAVE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_SAVE, CamelMimeFilterSaveClass))
+#define CAMEL_IS_MIME_FILTER_SAVE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_SAVE))
+#define CAMEL_IS_MIME_FILTER_SAVE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_SAVE))
+#define CAMEL_MIME_FILTER_SAVE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_SAVE, CamelMimeFilterSaveClass))
G_BEGIN_DECLS
@@ -50,7 +64,7 @@ struct _CamelMimeFilterSaveClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_save_get_type (void);
+GType camel_mime_filter_save_get_type (void);
CamelMimeFilter *
camel_mime_filter_save_new (CamelStream *stream);
diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c
index 7fd5502..bf96d04 100644
--- a/camel/camel-mime-filter-tohtml.c
+++ b/camel/camel-mime-filter-tohtml.c
@@ -31,6 +31,10 @@
#include "camel-url-scanner.h"
#include "camel-utf8.h"
+#define CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_TOHTML, CamelMimeFilterToHTMLPrivate))
+
struct _CamelMimeFilterToHTMLPrivate {
CamelUrlScanner *scanner;
@@ -79,7 +83,7 @@ static struct {
{ CONVERT_ADDRSPEC, { "@", "mailto:", camel_url_addrspec_start, camel_url_addrspec_end } },
};
-static CamelMimeFilterClass *camel_mime_filter_tohtml_parent;
+G_DEFINE_TYPE (CamelMimeFilterToHTML, camel_mime_filter_tohtml, CAMEL_TYPE_MIME_FILTER)
static gchar *
check_size (CamelMimeFilter *mime_filter,
@@ -155,7 +159,7 @@ writeln (CamelMimeFilter *mime_filter,
CamelMimeFilterToHTMLPrivate *priv;
const guchar *inptr = in;
- priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
while (inptr < inend) {
guint32 u;
@@ -235,7 +239,7 @@ html_convert (CamelMimeFilter *mime_filter,
const gchar *inend;
gint depth;
- priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
if (inlen == 0) {
if (priv->pre_open) {
@@ -389,11 +393,16 @@ html_convert (CamelMimeFilter *mime_filter,
}
static void
-camel_mime_filter_tohtml_finalize (CamelMimeFilterToHTML *mime_filter)
+mime_filter_tohtml_finalize (GObject *object)
{
- camel_url_scanner_free (mime_filter->priv->scanner);
+ CamelMimeFilterToHTMLPrivate *priv;
+
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (object);
- g_free (mime_filter->priv);
+ camel_url_scanner_free (priv->scanner);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_mime_filter_tohtml_parent_class)->finalize (object);
}
static void
@@ -429,7 +438,7 @@ mime_filter_tohtml_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterToHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
priv->column = 0;
priv->pre_open = FALSE;
@@ -438,43 +447,28 @@ mime_filter_tohtml_reset (CamelMimeFilter *mime_filter)
static void
camel_mime_filter_tohtml_class_init (CamelMimeFilterToHTMLClass *class)
{
- CamelMimeFilterClass *mime_filter_class;
+ GObjectClass *object_class;
+ CamelMimeFilterClass *filter_class;
+
+ g_type_class_add_private (class, sizeof (CamelMimeFilterToHTMLPrivate));
- camel_mime_filter_tohtml_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = mime_filter_tohtml_finalize;
- mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
- mime_filter_class->filter = mime_filter_tohtml_filter;
- mime_filter_class->complete = mime_filter_tohtml_complete;
- mime_filter_class->reset = mime_filter_tohtml_reset;
+ filter_class = CAMEL_MIME_FILTER_CLASS (class);
+ filter_class->filter = mime_filter_tohtml_filter;
+ filter_class->complete = mime_filter_tohtml_complete;
+ filter_class->reset = mime_filter_tohtml_reset;
}
static void
camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter)
{
- filter->priv = g_new0 (CamelMimeFilterToHTMLPrivate, 1);
+ filter->priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (filter);
filter->priv->scanner = camel_url_scanner_new ();
}
-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",
- sizeof (CamelMimeFilterToHTML),
- sizeof (CamelMimeFilterToHTMLClass),
- (CamelObjectClassInitFunc) camel_mime_filter_tohtml_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_tohtml_init,
- (CamelObjectFinalizeFunc) camel_mime_filter_tohtml_finalize);
- }
-
- return type;
-}
-
/**
* camel_mime_filter_tohtml_new:
* @flags: bitwise flags defining the behaviour
@@ -492,8 +486,8 @@ camel_mime_filter_tohtml_new (guint32 flags, guint32 color)
CamelMimeFilterToHTMLPrivate *priv;
gint i;
- filter = CAMEL_MIME_FILTER (camel_object_new (camel_mime_filter_tohtml_get_type ()));
- priv = CAMEL_MIME_FILTER_TOHTML (filter)->priv;
+ filter = g_object_new (CAMEL_TYPE_MIME_FILTER_TOHTML, NULL);
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (filter);
priv->flags = flags;
priv->color = color;
@@ -534,7 +528,7 @@ camel_text_to_html (const gchar *in, guint32 flags, guint32 color)
outbuf = g_strndup (outbuf, outlen);
- camel_object_unref (filter);
+ g_object_unref (filter);
return outbuf;
}
diff --git a/camel/camel-mime-filter-tohtml.h b/camel/camel-mime-filter-tohtml.h
index 78a78b7..836b3f9 100644
--- a/camel/camel-mime-filter-tohtml.h
+++ b/camel/camel-mime-filter-tohtml.h
@@ -29,9 +29,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_TOHTML(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_tohtml_get_type (), CamelMimeFilterToHTML)
-#define CAMEL_MIME_FILTER_TOHTML_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_tohtml_get_type (), CamelMimeFilterToHTMLClass)
-#define CAMEL_IS_MIME_FILTER_TOHTML(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_tohtml_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_TOHTML \
+ (camel_mime_filter_tohtml_get_type ())
+#define CAMEL_MIME_FILTER_TOHTML(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_TOHTML, CamelMimeFilterToHTML))
+#define CAMEL_MIME_FILTER_TOHTML_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_TOHTML, CamelMimeFilterToHTMLClass))
+#define CAMEL_IS_MIME_FILTER_TOHTML(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_TOHTML))
+#define CAMEL_IS_MIME_FILTER_TOHTML_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_TOHTML))
+#define CAMEL_MIME_FILTER_TOHTML_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_TOHTML, CamelMimeFilterToHTMLClass))
#define CAMEL_MIME_FILTER_TOHTML_PRE (1 << 0)
#define CAMEL_MIME_FILTER_TOHTML_CONVERT_NL (1 << 1)
@@ -59,7 +74,7 @@ struct _CamelMimeFilterToHTMLClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_tohtml_get_type (void);
+GType camel_mime_filter_tohtml_get_type (void);
CamelMimeFilter *
camel_mime_filter_tohtml_new (guint32 flags,
guint32 color);
diff --git a/camel/camel-mime-filter-windows.c b/camel/camel-mime-filter-windows.c
index 5845b2e..0f62acf 100644
--- a/camel/camel-mime-filter-windows.c
+++ b/camel/camel-mime-filter-windows.c
@@ -31,21 +31,31 @@
#include "camel-charset-map.h"
#include "camel-mime-filter-windows.h"
+#define CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_WINDOWS, CamelMimeFilterWindowsPrivate))
+
#define d(x)
#define w(x)
-static CamelMimeFilterClass *parent_class = NULL;
-
struct _CamelMimeFilterWindowsPrivate {
gboolean is_windows;
gchar *claimed_charset;
};
+G_DEFINE_TYPE (CamelMimeFilterWindows, camel_mime_filter_windows, CAMEL_TYPE_MIME_FILTER)
+
static void
-mime_filter_windows_finalize (CamelMimeFilterWindows *mime_filter)
+mime_filter_windows_finalize (GObject *object)
{
- g_free (mime_filter->priv->claimed_charset);
- g_free (mime_filter->priv);
+ CamelMimeFilterWindowsPrivate *priv;
+
+ priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (object);
+
+ g_free (priv->claimed_charset);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_mime_filter_windows_parent_class)->finalize (object);
}
static void
@@ -61,7 +71,7 @@ mime_filter_windows_filter (CamelMimeFilter *mime_filter,
register guchar *inptr;
guchar *inend;
- priv = CAMEL_MIME_FILTER_WINDOWS (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (mime_filter);
if (!priv->is_windows) {
inptr = (guchar *) in;
@@ -103,7 +113,7 @@ mime_filter_windows_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterWindowsPrivate *priv;
- priv = CAMEL_MIME_FILTER_WINDOWS (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (mime_filter);
priv->is_windows = FALSE;
}
@@ -111,9 +121,13 @@ mime_filter_windows_reset (CamelMimeFilter *mime_filter)
static void
camel_mime_filter_windows_class_init (CamelMimeFilterWindowsClass *class)
{
+ GObjectClass *object_class;
CamelMimeFilterClass *mime_filter_class;
- parent_class = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterWindowsPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = mime_filter_windows_finalize;
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_windows_filter;
@@ -122,28 +136,9 @@ camel_mime_filter_windows_class_init (CamelMimeFilterWindowsClass *class)
}
static void
-camel_mime_filter_windows_init (CamelMimeFilterWindows *mime_filter)
-{
- mime_filter->priv = g_new0 (CamelMimeFilterWindowsPrivate, 1);
-}
-
-CamelType
-camel_mime_filter_windows_get_type (void)
+camel_mime_filter_windows_init (CamelMimeFilterWindows *filter)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (),
- "CamelMimeFilterWindows",
- sizeof (CamelMimeFilterWindows),
- sizeof (CamelMimeFilterWindowsClass),
- (CamelObjectClassInitFunc) camel_mime_filter_windows_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_windows_init,
- (CamelObjectFinalizeFunc) mime_filter_windows_finalize);
- }
-
- return type;
+ filter->priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (filter);
}
/**
@@ -163,8 +158,8 @@ camel_mime_filter_windows_new (const gchar *claimed_charset)
g_return_val_if_fail (claimed_charset != NULL, NULL);
- filter = CAMEL_MIME_FILTER (camel_object_new (camel_mime_filter_windows_get_type ()));
- priv = CAMEL_MIME_FILTER_WINDOWS (filter)->priv;
+ filter = g_object_new (CAMEL_TYPE_MIME_FILTER_WINDOWS, NULL);
+ priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (filter);
priv->claimed_charset = g_strdup (claimed_charset);
diff --git a/camel/camel-mime-filter-windows.h b/camel/camel-mime-filter-windows.h
index 2228b92..62401cd 100644
--- a/camel/camel-mime-filter-windows.h
+++ b/camel/camel-mime-filter-windows.h
@@ -29,9 +29,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_MIME_FILTER_WINDOWS(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_windows_get_type (), CamelMimeFilterWindows)
-#define CAMEL_MIME_FILTER_WINDOWS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_windows_get_type (), CamelMimeFilterWindowsClass)
-#define CAMEL_IS_MIME_FILTER_WINDOWS(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_windows_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_WINDOWS \
+ (camel_mime_filter_windows_get_type ())
+#define CAMEL_MIME_FILTER_WINDOWS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_WINDOWS, CamelMimeFilterWindows))
+#define CAMEL_MIME_FILTER_WINDOWS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_WINDOWS, CamelMimeFilterWindowsClass))
+#define CAMEL_IS_MIME_FILTER_WINDOWS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_WINDOWS))
+#define CAMEL_IS_MIME_FILTER_WINDOWS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_WINDOWS))
+#define CAMEL_MIME_FILTER_WINDOWS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_WINDOWS, CamelMimeFilterWindowsClass))
G_BEGIN_DECLS
@@ -48,7 +63,7 @@ struct _CamelMimeFilterWindowsClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_windows_get_type (void);
+GType camel_mime_filter_windows_get_type (void);
CamelMimeFilter *
camel_mime_filter_windows_new
(const gchar *claimed_charset);
diff --git a/camel/camel-mime-filter-yenc.c b/camel/camel-mime-filter-yenc.c
index b50fd67..2d1fc93 100644
--- a/camel/camel-mime-filter-yenc.c
+++ b/camel/camel-mime-filter-yenc.c
@@ -28,6 +28,10 @@
#include "camel-mime-filter-yenc.h"
+#define CAMEL_MIME_FILTER_YENC_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencPrivate))
+
struct _CamelMimeFilterYencPrivate {
CamelMimeFilterYencDirection direction;
@@ -39,7 +43,7 @@ struct _CamelMimeFilterYencPrivate {
guint32 crc;
};
-static CamelMimeFilterClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelMimeFilterYenc, camel_mime_filter_yenc, CAMEL_TYPE_MIME_FILTER)
/* here we do all of the basic yEnc filtering */
static void
@@ -54,7 +58,7 @@ mime_filter_yenc_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterYencPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_YENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -163,7 +167,7 @@ mime_filter_yenc_complete (CamelMimeFilter *mime_filter,
CamelMimeFilterYencPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_YENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -201,11 +205,11 @@ mime_filter_yenc_complete (CamelMimeFilter *mime_filter,
/* should this 'flush' outstanding state/data bytes? */
static void
-mime_filter_yenc_reset (CamelMimeFilter *filter)
+mime_filter_yenc_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterYencPrivate *priv;
- priv = CAMEL_MIME_FILTER_YENC (filter)->priv;
+ priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -225,7 +229,7 @@ camel_mime_filter_yenc_class_init (CamelMimeFilterYencClass *class)
{
CamelMimeFilterClass *mime_filter_class;
- parent_class = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimeFilterYencPrivate));
mime_filter_class = CAMEL_MIME_FILTER_CLASS (class);
mime_filter_class->filter = mime_filter_yenc_filter;
@@ -236,31 +240,13 @@ camel_mime_filter_yenc_class_init (CamelMimeFilterYencClass *class)
static void
camel_mime_filter_yenc_init (CamelMimeFilterYenc *filter)
{
- filter->priv = g_new0 (CamelMimeFilterYencPrivate, 1);
+ filter->priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (filter);
+
filter->priv->part = 0;
filter->priv->pcrc = CAMEL_MIME_YENCODE_CRC_INIT;
filter->priv->crc = CAMEL_MIME_YENCODE_CRC_INIT;
}
-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",
- sizeof (CamelMimeFilterYenc),
- sizeof (CamelMimeFilterYencClass),
- (CamelObjectClassInitFunc) camel_mime_filter_yenc_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_yenc_init,
- NULL);
- }
-
- return type;
-}
-
/**
* camel_mime_filter_yenc_new:
* @direction: encode direction
@@ -275,8 +261,8 @@ camel_mime_filter_yenc_new (CamelMimeFilterYencDirection direction)
CamelMimeFilter *filter;
CamelMimeFilterYencPrivate *priv;
- filter = (CamelMimeFilter *) camel_object_new (CAMEL_TYPE_MIME_FILTER_YENC);
- priv = CAMEL_MIME_FILTER_YENC (filter)->priv;
+ filter = g_object_new (CAMEL_TYPE_MIME_FILTER_YENC, NULL);
+ priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (filter);
priv->direction = direction;
diff --git a/camel/camel-mime-filter-yenc.h b/camel/camel-mime-filter-yenc.h
index 5d888ea..8e36ebc 100644
--- a/camel/camel-mime-filter-yenc.h
+++ b/camel/camel-mime-filter-yenc.h
@@ -29,12 +29,24 @@
#include <camel/camel-mime-filter.h>
-#define CAMEL_TYPE_MIME_FILTER_YENC (camel_mime_filter_yenc_get_type ())
-#define CAMEL_MIME_FILTER_YENC(obj) (CAMEL_CHECK_CAST ((obj), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYenc))
-#define CAMEL_MIME_FILTER_YENC_CLASS(klass) (CAMEL_CHECK_CLASS_CAST ((klass), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencClass))
-#define CAMEL_IS_MIME_FILTER_YENC(obj) (CAMEL_CHECK_TYPE ((obj), CAMEL_TYPE_MIME_FILTER_YENC))
-#define CAMEL_IS_MIME_FILTER_YENC_CLASS(klass) (CAMEL_CHECK_CLASS_TYPE ((klass), CAMEL_TYPE_MIME_FILTER_YENC))
-#define CAMEL_MIME_FILTER_YENC_GET_CLASS(obj) (CAMEL_CHECK_GET_CLASS ((obj), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencClass))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER_YENC \
+ (camel_mime_filter_yenc_get_type ())
+#define CAMEL_MIME_FILTER_YENC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYenc))
+#define CAMEL_MIME_FILTER_YENC_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencClass))
+#define CAMEL_IS_MIME_FILTER_YENC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_YENC))
+#define CAMEL_IS_MIME_FILTER_YENC_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER_YENC))
+#define CAMEL_MIME_FILTER_YENC_GET_CLASS(obj) \
+ (CAMEL_CHECK_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencClass))
G_BEGIN_DECLS
@@ -75,7 +87,7 @@ struct _CamelMimeFilterYencClass {
CamelMimeFilterClass parent_class;
};
-CamelType camel_mime_filter_yenc_get_type (void);
+GType camel_mime_filter_yenc_get_type (void);
CamelMimeFilter *
camel_mime_filter_yenc_new (CamelMimeFilterYencDirection direction);
void camel_mime_filter_yenc_set_state(CamelMimeFilterYenc *yenc,
diff --git a/camel/camel-mime-filter.c b/camel/camel-mime-filter.c
index 71a705e..f762549 100644
--- a/camel/camel-mime-filter.c
+++ b/camel/camel-mime-filter.c
@@ -29,6 +29,10 @@
#include <mcheck.h>
#endif
+#define CAMEL_MIME_FILTER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER, CamelMimeFilterPrivate))
+
struct _CamelMimeFilterPrivate {
gchar *inbuf;
gsize inlen;
@@ -37,10 +41,10 @@ struct _CamelMimeFilterPrivate {
#define PRE_HEAD (64)
#define BACK_HEAD (64)
-static CamelObjectClass *camel_mime_filter_parent;
+G_DEFINE_ABSTRACT_TYPE (CamelMimeFilter, camel_mime_filter, CAMEL_TYPE_OBJECT)
static void
-mime_filter_finalize (CamelObject *object)
+mime_filter_finalize (GObject *object)
{
CamelMimeFilter *mime_filter;
@@ -49,7 +53,9 @@ mime_filter_finalize (CamelObject *object)
g_free (mime_filter->outreal);
g_free (mime_filter->backbuf);
g_free (mime_filter->priv->inbuf);
- g_free (mime_filter->priv);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_mime_filter_parent_class)->finalize (object);
}
static void
@@ -67,7 +73,12 @@ mime_filter_complete (CamelMimeFilter *mime_filter,
static void
camel_mime_filter_class_init (CamelMimeFilterClass *class)
{
- camel_mime_filter_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelMimeFilterPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = mime_filter_finalize;
class->complete = mime_filter_complete;
}
@@ -75,7 +86,7 @@ camel_mime_filter_class_init (CamelMimeFilterClass *class)
static void
camel_mime_filter_init (CamelMimeFilter *mime_filter)
{
- mime_filter->priv = g_malloc0(sizeof(*mime_filter->priv));
+ mime_filter->priv = CAMEL_MIME_FILTER_GET_PRIVATE (mime_filter);
mime_filter->outreal = NULL;
mime_filter->outbuf = NULL;
@@ -86,24 +97,6 @@ camel_mime_filter_init (CamelMimeFilter *mime_filter)
mime_filter->backlen = 0;
}
-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_TYPE_OBJECT, "CamelMimeFilter",
- sizeof (CamelMimeFilter),
- sizeof (CamelMimeFilterClass),
- (CamelObjectClassInitFunc) camel_mime_filter_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_init,
- (CamelObjectFinalizeFunc) mime_filter_finalize);
- }
-
- return camel_mime_filter_type;
-}
-
/**
* camel_mime_filter_new:
*
@@ -114,7 +107,7 @@ camel_mime_filter_get_type (void)
CamelMimeFilter *
camel_mime_filter_new (void)
{
- return CAMEL_MIME_FILTER ( camel_object_new (camel_mime_filter_get_type ()));
+ return g_object_new (CAMEL_TYPE_MIME_FILTER, NULL);
}
#ifdef MALLOC_CHECK
@@ -158,7 +151,7 @@ static void filter_run(CamelMimeFilter *f,
*/
if (prespace < f->backlen) {
gint newlen = len+prespace+f->backlen;
- p = f->priv;
+ p = CAMEL_MIME_FILTER_GET_PRIVATE(f);
if (p->inlen < newlen) {
/* NOTE: g_realloc copies data, we dont need that (slower) */
g_free(p->inbuf);
diff --git a/camel/camel-mime-filter.h b/camel/camel-mime-filter.h
index f641bfb..63650ba 100644
--- a/camel/camel-mime-filter.h
+++ b/camel/camel-mime-filter.h
@@ -31,12 +31,24 @@
#include <sys/types.h>
#include <camel/camel-object.h>
-#define CAMEL_MIME_FILTER_TYPE (camel_mime_filter_get_type ())
-#define CAMEL_MIME_FILTER(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_get_type (), CamelMimeFilter)
-#define CAMEL_MIME_FILTER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_get_type (), CamelMimeFilterClass)
-#define CAMEL_IS_MIME_FILTER(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_FILTER \
+ (camel_mime_filter_get_type ())
+#define CAMEL_MIME_FILTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_FILTER, CamelMimeFilter))
+#define CAMEL_MIME_FILTER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_FILTER, CamelMimeFilterClass))
+#define CAMEL_IS_MIME_FILTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_FILTER))
+#define CAMEL_IS_MIME_FILTER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_FILTER))
#define CAMEL_MIME_FILTER_GET_CLASS(obj) \
- ((CamelMimeFilterClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_FILTER, CamelMimeFilterClass))
G_BEGIN_DECLS
@@ -79,7 +91,7 @@ struct _CamelMimeFilterClass {
void (*reset) (CamelMimeFilter *filter);
};
-CamelType camel_mime_filter_get_type (void);
+GType camel_mime_filter_get_type (void);
CamelMimeFilter *
camel_mime_filter_new (void);
void camel_mime_filter_filter (CamelMimeFilter *filter,
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index e3a4bcb..8a41efe 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -79,14 +79,14 @@ static const gchar *header_names[] = {
"Bcc", "Resent-Bcc", "Date", "Message-ID", NULL
};
-static gpointer camel_mime_message_parent_class = NULL;
-
static const gchar *recipient_names[] = {
"To", "Cc", "Bcc", "Resent-To", "Resent-Cc", "Resent-Bcc", NULL
};
static GHashTable *header_name_table;
+G_DEFINE_TYPE (CamelMimeMessage, camel_mime_message, CAMEL_TYPE_MIME_PART)
+
/* FIXME: check format of fields. */
static gboolean
process_header (CamelMedium *medium,
@@ -105,10 +105,10 @@ process_header (CamelMedium *medium,
addr = camel_internet_address_new();
unfolded = camel_header_unfold (value);
if (camel_address_decode ((CamelAddress *) addr, unfolded) <= 0) {
- camel_object_unref (addr);
+ g_object_unref (addr);
} else {
if (message->from)
- camel_object_unref (message->from);
+ g_object_unref (message->from);
message->from = addr;
}
g_free (unfolded);
@@ -117,10 +117,10 @@ process_header (CamelMedium *medium,
addr = camel_internet_address_new();
unfolded = camel_header_unfold (value);
if (camel_address_decode ((CamelAddress *) addr, unfolded) <= 0) {
- camel_object_unref (addr);
+ g_object_unref (addr);
} else {
if (message->reply_to)
- camel_object_unref (message->reply_to);
+ g_object_unref (message->reply_to);
message->reply_to = addr;
}
g_free (unfolded);
@@ -177,26 +177,42 @@ process_header (CamelMedium *medium,
static void
unref_recipient (gpointer key, gpointer value, gpointer user_data)
{
- camel_object_unref (value);
+ g_object_unref (value);
}
static void
-mime_message_finalize (CamelObject *object)
+mime_message_dispose (GObject *object)
{
CamelMimeMessage *message = CAMEL_MIME_MESSAGE (object);
- g_free (message->subject);
+ if (message->reply_to != NULL) {
+ g_object_unref (message->reply_to);
+ message->reply_to = NULL;
+ }
- g_free (message->message_id);
+ if (message->from != NULL) {
+ g_object_unref (message->from);
+ message->from = NULL;
+ }
- if (message->reply_to)
- camel_object_unref (message->reply_to);
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_mime_message_parent_class)->dispose (object);
+}
- if (message->from)
- camel_object_unref (message->from);
+static void
+mime_message_finalize (GObject *object)
+{
+ CamelMimeMessage *message = CAMEL_MIME_MESSAGE (object);
+
+ g_free (message->subject);
+
+ g_free (message->message_id);
g_hash_table_foreach (message->recipients, unref_recipient, NULL);
g_hash_table_destroy (message->recipients);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_mime_message_parent_class)->finalize (object);
}
static gssize
@@ -318,12 +334,15 @@ mime_message_construct_from_parser (CamelMimePart *dw,
static void
camel_mime_message_class_init (CamelMimeMessageClass *class)
{
+ GObjectClass *object_class;
CamelDataWrapperClass *data_wrapper_class;
CamelMimePartClass *mime_part_class;
CamelMediumClass *medium_class;
gint ii;
- camel_mime_message_parent_class = CAMEL_MIME_PART_CLASS (camel_type_get_global_classfuncs (camel_mime_part_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = mime_message_dispose;
+ object_class->finalize = mime_message_finalize;
data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (class);
data_wrapper_class->write_to_stream = mime_message_write_to_stream;
@@ -370,24 +389,6 @@ camel_mime_message_init (CamelMimeMessage *mime_message)
mime_message->message_id = NULL;
}
-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),
- sizeof (CamelMimeMessageClass),
- (CamelObjectClassInitFunc) camel_mime_message_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_message_init,
- (CamelObjectFinalizeFunc) mime_message_finalize);
- }
-
- return camel_mime_message_type;
-}
-
/**
* camel_mime_message_new:
*
@@ -398,10 +399,7 @@ camel_mime_message_get_type (void)
CamelMimeMessage *
camel_mime_message_new (void)
{
- CamelMimeMessage *mime_message;
- mime_message = CAMEL_MIME_MESSAGE (camel_object_new (CAMEL_MIME_MESSAGE_TYPE));
-
- return mime_message;
+ return g_object_new (CAMEL_TYPE_MIME_MESSAGE, NULL);
}
/* **** Date: */
@@ -546,7 +544,7 @@ camel_mime_message_set_reply_to (CamelMimeMessage *msg, CamelInternetAddress *re
g_assert(msg);
if (msg->reply_to) {
- camel_object_unref (msg->reply_to);
+ g_object_unref (msg->reply_to);
msg->reply_to = NULL;
}
@@ -646,7 +644,7 @@ camel_mime_message_set_from (CamelMimeMessage *msg, CamelInternetAddress *from)
g_assert(msg);
if (msg->from) {
- camel_object_unref (msg->from);
+ g_object_unref (msg->from);
msg->from = NULL;
}
@@ -902,11 +900,10 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
CAMEL_STREAM_FILTER (filter), bestenc);
d(printf("writing to checking stream\n"));
camel_data_wrapper_decode_to_stream (content, filter);
- camel_stream_filter_remove (
- CAMEL_STREAM_FILTER (filter), idb);
+ camel_stream_filter_remove (CAMEL_STREAM_FILTER (filter), idb);
if (idc != -1) {
camel_stream_filter_remove (CAMEL_STREAM_FILTER (filter), idc);
- camel_object_unref (charenc);
+ g_object_unref (charenc);
charenc = NULL;
}
@@ -947,16 +944,16 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
/* and write it to the new stream */
camel_data_wrapper_write_to_stream (content, filter);
- camel_object_unref (charenc);
+ g_object_unref (charenc);
}
}
encoding = camel_mime_filter_bestenc_get_best_encoding (
CAMEL_MIME_FILTER_BESTENC (bestenc), enctype);
- camel_object_unref (filter);
- camel_object_unref (bestenc);
- camel_object_unref (null);
+ g_object_unref (filter);
+ g_object_unref (bestenc);
+ g_object_unref (null);
d(printf("done, best encoding = %d\n", encoding));
@@ -1071,7 +1068,7 @@ check_content_id (CamelMimeMessage *message, CamelMimePart *part, gpointer data)
found = content_id && !strcmp (content_id, check->content_id) ? TRUE : FALSE;
if (found)
- check->part = camel_object_ref (part);
+ check->part = g_object_ref (part);
return !found;
}
@@ -1235,7 +1232,7 @@ cmm_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, gint body, gint depth)
memset(s, ' ', depth);
s[depth] = 0;
/* yes this leaks, so what its only debug stuff */
- printf("%sclass: %s\n", s, ((CamelObject *)part)->klass->name);
+ printf("%sclass: %s\n", s, G_OBJECT_TYPE_NAME (part));
printf("%smime-type: %s\n", s, camel_content_type_format(((CamelDataWrapper *)part)->mime_type));
containee = camel_medium_get_content ((CamelMedium *)part);
@@ -1243,7 +1240,7 @@ cmm_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, gint body, gint depth)
if (containee == NULL)
return;
- printf("%scontent class: %s\n", s, ((CamelObject *)containee)->klass->name);
+ printf("%scontent class: %s\n", s, G_OBJECT_TYPE_NAME (containee));
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 */
diff --git a/camel/camel-mime-message.h b/camel/camel-mime-message.h
index 6025d92..7c5c76b 100644
--- a/camel/camel-mime-message.h
+++ b/camel/camel-mime-message.h
@@ -33,10 +33,24 @@
#include <camel/camel-internet-address.h>
#include <camel/camel-mime-filter-bestenc.h>
-#define CAMEL_MIME_MESSAGE_TYPE (camel_mime_message_get_type ())
-#define CAMEL_MIME_MESSAGE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MIME_MESSAGE_TYPE, CamelMimeMessage))
-#define CAMEL_MIME_MESSAGE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MIME_MESSAGE_TYPE, CamelMimeMessageClass))
-#define CAMEL_IS_MIME_MESSAGE(o) (CAMEL_CHECK_TYPE((o), CAMEL_MIME_MESSAGE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_MESSAGE \
+ (camel_mime_message_get_type ())
+#define CAMEL_MIME_MESSAGE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_MESSAGE, CamelMimeMessage))
+#define CAMEL_MIME_MESSAGE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_MESSAGE, CamelMimeMessageClass))
+#define CAMEL_IS_MIME_MESSAGE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_MESSAGE))
+#define CAMEL_IS_MIME_MESSAGE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_MESSAGE))
+#define CAMEL_MIME_MESSAGE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_MESSAGE, CamelMimeMessageClass))
#define CAMEL_RECIPIENT_TYPE_TO "To"
#define CAMEL_RECIPIENT_TYPE_CC "Cc"
@@ -79,8 +93,7 @@ struct _CamelMimeMessageClass {
CamelMimePartClass parent_class;
};
-/* Standard Camel function */
-CamelType camel_mime_message_get_type (void);
+GType camel_mime_message_get_type (void);
/* public methods */
CamelMimeMessage *camel_mime_message_new (void);
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
index a4cfaf9..6d8bc7e 100644
--- a/camel/camel-mime-parser.c
+++ b/camel/camel-mime-parser.c
@@ -181,50 +181,36 @@ static gchar *states[] = {
};
#endif
-static CamelObjectClass *camel_mime_parser_parent;
+G_DEFINE_TYPE (CamelMimeParser, camel_mime_parser, CAMEL_TYPE_OBJECT)
static void
-mime_parser_finalize (CamelObject *object)
+mime_parser_finalize (GObject *object)
{
- struct _header_scan_state *s = _PRIVATE(object);
+ struct _header_scan_state *s = _PRIVATE (object);
+
#ifdef PURIFY
purify_watch_remove_all();
#endif
folder_scan_close(s);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_mime_parser_parent_class)->finalize (object);
}
static void
camel_mime_parser_class_init (CamelMimeParserClass *class)
{
- camel_mime_parser_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = mime_parser_finalize;
}
static void
camel_mime_parser_init (CamelMimeParser *parser)
{
- struct _header_scan_state *s;
-
- s = folder_scan_init();
- _PRIVATE(parser) = s;
-}
-
-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),
- sizeof (CamelMimeParserClass),
- (CamelObjectClassInitFunc) camel_mime_parser_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_parser_init,
- (CamelObjectFinalizeFunc) mime_parser_finalize);
- }
-
- return type;
+ parser->priv = folder_scan_init();
}
/**
@@ -237,7 +223,7 @@ camel_mime_parser_get_type (void)
CamelMimeParser *
camel_mime_parser_new (void)
{
- return CAMEL_MIME_PARSER (camel_object_new (camel_mime_parser_get_type ()));
+ return g_object_new (CAMEL_TYPE_MIME_PARSER, NULL);
}
/**
@@ -265,7 +251,7 @@ camel_mime_parser_filter_add(CamelMimeParser *m, CamelMimeFilter *mf)
struct _header_scan_filter *f, *new;
new = g_malloc(sizeof(*new));
- new->filter = camel_object_ref (mf);
+ new->filter = mf;
new->id = s->filterid++;
if (s->filterid == -1)
s->filterid++;
@@ -299,7 +285,7 @@ camel_mime_parser_filter_remove(CamelMimeParser *m, gint id)
while (f && f->next) {
old = f->next;
if (old->id == id) {
- camel_object_unref (old->filter);
+ g_object_unref (old->filter);
f->next = old->next;
g_free(old);
/* there should only be a single matching id, but
@@ -1429,7 +1415,7 @@ folder_scan_close(struct _header_scan_state *s)
if (s->fd != -1)
close(s->fd);
if (s->stream) {
- camel_object_unref (s->stream);
+ g_object_unref (s->stream);
}
g_free(s);
}
@@ -1500,7 +1486,7 @@ folder_scan_reset(struct _header_scan_state *s)
s->fd = -1;
}
if (s->stream) {
- camel_object_unref (s->stream);
+ g_object_unref (s->stream);
s->stream = NULL;
}
s->ioerrno = 0;
@@ -1521,7 +1507,7 @@ folder_scan_init_with_stream (struct _header_scan_state *s,
CamelStream *stream)
{
folder_scan_reset(s);
- s->stream = camel_object_ref (stream);
+ s->stream = g_object_ref (stream);
return 0;
}
diff --git a/camel/camel-mime-parser.h b/camel/camel-mime-parser.h
index a5ca6ff..232b407 100644
--- a/camel/camel-mime-parser.h
+++ b/camel/camel-mime-parser.h
@@ -32,9 +32,24 @@
#include <camel/camel-mime-filter.h>
#include <camel/camel-stream.h>
-#define CAMEL_MIME_PARSER(obj) CAMEL_CHECK_CAST (obj, camel_mime_parser_get_type (), CamelMimeParser)
-#define CAMEL_MIME_PARSER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_parser_get_type (), CamelMimeParserClass)
-#define CAMEL_IS_MIME_PARSER(obj) CAMEL_CHECK_TYPE (obj, camel_mime_parser_get_type ())
+/* Stardard GObject macros */
+#define CAMEL_TYPE_MIME_PARSER \
+ (camel_mime_parser_get_type ())
+#define CAMEL_MIME_PARSER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_PARSER, CamelMimeParser))
+#define CAMEL_MIME_PARSER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_PARSER, CamelMimeParserClass))
+#define CAMEL_IS_MIME_PARSER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_PARSER))
+#define CAMEL_IS_MIME_PARSER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_PARSER))
+#define CAMEL_MIME_PARSER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_PARSER, CamelMimeParserClass))
G_BEGIN_DECLS
@@ -80,7 +95,7 @@ struct _CamelMimeParserClass {
void (*content) (CamelMimeParser *parser);
};
-CamelType camel_mime_parser_get_type (void);
+GType camel_mime_parser_get_type (void);
CamelMimeParser *camel_mime_parser_new (void);
/* quick-fix for parser not erroring, we can find out if it had an error afterwards */
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index de3c10b..a516fab 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -75,7 +75,7 @@ simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser
mem = camel_stream_mem_new_with_byte_array (buffer);
camel_data_wrapper_construct_from_stream (dw, mem);
- camel_object_unref (mem);
+ g_object_unref (mem);
}
/**
@@ -136,7 +136,7 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParse
/* would you believe you have to set this BEFORE you set the content object??? oh my god !!!! */
camel_data_wrapper_set_mime_type_field (content, camel_mime_part_get_content_type (dw));
camel_medium_set_content ((CamelMedium *)dw, content);
- camel_object_unref (content);
+ g_object_unref (content);
}
g_free (encoding);
@@ -213,9 +213,9 @@ camel_mime_message_build_preview (CamelMimePart *msg,
((CamelMessageInfoBase *) info)->preview = camel_utf8_make_valid(str->str);
g_string_free(str, TRUE);
- camel_object_unref (bstream);
+ g_object_unref (bstream);
}
- camel_object_unref (mstream);
+ g_object_unref (mstream);
return TRUE;
}
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index daf548c..af0823b 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -49,6 +49,10 @@
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
+#define CAMEL_MIME_PART_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_PART, CamelMimePartPrivate))
+
struct _CamelMimePartPrivate {
/* TODO: these should be in a camelcontentinfo */
@@ -61,6 +65,16 @@ struct _CamelMimePartPrivate {
CamelTransferEncoding encoding;
};
+enum {
+ PROP_0,
+ PROP_CONTENT_ID,
+ PROP_CONTENT_LOCATION,
+ PROP_CONTENT_MD5,
+ PROP_DESCRIPTION,
+ PROP_DISPOSITION,
+ PROP_FILENAME
+};
+
typedef enum {
HEADER_UNKNOWN,
HEADER_DESCRIPTION,
@@ -76,7 +90,7 @@ typedef enum {
static GHashTable *header_name_table;
static GHashTable *header_formatted_table;
-static gpointer camel_mime_part_parent_class;
+G_DEFINE_TYPE (CamelMimePart, camel_mime_part, CAMEL_TYPE_MEDIUM)
static gssize
write_raw (CamelStream *stream,
@@ -264,9 +278,93 @@ mime_part_process_header (CamelMedium *medium,
}
static void
-mime_part_finalize (CamelMimePart *mime_part)
+mime_part_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_CONTENT_ID:
+ camel_mime_part_set_content_id (
+ CAMEL_MIME_PART (object),
+ g_value_get_string (value));
+ return;
+
+ case PROP_CONTENT_MD5:
+ camel_mime_part_set_content_md5 (
+ CAMEL_MIME_PART (object),
+ g_value_get_string (value));
+ return;
+
+ case PROP_CONTENT_LOCATION:
+ camel_mime_part_set_content_location (
+ CAMEL_MIME_PART (object),
+ g_value_get_string (value));
+ return;
+
+ case PROP_DESCRIPTION:
+ camel_mime_part_set_description (
+ CAMEL_MIME_PART (object),
+ g_value_get_string (value));
+ return;
+
+ case PROP_DISPOSITION:
+ camel_mime_part_set_disposition (
+ CAMEL_MIME_PART (object),
+ g_value_get_string (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+mime_part_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- CamelMimePartPrivate *priv = mime_part->priv;
+ switch (property_id) {
+ case PROP_CONTENT_ID:
+ g_value_set_string (
+ value, camel_mime_part_get_content_id (
+ CAMEL_MIME_PART (object)));
+ return;
+
+ case PROP_CONTENT_MD5:
+ g_value_set_string (
+ value, camel_mime_part_get_content_md5 (
+ CAMEL_MIME_PART (object)));
+ return;
+
+ case PROP_CONTENT_LOCATION:
+ g_value_set_string (
+ value, camel_mime_part_get_content_location (
+ CAMEL_MIME_PART (object)));
+ return;
+
+ case PROP_DESCRIPTION:
+ g_value_set_string (
+ value, camel_mime_part_get_description (
+ CAMEL_MIME_PART (object)));
+ return;
+
+ case PROP_DISPOSITION:
+ g_value_set_string (
+ value, camel_mime_part_get_disposition (
+ CAMEL_MIME_PART (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+mime_part_finalize (GObject *object)
+{
+ CamelMimePartPrivate *priv;
+
+ priv = CAMEL_MIME_PART_GET_PRIVATE (object);
g_free (priv->description);
g_free (priv->content_id);
@@ -276,9 +374,10 @@ mime_part_finalize (CamelMimePart *mime_part)
camel_string_list_free (priv->content_languages);
camel_content_disposition_unref (priv->disposition);
- camel_header_raw_clear(&mime_part->headers);
+ camel_header_raw_clear(&CAMEL_MIME_PART (object)->headers);
- g_free (priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_mime_part_parent_class)->finalize (object);
}
static void
@@ -293,7 +392,7 @@ mime_part_add_header (CamelMedium *medium,
/* we simply add the header in a raw fashion */
/* If it was one of the headers we handled, it must be unique, set it instead of add */
- if (mime_part_process_header(medium, name, value))
+ if (mime_part_process_header (medium, name, value))
camel_header_raw_replace (&part->headers, name, value, -1);
else
camel_header_raw_append (&part->headers, name, value, -1);
@@ -479,7 +578,7 @@ mime_part_write_to_stream (CamelDataWrapper *dw,
if (charenc) {
camel_stream_filter_add (
CAMEL_STREAM_FILTER (filter_stream), charenc);
- camel_object_unref (charenc);
+ g_object_unref (charenc);
}
/* we only re-do crlf on encoded blocks */
@@ -489,13 +588,13 @@ mime_part_write_to_stream (CamelDataWrapper *dw,
camel_stream_filter_add (
CAMEL_STREAM_FILTER (filter_stream), crlf);
- camel_object_unref (crlf);
+ g_object_unref (crlf);
}
if (filter) {
camel_stream_filter_add (
CAMEL_STREAM_FILTER (filter_stream), filter);
- camel_object_unref (filter);
+ g_object_unref (filter);
}
stream = filter_stream;
@@ -511,7 +610,7 @@ mime_part_write_to_stream (CamelDataWrapper *dw,
if (filter_stream) {
errnosav = errno;
camel_stream_flush (stream);
- camel_object_unref (filter_stream);
+ g_object_unref (filter_stream);
errno = errnosav;
}
@@ -550,7 +649,7 @@ mime_part_construct_from_stream (CamelDataWrapper *dw,
ret = camel_mime_part_construct_from_parser (
CAMEL_MIME_PART (dw), mp);
}
- camel_object_unref (mp);
+ g_object_unref (mp);
return ret;
}
@@ -611,10 +710,16 @@ mime_part_construct_from_parser (CamelMimePart *mime_part,
static void
camel_mime_part_class_init (CamelMimePartClass *class)
{
+ GObjectClass *object_class;
CamelMediumClass *medium_class;
CamelDataWrapperClass *data_wrapper_class;
- camel_mime_part_parent_class = CAMEL_MEDIUM_CLASS (camel_type_get_global_classfuncs (camel_medium_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelMimePartPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = mime_part_set_property;
+ object_class->get_property = mime_part_get_property;
+ object_class->finalize = mime_part_finalize;
medium_class = CAMEL_MEDIUM_CLASS (class);
medium_class->add_header = mime_part_add_header;
@@ -631,6 +736,46 @@ camel_mime_part_class_init (CamelMimePartClass *class)
class->construct_from_parser = mime_part_construct_from_parser;
+ g_object_class_install_property (
+ object_class,
+ PROP_CONTENT_ID,
+ g_param_spec_string (
+ "content-id",
+ "Content ID",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CONTENT_MD5,
+ g_param_spec_string (
+ "content-md5",
+ "Content MD5",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_DESCRIPTION,
+ g_param_spec_string (
+ "description",
+ "Description",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_DISPOSITION,
+ g_param_spec_string (
+ "disposition",
+ "Disposition",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
init_header_name_table ();
}
@@ -639,7 +784,7 @@ camel_mime_part_init (CamelMimePart *mime_part)
{
CamelDataWrapper *data_wrapper;
- mime_part->priv = g_new0 (CamelMimePartPrivate, 1);
+ mime_part->priv = CAMEL_MIME_PART_GET_PRIVATE (mime_part);
mime_part->priv->encoding = CAMEL_TRANSFER_ENCODING_DEFAULT;
data_wrapper = CAMEL_DATA_WRAPPER (mime_part);
@@ -650,25 +795,6 @@ camel_mime_part_init (CamelMimePart *mime_part)
data_wrapper->mime_type = camel_content_type_new ("text", "plain");
}
-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",
- sizeof (CamelMimePart),
- sizeof (CamelMimePartClass),
- (CamelObjectClassInitFunc) camel_mime_part_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_part_init,
- (CamelObjectFinalizeFunc) mime_part_finalize);
- }
-
- return type;
-}
-
/* **** Content-Description */
/**
@@ -693,6 +819,8 @@ camel_mime_part_set_description (CamelMimePart *mime_part,
text = camel_header_encode_string ((guchar *) description);
camel_medium_set_header (medium, "Content-Description", text);
g_free (text);
+
+ g_object_notify (G_OBJECT (mime_part), "description");
}
/**
@@ -743,6 +871,8 @@ camel_mime_part_set_disposition (CamelMimePart *mime_part,
text = camel_content_disposition_format (mime_part->priv->disposition);
camel_medium_set_header (medium, "Content-Disposition", text);
g_free (text);
+
+ g_object_notify (G_OBJECT (mime_part), "disposition");
}
/**
@@ -872,6 +1002,8 @@ camel_mime_part_set_content_id (CamelMimePart *mime_part,
g_free (cid);
g_free (id);
+
+ g_object_notify (G_OBJECT (mime_part), "content-id");
}
/**
@@ -949,6 +1081,8 @@ camel_mime_part_set_content_location (CamelMimePart *mime_part,
/* FIXME: this should perform content-location folding */
camel_medium_set_header (medium, "Content-Location", location);
+
+ g_object_notify (G_OBJECT (mime_part), "content-location");
}
/**
@@ -1122,7 +1256,7 @@ camel_mime_part_construct_from_parser (CamelMimePart *mime_part,
CamelMimePart *
camel_mime_part_new (void)
{
- return (CamelMimePart *)camel_object_new (CAMEL_MIME_PART_TYPE);
+ return g_object_new (CAMEL_TYPE_MIME_PART, NULL);
}
/**
@@ -1152,9 +1286,9 @@ camel_mime_part_set_content (CamelMimePart *mime_part,
camel_data_wrapper_set_mime_type (dw, type);
stream = camel_stream_mem_new_with_buffer (data, length);
camel_data_wrapper_construct_from_stream (dw, stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
camel_medium_set_content (medium, dw);
- camel_object_unref (dw);
+ g_object_unref (dw);
} else
camel_medium_set_content (medium, NULL);
}
@@ -1184,7 +1318,7 @@ camel_mime_part_get_content_size (CamelMimePart *mime_part)
camel_data_wrapper_decode_to_stream (dw, (CamelStream *) null);
size = null->written;
- camel_object_unref (null);
+ g_object_unref (null);
return size;
}
diff --git a/camel/camel-mime-part.h b/camel/camel-mime-part.h
index a99ee51..c13297d 100644
--- a/camel/camel-mime-part.h
+++ b/camel/camel-mime-part.h
@@ -34,12 +34,24 @@
#include <camel/camel-mime-utils.h>
#include <camel/camel-mime-parser.h>
-#define CAMEL_MIME_PART_TYPE (camel_mime_part_get_type ())
-#define CAMEL_MIME_PART(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MIME_PART_TYPE, CamelMimePart))
-#define CAMEL_MIME_PART_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MIME_PART_TYPE, CamelMimePartClass))
-#define CAMEL_IS_MIME_PART(o) (CAMEL_CHECK_TYPE((o), CAMEL_MIME_PART_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MIME_PART \
+ (camel_mime_part_get_type ())
+#define CAMEL_MIME_PART(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MIME_PART, CamelMimePart))
+#define CAMEL_MIME_PART_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MIME_PART, CamelMimePartClass))
+#define CAMEL_IS_MIME_PART(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MIME_PART))
+#define CAMEL_IS_MIME_PART_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MIME_PART))
#define CAMEL_MIME_PART_GET_CLASS(obj) \
- ((CamelMimePartClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MIME_PART, CamelMimePartClass))
G_BEGIN_DECLS
@@ -61,7 +73,7 @@ struct _CamelMimePartClass {
CamelMimeParser *parser);
};
-CamelType camel_mime_part_get_type (void);
+GType camel_mime_part_get_type (void);
/* public methods */
CamelMimePart * camel_mime_part_new (void);
diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c
index c25f4bb..11fde95 100644
--- a/camel/camel-movemail.c
+++ b/camel/camel-movemail.c
@@ -533,8 +533,8 @@ camel_movemail_solaris (gint oldsfd,
g_free(from);
}
- camel_object_unref (mp);
- camel_object_unref (ffrom);
+ g_object_unref (mp);
+ g_object_unref (ffrom);
return ret;
@@ -546,8 +546,8 @@ fail:
_("Error copying mail temp file: %s"),
g_strerror (errno));
- camel_object_unref (mp);
- camel_object_unref (ffrom);
+ g_object_unref (mp);
+ g_object_unref (ffrom);
return -1;
}
diff --git a/camel/camel-multipart-encrypted.c b/camel/camel-multipart-encrypted.c
index 53bd20d..825f394 100644
--- a/camel/camel-multipart-encrypted.c
+++ b/camel/camel-multipart-encrypted.c
@@ -37,15 +37,35 @@
#include "camel-stream-fs.h"
#include "camel-stream-mem.h"
-static gpointer camel_multipart_encrypted_parent_class;
+G_DEFINE_TYPE (CamelMultipartEncrypted, camel_multipart_encrypted, CAMEL_TYPE_MULTIPART)
static void
-multipart_encrypted_finalize (CamelMultipartEncrypted *multipart)
+multipart_encrypted_dispose (GObject *object)
{
+ CamelMultipartEncrypted *multipart;
+
+ multipart = CAMEL_MULTIPART_ENCRYPTED (object);
+
+ if (multipart->decrypted) {
+ g_object_unref (multipart->decrypted);
+ multipart->decrypted = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_multipart_encrypted_parent_class)->dispose (object);
+}
+
+static void
+multipart_encrypted_finalize (GObject *object)
+{
+ CamelMultipartEncrypted *multipart;
+
+ multipart = CAMEL_MULTIPART_ENCRYPTED (object);
+
g_free (multipart->protocol);
- if (multipart->decrypted)
- camel_object_unref (multipart->decrypted);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_multipart_encrypted_parent_class)->finalize (object);
}
/* we snoop the mime type to get the protocol */
@@ -74,9 +94,12 @@ multipart_encrypted_set_mime_type_field (CamelDataWrapper *data_wrapper,
static void
camel_multipart_encrypted_class_init (CamelMultipartEncryptedClass *class)
{
+ GObjectClass *object_class;
CamelDataWrapperClass *data_wrapper_class;
- camel_multipart_encrypted_parent_class = (CamelMultipartClass *) camel_multipart_get_type ();
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = multipart_encrypted_dispose;
+ object_class->finalize = multipart_encrypted_finalize;
data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (class);
data_wrapper_class->set_mime_type_field =
@@ -92,25 +115,6 @@ camel_multipart_encrypted_init (CamelMultipartEncrypted *multipart)
multipart->decrypted = NULL;
}
-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",
- sizeof (CamelMultipartEncrypted),
- sizeof (CamelMultipartEncryptedClass),
- (CamelObjectClassInitFunc) camel_multipart_encrypted_class_init,
- NULL,
- (CamelObjectInitFunc) camel_multipart_encrypted_init,
- (CamelObjectFinalizeFunc) multipart_encrypted_finalize);
- }
-
- return type;
-}
-
/**
* camel_multipart_encrypted_new:
*
@@ -124,5 +128,5 @@ camel_multipart_encrypted_get_type (void)
CamelMultipartEncrypted *
camel_multipart_encrypted_new (void)
{
- return (CamelMultipartEncrypted *) camel_object_new (CAMEL_MULTIPART_ENCRYPTED_TYPE);
+ return g_object_new (CAMEL_TYPE_MULTIPART_ENCRYPTED, NULL);
}
diff --git a/camel/camel-multipart-encrypted.h b/camel/camel-multipart-encrypted.h
index 3672ad8..8c66588 100644
--- a/camel/camel-multipart-encrypted.h
+++ b/camel/camel-multipart-encrypted.h
@@ -29,10 +29,24 @@
#include <camel/camel-multipart.h>
-#define CAMEL_MULTIPART_ENCRYPTED_TYPE (camel_multipart_encrypted_get_type ())
-#define CAMEL_MULTIPART_ENCRYPTED(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_ENCRYPTED_TYPE, CamelMultipartEncrypted))
-#define CAMEL_MULTIPART_ENCRYPTED_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_ENCRYPTED_TYPE, CamelMultipartEncryptedClass))
-#define CAMEL_IS_MULTIPART_ENCRYPTED(o) (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_ENCRYPTED_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MULTIPART_ENCRYPTED \
+ (camel_multipart_encrypted_get_type ())
+#define CAMEL_MULTIPART_ENCRYPTED(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MULTIPART_ENCRYPTED, CamelMultipartEncrypted))
+#define CAMEL_MULTIPART_ENCRYPTED_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MULTIPART_ENCRYPTED, CamelMultipartEncryptedClass))
+#define CAMEL_IS_MULTIPART_ENCRYPTED(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MULTIPART_ENCRYPTED))
+#define CAMEL_IS_MULTIPART_ENCRYPTED_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MULTIPART_ENCRYPTED))
+#define CAMEL_MULTIPART_ENCRYPTED_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MULTIPART_ENCRYPTED, CamelMultipartEncryptedClass))
G_BEGIN_DECLS
@@ -60,7 +74,7 @@ struct _CamelMultipartEncryptedClass {
};
-CamelType camel_multipart_encrypted_get_type (void);
+GType camel_multipart_encrypted_get_type (void);
CamelMultipartEncrypted *camel_multipart_encrypted_new (void);
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
index 53f30c9..2d71381 100644
--- a/camel/camel-multipart-signed.c
+++ b/camel/camel-multipart-signed.c
@@ -51,7 +51,7 @@
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))
#include <stdio.h>;*/
-static gpointer camel_multipart_signed_parent_class;
+G_DEFINE_TYPE (CamelMultipartSigned, camel_multipart_signed, CAMEL_TYPE_MULTIPART)
static gint
multipart_signed_skip_content (CamelMimeParser *cmp)
@@ -158,7 +158,7 @@ multipart_signed_parse_content (CamelMultipartSigned *mps)
camel_multipart_set_postface(mp, camel_mime_parser_postface(cmp));
}
- camel_object_unref (cmp);
+ g_object_unref (cmp);
if (mps->end2 == -1 || mps->start2 == -1) {
return -1;
@@ -174,36 +174,62 @@ multipart_signed_set_stream (CamelMultipartSigned *mps,
CamelDataWrapper *dw = (CamelDataWrapper *)mps;
if (dw->stream)
- camel_object_unref (dw->stream);
+ g_object_unref (dw->stream);
dw->stream = stream;
mps->start1 = -1;
if (mps->content) {
- camel_object_unref (mps->content);
+ g_object_unref (mps->content);
mps->content = NULL;
}
if (mps->contentraw) {
- camel_object_unref (mps->contentraw);
+ g_object_unref (mps->contentraw);
mps->contentraw = NULL;
}
if (mps->signature) {
- camel_object_unref (mps->signature);
+ g_object_unref (mps->signature);
mps->signature = NULL;
}
}
static void
-multipart_signed_finalize (CamelMultipartSigned *mps)
+multipart_signed_dispose (GObject *object)
{
- g_free (mps->protocol);
- g_free (mps->micalg);
-\
- if (mps->signature)
- camel_object_unref (mps->signature);
- if (mps->content)
- camel_object_unref (mps->content);
- if (mps->contentraw)
- camel_object_unref (mps->contentraw);
+ CamelMultipartSigned *multipart;
+
+ multipart = CAMEL_MULTIPART_SIGNED (object);
+
+ if (multipart->signature != NULL) {
+ g_object_unref (multipart->signature);
+ multipart->signature = NULL;
+ }
+
+ if (multipart->content != NULL) {
+ g_object_unref (multipart->content);
+ multipart->content = NULL;
+ }
+
+ if (multipart->contentraw != NULL) {
+ g_object_unref (multipart->contentraw);
+ multipart->contentraw = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_multipart_signed_parent_class)->dispose (object);
+}
+
+static void
+multipart_signed_finalize (GObject *object)
+{
+ CamelMultipartSigned *multipart;
+
+ multipart = CAMEL_MULTIPART_SIGNED (object);
+
+ g_free (multipart->protocol);
+ g_free (multipart->micalg);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_multipart_signed_parent_class)->finalize (object);
}
static void
@@ -370,7 +396,7 @@ multipart_signed_get_part (CamelMultipart *multipart,
if (mps->content)
return mps->content;
if (mps->contentraw) {
- stream = camel_object_ref (mps->contentraw);
+ stream = g_object_ref (mps->contentraw);
} else if (mps->start1 == -1
&& multipart_signed_parse_content(mps) == -1
&& (stream = ((CamelDataWrapper *)mps)->stream) == NULL) {
@@ -379,7 +405,7 @@ multipart_signed_get_part (CamelMultipart *multipart,
} else if (dw->stream == NULL) {
return NULL;
} else if (mps->start1 == -1) {
- stream = camel_object_ref (dw->stream);
+ stream = g_object_ref (dw->stream);
} else {
stream = camel_seekable_substream_new((CamelSeekableStream *)dw->stream, mps->start1, mps->end1);
}
@@ -387,7 +413,7 @@ multipart_signed_get_part (CamelMultipart *multipart,
mps->content = camel_mime_part_new();
camel_data_wrapper_construct_from_stream (
CAMEL_DATA_WRAPPER (mps->content), stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
return mps->content;
case CAMEL_MULTIPART_SIGNED_SIGNATURE:
if (mps->signature)
@@ -404,7 +430,7 @@ multipart_signed_get_part (CamelMultipart *multipart,
mps->signature = camel_mime_part_new();
camel_data_wrapper_construct_from_stream (
CAMEL_DATA_WRAPPER (mps->signature), stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
return mps->signature;
default:
g_warning("trying to get object out of bounds for multipart");
@@ -470,10 +496,13 @@ multipart_signed_construct_from_parser (CamelMultipart *multipart,
static void
camel_multipart_signed_class_init (CamelMultipartSignedClass *class)
{
+ GObjectClass *object_class;
CamelDataWrapperClass *data_wrapper_class;
CamelMultipartClass *multipart_class;
- camel_multipart_signed_parent_class = (CamelMultipartClass *)camel_multipart_get_type();
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = multipart_signed_dispose;
+ object_class->finalize = multipart_signed_finalize;
data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (class);
data_wrapper_class->set_mime_type_field = multipart_signed_set_mime_type_field;
@@ -500,24 +529,6 @@ camel_multipart_signed_init (CamelMultipartSigned *multipart)
multipart->start1 = -1;
}
-CamelType
-camel_multipart_signed_get_type (void)
-{
- static CamelType camel_multipart_signed_type = CAMEL_INVALID_TYPE;
-
- if (camel_multipart_signed_type == CAMEL_INVALID_TYPE) {
- camel_multipart_signed_type = camel_type_register (camel_multipart_get_type (), "CamelMultipartSigned",
- sizeof (CamelMultipartSigned),
- sizeof (CamelMultipartSignedClass),
- (CamelObjectClassInitFunc) camel_multipart_signed_class_init,
- NULL,
- (CamelObjectInitFunc) camel_multipart_signed_init,
- (CamelObjectFinalizeFunc) multipart_signed_finalize);
- }
-
- return camel_multipart_signed_type;
-}
-
/**
* camel_multipart_signed_new:
*
@@ -549,7 +560,7 @@ camel_multipart_signed_get_type (void)
CamelMultipartSigned *
camel_multipart_signed_new (void)
{
- return (CamelMultipartSigned *)camel_object_new(CAMEL_MULTIPART_SIGNED_TYPE);
+ return g_object_new (CAMEL_TYPE_MULTIPART_SIGNED, NULL);
}
/**
@@ -571,7 +582,7 @@ camel_multipart_signed_get_content_stream (CamelMultipartSigned *mps,
/* we need to be able to verify stuff we just signed as well as stuff we loaded from a stream/parser */
if (mps->contentraw) {
- constream = camel_object_ref (mps->contentraw);
+ constream = g_object_ref (mps->contentraw);
} else {
CamelStream *sub;
CamelMimeFilter *canon_filter;
@@ -586,12 +597,12 @@ camel_multipart_signed_get_content_stream (CamelMultipartSigned *mps,
/* first, prepare our parts */
sub = camel_seekable_substream_new((CamelSeekableStream *)((CamelDataWrapper *)mps)->stream, mps->start1, mps->end1);
constream = camel_stream_filter_new (sub);
- camel_object_unref (sub);
+ g_object_unref (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);
- camel_object_unref (canon_filter);
+ g_object_unref (canon_filter);
}
return constream;
diff --git a/camel/camel-multipart-signed.h b/camel/camel-multipart-signed.h
index 0931f14..20b1054 100644
--- a/camel/camel-multipart-signed.h
+++ b/camel/camel-multipart-signed.h
@@ -33,10 +33,24 @@
#include <camel/camel-multipart.h>
-#define CAMEL_MULTIPART_SIGNED_TYPE (camel_multipart_signed_get_type ())
-#define CAMEL_MULTIPART_SIGNED(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_SIGNED_TYPE, CamelMultipartSigned))
-#define CAMEL_MULTIPART_SIGNED_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_SIGNED_TYPE, CamelMultipartSignedClass))
-#define CAMEL_IS_MULTIPART_SIGNED(o) (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_SIGNED_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MULTIPART_SIGNED \
+ (camel_multipart_signed_get_type ())
+#define CAMEL_MULTIPART_SIGNED(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MULTIPART_SIGNED, CamelMultipartSigned))
+#define CAMEL_MULTIPART_SIGNED_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MULTIPART_SIGNED, CamelMultipartSignedClass))
+#define CAMEL_IS_MULTIPART_SIGNED(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MULTIPART_SIGNED))
+#define CAMEL_IS_MULTIPART_SIGNED_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MULTIPART_SIGNED))
+#define CAMEL_MULTIPART_SIGNED_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MULTIPART_SIGNED, CamelMultipartSignedClass))
G_BEGIN_DECLS
@@ -85,7 +99,7 @@ typedef struct {
CamelMultipartClass parent_class;
} CamelMultipartSignedClass;
-CamelType camel_multipart_signed_get_type (void);
+GType camel_multipart_signed_get_type (void);
/* public methods */
CamelMultipartSigned *camel_multipart_signed_new (void);
diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c
index 87a43ed..1c66bac 100644
--- a/camel/camel-multipart.c
+++ b/camel/camel-multipart.c
@@ -38,17 +38,31 @@
#define d(x)
-static gpointer camel_multipart_parent_class;
+G_DEFINE_TYPE (CamelMultipart, camel_multipart, CAMEL_TYPE_DATA_WRAPPER)
static void
-multipart_finalize (CamelMultipart *multipart)
+multipart_dispose (GObject *object)
{
- g_list_foreach (multipart->parts, (GFunc) camel_object_unref, NULL);
+ CamelMultipart *multipart = CAMEL_MULTIPART (object);
+
+ g_list_foreach (multipart->parts, (GFunc) g_object_unref, NULL);
g_list_free (multipart->parts);
multipart->parts = NULL;
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_multipart_parent_class)->dispose (object);
+}
+
+static void
+multipart_finalize (GObject *object)
+{
+ CamelMultipart *multipart = CAMEL_MULTIPART (object);
+
g_free (multipart->preface);
g_free (multipart->postface);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_multipart_parent_class)->finalize (object);
}
/* this is MIME specific, doesn't belong here really */
@@ -142,7 +156,7 @@ multipart_add_part (CamelMultipart *multipart,
CamelMimePart *part)
{
multipart->parts = g_list_append (
- multipart->parts, camel_object_ref (part));
+ multipart->parts, g_object_ref (part));
}
static void
@@ -151,7 +165,7 @@ multipart_add_part_at (CamelMultipart *multipart,
guint index)
{
multipart->parts = g_list_insert (
- multipart->parts, camel_object_ref (part), index);
+ multipart->parts, g_object_ref (part), index);
}
static void
@@ -163,7 +177,7 @@ multipart_remove_part (CamelMultipart *multipart,
return;
multipart->parts = g_list_remove (multipart->parts, part);
- camel_object_unref (part);
+ g_object_unref (part);
}
static CamelMimePart *
@@ -186,7 +200,7 @@ multipart_remove_part_at (CamelMultipart *multipart,
multipart->parts = g_list_remove_link (multipart->parts, link);
if (link->data)
- camel_object_unref (link->data);
+ g_object_unref (link->data);
g_list_free_1 (link);
return removed_part;
@@ -289,7 +303,7 @@ multipart_construct_from_parser (CamelMultipart *multipart,
bodypart = camel_mime_part_new();
camel_mime_part_construct_from_parser (bodypart, mp);
camel_multipart_add_part(multipart, bodypart);
- camel_object_unref (bodypart);
+ g_object_unref (bodypart);
}
/* these are only return valid data in the MULTIPART_END state */
@@ -307,9 +321,12 @@ multipart_construct_from_parser (CamelMultipart *multipart,
static void
camel_multipart_class_init (CamelMultipartClass *class)
{
+ GObjectClass *object_class;
CamelDataWrapperClass *data_wrapper_class;
- camel_multipart_parent_class = (CamelDataWrapperClass *) camel_data_wrapper_get_type ();
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = multipart_dispose;
+ object_class->finalize = multipart_finalize;
data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (class);
data_wrapper_class->write_to_stream = multipart_write_to_stream;
@@ -337,24 +354,6 @@ camel_multipart_init (CamelMultipart *multipart)
multipart->postface = NULL;
}
-CamelType
-camel_multipart_get_type (void)
-{
- static CamelType camel_multipart_type = CAMEL_INVALID_TYPE;
-
- if (camel_multipart_type == CAMEL_INVALID_TYPE) {
- camel_multipart_type = camel_type_register (camel_data_wrapper_get_type (), "CamelMultipart",
- sizeof (CamelMultipart),
- sizeof (CamelMultipartClass),
- (CamelObjectClassInitFunc) camel_multipart_class_init,
- NULL,
- (CamelObjectInitFunc) camel_multipart_init,
- (CamelObjectFinalizeFunc) multipart_finalize);
- }
-
- return camel_multipart_type;
-}
-
/**
* camel_multipart_new:
*
@@ -367,7 +366,7 @@ camel_multipart_new (void)
{
CamelMultipart *multipart;
- multipart = (CamelMultipart *)camel_object_new (CAMEL_MULTIPART_TYPE);
+ multipart = g_object_new (CAMEL_TYPE_MULTIPART, NULL);
multipart->preface = NULL;
multipart->postface = NULL;
@@ -451,7 +450,7 @@ camel_multipart_remove_part (CamelMultipart *multipart,
*
* Remove the indicated part from the multipart object.
*
- * Returns: the removed part. Note that it is #camel_object_unref'ed
+ * Returns: the removed part. Note that it is #g_object_unref'ed
* before being returned, which may cause it to be destroyed.
**/
CamelMimePart *
diff --git a/camel/camel-multipart.h b/camel/camel-multipart.h
index 79b34ad..8e9d6cc 100644
--- a/camel/camel-multipart.h
+++ b/camel/camel-multipart.h
@@ -32,12 +32,24 @@
#include <camel/camel-data-wrapper.h>
-#define CAMEL_MULTIPART_TYPE (camel_multipart_get_type ())
-#define CAMEL_MULTIPART(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_TYPE, CamelMultipart))
-#define CAMEL_MULTIPART_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_TYPE, CamelMultipartClass))
-#define CAMEL_IS_MULTIPART(o) (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MULTIPART \
+ (camel_multipart_get_type ())
+#define CAMEL_MULTIPART(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MULTIPART, CamelMultipart))
+#define CAMEL_MULTIPART_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MULTIPART, CamelMultipartClass))
+#define CAMEL_IS_MULTIPART(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MULTIPART))
+#define CAMEL_IS_MULTIPART_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MULTIPART))
#define CAMEL_MULTIPART_GET_CLASS(obj) \
- ((CamelMultipartClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MULTIPART, CamelMultipartClass))
G_BEGIN_DECLS
@@ -71,7 +83,7 @@ struct _CamelMultipartClass {
/*int (*construct_from_stream)(CamelMultipart *, CamelStream *);*/
};
-CamelType camel_multipart_get_type (void);
+GType camel_multipart_get_type (void);
/* public methods */
CamelMultipart * camel_multipart_new (void);
diff --git a/camel/camel-nntp-address.c b/camel/camel-nntp-address.c
index ecf6ecd..6fb5d30 100644
--- a/camel/camel-nntp-address.c
+++ b/camel/camel-nntp-address.c
@@ -26,13 +26,13 @@
#define d(x)
-static CamelAddressClass *camel_nntp_address_parent;
-
struct _address {
gchar *name;
gchar *address;
};
+G_DEFINE_TYPE (CamelNNTPAddress, camel_nntp_address, CAMEL_TYPE_ADDRESS)
+
/* since newsgropus are 7bit ascii, decode/unformat are the same */
static gint
nntp_address_decode (CamelAddress *address,
@@ -110,8 +110,6 @@ camel_nntp_address_class_init (CamelNNTPAddressClass *class)
{
CamelAddressClass *address_class;
- camel_nntp_address_parent = CAMEL_ADDRESS_CLASS(camel_type_get_global_classfuncs(camel_address_get_type()));
-
address_class = CAMEL_ADDRESS_CLASS (class);
address_class->decode = nntp_address_decode;
address_class->encode = nntp_address_encode;
@@ -126,24 +124,6 @@ camel_nntp_address_init (CamelNNTPAddress *nntp_address)
{
}
-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),
- sizeof (CamelNNTPAddressClass),
- (CamelObjectClassInitFunc) camel_nntp_address_class_init,
- NULL,
- (CamelObjectInitFunc) camel_nntp_address_init,
- NULL);
- }
-
- return type;
-}
-
/**
* camel_nntp_address_new:
*
@@ -154,7 +134,7 @@ camel_nntp_address_get_type(void)
CamelNNTPAddress *
camel_nntp_address_new (void)
{
- return CAMEL_NNTP_ADDRESS(camel_object_new(camel_nntp_address_get_type()));
+ return g_object_new (CAMEL_TYPE_NNTP_ADDRESS, NULL);
}
/**
diff --git a/camel/camel-nntp-address.h b/camel/camel-nntp-address.h
index 1e8571a..20df318 100644
--- a/camel/camel-nntp-address.h
+++ b/camel/camel-nntp-address.h
@@ -28,9 +28,24 @@
#include <camel/camel-address.h>
-#define CAMEL_NNTP_ADDRESS(obj) CAMEL_CHECK_CAST (obj, camel_nntp_address_get_type (), CamelNNTPAddress)
-#define CAMEL_NNTP_ADDRESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_nntp_address_get_type (), CamelNNTPAddressClass)
-#define CAMEL_IS_NNTP_ADDRESS(obj) CAMEL_CHECK_TYPE (obj, camel_nntp_address_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_NNTP_ADDRESS \
+ (camel_nntp_address_get_type ())
+#define CAMEL_NNTP_ADDRESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_NNTP_ADDRESS, CamelNNTPAddress))
+#define CAMEL_NNTP_ADDRESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_NNTP_ADDRESS, CamelNNTPAddressClass))
+#define CAMEL_IS_NNTP_ADDRESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_NNTP_ADDRESS))
+#define CAMEL_IS_NNTP_ADDRESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_NNTP_ADDRESS))
+#define CAMEL_NNTP_ADDRESS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_NTTP_ADDRESS, CamelNNTPAddressClass))
G_BEGIN_DECLS
@@ -47,7 +62,7 @@ struct _CamelNNTPAddressClass {
CamelAddressClass parent_class;
};
-CamelType camel_nntp_address_get_type (void);
+GType camel_nntp_address_get_type (void);
CamelNNTPAddress *
camel_nntp_address_new (void);
gint camel_nntp_address_add (CamelNNTPAddress *a,
diff --git a/camel/camel-object-bag.c b/camel/camel-object-bag.c
new file mode 100644
index 0000000..79ca4a2
--- /dev/null
+++ b/camel/camel-object-bag.c
@@ -0,0 +1,525 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008 Novell, Inc.
+ *
+ * This library 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
+ * General Public License for more details.
+ *
+ * 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 Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "camel-object-bag.h"
+
+#include <glib-object.h>
+
+typedef struct _KeyReservation KeyReservation;
+
+struct _KeyReservation {
+ gpointer key;
+ gint waiters;
+ GThread *owner;
+ GCond *cond;
+};
+
+struct _CamelObjectBag {
+ GHashTable *key_table;
+ GHashTable *object_table;
+ GEqualFunc key_equal_func;
+ CamelCopyFunc key_copy_func;
+ GFreeFunc key_free_func;
+ GSList *reserved; /* list of KeyReservations */
+ GMutex *mutex;
+};
+
+static KeyReservation *
+key_reservation_new (CamelObjectBag *bag,
+ gconstpointer key)
+{
+ KeyReservation *reservation;
+
+ reservation = g_slice_new0 (KeyReservation);
+ reservation->key = bag->key_copy_func (key);
+ reservation->owner = g_thread_self ();
+ reservation->cond = g_cond_new ();
+
+ bag->reserved = g_slist_prepend (bag->reserved, reservation);
+
+ return reservation;
+}
+
+static KeyReservation *
+key_reservation_lookup (CamelObjectBag *bag,
+ gconstpointer key)
+{
+ GSList *iter;
+
+ /* XXX Might be easier to use a GHashTable for reservations. */
+ for (iter = bag->reserved; iter != NULL; iter = iter->next) {
+ KeyReservation *reservation = iter->data;
+ if (bag->key_equal_func (reservation->key, key))
+ return reservation;
+ }
+
+ return NULL;
+}
+
+static void
+key_reservation_free (CamelObjectBag *bag,
+ KeyReservation *reservation)
+{
+ /* Make sure the reservation is actually in the object bag. */
+ g_return_if_fail (key_reservation_lookup (bag, reservation->key) != NULL);
+
+ bag->reserved = g_slist_remove (bag->reserved, reservation);
+
+ bag->key_free_func (reservation->key);
+ g_cond_free (reservation->cond);
+ g_slice_free (KeyReservation, reservation);
+}
+
+static void
+object_bag_notify (CamelObjectBag *bag,
+ GObject *where_the_object_was)
+{
+ gpointer key;
+
+ g_mutex_lock (bag->mutex);
+
+ key = g_hash_table_lookup (bag->key_table, where_the_object_was);
+ if (key != NULL) {
+ g_hash_table_remove (bag->key_table, where_the_object_was);
+ g_hash_table_remove (bag->object_table, key);
+ }
+
+ g_mutex_unlock (bag->mutex);
+}
+
+static void
+object_bag_weak_unref (gpointer key,
+ GObject *object,
+ CamelObjectBag *bag)
+{
+ g_object_weak_unref (object, (GWeakNotify) object_bag_notify, bag);
+}
+
+static void
+object_bag_unreserve (CamelObjectBag *bag,
+ gconstpointer key)
+{
+ KeyReservation *reservation;
+
+ reservation = key_reservation_lookup (bag, key);
+ g_return_if_fail (reservation != NULL);
+ g_return_if_fail (reservation->owner == g_thread_self ());
+
+ if (reservation->waiters > 0) {
+ reservation->owner = NULL;
+ g_cond_signal (reservation->cond);
+ } else
+ key_reservation_free (bag, reservation);
+}
+
+/**
+ * camel_object_bag_new:
+ * @key_hash_func: a hashing function for keys
+ * @key_equal_func: a comparison function for keys
+ * @key_copy_func: a function to copy keys
+ * @key_free_func: a function to free keys
+ *
+ * Returns a new object bag. Object bags are keyed hash tables of objects
+ * that can be updated atomically using transaction semantics. Use
+ * camel_object_bag_destroy() to free the object bag.
+ *
+ * Returns: a newly-allocated #CamelObjectBag
+ **/
+CamelObjectBag *
+camel_object_bag_new (GHashFunc key_hash_func,
+ GEqualFunc key_equal_func,
+ CamelCopyFunc key_copy_func,
+ GFreeFunc key_free_func)
+{
+ CamelObjectBag *bag;
+ GHashTable *key_table;
+ GHashTable *object_table;
+
+ g_return_val_if_fail (key_hash_func != NULL, NULL);
+ g_return_val_if_fail (key_equal_func != NULL, NULL);
+ g_return_val_if_fail (key_copy_func != NULL, NULL);
+ g_return_val_if_fail (key_free_func != NULL, NULL);
+
+ /* Each key is shared between both hash tables, so only one
+ * table needs to be responsible for destroying keys. */
+
+ key_table = g_hash_table_new (g_direct_hash, g_direct_equal);
+
+ object_table = g_hash_table_new_full (
+ key_hash_func, key_equal_func,
+ (GDestroyNotify) key_free_func,
+ (GDestroyNotify) NULL);
+
+ bag = g_slice_new0 (CamelObjectBag);
+ bag->key_table = key_table;
+ bag->object_table = object_table;
+ bag->key_equal_func = key_equal_func;
+ bag->key_copy_func = key_copy_func;
+ bag->key_free_func = key_free_func;
+ bag->mutex = g_mutex_new ();
+
+ return bag;
+}
+
+/**
+ * camel_object_bag_get:
+ * @bag: a #CamelObjectBag
+ * @key: a key
+ *
+ * Lookup an object by @key. If the key is currently reserved, the function
+ * will block until another thread commits or aborts the reservation. The
+ * caller owns the reference to the returned object. Use g_object_unref ()
+ * to unreference it.
+ *
+ * Returns: the object corresponding to @key, or %NULL if not found
+ **/
+gpointer
+camel_object_bag_get (CamelObjectBag *bag,
+ gconstpointer key)
+{
+ KeyReservation *reservation;
+ gpointer object;
+
+ g_return_val_if_fail (bag != NULL, NULL);
+ g_return_val_if_fail (key != NULL, NULL);
+
+ g_mutex_lock (bag->mutex);
+
+ /* Look for the key in the bag. */
+ object = g_hash_table_lookup (bag->object_table, key);
+ if (object != NULL) {
+ g_object_ref (object);
+ g_mutex_unlock (bag->mutex);
+ return object;
+ }
+
+ /* Check if the key has been reserved. */
+ reservation = key_reservation_lookup (bag, key);
+ if (reservation == NULL) {
+ /* No such key, so return NULL. */
+ g_mutex_unlock (bag->mutex);
+ return NULL;
+ }
+
+ /* Wait for the key to be unreserved. */
+ reservation->waiters++;
+ while (reservation->owner != NULL)
+ g_cond_wait (reservation->cond, bag->mutex);
+ reservation->waiters--;
+
+ /* Check if an object was added by another thread. */
+ object = g_hash_table_lookup (bag->object_table, key);
+ if (object != NULL)
+ g_object_ref (object);
+
+ /* We're not reserving it. */
+ reservation->owner = g_thread_self ();
+ object_bag_unreserve (bag, key);
+
+ g_mutex_unlock (bag->mutex);
+
+ return object;
+}
+
+/**
+ * camel_object_bag_peek:
+ * @bag: a #CamelObjectBag
+ * @key: an unreserved key
+ *
+ * Returns the object for @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.
+ *
+ * Unlink other "peek" operations, the caller owns the returned object
+ * reference. Use g_object_unref () to unreference it.
+ *
+ * Returns: the object for @key, or %NULL if @key is reserved or not found
+ **/
+gpointer
+camel_object_bag_peek (CamelObjectBag *bag,
+ gconstpointer key)
+{
+ gpointer object;
+
+ g_return_val_if_fail (bag != NULL, NULL);
+ g_return_val_if_fail (key != NULL, NULL);
+
+ g_mutex_lock (bag->mutex);
+
+ object = g_hash_table_lookup (bag->object_table, key);
+ if (object != NULL)
+ g_object_ref (object);
+
+ g_mutex_unlock (bag->mutex);
+
+ return object;
+}
+
+/**
+ * camel_object_bag_reserve:
+ * @bag: a #CamelObjectBag
+ * @key: the key to reserve
+ *
+ * Reserves @key in @bag. If @key is already reserved in another thread,
+ * then wait until the reservation has been committed.
+ *
+ * After reserving @key, you either get a reference to the object
+ * corresponding to @key (similar to camel_object_bag_get()) or you get
+ * %NULL, signifying that you MUST call either camel_object_bag_add() or
+ * camel_object_bag_abort().
+ *
+ * Returns: the object for @key, or %NULL if @key is not found
+ **/
+gpointer
+camel_object_bag_reserve (CamelObjectBag *bag,
+ gconstpointer key)
+{
+ KeyReservation *reservation;
+ gpointer object;
+
+ g_return_val_if_fail (bag != NULL, NULL);
+ g_return_val_if_fail (key != NULL, NULL);
+
+ g_mutex_lock (bag->mutex);
+
+ /* If object for key already exists, return it immediately. */
+ object = g_hash_table_lookup (bag->object_table, key);
+ if (object != NULL) {
+ g_object_ref (object);
+ g_mutex_unlock (bag->mutex);
+ return object;
+ }
+
+ /* If no such key exists in the bag, create a reservation. */
+ reservation = key_reservation_lookup (bag, key);
+ if (reservation == NULL) {
+ reservation = key_reservation_new (bag, key);
+ g_mutex_unlock (bag->mutex);
+ return NULL;
+ }
+
+ /* Wait for the reservation to be committed or aborted. */
+ reservation->waiters++;
+ while (reservation->owner != NULL)
+ g_cond_wait (reservation->cond, bag->mutex);
+ reservation->owner = g_thread_self ();
+ reservation->waiters--;
+
+ /* Check if the object was added by another thread. */
+ object = g_hash_table_lookup (bag->object_table, key);
+ if (object != NULL) {
+ /* We have an object; no need to reserve the key. */
+ object_bag_unreserve (bag, key);
+ g_object_ref (object);
+ }
+
+ g_mutex_unlock (bag->mutex);
+
+ return object;
+}
+
+/**
+ * camel_object_bag_add:
+ * @bag: a #CamelObjectBag
+ * @key: a reserved key
+ * @object: a #GObject
+ *
+ * Adds @object to @bag. The @key MUST have been previously reserved using
+ * camel_object_bag_reserve().
+ **/
+void
+camel_object_bag_add (CamelObjectBag *bag,
+ gconstpointer key,
+ gpointer object)
+{
+ g_return_if_fail (bag != NULL);
+ g_return_if_fail (key != NULL);
+ g_return_if_fail (G_IS_OBJECT (object));
+
+ g_mutex_lock (bag->mutex);
+
+ if (g_hash_table_lookup (bag->key_table, object) == NULL) {
+ gpointer copied_key;
+
+ copied_key = bag->key_copy_func (key);
+ g_hash_table_insert (bag->key_table, object, copied_key);
+ g_hash_table_insert (bag->object_table, copied_key, object);
+ object_bag_unreserve (bag, key);
+
+ g_object_weak_ref (
+ G_OBJECT (object), (GWeakNotify)
+ object_bag_notify, bag);
+ }
+
+ g_mutex_unlock (bag->mutex);
+}
+
+/**
+ * camel_object_bag_abort:
+ * @bag: a #CamelObjectBag
+ * @key: a reserved key
+ *
+ * Aborts a key reservation.
+ **/
+void
+camel_object_bag_abort (CamelObjectBag *bag,
+ gconstpointer key)
+{
+ g_return_if_fail (bag != NULL);
+ g_return_if_fail (key != NULL);
+
+ g_mutex_lock (bag->mutex);
+
+ object_bag_unreserve (bag, key);
+
+ g_mutex_unlock (bag->mutex);
+}
+
+/**
+ * camel_object_bag_rekey:
+ * @bag: a #CamelObjectBag
+ * @object: a #GObject
+ * @new_key: a new key for @object
+ *
+ * Changes the key for @object to @new_key, atomically.
+ *
+ * It is considered a programming error if @object is not found in @bag.
+ * In such case the function will emit a terminal warning and return.
+ **/
+void
+camel_object_bag_rekey (CamelObjectBag *bag,
+ gpointer object,
+ gconstpointer new_key)
+{
+ gpointer key;
+
+ g_return_if_fail (bag != NULL);
+ g_return_if_fail (G_IS_OBJECT (object));
+ g_return_if_fail (new_key != NULL);
+
+ g_mutex_lock (bag->mutex);
+
+ key = g_hash_table_lookup (bag->key_table, object);
+ if (key != NULL) {
+ /* Remove the old key. */
+ g_hash_table_remove (bag->object_table, key);
+ g_hash_table_remove (bag->key_table, object);
+
+ /* Insert the new key. */
+ key = bag->key_copy_func (new_key);
+ g_hash_table_insert (bag->object_table, key, object);
+ g_hash_table_insert (bag->key_table, object, key);
+ } else
+ g_warn_if_reached ();
+
+ g_mutex_unlock (bag->mutex);
+}
+
+/**
+ * camel_object_bag_list:
+ * @bag: a #CamelObjectBag
+ *
+ * Returns a #GPtrArray of all the objects in the bag. The caller owns
+ * both the array and the object references, so to free the array use:
+ *
+ * <informalexample>
+ * <programlisting>
+ * g_ptr_array_foreach (array, g_object_unref, NULL);
+ * g_ptr_array_free (array, TRUE);
+ * </programlisting>
+ * </informalexample>
+ *
+ * Returns: an array of objects in @bag
+ **/
+GPtrArray *
+camel_object_bag_list (CamelObjectBag *bag)
+{
+ GPtrArray *array;
+ GList *values;
+
+ g_return_val_if_fail (bag != NULL, NULL);
+
+ /* XXX Too bad we're not returning a GList; this would be trivial. */
+
+ array = g_ptr_array_new ();
+
+ g_mutex_lock (bag->mutex);
+
+ values = g_hash_table_get_values (bag->object_table);
+ while (values != NULL) {
+ g_ptr_array_add (array, g_object_ref (values->data));
+ values = g_list_delete_link (values, values);
+ }
+
+ g_mutex_unlock (bag->mutex);
+
+ return array;
+}
+
+/**
+ * camel_object_bag_remove:
+ * @bag: a #CamelObjectBag
+ * @object: a #GObject
+ *
+ * Removes @object from @bag.
+ **/
+void
+camel_object_bag_remove (CamelObjectBag *bag,
+ gpointer object)
+{
+ gpointer key;
+
+ g_return_if_fail (bag != NULL);
+ g_return_if_fail (G_IS_OBJECT (object));
+
+ g_mutex_lock (bag->mutex);
+
+ key = g_hash_table_lookup (bag->key_table, object);
+ if (key != NULL) {
+ object_bag_weak_unref (key, object, bag);
+ g_hash_table_remove (bag->key_table, object);
+ g_hash_table_remove (bag->object_table, key);
+ }
+
+ g_mutex_unlock (bag->mutex);
+}
+
+/**
+ * camel_object_bag_destroy:
+ * @bag: a #CamelObjectBag
+ *
+ * Frees @bag. As a precaution, the function will emit a warning to standard
+ * error and return without freeing @bag if @bag still has reserved keys.
+ **/
+void
+camel_object_bag_destroy (CamelObjectBag *bag)
+{
+ g_return_if_fail (bag != NULL);
+ g_return_if_fail (bag->reserved == NULL);
+
+ /* Drop remaining weak references. */
+ g_hash_table_foreach (
+ bag->object_table, (GHFunc)
+ object_bag_weak_unref, bag);
+
+ g_hash_table_destroy (bag->key_table);
+ g_hash_table_destroy (bag->object_table);
+ g_mutex_free (bag->mutex);
+ g_slice_free (CamelObjectBag, bag);
+}
diff --git a/camel/camel-object-bag.h b/camel/camel-object-bag.h
new file mode 100644
index 0000000..97dd4fb
--- /dev/null
+++ b/camel/camel-object-bag.h
@@ -0,0 +1,61 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008 Novell, Inc.
+ *
+ * This library 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
+ * General Public License for more details.
+ *
+ * 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 Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/* Manages bags of weakly-referenced GObjects. */
+
+#if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
+#error "Only <camel/camel.h> can be included directly."
+#endif
+
+#ifndef CAMEL_OBJECT_BAG_H
+#define CAMEL_OBJECT_BAG_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct _CamelObjectBag CamelObjectBag;
+typedef gpointer (*CamelCopyFunc) (gconstpointer object);
+
+CamelObjectBag *camel_object_bag_new (GHashFunc key_hash_func,
+ GEqualFunc key_equal_func,
+ CamelCopyFunc key_copy_func,
+ GFreeFunc key_free_func);
+gpointer camel_object_bag_get (CamelObjectBag *bag,
+ gconstpointer key);
+gpointer camel_object_bag_peek (CamelObjectBag *bag,
+ gconstpointer key);
+gpointer camel_object_bag_reserve (CamelObjectBag *bag,
+ gconstpointer key);
+void camel_object_bag_add (CamelObjectBag *bag,
+ gconstpointer key,
+ gpointer object);
+void camel_object_bag_abort (CamelObjectBag *bag,
+ gconstpointer key);
+void camel_object_bag_rekey (CamelObjectBag *bag,
+ gpointer object,
+ gconstpointer new_key);
+GPtrArray * camel_object_bag_list (CamelObjectBag *bag);
+void camel_object_bag_remove (CamelObjectBag *bag,
+ gpointer object);
+void camel_object_bag_destroy (CamelObjectBag *bag);
+
+G_END_DECLS
+
+#endif /* CAMEL_OBJECT_BAG_H */
diff --git a/camel/camel-object.c b/camel/camel-object.c
index 64d83d2..978d0a7 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -28,24 +28,16 @@
#include <stdio.h>
#include <string.h>
-#include <glib.h>
#include <glib/gstdio.h>
#include "camel-file-utils.h"
-#include "camel-list-utils.h"
#include "camel-object.h"
#define d(x)
#define b(x) /* object bag */
#define h(x) /* hooks */
-/* I just mashed the keyboard for these... */
-#define CAMEL_OBJECT_MAGIC 0x77A344ED
-#define CAMEL_OBJECT_CLASS_MAGIC 0xEE26A997
-#define CAMEL_INTERFACE_MAGIC 0xBCE137A7
-#define CAMEL_OBJECT_FINALISED_MAGIC 0x84AC365F
-#define CAMEL_OBJECT_CLASS_FINALISED_MAGIC 0x7621ABCD
-#define CAMEL_INTERFACE_FINALISED_MAGIC 0x7CB2FE71
+G_DEFINE_ABSTRACT_TYPE (CamelObject, camel_object, G_TYPE_OBJECT)
/* ** Quickie type system ************************************************* */
@@ -84,60 +76,22 @@ typedef struct _CamelHookPair
gpointer data;
} CamelHookPair;
-struct _CamelObjectBagKey {
- struct _CamelObjectBagKey *next;
-
- gpointer key; /* the key reserved */
- gint waiters; /* count of threads waiting for key */
- GThread *owner; /* the thread that has reserved the bag for a new entry */
- gint have_owner;
- GCond *cond;
-};
-
-struct _CamelObjectBag {
- GHashTable *object_table; /* object by key */
- GHashTable *key_table; /* key by object */
- GEqualFunc equal_key;
- CamelCopyFunc copy_key;
- GFreeFunc free_key;
-
- struct _CamelObjectBagKey *reserved;
-};
-
-/* used to tag a bag hookpair */
-static const gchar bag_name[] = "object:bag";
-
/* meta-data stuff */
static CamelHookPair *co_metadata_pair(CamelObject *obj, gint create);
static const gchar meta_name[] = "object:meta";
#define CAMEL_OBJECT_STATE_FILE_MAGIC "CLMD"
-/* interface stuff */
-static const gchar interface_name[] = "object:interface";
-
/* ********************************************************************** */
static CamelHookList *camel_object_get_hooks(CamelObject *o);
static void camel_object_free_hooks(CamelObject *o);
-static void camel_object_bag_remove_unlocked(CamelObjectBag *inbag, CamelObject *o, CamelHookList *hooks);
#define camel_object_unget_hooks(o) \
(g_static_rec_mutex_unlock(&CAMEL_OBJECT(o)->hooks->lock))
/* ********************************************************************** */
-/* type-lock must be recursive, for atomically creating classes */
-static GStaticRecMutex type_lock = G_STATIC_REC_MUTEX_INIT;
-/* ref-lock must be global :-( for object bags to work */
-static GMutex *ref_lock;
-
-static GHashTable *type_table;
-
-/* fundamental types are accessed via global */
-CamelType camel_object_type = CAMEL_INVALID_TYPE;
-CamelType camel_interface_type = CAMEL_INVALID_TYPE;
-
#define CLASS_LOCK(k) (g_mutex_lock((((CamelObjectClass *)k)->lock)))
#define CLASS_UNLOCK(k) (g_mutex_unlock((((CamelObjectClass *)k)->lock)))
#define REF_LOCK() (g_mutex_lock(ref_lock))
@@ -181,54 +135,21 @@ hooks_free(CamelHookList *hooks)
g_slice_free (CamelHookList, hooks);
}
-/* not checked locked, who cares, only required for people that want to redefine root objects */
-void
-camel_type_init(void)
-{
- static gint init = FALSE;
-
- if (init)
- return;
-
- init = TRUE;
- type_table = g_hash_table_new(NULL, NULL);
- ref_lock = g_mutex_new();
-}
-
/* ************************************************************************ */
/* CamelObject base methods */
-/* Should this return the object to the caller? */
-static void
-cobject_init(CamelObject *o, CamelObjectClass *klass)
-{
- o->klass = klass;
- o->magic = CAMEL_OBJECT_MAGIC;
- o->ref_count = 1;
- o->flags = 0;
-}
-
-static void
-cobject_finalize(CamelObject *o)
-{
- /*printf("%p: finalize %s\n", o, o->klass->name);*/
-
- if (o->ref_count == 0)
- return;
-
- camel_object_free_hooks(o);
-
- o->magic = CAMEL_OBJECT_FINALISED_MAGIC;
- o->klass = NULL;
-}
-
static gint
-cobject_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
+cobject_getv (CamelObject *o,
+ CamelException *ex,
+ CamelArgGetV *args)
{
+ CamelObjectClass *class;
gint i;
guint32 tag;
+ class = CAMEL_OBJECT_GET_CLASS (o);
+
for (i=0;i<args->argc;i++) {
CamelArgGet *arg = &args->argv[i];
@@ -236,7 +157,7 @@ cobject_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
switch (tag & CAMEL_ARG_TAG) {
case CAMEL_OBJECT_ARG_DESCRIPTION:
- *arg->ca_str = (gchar *)o->klass->name;
+ *arg->ca_str = (gchar *) G_OBJECT_CLASS_NAME (class);
break;
case CAMEL_OBJECT_ARG_STATE_FILE: {
CamelHookPair *pair = co_metadata_pair(o, FALSE);
@@ -254,7 +175,9 @@ cobject_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
}
static gint
-cobject_setv(CamelObject *o, CamelException *ex, CamelArgV *args)
+cobject_setv (CamelObject *o,
+ CamelException *ex,
+ CamelArgV *args)
{
gint i;
guint32 tag;
@@ -474,453 +397,53 @@ abort:
}
static void
-cobject_class_init(CamelObjectClass *klass)
+object_dispose (GObject *object)
{
- klass->magic = CAMEL_OBJECT_CLASS_MAGIC;
-
- klass->getv = cobject_getv;
- klass->setv = cobject_setv;
- klass->free = cobject_free;
-
- klass->state_read = cobject_state_read;
- klass->state_write = cobject_state_write;
-
- camel_object_class_add_event(klass, "finalize", NULL);
-}
+ CamelObject *camel_object = CAMEL_OBJECT (object);
-static void
-cobject_class_finalize(CamelObjectClass * klass)
-{
- klass->magic = CAMEL_OBJECT_CLASS_FINALISED_MAGIC;
-
- g_free(klass);
-}
-
-/* this function must be called for any other in the object system */
-CamelType
-camel_object_get_type(void)
-{
- if (camel_object_type == CAMEL_INVALID_TYPE) {
- camel_type_init();
-
- camel_object_type = camel_type_register(NULL, "CamelObject", /*, 0, 0*/
- sizeof(CamelObject), sizeof(CamelObjectClass),
- cobject_class_init, cobject_class_finalize,
- cobject_init, cobject_finalize);
+ if (camel_object->hooks != NULL) {
+ camel_object_trigger_event (object, "finalize", NULL);
+ camel_object_free_hooks (camel_object);
}
- return camel_object_type;
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_object_parent_class)->dispose (object);
}
static void
-camel_type_class_init(CamelObjectClass *klass, CamelObjectClass *type)
-{
- if (type->parent)
- camel_type_class_init(klass, type->parent);
-
- if (type->klass_init)
- type->klass_init(klass);
-}
-
-static CamelType
-co_type_register(CamelType parent, const gchar * name,
- /*guint ver, guint rev,*/
- gsize object_size, gsize klass_size,
- CamelObjectClassInitFunc class_init,
- CamelObjectClassFinalizeFunc class_finalize,
- CamelObjectInitFunc object_init,
- CamelObjectFinalizeFunc object_finalize)
+camel_object_class_init (CamelObjectClass *class)
{
- CamelObjectClass *klass;
- /*int offset;
- gsize size;*/
-
- TYPE_LOCK();
-
- camel_type_init(); /* has a static boolean itself */
-
- /* Have to check creation, it might've happened in another thread before we got here */
- klass = g_hash_table_lookup(type_table, name);
- if (klass != NULL) {
- if (klass->klass_size != klass_size || klass->object_size != object_size
- || klass->klass_init != class_init || klass->klass_finalize != class_finalize
- || klass->init != object_init || klass->finalize != object_finalize) {
- g_warning("camel_type_register: Trying to re-register class '%s'", name);
- klass = NULL;
- }
- TYPE_UNLOCK();
- return klass;
- }
-
- /* this is for objects with no parent as part of their struct ('interfaces'?) */
- /*offset = parent?parent->klass_size:0;
- offset = (offset + 3) & (~3);
-
- size = offset + klass_size;
+ GObjectClass *object_class;
- klass = g_slice_alloc0(size);
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = object_dispose;
- klass->klass_size = size;
- klass->klass_data = offset;
+ class->hooks = NULL;
- offset = parent?parent->object_size:0;
- offset = (offset + 3) & (~3);
+ class->getv = cobject_getv;
+ class->setv = cobject_setv;
+ class->free = cobject_free;
- klass->object_size = offset + object_size;
- klass->object_data = offset;*/
-
- if (parent
- && klass_size < parent->klass_size) {
- g_warning("camel_type_register: '%s' has smaller class size than parent '%s'", name, parent->name);
- TYPE_UNLOCK();
- return NULL;
- }
+ class->state_read = cobject_state_read;
+ class->state_write = cobject_state_write;
- klass = g_slice_alloc0 (klass_size);
- klass->klass_size = klass_size;
- klass->object_size = object_size;
- klass->lock = g_mutex_new();
- klass->hooks = NULL;
-
- klass->parent = parent;
- if (parent) {
- klass->next = parent->child;
- parent->child = klass;
- }
- klass->name = name;
-
- /*klass->version = ver;
- klass->revision = rev;*/
-
- klass->klass_init = class_init;
- klass->klass_finalize = class_finalize;
-
- klass->init = object_init;
- klass->finalize = object_finalize;
-
- /* setup before class init, incase class init func uses the type or looks it up ? */
- g_hash_table_insert(type_table, (gpointer)name, klass);
-
- camel_type_class_init(klass, klass);
-
- TYPE_UNLOCK();
-
- return klass;
-}
-
-CamelType
-camel_type_register(CamelType parent, const gchar * name,
- /*guint ver, guint rev,*/
- gsize object_size, gsize klass_size,
- CamelObjectClassInitFunc class_init,
- CamelObjectClassFinalizeFunc class_finalize,
- CamelObjectInitFunc object_init,
- CamelObjectFinalizeFunc object_finalize)
-{
- if (parent != NULL && parent->magic != CAMEL_OBJECT_CLASS_MAGIC) {
- g_warning("camel_type_register: invalid junk parent class for '%s'", name);
- return NULL;
- }
-
- return co_type_register(parent, name, object_size, klass_size, class_init, class_finalize, object_init, object_finalize);
+ camel_object_class_add_event (class, "finalize", NULL);
}
static void
-camel_object_init(CamelObject *o, CamelObjectClass *klass, CamelType type)
-{
- if (type->parent)
- camel_object_init(o, klass, type->parent);
-
- if (type->init)
- type->init(o, klass);
-}
-
-CamelObject *
-camel_object_new(CamelType type)
-{
- CamelObject *o;
-
- if (type == NULL)
- return NULL;
-
- if (type->magic != CAMEL_OBJECT_CLASS_MAGIC)
- return NULL;
-
- CLASS_LOCK(type);
-
- o = g_slice_alloc0 (type->object_size);
-
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- if (type->instances)
- type->instances->prev = o;
- o->next = type->instances;
- o->prev = NULL;
- type->instances = o;
-#endif
-
- CLASS_UNLOCK(type);
-
- camel_object_init(o, type, type);
-
- d(printf("%p: new %s()\n", o, o->klass->name));
-
- return o;
-}
-
-gpointer
-camel_object_ref (gpointer vo)
-{
- register CamelObject *o = vo;
-
- g_return_val_if_fail (CAMEL_IS_OBJECT (o), NULL);
-
- REF_LOCK();
-
- o->ref_count++;
- d(printf("%p: ref %s(%d)\n", o, o->klass->name, o->ref_count));
-
- REF_UNLOCK();
-
- return vo;
-}
-
-void
-camel_object_unref (gpointer vo)
-{
- register CamelObject *o = vo;
- register CamelObjectClass *klass, *k;
- CamelHookList *hooks = NULL;
-
- g_return_if_fail(CAMEL_IS_OBJECT(o));
-
- klass = o->klass;
-
- if (o->hooks)
- hooks = camel_object_get_hooks(o);
-
- REF_LOCK();
-
- o->ref_count--;
-
- d(printf("%p: unref %s(%d)\n", o, o->klass->name, o->ref_count));
-
- if (o->ref_count > 0
- || (o->flags & CAMEL_OBJECT_DESTROY)) {
- REF_UNLOCK();
- if (hooks)
- camel_object_unget_hooks(o);
- return;
- }
-
- o->flags |= CAMEL_OBJECT_DESTROY;
-
- if (hooks)
- camel_object_bag_remove_unlocked(NULL, o, hooks);
-
- REF_UNLOCK();
-
- if (hooks)
- camel_object_unget_hooks(o);
-
- camel_object_trigger_event(o, "finalize", NULL);
-
- k = klass;
- while (k) {
- if (k->finalize)
- k->finalize(o);
- k = k->parent;
- }
-
- o->magic = CAMEL_OBJECT_FINALISED_MAGIC;
-
- CLASS_LOCK(klass);
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- if (o->prev)
- o->prev->next = o->next;
- else
- klass->instances = o->next;
- if (o->next)
- o->next->prev = o->prev;
-#endif
- g_slice_free1 (klass->object_size, o);
- CLASS_UNLOCK(klass);
-}
-
-const gchar *
-camel_type_to_name(CamelType type)
-{
- if (type == NULL)
- return "(NULL class)";
-
- if (type->magic == CAMEL_OBJECT_CLASS_MAGIC)
- return type->name;
-
- if (type->magic == CAMEL_INTERFACE_MAGIC)
- return type->name;
-
- return "(Junk class)";
-}
-
-CamelType camel_name_to_type(const gchar *name)
-{
- /* TODO: Load a class off disk (!) */
-
- return g_hash_table_lookup(type_table, name);
-}
-
-static gchar *
-desc_data(CamelObject *o, guint32 ok)
+camel_object_init (CamelObject *object)
{
- gchar *what;
-
- if (o == NULL)
- what = g_strdup("NULL OBJECT");
- else if (o->magic == ok)
- what = NULL;
- else if (o->magic == CAMEL_OBJECT_MAGIC)
- what = g_strdup_printf("CLASS '%s'", ((CamelObjectClass *)o)->name);
- else if (o->magic == CAMEL_OBJECT_CLASS_MAGIC)
- what = g_strdup_printf("CLASS '%s'", ((CamelObjectClass *)o)->name);
- else if (o->magic == CAMEL_INTERFACE_MAGIC)
- what = g_strdup_printf("INTERFACE '%s'", ((CamelObjectClass *)o)->name);
- else if (o->magic == CAMEL_OBJECT_FINALISED_MAGIC)
- what = g_strdup_printf("finalized OBJECT");
- else if (o->magic == CAMEL_OBJECT_CLASS_FINALISED_MAGIC)
- what = g_strdup_printf("finalized CLASS");
- else if (o->magic == CAMEL_INTERFACE_FINALISED_MAGIC)
- what = g_strdup_printf("finalized INTERFACE");
- else
- what = g_strdup_printf("junk data");
-
- return what;
-}
-
-#define check_magic(o, ctype, omagic) \
- ( ((CamelObject *)(o))->magic == (omagic) \
- && (ctype)->magic == CAMEL_OBJECT_CLASS_MAGIC) \
- ? 1 : check_magic_fail(o, ctype, omagic)
-
-static gboolean
-check_magic_fail(gpointer o, CamelType ctype, guint32 omagic)
-{
- gchar *what, *to;
-
- what = desc_data(o, omagic);
- to = desc_data((CamelObject *)ctype, CAMEL_OBJECT_CLASS_MAGIC);
-
- if (what || to) {
- if (what == NULL) {
- if (omagic == CAMEL_OBJECT_MAGIC)
- 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);
- g_free(what);
- g_free(to);
-
- return FALSE;
- }
-
- return TRUE;
-}
-
-gboolean
-camel_object_is(CamelObject *o, CamelType ctype)
-{
- CamelObjectClass *k;
-
- g_return_val_if_fail(o != NULL, FALSE);
- g_return_val_if_fail(check_magic(o, ctype, CAMEL_OBJECT_MAGIC), FALSE);
-
- k = o->klass;
- while (k) {
- if (k == ctype)
- return TRUE;
- k = k->parent;
- }
-
- return FALSE;
-}
-
-gboolean
-camel_object_class_is(CamelObjectClass *k, CamelType ctype)
-{
- g_return_val_if_fail(k != NULL, FALSE);
- g_return_val_if_fail(check_magic(k, ctype, CAMEL_OBJECT_CLASS_MAGIC), FALSE);
-
- while (k) {
- if (k == ctype)
- return TRUE;
- k = k->parent;
- }
-
- return FALSE;
-}
-
-CamelObject *
-camel_object_cast(CamelObject *o, CamelType ctype)
-{
- CamelObjectClass *k;
-
- g_return_val_if_fail(o != NULL, NULL);
- g_return_val_if_fail(check_magic(o, ctype, CAMEL_OBJECT_MAGIC), NULL);
-
- k = o->klass;
- while (k) {
- if (k == ctype)
- return o;
- k = k->parent;
- }
-
- g_warning("Object %p (class '%s') doesn't have '%s' in its hierarchy", (gpointer) o, o->klass->name, ctype->name);
-
- return NULL;
-}
-
-CamelObjectClass *
-camel_object_class_cast(CamelObjectClass *k, CamelType ctype)
-{
- CamelObjectClass *r = k;
-
- g_return_val_if_fail(check_magic(k, ctype, CAMEL_OBJECT_CLASS_MAGIC), NULL);
-
- while (k) {
- if (k == ctype)
- return r;
- k = k->parent;
- }
-
- g_warning("Class '%s' doesn't have '%s' in its hierarchy", r->name, ctype->name);
-
- return NULL;
-}
-
-static CamelHookPair *
-co_find_pair(CamelObjectClass *klass, const gchar *name)
-{
- CamelHookPair *hook;
-
- hook = klass->hooks;
- while (hook) {
- if (strcmp(hook->name, name) == 0)
- return hook;
- hook = hook->next;
- }
-
- return NULL;
}
static CamelHookPair *
-co_find_pair_ptr(CamelObjectClass *klass, const gchar *name)
+co_find_pair (CamelObjectClass *class,
+ const gchar *name)
{
CamelHookPair *hook;
- hook = klass->hooks;
+ hook = class->hooks;
while (hook) {
- if (hook->name == name)
+ if (strcmp (hook->name, name) == 0)
return hook;
hook = hook->next;
}
@@ -930,55 +453,51 @@ co_find_pair_ptr(CamelObjectClass *klass, const gchar *name)
/* class functions */
void
-camel_object_class_add_event(CamelObjectClass *klass, const gchar *name, CamelObjectEventPrepFunc prep)
+camel_object_class_add_event (CamelObjectClass *class,
+ const gchar *name,
+ CamelObjectEventPrepFunc prep)
{
CamelHookPair *pair;
g_return_if_fail (name);
- pair = co_find_pair(klass, name);
+ pair = co_find_pair (class, name);
if (pair) {
- g_warning("camel_object_class_add_event: '%s' is already declared for '%s'",
- name, klass->name);
+ g_warning ("%s: '%s' is already declared for '%s'",
+ G_STRFUNC, name, G_OBJECT_CLASS_NAME (class));
return;
}
- if (klass->magic == CAMEL_INTERFACE_MAGIC && prep != NULL) {
- g_warning("camel_object_class_add_event: '%s', CamelInterface '%s' may not have an event prep function - ignored",
- name, klass->name);
- prep = NULL;
- }
-
- pair = pair_alloc();
+ pair = pair_alloc ();
pair->name = name;
pair->func.prep = prep;
pair->flags = 0;
- pair->next = klass->hooks;
- klass->hooks = pair;
+ pair->next = class->hooks;
+ class->hooks = pair;
}
/* free hook data */
static void
camel_object_free_hooks(CamelObject *o)
{
- CamelHookPair *pair, *next;
+ CamelHookPair *pair, *next;
- if (o->hooks) {
- g_assert(o->hooks->depth == 0);
- g_assert((o->hooks->flags & CAMEL_HOOK_PAIR_REMOVED) == 0);
+ if (o->hooks) {
+ g_assert(o->hooks->depth == 0);
+ g_assert((o->hooks->flags & CAMEL_HOOK_PAIR_REMOVED) == 0);
- pair = o->hooks->list;
- while (pair) {
- next = pair->next;
+ pair = o->hooks->list;
+ while (pair) {
+ next = pair->next;
- pair_free(pair);
- pair = next;
- }
- g_static_rec_mutex_free(&o->hooks->lock);
- hooks_free(o->hooks);
- o->hooks = NULL;
- }
+ pair_free(pair);
+ pair = next;
+ }
+ g_static_rec_mutex_free(&o->hooks->lock);
+ hooks_free(o->hooks);
+ o->hooks = NULL;
+ }
}
/* return (allocate if required) the object's hook list, locking at the same time */
@@ -1010,9 +529,13 @@ camel_object_get_hooks(CamelObject *o)
}
guint
-camel_object_hook_event(gpointer vo, const gchar * name, CamelObjectEventHookFunc func, gpointer data)
+camel_object_hook_event (gpointer vo,
+ const gchar *name,
+ CamelObjectEventHookFunc func,
+ gpointer data)
{
CamelObject *obj = vo;
+ CamelObjectClass *class;
CamelHookPair *pair, *hook;
CamelHookList *hooks;
gint id;
@@ -1021,28 +544,18 @@ camel_object_hook_event(gpointer vo, const gchar * name, CamelObjectEventHookFun
g_return_val_if_fail(name != NULL, 0);
g_return_val_if_fail(func != NULL, 0);
- hook = co_find_pair(obj->klass, name);
+ class = CAMEL_OBJECT_GET_CLASS (obj);
+
+ hook = co_find_pair(class, name);
/* Check all interfaces on this object for events defined on them */
if (hook == NULL) {
- pair = co_find_pair_ptr(obj->klass, interface_name);
- if (pair) {
- GPtrArray *interfaces = pair->data;
- gint i;
-
- for (i=0;i<interfaces->len;i++) {
- hook = co_find_pair(interfaces->pdata[i], name);
- if (hook)
- goto setup;
- }
- }
-
g_warning("camel_object_hook_event: trying to hook event '%s' in class '%s' with no defined events.",
- name, obj->klass->name);
+ name, G_OBJECT_CLASS_NAME (class));
return 0;
}
-setup:
+
/* setup hook pair */
pair = pair_alloc();
pair->name = hook->name; /* effectively static! */
@@ -1064,7 +577,8 @@ setup:
}
void
-camel_object_remove_event(gpointer vo, guint id)
+camel_object_remove_event (gpointer vo,
+ guint id)
{
CamelObject *obj = vo;
CamelHookList *hooks;
@@ -1075,7 +589,7 @@ camel_object_remove_event(gpointer vo, guint id)
if (obj->hooks == NULL) {
g_warning("camel_object_unhook_event: trying to unhook '%u' from an instance of '%s' with no hooks",
- id, obj->klass->name);
+ id, G_OBJECT_TYPE_NAME (obj));
return;
}
@@ -1105,11 +619,14 @@ camel_object_remove_event(gpointer vo, guint id)
camel_object_unget_hooks(obj);
g_warning("camel_object_unhook_event: cannot find hook id %u in instance of '%s'",
- id, obj->klass->name);
+ id, G_OBJECT_TYPE_NAME (obj));
}
void
-camel_object_unhook_event(gpointer vo, const gchar * name, CamelObjectEventHookFunc func, gpointer data)
+camel_object_unhook_event (gpointer vo,
+ const gchar *name,
+ CamelObjectEventHookFunc func,
+ gpointer data)
{
CamelObject *obj = vo;
CamelHookList *hooks;
@@ -1121,7 +638,7 @@ camel_object_unhook_event(gpointer vo, const gchar * name, CamelObjectEventHookF
if (obj->hooks == NULL) {
g_warning("camel_object_unhook_event: trying to unhook '%s' from an instance of '%s' with no hooks",
- name, obj->klass->name);
+ name, G_OBJECT_TYPE_NAME (obj));
return;
}
@@ -1153,13 +670,16 @@ camel_object_unhook_event(gpointer vo, const gchar * name, CamelObjectEventHookF
camel_object_unget_hooks(obj);
g_warning("camel_object_unhook_event: cannot find hook/data pair %p/%p in an instance of '%s' attached to '%s'",
- (gpointer) func, data, obj->klass->name, name);
+ (gpointer) func, data, G_OBJECT_TYPE_NAME (obj), name);
}
void
-camel_object_trigger_event(gpointer vo, const gchar * name, gpointer event_data)
+camel_object_trigger_event (gpointer vo,
+ const gchar *name,
+ gpointer event_data)
{
CamelObject *obj = vo;
+ CamelObjectClass *class;
CamelHookList *hooks;
CamelHookPair *pair, **pairs, *parent, *hook;
gint i, size;
@@ -1168,27 +688,17 @@ camel_object_trigger_event(gpointer vo, const gchar * name, gpointer event_data)
g_return_if_fail (CAMEL_IS_OBJECT (obj));
g_return_if_fail (name);
- hook = co_find_pair(obj->klass, name);
+ class = CAMEL_OBJECT_GET_CLASS (obj);
+
+ hook = co_find_pair(class, name);
if (hook)
goto trigger;
if (obj->hooks == NULL)
return;
- /* interface events can't have prep functions */
- 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)
- goto trigger_interface;
- }
- }
-
g_warning("camel_object_trigger_event: trying to trigger unknown event '%s' in class '%s'",
- name, obj->klass->name);
+ name, G_OBJECT_TYPE_NAME (obj));
return;
@@ -1201,9 +711,8 @@ trigger:
if (obj->hooks == NULL)
return;
-trigger_interface:
/* lock the object for hook emission */
- camel_object_ref (obj);
+ g_object_ref(obj);
hooks = camel_object_get_hooks(obj);
if (hooks->list) {
@@ -1246,64 +755,92 @@ trigger_interface:
}
camel_object_unget_hooks(obj);
- camel_object_unref (obj);
+ g_object_unref(obj);
}
/* get/set arg methods */
-gint camel_object_set(gpointer vo, CamelException *ex, ...)
+gint
+camel_object_set (gpointer vo,
+ CamelException *ex,
+ ...)
{
+ CamelObjectClass *class;
CamelArgV args;
CamelObject *o = vo;
- CamelObjectClass *klass = o->klass;
gint ret = 0;
g_return_val_if_fail(CAMEL_IS_OBJECT(o), -1);
camel_argv_start(&args, ex);
+ class = CAMEL_OBJECT_GET_CLASS (o);
+ g_return_val_if_fail (class->setv != NULL, -1);
+
while (camel_argv_build(&args) && ret == 0)
- ret = klass->setv(o, ex, &args);
+ ret = class->setv(o, ex, &args);
if (ret == 0)
- ret = klass->setv(o, ex, &args);
+ ret = class->setv(o, ex, &args);
camel_argv_end(&args);
return ret;
}
-gint camel_object_setv(gpointer vo, CamelException *ex, CamelArgV *args)
+gint
+camel_object_setv (gpointer vo,
+ CamelException *ex,
+ CamelArgV *args)
{
+ CamelObjectClass *class;
+
g_return_val_if_fail(CAMEL_IS_OBJECT(vo), -1);
- return ((CamelObject *)vo)->klass->setv(vo, ex, args);
+ class = CAMEL_OBJECT_GET_CLASS (vo);
+ g_return_val_if_fail (class->setv != NULL, -1);
+
+ return class->setv (vo, ex, args);
}
-gint camel_object_get(gpointer vo, CamelException *ex, ...)
+gint
+camel_object_get (gpointer vo,
+ CamelException *ex,
+ ...)
{
+ CamelObjectClass *class;
CamelObject *o = vo;
CamelArgGetV args;
- CamelObjectClass *klass = o->klass;
gint ret = 0;
g_return_val_if_fail(CAMEL_IS_OBJECT(o), -1);
camel_argv_start(&args, ex);
+ class = CAMEL_OBJECT_GET_CLASS (o);
+ g_return_val_if_fail (class->getv != NULL, -1);
+
while (camel_arggetv_build(&args) && ret == 0)
- ret = klass->getv(o, ex, &args);
+ ret = class->getv(o, ex, &args);
if (ret == 0)
- ret = klass->getv(o, ex, &args);
+ ret = class->getv(o, ex, &args);
camel_argv_end(&args);
return ret;
}
-gint camel_object_getv(gpointer vo, CamelException *ex, CamelArgGetV *args)
+gint
+camel_object_getv (gpointer vo,
+ CamelException *ex,
+ CamelArgGetV *args)
{
+ CamelObjectClass *class;
+
g_return_val_if_fail(CAMEL_IS_OBJECT(vo), -1);
- return ((CamelObject *)vo)->klass->getv(vo, ex, args);
+ class = CAMEL_OBJECT_GET_CLASS (vo);
+ g_return_val_if_fail (class->getv != NULL, -1);
+
+ return class->getv (vo, ex, args);
}
/* NB: If this doesn't return NULL, then you must unget_hooks when done */
@@ -1365,7 +902,7 @@ gint camel_object_state_read(gpointer vo)
if (fp != NULL) {
if (fread(magic, 4, 1, fp) == 1
&& memcmp(magic, CAMEL_OBJECT_STATE_FILE_MAGIC, 4) == 0)
- res = obj->klass->state_read(obj, fp);
+ res = CAMEL_OBJECT_GET_CLASS (obj)->state_read(obj, fp);
else
res = -1;
fclose(fp);
@@ -1402,7 +939,7 @@ gint camel_object_state_write(gpointer vo)
fp = g_fopen(savename, "wb");
if (fp != NULL) {
if (fwrite(CAMEL_OBJECT_STATE_FILE_MAGIC, 4, 1, fp) == 1
- && obj->klass->state_write(obj, fp) == 0) {
+ && CAMEL_OBJECT_GET_CLASS (obj)->state_write(obj, fp) == 0) {
if (fclose(fp) == 0) {
res = 0;
g_rename(savename, file);
@@ -1441,487 +978,5 @@ void camel_object_free(gpointer vo, guint32 tag, gpointer value)
This would also let us copy and do other things with args
we can't do, but i can't see a use for that yet ... */
- ((CamelObject *)vo)->klass->free(vo, tag, value);
-}
-
-static void
-object_class_dump_tree_rec(CamelType root, gint depth)
-{
- gchar *p;
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- struct _CamelObject *o;
-#endif
-
- p = alloca(depth*2+1);
- memset(p, ' ', depth*2);
- p[depth*2] = 0;
-
- while (root) {
- CLASS_LOCK(root);
- printf("%sClass: %s\n", p, root->name);
- /*printf("%sVersion: %u.%u\n", p, root->version, root->revision);*/
- if (root->hooks) {
- CamelHookPair *pair = root->hooks;
-
- while (pair) {
- printf("%s event '%s' prep %p\n", p, pair->name, (gpointer) pair->func.prep);
- pair = pair->next;
- }
- }
-
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- o = root->instances;
- while (o) {
- printf("%s instance %p [%d]\n", p, (gpointer) o, o->ref_count);
- /* todo: should lock hooks while it scans them */
- if (o->hooks) {
- CamelHookPair *pair = o->hooks->list;
-
- while (pair) {
- printf("%s hook '%s' func %p data %p\n", p, pair->name, (gpointer) pair->func.event, (gpointer) pair->data);
- pair = pair->next;
- }
- }
- o = o->next;
- }
-#endif
- CLASS_UNLOCK(root);
-
- if (root->child)
- object_class_dump_tree_rec(root->child, depth+1);
-
- root = root->next;
- }
-}
-
-void
-camel_object_class_dump_tree(CamelType root)
-{
- object_class_dump_tree_rec(root, 0);
-}
-
-/**
- * camel_object_bag_new:
- * @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.
- *
- * Returns:
- **/
-CamelObjectBag *
-camel_object_bag_new(GHashFunc hash, GEqualFunc equal, CamelCopyFunc keycopy, GFreeFunc keyfree)
-{
- CamelObjectBag *bag;
-
- bag = g_malloc(sizeof(*bag));
- bag->object_table = g_hash_table_new(hash, equal);
- bag->equal_key = equal;
- bag->copy_key = keycopy;
- bag->free_key = keyfree;
- bag->key_table = g_hash_table_new(NULL, NULL);
- bag->reserved = NULL;
-
- return bag;
-}
-
-static void
-save_object(gpointer key, CamelObject *o, GPtrArray *objects)
-{
- g_ptr_array_add(objects, o);
-}
-
-void
-camel_object_bag_destroy(CamelObjectBag *bag)
-{
- GPtrArray *objects = g_ptr_array_new();
- gint i;
-
- g_assert(bag->reserved == NULL);
-
- 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);
- g_free(bag);
-}
-
-/* must be called with ref_lock held */
-static void
-co_bag_unreserve(CamelObjectBag *bag, gconstpointer key)
-{
- struct _CamelObjectBagKey *res, *resp;
-
- resp = (struct _CamelObjectBagKey *)&bag->reserved;
- res = resp->next;
- while (res) {
- if (bag->equal_key(res->key, key))
- break;
- resp = res;
- res = res->next;
- }
-
- g_assert(res != NULL);
- g_assert(res->have_owner && res->owner == g_thread_self ());
-
- if (res->waiters > 0) {
- b(printf("unreserve bag '%s', waking waiters\n", (gchar *)key));
- res->have_owner = FALSE;
- g_cond_signal(res->cond);
- } else {
- b(printf("unreserve bag '%s', no waiters, freeing reservation\n", (gchar *)key));
- resp->next = res->next;
- bag->free_key(res->key);
- g_cond_free(res->cond);
- g_free(res);
- }
-}
-
-/**
- * camel_object_bag_add:
- * @bag:
- * @key:
- * @vo:
- *
- * Add an object @vo to the object bag @bag. The @key MUST have
- * previously been reserved using camel_object_bag_reserve().
- **/
-void
-camel_object_bag_add(CamelObjectBag *bag, gconstpointer key, gpointer vo)
-{
- CamelObject *o = vo;
- CamelHookList *hooks;
- CamelHookPair *pair;
- gpointer k;
-
- hooks = camel_object_get_hooks(o);
- REF_LOCK();
-
- pair = hooks->list;
- while (pair) {
- if (pair->name == bag_name && pair->data == bag) {
- REF_UNLOCK();
- camel_object_unget_hooks(o);
- return;
- }
- pair = pair->next;
- }
-
- pair = pair_alloc();
- pair->name = bag_name;
- pair->data = bag;
- pair->flags = 0;
- pair->func.event = NULL;
-
- pair->next = hooks->list;
- hooks->list = pair;
- hooks->list_length++;
-
- k = bag->copy_key(key);
- g_hash_table_insert(bag->object_table, k, 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:
- *
- * Lookup an object by @key. If the key is currently reserved, then
- * wait until the key has been committed before continuing.
- *
- * Returns: 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.
- **/
-gpointer
-camel_object_bag_get(CamelObjectBag *bag, gconstpointer key)
-{
- CamelObject *o;
-
- REF_LOCK();
-
- o = g_hash_table_lookup(bag->object_table, key);
- if (o) {
- b(printf("object bag get '%s' = %p\n", (gchar *)key, o));
-
- /* we use the same lock as the refcount */
- o->ref_count++;
- } else {
- struct _CamelObjectBagKey *res = bag->reserved;
-
- /* check if this name is reserved currently, if so wait till its finished */
- while (res) {
- if (bag->equal_key(res->key, key))
- break;
- res = res->next;
- }
-
- if (res) {
- b(printf("object bag get '%s', reserved, waiting\n", (gchar *)key));
-
- res->waiters++;
- g_assert(!res->have_owner || res->owner != g_thread_self ());
- g_cond_wait(res->cond, ref_lock);
- res->waiters--;
-
- /* re-check if it slipped in */
- o = g_hash_table_lookup(bag->object_table, key);
- if (o)
- o->ref_count++;
-
- b(printf("object bag get '%s', finished waiting, got %p\n", (gchar *)key, o));
-
- /* we don't actually reserve it */
- res->owner = g_thread_self ();
- res->have_owner = TRUE;
- co_bag_unreserve(bag, key);
- }
- }
-
- REF_UNLOCK();
-
- return o;
-}
-
-/**
- * camel_object_bag_peek:
- * @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.
- *
- * Returns: A referenced object, or NULL if @key is not
- * present in the bag.
- **/
-gpointer
-camel_object_bag_peek(CamelObjectBag *bag, gconstpointer key)
-{
- CamelObject *o;
-
- REF_LOCK();
-
- o = g_hash_table_lookup(bag->object_table, key);
- if (o) {
- /* we use the same lock as the refcount */
- o->ref_count++;
- }
-
- REF_UNLOCK();
-
- return o;
-}
-
-/**
- * camel_object_bag_reserve:
- * @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.
- *
- * After reserving a key, you either get a reffed pointer to the
- * object corresponding to the key, similar to object_bag_get, or you
- * get NULL, signifying that you then MIST call either object_bag_add
- * or object_bag_abort.
- *
- * You may reserve multiple keys from the same thread, but they should
- * always be reserved in the same order, to avoid deadlocks.
- *
- * Returns:
- **/
-gpointer
-camel_object_bag_reserve(CamelObjectBag *bag, gconstpointer key)
-{
- CamelObject *o;
-
- REF_LOCK();
-
- o = g_hash_table_lookup(bag->object_table, key);
- if (o) {
- o->ref_count++;
- } else {
- struct _CamelObjectBagKey *res = bag->reserved;
-
- while (res) {
- if (bag->equal_key(res->key, key))
- break;
- res = res->next;
- }
-
- if (res) {
- b(printf("bag reserve %s, already reserved, waiting\n", (gchar *)key));
- g_assert(!res->have_owner || res->owner != g_thread_self ());
- res->waiters++;
- g_cond_wait(res->cond, ref_lock);
- res->waiters--;
- /* incase its slipped in while we were waiting */
- o = g_hash_table_lookup(bag->object_table, key);
- if (o) {
- b(printf("finished wait, someone else created '%s' = %p\n", (gchar *)key, o));
- o->ref_count++;
- /* in which case we dont need to reserve the bag either */
- res->owner = g_thread_self ();
- res->have_owner = TRUE;
- co_bag_unreserve(bag, key);
- } else {
- b(printf("finished wait, now owner of '%s'\n", (gchar *)key));
- res->owner = g_thread_self ();
- res->have_owner = TRUE;
- }
- } else {
- b(printf("bag reserve %s, no key, reserving\n", (gchar *)key));
- res = g_malloc(sizeof(*res));
- res->waiters = 0;
- res->key = bag->copy_key(key);
- res->cond = g_cond_new();
- res->owner = g_thread_self ();
- res->have_owner = TRUE;
- res->next = bag->reserved;
- bag->reserved = res;
- }
- }
-
- REF_UNLOCK();
-
- return o;
-}
-
-/**
- * camel_object_bag_abort:
- * @bag:
- * @key:
- *
- * Abort a key reservation.
- **/
-void
-camel_object_bag_abort(CamelObjectBag *bag, gconstpointer key)
-{
- REF_LOCK();
-
- co_bag_unreserve(bag, key);
-
- REF_UNLOCK();
-}
-
-/**
- * camel_object_bag_rekey:
- * @bag:
- * @o:
- * @newkey:
- *
- * Re-key an object, atomically. The key for object @o is set to
- * @newkey, in an atomic manner.
- *
- * It is an api (fatal) error if @o is not currently in the bag.
- **/
-void
-camel_object_bag_rekey(CamelObjectBag *bag, gpointer o, gconstpointer newkey)
-{
- gpointer oldkey;
-
- REF_LOCK();
-
- if (g_hash_table_lookup_extended(bag->key_table, o, NULL, &oldkey)) {
- g_hash_table_remove(bag->object_table, oldkey);
- g_hash_table_remove(bag->key_table, o);
- bag->free_key(oldkey);
- oldkey = bag->copy_key(newkey);
- g_hash_table_insert(bag->object_table, oldkey, o);
- g_hash_table_insert(bag->key_table, o, oldkey);
- } else {
- abort();
- }
-
- REF_UNLOCK();
-}
-
-static void
-save_bag(gpointer key, CamelObject *o, GPtrArray *list)
-{
- /* we have the refcount lock already */
- o->ref_count++;
- g_ptr_array_add(list, o);
-}
-
-/* get a list of all objects in the bag, ref'd
- ignores any reserved keys */
-GPtrArray *
-camel_object_bag_list(CamelObjectBag *bag)
-{
- GPtrArray *list;
-
- list = g_ptr_array_new();
-
- REF_LOCK();
- g_hash_table_foreach(bag->object_table, (GHFunc)save_bag, list);
- REF_UNLOCK();
-
- return list;
-}
-
-/* if bag is NULL, remove all bags from object */
-static void
-camel_object_bag_remove_unlocked(CamelObjectBag *inbag, CamelObject *o, CamelHookList *hooks)
-{
- CamelHookPair *pair, *parent;
- gpointer oldkey;
- CamelObjectBag *bag;
-
- parent = (CamelHookPair *)&hooks->list;
- pair = parent->next;
- while (pair) {
- if (pair->name == bag_name
- && (inbag == NULL || inbag == pair->data)) {
- bag = pair->data;
- /* lookup object in table? */
- oldkey = g_hash_table_lookup(bag->key_table, o);
- if (oldkey) {
- g_hash_table_remove(bag->key_table, o);
- g_hash_table_remove(bag->object_table, oldkey);
- bag->free_key(oldkey);
- }
- parent->next = pair->next;
- pair_free(pair);
- hooks->list_length--;
- } else {
- parent = pair;
- }
- pair = parent->next;
- }
-}
-
-void
-camel_object_bag_remove(CamelObjectBag *inbag, gpointer vo)
-{
- CamelObject *o = vo;
- CamelHookList *hooks;
-
- if (o->hooks == NULL)
- return;
-
- hooks = camel_object_get_hooks(o);
- REF_LOCK();
-
- camel_object_bag_remove_unlocked(inbag, o, hooks);
-
- REF_UNLOCK();
- camel_object_unget_hooks(o);
+ CAMEL_OBJECT_GET_CLASS (vo)->free (vo, tag, value);
}
diff --git a/camel/camel-object.h b/camel/camel-object.h
index e2e3f83..30eb955 100644
--- a/camel/camel-object.h
+++ b/camel/camel-object.h
@@ -29,7 +29,7 @@
#ifndef CAMEL_OBJECT_H
#define CAMEL_OBJECT_H
-#include <glib.h>
+#include <glib-object.h>
#include <stdio.h> /* FILE */
#include <stdlib.h> /* gsize */
#include <stdarg.h>
@@ -37,50 +37,34 @@
#include <camel/camel-arg.h>
#include <camel/camel-exception.h>
-/* turn on so that camel_object_class_dump_tree() dumps object instances as well */
-#define CAMEL_OBJECT_TRACK_INSTANCES
+/* Standard GObject macros */
+#define CAMEL_TYPE_OBJECT \
+ (camel_object_get_type ())
+#define CAMEL_OBJECT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_OBJECT, CamelObject))
+#define CAMEL_OBJECT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_OBJECT, CamelObjectClass))
+#define CAMEL_IS_OBJECT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_OBJECT))
+#define CAMEL_IS_OBJECT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_OBJECT))
+#define CAMEL_OBJECT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_OBJECT, CamelObjectClass))
G_BEGIN_DECLS
-typedef struct _CamelObjectClass *CamelType;
-
-#ifdef G_DISABLE_CHECKS
-#define CAMEL_CHECK_CAST(obj, ctype, ptype) ((ptype *) obj)
-#define CAMEL_CHECK_CLASS_CAST(klass, ctype, ptype) ((ptype *) klass)
-#else
-#define CAMEL_CHECK_CAST(obj, ctype, ptype) ((ptype *) camel_object_cast ((CamelObject *)(obj), (CamelType)(ctype)))
-#define CAMEL_CHECK_CLASS_CAST(klass, ctype, ptype) ((ptype *) camel_object_class_cast ((CamelObjectClass *)(klass), (CamelType)(ctype) ))
-#endif
-#define CAMEL_CHECK_TYPE(obj, ctype) (camel_object_is ((CamelObject *)(obj), (CamelType)(ctype) ))
-#define CAMEL_CHECK_CLASS_TYPE(klass, ctype) (camel_object_class_is ((CamelObjectClass *)(klass), (CamelType)(ctype)))
-
-extern CamelType camel_object_type;
-
-#define CAMEL_TYPE_OBJECT (camel_object_type)
-
-/* we can't check casts till we've got the type, use the global type variable because its cheaper */
-#define CAMEL_OBJECT(obj) (CAMEL_CHECK_CAST((obj), camel_object_type, CamelObject))
-#define CAMEL_OBJECT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), camel_object_type, CamelObjectClass))
-#define CAMEL_IS_OBJECT(o) (CAMEL_CHECK_TYPE((o), camel_object_type))
-#define CAMEL_IS_OBJECT_CLASS(k) (CAMEL_CHECK_CLASS_TYPE((k), camel_object_type))
-
-#define CAMEL_OBJECT_GET_CLASS(o) ((CamelObjectClass *)(CAMEL_OBJECT(o))->klass)
-#define CAMEL_OBJECT_GET_TYPE(o) ((CamelType)(CAMEL_OBJECT(o))->klass)
-
-typedef struct _CamelObjectClass CamelObjectClass;
typedef struct _CamelObject CamelObject;
+typedef struct _CamelObjectClass CamelObjectClass;
typedef guint CamelObjectHookID;
-typedef void (*CamelObjectClassInitFunc) (CamelObjectClass *);
-typedef void (*CamelObjectClassFinalizeFunc) (CamelObjectClass *);
-typedef void (*CamelObjectInitFunc) (CamelObject *, CamelObjectClass *);
-typedef void (*CamelObjectFinalizeFunc) (CamelObject *);
-
typedef gboolean (*CamelObjectEventPrepFunc) (CamelObject *, gpointer);
typedef void (*CamelObjectEventHookFunc) (CamelObject *, gpointer, gpointer);
-#define CAMEL_INVALID_TYPE (NULL)
-
/* camel object args. */
enum {
/* Get a description of the object. */
@@ -97,108 +81,33 @@ enum {
CAMEL_OBJECT_PERSISTENT_PROPERTIES = CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES
};
-typedef enum _CamelObjectFlags {
- CAMEL_OBJECT_DESTROY = (1<<0)
-} CamelObjectFlags;
-
-/* TODO: create a simpleobject which has no events on it, or an interface for events */
struct _CamelObject {
- struct _CamelObjectClass *klass;
-
- guint32 magic; /* only really needed for debugging ... */
+ GObject parent;
/* current hooks on this object */
struct _CamelHookList *hooks;
-
- guint32 ref_count:24;
- guint32 flags:8;
-
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- struct _CamelObject *next, *prev;
-#endif
};
-struct _CamelObjectClass
-{
- struct _CamelObjectClass *parent;
-
- guint32 magic; /* in same spot for validation */
-
- struct _CamelObjectClass *next, *child; /* maintain heirarchy, just for kicks */
-
- const gchar *name;
-
- gpointer lock; /* lock when used in threading, else just pads struct */
-
- /*unsigned short version, revision;*/
-
- /* if the object's bigger than 64K, it could use redesigning */
- unsigned short object_size/*, object_data*/;
- unsigned short klass_size/*, klass_data*/;
+struct _CamelObjectClass {
+ GObjectClass parent_class;
/* available hooks for this class */
struct _CamelHookPair *hooks;
- /* memchunks for this type */
- struct _EMemChunk *instance_chunks;
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- struct _CamelObject *instances;
-#endif
-
- /* init class */
- void (*klass_init)(struct _CamelObjectClass *);
- void (*klass_finalize)(struct _CamelObjectClass *);
-
- /* init/finalize object */
- void (*init)(struct _CamelObject *, struct _CamelObjectClass *);
- void (*finalize)(struct _CamelObject *);
-
- /* root-class fields follow, type system above */
-
/* get/set interface */
- gint (*setv)(struct _CamelObject *, CamelException *ex, CamelArgV *args);
- gint (*getv)(struct _CamelObject *, CamelException *ex, CamelArgGetV *args);
+ gint (*setv)(CamelObject *, CamelException *ex, CamelArgV *args);
+ gint (*getv)(CamelObject *, CamelException *ex, CamelArgGetV *args);
/* we only free 1 at a time, and only pointer types, obviously */
- void (*free)(struct _CamelObject *, guint32 tag, gpointer ptr);
+ void (*free)(CamelObject *, guint32 tag, gpointer ptr);
/* persistence stuff */
- gint (*state_read)(struct _CamelObject *, FILE *fp);
- gint (*state_write)(struct _CamelObject *, FILE *fp);
+ gint (*state_read)(CamelObject *, FILE *fp);
+ gint (*state_write)(CamelObject *, FILE *fp);
};
-/* The type system .... it's pretty simple..... */
-void camel_type_init (void);
-CamelType camel_type_register(CamelType parent, const gchar * name, /*guint ver, guint rev,*/
- gsize instance_size,
- gsize classfuncs_size,
- CamelObjectClassInitFunc class_init,
- CamelObjectClassFinalizeFunc class_finalize,
- CamelObjectInitFunc instance_init,
- CamelObjectFinalizeFunc instance_finalize);
-
-/* deprecated interface */
-#define camel_type_get_global_classfuncs(x) ((CamelObjectClass *)(x))
-
-/* object class methods (types == classes now) */
-const gchar *camel_type_to_name (CamelType type);
-CamelType camel_name_to_type (const gchar *name);
void camel_object_class_add_event (CamelObjectClass *klass, const gchar *name, CamelObjectEventPrepFunc prep);
-void camel_object_class_dump_tree (CamelType root);
-
-/* casting */
-CamelObject *camel_object_cast(CamelObject *obj, CamelType ctype);
-gboolean camel_object_is(CamelObject *obj, CamelType ctype);
-
-CamelObjectClass *camel_object_class_cast (CamelObjectClass *klass, CamelType ctype);
-gboolean camel_object_class_is (CamelObjectClass *klass, CamelType ctype);
-
-CamelType camel_object_get_type (void);
-
-CamelObject *camel_object_new (CamelType type);
-
-gpointer camel_object_ref (gpointer);
-void camel_object_unref (gpointer);
+GType camel_object_get_type (void);
/* hooks */
CamelObjectHookID camel_object_hook_event(gpointer obj, const gchar *name, CamelObjectEventHookFunc hook, gpointer data);
@@ -219,21 +128,6 @@ gint camel_object_state_write(gpointer vo);
/* free a retrieved object. May be a noop for static data. */
void camel_object_free(gpointer vo, guint32 tag, gpointer value);
-/* for managing bags of weakly-ref'd 'child' objects */
-typedef struct _CamelObjectBag CamelObjectBag;
-typedef gpointer (*CamelCopyFunc)(gconstpointer vo);
-
-CamelObjectBag *camel_object_bag_new(GHashFunc hash, GEqualFunc equal, CamelCopyFunc keycopy, GFreeFunc keyfree);
-gpointer camel_object_bag_get(CamelObjectBag *bag, gconstpointer key);
-gpointer camel_object_bag_peek(CamelObjectBag *bag, gconstpointer key);
-gpointer camel_object_bag_reserve(CamelObjectBag *bag, gconstpointer key);
-void camel_object_bag_add(CamelObjectBag *bag, gconstpointer key, gpointer vo);
-void camel_object_bag_abort(CamelObjectBag *bag, gconstpointer key);
-void camel_object_bag_rekey(CamelObjectBag *bag, gpointer o, gconstpointer newkey);
-GPtrArray *camel_object_bag_list(CamelObjectBag *bag);
-void camel_object_bag_remove(CamelObjectBag *bag, gpointer o);
-void camel_object_bag_destroy(CamelObjectBag *bag);
-
G_END_DECLS
#endif /* CAMEL_OBJECT_H */
diff --git a/camel/camel-offline-folder.c b/camel/camel-offline-folder.c
index 5415aef..53c812c 100644
--- a/camel/camel-offline-folder.c
+++ b/camel/camel-offline-folder.c
@@ -31,8 +31,6 @@
#include "camel-service.h"
#include "camel-session.h"
-static gpointer camel_offline_folder_parent_class;
-
static GSList *offline_folder_props = NULL;
static CamelProperty offline_prop_list[] = {
@@ -46,6 +44,8 @@ struct _offline_downsync_msg {
CamelFolderChangeInfo *changes;
};
+G_DEFINE_TYPE (CamelOfflineFolder, camel_offline_folder, CAMEL_TYPE_FOLDER)
+
static void
offline_downsync_sync (CamelSession *session, CamelSessionThreadMsg *mm)
{
@@ -61,7 +61,7 @@ offline_downsync_sync (CamelSession *session, CamelSessionThreadMsg *mm)
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);
+ g_object_unref (message);
}
} else {
camel_offline_folder_downsync ((CamelOfflineFolder *) m->folder, "(match-all)", &mm->ex);
@@ -78,7 +78,7 @@ offline_downsync_free (CamelSession *session, CamelSessionThreadMsg *mm)
if (m->changes)
camel_folder_change_info_free (m->changes);
- camel_object_unref (m->folder);
+ g_object_unref (m->folder);
}
static CamelSessionThreadOps offline_downsync_ops = {
@@ -99,7 +99,7 @@ offline_folder_changed (CamelFolder *folder, CamelFolderChangeInfo *changes, gpo
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);
- m->folder = camel_object_ref (folder);
+ m->folder = g_object_ref (folder);
camel_session_thread_queue (session, &m->msg, 0);
}
@@ -229,8 +229,6 @@ camel_offline_folder_class_init (CamelOfflineFolderClass *class)
CamelObjectClass *camel_object_class;
gint ii;
- camel_offline_folder_parent_class = (CamelFolderClass *) camel_type_get_global_classfuncs (CAMEL_FOLDER_TYPE);
-
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = offline_folder_getv;
camel_object_class->setv = offline_folder_setv;
@@ -253,25 +251,6 @@ camel_offline_folder_init (CamelOfflineFolder *folder)
(CamelObjectEventHookFunc) offline_folder_changed, NULL);
}
-CamelType
-camel_offline_folder_get_type (void)
-{
- static CamelType type = NULL;
-
- if (!type) {
- type = camel_type_register (CAMEL_FOLDER_TYPE,
- "CamelOfflineFolder",
- sizeof (CamelOfflineFolder),
- sizeof (CamelOfflineFolderClass),
- (CamelObjectClassInitFunc) camel_offline_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_offline_folder_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return type;
-}
-
/**
* camel_offline_folder_downsync:
* @offline: a #CamelOfflineFolder object
diff --git a/camel/camel-offline-folder.h b/camel/camel-offline-folder.h
index 1b5b621..51de524 100644
--- a/camel/camel-offline-folder.h
+++ b/camel/camel-offline-folder.h
@@ -29,12 +29,24 @@
#include <camel/camel-folder.h>
-#define CAMEL_OFFLINE_FOLDER_TYPE (camel_offline_folder_get_type ())
-#define CAMEL_OFFLINE_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_OFFLINE_FOLDER_TYPE, CamelOfflineFolder))
-#define CAMEL_OFFLINE_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_OFFLINE_FOLDER_TYPE, CamelOfflineFolderClass))
-#define CAMEL_IS_OFFLINE_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_OFFLINE_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_OFFLINE_FOLDER \
+ (camel_offline_folder_get_type ())
+#define CAMEL_OFFLINE_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_OFFLINE_FOLDER, CamelOfflineFolder))
+#define CAMEL_OFFLINE_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_OFFLINE_FOLDER, CamelOfflineFolderClass))
+#define CAMEL_IS_OFFLINE_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_OFFLINE_FOLDER))
+#define CAMEL_IS_OFFLINE_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_OFFLINE_FOLDER))
#define CAMEL_OFFLINE_FOLDER_GET_CLASS(obj) \
- ((CamelOfflineFolderClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_OFFLINE_FOLDER, CamelOfflineFolderClass))
G_BEGIN_DECLS
@@ -62,7 +74,7 @@ struct _CamelOfflineFolderClass {
gboolean (* downsync) (CamelOfflineFolder *folder, const gchar *expression, CamelException *ex);
};
-CamelType camel_offline_folder_get_type (void);
+GType camel_offline_folder_get_type (void);
gboolean camel_offline_folder_downsync (CamelOfflineFolder *offline, const gchar *expression, CamelException *ex);
diff --git a/camel/camel-offline-journal.c b/camel/camel-offline-journal.c
index c7c74d2..810f1a4 100644
--- a/camel/camel-offline-journal.c
+++ b/camel/camel-offline-journal.c
@@ -45,23 +45,30 @@
#define d(x)
-static CamelObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelOfflineJournal, camel_offline_journal, CAMEL_TYPE_OBJECT)
static void
-offline_journal_finalize (CamelOfflineJournal *journal)
+offline_journal_finalize (GObject *object)
{
+ CamelOfflineJournal *journal = CAMEL_OFFLINE_JOURNAL (object);
CamelDListNode *entry;
g_free (journal->filename);
while ((entry = camel_dlist_remhead (&journal->queue)))
CAMEL_OFFLINE_JOURNAL_GET_CLASS (journal)->entry_free (journal, entry);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_offline_journal_parent_class)->finalize (object);
}
static void
-camel_offline_journal_class_init (CamelOfflineJournalClass *klass)
+camel_offline_journal_class_init (CamelOfflineJournalClass *class)
{
- parent_class = camel_type_get_global_classfuncs (CAMEL_TYPE_OBJECT);
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = offline_journal_finalize;
}
static void
@@ -72,25 +79,6 @@ camel_offline_journal_init (CamelOfflineJournal *journal)
camel_dlist_init (&journal->queue);
}
-CamelType
-camel_offline_journal_get_type (void)
-{
- static CamelType type = NULL;
-
- if (!type) {
- type = camel_type_register (camel_object_get_type (),
- "CamelOfflineJournal",
- sizeof (CamelOfflineJournal),
- sizeof (CamelOfflineJournalClass),
- (CamelObjectClassInitFunc) camel_offline_journal_class_init,
- NULL,
- (CamelObjectInitFunc) camel_offline_journal_init,
- (CamelObjectFinalizeFunc) offline_journal_finalize);
- }
-
- return type;
-}
-
/**
* camel_offline_journal_construct:
* @journal: a #CamelOfflineJournal object
diff --git a/camel/camel-offline-journal.h b/camel/camel-offline-journal.h
index eb23c18..ec21026 100644
--- a/camel/camel-offline-journal.h
+++ b/camel/camel-offline-journal.h
@@ -33,12 +33,24 @@
#include <camel/camel-list-utils.h>
#include <camel/camel-object.h>
-#define CAMEL_TYPE_OFFLINE_JOURNAL (camel_offline_journal_get_type ())
-#define CAMEL_OFFLINE_JOURNAL(obj) (CAMEL_CHECK_CAST ((obj), CAMEL_TYPE_OFFLINE_JOURNAL, CamelOfflineJournal))
-#define CAMEL_OFFLINE_JOURNAL_CLASS(klass) (CAMEL_CHECK_CLASS_CAST ((klass), CAMEL_TYPE_OFFLINE_JOURNAL, CamelOfflineJournalClass))
-#define CAMEL_IS_OFFLINE_JOURNAL(obj) (CAMEL_CHECK_TYPE ((obj), CAMEL_TYPE_OFFLINE_JOURNAL))
-#define CAMEL_IS_OFFLINE_JOURNAL_CLASS(klass) (CAMEL_CHECK_CLASS_TYPE ((klass), CAMEL_TYPE_OFFLINE_JOURNAL))
-#define CAMEL_OFFLINE_JOURNAL_GET_CLASS(o) (CAMEL_OFFLINE_JOURNAL_CLASS (CAMEL_OBJECT_GET_CLASS (o)))
+/* Standard GObject macros */
+#define CAMEL_TYPE_OFFLINE_JOURNAL \
+ (camel_offline_journal_get_type ())
+#define CAMEL_OFFLINE_JOURNAL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_OFFLINE_JOURNAL, CamelOfflineJournal))
+#define CAMEL_OFFLINE_JOURNAL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_OFFLINE_JOURNAL, CamelOfflineJournalClass))
+#define CAMEL_IS_OFFLINE_JOURNAL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_OFFLINE_JOURNAL))
+#define CAMEL_IS_OFFLINE_JOURNAL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_OFFLINE_JOURNAL))
+#define CAMEL_OFFLINE_JOURNAL_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_OFFLINE_JOURNAL, CamelOfflineJournalClass))
G_BEGIN_DECLS
@@ -67,7 +79,7 @@ struct _CamelOfflineJournalClass {
gint (* entry_play) (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
};
-CamelType camel_offline_journal_get_type (void);
+GType camel_offline_journal_get_type (void);
void camel_offline_journal_construct (CamelOfflineJournal *journal, struct _CamelFolder *folder, const gchar *filename);
void camel_offline_journal_set_filename (CamelOfflineJournal *journal, const gchar *filename);
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index f18c336..d9cf25d 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -31,7 +31,7 @@
#include "camel-offline-store.h"
#include "camel-session.h"
-static gpointer camel_offline_store_parent_class;
+G_DEFINE_TYPE (CamelOfflineStore, camel_offline_store, CAMEL_TYPE_STORE)
static gboolean
offline_store_construct (CamelService *service,
@@ -60,8 +60,6 @@ camel_offline_store_class_init (CamelOfflineStoreClass *class)
{
CamelServiceClass *service_class;
- camel_offline_store_parent_class = (CamelStoreClass *) camel_type_get_global_classfuncs (CAMEL_STORE_TYPE);
-
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = offline_store_construct;
}
@@ -72,25 +70,6 @@ camel_offline_store_init (CamelOfflineStore *store)
store->state = CAMEL_OFFLINE_STORE_NETWORK_AVAIL;
}
-CamelType
-camel_offline_store_get_type (void)
-{
- static CamelType type = NULL;
-
- if (!type) {
- type = camel_type_register (CAMEL_STORE_TYPE,
- "CamelOfflineStore",
- sizeof (CamelOfflineStore),
- sizeof (CamelOfflineStoreClass),
- (CamelObjectClassInitFunc) camel_offline_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_offline_store_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return type;
-}
-
/**
* camel_offline_store_get_network_state:
* @store: a #CamelOfflineStore object
@@ -144,13 +123,13 @@ camel_offline_store_set_network_state (CamelOfflineStore *store,
for (i = 0; i < folders->len; i++) {
folder = folders->pdata[i];
- if (CAMEL_CHECK_TYPE (folder, CAMEL_OFFLINE_FOLDER_TYPE)
+ if (G_TYPE_CHECK_INSTANCE_TYPE (folder, CAMEL_TYPE_OFFLINE_FOLDER)
&& (sync || ((CamelOfflineFolder *) folder)->sync_offline)) {
camel_offline_folder_downsync ((CamelOfflineFolder *) folder, NULL, &lex);
camel_exception_clear (&lex);
}
- camel_object_unref (folder);
+ g_object_unref (folder);
}
g_ptr_array_free (folders, TRUE);
@@ -203,12 +182,12 @@ camel_offline_store_prepare_for_offline (CamelOfflineStore *store,
for (i = 0; i < folders->len; i++) {
folder = folders->pdata[i];
- if (CAMEL_CHECK_TYPE (folder, CAMEL_OFFLINE_FOLDER_TYPE)
+ if (G_TYPE_CHECK_INSTANCE_TYPE (folder, CAMEL_TYPE_OFFLINE_FOLDER)
&& (sync || ((CamelOfflineFolder *) folder)->sync_offline)) {
camel_offline_folder_downsync ((CamelOfflineFolder *) folder, NULL, &lex);
camel_exception_clear (&lex);
}
- camel_object_unref (folder);
+ g_object_unref (folder);
}
g_ptr_array_free (folders, TRUE);
}
diff --git a/camel/camel-offline-store.h b/camel/camel-offline-store.h
index 33449d6..148b645 100644
--- a/camel/camel-offline-store.h
+++ b/camel/camel-offline-store.h
@@ -29,12 +29,24 @@
#include <camel/camel-store.h>
-#define CAMEL_TYPE_OFFLINE_STORE (camel_offline_store_get_type ())
-#define CAMEL_OFFLINE_STORE(obj) (CAMEL_CHECK_CAST ((obj), CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStore))
-#define CAMEL_OFFLINE_STORE_CLASS(klass) (CAMEL_CHECK_CLASS_CAST ((klass), CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStoreClass))
-#define CAMEL_IS_OFFLINE_STORE(obj) (CAMEL_CHECK_TYPE ((obj), CAMEL_TYPE_OFFLINE_STORE))
-#define CAMEL_IS_OFFLINE_STORE_CLASS(klass) (CAMEL_CHECK_CLASS_TYPE ((klass), CAMEL_TYPE_OFFLINE_STORE))
-#define CAMEL_OFFLINE_STORE_GET_CLASS(obj) (CAMEL_CHECK_GET_CLASS ((obj), CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStoreClass))
+/* Standard GObject macros */
+#define CAMEL_TYPE_OFFLINE_STORE \
+ (camel_offline_store_get_type ())
+#define CAMEL_OFFLINE_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStore))
+#define CAMEL_OFFLINE_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStoreClass))
+#define CAMEL_IS_OFFLINE_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_OFFLINE_STORE))
+#define CAMEL_IS_OFFLINE_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_OFFLINE_STORE))
+#define CAMEL_OFFLINE_STORE_GET_CLASS(obj) \
+ (CAMEL_CHECK_GET_CLASS \
+ ((obj), CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStoreClass))
G_BEGIN_DECLS
@@ -62,7 +74,7 @@ struct _CamelOfflineStoreClass {
gboolean (* set_network_state) (CamelOfflineStore *store, gint state, CamelException *ex);
};
-CamelType camel_offline_store_get_type (void);
+GType camel_offline_store_get_type (void);
gboolean camel_offline_store_set_network_state (CamelOfflineStore *store, gint state, CamelException *ex);
gint camel_offline_store_get_network_state (CamelOfflineStore *store, CamelException *ex);
diff --git a/camel/camel-partition-table.c b/camel/camel-partition-table.c
index 938d3de..daa9e7e 100644
--- a/camel/camel-partition-table.c
+++ b/camel/camel-partition-table.c
@@ -39,73 +39,63 @@
tables consistent after program crash without sync */
/*#define SYNC_UPDATES*/
-#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
+#define d(x) /*(printf ("%s (%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
/* key index debug */
-#define k(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
-
-struct _CamelPartitionTablePrivate {
- GStaticMutex lock; /* for locking partition */
-};
+#define k(x) /*(printf ("%s (%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
#define CAMEL_PARTITION_TABLE_LOCK(kf, lock) (g_static_mutex_lock(&(kf)->priv->lock))
#define CAMEL_PARTITION_TABLE_UNLOCK(kf, lock) (g_static_mutex_unlock(&(kf)->priv->lock))
-static void
-camel_partition_table_class_init(CamelPartitionTableClass *klass)
-{
-}
+#define CAMEL_PARTITION_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_PARTITION_TABLE, CamelPartitionTablePrivate))
-static void
-camel_partition_table_init(CamelPartitionTable *cpi)
-{
- struct _CamelPartitionTablePrivate *p;
-
- camel_dlist_init(&cpi->partition);
+struct _CamelPartitionTablePrivate {
+ GStaticMutex lock; /* for locking partition */
+};
- p = cpi->priv = g_malloc0(sizeof(*cpi->priv));
- g_static_mutex_init (&p->lock);
-}
+G_DEFINE_TYPE (CamelPartitionTable, camel_partition_table, CAMEL_TYPE_OBJECT)
static void
-camel_partition_table_finalize(CamelPartitionTable *cpi)
+partition_table_finalize (GObject *object)
{
+ CamelPartitionTable *table = CAMEL_PARTITION_TABLE (object);
CamelBlock *bl;
- struct _CamelPartitionTablePrivate *p;
-
- p = cpi->priv;
- if (cpi->blocks) {
- while ((bl = (CamelBlock *)camel_dlist_remhead(&cpi->partition))) {
- camel_block_file_sync_block(cpi->blocks, bl);
- camel_block_file_unref_block(cpi->blocks, bl);
+ if (table->blocks) {
+ while ((bl = (CamelBlock *)camel_dlist_remhead (&table->partition))) {
+ camel_block_file_sync_block (table->blocks, bl);
+ camel_block_file_unref_block (table->blocks, bl);
}
- camel_block_file_sync(cpi->blocks);
+ camel_block_file_sync (table->blocks);
- camel_object_unref (cpi->blocks);
+ g_object_unref (table->blocks);
}
- g_static_mutex_free (&p->lock);
+ g_static_mutex_free (&table->priv->lock);
- g_free(p);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_partition_table_parent_class)->finalize (object);
+}
+static void
+camel_partition_table_class_init (CamelPartitionTableClass *class)
+{
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelPartitionTablePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = partition_table_finalize;
}
-CamelType
-camel_partition_table_get_type(void)
+static void
+camel_partition_table_init (CamelPartitionTable *cpi)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelPartitionTable",
- sizeof (CamelPartitionTable),
- sizeof (CamelPartitionTableClass),
- (CamelObjectClassInitFunc) camel_partition_table_class_init,
- NULL,
- (CamelObjectInitFunc) camel_partition_table_init,
- (CamelObjectFinalizeFunc) camel_partition_table_finalize);
- }
+ cpi->priv = CAMEL_PARTITION_TABLE_GET_PRIVATE (cpi);
- return type;
+ camel_dlist_init (&cpi->partition);
+ g_static_mutex_init (&cpi->priv->lock);
}
/* ********************************************************************** */
@@ -126,7 +116,7 @@ lookup word, if nameid is deleted, mark it in wordlist as unused and mark for wr
/* ********************************************************************** */
/* This simple hash seems to work quite well */
-static camel_hash_t hash_key(const gchar *key)
+static camel_hash_t hash_key (const gchar *key)
{
camel_hash_t hash = 0xABADF00D;
@@ -139,7 +129,7 @@ static camel_hash_t hash_key(const gchar *key)
}
/* Call with lock held */
-static CamelBlock *find_partition(CamelPartitionTable *cpi, camel_hash_t id, gint *indexp)
+static CamelBlock *find_partition (CamelPartitionTable *cpi, camel_hash_t id, gint *indexp)
{
gint index, jump;
CamelBlock *bl;
@@ -179,39 +169,41 @@ static CamelBlock *find_partition(CamelPartitionTable *cpi, camel_hash_t id, gin
bl = bl->next;
}
- g_warning("could not find a partition that could fit !partition table corrupt!");
+ g_warning ("could not find a partition that could fit! partition table corrupt!");
/* This should never be reached */
return NULL;
}
-CamelPartitionTable *camel_partition_table_new(struct _CamelBlockFile *bs, camel_block_t root)
+CamelPartitionTable *
+camel_partition_table_new (struct _CamelBlockFile *bs,
+ camel_block_t root)
{
CamelPartitionTable *cpi;
CamelPartitionMapBlock *ptb;
CamelPartitionKeyBlock *kb;
CamelBlock *block, *pblock;
- cpi = (CamelPartitionTable *)camel_object_new(camel_partition_table_get_type());
+ cpi = g_object_new (CAMEL_TYPE_PARTITION_TABLE, NULL);
cpi->rootid = root;
- cpi->blocks = camel_object_ref (bs);
+ cpi->blocks = g_object_ref (bs);
/* read the partition table into memory */
do {
- block = camel_block_file_get_block(bs, root);
+ block = camel_block_file_get_block (bs, root);
if (block == NULL)
goto fail;
ptb = (CamelPartitionMapBlock *)&block->data;
- d(printf("Adding partition block, used = %d, hashid = %08x\n", ptb->used, ptb->partition[0].hashid));
+ d (printf ("Adding partition block, used = %d, hashid = %08x\n", ptb->used, ptb->partition[0].hashid));
/* if we have no data, prime initial block */
- if (ptb->used == 0 && camel_dlist_empty(&cpi->partition) && ptb->next == 0) {
- pblock = camel_block_file_new_block(bs);
+ if (ptb->used == 0 && camel_dlist_empty (&cpi->partition) && ptb->next == 0) {
+ pblock = camel_block_file_new_block (bs);
if (pblock == NULL) {
- camel_block_file_unref_block(bs, block);
+ camel_block_file_unref_block (bs, block);
goto fail;
}
kb = (CamelPartitionKeyBlock *)&pblock->data;
@@ -219,40 +211,40 @@ CamelPartitionTable *camel_partition_table_new(struct _CamelBlockFile *bs, camel
ptb->used = 1;
ptb->partition[0].hashid = 0xffffffff;
ptb->partition[0].blockid = pblock->id;
- camel_block_file_touch_block(bs, pblock);
- camel_block_file_unref_block(bs, pblock);
- camel_block_file_touch_block(bs, block);
+ camel_block_file_touch_block (bs, pblock);
+ camel_block_file_unref_block (bs, pblock);
+ camel_block_file_touch_block (bs, block);
#ifdef SYNC_UPDATES
- camel_block_file_sync_block(bs, block);
+ camel_block_file_sync_block (bs, block);
#endif
}
root = ptb->next;
- camel_block_file_detach_block(bs, block);
- camel_dlist_addtail(&cpi->partition, (CamelDListNode *)block);
+ camel_block_file_detach_block (bs, block);
+ camel_dlist_addtail (&cpi->partition, (CamelDListNode *)block);
} while (root);
return cpi;
fail:
- camel_object_unref (cpi);
+ g_object_unref (cpi);
return NULL;
}
/* sync our blocks, the caller must still sync the blockfile itself */
gint
-camel_partition_table_sync(CamelPartitionTable *cpi)
+camel_partition_table_sync (CamelPartitionTable *cpi)
{
CamelBlock *bl, *bn;
gint ret = 0;
- CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_LOCK (cpi, lock);
if (cpi->blocks) {
bl = (CamelBlock *)cpi->partition.head;
bn = bl->next;
while (bn) {
- ret = camel_block_file_sync_block(cpi->blocks, bl);
+ ret = camel_block_file_sync_block (cpi->blocks, bl);
if (ret == -1)
goto fail;
bl = bn;
@@ -260,12 +252,14 @@ camel_partition_table_sync(CamelPartitionTable *cpi)
}
}
fail:
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
return ret;
}
-camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const gchar *key)
+camel_key_t
+camel_partition_table_lookup (CamelPartitionTable *cpi,
+ const gchar *key)
{
CamelPartitionKeyBlock *pkb;
CamelPartitionMapBlock *ptb;
@@ -274,19 +268,20 @@ camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const gchar *
camel_key_t keyid = 0;
gint index, i;
- hashid = hash_key(key);
+ hashid = hash_key (key);
- CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_LOCK (cpi, lock);
- ptblock = find_partition(cpi, hashid, &index);
+ ptblock = find_partition (cpi, hashid, &index);
if (ptblock == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
return 0;
}
ptb = (CamelPartitionMapBlock *)&ptblock->data;
- block = camel_block_file_get_block(cpi->blocks, ptb->partition[index].blockid);
+ block = camel_block_file_get_block (
+ cpi->blocks, ptb->partition[index].blockid);
if (block == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
return 0;
}
@@ -302,9 +297,9 @@ camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const gchar *
}
}
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
- camel_block_file_unref_block(cpi->blocks, block);
+ camel_block_file_unref_block (cpi->blocks, block);
return keyid;
}
@@ -319,19 +314,20 @@ camel_partition_table_remove (CamelPartitionTable *cpi,
camel_hash_t hashid;
gint index, i;
- hashid = hash_key(key);
+ hashid = hash_key (key);
- CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_LOCK (cpi, lock);
- ptblock = find_partition(cpi, hashid, &index);
+ ptblock = find_partition (cpi, hashid, &index);
if (ptblock == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
return TRUE;
}
ptb = (CamelPartitionMapBlock *)&ptblock->data;
- block = camel_block_file_get_block(cpi->blocks, ptb->partition[index].blockid);
+ block = camel_block_file_get_block (
+ cpi->blocks, ptb->partition[index].blockid);
if (block == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
return FALSE;
}
pkb = (CamelPartitionKeyBlock *)&block->data;
@@ -348,20 +344,20 @@ camel_partition_table_remove (CamelPartitionTable *cpi,
pkb->keys[i].keyid = pkb->keys[i+1].keyid;
pkb->keys[i].hashid = pkb->keys[i+1].hashid;
}
- camel_block_file_touch_block(cpi->blocks, block);
+ camel_block_file_touch_block (cpi->blocks, block);
break;
}
}
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
- camel_block_file_unref_block(cpi->blocks, block);
+ camel_block_file_unref_block (cpi->blocks, block);
return TRUE;
}
static gint
-keys_cmp(gconstpointer ap, gconstpointer bp)
+keys_cmp (gconstpointer ap, gconstpointer bp)
{
const CamelPartitionKey *a = ap;
const CamelPartitionKey *b = bp;
@@ -375,7 +371,9 @@ keys_cmp(gconstpointer ap, gconstpointer bp)
}
gint
-camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_t keyid)
+camel_partition_table_add (CamelPartitionTable *cpi,
+ const gchar *key,
+ camel_key_t keyid)
{
camel_hash_t hashid, partid;
gint index, newindex = 0; /* initialisation of this and pkb/nkb is just to silence compiler */
@@ -388,16 +386,17 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
hashid = hash_key(key);
- CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
- ptblock = find_partition(cpi, hashid, &index);
+ CAMEL_PARTITION_TABLE_LOCK (cpi, lock);
+ ptblock = find_partition (cpi, hashid, &index);
if (ptblock == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
return -1;
}
ptb = (CamelPartitionMapBlock *)&ptblock->data;
- block = camel_block_file_get_block(cpi->blocks, ptb->partition[index].blockid);
+ block = camel_block_file_get_block (
+ cpi->blocks, ptb->partition[index].blockid);
if (block == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
return -1;
}
kb = (CamelPartitionKeyBlock *)&block->data;
@@ -417,16 +416,18 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
/* TODO: Should look at next/previous partition table block as well ... */
if (index > 0) {
- pblock = camel_block_file_get_block(cpi->blocks, ptb->partition[index-1].blockid);
+ pblock = camel_block_file_get_block (
+ cpi->blocks, ptb->partition[index-1].blockid);
if (pblock == NULL)
goto fail;
pkb = (CamelPartitionKeyBlock *)&pblock->data;
}
if (index < (ptb->used-1)) {
- nblock = camel_block_file_get_block(cpi->blocks, ptb->partition[index+1].blockid);
+ nblock = camel_block_file_get_block (
+ cpi->blocks, ptb->partition[index+1].blockid);
if (nblock == NULL) {
if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
+ camel_block_file_unref_block (cpi->blocks, pblock);
goto fail;
}
nkb = (CamelPartitionKeyBlock *)&nblock->data;
@@ -460,12 +461,12 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
ptnblock = camel_block_file_new_block(cpi->blocks);
if (ptnblock == NULL) {
if (nblock)
- camel_block_file_unref_block(cpi->blocks, nblock);
+ camel_block_file_unref_block (cpi->blocks, nblock);
if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
+ camel_block_file_unref_block (cpi->blocks, pblock);
goto fail;
}
- camel_block_file_detach_block(cpi->blocks, ptnblock);
+ camel_block_file_detach_block (cpi->blocks, ptnblock);
/* split block and link on-disk, always sorted */
ptn = (CamelPartitionMapBlock *)&ptnblock->data;
@@ -474,7 +475,7 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
len = ptb->used / 2;
ptn->used = ptb->used - len;
ptb->used = len;
- memcpy(ptn->partition, &ptb->partition[len], ptn->used * sizeof(ptb->partition[0]));
+ memcpy (ptn->partition, &ptb->partition[len], ptn->used * sizeof (ptb->partition[0]));
/* link in-memory */
ptnblock->next = ptblock->next;
@@ -483,14 +484,14 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
ptnblock->prev = ptblock;
/* write in right order to ensure structure */
- camel_block_file_touch_block(cpi->blocks, ptnblock);
+ camel_block_file_touch_block (cpi->blocks, ptnblock);
#ifdef SYNC_UPDATES
- camel_block_file_sync_block(cpi->blocks, ptnblock);
+ camel_block_file_sync_block (cpi->blocks, ptnblock);
#endif
if (index > len) {
- camel_block_file_touch_block(cpi->blocks, ptblock);
+ camel_block_file_touch_block (cpi->blocks, ptblock);
#ifdef SYNC_UPDATES
- camel_block_file_sync_block(cpi->blocks, ptblock);
+ camel_block_file_sync_block (cpi->blocks, ptblock);
#endif
index -= len;
ptb = ptn;
@@ -499,12 +500,12 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
}
/* try get newblock before modifying existing */
- newblock = camel_block_file_new_block(cpi->blocks);
+ newblock = camel_block_file_new_block (cpi->blocks);
if (newblock == NULL) {
if (nblock)
- camel_block_file_unref_block(cpi->blocks, nblock);
+ camel_block_file_unref_block (cpi->blocks, nblock);
if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
+ camel_block_file_unref_block (cpi->blocks, pblock);
goto fail;
}
@@ -522,167 +523,161 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
ptb->partition[newindex].blockid = newblock->id;
if (nblock)
- camel_block_file_unref_block(cpi->blocks, nblock);
+ camel_block_file_unref_block (cpi->blocks, nblock);
if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
+ camel_block_file_unref_block (cpi->blocks, pblock);
} else {
newkb = (CamelPartitionKeyBlock *)&newblock->data;
if (newblock == pblock) {
if (nblock)
- camel_block_file_unref_block(cpi->blocks, nblock);
+ camel_block_file_unref_block (cpi->blocks, nblock);
} else {
if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
+ camel_block_file_unref_block (cpi->blocks, pblock);
}
}
/* sort keys to find midpoint */
len = kb->used;
- memcpy(keys, kb->keys, sizeof(kb->keys[0])*len);
- memcpy(keys+len, newkb->keys, sizeof(newkb->keys[0])*newkb->used);
+ memcpy (keys, kb->keys, sizeof (kb->keys[0])*len);
+ memcpy (keys+len, newkb->keys, sizeof (newkb->keys[0])*newkb->used);
len += newkb->used;
keys[len].hashid = hashid;
keys[len].keyid = keyid;
len++;
- qsort(keys, len, sizeof(keys[0]), keys_cmp);
+ qsort (keys, len, sizeof (keys[0]), keys_cmp);
/* Split keys, fix partition table */
half = len/2;
partid = keys[half-1].hashid;
if (index < newindex) {
- memcpy(kb->keys, keys, sizeof(keys[0])*half);
+ memcpy (kb->keys, keys, sizeof (keys[0])*half);
kb->used = half;
- memcpy(newkb->keys, keys+half, sizeof(keys[0])*(len-half));
+ memcpy (newkb->keys, keys+half, sizeof (keys[0])*(len-half));
newkb->used = len-half;
ptb->partition[index].hashid = partid;
} else {
- memcpy(newkb->keys, keys, sizeof(keys[0])*half);
+ memcpy (newkb->keys, keys, sizeof (keys[0])*half);
newkb->used = half;
- memcpy(kb->keys, keys+half, sizeof(keys[0])*(len-half));
+ memcpy (kb->keys, keys+half, sizeof (keys[0])*(len-half));
kb->used = len-half;
ptb->partition[newindex].hashid = partid;
}
- camel_block_file_touch_block(cpi->blocks, ptblock);
+ camel_block_file_touch_block (cpi->blocks, ptblock);
#ifdef SYNC_UPDATES
- camel_block_file_sync_block(cpi->blocks, ptblock);
+ camel_block_file_sync_block (cpi->blocks, ptblock);
#endif
- camel_block_file_touch_block(cpi->blocks, newblock);
- camel_block_file_unref_block(cpi->blocks, newblock);
+ camel_block_file_touch_block (cpi->blocks, newblock);
+ camel_block_file_unref_block (cpi->blocks, newblock);
}
- camel_block_file_touch_block(cpi->blocks, block);
- camel_block_file_unref_block(cpi->blocks, block);
+ camel_block_file_touch_block (cpi->blocks, block);
+ camel_block_file_unref_block (cpi->blocks, block);
ret = 0;
fail:
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
+ CAMEL_PARTITION_TABLE_UNLOCK (cpi, lock);
return ret;
}
/* ********************************************************************** */
+#define CAMEL_KEY_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_KEY_TABLE, CamelKeyTablePrivate))
+
+#define CAMEL_KEY_TABLE_LOCK(kf, lock) (g_static_mutex_lock(&(kf)->priv->lock))
+#define CAMEL_KEY_TABLE_UNLOCK(kf, lock) (g_static_mutex_unlock(&(kf)->priv->lock))
+
struct _CamelKeyTablePrivate {
GStaticMutex lock; /* for locking key */
};
-#define CAMEL_KEY_TABLE_LOCK(kf, lock) (g_static_mutex_lock(&(kf)->priv->lock))
-#define CAMEL_KEY_TABLE_UNLOCK(kf, lock) (g_static_mutex_unlock(&(kf)->priv->lock))
+G_DEFINE_TYPE (CamelKeyTable, camel_key_table, CAMEL_TYPE_OBJECT)
static void
-camel_key_table_class_init(CamelKeyTableClass *klass)
+key_table_finalize (GObject *object)
{
-}
+ CamelKeyTable *table = CAMEL_KEY_TABLE (object);
-static void
-camel_key_table_init(CamelKeyTable *ki)
-{
- struct _CamelKeyTablePrivate *p;
+ if (table->blocks) {
+ if (table->root_block) {
+ camel_block_file_sync_block (table->blocks, table->root_block);
+ camel_block_file_unref_block (table->blocks, table->root_block);
+ }
+ camel_block_file_sync (table->blocks);
+ g_object_unref (table->blocks);
+ }
- p = ki->priv = g_malloc0(sizeof(*ki->priv));
- g_static_mutex_init (&p->lock);
+ g_static_mutex_free (&table->priv->lock);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_key_table_parent_class)->finalize (object);
}
static void
-camel_key_table_finalize(CamelKeyTable *ki)
+camel_key_table_class_init (CamelKeyTableClass *class)
{
- struct _CamelKeyTablePrivate *p;
-
- p = ki->priv;
-
- if (ki->blocks) {
- if (ki->root_block) {
- camel_block_file_sync_block(ki->blocks, ki->root_block);
- camel_block_file_unref_block(ki->blocks, ki->root_block);
- }
- camel_block_file_sync(ki->blocks);
- camel_object_unref (ki->blocks);
- }
+ GObjectClass *object_class;
- g_static_mutex_free (&p->lock);
-
- g_free(p);
+ g_type_class_add_private (class, sizeof (CamelKeyTablePrivate));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = key_table_finalize;
}
-CamelType
-camel_key_table_get_type(void)
+static void
+camel_key_table_init (CamelKeyTable *table)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelKeyTable",
- sizeof (CamelKeyTable),
- sizeof (CamelKeyTableClass),
- (CamelObjectClassInitFunc) camel_key_table_class_init,
- NULL,
- (CamelObjectInitFunc) camel_key_table_init,
- (CamelObjectFinalizeFunc) camel_key_table_finalize);
- }
-
- return type;
+ table->priv = CAMEL_KEY_TABLE_GET_PRIVATE (table);
+ g_static_mutex_init (&table->priv->lock);
}
CamelKeyTable *
-camel_key_table_new(CamelBlockFile *bs, camel_block_t root)
+camel_key_table_new (CamelBlockFile *bs,
+ camel_block_t root)
{
CamelKeyTable *ki;
- ki = (CamelKeyTable *)camel_object_new(camel_key_table_get_type());
+ ki = g_object_new (CAMEL_TYPE_KEY_TABLE, NULL);
- ki->blocks = camel_object_ref (bs);
+ ki->blocks = g_object_ref (bs);
ki->rootid = root;
- ki->root_block = camel_block_file_get_block(bs, ki->rootid);
+ ki->root_block = camel_block_file_get_block (bs, ki->rootid);
if (ki->root_block == NULL) {
- camel_object_unref (ki);
+ g_object_unref (ki);
ki = NULL;
} else {
- camel_block_file_detach_block(bs, ki->root_block);
+ camel_block_file_detach_block (bs, ki->root_block);
ki->root = (CamelKeyRootBlock *)&ki->root_block->data;
- k(printf("Opening key index\n"));
- k(printf(" first %u\n last %u\n free %u\n", ki->root->first, ki->root->last, ki->root->free));
+ k (printf ("Opening key index\n"));
+ k (printf (" first %u\n last %u\n free %u\n", ki->root->first, ki->root->last, ki->root->free));
}
return ki;
}
gint
-camel_key_table_sync(CamelKeyTable *ki)
+camel_key_table_sync (CamelKeyTable *ki)
{
#ifdef SYNC_UPDATES
return 0;
#else
- return camel_block_file_sync_block(ki->blocks, ki->root_block);
+ return camel_block_file_sync_block (ki->blocks, ki->root_block);
#endif
}
camel_key_t
-camel_key_table_add(CamelKeyTable *ki, const gchar *key, camel_block_t data, guint flags)
+camel_key_table_add (CamelKeyTable *ki,
+ const gchar *key,
+ camel_block_t data,
+ guint flags)
{
CamelBlock *last, *next;
CamelKeyBlock *kblast, *kbnext;
@@ -691,21 +686,22 @@ camel_key_table_add(CamelKeyTable *ki, const gchar *key, camel_block_t data, gui
camel_key_t keyid = 0;
/* Maximum key size = 128 chars */
- len = strlen(key);
+ len = strlen (key);
if (len > CAMEL_KEY_TABLE_MAX_KEY)
len = 128;
- CAMEL_KEY_TABLE_LOCK(ki, lock);
+ CAMEL_KEY_TABLE_LOCK (ki, lock);
if (ki->root->last == 0) {
- last = camel_block_file_new_block(ki->blocks);
+ last = camel_block_file_new_block (ki->blocks);
if (last == NULL)
goto fail;
ki->root->last = ki->root->first = last->id;
- camel_block_file_touch_block(ki->blocks, ki->root_block);
- k(printf("adding first block, first = %u\n", ki->root->first));
+ camel_block_file_touch_block (ki->blocks, ki->root_block);
+ k (printf ("adding first block, first = %u\n", ki->root->first));
} else {
- last = camel_block_file_get_block(ki->blocks, ki->root->last);
+ last = camel_block_file_get_block (
+ ki->blocks, ki->root->last);
if (last == NULL)
goto fail;
}
@@ -717,24 +713,24 @@ camel_key_table_add(CamelKeyTable *ki, const gchar *key, camel_block_t data, gui
if (kblast->used > 0) {
/*left = &kblast->u.keydata[kblast->u.keys[kblast->used-1].offset] - (gchar *)(&kblast->u.keys[kblast->used+1]);*/
- left = kblast->u.keys[kblast->used-1].offset - sizeof(kblast->u.keys[0])*(kblast->used+1);
- d(printf("key '%s' used = %d (%d), filled = %d, left = %d len = %d?\n",
- key, kblast->used, kblast->used * sizeof(kblast->u.keys[0]),
- sizeof(kblast->u.keydata) - kblast->u.keys[kblast->used-1].offset,
+ left = kblast->u.keys[kblast->used-1].offset - sizeof (kblast->u.keys[0])*(kblast->used+1);
+ d (printf ("key '%s' used = %d (%d), filled = %d, left = %d len = %d?\n",
+ key, kblast->used, kblast->used * sizeof (kblast->u.keys[0]),
+ sizeof (kblast->u.keydata) - kblast->u.keys[kblast->used-1].offset,
left, len));
if (left < len) {
- next = camel_block_file_new_block(ki->blocks);
+ next = camel_block_file_new_block (ki->blocks);
if (next == NULL) {
- camel_block_file_unref_block(ki->blocks, last);
+ camel_block_file_unref_block (ki->blocks, last);
goto fail;
}
kbnext = (CamelKeyBlock *)&next->data;
kblast->next = next->id;
ki->root->last = next->id;
- d(printf("adding new block, first = %u, last = %u\n", ki->root->first, ki->root->last));
- camel_block_file_touch_block(ki->blocks, ki->root_block);
- camel_block_file_touch_block(ki->blocks, last);
- camel_block_file_unref_block(ki->blocks, last);
+ d (printf ("adding new block, first = %u, last = %u\n", ki->root->first, ki->root->last));
+ camel_block_file_touch_block (ki->blocks, ki->root_block);
+ camel_block_file_touch_block (ki->blocks, last);
+ camel_block_file_unref_block (ki->blocks, last);
kblast = kbnext;
last = next;
}
@@ -743,34 +739,34 @@ camel_key_table_add(CamelKeyTable *ki, const gchar *key, camel_block_t data, gui
if (kblast->used > 0)
offset = kblast->u.keys[kblast->used-1].offset - len;
else
- offset = sizeof(kblast->u.keydata)-len;
+ offset = sizeof (kblast->u.keydata)-len;
kblast->u.keys[kblast->used].flags = flags;
kblast->u.keys[kblast->used].data = data;
kblast->u.keys[kblast->used].offset = offset;
- memcpy(kblast->u.keydata + offset, key, len);
+ memcpy (kblast->u.keydata + offset, key, len);
keyid = (last->id & (~(CAMEL_BLOCK_SIZE-1))) | kblast->used;
kblast->used++;
#if 0
- g_assert(kblast->used < 127);
+ g_assert (kblast->used < 127);
#else
if (kblast->used >=127) {
- g_warning("Invalid value for used %d\n", kblast->used);
+ g_warning ("Invalid value for used %d\n", kblast->used);
return 0;
}
#endif
- camel_block_file_touch_block(ki->blocks, last);
- camel_block_file_unref_block(ki->blocks, last);
+ camel_block_file_touch_block (ki->blocks, last);
+ camel_block_file_unref_block (ki->blocks, last);
#ifdef SYNC_UPDATES
- camel_block_file_sync_block(ki->blocks, ki->root_block);
+ camel_block_file_sync_block (ki->blocks, ki->root_block);
#endif
fail:
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
+ CAMEL_KEY_TABLE_UNLOCK (ki, lock);
return keyid;
}
@@ -790,21 +786,21 @@ camel_key_table_set_data (CamelKeyTable *ki,
blockid = keyid & (~(CAMEL_BLOCK_SIZE-1));
index = keyid & (CAMEL_BLOCK_SIZE-1);
- bl = camel_block_file_get_block(ki->blocks, blockid);
+ bl = camel_block_file_get_block (ki->blocks, blockid);
if (bl == NULL)
return FALSE;
kb = (CamelKeyBlock *)&bl->data;
- CAMEL_KEY_TABLE_LOCK(ki, lock);
+ CAMEL_KEY_TABLE_LOCK (ki, lock);
if (kb->u.keys[index].data != data) {
kb->u.keys[index].data = data;
- camel_block_file_touch_block(ki->blocks, bl);
+ camel_block_file_touch_block (ki->blocks, bl);
}
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
+ CAMEL_KEY_TABLE_UNLOCK (ki, lock);
- camel_block_file_unref_block(ki->blocks, bl);
+ camel_block_file_unref_block (ki->blocks, bl);
return TRUE;
}
@@ -826,38 +822,36 @@ camel_key_table_set_flags (CamelKeyTable *ki,
blockid = keyid & (~(CAMEL_BLOCK_SIZE-1));
index = keyid & (CAMEL_BLOCK_SIZE-1);
- bl = camel_block_file_get_block(ki->blocks, blockid);
+ bl = camel_block_file_get_block (ki->blocks, blockid);
if (bl == NULL)
return FALSE;
kb = (CamelKeyBlock *)&bl->data;
-#if 0
- g_assert(kb->used < 127); /* this should be more accurate */
- g_assert(index < kb->used);
-#else
if (kb->used >=127 || index >= kb->used) {
g_warning("Block %x: Invalid index or content: index %d used %d\n", blockid, index, kb->used);
return FALSE;
}
-#endif
- CAMEL_KEY_TABLE_LOCK(ki, lock);
+ CAMEL_KEY_TABLE_LOCK (ki, lock);
old = kb->u.keys[index].flags;
if ((old & set) != (flags & set)) {
kb->u.keys[index].flags = (old & (~set)) | (flags & set);
- camel_block_file_touch_block(ki->blocks, bl);
+ camel_block_file_touch_block (ki->blocks, bl);
}
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
+ CAMEL_KEY_TABLE_UNLOCK (ki, lock);
- camel_block_file_unref_block(ki->blocks, bl);
+ camel_block_file_unref_block (ki->blocks, bl);
return TRUE;
}
camel_block_t
-camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, gchar **keyp, guint *flags)
+camel_key_table_lookup (CamelKeyTable *ki,
+ camel_key_t keyid,
+ gchar **keyp,
+ guint *flags)
{
CamelBlock *bl;
camel_block_t blockid;
@@ -865,12 +859,12 @@ camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, gchar **keyp, guint
gchar *key;
CamelKeyBlock *kb;
+ g_return_val_if_fail (keyid != 0, 0);
+
if (keyp)
*keyp = NULL;
if (flags)
*flags = 0;
- if (keyid == 0)
- return 0;
blockid = keyid & (~(CAMEL_BLOCK_SIZE-1));
index = keyid & (CAMEL_BLOCK_SIZE-1);
@@ -881,17 +875,12 @@ camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, gchar **keyp, guint
kb = (CamelKeyBlock *)&bl->data;
-#if 0
- g_assert(kb->used < 127); /* this should be more accurate */
- g_assert(index < kb->used);
-#else
if (kb->used >=127 || index >= kb->used) {
g_warning("Block %x: Invalid index or content: index %d used %d\n", blockid, index, kb->used);
return 0;
}
-#endif
- CAMEL_KEY_TABLE_LOCK(ki, lock);
+ CAMEL_KEY_TABLE_LOCK (ki, lock);
blockid = kb->u.keys[index].data;
if (flags)
@@ -900,17 +889,17 @@ camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, gchar **keyp, guint
if (keyp) {
off = kb->u.keys[index].offset;
if (index == 0)
- len = sizeof(kb->u.keydata) - off;
+ len = sizeof (kb->u.keydata) - off;
else
len = kb->u.keys[index-1].offset - off;
- *keyp = key = g_malloc(len+1);
- memcpy(key, kb->u.keydata + off, len);
+ *keyp = key = g_malloc (len+1);
+ memcpy (key, kb->u.keydata + off, len);
key[len] = 0;
}
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
+ CAMEL_KEY_TABLE_UNLOCK (ki, lock);
- camel_block_file_unref_block(ki->blocks, bl);
+ camel_block_file_unref_block (ki->blocks, bl);
return blockid;
}
@@ -931,12 +920,12 @@ camel_key_table_next(CamelKeyTable *ki, camel_key_t next, gchar **keyp, guint *f
if (datap)
*datap = 0;
- CAMEL_KEY_TABLE_LOCK(ki, lock);
+ CAMEL_KEY_TABLE_LOCK (ki, lock);
if (next == 0) {
next = ki->root->first;
if (next == 0) {
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
+ CAMEL_KEY_TABLE_UNLOCK (ki, lock);
return 0;
}
} else
@@ -946,9 +935,9 @@ camel_key_table_next(CamelKeyTable *ki, camel_key_t next, gchar **keyp, guint *f
blockid = next & (~(CAMEL_BLOCK_SIZE-1));
index = next & (CAMEL_BLOCK_SIZE-1);
- bl = camel_block_file_get_block(ki->blocks, blockid);
+ bl = camel_block_file_get_block (ki->blocks, blockid);
if (bl == NULL) {
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
+ CAMEL_KEY_TABLE_UNLOCK (ki, lock);
return 0;
}
@@ -958,22 +947,22 @@ camel_key_table_next(CamelKeyTable *ki, camel_key_t next, gchar **keyp, guint *f
if (index >= kb->used) {
/* FIXME: check for loops */
next = kb->next;
- camel_block_file_unref_block(ki->blocks, bl);
+ camel_block_file_unref_block (ki->blocks, bl);
bl = NULL;
}
} while (bl == NULL);
/* invalid block data */
- if ((kb->u.keys[index].offset >= sizeof(kb->u.keydata)
+ if ((kb->u.keys[index].offset >= sizeof (kb->u.keydata)
/*|| kb->u.keys[index].offset < kb->u.keydata - (gchar *)&kb->u.keys[kb->used])*/
- || kb->u.keys[index].offset < sizeof(kb->u.keys[0]) * kb->used
+ || kb->u.keys[index].offset < sizeof (kb->u.keys[0]) * kb->used
|| (index > 0 &&
- (kb->u.keys[index-1].offset >= sizeof(kb->u.keydata)
+ (kb->u.keys[index-1].offset >= sizeof (kb->u.keydata)
/*|| kb->u.keys[index-1].offset < kb->u.keydata - (gchar *)&kb->u.keys[kb->used]))) {*/
- || kb->u.keys[index-1].offset < sizeof(kb->u.keys[0]) * kb->used)))) {
- g_warning("Block %u invalid scanning keys", bl->id);
- camel_block_file_unref_block(ki->blocks, bl);
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
+ || kb->u.keys[index-1].offset < sizeof (kb->u.keys[0]) * kb->used)))) {
+ g_warning ("Block %u invalid scanning keys", bl->id);
+ camel_block_file_unref_block (ki->blocks, bl);
+ CAMEL_KEY_TABLE_UNLOCK (ki, lock);
return 0;
}
@@ -988,17 +977,17 @@ camel_key_table_next(CamelKeyTable *ki, camel_key_t next, gchar **keyp, guint *f
gchar *key;
if (index == 0)
- len = sizeof(kb->u.keydata) - off;
+ len = sizeof (kb->u.keydata) - off;
else
len = kb->u.keys[index-1].offset - off;
- *keyp = key = g_malloc(len+1);
- memcpy(key, kb->u.keydata + off, len);
+ *keyp = key = g_malloc (len+1);
+ memcpy (key, kb->u.keydata + off, len);
key[len] = 0;
}
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
+ CAMEL_KEY_TABLE_UNLOCK (ki, lock);
- camel_block_file_unref_block(ki->blocks, bl);
+ camel_block_file_unref_block (ki->blocks, bl);
return next;
}
diff --git a/camel/camel-partition-table.h b/camel/camel-partition-table.h
index 5f33c04..58ec6fb 100644
--- a/camel/camel-partition-table.h
+++ b/camel/camel-partition-table.h
@@ -30,6 +30,43 @@
#include "camel-block-file.h"
#include "camel-list-utils.h"
+/* Standard GObject macros */
+#define CAMEL_TYPE_PARTITION_TABLE \
+ (camel_partition_table_get_type ())
+#define CAMEL_PARTITION_TABLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_PARTITION_TABLE, CamelPartitionTable))
+#define CAMEL_PARTITION_TABLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_PARTITION_TABLE, CamelPartitionTableClass))
+#define CAMEL_IS_PARTITION_TABLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_PARTITION_TABLE))
+#define CAMEL_IS_PARTITION_TABLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_PARTITION_TABLE))
+#define CAMEL_PARTITION_TABLE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_PARTITION_TABLE, CamelPartitionTableClass))
+
+#define CAMEL_TYPE_KEY_TABLE \
+ (camel_key_table_get_type ())
+#define CAMEL_KEY_TABLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_KEY_TABLE, CamelKeyTable))
+#define CAMEL_KEY_TABLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_KEY_TABLE, CamelKeyTableClass))
+#define CAMEL_IS_KEY_TABLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_KEY_TABLE))
+#define CAMEL_IS_KEY_TABLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_KEY_TABLE))
+#define CAMEL_KEY_TABLE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_KEY_TABLE, CamelKeyTableClass))
+
G_BEGIN_DECLS
/* ********************************************************************** */
@@ -86,7 +123,7 @@ struct _CamelPartitionTableClass {
CamelObjectClass parent;
};
-CamelType camel_partition_table_get_type (void);
+GType camel_partition_table_get_type (void);
CamelPartitionTable *
camel_partition_table_new (struct _CamelBlockFile *bs,
camel_block_t root);
@@ -149,7 +186,7 @@ struct _CamelKeyTableClass {
CamelObjectClass parent;
};
-CamelType camel_key_table_get_type (void);
+GType camel_key_table_get_type (void);
CamelKeyTable * camel_key_table_new (CamelBlockFile *bs,
camel_block_t root);
gint camel_key_table_sync (CamelKeyTable *ki);
diff --git a/camel/camel-provider.h b/camel/camel-provider.h
index 0316fb9..2ffc172 100644
--- a/camel/camel-provider.h
+++ b/camel/camel-provider.h
@@ -31,8 +31,9 @@
#ifndef CAMEL_PROVIDER_H
#define CAMEL_PROVIDER_H
-#include <camel/camel-object.h>
#include <camel/camel-exception.h>
+#include <camel/camel-object.h>
+#include <camel/camel-object-bag.h>
#include <camel/camel-url.h>
#define CAMEL_PROVIDER(obj) ((CamelProvider *)(obj))
@@ -179,12 +180,12 @@ typedef struct {
/* auto-detection function */
CamelProviderAutoDetectFunc auto_detect;
- /* CamelType(s) of its store and/or transport. If both are
+ /* GType(s) of its store and/or transport. If both are
* set, then they are assumed to be linked together and the
* transport type can only be used in an account that also
* uses the store type (eg, Exchange or NNTP).
*/
- CamelType object_types[CAMEL_NUM_PROVIDER_TYPES];
+ GType object_types[CAMEL_NUM_PROVIDER_TYPES];
/* GList of CamelServiceAuthTypes the provider supports */
GList *authtypes;
diff --git a/camel/camel-sasl-anonymous.c b/camel/camel-sasl-anonymous.c
index 93fa9c4..80d4035 100644
--- a/camel/camel-sasl-anonymous.c
+++ b/camel/camel-sasl-anonymous.c
@@ -40,14 +40,17 @@ CamelServiceAuthType camel_sasl_anonymous_authtype = {
FALSE
};
-static CamelSaslClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSaslAnonymous, camel_sasl_anonymous, CAMEL_TYPE_SASL)
static void
-sasl_anonymous_finalize (CamelObject *object)
+sasl_anonymous_finalize (GObject *object)
{
CamelSaslAnonymous *sasl = CAMEL_SASL_ANONYMOUS (object);
g_free (sasl->trace_info);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_sasl_anonymous_parent_class)->finalize (object);
}
static GByteArray *
@@ -74,10 +77,10 @@ sasl_anonymous_challenge (CamelSasl *sasl,
ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
_("Invalid email address trace information:\n%s"),
sasl_anon->trace_info);
- camel_object_unref (cia);
+ g_object_unref (cia);
return NULL;
}
- camel_object_unref (cia);
+ g_object_unref (cia);
ret = g_byte_array_new ();
g_byte_array_append (ret, (guint8 *) sasl_anon->trace_info, strlen (sasl_anon->trace_info));
break;
@@ -110,31 +113,19 @@ sasl_anonymous_challenge (CamelSasl *sasl,
static void
camel_sasl_anonymous_class_init (CamelSaslAnonymousClass *class)
{
+ GObjectClass *object_class;
CamelSaslClass *sasl_class;
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = sasl_anonymous_finalize;
sasl_class = CAMEL_SASL_CLASS (class);
sasl_class->challenge = sasl_anonymous_challenge;
}
-CamelType
-camel_sasl_anonymous_get_type (void)
+static void
+camel_sasl_anonymous_init (CamelSaslAnonymous *sasl_anonymous)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslAnonymous",
- sizeof (CamelSaslAnonymous),
- sizeof (CamelSaslAnonymousClass),
- (CamelObjectClassInitFunc) camel_sasl_anonymous_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) sasl_anonymous_finalize);
- }
-
- return type;
}
/**
@@ -154,7 +145,7 @@ camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const gchar *trace_info)
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 = g_object_new (CAMEL_TYPE_SASL_ANONYMOUS, NULL);
sasl_anon->trace_info = g_strdup (trace_info);
sasl_anon->type = type;
diff --git a/camel/camel-sasl-anonymous.h b/camel/camel-sasl-anonymous.h
index ba09e84..57844ab 100644
--- a/camel/camel-sasl-anonymous.h
+++ b/camel/camel-sasl-anonymous.h
@@ -29,10 +29,24 @@
#include <camel/camel-sasl.h>
-#define CAMEL_SASL_ANONYMOUS_TYPE (camel_sasl_anonymous_get_type ())
-#define CAMEL_SASL_ANONYMOUS(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_ANONYMOUS_TYPE, CamelSaslAnonymous))
-#define CAMEL_SASL_ANONYMOUS_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_ANONYMOUS_TYPE, CamelSaslAnonymousClass))
-#define CAMEL_IS_SASL_ANONYMOUS(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_ANONYMOUS_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_ANONYMOUS \
+ (camel_sasl_anonymous_get_type ())
+#define CAMEL_SASL_ANONYMOUS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_ANONYMOUS, CamelSaslAnonymous))
+#define CAMEL_SASL_ANONYMOUS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_ANONYMOUS, CamelSaslAnonymousClass))
+#define CAMEL_IS_SASL_ANONYMOUS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_ANONYMOUS))
+#define CAMEL_IS_SASL_ANONYMOUS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_ANONYMOUS))
+#define CAMEL_SASL_ANONYMOUS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_ANONYMOUS, CamelSaslAnonymousClass))
G_BEGIN_DECLS
@@ -56,7 +70,7 @@ struct _CamelSaslAnonymousClass {
CamelSaslClass parent_class;
};
-CamelType camel_sasl_anonymous_get_type (void);
+GType camel_sasl_anonymous_get_type (void);
/* public methods */
CamelSasl *camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const gchar *trace_info);
diff --git a/camel/camel-sasl-cram-md5.c b/camel/camel-sasl-cram-md5.c
index 19c920e..e07d41d 100644
--- a/camel/camel-sasl-cram-md5.c
+++ b/camel/camel-sasl-cram-md5.c
@@ -33,6 +33,10 @@
#include "camel-sasl-cram-md5.h"
#include "camel-service.h"
+#define CAMEL_SASL_CRAM_MD5_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_CRAM_MD5, CamelSaslCramMd5Private))
+
struct _CamelSaslCramMd5Private {
gint placeholder; /* allow for future expansion */
};
@@ -47,7 +51,7 @@ CamelServiceAuthType camel_sasl_cram_md5_authtype = {
TRUE
};
-static CamelSaslClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSaslCramMd5, camel_sasl_cram_md5, CAMEL_TYPE_SASL)
/* CRAM-MD5 algorithm:
* MD5 ((passwd XOR opad), MD5 ((passwd XOR ipad), timestamp))
@@ -132,27 +136,14 @@ camel_sasl_cram_md5_class_init (CamelSaslCramMd5Class *class)
{
CamelSaslClass *sasl_class;
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelSaslCramMd5Private));
sasl_class = CAMEL_SASL_CLASS (class);
sasl_class->challenge = sasl_cram_md5_challenge;
}
-CamelType
-camel_sasl_cram_md5_get_type (void)
+static void
+camel_sasl_cram_md5_init (CamelSaslCramMd5 *sasl)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslCramMd5",
- sizeof (CamelSaslCramMd5),
- sizeof (CamelSaslCramMd5Class),
- (CamelObjectClassInitFunc) camel_sasl_cram_md5_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
+ sasl->priv = CAMEL_SASL_CRAM_MD5_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-cram-md5.h b/camel/camel-sasl-cram-md5.h
index ee1cc90..70145b5 100644
--- a/camel/camel-sasl-cram-md5.h
+++ b/camel/camel-sasl-cram-md5.h
@@ -29,10 +29,24 @@
#include <camel/camel-sasl.h>
-#define CAMEL_SASL_CRAM_MD5_TYPE (camel_sasl_cram_md5_get_type ())
-#define CAMEL_SASL_CRAM_MD5(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_CRAM_MD5_TYPE, CamelSaslCramMd5))
-#define CAMEL_SASL_CRAM_MD5_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_CRAM_MD5_TYPE, CamelSaslCramMd5Class))
-#define CAMEL_IS_SASL_CRAM_MD5(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_CRAM_MD5_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_CRAM_MD5 \
+ (camel_sasl_cram_md5_get_type ())
+#define CAMEL_SASL_CRAM_MD5(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_CRAM_MD5, CamelSaslCramMd5))
+#define CAMEL_SASL_CRAM_MD5_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_CRAM_MD5, CamelSaslCramMd5Class))
+#define CAMEL_IS_SASL_CRAM_MD5(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_CRAM_MD5))
+#define CAMEL_IS_SASL_CRAM_MD5_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_CRAM_MD5))
+#define CAMEL_SASL_CRAM_MD5_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_CRAM_MD5, CamelSaslCramMd5Class))
G_BEGIN_DECLS
@@ -49,7 +63,7 @@ struct _CamelSaslCramMd5Class {
CamelSaslClass parent_class;
};
-CamelType camel_sasl_cram_md5_get_type (void);
+GType camel_sasl_cram_md5_get_type (void);
extern CamelServiceAuthType camel_sasl_cram_md5_authtype;
diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c
index 6539e6d..c765ac7 100644
--- a/camel/camel-sasl-digest-md5.c
+++ b/camel/camel-sasl-digest-md5.c
@@ -46,6 +46,10 @@
#define PARANOID(x) x
+#define CAMEL_SASL_DIGEST_MD5_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_DIGEST_MD5, CamelSaslDigestMd5Private))
+
/* Implements rfc2831 */
CamelServiceAuthType camel_sasl_digest_md5_authtype = {
@@ -58,8 +62,6 @@ CamelServiceAuthType camel_sasl_digest_md5_authtype = {
TRUE
};
-static CamelSaslClass *parent_class = NULL;
-
enum {
STATE_AUTH,
STATE_FINAL
@@ -167,6 +169,8 @@ struct _CamelSaslDigestMd5Private {
gint state;
};
+G_DEFINE_TYPE (CamelSaslDigestMd5, camel_sasl_digest_md5, CAMEL_TYPE_SASL)
+
static void
decode_lwsp (const gchar **in)
{
@@ -733,7 +737,7 @@ digest_response (struct _DigestResponse *resp)
}
static void
-sasl_digest_md5_finalize (CamelObject *object)
+sasl_digest_md5_finalize (GObject *object)
{
CamelSaslDigestMd5 *sasl = CAMEL_SASL_DIGEST_MD5 (object);
struct _DigestChallenge *c = sasl->priv->challenge;
@@ -776,7 +780,8 @@ sasl_digest_md5_finalize (CamelObject *object)
g_free (r);
}
- g_free (sasl->priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_sasl_digest_md5_parent_class)->finalize (object);
}
static GByteArray *
@@ -914,9 +919,13 @@ sasl_digest_md5_challenge (CamelSasl *sasl,
static void
camel_sasl_digest_md5_class_init (CamelSaslDigestMd5Class *class)
{
+ GObjectClass *object_class;
CamelSaslClass *sasl_class;
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelSaslDigestMd5Private));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = sasl_digest_md5_finalize;
sasl_class = CAMEL_SASL_CLASS (class);
sasl_class->challenge = sasl_digest_md5_challenge;
@@ -925,24 +934,5 @@ camel_sasl_digest_md5_class_init (CamelSaslDigestMd5Class *class)
static void
camel_sasl_digest_md5_init (CamelSaslDigestMd5 *sasl)
{
- sasl->priv = g_new0 (CamelSaslDigestMd5Private, 1);
-}
-
-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",
- sizeof (CamelSaslDigestMd5),
- sizeof (CamelSaslDigestMd5Class),
- (CamelObjectClassInitFunc) camel_sasl_digest_md5_class_init,
- NULL,
- (CamelObjectInitFunc) camel_sasl_digest_md5_init,
- (CamelObjectFinalizeFunc) sasl_digest_md5_finalize);
- }
-
- return type;
+ sasl->priv = CAMEL_SASL_DIGEST_MD5_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-digest-md5.h b/camel/camel-sasl-digest-md5.h
index 5a12bab..62e904e 100644
--- a/camel/camel-sasl-digest-md5.h
+++ b/camel/camel-sasl-digest-md5.h
@@ -30,10 +30,24 @@
#include <sys/types.h>
#include <camel/camel-sasl.h>
-#define CAMEL_SASL_DIGEST_MD5_TYPE (camel_sasl_digest_md5_get_type ())
-#define CAMEL_SASL_DIGEST_MD5(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_DIGEST_MD5_TYPE, CamelSaslDigestMd5))
-#define CAMEL_SASL_DIGEST_MD5_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_DIGEST_MD5_TYPE, CamelSaslDigestMd5Class))
-#define CAMEL_IS_SASL_DIGEST_MD5(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_DIGEST_MD5_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_DIGEST_MD5 \
+ (camel_sasl_digest_md5_get_type ())
+#define CAMEL_SASL_DIGEST_MD5(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_DIGEST_MD5, CamelSaslDigestMd5))
+#define CAMEL_SASL_DIGEST_MD5_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_DIGEST_MD5, CamelSaslDigestMd5Class))
+#define CAMEL_IS_SASL_DIGEST_MD5(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_DIGEST_MD5))
+#define CAMEL_IS_SASL_DIGEST_MD5_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_DIGEST_MD5))
+#define CAMEL_SASL_DIGEST_MD5_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_DIGEST_MD5, CamelSaslDigestMd5Class))
G_BEGIN_DECLS
@@ -50,7 +64,7 @@ struct _CamelSaslDigestMd5Class {
CamelSaslClass parent_class;
};
-CamelType camel_sasl_digest_md5_get_type (void);
+GType camel_sasl_digest_md5_get_type (void);
extern CamelServiceAuthType camel_sasl_digest_md5_authtype;
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index 8abbc0b..64ddce9 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -74,6 +74,10 @@ extern gss_OID gss_nt_service_name;
#define DBUS_INTERFACE "org.gnome.KrbAuthDialog"
#define DBUS_METHOD "org.gnome.KrbAuthDialog.acquireTgt"
+#define CAMEL_SASL_GSSAPI_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_GSSAPI, CamelSaslGssapiPrivate))
+
CamelServiceAuthType camel_sasl_gssapi_authtype = {
N_("GSSAPI"),
@@ -103,7 +107,7 @@ struct _CamelSaslGssapiPrivate {
gss_name_t target;
};
-static CamelSaslClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSaslGssapi, camel_sasl_gssapi, CAMEL_TYPE_SASL)
static void
gssapi_set_exception (OM_uint32 major,
@@ -162,7 +166,7 @@ gssapi_set_exception (OM_uint32 major,
}
static void
-sasl_gssapi_finalize (CamelObject *object)
+sasl_gssapi_finalize (GObject *object)
{
CamelSaslGssapi *sasl = CAMEL_SASL_GSSAPI (object);
guint32 status;
@@ -174,7 +178,8 @@ sasl_gssapi_finalize (CamelObject *object)
if (sasl->priv->target != GSS_C_NO_NAME)
gss_release_name (&status, &sasl->priv->target);
- g_free (sasl->priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_sasl_gssapi_parent_class)->finalize (object);
}
/* DBUS Specific code */
@@ -241,7 +246,7 @@ sasl_gssapi_challenge (CamelSasl *sasl,
GByteArray *token,
CamelException *ex)
{
- CamelSaslGssapiPrivate *priv = CAMEL_SASL_GSSAPI (sasl)->priv;
+ CamelSaslGssapiPrivate *priv;
CamelService *service;
OM_uint32 major, minor, flags, time;
gss_buffer_desc inbuf, outbuf;
@@ -254,6 +259,8 @@ sasl_gssapi_challenge (CamelSasl *sasl,
struct addrinfo *ai, hints;
const gchar *service_name;
+ priv = CAMEL_SASL_GSSAPI_GET_PRIVATE (sasl);
+
service = camel_sasl_get_service (sasl);
service_name = camel_sasl_get_service_name (sasl);
@@ -402,9 +409,13 @@ sasl_gssapi_challenge (CamelSasl *sasl,
static void
camel_sasl_gssapi_class_init (CamelSaslGssapiClass *class)
{
+ GObjectClass *object_class;
CamelSaslClass *sasl_class;
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelSaslGssapiPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = sasl_gssapi_finalize;
sasl_class = CAMEL_SASL_CLASS (class);
sasl_class->challenge = sasl_gssapi_challenge;
@@ -413,31 +424,11 @@ camel_sasl_gssapi_class_init (CamelSaslGssapiClass *class)
static void
camel_sasl_gssapi_init (CamelSaslGssapi *sasl)
{
- sasl->priv = g_new (struct _CamelSaslGssapiPrivate, 1);
+ sasl->priv = CAMEL_SASL_GSSAPI_GET_PRIVATE (sasl);
sasl->priv->state = GSSAPI_STATE_INIT;
sasl->priv->ctx = GSS_C_NO_CONTEXT;
sasl->priv->target = GSS_C_NO_NAME;
}
-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 (),
- "CamelSaslGssapi",
- sizeof (CamelSaslGssapi),
- sizeof (CamelSaslGssapiClass),
- (CamelObjectClassInitFunc) camel_sasl_gssapi_class_init,
- NULL,
- (CamelObjectInitFunc) camel_sasl_gssapi_init,
- (CamelObjectFinalizeFunc) sasl_gssapi_finalize);
- }
-
- return type;
-}
-
#endif /* HAVE_KRB5 */
diff --git a/camel/camel-sasl-gssapi.h b/camel/camel-sasl-gssapi.h
index 5437a67..a921211 100644
--- a/camel/camel-sasl-gssapi.h
+++ b/camel/camel-sasl-gssapi.h
@@ -30,10 +30,24 @@
#include <sys/types.h>
#include <camel/camel-sasl.h>
-#define CAMEL_SASL_GSSAPI_TYPE (camel_sasl_gssapi_get_type ())
-#define CAMEL_SASL_GSSAPI(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_GSSAPI_TYPE, CamelSaslGssapi))
-#define CAMEL_SASL_GSSAPI_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_GSSAPI_TYPE, CamelSaslGssapiClass))
-#define CAMEL_IS_SASL_GSSAPI(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_GSSAPI_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_GSSAPI \
+ (camel_sasl_gssapi_get_type ())
+#define CAMEL_SASL_GSSAPI(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_GSSAPI, CamelSaslGssapi))
+#define CAMEL_SASL_GSSAPI_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_GSSAPI, CamelSaslGssapiClass))
+#define CAMEL_IS_SASL_GSSAPI(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_GSSAPI))
+#define CAMEL_IS_SASL_GSSAPI_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_GSSAPI))
+#define CAMEL_SASL_GSSAPI_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_GSSAPI, CamelSaslGssapiClass))
G_BEGIN_DECLS
@@ -50,7 +64,7 @@ struct _CamelSaslGssapiClass {
CamelSaslClass parent_class;
};
-CamelType camel_sasl_gssapi_get_type (void);
+GType camel_sasl_gssapi_get_type (void);
extern CamelServiceAuthType camel_sasl_gssapi_authtype;
diff --git a/camel/camel-sasl-login.c b/camel/camel-sasl-login.c
index 28f794c..4d5cabf 100644
--- a/camel/camel-sasl-login.c
+++ b/camel/camel-sasl-login.c
@@ -31,6 +31,10 @@
#include "camel-sasl-login.h"
#include "camel-service.h"
+#define CAMEL_SASL_LOGIN_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_LOGIN, CamelSaslLoginPrivate))
+
CamelServiceAuthType camel_sasl_login_authtype = {
N_("Login"),
@@ -46,30 +50,24 @@ enum {
LOGIN_PASSWD
};
-static CamelSaslClass *parent_class = NULL;
-
struct _CamelSaslLoginPrivate {
gint state;
};
-static void
-sasl_login_finalize (CamelObject *object)
-{
- CamelSaslLogin *sasl = CAMEL_SASL_LOGIN (object);
-
- g_free (sasl->priv);
-}
+G_DEFINE_TYPE (CamelSaslLogin, camel_sasl_login, CAMEL_TYPE_SASL)
static GByteArray *
sasl_login_challenge (CamelSasl *sasl,
GByteArray *token,
CamelException *ex)
{
- CamelSaslLoginPrivate *priv = CAMEL_SASL_LOGIN (sasl)->priv;
+ CamelSaslLoginPrivate *priv;
GByteArray *buf = NULL;
CamelService *service;
CamelURL *url;
+ priv = CAMEL_SASL_LOGIN_GET_PRIVATE (sasl);
+
service = camel_sasl_get_service (sasl);
url = service->url;
g_return_val_if_fail (url->passwd != NULL, NULL);
@@ -106,7 +104,7 @@ camel_sasl_login_class_init (CamelSaslLoginClass *class)
{
CamelSaslClass *sasl_class;
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelSaslLoginPrivate));
sasl_class = CAMEL_SASL_CLASS (class);
sasl_class->challenge = sasl_login_challenge;
@@ -115,24 +113,5 @@ camel_sasl_login_class_init (CamelSaslLoginClass *class)
static void
camel_sasl_login_init (CamelSaslLogin *sasl)
{
- sasl->priv = g_new0 (struct _CamelSaslLoginPrivate, 1);
-}
-
-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",
- sizeof (CamelSaslLogin),
- sizeof (CamelSaslLoginClass),
- (CamelObjectClassInitFunc) camel_sasl_login_class_init,
- NULL,
- (CamelObjectInitFunc) camel_sasl_login_init,
- (CamelObjectFinalizeFunc) sasl_login_finalize);
- }
-
- return type;
+ sasl->priv = CAMEL_SASL_LOGIN_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-login.h b/camel/camel-sasl-login.h
index 427e3ce..e17bbf8 100644
--- a/camel/camel-sasl-login.h
+++ b/camel/camel-sasl-login.h
@@ -29,10 +29,24 @@
#include <camel/camel-sasl.h>
-#define CAMEL_SASL_LOGIN_TYPE (camel_sasl_login_get_type ())
-#define CAMEL_SASL_LOGIN(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_LOGIN_TYPE, CamelSaslLogin))
-#define CAMEL_SASL_LOGIN_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_LOGIN_TYPE, CamelSaslLoginClass))
-#define CAMEL_IS_SASL_LOGIN(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_LOGIN_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_LOGIN \
+ (camel_sasl_login_get_type ())
+#define CAMEL_SASL_LOGIN(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_LOGIN, CamelSaslLogin))
+#define CAMEL_SASL_LOGIN_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_LOGIN, CamelSaslLoginClass))
+#define CAMEL_IS_SASL_LOGIN(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_LOGIN))
+#define CAMEL_IS_SASL_LOGIN_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_LOGIN))
+#define CAMEL_SASL_LOGIN_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_LOGIN, CamelSaslLoginClass))
G_BEGIN_DECLS
@@ -49,7 +63,7 @@ struct _CamelSaslLoginClass {
CamelSaslClass parent_class;
};
-CamelType camel_sasl_login_get_type (void);
+GType camel_sasl_login_get_type (void);
extern CamelServiceAuthType camel_sasl_login_authtype;
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index ed855dd..7d81430 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -29,6 +29,10 @@
#include "camel-sasl-ntlm.h"
+#define CAMEL_SASL_NTLM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_NTLM, CamelSaslNTLMPrivate))
+
struct _CamelSaslNTLMPrivate {
gint placeholder; /* allow for future expansion */
};
@@ -43,7 +47,7 @@ CamelServiceAuthType camel_sasl_ntlm_authtype = {
TRUE
};
-static CamelSaslClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSaslNTLM, camel_sasl_ntlm, CAMEL_TYPE_SASL)
#define NTLM_REQUEST "NTLMSSP\x00\x01\x00\x00\x00\x06\x82\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00"
@@ -722,25 +726,14 @@ camel_sasl_ntlm_class_init (CamelSaslNTLMClass *class)
{
CamelSaslClass *sasl_class;
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelSaslNTLMPrivate));
sasl_class = CAMEL_SASL_CLASS (class);
sasl_class->challenge = sasl_ntlm_challenge;
}
-CamelType
-camel_sasl_ntlm_get_type (void)
+static void
+camel_sasl_ntlm_init (CamelSaslNTLM *sasl)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_sasl_get_type (), "CamelSaslNTLM",
- sizeof (CamelSaslNTLM),
- sizeof (CamelSaslNTLMClass),
- (CamelObjectClassInitFunc) camel_sasl_ntlm_class_init,
- NULL, NULL, NULL);
- }
-
- return type;
+ sasl->priv = CAMEL_SASL_NTLM_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-ntlm.h b/camel/camel-sasl-ntlm.h
index 32142e0..c012895 100644
--- a/camel/camel-sasl-ntlm.h
+++ b/camel/camel-sasl-ntlm.h
@@ -27,10 +27,24 @@
#include <camel/camel-sasl.h>
-#define CAMEL_SASL_NTLM_TYPE (camel_sasl_ntlm_get_type ())
-#define CAMEL_SASL_NTLM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_NTLM_TYPE, CamelSaslNTLM))
-#define CAMEL_SASL_NTLM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_NTLM_TYPE, CamelSaslNTLMClass))
-#define CAMEL_IS_SASL_NTLM(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_NTLM_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_NTLM \
+ (camel_sasl_ntlm_get_type ())
+#define CAMEL_SASL_NTLM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_NTLM, CamelSaslNTLM))
+#define CAMEL_SASL_NTLM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_NTLM, CamelSaslNTLMClass))
+#define CAMEL_IS_SASL_NTLM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_NTLM))
+#define CAMEL_IS_SASL_NTLM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_NTLM))
+#define CAMEL_SASL_NTLM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_NTLM, CamelSaslNTLMClass))
G_BEGIN_DECLS
@@ -47,7 +61,7 @@ struct _CamelSaslNTLMClass {
CamelSaslClass parent_class;
};
-CamelType camel_sasl_ntlm_get_type (void);
+GType camel_sasl_ntlm_get_type (void);
extern CamelServiceAuthType camel_sasl_ntlm_authtype;
diff --git a/camel/camel-sasl-plain.c b/camel/camel-sasl-plain.c
index d1b28e1..6c83149 100644
--- a/camel/camel-sasl-plain.c
+++ b/camel/camel-sasl-plain.c
@@ -31,6 +31,10 @@
#include "camel-sasl-plain.h"
#include "camel-service.h"
+#define CAMEL_SASL_PLAIN_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_PLAIN, CamelSaslPlainPrivate))
+
struct _CamelSaslPlainPrivate {
gint placeholder; /* allow for future expansion */
};
@@ -45,7 +49,7 @@ CamelServiceAuthType camel_sasl_plain_authtype = {
TRUE
};
-static CamelSaslClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSaslPlain, camel_sasl_plain, CAMEL_TYPE_SASL)
static GByteArray *
sasl_plain_challenge (CamelSasl *sasl,
@@ -77,27 +81,14 @@ camel_sasl_plain_class_init (CamelSaslPlainClass *class)
{
CamelSaslClass *sasl_class;
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelSaslPlainPrivate));
sasl_class = CAMEL_SASL_CLASS (class);
sasl_class->challenge = sasl_plain_challenge;
}
-CamelType
-camel_sasl_plain_get_type (void)
+static void
+camel_sasl_plain_init (CamelSaslPlain *sasl)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslPlain",
- sizeof (CamelSaslPlain),
- sizeof (CamelSaslPlainClass),
- (CamelObjectClassInitFunc) camel_sasl_plain_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
+ sasl->priv = CAMEL_SASL_PLAIN_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-plain.h b/camel/camel-sasl-plain.h
index 51451cd..761eaad 100644
--- a/camel/camel-sasl-plain.h
+++ b/camel/camel-sasl-plain.h
@@ -29,10 +29,24 @@
#include <camel/camel-sasl.h>
-#define CAMEL_SASL_PLAIN_TYPE (camel_sasl_plain_get_type ())
-#define CAMEL_SASL_PLAIN(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_PLAIN_TYPE, CamelSaslPlain))
-#define CAMEL_SASL_PLAIN_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_PLAIN_TYPE, CamelSaslPlainClass))
-#define CAMEL_IS_SASL_PLAIN(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_PLAIN_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_PLAIN \
+ (camel_sasl_plain_get_type ())
+#define CAMEL_SASL_PLAIN(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_PLAIN, CamelSaslPlain))
+#define CAMEL_SASL_PLAIN_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_PLAIN, CamelSaslPlainClass))
+#define CAMEL_IS_SASL_PLAIN(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_PLAIN))
+#define CAMEL_IS_SASL_PLAIN_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_PLAIN))
+#define CAMEL_SASL_PLAIN_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_PLAIN, CamelSaslPlainClass))
G_BEGIN_DECLS
@@ -49,7 +63,7 @@ struct _CamelSaslPlainClass {
CamelSaslClass parent_class;
};
-CamelType camel_sasl_plain_get_type (void);
+GType camel_sasl_plain_get_type (void);
extern CamelServiceAuthType camel_sasl_plain_authtype;
diff --git a/camel/camel-sasl-popb4smtp.c b/camel/camel-sasl-popb4smtp.c
index 442a430..7fc9bba 100644
--- a/camel/camel-sasl-popb4smtp.c
+++ b/camel/camel-sasl-popb4smtp.c
@@ -34,6 +34,10 @@
#include "camel-session.h"
#include "camel-store.h"
+#define CAMEL_SASL_POPB4SMTP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_POPB4SMTP, CamelSaslPOPB4SMTPPrivate))
+
struct _CamelSaslPOPB4SMTPPrivate {
gint placeholder; /* allow for future expansion */
};
@@ -57,7 +61,7 @@ static GStaticMutex lock = G_STATIC_MUTEX_INIT;
#define POPB4SMTP_LOCK(l) g_static_mutex_lock(&l)
#define POPB4SMTP_UNLOCK(l) g_static_mutex_unlock(&l)
-static CamelSaslClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSaslPOPB4SMTP, camel_sasl_popb4smtp, CAMEL_TYPE_SASL)
static GByteArray *
sasl_popb4smtp_challenge (CamelSasl *sasl,
@@ -115,7 +119,7 @@ sasl_popb4smtp_challenge (CamelSasl *sasl,
store = camel_session_get_store(session, popuri, ex);
if (store) {
camel_sasl_set_authenticated (sasl, TRUE);
- camel_object_unref (store);
+ g_object_unref (store);
*timep = now;
} else {
camel_sasl_set_authenticated (sasl, FALSE);
@@ -134,7 +138,7 @@ camel_sasl_popb4smtp_class_init (CamelSaslPOPB4SMTPClass *class)
{
CamelSaslClass *sasl_class;
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelSaslPOPB4SMTPPrivate));
sasl_class = CAMEL_SASL_CLASS (class);
sasl_class->challenge = sasl_popb4smtp_challenge;
@@ -142,21 +146,8 @@ camel_sasl_popb4smtp_class_init (CamelSaslPOPB4SMTPClass *class)
poplast = g_hash_table_new (g_str_hash, g_str_equal);
}
-CamelType
-camel_sasl_popb4smtp_get_type (void)
+static void
+camel_sasl_popb4smtp_init (CamelSaslPOPB4SMTP *sasl)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslPOPB4SMTP",
- sizeof (CamelSaslPOPB4SMTP),
- sizeof (CamelSaslPOPB4SMTPClass),
- (CamelObjectClassInitFunc) camel_sasl_popb4smtp_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
+ sasl->priv = CAMEL_SASL_POPB4SMTP_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-popb4smtp.h b/camel/camel-sasl-popb4smtp.h
index 6f75c07..7882223 100644
--- a/camel/camel-sasl-popb4smtp.h
+++ b/camel/camel-sasl-popb4smtp.h
@@ -29,10 +29,24 @@
#include <camel/camel-sasl.h>
-#define CAMEL_SASL_POPB4SMTP_TYPE (camel_sasl_popb4smtp_get_type ())
-#define CAMEL_SASL_POPB4SMTP(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_POPB4SMTP_TYPE, CamelSaslPOPB4SMTP))
-#define CAMEL_SASL_POPB4SMTP_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_POPB4SMTP_TYPE, CamelSaslPOPB4SMTPClass))
-#define CAMEL_IS_SASL_POPB4SMTP(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_POPB4SMTP_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_POPB4SMTP \
+ (camel_sasl_popb4smtp_get_type ())
+#define CAMEL_SASL_POPB4SMTP(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_POPB4SMTP, CamelSaslPOPB4SMTP))
+#define CAMEL_SASL_POPB4SMTP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_POPB4SMTP, CamelSaslPOPB4SMTPClass))
+#define CAMEL_IS_SASL_POPB4SMTP(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_POPB4SMTP))
+#define CAMEL_IS_SASL_POPB4SMTP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_POPB4SMTP))
+#define CAMEL_SASL_POPB4SMTP_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_POPB4SMTP, CamelSaslPOPB4SMTPClass))
G_BEGIN_DECLS
@@ -49,7 +63,7 @@ struct _CamelSaslPOPB4SMTPClass {
CamelSaslClass parent_class;
};
-CamelType camel_sasl_popb4smtp_get_type (void);
+GType camel_sasl_popb4smtp_get_type (void);
extern CamelServiceAuthType camel_sasl_popb4smtp_authtype;
diff --git a/camel/camel-sasl.c b/camel/camel-sasl.c
index 467d701..76846ca 100644
--- a/camel/camel-sasl.c
+++ b/camel/camel-sasl.c
@@ -39,6 +39,10 @@
#define w(x)
+#define CAMEL_SASL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL, CamelSaslPrivate))
+
struct _CamelSaslPrivate {
CamelService *service;
gboolean authenticated;
@@ -46,7 +50,15 @@ struct _CamelSaslPrivate {
gchar *mechanism;
};
-static CamelObjectClass *parent_class = NULL;
+enum {
+ PROP_0,
+ PROP_AUTHENTICATED,
+ PROP_MECHANISM,
+ PROP_SERVICE,
+ PROP_SERVICE_NAME
+};
+
+G_DEFINE_ABSTRACT_TYPE (CamelSasl, camel_sasl, CAMEL_TYPE_OBJECT)
static void
sasl_set_mechanism (CamelSasl *sasl,
@@ -65,7 +77,7 @@ sasl_set_service (CamelSasl *sasl,
g_return_if_fail (CAMEL_IS_SERVICE (service));
g_return_if_fail (sasl->priv->service == NULL);
- sasl->priv->service = camel_object_ref (service);
+ sasl->priv->service = g_object_ref (service);
}
static void
@@ -79,43 +91,166 @@ sasl_set_service_name (CamelSasl *sasl,
}
static void
-sasl_finalize (CamelSasl *sasl)
+sasl_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- g_free (sasl->priv->mechanism);
- g_free (sasl->priv->service_name);
- camel_object_unref (sasl->priv->service);
- g_free (sasl->priv);
+ switch (property_id) {
+ case PROP_AUTHENTICATED:
+ camel_sasl_set_authenticated (
+ CAMEL_SASL (object),
+ g_value_get_boolean (value));
+ return;
+
+ case PROP_MECHANISM:
+ sasl_set_mechanism (
+ CAMEL_SASL (object),
+ g_value_get_string (value));
+ return;
+
+ case PROP_SERVICE:
+ sasl_set_service (
+ CAMEL_SASL (object),
+ g_value_get_object (value));
+ return;
+
+ case PROP_SERVICE_NAME:
+ sasl_set_service_name (
+ CAMEL_SASL (object),
+ g_value_get_string (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
static void
-camel_sasl_class_init (CamelSaslClass *camel_sasl_class)
+sasl_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- parent_class = camel_type_get_global_classfuncs (CAMEL_TYPE_OBJECT);
+ switch (property_id) {
+ case PROP_AUTHENTICATED:
+ g_value_set_boolean (
+ value, camel_sasl_get_authenticated (
+ CAMEL_SASL (object)));
+ return;
+
+ case PROP_MECHANISM:
+ g_value_set_string (
+ value, camel_sasl_get_mechanism (
+ CAMEL_SASL (object)));
+ return;
+
+ case PROP_SERVICE:
+ g_value_set_object (
+ value, camel_sasl_get_service (
+ CAMEL_SASL (object)));
+ return;
+
+ case PROP_SERVICE_NAME:
+ g_value_set_string (
+ value, camel_sasl_get_service_name (
+ CAMEL_SASL (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
static void
-camel_sasl_init (CamelSasl *sasl)
+sasl_dispose (GObject *object)
{
- sasl->priv = g_new0 (CamelSaslPrivate, 1);
+ CamelSaslPrivate *priv;
+
+ priv = CAMEL_SASL_GET_PRIVATE (object);
+
+ if (priv->service != NULL) {
+ g_object_unref (priv->service);
+ priv->service = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_sasl_parent_class)->dispose (object);
}
-CamelType
-camel_sasl_get_type (void)
+static void
+sasl_finalize (GObject *object)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_TYPE_OBJECT,
- "CamelSasl",
- sizeof (CamelSasl),
- sizeof (CamelSaslClass),
- (CamelObjectClassInitFunc) camel_sasl_class_init,
- NULL,
- (CamelObjectInitFunc) camel_sasl_init,
- (CamelObjectFinalizeFunc) sasl_finalize);
- }
+ CamelSaslPrivate *priv;
- return type;
+ priv = CAMEL_SASL_GET_PRIVATE (object);
+
+ g_free (priv->mechanism);
+ g_free (priv->service_name);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_sasl_parent_class)->finalize (object);
+}
+
+static void
+camel_sasl_class_init (CamelSaslClass *class)
+{
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelSaslPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = sasl_set_property;
+ object_class->get_property = sasl_get_property;
+ object_class->dispose = sasl_dispose;
+ object_class->finalize = sasl_finalize;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_AUTHENTICATED,
+ g_param_spec_boolean (
+ "authenticated",
+ "Authenticated",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MECHANISM,
+ g_param_spec_string (
+ "mechanism",
+ "Mechanism",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SERVICE,
+ g_param_spec_object (
+ "service",
+ "Service",
+ NULL,
+ CAMEL_TYPE_SERVICE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SERVICE_NAME,
+ g_param_spec_string (
+ "service-name",
+ "Service Name",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+}
+
+static void
+camel_sasl_init (CamelSasl *sasl)
+{
+ sasl->priv = CAMEL_SASL_GET_PRIVATE (sasl);
}
/**
@@ -209,7 +344,7 @@ camel_sasl_new (const gchar *service_name,
const gchar *mechanism,
CamelService *service)
{
- CamelSasl *sasl;
+ GType type;
g_return_val_if_fail (service_name != NULL, NULL);
g_return_val_if_fail (mechanism != NULL, NULL);
@@ -218,29 +353,27 @@ camel_sasl_new (const gchar *service_name,
/* 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);
+ type = CAMEL_TYPE_SASL_CRAM_MD5;
else if (!strcmp (mechanism, "DIGEST-MD5"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_DIGEST_MD5_TYPE);
+ type = CAMEL_TYPE_SASL_DIGEST_MD5;
#ifdef HAVE_KRB5
else if (!strcmp (mechanism, "GSSAPI"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_GSSAPI_TYPE);
+ type = CAMEL_TYPE_SASL_GSSAPI;
#endif
else if (!strcmp (mechanism, "PLAIN"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_PLAIN_TYPE);
+ type = CAMEL_TYPE_SASL_PLAIN;
else if (!strcmp (mechanism, "LOGIN"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_LOGIN_TYPE);
+ type = CAMEL_TYPE_SASL_LOGIN;
else if (!strcmp (mechanism, "POPB4SMTP"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_POPB4SMTP_TYPE);
+ type = CAMEL_TYPE_SASL_POPB4SMTP;
else if (!strcmp (mechanism, "NTLM"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_NTLM_TYPE);
+ type = CAMEL_TYPE_SASL_NTLM;
else
return NULL;
- sasl_set_mechanism (sasl, mechanism);
- sasl_set_service (sasl, service);
- sasl_set_service_name (sasl, service_name);
-
- return sasl;
+ return g_object_new (
+ type, "mechanism", mechanism, "service",
+ service, "service-name", service_name, NULL);
}
/**
@@ -267,6 +400,8 @@ camel_sasl_set_authenticated (CamelSasl *sasl,
g_return_if_fail (CAMEL_IS_SASL (sasl));
sasl->priv->authenticated = authenticated;
+
+ g_object_notify (G_OBJECT (sasl), "authenticated");
}
const gchar *
diff --git a/camel/camel-sasl.h b/camel/camel-sasl.h
index 482c1c2..a978940 100644
--- a/camel/camel-sasl.h
+++ b/camel/camel-sasl.h
@@ -31,12 +31,24 @@
#include <camel/camel-exception.h>
#include <camel/camel-service.h>
-#define CAMEL_SASL_TYPE (camel_sasl_get_type ())
-#define CAMEL_SASL(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_TYPE, CamelSasl))
-#define CAMEL_SASL_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_TYPE, CamelSaslClass))
-#define CAMEL_IS_SASL(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL \
+ (camel_sasl_get_type ())
+#define CAMEL_SASL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL, CamelSasl))
+#define CAMEL_SASL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL, CamelSaslClass))
+#define CAMEL_IS_SASL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL))
+#define CAMEL_IS_SASL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL))
#define CAMEL_SASL_GET_CLASS(obj) \
- ((CamelSaslClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL, CamelSaslClass))
G_BEGIN_DECLS
@@ -57,7 +69,7 @@ struct _CamelSaslClass {
CamelException *ex);
};
-CamelType camel_sasl_get_type (void);
+GType camel_sasl_get_type (void);
GByteArray * camel_sasl_challenge (CamelSasl *sasl,
GByteArray *token,
CamelException *ex);
diff --git a/camel/camel-search-private.c b/camel/camel-search-private.c
index 97875be..ec1ec3e 100644
--- a/camel/camel-search-private.c
+++ b/camel/camel-search-private.c
@@ -440,7 +440,7 @@ camel_search_header_match (const gchar *value, const gchar *match, camel_search_
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);
+ g_object_unref (cia);
break;
}
@@ -483,7 +483,7 @@ camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
camel_data_wrapper_write_to_stream (containee, stream);
camel_stream_write (stream, "", 1);
truth = regexec (pattern, (gchar *) byte_array->data, 0, NULL, 0) == 0;
- camel_object_unref (stream);
+ g_object_unref (stream);
}
return truth;
diff --git a/camel/camel-seekable-stream.c b/camel/camel-seekable-stream.c
index 1e86002..a76d5b4 100644
--- a/camel/camel-seekable-stream.c
+++ b/camel/camel-seekable-stream.c
@@ -27,7 +27,7 @@
#include "camel-seekable-stream.h"
-static CamelStreamClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSeekableStream, camel_seekable_stream, CAMEL_TYPE_STREAM)
static gint
seekable_stream_reset (CamelStream *stream)
@@ -68,8 +68,6 @@ camel_seekable_stream_class_init (CamelSeekableStreamClass *class)
{
CamelStreamClass *stream_class;
- parent_class = CAMEL_STREAM_CLASS( camel_type_get_global_classfuncs( CAMEL_STREAM_TYPE ) );
-
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->reset = seekable_stream_reset;
@@ -84,25 +82,6 @@ camel_seekable_stream_init (CamelSeekableStream *stream)
stream->bound_end = CAMEL_STREAM_UNBOUND;
}
-CamelType
-camel_seekable_stream_get_type (void)
-{
- static CamelType camel_seekable_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_seekable_stream_type == CAMEL_INVALID_TYPE) {
- camel_seekable_stream_type = camel_type_register( CAMEL_STREAM_TYPE,
- "CamelSeekableStream",
- sizeof( CamelSeekableStream ),
- sizeof( CamelSeekableStreamClass ),
- (CamelObjectClassInitFunc) camel_seekable_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_seekable_stream_init,
- NULL );
- }
-
- return camel_seekable_stream_type;
-}
-
/**
* camel_seekable_stream_seek:
* @stream: a #CamelStream object
diff --git a/camel/camel-seekable-stream.h b/camel/camel-seekable-stream.h
index b09915c..928f50f 100644
--- a/camel/camel-seekable-stream.h
+++ b/camel/camel-seekable-stream.h
@@ -33,12 +33,24 @@
#include <unistd.h>
#include <camel/camel-stream.h>
-#define CAMEL_SEEKABLE_STREAM_TYPE (camel_seekable_stream_get_type ())
-#define CAMEL_SEEKABLE_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SEEKABLE_STREAM_TYPE, CamelSeekableStream))
-#define CAMEL_SEEKABLE_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SEEKABLE_STREAM_TYPE, CamelSeekableStreamClass))
-#define CAMEL_IS_SEEKABLE_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_SEEKABLE_STREAM_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SEEKABLE_STREAM \
+ (camel_seekable_stream_get_type ())
+#define CAMEL_SEEKABLE_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SEEKABLE_STREAM, CamelSeekableStream))
+#define CAMEL_SEEKABLE_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SEEKABLE_STREAM, CamelSeekableStreamClass))
+#define CAMEL_IS_SEEKABLE_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SEEKABLE_STREAM))
+#define CAMEL_IS_SEEKABLE_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SEEKABLE_STREAM))
#define CAMEL_SEEKABLE_STREAM_GET_CLASS(obj) \
- ((CamelSeekableStreamClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SEEKABLE_STREAM, CamelSeekableStreamClass))
G_BEGIN_DECLS
@@ -73,7 +85,7 @@ struct _CamelSeekableStreamClass {
off_t end);
};
-CamelType camel_seekable_stream_get_type (void);
+GType camel_seekable_stream_get_type (void);
off_t camel_seekable_stream_seek (CamelSeekableStream *stream,
off_t offset,
CamelStreamSeekPolicy policy);
diff --git a/camel/camel-seekable-substream.c b/camel/camel-seekable-substream.c
index e7733f6..c2b40bf 100644
--- a/camel/camel-seekable-substream.c
+++ b/camel/camel-seekable-substream.c
@@ -27,7 +27,7 @@
#include "camel-seekable-substream.h"
-static CamelSeekableStreamClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSeekableSubstream, camel_seekable_substream, CAMEL_TYPE_SEEKABLE_STREAM)
static gboolean
seekable_substream_parent_reset (CamelSeekableSubstream *seekable_substream,
@@ -44,10 +44,19 @@ seekable_substream_parent_reset (CamelSeekableSubstream *seekable_substream,
}
static void
-camel_seekable_substream_finalize (CamelSeekableSubstream *seekable_substream)
+seekable_substream_dispose (GObject *object)
{
- if (seekable_substream->parent_stream != NULL)
- camel_object_unref (seekable_substream->parent_stream);
+ CamelSeekableSubstream *seekable_substream;
+
+ seekable_substream = CAMEL_SEEKABLE_SUBSTREAM (object);
+
+ if (seekable_substream->parent_stream != NULL) {
+ g_object_unref (seekable_substream->parent_stream);
+ seekable_substream = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_seekable_substream_parent_class)->dispose (object);
}
static gssize
@@ -221,10 +230,12 @@ seekable_substream_seek (CamelSeekableStream *seekable_stream,
static void
camel_seekable_substream_class_init (CamelSeekableSubstreamClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
CamelSeekableStreamClass *seekable_stream_class;
- parent_class = CAMEL_SEEKABLE_STREAM_CLASS (camel_type_get_global_classfuncs (camel_seekable_stream_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = seekable_substream_dispose;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = seekable_substream_read;
@@ -242,24 +253,6 @@ camel_seekable_substream_init (CamelSeekableSubstream *seekable_substream)
{
}
-CamelType
-camel_seekable_substream_get_type (void)
-{
- static CamelType camel_seekable_substream_type = CAMEL_INVALID_TYPE;
-
- if (camel_seekable_substream_type == CAMEL_INVALID_TYPE) {
- camel_seekable_substream_type = camel_type_register (camel_seekable_stream_get_type (), "CamelSeekableSubstream",
- sizeof (CamelSeekableSubstream),
- sizeof (CamelSeekableSubstreamClass),
- (CamelObjectClassInitFunc) camel_seekable_substream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_seekable_substream_init,
- (CamelObjectFinalizeFunc) camel_seekable_substream_finalize);
- }
-
- return camel_seekable_substream_type;
-}
-
/**
* camel_seekable_substream_new:
* @parent_stream: a #CamelSeekableStream object
@@ -285,10 +278,10 @@ camel_seekable_substream_new(CamelSeekableStream *parent_stream, off_t start, of
g_return_val_if_fail (CAMEL_IS_SEEKABLE_STREAM (parent_stream), NULL);
/* Create the seekable substream. */
- seekable_substream = CAMEL_SEEKABLE_SUBSTREAM (camel_object_new (camel_seekable_substream_get_type ()));
+ seekable_substream = g_object_new (CAMEL_TYPE_SEEKABLE_SUBSTREAM, NULL);
/* Initialize it. */
- seekable_substream->parent_stream = camel_object_ref (parent_stream);
+ seekable_substream->parent_stream = g_object_ref (parent_stream);
/* Set the bound of the substream. We can ignore any possible error
* here, because if we fail to seek now, it will try again later. */
diff --git a/camel/camel-seekable-substream.h b/camel/camel-seekable-substream.h
index b0864d2..877f939 100644
--- a/camel/camel-seekable-substream.h
+++ b/camel/camel-seekable-substream.h
@@ -31,10 +31,24 @@
#include <camel/camel-seekable-stream.h>
-#define CAMEL_SEEKABLE_SUBSTREAM_TYPE (camel_seekable_substream_get_type ())
-#define CAMEL_SEEKABLE_SUBSTREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SEEKABLE_SUBSTREAM_TYPE, CamelSeekableSubstream))
-#define CAMEL_SEEKABLE_SUBSTREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SEEKABLE_SUBSTREAM_TYPE, CamelSeekableSubstreamClass))
-#define CAMEL_IS_SEEKABLE_SUBSTREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_SEEKABLE_SUBSTREAM_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SEEKABLE_SUBSTREAM \
+ (camel_seekable_substream_get_type ())
+#define CAMEL_SEEKABLE_SUBSTREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SEEKABLE_SUBSTREAM, CamelSeekableSubstream))
+#define CAMEL_SEEKABLE_SUBSTREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SEEKABLE_SUBSTREAM, CamelSeekableSubstreamClass))
+#define CAMEL_IS_SEEKABLE_SUBSTREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SEEKABLE_SUBSTREAM))
+#define CAMEL_IS_SEEKABLE_SUBSTREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SEEKABLE_SUBSTREAM))
+#define CAMEL_SEEKABLE_SUBSTREAM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SEEKABLE_SUBSTREAM, CamelSeekableSubstreamClass))
G_BEGIN_DECLS
@@ -52,7 +66,7 @@ struct _CamelSeekableSubstreamClass {
CamelSeekableStreamClass parent_class;
};
-CamelType camel_seekable_substream_get_type (void);
+GType camel_seekable_substream_get_type (void);
/* public methods */
diff --git a/camel/camel-service.c b/camel/camel-service.c
index f2215ad..cc2986c 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -42,15 +42,19 @@
#define d(x)
#define w(x)
+#define CAMEL_SERVICE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SERVICE, CamelServicePrivate))
+
struct _CamelServicePrivate {
GStaticRecMutex connect_lock; /* for locking connection operations */
GStaticMutex connect_op_lock; /* for locking the connection_op */
};
-static CamelObjectClass *camel_service_parent_class = NULL;
+G_DEFINE_ABSTRACT_TYPE (CamelService, camel_service, CAMEL_TYPE_OBJECT)
static void
-camel_service_finalize (CamelObject *object)
+service_finalize (GObject *object)
{
CamelService *service = CAMEL_SERVICE (object);
@@ -70,12 +74,13 @@ camel_service_finalize (CamelObject *object)
camel_url_free (service->url);
if (service->session)
- camel_object_unref (service->session);
+ g_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);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_service_parent_class)->finalize (object);
}
static gint
@@ -221,7 +226,7 @@ service_construct (CamelService *service,
service->provider = provider;
service->url = camel_url_copy(url);
- service->session = camel_object_ref (session);
+ service->session = g_object_ref (session);
service->status = CAMEL_SERVICE_DISCONNECTED;
@@ -275,9 +280,9 @@ service_get_name (CamelService *service,
{
g_warning (
"%s does not implement CamelServiceClass::get_name()",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (service)));
+ G_OBJECT_TYPE_NAME (service));
- return g_strdup (camel_type_to_name (CAMEL_OBJECT_GET_TYPE (service)));
+ return g_strdup (G_OBJECT_TYPE_NAME (service));
}
static gchar *
@@ -326,9 +331,13 @@ service_get_path (CamelService *service)
static void
camel_service_class_init (CamelServiceClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
- camel_service_parent_class = camel_type_get_global_classfuncs (CAMEL_TYPE_OBJECT);
+ g_type_class_add_private (class, sizeof (CamelServicePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = service_finalize;
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->setv = service_setv;
@@ -346,32 +355,12 @@ camel_service_class_init (CamelServiceClass *class)
static void
camel_service_init (CamelService *service)
{
- service->priv = g_malloc0(sizeof(*service->priv));
+ service->priv = CAMEL_SERVICE_GET_PRIVATE (service);
g_static_rec_mutex_init (&service->priv->connect_lock);
g_static_mutex_init (&service->priv->connect_op_lock);
}
-CamelType
-camel_service_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type =
- camel_type_register (CAMEL_TYPE_OBJECT,
- "CamelService",
- sizeof (CamelService),
- sizeof (CamelServiceClass),
- (CamelObjectClassInitFunc) camel_service_class_init,
- NULL,
- (CamelObjectInitFunc) camel_service_init,
- camel_service_finalize );
- }
-
- return type;
-}
-
/**
* camel_service_construct:
* @service: a #CamelService object
@@ -520,6 +509,7 @@ camel_service_disconnect (CamelService *service,
camel_service_unlock (service, CS_REC_CONNECT_LOCK);
service->status = CAMEL_SERVICE_DISCONNECTED;
+
return res;
}
@@ -690,24 +680,23 @@ camel_service_query_auth_types (CamelService *service,
*
* Locks #service's #lock. Unlock it with camel_service_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_service_lock (CamelService *service, CamelServiceLock lock)
+camel_service_lock (CamelService *service,
+ CamelServiceLock lock)
{
- g_return_if_fail (service != NULL);
g_return_if_fail (CAMEL_IS_SERVICE (service));
- g_return_if_fail (service->priv != NULL);
switch (lock) {
- case CS_REC_CONNECT_LOCK:
- g_static_rec_mutex_lock (&service->priv->connect_lock);
- break;
- case CS_CONNECT_OP_LOCK:
- g_static_mutex_lock (&service->priv->connect_op_lock);
- break;
- default:
- g_return_if_reached ();
+ case CS_REC_CONNECT_LOCK:
+ g_static_rec_mutex_lock (&service->priv->connect_lock);
+ break;
+ case CS_CONNECT_OP_LOCK:
+ g_static_mutex_lock (&service->priv->connect_op_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
@@ -718,23 +707,22 @@ camel_service_lock (CamelService *service, CamelServiceLock lock)
*
* Unlocks #service's #lock, previously locked with camel_service_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_service_unlock (CamelService *service, CamelServiceLock lock)
+camel_service_unlock (CamelService *service,
+ CamelServiceLock lock)
{
- g_return_if_fail (service != NULL);
g_return_if_fail (CAMEL_IS_SERVICE (service));
- g_return_if_fail (service->priv != NULL);
switch (lock) {
- case CS_REC_CONNECT_LOCK:
- g_static_rec_mutex_unlock (&service->priv->connect_lock);
- break;
- case CS_CONNECT_OP_LOCK:
- g_static_mutex_unlock (&service->priv->connect_op_lock);
- break;
- default:
- g_return_if_reached ();
+ case CS_REC_CONNECT_LOCK:
+ g_static_rec_mutex_unlock (&service->priv->connect_lock);
+ break;
+ case CS_CONNECT_OP_LOCK:
+ g_static_mutex_unlock (&service->priv->connect_op_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
diff --git a/camel/camel-service.h b/camel/camel-service.h
index 3138812..aadd3a7 100644
--- a/camel/camel-service.h
+++ b/camel/camel-service.h
@@ -34,12 +34,24 @@
#include <camel/camel-provider.h>
#include <camel/camel-operation.h>
-#define CAMEL_SERVICE_TYPE (camel_service_get_type ())
-#define CAMEL_SERVICE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SERVICE_TYPE, CamelService))
-#define CAMEL_SERVICE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SERVICE_TYPE, CamelServiceClass))
-#define CAMEL_IS_SERVICE(o) (CAMEL_CHECK_TYPE((o), CAMEL_SERVICE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SERVICE \
+ (camel_service_get_type ())
+#define CAMEL_SERVICE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SERVICE, CamelService))
+#define CAMEL_SERVICE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SERVICE, CamelServiceClass))
+#define CAMEL_IS_SERVICE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SERVICE))
+#define CAMEL_IS_SERVICE_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SERVICE))
#define CAMEL_SERVICE_GET_CLASS(obj) \
- ((CamelServiceClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SERVICE, CamelServiceClass))
G_BEGIN_DECLS
@@ -117,7 +129,7 @@ typedef struct {
gboolean need_password; /* needs a password to authenticate */
} CamelServiceAuthType;
-CamelType camel_service_get_type (void);
+GType camel_service_get_type (void);
gboolean camel_service_construct (CamelService *service,
struct _CamelSession *session,
CamelProvider *provider,
@@ -138,9 +150,10 @@ struct _CamelSession *
CamelProvider * camel_service_get_provider (CamelService *service);
GList * camel_service_query_auth_types (CamelService *service,
CamelException *ex);
-
-void camel_service_lock (CamelService *service, CamelServiceLock lock);
-void camel_service_unlock (CamelService *service, CamelServiceLock lock);
+void camel_service_lock (CamelService *service,
+ CamelServiceLock lock);
+void camel_service_unlock (CamelService *service,
+ CamelServiceLock lock);
G_END_DECLS
diff --git a/camel/camel-session.c b/camel/camel-session.c
index c72f294..e7bc424 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -49,6 +49,10 @@
#define d(x)
+#define CAMEL_SESSION_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SESSION, CamelSessionPrivate))
+
struct _CamelSessionPrivate {
GMutex *lock; /* for locking everything basically */
GMutex *thread_lock; /* locking threads */
@@ -59,9 +63,10 @@ struct _CamelSessionPrivate {
GHashTable *thread_msg_op;
GHashTable *junk_headers;
-
};
+G_DEFINE_TYPE (CamelSession, camel_session, CAMEL_TYPE_OBJECT)
+
static void
cs_thread_status (CamelOperation *op,
const gchar *what,
@@ -78,7 +83,7 @@ cs_thread_status (CamelOperation *op,
}
static void
-session_finalize (CamelObject *object)
+session_finalize (GObject *object)
{
CamelSession *session = CAMEL_SESSION (object);
GThreadPool *thread_pool = session->priv->thread_pool;
@@ -101,7 +106,8 @@ session_finalize (CamelObject *object)
g_hash_table_destroy (session->priv->junk_headers);
}
- g_free(session->priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_session_parent_class)->finalize (object);
}
static CamelService *
@@ -113,7 +119,6 @@ session_get_service (CamelSession *session,
CamelURL *url;
CamelProvider *provider;
CamelService *service;
- CamelException internal_ex;
url = camel_url_new (url_string, ex);
if (!url)
@@ -144,12 +149,9 @@ session_get_service (CamelSession *session,
/* Now look up the service in the provider's cache */
service = camel_object_bag_reserve(provider->service_cache[type], url);
if (service == NULL) {
- service = (CamelService *)camel_object_new (provider->object_types[type]);
- camel_exception_init (&internal_ex);
- camel_service_construct (service, session, provider, url, &internal_ex);
- if (camel_exception_is_set (&internal_ex)) {
- camel_exception_xfer (ex, &internal_ex);
- camel_object_unref (service);
+ service = g_object_new (provider->object_types[type], NULL);
+ if (!camel_service_construct (service, session, provider, url, ex)) {
+ g_object_unref (service);
service = NULL;
camel_object_bag_abort(provider->service_cache[type], url);
} else {
@@ -201,7 +203,7 @@ session_thread_msg_new (CamelSession *session,
m = g_malloc0(size);
m->ops = ops;
- m->session = camel_object_ref (session);
+ m->session = g_object_ref (session);
m->op = camel_operation_new(cs_thread_status, m);
camel_exception_init(&m->ex);
camel_session_lock (session, CS_THREAD_LOCK);
@@ -232,7 +234,7 @@ session_thread_msg_free (CamelSession *session,
if (msg->op)
camel_operation_unref(msg->op);
camel_exception_clear(&msg->ex);
- camel_object_unref (msg->session);
+ g_object_unref (msg->session);
g_free(msg);
}
@@ -303,8 +305,14 @@ session_thread_status (CamelSession *session,
static void
camel_session_class_init (CamelSessionClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
+ g_type_class_add_private (class, sizeof (CamelSessionPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = session_finalize;
+
class->get_service = session_get_service;
class->get_storage_path = session_get_storage_path;
class->thread_msg_new = session_thread_msg_new;
@@ -320,7 +328,7 @@ camel_session_class_init (CamelSessionClass *class)
static void
camel_session_init (CamelSession *session)
{
- session->priv = g_malloc0(sizeof(*session->priv));
+ session->priv = CAMEL_SESSION_GET_PRIVATE (session);
session->online = TRUE;
session->network_state = TRUE;
@@ -333,25 +341,6 @@ camel_session_init (CamelSession *session)
session->priv->junk_headers = NULL;
}
-CamelType
-camel_session_get_type (void)
-{
- static CamelType camel_session_type = CAMEL_INVALID_TYPE;
-
- if (camel_session_type == CAMEL_INVALID_TYPE) {
- camel_session_type = camel_type_register (
- camel_object_get_type (), "CamelSession",
- sizeof (CamelSession),
- sizeof (CamelSessionClass),
- (CamelObjectClassInitFunc) camel_session_class_init,
- NULL,
- (CamelObjectInitFunc) camel_session_init,
- (CamelObjectFinalizeFunc) session_finalize);
- }
-
- return camel_session_type;
-}
-
/**
* camel_session_construct:
* @session: a #CamelSession object to construct
@@ -401,7 +390,9 @@ camel_session_get_service (CamelSession *session,
g_return_val_if_fail (class->get_service != NULL, NULL);
camel_session_lock (session, CS_SESSION_LOCK);
+
service = class->get_service (session, url_string, type, ex);
+
camel_session_unlock (session, CS_SESSION_LOCK);
return service;
@@ -434,7 +425,7 @@ camel_session_get_service_connected (CamelSession *session,
if (svc->status != CAMEL_SERVICE_CONNECTED) {
if (camel_service_connect (svc, ex) == FALSE) {
- camel_object_unref (svc);
+ g_object_unref (svc);
return NULL;
}
}
@@ -944,24 +935,23 @@ camel_session_forward_to (CamelSession *session,
*
* Locks #session's #lock. Unlock it with camel_session_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_session_lock (CamelSession *session, CamelSessionLock lock)
+camel_session_lock (CamelSession *session,
+ CamelSessionLock lock)
{
- g_return_if_fail (session != NULL);
g_return_if_fail (CAMEL_IS_SESSION (session));
- g_return_if_fail (session->priv != NULL);
switch (lock) {
- case CS_SESSION_LOCK:
- g_mutex_lock (session->priv->lock);
- break;
- case CS_THREAD_LOCK:
- g_mutex_lock (session->priv->thread_lock);
- break;
- default:
- g_return_if_reached ();
+ case CS_SESSION_LOCK:
+ g_mutex_lock (session->priv->lock);
+ break;
+ case CS_THREAD_LOCK:
+ g_mutex_lock (session->priv->thread_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
@@ -972,23 +962,22 @@ camel_session_lock (CamelSession *session, CamelSessionLock lock)
*
* Unlocks #session's #lock, previously locked with camel_session_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_session_unlock (CamelSession *session, CamelSessionLock lock)
+camel_session_unlock (CamelSession *session,
+ CamelSessionLock lock)
{
- g_return_if_fail (session != NULL);
g_return_if_fail (CAMEL_IS_SESSION (session));
- g_return_if_fail (session->priv != NULL);
switch (lock) {
- case CS_SESSION_LOCK:
- g_mutex_unlock (session->priv->lock);
- break;
- case CS_THREAD_LOCK:
- g_mutex_unlock (session->priv->thread_lock);
- break;
- default:
- g_return_if_reached ();
+ case CS_SESSION_LOCK:
+ g_mutex_unlock (session->priv->lock);
+ break;
+ case CS_THREAD_LOCK:
+ g_mutex_unlock (session->priv->thread_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
diff --git a/camel/camel-session.h b/camel/camel-session.h
index 07f9a8a..7c8c02a 100644
--- a/camel/camel-session.h
+++ b/camel/camel-session.h
@@ -36,12 +36,24 @@
#include <camel/camel-provider.h>
#include <camel/camel-service.h>
-#define CAMEL_SESSION_TYPE (camel_session_get_type ())
-#define CAMEL_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SESSION_TYPE, CamelSession))
-#define CAMEL_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SESSION_TYPE, CamelSessionClass))
-#define CAMEL_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_SESSION_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SESSION \
+ (camel_session_get_type ())
+#define CAMEL_SESSION(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SESSION, CamelSession))
+#define CAMEL_SESSION_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SESSION, CamelSessionClass))
+#define CAMEL_IS_SESSION(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SESSION))
+#define CAMEL_IS_SESSION_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SESSION))
#define CAMEL_SESSION_GET_CLASS(obj) \
- ((CamelSessionClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SESSION, CamelSessionClass))
G_BEGIN_DECLS
@@ -63,7 +75,7 @@ enum {
CAMEL_SESSION_PASSPHRASE = 1 << 4
};
-typedef enum _CamelSessionLock {
+typedef enum {
CS_SESSION_LOCK,
CS_THREAD_LOCK
} CamelSessionLock;
@@ -139,7 +151,7 @@ struct _CamelSessionClass {
CamelException *ex);
};
-CamelType camel_session_get_type (void);
+GType camel_session_get_type (void);
void camel_session_construct (CamelSession *session,
const gchar *storage_path);
@@ -243,9 +255,10 @@ void camel_session_forward_to (CamelSession *session,
CamelMimeMessage *message,
const gchar *address,
CamelException *ex);
-
-void camel_session_lock (CamelSession *session, CamelSessionLock lock);
-void camel_session_unlock (CamelSession *session, CamelSessionLock lock);
+void camel_session_lock (CamelSession *session,
+ CamelSessionLock lock);
+void camel_session_unlock (CamelSession *session,
+ CamelSessionLock lock);
G_END_DECLS
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index 68a53e6..515b5fb 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -62,6 +62,10 @@
#define d(x)
+#define CAMEL_SMIME_CONTEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SMIME_CONTEXT, CamelSMIMEContextPrivate))
+
struct _CamelSMIMEContextPrivate {
CERTCertDBHandle *certdb;
@@ -72,7 +76,7 @@ struct _CamelSMIMEContextPrivate {
guint send_encrypt_key_prefs:1;
};
-static CamelCipherContextClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelSMIMEContext, camel_smime_context, CAMEL_TYPE_CIPHER_CONTEXT)
static void
smime_cert_data_free (gpointer cert_data)
@@ -559,7 +563,7 @@ sm_verify_cmsg (CamelCipherContext *context,
mem = camel_stream_mem_new_with_byte_array (buffer);
camel_stream_write_to_stream (extstream, mem);
NSS_CMSDigestContext_Update (digcx, buffer->data, buffer->len);
- camel_object_unref (mem);
+ g_object_unref (mem);
if (NSS_CMSDigestContext_FinishMultiple (digcx, poolp, &digests) != SECSuccess) {
set_nss_error (ex, _("Cannot calculate digests"));
@@ -666,16 +670,6 @@ fail:
return NULL;
}
-static void
-smime_context_finalize (CamelObject *object)
-{
- CamelSMIMEContext *context = (CamelSMIMEContext *)object;
-
- /* FIXME: do we have to free the certdb? */
-
- g_free (context->priv);
-}
-
static const gchar *
smime_context_hash_to_id (CamelCipherContext *context,
CamelCipherHash hash)
@@ -815,7 +809,7 @@ smime_context_sign (CamelCipherContext *context,
mps->signature = sigpart;
mps->contentraw = istream;
camel_stream_reset (istream);
- camel_object_ref (istream);
+ g_object_ref (istream);
camel_medium_set_content ((CamelMedium *)opart, (CamelDataWrapper *)mps);
} else {
@@ -833,10 +827,10 @@ smime_context_sign (CamelCipherContext *context,
camel_mime_part_set_encoding (opart, CAMEL_TRANSFER_ENCODING_BASE64);
}
- camel_object_unref (dw);
+ g_object_unref (dw);
fail:
- camel_object_unref (ostream);
- camel_object_unref (istream);
+ g_object_unref (ostream);
+ g_object_unref (istream);
return res;
}
@@ -920,9 +914,9 @@ smime_context_verify (CamelCipherContext *context,
NSS_CMSMessage_Destroy (cmsg);
fail:
- camel_object_unref (mem);
+ g_object_unref (mem);
if (constream)
- camel_object_unref (constream);
+ g_object_unref (constream);
return valid;
}
@@ -1055,11 +1049,11 @@ smime_context_encrypt (CamelCipherContext *context,
camel_data_wrapper_write_to_stream ((CamelDataWrapper *)ipart, mem);
if (NSS_CMSEncoder_Update (enc, (gchar *) buffer->data, buffer->len) != SECSuccess) {
NSS_CMSEncoder_Cancel (enc);
- camel_object_unref (mem);
+ g_object_unref (mem);
set_nss_error (ex, _("Failed to add data to encoder"));
goto fail;
}
- camel_object_unref (mem);
+ g_object_unref (mem);
if (NSS_CMSEncoder_Finish(enc) != SECSuccess) {
set_nss_error (ex, _("Failed to encode data"));
@@ -1074,7 +1068,7 @@ smime_context_encrypt (CamelCipherContext *context,
dw = camel_data_wrapper_new ();
camel_data_wrapper_construct_from_stream (dw, ostream);
- camel_object_unref (ostream);
+ g_object_unref (ostream);
dw->encoding = CAMEL_TRANSFER_ENCODING_BINARY;
ct = camel_content_type_new ("application", "x-pkcs7-mime");
@@ -1084,7 +1078,7 @@ smime_context_encrypt (CamelCipherContext *context,
camel_content_type_unref (ct);
camel_medium_set_content ((CamelMedium *)opart, dw);
- camel_object_unref (dw);
+ g_object_unref (dw);
camel_mime_part_set_disposition (opart, "attachment");
camel_mime_part_set_filename (opart, "smime.p7m");
@@ -1095,7 +1089,7 @@ smime_context_encrypt (CamelCipherContext *context,
fail:
if (ostream)
- camel_object_unref (ostream);
+ g_object_unref (ostream);
if (cmsg)
NSS_CMSMessage_Destroy (cmsg);
if (bulkkey)
@@ -1106,7 +1100,7 @@ fail:
CERT_DestroyCertificate (recipient_certs[i]);
}
- PORT_FreeArena(poolp, PR_FALSE);
+ PORT_FreeArena (poolp, PR_FALSE);
return -1;
}
@@ -1134,7 +1128,7 @@ smime_context_decrypt (CamelCipherContext *context,
buffer = g_byte_array_new ();
istream = camel_stream_mem_new_with_byte_array (buffer);
camel_data_wrapper_decode_to_stream (camel_medium_get_content ((CamelMedium *)ipart), istream);
- camel_stream_reset ((CamelStream *)istream);
+ camel_stream_reset (istream);
dec = NSS_CMSDecoder_Start (NULL,
sm_write_stream, ostream, /* content callback */
@@ -1147,7 +1141,7 @@ smime_context_decrypt (CamelCipherContext *context,
cmsg = NSS_CMSDecoder_Finish (dec);
}
- camel_object_unref (istream);
+ g_object_unref (istream);
if (cmsg == NULL) {
set_nss_error (ex, _("Decoder failed"));
@@ -1177,7 +1171,7 @@ smime_context_decrypt (CamelCipherContext *context,
NSS_CMSMessage_Destroy (cmsg);
fail:
- camel_object_unref (ostream);
+ g_object_unref (ostream);
return valid;
}
@@ -1187,7 +1181,7 @@ camel_smime_context_class_init (CamelSMIMEContextClass *class)
{
CamelCipherContextClass *cipher_context_class;
- parent_class = CAMEL_CIPHER_CONTEXT_CLASS(camel_type_get_global_classfuncs(camel_cipher_context_get_type()));
+ g_type_class_add_private (class, sizeof (CamelSMIMEContextPrivate));
cipher_context_class = CAMEL_CIPHER_CONTEXT_CLASS (class);
cipher_context_class->sign_protocol = "application/x-pkcs7-signature";
@@ -1204,32 +1198,13 @@ camel_smime_context_class_init (CamelSMIMEContextClass *class)
static void
camel_smime_context_init (CamelSMIMEContext *smime_context)
{
- smime_context->priv = g_malloc0(sizeof(*smime_context->priv));
+ smime_context->priv = CAMEL_SMIME_CONTEXT_GET_PRIVATE (smime_context);
smime_context->priv->certdb = CERT_GetDefaultCertDB ();
smime_context->priv->sign_mode = CAMEL_SMIME_SIGN_CLEARSIGN;
smime_context->priv->password_tries = 0;
}
-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",
- sizeof(CamelSMIMEContext),
- sizeof(CamelSMIMEContextClass),
- (CamelObjectClassInitFunc) camel_smime_context_class_init,
- NULL,
- (CamelObjectInitFunc) camel_smime_context_init,
- (CamelObjectFinalizeFunc) smime_context_finalize);
- }
-
- return type;
-}
-
/**
* camel_smime_context_new:
* @session: session
@@ -1241,17 +1216,11 @@ camel_smime_context_get_type(void)
CamelCipherContext *
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 = CAMEL_CIPHER_CONTEXT (ctx);
- camel_cipher_context_construct (cipher, session);
-
- return cipher;
+ return g_object_new (
+ CAMEL_TYPE_SMIME_CONTEXT,
+ "session", session, NULL);
}
void
@@ -1308,8 +1277,8 @@ camel_smime_context_describe_part (CamelSMIMEContext *context, CamelMimePart *pa
NULL, NULL, /* password callback */
NULL, NULL); /* decrypt key callback */
- NSS_CMSDecoder_Update(dec, (gchar *) buffer->data, buffer->len);
- camel_object_unref (istream);
+ NSS_CMSDecoder_Update (dec, (gchar *) buffer->data, buffer->len);
+ g_object_unref (istream);
cmsg = NSS_CMSDecoder_Finish (dec);
if (cmsg) {
diff --git a/camel/camel-smime-context.h b/camel/camel-smime-context.h
index 22065af..4aed11b 100644
--- a/camel/camel-smime-context.h
+++ b/camel/camel-smime-context.h
@@ -30,10 +30,24 @@
#include <camel/camel-cipher-context.h>
-#define CAMEL_SMIME_CONTEXT_TYPE (camel_smime_context_get_type())
-#define CAMEL_SMIME_CONTEXT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SMIME_CONTEXT_TYPE, CamelSMIMEContext))
-#define CAMEL_SMIME_CONTEXT_CLASS(k)(CAMEL_CHECK_CLASS_CAST((k), CAMEL_SMIME_CONTEXT_TYPE, CamelSMIMEContextClass))
-#define CAMEL_IS_SMIME_CONTEXT(o) (CAMEL_CHECK_TYPE((o), CAMEL_SMIME_CONTEXT_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SMIME_CONTEXT \
+ (camel_smime_context_get_type())
+#define CAMEL_SMIME_CONTEXT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SMIME_CONTEXT, CamelSMIMEContext))
+#define CAMEL_SMIME_CONTEXT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SMIME_CONTEXT, CamelSMIMEContextClass))
+#define CAMEL_IS_SMIME_CONTEXT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SMIME_CONTEXT))
+#define CAMEL_IS_SMIME_CONTEXT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SMIME_CONTEXT))
+#define CAMEL_SMIME_CONTEXT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SMIME_CONTEXT, CamelSMIMEContextClass))
G_BEGIN_DECLS
@@ -62,7 +76,7 @@ struct _CamelSMIMEContextClass {
CamelCipherContextClass parent_class;
};
-CamelType camel_smime_context_get_type(void);
+GType camel_smime_context_get_type(void);
CamelCipherContext *camel_smime_context_new(CamelSession *session);
diff --git a/camel/camel-store-summary.c b/camel/camel-store-summary.c
index 295cc22..3e01cad 100644
--- a/camel/camel-store-summary.c
+++ b/camel/camel-store-summary.c
@@ -44,12 +44,6 @@
#define d(x)
#define io(x) /* io debug */
-struct _CamelStoreSummaryPrivate {
- GMutex *summary_lock; /* for the summary hashtable/array */
- GMutex *io_lock; /* load/save lock, for access to saved_count, etc */
- GMutex *ref_lock; /* for reffing/unreffing messageinfo's ALWAYS obtain before CSS_SUMMARY_LOCK */
-};
-
/* possible versions, for versioning changes */
#define CAMEL_STORE_SUMMARY_VERSION_0 (1)
#define CAMEL_STORE_SUMMARY_VERSION_2 (2)
@@ -57,13 +51,23 @@ struct _CamelStoreSummaryPrivate {
/* current version */
#define CAMEL_STORE_SUMMARY_VERSION (2)
-#define CAMEL_STORE_SUMMARY_GET_PRIVATE(o) (((CamelStoreSummary *)(o))->priv)
+#define CAMEL_STORE_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STORE_SUMMARY, CamelStoreSummaryPrivate))
-static CamelObjectClass *camel_store_summary_parent;
+struct _CamelStoreSummaryPrivate {
+ GMutex *summary_lock; /* for the summary hashtable/array */
+ GMutex *io_lock; /* load/save lock, for access to saved_count, etc */
+ GMutex *ref_lock; /* for reffing/unreffing messageinfo's ALWAYS obtain before CSS_SUMMARY_LOCK */
+};
+
+G_DEFINE_TYPE (CamelStoreSummary, camel_store_summary, CAMEL_TYPE_OBJECT)
static void
-store_summary_finalize (CamelStoreSummary *summary)
+store_summary_finalize (GObject *object)
{
+ CamelStoreSummary *summary = CAMEL_STORE_SUMMARY (object);
+
camel_store_summary_clear (summary);
g_ptr_array_free (summary->folders, TRUE);
g_hash_table_destroy (summary->folders_path);
@@ -77,7 +81,8 @@ store_summary_finalize (CamelStoreSummary *summary)
g_mutex_free (summary->priv->io_lock);
g_mutex_free (summary->priv->ref_lock);
- g_free (summary->priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_store_summary_parent_class)->finalize (object);
}
static gint
@@ -295,7 +300,12 @@ store_summary_store_info_set_string (CamelStoreSummary *summary,
static void
camel_store_summary_class_init (CamelStoreSummaryClass *class)
{
- camel_store_summary_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelStoreSummaryPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = store_summary_finalize;
class->summary_header_load = store_summary_summary_header_load;
class->summary_header_save = store_summary_summary_header_save;
@@ -310,7 +320,7 @@ camel_store_summary_class_init (CamelStoreSummaryClass *class)
static void
camel_store_summary_init (CamelStoreSummary *summary)
{
- summary->priv = g_new0 (CamelStoreSummaryPrivate, 1);
+ summary->priv = CAMEL_STORE_SUMMARY_GET_PRIVATE (summary);
summary->store_info_size = sizeof (CamelStoreInfo);
@@ -329,24 +339,6 @@ camel_store_summary_init (CamelStoreSummary *summary)
summary->priv->ref_lock = g_mutex_new ();
}
-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),
- sizeof (CamelStoreSummaryClass),
- (CamelObjectClassInitFunc) camel_store_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_store_summary_init,
- (CamelObjectFinalizeFunc) store_summary_finalize);
- }
-
- return type;
-}
-
/**
* camel_store_summary_new:
*
@@ -357,7 +349,7 @@ camel_store_summary_get_type (void)
CamelStoreSummary *
camel_store_summary_new (void)
{
- return CAMEL_STORE_SUMMARY (camel_object_new (camel_store_summary_get_type ()));
+ return g_object_new (CAMEL_TYPE_STORE_SUMMARY, NULL);
}
/**
@@ -1095,27 +1087,26 @@ camel_store_info_set_string (CamelStoreSummary *summary,
*
* Locks #summary's #lock. Unlock it with camel_store_summary_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_store_summary_lock (CamelStoreSummary *summary, CamelStoreSummaryLock lock)
+camel_store_summary_lock (CamelStoreSummary *summary,
+ CamelStoreSummaryLock lock)
{
- g_return_if_fail (summary != NULL);
g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary));
- g_return_if_fail (summary->priv != NULL);
switch (lock) {
- case CSS_SUMMARY_LOCK:
- g_mutex_lock (summary->priv->summary_lock);
- break;
- case CSS_IO_LOCK:
- g_mutex_lock (summary->priv->io_lock);
- break;
- case CSS_REF_LOCK:
- g_mutex_lock (summary->priv->ref_lock);
- break;
- default:
- g_return_if_reached ();
+ case CSS_SUMMARY_LOCK:
+ g_mutex_lock (summary->priv->summary_lock);
+ break;
+ case CSS_IO_LOCK:
+ g_mutex_lock (summary->priv->io_lock);
+ break;
+ case CSS_REF_LOCK:
+ g_mutex_lock (summary->priv->ref_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
@@ -1126,26 +1117,25 @@ camel_store_summary_lock (CamelStoreSummary *summary, CamelStoreSummaryLock lock
*
* Unlocks #summary's #lock, previously locked with camel_store_summary_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_store_summary_unlock (CamelStoreSummary *summary, CamelStoreSummaryLock lock)
+camel_store_summary_unlock (CamelStoreSummary *summary,
+ CamelStoreSummaryLock lock)
{
- g_return_if_fail (summary != NULL);
g_return_if_fail (CAMEL_IS_STORE_SUMMARY (summary));
- g_return_if_fail (summary->priv != NULL);
switch (lock) {
- case CSS_SUMMARY_LOCK:
- g_mutex_unlock (summary->priv->summary_lock);
- break;
- case CSS_IO_LOCK:
- g_mutex_unlock (summary->priv->io_lock);
- break;
- case CSS_REF_LOCK:
- g_mutex_unlock (summary->priv->ref_lock);
- break;
- default:
- g_return_if_reached ();
+ case CSS_SUMMARY_LOCK:
+ g_mutex_unlock (summary->priv->summary_lock);
+ break;
+ case CSS_IO_LOCK:
+ g_mutex_unlock (summary->priv->io_lock);
+ break;
+ case CSS_REF_LOCK:
+ g_mutex_unlock (summary->priv->ref_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
diff --git a/camel/camel-store-summary.h b/camel/camel-store-summary.h
index 7e8a338..9070264 100644
--- a/camel/camel-store-summary.h
+++ b/camel/camel-store-summary.h
@@ -32,11 +32,24 @@
#include <camel/camel-object.h>
#include <camel/camel-url.h>
-#define CAMEL_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_store_summary_get_type (), CamelStoreSummary)
-#define CAMEL_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_store_summary_get_type (), CamelStoreSummaryClass)
-#define CAMEL_IS_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_store_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_STORE_SUMMARY \
+ (camel_store_summary_get_type ())
+#define CAMEL_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STORE_SUMMARY, CamelStoreSummary))
+#define CAMEL_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STORE_SUMMARY, CamelStoreSummaryClass))
+#define CAMEL_IS_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STORE_SUMMARY))
+#define CAMEL_IS_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STORE_SUMMARY))
#define CAMEL_STORE_SUMMARY_GET_CLASS(obj) \
- ((CamelStoreSummaryClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STORE_SUMMARY, CamelStoreSummaryClass))
G_BEGIN_DECLS
@@ -89,7 +102,7 @@ typedef enum _CamelStoreSummaryFlags {
CAMEL_STORE_SUMMARY_FRAGMENT = 1<<1 /* path name is stored in fragment rather than path */
} CamelStoreSummaryFlags;
-typedef enum _CamelStoreSummaryLock {
+typedef enum {
CSS_SUMMARY_LOCK,
CSS_IO_LOCK,
CSS_REF_LOCK
@@ -136,7 +149,7 @@ struct _CamelStoreSummaryClass {
void (*store_info_set_string)(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
};
-CamelType camel_store_summary_get_type (void);
+GType camel_store_summary_get_type (void);
CamelStoreSummary *camel_store_summary_new (void);
void camel_store_summary_set_filename(CamelStoreSummary *summary, const gchar *filename);
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 31eeee1..6b3dfb5 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -44,11 +44,15 @@
#define d(x)
#define w(x)
+#define CAMEL_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STORE, CamelStorePrivate))
+
struct _CamelStorePrivate {
GStaticRecMutex folder_lock; /* for locking folder operations */
};
-static gpointer camel_store_parent_class;
+G_DEFINE_ABSTRACT_TYPE (CamelStore, camel_store, CAMEL_TYPE_SERVICE)
/**
* ignore_no_such_table_exception:
@@ -74,7 +78,7 @@ store_get_special (CamelStore *store,
for (i=0;i<folders->len;i++) {
if (!CAMEL_IS_VTRASH_FOLDER(folders->pdata[i]))
camel_vee_folder_add_folder((CamelVeeFolder *)folder, (CamelFolder *)folders->pdata[i]);
- camel_object_unref (folders->pdata[i]);
+ g_object_unref (folders->pdata[i]);
}
g_ptr_array_free(folders, TRUE);
@@ -82,8 +86,10 @@ store_get_special (CamelStore *store,
}
static void
-store_finalize (CamelStore *store)
+store_finalize (GObject *object)
{
+ CamelStore *store = CAMEL_STORE (object);
+
if (store->folders != NULL)
camel_object_bag_destroy (store->folders);
@@ -99,7 +105,26 @@ store_finalize (CamelStore *store)
store->cdb_w = NULL;
}
- g_free (store->priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_store_parent_class)->finalize (object);
+}
+
+static void
+store_constructed (GObject *object)
+{
+ CamelStore *store;
+ CamelStoreClass *class;
+
+ store = CAMEL_STORE (object);
+ class = CAMEL_STORE_GET_CLASS (store);
+
+ if (class->hash_folder_name != NULL)
+ store->folders = camel_object_bag_new (
+ class->hash_folder_name,
+ class->compare_folder_name,
+ (CamelCopyFunc) g_strdup, g_free);
+ else
+ store->folders = NULL;
}
static gboolean
@@ -115,7 +140,7 @@ store_construct (CamelService *service,
/* Chain up to parent's construct() method. */
service_class = CAMEL_SERVICE_CLASS (camel_store_parent_class);
- if (!service_class->construct(service, session, provider, url, ex))
+ if (!service_class->construct (service, session, provider, url, ex))
return FALSE;
store_db_path = g_build_filename (service->url->path, CAMEL_DB_FILE, NULL);
@@ -228,7 +253,7 @@ store_sync (CamelStore *store,
ignore_no_such_table_exception (&x);
} else if (CAMEL_IS_VEE_FOLDER(folder))
camel_vee_folder_sync_headers(folder, NULL); /* Literally don't care of vfolder exceptions */
- camel_object_unref (folder);
+ g_object_unref (folder);
}
camel_exception_xfer(ex, &x);
@@ -255,10 +280,15 @@ store_can_refresh_folder (CamelStore *store,
static void
camel_store_class_init (CamelStoreClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
CamelServiceClass *service_class;
- camel_store_parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelStorePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = store_finalize;
+ object_class->constructed = store_constructed;
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = store_construct;
@@ -284,42 +314,15 @@ camel_store_class_init (CamelStoreClass *class)
static void
camel_store_init (CamelStore *store)
{
- CamelStoreClass *store_class = CAMEL_STORE_GET_CLASS (store);
-
- if (store_class->hash_folder_name) {
- store->folders = camel_object_bag_new (
- store_class->hash_folder_name,
- store_class->compare_folder_name,
- (CamelCopyFunc) g_strdup, g_free);
- } else
- store->folders = NULL;
+ store->priv = CAMEL_STORE_GET_PRIVATE (store);
/* set vtrash and vjunk on by default */
store->flags = CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK;
store->mode = CAMEL_STORE_READ | CAMEL_STORE_WRITE;
- store->priv = g_malloc0 (sizeof (*store->priv));
g_static_rec_mutex_init (&store->priv->folder_lock);
}
-CamelType
-camel_store_get_type (void)
-{
- static CamelType camel_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_store_type == CAMEL_INVALID_TYPE) {
- camel_store_type = camel_type_register (CAMEL_SERVICE_TYPE, "CamelStore",
- sizeof (CamelStore),
- sizeof (CamelStoreClass),
- (CamelObjectClassInitFunc) camel_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_store_init,
- (CamelObjectFinalizeFunc) store_finalize );
- }
-
- return camel_store_type;
-}
-
/**
* camel_store_get_folder:
* @store: a #CamelStore object
@@ -358,7 +361,7 @@ camel_store_get_folder (CamelStore *store,
_("Cannot create folder '%s': folder exists"),
folder_name);
camel_object_bag_abort (store->folders, folder_name);
- camel_object_unref (folder);
+ g_object_unref (folder);
return NULL;
}
}
@@ -391,13 +394,13 @@ camel_store_get_folder (CamelStore *store,
if ((store->flags & CAMEL_STORE_VTRASH)
&& (vfolder = camel_object_bag_get(store->folders, CAMEL_VTRASH_NAME))) {
camel_vee_folder_add_folder(vfolder, folder);
- camel_object_unref (vfolder);
+ g_object_unref (vfolder);
}
if ((store->flags & CAMEL_STORE_VJUNK)
&& (vfolder = camel_object_bag_get(store->folders, CAMEL_VJUNK_NAME))) {
camel_vee_folder_add_folder(vfolder, folder);
- camel_object_unref (vfolder);
+ g_object_unref (vfolder);
}
}
}
@@ -474,19 +477,19 @@ cs_delete_cached_folder(CamelStore *store, const gchar *folder_name)
if ((store->flags & CAMEL_STORE_VTRASH)
&& (vfolder = camel_object_bag_get(store->folders, CAMEL_VTRASH_NAME))) {
camel_vee_folder_remove_folder(vfolder, folder);
- camel_object_unref (vfolder);
+ g_object_unref (vfolder);
}
if ((store->flags & CAMEL_STORE_VJUNK)
&& (vfolder = camel_object_bag_get(store->folders, CAMEL_VJUNK_NAME))) {
camel_vee_folder_remove_folder(vfolder, folder);
- camel_object_unref (vfolder);
+ g_object_unref (vfolder);
}
camel_folder_delete(folder);
camel_object_bag_remove(store->folders, folder);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
}
@@ -529,7 +532,7 @@ camel_store_delete_folder (CamelStore *store,
camel_store_lock (store, CS_FOLDER_LOCK);
- success = class->delete_folder(store, folder_name, &local);
+ success = class->delete_folder (store, folder_name, &local);
/* ignore 'no such table' errors */
if (camel_exception_is_set (&local) && camel_exception_get_description (&local) &&
@@ -612,7 +615,7 @@ camel_store_rename_folder (CamelStore *store,
} else {
g_ptr_array_remove_index_fast(folders, i);
i--;
- camel_object_unref (folder);
+ g_object_unref (folder);
}
}
}
@@ -637,7 +640,7 @@ camel_store_rename_folder (CamelStore *store,
g_free(new);
camel_folder_unlock (folder, CF_REC_LOCK);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
/* Emit renamed signal */
@@ -655,7 +658,7 @@ camel_store_rename_folder (CamelStore *store,
for (i=0;i<folders->len;i++) {
folder = folders->pdata[i];
camel_folder_unlock (folder, CF_REC_LOCK);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
}
}
@@ -689,7 +692,9 @@ camel_store_get_inbox (CamelStore *store,
g_return_val_if_fail (class->get_inbox != NULL, NULL);
camel_store_lock (store, CS_FOLDER_LOCK);
+
folder = class->get_inbox (store, ex);
+
camel_store_unlock (store, CS_FOLDER_LOCK);
return folder;
@@ -1224,7 +1229,9 @@ camel_store_folder_subscribed (CamelStore *store,
g_return_val_if_fail (class->folder_subscribed != NULL, FALSE);
camel_store_lock (store, CS_FOLDER_LOCK);
+
ret = class->folder_subscribed (store, folder_name);
+
camel_store_unlock (store, CS_FOLDER_LOCK);
return ret;
@@ -1256,7 +1263,9 @@ camel_store_subscribe_folder (CamelStore *store,
g_return_val_if_fail (class->subscribe_folder != NULL, FALSE);
camel_store_lock (store, CS_FOLDER_LOCK);
+
success = class->subscribe_folder (store, folder_name, ex);
+
camel_store_unlock (store, CS_FOLDER_LOCK);
return success;
@@ -1422,21 +1431,20 @@ camel_store_can_refresh_folder (CamelStore *store,
*
* Locks #store's #lock. Unlock it with camel_store_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_store_lock (CamelStore *store, CamelStoreLock lock)
+camel_store_lock (CamelStore *store,
+ CamelStoreLock lock)
{
- g_return_if_fail (store != NULL);
g_return_if_fail (CAMEL_IS_STORE (store));
- g_return_if_fail (store->priv != NULL);
switch (lock) {
- case CS_FOLDER_LOCK:
- g_static_rec_mutex_lock (&store->priv->folder_lock);
- break;
- default:
- g_return_if_reached ();
+ case CS_FOLDER_LOCK:
+ g_static_rec_mutex_lock (&store->priv->folder_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
@@ -1447,20 +1455,19 @@ camel_store_lock (CamelStore *store, CamelStoreLock lock)
*
* Unlocks #store's #lock, previously locked with camel_store_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_store_unlock (CamelStore *store, CamelStoreLock lock)
+camel_store_unlock (CamelStore *store,
+ CamelStoreLock lock)
{
- g_return_if_fail (store != NULL);
g_return_if_fail (CAMEL_IS_STORE (store));
- g_return_if_fail (store->priv != NULL);
switch (lock) {
- case CS_FOLDER_LOCK:
- g_static_rec_mutex_unlock (&store->priv->folder_lock);
- break;
- default:
- g_return_if_reached ();
+ case CS_FOLDER_LOCK:
+ g_static_rec_mutex_unlock (&store->priv->folder_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
diff --git a/camel/camel-store.h b/camel/camel-store.h
index 94758a2..14bc6e3 100644
--- a/camel/camel-store.h
+++ b/camel/camel-store.h
@@ -37,12 +37,24 @@
#include <camel/camel-folder.h>
#include <camel/camel-service.h>
-#define CAMEL_STORE_TYPE (camel_store_get_type ())
-#define CAMEL_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STORE_TYPE, CamelStore))
-#define CAMEL_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STORE_TYPE, CamelStoreClass))
-#define CAMEL_IS_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_STORE \
+ (camel_store_get_type ())
+#define CAMEL_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STORE, CamelStore))
+#define CAMEL_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STORE, CamelStoreClass))
+#define CAMEL_IS_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STORE))
+#define CAMEL_IS_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STORE))
#define CAMEL_STORE_GET_CLASS(obj) \
- ((CamelStoreClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STORE, CamelStoreClass))
G_BEGIN_DECLS
@@ -50,7 +62,7 @@ enum {
CAMEL_STORE_ARG_FIRST = CAMEL_SERVICE_ARG_FIRST + 100
};
-typedef enum _CamelStoreLock {
+typedef enum {
CS_FOLDER_LOCK
} CamelStoreLock;
@@ -235,7 +247,7 @@ struct _CamelStoreClass {
CamelException *ex);
};
-CamelType camel_store_get_type (void);
+GType camel_store_get_type (void);
CamelFolder * camel_store_get_folder (CamelStore *store,
const gchar *folder_name,
guint32 flags,
@@ -303,9 +315,10 @@ gint camel_store_folder_uri_equal (CamelStore *store,
gboolean camel_store_can_refresh_folder (CamelStore *store,
CamelFolderInfo *info,
CamelException *ex);
-
-void camel_store_lock (CamelStore *store, CamelStoreLock lock);
-void camel_store_unlock (CamelStore *store, CamelStoreLock lock);
+void camel_store_lock (CamelStore *store,
+ CamelStoreLock lock);
+void camel_store_unlock (CamelStore *store,
+ CamelStoreLock lock);
G_END_DECLS
diff --git a/camel/camel-stream-buffer.c b/camel/camel-stream-buffer.c
index b68de66..0357bd4 100644
--- a/camel/camel-stream-buffer.c
+++ b/camel/camel-stream-buffer.c
@@ -33,7 +33,9 @@
#include "camel-stream-buffer.h"
-static CamelStreamClass *parent_class = NULL;
+#define CAMEL_STREAM_BUFFER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferPrivate))
struct _CamelStreamBufferPrivate {
@@ -49,6 +51,8 @@ struct _CamelStreamBufferPrivate {
guint flags;
};
+G_DEFINE_TYPE (CamelStreamBuffer, camel_stream_buffer, CAMEL_TYPE_STREAM)
+
enum {
BUF_USER = 1<<0 /* user-supplied buffer, do not free */
};
@@ -82,7 +86,7 @@ set_vbuf (CamelStreamBuffer *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
if (priv->buf && !(priv->flags & BUF_USER))
g_free (priv->buf);
@@ -102,19 +106,35 @@ set_vbuf (CamelStreamBuffer *stream,
}
static void
-stream_buffer_finalize (CamelStreamBuffer *stream_buffer)
+stream_buffer_dispose (GObject *object)
{
- CamelStreamBufferPrivate *priv = stream_buffer->priv;
+ CamelStreamBufferPrivate *priv;
+
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (object);
+
+ if (priv->stream != NULL) {
+ g_object_unref (priv->stream);
+ priv->stream = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_stream_buffer_parent_class)->dispose (object);
+}
+
+static void
+stream_buffer_finalize (GObject *object)
+{
+ CamelStreamBufferPrivate *priv;
+
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (object);
if (!(priv->flags & BUF_USER))
g_free (priv->buf);
- if (priv->stream)
- camel_object_unref (priv->stream);
-
g_free (priv->linebuf);
- g_free (priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_stream_buffer_parent_class)->finalize (object);
}
static gssize
@@ -127,7 +147,7 @@ stream_buffer_read (CamelStream *stream,
gssize bytes_left;
gchar *bptr = buffer;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
g_return_val_if_fail (
(priv->mode & CAMEL_STREAM_BUFFER_MODE) ==
@@ -184,7 +204,7 @@ stream_buffer_write (CamelStream *stream,
gssize total = n;
gssize left, todo;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
g_return_val_if_fail (
(priv->mode & CAMEL_STREAM_BUFFER_MODE) ==
@@ -229,7 +249,7 @@ stream_buffer_flush (CamelStream *stream)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
if ((priv->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
gsize len = priv->ptr - priv->buf;
@@ -251,7 +271,7 @@ stream_buffer_close (CamelStream *stream)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
if (stream_buffer_flush (stream) == -1)
return -1;
@@ -264,7 +284,7 @@ stream_buffer_eos (CamelStream *stream)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
return camel_stream_eos(priv->stream) && priv->ptr == priv->end;
}
@@ -278,14 +298,14 @@ stream_buffer_init_vbuf (CamelStreamBuffer *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
set_vbuf (stream, buf, mode, size);
- if (priv->stream)
- camel_object_unref (priv->stream);
+ if (priv->stream != NULL)
+ g_object_unref (priv->stream);
- priv->stream = camel_object_ref (other_stream);
+ priv->stream = g_object_ref (other_stream);
}
static void
@@ -299,9 +319,14 @@ stream_buffer_init_method (CamelStreamBuffer *stream,
static void
camel_stream_buffer_class_init (CamelStreamBufferClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
- parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (camel_stream_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelStreamBufferPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = stream_buffer_dispose;
+ object_class->finalize = stream_buffer_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = stream_buffer_read;
@@ -317,7 +342,7 @@ camel_stream_buffer_class_init (CamelStreamBufferClass *class)
static void
camel_stream_buffer_init (CamelStreamBuffer *stream)
{
- stream->priv = g_new0 (CamelStreamBufferPrivate, 1);
+ stream->priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
stream->priv->flags = 0;
stream->priv->size = BUF_SIZE;
@@ -332,24 +357,6 @@ camel_stream_buffer_init (CamelStreamBuffer *stream)
stream->priv->linebuf = g_malloc (stream->priv->linesize);
}
-CamelType
-camel_stream_buffer_get_type (void)
-{
- static CamelType camel_stream_buffer_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_buffer_type == CAMEL_INVALID_TYPE) {
- camel_stream_buffer_type = camel_type_register (camel_stream_get_type (), "CamelStreamBuffer",
- sizeof (CamelStreamBuffer),
- sizeof (CamelStreamBufferClass),
- (CamelObjectClassInitFunc) camel_stream_buffer_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_buffer_init,
- (CamelObjectFinalizeFunc) stream_buffer_finalize);
- }
-
- return camel_stream_buffer_type;
-}
-
/**
* camel_stream_buffer_new:
* @stream: a #CamelStream object to buffer
@@ -373,7 +380,7 @@ camel_stream_buffer_new (CamelStream *stream,
g_return_val_if_fail (CAMEL_IS_STREAM (stream), NULL);
- sbf = CAMEL_STREAM_BUFFER (camel_object_new (camel_stream_buffer_get_type ()));
+ sbf = g_object_new (CAMEL_TYPE_STREAM_BUFFER, NULL);
class = CAMEL_STREAM_BUFFER_GET_CLASS (sbf);
g_return_val_if_fail (class->init != NULL, NULL);
@@ -430,7 +437,7 @@ camel_stream_buffer_new_with_vbuf (CamelStream *stream,
g_return_val_if_fail (CAMEL_IS_STREAM (stream), NULL);
g_return_val_if_fail (buf != NULL, NULL);
- sbf = CAMEL_STREAM_BUFFER (camel_object_new (camel_stream_buffer_get_type ()));
+ sbf = g_object_new (CAMEL_TYPE_STREAM_BUFFER, NULL);
class = CAMEL_STREAM_BUFFER_GET_CLASS (sbf);
g_return_val_if_fail (class->init_vbuf != NULL, NULL);
diff --git a/camel/camel-stream-buffer.h b/camel/camel-stream-buffer.h
index d2cd638..ad591a9 100644
--- a/camel/camel-stream-buffer.h
+++ b/camel/camel-stream-buffer.h
@@ -33,12 +33,24 @@
#include <stdio.h>
#include <camel/camel-seekable-stream.h>
-#define CAMEL_STREAM_BUFFER_TYPE (camel_stream_buffer_get_type ())
-#define CAMEL_STREAM_BUFFER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_BUFFER_TYPE, CamelStreamBuffer))
-#define CAMEL_STREAM_BUFFER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_BUFFER_TYPE, CamelStreamBufferClass))
-#define CAMEL_IS_STREAM_BUFFER(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_BUFFER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_STREAM_BUFFER \
+ (camel_stream_buffer_get_type ())
+#define CAMEL_STREAM_BUFFER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBuffer))
+#define CAMEL_STREAM_BUFFER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferClass))
+#define CAMEL_IS_STREAM_BUFFER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STREAM_BUFFER))
+#define CAMEL_IS_STREAM_BUFFER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STREAM_BUFFER))
#define CAMEL_STREAM_BUFFER_GET_CLASS(obj) \
- ((CamelStreamBufferClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferClass))
G_BEGIN_DECLS
@@ -72,7 +84,7 @@ struct _CamelStreamBufferClass {
guint32 size);
};
-CamelType camel_stream_buffer_get_type (void);
+GType camel_stream_buffer_get_type (void);
CamelStream * camel_stream_buffer_new (CamelStream *stream,
CamelStreamBufferMode mode);
CamelStream * camel_stream_buffer_new_with_vbuf
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c
index 2ea2d7c..c781240 100644
--- a/camel/camel-stream-filter.c
+++ b/camel/camel-stream-filter.c
@@ -34,6 +34,10 @@
/*extern void g_check(gpointer mp);*/
#define g_check(x)
+#define CAMEL_STREAM_FILTER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STREAM_FILTER, CamelStreamFilterPrivate))
+
struct _filter {
struct _filter *next;
gint id;
@@ -60,24 +64,27 @@ struct _CamelStreamFilterPrivate {
#define READ_PAD (128) /* bytes padded before buffer */
#define READ_SIZE (4096)
-static CamelStreamClass *camel_stream_filter_parent;
+G_DEFINE_TYPE (CamelStreamFilter, camel_stream_filter, CAMEL_TYPE_STREAM)
static void
-stream_filter_finalize (CamelStreamFilter *filter)
+stream_filter_finalize (GObject *object)
{
+ CamelStreamFilter *stream = CAMEL_STREAM_FILTER (object);
struct _filter *fn, *f;
- f = filter->priv->filters;
+ f = stream->priv->filters;
while (f) {
fn = f->next;
- camel_object_unref (f->filter);
+ g_object_unref (f->filter);
g_free (f);
f = fn;
}
- g_free (filter->priv->realbuffer);
- camel_object_unref (filter->priv->source);
- g_free (filter->priv);
+ g_free (stream->priv->realbuffer);
+ g_object_unref (stream->priv->source);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_stream_filter_parent_class)->finalize (object);
}
static gssize
@@ -89,7 +96,7 @@ stream_filter_read (CamelStream *stream,
gssize size;
struct _filter *f;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
priv->last_was_read = TRUE;
@@ -165,7 +172,7 @@ stream_filter_write (CamelStream *stream,
gsize presize, len, left = n;
gchar *buffer, realbuffer[READ_SIZE+READ_PAD];
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
priv->last_was_read = FALSE;
@@ -215,7 +222,7 @@ stream_filter_flush (CamelStream *stream)
gsize presize;
gsize len;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
if (priv->last_was_read)
return 0;
@@ -250,7 +257,7 @@ stream_filter_close (CamelStream *stream)
{
CamelStreamFilterPrivate *priv;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
if (!priv->last_was_read)
stream_filter_flush (stream);
@@ -263,7 +270,7 @@ stream_filter_eos (CamelStream *stream)
{
CamelStreamFilterPrivate *priv;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
if (priv->filteredlen > 0)
return FALSE;
@@ -280,7 +287,7 @@ stream_filter_reset (CamelStream *stream)
CamelStreamFilterPrivate *priv;
struct _filter *f;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
priv->filteredlen = 0;
priv->flushed = FALSE;
@@ -298,9 +305,13 @@ stream_filter_reset (CamelStream *stream)
static void
camel_stream_filter_class_init (CamelStreamFilterClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
- camel_stream_filter_parent = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (camel_stream_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelStreamFilterPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = stream_filter_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = stream_filter_read;
@@ -314,31 +325,14 @@ camel_stream_filter_class_init (CamelStreamFilterClass *class)
static void
camel_stream_filter_init (CamelStreamFilter *stream)
{
- stream->priv = g_new0 (CamelStreamFilterPrivate, 1);
+ stream->priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+
stream->priv->realbuffer = g_malloc(READ_SIZE + READ_PAD);
stream->priv->buffer = stream->priv->realbuffer + READ_PAD;
stream->priv->last_was_read = TRUE;
stream->priv->flushed = FALSE;
}
-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),
- sizeof (CamelStreamFilterClass),
- (CamelObjectClassInitFunc) camel_stream_filter_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_filter_init,
- (CamelObjectFinalizeFunc) stream_filter_finalize);
- }
-
- return type;
-}
-
/**
* camel_stream_filter_new:
*
@@ -354,10 +348,10 @@ camel_stream_filter_new (CamelStream *source)
g_return_val_if_fail (CAMEL_IS_STREAM (source), NULL);
- stream = CAMEL_STREAM (camel_object_new (camel_stream_filter_get_type ()));
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ stream = g_object_new (CAMEL_TYPE_STREAM_FILTER, NULL);
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
- priv->source = camel_object_ref (source);
+ priv->source = g_object_ref (source);
return stream;
}
@@ -393,11 +387,11 @@ camel_stream_filter_add (CamelStreamFilter *stream,
g_return_val_if_fail (CAMEL_IS_STREAM_FILTER (stream), -1);
g_return_val_if_fail (CAMEL_IS_MIME_FILTER (filter), -1);
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
fn = g_malloc(sizeof(*fn));
fn->id = priv->filterid++;
- fn->filter = camel_object_ref (filter);
+ fn->filter = g_object_ref (filter);
/* sure, we could use a GList, but we wouldn't save much */
f = (struct _filter *)&priv->filters;
@@ -424,14 +418,14 @@ camel_stream_filter_remove (CamelStreamFilter *stream,
g_return_if_fail (CAMEL_IS_STREAM_FILTER (stream));
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
f = (struct _filter *)&priv->filters;
while (f && f->next) {
fn = f->next;
if (fn->id == id) {
f->next = fn->next;
- camel_object_unref (fn->filter);
+ g_object_unref (fn->filter);
g_free(fn);
}
f = f->next;
diff --git a/camel/camel-stream-filter.h b/camel/camel-stream-filter.h
index 18fef88..76ce880 100644
--- a/camel/camel-stream-filter.h
+++ b/camel/camel-stream-filter.h
@@ -29,9 +29,24 @@
#include <camel/camel-stream.h>
#include <camel/camel-mime-filter.h>
-#define CAMEL_STREAM_FILTER(obj) CAMEL_CHECK_CAST (obj, camel_stream_filter_get_type (), CamelStreamFilter)
-#define CAMEL_STREAM_FILTER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_stream_filter_get_type (), CamelStreamFilterClass)
-#define CAMEL_IS_STREAM_FILTER(obj) CAMEL_CHECK_TYPE (obj, camel_stream_filter_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_STREAM_FILTER \
+ (camel_stream_filter_get_type ())
+#define CAMEL_STREAM_FILTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STREAM_FILTER, CamelStreamFilter))
+#define CAMEL_STREAM_FILTER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STREAM_FILTER, CamelStreamFilterClass))
+#define CAMEL_IS_STREAM_FILTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STREAM_FILTER))
+#define CAMEL_IS_STREAM_FILTER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STREAM_FILTER))
+#define CAMEL_STREAM_FILTER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STREAM_FILTER, CamelStreamFilterClass))
G_BEGIN_DECLS
@@ -48,8 +63,8 @@ struct _CamelStreamFilterClass {
CamelStreamClass parent_class;
};
-CamelType camel_stream_filter_get_type (void);
-CamelStream * camel_stream_filter_new (CamelStream *stream);
+GType camel_stream_filter_get_type (void);
+CamelStream * camel_stream_filter_new (CamelStream *source);
CamelStream * camel_stream_filter_get_source (CamelStreamFilter *stream);
gint camel_stream_filter_add (CamelStreamFilter *stream,
CamelMimeFilter *filter);
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
index 4502212..9920374 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -39,21 +39,28 @@
#include "camel-stream-fs.h"
#include "camel-win32.h"
+#define CAMEL_STREAM_FS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STREAM_FS, CamelStreamFsPrivate))
+
struct _CamelStreamFsPrivate {
gint fd; /* file descriptor on the underlying file */
};
-static CamelSeekableStreamClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelStreamFs, camel_stream_fs, CAMEL_TYPE_SEEKABLE_STREAM)
static void
-camel_stream_fs_finalize (CamelStreamFs *stream_fs)
+stream_fs_finalize (GObject *object)
{
- CamelStreamFsPrivate *priv = stream_fs->priv;
+ CamelStreamFsPrivate *priv;
+
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (object);
if (priv->fd != -1)
close (priv->fd);
- g_free (priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_stream_fs_parent_class)->finalize (object);
}
static gssize
@@ -65,7 +72,7 @@ stream_fs_read (CamelStream *stream,
CamelSeekableStream *seekable;
gssize nread;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
seekable = CAMEL_SEEKABLE_STREAM (stream);
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
@@ -88,7 +95,7 @@ stream_fs_write (CamelStream *stream,
CamelSeekableStream *seekable;
gssize nwritten;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
seekable = CAMEL_SEEKABLE_STREAM (stream);
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
@@ -105,7 +112,7 @@ stream_fs_flush (CamelStream *stream)
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
return fsync (priv->fd);
}
@@ -115,7 +122,7 @@ stream_fs_close (CamelStream *stream)
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
if (close (priv->fd) == -1)
return -1;
@@ -133,7 +140,7 @@ stream_fs_seek (CamelSeekableStream *stream,
CamelStreamFsPrivate *priv;
off_t real = 0;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
switch (policy) {
case CAMEL_STREAM_SET:
@@ -175,10 +182,14 @@ stream_fs_seek (CamelSeekableStream *stream,
static void
camel_stream_fs_class_init (CamelStreamFsClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
CamelSeekableStreamClass *seekable_stream_class;
- parent_class = CAMEL_SEEKABLE_STREAM_CLASS (camel_type_get_global_classfuncs (camel_seekable_stream_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelStreamFsPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = stream_fs_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = stream_fs_read;
@@ -193,30 +204,12 @@ camel_stream_fs_class_init (CamelStreamFsClass *class)
static void
camel_stream_fs_init (CamelStreamFs *stream)
{
- stream->priv = g_new0 (CamelStreamFsPrivate, 1);
+ stream->priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
stream->priv->fd = -1;
CAMEL_SEEKABLE_STREAM (stream)->bound_end = CAMEL_STREAM_UNBOUND;
}
-CamelType
-camel_stream_fs_get_type (void)
-{
- static CamelType camel_stream_fs_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_fs_type == CAMEL_INVALID_TYPE) {
- camel_stream_fs_type = camel_type_register (camel_seekable_stream_get_type (), "CamelStreamFs",
- sizeof (CamelStreamFs),
- sizeof (CamelStreamFsClass),
- (CamelObjectClassInitFunc) camel_stream_fs_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_fs_init,
- (CamelObjectFinalizeFunc) camel_stream_fs_finalize);
- }
-
- return camel_stream_fs_type;
-}
-
/**
* camel_stream_fs_new_with_fd:
* @fd: a file descriptor
@@ -237,8 +230,8 @@ camel_stream_fs_new_with_fd (gint fd)
if (fd == -1)
return NULL;
- stream = CAMEL_STREAM (camel_object_new (camel_stream_fs_get_type ()));
- priv = CAMEL_STREAM_FS (stream)->priv;
+ stream = g_object_new (CAMEL_TYPE_STREAM_FS, NULL);
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
priv->fd = fd;
offset = lseek (fd, 0, SEEK_CUR);
diff --git a/camel/camel-stream-fs.h b/camel/camel-stream-fs.h
index 885da92..d8a7dda 100644
--- a/camel/camel-stream-fs.h
+++ b/camel/camel-stream-fs.h
@@ -36,10 +36,24 @@
#include <camel/camel-seekable-stream.h>
-#define CAMEL_STREAM_FS_TYPE (camel_stream_fs_get_type ())
-#define CAMEL_STREAM_FS(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_FS_TYPE, CamelStreamFs))
-#define CAMEL_STREAM_FS_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_FS_TYPE, CamelStreamFsClass))
-#define CAMEL_IS_STREAM_FS(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_FS_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_STREAM_FS \
+ (camel_stream_fs_get_type ())
+#define CAMEL_STREAM_FS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STREAM_FS, CamelStreamFs))
+#define CAMEL_STREAM_FS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STREAM_FS, CamelStreamFsClass))
+#define CAMEL_IS_STREAM_FS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STREAM_FS))
+#define CAMEL_IS_STREAM_FS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STREAM_FS))
+#define CAMEL_STREAM_FS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STREAM_FS, CamelStreamFsClass))
G_BEGIN_DECLS
@@ -56,7 +70,7 @@ struct _CamelStreamFsClass {
CamelSeekableStreamClass parent_class;
};
-CamelType camel_stream_fs_get_type (void);
+GType camel_stream_fs_get_type (void);
CamelStream * camel_stream_fs_new_with_name (const gchar *name,
gint flags,
mode_t mode);
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index 3209f26..59a036f 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -34,7 +34,9 @@
#include "camel-stream-mem.h"
-static CamelSeekableStreamClass *parent_class = NULL;
+#define CAMEL_STREAM_MEM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STREAM_MEM, CamelStreamMemPrivate))
struct _CamelStreamMemPrivate {
guint owner : 1; /* do we own the buffer? */
@@ -44,6 +46,8 @@ struct _CamelStreamMemPrivate {
GByteArray *buffer;
};
+G_DEFINE_TYPE (CamelStreamMem, camel_stream_mem, CAMEL_TYPE_SEEKABLE_STREAM)
+
/* could probably be a util method */
static void
clear_mem (gpointer p, gsize len)
@@ -63,9 +67,11 @@ clear_mem (gpointer p, gsize len)
}
static void
-camel_stream_mem_finalize (CamelStreamMem *stream)
+stream_mem_finalize (GObject *object)
{
- CamelStreamMemPrivate *priv = stream->priv;
+ CamelStreamMemPrivate *priv;
+
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (object);
if (priv->buffer && priv->owner) {
/* TODO: we need our own bytearray type since we don't know
@@ -75,7 +81,8 @@ camel_stream_mem_finalize (CamelStreamMem *stream)
g_byte_array_free (priv->buffer, TRUE);
}
- g_free (priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_stream_mem_parent_class)->finalize (object);
}
static gssize
@@ -87,7 +94,7 @@ stream_mem_read (CamelStream *stream,
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
gssize nread;
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
n = MIN(seekable->bound_end - seekable->position, n);
@@ -111,7 +118,7 @@ stream_mem_write (CamelStream *stream,
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
gssize nwrite = n;
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
nwrite = MIN(seekable->bound_end - seekable->position, n);
@@ -134,7 +141,7 @@ stream_mem_eos (CamelStream *stream)
CamelStreamMemPrivate *priv;
CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM (stream);
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
return priv->buffer->len <= seekable_stream->position;
}
@@ -147,7 +154,7 @@ stream_mem_seek (CamelSeekableStream *stream,
CamelStreamMemPrivate *priv;
off_t position;
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
switch (policy) {
case CAMEL_STREAM_SET:
@@ -186,10 +193,14 @@ stream_mem_seek (CamelSeekableStream *stream,
static void
camel_stream_mem_class_init (CamelStreamMemClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
CamelSeekableStreamClass *seekable_stream_class;
- parent_class = CAMEL_SEEKABLE_STREAM_CLASS( camel_type_get_global_classfuncs( CAMEL_SEEKABLE_STREAM_TYPE ) );
+ g_type_class_add_private (class, sizeof (CamelStreamMemPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = stream_mem_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = stream_mem_read;
@@ -203,26 +214,7 @@ camel_stream_mem_class_init (CamelStreamMemClass *class)
static void
camel_stream_mem_init (CamelStreamMem *stream)
{
- stream->priv = g_new0 (CamelStreamMemPrivate, 1);
-}
-
-CamelType
-camel_stream_mem_get_type (void)
-{
- static CamelType camel_stream_mem_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_mem_type == CAMEL_INVALID_TYPE) {
- camel_stream_mem_type = camel_type_register( CAMEL_SEEKABLE_STREAM_TYPE,
- "CamelStreamMem",
- sizeof( CamelStreamMem ),
- sizeof( CamelStreamMemClass ),
- (CamelObjectClassInitFunc) camel_stream_mem_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_mem_init,
- (CamelObjectFinalizeFunc) camel_stream_mem_finalize );
- }
-
- return camel_stream_mem_type;
+ stream->priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
}
/**
@@ -284,8 +276,8 @@ camel_stream_mem_new_with_byte_array (GByteArray *buffer)
g_return_val_if_fail (buffer != NULL, NULL);
- stream = CAMEL_STREAM (camel_object_new (CAMEL_STREAM_MEM_TYPE));
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ stream = g_object_new (CAMEL_TYPE_STREAM_MEM, NULL);
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
priv->buffer = buffer;
priv->owner = TRUE;
diff --git a/camel/camel-stream-mem.h b/camel/camel-stream-mem.h
index ffd2bd2..77a01c6 100644
--- a/camel/camel-stream-mem.h
+++ b/camel/camel-stream-mem.h
@@ -32,10 +32,24 @@
#include <sys/types.h>
#include <camel/camel-seekable-stream.h>
-#define CAMEL_STREAM_MEM_TYPE (camel_stream_mem_get_type ())
-#define CAMEL_STREAM_MEM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_MEM_TYPE, CamelStreamMem))
-#define CAMEL_STREAM_MEM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_MEM_TYPE, CamelStreamMemClass))
-#define CAMEL_IS_STREAM_MEM(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_MEM_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_STREAM_MEM \
+ (camel_stream_mem_get_type ())
+#define CAMEL_STREAM_MEM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STREAM_MEM, CamelStreamMem))
+#define CAMEL_STREAM_MEM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STREAM_MEM, CamelStreamMemClass))
+#define CAMEL_IS_STREAM_MEM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STREAM_MEM))
+#define CAMEL_IS_STREAM_MEM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STREAM_MEM))
+#define CAMEL_STREAM_MEM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STREAM_MEM, CamelStreamMemClass))
G_BEGIN_DECLS
@@ -52,7 +66,7 @@ struct _CamelStreamMemClass {
CamelSeekableStreamClass parent_class;
};
-CamelType camel_stream_mem_get_type (void);
+GType camel_stream_mem_get_type (void);
CamelStream * camel_stream_mem_new (void);
CamelStream * camel_stream_mem_new_with_byte_array
(GByteArray *buffer);
diff --git a/camel/camel-stream-null.c b/camel/camel-stream-null.c
index 1731a34..8c3bcb3 100644
--- a/camel/camel-stream-null.c
+++ b/camel/camel-stream-null.c
@@ -28,7 +28,7 @@
#include "camel-stream-null.h"
-static CamelObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelStreamNull, camel_stream_null, CAMEL_TYPE_STREAM)
static gssize
stream_null_write (CamelStream *stream,
@@ -59,8 +59,6 @@ camel_stream_null_class_init (CamelStreamNullClass *class)
{
CamelStreamClass *stream_class;
- parent_class = camel_type_get_global_classfuncs( CAMEL_TYPE_OBJECT );
-
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->write = stream_null_write;
stream_class->eos = stream_null_eos;
@@ -72,25 +70,6 @@ camel_stream_null_init (CamelStreamNull *stream_null)
{
}
-CamelType
-camel_stream_null_get_type (void)
-{
- static CamelType camel_stream_null_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_null_type == CAMEL_INVALID_TYPE) {
- camel_stream_null_type = camel_type_register( camel_stream_get_type(),
- "CamelStreamNull",
- sizeof( CamelStreamNull ),
- sizeof( CamelStreamNullClass ),
- (CamelObjectClassInitFunc) camel_stream_null_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_null_init,
- NULL );
- }
-
- return camel_stream_null_type;
-}
-
/**
* camel_stream_null_new:
*
@@ -102,5 +81,5 @@ camel_stream_null_get_type (void)
CamelStream *
camel_stream_null_new(void)
{
- return (CamelStream *)camel_object_new(camel_stream_null_get_type ());
+ return g_object_new (CAMEL_TYPE_STREAM_NULL, NULL);
}
diff --git a/camel/camel-stream-null.h b/camel/camel-stream-null.h
index 8f80ad0..94e96ab 100644
--- a/camel/camel-stream-null.h
+++ b/camel/camel-stream-null.h
@@ -28,9 +28,24 @@
#include <camel/camel-stream.h>
-#define CAMEL_STREAM_NULL(obj) CAMEL_CHECK_CAST (obj, camel_stream_null_get_type (), CamelStreamNull)
-#define CAMEL_STREAM_NULL_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_stream_null_get_type (), CamelStreamNullClass)
-#define CAMEL_IS_STREAM_NULL(obj) CAMEL_CHECK_TYPE (obj, camel_stream_null_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_STREAM_NULL \
+ (camel_stream_null_get_type ())
+#define CAMEL_STREAM_NULL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STREAM_NULL, CamelStreamNull))
+#define CAMEL_STREAM_NULL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STREAM_NULL, CamelStreamNullClass))
+#define CAMEL_IS_STREAM_NULL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STREAM_NULL))
+#define CAMEL_IS_STREAM_NULL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STREAM_NULL))
+#define CAMEL_STREAM_NULL_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STREAM_NULL, CamelStreamNullClass))
G_BEGIN_DECLS
@@ -47,7 +62,7 @@ struct _CamelStreamNullClass {
CamelStreamClass parent_class;
};
-CamelType camel_stream_null_get_type (void);
+GType camel_stream_null_get_type (void);
CamelStream *camel_stream_null_new (void);
diff --git a/camel/camel-stream-process.c b/camel/camel-stream-process.c
index 6fcae95..0a11498 100644
--- a/camel/camel-stream-process.c
+++ b/camel/camel-stream-process.c
@@ -44,14 +44,17 @@
extern gint camel_verbose_debug;
-static CamelObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelStreamProcess, camel_stream_process, CAMEL_TYPE_STREAM)
static void
-stream_process_finalize (CamelObject *object)
+stream_process_finalize (GObject *object)
{
/* Ensure we clean up after ourselves -- kill
the child process and reap it. */
camel_stream_close (CAMEL_STREAM (object));
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_stream_process_parent_class)->finalize (object);
}
static gssize
@@ -132,9 +135,11 @@ stream_process_flush (CamelStream *stream)
static void
camel_stream_process_class_init (CamelStreamProcessClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
- parent_class = camel_type_get_global_classfuncs (CAMEL_TYPE_OBJECT);
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = stream_process_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = stream_process_read;
@@ -150,25 +155,6 @@ camel_stream_process_init (CamelStreamProcess *stream)
stream->childpid = 0;
}
-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",
- sizeof (CamelStreamProcess),
- sizeof (CamelStreamProcessClass),
- (CamelObjectClassInitFunc) camel_stream_process_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_process_init,
- (CamelObjectFinalizeFunc) stream_process_finalize);
- }
-
- return type;
-}
-
/**
* camel_stream_process_new:
*
@@ -179,7 +165,7 @@ camel_stream_process_get_type (void)
CamelStream *
camel_stream_process_new (void)
{
- return (CamelStream *) camel_object_new (camel_stream_process_get_type ());
+ return g_object_new (CAMEL_TYPE_STREAM_PROCESS, NULL);
}
G_GNUC_NORETURN static void
diff --git a/camel/camel-stream-process.h b/camel/camel-stream-process.h
index c5e8776..047b112 100644
--- a/camel/camel-stream-process.h
+++ b/camel/camel-stream-process.h
@@ -28,9 +28,24 @@
#include <camel/camel-stream.h>
-#define CAMEL_STREAM_PROCESS(obj) CAMEL_CHECK_CAST (obj, camel_stream_process_get_type (), CamelStreamProcess)
-#define CAMEL_STREAM_PROCESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_stream_process_get_type (), CamelStreamProcessClass)
-#define CAMEL_IS_STREAM_PROCESS(obj) CAMEL_CHECK_TYPE (obj, camel_stream_process_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_STREAM_PROCESS \
+ (camel_stream_process_get_type ())
+#define CAMEL_STREAM_PROCESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STREAM_PROCESS, CamelStreamProcess))
+#define CAMEL_STREAM_PROCESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STREAM_PROCESS, CamelStreamProcessClass))
+#define CAMEL_IS_STREAM_PROCESS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STREAM_PROCESS))
+#define CAMEL_IS_STREAM_PROCESS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STREAM_PROCESS))
+#define CAMEL_STREAM_PROCESS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STREAM_PROCSS, CamelStreamProcessClass))
G_BEGIN_DECLS
@@ -48,7 +63,7 @@ struct _CamelStreamProcessClass {
CamelStreamClass parent_class;
};
-CamelType camel_stream_process_get_type (void);
+GType camel_stream_process_get_type (void);
CamelStream * camel_stream_process_new (void);
gint camel_stream_process_connect (CamelStreamProcess *stream,
const gchar *command,
diff --git a/camel/camel-stream-vfs.c b/camel/camel-stream-vfs.c
index e1de33d..13d6194 100644
--- a/camel/camel-stream-vfs.c
+++ b/camel/camel-stream-vfs.c
@@ -34,14 +34,20 @@
#include "camel-operation.h"
#include "camel-stream-vfs.h"
-static CamelStreamClass *parent_class = NULL;
-
+G_DEFINE_TYPE (CamelStreamVFS, camel_stream_vfs, CAMEL_TYPE_STREAM)
static void
-stream_vfs_finalize (CamelStreamVFS *stream_vfs)
+stream_vfs_dispose (GObject *object)
{
- if (stream_vfs->stream)
- g_object_unref (stream_vfs->stream);
+ CamelStreamVFS *stream = CAMEL_STREAM_VFS (object);
+
+ if (stream->stream != NULL) {
+ g_object_unref (stream->stream);
+ stream->stream = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_stream_vfs_parent_class)->dispose (object);
}
static gssize
@@ -138,9 +144,11 @@ stream_vfs_close (CamelStream *stream)
static void
camel_stream_vfs_class_init (CamelStreamVFSClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
- parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (camel_stream_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = stream_vfs_dispose;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = stream_vfs_read;
@@ -155,24 +163,6 @@ camel_stream_vfs_init (CamelStreamVFS *stream)
stream->stream = NULL;
}
-CamelType
-camel_stream_vfs_get_type (void)
-{
- static CamelType camel_stream_vfs_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_vfs_type == CAMEL_INVALID_TYPE) {
- camel_stream_vfs_type = camel_type_register (camel_stream_get_type (), "CamelStreamVFS",
- sizeof (CamelStreamVFS),
- sizeof (CamelStreamVFSClass),
- (CamelObjectClassInitFunc) camel_stream_vfs_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_vfs_init,
- (CamelObjectFinalizeFunc) stream_vfs_finalize);
- }
-
- return camel_stream_vfs_type;
-}
-
/**
* camel_stream_vfs_new_with_stream:
* @stream: a GInputStream or GOutputStream instance
@@ -198,7 +188,7 @@ camel_stream_vfs_new_with_stream (GObject *stream)
g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream) || G_IS_INPUT_STREAM (stream), NULL);
errno = 0;
- stream_vfs = CAMEL_STREAM_VFS (camel_object_new (camel_stream_vfs_get_type ()));
+ stream_vfs = g_object_new (CAMEL_TYPE_STREAM_VFS, NULL);
stream_vfs->stream = stream;
return CAMEL_STREAM (stream_vfs);
diff --git a/camel/camel-stream-vfs.h b/camel/camel-stream-vfs.h
index 06b9e2a..8231725 100644
--- a/camel/camel-stream-vfs.h
+++ b/camel/camel-stream-vfs.h
@@ -29,13 +29,26 @@
#ifndef CAMEL_STREAM_VFS_H
#define CAMEL_STREAM_VFS_H
-#include <glib-object.h>
#include <camel/camel-stream.h>
-#define CAMEL_STREAM_VFS_TYPE (camel_stream_vfs_get_type ())
-#define CAMEL_STREAM_VFS(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_VFS_TYPE, CamelStreamVFS))
-#define CAMEL_STREAM_VFS_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_VFS_TYPE, CamelStreamVFSClass))
-#define CAMEL_IS_STREAM_VFS(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_VFS_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_STREAM_VFS \
+ (camel_stream_vfs_get_type ())
+#define CAMEL_STREAM_VFS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STREAM_VFS, CamelStreamVFS))
+#define CAMEL_STREAM_VFS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STREAM_VFS, CamelStreamVFSClass))
+#define CAMEL_IS_STREAM_VFS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STREAM_VFS))
+#define CAMEL_IS_STREAM_VFS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STREAM_VFS))
+#define CAMEL_STREAM_VFS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STREAM_VFS, CamelStreamVFSClass))
G_BEGIN_DECLS
@@ -52,7 +65,7 @@ struct _CamelStreamVFSClass {
CamelStreamClass parent_class;
};
-CamelType camel_stream_vfs_get_type (void);
+GType camel_stream_vfs_get_type (void);
/**
* CamelStreamVFSOpenMethod:
diff --git a/camel/camel-stream.c b/camel/camel-stream.c
index dcf09aa..27f1ee2 100644
--- a/camel/camel-stream.c
+++ b/camel/camel-stream.c
@@ -30,7 +30,7 @@
#include "camel-stream.h"
-static CamelObjectClass *parent_class = NULL;
+G_DEFINE_ABSTRACT_TYPE (CamelStream, camel_stream, CAMEL_TYPE_OBJECT)
static gssize
stream_read (CamelStream *stream,
@@ -75,8 +75,6 @@ stream_reset (CamelStream *stream)
static void
camel_stream_class_init (CamelStreamClass *class)
{
- parent_class = camel_type_get_global_classfuncs( CAMEL_TYPE_OBJECT );
-
class->read = stream_read;
class->write = stream_write;
class->close = stream_close;
@@ -90,25 +88,6 @@ camel_stream_init (CamelStream *stream)
{
}
-CamelType
-camel_stream_get_type (void)
-{
- static CamelType camel_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_type == CAMEL_INVALID_TYPE) {
- camel_stream_type = camel_type_register( CAMEL_TYPE_OBJECT,
- "CamelStream",
- sizeof( CamelStream ),
- sizeof( CamelStreamClass ),
- (CamelObjectClassInitFunc) camel_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_init,
- NULL );
- }
-
- return camel_stream_type;
-}
-
/**
* camel_stream_read:
* @stream: a #CamelStream object.
@@ -262,7 +241,8 @@ camel_stream_reset (CamelStream *stream)
* Returns: the number of characters written or %-1 on error.
**/
gssize
-camel_stream_write_string (CamelStream *stream, const gchar *string)
+camel_stream_write_string (CamelStream *stream,
+ const gchar *string)
{
return camel_stream_write (stream, string, strlen (string));
}
@@ -277,7 +257,9 @@ camel_stream_write_string (CamelStream *stream, const gchar *string)
* Returns: the number of characters written or %-1 on error.
**/
gssize
-camel_stream_printf (CamelStream *stream, const gchar *fmt, ... )
+camel_stream_printf (CamelStream *stream,
+ const gchar *fmt,
+ ...)
{
va_list args;
gchar *string;
diff --git a/camel/camel-stream.h b/camel/camel-stream.h
index d150dbe..2867e0c 100644
--- a/camel/camel-stream.h
+++ b/camel/camel-stream.h
@@ -33,12 +33,24 @@
#include <unistd.h>
#include <camel/camel-object.h>
-#define CAMEL_STREAM_TYPE (camel_stream_get_type ())
-#define CAMEL_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_TYPE, CamelStream))
-#define CAMEL_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_TYPE, CamelStreamClass))
-#define CAMEL_IS_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_STREAM \
+ (camel_stream_get_type ())
+#define CAMEL_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_STREAM, CamelStream))
+#define CAMEL_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_STREAM, CamelStreamClass))
+#define CAMEL_IS_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_STREAM))
+#define CAMEL_IS_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_STREAM))
#define CAMEL_STREAM_GET_CLASS(obj) \
- ((CamelStreamClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_STREAM, CamelStreamClass))
G_BEGIN_DECLS
@@ -66,7 +78,7 @@ struct _CamelStreamClass {
gint (*reset) (CamelStream *stream);
};
-CamelType camel_stream_get_type (void);
+GType camel_stream_get_type (void);
gssize camel_stream_read (CamelStream *stream,
gchar *buffer,
gsize n);
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index a833d74..153d008 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -53,10 +53,9 @@
#undef ETIMEDOUT
#endif
#define ETIMEDOUT EAGAIN
-
#endif
-static CamelTcpStreamClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelTcpStreamRaw, camel_tcp_stream_raw, CAMEL_TYPE_TCP_STREAM)
#ifdef SIMULATE_FLAKY_NETWORK
static gssize
@@ -326,10 +325,15 @@ socket_connect(struct addrinfo *h)
}
static void
-tcp_stream_raw_finalize (CamelTcpStreamRaw *stream)
+tcp_stream_raw_finalize (GObject *object)
{
+ CamelTcpStreamRaw *stream = CAMEL_TCP_STREAM_RAW (object);
+
if (stream->sockfd != -1)
SOCKET_CLOSE (stream->sockfd);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_tcp_stream_raw_parent_class)->finalize (object);
}
static gssize
@@ -501,10 +505,12 @@ tcp_stream_raw_get_remote_address (CamelTcpStream *stream,
static void
camel_tcp_stream_raw_class_init (CamelTcpStreamRawClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
CamelTcpStreamClass *tcp_stream_class;
- parent_class = CAMEL_TCP_STREAM_CLASS (camel_type_get_global_classfuncs (camel_tcp_stream_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = tcp_stream_raw_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = tcp_stream_raw_read;
@@ -526,25 +532,6 @@ camel_tcp_stream_raw_init (CamelTcpStreamRaw *stream)
stream->sockfd = -1;
}
-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",
- sizeof (CamelTcpStreamRaw),
- sizeof (CamelTcpStreamRawClass),
- (CamelObjectClassInitFunc) camel_tcp_stream_raw_class_init,
- NULL,
- (CamelObjectInitFunc) camel_tcp_stream_raw_init,
- (CamelObjectFinalizeFunc) tcp_stream_raw_finalize);
- }
-
- return type;
-}
-
/**
* camel_tcp_stream_raw_new:
*
@@ -555,5 +542,5 @@ camel_tcp_stream_raw_get_type (void)
CamelStream *
camel_tcp_stream_raw_new (void)
{
- return CAMEL_STREAM (camel_object_new (camel_tcp_stream_raw_get_type ()));
+ return g_object_new (CAMEL_TYPE_TCP_STREAM_RAW, NULL);
}
diff --git a/camel/camel-tcp-stream-raw.h b/camel/camel-tcp-stream-raw.h
index 63b17f1..72b3310 100644
--- a/camel/camel-tcp-stream-raw.h
+++ b/camel/camel-tcp-stream-raw.h
@@ -29,10 +29,24 @@
#include <camel/camel-tcp-stream.h>
-#define CAMEL_TCP_STREAM_RAW_TYPE (camel_tcp_stream_raw_get_type ())
-#define CAMEL_TCP_STREAM_RAW(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TCP_STREAM_RAW_TYPE, CamelTcpStreamRaw))
-#define CAMEL_TCP_STREAM_RAW_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TCP_STREAM_RAW_TYPE, CamelTcpStreamRawClass))
-#define CAMEL_IS_TCP_STREAM_RAW(o) (CAMEL_CHECK_TYPE((o), CAMEL_TCP_STREAM_RAW_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_TCP_STREAM_RAW \
+ (camel_tcp_stream_raw_get_type ())
+#define CAMEL_TCP_STREAM_RAW(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TCP_STREAM_RAW, CamelTcpStreamRaw))
+#define CAMEL_TCP_STREAM_RAW_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TCP_STREAM_RAW, CamelTcpStreamRawClass))
+#define CAMEL_IS_TCP_STREAM_RAW(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TCP_STREAM_RAW))
+#define CAMEL_IS_TCP_STREAM_RAW_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TCP_STREAM_RAW))
+#define CAMEL_TCP_STREAM_RAW_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TCP_STREAM_RAW, CAmelTcpStreamRawClass))
G_BEGIN_DECLS
@@ -52,7 +66,7 @@ struct _CamelTcpStreamRawClass {
CamelTcpStreamClass parent_class;
};
-CamelType camel_tcp_stream_raw_get_type (void);
+GType camel_tcp_stream_raw_get_type (void);
/* public methods */
CamelStream *camel_tcp_stream_raw_new (void);
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 117239f..f61f205 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -67,7 +67,9 @@
#define IO_TIMEOUT (PR_TicksPerSecond() * 4 * 60)
#define CONNECT_TIMEOUT (PR_TicksPerSecond () * 4 * 60)
-static CamelTcpStreamClass *parent_class = NULL;
+#define CAMEL_TCP_STREAM_SSL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TCP_STREAM_SSL, CamelTcpStreamSSLPrivate))
struct _CamelTcpStreamSSLPrivate {
PRFileDesc *sockfd;
@@ -78,6 +80,7 @@ struct _CamelTcpStreamSSLPrivate {
guint32 flags;
};
+G_DEFINE_TYPE (CamelTcpStreamSSL, camel_tcp_stream_ssl, CAMEL_TYPE_TCP_STREAM)
static void
set_errno (gint code)
@@ -142,24 +145,39 @@ set_errno (gint code)
}
static void
-tcp_stream_ssl_finalize (CamelTcpStreamSSL *stream)
+tcp_stream_ssl_dispose (GObject *object)
{
- CamelTcpStreamSSLPrivate *priv = stream->priv;
+ CamelTcpStreamSSLPrivate *priv;
+
+ priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (object);
+
+ if (priv->session != NULL) {
+ g_object_unref (priv->session);
+ priv->session = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_tcp_stream_ssl_parent_class)->dispose (object);
+}
+
+static void
+tcp_stream_ssl_finalize (GObject *object)
+{
+ CamelTcpStreamSSLPrivate *priv;
+
+ priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (object);
if (priv->sockfd != NULL) {
PR_Shutdown (priv->sockfd, PR_SHUTDOWN_BOTH);
PR_Close (priv->sockfd);
}
- if (priv->session)
- camel_object_unref (priv->session);
-
g_free (priv->expected_host);
- g_free (priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_tcp_stream_ssl_parent_class)->finalize (object);
}
-
static gssize
tcp_stream_ssl_read (CamelStream *stream,
gchar *buffer,
@@ -643,7 +661,7 @@ camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate
g_unlink (path);
}
camel_stream_close (stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
} else {
g_warning ("Could not save cert: %s: %s", path, g_strerror (errno));
}
@@ -735,7 +753,7 @@ ssl_bad_cert (gpointer data, PRFileDesc *sockfd)
}
camel_certdb_cert_unref(certdb, ccert);
- camel_object_unref (certdb);
+ g_object_unref (certdb);
return accept ? SECSuccess : SECFailure;
@@ -1176,10 +1194,15 @@ camel_tcp_stream_ssl_sockfd (CamelTcpStreamSSL *stream)
static void
camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
CamelTcpStreamClass *tcp_stream_class;
- parent_class = CAMEL_TCP_STREAM_CLASS (camel_type_get_global_classfuncs (camel_tcp_stream_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelTcpStreamSSLPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = tcp_stream_ssl_dispose;
+ object_class->finalize = tcp_stream_ssl_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = tcp_stream_ssl_read;
@@ -1198,26 +1221,7 @@ camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *class)
static void
camel_tcp_stream_ssl_init (CamelTcpStreamSSL *stream)
{
- stream->priv = g_new0 (CamelTcpStreamSSLPrivate, 1);
-}
-
-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",
- sizeof (CamelTcpStreamSSL),
- sizeof (CamelTcpStreamSSLClass),
- (CamelObjectClassInitFunc) camel_tcp_stream_ssl_class_init,
- NULL,
- (CamelObjectInitFunc) camel_tcp_stream_ssl_init,
- (CamelObjectFinalizeFunc) tcp_stream_ssl_finalize);
- }
-
- return type;
+ stream->priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (stream);
}
/**
@@ -1242,9 +1246,9 @@ camel_tcp_stream_ssl_new (CamelSession *session, const gchar *expected_host, gui
g_assert(CAMEL_IS_SESSION(session));
- stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
+ stream = g_object_new (CAMEL_TYPE_TCP_STREAM_SSL, NULL);
- stream->priv->session = camel_object_ref (session);
+ stream->priv->session = g_object_ref (session);
stream->priv->expected_host = g_strdup (expected_host);
stream->priv->ssl_mode = TRUE;
stream->priv->flags = flags;
@@ -1274,9 +1278,9 @@ camel_tcp_stream_ssl_new_raw (CamelSession *session, const gchar *expected_host,
g_assert(CAMEL_IS_SESSION(session));
- stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
+ stream = g_object_new (CAMEL_TYPE_TCP_STREAM_SSL, NULL);
- stream->priv->session = camel_object_ref (session);
+ stream->priv->session = g_object_ref (session);
stream->priv->expected_host = g_strdup (expected_host);
stream->priv->ssl_mode = FALSE;
stream->priv->flags = flags;
diff --git a/camel/camel-tcp-stream-ssl.h b/camel/camel-tcp-stream-ssl.h
index d5eac2e..928f578 100644
--- a/camel/camel-tcp-stream-ssl.h
+++ b/camel/camel-tcp-stream-ssl.h
@@ -32,10 +32,24 @@
#include <camel/camel-tcp-stream.h>
#include <prio.h>
-#define CAMEL_TCP_STREAM_SSL_TYPE (camel_tcp_stream_ssl_get_type ())
-#define CAMEL_TCP_STREAM_SSL(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TCP_STREAM_SSL_TYPE, CamelTcpStreamSSL))
-#define CAMEL_TCP_STREAM_SSL_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TCP_STREAM_SSL_TYPE, CamelTcpStreamSSLClass))
-#define CAMEL_IS_TCP_STREAM_SSL(o) (CAMEL_CHECK_TYPE((o), CAMEL_TCP_STREAM_SSL_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_TCP_STREAM_SSL \
+ (camel_tcp_stream_ssl_get_type ())
+#define CAMEL_TCP_STREAM_SSL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TCP_STREAM_SSL, CamelTcpStreamSSL))
+#define CAMEL_TCP_STREAM_SSL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TCP_STREAM_SSL, CamelTcpStreamSSLClass))
+#define CAMEL_IS_TCP_STREAM_SSL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TCP_STREAM_SSL))
+#define CAMEL_IS_TCP_STREAM_SSL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TCP_STREAM_SSL))
+#define CAMEL_TCP_STREAM_SSL_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TCP_STREAM_SSL, CamelTcpStreamSSLClass))
#define CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 (1 << 0)
#define CAMEL_TCP_STREAM_SSL_ENABLE_SSL3 (1 << 1)
@@ -58,7 +72,7 @@ struct _CamelTcpStreamSSLClass {
CamelTcpStreamClass parent_class;
};
-CamelType camel_tcp_stream_ssl_get_type (void);
+GType camel_tcp_stream_ssl_get_type (void);
/* public methods */
CamelStream *camel_tcp_stream_ssl_new (struct _CamelSession *session, const gchar *expected_host, guint32 flags);
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
index 39aa6e3..171f427 100644
--- a/camel/camel-tcp-stream.c
+++ b/camel/camel-tcp-stream.c
@@ -35,12 +35,11 @@
#define w(x)
-static CamelStreamClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelTcpStream, camel_tcp_stream, CAMEL_TYPE_STREAM)
static void
camel_tcp_stream_class_init (CamelTcpStreamClass *class)
{
- parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (CAMEL_STREAM_TYPE));
}
static void
@@ -48,25 +47,6 @@ camel_tcp_stream_init (CamelTcpStream *tcp_stream)
{
}
-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",
- sizeof (CamelTcpStream),
- sizeof (CamelTcpStreamClass),
- (CamelObjectClassInitFunc) camel_tcp_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_tcp_stream_init,
- NULL);
- }
-
- return type;
-}
-
/**
* camel_tcp_stream_connect:
* @stream: a #CamelTcpStream object
diff --git a/camel/camel-tcp-stream.h b/camel/camel-tcp-stream.h
index a7db2e5..17cb492 100644
--- a/camel/camel-tcp-stream.h
+++ b/camel/camel-tcp-stream.h
@@ -46,12 +46,24 @@ struct addrinfo;
#include <camel/camel-stream.h>
-#define CAMEL_TCP_STREAM_TYPE (camel_tcp_stream_get_type ())
-#define CAMEL_TCP_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TCP_STREAM_TYPE, CamelTcpStream))
-#define CAMEL_TCP_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TCP_STREAM_TYPE, CamelTcpStreamClass))
-#define CAMEL_IS_TCP_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_TCP_STREAM_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_TCP_STREAM \
+ (camel_tcp_stream_get_type ())
+#define CAMEL_TCP_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TCP_STREAM, CamelTcpStream))
+#define CAMEL_TCP_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TCP_STREAM, CamelTcpStreamClass))
+#define CAMEL_IS_TCP_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TCP_STREAM))
+#define CAMEL_IS_TCP_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TCP_STREAM))
#define CAMEL_TCP_STREAM_GET_CLASS(obj) \
- ((CamelTcpStreamClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TCP_STREAM, CamelTcpStreamClass))
G_BEGIN_DECLS
@@ -121,7 +133,7 @@ struct _CamelTcpStreamClass {
socklen_t *len);
};
-CamelType camel_tcp_stream_get_type (void);
+GType camel_tcp_stream_get_type (void);
gint camel_tcp_stream_connect (CamelTcpStream *stream,
struct addrinfo *host);
gint camel_tcp_stream_getsockopt (CamelTcpStream *stream,
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index ac471cb..e242669 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -60,6 +60,10 @@ static gint text_index_compress_nosync (CamelIndex *idx);
/* ********************************************************************** */
+#define CAMEL_TEXT_INDEX_NAME_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_NAME, CamelTextIndexNamePrivate))
+
struct _CamelTextIndexNamePrivate {
GString *buffer;
camel_key_t nameid;
@@ -70,6 +74,10 @@ CamelTextIndexName *camel_text_index_name_new (CamelTextIndex *idx, const gchar
/* ****************************** */
+#define CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_CURSOR, CamelTextIndexCursorPrivate))
+
struct _CamelTextIndexCursorPrivate {
camel_block_t first;
camel_block_t next;
@@ -86,6 +94,10 @@ CamelTextIndexCursor *camel_text_index_cursor_new (CamelTextIndex *idx, camel_bl
/* ****************************** */
+#define CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, CamelTextIndexKeyCursorPrivate))
+
struct _CamelTextIndexKeyCursorPrivate {
CamelKeyTable *table;
@@ -102,6 +114,10 @@ CamelTextIndexKeyCursor *camel_text_index_key_cursor_new (CamelTextIndex *idx, C
#define CAMEL_TEXT_INDEX_VERSION "TEXT.000"
#define CAMEL_TEXT_INDEX_KEY_VERSION "KEYS.000"
+#define CAMEL_TEXT_INDEX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX, CamelTextIndexPrivate))
+
struct _CamelTextIndexPrivate {
CamelBlockFile *blocks;
CamelKeyFile *links;
@@ -148,15 +164,74 @@ struct _CamelTextIndexWord {
camel_key_t names[32];
};
-#define CAMEL_TEXT_INDEX_GET_PRIVATE(o) (((CamelTextIndex *)(o))->priv)
-
-#define CI_CLASS(o) ((CamelTextIndexClass *)(((CamelObject *)o)->classfuncs))
-
/* ********************************************************************** */
/* CamelTextIndex */
/* ********************************************************************** */
-static CamelObjectClass *camel_text_index_parent;
+G_DEFINE_TYPE (CamelTextIndex, camel_text_index, CAMEL_TYPE_INDEX)
+
+static void
+text_index_dispose (GObject *object)
+{
+ CamelTextIndexPrivate *priv;
+
+ priv = CAMEL_TEXT_INDEX_GET_PRIVATE (object);
+
+ /* Only run this the first time. */
+ if (priv->word_index != NULL)
+ camel_index_sync (CAMEL_INDEX (object));
+
+ if (priv->word_index != NULL) {
+ g_object_unref (priv->word_index);
+ priv->word_index = NULL;
+ }
+
+ if (priv->word_hash != NULL) {
+ g_object_unref (priv->word_hash);
+ priv->word_hash = NULL;
+ }
+
+ if (priv->name_index != NULL) {
+ g_object_unref (priv->name_index);
+ priv->name_index = NULL;
+ }
+
+ if (priv->name_hash != NULL) {
+ g_object_unref (priv->name_hash);
+ priv->name_hash = NULL;
+ }
+
+ if (priv->blocks != NULL) {
+ g_object_unref (priv->blocks);
+ priv->blocks = NULL;
+ }
+
+ if (priv->links != NULL) {
+ g_object_unref (priv->links);
+ priv->links = NULL;
+ }
+
+ /* Chain up to parent's dispose () method. */
+ G_OBJECT_CLASS (camel_text_index_parent_class)->dispose (object);
+}
+
+static void
+text_index_finalize (GObject *object)
+{
+ CamelTextIndexPrivate *priv;
+
+ priv = CAMEL_TEXT_INDEX_GET_PRIVATE (object);
+
+ g_assert (camel_dlist_empty (&priv->word_cache));
+ g_assert (g_hash_table_size (priv->words) == 0);
+
+ g_hash_table_destroy (priv->words);
+
+ g_static_rec_mutex_free (&priv->lock);
+
+ /* Chain up to parent's finalize () method. */
+ G_OBJECT_CLASS (camel_text_index_parent_class)->finalize (object);
+}
/* call locked */
static void
@@ -512,7 +587,7 @@ fail:
camel_index_delete ((CamelIndex *)newidx);
- camel_object_unref (newidx);
+ g_object_unref (newidx);
g_free (name);
g_hash_table_destroy (remap);
@@ -728,93 +803,47 @@ text_index_names (CamelIndex *idx)
}
static void
-camel_text_index_class_init (CamelTextIndexClass *klass)
+camel_text_index_class_init (CamelTextIndexClass *class)
{
- CamelIndexClass *iklass = (CamelIndexClass *)klass;
-
- camel_text_index_parent = CAMEL_OBJECT_CLASS (camel_type_get_global_classfuncs (camel_object_get_type ()));
-
- iklass->sync = text_index_sync;
- iklass->compress = text_index_compress;
- iklass->delete = text_index_delete;
-
- iklass->rename = text_index_rename;
-
- iklass->has_name = text_index_has_name;
- iklass->add_name = text_index_add_name;
- iklass->write_name = text_index_write_name;
- iklass->find_name = text_index_find_name;
- iklass->delete_name = text_index_delete_name;
- iklass->find = text_index_find;
-
- iklass->words = text_index_words;
- iklass->names = text_index_names;
-}
-
-static void
-camel_text_index_init (CamelTextIndex *idx)
-{
- CamelTextIndexPrivate *p;
-
- p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx) = g_malloc0(sizeof (*p));
-
- camel_dlist_init (&p->word_cache);
- p->words = g_hash_table_new (g_str_hash, g_str_equal);
- p->word_cache_count = 0;
- /* 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);
+ GObjectClass *object_class;
+ CamelIndexClass *index_class;
+
+ g_type_class_add_private (class, sizeof (CamelTextIndexPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = text_index_dispose;
+ object_class->finalize = text_index_finalize;
+
+ index_class = CAMEL_INDEX_CLASS (class);
+ index_class->sync = text_index_sync;
+ index_class->compress = text_index_compress;
+ index_class->delete = text_index_delete;
+ index_class->rename = text_index_rename;
+ index_class->has_name = text_index_has_name;
+ index_class->add_name = text_index_add_name;
+ index_class->write_name = text_index_write_name;
+ index_class->find_name = text_index_find_name;
+ index_class->delete_name = text_index_delete_name;
+ index_class->find = text_index_find;
+ index_class->words = text_index_words;
+ index_class->names = text_index_names;
}
static void
-camel_text_index_finalize (CamelTextIndex *idx)
+camel_text_index_init (CamelTextIndex *text_index)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
-
- camel_index_sync ((CamelIndex *)idx);
-
- g_assert (camel_dlist_empty (&p->word_cache));
- g_assert (g_hash_table_size (p->words) == 0);
-
- g_hash_table_destroy (p->words);
+ text_index->priv = CAMEL_TEXT_INDEX_GET_PRIVATE (text_index);
- if (p->word_index)
- camel_object_unref (p->word_index);
- if (p->word_hash)
- camel_object_unref (p->word_hash);
- if (p->name_index)
- camel_object_unref (p->name_index);
- if (p->name_hash)
- camel_object_unref (p->name_hash);
+ camel_dlist_init (&text_index->priv->word_cache);
+ text_index->priv->words = g_hash_table_new (g_str_hash, g_str_equal);
+ text_index->priv->word_cache_count = 0;
- if (p->blocks)
- camel_object_unref (p->blocks);
- if (p->links)
- camel_object_unref (p->links);
+ /* 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. */
+ text_index->priv->word_cache_limit = 4096; /* 1024 = 128K */
- g_static_rec_mutex_free (&p->lock);
-
- g_free (p);
-}
-
-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),
- sizeof (CamelTextIndexClass),
- (CamelObjectClassInitFunc) camel_text_index_class_init,
- NULL,
- (CamelObjectInitFunc) camel_text_index_init,
- (CamelObjectFinalizeFunc) camel_text_index_finalize);
- }
-
- return type;
+ g_static_rec_mutex_init (&text_index->priv->lock);
}
static gchar *
@@ -832,7 +861,7 @@ text_index_normalize (CamelIndex *idx, const gchar *in, gpointer data)
CamelTextIndex *
camel_text_index_new (const gchar *path, gint flags)
{
- CamelTextIndex *idx = (CamelTextIndex *)camel_object_new (camel_text_index_get_type ());
+ CamelTextIndex *idx = g_object_new (CAMEL_TYPE_TEXT_INDEX, NULL);
CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
struct _CamelTextIndexRoot *rb;
gchar *link;
@@ -906,14 +935,14 @@ camel_text_index_new (const gchar *path, gint flags)
if (p->word_index == NULL || p->word_hash == NULL
|| p->name_index == NULL || p->name_hash == NULL) {
- camel_object_unref (idx);
+ g_object_unref (idx);
idx = NULL;
}
return idx;
fail:
- camel_object_unref (idx);
+ g_object_unref (idx);
return NULL;
}
@@ -937,12 +966,12 @@ camel_text_index_check (const gchar *path)
keys = camel_key_file_new (key, O_RDONLY, CAMEL_TEXT_INDEX_KEY_VERSION);
if (keys == NULL) {
io (printf ("Check failed: No key file: %s\n", g_strerror (errno)));
- camel_object_unref (blocks);
+ g_object_unref (blocks);
return -1;
}
- camel_object_unref (keys);
- camel_object_unref (blocks);
+ g_object_unref (keys);
+ g_object_unref (blocks);
return 0;
}
@@ -1236,7 +1265,7 @@ camel_text_index_dump (CamelTextIndex *idx)
printf (" %s", name);
}
printf ("\n");
- camel_object_unref (idc);
+ g_object_unref (idc);
g_free (word);
}
#else
@@ -1350,7 +1379,7 @@ camel_text_index_validate (CamelTextIndex *idx)
g_hash_table_insert (used, g_strdup (name), (gpointer)1);
}
}
- camel_object_unref (idc);
+ g_object_unref (idc);
g_hash_table_foreach (used, (GHFunc)g_free, NULL);
g_hash_table_destroy (used);
@@ -1385,10 +1414,23 @@ camel_text_index_validate (CamelTextIndex *idx)
/* CamelTextIndexName */
/* ********************************************************************** */
-static CamelIndexNameClass *camel_text_index_name_parent;
+G_DEFINE_TYPE (CamelTextIndexName, camel_text_index_name, CAMEL_TYPE_INDEX_NAME)
+
+static void
+text_index_name_finalize (GObject *object)
+{
+ CamelTextIndexNamePrivate *priv;
+
+ priv = CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (object);
+
+ g_hash_table_destroy (CAMEL_TEXT_INDEX_NAME (object)->parent.words);
-#define CIN_CLASS(o) ((CamelTextIndexNameClass *)(((CamelObject *)o)->classfuncs))
-#define CAMEL_TEXT_INDEX_NAME_GET_PRIVATE(o) (((CamelTextIndexName *)(o))->priv)
+ g_string_free (priv->buffer, TRUE);
+ camel_mempool_destroy (priv->pool);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_text_index_name_parent_class)->finalize (object);
+}
static void
text_index_name_add_word (CamelIndexName *idn, const gchar *word)
@@ -1505,67 +1547,43 @@ text_index_name_add_buffer (CamelIndexName *idn, const gchar *buffer, gsize len)
}
static void
-camel_text_index_name_class_init (CamelTextIndexNameClass *klass)
+camel_text_index_name_class_init (CamelTextIndexNameClass *class)
{
- CamelIndexNameClass *nklass = (CamelIndexNameClass *)klass;
-
- camel_text_index_name_parent = CAMEL_INDEX_NAME_CLASS (camel_type_get_global_classfuncs (camel_index_name_get_type ()));
-
- nklass->add_word = text_index_name_add_word;
- nklass->add_buffer = text_index_name_add_buffer;
-}
+ GObjectClass *object_class;
+ CamelIndexNameClass *index_name_class;
-static void
-camel_text_index_name_init (CamelTextIndexName *idn)
-{
- CamelTextIndexNamePrivate *p;
+ g_type_class_add_private (class, sizeof (CamelTextIndexNamePrivate));
- idn->parent.words = g_hash_table_new (g_str_hash, g_str_equal);
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = text_index_name_finalize;
- p = idn->priv = g_malloc0(sizeof (*idn->priv));
- p->buffer = g_string_new ("");
- p->pool = camel_mempool_new (256, 128, CAMEL_MEMPOOL_ALIGN_BYTE);
+ index_name_class = CAMEL_INDEX_NAME_CLASS (class);
+ index_name_class->add_word = text_index_name_add_word;
+ index_name_class->add_buffer = text_index_name_add_buffer;
}
static void
-camel_text_index_name_finalize (CamelTextIndexName *idn)
+camel_text_index_name_init (CamelTextIndexName *text_index_name)
{
- CamelTextIndexNamePrivate *p = CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (idn);
+ text_index_name->priv =
+ CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (text_index_name);
- g_hash_table_destroy (idn->parent.words);
+ text_index_name->parent.words = g_hash_table_new (
+ g_str_hash, g_str_equal);
- g_string_free (p->buffer, TRUE);
- camel_mempool_destroy (p->pool);
-
- g_free (p);
-}
-
-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),
- sizeof (CamelTextIndexNameClass),
- (CamelObjectClassInitFunc) camel_text_index_name_class_init,
- NULL,
- (CamelObjectInitFunc) camel_text_index_name_init,
- (CamelObjectFinalizeFunc) camel_text_index_name_finalize);
- }
-
- return type;
+ text_index_name->priv->buffer = g_string_new ("");
+ text_index_name->priv->pool =
+ camel_mempool_new (256, 128, CAMEL_MEMPOOL_ALIGN_BYTE);
}
CamelTextIndexName *
camel_text_index_name_new (CamelTextIndex *idx, const gchar *name, camel_key_t nameid)
{
- CamelTextIndexName *idn = (CamelTextIndexName *)camel_object_new (camel_text_index_name_get_type ());
+ CamelTextIndexName *idn = g_object_new (CAMEL_TYPE_TEXT_INDEX_NAME, NULL);
CamelIndexName *cin = &idn->parent;
CamelTextIndexNamePrivate *p = CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (idn);
- cin->index = camel_object_ref (idx);
+ cin->index = g_object_ref (idx);
cin->name = camel_mempool_strdup (p->pool, name);
p->nameid = nameid;
@@ -1576,10 +1594,21 @@ camel_text_index_name_new (CamelTextIndex *idx, const gchar *name, camel_key_t n
/* CamelTextIndexCursor */
/* ********************************************************************** */
-static CamelIndexCursorClass *camel_text_index_cursor_parent;
+G_DEFINE_TYPE (CamelTextIndexCursor, camel_text_index_cursor, CAMEL_TYPE_INDEX_CURSOR)
-#define CIC_CLASS(o) ((CamelTextIndexCursorClass *)(((CamelObject *)o)->classfuncs))
-#define CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE(o) (((CamelTextIndexCursor *)(o))->priv)
+static void
+text_index_cursor_finalize (GObject *object)
+{
+ CamelTextIndexCursorPrivate *priv;
+
+ priv = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (object);
+
+ g_free (priv->records);
+ g_free (priv->current);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_text_index_cursor_parent_class)->finalize (object);
+}
static const gchar *
text_index_cursor_next (CamelIndexCursor *idc)
@@ -1631,58 +1660,36 @@ text_index_cursor_reset (CamelIndexCursor *idc)
}
static void
-camel_text_index_cursor_class_init (CamelTextIndexCursorClass *klass)
+camel_text_index_cursor_class_init (CamelTextIndexCursorClass *class)
{
- CamelIndexCursorClass *cklass = (CamelIndexCursorClass *)klass;
+ GObjectClass *object_class;
+ CamelIndexCursorClass *index_cursor_class;
- camel_text_index_cursor_parent = CAMEL_INDEX_CURSOR_CLASS (camel_type_get_global_classfuncs (camel_index_cursor_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelTextIndexCursorPrivate));
- cklass->next = text_index_cursor_next;
- cklass->reset = text_index_cursor_reset;
-}
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = text_index_cursor_finalize;
-static void
-camel_text_index_cursor_init (CamelTextIndexCursor *idc)
-{
- CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc) = g_malloc0(sizeof (CamelTextIndexCursorPrivate));
+ index_cursor_class = CAMEL_INDEX_CURSOR_CLASS (class);
+ index_cursor_class->next = text_index_cursor_next;
+ index_cursor_class->reset = text_index_cursor_reset;
}
static void
-camel_text_index_cursor_finalize (CamelTextIndexCursor *idc)
+camel_text_index_cursor_init (CamelTextIndexCursor *text_index_cursor)
{
- CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc);
-
- g_free (p->records);
- g_free (p->current);
- g_free (p);
-}
-
-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),
- sizeof (CamelTextIndexCursorClass),
- (CamelObjectClassInitFunc) camel_text_index_cursor_class_init,
- NULL,
- (CamelObjectInitFunc) camel_text_index_cursor_init,
- (CamelObjectFinalizeFunc) camel_text_index_cursor_finalize);
- }
-
- return type;
+ text_index_cursor->priv =
+ CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (text_index_cursor);
}
CamelTextIndexCursor *
camel_text_index_cursor_new (CamelTextIndex *idx, camel_block_t data)
{
- CamelTextIndexCursor *idc = (CamelTextIndexCursor *)camel_object_new (camel_text_index_cursor_get_type ());
+ CamelTextIndexCursor *idc = g_object_new (CAMEL_TYPE_TEXT_INDEX_CURSOR, NULL);
CamelIndexCursor *cic = &idc->parent;
CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc);
- cic->index = camel_object_ref (idx);
+ cic->index = g_object_ref (idx);
p->first = data;
p->next = data;
p->record_count = 0;
@@ -1695,10 +1702,36 @@ camel_text_index_cursor_new (CamelTextIndex *idx, camel_block_t data)
/* CamelTextIndexKeyCursor */
/* ********************************************************************** */
-static CamelIndexCursorClass *camel_text_index_key_cursor_parent;
+G_DEFINE_TYPE (CamelTextIndexKeyCursor, camel_text_index_key_cursor, CAMEL_TYPE_INDEX_CURSOR)
+
+static void
+text_index_key_cursor_dispose (GObject *object)
+{
+ CamelTextIndexKeyCursorPrivate *priv;
+
+ priv = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (object);
+
+ if (priv->table != NULL) {
+ g_object_unref (priv->table);
+ priv->table = NULL;
+ }
-#define CIKC_CLASS(o) ((CamelTextIndexKeyCursorClass *)(((CamelObject *)o)->classfuncs))
-#define CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE(o) (((CamelTextIndexKeyCursor *)(o))->priv)
+ /* Chain up parent's dispose() method. */
+ G_OBJECT_CLASS (camel_text_index_key_cursor_parent_class)->dispose (object);
+}
+
+static void
+text_index_key_cursor_finalize (GObject *object)
+{
+ CamelTextIndexKeyCursorPrivate *priv;
+
+ priv = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (object);
+
+ g_free (priv->current);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_text_index_key_cursor_parent_class)->finalize (object);
+}
static const gchar *
text_index_key_cursor_next (CamelIndexCursor *idc)
@@ -1735,66 +1768,43 @@ text_index_key_cursor_reset (CamelIndexCursor *idc)
}
static void
-camel_text_index_key_cursor_class_init (CamelTextIndexKeyCursorClass *klass)
+camel_text_index_key_cursor_class_init (CamelTextIndexKeyCursorClass *class)
{
- CamelIndexCursorClass *cklass = (CamelIndexCursorClass *)klass;
+ GObjectClass *object_class;
+ CamelIndexCursorClass *index_cursor_class;
- camel_text_index_key_cursor_parent = CAMEL_INDEX_CURSOR_CLASS (camel_type_get_global_classfuncs (camel_index_cursor_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelTextIndexKeyCursorPrivate));
- cklass->next = text_index_key_cursor_next;
- cklass->reset = text_index_key_cursor_reset;
-}
-
-static void
-camel_text_index_key_cursor_init (CamelTextIndexKeyCursor *idc)
-{
- CamelTextIndexKeyCursorPrivate *p;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = text_index_key_cursor_dispose;
+ object_class->finalize = text_index_key_cursor_finalize;
- p = idc->priv = g_malloc0(sizeof (CamelTextIndexKeyCursorPrivate));
- p->keyid = 0;
- p->flags = 0;
- p->data = 0;
- p->current = NULL;
+ index_cursor_class = CAMEL_INDEX_CURSOR_CLASS (class);
+ index_cursor_class->next = text_index_key_cursor_next;
+ index_cursor_class->reset = text_index_key_cursor_reset;
}
static void
-camel_text_index_key_cursor_finalize (CamelTextIndexKeyCursor *idc)
+camel_text_index_key_cursor_init (CamelTextIndexKeyCursor *text_index_key_cursor)
{
- CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (idc);
-
- g_free (p->current);
- if (p->table)
- camel_object_unref (p->table);
- g_free (p);
-}
-
-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),
- sizeof (CamelTextIndexKeyCursorClass),
- (CamelObjectClassInitFunc) camel_text_index_key_cursor_class_init,
- NULL,
- (CamelObjectInitFunc) camel_text_index_key_cursor_init,
- (CamelObjectFinalizeFunc) camel_text_index_key_cursor_finalize);
- }
+ text_index_key_cursor->priv =
+ CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (text_index_key_cursor);
- return type;
+ text_index_key_cursor->priv->keyid = 0;
+ text_index_key_cursor->priv->flags = 0;
+ text_index_key_cursor->priv->data = 0;
+ text_index_key_cursor->priv->current = NULL;
}
CamelTextIndexKeyCursor *
camel_text_index_key_cursor_new (CamelTextIndex *idx, CamelKeyTable *table)
{
- CamelTextIndexKeyCursor *idc = (CamelTextIndexKeyCursor *)camel_object_new (camel_text_index_key_cursor_get_type ());
+ CamelTextIndexKeyCursor *idc = g_object_new (CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, NULL);
CamelIndexCursor *cic = &idc->parent;
CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (idc);
- cic->index = camel_object_ref (idx);
- p->table = camel_object_ref (table);
+ cic->index = g_object_ref (idx);
+ p->table = g_object_ref (table);
return idc;
}
@@ -1860,7 +1870,7 @@ gint main (gint argc, gchar **argv)
idn = camel_index_add_name (idx, name);
camel_index_name_add_buffer (idn, wordbuffer, sizeof (wordbuffer)-1);
camel_index_write_name (idx, idn);
- camel_object_unref (idn);
+ g_object_unref (idn);
}
printf ("Looking up which names contain word 'word'\n");
@@ -1868,7 +1878,7 @@ gint main (gint argc, gchar **argv)
while ((word = camel_index_cursor_next (idc)) != NULL) {
printf (" name is '%s'\n", word);
}
- camel_object_unref (idc);
+ g_object_unref (idc);
printf ("done.\n");
printf ("Looking up which names contain word 'truncate'\n");
@@ -1876,11 +1886,11 @@ gint main (gint argc, gchar **argv)
while ((word = camel_index_cursor_next (idc)) != NULL) {
printf (" name is '%s'\n", word);
}
- camel_object_unref (idc);
+ g_object_unref (idc);
printf ("done.\n");
camel_index_sync (idx);
- camel_object_unref (idx);
+ g_object_unref (idx);
#if 0
bs = camel_block_file_new ("blocks", "TESTINDX", CAMEL_BLOCK_SIZE);
diff --git a/camel/camel-text-index.h b/camel/camel-text-index.h
index 610d416..d1d5c41 100644
--- a/camel/camel-text-index.h
+++ b/camel/camel-text-index.h
@@ -30,9 +30,78 @@
#include <camel/camel-object.h>
#include "camel-index.h"
-#define CAMEL_TEXT_INDEX(obj) CAMEL_CHECK_CAST (obj, camel_text_index_get_type (), CamelTextIndex)
-#define CAMEL_TEXT_INDEX_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_text_index_get_type (), CamelTextIndexClass)
-#define CAMEL_IS_TEXT_INDEX(obj) CAMEL_CHECK_TYPE (obj, camel_text_index_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_TEXT_INDEX \
+ (camel_text_index_get_type ())
+#define CAMEL_TEXT_INDEX(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TEXT_INDEX, CamelTextIndex))
+#define CAMEL_TEXT_INDEX_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TEXT_INDEX, CamelTextIndexClass))
+#define CAMEL_IS_TEXT_INDEX(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX))
+#define CAMEL_IS_TEXT_INDEX_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TEXT_INDEX))
+#define CAMEL_TEXT_INDEX_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TEXT_INDEX, CamelTextIndexClass))
+
+#define CAMEL_TYPE_TEXT_INDEX_NAME \
+ (camel_text_index_name_get_type ())
+#define CAMEL_TEXT_INDEX_NAME(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_NAME, CamelTextIndexName))
+#define CAMEL_TEXT_INDEX_NAME_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TEXT_INDEX_NAME, CamelTextIndexNameClass))
+#define CAMEL_IS_TEXT_INDEX_NAME(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_NAME))
+#define CAMEL_IS_TEXT_INDEX_NAME_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TEXT_INDEX_NAME))
+#define CAMEL_TEXT_INDEX_NAME_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_NAME, CamelTextIndexNameClass))
+
+#define CAMEL_TYPE_TEXT_INDEX_CURSOR \
+ (camel_text_index_cursor_get_type ())
+#define CAMEL_TEXT_INDEX_CURSOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_CURSOR, CamelTextIndexCursor))
+#define CAMEL_TEXT_INDEX_CURSOR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TEXT_INDEX_CURSOR, CamelTextIndexCursorClass))
+#define CAMEL_IS_TEXT_INDEX_CURSOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_CURSOR))
+#define CAMEL_IS_TEXT_INDEX_CURSOR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TEXT_INDEX_CURSOR))
+#define CAMEL_TEXT_INDEX_CURSOR_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_CURSOR, CamelTextIndexCursorClass))
+
+#define CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR \
+ (camel_text_index_key_cursor_get_type ())
+#define CAMEL_TEXT_INDEX_KEY_CURSOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, CamelTextIndexKeyCursor))
+#define CAMEL_TEXT_INDEX_KEY_CURSOR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, CamelTextIndexKeyCursorClass))
+#define CAMEL_IS_TEXT_INDEX_KEY_CURSOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR))
+#define CAMEL_IS_TEXT_INDEX_KEY_CURSOR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR))
+#define CAMEL_TEXT_INDEX_KEY_CURSOR_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, CamelTextIndexKeyCursorClass))
G_BEGIN_DECLS
@@ -65,7 +134,7 @@ struct _CamelTextIndexCursorClass {
CamelIndexCursorClass parent_class;
};
-CamelType camel_text_index_cursor_get_type(void);
+GType camel_text_index_cursor_get_type(void);
/* ********************************************************************** */
@@ -78,7 +147,7 @@ struct _CamelTextIndexKeyCursorClass {
CamelIndexCursorClass parent_class;
};
-CamelType camel_text_index_key_cursor_get_type(void);
+GType camel_text_index_key_cursor_get_type(void);
/* ********************************************************************** */
@@ -91,7 +160,7 @@ struct _CamelTextIndexNameClass {
CamelIndexNameClass parent_class;
};
-CamelType camel_text_index_name_get_type(void);
+GType camel_text_index_name_get_type(void);
/* ********************************************************************** */
@@ -104,7 +173,7 @@ struct _CamelTextIndexClass {
CamelIndexClass parent_class;
};
-CamelType camel_text_index_get_type (void);
+GType camel_text_index_get_type (void);
CamelTextIndex *camel_text_index_new (const gchar *path,
gint flags);
diff --git a/camel/camel-transport.c b/camel/camel-transport.c
index 29aba48..5a1e5bf 100644
--- a/camel/camel-transport.c
+++ b/camel/camel-transport.c
@@ -31,55 +31,48 @@
#include "camel-mime-message.h"
#include "camel-transport.h"
+#define CAMEL_TRANSPORT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TRANSPORT, CamelTransportPrivate))
+
struct _CamelTransportPrivate {
GMutex *send_lock; /* for locking send operations */
};
-static CamelServiceClass *parent_class = NULL;
+G_DEFINE_ABSTRACT_TYPE (CamelTransport, camel_transport, CAMEL_TYPE_SERVICE)
static void
-transport_finalize (CamelObject *object)
+transport_finalize (GObject *object)
{
- CamelTransportPrivate *priv = CAMEL_TRANSPORT (object)->priv;
+ CamelTransportPrivate *priv;
+
+ priv = CAMEL_TRANSPORT_GET_PRIVATE (object);
g_mutex_free (priv->send_lock);
- g_free (priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_transport_parent_class)->finalize (object);
}
static void
camel_transport_class_init (CamelTransportClass *class)
{
- parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (CamelTransportPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = transport_finalize;
}
static void
camel_transport_init (CamelTransport *transport)
{
- transport->priv = g_malloc0 (sizeof (struct _CamelTransportPrivate));
+ transport->priv = CAMEL_TRANSPORT_GET_PRIVATE (transport);
transport->priv->send_lock = g_mutex_new ();
}
-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",
- sizeof (CamelTransport),
- sizeof (CamelTransportClass),
- (CamelObjectClassInitFunc) camel_transport_class_init,
- NULL,
- (CamelObjectInitFunc) camel_transport_init,
- (CamelObjectFinalizeFunc) transport_finalize);
- }
-
- return type;
-}
-
/**
* camel_transport_send_to:
* @transport: a #CamelTransport object
@@ -126,21 +119,20 @@ camel_transport_send_to (CamelTransport *transport,
*
* Locks #transport's #lock. Unlock it with camel_transport_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_transport_lock (CamelTransport *transport, CamelTransportLock lock)
+camel_transport_lock (CamelTransport *transport,
+ CamelTransportLock lock)
{
- g_return_if_fail (transport != NULL);
g_return_if_fail (CAMEL_IS_TRANSPORT (transport));
- g_return_if_fail (transport->priv != NULL);
switch (lock) {
- case CT_SEND_LOCK:
- g_mutex_lock (transport->priv->send_lock);
- break;
- default:
- g_return_if_reached ();
+ case CT_SEND_LOCK:
+ g_mutex_lock (transport->priv->send_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
@@ -151,20 +143,19 @@ camel_transport_lock (CamelTransport *transport, CamelTransportLock lock)
*
* Unlocks #transport's #lock, previously locked with camel_transport_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_transport_unlock (CamelTransport *transport, CamelTransportLock lock)
+camel_transport_unlock (CamelTransport *transport,
+ CamelTransportLock lock)
{
- g_return_if_fail (transport != NULL);
g_return_if_fail (CAMEL_IS_TRANSPORT (transport));
- g_return_if_fail (transport->priv != NULL);
switch (lock) {
- case CT_SEND_LOCK:
- g_mutex_unlock (transport->priv->send_lock);
- break;
- default:
- g_return_if_reached ();
+ case CT_SEND_LOCK:
+ g_mutex_unlock (transport->priv->send_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
diff --git a/camel/camel-transport.h b/camel/camel-transport.h
index 3508351..f1b6e8d 100644
--- a/camel/camel-transport.h
+++ b/camel/camel-transport.h
@@ -34,12 +34,24 @@
#include <camel/camel-mime-message.h>
#include <camel/camel-service.h>
-#define CAMEL_TRANSPORT_TYPE (camel_transport_get_type ())
-#define CAMEL_TRANSPORT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TRANSPORT_TYPE, CamelTransport))
-#define CAMEL_TRANSPORT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TRANSPORT_TYPE, CamelTransportClass))
-#define CAMEL_IS_TRANSPORT(o) (CAMEL_CHECK_TYPE((o), CAMEL_TRANSPORT_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_TRANSPORT \
+ (camel_transport_get_type ())
+#define CAMEL_TRANSPORT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TRANSPORT, CamelTransport))
+#define CAMEL_TRANSPORT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TRANSPORT, CamelTransportClass))
+#define CAMEL_IS_TRANSPORT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TRANSPORT))
+#define CAMEL_IS_TRANSPORT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TRANSPORT))
#define CAMEL_TRANSPORT_GET_CLASS(obj) \
- ((CamelTransportClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TRANSPORT, CamelTransportClass))
G_BEGIN_DECLS
@@ -51,7 +63,7 @@ enum {
CAMEL_TRANSPORT_ARG_FIRST = CAMEL_SERVICE_ARG_FIRST + 100
};
-typedef enum _CamelTransportLock {
+typedef enum {
CT_SEND_LOCK
} CamelTransportLock;
@@ -63,23 +75,23 @@ struct _CamelTransport {
struct _CamelTransportClass {
CamelServiceClass parent_class;
- gboolean (*send_to) (CamelTransport *transport,
- CamelMimeMessage *message,
- CamelAddress *from, CamelAddress *recipients,
- CamelException *ex);
+ gboolean (*send_to) (CamelTransport *transport,
+ CamelMimeMessage *message,
+ CamelAddress *from,
+ CamelAddress *recipients,
+ CamelException *ex);
};
-/* public methods */
-gboolean camel_transport_send_to (CamelTransport *transport,
- CamelMimeMessage *message,
- CamelAddress *from,
- CamelAddress *recipients,
- CamelException *ex);
-
-CamelType camel_transport_get_type (void);
-
-void camel_transport_lock (CamelTransport *transport, CamelTransportLock lock);
-void camel_transport_unlock (CamelTransport *transport, CamelTransportLock lock);
+GType camel_transport_get_type (void);
+gboolean camel_transport_send_to (CamelTransport *transport,
+ CamelMimeMessage *message,
+ CamelAddress *from,
+ CamelAddress *recipients,
+ CamelException *ex);
+void camel_transport_lock (CamelTransport *transport,
+ CamelTransportLock lock);
+void camel_transport_unlock (CamelTransport *transport,
+ CamelTransportLock lock);
G_END_DECLS
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index c46b7e4..76ce2c1 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -45,6 +45,10 @@
#define d(x)
#define dd(x) (camel_debug ("vfolder")?(x):0)
+#define CAMEL_VEE_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_VEE_FOLDER, CamelVeeFolderPrivate))
+
struct _CamelVeeFolderPrivate {
gboolean destroyed;
GList *folders; /* lock using subfolder_lock before changing/accessing */
@@ -56,10 +60,6 @@ struct _CamelVeeFolderPrivate {
gint unread_vfolder;
};
-#define CAMEL_VEE_FOLDER_GET_PRIVATE(o) (((CamelVeeFolder *)(o))->priv)
-
-static gpointer camel_vee_folder_parent_class;
-
struct _update_data {
CamelFolder *source;
CamelVeeFolder *vee_folder;
@@ -76,6 +76,8 @@ struct _folder_changed_msg {
CamelVeeFolder *vee_folder;
};
+G_DEFINE_TYPE (CamelVeeFolder, camel_vee_folder, CAMEL_TYPE_FOLDER)
+
/* must be called with summary_lock held */
static CamelVeeMessageInfo *
vee_folder_add_uid (CamelVeeFolder *vf,
@@ -620,8 +622,8 @@ folder_changed_free (CamelSession *session, CamelSessionThreadMsg *msg)
struct _folder_changed_msg *m = (struct _folder_changed_msg *)msg;
camel_folder_change_info_free (m->changes);
- camel_object_unref (m->vee_folder);
- camel_object_unref (m->sub);
+ g_object_unref (m->vee_folder);
+ g_object_unref (m->sub);
}
static CamelSessionThreadOps folder_changed_ops = {
@@ -846,7 +848,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub)
if (sub->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED) {
while (g_list_find (up->folders, sub)) {
up->folders = g_list_remove (up->folders, sub);
- camel_object_unref (sub);
+ g_object_unref (sub);
/* undo the freeze state that Unmatched has imposed on this source folder */
camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK);
@@ -857,7 +859,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub)
} else if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
if (g_list_find (up->folders, sub) != NULL) {
up->folders = g_list_remove (up->folders, sub);
- camel_object_unref (sub);
+ g_object_unref (sub);
/* undo the freeze state that Unmatched has imposed on this source folder */
camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK);
@@ -872,16 +874,18 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub)
if (CAMEL_IS_VEE_FOLDER (sub))
return;
- camel_object_unref (sub);
+ g_object_unref (sub);
}
static void
-vee_folder_finalize (CamelVeeFolder *vf)
+vee_folder_finalize (GObject *object)
{
+ CamelVeeFolder *vf;
CamelVeeFolder *folder_unmatched;
GList *node;
CamelFIRecord * record;
+ vf = CAMEL_VEE_FOLDER (object);
vf->priv->destroyed = TRUE;
folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -898,7 +902,7 @@ vee_folder_finalize (CamelVeeFolder *vf)
/* This may invoke sub-classes with partially destroyed state, they must deal with this */
if (vf == folder_unmatched) {
for (node = vf->priv->folders;node;node = g_list_next (node))
- camel_object_unref (node->data);
+ g_object_unref (node->data);
} else {
/* FIXME[disk-summary] See if it is really reqd */
camel_folder_freeze ((CamelFolder *)vf);
@@ -915,13 +919,15 @@ vee_folder_finalize (CamelVeeFolder *vf)
g_list_free (vf->priv->folders_changed);
camel_folder_change_info_free (vf->changes);
- camel_object_unref (vf->search);
+ g_object_unref (vf->search);
g_mutex_free (vf->priv->summary_lock);
g_mutex_free (vf->priv->subfolder_lock);
g_mutex_free (vf->priv->changed_lock);
g_hash_table_destroy (vf->hashes);
- g_free (vf->priv);
+
+ /* Chain up to parent's finalize () method. */
+ G_OBJECT_CLASS (camel_vee_folder_parent_class)->finalize (object);
}
/* This entire code will be useless, since we sync the counts always. */
@@ -1369,11 +1375,11 @@ vee_folder_delete (CamelFolder *folder)
while (p->folders) {
CamelFolder *f = p->folders->data;
- camel_object_ref (f);
+ g_object_ref (f);
camel_vee_folder_unlock (CAMEL_VEE_FOLDER (folder), CVF_SUBFOLDER_LOCK);
camel_vee_folder_remove_folder ((CamelVeeFolder *)folder, f);
- camel_object_unref (f);
+ g_object_unref (f);
camel_vee_folder_lock (CAMEL_VEE_FOLDER (folder), CVF_SUBFOLDER_LOCK);
}
camel_vee_folder_unlock (CAMEL_VEE_FOLDER (folder), CVF_SUBFOLDER_LOCK);
@@ -1907,8 +1913,8 @@ vee_folder_folder_changed (CamelVeeFolder *vee_folder,
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);
- m->sub = camel_object_ref (sub);
- m->vee_folder = camel_object_ref (vee_folder);
+ m->sub = g_object_ref (sub);
+ m->vee_folder = g_object_ref (vee_folder);
camel_session_thread_queue (session, &m->msg, 0);
}
@@ -1935,10 +1941,14 @@ vee_folder_folder_renamed (CamelVeeFolder *vee_folder,
static void
camel_vee_folder_class_init (CamelVeeFolderClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
CamelFolderClass *folder_class;
- camel_vee_folder_parent_class = CAMEL_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_folder_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelVeeFolderPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = vee_folder_finalize;
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = vee_folder_getv;
@@ -1970,7 +1980,7 @@ camel_vee_folder_init (CamelVeeFolder *vee_folder)
{
CamelFolder *folder = CAMEL_FOLDER (vee_folder);
- vee_folder->priv = g_new0 (CamelVeeFolderPrivate, 1);
+ vee_folder->priv = CAMEL_VEE_FOLDER_GET_PRIVATE (vee_folder);
folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
@@ -1996,24 +2006,6 @@ camel_vee_folder_init (CamelVeeFolder *vee_folder)
vee_folder->priv->unread_vfolder = -1;
}
-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),
- sizeof (CamelVeeFolderClass),
- (CamelObjectClassInitFunc) camel_vee_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_vee_folder_init,
- (CamelObjectFinalizeFunc) vee_folder_finalize);
- }
-
- return type;
-}
-
void
camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const gchar *full, const gchar *name, guint32 flags)
{
@@ -2046,7 +2038,7 @@ camel_vee_folder_new (CamelStore *parent_store, const gchar *full, guint32 flags
if (CAMEL_IS_VEE_STORE (parent_store) && strcmp (full, CAMEL_UNMATCHED_NAME) == 0) {
vf = ((CamelVeeStore *)parent_store)->folder_unmatched;
- camel_object_ref (vf);
+ g_object_ref (vf);
} else {
const gchar *name = strrchr (full, '/');
@@ -2054,7 +2046,7 @@ camel_vee_folder_new (CamelStore *parent_store, const gchar *full, guint32 flags
name = full;
else
name++;
- vf = (CamelVeeFolder *)camel_object_new (camel_vee_folder_get_type ());
+ vf = g_object_new (CAMEL_TYPE_VEE_FOLDER, NULL);
camel_vee_folder_construct (vf, parent_store, full, name, flags);
}
@@ -2101,7 +2093,7 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
/* for normal vfolders we want only unique ones, for unmatched we want them all recorded */
if (g_list_find (p->folders, sub) == NULL) {
p->folders = g_list_append (
- p->folders, camel_object_ref (sub));
+ p->folders, g_object_ref (sub));
camel_folder_lock (CAMEL_FOLDER (vf), CF_CHANGE_LOCK);
@@ -2114,7 +2106,7 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER (sub) && folder_unmatched != NULL) {
CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched);
up->folders = g_list_append (
- up->folders, camel_object_ref (sub));
+ up->folders, g_object_ref (sub));
camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK);
@@ -2183,7 +2175,7 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub)
if (sub->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED) {
while (g_list_find (up->folders, sub)) {
up->folders = g_list_remove (up->folders, sub);
- camel_object_unref (sub);
+ g_object_unref (sub);
/* undo the freeze state that Unmatched has imposed on this source folder */
camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK);
@@ -2194,7 +2186,7 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub)
} else if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
if (g_list_find (up->folders, sub) != NULL) {
up->folders = g_list_remove (up->folders, sub);
- camel_object_unref (sub);
+ g_object_unref (sub);
/* undo the freeze state that Unmatched has imposed on this source folder */
camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CF_CHANGE_LOCK);
@@ -2211,7 +2203,7 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub)
if (CAMEL_IS_VEE_FOLDER (sub))
return;
- camel_object_unref (sub);
+ g_object_unref (sub);
}
/**
@@ -2234,7 +2226,7 @@ static void
remove_folders (CamelFolder *folder, CamelFolder *foldercopy, CamelVeeFolder *vf)
{
camel_vee_folder_remove_folder (vf, folder);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
/**
@@ -2257,7 +2249,7 @@ camel_vee_folder_set_folders (CamelVeeFolder *vf, GList *folders)
l = p->folders;
while (l) {
g_hash_table_insert (remove, l->data, l->data);
- camel_object_ref (l->data);
+ g_object_ref (l->data);
l = l->next;
}
camel_vee_folder_unlock (vf, CVF_SUBFOLDER_LOCK);
@@ -2267,7 +2259,7 @@ camel_vee_folder_set_folders (CamelVeeFolder *vf, GList *folders)
while (l) {
if ((folder = g_hash_table_lookup (remove, l->data))) {
g_hash_table_remove (remove, folder);
- camel_object_unref (folder);
+ g_object_unref (folder);
} else {
camel_vee_folder_add_folder (vf, l->data);
}
@@ -2413,7 +2405,8 @@ camel_vee_folder_get_unread_vfolder (CamelVeeFolder *folder)
/* FIXME: This shouldn't be needed */
void
-camel_vee_folder_set_unread_vfolder (CamelVeeFolder *folder, gint unread_vfolder)
+camel_vee_folder_set_unread_vfolder (CamelVeeFolder *folder,
+ gint unread_vfolder)
{
g_return_if_fail (folder != NULL);
g_return_if_fail (CAMEL_IS_VEE_FOLDER (folder));
@@ -2428,27 +2421,26 @@ camel_vee_folder_set_unread_vfolder (CamelVeeFolder *folder, gint unread_vfolder
*
* Locks #folder's #lock. Unlock it with camel_vee_folder_unlock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_vee_folder_lock (CamelVeeFolder *folder, CamelVeeFolderLock lock)
+camel_vee_folder_lock (CamelVeeFolder *folder,
+ CamelVeeFolderLock lock)
{
- g_return_if_fail (folder != NULL);
g_return_if_fail (CAMEL_IS_VEE_FOLDER (folder));
- g_return_if_fail (folder->priv != NULL);
switch (lock) {
- case CVF_SUMMARY_LOCK:
- g_mutex_lock (folder->priv->summary_lock);
- break;
- case CVF_SUBFOLDER_LOCK:
- g_mutex_lock (folder->priv->subfolder_lock);
- break;
- case CVF_CHANGED_LOCK:
- g_mutex_lock (folder->priv->changed_lock);
- break;
- default:
- g_return_if_reached ();
+ case CVF_SUMMARY_LOCK:
+ g_mutex_lock (folder->priv->summary_lock);
+ break;
+ case CVF_SUBFOLDER_LOCK:
+ g_mutex_lock (folder->priv->subfolder_lock);
+ break;
+ case CVF_CHANGED_LOCK:
+ g_mutex_lock (folder->priv->changed_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
@@ -2459,26 +2451,25 @@ camel_vee_folder_lock (CamelVeeFolder *folder, CamelVeeFolderLock lock)
*
* Unlocks #folder's #lock, previously locked with camel_vee_folder_lock().
*
- * Since: 2.31.1
+ * Since: 3.0
**/
void
-camel_vee_folder_unlock (CamelVeeFolder *folder, CamelVeeFolderLock lock)
+camel_vee_folder_unlock (CamelVeeFolder *folder,
+ CamelVeeFolderLock lock)
{
- g_return_if_fail (folder != NULL);
g_return_if_fail (CAMEL_IS_VEE_FOLDER (folder));
- g_return_if_fail (folder->priv != NULL);
switch (lock) {
- case CVF_SUMMARY_LOCK:
- g_mutex_unlock (folder->priv->summary_lock);
- break;
- case CVF_SUBFOLDER_LOCK:
- g_mutex_unlock (folder->priv->subfolder_lock);
- break;
- case CVF_CHANGED_LOCK:
- g_mutex_unlock (folder->priv->changed_lock);
- break;
- default:
- g_return_if_reached ();
+ case CVF_SUMMARY_LOCK:
+ g_mutex_unlock (folder->priv->summary_lock);
+ break;
+ case CVF_SUBFOLDER_LOCK:
+ g_mutex_unlock (folder->priv->subfolder_lock);
+ break;
+ case CVF_CHANGED_LOCK:
+ g_mutex_unlock (folder->priv->changed_lock);
+ break;
+ default:
+ g_return_if_reached ();
}
}
diff --git a/camel/camel-vee-folder.h b/camel/camel-vee-folder.h
index d3c6020..da0e2c9 100644
--- a/camel/camel-vee-folder.h
+++ b/camel/camel-vee-folder.h
@@ -31,11 +31,24 @@
#include <camel/camel-store.h>
#include <camel/camel-vee-summary.h>
-#define CAMEL_VEE_FOLDER(obj) CAMEL_CHECK_CAST (obj, camel_vee_folder_get_type (), CamelVeeFolder)
-#define CAMEL_VEE_FOLDER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vee_folder_get_type (), CamelVeeFolderClass)
-#define CAMEL_IS_VEE_FOLDER(obj) CAMEL_CHECK_TYPE (obj, camel_vee_folder_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_VEE_FOLDER \
+ (camel_vee_folder_get_type ())
+#define CAMEL_VEE_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_VEE_FOLDER, CamelVeeFolder))
+#define CAMEL_VEE_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_VEE_FOLDER, CamelVeeFolderClass))
+#define CAMEL_IS_VEE_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_VEE_FOLDER))
+#define CAMEL_IS_VEE_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_VEE_FOLDER))
#define CAMEL_VEE_FOLDER_GET_CLASS(obj) \
- ((CamelVeeFolderClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_VEE_FOLDER, CamelVeeFolderClass))
G_BEGIN_DECLS
@@ -43,7 +56,7 @@ typedef struct _CamelVeeFolder CamelVeeFolder;
typedef struct _CamelVeeFolderClass CamelVeeFolderClass;
typedef struct _CamelVeeFolderPrivate CamelVeeFolderPrivate;
-typedef enum _CamelVeeFolderLock {
+typedef enum {
CVF_SUMMARY_LOCK,
CVF_SUBFOLDER_LOCK,
CVF_CHANGED_LOCK
@@ -87,7 +100,7 @@ struct _CamelVeeFolderClass {
#define CAMEL_UNMATCHED_NAME "UNMATCHED"
-CamelType camel_vee_folder_get_type (void);
+GType camel_vee_folder_get_type (void);
CamelFolder *camel_vee_folder_new (CamelStore *parent_store, const gchar *full, guint32 flags);
void camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const gchar *full, const gchar *name, guint32 flags);
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index e22972b..53b385a 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -43,7 +43,7 @@
#define CHANGE_DELETE (1)
#define CHANGE_NOSELECT (2)
-static gpointer camel_vee_store_parent_class;
+G_DEFINE_TYPE (CamelVeeStore, camel_vee_store, CAMEL_TYPE_STORE)
static gint
vee_folder_cmp (gconstpointer ap,
@@ -93,11 +93,16 @@ cvs_free_unmatched (gpointer key, gpointer value, gpointer data)
}
static void
-vee_store_finalize (CamelVeeStore *vee_store)
+vee_store_finalize (GObject *object)
{
+ CamelVeeStore *vee_store = CAMEL_VEE_STORE (object);
+
g_hash_table_foreach (vee_store->unmatched_uids, cvs_free_unmatched, NULL);
g_hash_table_destroy (vee_store->unmatched_uids);
- camel_object_unref (vee_store->folder_unmatched);
+ g_object_unref (vee_store->folder_unmatched);
+
+ /* Chain up to parent's finalize () method. */
+ G_OBJECT_CLASS (camel_vee_store_parent_class)->finalize (object);
}
static gboolean
@@ -122,7 +127,7 @@ vee_store_construct (CamelService *service,
/* Set up unmatched folder */
#ifndef VEE_UNMATCHED_ENABLE
vee_store->unmatched_uids = g_hash_table_new (g_str_hash, g_str_equal);
- vee_store->folder_unmatched = (CamelVeeFolder *)camel_object_new (camel_vee_folder_get_type ());
+ vee_store->folder_unmatched = g_object_new (CAMEL_TYPE_VEE_FOLDER, NULL);
camel_vee_folder_construct (vee_store->folder_unmatched, store, CAMEL_UNMATCHED_NAME, _("Unmatched"), CAMEL_STORE_FOLDER_PRIVATE);
camel_db_create_vfolder (store->cdb_r, _("Unmatched"), NULL);
#endif
@@ -164,7 +169,7 @@ vee_store_get_folder (CamelStore *store,
change_folder (store, name, CHANGE_ADD|CHANGE_NOSELECT, 0);
/* FIXME: this sort of leaks folder, nobody owns a ref to it but us */
} else {
- camel_object_unref (folder);
+ g_object_unref (folder);
}
*p++='/';
}
@@ -217,12 +222,12 @@ vee_store_rename_folder (CamelStore *store,
change_folder (store, name, CHANGE_ADD|CHANGE_NOSELECT, 0);
/* FIXME: this sort of leaks folder, nobody owns a ref to it but us */
} else {
- camel_object_unref (folder);
+ g_object_unref (folder);
}
*p++='/';
}
- camel_object_unref (oldfolder);
+ g_object_unref (oldfolder);
return TRUE;
}
@@ -258,7 +263,7 @@ vee_store_delete_folder (CamelStore *store,
change_folder (store, folder_name, CHANGE_DELETE, -1);
}
- camel_object_unref (folder);
+ g_object_unref (folder);
} else {
camel_exception_setv (
ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
@@ -370,7 +375,7 @@ vee_store_get_folder_info (CamelStore *store,
}
g_free (pname);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
g_ptr_array_free (folders, TRUE);
g_hash_table_destroy (infos_hash);
@@ -420,10 +425,12 @@ vee_store_get_junk (CamelStore *store,
static void
camel_vee_store_class_init (CamelVeeStoreClass *class)
{
+ GObjectClass *object_class;
CamelServiceClass *service_class;
CamelStoreClass *store_class;
- camel_vee_store_parent_class = (CamelStoreClass *)camel_store_get_type ();
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = vee_store_finalize;
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = vee_store_construct;
@@ -448,24 +455,6 @@ camel_vee_store_init (CamelVeeStore *vee_store)
store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);
}
-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),
- sizeof (CamelVeeStoreClass),
- (CamelObjectClassInitFunc) camel_vee_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_vee_store_init,
- (CamelObjectFinalizeFunc) vee_store_finalize);
- }
-
- return type;
-}
-
/**
* camel_vee_store_new:
*
@@ -476,5 +465,5 @@ camel_vee_store_get_type (void)
CamelVeeStore *
camel_vee_store_new (void)
{
- return CAMEL_VEE_STORE (camel_object_new (camel_vee_store_get_type ()));
+ return g_object_new (CAMEL_TYPE_VEE_STORE, NULL);
}
diff --git a/camel/camel-vee-store.h b/camel/camel-vee-store.h
index 6ff28f4..ae16975 100644
--- a/camel/camel-vee-store.h
+++ b/camel/camel-vee-store.h
@@ -28,9 +28,24 @@
#include <camel/camel-store.h>
-#define CAMEL_VEE_STORE(obj) CAMEL_CHECK_CAST (obj, camel_vee_store_get_type (), CamelVeeStore)
-#define CAMEL_VEE_STORE_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vee_store_get_type (), CamelVeeStoreClass)
-#define CAMEL_IS_VEE_STORE(obj) CAMEL_CHECK_TYPE (obj, camel_vee_store_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_VEE_STORE \
+ (camel_vee_store_get_type ())
+#define CAMEL_VEE_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_VEE_STORE, CamelVeeStore))
+#define CAMEL_VEE_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_VEE_STORE, CamelVeeStoreClass))
+#define CAMEL_IS_VEE_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_VEE_STORE))
+#define CAMEL_IS_VEE_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_VEE_STORE))
+#define CAMEL_VEE_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_VEE_STORE, CamelVeeStoreClass))
G_BEGIN_DECLS
@@ -59,7 +74,7 @@ struct _CamelVeeStoreClass {
CamelStoreClass parent_class;
};
-CamelType camel_vee_store_get_type (void);
+GType camel_vee_store_get_type (void);
CamelVeeStore * camel_vee_store_new (void);
G_END_DECLS
diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c
index cf73c9c..d2ba26f 100644
--- a/camel/camel-vee-summary.c
+++ b/camel/camel-vee-summary.c
@@ -40,16 +40,17 @@
#define d(x)
-static CamelFolderSummaryClass *camel_vee_summary_parent;
static const gchar *unread_str = " (and\n \n (match-all (not (system-flag \"Seen\")))\n \n )\n; (or\n \n (match-all (not (system-flag \"Seen\")))\n \n )\n; (match-threads \"all\" (and\n \n (match-all (not (system-flag \"Seen\")))\n \n )\n)\n; (match-threads \"all\" (or\n \n (match-all (not (system-flag \"Seen\")))\n \n )\n)\n;";
+G_DEFINE_TYPE (CamelVeeSummary, camel_vee_summary, CAMEL_TYPE_FOLDER_SUMMARY)
+
static void
vee_message_info_free(CamelFolderSummary *s, CamelMessageInfo *info)
{
CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)info;
camel_pstring_free(info->uid);
- camel_object_unref (mi->summary);
+ g_object_unref (mi->summary);
}
static CamelMessageInfo *
@@ -60,7 +61,7 @@ vee_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
to = (CamelVeeMessageInfo *)camel_message_info_new(s);
- to->summary = camel_object_ref (from->summary);
+ to->summary = g_object_ref (from->summary);
to->info.summary = s;
to->info.uid = camel_pstring_strdup(from->info.uid);
@@ -358,7 +359,7 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
strncpy(tmphash, uid, 8);
tmphash[8] = 0;
vinfo->summary = g_hash_table_lookup(((CamelVeeFolder *) s->folder)->hashes, tmphash);
- camel_object_ref (vinfo->summary);
+ g_object_ref (vinfo->summary);
camel_folder_summary_insert (s, info, FALSE);
}
return info;
@@ -390,27 +391,6 @@ camel_vee_summary_init (CamelVeeSummary *vee_summary)
{
}
-CamelType
-camel_vee_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- camel_vee_summary_parent = (CamelFolderSummaryClass *)camel_folder_summary_get_type();
-
- type = camel_type_register(
- camel_folder_summary_get_type(), "CamelVeeSummary",
- sizeof (CamelVeeSummary),
- sizeof (CamelVeeSummaryClass),
- (CamelObjectClassInitFunc) camel_vee_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_vee_summary_init,
- NULL);
- }
-
- return type;
-}
-
/**
* camel_vee_summary_new:
* @parent: Folder its attached to.
@@ -425,7 +405,7 @@ camel_vee_summary_new(CamelFolder *parent)
{
CamelVeeSummary *s;
- s = (CamelVeeSummary *)camel_object_new(camel_vee_summary_get_type());
+ s = g_object_new (CAMEL_TYPE_VEE_SUMMARY, NULL);
s->summary.folder = parent;
s->force_counts = FALSE;
s->fake_visible_count = 0;
@@ -479,7 +459,7 @@ camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const gch
d(g_message ("%s - already there\n", vuid));
g_free (vuid);
if (!mi->summary)
- mi->summary = camel_object_ref (summary);
+ mi->summary = g_object_ref (summary);
camel_message_info_ref (mi);
return mi;
@@ -490,7 +470,7 @@ camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const gch
fcache = camel_folder_summary_get_flag_cache(summary);
mi->old_flags = GPOINTER_TO_UINT(g_hash_table_lookup (fcache, uid));
/* We would do lazy loading of flags, when the folders are loaded to memory through folder_reloaded signal */
- camel_object_ref (summary);
+ g_object_ref (summary);
mi->info.uid = (gchar *) camel_pstring_strdup (vuid);
g_free (vuid);
camel_message_info_ref (mi);
diff --git a/camel/camel-vee-summary.h b/camel/camel-vee-summary.h
index 0b7855b..28ac2d3 100644
--- a/camel/camel-vee-summary.h
+++ b/camel/camel-vee-summary.h
@@ -29,9 +29,24 @@
#include <camel/camel-folder-summary.h>
-#define CAMEL_VEE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_vee_summary_get_type (), CamelVeeSummary)
-#define CAMEL_VEE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vee_summary_get_type (), CamelVeeSummaryClass)
-#define CAMEL_IS_VEE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_vee_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_VEE_SUMMARY \
+ (camel_vee_summary_get_type ())
+#define CAMEL_VEE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_VEE_SUMMARY, CamelVeeSummary))
+#define CAMEL_VEE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_VEE_SUMMARY, CamelVeeSummaryClass))
+#define CAMEL_IS_VEE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_VEE_SUMMARY))
+#define CAMEL_IS_VEE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_VEE_SUMMARY))
+#define CAMEL_VEE_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_VEE_SUMMARY, CamelVeeSummaryClass))
G_BEGIN_DECLS
@@ -59,7 +74,7 @@ struct _CamelVeeSummaryClass {
CamelFolderSummaryClass parent_class;
};
-CamelType camel_vee_summary_get_type (void);
+GType camel_vee_summary_get_type (void);
CamelFolderSummary *
camel_vee_summary_new (struct _CamelFolder *parent);
CamelVeeMessageInfo *
diff --git a/camel/camel-vtrash-folder.c b/camel/camel-vtrash-folder.c
index f7e5bf0..b013308 100644
--- a/camel/camel-vtrash-folder.c
+++ b/camel/camel-vtrash-folder.c
@@ -59,7 +59,7 @@ struct _transfer_data {
gboolean delete;
};
-static CamelVeeFolderClass *camel_vtrash_folder_parent;
+G_DEFINE_TYPE (CamelVTrashFolder, camel_vtrash_folder, CAMEL_TYPE_VEE_FOLDER)
static void
transfer_messages (CamelFolder *folder,
@@ -75,7 +75,7 @@ transfer_messages (CamelFolder *folder,
for (i=0;i<md->uids->len;i++)
g_free(md->uids->pdata[i]);
g_ptr_array_free(md->uids, TRUE);
- camel_object_unref (md->folder);
+ g_object_unref (md->folder);
g_free(md);
}
@@ -166,7 +166,7 @@ vtrash_folder_getv (CamelObject *object,
arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
}
- return CAMEL_OBJECT_CLASS (camel_vtrash_folder_parent)->getv (object, ex, args);
+ return CAMEL_OBJECT_CLASS (camel_vtrash_folder_parent_class)->getv (object, ex, args);
}
static gboolean
@@ -243,7 +243,7 @@ vtrash_folder_transfer_messages_to (CamelFolder *source,
md = g_hash_table_lookup(batch, mi->summary->folder);
if (md == NULL) {
md = g_malloc0(sizeof(*md));
- md->folder = camel_object_ref (mi->summary->folder);
+ md->folder = g_object_ref (mi->summary->folder);
md->uids = g_ptr_array_new();
md->dest = dest;
g_hash_table_insert(batch, mi->summary->folder, md);
@@ -271,8 +271,6 @@ camel_vtrash_folder_class_init (CamelVTrashFolderClass *class)
CamelObjectClass *camel_object_class;
CamelFolderClass *folder_class;
- camel_vtrash_folder_parent = CAMEL_VEE_FOLDER_CLASS(camel_vee_folder_get_type());
-
/* Not required from here on. We don't count */
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = vtrash_folder_getv;
@@ -287,25 +285,6 @@ camel_vtrash_folder_init (CamelVTrashFolder *vtrash_folder)
{
}
-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",
- sizeof (CamelVTrashFolder),
- sizeof (CamelVTrashFolderClass),
- (CamelObjectClassInitFunc) camel_vtrash_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_vtrash_folder_init,
- NULL);
- }
-
- return type;
-}
-
/**
* camel_vtrash_folder_new:
* @parent_store: the parent #CamelVeeStore object
@@ -323,7 +302,7 @@ camel_vtrash_folder_new (CamelStore *parent_store, camel_vtrash_folder_t type)
g_assert(type < CAMEL_VTRASH_FOLDER_LAST);
- vtrash = (CamelVTrashFolder *)camel_object_new(camel_vtrash_folder_get_type());
+ vtrash = g_object_new (CAMEL_TYPE_VTRASH_FOLDER, NULL);
camel_vee_folder_construct(CAMEL_VEE_FOLDER (vtrash), parent_store, vdata[type].full_name, _(vdata[type].name),
CAMEL_STORE_FOLDER_PRIVATE|CAMEL_STORE_FOLDER_CREATE|CAMEL_STORE_VEE_FOLDER_AUTO|CAMEL_STORE_VEE_FOLDER_SPECIAL);
diff --git a/camel/camel-vtrash-folder.h b/camel/camel-vtrash-folder.h
index 87112ca..d9ee180 100644
--- a/camel/camel-vtrash-folder.h
+++ b/camel/camel-vtrash-folder.h
@@ -30,9 +30,24 @@
#include <camel/camel-folder.h>
#include <camel/camel-vee-folder.h>
-#define CAMEL_VTRASH_FOLDER(obj) CAMEL_CHECK_CAST (obj, camel_vtrash_folder_get_type (), CamelVTrashFolder)
-#define CAMEL_VTRASH_FOLDER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vtrash_folder_get_type (), CamelVTrashFolderClass)
-#define CAMEL_IS_VTRASH_FOLDER(obj) CAMEL_CHECK_TYPE (obj, camel_vtrash_folder_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_VTRASH_FOLDER \
+ (camel_vtrash_folder_get_type ())
+#define CAMEL_VTRASH_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_VTRASH_FOLDER, CamelVTrashFolder))
+#define CAMEL_VTRASH_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_VTRASH_FOLDER, CamelVTrashFolderClass))
+#define CAMEL_IS_VTRASH_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_VTRASH_FOLDER))
+#define CAMEL_IS_VTRASH_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_VTRASH_FOLDER))
+#define CAMEL_VTRASH_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_VTRASH_FOLDER, CamelVTrashFolderClass))
#define CAMEL_VTRASH_NAME ".#evolution/Trash"
#define CAMEL_VJUNK_NAME ".#evolution/Junk"
@@ -59,7 +74,7 @@ struct _CamelVTrashFolderClass {
CamelVeeFolderClass parent_class;
};
-CamelType camel_vtrash_folder_get_type (void);
+GType camel_vtrash_folder_get_type (void);
CamelFolder * camel_vtrash_folder_new (CamelStore *parent_store,
camel_vtrash_folder_t type);
diff --git a/camel/camel.c b/camel/camel.c
index 9bf0796..f9214a0 100644
--- a/camel/camel.c
+++ b/camel/camel.c
@@ -72,9 +72,6 @@ camel_init (const gchar *configdir, gboolean nss_init)
camel_debug_init();
- /* initialise global camel_object_type */
- camel_object_get_type ();
-
#ifdef HAVE_NSS
if (nss_init) {
gchar *nss_configdir;
@@ -137,7 +134,7 @@ camel_init (const gchar *configdir, gboolean nss_init)
/* set this certdb as the default db */
camel_certdb_set_default (certdb);
- camel_object_unref (certdb);
+ g_object_unref (certdb);
initialised = TRUE;
diff --git a/camel/camel.h b/camel/camel.h
index 4a776f9..3465e86 100644
--- a/camel/camel.h
+++ b/camel/camel.h
@@ -91,6 +91,7 @@
#include <camel/camel-net-utils.h>
#include <camel/camel-nntp-address.h>
#include <camel/camel-object.h>
+#include <camel/camel-object-bag.h>
#include <camel/camel-offline-folder.h>
#include <camel/camel-offline-journal.h>
#include <camel/camel-offline-store.h>
diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c
index d678fb1..5d47efe 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -61,7 +61,9 @@ which needs to be better organized via functions */
#define MAX_ATTACHMENT_SIZE 1*1024*1024 /*In bytes*/
#define GROUPWISE_BULK_DELETE_LIMIT 100
-static gpointer camel_groupwise_folder_parent_class;
+#define CAMEL_GROUPWISE_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_GROUPWISE_FOLDER, CamelGroupwiseFolderPrivate))
struct _CamelGroupwiseFolderPrivate {
@@ -96,6 +98,8 @@ static gboolean groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMess
static const gchar * GET_ITEM_VIEW_WITH_CACHE = "peek default recipient threading attachments subject status priority startDate created delivered size recurrenceKey message notification";
static const gchar * GET_ITEM_VIEW_WITHOUT_CACHE = "peek default recipient threading hasAttachment subject status priority startDate created delivered size recurrenceKey";
+G_DEFINE_TYPE (CamelGroupwiseFolder, camel_groupwise_folder, CAMEL_TYPE_OFFLINE_FOLDER)
+
static gchar *
groupwise_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
@@ -140,9 +144,9 @@ groupwise_folder_get_message( CamelFolder *folder, const gchar *uid, CamelExcept
camel_exception_setv (
ex, CAMEL_EXCEPTION_USER_CANCEL,
_("User canceled"));
- camel_object_unref (msg);
- camel_object_unref (cache_stream);
- camel_object_unref (stream);
+ g_object_unref (msg);
+ g_object_unref (cache_stream);
+ g_object_unref (stream);
camel_message_info_free (&mi->info);
return NULL;
} else {
@@ -150,13 +154,13 @@ groupwise_folder_get_message( CamelFolder *folder, const gchar *uid, CamelExcept
ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot get message %s: %s"),
uid, g_strerror (errno));
- camel_object_unref (msg);
+ g_object_unref (msg);
msg = NULL;
}
}
- camel_object_unref (cache_stream);
+ g_object_unref (cache_stream);
}
- camel_object_unref (stream);
+ g_object_unref (stream);
if (msg != NULL) {
camel_message_info_free (&mi->info);
@@ -219,7 +223,7 @@ groupwise_folder_get_message( CamelFolder *folder, const gchar *uid, CamelExcept
if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *) msg, cache_stream) == -1
|| camel_stream_flush (cache_stream) == -1)
camel_data_cache_remove (gw_folder->cache, "cache", uid, NULL);
- camel_object_unref (cache_stream);
+ g_object_unref (cache_stream);
}
CAMEL_GROUPWISE_FOLDER_REC_UNLOCK (folder, cache_lock);
@@ -335,7 +339,7 @@ groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multi
camel_multipart_set_boundary (multipart, NULL);
camel_multipart_add_part (multipart, part);
- camel_object_unref (part);
+ g_object_unref (part);
}
/* Set the recipients list in the message from the item */
@@ -985,7 +989,7 @@ camel_gw_folder_new(CamelStore *store, const gchar *folder_name, const gchar *fo
gchar *summary_file, *state_file, *journal_file;
gchar *short_name;
- folder = CAMEL_FOLDER (camel_object_new(camel_groupwise_folder_get_type ()) );
+ folder = g_object_new (CAMEL_TYPE_GROUPWISE_FOLDER, NULL);
gw_folder = CAMEL_GROUPWISE_FOLDER(folder);
short_name = strrchr (folder_name, '/');
@@ -999,7 +1003,7 @@ camel_gw_folder_new(CamelStore *store, const gchar *folder_name, const gchar *fo
folder->summary = camel_groupwise_summary_new(folder, summary_file);
g_free(summary_file);
if (!folder->summary) {
- camel_object_unref (CAMEL_OBJECT (folder));
+ g_object_unref (CAMEL_OBJECT (folder));
camel_exception_setv (
ex, CAMEL_EXCEPTION_SYSTEM,
_("Could not load summary for %s"), folder_name);
@@ -1014,7 +1018,7 @@ camel_gw_folder_new(CamelStore *store, const gchar *folder_name, const gchar *fo
gw_folder->cache = camel_data_cache_new (folder_dir ,ex);
if (!gw_folder->cache) {
- camel_object_unref (folder);
+ g_object_unref (folder);
return NULL;
}
@@ -1022,7 +1026,7 @@ camel_gw_folder_new(CamelStore *store, const gchar *folder_name, const gchar *fo
gw_folder->journal = camel_groupwise_journal_new (gw_folder, journal_file);
g_free (journal_file);
if (!gw_folder->journal) {
- camel_object_unref (folder);
+ g_object_unref (folder);
return NULL;
}
@@ -1033,7 +1037,7 @@ camel_gw_folder_new(CamelStore *store, const gchar *folder_name, const gchar *fo
gw_folder->search = camel_folder_search_new ();
if (!gw_folder->search) {
- camel_object_unref (folder);
+ g_object_unref (folder);
return NULL;
}
@@ -1163,7 +1167,7 @@ update_free (CamelSession *session, CamelSessionThreadMsg *msg)
g_free (m->t_str);
g_free (m->container_id);
- camel_object_unref (m->folder);
+ g_object_unref (m->folder);
g_slist_foreach (m->slist, (GFunc) g_free, NULL);
g_slist_free (m->slist);
m->slist = NULL;
@@ -1464,7 +1468,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
msg->cnc = cnc;
msg->t_str = g_strdup (old_sync_time);
msg->container_id = g_strdup (container_id);
- msg->folder = camel_object_ref (folder);
+ msg->folder = g_object_ref (folder);
camel_session_thread_queue (session, &msg->msg, 0);
/*thread creation and queueing done*/
}
@@ -1760,7 +1764,7 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
/* add to cache if its a new message*/
t_cache_stream = camel_data_cache_get (gw_folder->cache, "cache", id, ex);
if (t_cache_stream) {
- camel_object_unref (t_cache_stream);
+ g_object_unref (t_cache_stream);
mail_msg = groupwise_folder_item_to_msg (folder, item, ex);
if (mail_msg)
@@ -1770,10 +1774,10 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
if ((cache_stream = camel_data_cache_add (gw_folder->cache, "cache", id, NULL))) {
if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *) mail_msg, cache_stream) == -1 || camel_stream_flush (cache_stream) == -1)
camel_data_cache_remove (gw_folder->cache, "cache", id, NULL);
- camel_object_unref (cache_stream);
+ g_object_unref (cache_stream);
}
- camel_object_unref (mail_msg);
+ g_object_unref (mail_msg);
CAMEL_GROUPWISE_FOLDER_REC_UNLOCK (folder, cache_lock);
}
/******************** Caching stuff ends *************************/
@@ -2110,8 +2114,8 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
if (has_mime_822 && body) {
temp_stream = camel_stream_mem_new_with_buffer (body, body_len);
if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) msg, temp_stream) == -1) {
- camel_object_unref (msg);
- camel_object_unref (temp_stream);
+ g_object_unref (msg);
+ g_object_unref (temp_stream);
msg = NULL;
goto end;
}
@@ -2211,8 +2215,8 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
camel_medium_set_content (CAMEL_MEDIUM (part),CAMEL_DATA_WRAPPER(temp_msg));
camel_multipart_add_part (multipart,part);
- camel_object_unref (temp_msg);
- camel_object_unref (part);
+ g_object_unref (temp_msg);
+ g_object_unref (part);
}
g_object_unref (temp_item);
} else {
@@ -2293,7 +2297,7 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
camel_multipart_set_boundary(multipart, NULL);
camel_multipart_add_part (multipart, part);
- camel_object_unref (part);
+ g_object_unref (part);
g_free (attachment);
} /* if attachment */
}
@@ -2310,7 +2314,7 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
camel_medium_add_header ( CAMEL_MEDIUM (msg), "Security", e_gw_item_get_security(item));
camel_medium_set_content (CAMEL_MEDIUM (msg), CAMEL_DATA_WRAPPER(multipart));
- camel_object_unref (multipart);
+ g_object_unref (multipart);
end:
if (body)
@@ -2538,7 +2542,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
break;
camel_groupwise_journal_transfer (journal, (CamelGroupwiseFolder *)source, message, info, uids->pdata[i], NULL, ex);
- camel_object_unref (message);
+ g_object_unref (message);
if (camel_exception_is_set (ex))
break;
@@ -2798,23 +2802,35 @@ groupwise_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
}
static void
-groupwise_folder_finalize (CamelGroupwiseFolder *gw_folder)
+groupwise_folder_dispose (GObject *object)
{
- g_free (gw_folder->priv);
+ CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER (object);
+
+ if (gw_folder->cache != NULL) {
+ g_object_unref (gw_folder->cache);
+ gw_folder->cache = NULL;
+ }
- if (gw_folder->cache)
- camel_object_unref (gw_folder->cache);
- if (gw_folder->search)
- camel_object_unref (gw_folder->search);
+ if (gw_folder->search != NULL) {
+ g_object_unref (gw_folder->search);
+ gw_folder->search = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_groupwise_folder_parent_class)->dispose (object);
}
static void
camel_groupwise_folder_class_init (CamelGroupwiseFolderClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
CamelFolderClass *folder_class;
- camel_groupwise_folder_parent_class = CAMEL_OFFLINE_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_offline_folder_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelGroupwiseFolderPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = groupwise_folder_dispose;
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = gw_getv;
@@ -2841,7 +2857,7 @@ camel_groupwise_folder_init (CamelGroupwiseFolder *gw_folder)
{
CamelFolder *folder = CAMEL_FOLDER (gw_folder);
- gw_folder->priv = g_malloc0 (sizeof(*gw_folder->priv));
+ gw_folder->priv = CAMEL_GROUPWISE_FOLDER_GET_PRIVATE (gw_folder);
folder->permanent_flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED |
CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN;
@@ -2856,26 +2872,6 @@ camel_groupwise_folder_init (CamelGroupwiseFolder *gw_folder)
gw_folder->need_rescan = TRUE;
}
-CamelType
-camel_groupwise_folder_get_type (void)
-{
- static CamelType camel_groupwise_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_groupwise_folder_type == CAMEL_INVALID_TYPE) {
- camel_groupwise_folder_type =
- camel_type_register (camel_offline_folder_get_type (),
- "CamelGroupwiseFolder",
- sizeof (CamelGroupwiseFolder),
- sizeof (CamelGroupwiseFolderClass),
- (CamelObjectClassInitFunc) camel_groupwise_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_groupwise_folder_init,
- (CamelObjectFinalizeFunc) groupwise_folder_finalize);
- }
-
- return camel_groupwise_folder_type;
-}
-
static gint
gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
diff --git a/camel/providers/groupwise/camel-groupwise-folder.h b/camel/providers/groupwise/camel-groupwise-folder.h
index aed6b14..937818e 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.h
+++ b/camel/providers/groupwise/camel-groupwise-folder.h
@@ -31,10 +31,24 @@
#include "camel-groupwise-summary.h"
-#define CAMEL_GROUPWISE_FOLDER_TYPE (camel_groupwise_folder_get_type ())
-#define CAMEL_GROUPWISE_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_GROUPWISE_FOLDER_TYPE, CamelGroupwiseFolder))
-#define CAMEL_GROUPWISE_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_GROUPWISE_FOLDER_TYPE, CamelGroupwiseFolderClass))
-#define CAMEL_IS_GROUPWISE_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_GROUPWISE_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_GROUPWISE_FOLDER \
+ (camel_groupwise_folder_get_type ())
+#define CAMEL_GROUPWISE_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_GROUPWISE_FOLDER, CamelGroupwiseFolder))
+#define CAMEL_GROUPWISE_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_GROUPWISE_FOLDER, CamelGroupwiseFolderClass))
+#define CAMEL_IS_GROUPWISE_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_GROUPWISE_FOLDER))
+#define CAMEL_IS_GROUPWISE_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_GROUPWISE_FOLDER))
+#define CAMEL_GROUPWISE_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_GROUPWISE_FOLDER, CamelGroupwiseFolderClass))
G_BEGIN_DECLS
@@ -64,7 +78,7 @@ struct _CamelGroupwiseFolderClass {
} ;
-CamelType camel_groupwise_folder_get_type (void);
+GType camel_groupwise_folder_get_type (void);
/* implemented */
CamelFolder * camel_gw_folder_new(CamelStore *store, const gchar *folder_dir, const gchar *folder_name, CamelException *ex);
diff --git a/camel/providers/groupwise/camel-groupwise-journal.c b/camel/providers/groupwise/camel-groupwise-journal.c
index 558a604..a854978 100644
--- a/camel/providers/groupwise/camel-groupwise-journal.c
+++ b/camel/providers/groupwise/camel-groupwise-journal.c
@@ -46,15 +46,13 @@ static CamelDListNode *groupwise_entry_load (CamelOfflineJournal *journal, FILE
static gint groupwise_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
static gint groupwise_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
-static gpointer camel_groupwise_journal_parent_class;
+G_DEFINE_TYPE (CamelGroupwiseJournal, camel_groupwise_journal, CAMEL_TYPE_OFFLINE_JOURNAL)
static void
camel_groupwise_journal_class_init (CamelGroupwiseJournalClass *class)
{
CamelOfflineJournalClass *offline_journal_class;
- camel_groupwise_journal_parent_class = (CamelOfflineJournalClass *) camel_type_get_global_classfuncs (CAMEL_TYPE_OFFLINE_JOURNAL);
-
offline_journal_class = CAMEL_OFFLINE_JOURNAL_CLASS (class);
offline_journal_class->entry_free = groupwise_entry_free;
offline_journal_class->entry_load = groupwise_entry_load;
@@ -67,25 +65,6 @@ camel_groupwise_journal_init (CamelGroupwiseJournal *groupwise_journal)
{
}
-CamelType
-camel_groupwise_journal_get_type (void)
-{
- static CamelType type = NULL;
-
- if (!type) {
- type = camel_type_register (camel_offline_journal_get_type (),
- "CamelGroupwiseJournal",
- sizeof (CamelGroupwiseJournal),
- sizeof (CamelGroupwiseJournalClass),
- (CamelObjectClassInitFunc) camel_groupwise_journal_class_init,
- NULL,
- (CamelObjectInitFunc) camel_groupwise_journal_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return type;
-}
-
static void
groupwise_entry_free (CamelOfflineJournal *journal, CamelDListNode *entry)
{
@@ -192,12 +171,12 @@ groupwise_entry_play_append (CamelOfflineJournal *journal, CamelGroupwiseJournal
message = camel_mime_message_new ();
if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) message, stream) == -1) {
- camel_object_unref (message);
- camel_object_unref (stream);
+ g_object_unref (message);
+ g_object_unref (stream);
goto done;
}
- camel_object_unref (stream);
+ g_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 */
@@ -206,7 +185,7 @@ groupwise_entry_play_append (CamelOfflineJournal *journal, CamelGroupwiseJournal
success = camel_folder_append_message (folder, message, info, NULL, ex);
camel_message_info_free (info);
- camel_object_unref (message);
+ g_object_unref (message);
if (!success)
return -1;
@@ -252,7 +231,7 @@ groupwise_entry_play_transfer (CamelOfflineJournal *journal, CamelGroupwiseJourn
g_ptr_array_free (xuids, TRUE);
g_ptr_array_free (uids, TRUE);
- camel_object_unref (src);
+ g_object_unref (src);
} else if (!name) {
camel_exception_setv (
ex, CAMEL_EXCEPTION_SYSTEM,
@@ -298,7 +277,7 @@ camel_groupwise_journal_new (CamelGroupwiseFolder *folder, const gchar *filename
g_return_val_if_fail (CAMEL_IS_GROUPWISE_FOLDER (folder), NULL);
- journal = (CamelOfflineJournal *) camel_object_new (camel_groupwise_journal_get_type ());
+ journal = g_object_new (CAMEL_TYPE_OFFLINE_JOURNAL, NULL);
camel_offline_journal_construct (journal, (CamelFolder *) folder, filename);
return journal;
@@ -340,12 +319,12 @@ update_cache (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *messag
g_strerror (errno));
camel_data_cache_remove (groupwise_folder->cache, "cache", uid, NULL);
folder->summary->nextuid--;
- camel_object_unref (cache);
+ g_object_unref (cache);
g_free (uid);
return FALSE;
}
- camel_object_unref (cache);
+ g_object_unref (cache);
info = camel_folder_summary_info_new_from_message (folder->summary, message, NULL);
camel_pstring_free(info->uid);
diff --git a/camel/providers/groupwise/camel-groupwise-journal.h b/camel/providers/groupwise/camel-groupwise-journal.h
index b16349c..d6246ea 100644
--- a/camel/providers/groupwise/camel-groupwise-journal.h
+++ b/camel/providers/groupwise/camel-groupwise-journal.h
@@ -26,12 +26,24 @@
#include <stdarg.h>
#include <camel/camel.h>
-#define CAMEL_TYPE_GROUPWISE_JOURNAL (camel_groupwise_journal_get_type ())
-#define CAMEL_GROUPWISE_JOURNAL(obj) (CAMEL_CHECK_CAST ((obj), CAMEL_TYPE_GROUPWISE_JOURNAL, CamelGroupwiseJournal))
-#define CAMEL_GROUPWISE_JOURNAL_CLASS(klass) (CAMEL_CHECK_CLASS_CAST ((klass), CAMEL_TYPE_GROUPWISE_JOURNAL, CamelGroupwiseJournalClass))
-#define CAMEL_IS_GROUPWISE_JOURNAL(obj) (CAMEL_CHECK_TYPE ((obj), CAMEL_TYPE_GROUPWISE_JOURNAL))
-#define CAMEL_IS_GROUPWISE_JOURNAL_CLASS(klass) (CAMEL_CHECK_CLASS_TYPE ((klass), CAMEL_TYPE_GROUPWISE_JOURNAL))
-#define CAMEL_GROUPWISE_JOURNAL_GET_CLASS(obj) (CAMEL_CHECK_GET_CLASS ((obj), CAMEL_TYPE_GROUPWISE_JOURNAL, CamelGroupwiseJournalClass))
+/* Standard GObject macros */
+#define CAMEL_TYPE_GROUPWISE_JOURNAL \
+ (camel_groupwise_journal_get_type ())
+#define CAMEL_GROUPWISE_JOURNAL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_GROUPWISE_JOURNAL, CamelGroupwiseJournal))
+#define CAMEL_GROUPWISE_JOURNAL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_GROUPWISE_JOURNAL, CamelGroupwiseJournalClass))
+#define CAMEL_IS_GROUPWISE_JOURNAL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_GROUPWISE_JOURNAL))
+#define CAMEL_IS_GROUPWISE_JOURNAL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_GROUPWISE_JOURNAL))
+#define CAMEL_GROUPWISE_JOURNAL_GET_CLASS(obj) \
+ (CAMEL_CHECK_GET_CLASS \
+ ((obj), CAMEL_TYPE_GROUPWISE_JOURNAL, CamelGroupwiseJournalClass))
G_BEGIN_DECLS
@@ -66,7 +78,7 @@ struct _CamelGroupwiseJournalClass {
};
-CamelType camel_groupwise_journal_get_type (void);
+GType camel_groupwise_journal_get_type (void);
CamelOfflineJournal *camel_groupwise_journal_new (struct _CamelGroupwiseFolder *folder, const gchar *filename);
diff --git a/camel/providers/groupwise/camel-groupwise-store-summary.c b/camel/providers/groupwise/camel-groupwise-store-summary.c
index 5bdf956..8bcd0b6 100644
--- a/camel/providers/groupwise/camel-groupwise-store-summary.c
+++ b/camel/providers/groupwise/camel-groupwise-store-summary.c
@@ -50,15 +50,13 @@ static void store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint
static const gchar *store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type);
CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_find_full(CamelGroupwiseStoreSummary *s, const gchar *full);
-static gpointer camel_groupwise_store_summary_parent_class;
+G_DEFINE_TYPE (CamelGroupwiseStoreSummary, camel_groupwise_store_summary, CAMEL_TYPE_STORE_SUMMARY)
static void
camel_groupwise_store_summary_class_init (CamelGroupwiseStoreSummaryClass *class)
{
CamelStoreSummaryClass *store_summary_class;
- camel_groupwise_store_summary_parent_class = (CamelStoreSummaryClass *)camel_store_summary_get_type();
-
store_summary_class = CAMEL_STORE_SUMMARY_CLASS (class);
store_summary_class->summary_header_load = summary_header_load;
store_summary_class->summary_header_save = summary_header_save;
@@ -78,29 +76,10 @@ camel_groupwise_store_summary_init (CamelGroupwiseStoreSummary *gw_summary)
gw_summary->version = CAMEL_GW_STORE_SUMMARY_VERSION;
}
-CamelType
-camel_groupwise_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 (),
- "CamelGroupwiseStoreSummary",
- sizeof (CamelGroupwiseStoreSummary),
- sizeof (CamelGroupwiseStoreSummaryClass),
- (CamelObjectClassInitFunc) camel_groupwise_store_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_groupwise_store_summary_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return type;
-}
-
CamelGroupwiseStoreSummary *
camel_groupwise_store_summary_new (void)
{
- return CAMEL_GW_STORE_SUMMARY ( camel_object_new (camel_groupwise_store_summary_get_type ()));
+ return g_object_new (CAMEL_TYPE_GROUPWISE_STORE_SUMMARY, NULL);
}
CamelGroupwiseStoreInfo *
diff --git a/camel/providers/groupwise/camel-groupwise-store-summary.h b/camel/providers/groupwise/camel-groupwise-store-summary.h
index 59a0b91..45eebf7 100644
--- a/camel/providers/groupwise/camel-groupwise-store-summary.h
+++ b/camel/providers/groupwise/camel-groupwise-store-summary.h
@@ -24,9 +24,24 @@
#include <camel/camel.h>
-#define CAMEL_GW_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_groupwise_store_summary_get_type (), CamelGroupwiseStoreSummary)
-#define CAMEL_GW_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_groupwise_store_summary_get_type (), CamelGroupwiseStoreSummaryClass)
-#define CAMEL_IS_GW_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_groupwise_store_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_GROUPWISE_STORE_SUMMARY \
+ (camel_groupwise_store_summary_get_type ())
+#define CAMEL_GROUPWISE_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_GROUPWISE_STORE_SUMMARY, CamelGroupwiseStoreSummary))
+#define CAMEL_GROUPWISE_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_GROUPWISE_STORE_SUMMARY, CamelGroupwiseStoreSummaryClass))
+#define CAMEL_IS_GROUPWISE_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_GROUPWISE_STORE_SUMMARY))
+#define CAMEL_IS_GROUPWISE_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_GROUPWISE_STORE_SUMMARY))
+#define CAMEL_GROUPWISE_STORE_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_GROUPWISE_STORE_SUMMARY, CamelGroupwiseStoreSummaryClass))
G_BEGIN_DECLS
@@ -68,7 +83,7 @@ struct _CamelGroupwiseStoreSummaryClass {
CamelStoreSummaryClass summary_class;
};
-CamelType camel_groupwise_store_summary_get_type (void);
+GType camel_groupwise_store_summary_get_type (void);
CamelGroupwiseStoreSummary *camel_groupwise_store_summary_new (void);
CamelGroupwiseStoreInfo *camel_groupwise_store_summary_full_name(CamelGroupwiseStoreSummary *s, const gchar *full_name);
CamelGroupwiseStoreInfo *camel_groupwise_store_summary_add_from_full(CamelGroupwiseStoreSummary *s, const gchar *full, gchar dir_sep);
diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c
index 995ed8b..b152258 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -53,6 +53,10 @@
#define JUNK_ENABLE 1
#define JUNK_PERSISTENCE 14
+#define CAMEL_GROUPWISE_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_GROUPWISE_STORE, CamelGroupwiseStorePrivate))
+
const gchar * CREATE_CURSOR_VIEW = "peek id default recipient threading hasAttachment subject status priority startDate created delivered size recurrenceKey";
struct _CamelGroupwiseStorePrivate {
@@ -70,13 +74,13 @@ struct _CamelGroupwiseStorePrivate {
EGwConnection *cnc;
};
-static gpointer camel_groupwise_store_parent_class;
-
extern CamelServiceAuthType camel_groupwise_password_authtype; /*for the query_auth_types function*/
static CamelFolderInfo *convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, const gchar *url, CamelException *ex);
static gboolean groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex);
static gint match_path(const gchar *path, const gchar *name);
+G_DEFINE_TYPE (CamelGroupwiseStore, camel_groupwise_store, CAMEL_TYPE_OFFLINE_STORE)
+
static gboolean
groupwise_store_construct (CamelService *service, CamelSession *session,
CamelProvider *provider, CamelURL *url,
@@ -263,12 +267,12 @@ groupwise_store_set_current_folder (CamelGroupwiseStore *groupwise_store, CamelF
camel_service_lock (CAMEL_SERVICE (groupwise_store), CS_REC_CONNECT_LOCK);
if (groupwise_store->current_folder) {
- camel_object_unref (groupwise_store->current_folder);
+ g_object_unref (groupwise_store->current_folder);
groupwise_store->current_folder = NULL;
}
if (folder)
- groupwise_store->current_folder = camel_object_ref (folder);
+ groupwise_store->current_folder = g_object_ref (folder);
camel_service_unlock (CAMEL_SERVICE (groupwise_store), CS_REC_CONNECT_LOCK);
}
@@ -295,6 +299,7 @@ groupwise_connect (CamelService *service, CamelException *ex)
camel_service_construct (service, service->session, service->provider, service->url, ex);
}
+
camel_service_lock (service, CS_REC_CONNECT_LOCK);
if (priv->cnc) {
@@ -344,10 +349,9 @@ 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);
+ g_object_unref (groupwise_store->summary);
}
if (priv) {
@@ -648,7 +652,7 @@ groupwise_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags
camel_folder_summary_save_to_db (folder->summary, ex);
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
camel_operation_end (NULL);
- camel_object_unref (folder);
+ g_object_unref (folder);
g_free (container_id);
return NULL;*/
}
@@ -1117,7 +1121,7 @@ store_refresh_free(CamelSession *session, CamelSessionThreadMsg *msg)
{
struct _store_refresh_msg *m = (struct _store_refresh_msg *)msg;
- camel_object_unref (m->store);
+ g_object_unref (m->store);
camel_exception_clear (&m->ex);
}
@@ -1487,15 +1491,35 @@ match_path(const gchar *path, const gchar *name)
}
static void
-groupwise_store_finalize (CamelGroupwiseStore *groupwise_store)
+groupwise_store_dispose (GObject *object)
{
- CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
+ CamelGroupwiseStore *groupwise_store;
+
+ groupwise_store = CAMEL_GROUPWISE_STORE (object);
if (groupwise_store->summary != NULL) {
- camel_store_summary_save ((CamelStoreSummary *)groupwise_store->summary);
- camel_object_unref (groupwise_store->summary);
+ camel_store_summary_save (
+ CAMEL_STORE_SUMMARY (groupwise_store->summary));
+ g_object_unref (groupwise_store->summary);
+ groupwise_store->summary = NULL;
}
+ if (groupwise_store->priv->cnc != NULL) {
+ g_object_unref (groupwise_store->priv->cnc);
+ groupwise_store->priv->cnc = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_groupwise_store_parent_class)->dispose (object);
+}
+
+static void
+groupwise_store_finalize (GObject *object)
+{
+ CamelGroupwiseStore *groupwise_store;
+
+ groupwise_store = CAMEL_GROUPWISE_STORE (object);
+
g_free (groupwise_store->priv->user);
g_free (groupwise_store->priv->server_name);
g_free (groupwise_store->priv->port);
@@ -1504,31 +1528,31 @@ groupwise_store_finalize (CamelGroupwiseStore *groupwise_store)
g_free (groupwise_store->priv->storage_path);
g_free (groupwise_store->root_container);
-
- if (E_IS_GW_CONNECTION (groupwise_store->priv->cnc)) {
- g_object_unref (groupwise_store->priv->cnc);
- groupwise_store->priv->cnc = NULL;
- }
-
if (groupwise_store->priv->id_hash != NULL)
- g_hash_table_destroy (priv->id_hash);
+ g_hash_table_destroy (groupwise_store->priv->id_hash);
if (groupwise_store->priv->name_hash != NULL)
- g_hash_table_destroy (priv->name_hash);
+ g_hash_table_destroy (groupwise_store->priv->name_hash);
if (groupwise_store->priv->parent_hash != NULL)
- g_hash_table_destroy (priv->parent_hash);
+ g_hash_table_destroy (groupwise_store->priv->parent_hash);
- g_free (groupwise_store->priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_groupwise_store_parent_class)->finalize (object);
}
static void
camel_groupwise_store_class_init (CamelGroupwiseStoreClass *class)
{
+ GObjectClass *object_class;
CamelServiceClass *service_class;
CamelStoreClass *store_class;
- camel_groupwise_store_parent_class = CAMEL_OFFLINE_STORE_CLASS (camel_type_get_global_classfuncs (camel_offline_store_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelGroupwiseStorePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = groupwise_store_dispose;
+ object_class->finalize = groupwise_store_finalize;
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = groupwise_store_construct;
@@ -1553,7 +1577,8 @@ camel_groupwise_store_class_init (CamelGroupwiseStoreClass *class)
static void
camel_groupwise_store_init (CamelGroupwiseStore *groupwise_store)
{
- groupwise_store->priv = g_new0 (CamelGroupwiseStorePrivate, 1);
+ groupwise_store->priv =
+ CAMEL_GROUPWISE_STORE_GET_PRIVATE (groupwise_store);
d("in groupwise store init\n");
groupwise_store->priv->server_name = NULL;
@@ -1563,23 +1588,3 @@ camel_groupwise_store_init (CamelGroupwiseStore *groupwise_store)
groupwise_store->priv->cnc = NULL;
groupwise_store->current_folder = NULL;
}
-
-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 (),
- "CamelGroupwiseStore",
- sizeof (CamelGroupwiseStore),
- sizeof (CamelGroupwiseStoreClass),
- (CamelObjectClassInitFunc) camel_groupwise_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_groupwise_store_init,
- (CamelObjectFinalizeFunc) groupwise_store_finalize);
- }
-
- return camel_groupwise_store_type;
-}
diff --git a/camel/providers/groupwise/camel-groupwise-store.h b/camel/providers/groupwise/camel-groupwise-store.h
index b52f2a0..02bb9a6 100644
--- a/camel/providers/groupwise/camel-groupwise-store.h
+++ b/camel/providers/groupwise/camel-groupwise-store.h
@@ -31,10 +31,24 @@
#include <e-gw-connection.h>
#include <e-gw-container.h>
-#define CAMEL_GROUPWISE_STORE_TYPE (camel_groupwise_store_get_type ())
-#define CAMEL_GROUPWISE_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_GROUPWISE_STORE_TYPE, CamelGroupwiseStore))
-#define CAMEL_GROUPWISE_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_GROUPWISE_STORE_TYPE, CamelGroupwiseStoreClass))
-#define CAMEL_IS_GROUPWISE_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_GROUPWISE_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_GROUPWISE_STORE \
+ (camel_groupwise_store_get_type ())
+#define CAMEL_GROUPWISE_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_GROUPWISE_STORE, CamelGroupwiseStore))
+#define CAMEL_GROUPWISE_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_GROUPWISE_STORE, CamelGroupwiseStoreClass))
+#define CAMEL_IS_GROUPWISE_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_GROUPWISE_STORE))
+#define CAMEL_IS_GROUPWISE_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_GROUPWISE_STORE))
+#define CAMEL_GROUPWISE_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_GROUPWISE_STORE, CamelGroupwiseStoreClass))
#define GW_PARAM_FILTER_INBOX (1 << 0)
@@ -62,7 +76,7 @@ struct _CamelGroupwiseStoreClass {
CamelOfflineStoreClass parent_class;
};
-CamelType camel_groupwise_store_get_type (void);
+GType camel_groupwise_store_get_type (void);
gchar * groupwise_get_name(CamelService *service, gboolean brief);
/*IMplemented*/
diff --git a/camel/providers/groupwise/camel-groupwise-summary.c b/camel/providers/groupwise/camel-groupwise-summary.c
index 601c896..f8f1cb1 100644
--- a/camel/providers/groupwise/camel-groupwise-summary.c
+++ b/camel/providers/groupwise/camel-groupwise-summary.c
@@ -63,7 +63,7 @@ static CamelMessageContentInfo * content_info_from_db (CamelFolderSummary *s, Ca
/*End of Prototypes*/
-static gpointer camel_groupwise_summary_parent_class;
+G_DEFINE_TYPE (CamelGroupwiseSummary, camel_groupwise_summary, CAMEL_TYPE_FOLDER_SUMMARY)
static CamelMessageInfo *
gw_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
@@ -85,8 +85,6 @@ camel_groupwise_summary_class_init (CamelGroupwiseSummaryClass *class)
{
CamelFolderSummaryClass *folder_summary_class;
- camel_groupwise_summary_parent_class = CAMEL_FOLDER_SUMMARY_CLASS (camel_type_get_global_classfuncs (camel_folder_summary_get_type()));
-
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
folder_summary_class->message_info_size = sizeof (CamelGroupwiseMessageInfo);
folder_summary_class->content_info_size = sizeof (CamelGroupwiseMessageContentInfo);
@@ -115,25 +113,6 @@ camel_groupwise_summary_init (CamelGroupwiseSummary *gw_summary)
summary->meta_summary->uid_len = 2048;
}
-CamelType
-camel_groupwise_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(
- camel_folder_summary_get_type(), "CamelGroupwiseSummary",
- sizeof (CamelGroupwiseSummary),
- sizeof (CamelGroupwiseSummaryClass),
- (CamelObjectClassInitFunc) camel_groupwise_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_groupwise_summary_init,
- NULL);
- }
-
- return type;
-}
-
/**
* camel_groupwise_summary_new:
* @filename: the file to store the summary in.
@@ -149,7 +128,7 @@ camel_groupwise_summary_new (struct _CamelFolder *folder, const gchar *filename)
CamelFolderSummary *summary;
CamelException ex;
- summary = CAMEL_FOLDER_SUMMARY (camel_object_new (camel_groupwise_summary_get_type ()));
+ summary = g_object_new (CAMEL_TYPE_GROUPWISE_SUMMARY, NULL);
summary->folder = folder;
camel_folder_summary_set_build_content (summary, TRUE);
camel_folder_summary_set_filename (summary, filename);
diff --git a/camel/providers/groupwise/camel-groupwise-summary.h b/camel/providers/groupwise/camel-groupwise-summary.h
index 1056af5..fbe84b4 100644
--- a/camel/providers/groupwise/camel-groupwise-summary.h
+++ b/camel/providers/groupwise/camel-groupwise-summary.h
@@ -24,9 +24,24 @@
#include <camel/camel.h>
-#define CAMEL_GROUPWISE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_groupwise_summary_get_type (), CamelGroupwiseSummary)
-#define CAMEL_GROUPWISE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_groupwise_summary_get_type (), CamelGroupwiseSummaryClass)
-#define CAMEL_IS_GROUPWISE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_groupwise_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_GROUPWISE_SUMMARY \
+ (camel_groupwise_summary_get_type ())
+#define CAMEL_GROUPWISE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_GROUPWISE_SUMMARY, CamelGroupwiseSummary))
+#define CAMEL_GROUPWISE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_GROUPWISE_SUMMARY, CamelGroupwiseSummaryClass))
+#define CAMEL_IS_GROUPWISE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_GROUPWISE_SUMMARY))
+#define CAMEL_IS_GROUPWISE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_GROUPWISE_SUMMARY))
+#define CAMEL_GROUPWISE_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_GROUPWISE_SUMMARY, CamelGroupwiseSummaryClass))
G_BEGIN_DECLS
@@ -63,7 +78,7 @@ struct _CamelGroupwiseSummaryClass {
CamelFolderSummaryClass parent_class;
} ;
-CamelType camel_groupwise_summary_get_type (void);
+GType camel_groupwise_summary_get_type (void);
CamelFolderSummary *camel_groupwise_summary_new (struct _CamelFolder *folder, const gchar *filename);
diff --git a/camel/providers/groupwise/camel-groupwise-transport.c b/camel/providers/groupwise/camel-groupwise-transport.c
index 2880fe5..786ec13 100644
--- a/camel/providers/groupwise/camel-groupwise-transport.c
+++ b/camel/providers/groupwise/camel-groupwise-transport.c
@@ -36,7 +36,7 @@
#define REPLY_VIEW "default message attachments threading"
-static gpointer camel_groupwise_transport_parent_class;
+G_DEFINE_TYPE (CamelGroupwiseTransport, camel_groupwise_transport, CAMEL_TYPE_TRANSPORT)
static gboolean
groupwise_transport_connect (CamelService *service,
@@ -173,8 +173,6 @@ camel_groupwise_transport_class_init (CamelGroupwiseTransportClass *class)
CamelServiceClass *service_class;
CamelTransportClass *transport_class;
- camel_groupwise_transport_parent_class = CAMEL_TRANSPORT_CLASS (camel_type_get_global_classfuncs (camel_transport_get_type ()));
-
service_class = CAMEL_SERVICE_CLASS (class);
service_class->connect = groupwise_transport_connect;
service_class->get_name = groupwise_transport_get_name;
@@ -187,23 +185,3 @@ static void
camel_groupwise_transport_init (CamelGroupwiseTransport *groupwise_transport)
{
}
-
-CamelType
-camel_groupwise_transport_get_type (void)
-{
- static CamelType camel_groupwise_transport_type = CAMEL_INVALID_TYPE;
-
- if (camel_groupwise_transport_type == CAMEL_INVALID_TYPE) {
- camel_groupwise_transport_type =
- camel_type_register (CAMEL_TRANSPORT_TYPE,
- "CamelGroupwiseTransport",
- sizeof (CamelGroupwiseTransport),
- sizeof (CamelGroupwiseTransportClass),
- (CamelObjectClassInitFunc) camel_groupwise_transport_class_init,
- NULL,
- (CamelObjectInitFunc) camel_groupwise_transport_init,
- NULL);
- }
-
- return camel_groupwise_transport_type;
-}
diff --git a/camel/providers/groupwise/camel-groupwise-transport.h b/camel/providers/groupwise/camel-groupwise-transport.h
index 61e5773..9abf71a 100644
--- a/camel/providers/groupwise/camel-groupwise-transport.h
+++ b/camel/providers/groupwise/camel-groupwise-transport.h
@@ -26,10 +26,24 @@
#include <camel/camel.h>
-#define CAMEL_GROUPWISE_TRANSPORT_TYPE (camel_groupwise_transport_get_type ())
-#define CAMEL_GROUPWISE_TRANSPORT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_GROUPWISE_TRANSPORT_TYPE, CamelGroupwiseTransport))
-#define CAMEL_GROUPWISE_TRANSPORT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_GROUPWISE_TRANSPORT_TYPE, CamelGroupwiseTransportClass))
-#define CAMEL_IS_GROUPWISE_TRANSPORT(o) (CAMEL_CHECK_TYPE((o), CAMEL_GROUPWISE_TRANSPORT_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_GROUPWISE_TRANSPORT \
+ (camel_groupwise_transport_get_type ())
+#define CAMEL_GROUPWISE_TRANSPORT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_GROUPWISE_TRANSPORT, CamelGroupwiseTransport))
+#define CAMEL_GROUPWISE_TRANSPORT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_GROUPWISE_TRANSPORT, CamelGroupwiseTransportClass))
+#define CAMEL_IS_GROUPWISE_TRANSPORT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_GROUPWISE_TRANSPORT))
+#define CAMEL_IS_GROUPWISE_TRANSPORT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_GROUPWISE_TRANSPORT))
+#define CAMEL_GROUPWISE_TRANSPORT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_GROUPWISE_TRANSPORT, CamelGroupwiseTransportClass))
G_BEGIN_DECLS
@@ -45,7 +59,7 @@ struct _CamelGroupwiseTransportClass {
CamelTransportClass parent_class;
};
-CamelType camel_groupwise_transport_get_type (void);
+GType camel_groupwise_transport_get_type (void);
G_END_DECLS
diff --git a/camel/providers/groupwise/camel-groupwise-utils.c b/camel/providers/groupwise/camel-groupwise-utils.c
index c4f9ca1..775f0f7 100644
--- a/camel/providers/groupwise/camel-groupwise-utils.c
+++ b/camel/providers/groupwise/camel-groupwise-utils.c
@@ -438,15 +438,15 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
filter = camel_mime_filter_charset_new (charset, "UTF-8");
filtered_stream = camel_stream_filter_new (content);
camel_stream_filter_add ((CamelStreamFilter *) filtered_stream, filter);
- camel_object_unref (filter);
+ g_object_unref (filter);
} else {
/* US-ASCII or UTF-8 */
- filtered_stream = camel_object_ref (content);
+ filtered_stream = g_object_ref (content);
}
camel_data_wrapper_decode_to_stream (dw, filtered_stream);
camel_stream_flush (filtered_stream);
- camel_object_unref (filtered_stream);
+ g_object_unref (filtered_stream);
camel_stream_write (content, "", 1);
e_gw_item_set_message (item, (const gchar *)byte_array->data);
@@ -455,7 +455,7 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
send_as_attachment (cnc, item, content, type, dw, NULL, NULL, &attach_list);
}
- camel_object_unref (content);
+ g_object_unref (content);
}
/*Populate EGwItem*/
/*From Address*/
@@ -654,7 +654,7 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
cid = camel_mime_part_get_content_id (temp_part);
send_as_attachment (cnc, item, temp_content, type, temp_dw, filename, cid, attach_list);
}
- camel_object_unref (temp_content);
+ g_object_unref (temp_content);
continue;
}
@@ -673,15 +673,15 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
filter = camel_mime_filter_charset_new (charset, "UTF-8");
filtered_stream = camel_stream_filter_new (content);
camel_stream_filter_add ((CamelStreamFilter *) filtered_stream, filter);
- camel_object_unref (filter);
+ g_object_unref (filter);
} else {
/* US-ASCII or UTF-8 */
- filtered_stream = camel_object_ref (content);
+ filtered_stream = g_object_ref (content);
}
camel_data_wrapper_decode_to_stream (dw, filtered_stream);
camel_stream_flush (filtered_stream);
- camel_object_unref (filtered_stream);
+ g_object_unref (filtered_stream);
camel_stream_write (content, "", 1);
e_gw_item_set_message (item, (const gchar *) buffer->data);
@@ -694,6 +694,6 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
send_as_attachment (cnc, item, content, type, dw, filename, content_id, attach_list);
}
- camel_object_unref (content);
+ g_object_unref (content);
} /*end of for*/
}
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 0a3bcdb..fba6122 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -97,9 +97,9 @@ camel_imap_command (CamelImapStore *store,
cmd = imap_command_strdup_vprintf (store, fmt, ap);
va_end (ap);
} else {
- camel_object_ref (folder);
+ g_object_ref (folder);
if (store->current_folder)
- camel_object_unref (store->current_folder);
+ g_object_unref (store->current_folder);
store->current_folder = folder;
cmd = imap_command_strdup_printf (store, "SELECT %F", folder->full_name);
}
@@ -406,7 +406,7 @@ imap_read_response (CamelImapStore *store, CamelException *ex)
response = g_new0 (CamelImapResponse, 1);
/*FIXME 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));
+ g_object_ref (CAMEL_OBJECT (response->folder));
} */
response->untagged = g_ptr_array_new ();
@@ -663,7 +663,7 @@ camel_imap_response_free (CamelImapStore *store, CamelImapResponse *response)
g_array_free (expunged, TRUE);
}
- camel_object_unref (CAMEL_OBJECT (response->folder));
+ g_object_unref (CAMEL_OBJECT (response->folder));
}
g_free (response);
@@ -686,7 +686,7 @@ camel_imap_response_free_without_processing (CamelImapStore *store,
return;
if (response->folder) {
- camel_object_unref (CAMEL_OBJECT (response->folder));
+ g_object_unref (CAMEL_OBJECT (response->folder));
response->folder = NULL;
}
camel_imap_response_free (store, response);
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 1505569..3b4004c 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -58,9 +58,11 @@
* octets) */
#define UID_SET_LIMIT (768)
-extern gint camel_application_is_exiting;
+#define CAMEL_IMAP_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_IMAP_FOLDER, CamelImapFolderPrivate))
-static gpointer camel_imap_folder_parent_class;
+extern gint camel_application_is_exiting;
static CamelProperty imap_property_list[] = {
{ CAMEL_IMAP_FOLDER_CHECK_FOLDER, "check_folder", N_("Always check for new mail in this folder") },
@@ -127,42 +129,69 @@ static CamelImapMessageInfo * imap_folder_summary_uid_or_error(
#define strtok_r(s,sep,lasts) (*(lasts)=strtok((s),(sep)))
#endif
+G_DEFINE_TYPE (CamelImapFolder, camel_imap_folder, CAMEL_TYPE_OFFLINE_FOLDER)
+
static void
-imap_folder_finalize (CamelObject *object)
+imap_folder_dispose (GObject *object)
{
CamelImapFolder *imap_folder;
imap_folder = CAMEL_IMAP_FOLDER (object);
- if (imap_folder->search != NULL)
- camel_object_unref (imap_folder->search);
+ if (imap_folder->search != NULL) {
+ g_object_unref (imap_folder->search);
+ imap_folder->search = NULL;
+ }
- if (imap_folder->cache != NULL)
- camel_object_unref (imap_folder->cache);
+ if (imap_folder->cache != NULL) {
+ g_object_unref (imap_folder->cache);
+ imap_folder->cache = NULL;
+ }
-#ifdef ENABLE_THREADS
- g_static_mutex_free(&imap_folder->priv->search_lock);
- g_static_rec_mutex_free(&imap_folder->priv->cache_lock);
-#endif
- if (imap_folder->priv->ignore_recent)
+ if (imap_folder->priv->ignore_recent != NULL) {
g_hash_table_unref (imap_folder->priv->ignore_recent);
+ imap_folder->priv->ignore_recent = NULL;
+ }
- if (imap_folder->journal) {
+ if (imap_folder->journal != NULL) {
camel_offline_journal_write (imap_folder->journal, NULL);
- camel_object_unref (imap_folder->journal);
+ g_object_unref (imap_folder->journal);
+ imap_folder->journal = NULL;
}
- g_free(imap_folder->priv);
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_imap_folder_parent_class)->dispose (object);
+}
+
+static void
+imap_folder_finalize (GObject *object)
+{
+ CamelImapFolder *imap_folder;
+
+ imap_folder = CAMEL_IMAP_FOLDER (object);
+
+#ifdef ENABLE_THREADS
+ g_static_mutex_free (&imap_folder->priv->search_lock);
+ g_static_rec_mutex_free (&imap_folder->priv->cache_lock);
+#endif
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imap_folder_parent_class)->finalize (object);
}
static void
camel_imap_folder_class_init (CamelImapFolderClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
CamelFolderClass *folder_class;
- gint ii;
+ gint i;
- camel_imap_folder_parent_class = CAMEL_OFFLINE_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_offline_folder_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelImapFolderPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = imap_folder_dispose;
+ object_class->finalize = imap_folder_finalize;
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = imap_getv;
@@ -187,9 +216,9 @@ camel_imap_folder_class_init (CamelImapFolderClass *class)
folder_class->get_filename = imap_get_filename;
/* only localize here, do not create GSList, we do not want to leak */
- for (ii = 0; ii < G_N_ELEMENTS (imap_property_list); ii++)
- imap_property_list[ii].description =
- _(imap_property_list[ii].description);
+ for (i = 0; i < G_N_ELEMENTS (imap_property_list); i++)
+ imap_property_list[i].description =
+ _(imap_property_list[i].description);
}
static void
@@ -197,7 +226,7 @@ camel_imap_folder_init (CamelImapFolder *imap_folder)
{
CamelFolder *folder = CAMEL_FOLDER (imap_folder);
- imap_folder->priv = g_malloc0(sizeof(*imap_folder->priv));
+ imap_folder->priv = CAMEL_IMAP_FOLDER_GET_PRIVATE (imap_folder);
folder->permanent_flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED |
CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN;
@@ -215,26 +244,6 @@ camel_imap_folder_init (CamelImapFolder *imap_folder)
imap_folder->need_rescan = TRUE;
}
-CamelType
-camel_imap_folder_get_type (void)
-{
- static CamelType camel_imap_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_imap_folder_type == CAMEL_INVALID_TYPE) {
- camel_imap_folder_type =
- camel_type_register (camel_offline_folder_get_type (),
- "CamelImapFolder",
- sizeof (CamelImapFolder),
- sizeof (CamelImapFolderClass),
- (CamelObjectClassInitFunc) camel_imap_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_folder_init,
- (CamelObjectFinalizeFunc) imap_folder_finalize);
- }
-
- return camel_imap_folder_type;
-}
-
static void
replay_offline_journal (CamelImapStore *imap_store, CamelImapFolder *imap_folder, CamelException *ex)
{
@@ -282,7 +291,7 @@ camel_imap_folder_new (CamelStore *parent, const gchar *folder_name,
return NULL;
}
- folder = CAMEL_FOLDER (camel_object_new (camel_imap_folder_get_type ()));
+ folder = g_object_new (CAMEL_TYPE_IMAP_FOLDER, NULL);
short_name = strrchr (folder_name, '/');
if (short_name)
short_name++;
@@ -294,7 +303,7 @@ camel_imap_folder_new (CamelStore *parent, const gchar *folder_name,
folder->summary = camel_imap_summary_new (folder, summary_file);
g_free (summary_file);
if (!folder->summary) {
- camel_object_unref (CAMEL_OBJECT (folder));
+ g_object_unref (CAMEL_OBJECT (folder));
camel_exception_setv (
ex, CAMEL_EXCEPTION_SYSTEM,
_("Could not load summary for %s"), folder_name);
@@ -314,7 +323,7 @@ camel_imap_folder_new (CamelStore *parent, const gchar *folder_name,
imap_folder->cache = camel_imap_message_cache_new (folder_dir, folder->summary, ex);
if (!imap_folder->cache) {
- camel_object_unref (CAMEL_OBJECT (folder));
+ g_object_unref (CAMEL_OBJECT (folder));
return NULL;
}
@@ -1600,7 +1609,7 @@ imap_expunge_uids_online (CamelFolder *folder,
camel_service_lock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK);
if ((store->capabilities & IMAP_CAPABILITY_UIDPLUS) == 0) {
- if (!CAMEL_FOLDER_GET_CLASS (folder)->sync(folder, 0, ex)) {
+ if (!CAMEL_FOLDER_GET_CLASS (folder)->sync (folder, 0, ex)) {
camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK);
return FALSE;
}
@@ -1963,9 +1972,9 @@ do_append (CamelFolder *folder,
CAMEL_STREAM_FILTER (streamfilter), crlf_filter);
camel_data_wrapper_write_to_stream (
CAMEL_DATA_WRAPPER (message), streamfilter);
- camel_object_unref (streamfilter);
- camel_object_unref (crlf_filter);
- camel_object_unref (memstream);
+ g_object_unref (streamfilter);
+ g_object_unref (crlf_filter);
+ g_object_unref (memstream);
/* Some servers don't let us append with (CamelMessageInfo *)custom flags. If the command fails for
whatever reason, assume this is the case and save the state and try again */
@@ -2180,7 +2189,7 @@ imap_transfer_offline (CamelFolder *source,
if (message) {
camel_imap_summary_add_offline (dest->summary, destuid, message, mi);
- camel_object_unref (CAMEL_OBJECT (message));
+ g_object_unref (CAMEL_OBJECT (message));
} else
camel_imap_summary_add_offline_uncached (dest->summary, destuid, mi);
@@ -2531,7 +2540,7 @@ imap_transfer_resyncing (CamelFolder *source,
imap_append_online (dest, message, info, NULL, ex);
camel_folder_free_message_info (source, info);
- camel_object_unref (CAMEL_OBJECT (message));
+ g_object_unref (CAMEL_OBJECT (message));
if (delete_originals && !camel_exception_is_set (ex))
camel_folder_delete_message (source, uid);
i++;
@@ -2755,9 +2764,9 @@ get_content (CamelImapFolder *imap_folder, const gchar *uid,
if (stream) {
ret = camel_data_wrapper_construct_from_stream (
CAMEL_DATA_WRAPPER (body_mp), stream);
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
if (ret == -1) {
- camel_object_unref ( body_mp);
+ g_object_unref ( body_mp);
return NULL;
}
}
@@ -2795,10 +2804,10 @@ get_content (CamelImapFolder *imap_folder, const gchar *uid,
part = camel_mime_part_new ();
ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (part), stream);
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
if (ret == -1) {
- camel_object_unref (CAMEL_OBJECT (part));
- camel_object_unref (CAMEL_OBJECT (body_mp));
+ g_object_unref (CAMEL_OBJECT (part));
+ g_object_unref (CAMEL_OBJECT (body_mp));
g_free (child_spec);
return NULL;
}
@@ -2807,7 +2816,7 @@ get_content (CamelImapFolder *imap_folder, const gchar *uid,
}
if (!stream || !content) {
- camel_object_unref (CAMEL_OBJECT (body_mp));
+ g_object_unref (CAMEL_OBJECT (body_mp));
g_free (child_spec);
return NULL;
}
@@ -2833,10 +2842,10 @@ get_content (CamelImapFolder *imap_folder, const gchar *uid,
}
camel_medium_set_content (CAMEL_MEDIUM (part), content);
- camel_object_unref (content);
+ g_object_unref (content);
camel_multipart_add_part (body_mp, part);
- camel_object_unref (part);
+ g_object_unref (part);
ci = ci->next;
}
@@ -2892,15 +2901,15 @@ get_message (CamelImapFolder *imap_folder, const gchar *uid,
msg = camel_mime_message_new ();
ret = camel_data_wrapper_construct_from_stream (
CAMEL_DATA_WRAPPER (msg), stream);
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
if (ret == -1) {
- camel_object_unref (CAMEL_OBJECT (msg));
+ g_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));
+ g_object_unref (CAMEL_OBJECT (msg));
return NULL;
}
@@ -2915,7 +2924,7 @@ get_message (CamelImapFolder *imap_folder, const gchar *uid,
camel_data_wrapper_set_mime_type_field(content, camel_mime_part_get_content_type((CamelMimePart *)msg));
camel_medium_set_content (CAMEL_MEDIUM (msg), content);
- camel_object_unref (CAMEL_OBJECT (content));
+ g_object_unref (CAMEL_OBJECT (content));
return msg;
}
@@ -2939,13 +2948,13 @@ get_message_simple (CamelImapFolder *imap_folder, const gchar *uid,
msg = camel_mime_message_new ();
ret = camel_data_wrapper_construct_from_stream (
CAMEL_DATA_WRAPPER (msg), stream);
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
if (ret == -1) {
camel_exception_setv (
ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("Unable to retrieve message: %s"),
g_strerror (errno));
- camel_object_unref (CAMEL_OBJECT (msg));
+ g_object_unref (CAMEL_OBJECT (msg));
return NULL;
}
@@ -3184,12 +3193,12 @@ imap_sync_message (CamelFolder *folder,
/* If its cached in full, just get it as is, this is only a shortcut,
since we get stuff from the cache anyway. It affects a busted connection though. */
if ((stream = camel_imap_folder_fetch_data(imap_folder, uid, "", TRUE, NULL))) {
- camel_object_unref (stream);
+ g_object_unref (stream);
return TRUE;
}
msg = imap_get_message(folder, uid, ex);
if (msg != NULL) {
- camel_object_unref (msg);
+ g_object_unref (msg);
success = TRUE;
}
@@ -3206,7 +3215,7 @@ imap_cache_message (CamelDiscoFolder *disco_folder, const gchar *uid,
stream = camel_imap_folder_fetch_data (imap_folder, uid, "", FALSE, ex);
if (stream)
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
}
*/
@@ -3340,14 +3349,14 @@ add_message_from_data (CamelFolder *folder, GPtrArray *messages,
msg = camel_mime_message_new ();
if (camel_data_wrapper_construct_from_stream (
CAMEL_DATA_WRAPPER (msg), stream) == -1) {
- camel_object_unref (CAMEL_OBJECT (msg));
+ g_object_unref (CAMEL_OBJECT (msg));
return;
}
bodystructure = g_datalist_get_data (&data, "BODY");
mi = (CamelImapMessageInfo *)camel_folder_summary_info_new_from_message (folder->summary, msg, bodystructure);
- camel_object_unref (CAMEL_OBJECT (msg));
+ g_object_unref (CAMEL_OBJECT (msg));
if ((idate = g_datalist_get_data (&data, "INTERNALDATE")))
mi->info.date_received = decode_internaldate ((const guchar *) idate);
@@ -3949,7 +3958,7 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const gchar *uid,
ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("Could not find message body in FETCH response."));
} else {
- camel_object_ref (CAMEL_OBJECT (stream));
+ g_object_ref (CAMEL_OBJECT (stream));
g_datalist_clear (&fetch_data);
}
@@ -4100,7 +4109,7 @@ parse_fetch_response (CamelImapFolder *imap_folder, gchar *response)
if (stream)
g_datalist_set_data_full (&data, "BODY_PART_STREAM", stream,
- (GDestroyNotify) camel_object_unref);
+ (GDestroyNotify) g_object_unref);
}
return data;
diff --git a/camel/providers/imap/camel-imap-folder.h b/camel/providers/imap/camel-imap-folder.h
index b68fc11..c47959d 100644
--- a/camel/providers/imap/camel-imap-folder.h
+++ b/camel/providers/imap/camel-imap-folder.h
@@ -31,10 +31,24 @@
#include "camel-imap-command.h"
#include "camel-imap-message-cache.h"
-#define CAMEL_IMAP_FOLDER_TYPE (camel_imap_folder_get_type ())
-#define CAMEL_IMAP_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_FOLDER_TYPE, CamelImapFolder))
-#define CAMEL_IMAP_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_FOLDER_TYPE, CamelImapFolderClass))
-#define CAMEL_IS_IMAP_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAP_FOLDER \
+ (camel_imap_folder_get_type ())
+#define CAMEL_IMAP_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAP_FOLDER, CamelImapFolder))
+#define CAMEL_IMAP_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAP_FOLDER, CamelImapFolderClass))
+#define CAMEL_IS_IMAP_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAP_FOLDER))
+#define CAMEL_IS_IMAP_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAP_FOLDER))
+#define CAMEL_IMAP_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAP_FOLDER, CamelImapFolderClass))
G_BEGIN_DECLS
@@ -101,8 +115,7 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
gboolean
imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelException *ex);
-/* Standard Camel function */
-CamelType camel_imap_folder_get_type (void);
+GType camel_imap_folder_get_type (void);
G_END_DECLS
diff --git a/camel/providers/imap/camel-imap-journal.c b/camel/providers/imap/camel-imap-journal.c
index 730d281..340aa02 100644
--- a/camel/providers/imap/camel-imap-journal.c
+++ b/camel/providers/imap/camel-imap-journal.c
@@ -49,7 +49,7 @@ static void unref_folder (gpointer key, gpointer value, gpointer data);
static void free_uids (GPtrArray *array);
static void close_folder (gpointer name, gpointer folder, gpointer data);
-static gpointer camel_imap_journal_parent_class;
+G_DEFINE_TYPE (CamelIMAPJournal, camel_imap_journal, CAMEL_TYPE_OFFLINE_JOURNAL)
static void
free_uid (gpointer key, gpointer value, gpointer data)
@@ -59,8 +59,10 @@ free_uid (gpointer key, gpointer value, gpointer data)
}
static void
-imap_journal_finalize (CamelIMAPJournal *journal)
+imap_journal_finalize (GObject *object)
{
+ CamelIMAPJournal *journal = CAMEL_IMAP_JOURNAL (object);
+
if (journal->folders) {
g_hash_table_foreach (journal->folders, unref_folder, NULL);
g_hash_table_destroy (journal->folders);
@@ -71,14 +73,19 @@ imap_journal_finalize (CamelIMAPJournal *journal)
g_hash_table_foreach (journal->uidmap, free_uid, NULL);
g_hash_table_destroy (journal->uidmap);
}
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imap_journal_parent_class)->finalize (object);
}
static void
camel_imap_journal_class_init (CamelIMAPJournalClass *class)
{
+ GObjectClass *object_class;
CamelOfflineJournalClass *offline_journal_class;
- camel_imap_journal_parent_class = (CamelOfflineJournalClass *) camel_type_get_global_classfuncs (CAMEL_TYPE_OFFLINE_JOURNAL);
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = imap_journal_finalize;
offline_journal_class = CAMEL_OFFLINE_JOURNAL_CLASS (class);
offline_journal_class->entry_free = imap_entry_free;
@@ -94,29 +101,10 @@ camel_imap_journal_init (CamelIMAPJournal *journal)
journal->uidmap = g_hash_table_new (g_str_hash, g_str_equal);
}
-CamelType
-camel_imap_journal_get_type (void)
-{
- static CamelType type = NULL;
-
- if (!type) {
- type = camel_type_register (camel_offline_journal_get_type (),
- "CamelIMAPJournal",
- sizeof (CamelIMAPJournal),
- sizeof (CamelIMAPJournalClass),
- (CamelObjectClassInitFunc) camel_imap_journal_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_journal_init,
- (CamelObjectFinalizeFunc) imap_journal_finalize);
- }
-
- return type;
-}
-
static void
unref_folder (gpointer key, gpointer value, gpointer data)
{
- camel_object_unref (value);
+ g_object_unref (value);
}
static void
@@ -393,7 +381,7 @@ camel_imap_journal_new (CamelImapFolder *folder, const gchar *filename)
g_return_val_if_fail (CAMEL_IS_IMAP_FOLDER (folder), NULL);
d(g_print ("Creating the journal \n"));
- journal = (CamelOfflineJournal *) camel_object_new (camel_imap_journal_get_type ());
+ journal = g_object_new (CAMEL_TYPE_IMAP_JOURNAL, NULL);
camel_offline_journal_construct (journal, (CamelFolder *) folder, filename);
return journal;
@@ -450,7 +438,7 @@ close_folder (gpointer name, gpointer folder, gpointer data)
{
g_free (name);
camel_folder_sync (folder, FALSE, NULL);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
void
diff --git a/camel/providers/imap/camel-imap-journal.h b/camel/providers/imap/camel-imap-journal.h
index 302cc7d..8cc6f13 100644
--- a/camel/providers/imap/camel-imap-journal.h
+++ b/camel/providers/imap/camel-imap-journal.h
@@ -27,12 +27,24 @@
#include <stdarg.h>
#include <camel/camel.h>
-#define CAMEL_TYPE_IMAP_JOURNAL (camel_imap_journal_get_type ())
-#define CAMEL_IMAP_JOURNAL(obj) (CAMEL_CHECK_CAST ((obj), CAMEL_TYPE_IMAP_JOURNAL, CamelIMAPJournal))
-#define CAMEL_IMAP_JOURNAL_CLASS(klass) (CAMEL_CHECK_CLASS_CAST ((klass), CAMEL_TYPE_IMAP_JOURNAL, CamelIMAPJournalClass))
-#define CAMEL_IS_IMAP_JOURNAL(obj) (CAMEL_CHECK_TYPE ((obj), CAMEL_TYPE_IMAP_JOURNAL))
-#define CAMEL_IS_IMAP_JOURNAL_CLASS(klass) (CAMEL_CHECK_CLASS_TYPE ((klass), CAMEL_TYPE_IMAP_JOURNAL))
-#define CAMEL_IMAP_JOURNAL_GET_CLASS(obj) (CAMEL_CHECK_GET_CLASS ((obj), CAMEL_TYPE_IMAP_JOURNAL, CamelIMAPJournalClass))
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAP_JOURNAL \
+ (camel_imap_journal_get_type ())
+#define CAMEL_IMAP_JOURNAL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAP_JOURNAL, CamelIMAPJournal))
+#define CAMEL_IMAP_JOURNAL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAP_JOURNAL, CamelIMAPJournalClass))
+#define CAMEL_IS_IMAP_JOURNAL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAP_JOURNAL))
+#define CAMEL_IS_IMAP_JOURNAL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAP_JOURNAL))
+#define CAMEL_IMAP_JOURNAL_GET_CLASS(obj) \
+ (CAMEL_CHECK_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAP_JOURNAL, CamelIMAPJournalClass))
G_BEGIN_DECLS
@@ -73,7 +85,7 @@ struct _CamelIMAPJournalClass {
};
-CamelType camel_imap_journal_get_type (void);
+GType camel_imap_journal_get_type (void);
CamelOfflineJournal *camel_imap_journal_new (struct _CamelImapFolder *folder, const gchar *filename);
void camel_imap_journal_log (CamelOfflineJournal *journal, CamelOfflineAction action, ...);
diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c
index 81398a2..e0e0c94 100644
--- a/camel/providers/imap/camel-imap-message-cache.c
+++ b/camel/providers/imap/camel-imap-message-cache.c
@@ -58,6 +58,8 @@ struct _part_find {
gint found;
};
+G_DEFINE_TYPE (CamelImapMessageCache, camel_imap_message_cache, CAMEL_TYPE_OBJECT)
+
static void
free_part (gpointer key, gpointer value, gpointer data)
{
@@ -65,7 +67,7 @@ free_part (gpointer key, gpointer value, gpointer data)
if (strchr (key, '.')) {
camel_object_unhook_event (value, "finalize",
stream_finalize, data);
- camel_object_unref (value);
+ g_object_unref (value);
} else
g_ptr_array_free (value, TRUE);
}
@@ -73,10 +75,14 @@ free_part (gpointer key, gpointer value, gpointer data)
}
static void
-imap_message_cache_finalize (CamelImapMessageCache *cache)
+imap_message_cache_finalize (GObject *object)
{
+ CamelImapMessageCache *cache;
+
+ cache = CAMEL_IMAP_MESSAGE_CACHE (object);
+
g_free (cache->path);
-\
+
if (cache->parts) {
g_hash_table_foreach (cache->parts, free_part, cache);
g_hash_table_destroy (cache->parts);
@@ -84,25 +90,23 @@ imap_message_cache_finalize (CamelImapMessageCache *cache)
if (cache->cached)
g_hash_table_destroy (cache->cached);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imap_message_cache_parent_class)->finalize (object);
}
-CamelType
-camel_imap_message_cache_get_type (void)
+static void
+camel_imap_message_cache_class_init (CamelImapMessageCacheClass *class)
{
- 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_TYPE_OBJECT, "CamelImapMessageCache",
- sizeof (CamelImapMessageCache),
- sizeof (CamelImapMessageCacheClass),
- NULL,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) imap_message_cache_finalize);
- }
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = imap_message_cache_finalize;
+}
- return camel_imap_message_cache_type;
+static void
+camel_imap_message_cache_init (CamelImapMessageCache *imap_message_cache)
+{
}
static void
@@ -129,7 +133,7 @@ cache_put (CamelImapMessageCache *cache, const gchar *uid, const gchar *key,
camel_object_unhook_event (ostream, "finalize",
stream_finalize, cache);
g_hash_table_remove (cache->cached, ostream);
- camel_object_unref (ostream);
+ g_object_unref (ostream);
}
hash_key = okey;
} else {
@@ -181,7 +185,7 @@ camel_imap_message_cache_new (const gchar *path,
return NULL;
}
- cache = (CamelImapMessageCache *)camel_object_new (CAMEL_IMAP_MESSAGE_CACHE_TYPE);
+ cache = g_object_new (CAMEL_TYPE_IMAP_MESSAGE_CACHE, NULL);
cache->path = g_strdup (path);
cache->parts = g_hash_table_new (g_str_hash, g_str_equal);
@@ -321,7 +325,7 @@ insert_setup (CamelImapMessageCache *cache, const gchar *uid, const gchar *part_
*key = strrchr (*path, '/') + 1;
stream = g_hash_table_lookup (cache->parts, *key);
if (stream)
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
fd = g_open (*path, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0600);
if (fd == -1) {
@@ -341,7 +345,7 @@ insert_abort (gchar *path, CamelStream *stream)
{
g_unlink (path);
g_free (path);
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
return NULL;
}
@@ -430,7 +434,7 @@ camel_imap_message_cache_insert_stream (CamelImapMessageCache *cache,
insert_abort (path, stream);
} else {
insert_finish (cache, uid, path, key, stream);
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
}
}
@@ -465,7 +469,7 @@ camel_imap_message_cache_insert_wrapper (CamelImapMessageCache *cache,
insert_abort (path, stream);
} else {
insert_finish (cache, uid, path, key, stream);
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
}
}
@@ -530,7 +534,7 @@ camel_imap_message_cache_get (CamelImapMessageCache *cache, const gchar *uid,
stream = g_hash_table_lookup (cache->parts, key);
if (stream) {
camel_stream_reset (CAMEL_STREAM (stream));
- camel_object_ref (stream);
+ g_object_ref (stream);
g_free (path);
return stream;
}
@@ -576,7 +580,7 @@ camel_imap_message_cache_remove (CamelImapMessageCache *cache, const gchar *uid)
if (stream) {
camel_object_unhook_event (stream, "finalize",
stream_finalize, cache);
- camel_object_unref (stream);
+ g_object_unref (stream);
g_hash_table_remove (cache->cached, stream);
}
g_hash_table_remove (cache->parts, key);
@@ -646,7 +650,7 @@ camel_imap_message_cache_copy (CamelImapMessageCache *source,
if ((stream = camel_imap_message_cache_get (source, source_uid, part, ex))) {
camel_imap_message_cache_insert_stream (dest, dest_uid, part, stream, ex);
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_object_unref (CAMEL_OBJECT (stream));
}
}
}
diff --git a/camel/providers/imap/camel-imap-message-cache.h b/camel/providers/imap/camel-imap-message-cache.h
index 20b6161..640c388 100644
--- a/camel/providers/imap/camel-imap-message-cache.h
+++ b/camel/providers/imap/camel-imap-message-cache.h
@@ -27,10 +27,24 @@
#include <camel/camel.h>
-#define CAMEL_IMAP_MESSAGE_CACHE_TYPE (camel_imap_message_cache_get_type ())
-#define CAMEL_IMAP_MESSAGE_CACHE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_MESSAGE_CACHE_TYPE, CamelImapFolder))
-#define CAMEL_IMAP_MESSAGE_CACHE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_MESSAGE_CACHE_TYPE, CamelImapFolderClass))
-#define CAMEL_IS_IMAP_MESSAGE_CACHE(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_MESSAGE_CACHE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAP_MESSAGE_CACHE \
+ (camel_imap_message_cache_get_type ())
+#define CAMEL_IMAP_MESSAGE_CACHE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAP_MESSAGE_CACHE, CamelImapMessageCache))
+#define CAMEL_IMAP_MESSAGE_CACHE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAP_MESSAGE_CACHE, CamelImapMessageCacheClass))
+#define CAMEL_IS_IMAP_MESSAGE_CACHE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAP_MESSAGE_CACHE))
+#define CAMEL_IS_IMAP_MESSAGE_CACHE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAP_MESSAGE_CACHE))
+#define CAMEL_IMAP_MESSAGE_CACHE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAP_MESSAGE_CACHE, CamelImapMessageCacheClass))
G_BEGIN_DECLS
@@ -109,7 +123,7 @@ GPtrArray * camel_imap_message_cache_filter_cached(CamelImapMessageCache *,
GPtrArray *uids,
CamelException *ex);
-CamelType camel_imap_message_cache_get_type (void);
+GType camel_imap_message_cache_get_type (void);
G_END_DECLS
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
index 6afdf66..ea9b967 100644
--- a/camel/providers/imap/camel-imap-search.c
+++ b/camel/providers/imap/camel-imap-search.c
@@ -91,7 +91,7 @@ struct _match_record {
static ESExpResult *imap_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static gpointer camel_imap_search_parent_class;
+G_DEFINE_TYPE (CamelImapSearch, camel_imap_search, CAMEL_TYPE_FOLDER_SEARCH)
static void
free_match(CamelImapSearch *is, struct _match_record *mr)
@@ -106,23 +106,47 @@ free_match(CamelImapSearch *is, struct _match_record *mr)
}
static void
-imap_search_finalize (CamelImapSearch *search)
+imap_search_dispose (GObject *object)
{
+ CamelImapSearch *search;
+
+ search = CAMEL_IMAP_SEARCH (object);
+
+ if (search->cache != NULL) {
+ g_object_unref (search->cache);
+ search->cache = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_imap_search_parent_class)->dispose (object);
+}
+
+static void
+imap_search_finalize (GObject *object)
+{
+ CamelImapSearch *search;
struct _match_record *mr;
+ search = CAMEL_IMAP_SEARCH (object);
+
while ((mr = (struct _match_record *)camel_dlist_remtail(&search->matches)))
- free_match(search, mr);
- g_hash_table_destroy(search->matches_hash);
- if (search->cache != NULL)
- camel_object_unref (search->cache);
+ free_match (search, mr);
+
+ g_hash_table_destroy (search->matches_hash);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imap_search_parent_class)->finalize (object);
}
static void
camel_imap_search_class_init (CamelImapSearchClass *class)
{
+ GObjectClass *object_class;
CamelFolderSearchClass *folder_search_class;
- camel_imap_search_parent_class = (CamelFolderSearchClass *)camel_type_get_global_classfuncs (camel_folder_search_get_type ());
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = imap_search_dispose;
+ object_class->finalize = imap_search_finalize;
folder_search_class = CAMEL_FOLDER_SEARCH_CLASS (class);
folder_search_class->body_contains = imap_body_contains;
@@ -137,24 +161,6 @@ camel_imap_search_init (CamelImapSearch *is)
is->lastuid = 0;
}
-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",
- sizeof (CamelImapSearch),
- sizeof (CamelImapSearchClass),
- (CamelObjectClassInitFunc) camel_imap_search_class_init, NULL,
- (CamelObjectInitFunc) camel_imap_search_init,
- (CamelObjectFinalizeFunc) imap_search_finalize);
- }
-
- return camel_imap_search_type;
-}
-
/**
* camel_imap_search_new:
*
@@ -163,7 +169,7 @@ camel_imap_search_get_type (void)
CamelFolderSearch *
camel_imap_search_new (const gchar *cachedir)
{
- CamelFolderSearch *new = CAMEL_FOLDER_SEARCH (camel_object_new (camel_imap_search_get_type ()));
+ CamelFolderSearch *new = g_object_new (CAMEL_TYPE_IMAP_SEARCH, NULL);
CamelImapSearch *is = (CamelImapSearch *)new;
camel_folder_search_construct (new);
@@ -246,7 +252,7 @@ save_match(CamelImapSearch *is, struct _match_record *mr)
ret = -1;
}
- camel_object_unref (stream);
+ g_object_unref (stream);
return ret;
}
@@ -292,7 +298,7 @@ load_match(CamelImapSearch *is, gchar hash[17], gint argc, struct _ESExpResult *
d(printf(" file format invalid/validity changed\n"));
memset(&header, 0, sizeof(header));
}
- camel_object_unref (stream);
+ g_object_unref (stream);
} else {
d(printf(" no cache entry found\n"));
}
diff --git a/camel/providers/imap/camel-imap-search.h b/camel/providers/imap/camel-imap-search.h
index 5959ce9..26e8993 100644
--- a/camel/providers/imap/camel-imap-search.h
+++ b/camel/providers/imap/camel-imap-search.h
@@ -28,10 +28,24 @@
#include <camel/camel.h>
-#define CAMEL_IMAP_SEARCH_TYPE (camel_imap_search_get_type ())
-#define CAMEL_IMAP_SEARCH(obj) CAMEL_CHECK_CAST (obj, camel_imap_search_get_type (), CamelImapSearch)
-#define CAMEL_IMAP_SEARCH_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap_search_get_type (), CamelImapSearchClass)
-#define CAMEL_IS_IMAP_SEARCH(obj) CAMEL_CHECK_TYPE (obj, camel_imap_search_get_type ())
+/* Standard GObject class */
+#define CAMEL_TYPE_IMAP_SEARCH \
+ (camel_imap_search_get_type ())
+#define CAMEL_IMAP_SEARCH(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAP_SEARCH, CamelImapSearch))
+#define CAMEL_IMAP_SEARCH_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAP_SEARCH, CamelImapSearchClass))
+#define CAMEL_IS_IMAP_SEARCH(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAP_SEARCH))
+#define CAMEL_IS_IMAP_SEARCH_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAP_SEARCH))
+#define CAMEL_IMAP_SEARCH_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAP_SEARCH, CamelImapSearchClass))
G_BEGIN_DECLS
@@ -57,7 +71,7 @@ struct _CamelImapSearchClass {
};
-CamelType camel_imap_search_get_type (void);
+GType camel_imap_search_get_type (void);
CamelFolderSearch *camel_imap_search_new (const gchar *cachedir);
G_END_DECLS
diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c
index ed4e683..30081cd 100644
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ b/camel/providers/imap/camel-imap-store-summary.c
@@ -49,15 +49,13 @@ static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, gint);
static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
-static gpointer camel_imap_store_summary_parent_class;
+G_DEFINE_TYPE (CamelImapStoreSummary, camel_imap_store_summary, CAMEL_TYPE_STORE_SUMMARY)
static void
camel_imap_store_summary_class_init (CamelImapStoreSummaryClass *class)
{
CamelStoreSummaryClass *store_summary_class;
- camel_imap_store_summary_parent_class = (CamelStoreSummaryClass *)camel_store_summary_get_type();
-
store_summary_class = CAMEL_STORE_SUMMARY_CLASS (class);
store_summary_class->summary_header_load = summary_header_load;
store_summary_class->summary_header_save = summary_header_save;
@@ -79,25 +77,6 @@ camel_imap_store_summary_init (CamelImapStoreSummary *imap_store_summary)
imap_store_summary->version = CAMEL_IMAP_STORE_SUMMARY_VERSION;
}
-CamelType
-camel_imap_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 (),
- "CamelImapStoreSummary",
- sizeof (CamelImapStoreSummary),
- sizeof (CamelImapStoreSummaryClass),
- (CamelObjectClassInitFunc) camel_imap_store_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_store_summary_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return type;
-}
-
/**
* camel_imap_store_summary_new:
*
@@ -108,7 +87,7 @@ camel_imap_store_summary_get_type (void)
CamelImapStoreSummary *
camel_imap_store_summary_new (void)
{
- return CAMEL_IMAP_STORE_SUMMARY ( camel_object_new (camel_imap_store_summary_get_type ()));
+ return g_object_new (CAMEL_TYPE_IMAP_STORE_SUMMARY, NULL);
}
/**
diff --git a/camel/providers/imap/camel-imap-store-summary.h b/camel/providers/imap/camel-imap-store-summary.h
index fff3c3c..ad31198 100644
--- a/camel/providers/imap/camel-imap-store-summary.h
+++ b/camel/providers/imap/camel-imap-store-summary.h
@@ -24,14 +24,30 @@
#include <camel/camel.h>
-#define CAMEL_IMAP_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imap_store_summary_get_type (), CamelImapStoreSummary)
-#define CAMEL_IMAP_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap_store_summary_get_type (), CamelImapStoreSummaryClass)
-#define CAMEL_IS_IMAP_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imap_store_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAP_STORE_SUMMARY \
+ (camel_imap_store_summary_get_type ())
+#define CAMEL_IMAP_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAP_STORE_SUMMARY, CamelImapStoreSummary))
+#define CAMEL_IMAP_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAP_STORE_SUMMARY, CamelImapStoreSummaryClass))
+#define CAMEL_IS_IMAP_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAP_STORE_SUMMARY))
+#define CAMEL_IS_IMAP_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAP_STORE_SUMMARY))
+#define CAMEL_IMAP_STORE_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAP_STORE_SUMMARY, CamelImapStoreSummaryClass))
G_BEGIN_DECLS
-typedef struct _CamelImapStoreSummary CamelImapStoreSummary;
+typedef struct _CamelImapStoreSummary CamelImapStoreSummary;
typedef struct _CamelImapStoreSummaryClass CamelImapStoreSummaryClass;
+typedef struct _CamelImapStoreSummaryPrivate CamelImapStoreSummaryPrivate;
typedef struct _CamelImapStoreInfo CamelImapStoreInfo;
@@ -57,8 +73,7 @@ struct _CamelImapStoreNamespace {
struct _CamelImapStoreSummary {
CamelStoreSummary summary;
-
- struct _CamelImapStoreSummaryPrivate *priv;
+ CamelImapStoreSummaryPrivate *priv;
/* header info */
guint32 version; /* version of base part of file */
@@ -70,7 +85,7 @@ struct _CamelImapStoreSummaryClass {
CamelStoreSummaryClass summary_class;
};
-CamelType camel_imap_store_summary_get_type (void);
+GType camel_imap_store_summary_get_type (void);
CamelImapStoreSummary *camel_imap_store_summary_new (void);
void camel_imap_store_summary_namespace_set_main (CamelImapStoreSummary *s, const gchar *full_name, gchar dir_sep);
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 5e28857..4ad0ca1 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -64,8 +64,6 @@
extern gint camel_verbose_debug;
-static gpointer camel_imap_store_parent_class;
-
static gchar imap_tag_prefix = 'A';
static gboolean construct (CamelService *service, CamelSession *session,
@@ -108,6 +106,8 @@ static CamelFolderInfo * get_folder_info (CamelStore *store, const gchar *top, g
static CamelFolder * get_folder_offline (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex);
static CamelFolderInfo * get_folder_info_offline (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
+G_DEFINE_TYPE (CamelImapStore, camel_imap_store, CAMEL_TYPE_OFFLINE_STORE)
+
static gboolean
free_key (gpointer key, gpointer value, gpointer user_data)
{
@@ -116,31 +116,49 @@ free_key (gpointer key, gpointer value, gpointer user_data)
}
static void
-imap_store_finalize (CamelImapStore *imap_store)
+imap_store_dispose (GObject *object)
{
- /* This frees current_folder, folders, authtypes, streams, and namespace. */
- camel_service_disconnect((CamelService *)imap_store, TRUE, NULL);
+ CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
if (imap_store->summary != NULL) {
camel_store_summary_save (
CAMEL_STORE_SUMMARY (imap_store->summary));
- camel_object_unref (imap_store->summary);
+ g_object_unref (imap_store->summary);
+ imap_store->summary = NULL;
}
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_imap_store_parent_class)->dispose (object);
+}
+
+static void
+imap_store_finalize (GObject *object)
+{
+ CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
+
+ /* This frees current_folder, folders, authtypes, streams, and namespace. */
+ camel_service_disconnect (CAMEL_SERVICE (imap_store), TRUE, NULL);
+
g_free (imap_store->base_url);
g_free (imap_store->storage_path);
g_free (imap_store->users_namespace);
g_free (imap_store->custom_headers);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imap_store_parent_class)->finalize (object);
}
static void
camel_imap_store_class_init (CamelImapStoreClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
CamelServiceClass *service_class;
CamelStoreClass *store_class;
- camel_imap_store_parent_class = CAMEL_OFFLINE_STORE_CLASS (camel_type_get_global_classfuncs (camel_offline_store_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = imap_store_dispose;
+ object_class->finalize = imap_store_finalize;
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->setv = imap_setv;
@@ -189,26 +207,6 @@ camel_imap_store_init (CamelImapStore *imap_store)
imap_tag_prefix = 'A';
}
-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_offline_store_get_type (),
- "CamelImapStore",
- sizeof (CamelImapStore),
- sizeof (CamelImapStoreClass),
- (CamelObjectClassInitFunc) camel_imap_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_store_init,
- (CamelObjectFinalizeFunc) imap_store_finalize);
- }
-
- return camel_imap_store_type;
-}
-
static gboolean
construct (CamelService *service, CamelSession *session,
CamelProvider *provider, CamelURL *url,
@@ -565,7 +563,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("Could not connect to %s: %s"),
service->url->host, g_strerror (errno));
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
return FALSE;
}
@@ -589,12 +587,12 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
/* 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);
+ g_object_unref (store->istream);
store->istream = NULL;
}
if (store->ostream) {
- camel_object_unref (store->ostream);
+ g_object_unref (store->ostream);
store->ostream = NULL;
}
@@ -639,12 +637,12 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
/* get the imap server capabilities */
if (!imap_get_capability (service, ex)) {
if (store->istream) {
- camel_object_unref (store->istream);
+ g_object_unref (store->istream);
store->istream = NULL;
}
if (store->ostream) {
- camel_object_unref (store->ostream);
+ g_object_unref (store->ostream);
store->ostream = NULL;
}
@@ -677,8 +675,8 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
response = camel_imap_command (store, NULL, ex, "STARTTLS");
if (!response) {
- camel_object_unref (store->istream);
- camel_object_unref (store->ostream);
+ g_object_unref (store->istream);
+ g_object_unref (store->ostream);
store->istream = store->ostream = NULL;
return FALSE;
}
@@ -705,12 +703,12 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
command, the client MUST discard prior CAPA responses */
if (!imap_get_capability (service, ex)) {
if (store->istream) {
- camel_object_unref (store->istream);
+ g_object_unref (store->istream);
store->istream = NULL;
}
if (store->ostream) {
- camel_object_unref (store->ostream);
+ g_object_unref (store->ostream);
store->ostream = NULL;
}
@@ -740,12 +738,12 @@ exception:
}
if (store->istream) {
- camel_object_unref (store->istream);
+ g_object_unref (store->istream);
store->istream = NULL;
}
if (store->ostream) {
- camel_object_unref (store->ostream);
+ g_object_unref (store->ostream);
store->ostream = NULL;
}
@@ -851,7 +849,7 @@ connect_to_server_process (CamelService *service, const gchar *cmd, CamelExcepti
_("Could not connect with command \"%s\": %s"),
full_cmd, g_strerror (errno));
- camel_object_unref (cmd_stream);
+ g_object_unref (cmd_stream);
g_free (full_cmd);
return FALSE;
}
@@ -867,12 +865,12 @@ connect_to_server_process (CamelService *service, const gchar *cmd, CamelExcepti
/* 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);
+ g_object_unref (store->istream);
store->istream = NULL;
}
if (store->ostream) {
- camel_object_unref (store->ostream);
+ g_object_unref (store->ostream);
store->ostream = NULL;
}
@@ -887,12 +885,12 @@ connect_to_server_process (CamelService *service, const gchar *cmd, CamelExcepti
/* get the imap server capabilities */
if (!imap_get_capability (service, ex)) {
if (store->istream) {
- camel_object_unref (store->istream);
+ g_object_unref (store->istream);
store->istream = NULL;
}
if (store->ostream) {
- camel_object_unref (store->ostream);
+ g_object_unref (store->ostream);
store->ostream = NULL;
}
@@ -1182,7 +1180,7 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
/* NB: we can have vtrash folders also in our store ... bit hacky */
if (!CAMEL_IS_IMAP_FOLDER(folder)) {
- camel_object_unref (folder);
+ g_object_unref (folder);
continue;
}
@@ -1198,12 +1196,12 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
* after being offline */
namedup = g_strdup (folder->full_name);
- camel_object_unref (folder);
+ g_object_unref (folder);
imap_folder_effectively_unsubscribed (store, namedup, ex);
imap_forget_folder (store, namedup, ex);
g_free (namedup);
} else
- camel_object_unref (folder);
+ g_object_unref (folder);
}
g_ptr_array_free (folders, TRUE);
@@ -1248,7 +1246,7 @@ try_auth (CamelImapStore *store, const gchar *mech, CamelException *ex)
goto lose;
}
- camel_object_unref (sasl);
+ g_object_unref (sasl);
return TRUE;
@@ -1265,7 +1263,7 @@ try_auth (CamelImapStore *store, const gchar *mech, CamelException *ex)
_("Bad authentication response from server."));
}
- camel_object_unref (sasl);
+ g_object_unref (sasl);
return FALSE;
}
@@ -1580,19 +1578,19 @@ imap_disconnect (CamelService *service, gboolean clean, CamelException *ex)
if (store->istream) {
camel_stream_close(store->istream);
- camel_object_unref (store->istream);
+ g_object_unref (store->istream);
store->istream = NULL;
}
if (store->ostream) {
camel_stream_close(store->ostream);
- camel_object_unref (store->ostream);
+ g_object_unref (store->ostream);
store->ostream = NULL;
}
store->connected = FALSE;
if (store->current_folder) {
- camel_object_unref (store->current_folder);
+ g_object_unref (store->current_folder);
store->current_folder = NULL;
}
@@ -1861,7 +1859,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc
folder_name = "INBOX";
if (imap_store->current_folder) {
- camel_object_unref (imap_store->current_folder);
+ g_object_unref (imap_store->current_folder);
imap_store->current_folder = NULL;
}
@@ -2029,12 +2027,12 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelExc
new_folder = camel_imap_folder_new (store, folder_name, folder_dir, ex);
g_free (folder_dir);
if (new_folder) {
- imap_store->current_folder = camel_object_ref (new_folder);
+ imap_store->current_folder = g_object_ref (new_folder);
if (!camel_imap_folder_selected (new_folder, response, ex)) {
- camel_object_unref (imap_store->current_folder);
+ g_object_unref (imap_store->current_folder);
imap_store->current_folder = NULL;
- camel_object_unref (new_folder);
+ g_object_unref (new_folder);
new_folder = NULL;
}
}
@@ -2108,7 +2106,7 @@ delete_folder (CamelStore *store,
camel_imap_response_free_without_processing (imap_store, response);
if (imap_store->current_folder)
- camel_object_unref (imap_store->current_folder);
+ g_object_unref (imap_store->current_folder);
/* no need to actually create a CamelFolder for INBOX */
imap_store->current_folder = NULL;
@@ -2222,7 +2220,7 @@ rename_folder (CamelStore *store,
camel_imap_response_free_without_processing (imap_store, response);
if (imap_store->current_folder)
- camel_object_unref (imap_store->current_folder);
+ g_object_unref (imap_store->current_folder);
/* no need to actually create a CamelFolder for INBOX */
imap_store->current_folder = NULL;
@@ -2273,7 +2271,7 @@ rename_folder (CamelStore *store,
g_free (folder_dir);
}
- camel_object_unref (folder);
+ g_object_unref (folder);
}
}
@@ -2737,8 +2735,8 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
fi->total = ((CamelFolderSummary *)ims)->saved_count;
if (!folder->summary)
- camel_object_unref (ims);
- camel_object_unref (folder);
+ g_object_unref (ims);
+ g_object_unref (folder);
}
}
@@ -2779,7 +2777,7 @@ refresh_free(CamelSession *session, CamelSessionThreadMsg *msg)
{
struct _refresh_msg *m = (struct _refresh_msg *)msg;
- camel_object_unref (m->store);
+ g_object_unref (m->store);
camel_exception_clear(&m->ex);
}
@@ -2828,7 +2826,7 @@ get_folder_info (CamelStore *store,
imap_store->refresh_stamp = now;
m = camel_session_thread_msg_new(((CamelService *)store)->session, &refresh_ops, sizeof(*m));
- m->store = camel_object_ref (store);
+ m->store = g_object_ref (store);
camel_exception_init(&m->ex);
camel_session_thread_queue(((CamelService *)store)->session, &m->msg, 0);
}
diff --git a/camel/providers/imap/camel-imap-store.h b/camel/providers/imap/camel-imap-store.h
index 9aa9c2f..e24c244 100644
--- a/camel/providers/imap/camel-imap-store.h
+++ b/camel/providers/imap/camel-imap-store.h
@@ -52,10 +52,24 @@ void camel_imap_msg_queue(CamelImapStore *store, CamelImapMsg *msg);
G_END_DECLS
-#define CAMEL_IMAP_STORE_TYPE (camel_imap_store_get_type ())
-#define CAMEL_IMAP_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_STORE_TYPE, CamelImapStore))
-#define CAMEL_IMAP_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_STORE_TYPE, CamelImapStoreClass))
-#define CAMEL_IS_IMAP_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAP_STORE \
+ (camel_imap_store_get_type ())
+#define CAMEL_IMAP_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAP_STORE, CamelImapStore))
+#define CAMEL_IMAP_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAP_STORE, CamelImapStoreClass))
+#define CAMEL_IS_IMAP_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAP_STORE))
+#define CAMEL_IS_IMAP_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAP_STORE))
+#define CAMEL_IMAP_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAP_STORE, CamelImapStoreClass))
G_BEGIN_DECLS
@@ -152,8 +166,7 @@ struct _CamelImapStoreClass {
CamelOfflineStoreClass parent_class;
};
-/* Standard Camel function */
-CamelType camel_imap_store_get_type (void);
+GType camel_imap_store_get_type (void);
gboolean camel_imap_store_connected (CamelImapStore *store, CamelException *ex);
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
index 5581663..afc22e7 100644
--- a/camel/providers/imap/camel-imap-summary.c
+++ b/camel/providers/imap/camel-imap-summary.c
@@ -57,7 +57,7 @@ static CamelMessageInfo * message_info_from_db (CamelFolderSummary *s, CamelMIRe
static gint content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir);
static CamelMessageContentInfo * content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir);
-static gpointer camel_imap_summary_parent_class;
+G_DEFINE_TYPE (CamelImapSummary, camel_imap_summary, CAMEL_TYPE_FOLDER_SUMMARY)
static CamelMessageInfo *
imap_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
@@ -79,8 +79,6 @@ camel_imap_summary_class_init (CamelImapSummaryClass *class)
{
CamelFolderSummaryClass *folder_summary_class;
- camel_imap_summary_parent_class = CAMEL_FOLDER_SUMMARY_CLASS (camel_type_get_global_classfuncs (camel_folder_summary_get_type()));
-
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
folder_summary_class->message_info_size = sizeof (CamelImapMessageInfo);
folder_summary_class->content_info_size = sizeof (CamelImapMessageContentInfo);
@@ -105,25 +103,6 @@ camel_imap_summary_init (CamelImapSummary *imap_summary)
{
}
-CamelType
-camel_imap_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(
- camel_folder_summary_get_type(), "CamelImapSummary",
- sizeof (CamelImapSummary),
- sizeof (CamelImapSummaryClass),
- (CamelObjectClassInitFunc) camel_imap_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_summary_init,
- NULL);
- }
-
- return type;
-}
-
static gint
sort_uid_cmp (gpointer enc, gint len1, gpointer data1, gint len2, gpointer data2)
{
@@ -181,7 +160,7 @@ camel_imap_summary_new (struct _CamelFolder *folder, const gchar *filename)
CamelException ex;
camel_exception_init (&ex);
- summary = CAMEL_FOLDER_SUMMARY (camel_object_new (camel_imap_summary_get_type ()));
+ summary = g_object_new (CAMEL_TYPE_IMAP_SUMMARY, NULL);
summary->folder = folder;
/* Don't do DB sort. Its pretty slow to load */
if (folder && 0) {
diff --git a/camel/providers/imap/camel-imap-summary.h b/camel/providers/imap/camel-imap-summary.h
index 276c22d..d7eefb1 100644
--- a/camel/providers/imap/camel-imap-summary.h
+++ b/camel/providers/imap/camel-imap-summary.h
@@ -25,9 +25,24 @@
#include <camel/camel.h>
-#define CAMEL_IMAP_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imap_summary_get_type (), CamelImapSummary)
-#define CAMEL_IMAP_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap_summary_get_type (), CamelImapSummaryClass)
-#define CAMEL_IS_IMAP_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imap_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAP_SUMMARY \
+ (camel_imap_summary_get_type ())
+#define CAMEL_IMAP_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAP_SUMMARY, CamelImapSummary))
+#define CAMEL_IMAP_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAP_SUMMARY, CamelImapSummaryClass))
+#define CAMEL_IS_IMAP_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAP_SUMMARY))
+#define CAMEL_IS_IMAP_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAP_SUMMARY))
+#define CAMEL_IMAP_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAP_SUMMARY, CamelImapSummaryClass))
#define CAMEL_IMAP_SERVER_FLAGS (CAMEL_MESSAGE_ANSWERED | \
CAMEL_MESSAGE_DELETED | \
@@ -67,7 +82,7 @@ struct _CamelImapSummaryClass {
};
-CamelType camel_imap_summary_get_type (void);
+GType camel_imap_summary_get_type (void);
CamelFolderSummary *camel_imap_summary_new (struct _CamelFolder *folder, const gchar *filename);
void camel_imap_summary_add_offline (CamelFolderSummary *summary,
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c
index 8a99941..ce42c85 100644
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ b/camel/providers/imap/camel-imap-wrapper.c
@@ -31,6 +31,10 @@
#include "camel-imap-folder.h"
#include "camel-imap-wrapper.h"
+#define CAMEL_IMAP_WRAPPER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_IMAP_WRAPPER, CamelImapWrapperPrivate))
+
struct _CamelImapWrapperPrivate {
GMutex *lock;
};
@@ -38,7 +42,7 @@ struct _CamelImapWrapperPrivate {
#define CAMEL_IMAP_WRAPPER_LOCK(f, l) (g_mutex_lock(((CamelImapWrapper *)f)->priv->l))
#define CAMEL_IMAP_WRAPPER_UNLOCK(f, l) (g_mutex_unlock(((CamelImapWrapper *)f)->priv->l))
-static gpointer camel_imap_wrapper_parent_class;
+G_DEFINE_TYPE (CamelImapWrapper, camel_imap_wrapper, CAMEL_TYPE_DATA_WRAPPER)
static void
imap_wrapper_hydrate (CamelImapWrapper *imap_wrapper,
@@ -46,32 +50,43 @@ imap_wrapper_hydrate (CamelImapWrapper *imap_wrapper,
{
CamelDataWrapper *data_wrapper = (CamelDataWrapper *) imap_wrapper;
- data_wrapper->stream = camel_object_ref (stream);
+ data_wrapper->stream = g_object_ref (stream);
data_wrapper->offline = FALSE;
- camel_object_unref (imap_wrapper->folder);
+ g_object_unref (imap_wrapper->folder);
imap_wrapper->folder = NULL;
g_free (imap_wrapper->uid);
imap_wrapper->uid = NULL;
g_free (imap_wrapper->part_spec);
- imap_wrapper->part = NULL;
+ imap_wrapper->part_spec = NULL;
}
static void
-imap_wrapper_finalize (CamelObject *object)
+imap_wrapper_dispose (GObject *object)
{
CamelImapWrapper *imap_wrapper = CAMEL_IMAP_WRAPPER (object);
- if (imap_wrapper->folder)
- camel_object_unref (CAMEL_OBJECT (imap_wrapper->folder));
- if (imap_wrapper->uid)
- g_free (imap_wrapper->uid);
- if (imap_wrapper->part)
- g_free (imap_wrapper->part_spec);
+ if (imap_wrapper->folder != NULL) {
+ g_object_unref (imap_wrapper->folder);
+ imap_wrapper->folder = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_imap_wrapper_parent_class)->dispose (object);
+}
+
+static void
+imap_wrapper_finalize (GObject *object)
+{
+ CamelImapWrapper *imap_wrapper = CAMEL_IMAP_WRAPPER (object);
+
+ g_free (imap_wrapper->uid);
+ g_free (imap_wrapper->part_spec);
g_mutex_free (imap_wrapper->priv->lock);
- g_free (imap_wrapper->priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imap_wrapper_parent_class)->finalize (object);
}
static gssize
@@ -103,7 +118,7 @@ imap_wrapper_write_to_stream (CamelDataWrapper *data_wrapper,
}
imap_wrapper_hydrate (imap_wrapper, datastream);
- camel_object_unref (datastream);
+ g_object_unref (datastream);
}
CAMEL_IMAP_WRAPPER_UNLOCK (imap_wrapper, lock);
@@ -114,9 +129,14 @@ imap_wrapper_write_to_stream (CamelDataWrapper *data_wrapper,
static void
camel_imap_wrapper_class_init (CamelImapWrapperClass *class)
{
+ GObjectClass *object_class;
CamelDataWrapperClass *data_wrapper_class;
- camel_imap_wrapper_parent_class = CAMEL_DATA_WRAPPER_CLASS (camel_type_get_global_classfuncs (camel_data_wrapper_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelImapWrapperPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = imap_wrapper_dispose;
+ object_class->finalize = imap_wrapper_finalize;
data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (class);
data_wrapper_class->write_to_stream = imap_wrapper_write_to_stream;
@@ -125,30 +145,10 @@ camel_imap_wrapper_class_init (CamelImapWrapperClass *class)
static void
camel_imap_wrapper_init (CamelImapWrapper *imap_wrapper)
{
- imap_wrapper->priv = g_new0 (CamelImapWrapperPrivate, 1);
+ imap_wrapper->priv = CAMEL_IMAP_WRAPPER_GET_PRIVATE (imap_wrapper);
imap_wrapper->priv->lock = g_mutex_new ();
}
-CamelType
-camel_imap_wrapper_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- CAMEL_DATA_WRAPPER_TYPE,
- "CamelImapWrapper",
- sizeof (CamelImapWrapper),
- sizeof (CamelImapWrapperClass),
- (CamelObjectClassInitFunc) camel_imap_wrapper_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_wrapper_init,
- (CamelObjectFinalizeFunc) imap_wrapper_finalize);
- }
-
- return type;
-}
-
CamelDataWrapper *
camel_imap_wrapper_new (CamelImapFolder *imap_folder,
CamelContentType *type, CamelTransferEncoding encoding,
@@ -164,12 +164,12 @@ camel_imap_wrapper_new (CamelImapFolder *imap_folder,
sync_offline = (camel_url_get_param (((CamelService *) store)->url, "sync_offline") != NULL ||
((CamelOfflineFolder *)imap_folder)->sync_offline);
- imap_wrapper = (CamelImapWrapper *)camel_object_new (camel_imap_wrapper_get_type());
+ imap_wrapper = g_object_new (CAMEL_TYPE_IMAP_WRAPPER, NULL);
camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (imap_wrapper), type);
((CamelDataWrapper *)imap_wrapper)->offline = !sync_offline;
((CamelDataWrapper *)imap_wrapper)->encoding = encoding;
- imap_wrapper->folder = camel_object_ref (imap_folder);
+ imap_wrapper->folder = g_object_ref (imap_folder);
imap_wrapper->uid = g_strdup (uid);
imap_wrapper->part_spec = g_strdup (part_spec);
@@ -182,7 +182,7 @@ camel_imap_wrapper_new (CamelImapFolder *imap_folder,
if (stream) {
imap_wrapper_hydrate (imap_wrapper, stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
}
return (CamelDataWrapper *)imap_wrapper;
diff --git a/camel/providers/imap/camel-imap-wrapper.h b/camel/providers/imap/camel-imap-wrapper.h
index dd9dc42..df46207 100644
--- a/camel/providers/imap/camel-imap-wrapper.h
+++ b/camel/providers/imap/camel-imap-wrapper.h
@@ -24,10 +24,24 @@
#include <camel/camel.h>
-#define CAMEL_IMAP_WRAPPER_TYPE (camel_imap_wrapper_get_type ())
-#define CAMEL_IMAP_WRAPPER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_WRAPPER_TYPE, CamelImapWrapper))
-#define CAMEL_IMAP_WRAPPER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_WRAPPER_TYPE, CamelImapWrapperClass))
-#define CAMEL_IS_IMAP_WRAPPER(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_WRAPPER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAP_WRAPPER \
+ (camel_imap_wrapper_get_type ())
+#define CAMEL_IMAP_WRAPPER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAP_WRAPPER, CamelImapWrapper))
+#define CAMEL_IMAP_WRAPPER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAP_WRAPPER, CamelImapWrapperClass))
+#define CAMEL_IS_IMAP_WRAPPER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAP_WRAPPER))
+#define CAMEL_IS_IMAP_WRAPPER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAP_WRAPPER))
+#define CAMEL_IMAP_WRAPPER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAP_WRAPPER, CamelImapWrapperClass))
G_BEGIN_DECLS
@@ -49,7 +63,7 @@ struct _CamelImapWrapperClass {
CamelDataWrapperClass parent_class;
};
-CamelType camel_imap_wrapper_get_type (void);
+GType camel_imap_wrapper_get_type (void);
/* Constructor */
CamelDataWrapper *camel_imap_wrapper_new (CamelImapFolder *imap_folder,
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index d5ac1cf..1390485 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -39,9 +39,7 @@
#define d(x)
-#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o)))
-static CamelObjectClass *parent_class;
-static CamelOfflineFolderClass *offline_folder_class = NULL;
+G_DEFINE_TYPE (CamelIMAPXFolder, camel_imapx_folder, CAMEL_TYPE_FOLDER)
CamelFolder *
camel_imapx_folder_new(CamelStore *store, const gchar *folder_dir, const gchar *folder_name, CamelException *ex)
@@ -60,7 +58,7 @@ camel_imapx_folder_new(CamelStore *store, const gchar *folder_dir, const gchar *
else
short_name = folder_name;
- folder = CAMEL_FOLDER (camel_object_new (CAMEL_IMAPX_FOLDER_TYPE));
+ folder = g_object_new (CAMEL_TYPE_IMAPX_FOLDER, NULL);
camel_folder_construct(folder, store, folder_name, short_name);
ifolder = (CamelIMAPXFolder *) folder;
@@ -109,6 +107,40 @@ camel_imapx_folder_new(CamelStore *store, const gchar *folder_dir, const gchar *
return folder;
}
+static void
+imapx_folder_dispose (GObject *object)
+{
+ CamelIMAPXFolder *folder = CAMEL_IMAPX_FOLDER (object);
+
+ if (folder->cache != NULL) {
+ g_object_unref (folder->cache);
+ folder->cache = NULL;
+ }
+
+ if (folder->search != NULL) {
+ g_object_unref (folder->search);
+ folder->search = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_imapx_folder_parent_class)->dispose (object);
+}
+
+static void
+imapx_folder_finalize (GObject *object)
+{
+ CamelIMAPXFolder *folder = CAMEL_IMAPX_FOLDER (object);
+
+ if (folder->ignore_recent != NULL)
+ g_hash_table_unref (folder->ignore_recent);
+
+ g_mutex_free (folder->search_lock);
+ g_mutex_free (folder->stream_lock);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imapx_folder_parent_class)->finalize (object);
+}
+
static gboolean
imapx_refresh_info (CamelFolder *folder, CamelException *ex)
{
@@ -205,11 +237,11 @@ imapx_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
g_mutex_lock (ifolder->stream_lock);
if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) == -1) {
- camel_object_unref (msg);
+ g_object_unref (msg);
msg = NULL;
}
g_mutex_unlock (ifolder->stream_lock);
- camel_object_unref (stream);
+ g_object_unref (stream);
}
return msg;
@@ -394,29 +426,34 @@ imapx_search_by_expression (CamelFolder *folder, const gchar *expression, CamelE
}
static void
-imapx_folder_class_init (CamelIMAPXFolderClass *klass)
+camel_imapx_folder_class_init (CamelIMAPXFolderClass *class)
{
- offline_folder_class = CAMEL_OFFLINE_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_offline_folder_get_type ()));
-
- ((CamelFolderClass *)klass)->refresh_info = imapx_refresh_info;
- ((CamelFolderClass *)klass)->sync = imapx_sync;
- ((CamelFolderClass *)klass)->search_by_expression = imapx_search_by_expression;
- ((CamelFolderClass *)klass)->search_by_uids = imapx_search_by_uids;
- ((CamelFolderClass *)klass)->count_by_expression = imapx_count_by_expression;
- ((CamelFolderClass *)klass)->search_free = imapx_search_free;
-
- ((CamelFolderClass *)klass)->expunge = imapx_expunge;
- ((CamelFolderClass *)klass)->get_message = imapx_get_message;
- ((CamelFolderClass *)klass)->sync_message = imapx_sync_message;
- ((CamelFolderClass *)klass)->append_message = imapx_append_message;
- ((CamelFolderClass *)klass)->transfer_messages_to = imapx_transfer_messages_to;
- ((CamelFolderClass *)klass)->get_filename = imapx_get_filename;
+ GObjectClass *object_class;
+ CamelFolderClass *folder_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = imapx_folder_dispose;
+ object_class->finalize = imapx_folder_finalize;
+
+ folder_class = CAMEL_FOLDER_CLASS (class);
+ folder_class->refresh_info = imapx_refresh_info;
+ folder_class->sync = imapx_sync;
+ folder_class->search_by_expression = imapx_search_by_expression;
+ folder_class->search_by_uids = imapx_search_by_uids;
+ folder_class->count_by_expression = imapx_count_by_expression;
+ folder_class->search_free = imapx_search_free;
+ folder_class->expunge = imapx_expunge;
+ folder_class->get_message = imapx_get_message;
+ folder_class->sync_message = imapx_sync_message;
+ folder_class->append_message = imapx_append_message;
+ folder_class->transfer_messages_to = imapx_transfer_messages_to;
+ folder_class->get_filename = imapx_get_filename;
}
static void
-imapx_folder_init(CamelObject *o, CamelObjectClass *klass)
+camel_imapx_folder_init (CamelIMAPXFolder *imapx_folder)
{
- CamelFolder *folder = (CamelFolder *)o;
+ CamelFolder *folder = CAMEL_FOLDER (imapx_folder);
folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
@@ -428,37 +465,3 @@ imapx_folder_init(CamelObject *o, CamelObjectClass *klass)
camel_folder_set_lock_async (folder, TRUE);
}
-static void
-imapx_finalize (CamelObject *object)
-{
- CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) object;
-
- camel_object_unref (CAMEL_OBJECT (ifolder->cache));
-
- if (ifolder->ignore_recent)
- g_hash_table_unref (ifolder->ignore_recent);
-
- g_mutex_free (ifolder->search_lock);
- g_mutex_free (ifolder->stream_lock);
- if (ifolder->search)
- camel_object_unref (CAMEL_OBJECT (ifolder->search));
-}
-
-CamelType
-camel_imapx_folder_get_type (void)
-{
- static CamelType camel_imapx_folder_type = CAMEL_INVALID_TYPE;
-
- if (!camel_imapx_folder_type) {
- parent_class = camel_offline_folder_get_type();
- camel_imapx_folder_type = camel_type_register (parent_class, "CamelIMAPXFolder",
- sizeof (CamelIMAPXFolder),
- sizeof (CamelIMAPXFolderClass),
- (CamelObjectClassInitFunc)imapx_folder_class_init,
- NULL,
- imapx_folder_init,
- (CamelObjectFinalizeFunc) imapx_finalize);
- }
-
- return camel_imapx_folder_type;
-}
diff --git a/camel/providers/imapx/camel-imapx-folder.h b/camel/providers/imapx/camel-imapx-folder.h
index 256888f..0ea9361 100644
--- a/camel/providers/imapx/camel-imapx-folder.h
+++ b/camel/providers/imapx/camel-imapx-folder.h
@@ -24,19 +24,33 @@
#ifndef CAMEL_IMAPX_FOLDER_H
#define CAMEL_IMAPX_FOLDER_H
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
#include <camel/camel.h>
-#define CAMEL_IMAPX_FOLDER_TYPE (camel_imapx_folder_get_type ())
-#define CAMEL_IMAPX_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAPX_FOLDER_TYPE, CamelIMAPXFolder))
-#define CAMEL_IMAPX_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAPX_FOLDER_TYPE, CamelIMAPXFolderClass))
-#define CAMEL_IS_IMAPX_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAPX_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAPX_FOLDER \
+ (camel_imapx_folder_get_type ())
+#define CAMEL_IMAPX_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAPX_FOLDER, CamelIMAPXFolder))
+#define CAMEL_IMAPX_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAPX_FOLDER, CamelIMAPXFolderClass))
+#define CAMEL_IS_IMAPX_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAPX_FOLDER))
+#define CAMEL_IS_IMAPX_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAPX_FOLDER))
+#define CAMEL_IMAPX_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAPX_FOLDER, CamelIMAPXFolderClass))
+
+G_BEGIN_DECLS
-typedef struct _CamelIMAPXFolder {
+typedef struct _CamelIMAPXFolder CamelIMAPXFolder;
+typedef struct _CamelIMAPXFolderClass CamelIMAPXFolderClass;
+
+struct _CamelIMAPXFolder {
CamelOfflineFolder parent;
gchar *raw_name;
@@ -51,21 +65,21 @@ typedef struct _CamelIMAPXFolder {
GMutex *search_lock;
GMutex *stream_lock;
-} CamelIMAPXFolder;
+};
-typedef struct _CamelIMAPXFolderClass {
+struct _CamelIMAPXFolderClass {
CamelOfflineFolderClass parent_class;
-} CamelIMAPXFolderClass;
-
-/* Standard Camel function */
-CamelType camel_imapx_folder_get_type (void);
+};
-/* public methods */
-CamelFolder *camel_imapx_folder_new(CamelStore *parent, const gchar *path, const gchar *raw, CamelException *ex);
-gchar * imapx_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
+GType camel_imapx_folder_get_type (void);
+CamelFolder * camel_imapx_folder_new (CamelStore *parent,
+ const gchar *path,
+ const gchar *raw,
+ CamelException *ex);
+gchar * imapx_get_filename (CamelFolder *folder,
+ const gchar *uid,
+ CamelException *ex);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
#endif /* CAMEL_IMAPX_FOLDER_H */
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 7270b28..bc068df 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -65,7 +65,6 @@ struct _uidset_state {
guint32 last;
};
-struct _CamelIMAPXCommand;
void imapx_uidset_init(struct _uidset_state *ss, gint total, gint limit);
gint imapx_uidset_done(struct _uidset_state *ss, struct _CamelIMAPXCommand *ic);
gint imapx_uidset_add(struct _uidset_state *ss, struct _CamelIMAPXCommand *ic, const gchar *uid);
@@ -73,7 +72,6 @@ static gboolean imapx_disconnect (CamelIMAPXServer *is);
static gint imapx_uid_cmp(gconstpointer ap, gconstpointer bp, gpointer data);
typedef struct _CamelIMAPXCommandPart CamelIMAPXCommandPart;
-typedef struct _CamelIMAPXCommand CamelIMAPXCommand;
typedef enum {
CAMEL_IMAPX_COMMAND_SIMPLE = 0,
@@ -285,7 +283,6 @@ static gint imapx_refresh_info_uid_cmp(gconstpointer ap, gconstpointer bp);
static gint imapx_uids_array_cmp (gconstpointer ap, gconstpointer bp);
static void imapx_server_sync_changes(CamelIMAPXServer *is, CamelFolder *folder, gint pri, CamelException *ex);
-typedef struct _CamelIMAPXIdle CamelIMAPXIdle;
struct _CamelIMAPXIdle {
GMutex *idle_lock;
EFlag *idle_start_watch;
@@ -316,6 +313,8 @@ enum {
static void imapx_select(CamelIMAPXServer *is, CamelFolder *folder, gboolean force, CamelException *ex);
+G_DEFINE_TYPE (CamelIMAPXServer, camel_imapx_server, CAMEL_TYPE_OBJECT)
+
/*
this creates a uid (or sequence number) set directly into a command,
if total is set, then we break it up into total uids. (i.e. command time)
@@ -421,9 +420,9 @@ imapx_command_add_part(CamelIMAPXCommand *ic, camel_imapx_command_part_t type, g
camel_stream_reset((CamelStream *)ob);
}
type |= CAMEL_IMAPX_COMMAND_CONTINUATION;
- camel_object_ref (ob);
+ g_object_ref (ob);
ob_size = null->written;
- camel_object_unref (null);
+ g_object_unref (null);
camel_stream_printf((CamelStream *)ic->mem, "{%u}", ob_size);
break;
}
@@ -431,7 +430,7 @@ imapx_command_add_part(CamelIMAPXCommand *ic, camel_imapx_command_part_t type, g
CamelObject *ob = o;
/* we presume we'll need to get additional data only if we're not authenticated yet */
- camel_object_ref (ob);
+ g_object_ref (ob);
camel_stream_printf((CamelStream *)ic->mem, "%s", camel_sasl_get_mechanism (CAMEL_SASL (ob)));
if (!camel_sasl_get_authenticated((CamelSasl *)ob))
type |= CAMEL_IMAPX_COMMAND_CONTINUATION;
@@ -707,7 +706,7 @@ camel_imapx_command_free(CamelIMAPXCommand *ic)
return;
if (ic->mem)
- camel_object_unref (ic->mem);
+ g_object_unref (ic->mem);
imapx_free_status(ic->status);
g_free(ic->select);
@@ -720,7 +719,7 @@ camel_imapx_command_free(CamelIMAPXCommand *ic)
g_free(cp->ob);
break;
default:
- camel_object_unref (cp->ob);
+ g_object_unref (cp->ob);
}
}
g_free(cp);
@@ -742,7 +741,7 @@ camel_imapx_command_close(CamelIMAPXCommand *ic)
if (byte_array->len > 0)
imapx_command_add_part(ic, CAMEL_IMAPX_COMMAND_SIMPLE, NULL);
- camel_object_unref (ic->mem);
+ g_object_unref (ic->mem);
ic->mem = NULL;
}
}
@@ -1204,7 +1203,7 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
gboolean changed = FALSE;
gchar *uid = NULL;
- camel_object_ref (imap->select_folder);
+ g_object_ref (imap->select_folder);
folder = imap->select_folder;
c(printf("flag changed: %d\n", id));
@@ -1234,7 +1233,7 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
if (mi)
camel_message_info_free (mi);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
}
@@ -1274,7 +1273,7 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
mp = camel_mime_parser_new();
camel_mime_parser_init_with_stream(mp, finfo->header);
mi = camel_folder_summary_info_new_from_parser(job->folder->summary, mp);
- camel_object_unref (mp);
+ g_object_unref (mp);
if (mi) {
guint32 server_flags;
@@ -1502,7 +1501,7 @@ imapx_continuation(CamelIMAPXServer *imap, CamelException *ex)
// FIXME: errors
if (cp->ob && (file = camel_stream_fs_new_with_name(cp->ob, O_RDONLY, 0))) {
camel_stream_write_to_stream(file, (CamelStream *)imap->stream);
- camel_object_unref (file);
+ g_object_unref (file);
} else if (cp->ob_size > 0) {
// Server is expecting data ... ummm, send it zeros? abort?
}
@@ -2017,7 +2016,7 @@ imapx_command_select_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
}
if (is->select_pending)
- camel_object_unref (is->select_pending);
+ g_object_unref (is->select_pending);
} else {
CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) is->select_pending;
c(printf("Select ok!\n"));
@@ -2071,10 +2070,10 @@ imapx_select (CamelIMAPXServer *is, CamelFolder *folder, gboolean forced, CamelE
return;
is->select_pending = folder;
- camel_object_ref (folder);
+ g_object_ref (folder);
if (is->select_folder) {
g_free(is->select);
- camel_object_unref (is->select_folder);
+ g_object_unref (is->select_folder);
is->select = NULL;
is->select_folder = NULL;
}
@@ -2150,7 +2149,7 @@ imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex)
if (ex && ex->id) {
e(printf ("Unable to connect %d %s \n", ex->id, ex->desc));
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
return FALSE;
}
@@ -2163,12 +2162,12 @@ imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("Could not connect to %s (port %s): %s"),
is->url->host, serv, g_strerror(errno));
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
return FALSE;
}
is->stream = (CamelIMAPXStream *) camel_imapx_stream_new(tcp_stream);
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
/* Disable Nagle - we send a lot of small requests which nagle slows down */
sockopt.option = CAMEL_SOCKOPT_NODELAY;
@@ -2235,7 +2234,7 @@ imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex)
exit:
if (camel_exception_is_set (ex)) {
e(printf("Unable to connect %d %s \n", ex->id, ex->desc));
- camel_object_unref (is->stream);
+ g_object_unref (is->stream);
is->stream = NULL;
if (is->cinfo) {
@@ -2304,7 +2303,7 @@ imapx_reconnect (CamelIMAPXServer *is, CamelException *ex)
if (service->url->authmech
&& (sasl = camel_sasl_new("imap", service->url->authmech, NULL))) {
ic = camel_imapx_command_new("AUTHENTICATE", NULL, "AUTHENTICATE %A", sasl);
- camel_object_unref (sasl);
+ g_object_unref (sasl);
} else {
ic = camel_imapx_command_new("LOGIN", NULL, "LOGIN %s %s", service->url->user, service->url->passwd);
}
@@ -2446,7 +2445,7 @@ imapx_command_fetch_message_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
camel_exception_setv(job->ex, 1, "Error fetching message: %s", ic->status->text);
else
camel_exception_xfer (job->ex, ic->ex);
- camel_object_unref (stream);
+ g_object_unref (stream);
job->u.get_message.stream = NULL;
} else {
CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) job->folder;
@@ -2589,8 +2588,8 @@ imapx_command_copy_messages_step_done (CamelIMAPXServer *is, CamelIMAPXCommand *
}
cleanup:
- camel_object_unref (job->u.copy_messages.dest);
- camel_object_unref (job->folder);
+ g_object_unref (job->u.copy_messages.dest);
+ g_object_unref (job->folder);
imapx_job_done (is, job);
camel_imapx_command_free (ic);
@@ -2664,7 +2663,7 @@ imapx_command_append_message_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
g_free (old_uid);
camel_message_info_free(job->u.append_message.info);
g_free(job->u.append_message.path);
- camel_object_unref (job->folder);
+ g_object_unref (job->folder);
imapx_job_done (is, job);
camel_imapx_command_free (ic);
@@ -3772,15 +3771,53 @@ imapx_parser_thread (gpointer d)
}
static void
-imapx_server_class_init(CamelIMAPXServerClass *ieclass)
+imapx_server_finalize (GObject *object)
+{
+ CamelIMAPXServer *is = CAMEL_IMAPX_SERVER (object);
+
+ g_static_rec_mutex_free(&is->queue_lock);
+ g_static_rec_mutex_free (&is->ostream_lock);
+ g_hash_table_destroy (is->uid_eflags);
+
+ camel_folder_change_info_free (is->changes);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imapx_server_parent_class)->finalize (object);
+}
+
+static void
+imapx_server_constructed (GObject *object)
+{
+ CamelIMAPXServer *server;
+ CamelIMAPXServerClass *class;
+
+ server = CAMEL_IMAPX_SERVER (object);
+ class = CAMEL_IMAPX_SERVER_GET_CLASS (server);
+
+ server->tagprefix = class->tagprefix;
+ class->tagprefix++;
+ if (class->tagprefix > 'Z')
+ class->tagprefix = 'A';
+ server->tagprefix = 'A';
+
+}
+
+static void
+camel_imapx_server_class_init(CamelIMAPXServerClass *class)
{
- ieclass->tagprefix = 'A';
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = imapx_server_finalize;
+ object_class->constructed = imapx_server_constructed;
+
+ class->tagprefix = 'A';
-// camel_object_class_add_event((CamelObjectClass *)ieclass, "status", NULL);
+// camel_object_class_add_event((CamelObjectClass *)class, "status", NULL);
}
static void
-imapx_server_init(CamelIMAPXServer *is, CamelIMAPXServerClass *isclass)
+camel_imapx_server_init (CamelIMAPXServer *is)
{
camel_dlist_init(&is->queue);
camel_dlist_init(&is->active);
@@ -3793,12 +3830,6 @@ imapx_server_init(CamelIMAPXServer *is, CamelIMAPXServerClass *isclass)
g_static_rec_mutex_init (&is->queue_lock);
g_static_rec_mutex_init (&is->ostream_lock);
- is->tagprefix = isclass->tagprefix;
- isclass->tagprefix++;
- if (isclass->tagprefix > 'Z')
- isclass->tagprefix = 'A';
- is->tagprefix = 'A';
-
is->state = IMAPX_DISCONNECTED;
is->expunged = NULL;
@@ -3808,43 +3839,13 @@ imapx_server_init(CamelIMAPXServer *is, CamelIMAPXServerClass *isclass)
is->uid_eflags = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify) e_flag_free);
}
-static void
-imapx_server_finalize(CamelIMAPXServer *is, CamelIMAPXServerClass *isclass)
-{
- g_static_rec_mutex_free(&is->queue_lock);
- g_static_rec_mutex_free (&is->ostream_lock);
- g_hash_table_destroy (is->uid_eflags);
-
- camel_folder_change_info_free (is->changes);
-}
-
-CamelType
-camel_imapx_server_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_object_get_type (),
- "CamelIMAPXServer",
- sizeof (CamelIMAPXServer),
- sizeof (CamelIMAPXServerClass),
- (CamelObjectClassInitFunc) imapx_server_class_init,
- NULL,
- (CamelObjectInitFunc) imapx_server_init,
- (CamelObjectFinalizeFunc) imapx_server_finalize);
- }
-
- return type;
-}
-
CamelIMAPXServer *
camel_imapx_server_new(CamelStore *store, CamelURL *url)
{
- CamelIMAPXServer *is = (CamelIMAPXServer *)camel_object_new(camel_imapx_server_get_type());
+ CamelIMAPXServer *is;
- is->session = ((CamelService *)store)->session;
- camel_object_ref (is->session);
+ is = g_object_new (CAMEL_TYPE_IMAPX_SERVER, NULL);
+ is->session = g_object_ref (CAMEL_SERVICE (store)->session);
is->store = store;
is->url = camel_url_copy(url);
@@ -3862,13 +3863,13 @@ imapx_disconnect (CamelIMAPXServer *is)
if (camel_stream_close (is->stream->source) == -1)
ret = FALSE;
- camel_object_unref (CAMEL_OBJECT (is->stream));
+ g_object_unref (CAMEL_OBJECT (is->stream));
is->stream = NULL;
}
/* TODO need a select lock */
if (is->select_folder) {
- camel_object_unref (is->select_folder);
+ g_object_unref (is->select_folder);
is->select_folder = NULL;
}
@@ -3878,7 +3879,7 @@ imapx_disconnect (CamelIMAPXServer *is)
}
if (is->select_pending) {
- camel_object_unref (is->select_pending);
+ g_object_unref (is->select_pending);
is->select_pending = NULL;
}
@@ -4050,7 +4051,7 @@ camel_imapx_server_sync_message (CamelIMAPXServer *is, CamelFolder *folder, cons
stream = imapx_server_get_message (is, folder, NULL, uid, IMAPX_PRIORITY_SYNC_MESSAGE, ex);
if (stream)
- camel_object_unref (stream);
+ g_object_unref (stream);
}
void
@@ -4068,8 +4069,8 @@ camel_imapx_server_copy_message (CamelIMAPXServer *is, CamelFolder *source, Came
job->u.copy_messages.delete_originals = delete_originals;
job->ex = ex;
- camel_object_ref (source);
- camel_object_ref (dest);
+ g_object_ref (source);
+ g_object_ref (dest);
if (imapx_register_job (is, job))
imapx_run_job (is, job);
@@ -4100,12 +4101,12 @@ camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, Cam
}
filter = camel_stream_filter_new (stream);
- camel_object_unref (stream);
+ g_object_unref (stream);
canon = camel_mime_filter_canon_new(CAMEL_MIME_FILTER_CANON_CRLF);
camel_stream_filter_add((CamelStreamFilter *)filter, canon);
res = camel_data_wrapper_write_to_stream((CamelDataWrapper *)message, filter);
- camel_object_unref (canon);
- camel_object_unref (filter);
+ g_object_unref (canon);
+ g_object_unref (filter);
if (res == -1) {
camel_exception_setv(ex, 2, "Cannot create spool file: %s", g_strerror(errno));
@@ -4130,7 +4131,7 @@ camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, Cam
job->noreply = 1;
job->start = imapx_job_append_message_start;
job->folder = folder;
- camel_object_ref (folder);
+ g_object_ref (folder);
job->u.append_message.info = info;
job->u.append_message.path = tmp;
diff --git a/camel/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
index 382cfa2..5be5238 100644
--- a/camel/providers/imapx/camel-imapx-server.h
+++ b/camel/providers/imapx/camel-imapx-server.h
@@ -25,30 +25,48 @@
#include <camel/camel.h>
#include <libedataserver/e-flag.h>
-struct _CamelFolder;
-struct _CamelException;
-struct _CamelMimeMessage;
-struct _CamelMessageInfo;
+#include "camel-imapx-stream.h"
+#include "camel-imapx-store-summary.h"
+
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAPX_SERVER \
+ (camel_imapx_server_get_type ())
+#define CAMEL_IMAPX_SERVER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAPX_SERVER, CamelIMAPXServer))
+#define CAMEL_IMAPX_SERVER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAPX_SERVER, CamelIMAPXServerClass))
+#define CAMEL_IS_IMAPX_SERVER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAPX_SERVER))
+#define CAMEL_IS_IMAPX_SERVER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAPX_SERVER))
+#define CAMEL_IMAPX_SERVER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAPX_SERVER, CamelIMAPXServerClass))
-#define CAMEL_IMAPX_SERVER(obj) CAMEL_CHECK_CAST (obj, camel_imapx_server_get_type (), CamelIMAPPServer)
-#define CAMEL_IMAPX_SERVER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapx_server_get_type (), CamelIMAPPServerClass)
-#define CAMEL_IS_IMAPX_SERVER(obj) CAMEL_CHECK_TYPE (obj, camel_imapx_server_get_type ())
+#define IMAPX_MODE_READ (1<<0)
+#define IMAPX_MODE_WRITE (1<<1)
+
+G_BEGIN_DECLS
typedef struct _CamelIMAPXServer CamelIMAPXServer;
typedef struct _CamelIMAPXServerClass CamelIMAPXServerClass;
-#define IMAPX_MODE_READ (1<<0)
-#define IMAPX_MODE_WRITE (1<<1)
+typedef struct _CamelIMAPXCommand CamelIMAPXCommand;
+typedef struct _CamelIMAPXIdle CamelIMAPXIdle;
struct _CamelIMAPXServer {
- CamelObject cobject;
+ CamelObject parent;
- struct _CamelStore *store;
- struct _CamelSession *session;
+ CamelStore *store;
+ CamelSession *session;
/* Info about the current connection */
- struct _CamelURL *url;
- struct _CamelIMAPXStream *stream;
+ CamelURL *url;
+ CamelIMAPXStream *stream;
struct _capability_info *cinfo;
gboolean is_ssl_stream;
@@ -66,16 +84,16 @@ struct _CamelIMAPXServer {
/* Current command/work queue. All commands are stored in one list,
all the time, so they can be cleaned up in exception cases */
GStaticRecMutex queue_lock;
- struct _CamelIMAPXCommand *literal;
+ CamelIMAPXCommand *literal;
CamelDList queue;
CamelDList active;
CamelDList done;
/* info on currently selected folder */
- struct _CamelFolder *select_folder;
+ CamelFolder *select_folder;
gchar *select;
- struct _CamelFolderChangeInfo *changes;
- struct _CamelFolder *select_pending;
+ CamelFolderChangeInfo *changes;
+ CamelFolder *select_pending;
guint32 permanentflags;
guint32 uidvalidity;
guint32 unseen;
@@ -97,7 +115,7 @@ struct _CamelIMAPXServer {
gboolean parser_quit;
/* Idle */
- struct _CamelIMAPXIdle *idle;
+ CamelIMAPXIdle *idle;
gboolean use_idle;
/* used for storing eflags to syncronize duplicate get_message requests */
@@ -105,32 +123,72 @@ struct _CamelIMAPXServer {
};
struct _CamelIMAPXServerClass {
- CamelObjectClass cclass;
+ CamelObjectClass parent_class;
gchar tagprefix;
};
-CamelType camel_imapx_server_get_type (void);
-CamelIMAPXServer *camel_imapx_server_new(struct _CamelStore *store, struct _CamelURL *url);
-
-gboolean camel_imapx_server_connect(CamelIMAPXServer *is, gint state, CamelException *ex);
-gboolean imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex);
-
-GPtrArray *camel_imapx_server_list(CamelIMAPXServer *is, const gchar *top, guint32 flags, CamelException *ex);
-
-void camel_imapx_server_refresh_info(CamelIMAPXServer *is, CamelFolder *folder, struct _CamelException *ex);
-void camel_imapx_server_sync_changes(CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex);
-void camel_imapx_server_expunge(CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex);
-void camel_imapx_server_noop (CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex);
-
-CamelStream *camel_imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, struct _CamelException *ex);
-void camel_imapx_server_copy_message (CamelIMAPXServer *is, CamelFolder *source, CamelFolder *dest, GPtrArray *uids, gboolean delete_originals, CamelException *ex);
-void camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, struct _CamelMimeMessage *message, const struct _CamelMessageInfo *mi, CamelException *ex);
-void camel_imapx_server_sync_message (CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, CamelException *ex);
-
-void camel_imapx_server_manage_subscription (CamelIMAPXServer *is, const gchar *folder_name, gboolean subscribe, CamelException *ex);
-void camel_imapx_server_create_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex);
-void camel_imapx_server_delete_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex);
-void camel_imapx_server_rename_folder (CamelIMAPXServer *is, const gchar *old_name, const gchar *new_name, CamelException *ex);
+GType camel_imapx_server_get_type (void);
+CamelIMAPXServer *
+ camel_imapx_server_new (CamelStore *store,
+ CamelURL *url);
+gboolean camel_imapx_server_connect (CamelIMAPXServer *is,
+ gint state,
+ CamelException *ex);
+gboolean imapx_connect_to_server (CamelIMAPXServer *is,
+ CamelException *ex);
+GPtrArray * camel_imapx_server_list (CamelIMAPXServer *is,
+ const gchar *top,
+ guint32 flags,
+ CamelException *ex);
+void camel_imapx_server_refresh_info (CamelIMAPXServer *is,
+ CamelFolder *folder,
+ CamelException *ex);
+void camel_imapx_server_sync_changes (CamelIMAPXServer *is,
+ CamelFolder *folder,
+ CamelException *ex);
+void camel_imapx_server_expunge (CamelIMAPXServer *is,
+ CamelFolder *folder,
+ CamelException *ex);
+void camel_imapx_server_noop (CamelIMAPXServer *is,
+ CamelFolder *folder,
+ CamelException *ex);
+CamelStream * camel_imapx_server_get_message (CamelIMAPXServer *is,
+ CamelFolder *folder,
+ const gchar *uid,
+ CamelException *ex);
+void camel_imapx_server_copy_message (CamelIMAPXServer *is,
+ CamelFolder *source,
+ CamelFolder *dest,
+ GPtrArray *uids,
+ gboolean delete_originals,
+ CamelException *ex);
+void camel_imapx_server_append_message
+ (CamelIMAPXServer *is,
+ CamelFolder *folder,
+ CamelMimeMessage *message,
+ const CamelMessageInfo *mi,
+ CamelException *ex);
+void camel_imapx_server_sync_message (CamelIMAPXServer *is,
+ CamelFolder *folder,
+ const gchar *uid,
+ CamelException *ex);
+void camel_imapx_server_manage_subscription
+ (CamelIMAPXServer *is,
+ const gchar *folder_name,
+ gboolean subscribe,
+ CamelException *ex);
+void camel_imapx_server_create_folder(CamelIMAPXServer *is,
+ const gchar *folder_name,
+ CamelException *ex);
+void camel_imapx_server_delete_folder(CamelIMAPXServer *is,
+ const gchar *folder_name,
+ CamelException *ex);
+void camel_imapx_server_rename_folder(CamelIMAPXServer *is,
+ const gchar *old_name,
+ const gchar *new_name,
+ CamelException *ex);
+
+G_END_DECLS
#endif /* CAMEL_IMAPX_SERVER_H */
diff --git a/camel/providers/imapx/camel-imapx-store-summary.c b/camel/providers/imapx/camel-imapx-store-summary.c
index 8eb7ec2..4d2c277 100644
--- a/camel/providers/imapx/camel-imapx-store-summary.c
+++ b/camel/providers/imapx/camel-imapx-store-summary.c
@@ -39,8 +39,6 @@
#define CAMEL_IMAPX_STORE_SUMMARY_VERSION (0)
-#define _PRIVATE(o) (((CamelIMAPXStoreSummary *)(o))->priv)
-
static gint summary_header_load(CamelStoreSummary *, FILE *);
static gint summary_header_save(CamelStoreSummary *, FILE *);
@@ -52,69 +50,30 @@ static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, gint);
static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
-static void camel_imapx_store_summary_class_init (CamelIMAPXStoreSummaryClass *klass);
-static void camel_imapx_store_summary_init (CamelIMAPXStoreSummary *obj);
-static void camel_imapx_store_summary_finalize (CamelObject *obj);
-
-static CamelStoreSummaryClass *camel_imapx_store_summary_parent;
+G_DEFINE_TYPE (CamelIMAPXStoreSummary, camel_imapx_store_summary, CAMEL_TYPE_STORE_SUMMARY)
static void
-camel_imapx_store_summary_class_init (CamelIMAPXStoreSummaryClass *klass)
+camel_imapx_store_summary_class_init (CamelIMAPXStoreSummaryClass *class)
{
- CamelStoreSummaryClass *ssklass = (CamelStoreSummaryClass *)klass;
-
- ssklass->summary_header_load = summary_header_load;
- ssklass->summary_header_save = summary_header_save;
-
- /*ssklass->store_info_new = store_info_new;*/
- ssklass->store_info_load = store_info_load;
- ssklass->store_info_save = store_info_save;
- ssklass->store_info_free = store_info_free;
-
- ssklass->store_info_string = store_info_string;
- ssklass->store_info_set_string = store_info_set_string;
+ CamelStoreSummaryClass *store_summary_class;
+
+ store_summary_class = CAMEL_STORE_SUMMARY_CLASS (class);
+ store_summary_class->summary_header_load = summary_header_load;
+ store_summary_class->summary_header_save = summary_header_save;
+ store_summary_class->store_info_load = store_info_load;
+ store_summary_class->store_info_save = store_info_save;
+ store_summary_class->store_info_free = store_info_free;
+ store_summary_class->store_info_string = store_info_string;
+ store_summary_class->store_info_set_string = store_info_set_string;
}
static void
camel_imapx_store_summary_init (CamelIMAPXStoreSummary *s)
{
- /*struct _CamelImapStoreSummaryPrivate *p;
-
- p = _PRIVATE(s) = g_malloc0(sizeof(*p));*/
-
((CamelStoreSummary *)s)->store_info_size = sizeof(CamelIMAPXStoreInfo);
s->version = CAMEL_IMAPX_STORE_SUMMARY_VERSION;
}
-static void
-camel_imapx_store_summary_finalize (CamelObject *obj)
-{
- /*struct _CamelImapStoreSummaryPrivate *p;*/
- /*CamelImapStoreSummary *s = (CamelImapStoreSummary *)obj;*/
-
- /*p = _PRIVATE(obj);
- g_free(p);*/
-}
-
-CamelType
-camel_imapx_store_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- camel_imapx_store_summary_parent = (CamelStoreSummaryClass *)camel_store_summary_get_type();
- type = camel_type_register((CamelType)camel_imapx_store_summary_parent, "CamelIMAPXStoreSummary",
- sizeof (CamelIMAPXStoreSummary),
- sizeof (CamelIMAPXStoreSummaryClass),
- (CamelObjectClassInitFunc) camel_imapx_store_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapx_store_summary_init,
- (CamelObjectFinalizeFunc) camel_imapx_store_summary_finalize);
- }
-
- return type;
-}
-
/**
* camel_imapx_store_summary_new:
*
@@ -125,9 +84,7 @@ camel_imapx_store_summary_get_type (void)
CamelIMAPXStoreSummary *
camel_imapx_store_summary_new (void)
{
- CamelIMAPXStoreSummary *new = CAMEL_IMAPX_STORE_SUMMARY ( camel_object_new (camel_imapx_store_summary_get_type ()));
-
- return new;
+ return g_object_new (CAMEL_TYPE_IMAPX_STORE_SUMMARY, NULL);
}
/**
@@ -549,11 +506,13 @@ static gint
summary_header_load(CamelStoreSummary *s, FILE *in)
{
CamelIMAPXStoreSummary *is = (CamelIMAPXStoreSummary *)s;
+ CamelStoreSummaryClass *store_summary_class;
gint32 version, capabilities;
camel_imapx_namespace_list_clear (is->namespaces);
- if (camel_imapx_store_summary_parent->summary_header_load((CamelStoreSummary *)s, in) == -1
+ store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
+ if (store_summary_class->summary_header_load((CamelStoreSummary *)s, in) == -1
|| camel_file_util_decode_fixed_int32(in, &version) == -1)
return -1;
@@ -581,9 +540,11 @@ static gint
summary_header_save(CamelStoreSummary *s, FILE *out)
{
CamelIMAPXStoreSummary *is = (CamelIMAPXStoreSummary *)s;
+ CamelStoreSummaryClass *store_summary_class;
/* always write as latest version */
- if (camel_imapx_store_summary_parent->summary_header_save((CamelStoreSummary *)s, out) == -1
+ store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
+ if (store_summary_class->summary_header_save((CamelStoreSummary *)s, out) == -1
|| camel_file_util_encode_fixed_int32(out, CAMEL_IMAPX_STORE_SUMMARY_VERSION) == -1
|| camel_file_util_encode_fixed_int32(out, is->capabilities) == -1)
return -1;
@@ -598,8 +559,10 @@ static CamelStoreInfo *
store_info_load(CamelStoreSummary *s, FILE *in)
{
CamelIMAPXStoreInfo *mi;
+ CamelStoreSummaryClass *store_summary_class;
- mi = (CamelIMAPXStoreInfo *)camel_imapx_store_summary_parent->store_info_load(s, in);
+ store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
+ mi = (CamelIMAPXStoreInfo *)store_summary_class->store_info_load(s, in);
if (mi) {
if (camel_file_util_decode_string(in, &mi->full_name) == -1) {
camel_store_summary_info_free(s, (CamelStoreInfo *)mi);
@@ -618,8 +581,10 @@ static gint
store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
{
CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *)mi;
+ CamelStoreSummaryClass *store_summary_class;
- if (camel_imapx_store_summary_parent->store_info_save(s, out, mi) == -1
+ store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
+ if (store_summary_class->store_info_save(s, out, mi) == -1
|| camel_file_util_encode_string(out, isi->full_name) == -1)
return -1;
@@ -630,25 +595,31 @@ static void
store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
{
CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *)mi;
+ CamelStoreSummaryClass *store_summary_class;
g_free(isi->full_name);
- camel_imapx_store_summary_parent->store_info_free(s, mi);
+
+ store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
+ store_summary_class->store_info_free(s, mi);
}
static const gchar *
store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
{
CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *)mi;
+ CamelStoreSummaryClass *store_summary_class;
/* FIXME: Locks? */
g_assert (mi != NULL);
+ store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
+
switch (type) {
case CAMEL_IMAPX_STORE_INFO_FULL_NAME:
return isi->full_name;
default:
- return camel_imapx_store_summary_parent->store_info_string(s, mi, type);
+ return store_summary_class->store_info_string(s, mi, type);
}
}
@@ -656,9 +627,12 @@ static void
store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
{
CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *)mi;
+ CamelStoreSummaryClass *store_summary_class;
g_assert(mi != NULL);
+ store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
+
switch (type) {
case CAMEL_IMAPX_STORE_INFO_FULL_NAME:
d(printf("Set full name %s -> %s\n", isi->full_name, str));
@@ -668,7 +642,7 @@ store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const
camel_store_summary_unlock (s, CSS_SUMMARY_LOCK);
break;
default:
- camel_imapx_store_summary_parent->store_info_set_string(s, mi, type, str);
+ store_summary_class->store_info_set_string(s, mi, type, str);
break;
}
}
diff --git a/camel/providers/imapx/camel-imapx-store-summary.h b/camel/providers/imapx/camel-imapx-store-summary.h
index cf78e88..c290ee0 100644
--- a/camel/providers/imapx/camel-imapx-store-summary.h
+++ b/camel/providers/imapx/camel-imapx-store-summary.h
@@ -24,13 +24,28 @@
#include <camel/camel.h>
-#define CAMEL_IMAPX_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imapx_store_summary_get_type (), CamelIMAPXStoreSummary)
-#define CAMEL_IMAPX_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapx_store_summary_get_type (), CamelIMAPXStoreSummaryClass)
-#define CAMEL_IS_IMAPX_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imapx_store_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAPX_STORE_SUMMARY \
+ (camel_imapx_store_summary_get_type ())
+#define CAMEL_IMAPX_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummary)
+#define CAMEL_IMAPX_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass)
+#define CAMEL_IS_IMAPX_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY))
+#define CAMEL_IS_IMAPX_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY))
+#define CAMEL_IMAPX_STORE_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass))
G_BEGIN_DECLS
-typedef struct _CamelIMAPXStoreSummary CamelIMAPXStoreSummary;
+typedef struct _CamelIMAPXStoreSummary CamelIMAPXStoreSummary;
typedef struct _CamelIMAPXStoreSummaryClass CamelIMAPXStoreSummaryClass;
typedef struct _CamelIMAPXStoreInfo CamelIMAPXStoreInfo;
@@ -48,7 +63,7 @@ struct _CamelIMAPXStoreInfo {
typedef struct _CamelIMAPXStoreNamespace CamelIMAPXStoreNamespace;
struct _CamelIMAPXStoreNamespace {
- struct _CamelIMAPXStoreNamespace *next;
+ CamelIMAPXStoreNamespace *next;
gchar *path; /* display path */
gchar *full_name; /* real name */
gchar sep; /* directory separator */
@@ -61,9 +76,7 @@ typedef struct _CamelIMAPXNamespaceList {
} CamelIMAPXNamespaceList;
struct _CamelIMAPXStoreSummary {
- CamelStoreSummary summary;
-
- struct _CamelIMAPXStoreSummaryPrivate *priv;
+ CamelStoreSummary parent;
/* header info */
guint32 version; /* version of base part of file */
@@ -72,32 +85,65 @@ struct _CamelIMAPXStoreSummary {
};
struct _CamelIMAPXStoreSummaryClass {
- CamelStoreSummaryClass summary_class;
+ CamelStoreSummaryClass parent_class;
};
-CamelType camel_imapx_store_summary_get_type (void);
-CamelIMAPXStoreSummary *camel_imapx_store_summary_new (void);
+GType camel_imapx_store_summary_get_type (void);
+CamelIMAPXStoreSummary *
+ camel_imapx_store_summary_new (void);
/* TODO: this api needs some more work, needs to support lists */
-CamelIMAPXStoreNamespace *camel_imapx_store_summary_namespace_new(CamelIMAPXStoreSummary *s, const gchar *full_name, gchar dir_sep);
-void camel_imapx_store_summary_namespace_set(CamelIMAPXStoreSummary *s, CamelIMAPXStoreNamespace *ns);
-CamelIMAPXStoreNamespace *camel_imapx_store_summary_namespace_find_path(CamelIMAPXStoreSummary *s, const gchar *path);
-CamelIMAPXStoreNamespace *camel_imapx_store_summary_namespace_find_full(CamelIMAPXStoreSummary *s, const gchar *full_name);
+CamelIMAPXStoreNamespace *
+ camel_imapx_store_summary_namespace_new
+ (CamelIMAPXStoreSummary *s,
+ const gchar *full_name,
+ gchar dir_sep);
+void camel_imapx_store_summary_namespace_set
+ (CamelIMAPXStoreSummary *s,
+ CamelIMAPXStoreNamespace *ns);
+CamelIMAPXStoreNamespace *
+ camel_imapx_store_summary_namespace_find_path
+ (CamelIMAPXStoreSummary *s,
+ const gchar *path);
+CamelIMAPXStoreNamespace *
+ camel_imapx_store_summary_namespace_find_full
+ (CamelIMAPXStoreSummary *s,
+ const gchar *full_name);
/* converts to/from utf8 canonical nasmes */
-gchar *camel_imapx_store_summary_full_to_path(CamelIMAPXStoreSummary *s, const gchar *full_name, gchar dir_sep);
-gchar *camel_imapx_store_summary_path_to_full(CamelIMAPXStoreSummary *s, const gchar *path, gchar dir_sep);
-
-CamelIMAPXStoreInfo *camel_imapx_store_summary_full_name(CamelIMAPXStoreSummary *s, const gchar *full_name);
-CamelIMAPXStoreInfo *camel_imapx_store_summary_add_from_full(CamelIMAPXStoreSummary *s, const gchar *full_name, gchar dir_sep);
+gchar * camel_imapx_store_summary_full_to_path
+ (CamelIMAPXStoreSummary *s,
+ const gchar *full_name,
+ gchar dir_sep);
+gchar * camel_imapx_store_summary_path_to_full
+ (CamelIMAPXStoreSummary *s,
+ const gchar *path,
+ gchar dir_sep);
+
+CamelIMAPXStoreInfo *
+ camel_imapx_store_summary_full_name
+ (CamelIMAPXStoreSummary *s,
+ const gchar *full_name);
+CamelIMAPXStoreInfo *
+ camel_imapx_store_summary_add_from_full
+ (CamelIMAPXStoreSummary *s,
+ const gchar *full_name,
+ gchar dir_sep);
/* a convenience lookup function. always use this if path known */
-gchar *camel_imapx_store_summary_full_from_path(CamelIMAPXStoreSummary *s, const gchar *path);
+gchar * camel_imapx_store_summary_full_from_path
+ (CamelIMAPXStoreSummary *s,
+ const gchar *path);
-void camel_imapx_store_summary_set_namespaces (CamelIMAPXStoreSummary *summary, const CamelIMAPXNamespaceList *nsl);
+void camel_imapx_store_summary_set_namespaces
+ (CamelIMAPXStoreSummary *summary,
+ const CamelIMAPXNamespaceList *nsl);
/* helpe macro's */
-#define camel_imapx_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAPX_STORE_INFO_FULL_NAME))
+#define camel_imapx_store_info_full_name(s, i) \
+ (camel_store_info_string ( \
+ (CamelStoreSummary *)s, (const CamelStoreInfo *)i, \
+ CAMEL_IMAPX_STORE_INFO_FULL_NAME))
G_END_DECLS
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index 7848be5..629007d 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -53,7 +53,7 @@
#define FINFO_REFRESH_INTERVAL 60
-static CamelOfflineStoreClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelIMAPXStore, camel_imapx_store, CAMEL_TYPE_STORE)
static guint
imapx_name_hash(gconstpointer key)
@@ -109,13 +109,32 @@ imapx_parse_receiving_options (CamelIMAPXStore *istore, CamelURL *url)
istore->rec_options |= IMAPX_USE_IDLE;
}
+static void
+imapx_store_finalize (GObject *object)
+{
+ CamelIMAPXStore *imapx_store = CAMEL_IMAPX_STORE (object);
+
+ /* force disconnect so we dont have it run later, after we've cleaned up some stuff */
+ /* SIGH */
+
+ camel_service_disconnect((CamelService *)imapx_store, TRUE, NULL);
+ g_mutex_free (imapx_store->get_finfo_lock);
+
+ g_free (imapx_store->base_url);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imapx_store_parent_class)->finalize (object);
+}
+
static gboolean
imapx_construct(CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
{
gchar *summary;
CamelIMAPXStore *store = (CamelIMAPXStore *)service;
+ CamelServiceClass *service_class;
- if (!CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex))
+ service_class = CAMEL_SERVICE_CLASS (camel_imapx_store_parent_class);
+ if (!service_class->construct (service, session, provider, url, ex))
return FALSE;
store->base_url = camel_url_to_string (service->url, (CAMEL_URL_HIDE_PASSWORD |
@@ -206,8 +225,10 @@ static gboolean
imapx_disconnect (CamelService *service, gboolean clean, CamelException *ex)
{
CamelIMAPXStore *istore = CAMEL_IMAPX_STORE (service);
+ CamelServiceClass *service_class;
- CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex);
+ service_class = CAMEL_SERVICE_CLASS (camel_imapx_store_parent_class);
+ service_class->disconnect (service, clean, ex);
if (istore->server)
camel_imapx_server_connect(istore->server, FALSE, ex);
@@ -218,7 +239,11 @@ imapx_disconnect (CamelService *service, gboolean clean, CamelException *ex)
static CamelFolder *
imapx_get_junk(CamelStore *store, CamelException *ex)
{
- CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_junk(store, ex);
+ CamelFolder *folder;
+ CamelStoreClass *store_class;
+
+ store_class = CAMEL_STORE_CLASS (camel_imapx_store_parent_class);
+ folder = store_class->get_junk (store, ex);
if (folder) {
gchar *state = g_build_filename(((CamelIMAPXStore *)store)->storage_path, "system", "Junk.cmeta", NULL);
@@ -235,7 +260,11 @@ imapx_get_junk(CamelStore *store, CamelException *ex)
static CamelFolder *
imapx_get_trash (CamelStore *store, CamelException *ex)
{
- CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_trash(store, ex);
+ CamelFolder *folder;
+ CamelStoreClass *store_class;
+
+ store_class = CAMEL_STORE_CLASS (camel_imapx_store_parent_class);
+ folder = store_class->get_trash (store, ex);
if (folder) {
gchar *state = g_build_filename(((CamelIMAPXStore *)store)->storage_path, "system", "Trash.cmeta", NULL);
@@ -406,8 +435,8 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
fi->total = ((CamelFolderSummary *)ims)->saved_count;
if (!folder->summary)
- camel_object_unref (ims);
- camel_object_unref (folder);
+ g_object_unref (ims);
+ g_object_unref (folder);
}
}
@@ -1173,7 +1202,7 @@ imapx_refresh_free(CamelSession *session, CamelSessionThreadMsg *msg)
{
struct _imapx_refresh_msg *m = (struct _imapx_refresh_msg *)msg;
- camel_object_unref (m->store);
+ g_object_unref (m->store);
camel_exception_clear(&m->ex);
}
@@ -1232,7 +1261,7 @@ imapx_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelE
istore->last_refresh_time = time (NULL);
m = camel_session_thread_msg_new(((CamelService *)store)->session, &imapx_refresh_ops, sizeof(*m));
m->store = store;
- camel_object_ref (store);
+ g_object_ref (store);
camel_exception_init(&m->ex);
camel_session_thread_queue(((CamelService *)store)->session, &m->msg, 0);
}
@@ -1290,13 +1319,16 @@ imapx_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelE
static gboolean
imapx_can_refresh_folder (CamelStore *store, CamelFolderInfo *info, CamelException *ex)
{
+ CamelStoreClass *store_class;
gboolean res;
- res = CAMEL_STORE_CLASS(parent_class)->can_refresh_folder (store, info, ex) ||
+ store_class = CAMEL_STORE_CLASS (camel_imapx_store_parent_class);
+
+ res = store_class->can_refresh_folder (store, info, ex) ||
(camel_url_get_param (((CamelService *)store)->url, "check_all") != NULL) ||
(camel_url_get_param (((CamelService *)store)->url, "check_lsub") != NULL && (info->flags & CAMEL_FOLDER_SUBSCRIBED) != 0);
- if (!res && !camel_exception_is_set (ex) && CAMEL_IS_IMAP_STORE (store)) {
+ if (!res && !camel_exception_is_set (ex) && CAMEL_IS_IMAPX_STORE (store)) {
CamelStoreInfo *si;
CamelStoreSummary *sm = CAMEL_STORE_SUMMARY (((CamelIMAPXStore *)(store))->summary);
@@ -1331,83 +1363,50 @@ imapx_folder_subscribed (CamelStore *store, const gchar *folder_name)
}
static void
-camel_imapx_store_class_init(CamelIMAPXStoreClass *klass)
+camel_imapx_store_class_init(CamelIMAPXStoreClass *class)
{
- CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(klass);
- CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS(klass);
-
- parent_class = CAMEL_OFFLINE_STORE_CLASS (camel_type_get_global_classfuncs (camel_offline_store_get_type ()));
-
- camel_service_class->construct = imapx_construct;
- camel_service_class->query_auth_types = imapx_query_auth_types;
- camel_service_class->get_name = imapx_get_name;
- camel_service_class->connect = imapx_connect;
- camel_service_class->disconnect = imapx_disconnect;
-
- camel_store_class->get_trash = imapx_get_trash;
- camel_store_class->get_junk = imapx_get_junk;
- camel_store_class->noop = imapx_noop;
- camel_store_class->get_folder = imapx_get_folder;
- camel_store_class->get_inbox = imapx_get_inbox;
- camel_store_class->hash_folder_name = imapx_hash_folder_name;
- camel_store_class->compare_folder_name = imapx_compare_folder_name;
-
- camel_store_class->can_refresh_folder = imapx_can_refresh_folder;
- camel_store_class->create_folder = imapx_create_folder;
- camel_store_class->rename_folder = imapx_rename_folder;
- camel_store_class->delete_folder = imapx_delete_folder;
- camel_store_class->subscribe_folder = imapx_store_subscribe_folder;
- camel_store_class->unsubscribe_folder = imapx_store_unsubscribe_folder;
- camel_store_class->get_folder_info = imapx_get_folder_info;
- camel_store_class->folder_subscribed = imapx_folder_subscribed;
- camel_store_class->free_folder_info = camel_store_free_folder_info_full;
-
- ((CamelStoreClass *)klass)->hash_folder_name = imapx_name_hash;
- ((CamelStoreClass *)klass)->compare_folder_name = imapx_name_equal;
+ GObjectClass *object_class;
+ CamelServiceClass *service_class;
+ CamelStoreClass *store_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = imapx_store_finalize;
+
+ service_class = CAMEL_SERVICE_CLASS (class);
+ service_class->construct = imapx_construct;
+ service_class->query_auth_types = imapx_query_auth_types;
+ service_class->get_name = imapx_get_name;
+ service_class->connect = imapx_connect;
+ service_class->disconnect = imapx_disconnect;
+
+ store_class = CAMEL_STORE_CLASS (class);
+ store_class->get_trash = imapx_get_trash;
+ store_class->get_junk = imapx_get_junk;
+ store_class->noop = imapx_noop;
+ store_class->get_folder = imapx_get_folder;
+ store_class->get_inbox = imapx_get_inbox;
+ store_class->hash_folder_name = imapx_hash_folder_name;
+ store_class->compare_folder_name = imapx_compare_folder_name;
+ store_class->can_refresh_folder = imapx_can_refresh_folder;
+ store_class->create_folder = imapx_create_folder;
+ store_class->rename_folder = imapx_rename_folder;
+ store_class->delete_folder = imapx_delete_folder;
+ store_class->subscribe_folder = imapx_store_subscribe_folder;
+ store_class->unsubscribe_folder = imapx_store_unsubscribe_folder;
+ store_class->get_folder_info = imapx_get_folder_info;
+ store_class->folder_subscribed = imapx_folder_subscribed;
+ store_class->free_folder_info = camel_store_free_folder_info_full;
+ store_class->hash_folder_name = imapx_name_hash;
+ store_class->compare_folder_name = imapx_name_equal;
}
static void
-camel_imapx_store_init (gpointer object, gpointer klass)
+camel_imapx_store_init (CamelIMAPXStore *istore)
{
- CamelStore *store = (CamelStore *) object;
- CamelIMAPXStore *istore = CAMEL_IMAPX_STORE (object);
+ CamelStore *store = CAMEL_STORE (istore);
store->flags |= CAMEL_STORE_ASYNC | CAMEL_STORE_SUBSCRIPTIONS;
istore->get_finfo_lock = g_mutex_new ();
istore->last_refresh_time = time (NULL) - (FINFO_REFRESH_INTERVAL + 10);
istore->dir_sep = '/';
}
-
-static void
-imapx_store_finalize(CamelObject *object)
-{
- CamelIMAPXStore *imapx_store = CAMEL_IMAPX_STORE (object);
-
- /* force disconnect so we dont have it run later, after we've cleaned up some stuff */
- /* SIGH */
-
- camel_service_disconnect((CamelService *)imapx_store, TRUE, NULL);
- g_mutex_free (imapx_store->get_finfo_lock);
-
- if (imapx_store->base_url)
- g_free (imapx_store->base_url);
-}
-
-CamelType
-camel_imapx_store_get_type (void)
-{
- static CamelType camel_imapx_store_type = CAMEL_INVALID_TYPE;
-
- if (!camel_imapx_store_type) {
- camel_imapx_store_type = camel_type_register(camel_offline_store_get_type (),
- "CamelIMAPXStore",
- sizeof (CamelIMAPXStore),
- sizeof (CamelIMAPXStoreClass),
- (CamelObjectClassInitFunc) camel_imapx_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapx_store_init,
- imapx_store_finalize);
- }
-
- return camel_imapx_store_type;
-}
diff --git a/camel/providers/imapx/camel-imapx-store.h b/camel/providers/imapx/camel-imapx-store.h
index 3da0782..79fb9da 100644
--- a/camel/providers/imapx/camel-imapx-store.h
+++ b/camel/providers/imapx/camel-imapx-store.h
@@ -24,19 +24,29 @@
#ifndef CAMEL_IMAPX_STORE_H
#define CAMEL_IMAPX_STORE_H
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
#include <camel/camel.h>
+#include "camel-imapx-server.h"
#include "camel-imapx-store-summary.h"
-#define CAMEL_IMAPX_STORE_TYPE (camel_imapx_store_get_type ())
-#define CAMEL_IMAPX_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAPX_STORE_TYPE, CamelIMAPXStore))
-#define CAMEL_IMAPX_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAPX_STORE_TYPE, CamelIMAPXStoreClass))
-#define CAMEL_IS_IMAP_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAPX_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAPX_STORE \
+ (camel_imapx_store_get_type ())
+#define CAMEL_IMAPX_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAPX_STORE, CamelIMAPXStore))
+#define CAMEL_IMAPX_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAPX_STORE, CamelIMAPXStoreClass))
+#define CAMEL_IS_IMAPX_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAPX_STORE))
+#define CAMEL_IS_IMAPX_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAPX_STORE))
+#define CAMEL_IMAPX_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAPX_STORE, CamelIMAPXStoreClass))
#define IMAPX_OVERRIDE_NAMESPACE (1 << 0)
#define IMAPX_CHECK_ALL (1 << 1)
@@ -47,10 +57,15 @@ extern "C" {
#define IMAPX_CHECK_LSUB (1 << 6)
#define IMAPX_USE_IDLE (1 << 7)
-typedef struct {
+G_BEGIN_DECLS
+
+typedef struct _CamelIMAPXStore CamelIMAPXStore;
+typedef struct _CamelIMAPXStoreClass CamelIMAPXStoreClass;
+
+struct _CamelIMAPXStore {
CamelOfflineStore parent;
- struct _CamelIMAPXServer *server;
+ CamelIMAPXServer *server;
CamelIMAPXStoreSummary *summary; /* in-memory list of folders */
gchar *namespace, dir_sep, *base_url, *storage_path;
@@ -69,19 +84,15 @@ typedef struct {
gchar *login_error;
GPtrArray *pending_list;
-} CamelIMAPXStore;
+};
-typedef struct {
+struct _CamelIMAPXStoreClass {
CamelOfflineStoreClass parent_class;
+};
-} CamelIMAPXStoreClass;
-
-/* Standard Camel function */
-CamelType camel_imapx_store_get_type (void);
+GType camel_imapx_store_get_type (void);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
#endif /* CAMEL_IMAPX_STORE_H */
diff --git a/camel/providers/imapx/camel-imapx-stream.c b/camel/providers/imapx/camel-imapx-stream.c
index 270747d..c63cdc3 100644
--- a/camel/providers/imapx/camel-imapx-stream.c
+++ b/camel/providers/imapx/camel-imapx-stream.c
@@ -38,16 +38,13 @@
#define t(x)
#define io(x)
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_IMAPX_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
#define CAMEL_IMAPX_STREAM_SIZE (4096)
#define CAMEL_IMAPX_STREAM_TOKEN (4096) /* maximum token size */
+G_DEFINE_TYPE (CamelIMAPXStream, camel_imapx_stream, CAMEL_TYPE_STREAM)
+
static gint
-stream_fill(CamelIMAPXStream *is)
+imapx_stream_fill (CamelIMAPXStream *is)
{
gint left = 0;
@@ -72,8 +69,35 @@ stream_fill(CamelIMAPXStream *is)
return -1;
}
+static void
+imapx_stream_dispose (GObject *object)
+{
+ CamelIMAPXStream *stream = CAMEL_IMAPX_STREAM (object);
+
+ if (stream->source != NULL) {
+ g_object_unref (stream->source);
+ stream->source = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_imapx_stream_parent_class)->dispose (object);
+}
+
+static void
+imapx_stream_finalize (GObject *object)
+{
+ CamelIMAPXStream *stream = CAMEL_IMAPX_STREAM (object);
+
+ g_free (stream->buf);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_imapx_stream_parent_class)->finalize (object);
+}
+
static gssize
-stream_read(CamelStream *stream, gchar *buffer, gsize n)
+imapx_stream_read (CamelStream *stream,
+ gchar *buffer,
+ gsize n)
{
CamelIMAPXStream *is = (CamelIMAPXStream *)stream;
gssize max;
@@ -102,7 +126,9 @@ stream_read(CamelStream *stream, gchar *buffer, gsize n)
}
static gssize
-stream_write(CamelStream *stream, const gchar *buffer, gsize n)
+imapx_stream_write (CamelStream *stream,
+ const gchar *buffer,
+ gsize n)
{
CamelIMAPXStream *is = (CamelIMAPXStream *)stream;
@@ -112,21 +138,21 @@ stream_write(CamelStream *stream, const gchar *buffer, gsize n)
}
static gint
-stream_close(CamelStream *stream)
+imapx_stream_close (CamelStream *stream)
{
/* nop? */
return 0;
}
static gint
-stream_flush(CamelStream *stream)
+imapx_stream_flush (CamelStream *stream)
{
/* nop? */
return 0;
}
static gboolean
-stream_eos(CamelStream *stream)
+imapx_stream_eos (CamelStream *stream)
{
CamelIMAPXStream *is = (CamelIMAPXStream *)stream;
@@ -134,30 +160,33 @@ stream_eos(CamelStream *stream)
}
static gint
-stream_reset(CamelStream *stream)
+imapx_stream_reset (CamelStream *stream)
{
/* nop? reset literal mode? */
return 0;
}
static void
-camel_imapx_stream_class_init (CamelStreamClass *camel_imapx_stream_class)
+camel_imapx_stream_class_init (CamelIMAPXStreamClass *class)
{
- CamelStreamClass *camel_stream_class = (CamelStreamClass *)camel_imapx_stream_class;
-
- parent_class = camel_type_get_global_classfuncs( CAMEL_TYPE_OBJECT );
-
- /* virtual method definition */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->close = stream_close;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->eos = stream_eos;
- camel_stream_class->reset = stream_reset;
+ GObjectClass *object_class;
+ CamelStreamClass *stream_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = imapx_stream_dispose;
+ object_class->finalize = imapx_stream_finalize;
+
+ stream_class = CAMEL_STREAM_CLASS (class);
+ stream_class->read = imapx_stream_read;
+ stream_class->write = imapx_stream_write;
+ stream_class->close = imapx_stream_close;
+ stream_class->flush = imapx_stream_flush;
+ stream_class->eos = imapx_stream_eos;
+ stream_class->reset = imapx_stream_reset;
}
static void
-camel_imapx_stream_init(CamelIMAPXStream *is, CamelIMAPXStreamClass *isclass)
+camel_imapx_stream_init (CamelIMAPXStream *is)
{
/* +1 is room for appending a 0 if we need to for a token */
is->ptr = is->end = is->buf = g_malloc(CAMEL_IMAPX_STREAM_SIZE+1);
@@ -165,33 +194,6 @@ camel_imapx_stream_init(CamelIMAPXStream *is, CamelIMAPXStreamClass *isclass)
is->tokenend = is->tokenbuf + CAMEL_IMAPX_STREAM_SIZE;
}
-static void
-camel_imapx_stream_finalize(CamelIMAPXStream *is)
-{
- g_free(is->buf);
- if (is->source)
- camel_object_unref (is->source);
-}
-
-CamelType
-camel_imapx_stream_get_type (void)
-{
- static CamelType camel_imapx_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_imapx_stream_type == CAMEL_INVALID_TYPE) {
- camel_imapx_stream_type = camel_type_register( camel_stream_get_type(),
- "CamelIMAPXStream",
- sizeof( CamelIMAPXStream ),
- sizeof( CamelIMAPXStreamClass ),
- (CamelObjectClassInitFunc) camel_imapx_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapx_stream_init,
- (CamelObjectFinalizeFunc) camel_imapx_stream_finalize );
- }
-
- return camel_imapx_stream_type;
-}
-
/**
* camel_imapx_stream_new:
*
@@ -205,9 +207,8 @@ camel_imapx_stream_new(CamelStream *source)
{
CamelIMAPXStream *is;
- is = (CamelIMAPXStream *)camel_object_new(camel_imapx_stream_get_type ());
- camel_object_ref (source);
- is->source = source;
+ is = g_object_new (CAMEL_TYPE_IMAPX_STREAM, NULL);
+ is->source = g_object_ref (source);
return (CamelStream *)is;
}
@@ -233,7 +234,7 @@ skip_ws(CamelIMAPXStream *is, guchar *pp, guchar *pe)
do {
while (p >= e ) {
is->ptr = p;
- if (stream_fill(is) == IMAPX_TOK_ERROR)
+ if (imapx_stream_fill(is) == IMAPX_TOK_ERROR)
return IMAPX_TOK_ERROR;
p = is->ptr;
e = is->end;
@@ -380,7 +381,7 @@ camel_imapx_stream_nstring_stream(CamelIMAPXStream *is, CamelStream **stream, Ca
mem = camel_stream_mem_new();
if (camel_stream_write_to_stream((CamelStream *)is, mem) == -1) {
camel_exception_setv (ex, 1, "nstring: io error: %s", strerror(errno));
- camel_object_unref (mem);
+ g_object_unref (mem);
ret = -1;
break;
}
@@ -482,7 +483,7 @@ camel_imapx_stream_token(CamelIMAPXStream *is, guchar **data, guint *len, CamelE
do {
while (p >= e ) {
is->ptr = p;
- if (stream_fill(is) == IMAPX_TOK_ERROR)
+ if (imapx_stream_fill(is) == IMAPX_TOK_ERROR)
goto io_error;
p = is->ptr;
e = is->end;
@@ -516,7 +517,7 @@ camel_imapx_stream_token(CamelIMAPXStream *is, guchar **data, guint *len, CamelE
}
}
is->ptr = p;
- if (stream_fill(is) == IMAPX_TOK_ERROR)
+ if (imapx_stream_fill(is) == IMAPX_TOK_ERROR)
goto io_error;
p = is->ptr;
e = is->end;
@@ -531,7 +532,7 @@ camel_imapx_stream_token(CamelIMAPXStream *is, guchar **data, guint *len, CamelE
}
}
is->ptr = p;
- if (stream_fill(is) == IMAPX_TOK_ERROR)
+ if (imapx_stream_fill(is) == IMAPX_TOK_ERROR)
goto io_error;
p = is->ptr;
e = is->end;
@@ -545,7 +546,7 @@ camel_imapx_stream_token(CamelIMAPXStream *is, guchar **data, guint *len, CamelE
if (c == '\\') {
while (p >= e) {
is->ptr = p;
- if (stream_fill(is) == IMAPX_TOK_ERROR)
+ if (imapx_stream_fill(is) == IMAPX_TOK_ERROR)
goto io_error;
p = is->ptr;
e = is->end;
@@ -574,7 +575,7 @@ camel_imapx_stream_token(CamelIMAPXStream *is, guchar **data, guint *len, CamelE
}
}
is->ptr = p;
- if (stream_fill(is) == IMAPX_TOK_ERROR)
+ if (imapx_stream_fill(is) == IMAPX_TOK_ERROR)
goto io_error;
p = is->ptr;
e = is->end;
@@ -607,7 +608,7 @@ camel_imapx_stream_token(CamelIMAPXStream *is, guchar **data, guint *len, CamelE
}
}
is->ptr = p;
- if (stream_fill(is) == IMAPX_TOK_ERROR)
+ if (imapx_stream_fill(is) == IMAPX_TOK_ERROR)
goto io_error;
p = is->ptr;
e = is->end;
@@ -652,7 +653,7 @@ gint camel_imapx_stream_gets(CamelIMAPXStream *is, guchar **start, guint *len)
max = is->end - is->ptr;
if (max == 0) {
- max = stream_fill(is);
+ max = imapx_stream_fill(is);
if (max <= 0)
return max;
}
@@ -683,7 +684,7 @@ gint camel_imapx_stream_getl(CamelIMAPXStream *is, guchar **start, guint *len)
if (is->literal > 0) {
max = is->end - is->ptr;
if (max == 0) {
- max = stream_fill(is);
+ max = imapx_stream_fill(is);
if (max <= 0)
return max;
}
diff --git a/camel/providers/imapx/camel-imapx-stream.h b/camel/providers/imapx/camel-imapx-stream.h
index 0416c56..433a01f 100644
--- a/camel/providers/imapx/camel-imapx-stream.h
+++ b/camel/providers/imapx/camel-imapx-stream.h
@@ -23,12 +23,29 @@
#include <camel/camel.h>
-#define CAMEL_IMAPX_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_imapx_stream_get_type (), CamelIMAPXStream)
-#define CAMEL_IMAPX_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapx_stream_get_type (), CamelIMAPXStreamClass)
-#define CAMEL_IS_IMAPX_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_imapx_stream_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAPX_STREAM \
+ (camel_imapx_stream_get_type ())
+#define CAMEL_IMAPX_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAPX_STREAM, CamelIMAPXStream))
+#define CAMEL_IMAPX_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAPX_STREAM, CamelIMAPXStreamClass))
+#define CAMEL_IS_IMAPX_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAPX_STREAM))
+#define CAMEL_IS_IMAPX_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAPX_STREAM))
+#define CAMEL_IMAPX_STREAM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAPX_STREAM, CamelIMAPXStreamClass))
+
+G_BEGIN_DECLS
-typedef struct _CamelIMAPXStreamClass CamelIMAPXStreamClass;
typedef struct _CamelIMAPXStream CamelIMAPXStream;
+typedef struct _CamelIMAPXStreamClass CamelIMAPXStreamClass;
typedef enum {
IMAPX_TOK_PROTOCOL = -2,
@@ -60,36 +77,63 @@ struct _CamelIMAPXStreamClass {
CamelStreamClass parent_class;
};
-CamelType camel_imapx_stream_get_type (void);
-
-CamelStream *camel_imapx_stream_new (CamelStream *source);
-
-gint camel_imapx_stream_buffered (CamelIMAPXStream *is);
-
-camel_imapx_token_t camel_imapx_stream_token (CamelIMAPXStream *is, guchar **start, guint *len, CamelException *ex); /* throws IO,PARSE exception */
-void camel_imapx_stream_ungettoken (CamelIMAPXStream *is, camel_imapx_token_t tok, guchar *token, guint len);
-
-void camel_imapx_stream_set_literal (CamelIMAPXStream *is, guint literal);
-gint camel_imapx_stream_gets (CamelIMAPXStream *is, guchar **start, guint *len);
-gint camel_imapx_stream_getl (CamelIMAPXStream *is, guchar **start, guint *len);
+GType camel_imapx_stream_get_type (void);
+CamelStream * camel_imapx_stream_new (CamelStream *source);
+gint camel_imapx_stream_buffered (CamelIMAPXStream *is);
+
+/* throws IO,PARSE exception */
+camel_imapx_token_t
+ camel_imapx_stream_token (CamelIMAPXStream *is,
+ guchar **start,
+ guint *len,
+ CamelException *ex);
+
+void camel_imapx_stream_ungettoken (CamelIMAPXStream *is,
+ camel_imapx_token_t tok,
+ guchar *token,
+ guint len);
+void camel_imapx_stream_set_literal (CamelIMAPXStream *is,
+ guint literal);
+gint camel_imapx_stream_gets (CamelIMAPXStream *is,
+ guchar **start,
+ guint *len);
+gint camel_imapx_stream_getl (CamelIMAPXStream *is,
+ guchar **start,
+ guint *len);
/* all throw IO,PARSE exceptions */
/* gets an atom, upper-cases */
-gint camel_imapx_stream_atom (CamelIMAPXStream *is, guchar **start, guint *len, CamelException *ex);
+gint camel_imapx_stream_atom (CamelIMAPXStream *is,
+ guchar **start,
+ guint *len,
+ CamelException *ex);
/* gets an atom or string */
-gint camel_imapx_stream_astring (CamelIMAPXStream *is, guchar **start, CamelException *ex);
+gint camel_imapx_stream_astring (CamelIMAPXStream *is,
+ guchar **start,
+ CamelException *ex);
/* gets a NIL or a string, start==NULL if NIL */
-gint camel_imapx_stream_nstring (CamelIMAPXStream *is, guchar **start, CamelException *ex);
+gint camel_imapx_stream_nstring (CamelIMAPXStream *is,
+ guchar **start,
+ CamelException *ex);
/* gets a NIL or string into a stream, stream==NULL if NIL */
-gint camel_imapx_stream_nstring_stream(CamelIMAPXStream *is, CamelStream **stream, CamelException *ex);
+gint camel_imapx_stream_nstring_stream
+ (CamelIMAPXStream *is,
+ CamelStream **stream,
+ CamelException *ex);
/* gets 'text' */
-gint camel_imapx_stream_text (CamelIMAPXStream *is, guchar **text, CamelException *ex);
+gint camel_imapx_stream_text (CamelIMAPXStream *is,
+ guchar **text,
+ CamelException *ex);
/* gets a 'number' */
-guint32 camel_imapx_stream_number(CamelIMAPXStream *is, CamelException *ex);
+guint32 camel_imapx_stream_number (CamelIMAPXStream *is,
+ CamelException *ex);
/* skips the rest of a line, including literals, etc */
-gint camel_imapx_stream_skip(CamelIMAPXStream *is, CamelException *ex);
+gint camel_imapx_stream_skip (CamelIMAPXStream *is,
+ CamelException *ex);
+
+G_END_DECLS
#endif /* CAMEL_IMAPX_STREAM_H */
diff --git a/camel/providers/imapx/camel-imapx-summary.c b/camel/providers/imapx/camel-imapx-summary.c
index 2db97dd..5fd38f2 100644
--- a/camel/providers/imapx/camel-imapx-summary.c
+++ b/camel/providers/imapx/camel-imapx-summary.c
@@ -56,37 +56,20 @@ static CamelMessageInfo * message_info_from_db (CamelFolderSummary *s, CamelMIRe
static gint content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir);
static CamelMessageContentInfo * content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir);
-static void camel_imapx_summary_class_init (CamelIMAPXSummaryClass *klass);
-static void camel_imapx_summary_init (CamelIMAPXSummary *obj);
-
-static CamelFolderSummaryClass *camel_imapx_summary_parent;
-
-CamelType
-camel_imapx_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(
- camel_folder_summary_get_type(), "CamelIMAPXSummary",
- sizeof (CamelIMAPXSummary),
- sizeof (CamelIMAPXSummaryClass),
- (CamelObjectClassInitFunc) camel_imapx_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapx_summary_init,
- NULL);
- }
-
- return type;
-}
+G_DEFINE_TYPE (CamelIMAPXSummary, camel_imapx_summary, CAMEL_TYPE_FOLDER_SUMMARY)
static CamelMessageInfo *
imapx_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
{
CamelIMAPXMessageInfo *to;
+ CamelFolderSummaryClass *folder_summary_class;
const CamelIMAPXMessageInfo *from = (const CamelIMAPXMessageInfo *)mi;
- to = (CamelIMAPXMessageInfo *)camel_imapx_summary_parent->message_info_clone(s, mi);
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ to = (CamelIMAPXMessageInfo *)
+ folder_summary_class->message_info_clone(s, mi);
to->server_flags = from->server_flags;
/* FIXME: parent clone should do this */
@@ -96,32 +79,27 @@ imapx_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
}
static void
-camel_imapx_summary_class_init (CamelIMAPXSummaryClass *klass)
+camel_imapx_summary_class_init (CamelIMAPXSummaryClass *class)
{
- CamelFolderSummaryClass *cfs_class = (CamelFolderSummaryClass *) klass;
-
- camel_imapx_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS (camel_type_get_global_classfuncs (camel_folder_summary_get_type()));
-
- cfs_class->message_info_size = sizeof(CamelIMAPXMessageInfo);
- cfs_class->content_info_size = sizeof(CamelIMAPXMessageContentInfo);
-
- cfs_class->message_info_clone = imapx_message_info_clone;
-
- cfs_class->summary_header_load = summary_header_load;
- cfs_class->summary_header_save = summary_header_save;
- cfs_class->message_info_load = message_info_load;
- cfs_class->message_info_save = message_info_save;
- cfs_class->content_info_load = content_info_load;
- cfs_class->content_info_save = content_info_save;
-
- cfs_class->summary_header_to_db = summary_header_to_db;
- cfs_class->summary_header_from_db = summary_header_from_db;
- cfs_class->message_info_to_db = message_info_to_db;
- cfs_class->message_info_from_db = message_info_from_db;
- cfs_class->content_info_to_db = content_info_to_db;
- cfs_class->content_info_from_db = content_info_from_db;
-
- cfs_class->info_set_user_flag = info_set_user_flag;
+ CamelFolderSummaryClass *folder_summary_class;
+
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
+ folder_summary_class->message_info_size = sizeof (CamelIMAPXMessageInfo);
+ folder_summary_class->content_info_size = sizeof (CamelIMAPXMessageContentInfo);
+ folder_summary_class->message_info_clone = imapx_message_info_clone;
+ folder_summary_class->summary_header_load = summary_header_load;
+ folder_summary_class->summary_header_save = summary_header_save;
+ folder_summary_class->message_info_load = message_info_load;
+ folder_summary_class->message_info_save = message_info_save;
+ folder_summary_class->content_info_load = content_info_load;
+ folder_summary_class->content_info_save = content_info_save;
+ folder_summary_class->summary_header_to_db = summary_header_to_db;
+ folder_summary_class->summary_header_from_db = summary_header_from_db;
+ folder_summary_class->message_info_to_db = message_info_to_db;
+ folder_summary_class->message_info_from_db = message_info_from_db;
+ folder_summary_class->content_info_to_db = content_info_to_db;
+ folder_summary_class->content_info_from_db = content_info_from_db;
+ folder_summary_class->info_set_user_flag = info_set_user_flag;
}
static void
@@ -182,10 +160,12 @@ uid_compare (gconstpointer va, gconstpointer vb)
CamelFolderSummary *
camel_imapx_summary_new (struct _CamelFolder *folder, const gchar *filename)
{
- CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (camel_object_new (camel_imapx_summary_get_type ()));
+ CamelFolderSummary *summary;
CamelException ex;
camel_exception_init (&ex);
+ summary = g_object_new (CAMEL_TYPE_IMAPX_SUMMARY, NULL);
+
summary->folder = folder;
/* Don't do DB sort. Its pretty slow to load */
if (folder && 0) {
@@ -215,9 +195,13 @@ static gint
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
{
CamelIMAPXSummary *ims = CAMEL_IMAPX_SUMMARY (s);
+ CamelFolderSummaryClass *folder_summary_class;
gchar *part;
- if (camel_imapx_summary_parent->summary_header_from_db (s, mir) == -1)
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ if (folder_summary_class->summary_header_from_db (s, mir) == -1)
return -1;
part = mir->bdata;
@@ -243,8 +227,12 @@ static gint
summary_header_load (CamelFolderSummary *s, FILE *in)
{
CamelIMAPXSummary *ims = CAMEL_IMAPX_SUMMARY (s);
+ CamelFolderSummaryClass *folder_summary_class;
- if (camel_imapx_summary_parent->summary_header_load (s, in) == -1)
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ if (folder_summary_class->summary_header_load (s, in) == -1)
return -1;
/* Legacy version */
@@ -279,9 +267,13 @@ static CamelFIRecord *
summary_header_to_db (CamelFolderSummary *s, CamelException *ex)
{
CamelIMAPXSummary *ims = CAMEL_IMAPX_SUMMARY(s);
+ CamelFolderSummaryClass *folder_summary_class;
struct _CamelFIRecord *fir;
- fir = camel_imapx_summary_parent->summary_header_to_db (s, ex);
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ fir = folder_summary_class->summary_header_to_db (s, ex);
if (!fir)
return NULL;
fir->bdata = g_strdup_printf ("%d %u", CAMEL_IMAPX_SUMMARY_VERSION, ims->validity);
@@ -293,8 +285,12 @@ static gint
summary_header_save (CamelFolderSummary *s, FILE *out)
{
CamelIMAPXSummary *ims = CAMEL_IMAPX_SUMMARY(s);
+ CamelFolderSummaryClass *folder_summary_class;
- if (camel_imapx_summary_parent->summary_header_save (s, out) == -1)
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ if (folder_summary_class->summary_header_save (s, out) == -1)
return -1;
camel_file_util_encode_fixed_int32(out, CAMEL_IMAPX_SUMMARY_VERSION);
@@ -307,8 +303,12 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
{
CamelMessageInfo *info;
CamelIMAPXMessageInfo *iinfo;
+ CamelFolderSummaryClass *folder_summary_class;
+
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
- info = camel_imapx_summary_parent->message_info_from_db (s, mir);
+ info = folder_summary_class->message_info_from_db (s, mir);
if (info) {
gchar *part = g_strdup (mir->bdata), *tmp;
tmp = part;
@@ -325,8 +325,12 @@ message_info_load (CamelFolderSummary *s, FILE *in)
{
CamelMessageInfo *info;
CamelIMAPXMessageInfo *iinfo;
+ CamelFolderSummaryClass *folder_summary_class;
- info = camel_imapx_summary_parent->message_info_load (s, in);
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ info = folder_summary_class->message_info_load (s, in);
if (info) {
iinfo = (CamelIMAPXMessageInfo *)info;
@@ -344,9 +348,13 @@ static CamelMIRecord *
message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
{
CamelIMAPXMessageInfo *iinfo = (CamelIMAPXMessageInfo *)info;
+ CamelFolderSummaryClass *folder_summary_class;
struct _CamelMIRecord *mir;
- mir = camel_imapx_summary_parent->message_info_to_db (s, info);
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ mir = folder_summary_class->message_info_to_db (s, info);
if (mir)
mir->bdata = g_strdup_printf ("%u", iinfo->server_flags);
@@ -357,8 +365,12 @@ static gint
message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
{
CamelIMAPXMessageInfo *iinfo = (CamelIMAPXMessageInfo *)info;
+ CamelFolderSummaryClass *folder_summary_class;
- if (camel_imapx_summary_parent->message_info_save (s, out, info) == -1)
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ if (folder_summary_class->message_info_save (s, out, info) == -1)
return -1;
return camel_file_util_encode_uint32 (out, iinfo->server_flags);
@@ -367,9 +379,13 @@ message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
static gboolean
info_set_user_flag (CamelMessageInfo *info, const gchar *id, gboolean state)
{
+ CamelFolderSummaryClass *folder_summary_class;
gboolean res;
- res = camel_imapx_summary_parent->info_set_user_flag (info, id, state);
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
+ res = folder_summary_class->info_set_user_flag (info, id, state);
/* there was a change, so do not forget to store it to server */
if (res)
@@ -381,9 +397,13 @@ info_set_user_flag (CamelMessageInfo *info, const gchar *id, gboolean state)
static CamelMessageContentInfo *
content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
{
+ CamelFolderSummaryClass *folder_summary_class;
gchar *part = mir->cinfo;
guint32 type=0;
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
if (part) {
if (*part == ' ')
part++;
@@ -393,7 +413,7 @@ content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
}
mir->cinfo = part;
if (type)
- return camel_imapx_summary_parent->content_info_from_db (s, mir);
+ return folder_summary_class->content_info_from_db (s, mir);
else
return camel_folder_summary_content_info_new (s);
}
@@ -401,8 +421,13 @@ content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
static CamelMessageContentInfo *
content_info_load (CamelFolderSummary *s, FILE *in)
{
+ CamelFolderSummaryClass *folder_summary_class;
+
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
if (fgetc (in))
- return camel_imapx_summary_parent->content_info_load (s, in);
+ return folder_summary_class->content_info_load (s, in);
else
return camel_folder_summary_content_info_new (s);
}
@@ -410,12 +435,17 @@ content_info_load (CamelFolderSummary *s, FILE *in)
static gint
content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir)
{
+ CamelFolderSummaryClass *folder_summary_class;
gchar *oldr;
+
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
if (info->type) {
oldr = mir->cinfo;
mir->cinfo = oldr ? g_strdup_printf("%s 1", oldr) : g_strdup ("1");
g_free(oldr);
- return camel_imapx_summary_parent->content_info_to_db (s, info, mir);
+ return folder_summary_class->content_info_to_db (s, info, mir);
} else {
oldr = mir->cinfo;
mir->cinfo = oldr ? g_strdup_printf("%s 0", oldr) : g_strdup ("0");
@@ -428,9 +458,14 @@ static gint
content_info_save (CamelFolderSummary *s, FILE *out,
CamelMessageContentInfo *info)
{
+ CamelFolderSummaryClass *folder_summary_class;
+
+ folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
+ camel_imapx_summary_parent_class);
+
if (info->type) {
fputc (1, out);
- return camel_imapx_summary_parent->content_info_save (s, out, info);
+ return folder_summary_class->content_info_save (s, out, info);
} else
return fputc (0, out);
}
diff --git a/camel/providers/imapx/camel-imapx-summary.h b/camel/providers/imapx/camel-imapx-summary.h
index e78651f..e37772c 100644
--- a/camel/providers/imapx/camel-imapx-summary.h
+++ b/camel/providers/imapx/camel-imapx-summary.h
@@ -25,32 +25,48 @@
#include <camel/camel.h>
-#define CAMEL_IMAPX_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imapx_summary_get_type (), CamelIMAPXSummary)
-#define CAMEL_IMAPX_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapx_summary_get_type (), CamelIMAPXSummaryClass)
-#define CAMEL_IS_IMAPX_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imapx_summary_get_type ())
-
-#define CAMEL_IMAPX_SERVER_FLAGS (CAMEL_MESSAGE_ANSWERED | \
- CAMEL_MESSAGE_DELETED | \
- CAMEL_MESSAGE_DRAFT | \
- CAMEL_MESSAGE_FLAGGED | \
- CAMEL_MESSAGE_SEEN)
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAPX_SUMMARY \
+ (camel_imapx_summary_get_type ())
+#define CAMEL_IMAPX_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAPX_SUMMARY, CamelIMAPXSummary))
+#define CAMEL_IMAPX_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAPX_SUMMARY, CamelIMAPXSummaryClass))
+#define CAMEL_IS_IMAPX_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAPX_SUMMARY))
+#define CAMEL_IS_IMAPX_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAPX_SUMMARY))
+#define CAMEL_IMAPX_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAPX_SUMMARY, CamelIMAPXSummaryClass))
+
+#define CAMEL_IMAPX_SERVER_FLAGS \
+ (CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED | \
+ CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | \
+ CAMEL_MESSAGE_SEEN)
G_BEGIN_DECLS
-typedef struct _CamelIMAPXSummaryClass CamelIMAPXSummaryClass;
typedef struct _CamelIMAPXSummary CamelIMAPXSummary;
+typedef struct _CamelIMAPXSummaryClass CamelIMAPXSummaryClass;
-typedef struct _CamelIMAPXMessageContentInfo {
- CamelMessageContentInfo info;
+typedef struct _CamelIMAPXMessageInfo CamelIMAPXMessageInfo;
+typedef struct _CamelIMAPXMessageContentInfo CamelIMAPXMessageContentInfo;
-} CamelIMAPXMessageContentInfo;
+struct _CamelIMAPXMessageContentInfo {
+ CamelMessageContentInfo info;
+};
-typedef struct _CamelIMAPXMessageInfo {
+struct _CamelIMAPXMessageInfo {
CamelMessageInfoBase info;
guint32 server_flags;
- struct _CamelFlag *server_user_flags;
-} CamelIMAPXMessageInfo;
+ CamelFlag *server_user_flags;
+};
struct _CamelIMAPXSummary {
CamelFolderSummary parent;
@@ -61,20 +77,20 @@ struct _CamelIMAPXSummary {
struct _CamelIMAPXSummaryClass {
CamelFolderSummaryClass parent_class;
-
};
-CamelType camel_imapx_summary_get_type (void);
-CamelFolderSummary *camel_imapx_summary_new (struct _CamelFolder *folder, const gchar *filename);
-
-void camel_imapx_summary_add_offline (CamelFolderSummary *summary,
- const gchar *uid,
- CamelMimeMessage *message,
- const CamelMessageInfo *info);
-
-void camel_imapx_summary_add_offline_uncached (CamelFolderSummary *summary,
- const gchar *uid,
- const CamelMessageInfo *info);
+GType camel_imapx_summary_get_type (void);
+CamelFolderSummary *
+ camel_imapx_summary_new (CamelFolder *folder,
+ const gchar *filename);
+void camel_imapx_summary_add_offline (CamelFolderSummary *summary,
+ const gchar *uid,
+ CamelMimeMessage *message,
+ const CamelMessageInfo *info);
+void camel_imapx_summary_add_offline_uncached
+ (CamelFolderSummary *summary,
+ const gchar *uid,
+ const CamelMessageInfo *info);
G_END_DECLS
diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
index f43f75c..569ceab 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -1281,11 +1281,11 @@ imapx_free_fetch(struct _fetch_info *finfo)
return;
if (finfo->body)
- camel_object_unref (finfo->body);
+ g_object_unref (finfo->body);
if (finfo->text)
- camel_object_unref (finfo->text);
+ g_object_unref (finfo->text);
if (finfo->header)
- camel_object_unref (finfo->header);
+ g_object_unref (finfo->header);
if (finfo->minfo)
camel_message_info_free(finfo->minfo);
if (finfo->cinfo)
@@ -1347,7 +1347,7 @@ imapx_dump_fetch(struct _fetch_info *finfo)
camel_stream_printf(sout, "Section: '%s'\n", finfo->section);
if (finfo->date)
camel_stream_printf(sout, "UID: '%s'\n", finfo->uid);
- camel_object_unref (sout);
+ g_object_unref (sout);
}
struct _fetch_info *
diff --git a/camel/providers/imapx/camel-imapx-view-summary.h b/camel/providers/imapx/camel-imapx-view-summary.h
index 53917c4..dfb05a5 100644
--- a/camel/providers/imapx/camel-imapx-view-summary.h
+++ b/camel/providers/imapx/camel-imapx-view-summary.h
@@ -23,7 +23,28 @@
#include "camel-view-summary-disk.h"
-typedef struct _CamelIMAPXViewSummary CamelIMAPXViewSummary;
+/* Standard GObject macros */
+#define CAMEL_TYPE_IMAPX_VIEW_SUMMARY \
+ (camel_imapx_view_summary_get_type ())
+#define CAMEL_IMAPX_VIEW_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_IMAPX_VIEW_SUMMARY, CamelIMAPXViewSummary))
+#define CAMEL_IMAPX_VIEW_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_IMAPX_VIEW_SUMMARY, CamelIMAPXViewSummaryClass))
+#define CAMEL_IS_IMAPX_VIEW_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_IMAPX_VIEW_SUMMARY))
+#define CAMEL_IS_IMAPX_VIEW_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_IMAPX_VIEW_SUMMARY))
+#define CAMEL_IMAPX_VIEW_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_IMAPX_VIEW_SUMMARY, CamelIMAPXViewSummaryClass))
+
+G_BEGIN_DECLS
+
+typedef struct _CamelIMAPXViewSummary CamelIMAPXViewSummary;
typedef struct _CamelIMAPXViewSummaryClass CamelIMAPXViewSummaryClass;
enum {
@@ -52,12 +73,17 @@ struct _CamelIMAPXViewSummaryClass {
CamelViewSummaryDiskClass parent_class;
};
-CamelType camel_imapx_view_summary_get_type (void);
-CamelIMAPXViewSummary *camel_imapx_view_summary_new (const gchar *base, CamelException *ex);
+GType camel_imapx_view_summary_get_type (void);
+CamelIMAPXViewSummary *
+ camel_imapx_view_summary_new (const gchar *base,
+ CamelException *ex);
/* called on root view */
-guint32 camel_imapx_view_next_uid(CamelIMAPXView *view);
-void camel_imapx_view_last_uid(CamelIMAPXView *view, guint32 uid);
+guint32 camel_imapx_view_next_uid (CamelIMAPXView *view);
+void camel_imapx_view_last_uid (CamelIMAPXView *view,
+ guint32 uid);
+
+G_END_DECLS
#endif /* CAMEL_IMAPX_VIEW_SUMMARY_H */
diff --git a/camel/providers/imapx/test-imapx.c b/camel/providers/imapx/test-imapx.c
index cc2df88..eacaaef 100644
--- a/camel/providers/imapx/test-imapx.c
+++ b/camel/providers/imapx/test-imapx.c
@@ -24,7 +24,7 @@ main (gint argc, gchar *argv [])
camel_provider_init ();
ex = camel_exception_new ();
- session = CAMEL_SESSION (camel_object_new (CAMEL_SESSION_TYPE));
+ session = g_object_new (CAMEL_TYPE_SESSION, NULL);
camel_session_construct (session, "/tmp/test-camel-imapx");
service = camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, ex);
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index c039f3c..d9f903c 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -51,7 +51,10 @@
#define PATH_MAX _POSIX_PATH_MAX
#endif
-static gpointer camel_local_folder_parent_class;
+#define CAMEL_LOCAL_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_LOCAL_FOLDER, CamelLocalFolderPrivate))
+
static GSList *local_folder_properties;
static gint local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
@@ -78,27 +81,48 @@ static CamelProperty local_property_list[] = {
{ CAMEL_LOCAL_FOLDER_INDEX_BODY, "index_body", N_("Index message body data") },
};
+G_DEFINE_TYPE (CamelLocalFolder, camel_local_folder, CAMEL_TYPE_FOLDER)
+
static void
-local_folder_finalize (CamelLocalFolder *local_folder)
+local_folder_dispose (GObject *object)
{
- CamelFolder *folder = CAMEL_FOLDER (local_folder);
+ CamelFolder *folder;
+ CamelLocalFolder *local_folder;
+
+ folder = CAMEL_FOLDER (object);
+ local_folder = CAMEL_LOCAL_FOLDER (object);
- if (folder->summary) {
+ if (folder->summary != NULL) {
camel_local_summary_sync (
CAMEL_LOCAL_SUMMARY (folder->summary),
FALSE, local_folder->changes, NULL);
- camel_object_unref (folder->summary);
+ g_object_unref (folder->summary);
folder->summary = NULL;
}
- if (local_folder->search)
- camel_object_unref (local_folder->search);
+ if (local_folder->search != NULL) {
+ g_object_unref (local_folder->search);
+ local_folder->search = NULL;
+ }
- if (local_folder->index)
- camel_object_unref (local_folder->index);
+ if (local_folder->index != NULL) {
+ g_object_unref (local_folder->index);
+ local_folder->index = NULL;
+ }
- while (local_folder->locked> 0)
- camel_local_folder_unlock(local_folder);
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_local_folder_parent_class)->dispose (object);
+}
+
+static void
+local_folder_finalize (GObject *object)
+{
+ CamelLocalFolder *local_folder;
+
+ local_folder = CAMEL_LOCAL_FOLDER (object);
+
+ while (local_folder->locked > 0)
+ camel_local_folder_unlock (local_folder);
g_free (local_folder->base_path);
g_free (local_folder->folder_path);
@@ -109,17 +133,23 @@ local_folder_finalize (CamelLocalFolder *local_folder)
g_mutex_free (local_folder->priv->search_lock);
- g_free (local_folder->priv);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_local_folder_parent_class)->finalize (object);
}
static void
camel_local_folder_class_init (CamelLocalFolderClass *class)
{
+ GObjectClass *object_class;
CamelObjectClass *camel_object_class;
CamelFolderClass *folder_class;
gint ii;
- camel_local_folder_parent_class = (CamelFolderClass *)camel_folder_get_type();
+ g_type_class_add_private (class, sizeof (CamelLocalFolderPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = local_folder_dispose;
+ object_class->finalize = local_folder_finalize;
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = local_getv;
@@ -153,7 +183,7 @@ camel_local_folder_init (CamelLocalFolder *local_folder)
{
CamelFolder *folder = CAMEL_FOLDER (local_folder);
- local_folder->priv = g_new0 (CamelLocalFolderPrivate, 1);
+ local_folder->priv = CAMEL_LOCAL_FOLDER_GET_PRIVATE (local_folder);
local_folder->priv->search_lock = g_mutex_new();
folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
@@ -168,24 +198,6 @@ camel_local_folder_init (CamelLocalFolder *local_folder)
local_folder->search = NULL;
}
-CamelType
-camel_local_folder_get_type(void)
-{
- static CamelType camel_local_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_local_folder_type == CAMEL_INVALID_TYPE) {
- camel_local_folder_type = camel_type_register(camel_folder_get_type(), "CamelLocalFolder",
- sizeof(CamelLocalFolder),
- sizeof(CamelLocalFolderClass),
- (CamelObjectClassInitFunc) camel_local_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_local_folder_init,
- (CamelObjectFinalizeFunc) local_folder_finalize);
- }
-
- return camel_local_folder_type;
-}
-
CamelLocalFolder *
camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex)
{
@@ -278,7 +290,7 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
if (camel_local_summary_check((CamelLocalSummary *)folder->summary, lf->changes, ex) == 0) {
/* we sync here so that any hard work setting up the folder isn't lost */
if (camel_local_summary_sync((CamelLocalSummary *)folder->summary, FALSE, lf->changes, ex) == -1) {
- camel_object_unref (CAMEL_OBJECT (folder));
+ g_object_unref (CAMEL_OBJECT (folder));
g_free(name);
return NULL;
}
@@ -290,7 +302,7 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
/*if (camel_local_summary_check((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1) {*/
/* we sync here so that any hard work setting up the folder isn't lost */
/*if (camel_local_summary_sync((CamelLocalSummary *)folder->summary, FALSE, lf->changes, ex) == -1) {
- camel_object_unref (CAMEL_OBJECT (folder));
+ g_object_unref (CAMEL_OBJECT (folder));
g_free(name);
return NULL;
}*/
diff --git a/camel/providers/local/camel-local-folder.h b/camel/providers/local/camel-local-folder.h
index 84e379e..4314854 100644
--- a/camel/providers/local/camel-local-folder.h
+++ b/camel/providers/local/camel-local-folder.h
@@ -26,12 +26,24 @@
#include "camel-local-summary.h"
-#define CAMEL_LOCAL_FOLDER_TYPE (camel_local_folder_get_type ())
-#define CAMEL_LOCAL_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_LOCAL_FOLDER_TYPE, CamelLocalFolder))
-#define CAMEL_LOCAL_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_LOCAL_FOLDER_TYPE, CamelLocalFolderClass))
-#define CAMEL_IS_LOCAL_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_LOCAL_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_LOCAL_FOLDER \
+ (camel_local_folder_get_type ())
+#define CAMEL_LOCAL_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_LOCAL_FOLDER, CamelLocalFolder))
+#define CAMEL_LOCAL_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_LOCAL_FOLDER, CamelLocalFolderClass))
+#define CAMEL_IS_LOCAL_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_LOCAL_FOLDER))
+#define CAMEL_IS_LOCAL_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_LOCAL_FOLDER))
#define CAMEL_LOCAL_FOLDER_GET_CLASS(obj) \
- ((CamelLocalFolderClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_LOCAL_FOLDER, CamelLocalFolderClass))
G_BEGIN_DECLS
@@ -88,8 +100,7 @@ struct _CamelLocalFolderClass {
CamelLocalFolder *camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store,
const gchar *full_name, guint32 flags, CamelException *ex);
-/* Standard Camel function */
-CamelType camel_local_folder_get_type(void);
+GType camel_local_folder_get_type(void);
/* Lock the folder for internal use. May be called repeatedly */
/* UNIMPLEMENTED */
diff --git a/camel/providers/local/camel-local-provider.c b/camel/providers/local/camel-local-provider.c
index d364f11..c853d84 100644
--- a/camel/providers/local/camel-local-provider.c
+++ b/camel/providers/local/camel-local-provider.c
@@ -235,7 +235,7 @@ camel_provider_module_init(void)
#else
mbox_conf_entries[0].value = ""; /* default path */
#endif
- mbox_provider.object_types[CAMEL_PROVIDER_STORE] = CAMEL_MBOX_STORE_TYPE;
+ mbox_provider.object_types[CAMEL_PROVIDER_STORE] = CAMEL_TYPE_MBOX_STORE;
mbox_provider.url_hash = local_url_hash;
mbox_provider.url_equal = local_url_equal;
mbox_provider.translation_domain = GETTEXT_PACKAGE;
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index 75963a5..072407c 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -52,21 +52,28 @@ static gboolean local_can_refresh_folder (CamelStore *store, CamelFolderInfo *in
static gchar *local_get_full_path(CamelLocalStore *lf, const gchar *full_name);
static gchar *local_get_meta_path(CamelLocalStore *lf, const gchar *full_name, const gchar *ext);
-static gpointer camel_local_store_parent_class;
+G_DEFINE_TYPE (CamelLocalStore, camel_local_store, CAMEL_TYPE_STORE)
static void
-local_store_finalize (CamelLocalStore *local_store)
+local_store_finalize (GObject *object)
{
+ CamelLocalStore *local_store = CAMEL_LOCAL_STORE (object);
+
g_free (local_store->toplevel_dir);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_local_store_parent_class)->finalize (object);
}
static void
camel_local_store_class_init (CamelLocalStoreClass *class)
{
+ GObjectClass *object_class;
CamelServiceClass *service_class;
CamelStoreClass *store_class;
- camel_local_store_parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = local_store_finalize;
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = construct;
@@ -88,22 +95,9 @@ camel_local_store_class_init (CamelLocalStoreClass *class)
class->get_meta_path = local_get_meta_path;
}
-CamelType
-camel_local_store_get_type (void)
+static void
+camel_local_store_init (CamelLocalStore *local_store)
{
- 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),
- sizeof (CamelLocalStoreClass),
- (CamelObjectClassInitFunc) camel_local_store_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) local_store_finalize);
- }
-
- return camel_local_store_type;
}
static gboolean
@@ -307,7 +301,7 @@ create_folder (CamelStore *store,
folder = CAMEL_STORE_GET_CLASS (store)->get_folder (
store, name, CAMEL_STORE_FOLDER_CREATE, ex);
if (folder) {
- camel_object_unref (folder);
+ g_object_unref (folder);
info = CAMEL_STORE_GET_CLASS (store)->get_folder_info (
store, name, 0, ex);
@@ -406,7 +400,7 @@ rename_folder(CamelStore *store,
g_free(oldibex);
if (folder)
- camel_object_unref (folder);
+ g_object_unref (folder);
return TRUE;
@@ -434,7 +428,7 @@ ibex_failed:
g_free(oldibex);
if (folder)
- camel_object_unref (folder);
+ g_object_unref (folder);
return FALSE;
}
@@ -470,7 +464,7 @@ delete_folder (CamelStore *store,
if ((lf = camel_store_get_folder (store, folder_name, 0, &lex))) {
camel_object_get (lf, NULL, CAMEL_OBJECT_STATE_FILE, &str, NULL);
camel_object_set (lf, NULL, CAMEL_OBJECT_STATE_FILE, NULL, NULL);
- camel_object_unref (lf);
+ g_object_unref (lf);
} else {
camel_exception_clear (&lex);
}
diff --git a/camel/providers/local/camel-local-store.h b/camel/providers/local/camel-local-store.h
index 35317ec..93f66c0 100644
--- a/camel/providers/local/camel-local-store.h
+++ b/camel/providers/local/camel-local-store.h
@@ -25,12 +25,24 @@
#include <camel/camel.h>
-#define CAMEL_LOCAL_STORE_TYPE (camel_local_store_get_type ())
-#define CAMEL_LOCAL_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_LOCAL_STORE_TYPE, CamelLocalStore))
-#define CAMEL_LOCAL_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_LOCAL_STORE_TYPE, CamelLocalStoreClass))
-#define CAMEL_IS_LOCAL_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_LOCAL_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_LOCAL_STORE \
+ (camel_local_store_get_type ())
+#define CAMEL_LOCAL_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_LOCAL_STORE, CamelLocalStore))
+#define CAMEL_LOCAL_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_LOCAL_STORE, CamelLocalStoreClass))
+#define CAMEL_IS_LOCAL_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_LOCAL_STORE))
+#define CAMEL_IS_LOCAL_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_LOCAL_STORE))
#define CAMEL_LOCAL_STORE_GET_CLASS(obj) \
- ((CamelLocalStoreClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_LOCAL_STORE, CamelLocalStoreClass))
G_BEGIN_DECLS
@@ -50,7 +62,7 @@ struct _CamelLocalStoreClass {
gchar *(*get_meta_path)(CamelLocalStore *ls, const gchar *full_name, const gchar *ext);
};
-CamelType camel_local_store_get_type (void);
+GType camel_local_store_get_type (void);
const gchar *camel_local_store_get_toplevel_dir (CamelLocalStore *store);
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index 77af97a..8cf829b 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -60,22 +60,46 @@ static gint local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFo
static CamelMessageInfo *local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
static gint local_summary_need_index(void);
-static gpointer camel_local_summary_parent_class;
+G_DEFINE_TYPE (CamelLocalSummary, camel_local_summary, CAMEL_TYPE_FOLDER_SUMMARY)
static void
-local_summary_finalize (CamelLocalSummary *local_summary)
+local_summary_dispose (GObject *object)
{
- if (local_summary->index)
- camel_object_unref (local_summary->index);
+ CamelLocalSummary *local_summary;
+
+ local_summary = CAMEL_LOCAL_SUMMARY (object);
+
+ if (local_summary->index != NULL) {
+ g_object_unref (local_summary->index);
+ local_summary->index = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_local_summary_parent_class)->dispose (object);
+}
+
+static void
+local_summary_finalize (GObject *object)
+{
+ CamelLocalSummary *local_summary;
+
+ local_summary = CAMEL_LOCAL_SUMMARY (object);
+
g_free (local_summary->folder_path);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_local_summary_parent_class)->finalize (object);
}
static void
camel_local_summary_class_init (CamelLocalSummaryClass *class)
{
+ GObjectClass *object_class;
CamelFolderSummaryClass *folder_summary_class;
- camel_local_summary_parent_class = CAMEL_FOLDER_SUMMARY_CLASS(camel_type_get_global_classfuncs(camel_folder_summary_get_type()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = local_summary_dispose;
+ object_class->finalize = local_summary_finalize;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
folder_summary_class->message_info_size = sizeof (CamelLocalMessageInfo);
@@ -106,24 +130,6 @@ camel_local_summary_init (CamelLocalSummary *local_summary)
folder_summary->version += CAMEL_LOCAL_SUMMARY_VERSION;
}
-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),
- sizeof (CamelLocalSummaryClass),
- (CamelObjectClassInitFunc) camel_local_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_local_summary_init,
- (CamelObjectFinalizeFunc) local_summary_finalize);
- }
-
- return type;
-}
-
void
camel_local_summary_construct(CamelLocalSummary *new, const gchar *filename, const gchar *local_name, CamelIndex *index)
{
@@ -132,7 +138,7 @@ camel_local_summary_construct(CamelLocalSummary *new, const gchar *filename, con
new->folder_path = g_strdup(local_name);
new->index = index;
if (index)
- camel_object_ref (index);
+ g_object_ref (index);
}
static gint
@@ -516,7 +522,7 @@ local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMess
camel_data_wrapper_write_to_stream((CamelDataWrapper *)msg, (CamelStream *)sn);
mi->info.size = sn->written;
- camel_object_unref (sn);
+ g_object_unref (sn);
}
mi->info.flags &= ~(CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_FLAGGED);
diff --git a/camel/providers/local/camel-local-summary.h b/camel/providers/local/camel-local-summary.h
index 002c15f..204ff1c 100644
--- a/camel/providers/local/camel-local-summary.h
+++ b/camel/providers/local/camel-local-summary.h
@@ -23,11 +23,24 @@
#include <camel/camel.h>
-#define CAMEL_LOCAL_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_local_summary_get_type (), CamelLocalSummary)
-#define CAMEL_LOCAL_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_local_summary_get_type (), CamelLocalSummaryClass)
-#define CAMEL_IS_LOCAL_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_local_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_LOCAL_SUMMARY \
+ (camel_local_summary_get_type ())
+#define CAMEL_LOCAL_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_LOCAL_SUMMARY, CamelLocalSummary))
+#define CAMEL_LOCAL_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_LOCAL_SUMMARY, CamelLocalSummaryClass))
+#define CAMEL_IS_LOCAL_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_LOCAL_SUMMARY))
+#define CAMEL_IS_LOCAL_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_LOCAL_SUMMARY))
#define CAMEL_LOCAL_SUMMARY_GET_CLASS(obj) \
- ((CamelLocalSummaryClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_LOCAL_SUMMARY, CamelLocalSummaryClass))
G_BEGIN_DECLS
@@ -72,7 +85,7 @@ struct _CamelLocalSummaryClass {
gint (*need_index)(void);
};
-CamelType camel_local_summary_get_type (void);
+GType camel_local_summary_get_type (void);
void camel_local_summary_construct (CamelLocalSummary *new, const gchar *filename, const gchar *local_name, CamelIndex *index);
/* load/check the summary */
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index 59a5b59..ce6efe0 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -41,8 +41,6 @@
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-static gpointer camel_maildir_folder_parent_class;
-
static CamelLocalSummary *maildir_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index);
static gboolean maildir_append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, gchar **appended_uid, CamelException * ex);
@@ -52,6 +50,8 @@ static gint maildir_cmp_uids (CamelFolder *folder, const gchar *uid1, const gcha
static void maildir_sort_uids (CamelFolder *folder, GPtrArray *uids);
static gboolean maildir_transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *dest, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex);
+G_DEFINE_TYPE (CamelMaildirFolder, camel_maildir_folder, CAMEL_TYPE_LOCAL_FOLDER)
+
static gint
maildir_folder_getv (CamelObject *object,
CamelException *ex,
@@ -90,8 +90,6 @@ camel_maildir_folder_class_init (CamelMaildirFolderClass *class)
CamelFolderClass *folder_class;
CamelLocalFolderClass *local_folder_class;
- camel_maildir_folder_parent_class = CAMEL_LOCAL_FOLDER_CLASS (camel_type_get_global_classfuncs(camel_local_folder_get_type()));
-
camel_object_class = CAMEL_OBJECT_CLASS (class);
camel_object_class->getv = maildir_folder_getv;
@@ -112,24 +110,6 @@ camel_maildir_folder_init (CamelMaildirFolder *maildir_folder)
{
}
-CamelType
-camel_maildir_folder_get_type(void)
-{
- static CamelType camel_maildir_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_maildir_folder_type == CAMEL_INVALID_TYPE) {
- camel_maildir_folder_type = camel_type_register(CAMEL_LOCAL_FOLDER_TYPE, "CamelMaildirFolder",
- sizeof(CamelMaildirFolder),
- sizeof(CamelMaildirFolderClass),
- (CamelObjectClassInitFunc) camel_maildir_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_maildir_folder_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return camel_maildir_folder_type;
-}
-
CamelFolder *
camel_maildir_folder_new (CamelStore *parent_store,
const gchar *full_name,
@@ -140,7 +120,7 @@ camel_maildir_folder_new (CamelStore *parent_store,
d(printf("Creating maildir folder: %s\n", full_name));
- folder = (CamelFolder *)camel_object_new(CAMEL_MAILDIR_FOLDER_TYPE);
+ folder = g_object_new (CAMEL_TYPE_MAILDIR_FOLDER, NULL);
if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
&& strcmp(full_name, ".") == 0)
@@ -220,7 +200,7 @@ maildir_append_message (CamelFolder *folder,
*appended_uid = g_strdup(camel_message_info_uid(mi));
if (output_stream)
- camel_object_unref (output_stream);
+ g_object_unref (output_stream);
goto check_changed;
@@ -241,7 +221,7 @@ maildir_append_message (CamelFolder *folder,
name, g_strerror (errno));
if (output_stream) {
- camel_object_unref (CAMEL_OBJECT (output_stream));
+ g_object_unref (CAMEL_OBJECT (output_stream));
unlink (name);
}
@@ -329,11 +309,11 @@ maildir_get_message (CamelFolder *folder,
ex, (errno==EINTR) ?
CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
uid, lf->folder_path, _("Invalid message contents"));
- camel_object_unref (message);
+ g_object_unref (message);
message = NULL;
}
- camel_object_unref (message_stream);
+ g_object_unref (message_stream);
fail:
g_free (name);
diff --git a/camel/providers/local/camel-maildir-folder.h b/camel/providers/local/camel-maildir-folder.h
index b85cfc7..2165756 100644
--- a/camel/providers/local/camel-maildir-folder.h
+++ b/camel/providers/local/camel-maildir-folder.h
@@ -25,10 +25,24 @@
#include "camel-local-folder.h"
-#define CAMEL_MAILDIR_FOLDER_TYPE (camel_maildir_folder_get_type ())
-#define CAMEL_MAILDIR_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MAILDIR_FOLDER_TYPE, CamelMaildirFolder))
-#define CAMEL_MAILDIR_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MAILDIR_FOLDER_TYPE, CamelMaildirFolderClass))
-#define CAMEL_IS_MAILDIR_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_MAILDIR_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MAILDIR_FOLDER \
+ (camel_maildir_folder_get_type ())
+#define CAMEL_MAILDIR_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MAILDIR_FOLDER, CamelMaildirFolder))
+#define CAMEL_MAILDIR_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MAILDIR_FOLDER, CamelMaildirFolderClass))
+#define CAMEL_IS_MAILDIR_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MAILDIR_FOLDER))
+#define CAMEL_IS_MAILDIR_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MAILDIR_FOLDER))
+#define CAMEL_MAILDIR_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MAILDIR_FOLDER, CamelMaildirFolderClass))
G_BEGIN_DECLS
@@ -46,7 +60,7 @@ struct _CamelMaildirFolderClass {
/* public methods */
CamelFolder *camel_maildir_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex);
-CamelType camel_maildir_folder_get_type(void);
+GType camel_maildir_folder_get_type(void);
G_END_DECLS
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index 7995400..b0859e3 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -38,8 +38,6 @@
#define d(x)
-static gpointer camel_maildir_store_parent_class;
-
static CamelFolder *get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex);
static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
static gboolean delete_folder(CamelStore * store, const gchar *folder_name, CamelException * ex);
@@ -50,13 +48,13 @@ static CamelFolderInfo * get_folder_info (CamelStore *store, const gchar *top, g
static gboolean maildir_compare_folder_name(gconstpointer a, gconstpointer b);
static guint maildir_hash_folder_name(gconstpointer a);
+G_DEFINE_TYPE (CamelMaildirStore, camel_maildir_store, CAMEL_TYPE_LOCAL_STORE)
+
static void
camel_maildir_store_class_init (CamelMaildirStoreClass *class)
{
CamelStoreClass *store_class;
- camel_maildir_store_parent_class = (CamelLocalStoreClass *)camel_type_get_global_classfuncs(camel_local_store_get_type());
-
store_class = CAMEL_STORE_CLASS (class);
store_class->hash_folder_name = maildir_hash_folder_name;
store_class->compare_folder_name = maildir_compare_folder_name;
@@ -68,22 +66,9 @@ camel_maildir_store_class_init (CamelMaildirStoreClass *class)
store_class->free_folder_info = camel_store_free_folder_info_full;
}
-CamelType
-camel_maildir_store_get_type(void)
+static void
+camel_maildir_store_init (CamelMaildirStore *maildir_store)
{
- static CamelType camel_maildir_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_maildir_store_type == CAMEL_INVALID_TYPE) {
- camel_maildir_store_type = camel_type_register(CAMEL_LOCAL_STORE_TYPE, "CamelMaildirStore",
- sizeof(CamelMaildirStore),
- sizeof(CamelMaildirStoreClass),
- (CamelObjectClassInitFunc) camel_maildir_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_maildir_store_type;
}
/* This fixes up some historical cruft of names starting with "./" */
@@ -345,7 +330,7 @@ fill_fi (CamelStore *store,
camel_folder_refresh_info(folder, NULL);
fi->unread = camel_folder_get_unread_message_count(folder);
fi->total = camel_folder_get_message_count(folder);
- camel_object_unref (folder);
+ g_object_unref (folder);
} else {
gchar *path, *folderpath;
CamelFolderSummary *s;
@@ -360,7 +345,7 @@ fill_fi (CamelStore *store,
fi->unread = s->unread_count;
fi->total = s->saved_count;
}
- camel_object_unref (s);
+ g_object_unref (s);
g_free(folderpath);
g_free(path);
}
diff --git a/camel/providers/local/camel-maildir-store.h b/camel/providers/local/camel-maildir-store.h
index b652f1c..b62a90c 100644
--- a/camel/providers/local/camel-maildir-store.h
+++ b/camel/providers/local/camel-maildir-store.h
@@ -24,10 +24,24 @@
#include "camel-local-store.h"
-#define CAMEL_MAILDIR_STORE_TYPE (camel_maildir_store_get_type ())
-#define CAMEL_MAILDIR_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MAILDIR_STORE_TYPE, CamelMaildirStore))
-#define CAMEL_MAILDIR_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MAILDIR_STORE_TYPE, CamelMaildirStoreClass))
-#define CAMEL_IS_MAILDIR_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_MAILDIR_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MAILDIR_STORE \
+ (camel_maildir_store_get_type ())
+#define CAMEL_MAILDIR_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MAILDIR_STORE, CamelMaildirStore))
+#define CAMEL_MAILDIR_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MAILDIR_STORE, CamelMaildirStoreClass))
+#define CAMEL_IS_MAILDIR_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MAILDIR_STORE))
+#define CAMEL_IS_MAILDIR_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MAILDIR_STORE))
+#define CAMEL_MAILDIR_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MAILDIR_STORE, CamelMaildirStoreClass))
G_BEGIN_DECLS
@@ -42,7 +56,7 @@ struct _CamelMaildirStoreClass {
CamelLocalStoreClass parent_class;
};
-CamelType camel_maildir_store_get_type(void);
+GType camel_maildir_store_get_type(void);
G_END_DECLS
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index 88b6828..de0b659 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -41,6 +41,10 @@
#define CAMEL_MAILDIR_SUMMARY_VERSION (0x2000)
+#define CAMEL_MAILDIR_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MAILDIR_SUMMARY, CamelMaildirSummaryPrivate))
+
static CamelMessageInfo *message_info_load(CamelFolderSummary *s, FILE *in);
static CamelMessageInfo *message_info_new_from_header(CamelFolderSummary *, struct _camel_header_raw *);
static void message_info_free(CamelFolderSummary *, CamelMessageInfo *mi);
@@ -62,23 +66,33 @@ struct _CamelMaildirSummaryPrivate {
GMutex *summary_lock;
};
-static gpointer camel_maildir_summary_parent_class;
+G_DEFINE_TYPE (CamelMaildirSummary, camel_maildir_summary, CAMEL_TYPE_LOCAL_SUMMARY)
static void
-maildir_summary_finalize (CamelMaildirSummary *summary)
+maildir_summary_finalize (GObject *object)
{
- g_free (summary->priv->hostname);
- g_mutex_free (summary->priv->summary_lock);
- g_free (summary->priv);
+ CamelMaildirSummaryPrivate *priv;
+
+ priv = CAMEL_MAILDIR_SUMMARY_GET_PRIVATE (object);
+
+ g_free (priv->hostname);
+ g_mutex_free (priv->summary_lock);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_maildir_summary_parent_class)->finalize (object);
}
static void
camel_maildir_summary_class_init (CamelMaildirSummaryClass *class)
{
+ GObjectClass *object_class;
CamelFolderSummaryClass *folder_summary_class;
CamelLocalSummaryClass *local_summary_class;
- camel_maildir_summary_parent_class = (CamelLocalSummaryClass *)camel_type_get_global_classfuncs(camel_local_summary_get_type ());
+ g_type_class_add_private (class, sizeof (CamelMaildirSummaryPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = maildir_summary_finalize;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
folder_summary_class->message_info_size = sizeof (CamelMaildirMessageInfo);
@@ -105,7 +119,8 @@ camel_maildir_summary_init (CamelMaildirSummary *maildir_summary)
folder_summary = CAMEL_FOLDER_SUMMARY (maildir_summary);
- maildir_summary->priv = g_new0 (CamelMaildirSummaryPrivate, 1);
+ maildir_summary->priv =
+ CAMEL_MAILDIR_SUMMARY_GET_PRIVATE (maildir_summary);
/* set unique file version */
folder_summary->version += CAMEL_MAILDIR_SUMMARY_VERSION;
@@ -118,24 +133,6 @@ camel_maildir_summary_init (CamelMaildirSummary *maildir_summary)
maildir_summary->priv->summary_lock = g_mutex_new ();
}
-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),
- sizeof(CamelMaildirSummaryClass),
- (CamelObjectClassInitFunc)camel_maildir_summary_class_init,
- NULL,
- (CamelObjectInitFunc)camel_maildir_summary_init,
- (CamelObjectFinalizeFunc)maildir_summary_finalize);
- }
-
- return type;
-}
-
/**
* camel_maildir_summary_new:
* @folder: parent folder.
@@ -151,7 +148,7 @@ CamelMaildirSummary
{
CamelMaildirSummary *o;
- o = (CamelMaildirSummary *)camel_object_new(camel_maildir_summary_get_type ());
+ o = g_object_new (CAMEL_TYPE_MAILDIR_SUMMARY, NULL);
((CamelFolderSummary *)o)->folder = folder;
if (folder) {
camel_db_set_collate (folder->parent_store->cdb_r, "dreceived", NULL, NULL);
@@ -497,7 +494,7 @@ camel_maildir_summary_add (CamelLocalSummary *cls, const gchar *name, gint force
}
maildirs->priv->current_file = (gchar *)name;
camel_folder_summary_add_from_parser((CamelFolderSummary *)maildirs, mp);
- camel_object_unref (mp);
+ g_object_unref (mp);
maildirs->priv->current_file = NULL;
camel_folder_summary_set_index((CamelFolderSummary *)maildirs, NULL);
g_free(filename);
diff --git a/camel/providers/local/camel-maildir-summary.h b/camel/providers/local/camel-maildir-summary.h
index 34af003..5523062 100644
--- a/camel/providers/local/camel-maildir-summary.h
+++ b/camel/providers/local/camel-maildir-summary.h
@@ -23,9 +23,24 @@
#include "camel-local-summary.h"
-#define CAMEL_MAILDIR_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_maildir_summary_get_type (), CamelMaildirSummary)
-#define CAMEL_MAILDIR_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_maildir_summary_get_type (), CamelMaildirSummaryClass)
-#define CAMEL_IS_MAILDIR_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_maildir_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MAILDIR_SUMMARY \
+ (camel_maildir_summary_get_type ())
+#define CAMEL_MAILDIR_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MAILDIR_SUMMARY, CamelMaildirSummary))
+#define CAMEL_MAILDIR_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MAILDIR_SUMMARY, CamelMaildirSummaryClass))
+#define CAMEL_IS_MAILDIR_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MAILDIR_SUMMARY))
+#define CAMEL_IS_MAILDIR_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MAILDIR_SUMMARY))
+#define CAMEL_MAILDIR_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MAILDIR_SUMMARY, CamelMaildirSummaryClass))
G_BEGIN_DECLS
@@ -57,7 +72,7 @@ struct _CamelMaildirSummaryClass {
CamelLocalSummaryClass parent_class;
};
-CamelType camel_maildir_summary_get_type (void);
+GType camel_maildir_summary_get_type (void);
CamelMaildirSummary *camel_maildir_summary_new (struct _CamelFolder *folder, const gchar *filename, const gchar *maildirdir, CamelIndex *index);
/* convert some info->flags to/from the messageinfo */
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index df1c6dc..dfa299b 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -46,8 +46,6 @@
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-static gpointer camel_mbox_folder_parent_class;
-
static gint mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
static void mbox_unlock(CamelLocalFolder *lf);
@@ -58,14 +56,14 @@ static gchar * mbox_get_filename (CamelFolder *folder, const gchar *uid, CamelEx
static gint mbox_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2);
static void mbox_sort_uids (CamelFolder *folder, GPtrArray *uids);
+G_DEFINE_TYPE (CamelMboxFolder, camel_mbox_folder, CAMEL_TYPE_LOCAL_FOLDER)
+
static void
camel_mbox_folder_class_init (CamelMboxFolderClass *class)
{
CamelFolderClass *folder_class;
CamelLocalFolderClass *local_folder_class;
- camel_mbox_folder_parent_class = (CamelLocalFolderClass *)camel_type_get_global_classfuncs(camel_local_folder_get_type());
-
folder_class = CAMEL_FOLDER_CLASS (class);
folder_class->append_message = mbox_append_message;
folder_class->get_message = mbox_get_message;
@@ -85,24 +83,6 @@ camel_mbox_folder_init (CamelMboxFolder *mbox_folder)
mbox_folder->lockfd = -1;
}
-CamelType
-camel_mbox_folder_get_type(void)
-{
- static CamelType camel_mbox_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_mbox_folder_type == CAMEL_INVALID_TYPE) {
- camel_mbox_folder_type = camel_type_register(CAMEL_LOCAL_FOLDER_TYPE, "CamelMboxFolder",
- sizeof(CamelMboxFolder),
- sizeof(CamelMboxFolderClass),
- (CamelObjectClassInitFunc) camel_mbox_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mbox_folder_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return camel_mbox_folder_type;
-}
-
CamelFolder *
camel_mbox_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex)
{
@@ -110,7 +90,7 @@ camel_mbox_folder_new(CamelStore *parent_store, const gchar *full_name, guint32
d(printf("Creating mbox folder: %s in %s\n", full_name, camel_local_store_get_toplevel_dir((CamelLocalStore *)parent_store)));
- folder = (CamelFolder *)camel_object_new(CAMEL_MBOX_FOLDER_TYPE);
+ folder = g_object_new (CAMEL_TYPE_MBOX_FOLDER, NULL);
folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder,
parent_store, full_name, flags, ex);
@@ -231,7 +211,7 @@ mbox_append_message (CamelFolder *folder,
filter_stream = camel_stream_filter_new (output_stream);
filter_from = camel_mime_filter_from_new();
camel_stream_filter_add((CamelStreamFilter *) filter_stream, filter_from);
- camel_object_unref (filter_from);
+ g_object_unref (filter_from);
if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *) message, filter_stream) == -1 ||
camel_stream_write (filter_stream, "\n", 1) == -1 ||
@@ -239,8 +219,8 @@ mbox_append_message (CamelFolder *folder,
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_object_unref (filter_stream);
+ g_object_unref (output_stream);
g_free(fromline);
if (!((CamelMessageInfoBase *)mi)->preview && camel_folder_summary_get_need_preview(folder->summary)) {
@@ -289,11 +269,11 @@ fail_write:
retval = ftruncate (fd, mbs->folder_size);
} while (retval == -1 && errno == EINTR);
- camel_object_unref (output_stream);
+ g_object_unref (output_stream);
}
if (filter_stream)
- camel_object_unref (filter_stream);
+ g_object_unref (filter_stream);
g_free(fromline);
@@ -435,7 +415,7 @@ retry:
(glong)camel_mime_parser_tell_start_from(parser),
camel_mime_parser_state(parser));
- camel_object_unref (parser);
+ g_object_unref (parser);
parser = NULL;
if (!retried) {
@@ -460,7 +440,7 @@ retry:
CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
uid, lf->folder_path,
_("Message construction failed."));
- camel_object_unref (message);
+ g_object_unref (message);
message = NULL;
goto fail;
}
@@ -472,7 +452,7 @@ fail:
camel_local_folder_unlock(lf);
if (parser)
- camel_object_unref (parser);
+ g_object_unref (parser);
/* use the opportunity to notify of changes (particularly if we had a rebuild) */
if (camel_folder_change_info_changed(lf->changes)) {
diff --git a/camel/providers/local/camel-mbox-folder.h b/camel/providers/local/camel-mbox-folder.h
index 7a61f33..89b03b7 100644
--- a/camel/providers/local/camel-mbox-folder.h
+++ b/camel/providers/local/camel-mbox-folder.h
@@ -25,10 +25,24 @@
#include "camel-local-folder.h"
#include "camel-mbox-summary.h"
-#define CAMEL_MBOX_FOLDER_TYPE (camel_mbox_folder_get_type ())
-#define CAMEL_MBOX_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MBOX_FOLDER_TYPE, CamelMboxFolder))
-#define CAMEL_MBOX_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MBOX_FOLDER_TYPE, CamelMboxFolderClass))
-#define CAMEL_IS_MBOX_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_MBOX_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MBOX_FOLDER \
+ (camel_mbox_folder_get_type ())
+#define CAMEL_MBOX_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MBOX_FOLDER, CamelMboxFolder))
+#define CAMEL_MBOX_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MBOX_FOLDER, CamelMboxFolderClass))
+#define CAMEL_IS_MBOX_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MBOX_FOLDER))
+#define CAMEL_IS_MBOX_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MBOX_FOLDER))
+#define CAMEL_MBOX_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MBOX_FOLDER, CamelMboxFolderClass))
G_BEGIN_DECLS
@@ -49,7 +63,7 @@ struct _CamelMboxFolderClass {
/* flags are taken from CAMEL_STORE_FOLDER_* flags */
CamelFolder *camel_mbox_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex);
-CamelType camel_mbox_folder_get_type(void);
+GType camel_mbox_folder_get_type(void);
G_END_DECLS
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index 13f5a6b..fde5b5f 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -38,8 +38,6 @@
#define d(x)
-static gpointer camel_mbox_store_parent_class;
-
static CamelFolder *get_folder(CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex);
static gboolean delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex);
static gboolean rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
@@ -48,14 +46,14 @@ static CamelFolderInfo *get_folder_info(CamelStore *store, const gchar *top, gui
static gchar *mbox_get_meta_path(CamelLocalStore *ls, const gchar *full_name, const gchar *ext);
static gchar *mbox_get_full_path(CamelLocalStore *ls, const gchar *full_name);
+G_DEFINE_TYPE (CamelMboxStore, camel_mbox_store, CAMEL_TYPE_LOCAL_STORE)
+
static void
camel_mbox_store_class_init (CamelMboxStoreClass *class)
{
CamelStoreClass *store_class;
CamelLocalStoreClass *local_store_class;
- camel_mbox_store_parent_class =(CamelLocalStoreClass *)camel_type_get_global_classfuncs(camel_local_store_get_type());
-
store_class = CAMEL_STORE_CLASS (class);
store_class->get_folder = get_folder;
store_class->delete_folder = delete_folder;
@@ -69,22 +67,9 @@ camel_mbox_store_class_init (CamelMboxStoreClass *class)
local_store_class->get_meta_path = mbox_get_meta_path;
}
-CamelType
-camel_mbox_store_get_type(void)
+static void
+camel_mbox_store_init (CamelMboxStore *mbox_store)
{
- 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),
- sizeof(CamelMboxStoreClass),
- (CamelObjectClassInitFunc) camel_mbox_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_mbox_store_type;
}
static const gchar *extensions[] = {
@@ -319,7 +304,7 @@ delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
if ((lf = camel_store_get_folder(store, folder_name, 0, &lex))) {
camel_object_get(lf, NULL, CAMEL_OBJECT_STATE_FILE, &path, NULL);
camel_object_set(lf, NULL, CAMEL_OBJECT_STATE_FILE, NULL, NULL);
- camel_object_unref (lf);
+ g_object_unref (lf);
} else {
camel_exception_clear(&lex);
}
@@ -421,7 +406,7 @@ create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_n
folder = CAMEL_STORE_GET_CLASS (store)->get_folder (
store, name, CAMEL_STORE_FOLDER_CREATE, ex);
if (folder) {
- camel_object_unref (folder);
+ g_object_unref (folder);
info = CAMEL_STORE_GET_CLASS (store)->get_folder_info (
store, name, 0, ex);
}
@@ -572,7 +557,7 @@ rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelExcept
g_free(newibex);
if (folder)
- camel_object_unref (folder);
+ g_object_unref (folder);
return TRUE;
@@ -605,7 +590,7 @@ ibex_failed:
g_free(oldibex);
if (folder)
- camel_object_unref (folder);
+ g_object_unref (folder);
return FALSE;
}
@@ -652,7 +637,7 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
camel_folder_refresh_info(folder, NULL);
fi->unread = camel_folder_get_unread_message_count(folder);
fi->total = camel_folder_get_message_count(folder);
- camel_object_unref (folder);
+ g_object_unref (folder);
} else {
gchar *path, *folderpath;
CamelMboxSummary *mbs;
@@ -668,7 +653,7 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
fi->total = ((CamelFolderSummary *)mbs)->saved_count;
}
- camel_object_unref (mbs);
+ g_object_unref (mbs);
g_free(folderpath);
g_free(path);
}
diff --git a/camel/providers/local/camel-mbox-store.h b/camel/providers/local/camel-mbox-store.h
index 49f7ac1..97cad66 100644
--- a/camel/providers/local/camel-mbox-store.h
+++ b/camel/providers/local/camel-mbox-store.h
@@ -24,10 +24,24 @@
#include "camel-local-store.h"
-#define CAMEL_MBOX_STORE_TYPE (camel_mbox_store_get_type ())
-#define CAMEL_MBOX_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MBOX_STORE_TYPE, CamelMboxStore))
-#define CAMEL_MBOX_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MBOX_STORE_TYPE, CamelMboxStoreClass))
-#define CAMEL_IS_MBOX_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_MBOX_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MBOX_STORE \
+ (camel_mbox_store_get_type ())
+#define CAMEL_MBOX_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MBOX_STORE, CamelMboxStore))
+#define CAMEL_MBOX_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MBOX_STORE, CamelMboxStoreClass))
+#define CAMEL_IS_MBOX_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MBOX_STORE))
+#define CAMEL_IS_MBOX_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MBOX_STORE))
+#define CAMEL_MBOX_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MBOX_STORE, CamelMboxStoreClass))
G_BEGIN_DECLS
@@ -42,7 +56,7 @@ struct _CamelMboxStoreClass {
CamelLocalStoreClass parent_class;
};
-CamelType camel_mbox_store_get_type (void);
+GType camel_mbox_store_get_type (void);
G_END_DECLS
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 256203d..9776241 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -81,7 +81,7 @@ static void encode_status(guint32 flags, gchar status[8]);
static guint32 decode_status(const gchar *status);
#endif
-static gpointer camel_mbox_summary_parent_class;
+G_DEFINE_TYPE (CamelMboxSummary, camel_mbox_summary, CAMEL_TYPE_LOCAL_SUMMARY)
static gboolean
mbox_info_set_user_flag(CamelMessageInfo *mi, const gchar *name, gboolean value)
@@ -128,8 +128,6 @@ camel_mbox_summary_class_init (CamelMboxSummaryClass *class)
CamelFolderSummaryClass *folder_summary_class;
CamelLocalSummaryClass *local_summary_class;
- camel_mbox_summary_parent_class = (CamelLocalSummaryClass *)camel_type_get_global_classfuncs(camel_local_summary_get_type());
-
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
folder_summary_class->message_info_size = sizeof (CamelMboxMessageInfo);
folder_summary_class->content_info_size = sizeof (CamelMboxMessageContentInfo);
@@ -173,24 +171,6 @@ camel_mbox_summary_init (CamelMboxSummary *mbox_summary)
folder_summary->version += CAMEL_MBOX_SUMMARY_VERSION;
}
-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),
- sizeof (CamelMboxSummaryClass),
- (CamelObjectClassInitFunc) camel_mbox_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mbox_summary_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return type;
-}
-
/**
* camel_mbox_summary_new:
*
@@ -203,7 +183,7 @@ camel_mbox_summary_new(struct _CamelFolder *folder, const gchar *filename, const
{
CamelMboxSummary *new;
- new = (CamelMboxSummary *)camel_object_new(camel_mbox_summary_get_type());
+ new = g_object_new (CAMEL_TYPE_MBOX_SUMMARY, NULL);
((CamelFolderSummary *)new)->folder = folder;
if (folder) {
CamelFolderSummary *summary = (CamelFolderSummary *)new;
@@ -574,7 +554,7 @@ summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *chan
g_assert(camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM_END);
}
- camel_object_unref (CAMEL_OBJECT (mp));
+ g_object_unref (CAMEL_OBJECT (mp));
count = camel_folder_summary_count(s);
for (i=0;i<count;i++) {
@@ -959,7 +939,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
g_ptr_array_foreach (summary, (GFunc) camel_pstring_free, NULL);
g_ptr_array_free (summary, TRUE);
- camel_object_unref (mp);
+ g_object_unref (mp);
camel_operation_end(NULL);
@@ -970,7 +950,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
if (fd != -1)
close(fd);
if (mp)
- camel_object_unref (mp);
+ g_object_unref (mp);
if (info)
camel_message_info_free((CamelMessageInfo *)info);
@@ -1239,7 +1219,7 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
write(fdout, "\n", 1);
#endif
- camel_object_unref (mp);
+ g_object_unref (mp);
/* clear working flags */
for (i=0; i<count; i++) {
@@ -1265,7 +1245,7 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
g_free(xevnew);
if (mp)
- camel_object_unref (mp);
+ g_object_unref (mp);
if (info)
camel_message_info_free((CamelMessageInfo *)info);
diff --git a/camel/providers/local/camel-mbox-summary.h b/camel/providers/local/camel-mbox-summary.h
index 4609860..5b4f95c 100644
--- a/camel/providers/local/camel-mbox-summary.h
+++ b/camel/providers/local/camel-mbox-summary.h
@@ -26,11 +26,24 @@
/* Enable the use of elm/pine style "Status" & "X-Status" headers */
#define STATUS_PINE
-#define CAMEL_MBOX_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_mbox_summary_get_type (), CamelMboxSummary)
-#define CAMEL_MBOX_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mbox_summary_get_type (), CamelMboxSummaryClass)
-#define CAMEL_IS_MBOX_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_mbox_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MBOX_SUMMARY \
+ (camel_mbox_summary_get_type ())
+#define CAMEL_MBOX_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MBOX_SUMMARY, CamelMboxSummary))
+#define CAMEL_MBOX_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MBOX_SUMMARY, CamelMboxSummaryClass))
+#define CAMEL_IS_MBOX_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MBOX_SUMMARY))
+#define CAMEL_IS_MBOX_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MBOX_SUMMARY))
#define CAMEL_MBOX_SUMMARY_GET_CLASS(obj) \
- ((CamelMboxSummaryClass *) CAMEL_OBJECT_GET_CLASS (obj))
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MBOX_SUMMARY, CamelMboxSummaryClass))
G_BEGIN_DECLS
@@ -67,7 +80,7 @@ struct _CamelMboxSummaryClass {
gint (*sync_full)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
};
-CamelType camel_mbox_summary_get_type (void);
+GType camel_mbox_summary_get_type (void);
CamelMboxSummary *camel_mbox_summary_new (struct _CamelFolder *, const gchar *filename, const gchar *mbox_name, CamelIndex *index);
/* do we honour/use xstatus headers, etc */
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index 05e2a91..d016d09 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -40,22 +40,20 @@
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-static CamelLocalFolderClass *parent_class = NULL;
-
static CamelLocalSummary *mh_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index);
static gboolean mh_append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, gchar **appended_uid, CamelException * ex);
static CamelMimeMessage *mh_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex);
static gchar * mh_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
+G_DEFINE_TYPE (CamelMhFolder, camel_mh_folder, CAMEL_TYPE_LOCAL_FOLDER)
+
static void
camel_mh_folder_class_init (CamelMhFolderClass *class)
{
CamelFolderClass *folder_class;
CamelLocalFolderClass *local_folder_class;
- parent_class = CAMEL_LOCAL_FOLDER_CLASS (camel_type_get_global_classfuncs(camel_local_folder_get_type()));
-
folder_class = CAMEL_FOLDER_CLASS (class);
folder_class->append_message = mh_append_message;
folder_class->get_message = mh_get_message;
@@ -70,24 +68,6 @@ camel_mh_folder_init (CamelMhFolder *mh_folder)
{
}
-CamelType
-camel_mh_folder_get_type(void)
-{
- static CamelType camel_mh_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_mh_folder_type == CAMEL_INVALID_TYPE) {
- camel_mh_folder_type = camel_type_register(CAMEL_LOCAL_FOLDER_TYPE, "CamelMhFolder",
- sizeof(CamelMhFolder),
- sizeof(CamelMhFolderClass),
- (CamelObjectClassInitFunc) camel_mh_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mh_folder_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return camel_mh_folder_type;
-}
-
CamelFolder *
camel_mh_folder_new (CamelStore *parent_store,
const gchar *full_name,
@@ -98,7 +78,7 @@ camel_mh_folder_new (CamelStore *parent_store,
d(printf("Creating mh folder: %s\n", full_name));
- folder = (CamelFolder *)camel_object_new(CAMEL_MH_FOLDER_TYPE);
+ folder = g_object_new (CAMEL_TYPE_MH_FOLDER, NULL);
folder = (CamelFolder *) camel_local_folder_construct (
CAMEL_LOCAL_FOLDER (folder),
parent_store, full_name, flags, ex);
@@ -158,7 +138,7 @@ mh_append_message (CamelFolder *folder,
goto fail_write;
/* close this? */
- camel_object_unref (CAMEL_OBJECT (output_stream));
+ g_object_unref (CAMEL_OBJECT (output_stream));
g_free(name);
@@ -184,7 +164,7 @@ mh_append_message (CamelFolder *folder,
name, g_strerror (errno));
if (output_stream) {
- camel_object_unref (CAMEL_OBJECT (output_stream));
+ g_object_unref (CAMEL_OBJECT (output_stream));
unlink (name);
}
@@ -252,11 +232,11 @@ mh_get_message (CamelFolder *folder,
ex, CAMEL_EXCEPTION_SYSTEM,
name, lf->folder_path,
_("Message construction failed."));
- camel_object_unref (message);
+ g_object_unref (message);
message = NULL;
}
- camel_object_unref (message_stream);
+ g_object_unref (message_stream);
fail:
g_free (name);
diff --git a/camel/providers/local/camel-mh-folder.h b/camel/providers/local/camel-mh-folder.h
index 7304ba3..9857a3e 100644
--- a/camel/providers/local/camel-mh-folder.h
+++ b/camel/providers/local/camel-mh-folder.h
@@ -25,10 +25,23 @@
#include "camel-local-folder.h"
-#define CAMEL_MH_FOLDER_TYPE (camel_mh_folder_get_type ())
-#define CAMEL_MH_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MH_FOLDER_TYPE, CamelMhFolder))
-#define CAMEL_MH_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MH_FOLDER_TYPE, CamelMhFolderClass))
-#define CAMEL_IS_MH_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_MH_FOLDER_TYPE))
+#define CAMEL_TYPE_MH_FOLDER \
+ (camel_mh_folder_get_type ())
+#define CAMEL_MH_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MH_FOLDER, CamelMhFolder))
+#define CAMEL_MH_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MH_FOLDER, CamelMhFolderClass))
+#define CAMEL_IS_MH_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MH_FOLDER))
+#define CAMEL_IS_MH_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MH_FOLDER))
+#define CAMEL_MH_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MH_FOLDER, CamelMhFolderClass))
G_BEGIN_DECLS
@@ -46,7 +59,7 @@ struct _CamelMhFolderClass {
/* public methods */
CamelFolder *camel_mh_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex);
-CamelType camel_mh_folder_get_type(void);
+GType camel_mh_folder_get_type(void);
G_END_DECLS
diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c
index b225f7e..d0c2277 100644
--- a/camel/providers/local/camel-mh-store.c
+++ b/camel/providers/local/camel-mh-store.c
@@ -35,8 +35,6 @@
#include "camel-mh-store.h"
#include "camel-mh-summary.h"
-static gpointer camel_mh_store_parent_class;
-
#define d(x)
static gboolean construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
@@ -46,14 +44,14 @@ static gboolean delete_folder(CamelStore * store, const gchar *folder_name, Came
static gboolean rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
static CamelFolderInfo * get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
+G_DEFINE_TYPE (CamelMhStore, camel_mh_store, CAMEL_TYPE_LOCAL_STORE)
+
static void
-camel_mh_store_class_init (CamelObjectClass *class)
+camel_mh_store_class_init (CamelMhStoreClass *class)
{
CamelServiceClass *service_class;
CamelStoreClass *store_class;
- camel_mh_store_parent_class = (CamelLocalStoreClass *)camel_type_get_global_classfuncs(camel_local_store_get_type());
-
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = construct;
@@ -65,22 +63,9 @@ camel_mh_store_class_init (CamelObjectClass *class)
store_class->get_folder_info = get_folder_info;
}
-CamelType
-camel_mh_store_get_type(void)
+static void
+camel_mh_store_init (CamelMhStore *mh_store)
{
- static CamelType camel_mh_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_mh_store_type == CAMEL_INVALID_TYPE) {
- camel_mh_store_type = camel_type_register(CAMEL_LOCAL_STORE_TYPE, "CamelMhStore",
- sizeof(CamelMhStore),
- sizeof(CamelMhStoreClass),
- (CamelObjectClassInitFunc) camel_mh_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_mh_store_type;
}
static gboolean
@@ -135,7 +120,7 @@ folders_update (const gchar *root,
stream = camel_stream_fs_new_with_name (tmp, O_RDONLY, 0);
if (stream) {
in = camel_stream_buffer_new(stream, CAMEL_STREAM_BUFFER_READ);
- camel_object_unref (stream);
+ g_object_unref (stream);
}
if (in == NULL || stream == NULL) {
if (mode == UPDATE_ADD && camel_stream_printf (out, "%s\n", folder) == -1)
@@ -199,9 +184,9 @@ fail:
unlink(tmpnew); /* remove it if its there */
g_free(line);
if (in)
- camel_object_unref (in);
+ g_object_unref (in);
if (out)
- camel_object_unref (out);
+ g_object_unref (out);
}
static CamelFolder *
@@ -348,7 +333,7 @@ fill_fi (CamelStore *store,
camel_folder_refresh_info(folder, NULL);
fi->unread = camel_folder_get_unread_message_count(folder);
fi->total = camel_folder_get_message_count(folder);
- camel_object_unref (folder);
+ g_object_unref (folder);
} else {
gchar *path, *folderpath;
CamelFolderSummary *s;
@@ -368,7 +353,7 @@ fill_fi (CamelStore *store,
fi->unread = s->unread_count;
fi->total = s->saved_count;
}
- camel_object_unref (s);
+ g_object_unref (s);
g_free(folderpath);
g_free(path);
}
@@ -509,7 +494,7 @@ folders_scan (CamelStore *store,
return;
in = camel_stream_buffer_new(stream, CAMEL_STREAM_BUFFER_READ);
- camel_object_unref (stream);
+ g_object_unref (stream);
if (in == NULL)
return;
@@ -569,7 +554,7 @@ folders_scan (CamelStore *store,
g_hash_table_foreach(visited, (GHFunc)g_free, NULL);
g_hash_table_destroy(visited);
- camel_object_unref (in);
+ g_object_unref (in);
}
/* FIXME: move to camel-local, this is shared with maildir code */
diff --git a/camel/providers/local/camel-mh-store.h b/camel/providers/local/camel-mh-store.h
index 2558590..e166ea3 100644
--- a/camel/providers/local/camel-mh-store.h
+++ b/camel/providers/local/camel-mh-store.h
@@ -24,10 +24,24 @@
#include "camel-local-store.h"
-#define CAMEL_MH_STORE_TYPE (camel_mh_store_get_type ())
-#define CAMEL_MH_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MH_STORE_TYPE, CamelMhStore))
-#define CAMEL_MH_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MH_STORE_TYPE, CamelMhStoreClass))
-#define CAMEL_IS_MH_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_MH_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_MH_STORE \
+ (camel_mh_store_get_type ())
+#define CAMEL_MH_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MH_STORE, CamelMhStore))
+#define CAMEL_MH_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MH_STORE, CamelMhStoreClass))
+#define CAMEL_IS_MH_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MH_STORE))
+#define CAMEL_IS_MH_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MH_STORE))
+#define CAMEL_MH_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MH_STORE, CamelMhStoreClass))
G_BEGIN_DECLS
@@ -48,7 +62,7 @@ struct _CamelMhStoreClass {
CamelLocalStoreClass parent_class;
};
-CamelType camel_mh_store_get_type(void);
+GType camel_mh_store_get_type (void);
G_END_DECLS
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index e00a2d9..9a48078 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -41,6 +41,10 @@
#define CAMEL_MH_SUMMARY_VERSION (0x2000)
+#define CAMEL_MH_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MH_SUMMARY, CamelMhSummaryPrivate))
+
static gint mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
static gint mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
/*static gint mh_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);*/
@@ -51,13 +55,7 @@ struct _CamelMhSummaryPrivate {
gchar *current_uid;
};
-static gpointer camel_mh_summary_parent_class;
-
-static void
-mh_summary_finalize (CamelMhSummary *mh_summary)
-{
- g_free (mh_summary->priv);
-}
+G_DEFINE_TYPE (CamelMhSummary, camel_mh_summary, CAMEL_TYPE_LOCAL_SUMMARY)
static void
camel_mh_summary_class_init (CamelMhSummaryClass *class)
@@ -65,7 +63,7 @@ camel_mh_summary_class_init (CamelMhSummaryClass *class)
CamelFolderSummaryClass *folder_summary_class;
CamelLocalSummaryClass *local_summary_class;
- camel_mh_summary_parent_class = (CamelLocalSummaryClass *)camel_type_get_global_classfuncs(camel_local_summary_get_type ());
+ g_type_class_add_private (class, sizeof (CamelMhSummaryPrivate));
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
folder_summary_class->next_uid_string = mh_summary_next_uid_string;
@@ -80,7 +78,7 @@ camel_mh_summary_init (CamelMhSummary *mh_summary)
{
CamelFolderSummary *folder_summary;
- mh_summary->priv = g_new0 (CamelMhSummaryPrivate, 1);
+ mh_summary->priv = CAMEL_MH_SUMMARY_GET_PRIVATE (mh_summary);
folder_summary = CAMEL_FOLDER_SUMMARY (mh_summary);
@@ -88,24 +86,6 @@ camel_mh_summary_init (CamelMhSummary *mh_summary)
folder_summary->version += CAMEL_MH_SUMMARY_VERSION;
}
-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),
- sizeof(CamelMhSummaryClass),
- (CamelObjectClassInitFunc)camel_mh_summary_class_init,
- NULL,
- (CamelObjectInitFunc)camel_mh_summary_init,
- (CamelObjectFinalizeFunc)mh_summary_finalize);
- }
-
- return type;
-}
-
/**
* camel_mh_summary_new:
*
@@ -121,7 +101,7 @@ camel_mh_summary_new (CamelFolder *folder,
{
CamelMhSummary *o;
- o = (CamelMhSummary *)camel_object_new(camel_mh_summary_get_type ());
+ o = g_object_new (CAMEL_TYPE_MH_SUMMARY, NULL);
((CamelFolderSummary *)o)->folder = folder;
if (folder) {
camel_db_set_collate (folder->parent_store->cdb_r, "uid", "mh_uid_sort", (CamelDBCollate)camel_local_frompos_sort);
@@ -198,7 +178,7 @@ camel_mh_summary_add (CamelLocalSummary *cls,
}
mhs->priv->current_uid = (gchar *)name;
camel_folder_summary_add_from_parser((CamelFolderSummary *)mhs, mp);
- camel_object_unref (mp);
+ g_object_unref (mp);
mhs->priv->current_uid = NULL;
camel_folder_summary_set_index((CamelFolderSummary *)mhs, NULL);
g_free(filename);
diff --git a/camel/providers/local/camel-mh-summary.h b/camel/providers/local/camel-mh-summary.h
index 218eed2..9f211d2 100644
--- a/camel/providers/local/camel-mh-summary.h
+++ b/camel/providers/local/camel-mh-summary.h
@@ -23,9 +23,24 @@
#include "camel-local-summary.h"
-#define CAMEL_MH_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_mh_summary_get_type (), CamelMhSummary)
-#define CAMEL_MH_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mh_summary_get_type (), CamelMhSummaryClass)
-#define CAMEL_IS_MH_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_mh_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_MH_SUMMARY \
+ (camel_mh_summary_get_type ())
+#define CAMEL_MH_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_MH_SUMMARY, CamelMhSummary))
+#define CAMEL_MH_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_MH_SUMMARY, CamelMhSummaryClass))
+#define CAMEL_IS_MH_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_MH_SUMMARY))
+#define CAMEL_IS_MH_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_MH_SUMMARY))
+#define CAMEL_MH_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_MH_SUMMARY, CamelMhSummaryClass))
G_BEGIN_DECLS
@@ -42,7 +57,7 @@ struct _CamelMhSummaryClass {
CamelLocalSummaryClass parent_class;
};
-CamelType camel_mh_summary_get_type (void);
+GType camel_mh_summary_get_type (void);
CamelMhSummary *camel_mh_summary_new(struct _CamelFolder *, const gchar *filename, const gchar *mhdir, CamelIndex *index);
G_END_DECLS
diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c
index c55fadb..2cae7d0 100644
--- a/camel/providers/local/camel-spool-folder.c
+++ b/camel/providers/local/camel-spool-folder.c
@@ -40,20 +40,18 @@
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-static CamelFolderClass *parent_class = NULL;
-
static CamelLocalSummary *spool_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index);
static gint spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
static void spool_unlock(CamelLocalFolder *lf);
+G_DEFINE_TYPE (CamelSpoolFolder, camel_spool_folder, CAMEL_TYPE_MBOX_FOLDER)
+
static void
camel_spool_folder_class_init (CamelSpoolFolderClass *class)
{
CamelLocalFolderClass *local_folder_class;
- parent_class = (CamelFolderClass *)camel_mbox_folder_get_type();
-
local_folder_class = CAMEL_LOCAL_FOLDER_CLASS (class);
local_folder_class->create_summary = spool_create_summary;
local_folder_class->lock = spool_lock;
@@ -66,24 +64,6 @@ camel_spool_folder_init (CamelSpoolFolder *spool_folder)
spool_folder->lockid = -1;
}
-CamelType
-camel_spool_folder_get_type (void)
-{
- static CamelType camel_spool_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_spool_folder_type == CAMEL_INVALID_TYPE) {
- camel_spool_folder_type = camel_type_register(camel_mbox_folder_get_type(), "CamelSpoolFolder",
- sizeof(CamelSpoolFolder),
- sizeof(CamelSpoolFolderClass),
- (CamelObjectClassInitFunc) camel_spool_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_spool_folder_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return camel_spool_folder_type;
-}
-
CamelFolder *
camel_spool_folder_new (CamelStore *parent_store,
const gchar *full_name,
@@ -94,7 +74,7 @@ camel_spool_folder_new (CamelStore *parent_store,
d(printf("Creating spool folder: %s in %s\n", full_name, camel_local_store_get_toplevel_dir((CamelLocalStore *)parent_store)));
- folder = (CamelFolder *)camel_object_new(CAMEL_SPOOL_FOLDER_TYPE);
+ folder = g_object_new (CAMEL_TYPE_SPOOL_FOLDER, NULL);
if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
&& strcmp(full_name, "INBOX") == 0)
diff --git a/camel/providers/local/camel-spool-folder.h b/camel/providers/local/camel-spool-folder.h
index ec0280a..7ae32af 100644
--- a/camel/providers/local/camel-spool-folder.h
+++ b/camel/providers/local/camel-spool-folder.h
@@ -25,10 +25,24 @@
#include "camel-mbox-folder.h"
#include "camel-spool-summary.h"
-#define CAMEL_SPOOL_FOLDER_TYPE (camel_spool_folder_get_type ())
-#define CAMEL_SPOOL_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SPOOL_FOLDER_TYPE, CamelSpoolFolder))
-#define CAMEL_SPOOL_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SPOOL_FOLDER_TYPE, CamelSpoolFolderClass))
-#define CAMEL_IS_SPOOL_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_SPOOL_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SPOOL_FOLDER \
+ (camel_spool_folder_get_type ())
+#define CAMEL_SPOOL_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SPOOL_FOLDER, CamelSpoolFolder))
+#define CAMEL_SPOOL_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SPOOL_FOLDER, CamelSpoolFolderClass))
+#define CAMEL_IS_SPOOL_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SPOOL_FOLDER))
+#define CAMEL_IS_SPOOL_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SPOOL_FOLDER))
+#define CAMEL_SPOOL_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SPOOL_FOLDER, CamelSpoolFolderClass))
G_BEGIN_DECLS
@@ -47,7 +61,7 @@ struct _CamelSpoolFolderClass {
CamelMboxFolderClass parent_class;
};
-CamelType camel_spool_folder_get_type(void);
+GType camel_spool_folder_get_type(void);
CamelFolder *camel_spool_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex);
diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c
index e476ff1..811efb0 100644
--- a/camel/providers/local/camel-spool-store.c
+++ b/camel/providers/local/camel-spool-store.c
@@ -56,7 +56,7 @@ static gboolean delete_folder(CamelStore *store, const gchar *folder_name, Camel
static gchar *spool_get_meta_path(CamelLocalStore *ls, const gchar *full_name, const gchar *ext);
static gchar *spool_get_full_path(CamelLocalStore *ls, const gchar *full_name);
-static gpointer camel_spool_store_parent_class;
+G_DEFINE_TYPE (CamelSpoolStore, camel_spool_store, CAMEL_TYPE_MBOX_STORE)
static void
camel_spool_store_class_init (CamelSpoolStoreClass *class)
@@ -65,8 +65,6 @@ camel_spool_store_class_init (CamelSpoolStoreClass *class)
CamelStoreClass *store_class;
CamelLocalStoreClass *local_store_class;
- camel_spool_store_parent_class = CAMEL_STORE_CLASS(camel_mbox_store_get_type());
-
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = construct;
service_class->get_name = get_name;
@@ -84,22 +82,9 @@ camel_spool_store_class_init (CamelSpoolStoreClass *class)
local_store_class->get_meta_path = spool_get_meta_path;
}
-CamelType
-camel_spool_store_get_type (void)
+static void
+camel_spool_store_init (CamelSpoolStore *spool_store)
{
- 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),
- sizeof (CamelSpoolStoreClass),
- (CamelObjectClassInitFunc) camel_spool_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_spool_store_type;
}
static gboolean
@@ -113,7 +98,7 @@ construct (CamelService *service,
struct stat st;
d(printf("constructing store of type %s '%s:%s'\n",
- camel_type_to_name(((CamelObject *)service)->s.type), url->protocol, url->path));
+ G_OBJECT_CLASS_NAME(((CamelObject *)service)->s.type), url->protocol, url->path));
/* Chain up to parent's construct() method. */
service_class = CAMEL_SERVICE_CLASS (camel_spool_store_parent_class);
@@ -290,7 +275,7 @@ spool_fill_fi (CamelStore *store,
camel_folder_refresh_info(folder, NULL);
fi->unread = camel_folder_get_unread_message_count(folder);
fi->total = camel_folder_get_message_count(folder);
- camel_object_unref (folder);
+ g_object_unref (folder);
}
}
@@ -427,7 +412,7 @@ scan_dir (CamelStore *store,
spool_fill_fi(store, fi, flags);
}
if (folder)
- camel_object_unref (folder);
+ g_object_unref (folder);
} else if (S_ISDIR(st.st_mode)) {
struct _inode in = { st.st_dev, st.st_ino };
diff --git a/camel/providers/local/camel-spool-store.h b/camel/providers/local/camel-spool-store.h
index 0c5f609..f0b9d34 100644
--- a/camel/providers/local/camel-spool-store.h
+++ b/camel/providers/local/camel-spool-store.h
@@ -24,10 +24,24 @@
#include "camel-mbox-store.h"
-#define CAMEL_SPOOL_STORE_TYPE (camel_spool_store_get_type ())
-#define CAMEL_SPOOL_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SPOOL_STORE_TYPE, CamelSpoolStore))
-#define CAMEL_SPOOL_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SPOOL_STORE_TYPE, CamelSpoolStoreClass))
-#define CAMEL_IS_SPOOL_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_SPOOL_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SPOOL_STORE \
+ (camel_spool_store_get_type ())
+#define CAMEL_SPOOL_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SPOOL_STORE, CamelSpoolStore))
+#define CAMEL_SPOOL_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SPOOL_STORE, CamelSpoolStoreClass))
+#define CAMEL_IS_SPOOL_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SPOOL_STORE))
+#define CAMEL_IS_SPOOL_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SPOOL_STORE))
+#define CAMEL_SPOOL_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SPOOL_STORE, CamelSpoolStoreClass))
G_BEGIN_DECLS
@@ -49,7 +63,7 @@ struct _CamelSpoolStoreClass {
CamelMboxStoreClass parent_class;
};
-CamelType camel_spool_store_get_type (void);
+GType camel_spool_store_get_type (void);
G_END_DECLS
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
index b4b789c..258cda8 100644
--- a/camel/providers/local/camel-spool-summary.c
+++ b/camel/providers/local/camel-spool-summary.c
@@ -49,7 +49,7 @@ static gint spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *c
static gint spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
static gint spool_summary_need_index(void);
-static gpointer camel_spool_summary_parent_class;
+G_DEFINE_TYPE (CamelSpoolSummary, camel_spool_summary, CAMEL_TYPE_MBOX_SUMMARY)
static void
camel_spool_summary_class_init (CamelSpoolSummaryClass *class)
@@ -57,8 +57,6 @@ camel_spool_summary_class_init (CamelSpoolSummaryClass *class)
CamelLocalSummaryClass *local_summary_class;
CamelMboxSummaryClass *mbox_summary_class;
- camel_spool_summary_parent_class = CAMEL_FOLDER_SUMMARY_CLASS(camel_mbox_summary_get_type());
-
local_summary_class = CAMEL_LOCAL_SUMMARY_CLASS (class);
local_summary_class->load = spool_summary_load;
local_summary_class->check = spool_summary_check;
@@ -81,31 +79,13 @@ camel_spool_summary_init(CamelSpoolSummary *spool_summary)
folder_summary->version += CAMEL_SPOOL_SUMMARY_VERSION;
}
-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),
- sizeof (CamelSpoolSummaryClass),
- (CamelObjectClassInitFunc) camel_spool_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_spool_summary_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return type;
-}
-
CamelSpoolSummary *
camel_spool_summary_new (CamelFolder *folder,
const gchar *mbox_name)
{
CamelSpoolSummary *new;
- new = (CamelSpoolSummary *)camel_object_new(camel_spool_summary_get_type());
+ new = g_object_new (CAMEL_TYPE_SPOOL_SUMMARY, NULL);
((CamelFolderSummary *)new)->folder = folder;
if (folder) {
camel_db_set_collate (folder->parent_store->cdb_r, "bdata", "spool_frompos_sort", (CamelDBCollate)camel_local_frompos_sort);
diff --git a/camel/providers/local/camel-spool-summary.h b/camel/providers/local/camel-spool-summary.h
index b4fd894..98aa960 100644
--- a/camel/providers/local/camel-spool-summary.h
+++ b/camel/providers/local/camel-spool-summary.h
@@ -25,9 +25,24 @@
#include "camel-mbox-summary.h"
-#define CAMEL_SPOOL_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_spool_summary_get_type (), CamelSpoolSummary)
-#define CAMEL_SPOOL_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_spool_summary_get_type (), CamelSpoolSummaryClass)
-#define CAMEL_IS_SPOOL_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_spool_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_SPOOL_SUMMARY \
+ (camel_spool_summary_get_type ())
+#define CAMEL_SPOOL_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SPOOL_SUMMARY, CamelSpoolSummary))
+#define CAMEL_SPOOL_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SPOOL_SUMMARY, CamelSpoolSummaryClass))
+#define CAMEL_IS_SPOOL_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SPOOL_SUMMARY))
+#define CAMEL_IS_SPOOL_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SPOOL_SUMMARY))
+#define CAMEL_SPOOL_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SPOOL_SUMMARY, CamelSpoolSummaryClass))
G_BEGIN_DECLS
@@ -43,7 +58,7 @@ struct _CamelSpoolSummaryClass {
CamelMboxSummaryClass parent_class;
};
-CamelType camel_spool_summary_get_type (void);
+GType camel_spool_summary_get_type (void);
void camel_spool_summary_construct (CamelSpoolSummary *new, const gchar *filename, const gchar *spool_name, CamelIndex *index);
/* create the summary, in-memory only */
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index 0a9c882..7cb9493 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -39,21 +39,34 @@
#include "camel-nntp-store.h"
#include "camel-nntp-summary.h"
-static CamelDiscoFolderClass *parent_class = NULL;
+#define CAMEL_NNTP_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_NNTP_FOLDER, CamelNNTPFolderPrivate))
+
+G_DEFINE_TYPE (CamelNNTPFolder, camel_nntp_folder, CAMEL_TYPE_DISCO_FOLDER)
static void
-nntp_folder_finalize (CamelNNTPFolder *nntp_folder)
+nntp_folder_dispose (GObject *object)
{
- CamelException ex;
-
- camel_exception_init (&ex);
+ CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (object);
camel_folder_summary_save_to_db (
- CAMEL_FOLDER (nntp_folder)->summary, &ex);
+ CAMEL_FOLDER (nntp_folder)->summary, NULL);
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_nntp_folder_parent_class)->dispose (object);
+}
+
+static void
+nntp_folder_finalize (GObject *object)
+{
+ CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (object);
g_mutex_free (nntp_folder->priv->search_lock);
g_mutex_free (nntp_folder->priv->cache_lock);
- g_free (nntp_folder->priv);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_nntp_folder_parent_class)->finalize (object);
}
gboolean
@@ -106,7 +119,9 @@ nntp_folder_sync_online (CamelFolder *folder, CamelException *ex)
gboolean success;
camel_service_lock (CAMEL_SERVICE (folder->parent_store), CS_REC_CONNECT_LOCK);
+
success = camel_folder_summary_save_to_db (folder->summary, ex);
+
camel_service_unlock (CAMEL_SERVICE (folder->parent_store), CS_REC_CONNECT_LOCK);
return success;
@@ -118,7 +133,9 @@ nntp_folder_sync_offline (CamelFolder *folder, CamelException *ex)
gboolean success;
camel_service_lock (CAMEL_SERVICE (folder->parent_store), CS_REC_CONNECT_LOCK);
+
success = camel_folder_summary_save_to_db (folder->summary, ex);
+
camel_service_unlock (CAMEL_SERVICE (folder->parent_store), CS_REC_CONNECT_LOCK);
return success;
@@ -161,7 +178,7 @@ nntp_folder_download_message (CamelNNTPFolder *nntp_folder, const gchar *id, con
if (camel_stream_reset (stream) == -1)
goto fail;
} else {
- stream = camel_object_ref (nntp_store->stream);
+ stream = g_object_ref (nntp_store->stream);
}
} else if (ret == 423 || ret == 430) {
camel_exception_setv (
@@ -215,7 +232,7 @@ nntp_folder_cache_message (CamelDiscoFolder *disco_folder,
stream = nntp_folder_download_message (
(CamelNNTPFolder *) disco_folder, article, msgid, ex);
if (stream)
- camel_object_unref (stream);
+ g_object_unref (stream);
else
success = FALSE;
@@ -276,11 +293,11 @@ nntp_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException *
ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot get message %s: %s"), uid,
g_strerror (errno));
- camel_object_unref (message);
+ g_object_unref (message);
message = NULL;
}
- camel_object_unref (stream);
+ g_object_unref (stream);
fail:
if (camel_folder_change_info_changed (nntp_folder->changes)) {
changes = nntp_folder->changes;
@@ -414,7 +431,7 @@ nntp_folder_append_message_online (CamelFolder *folder,
filtered_stream = camel_stream_filter_new (stream);
camel_stream_filter_add (
CAMEL_STREAM_FILTER (filtered_stream), crlffilter);
- camel_object_unref (crlffilter);
+ g_object_unref (crlffilter);
/* remove mail 'To', 'CC', and 'BCC' headers */
savedhdrs = NULL;
@@ -457,7 +474,7 @@ nntp_folder_append_message_online (CamelFolder *folder,
success = FALSE;
}
- camel_object_unref (filtered_stream);
+ g_object_unref (filtered_stream);
g_free(group);
header->next = savedhdrs;
@@ -501,11 +518,15 @@ nntp_folder_transfer_message (CamelFolder *source,
static void
camel_nntp_folder_class_init (CamelNNTPFolderClass *class)
{
+ GObjectClass *object_class;
CamelFolderClass *folder_class;
CamelDiscoFolderClass *disco_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 ()));
+ g_type_class_add_private (class, sizeof (CamelNNTPFolderPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = nntp_folder_dispose;
+ object_class->finalize = nntp_folder_finalize;
folder_class = CAMEL_FOLDER_CLASS (class);
folder_class->get_message = nntp_folder_get_message;
@@ -532,31 +553,13 @@ camel_nntp_folder_class_init (CamelNNTPFolderClass *class)
static void
camel_nntp_folder_init (CamelNNTPFolder *nntp_folder)
{
- nntp_folder->priv = g_new0 (CamelNNTPFolderPrivate, 1);
+ nntp_folder->priv = CAMEL_NNTP_FOLDER_GET_PRIVATE (nntp_folder);
nntp_folder->changes = camel_folder_change_info_new ();
nntp_folder->priv->search_lock = g_mutex_new ();
nntp_folder->priv->cache_lock = g_mutex_new ();
}
-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),
- sizeof (CamelNNTPFolderClass),
- (CamelObjectClassInitFunc) camel_nntp_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_nntp_folder_init,
- (CamelObjectFinalizeFunc) nntp_folder_finalize);
- }
-
- return camel_nntp_folder_type;
-}
-
CamelFolder *
camel_nntp_folder_new (CamelStore *parent,
const gchar *folder_name,
@@ -577,7 +580,7 @@ camel_nntp_folder_new (CamelStore *parent,
/* If this doesn't work, stuff wont save, but let it continue anyway */
g_mkdir_with_parents (root, 0700);
- folder = (CamelFolder *) camel_object_new (CAMEL_NNTP_FOLDER_TYPE);
+ folder = g_object_new (CAMEL_TYPE_NNTP_FOLDER, NULL);
nntp_folder = (CamelNNTPFolder *)folder;
camel_folder_construct (folder, parent, folder_name, folder_name);
@@ -604,7 +607,7 @@ camel_nntp_folder_new (CamelStore *parent,
}
if (subscribed && !camel_folder_refresh_info (folder, ex)) {
- camel_object_unref (folder);
+ g_object_unref (folder);
folder = NULL;
}
diff --git a/camel/providers/nntp/camel-nntp-folder.h b/camel/providers/nntp/camel-nntp-folder.h
index 10e88e1..7eb11b8 100644
--- a/camel/providers/nntp/camel-nntp-folder.h
+++ b/camel/providers/nntp/camel-nntp-folder.h
@@ -27,10 +27,24 @@
#include <camel/camel.h>
-#define CAMEL_NNTP_FOLDER_TYPE (camel_nntp_folder_get_type ())
-#define CAMEL_NNTP_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_NNTP_FOLDER_TYPE, CamelNNTPFolder))
-#define CAMEL_NNTP_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_NNTP_FOLDER_TYPE, CamelNNTPFolderClass))
-#define CAMEL_IS_NNTP_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_NNTP_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_NNTP_FOLDER \
+ (camel_nntp_folder_get_type ())
+#define CAMEL_NNTP_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_NNTP_FOLDER, CamelNNTPFolder))
+#define CAMEL_NNTP_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_NNTP_FOLDER, CamelNNTPFolderClass))
+#define CAMEL_IS_NNTP_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_NNTP_FOLDER))
+#define CAMEL_IS_NNTP_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_NNTP_FOLDER))
+#define CAMEL_NNTP_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_NNTP_FOLDER, CamelNNTPFolderClass))
G_BEGIN_DECLS
@@ -52,7 +66,7 @@ struct _CamelNNTPFolderClass {
CamelDiscoFolderClass parent;
};
-CamelType camel_nntp_folder_get_type (void);
+GType camel_nntp_folder_get_type (void);
CamelFolder *camel_nntp_folder_new (CamelStore *parent, const gchar *folder_name, CamelException *ex);
diff --git a/camel/providers/nntp/camel-nntp-store-summary.c b/camel/providers/nntp/camel-nntp-store-summary.c
index 781da0a..a5cf6d7 100644
--- a/camel/providers/nntp/camel-nntp-store-summary.c
+++ b/camel/providers/nntp/camel-nntp-store-summary.c
@@ -49,15 +49,13 @@ static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, gint);
static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
-static gpointer camel_nntp_store_summary_parent_class;
+G_DEFINE_TYPE (CamelNNTPStoreSummary, camel_nntp_store_summary, CAMEL_TYPE_STORE_SUMMARY)
static void
camel_nntp_store_summary_class_init (CamelNNTPStoreSummaryClass *class)
{
CamelStoreSummaryClass *store_summary_class;
- camel_nntp_store_summary_parent_class = CAMEL_STORE_SUMMARY_CLASS (camel_type_get_global_classfuncs (camel_store_summary_get_type ()));
-
store_summary_class = CAMEL_STORE_SUMMARY_CLASS (class);
store_summary_class->summary_header_load = summary_header_load;
store_summary_class->summary_header_save = summary_header_save;
@@ -83,25 +81,6 @@ camel_nntp_store_summary_init (CamelNNTPStoreSummary *nntp_store_summary)
sizeof (nntp_store_summary->last_newslist));
}
-CamelType
-camel_nntp_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 (),
- "CamelNNTPStoreSummary",
- sizeof (CamelNNTPStoreSummary),
- sizeof (CamelNNTPStoreSummaryClass),
- (CamelObjectClassInitFunc) camel_nntp_store_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_nntp_store_summary_init,
- (CamelObjectFinalizeFunc) NULL);
- }
-
- return type;
-}
-
/**
* camel_nntp_store_summary_new:
*
@@ -112,7 +91,7 @@ camel_nntp_store_summary_get_type (void)
CamelNNTPStoreSummary *
camel_nntp_store_summary_new (void)
{
- return (CamelNNTPStoreSummary *) camel_object_new (camel_nntp_store_summary_get_type ());
+ return g_object_new (CAMEL_TYPE_NNTP_STORE_SUMMARY, NULL);
}
/**
diff --git a/camel/providers/nntp/camel-nntp-store-summary.h b/camel/providers/nntp/camel-nntp-store-summary.h
index 8ba6400..a9858c3 100644
--- a/camel/providers/nntp/camel-nntp-store-summary.h
+++ b/camel/providers/nntp/camel-nntp-store-summary.h
@@ -26,9 +26,24 @@
#include <camel/camel.h>
-#define CAMEL_NNTP_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_nntp_store_summary_get_type (), CamelNNTPStoreSummary)
-#define CAMEL_NNTP_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_nntp_store_summary_get_type (), CamelNNTPStoreSummaryClass)
-#define CAMEL_IS_NNTP_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_nntp_store_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_NNTP_STORE_SUMMARY \
+ (camel_nntp_store_summary_get_type ())
+#define CAMEL_NNTP_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_NNTP_STORE_SUMMARY, CamelNNTPStoreSummary))
+#define CAMEL_NNTP_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_NNTP_STORE_SUMMARY, CamelNNTPStoreSummaryClass))
+#define CAMEL_IS_NNTP_STORE_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_NNTP_STORE_SUMMARY))
+#define CAMEL_IS_NNTP_STORE_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_NNTP_STORE_SUMMARY))
+#define CAMEL_NNTP_STORE_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_NNTP_STORE_SUMMARY, CamelNNTPStoreSummaryClass))
G_BEGIN_DECLS
@@ -65,7 +80,7 @@ struct _CamelNNTPStoreSummaryClass {
CamelStoreSummaryClass summary_class;
};
-CamelType camel_nntp_store_summary_get_type (void);
+GType camel_nntp_store_summary_get_type (void);
CamelNNTPStoreSummary *camel_nntp_store_summary_new (void);
/* TODO: this api needs some more work, needs to support lists */
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index aebfc26..0745af2 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -54,35 +54,63 @@
#define DUMP_EXTENSIONS
-static gpointer camel_nntp_store_parent_class;
+#define CAMEL_NNTP_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_NNTP_STORE, CamelNNTPStorePrivate))
static gint camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex);
+G_DEFINE_TYPE (CamelNNTPStore, camel_nntp_store, CAMEL_TYPE_DISCO_STORE)
+
static void
-nntp_store_finalize (CamelObject *object)
+nntp_store_dispose (GObject *object)
{
- /* call base finalize */
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (object);
- CamelDiscoStore *disco_store = (CamelDiscoStore *) nntp_store;
- struct _CamelNNTPStorePrivate *p = nntp_store->priv;
- struct _xover_header *xover, *xn;
+ CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (object);
- camel_service_disconnect ((CamelService *)object, TRUE, NULL);
+ /* Only run this the first time. */
+ if (nntp_store->summary != NULL)
+ camel_service_disconnect (CAMEL_SERVICE (object), TRUE, NULL);
- if (nntp_store->summary) {
- camel_store_summary_save ((CamelStoreSummary *) nntp_store->summary);
- camel_object_unref (nntp_store->summary);
+ if (nntp_store->summary != NULL) {
+ camel_store_summary_save (
+ CAMEL_STORE_SUMMARY (nntp_store->summary));
+ g_object_unref (nntp_store->summary);
+ nntp_store->summary = NULL;
+ }
+
+ if (nntp_store->mem != NULL) {
+ g_object_unref (nntp_store->mem);
+ nntp_store->mem = NULL;
+ }
+
+ if (nntp_store->stream != NULL) {
+ g_object_unref (nntp_store->stream);
+ nntp_store->stream = NULL;
}
- camel_object_unref (nntp_store->mem);
- nntp_store->mem = NULL;
- if (nntp_store->stream)
- camel_object_unref (nntp_store->stream);
+ if (nntp_store->cache != NULL) {
+ g_object_unref (nntp_store->cache);
+ nntp_store->cache = NULL;
+ }
+
+ if (disco_store->diary != NULL) {
+ g_object_unref (disco_store->diary);
+ disco_store->diary = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_nntp_store_parent_class)->dispose (object);
+}
+
+static void
+nntp_store_finalize (GObject *object)
+{
+ CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (object);
+ struct _xover_header *xover, *xn;
- if (nntp_store->base_url)
- g_free (nntp_store->base_url);
- if (nntp_store->storage_path)
- g_free (nntp_store->storage_path);
+ g_free (nntp_store->base_url);
+ g_free (nntp_store->storage_path);
xover = nntp_store->xover;
while (xover) {
@@ -91,15 +119,8 @@ nntp_store_finalize (CamelObject *object)
xover = xn;
}
- if (nntp_store->cache)
- camel_object_unref (nntp_store->cache);
-
- if (disco_store->diary) {
- camel_object_unref (disco_store->diary);
- disco_store->diary = NULL;
- }
-
- g_free(p);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_nntp_store_parent_class)->finalize (object);
}
static gboolean
@@ -224,13 +245,13 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("Could not connect to %s: %s"),
service->url->host, g_strerror (errno));
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
goto fail;
}
store->stream = (CamelNNTPStream *) camel_nntp_stream_new (tcp_stream);
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
/* Read the greeting, if any. */
if (camel_nntp_stream_line (store->stream, &buf, &len) == -1) {
@@ -242,7 +263,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
_("Could not read greeting from %s: %s"),
service->url->host, g_strerror (errno));
- camel_object_unref (store->stream);
+ g_object_unref (store->stream);
store->stream = NULL;
goto fail;
@@ -254,7 +275,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
_("NNTP server %s returned error code %d: %s"),
service->url->host, len, buf);
- camel_object_unref (store->stream);
+ g_object_unref (store->stream);
store->stream = NULL;
goto fail;
@@ -399,13 +420,12 @@ nntp_disconnect_online (CamelService *service, gboolean clean, CamelException *e
camel_exception_clear(ex);
}
- /* Chain up to parent's disconnect() method. */
if (!service_class->disconnect (service, clean, ex)) {
camel_service_unlock (CAMEL_SERVICE (store), CS_REC_CONNECT_LOCK);
return FALSE;
}
- camel_object_unref (store->stream);
+ g_object_unref (store->stream);
store->stream = NULL;
g_free(store->current_folder);
store->current_folder = NULL;
@@ -427,7 +447,7 @@ nntp_disconnect_offline (CamelService *service, gboolean clean, CamelException *
return FALSE;
if (disco->diary) {
- camel_object_unref (disco->diary);
+ g_object_unref (disco->diary);
disco->diary = NULL;
}
@@ -658,7 +678,7 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const gchar *top,
camel_object_trigger_event((CamelObject *) folder, "folder_changed", changes);
camel_folder_change_info_free(changes);
}
- camel_object_unref (folder);
+ g_object_unref (folder);
}
camel_exception_clear(ex);
}
@@ -1111,11 +1131,16 @@ nntp_construct (CamelService *service, CamelSession *session,
static void
camel_nntp_store_class_init (CamelNNTPStoreClass *class)
{
+ GObjectClass *object_class;
CamelServiceClass *service_class;
CamelStoreClass *store_class;
CamelDiscoStoreClass *disco_store_class;
- camel_nntp_store_parent_class = CAMEL_DISCO_STORE_CLASS (camel_type_get_global_classfuncs (camel_disco_store_get_type ()));
+ g_type_class_add_private (class, sizeof (CamelNNTPStorePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = nntp_store_dispose;
+ object_class->finalize = nntp_store_finalize;
service_class = CAMEL_SERVICE_CLASS (class);
service_class->construct = nntp_construct;
@@ -1155,27 +1180,7 @@ camel_nntp_store_init (CamelNNTPStore *nntp_store)
nntp_store->mem = (CamelStreamMem *)camel_stream_mem_new();
- nntp_store->priv = g_new0 (CamelNNTPStorePrivate, 1);
-}
-
-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,
- "CamelNNTPStore",
- sizeof (CamelNNTPStore),
- sizeof (CamelNNTPStoreClass),
- (CamelObjectClassInitFunc) camel_nntp_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_nntp_store_init,
- (CamelObjectFinalizeFunc) nntp_store_finalize);
- }
-
- return camel_nntp_store_type;
+ nntp_store->priv = CAMEL_NNTP_STORE_GET_PRIVATE (nntp_store);
}
static gint
diff --git a/camel/providers/nntp/camel-nntp-store.h b/camel/providers/nntp/camel-nntp-store.h
index 49c23a1..1a07a95 100644
--- a/camel/providers/nntp/camel-nntp-store.h
+++ b/camel/providers/nntp/camel-nntp-store.h
@@ -28,10 +28,24 @@
#include "camel-nntp-stream.h"
#include "camel-nntp-store-summary.h"
-#define CAMEL_NNTP_STORE_TYPE (camel_nntp_store_get_type ())
-#define CAMEL_NNTP_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_NNTP_STORE_TYPE, CamelNNTPStore))
-#define CAMEL_NNTP_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_NNTP_STORE_TYPE, CamelNNTPStoreClass))
-#define CAMEL_IS_NNTP_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_NNTP_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_NNTP_STORE \
+ (camel_nntp_store_get_type ())
+#define CAMEL_NNTP_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_NNTP_STORE, CamelNNTPStore))
+#define CAMEL_NNTP_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_NNTP_STORE, CamelNNTPStoreClass))
+#define CAMEL_IS_NNTP_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_NNTP_STORE))
+#define CAMEL_IS_NNTP_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_NNTP_STORE))
+#define CAMEL_NNTP_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_NNTP_STORE, CamelNNTPStoreClass))
#define CAMEL_NNTP_EXT_SEARCH (1<<0)
#define CAMEL_NNTP_EXT_SETGET (1<<1)
@@ -93,7 +107,7 @@ struct _CamelNNTPStoreClass {
};
-CamelType camel_nntp_store_get_type (void);
+GType camel_nntp_store_get_type (void);
gint camel_nntp_raw_commandv (CamelNNTPStore *store, struct _CamelException *ex, gchar **line, const gchar *fmt, va_list ap);
gint camel_nntp_raw_command(CamelNNTPStore *store, struct _CamelException *ex, gchar **line, const gchar *fmt, ...);
diff --git a/camel/providers/nntp/camel-nntp-stream.c b/camel/providers/nntp/camel-nntp-stream.c
index da0d56d..c90ecf8 100644
--- a/camel/providers/nntp/camel-nntp-stream.c
+++ b/camel/providers/nntp/camel-nntp-stream.c
@@ -30,17 +30,43 @@
#include "camel-nntp-stream.h"
-#define dd(x) (camel_debug("nntp:stream")?(x):0)
+#define dd(x) (camel_debug ("nntp:stream")?(x):0)
#ifndef ECONNRESET
#define ECONNRESET EIO
#endif
-static CamelObjectClass *parent_class = NULL;
-
#define CAMEL_NNTP_STREAM_SIZE (4096)
#define CAMEL_NNTP_STREAM_LINE_SIZE (1024) /* maximum line size */
+G_DEFINE_TYPE (CamelNNTPStream, camel_nntp_stream, CAMEL_TYPE_STREAM)
+
+static void
+nntp_stream_dispose (GObject *object)
+{
+ CamelNNTPStream *stream = CAMEL_NNTP_STREAM (object);
+
+ if (stream->source != NULL) {
+ g_object_unref (stream->source);
+ stream->source = NULL;
+ }
+
+ /* Chain up to parent's dispose () method. */
+ G_OBJECT_CLASS (camel_nntp_stream_parent_class)->dispose (object);
+}
+
+static void
+nntp_stream_finalize (GObject *object)
+{
+ CamelNNTPStream *stream = CAMEL_NNTP_STREAM (object);
+
+ g_free (stream->buf);
+ g_free (stream->linebuf);
+
+ /* Chain up to parent's finalize () method. */
+ G_OBJECT_CLASS (camel_nntp_stream_parent_class)->finalize (object);
+}
+
static gint
nntp_stream_fill (CamelNNTPStream *is)
{
@@ -67,16 +93,6 @@ nntp_stream_fill (CamelNNTPStream *is)
return 0;
}
-static void
-camel_nntp_stream_finalize(CamelNNTPStream *is)
-{
- g_free (is->buf);
- g_free (is->linebuf);
- if (is->source)
- camel_object_unref (is->source);
-}
-
-
static gssize
nntp_stream_read (CamelStream *stream,
gchar *buffer,
@@ -191,11 +207,14 @@ nntp_stream_reset (CamelStream *stream)
}
static void
-camel_nntp_stream_class_init (CamelStreamClass *class)
+camel_nntp_stream_class_init (CamelNNTPStreamClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
- parent_class = camel_type_get_global_classfuncs( CAMEL_TYPE_OBJECT );
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = nntp_stream_dispose;
+ object_class->finalize = nntp_stream_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = nntp_stream_read;
@@ -221,25 +240,6 @@ camel_nntp_stream_init (CamelNNTPStream *is)
is->mode = CAMEL_NNTP_STREAM_LINE;
}
-CamelType
-camel_nntp_stream_get_type (void)
-{
- static CamelType camel_nntp_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_nntp_stream_type == CAMEL_INVALID_TYPE) {
- camel_nntp_stream_type = camel_type_register( camel_stream_get_type(),
- "CamelNNTPStream",
- sizeof( CamelNNTPStream ),
- sizeof( CamelNNTPStreamClass ),
- (CamelObjectClassInitFunc) camel_nntp_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_nntp_stream_init,
- (CamelObjectFinalizeFunc) camel_nntp_stream_finalize );
- }
-
- return camel_nntp_stream_type;
-}
-
/**
* camel_nntp_stream_new:
*
@@ -253,8 +253,8 @@ camel_nntp_stream_new (CamelStream *source)
{
CamelNNTPStream *is;
- is = (CamelNNTPStream *)camel_object_new(camel_nntp_stream_get_type ());
- is->source = camel_object_ref (source);
+ is = g_object_new (CAMEL_TYPE_NNTP_STREAM, NULL);
+ is->source = g_object_ref (source);
return (CamelStream *)is;
}
diff --git a/camel/providers/nntp/camel-nntp-stream.h b/camel/providers/nntp/camel-nntp-stream.h
index bd5e7a6..f4375d4 100644
--- a/camel/providers/nntp/camel-nntp-stream.h
+++ b/camel/providers/nntp/camel-nntp-stream.h
@@ -23,9 +23,24 @@
#include <camel/camel.h>
-#define CAMEL_NNTP_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_nntp_stream_get_type (), CamelNNTPStream)
-#define CAMEL_NNTP_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_nntp_stream_get_type (), CamelNNTPStreamClass)
-#define CAMEL_IS_NNTP_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_nntp_stream_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_NNTP_STREAM \
+ (camel_nntp_stream_get_type ())
+#define CAMEL_NNTP_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_NNTP_STREAM, CamelNNTPStream))
+#define CAMEL_NNTP_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_NNTP_STREAM, CamelNNTPStreamClass))
+#define CAMEL_IS_NNTP_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_NNTP_STREAM))
+#define CAMEL_IS_NNTP_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_NNTP_STREAM))
+#define CAMEL_NNTP_STREAM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_NNTP_STREAM, CamelNNTPStreamClass))
G_BEGIN_DECLS
@@ -54,7 +69,7 @@ struct _CamelNNTPStreamClass {
CamelStreamClass parent_class;
};
-CamelType camel_nntp_stream_get_type (void);
+GType camel_nntp_stream_get_type (void);
CamelStream * camel_nntp_stream_new (CamelStream *source);
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index be3a060..03853fe 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -47,6 +47,10 @@
#define EXTRACT_FIRST_DIGIT(val) val=strtoul (part, &part, 10);
#define EXTRACT_DIGIT(val) part++; val=strtoul (part, &part, 10);
+#define CAMEL_NNTP_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_NNTP_SUMMARY, CamelNNTPSummaryPrivate))
+
struct _CamelNNTPSummaryPrivate {
gchar *uid;
@@ -62,20 +66,14 @@ static gint summary_header_save (CamelFolderSummary *, FILE *);
static gint summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
static CamelFIRecord * summary_header_to_db (CamelFolderSummary *s, CamelException *ex);
-static gpointer camel_nntp_summary_parent_class;
-
-static void
-nntp_summary_finalize (CamelNNTPSummary *nntp_summary)
-{
- g_free (nntp_summary->priv);
-}
+G_DEFINE_TYPE (CamelNNTPSummary, camel_nntp_summary, CAMEL_TYPE_FOLDER_SUMMARY)
static void
camel_nntp_summary_class_init (CamelNNTPSummaryClass *class)
{
CamelFolderSummaryClass *folder_summary_class;
- camel_nntp_summary_parent_class = CAMEL_FOLDER_SUMMARY_CLASS(camel_type_get_global_classfuncs(camel_folder_summary_get_type()));
+ g_type_class_add_private (class, sizeof (CamelNNTPSummaryPrivate));
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
folder_summary_class->message_info_size = sizeof (CamelMessageInfoBase);
@@ -92,36 +90,18 @@ camel_nntp_summary_init (CamelNNTPSummary *nntp_summary)
{
CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (nntp_summary);
- nntp_summary->priv = g_new0 (CamelNNTPSummaryPrivate, 1);
+ nntp_summary->priv = CAMEL_NNTP_SUMMARY_GET_PRIVATE (nntp_summary);
/* and a unique file version */
summary->version += CAMEL_NNTP_SUMMARY_VERSION;
}
-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),
- sizeof (CamelNNTPSummaryClass),
- (CamelObjectClassInitFunc) camel_nntp_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_nntp_summary_init,
- (CamelObjectFinalizeFunc) nntp_summary_finalize);
- }
-
- return type;
-}
-
CamelNNTPSummary *
camel_nntp_summary_new (CamelFolder *folder, const gchar *path)
{
CamelNNTPSummary *cns;
- cns = (CamelNNTPSummary *)camel_object_new(camel_nntp_summary_get_type());
+ cns = g_object_new (CAMEL_TYPE_NNTP_SUMMARY, NULL);
((CamelFolderSummary *)cns)->folder = folder;
camel_folder_summary_set_filename ((CamelFolderSummary *)cns, path);
@@ -424,7 +404,7 @@ ioerror:
g_free (cns->priv->uid);
cns->priv->uid = NULL;
}
- camel_object_unref (mp);
+ g_object_unref (mp);
camel_operation_end (NULL);
diff --git a/camel/providers/nntp/camel-nntp-summary.h b/camel/providers/nntp/camel-nntp-summary.h
index 5087bb9..b69c735 100644
--- a/camel/providers/nntp/camel-nntp-summary.h
+++ b/camel/providers/nntp/camel-nntp-summary.h
@@ -23,9 +23,24 @@
#include <camel/camel.h>
-#define CAMEL_NNTP_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_nntp_summary_get_type (), CamelNNTPSummary)
-#define CAMEL_NNTP_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_nntp_summary_get_type (), CamelNNTPSummaryClass)
-#define CAMEL_IS_LOCAL_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_nntp_summary_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_NNTP_SUMMARY \
+ (camel_nntp_summary_get_type ())
+#define CAMEL_NNTP_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_NNTP_SUMMARY, CamelNNTPSummary))
+#define CAMEL_NNTP_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_NNTP_SUMMARY, CamelNNTPSummaryClass))
+#define CAMEL_IS_NNTP_SUMMARY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_NNTP_SUMMARY))
+#define CAMEL_IS_NNTP_SUMMARY_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_NNTP_SUMMARY))
+#define CAMEL_NNTP_SUMMARY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_NNTP_SUMMARY, CamelNNTPSummaryClass))
G_BEGIN_DECLS
@@ -49,7 +64,7 @@ struct _CamelNNTPSummaryClass {
CamelFolderSummaryClass parent_class;
};
-CamelType camel_nntp_summary_get_type (void);
+GType camel_nntp_summary_get_type (void);
CamelNNTPSummary *camel_nntp_summary_new(struct _CamelFolder *folder, const gchar *path);
gint camel_nntp_summary_check(CamelNNTPSummary *cns, struct _CamelNNTPStore *store, gchar *line, struct _CamelFolderChangeInfo *changes, struct _CamelException *ex);
diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c
index 631528b..408887c 100644
--- a/camel/providers/pop3/camel-pop3-engine.c
+++ b/camel/providers/pop3/camel-pop3-engine.c
@@ -45,24 +45,44 @@ extern gint camel_verbose_debug;
static void get_capabilities(CamelPOP3Engine *pe);
-static CamelObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (CamelPOP3Engine, camel_pop3_engine, CAMEL_TYPE_OBJECT)
static void
-pop3_engine_finalize (CamelPOP3Engine *engine)
+pop3_engine_dispose (GObject *object)
{
- /* FIXME: Also flush/free any outstanding requests, etc */
+ CamelPOP3Engine *engine = CAMEL_POP3_ENGINE (object);
+
+ if (engine->stream != NULL) {
+ g_object_unref (engine->stream);
+ engine->stream = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_pop3_engine_parent_class)->dispose (object);
+}
+
+static void
+pop3_engine_finalize (GObject *object)
+{
+ CamelPOP3Engine *engine = CAMEL_POP3_ENGINE (object);
- if (engine->stream)
- camel_object_unref (engine->stream);
+ /* FIXME: Also flush/free any outstanding requests, etc */
g_list_free (engine->auth);
g_free (engine->apop);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_pop3_engine_parent_class)->finalize (object);
}
static void
camel_pop3_engine_class_init (CamelPOP3EngineClass *class)
{
- parent_class = camel_type_get_global_classfuncs( CAMEL_TYPE_OBJECT );
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = pop3_engine_dispose;
+ object_class->finalize = pop3_engine_finalize;
}
static void
@@ -74,25 +94,6 @@ camel_pop3_engine_init (CamelPOP3Engine *engine)
engine->state = CAMEL_POP3_ENGINE_DISCONNECT;
}
-CamelType
-camel_pop3_engine_get_type (void)
-{
- static CamelType camel_pop3_engine_type = CAMEL_INVALID_TYPE;
-
- if (camel_pop3_engine_type == CAMEL_INVALID_TYPE) {
- camel_pop3_engine_type = camel_type_register(camel_object_get_type(),
- "CamelPOP3Engine",
- sizeof( CamelPOP3Engine ),
- sizeof( CamelPOP3EngineClass ),
- (CamelObjectClassInitFunc) camel_pop3_engine_class_init,
- NULL,
- (CamelObjectInitFunc) camel_pop3_engine_init,
- (CamelObjectFinalizeFunc) pop3_engine_finalize );
- }
-
- return camel_pop3_engine_type;
-}
-
static gint
read_greeting (CamelPOP3Engine *pe)
{
@@ -132,14 +133,14 @@ camel_pop3_engine_new(CamelStream *source, guint32 flags)
{
CamelPOP3Engine *pe;
- pe = (CamelPOP3Engine *) camel_object_new(camel_pop3_engine_get_type ());
+ pe = g_object_new (CAMEL_TYPE_POP3_ENGINE, NULL);
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);
+ g_object_unref (pe);
return NULL;
}
diff --git a/camel/providers/pop3/camel-pop3-engine.h b/camel/providers/pop3/camel-pop3-engine.h
index 74cb476..89dbaf6 100644
--- a/camel/providers/pop3/camel-pop3-engine.h
+++ b/camel/providers/pop3/camel-pop3-engine.h
@@ -25,9 +25,24 @@
#include "camel-pop3-stream.h"
-#define CAMEL_POP3_ENGINE(obj) CAMEL_CHECK_CAST (obj, camel_pop3_engine_get_type (), CamelPOP3Engine)
-#define CAMEL_POP3_ENGINE_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_pop3_engine_get_type (), CamelPOP3EngineClass)
-#define CAMEL_IS_POP3_ENGINE(obj) CAMEL_CHECK_TYPE (obj, camel_pop3_engine_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_POP3_ENGINE \
+ (camel_pop3_engine_get_type ())
+#define CAMEL_POP3_ENGINE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_POP3_ENGINE, CamelPOP3Engine))
+#define CAMEL_POP3_ENGINE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_POP3_ENGINE, CamelPOP3EngineClass))
+#define CAMEL_IS_POP3_ENGINE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_POP3_ENGINE))
+#define CAMEL_IS_POP3_ENGINE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_POP3_ENGINE))
+#define CAMEL_POP3_ENGINE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_POP3_ENGINE, CamelPOP3EngineClass))
G_BEGIN_DECLS
@@ -121,7 +136,7 @@ struct _CamelPOP3EngineClass {
CamelObjectClass parent_class;
};
-CamelType camel_pop3_engine_get_type (void);
+GType camel_pop3_engine_get_type (void);
CamelPOP3Engine *camel_pop3_engine_new (CamelStream *source, guint32 flags);
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index d774a75..42c7e4b 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -38,8 +38,6 @@
#define d(x)
-static CamelFolderClass *parent_class;
-
static gboolean pop3_refresh_info (CamelFolder *folder, CamelException *ex);
static gboolean pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
static gint pop3_get_message_count (CamelFolder *folder);
@@ -48,8 +46,10 @@ static CamelMimeMessage *pop3_get_message (CamelFolder *folder, const gchar *uid
static gboolean pop3_set_message_flags (CamelFolder *folder, const gchar *uid, guint32 flags, guint32 set);
static gchar * pop3_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
+G_DEFINE_TYPE (CamelPOP3Folder, camel_pop3_folder, CAMEL_TYPE_FOLDER)
+
static void
-pop3_folder_finalize (CamelObject *object)
+pop3_folder_finalize (GObject *object)
{
CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (object);
CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
@@ -71,14 +71,19 @@ pop3_folder_finalize (CamelObject *object)
g_ptr_array_free(pop3_folder->uids, TRUE);
g_hash_table_destroy(pop3_folder->uids_uid);
}
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_pop3_folder_parent_class)->finalize (object);
}
static void
camel_pop3_folder_class_init (CamelPOP3FolderClass *class)
{
+ GObjectClass *object_class;
CamelFolderClass *folder_class;
- parent_class = CAMEL_FOLDER_CLASS(camel_folder_get_type());
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = pop3_folder_finalize;
folder_class = CAMEL_FOLDER_CLASS (class);
folder_class->refresh_info = pop3_refresh_info;
@@ -91,22 +96,9 @@ camel_pop3_folder_class_init (CamelPOP3FolderClass *class)
folder_class->set_message_flags = pop3_set_message_flags;
}
-CamelType
-camel_pop3_folder_get_type (void)
+static void
+camel_pop3_folder_init (CamelPOP3Folder *pop3_folder)
{
- 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),
- sizeof (CamelPOP3FolderClass),
- (CamelObjectClassInitFunc) camel_pop3_folder_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) pop3_folder_finalize);
- }
-
- return camel_pop3_folder_type;
}
CamelFolder *
@@ -116,12 +108,12 @@ camel_pop3_folder_new (CamelStore *parent, CamelException *ex)
d(printf("opening pop3 INBOX folder\n"));
- folder = CAMEL_FOLDER (camel_object_new (CAMEL_POP3_FOLDER_TYPE));
+ folder = g_object_new (CAMEL_TYPE_POP3_FOLDER, NULL);
camel_folder_construct (folder, parent, "inbox", "inbox");
/* mt-ok, since we dont have the folder-lock for new() */
if (!camel_folder_refresh_info (folder, ex)) { /* mt-ok */
- camel_object_unref (folder);
+ g_object_unref (folder);
folder = NULL;
}
@@ -165,7 +157,7 @@ cmd_builduid(CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data)
default:
break;
}
- camel_object_unref (mp);
+ g_object_unref (mp);
g_checksum_get_digest (checksum, digest, &length);
g_checksum_free (checksum);
@@ -385,7 +377,7 @@ pop3_get_message_time_from_cache (CamelFolder *folder, const gchar *uid, time_t
message = camel_mime_message_new ();
if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *)message, stream) == -1) {
g_warning (_("Cannot get message %s: %s"), uid, g_strerror (errno));
- camel_object_unref (message);
+ g_object_unref (message);
message = NULL;
}
@@ -393,12 +385,12 @@ pop3_get_message_time_from_cache (CamelFolder *folder, const gchar *uid, time_t
res = TRUE;
*message_time = message->date + message->date_offset;
- camel_object_unref (message);
+ g_object_unref (message);
}
}
if (stream) {
- camel_object_unref (stream);
+ g_object_unref (stream);
}
return res;
}
@@ -429,7 +421,7 @@ camel_pop3_delete_old (CamelFolder *folder,
message = pop3_get_message (folder, fi->uid, ex);
if (message) {
message_time = message->date + message->date_offset;
- camel_object_unref (message);
+ g_object_unref (message);
}
}
@@ -523,7 +515,7 @@ done:
fi->err = 0;
}
- camel_object_unref (fi->stream);
+ g_object_unref (fi->stream);
fi->stream = NULL;
}
@@ -611,7 +603,7 @@ pop3_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
stream = camel_stream_mem_new();
/* ref it, the cache storage routine unref's when done */
- fi->stream = camel_object_ref (stream);
+ fi->stream = g_object_ref (stream);
fi->err = EIO;
pcr = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_tocache, fi, "RETR %u\r\n", fi->id);
@@ -680,11 +672,11 @@ pop3_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot get message %s: %s"),
uid, g_strerror (errno));
- camel_object_unref (message);
+ g_object_unref (message);
message = NULL;
}
done:
- camel_object_unref (stream);
+ g_object_unref (stream);
fail:
camel_operation_end(NULL);
diff --git a/camel/providers/pop3/camel-pop3-folder.h b/camel/providers/pop3/camel-pop3-folder.h
index 08da313..e40fe76 100644
--- a/camel/providers/pop3/camel-pop3-folder.h
+++ b/camel/providers/pop3/camel-pop3-folder.h
@@ -28,10 +28,24 @@
#include <camel/camel.h>
-#define CAMEL_POP3_FOLDER_TYPE (camel_pop3_folder_get_type ())
-#define CAMEL_POP3_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_POP3_FOLDER_TYPE, CamelPOP3Folder))
-#define CAMEL_POP3_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_POP3_FOLDER_TYPE, CamelPOP3FolderClass))
-#define CAMEL_IS_POP3_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_POP3_FOLDER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_POP3_FOLDER \
+ (camel_pop3_folder_get_type ())
+#define CAMEL_POP3_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_POP3_FOLDER, CamelPOP3Folder))
+#define CAMEL_POP3_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_POP3_FOLDER, CamelPOP3FolderClass))
+#define CAMEL_IS_POP3_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_POP3_FOLDER))
+#define CAMEL_IS_POP3_FOLDER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_POP3_FOLDER))
+#define CAMEL_POP3_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_POP3_FOLDER, CamelPOP3FolderClass))
G_BEGIN_DECLS
@@ -65,7 +79,7 @@ struct _CamelPOP3FolderClass {
/* public methods */
CamelFolder *camel_pop3_folder_new (CamelStore *parent, CamelException *ex);
-CamelType camel_pop3_folder_get_type (void);
+GType camel_pop3_folder_get_type (void);
gint camel_pop3_delete_old(CamelFolder *folder, gint days_to_delete, CamelException *ex);
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 4a471a4..6e31ff7 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -65,8 +65,10 @@ static CamelFolder *get_trash (CamelStore *store, CamelException *ex);
static gboolean pop3_can_refresh_folder (CamelStore *store, CamelFolderInfo *info, CamelException *ex);
+G_DEFINE_TYPE (CamelPOP3Store, camel_pop3_store, CAMEL_TYPE_STORE)
+
static void
-pop3_store_finalize (CamelObject *object)
+pop3_store_finalize (GObject *object)
{
CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (object);
@@ -76,18 +78,23 @@ pop3_store_finalize (CamelObject *object)
camel_service_disconnect((CamelService *)pop3_store, TRUE, NULL);
if (pop3_store->engine)
- camel_object_unref (pop3_store->engine);
+ g_object_unref (pop3_store->engine);
if (pop3_store->cache)
- camel_object_unref (pop3_store->cache);
+ g_object_unref (pop3_store->cache);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_pop3_store_parent_class)->finalize (object);
}
static void
camel_pop3_store_class_init (CamelPOP3StoreClass *class)
{
+ GObjectClass *object_class;
CamelServiceClass *service_class;
CamelStoreClass *store_class;
- camel_pop3_store_parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = pop3_store_finalize;
service_class = CAMEL_SERVICE_CLASS (class);
service_class->query_auth_types = query_auth_types;
@@ -105,25 +112,6 @@ camel_pop3_store_init (CamelPOP3Store *pop3_store)
{
}
-CamelType
-camel_pop3_store_get_type (void)
-{
- static CamelType camel_pop3_store_type = CAMEL_INVALID_TYPE;
-
- if (!camel_pop3_store_type) {
- camel_pop3_store_type = camel_type_register (CAMEL_STORE_TYPE,
- "CamelPOP3Store",
- sizeof (CamelPOP3Store),
- sizeof (CamelPOP3StoreClass),
- (CamelObjectClassInitFunc) camel_pop3_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_pop3_store_init,
- pop3_store_finalize);
- }
-
- return camel_pop3_store_type;
-}
-
enum {
MODE_CLEAR,
MODE_SSL,
@@ -198,14 +186,14 @@ connect_to_server (CamelService *service,
_("Could not connect to %s: %s"),
service->url->host, g_strerror (errno));
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
return FALSE;
}
/* parent class connect initialization */
if (CAMEL_SERVICE_CLASS (camel_pop3_store_parent_class)->connect (service, ex) == FALSE) {
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
return FALSE;
}
@@ -220,12 +208,12 @@ connect_to_server (CamelService *service,
ex, CAMEL_EXCEPTION_SYSTEM,
_("Failed to read a valid greeting from POP server %s"),
service->url->host);
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
return FALSE;
}
if (ssl_mode != MODE_TLS) {
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
return TRUE;
}
@@ -278,7 +266,7 @@ connect_to_server (CamelService *service,
goto stls_exception;
#endif /* HAVE_SSL */
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
/* rfc2595, section 4 states that after a successful STLS
command, the client MUST discard prior CAPA responses */
@@ -295,8 +283,8 @@ connect_to_server (CamelService *service,
camel_pop3_engine_command_free (store->engine, pc);
}
- camel_object_unref (CAMEL_OBJECT (store->engine));
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
+ g_object_unref (CAMEL_OBJECT (store->engine));
+ g_object_unref (CAMEL_OBJECT (tcp_stream));
store->engine = NULL;
return FALSE;
@@ -480,7 +468,7 @@ try_sasl (CamelPOP3Store *store,
goto ioerror;
}
- camel_object_unref (sasl);
+ g_object_unref (sasl);
return 0;
ioerror:
@@ -494,7 +482,7 @@ try_sasl (CamelPOP3Store *store,
CAMEL_SERVICE (store)->url->host, g_strerror (errno));
}
done:
- camel_object_unref (sasl);
+ g_object_unref (sasl);
return -1;
}
@@ -727,7 +715,7 @@ pop3_disconnect (CamelService *service,
if (!service_class->disconnect (service, clean, ex))
return FALSE;
- camel_object_unref (store->engine);
+ g_object_unref (store->engine);
store->engine = NULL;
return TRUE;
diff --git a/camel/providers/pop3/camel-pop3-store.h b/camel/providers/pop3/camel-pop3-store.h
index cb0e80c..31440d3 100644
--- a/camel/providers/pop3/camel-pop3-store.h
+++ b/camel/providers/pop3/camel-pop3-store.h
@@ -30,10 +30,24 @@
#include "camel-pop3-engine.h"
-#define CAMEL_POP3_STORE_TYPE (camel_pop3_store_get_type ())
-#define CAMEL_POP3_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_POP3_STORE_TYPE, CamelPOP3Store))
-#define CAMEL_POP3_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_POP3_STORE_TYPE, CamelPOP3StoreClass))
-#define CAMEL_IS_POP3_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_POP3_STORE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_POP3_STORE \
+ (camel_pop3_store_get_type ())
+#define CAMEL_POP3_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_POP3_STORE, CamelPOP3Store))
+#define CAMEL_POP3_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_POP3_STORE, CamelPOP3StoreClass))
+#define CAMEL_IS_POP3_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_POP3_STORE))
+#define CAMEL_IS_POP3_STORE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_POP3_STORE))
+#define CAMEL_POP3_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_POP3_STORE, CamelPOP3StoreClass))
G_BEGIN_DECLS
@@ -54,7 +68,7 @@ struct _CamelPOP3StoreClass {
CamelStoreClass parent_class;
};
-CamelType camel_pop3_store_get_type (void);
+GType camel_pop3_store_get_type (void);
/* public methods */
void camel_pop3_store_expunge (CamelPOP3Store *store, CamelException *ex);
diff --git a/camel/providers/pop3/camel-pop3-stream.c b/camel/providers/pop3/camel-pop3-stream.c
index 7f9ab1d..01faeee 100644
--- a/camel/providers/pop3/camel-pop3-stream.c
+++ b/camel/providers/pop3/camel-pop3-stream.c
@@ -31,25 +31,40 @@
#include <stdio.h>
#include <string.h>
-#include <glib.h>
-
#include "camel-pop3-stream.h"
extern gint camel_verbose_debug;
#define dd(x) (camel_verbose_debug?(x):0)
-static CamelObjectClass *parent_class = NULL;
-
#define CAMEL_POP3_STREAM_SIZE (4096)
#define CAMEL_POP3_STREAM_LINE (1024) /* maximum line size */
+G_DEFINE_TYPE (CamelPOP3Stream, camel_pop3_stream, CAMEL_TYPE_STREAM)
+
static void
-pop3_stream_finalize (CamelPOP3Stream *is)
+pop3_stream_dispose (GObject *object)
{
- g_free (is->buf);
- g_free (is->linebuf);
- if (is->source)
- camel_object_unref (is->source);
+ CamelPOP3Stream *stream = CAMEL_POP3_STREAM (object);
+
+ if (stream->source != NULL) {
+ g_object_unref (stream->source);
+ stream->source = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_pop3_stream_parent_class)->dispose (object);
+}
+
+static void
+pop3_stream_finalize (GObject *object)
+{
+ CamelPOP3Stream *stream = CAMEL_POP3_STREAM (object);
+
+ g_free (stream->buf);
+ g_free (stream->linebuf);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_pop3_stream_parent_class)->finalize (object);
}
static gint
@@ -195,11 +210,14 @@ stream_reset (CamelStream *stream)
}
static void
-camel_pop3_stream_class_init (CamelStreamClass *class)
+camel_pop3_stream_class_init (CamelPOP3StreamClass *class)
{
+ GObjectClass *object_class;
CamelStreamClass *stream_class;
- parent_class = camel_type_get_global_classfuncs( CAMEL_TYPE_OBJECT );
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = pop3_stream_dispose;
+ object_class->finalize = pop3_stream_finalize;
stream_class = CAMEL_STREAM_CLASS (class);
stream_class->read = stream_read;
@@ -225,25 +243,6 @@ camel_pop3_stream_init (CamelPOP3Stream *is)
is->mode = CAMEL_POP3_STREAM_LINE;
}
-CamelType
-camel_pop3_stream_get_type (void)
-{
- static CamelType camel_pop3_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_pop3_stream_type == CAMEL_INVALID_TYPE) {
- camel_pop3_stream_type = camel_type_register( camel_stream_get_type(),
- "CamelPOP3Stream",
- sizeof( CamelPOP3Stream ),
- sizeof( CamelPOP3StreamClass ),
- (CamelObjectClassInitFunc) camel_pop3_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_pop3_stream_init,
- (CamelObjectFinalizeFunc) pop3_stream_finalize );
- }
-
- return camel_pop3_stream_type;
-}
-
/**
* camel_pop3_stream_new:
*
@@ -257,8 +256,8 @@ camel_pop3_stream_new (CamelStream *source)
{
CamelPOP3Stream *is;
- is = (CamelPOP3Stream *)camel_object_new(camel_pop3_stream_get_type ());
- is->source = camel_object_ref (source);
+ is = g_object_new (CAMEL_TYPE_POP3_STREAM, NULL);
+ is->source = g_object_ref (source);
return (CamelStream *)is;
}
diff --git a/camel/providers/pop3/camel-pop3-stream.h b/camel/providers/pop3/camel-pop3-stream.h
index b5b287b..8aaa085 100644
--- a/camel/providers/pop3/camel-pop3-stream.h
+++ b/camel/providers/pop3/camel-pop3-stream.h
@@ -26,9 +26,24 @@
#include <camel/camel.h>
-#define CAMEL_POP3_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_pop3_stream_get_type (), CamelPOP3Stream)
-#define CAMEL_POP3_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_pop3_stream_get_type (), CamelPOP3StreamClass)
-#define CAMEL_IS_POP3_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_pop3_stream_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_POP3_STREAM \
+ (camel_pop3_stream_get_type ())
+#define CAMEL_POP3_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_POP3_STREAM, CamelPOP3Stream))
+#define CAMEL_POP3_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_POP3_STREAM, CamelPOP3StreamClass))
+#define CAMEL_IS_POP3_STREAM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_POP3_STREAM))
+#define CAMEL_IS_POP3_STREAM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_POP3_STREAM))
+#define CAMEL_POP3_STREAM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_POP3_STREAM, CamelPOP3StreamClass))
G_BEGIN_DECLS
@@ -57,7 +72,7 @@ struct _CamelPOP3StreamClass {
CamelStreamClass parent_class;
};
-CamelType camel_pop3_stream_get_type (void);
+GType camel_pop3_stream_get_type (void);
CamelStream *camel_pop3_stream_new (CamelStream *source);
diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c
index 633ed66..28dc6c8 100644
--- a/camel/providers/sendmail/camel-sendmail-transport.c
+++ b/camel/providers/sendmail/camel-sendmail-transport.c
@@ -44,6 +44,8 @@ static gboolean sendmail_send_to (CamelTransport *transport,
CamelAddress *from, CamelAddress *recipients,
CamelException *ex);
+G_DEFINE_TYPE (CamelSendmailTransport, camel_sendmail_transport, CAMEL_TYPE_TRANSPORT)
+
static void
camel_sendmail_transport_class_init (CamelSendmailTransportClass *class)
{
@@ -57,23 +59,9 @@ camel_sendmail_transport_class_init (CamelSendmailTransportClass *class)
transport_class->send_to = sendmail_send_to;
}
-CamelType
-camel_sendmail_transport_get_type (void)
+static void
+camel_sendmail_transport_init (CamelSendmailTransport *sendmail_transport)
{
- 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",
- sizeof (CamelSendmailTransport),
- sizeof (CamelSendmailTransportClass),
- (CamelObjectClassInitFunc) camel_sendmail_transport_class_init,
- NULL,
- (CamelObjectInitFunc) NULL,
- NULL);
- }
-
- return camel_sendmail_transport_type;
}
static gboolean
@@ -193,13 +181,13 @@ sendmail_send_to (CamelTransport *transport,
filter = camel_stream_filter_new (out);
crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
camel_stream_filter_add (CAMEL_STREAM_FILTER (filter), crlf);
- camel_object_unref (crlf);
- camel_object_unref (out);
+ g_object_unref (crlf);
+ g_object_unref (out);
out = (CamelStream *) filter;
if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), out) == -1
|| camel_stream_close (out) == -1) {
- camel_object_unref (CAMEL_OBJECT (out));
+ g_object_unref (CAMEL_OBJECT (out));
camel_exception_setv (
ex, CAMEL_EXCEPTION_SYSTEM,
_("Could not send message: %s"),
@@ -217,7 +205,7 @@ sendmail_send_to (CamelTransport *transport,
return FALSE;
}
- camel_object_unref (CAMEL_OBJECT (out));
+ g_object_unref (CAMEL_OBJECT (out));
/* Wait for sendmail to exit. */
while (waitpid (pid, &wstat, 0) == -1 && errno == EINTR)
diff --git a/camel/providers/sendmail/camel-sendmail-transport.h b/camel/providers/sendmail/camel-sendmail-transport.h
index 6272e19..7ab978c 100644
--- a/camel/providers/sendmail/camel-sendmail-transport.h
+++ b/camel/providers/sendmail/camel-sendmail-transport.h
@@ -28,10 +28,24 @@
#include <camel/camel.h>
-#define CAMEL_SENDMAIL_TRANSPORT_TYPE (camel_sendmail_transport_get_type ())
-#define CAMEL_SENDMAIL_TRANSPORT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SENDMAIL_TRANSPORT_TYPE, CamelSendmailTransport))
-#define CAMEL_SENDMAIL_TRANSPORT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SENDMAIL_TRANSPORT_TYPE, CamelSendmailTransportClass))
-#define CAMEL_IS_SENDMAIL_TRANSPORT(o) (CAMEL_CHECK_TYPE((o), CAMEL_SENDMAIL_TRANSPORT_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SENDMAIL_TRANSPORT \
+ (camel_sendmail_transport_get_type ())
+#define CAMEL_SENDMAIL_TRANSPORT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SENDMAIL_TRANSPORT, CamelSendmailTransport))
+#define CAMEL_SENDMAIL_TRANSPORT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SENDMAIL_TRANSPORT, CamelSendmailTransportClass))
+#define CAMEL_IS_SENDMAIL_TRANSPORT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SENDMAIL_TRANSPORT))
+#define CAMEL_IS_SENDMAIL_TRANSPORT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SENDMAIL_TRANSPORT))
+#define CAMEL_SENDMAIL_TRANSPORT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SENDMAIL_TRANSPORT, CamelSendmailTransportClass))
G_BEGIN_DECLS
@@ -46,7 +60,7 @@ struct _CamelSendmailTransportClass {
CamelTransportClass parent_class;
};
-CamelType camel_sendmail_transport_get_type (void);
+GType camel_sendmail_transport_get_type (void);
G_END_DECLS
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 66ffce8..7130893 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -77,8 +77,7 @@ static gboolean smtp_quit (CamelSmtpTransport *transport, CamelException *ex);
static void smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const gchar *respbuf,
const gchar *message, CamelException *ex);
-/* private data members */
-static gpointer camel_smtp_transport_parent_class;
+G_DEFINE_TYPE (CamelSmtpTransport, camel_smtp_transport, CAMEL_TYPE_TRANSPORT)
static void
camel_smtp_transport_class_init (CamelSmtpTransportClass *class)
@@ -86,8 +85,6 @@ camel_smtp_transport_class_init (CamelSmtpTransportClass *class)
CamelTransportClass *transport_class;
CamelServiceClass *service_class;
- camel_smtp_transport_parent_class = CAMEL_TRANSPORT_CLASS (camel_type_get_global_classfuncs (camel_transport_get_type ()));
-
service_class = CAMEL_SERVICE_CLASS (class);
service_class->connect = smtp_connect;
service_class->disconnect = smtp_disconnect;
@@ -105,25 +102,6 @@ camel_smtp_transport_init (CamelSmtpTransport *smtp)
smtp->connected = FALSE;
}
-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",
- sizeof (CamelSmtpTransport),
- sizeof (CamelSmtpTransportClass),
- (CamelObjectClassInitFunc) camel_smtp_transport_class_init,
- NULL,
- (CamelObjectInitFunc) camel_smtp_transport_init,
- NULL);
- }
-
- return type;
-}
-
static const gchar *
smtp_error_string (gint error)
{
@@ -249,7 +227,7 @@ connect_to_server (CamelService *service,
_("Could not connect to %s: %s"),
service->url->host, g_strerror (errno));
- camel_object_unref (tcp_stream);
+ g_object_unref (tcp_stream);
return FALSE;
}
@@ -362,9 +340,9 @@ connect_to_server (CamelService *service,
exception_cleanup:
- camel_object_unref (transport->istream);
+ g_object_unref (transport->istream);
transport->istream = NULL;
- camel_object_unref (transport->ostream);
+ g_object_unref (transport->ostream);
transport->ostream = NULL;
transport->connected = FALSE;
@@ -450,7 +428,7 @@ smtp_connect (CamelService *service, CamelException *ex)
truth = camel_sasl_get_authenticated (sasl);
if (chal)
g_byte_array_free (chal, TRUE);
- camel_object_unref (sasl);
+ g_object_unref (sasl);
if (!truth)
return FALSE;
@@ -601,12 +579,12 @@ smtp_disconnect (CamelService *service,
}
if (transport->istream) {
- camel_object_unref (transport->istream);
+ g_object_unref (transport->istream);
transport->istream = NULL;
}
if (transport->ostream) {
- camel_object_unref (transport->ostream);
+ g_object_unref (transport->ostream);
transport->ostream = NULL;
}
@@ -1021,7 +999,9 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
respbuf = camel_stream_buffer_read_line (
CAMEL_STREAM_BUFFER (transport->istream));
if (!respbuf || strncmp (respbuf, "250", 3)) {
- smtp_set_exception (transport, FALSE, respbuf, _("HELO command failed"), ex);
+ smtp_set_exception (
+ transport, FALSE, respbuf,
+ _("HELO command failed"), ex);
camel_operation_end (NULL);
g_free (respbuf);
return FALSE;
@@ -1186,7 +1166,7 @@ smtp_auth (CamelSmtpTransport *transport,
if (strncmp (respbuf, "235", 3) != 0)
goto lose;
- camel_object_unref (sasl);
+ g_object_unref (sasl);
camel_operation_end (NULL);
return TRUE;
@@ -1205,7 +1185,7 @@ smtp_auth (CamelSmtpTransport *transport,
_("Bad authentication response from server.\n"));
}
- camel_object_unref (sasl);
+ g_object_unref (sasl);
camel_operation_end (NULL);
g_free (respbuf);
@@ -1382,8 +1362,8 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
filter = camel_mime_filter_progress_new (NULL, null->written);
camel_stream_filter_add (
CAMEL_STREAM_FILTER (filtered_stream), filter);
- camel_object_unref (filter);
- camel_object_unref (null);
+ g_object_unref (filter);
+ g_object_unref (null);
/* setup LF->CRLF conversion */
filter = camel_mime_filter_crlf_new (
@@ -1391,7 +1371,7 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS);
camel_stream_filter_add (
CAMEL_STREAM_FILTER (filtered_stream), filter);
- camel_object_unref (filter);
+ g_object_unref (filter);
/* write the message */
ret = camel_data_wrapper_write_to_stream (
@@ -1405,14 +1385,14 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
_("DATA command failed: %s: mail not sent"),
g_strerror (errno));
- camel_object_unref (filtered_stream);
+ g_object_unref (filtered_stream);
camel_service_disconnect ((CamelService *) transport, FALSE, NULL);
return FALSE;
}
camel_stream_flush (filtered_stream);
- camel_object_unref (filtered_stream);
+ g_object_unref (filtered_stream);
/* terminate the message body */
diff --git a/camel/providers/smtp/camel-smtp-transport.h b/camel/providers/smtp/camel-smtp-transport.h
index 57e61e0..faebdb2 100644
--- a/camel/providers/smtp/camel-smtp-transport.h
+++ b/camel/providers/smtp/camel-smtp-transport.h
@@ -27,10 +27,24 @@
#include <camel/camel.h>
-#define CAMEL_SMTP_TRANSPORT_TYPE (camel_smtp_transport_get_type ())
-#define CAMEL_SMTP_TRANSPORT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SMTP_TRANSPORT_TYPE, CamelSmtpTransport))
-#define CAMEL_SMTP_TRANSPORT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SMTP_TRANSPORT_TYPE, CamelSmtpTransportClass))
-#define CAMEL_IS_SMTP_TRANSPORT(o) (CAMEL_CHECK_TYPE((o), CAMEL_SMTP_TRANSPORT_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_SMTP_TRANSPORT \
+ (camel_smtp_transport_get_type ())
+#define CAMEL_SMTP_TRANSPORT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SMTP_TRANSPORT, CamelSmtpTransport))
+#define CAMEL_SMTP_TRANSPORT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SMTP_TRANSPORT, CamelSmtpTransportClass))
+#define CAMEL_IS_SMTP_TRANSPORT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SMTP_TRANSPORT))
+#define CAMEL_IS_SMTP_TRANSPORT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SMTP_TRANSPORT))
+#define CAMEL_SMTP_TRANSPORT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SMTP_TRANSPORT, CamelSmtpTransportClass))
#define CAMEL_SMTP_TRANSPORT_IS_ESMTP (1 << 0)
#define CAMEL_SMTP_TRANSPORT_8BITMIME (1 << 1)
@@ -66,7 +80,7 @@ struct _CamelSmtpTransportClass {
CamelTransportClass parent_class;
};
-CamelType camel_smtp_transport_get_type (void);
+GType camel_smtp_transport_get_type (void);
G_END_DECLS
diff --git a/camel/tests/folder/test1.c b/camel/tests/folder/test1.c
index d8b86e0..649a30b 100644
--- a/camel/tests/folder/test1.c
+++ b/camel/tests/folder/test1.c
@@ -9,7 +9,7 @@ static const gchar *local_drivers[] = {
"local"
};
-static gchar *local_providers[] = {
+static const gchar *local_providers[] = {
"mbox",
"mh",
"maildir"
@@ -43,7 +43,7 @@ gint main(gint argc, gchar **argv)
g_free(path);
}
- camel_object_unref (session);
+ g_object_unref (session);
camel_exception_free(ex);
return 0;
diff --git a/camel/tests/folder/test10.c b/camel/tests/folder/test10.c
index 44a405f..c362273 100644
--- a/camel/tests/folder/test10.c
+++ b/camel/tests/folder/test10.c
@@ -14,7 +14,7 @@
#define d(x)
static const gchar *local_drivers[] = { "local" };
-static gchar *local_providers[] = {
+static const gchar *local_providers[] = {
"mbox",
"mh",
"maildir"
@@ -38,11 +38,11 @@ worker(gpointer d)
folder = camel_store_get_folder(store, "testbox", CAMEL_STORE_FOLDER_CREATE, ex);
camel_exception_clear(ex);
if (testid == 0) {
- camel_object_unref (folder);
- camel_object_unref (store);
+ g_object_unref (folder);
+ g_object_unref (store);
} else {
- camel_object_unref (store);
- camel_object_unref (folder);
+ g_object_unref (store);
+ g_object_unref (folder);
}
}
@@ -51,7 +51,8 @@ worker(gpointer d)
return NULL;
}
-gint main(gint argc, gchar **argv)
+gint
+main(gint argc, gchar **argv)
{
CamelException *ex;
gint i, j;
@@ -101,7 +102,7 @@ gint main(gint argc, gchar **argv)
camel_test_end();
}
- camel_object_unref (session);
+ g_object_unref (session);
camel_exception_free(ex);
return 0;
diff --git a/camel/tests/folder/test11.c b/camel/tests/folder/test11.c
index 9875667..302609c 100644
--- a/camel/tests/folder/test11.c
+++ b/camel/tests/folder/test11.c
@@ -92,7 +92,8 @@ check_fi(CamelFolderInfo *fi, CamelFolderInfo *list, gint len)
g_ptr_array_free(folders, TRUE);
}
-gint main(gint argc, gchar **argv)
+gint
+main(gint argc, gchar **argv)
{
CamelException *ex;
CamelFolder *f1, *f2;
diff --git a/camel/tests/folder/test2.c b/camel/tests/folder/test2.c
index 3ab9043..b57ec2d 100644
--- a/camel/tests/folder/test2.c
+++ b/camel/tests/folder/test2.c
@@ -12,7 +12,7 @@
static const gchar *local_drivers[] = { "local" };
-static gchar *stores[] = {
+static const gchar *stores[] = {
"mbox:///tmp/camel-test/mbox",
"mh:///tmp/camel-test/mh",
"maildir:///tmp/camel-test/maildir"
diff --git a/camel/tests/folder/test3.c b/camel/tests/folder/test3.c
index b34db78..d96890e 100644
--- a/camel/tests/folder/test3.c
+++ b/camel/tests/folder/test3.c
@@ -130,7 +130,7 @@ run_search(CamelFolder *folder, gint m)
static const gchar *local_drivers[] = { "local" };
-static gchar *stores[] = {
+static const gchar *stores[] = {
"mbox:///tmp/camel-test/mbox",
"mh:///tmp/camel-test/mh",
"maildir:///tmp/camel-test/maildir"
@@ -162,7 +162,7 @@ gint main(gint argc, gchar **argv)
/* we iterate over all stores we want to test, with indexing or indexing turned on or off */
for (i = 0; i < G_N_ELEMENTS (stores); i++) {
- gchar *name = stores[i];
+ const gchar *name = stores[i];
for (indexed = 0;indexed<2;indexed++) {
gchar *what = g_strdup_printf("folder search: %s (%sindexed)", name, indexed?"":"non-");
gint flags;
diff --git a/camel/tests/folder/test4.c b/camel/tests/folder/test4.c
index 60123fd..8cdfe42 100644
--- a/camel/tests/folder/test4.c
+++ b/camel/tests/folder/test4.c
@@ -7,7 +7,7 @@
static const gchar *imap_drivers[] = { "imap4" };
-static gchar *remote_providers[] = {
+static const gchar *remote_providers[] = {
"IMAP_TEST_URL",
};
@@ -44,7 +44,7 @@ gint main(gint argc, gchar **argv)
/*camel_test_fatal();*/
}
- camel_object_unref (session);
+ g_object_unref (session);
camel_exception_free(ex);
return 0;
diff --git a/camel/tests/folder/test5.c b/camel/tests/folder/test5.c
index e1412f5..db99240 100644
--- a/camel/tests/folder/test5.c
+++ b/camel/tests/folder/test5.c
@@ -7,7 +7,7 @@
static const gchar *nntp_drivers[] = { "nntp" };
-static gchar *remote_providers[] = {
+static const gchar *remote_providers[] = {
"NNTP_TEST_URL",
};
@@ -44,7 +44,7 @@ gint main(gint argc, gchar **argv)
camel_test_fatal();
}
- camel_object_unref (session);
+ g_object_unref (session);
camel_exception_free(ex);
return 0;
diff --git a/camel/tests/folder/test6.c b/camel/tests/folder/test6.c
index 6af5dea..3f5541c 100644
--- a/camel/tests/folder/test6.c
+++ b/camel/tests/folder/test6.c
@@ -6,7 +6,7 @@
#include "session.h"
static const gchar *imap_drivers[] = { "imap4" };
-static gchar *remote_providers[] = {
+static const gchar *remote_providers[] = {
"IMAP_TEST_URL",
};
diff --git a/camel/tests/folder/test7.c b/camel/tests/folder/test7.c
index 5e99fe3..a705096 100644
--- a/camel/tests/folder/test7.c
+++ b/camel/tests/folder/test7.c
@@ -7,7 +7,7 @@
#include "session.h"
static const gchar *nntp_drivers[] = { "nntp" };
-static gchar *remote_providers[] = {
+static const gchar *remote_providers[] = {
"NNTP_TEST_URL",
};
diff --git a/camel/tests/folder/test8.c b/camel/tests/folder/test8.c
index e50ae24..41befdc 100644
--- a/camel/tests/folder/test8.c
+++ b/camel/tests/folder/test8.c
@@ -15,7 +15,7 @@
static const gchar *local_drivers[] = { "local" };
-static gchar *local_providers[] = {
+static const gchar *local_providers[] = {
"mbox",
"mh",
"maildir"
@@ -85,7 +85,7 @@ worker(gpointer d)
content = g_strdup_printf("Test message %08x contents\n\n", id+i);
push("comparing content '%s': '%s'", res->pdata[0], content);
- test_message_compare_content(camel_medium_get_content ((CamelMedium *)msg), content, strlen(content));
+ test_message_compare_content(camel_medium_get_content((CamelMedium *)msg), content, strlen(content));
test_free(content);
pull();
@@ -204,7 +204,7 @@ gint main(gint argc, gchar **argv)
}
}
- camel_object_unref (session);
+ g_object_unref (session);
camel_exception_free(ex);
return 0;
diff --git a/camel/tests/folder/test9.c b/camel/tests/folder/test9.c
index 1e7d377..2ee34ff 100644
--- a/camel/tests/folder/test9.c
+++ b/camel/tests/folder/test9.c
@@ -11,7 +11,7 @@
static const gchar *local_drivers[] = { "local" };
struct {
- gchar *name;
+ const gchar *name;
CamelFolder *folder;
} mailboxes[] = {
{ "INBOX", NULL },
@@ -22,7 +22,7 @@ struct {
};
struct {
- gchar *name, *match, *action;
+ const gchar *name, *match, *action;
} rules[] = {
{ "empty1", "(match-all (header-contains \"Frobnitz\"))", "(copy-to \"folder1\")" },
{ "empty2", "(header-contains \"Frobnitz\")", "(copy-to \"folder2\")" },
@@ -37,7 +37,7 @@ struct {
/* broken match rules */
struct {
- gchar *name, *match, *action;
+ const gchar *name, *match, *action;
} brokens[] = {
{ "count1", "(body-contains data50)", "(copy-to \"folder1\")" }, /* non string argument */
{ "count1", "(body-contains-stuff \"data3\")", "(move-to-folder \"folder2\")" }, /* invalid function */
@@ -53,7 +53,7 @@ struct {
/* broken action rules */
struct {
- gchar *name, *match, *action;
+ const gchar *name, *match, *action;
} brokena[] = {
{ "a", "(body-contains \"data2\")", "(body-contains \"help\")" }, /* rule in action */
{ "a", "(body-contains \"data2\")", "(move-to-folder-name \"folder2\")" }, /* unknown function */
@@ -65,13 +65,17 @@ struct {
{ "a", "(body-contains \"data2\")", "" }, /* empty */
};
-static CamelFolder *get_folder(CamelFilterDriver *d, const gchar *uri, gpointer data, CamelException *ex)
+static CamelFolder *
+get_folder (CamelFilterDriver *d,
+ const gchar *uri,
+ gpointer data,
+ CamelException *ex);
{
gint i;
for (i = 0; i < G_N_ELEMENTS (mailboxes); i++)
if (!strcmp(mailboxes[i].name, uri)) {
- return camel_object_ref (mailboxes[i].folder);
+ return g_object_ref (mailboxes[i].folder);
}
return NULL;
}
diff --git a/camel/tests/lib/camel-test-provider.c b/camel/tests/lib/camel-test-provider.c
index 29a4076..75bdac0 100644
--- a/camel/tests/lib/camel-test-provider.c
+++ b/camel/tests/lib/camel-test-provider.c
@@ -1,7 +1,8 @@
-
+#include "camel-test-provider.h"
#include "camel-test.h"
-void camel_test_provider_init(gint argc, gchar **argv)
+void
+camel_test_provider_init (gint argc, const gchar **argv)
{
gchar *name, *path;
gint i;
diff --git a/camel/tests/lib/camel-test-provider.h b/camel/tests/lib/camel-test-provider.h
index 2ab7ba1..3c90ce2 100644
--- a/camel/tests/lib/camel-test-provider.h
+++ b/camel/tests/lib/camel-test-provider.h
@@ -4,6 +4,6 @@
#include <glib.h>
-void camel_test_provider_init(gint argc, gchar **argv);
+void camel_test_provider_init(gint argc, const gchar **argv);
#endif
diff --git a/camel/tests/lib/camel-test.h b/camel/tests/lib/camel-test.h
index ca4a5eb..b569142 100644
--- a/camel/tests/lib/camel-test.h
+++ b/camel/tests/lib/camel-test.h
@@ -27,14 +27,14 @@ static void check_msg(gint truth, gchar *fmt, ...)
#endif
#define check_count(object, expected) do { \
- if (CAMEL_OBJECT(object)->ref_count != expected) { \
- camel_test_fail("%s->ref_count != %s\n\tref_count = %d", #object, #expected, CAMEL_OBJECT(object)->ref_count); \
+ if (G_OBJECT (object)->ref_count != expected) { \
+ camel_test_fail("%s->ref_count != %s\n\tref_count = %d", #object, #expected, G_OBJECT (object)->ref_count); \
} \
} while (0)
#define check_unref(object, expected) do { \
check_count(object, expected); \
- camel_object_unref (CAMEL_OBJECT(object)); \
+ g_object_unref(CAMEL_OBJECT(object)); \
if (expected == 1) { \
object = NULL; \
} \
diff --git a/camel/tests/lib/folders.c b/camel/tests/lib/folders.c
index 4c23c43..c7059f5 100644
--- a/camel/tests/lib/folders.c
+++ b/camel/tests/lib/folders.c
@@ -105,7 +105,7 @@ test_folder_message(CamelFolder *folder, const gchar *uid)
/* cross check with info */
test_message_info(msg, info);
- camel_object_unref (msg);
+ g_object_unref (msg);
/* see if it is in the summary (only once) */
s = camel_folder_get_summary(folder);
diff --git a/camel/tests/lib/folders.h b/camel/tests/lib/folders.h
index 07d8bba..006a297 100644
--- a/camel/tests/lib/folders.h
+++ b/camel/tests/lib/folders.h
@@ -1,4 +1,6 @@
+#include <camel/camel.h>
+
/* check the total/unread is what we think it should be, everywhere it can be determined */
void test_folder_counts(CamelFolder *folder, gint total, gint unread);
/* cross-check info/msg */
diff --git a/camel/tests/lib/messages.c b/camel/tests/lib/messages.c
index fa79f51..a6cbee0 100644
--- a/camel/tests/lib/messages.c
+++ b/camel/tests/lib/messages.c
@@ -57,14 +57,14 @@ test_message_set_content_simple(CamelMimePart *part, gint how, const gchar *type
break;
case 3:
ba = g_byte_array_new();
- g_byte_array_append(ba, text, len);
+ g_byte_array_append(ba, (guint8 *) text, len);
content = (CamelStreamMem *)camel_stream_mem_new_with_byte_array(ba);
ba = NULL;
break;
case 4:
ba = g_byte_array_new();
- g_byte_array_append(ba, text, len);
+ g_byte_array_append(ba, (guint8 *) text, len);
content = (CamelStreamMem *)camel_stream_mem_new();
camel_stream_mem_set_byte_array(content, ba);
@@ -95,8 +95,8 @@ test_message_write_file(CamelMimeMessage *msg, const gchar *name)
camel_data_wrapper_write_to_stream((CamelDataWrapper *)msg, (CamelStream *)file);
ret = camel_stream_close((CamelStream *)file);
- check(((CamelObject *)file)->ref_count == 1);
- camel_object_unref (file);
+ check(G_OBJECT (file)->ref_count == 1);
+ g_object_unref (file);
return ret;
}
@@ -112,8 +112,8 @@ test_message_read_file(const gchar *name)
camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg2, (CamelStream *)file);
/* file's refcount may be > 1 if the message is real big */
- check(CAMEL_OBJECT(file)->ref_count >=1);
- camel_object_unref (file);
+ check(G_OBJECT(file)->ref_count >=1);
+ g_object_unref (file);
return msg2;
}
@@ -165,7 +165,7 @@ test_message_compare_content(CamelDataWrapper *dw, const gchar *text, gint len)
if (byte_array->len != len) {
printf ("original text:\n");
- hexdump (text, len);
+ hexdump ((guchar *) text, len);
printf ("new text:\n");
hexdump (byte_array->data, byte_array->len);
@@ -223,8 +223,8 @@ test_message_compare (CamelMimeMessage *msg)
check_msg (memcmp (byte_array1->data, byte_array2->data, byte_array1->len) == 0, "msg/stream compare");
- camel_object_unref (stream1);
- camel_object_unref (stream2);
+ g_object_unref (stream1);
+ g_object_unref (stream2);
return 0;
}
@@ -254,11 +254,11 @@ message_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, gint depth)
s[depth] = 0;
mime_type = camel_data_wrapper_get_mime_type((CamelDataWrapper *)part);
- printf("%sPart <%s>\n", s, ((CamelObject *)part)->klass->name);
+ printf("%sPart <%s>\n", s, G_OBJECT_TYPE_NAME (part));
printf("%sContent-Type: %s\n", s, mime_type);
g_free(mime_type);
printf("%s encoding: %s\n", s, camel_transfer_encoding_to_string(((CamelDataWrapper *)part)->encoding));
- printf("%s part encoding: %s\n", s, camel_transfer_encoding_to_string(camel_mime_part_get_encoding(part)));
+ printf("%s part encoding: %s\n", s, camel_transfer_encoding_to_string(camel_mime_part_get_encoding (part)));
containee = camel_medium_get_content (CAMEL_MEDIUM (part));
@@ -266,7 +266,7 @@ message_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, gint depth)
return;
mime_type = camel_data_wrapper_get_mime_type(containee);
- printf("%sContent <%s>\n", s, ((CamelObject *)containee)->klass->name);
+ printf("%sContent <%s>\n", s, G_OBJECT_TYPE_NAME (containee));
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));
diff --git a/camel/tests/lib/session.c b/camel/tests/lib/session.c
index a3d3d2b..b155069 100644
--- a/camel/tests/lib/session.c
+++ b/camel/tests/lib/session.c
@@ -4,31 +4,16 @@
#include "session.h"
+G_DEFINE_TYPE (CamelTestSession, camel_test_session, CAMEL_TYPE_SESSION)
+
static void
-class_init (CamelTestSessionClass *camel_test_session_class)
+camel_test_session_class_init (CamelTestSessionClass *class)
{
- CamelSessionClass *camel_session_class =
- CAMEL_SESSION_CLASS (camel_test_session_class);
}
-CamelType
-camel_test_session_get_type (void)
+static void
+camel_test_session_init (CamelTestSession *test_session)
{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_session_get_type (),
- "CamelTestSession",
- sizeof (CamelTestSession),
- sizeof (CamelTestSessionClass),
- (CamelObjectClassInitFunc) class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
}
CamelSession *
@@ -36,8 +21,7 @@ camel_test_session_new (const gchar *path)
{
CamelSession *session;
- session = CAMEL_SESSION (camel_object_new (CAMEL_TEST_SESSION_TYPE));
-
+ session = g_object_new (CAMEL_TYPE_TEST_SESSION, NULL);
camel_session_construct (session, path);
return session;
diff --git a/camel/tests/lib/session.h b/camel/tests/lib/session.h
index b0a1204..2b2e5ec 100644
--- a/camel/tests/lib/session.h
+++ b/camel/tests/lib/session.h
@@ -1,19 +1,38 @@
#include <camel/camel.h>
-#define CAMEL_TEST_SESSION_TYPE (camel_test_session_get_type ())
-#define CAMEL_TEST_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TEST_SESSION_TYPE, CamelTestSession))
-#define CAMEL_TEST_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TEST_SESSION_TYPE, CamelTestSessionClass))
-#define CAMEL_TEST_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_TEST_SESSION_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_TEST_SESSION \
+ (camel_test_session_get_type ())
+#define CAMEL_TEST_SESSION(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_TEST_SESSION, CamelTestSession))
+#define CAMEL_TEST_SESSION_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_TEST_SESSION, CamelTestSessionClass))
+#define CAMEL_IS_TEST_SESSION(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_TEST_SESSION))
+#define CAMEL_IS_TEST_SESSION_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_TEST_SESSION))
+#define CAMEL_TEST_SESSION_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_TEST_SESSION, CamelTestSessionClass))
-typedef struct _CamelTestSession {
- CamelSession parent;
+G_BEGIN_DECLS
-} CamelTestSession;
+typedef struct _CamelTestSession CamelTestSession;
+typedef struct _CamelTestSessionClass CamelTestSessionClass;
-typedef struct _CamelTestSessionClass {
- CamelSessionClass parent_class;
+struct _CamelTestSession {
+ CamelSession parent;
+};
-} CamelTestSessionClass;
+struct _CamelTestSessionClass {
+ CamelSessionClass parent_class;
+};
-CamelType camel_test_session_get_type (void);
+GType camel_test_session_get_type (void);
CamelSession *camel_test_session_new (const gchar *path);
+
+G_END_DECLS
diff --git a/camel/tests/lib/streams.c b/camel/tests/lib/streams.c
index 266a61b..4229a35 100644
--- a/camel/tests/lib/streams.c
+++ b/camel/tests/lib/streams.c
@@ -147,7 +147,7 @@ test_seekable_substream_writepart(CamelStream *s, gint type)
len = (ss->bound_end-ss->bound_start) % sizeof(teststring);
check(camel_stream_write(s, teststring, len) == len);
check(camel_seekable_stream_tell(CAMEL_SEEKABLE_STREAM(s)) == ss->bound_end);
- if (type == 0) {
+ if (G_UNLIKELY (type == G_TYPE_INVALID)) {
check(camel_stream_write(s, teststring, sizeof(teststring)) == 0);
check(camel_stream_eos(s));
check(camel_seekable_stream_tell(CAMEL_SEEKABLE_STREAM(s)) == ss->bound_end);
diff --git a/camel/tests/message/test3.c b/camel/tests/message/test3.c
index 568d436..b10a8a3 100644
--- a/camel/tests/message/test3.c
+++ b/camel/tests/message/test3.c
@@ -37,37 +37,37 @@ gint main(gint argc, gchar **argv)
part = camel_mime_part_new();
test_message_set_content_simple(part, 0, "text/plain", "content part 1", strlen("content part 1"));
camel_multipart_add_part(mp, part);
- check(CAMEL_OBJECT(part)->ref_count == 2);
+ check(G_OBJECT(part)->ref_count == 2);
check(camel_multipart_get_number(mp) == 1);
check(camel_multipart_get_part(mp, 0) == part);
check(camel_multipart_get_part(mp, 1) == NULL);
camel_multipart_remove_part(mp, part);
- check(CAMEL_OBJECT(part)->ref_count == 1);
+ check(G_OBJECT(part)->ref_count == 1);
check(camel_multipart_get_number(mp) == 0);
check(camel_multipart_get_part(mp, 0) == NULL);
check(camel_multipart_get_part(mp, 1) == NULL);
camel_multipart_add_part_at(mp, part, 0);
- check(CAMEL_OBJECT(part)->ref_count == 2);
+ check(G_OBJECT(part)->ref_count == 2);
check(camel_multipart_get_number(mp) == 1);
check(camel_multipart_get_part(mp, 0) == part);
check(camel_multipart_get_part(mp, 1) == NULL);
check(camel_multipart_remove_part_at(mp, 1) == NULL);
- check(CAMEL_OBJECT(part)->ref_count == 2);
+ check(G_OBJECT(part)->ref_count == 2);
check(camel_multipart_get_number(mp) == 1);
check(camel_multipart_get_part(mp, 0) == part);
check(camel_multipart_get_part(mp, 1) == NULL);
check(camel_multipart_remove_part_at(mp, 0) == part);
- check(CAMEL_OBJECT(part)->ref_count == 1);
+ check(G_OBJECT(part)->ref_count == 1);
check(camel_multipart_get_number(mp) == 0);
check(camel_multipart_get_part(mp, 0) == NULL);
check(camel_multipart_get_part(mp, 1) == NULL);
camel_multipart_add_part(mp, part);
- check(CAMEL_OBJECT(part)->ref_count == 2);
+ check(G_OBJECT(part)->ref_count == 2);
check(camel_multipart_get_number(mp) == 1);
check(camel_multipart_get_part(mp, 0) == part);
check(camel_multipart_get_part(mp, 1) == NULL);
@@ -75,7 +75,7 @@ gint main(gint argc, gchar **argv)
part2 = camel_mime_part_new();
test_message_set_content_simple(part2, 0, "text/plain", "content part 2", strlen("content part 2"));
camel_multipart_add_part(mp, part2);
- check(CAMEL_OBJECT(part2)->ref_count == 2);
+ check(G_OBJECT(part2)->ref_count == 2);
check(camel_multipart_get_number(mp) == 2);
check(camel_multipart_get_part(mp, 0) == part);
check(camel_multipart_get_part(mp, 1) == part2);
@@ -83,7 +83,7 @@ gint main(gint argc, gchar **argv)
part3 = camel_mime_part_new();
test_message_set_content_simple(part3, 0, "text/plain", "content part 3", strlen("content part 3"));
camel_multipart_add_part_at(mp, part3, 1);
- check(CAMEL_OBJECT(part3)->ref_count == 2);
+ check(G_OBJECT(part3)->ref_count == 2);
check(camel_multipart_get_number(mp) == 3);
check(camel_multipart_get_part(mp, 0) == part);
check(camel_multipart_get_part(mp, 1) == part3);
diff --git a/camel/tests/message/test4.c b/camel/tests/message/test4.c
index 835bc3f..574fc18 100644
--- a/camel/tests/message/test4.c
+++ b/camel/tests/message/test4.c
@@ -43,7 +43,7 @@ dump_mime_struct (CamelMimePart *mime_part, gint depth)
i++;
}
- content = camel_medium_get_content_object ((CamelMedium *) mime_part);
+ content = camel_medium_get_content ((CamelMedium *) mime_part);
mime_type = camel_data_wrapper_get_mime_type (content);
printf ("Content-Type: %s\n", mime_type);
@@ -108,8 +108,8 @@ gint main (gint argc, gchar **argv)
/*dump_mime_struct ((CamelMimePart *) message, 0);*/
test_message_compare (message);
- camel_object_unref (message);
- camel_object_unref (stream);
+ g_object_unref (message);
+ g_object_unref (stream);
pull ();
}
diff --git a/camel/tests/mime-filter/test-charset.c b/camel/tests/mime-filter/test-charset.c
index e859260..17e60c4 100644
--- a/camel/tests/mime-filter/test-charset.c
+++ b/camel/tests/mime-filter/test-charset.c
@@ -72,7 +72,7 @@ main (gint argc, gchar **argv)
ext = strchr (charset, '.');
*((gchar *) ext) = '\0';
- if (!(f = (CamelMimeFilter *) camel_mime_filter_charset_new (charset, "UTF-8"))) {
+ if (!(f = camel_mime_filter_charset_new (charset, "UTF-8"))) {
camel_test_fail ("Couldn't create CamelMimeFilterCharset??");
g_free (charset);
continue;
@@ -80,7 +80,7 @@ main (gint argc, gchar **argv)
g_free (charset);
camel_stream_filter_add (filter, f);
- camel_object_unref (f);
+ g_object_unref (f);
camel_test_push ("Running filter and comparing to correct result");
@@ -126,9 +126,9 @@ main (gint argc, gchar **argv)
/* inefficient */
camel_test_push ("Cleaning up");
- camel_object_unref (CAMEL_OBJECT (filter));
- camel_object_unref (CAMEL_OBJECT (correct));
- camel_object_unref (CAMEL_OBJECT (source));
+ g_object_unref (CAMEL_OBJECT (filter));
+ g_object_unref (CAMEL_OBJECT (correct));
+ g_object_unref (CAMEL_OBJECT (source));
camel_test_pull ();
camel_test_end ();
diff --git a/camel/tests/mime-filter/test-crlf.c b/camel/tests/mime-filter/test-crlf.c
index 602c934..68582d5 100644
--- a/camel/tests/mime-filter/test-crlf.c
+++ b/camel/tests/mime-filter/test-crlf.c
@@ -139,10 +139,10 @@ main (gint argc, gchar **argv)
/* 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_object_unref (CAMEL_OBJECT (sh));
+ g_object_unref (CAMEL_OBJECT (filter));
+ g_object_unref (CAMEL_OBJECT (correct));
+ g_object_unref (CAMEL_OBJECT (source));
+ g_object_unref (CAMEL_OBJECT (sh));
camel_test_pull ();
camel_test_pull ();
diff --git a/camel/tests/mime-filter/test-tohtml.c b/camel/tests/mime-filter/test-tohtml.c
index 70ce4da..731ae63 100644
--- a/camel/tests/mime-filter/test-tohtml.c
+++ b/camel/tests/mime-filter/test-tohtml.c
@@ -47,12 +47,12 @@ test_filter(CamelMimeFilter *f, const gchar *inname, const gchar *outname)
byte_array_in = g_byte_array_new ();
in = camel_stream_mem_new_with_byte_array (byte_array_in);
- filter = (CamelStream *)camel_stream_filter_new (indisk);
+ filter = camel_stream_filter_new (indisk);
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(camel_stream_write_to_stream(filter, in) > 0);
check_msg(byte_array_in->len == byte_array_out->len
&& memcmp(byte_array_in->data, byte_array_out->data, byte_array_in->len) == 0,
"Buffer content mismatch, %d != %d, in = '%.*s' != out = '%.*s'", byte_array_in->len, byte_array_out->len,
@@ -75,7 +75,7 @@ test_filter(CamelMimeFilter *f, const gchar *inname, const gchar *outname)
byte_array_in = g_byte_array_new ();
in = camel_stream_mem_new_with_byte_array (byte_array_in);
- filter = (CamelStream *)camel_stream_filter_new (in);
+ filter = camel_stream_filter_new (in);
check_count(in, 2);
id = camel_stream_filter_add((CamelStreamFilter *)filter, f);
check_count(f, 2);
diff --git a/camel/tests/mime-filter/test1.c b/camel/tests/mime-filter/test1.c
index f7fed37..1cf3212 100644
--- a/camel/tests/mime-filter/test1.c
+++ b/camel/tests/mime-filter/test1.c
@@ -16,8 +16,8 @@
struct {
gint flags;
- gchar *in;
- gchar *out;
+ const gchar *in;
+ const gchar *out;
} tests[] = {
{ CAMEL_MIME_FILTER_CANON_FROM|CAMEL_MIME_FILTER_CANON_CRLF,
"From \nRussia - with love.\n\n",
@@ -51,7 +51,7 @@ struct {
gint
main (gint argc, gchar **argv)
{
- CamelStreamFilter *filter;
+ CamelStream *filter;
CamelMimeFilter *sh;
gint i;
@@ -68,7 +68,7 @@ main (gint argc, gchar **argv)
for (step=1;step<20;step++) {
GByteArray *byte_array;
CamelStream *out;
- gchar *p;
+ const gchar *p;
camel_test_push("Chunk size %d\n", step);
diff --git a/camel/tests/misc/split.c b/camel/tests/misc/split.c
index 8c87bd9..7947e72 100644
--- a/camel/tests/misc/split.c
+++ b/camel/tests/misc/split.c
@@ -4,7 +4,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <glib.h>
#include <camel/camel-search-private.h>
#include "camel-test.h"
@@ -12,10 +11,10 @@
/* TODO: should put utf8 stuff here too */
static struct {
- gchar *word;
+ const gchar *word;
gint count;
struct {
- gchar *word;
+ const gchar *word;
gint type;
} splits[5];
} split_tests[] = {
@@ -33,10 +32,10 @@ static struct {
};
static struct {
- gchar *word;
+ const gchar *word;
gint count;
struct {
- gchar *word;
+ const gchar *word;
gint type;
} splits[5];
} simple_tests[] = {
diff --git a/camel/tests/misc/test1.c b/camel/tests/misc/test1.c
index b5f6fd5..e607b6a 100644
--- a/camel/tests/misc/test1.c
+++ b/camel/tests/misc/test1.c
@@ -8,8 +8,8 @@
#include "camel-test.h"
struct {
- gchar *header;
- gchar *values[5];
+ const gchar *header;
+ const gchar *values[5];
} test1[] = {
{ "<test camel host>", { "test camel host" } },
{ "(this is a comment) <test camel host>", { "test camel host" } },
diff --git a/camel/tests/misc/test2.c b/camel/tests/misc/test2.c
index e4d6f66..f56c1c0 100644
--- a/camel/tests/misc/test2.c
+++ b/camel/tests/misc/test2.c
@@ -11,9 +11,9 @@
/* NB: We know which order the params will be decoded in, plain in the order they come,
and rfc2184 encoded following those, sorted lexigraphically */
struct {
- gchar *list;
+ const gchar *list;
gint count;
- gchar *params[8];
+ const gchar *params[8];
} test1[] = {
{ "; charset=\"iso-8859-1\"",
1,
@@ -44,8 +44,8 @@ struct {
struct {
gint count;
- gchar *params[8];
- gchar *list;
+ const gchar *params[8];
+ const gchar *list;
} test2[] = {
{ 1,
{ "name", "Doul\xC3\xADk01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123457890123456789123456789" },
diff --git a/camel/tests/misc/url-scan.c b/camel/tests/misc/url-scan.c
index 9476526..a3381e1 100644
--- a/camel/tests/misc/url-scan.c
+++ b/camel/tests/misc/url-scan.c
@@ -31,7 +31,7 @@
#include "camel-test.h"
struct {
- gchar *text, *url;
+ const gchar *text, *url;
} url_tests[] = {
{ "bob foo com", "mailto:bob foo com" },
{ "Ends with bob foo com", "mailto:bob foo com" },
diff --git a/camel/tests/misc/url.c b/camel/tests/misc/url.c
index dcdb06f..b7b6951 100644
--- a/camel/tests/misc/url.c
+++ b/camel/tests/misc/url.c
@@ -7,10 +7,10 @@
#include "camel-test.h"
-gchar *base = "http://a/b/c/d;p?q#f";
+const gchar *base = "http://a/b/c/d;p?q#f";
struct {
- gchar *url_string, *result;
+ const gchar *url_string, *result;
} tests[] = {
{ "g:h", "g:h" },
{ "g", "http://a/b/c/g" },
diff --git a/camel/tests/misc/utf7.c b/camel/tests/misc/utf7.c
index b4d439c..c80e1f1 100644
--- a/camel/tests/misc/utf7.c
+++ b/camel/tests/misc/utf7.c
@@ -4,13 +4,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <glib.h>
#include "camel-test.h"
static struct {
guchar *utf8;
- gchar *utf7;
+ const gchar *utf7;
guint32 unicode[200];
} tests[] = {
/* the escape gchar */
diff --git a/camel/tests/smime/pgp-mime.c b/camel/tests/smime/pgp-mime.c
index 3e6870a..d4cfcd9 100644
--- a/camel/tests/smime/pgp-mime.c
+++ b/camel/tests/smime/pgp-mime.c
@@ -37,9 +37,9 @@ static gchar test_msg[] = "Since we need to make sure that\nFrom lines work okay
"the basics at least...\n";
#define CAMEL_PGP_SESSION_TYPE (camel_pgp_session_get_type ())
-#define CAMEL_PGP_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_PGP_SESSION_TYPE, CamelPgpSession))
-#define CAMEL_PGP_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_PGP_SESSION_TYPE, CamelPgpSessionClass))
-#define CAMEL_PGP_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_PGP_SESSION_TYPE))
+#define CAMEL_PGP_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CAMEL_PGP_SESSION_TYPE, CamelPgpSession))
+#define CAMEL_PGP_SESSION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAMEL_PGP_SESSION_TYPE, CamelPgpSessionClass))
+#define CAMEL_PGP_IS_SESSION(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CAMEL_PGP_SESSION_TYPE))
typedef struct _CamelPgpSession {
CamelSession parent_object;
@@ -68,26 +68,24 @@ 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;
}
-static CamelType
+static GType
camel_pgp_session_get_type (void)
{
- static CamelType type = CAMEL_INVALID_TYPE;
+ static GType type = G_TYPE_INVALID;
- if (type == CAMEL_INVALID_TYPE) {
+ if (G_UNLIKELY (type == G_TYPE_INVALID))
type = camel_type_register (
- camel_test_session_get_type (),
+ CAMEL_TYPE_TEST_SESSION,
"CamelPgpSession",
sizeof (CamelPgpSession),
sizeof (CamelPgpSessionClass),
- (CamelObjectClassInitFunc) class_init,
+ (GClassInitFunc) class_init,
NULL,
- (CamelObjectInitFunc) init,
+ (GInstanceInitFunc) init,
NULL);
- }
return type;
}
@@ -104,8 +102,7 @@ camel_pgp_session_new (const gchar *path)
{
CamelSession *session;
- session = CAMEL_SESSION (camel_object_new (CAMEL_PGP_SESSION_TYPE));
-
+ session = g_object_new (CAMEL_TYPE_PGP_SESSION, NULL);
camel_session_construct (session, path);
return session;
@@ -158,7 +155,7 @@ gint main (gint argc, gchar **argv)
check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
camel_test_pull ();
- camel_object_unref (mime_part);
+ g_object_unref (mime_part);
camel_exception_clear (ex);
camel_test_push ("PGP/MIME verify");
@@ -168,7 +165,7 @@ gint main (gint argc, gchar **argv)
camel_cipher_validity_free (valid);
camel_test_pull ();
- camel_object_unref (mps);
+ g_object_unref (mps);
camel_exception_clear (ex);
mime_part = camel_mime_part_new ();
@@ -186,17 +183,17 @@ gint main (gint argc, gchar **argv)
camel_test_pull ();
camel_exception_clear (ex);
- camel_object_unref (mime_part);
+ g_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);
+ g_object_unref (mime_part);
+ g_object_unref (mpe);
camel_test_pull ();
- camel_object_unref (CAMEL_OBJECT (ctx));
- camel_object_unref (CAMEL_OBJECT (session));
+ g_object_unref (CAMEL_OBJECT (ctx));
+ g_object_unref (CAMEL_OBJECT (session));
camel_test_end ();
diff --git a/camel/tests/smime/pgp.c b/camel/tests/smime/pgp.c
index f5f7972..483767e 100644
--- a/camel/tests/smime/pgp.c
+++ b/camel/tests/smime/pgp.c
@@ -32,10 +32,10 @@
#include "camel-test.h"
#include "session.h"
-#define CAMEL_PGP_SESSION_TYPE (camel_pgp_session_get_type ())
-#define CAMEL_PGP_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_PGP_SESSION_TYPE, CamelPgpSession))
-#define CAMEL_PGP_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_PGP_SESSION_TYPE, CamelPgpSessionClass))
-#define CAMEL_PGP_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_PGP_SESSION_TYPE))
+#define CAMEL_TYPE_PGP_SESSION (camel_pgp_session_get_type ())
+#define CAMEL_PGP_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CAMEL_TYPE_PGP_SESSION, CamelPgpSession))
+#define CAMEL_PGP_SESSION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAMEL_TYPE_PGP_SESSION, CamelPgpSessionClass))
+#define CAMEL_PGP_IS_SESSION(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CAMEL_TYPE_PGP_SESSION))
typedef struct _CamelPgpSession {
CamelSession parent_object;
@@ -52,24 +52,19 @@ static gchar *get_password (CamelSession *session, const gchar *prompt,
CamelService *service, const gchar *item,
CamelException *ex);
-static void
-init (CamelPgpSession *session)
-{
- ;
-}
+G_DEFINE_TYPE (CamelPgpSession, camel_pgp_session, camel_test_session_get_type ())
static void
-class_init (CamelPgpSessionClass *camel_pgp_session_class)
+camel_pgp_session_class_init (CamelPgpSessionClass *class)
{
- CamelSessionClass *camel_session_class =
- CAMEL_SESSION_CLASS (camel_pgp_session_class);
+ CamelSessionClass *session_class;
- /* virtual method override */
+ session_class = CAMEL_SESSION_CLASS (class);
camel_session_class->get_password = get_password;
}
-static CamelType
-camel_pgp_session_get_type (void)
+static void
+camel_pgp_session_init (CamelPgpSession *session)
{
static CamelType type = CAMEL_INVALID_TYPE;
@@ -100,8 +95,7 @@ camel_pgp_session_new (const gchar *path)
{
CamelSession *session;
- session = CAMEL_SESSION (camel_object_new (CAMEL_PGP_SESSION_TYPE));
-
+ session = g_object_new (CAMEL_TYPE_PGP_SESSION, NULL);
camel_session_construct (session, path);
return session;
@@ -114,10 +108,10 @@ gint main (gint argc, gchar **argv)
CamelException *ex;
CamelCipherValidity *valid;
CamelStream *stream1, *stream2;
+ GByteArray *buffer1, *buffer2;
struct _CamelMimePart *sigpart, *conpart, *encpart, *outpart;
CamelDataWrapper *dw;
GPtrArray *recipients;
- GByteArray *buf;
gchar *before, *after;
gint ret;
@@ -159,8 +153,8 @@ gint main (gint argc, gchar **argv)
dw = camel_data_wrapper_new();
camel_data_wrapper_construct_from_stream(dw, stream1);
camel_medium_set_content ((CamelMedium *)conpart, dw);
- camel_object_unref (stream1);
- camel_object_unref (dw);
+ g_object_unref (stream1);
+ g_object_unref (dw);
sigpart = camel_mime_part_new();
@@ -182,8 +176,8 @@ gint main (gint argc, gchar **argv)
camel_cipher_validity_free (valid);
camel_test_pull ();
- camel_object_unref (conpart);
- camel_object_unref (sigpart);
+ g_object_unref (conpart);
+ g_object_unref (sigpart);
stream1 = camel_stream_mem_new ();
camel_stream_write (stream1, "Hello, I am a test of encryption/decryption.", 44);
@@ -194,8 +188,8 @@ gint main (gint argc, gchar **argv)
camel_stream_reset(stream1);
camel_data_wrapper_construct_from_stream(dw, stream1);
camel_medium_set_content ((CamelMedium *)conpart, dw);
- camel_object_unref (stream1);
- camel_object_unref (dw);
+ g_object_unref (stream1);
+ g_object_unref (dw);
encpart = camel_mime_part_new();
@@ -203,7 +197,7 @@ gint main (gint argc, gchar **argv)
camel_test_push ("PGP encrypt");
recipients = g_ptr_array_new ();
- g_ptr_array_add (recipients, "no user no domain");
+ g_ptr_array_add (recipients, (guint8 *) "no user no domain");
camel_cipher_encrypt (ctx, "no user no domain", recipients, conpart, encpart, ex);
check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
g_ptr_array_free (recipients, TRUE);
@@ -217,30 +211,30 @@ gint main (gint argc, gchar **argv)
check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
check_msg (valid->encrypt.status == CAMEL_CIPHER_VALIDITY_ENCRYPT_ENCRYPTED, "%s", valid->encrypt.description);
- stream1 = camel_stream_mem_new();
- stream2 = camel_stream_mem_new();
+ buffer1 = g_byte_array_new ();
+ stream1 = camel_stream_mem_new_with_byte_array (buffer1);
+ buffer2 = g_byte_array_new ();
+ stream2 = camel_stream_mem_new_with_byte_array (buffer2);
camel_data_wrapper_write_to_stream((CamelDataWrapper *)conpart, stream1);
camel_data_wrapper_write_to_stream((CamelDataWrapper *)outpart, stream2);
- buf = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (stream1));
- before = g_strndup (buf->data, buf->len);
- buf = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (stream2));
- after = g_strndup (buf->data, buf->len);
+ before = g_strndup ((gchar *) buffer1->data, buffer1->len);
+ after = g_strndup ((gchar *) buffer2->data, buffer2->len);
check_msg (string_equal (before, after), "before = '%s', after = '%s'", before, after);
g_free (before);
g_free (after);
- camel_object_unref (stream1);
- camel_object_unref (stream2);
- camel_object_unref (conpart);
- camel_object_unref (encpart);
- camel_object_unref (outpart);
+ g_object_unref (stream1);
+ g_object_unref (stream2);
+ g_object_unref (conpart);
+ g_object_unref (encpart);
+ g_object_unref (outpart);
camel_test_pull ();
- camel_object_unref (CAMEL_OBJECT (ctx));
- camel_object_unref (CAMEL_OBJECT (session));
+ g_object_unref (CAMEL_OBJECT (ctx));
+ g_object_unref (CAMEL_OBJECT (session));
camel_test_end ();
diff --git a/camel/tests/smime/pkcs7.c b/camel/tests/smime/pkcs7.c
index 73dc143..c6c7d66 100644
--- a/camel/tests/smime/pkcs7.c
+++ b/camel/tests/smime/pkcs7.c
@@ -7,9 +7,9 @@
#include "camel-test.h"
#define CAMEL_TEST_SESSION_TYPE (camel_test_session_get_type ())
-#define CAMEL_TEST_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TEST_SESSION_TYPE, CamelTestSession))
-#define CAMEL_TEST_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TEST_SESSION_TYPE, CamelTestSessionClass))
-#define CAMEL_TEST_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_TEST_SESSION_TYPE))
+#define CAMEL_TEST_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CAMEL_TEST_SESSION_TYPE, CamelTestSession))
+#define CAMEL_TEST_SESSION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAMEL_TEST_SESSION_TYPE, CamelTestSessionClass))
+#define CAMEL_TEST_IS_SESSION(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CAMEL_TEST_SESSION_TYPE))
typedef struct _CamelTestSession {
CamelSession parent_object;
@@ -37,26 +37,24 @@ 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;
}
-static CamelType
+static GType
camel_test_session_get_type (void)
{
- static CamelType type = CAMEL_INVALID_TYPE;
+ static GType type = G_TYPE_INVALID;
- if (type == CAMEL_INVALID_TYPE) {
+ if (G_UNLIKELY (type == G_TYPE_INVALID))
type = camel_type_register (
- camel_test_session_get_type (),
+ CAMEL_TEST_SESSION_TYPE,
"CamelTestSession",
sizeof (CamelTestSession),
sizeof (CamelTestSessionClass),
- (CamelObjectClassInitFunc) class_init,
+ (GClassInitFunc) class_init,
NULL,
- (CamelObjectInitFunc) init,
+ (GInstanceInitFunc) init,
NULL);
- }
return type;
}
@@ -73,8 +71,7 @@ camel_test_session_new (const gchar *path)
{
CamelSession *session;
- session = CAMEL_SESSION (camel_object_new (CAMEL_TEST_SESSION_TYPE));
-
+ session = g_object_new (CAMEL_TYPE_TEST_SESSION, NULL);
camel_session_construct (session, path);
return session;
@@ -127,8 +124,8 @@ gint main (gint argc, gchar **argv)
camel_cipher_validity_free (valid);
camel_test_pull ();
- camel_object_unref (CAMEL_OBJECT (stream1));
- camel_object_unref (CAMEL_OBJECT (stream2));
+ g_object_unref (CAMEL_OBJECT (stream1));
+ g_object_unref (CAMEL_OBJECT (stream2));
stream1 = camel_stream_mem_new ();
stream2 = camel_stream_mem_new ();
@@ -163,8 +160,8 @@ gint main (gint argc, gchar **argv)
g_free (after);
camel_test_pull ();
- camel_object_unref (CAMEL_OBJECT (ctx));
- camel_object_unref (CAMEL_OBJECT (session));
+ g_object_unref (CAMEL_OBJECT (ctx));
+ g_object_unref (CAMEL_OBJECT (session));
camel_test_end ();
diff --git a/camel/tests/stream/test1.c b/camel/tests/stream/test1.c
index c45cfea..e6e12c9 100644
--- a/camel/tests/stream/test1.c
+++ b/camel/tests/stream/test1.c
@@ -8,7 +8,8 @@
#include <sys/stat.h>
#include <unistd.h>
-gint main(gint argc, gchar **argv)
+gint
+main(gint argc, gchar **argv)
{
CamelSeekableStream *ss = NULL;
gint i;
diff --git a/camel/tests/stream/test2.c b/camel/tests/stream/test2.c
index 22ab779..5cc16ac 100644
--- a/camel/tests/stream/test2.c
+++ b/camel/tests/stream/test2.c
@@ -8,15 +8,12 @@
#include <sys/stat.h>
#include <unistd.h>
-gint main(gint argc, gchar **argv)
+gint
+main(gint argc, gchar **argv)
{
CamelSeekableStream *ss = NULL;
- gint i;
- gint fd = -1;
- struct stat st;
- gint size;
- gchar buffer[1024];
GByteArray *ba;
+ gint i;
camel_test_init(argc, argv);
diff --git a/camel/tests/stream/test3.c b/camel/tests/stream/test3.c
index 0f48fca..6f52e42 100644
--- a/camel/tests/stream/test3.c
+++ b/camel/tests/stream/test3.c
@@ -29,7 +29,8 @@ struct {
{ 10245, CAMEL_STREAM_UNBOUND },
};
-gint main(gint argc, gchar **argv)
+gint
+main(gint argc, gchar **argv)
{
CamelSeekableStream *ss = NULL;
gint i, j;
diff --git a/docs/reference/camel/Makefile.am b/docs/reference/camel/Makefile.am
index 2b7704a..2e37ee0 100644
--- a/docs/reference/camel/Makefile.am
+++ b/docs/reference/camel/Makefile.am
@@ -14,7 +14,7 @@ HTML_DIR = $(datadir)/gtk-doc/html
SCAN_OPTIONS = --deprecated-guards="CAMEL_DISABLE_DEPRECATED"
# Extra options to pass to gtkdoc-scangobj
-SCANGOBJ_OPTIONS=--type-init-func="camel_init (\".\", 0)"
+SCANGOBJ_OPTIONS =
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS = --sgml-mode --output-format=xml --name-space=camel
@@ -26,8 +26,9 @@ GTKDOC_CFLAGS = \
-I$(top_builddir)/camel \
$(GLIB_CFLAGS)
-GTKDOC_LIBS = \
- $(top_builddir)/camel/libcamel-2.0.la \
+GTKDOC_LIBS = \
+ $(top_builddir)/camel/libcamel-1.2.la \
+ $(top_builddir)/camel/libcamel-provider-1.2.la \
$(GLIB_LIBS)
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
@@ -51,19 +52,11 @@ IGNORE_HFILES = \
camel-net-utils-win32.h \
camel-nntp-private.h \
camel-nntp-types.h \
- camel-private.h \
camel-search-private.h \
camel-types.h \
- camel-imapx-exception.h \
- camel-imapx-folder.h \
- camel-imapx-server.h \
- camel-imapx-store.h \
- camel-imapx-store-summary.h \
- camel-imapx-stream.h \
- camel-imapx-summary.h \
- camel-imapx-tokenise.h \
- camel-imapx-utils.h \
- camel-imapx-view-summary.h
+ camel-win32.h \
+ providers \
+ tests
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index bf0147c..8bfdeba 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -15,9 +15,13 @@ camel_address_remove
<SUBSECTION Standard>
CAMEL_ADDRESS
CAMEL_IS_ADDRESS
+CAMEL_TYPE_ADDRESS
CAMEL_ADDRESS_CLASS
+CAMEL_IS_ADDRESS_CLASS
+CAMEL_ADDRESS_GET_CLASS
CamelAddressClass
<SUBSECTION Private>
+CamelAddressPrivate
camel_address_get_type
</SECTION>
@@ -54,9 +58,23 @@ camel_key_file_delete
camel_key_file_write
camel_key_file_read
<SUBSECTION Standard>
+CAMEL_BLOCK_FILE
+CAMEL_IS_BLOCK_FILE
+CAMEL_TYPE_BLOCK_FILE
+CAMEL_BLOCK_FILE_CLASS
+CAMEL_IS_BLOCK_FILE_CLASS
+CAMEL_BLOCK_FILE_GET_CLASS
+CAMEL_KEY_FILE
+CAMEL_IS_KEY_FILE
+CAMEL_TYPE_KEY_FILE
+CAMEL_KEY_FILE_CLASS
+CAMEL_IS_KEY_FILE_CLASS
+CAMEL_KEY_FILE_GET_CLASS
CamelBlockFileClass
CamelKeyFileClass
<SUBSECTION Private>
+CamelBlockFilePrivate
+CamelKeyFilePrivate
camel_block_file_get_type
camel_key_file_get_type
</SECTION>
@@ -96,10 +114,13 @@ camel_cert_set_trust
<SUBSECTION Standard>
CAMEL_CERTDB
CAMEL_IS_CERTDB
-CAMEL_CERTDB_TYPE
+CAMEL_TYPE_CERTDB
CAMEL_CERTDB_CLASS
+CAMEL_IS_CERTDB_CLASS
+CAMEL_CERTDB_GET_CLASS
CamelCertDBClass
<SUBSECTION Private>
+CamelCertDBPrivate
camel_certdb_get_type
</SECTION>
@@ -114,7 +135,7 @@ camel_cipher_validity_sign_t
camel_cipher_validity_encrypt_t
camel_cipher_validity_mode_t
camel_cipher_context_new
-camel_cipher_context_construct
+camel_cipher_context_get_session
camel_cipher_id_to_hash
camel_cipher_hash_to_id
camel_cipher_sign
@@ -139,10 +160,13 @@ camel_cipher_canonical_to_stream
<SUBSECTION Standard>
CAMEL_CIPHER_CONTEXT
CAMEL_IS_CIPHER_CONTEXT
-CAMEL_CIPHER_CONTEXT_TYPE
+CAMEL_TYPE_CIPHER_CONTEXT
CAMEL_CIPHER_CONTEXT_CLASS
+CAMEL_IS_CIPHER_CONTEXT_CLASS
+CAMEL_CIPHER_CONTEXT_GET_CLASS
CamelCipherContextClass
<SUBSECTION Private>
+CamelCipherContextPrivate
camel_cipher_context_get_type
</SECTION>
@@ -153,19 +177,20 @@ CamelDataCache
camel_data_cache_new
camel_data_cache_set_expire_age
camel_data_cache_set_expire_access
-camel_data_cache_rename
camel_data_cache_add
camel_data_cache_get
camel_data_cache_remove
-camel_data_cache_clear
camel_data_cache_get_filename
<SUBSECTION Standard>
CAMEL_DATA_CACHE
CAMEL_IS_DATA_CACHE
-CAMEL_DATA_CACHE_TYPE
+CAMEL_TYPE_DATA_CACHE
CAMEL_DATA_CACHE_CLASS
+CAMEL_IS_DATA_CACHE_CLASS
+CAMEL_DATA_CACHE_GET_CLASS
CamelDataCacheClass
<SUBSECTION Private>
+CamelDataCachePrivate
camel_data_cache_get_type
</SECTION>
@@ -185,10 +210,13 @@ camel_data_wrapper_is_offline
<SUBSECTION Standard>
CAMEL_DATA_WRAPPER
CAMEL_IS_DATA_WRAPPER
-CAMEL_DATA_WRAPPER_TYPE
+CAMEL_TYPE_DATA_WRAPPER
CAMEL_DATA_WRAPPER_CLASS
+CAMEL_IS_DATA_WRAPPER_CLASS
+CAMEL_DATA_WRAPPER_GET_CLASS
CamelDataWrapperClass
<SUBSECTION Private>
+CamelDataWrapperPrivate
camel_data_wrapper_get_type
</SECTION>
@@ -281,8 +309,10 @@ camel_disco_diary_uidmap_lookup
<SUBSECTION Standard>
CAMEL_DISCO_DIARY
CAMEL_IS_DISCO_DIARY
-CAMEL_DISCO_DIARY_TYPE
+CAMEL_TYPE_DISCO_DIARY
CAMEL_DISCO_DIARY_CLASS
+CAMEL_IS_DISCO_DIARY_CLASS
+CAMEL_DISCO_DIARY_GET_CLASS
CamelDiscoDiaryClass
<SUBSECTION Private>
camel_disco_diary_get_type
@@ -298,14 +328,38 @@ camel_disco_folder_prepare_for_offline
<SUBSECTION Standard>
CAMEL_DISCO_FOLDER
CAMEL_IS_DISCO_FOLDER
-CAMEL_DISCO_FOLDER_TYPE
+CAMEL_TYPE_DISCO_FOLDER
CAMEL_DISCO_FOLDER_CLASS
+CAMEL_IS_DISCO_FOLDER_CLASS
+CAMEL_DISCO_FOLDER_GET_CLASS
CamelDiscoFolderClass
<SUBSECTION Private>
camel_disco_folder_get_type
</SECTION>
<SECTION>
+<FILE>camel-disco-store</FILE>
+<TITLE>CamelDiscoStore</TITLE>
+CamelDiscoStore
+CamelDiscoStoreStatus
+camel_disco_store_status
+camel_disco_store_set_status
+camel_disco_store_can_work_offline
+camel_disco_store_check_online
+camel_disco_store_prepare_for_offline
+<SUBSECTION Standard>
+CAMEL_DISCO_STORE
+CAMEL_IS_DISCO_STORE
+CAMEL_TYPE_DISCO_STORE
+CAMEL_DISCO_STORE_CLASS
+CAMEL_IS_DISCO_STORE_CLASS
+CAMEL_DISCO_STORE_GET_CLASS
+CamelDiscoStoreClass
+<SUBSECTION Private>
+camel_disco_store_get_type
+</SECTION>
+
+<SECTION>
<FILE>camel-filter-driver</FILE>
<TITLE>CamelFilterDriver</TITLE>
CamelFilterDriver
@@ -327,10 +381,13 @@ camel_filter_driver_filter_folder
<SUBSECTION Standard>
CAMEL_FILTER_DRIVER
CAMEL_IS_FILTER_DRIVER
-CAMEL_FILTER_DRIVER_TYPE
+CAMEL_TYPE_FILTER_DRIVER
CAMEL_FILTER_DRIVER_CLASS
+CAMEL_IS_FILTER_DRIVER_CLASS
+CAMEL_FILTER_DRIVER_GET_CLASS
CamelFilterDriverClass
<SUBSECTION Private>
+CamelFilterDriverPrivate
camel_filter_driver_get_type
</SECTION>
@@ -416,10 +473,13 @@ camel_folder_change_info_recent_uid
<SUBSECTION Standard>
CAMEL_FOLDER
CAMEL_IS_FOLDER
-CAMEL_FOLDER_TYPE
+CAMEL_TYPE_FOLDER
CAMEL_FOLDER_CLASS
+CAMEL_IS_FOLDER_CLASS
+CAMEL_FOLDER_GET_CLASS
CamelFolderClass
<SUBSECTION Private>
+CamelFolderPrivate
camel_folder_get_type
</SECTION>
@@ -439,10 +499,13 @@ camel_folder_search_free_result
<SUBSECTION Standard>
CAMEL_FOLDER_SEARCH
CAMEL_IS_FOLDER_SEARCH
-CAMEL_FOLDER_SEARCH_TYPE
+CAMEL_TYPE_FOLDER_SEARCH
CAMEL_FOLDER_SEARCH_CLASS
+CAMEL_IS_FOLDER_SEARCH_CLASS
+CAMEL_FOLDER_SEARCH_GET_CLASS
CamelFolderSearchClass
<SUBSECTION Private>
+CamelFolderSearchPrivate
camel_folder_search_get_type
</SECTION>
@@ -563,10 +626,13 @@ camel_folder_summary_migrate_infos
<SUBSECTION Standard>
CAMEL_FOLDER_SUMMARY
CAMEL_IS_FOLDER_SUMMARY
-CAMEL_FOLDER_SUMMARY_TYPE
+CAMEL_TYPE_FOLDER_SUMMARY
CAMEL_FOLDER_SUMMARY_CLASS
+CAMEL_IS_FOLDER_SUMMARY_CLASS
+CAMEL_FOLDER_SUMMARY_GET_CLASS
CamelFolderSummaryClass
<SUBSECTION Private>
+CamelFolderSummaryPrivate
camel_folder_summary_get_type
</SECTION>
@@ -579,10 +645,13 @@ camel_gpg_context_set_always_trust
<SUBSECTION Standard>
CAMEL_GPG_CONTEXT
CAMEL_IS_GPG_CONTEXT
-CAMEL_GPG_CONTEXT_TYPE
+CAMEL_TYPE_GPG_CONTEXT
CAMEL_GPG_CONTEXT_CLASS
+CAMEL_IS_GPG_CONTEXT_CLASS
+CAMEL_GPG_CONTEXT_GET_CLASS
CamelGpgContextClass
<SUBSECTION Private>
+CamelGpgContextPrivate
camel_gpg_context_get_type
</SECTION>
@@ -601,9 +670,13 @@ camel_html_parser_attr_list
<SUBSECTION Standard>
CAMEL_HTML_PARSER
CAMEL_IS_HTML_PARSER
+CAMEL_TYPE_HTML_PARSER
CAMEL_HTML_PARSER_CLASS
+CAMEL_IS_HTML_PARSER_CLASS
+CAMEL_HTML_PARSER_GET_CLASS
CamelHTMLParserClass
<SUBSECTION Private>
+CamelHTMLParserPrivate
camel_html_parser_get_type
</SECTION>
@@ -621,8 +694,10 @@ camel_http_stream_get_content_type
<SUBSECTION Standard>
CAMEL_HTTP_STREAM
CAMEL_IS_HTTP_STREAM
-CAMEL_HTTP_STREAM_TYPE
+CAMEL_TYPE_HTTP_STREAM
CAMEL_HTTP_STREAM_CLASS
+CAMEL_IS_HTTP_STREAM_CLASS
+CAMEL_HTTP_STREAM_GET_CLASS
CamelHttpStreamClass
<SUBSECTION Private>
camel_http_stream_get_type
@@ -647,7 +722,6 @@ CAMEL_INDEX_DELETED
camel_index_new
camel_index_construct
camel_index_rename
-camel_index_set_normalise
camel_index_sync
camel_index_compress
camel_index_delete
@@ -662,21 +736,32 @@ camel_index_names
<SUBSECTION Standard>
CAMEL_INDEX
CAMEL_IS_INDEX
-camel_index_get_type
+CAMEL_TYPE_INDEX
CAMEL_INDEX_CLASS
+CAMEL_IS_INDEX_CLASS
+CAMEL_INDEX_GET_CLASS
CAMEL_INDEX_NAME
CAMEL_IS_INDEX_NAME
-camel_index_name_get_type
+CAMEL_TYPE_INDEX_NAME
CAMEL_INDEX_NAME_CLASS
+CAMEL_IS_INDEX_NAME_CLASS
+CAMEL_INDEX_NAME_GET_CLASS
CAMEL_INDEX_CURSOR
CAMEL_IS_INDEX_CURSOR
-camel_index_cursor_get_type
+CAMEL_TYPE_INDEX_CURSOR
CAMEL_INDEX_CURSOR_CLASS
+CAMEL_IS_INDEX_CURSOR_CLASS
+CAMEL_INDEX_CURSOR_GET_CLASS
CamelIndexClass
CamelIndexCursorClass
CamelIndexNameClass
<SUBSECTION Private>
+CamelIndexPrivate
+CamelIndexNamePrivate
+CamelIndexCursorPrivate
+camel_index_get_type
camel_index_name_get_type
+camel_index_cursor_get_type
</SECTION>
<SECTION>
@@ -693,9 +778,13 @@ camel_internet_address_format_address
<SUBSECTION Standard>
CAMEL_INTERNET_ADDRESS
CAMEL_IS_INTERNET_ADDRESS
+CAMEL_TYPE_INTERNET_ADDRESS
CAMEL_INTERNET_ADDRESS_CLASS
+CAMEL_IS_INTERNET_ADDRESS_CLASS
+CAMEL_INTERNET_ADDRESS_GET_CLASS
CamelInternetAddressClass
<SUBSECTION Private>
+CamelInternetAddressPrivate
camel_internet_address_get_type
</SECTION>
@@ -710,15 +799,18 @@ camel_medium_remove_header
camel_medium_get_header
camel_medium_get_headers
camel_medium_free_headers
-camel_medium_get_content_object
-camel_medium_set_content_object
+camel_medium_get_content
+camel_medium_set_content
<SUBSECTION Standard>
CAMEL_MEDIUM
CAMEL_IS_MEDIUM
-CAMEL_MEDIUM_TYPE
+CAMEL_TYPE_MEDIUM
CAMEL_MEDIUM_CLASS
+CAMEL_IS_MEDIUM_CLASS
+CAMEL_MEDIUM_GET_CLASS
CamelMediumClass
<SUBSECTION Private>
+CamelMediumPrivate
camel_medium_get_type
</SECTION>
@@ -728,13 +820,16 @@ camel_medium_get_type
CamelMimeFilterBasic
CamelMimeFilterBasicType
camel_mime_filter_basic_new
-camel_mime_filter_basic_new_type
<SUBSECTION Standard>
CAMEL_MIME_FILTER_BASIC
CAMEL_IS_MIME_FILTER_BASIC
+CAMEL_TYPE_MIME_FILTER_BASIC
CAMEL_MIME_FILTER_BASIC_CLASS
+CAMEL_IS_MIME_FILTER_BASIC_CLASS
+CAMEL_MIME_FILTER_BASIC_GET_CLASS
CamelMimeFilterBasicClass
<SUBSECTION Private>
+CamelMimeFilterBasicPrivate
camel_mime_filter_basic_get_type
</SECTION>
@@ -751,9 +846,13 @@ camel_mime_filter_bestenc_set_flags
<SUBSECTION Standard>
CAMEL_MIME_FILTER_BESTENC
CAMEL_IS_MIME_FILTER_BESTENC
+CAMEL_TYPE_MIME_FILTER_BESTENC
CAMEL_MIME_FILTER_BESTENC_CLASS
+CAMEL_IS_MIME_FILTER_BESTENC_CLASS
+CAMEL_MIME_FILTER_BESTENC_GET_CLASS
CamelMimeFilterBestencClass
<SUBSECTION Private>
+CamelMimeFilterBestencPrivate
camel_mime_filter_bestenc_get_type
</SECTION>
@@ -765,10 +864,13 @@ camel_mime_filter_canon_new
<SUBSECTION Standard>
CAMEL_MIME_FILTER_CANON
CAMEL_IS_MIME_FILTER_CANON
-CAMEL_MIME_FILTER_CANON_TYPE
+CAMEL_TYPE_MIME_FILTER_CANON
CAMEL_MIME_FILTER_CANON_CLASS
+CAMEL_IS_MIME_FILTER_CANON_CLASS
+CAMEL_MIME_FILTER_CANON_GET_CLASS
CamelMimeFilterCanonClass
<SUBSECTION Private>
+CamelMimeFilterCanonPrivate
camel_mime_filter_canon_get_type
</SECTION>
@@ -777,13 +879,16 @@ camel_mime_filter_canon_get_type
<TITLE>CamelMimeFilterCharset</TITLE>
CamelMimeFilterCharset
camel_mime_filter_charset_new
-camel_mime_filter_charset_new_convert
<SUBSECTION Standard>
CAMEL_MIME_FILTER_CHARSET
CAMEL_IS_MIME_FILTER_CHARSET
+CAMEL_TYPE_MIME_FILTER_CHARSET
CAMEL_MIME_FILTER_CHARSET_CLASS
+CAMEL_IS_MIME_FILTER_CHARSET_CLASS
+CAMEL_MIME_FILTER_CHARSET_GET_CLASS
CamelMimeFilterCharsetClass
<SUBSECTION Private>
+CamelMimeFilterCharsetPrivate
camel_mime_filter_charset_get_type
</SECTION>
@@ -797,10 +902,13 @@ camel_mime_filter_crlf_new
<SUBSECTION Standard>
CAMEL_MIME_FILTER_CRLF
CAMEL_IS_MIME_FILTER_CRLF
-CAMEL_MIME_FILTER_CRLF_TYPE
+CAMEL_TYPE_MIME_FILTER_CRLF
CAMEL_MIME_FILTER_CRLF_CLASS
+CAMEL_IS_MIME_FILTER_CRLF_CLASS
+CAMEL_MIME_FILTER_CRLF_GET_CLASS
CamelMimeFilterCRLFClass
<SUBSECTION Private>
+CamelMimeFilterCRLFPrivate
camel_mime_filter_crlf_get_type
</SECTION>
@@ -816,8 +924,11 @@ CAMEL_MIME_FILTER_ENRICHED
CAMEL_IS_MIME_FILTER_ENRICHED
CAMEL_TYPE_MIME_FILTER_ENRICHED
CAMEL_MIME_FILTER_ENRICHED_CLASS
+CAMEL_IS_MIME_FILTER_ENRICHED_CLASS
+CAMEL_MIME_FILTER_ENRICHED_GET_CLASS
CamelMimeFilterEnrichedClass
<SUBSECTION Private>
+CamelMimeFilterEnrichedPrivate
camel_mime_filter_enriched_get_type
</SECTION>
@@ -829,9 +940,13 @@ camel_mime_filter_from_new
<SUBSECTION Standard>
CAMEL_MIME_FILTER_FROM
CAMEL_IS_MIME_FILTER_FROM
+CAMEL_TYPE_MIME_FILTER_FROM
CAMEL_MIME_FILTER_FROM_CLASS
+CAMEL_IS_MIME_FILTER_FROM_CLASS
+CAMEL_MIME_FILTER_FROM_GET_CLASS
CamelMimeFilterFromClass
<SUBSECTION Private>
+CamelMimeFilterFromPrivate
camel_mime_filter_from_get_type
</SECTION>
@@ -850,6 +965,7 @@ CAMEL_IS_MIME_FILTER_GZIP_CLASS
CAMEL_MIME_FILTER_GZIP_GET_CLASS
CamelMimeFilterGZipClass
<SUBSECTION Private>
+CamelMimeFilterGZipPrivate
camel_mime_filter_gzip_get_type
</SECTION>
@@ -861,9 +977,13 @@ camel_mime_filter_html_new
<SUBSECTION Standard>
CAMEL_MIME_FILTER_HTML
CAMEL_IS_MIME_FILTER_HTML
+CAMEL_TYPE_MIME_FILTER_HTML
CAMEL_MIME_FILTER_HTML_CLASS
+CAMEL_IS_MIME_FILTER_HTML_CLASS
+CAMEL_MIME_FILTER_HTML_GET_CLASS
CamelMimeFilterHTMLClass
<SUBSECTION Private>
+CamelMimeFilterHTMLPrivate
camel_mime_filter_html_get_type
</SECTION>
@@ -872,15 +992,18 @@ camel_mime_filter_html_get_type
<TITLE>CamelMimeFilterIndex</TITLE>
CamelMimeFilterIndex
camel_mime_filter_index_new
-camel_mime_filter_index_new_index
camel_mime_filter_index_set_name
camel_mime_filter_index_set_index
<SUBSECTION Standard>
CAMEL_MIME_FILTER_INDEX
CAMEL_IS_MIME_FILTER_INDEX
+CAMEL_TYPE_MIME_FILTER_INDEX
CAMEL_MIME_FILTER_INDEX_CLASS
+CAMEL_IS_MIME_FILTER_INDEX_CLASS
+CAMEL_MIME_FILTER_INDEX_GET_CLASS
CamelMimeFilterIndexClass
<SUBSECTION Private>
+CamelMimeFilterIndexPrivate
camel_mime_filter_index_get_type
</SECTION>
@@ -892,10 +1015,13 @@ camel_mime_filter_linewrap_new
<SUBSECTION Standard>
CAMEL_MIME_FILTER_LINEWRAP
CAMEL_IS_MIME_FILTER_LINEWRAP
-CAMEL_MIME_FILTER_LINEWRAP_TYPE
+CAMEL_TYPE_MIME_FILTER_LINEWRAP
CAMEL_MIME_FILTER_LINEWRAP_CLASS
+CAMEL_IS_MIME_FILTER_LINEWRAP_CLASS
+CAMEL_MIME_FILTER_LINEWRAP_GET_CLASS
CamelMimeFilterLinewrapClass
<SUBSECTION Private>
+CamelMimeFilterLinewrapPrivate
camel_mime_filter_linewrap_get_type
</SECTION>
@@ -905,12 +1031,15 @@ camel_mime_filter_linewrap_get_type
CamelMimeFilterPgp
camel_mime_filter_pgp_new
<SUBSECTION Standard>
-CAMEL_MIME_FILTER_PGP_TYPE
CAMEL_MIME_FILTER_PGP
-CAMEL_MIME_FILTER_PGP_CLASS
CAMEL_IS_MIME_FILTER_PGP
+CAMEL_TYPE_MIME_FILTER_PGP
+CAMEL_MIME_FILTER_PGP_CLASS
+CAMEL_IS_MIME_FILTER_PGP_CLASS
+CAMEL_MIME_FILTER_PGP_GET_CLASS
CamelMimeFilterPgpClass
<SUBSECTION Private>
+CamelMimeFilterPgpPrivate
camel_mime_filter_pgp_get_type
</SECTION>
@@ -919,14 +1048,16 @@ camel_mime_filter_pgp_get_type
<TITLE>CamelMimeFilterSave</TITLE>
CamelMimeFilterSave
camel_mime_filter_save_new
-camel_mime_filter_save_new_with_stream
<SUBSECTION Standard>
CAMEL_MIME_FILTER_SAVE
CAMEL_IS_MIME_FILTER_SAVE
-CAMEL_MIME_FILTER_SAVE_TYPE
+CAMEL_TYPE_MIME_FILTER_SAVE
CAMEL_MIME_FILTER_SAVE_CLASS
+CAMEL_IS_MIME_FILTER_SAVE_CLASS
+CAMEL_MIME_FILTER_SAVE_GET_CLASS
CamelMimeFilterSaveClass
<SUBSECTION Private>
+CamelMimeFilterSavePrivate
camel_mime_filter_save_get_type
</SECTION>
@@ -949,9 +1080,13 @@ camel_text_to_html
<SUBSECTION Standard>
CAMEL_MIME_FILTER_TOHTML
CAMEL_IS_MIME_FILTER_TOHTML
+CAMEL_TYPE_MIME_FILTER_TOHTML
CAMEL_MIME_FILTER_TOHTML_CLASS
+CAMEL_IS_MIME_FILTER_TOHTML_CLASS
+CAMEL_MIME_FILTER_TOHTML_GET_CLASS
CamelMimeFilterToHTMLClass
<SUBSECTION Private>
+CamelMimeFilterToHTMLPrivate
camel_mime_filter_tohtml_get_type
</SECTION>
@@ -965,9 +1100,13 @@ camel_mime_filter_windows_real_charset
<SUBSECTION Standard>
CAMEL_MIME_FILTER_WINDOWS
CAMEL_IS_MIME_FILTER_WINDOWS
+CAMEL_TYPE_MIME_FILTER_WINDOWS
CAMEL_MIME_FILTER_WINDOWS_CLASS
+CAMEL_IS_MIME_FILTER_WINDOWS_CLASS
+CAMEL_MIME_FILTER_WINDOWS_GET_CLASS
CamelMimeFilterWindowsClass
<SUBSECTION Private>
+CamelMimeFilterWindowsPrivate
camel_mime_filter_windows_get_type
</SECTION>
@@ -1003,6 +1142,7 @@ CAMEL_IS_MIME_FILTER_YENC_CLASS
CAMEL_MIME_FILTER_YENC_GET_CLASS
CamelMimeFilterYencClass
<SUBSECTION Private>
+CamelMimeFilterYencPrivate
camel_mime_filter_yenc_get_type
</SECTION>
@@ -1019,10 +1159,13 @@ camel_mime_filter_set_size
<SUBSECTION Standard>
CAMEL_MIME_FILTER
CAMEL_IS_MIME_FILTER
-CAMEL_MIME_FILTER_TYPE
+CAMEL_TYPE_MIME_FILTER
CAMEL_MIME_FILTER_CLASS
+CAMEL_IS_MIME_FILTER_CLASS
+CAMEL_MIME_FILTER_GET_CLASS
CamelMimeFilterClass
<SUBSECTION Private>
+CamelMimeFilterPrivate
camel_mime_filter_get_type
</SECTION>
@@ -1033,10 +1176,14 @@ CamelMimeFilterProgress
camel_mime_filter_progress_new
<SUBSECTION Standard>
CAMEL_MIME_FILTER_PROGRESS
-CAMEL_MIME_FILTER_PROGRESS_CLASS
CAMEL_IS_MIME_FILTER_PROGRESS
+CAMEL_TYPE_MIME_FILTER_PROGRESS
+CAMEL_MIME_FILTER_PROGRESS_CLASS
+CAMEL_IS_MIME_FILTER_PROGRESS_CLASS
+CAMEL_MIME_FILTER_PROGRESS_GET_CLASS
CamelMimeFilterProgressClass
<SUBSECTION Private>
+CamelMimeFilterProgressPrivate
camel_mime_filter_progress_get_type
</SECTION>
@@ -1077,8 +1224,10 @@ camel_mime_message_dump
<SUBSECTION Standard>
CAMEL_MIME_MESSAGE
CAMEL_IS_MIME_MESSAGE
-CAMEL_MIME_MESSAGE_TYPE
+CAMEL_TYPE_MIME_MESSAGE
CAMEL_MIME_MESSAGE_CLASS
+CAMEL_IS_MIME_MESSAGE_CLASS
+CAMEL_MIME_MESSAGE_GET_CLASS
CamelMimeMessageClass
<SUBSECTION Private>
camel_mime_message_get_type
@@ -1120,9 +1269,13 @@ camel_mime_parser_tell_start_boundary
<SUBSECTION Standard>
CAMEL_MIME_PARSER
CAMEL_IS_MIME_PARSER
+CAMEL_TYPE_MIME_PARSER
CAMEL_MIME_PARSER_CLASS
+CAMEL_IS_MIME_PARSER_CLASS
+CAMEL_MIME_PARSER_GET_CLASS
CamelMimeParserClass
<SUBSECTION Private>
+CamelMimeParserPrivate
camel_mime_parser_get_type
</SECTION>
@@ -1140,8 +1293,8 @@ camel_mime_part_set_filename
camel_mime_part_get_filename
camel_mime_part_set_content_id
camel_mime_part_get_content_id
-camel_mime_part_set_content_MD5
-camel_mime_part_get_content_MD5
+camel_mime_part_set_content_md5
+camel_mime_part_get_content_md5
camel_mime_part_set_content_location
camel_mime_part_get_content_location
camel_mime_part_set_encoding
@@ -1158,10 +1311,13 @@ camel_mime_message_build_preview
<SUBSECTION Standard>
CAMEL_MIME_PART
CAMEL_IS_MIME_PART
-CAMEL_MIME_PART_TYPE
+CAMEL_TYPE_MIME_PART
CAMEL_MIME_PART_CLASS
+CAMEL_IS_MIME_PART_CLASS
+CAMEL_MIME_PART_GET_CLASS
CamelMimePartClass
<SUBSECTION Private>
+CamelMimePartPrivate
camel_mime_part_get_type
</SECTION>
@@ -1189,8 +1345,10 @@ camel_multipart_encrypted_new
<SUBSECTION Standard>
CAMEL_MULTIPART_ENCRYPTED
CAMEL_IS_MULTIPART_ENCRYPTED
-CAMEL_MULTIPART_ENCRYPTED_TYPE
+CAMEL_TYPE_MULTIPART_ENCRYPTED
CAMEL_MULTIPART_ENCRYPTED_CLASS
+CAMEL_IS_MULTIPART_ENCRYPTED_CLASS
+CAMEL_MULTIPART_ENCRYPTED_GET_CLASS
CamelMultipartEncryptedClass
<SUBSECTION Private>
camel_multipart_encrypted_get_type
@@ -1205,8 +1363,10 @@ camel_multipart_signed_get_content_stream
<SUBSECTION Standard>
CAMEL_MULTIPART_SIGNED
CAMEL_IS_MULTIPART_SIGNED
-CAMEL_MULTIPART_SIGNED_TYPE
+CAMEL_TYPE_MULTIPART_SIGNED
CAMEL_MULTIPART_SIGNED_CLASS
+CAMEL_IS_MULTIPART_SIGNED_CLASS
+CAMEL_MULTIPART_SIGNED_GET_CLASS
CamelMultipartSignedClass
<SUBSECTION Private>
camel_multipart_signed_get_type
@@ -1231,49 +1391,43 @@ camel_multipart_construct_from_parser
<SUBSECTION Standard>
CAMEL_MULTIPART
CAMEL_IS_MULTIPART
-CAMEL_MULTIPART_TYPE
+CAMEL_TYPE_MULTIPART
CAMEL_MULTIPART_CLASS
+CAMEL_IS_MULTIPART_CLASS
+CAMEL_MULTIPART_GET_CLASS
CamelMultipartClass
<SUBSECTION Private>
camel_multipart_get_type
</SECTION>
<SECTION>
+<FILE>camel-nntp-address</FILE>
+<TITLE>CamelNNTPAddress</TITLE>
+CamelNNTPAddress
+camel_nntp_address_new
+camel_nntp_address_add
+camel_nntp_address_get
+<SUBSECTION Standard>
+CAMEL_NNTP_ADDRESS
+CAMEL_IS_NNTP_ADDRESS
+CAMEL_TYPE_NNTP_ADDRESS
+CAMEL_NNTP_ADDRESS_CLASS
+CAMEL_IS_NNTP_ADDRESS_CLASS
+CAMEL_NNTP_ADDRESS_GET_CLASS
+CamelNNTPAddressClass
+<SUBSECTION Private>
+CamelNNTPAddressPrivate
+camel_nntp_address_get_type
+</SECTION>
+
+<SECTION>
<FILE>camel-object</FILE>
<TITLE>CamelObject</TITLE>
-CAMEL_OBJECT_TRACK_INSTANCES
-CamelType
CamelObject
-CAMEL_CHECK_CAST
-CAMEL_CHECK_CLASS_CAST
-CAMEL_CHECK_TYPE
-CAMEL_CHECK_CLASS_TYPE
-camel_object_type
-CAMEL_OBJECT_TYPE
-CAMEL_OBJECT_GET_TYPE
CamelObjectHookID
-CamelObjectClassInitFunc
-CamelObjectClassFinalizeFunc
-CamelObjectInitFunc
-CamelObjectFinalizeFunc
CamelObjectEventPrepFunc
CamelObjectEventHookFunc
-CAMEL_INVALID_TYPE
-CamelObjectFlags
-camel_type_init
-camel_type_register
-camel_type_get_global_classfuncs
-camel_type_to_name
-camel_name_to_type
camel_object_class_add_event
-camel_object_class_dump_tree
-camel_object_cast
-camel_object_is
-camel_object_class_cast
-camel_object_class_is
-camel_object_new
-camel_object_ref
-camel_object_unref
camel_object_hook_event
camel_object_remove_event
camel_object_unhook_event
@@ -1300,6 +1454,7 @@ camel_object_bag_destroy
<SUBSECTION Standard>
CAMEL_OBJECT
CAMEL_IS_OBJECT
+CAMEL_TYPE_OBJECT
CAMEL_OBJECT_CLASS
CAMEL_IS_OBJECT_CLASS
CAMEL_OBJECT_GET_CLASS
@@ -1309,6 +1464,112 @@ camel_object_get_type
</SECTION>
<SECTION>
+<FILE>camel-offline-folder</FILE>
+<TITLE>CamelOfflineFolder</TITLE>
+CamelOfflineFolder
+camel_offline_folder_downsync
+<SUBSECTION Standard>
+CAMEL_OFFLINE_FOLDER
+CAMEL_IS_OFFLINE_FOLDER
+CAMEL_TYPE_OFFLINE_FOLDER
+CAMEL_OFFLINE_FOLDER_CLASS
+CAMEL_IS_OFFLINE_FOLDER_CLASS
+CAMEL_OFFLINE_FOLDER_GET_CLASS
+CamelOfflineFolderClass
+<SUBSECTION Private>
+camel_offline_folder_get_type
+</SECTION>
+
+<SECTION>
+<FILE>camel-offline-journal</FILE>
+<TITLE>CamelOfflineJournal</TITLE>
+CamelOfflineJournal
+CamelOfflineJournalEntry
+camel_offline_journal_construct
+camel_offline_journal_set_filename
+camel_offline_journal_write
+camel_offline_journal_replay
+<SUBSECTION Standard>
+CAMEL_OFFLINE_JOURNAL
+CAMEL_IS_OFFLINE_JOURNAL
+CAMEL_TYPE_OFFLINE_JOURNAL
+CAMEL_OFFLINE_JOURNAL_CLASS
+CAMEL_IS_OFFLINE_JOURNAL_CLASS
+CAMEL_OFFLINE_JOURNAL_GET_CLASS
+CamelOfflineJournalClass
+<SUBSECTION Private>
+camel_offline_journal_get_type
+</SECTION>
+
+<SECTION>
+<FILE>camel-offline-store</FILE>
+<TITLE>CamelOfflineStore</TITLE>
+CamelOfflineStore
+camel_offline_store_set_network_state
+camel_offline_store_get_network_state
+camel_offline_store_prepare_for_offline
+<SUBSECTION Standard>
+CAMEL_OFFLINE_STORE
+CAMEL_IS_OFFLINE_STORE
+CAMEL_TYPE_OFFLINE_STORE
+CAMEL_OFFLINE_STORE_CLASS
+CAMEL_IS_OFFLINE_STORE_CLASS
+CAMEL_OFFLINE_STORE_GET_CLASS
+CamelOfflineStoreClass
+<SUBSECTION Private>
+camel_offline_store_get_type
+</SECTION>
+
+<SECTION>
+<FILE>camel-partition-table</FILE>
+<TITLE>CamelPartitionTable</TITLE>
+<TITLE>CamelKeyTable</TITLE>
+camel_hash_t
+CamelPartitionKey
+CamelPartitionKeyBlock
+CamelPartitionMap
+CamelPartitionMapBlock
+CamelPartitionTable
+camel_partition_table_new
+camel_partition_table_sync
+camel_partition_table_add
+camel_partition_table_lookup
+camel_partition_table_remove
+CamelKeyBlock
+CamelKeyRootBlock
+CamelKeyKey
+CAMEL_KEY_TABLE_MAX_KEY
+CamelKeyTable
+camel_key_table_new
+camel_key_table_sync
+camel_key_table_add
+camel_key_table_set_data
+camel_key_table_set_flags
+camel_key_table_lookup
+camel_key_table_next
+<SUBSECTION Standard>
+CAMEL_PARTITION_TABLE
+CAMEL_IS_PARTITION_TABLE
+CAMEL_TYPE_PARTITION_TABLE
+CAMEL_PARTITION_TABLE_CLASS
+CAMEL_IS_PARTITION_TABLE_CLASS
+CAMEL_PARTITION_TABLE_GET_CLASS
+CAMEL_KEY_TABLE
+CAMEL_IS_KEY_TABLE
+CAMEL_TYPE_KEY_TABLE
+CAMEL_KEY_TABLE_CLASS
+CAMEL_IS_KEY_TABLE_CLASS
+CAMEL_KEY_TABLE_GET_CLASS
+CamelPartitionTableClass
+CamelKeyTableClass
+<SUBSECTION Private>
+CamelPartitionTablePrivate
+CamelKeyTablePrivate
+camel_partition_table_get_type
+camel_key_table_get_type
+</SECTION>
+
+<SECTION>
<FILE>camel-provider</FILE>
CamelProvider
CamelProviderType
@@ -1383,8 +1644,10 @@ camel_sasl_anonymous_authtype
<SUBSECTION Standard>
CAMEL_SASL_ANONYMOUS
CAMEL_IS_SASL_ANONYMOUS
-CAMEL_SASL_ANONYMOUS_TYPE
+CAMEL_TYPE_SASL_ANONYMOUS
CAMEL_SASL_ANONYMOUS_CLASS
+CAMEL_IS_SASL_ANONYMOUS_CLASS
+CAMEL_SASL_ANONYMOUS_GET_CLASS
CamelSaslAnonymousClass
<SUBSECTION Private>
camel_sasl_anonymous_get_type
@@ -1398,10 +1661,13 @@ camel_sasl_cram_md5_authtype
<SUBSECTION Standard>
CAMEL_SASL_CRAM_MD5
CAMEL_IS_SASL_CRAM_MD5
-CAMEL_SASL_CRAM_MD5_TYPE
+CAMEL_TYPE_SASL_CRAM_MD5
CAMEL_SASL_CRAM_MD5_CLASS
+CAMEL_IS_SASL_CRAM_MD5_CLASS
+CAMEL_SASL_CRAM_MD5_GET_CLASS
CamelSaslCramMd5Class
<SUBSECTION Private>
+CamelSaslCramMd5Private
camel_sasl_cram_md5_get_type
</SECTION>
@@ -1413,10 +1679,13 @@ camel_sasl_digest_md5_authtype
<SUBSECTION Standard>
CAMEL_SASL_DIGEST_MD5
CAMEL_IS_SASL_DIGEST_MD5
-CAMEL_SASL_DIGEST_MD5_TYPE
+CAMEL_TYPE_SASL_DIGEST_MD5
CAMEL_SASL_DIGEST_MD5_CLASS
+CAMEL_IS_SASL_DIGEST_MD5_CLASS
+CAMEL_SASL_DIGEST_MD5_GET_CLASS
CamelSaslDigestMd5Class
<SUBSECTION Private>
+CamelSaslDigestMd5Private
camel_sasl_digest_md5_get_type
</SECTION>
@@ -1428,10 +1697,13 @@ camel_sasl_gssapi_authtype
<SUBSECTION Standard>
CAMEL_SASL_GSSAPI
CAMEL_IS_SASL_GSSAPI
-CAMEL_SASL_GSSAPI_TYPE
+CAMEL_TYPE_SASL_GSSAPI
CAMEL_SASL_GSSAPI_CLASS
+CAMEL_IS_SASL_GSSAPI_CLASS
+CAMEL_SASL_GSSAPI_GET_CLASS
CamelSaslGssapiClass
<SUBSECTION Private>
+CamelSaslGssapiPrivate
camel_sasl_gssapi_get_type
</SECTION>
@@ -1443,10 +1715,13 @@ camel_sasl_login_authtype
<SUBSECTION Standard>
CAMEL_SASL_LOGIN
CAMEL_IS_SASL_LOGIN
-CAMEL_SASL_LOGIN_TYPE
+CAMEL_TYPE_SASL_LOGIN
CAMEL_SASL_LOGIN_CLASS
+CAMEL_IS_SASL_LOGIN_CLASS
+CAMEL_SASL_LOGIN_GET_CLASS
CamelSaslLoginClass
<SUBSECTION Private>
+CamelSaslLoginPrivate
camel_sasl_login_get_type
</SECTION>
@@ -1458,10 +1733,13 @@ camel_sasl_ntlm_authtype
<SUBSECTION Standard>
CAMEL_SASL_NTLM
CAMEL_IS_SASL_NTLM
-CAMEL_SASL_NTLM_TYPE
+CAMEL_TYPE_SASL_NTLM
CAMEL_SASL_NTLM_CLASS
+CAMEL_IS_SASL_NTLM_CLASS
+CAMEL_SASL_NTLM_GET_CLASS
CamelSaslNTLMClass
<SUBSECTION Private>
+CamelSaslNTLMPrivate
camel_sasl_ntlm_get_type
</SECTION>
@@ -1473,10 +1751,13 @@ camel_sasl_plain_authtype
<SUBSECTION Standard>
CAMEL_SASL_PLAIN
CAMEL_IS_SASL_PLAIN
-CAMEL_SASL_PLAIN_TYPE
+CAMEL_TYPE_SASL_PLAIN
CAMEL_SASL_PLAIN_CLASS
+CAMEL_IS_SASL_PLAIN_CLASS
+CAMEL_SASL_PLAIN_GET_CLASS
CamelSaslPlainClass
<SUBSECTION Private>
+CamelSaslPlainPrivate
camel_sasl_plain_get_type
</SECTION>
@@ -1488,10 +1769,13 @@ camel_sasl_popb4smtp_authtype
<SUBSECTION Standard>
CAMEL_SASL_POPB4SMTP
CAMEL_IS_SASL_POPB4SMTP
-CAMEL_SASL_POPB4SMTP_TYPE
+CAMEL_TYPE_SASL_POPB4SMTP
CAMEL_SASL_POPB4SMTP_CLASS
+CAMEL_IS_SASL_POPB4SMTP_CLASS
+CAMEL_SASL_POPB4SMTP_GET_CLASS
CamelSaslPOPB4SMTPClass
<SUBSECTION Private>
+CamelSaslPOPB4SMTPPrivate
camel_sasl_popb4smtp_get_type
</SECTION>
@@ -1501,17 +1785,19 @@ camel_sasl_popb4smtp_get_type
CamelSasl
camel_sasl_challenge
camel_sasl_challenge_base64
-camel_sasl_authenticated
camel_sasl_new
camel_sasl_authtype_list
camel_sasl_authtype
<SUBSECTION Standard>
CAMEL_SASL
CAMEL_IS_SASL
-CAMEL_SASL_TYPE
+CAMEL_TYPE_SASL
CAMEL_SASL_CLASS
+CAMEL_IS_SASL_CLASS
+CAMEL_SASL_GET_CLASS
CamelSaslClass
<SUBSECTION Private>
+CamelSaslPrivate
camel_sasl_get_type
</SECTION>
@@ -1537,8 +1823,10 @@ camel_seekable_stream_set_bounds
<SUBSECTION Standard>
CAMEL_SEEKABLE_STREAM
CAMEL_IS_SEEKABLE_STREAM
-CAMEL_SEEKABLE_STREAM_TYPE
+CAMEL_TYPE_SEEKABLE_STREAM
CAMEL_SEEKABLE_STREAM_CLASS
+CAMEL_IS_SEEKABLE_STREAM_CLASS
+CAMEL_SEEKABLE_STREAM_GET_CLASS
CamelSeekableStreamClass
<SUBSECTION Private>
camel_seekable_stream_get_type
@@ -1552,8 +1840,10 @@ camel_seekable_substream_new
<SUBSECTION Standard>
CAMEL_SEEKABLE_SUBSTREAM
CAMEL_IS_SEEKABLE_SUBSTREAM
-CAMEL_SEEKABLE_SUBSTREAM_TYPE
+CAMEL_TYPE_SEEKABLE_SUBSTREAM
CAMEL_SEEKABLE_SUBSTREAM_CLASS
+CAMEL_IS_SEEKABLE_SUBSTREAM_CLASS
+CAMEL_SEEKABLE_SUBSTREAM_GET_CLASS
CamelSeekableSubstreamClass
<SUBSECTION Private>
camel_seekable_substream_get_type
@@ -1583,10 +1873,13 @@ camel_service_query_auth_types
<SUBSECTION Standard>
CAMEL_SERVICE
CAMEL_IS_SERVICE
-CAMEL_SERVICE_TYPE
+CAMEL_TYPE_SERVICE
CAMEL_SERVICE_CLASS
+CAMEL_IS_SERVICE_CLASS
+CAMEL_SERVICE_GET_CLASS
CamelServiceClass
<SUBSECTION Private>
+CamelServicePrivate
camel_service_get_type
</SECTION>
@@ -1626,10 +1919,13 @@ camel_session_forward_to
<SUBSECTION Standard>
CAMEL_SESSION
CAMEL_IS_SESSION
-CAMEL_SESSION_TYPE
+CAMEL_TYPE_SESSION
CAMEL_SESSION_CLASS
+CAMEL_IS_SESSION_CLASS
+CAMEL_SESSION_GET_CLASS
CamelSessionClass
<SUBSECTION Private>
+CamelSessionPrivate
camel_session_get_type
</SECTION>
@@ -1646,10 +1942,13 @@ camel_smime_context_describe_part
<SUBSECTION Standard>
CAMEL_SMIME_CONTEXT
CAMEL_IS_SMIME_CONTEXT
-CAMEL_SMIME_CONTEXT_TYPE
+CAMEL_TYPE_SMIME_CONTEXT
CAMEL_SMIME_CONTEXT_CLASS
+CAMEL_IS_SMIME_CONTEXT_CLASS
+CAMEL_SMIME_CONTEXT_GET_CLASS
CamelSMIMEContextClass
<SUBSECTION Private>
+CamelSMIMEContextPrivate
camel_smime_context_get_type
</SECTION>
@@ -1691,9 +1990,13 @@ camel_store_info_name
<SUBSECTION Standard>
CAMEL_STORE_SUMMARY
CAMEL_IS_STORE_SUMMARY
+CAMEL_TYPE_STORE_SUMMARY
CAMEL_STORE_SUMMARY_CLASS
+CAMEL_IS_STORE_SUMMARY_CLASS
+CAMEL_STORE_SUMMARY_GET_CLASS
CamelStoreSummaryClass
<SUBSECTION Private>
+CamelStoreSummaryPrivate
camel_store_summary_get_type
</SECTION>
@@ -1766,10 +2069,13 @@ camel_store_can_refresh_folder
<SUBSECTION Standard>
CAMEL_STORE
CAMEL_IS_STORE
-CAMEL_STORE_TYPE
+CAMEL_TYPE_STORE
CAMEL_STORE_CLASS
+CAMEL_IS_STORE_CLASS
+CAMEL_STORE_GET_CLASS
CamelStoreClass
<SUBSECTION Private>
+CamelStorePrivate
camel_isubscribe_get_type
camel_store_get_type
</SECTION>
@@ -1791,8 +2097,10 @@ camel_stream_write_to_stream
<SUBSECTION Standard>
CAMEL_STREAM
CAMEL_IS_STREAM
-CAMEL_STREAM_TYPE
+CAMEL_TYPE_STREAM
CAMEL_STREAM_CLASS
+CAMEL_IS_STREAM_CLASS
+CAMEL_STREAM_GET_CLASS
CamelStreamClass
<SUBSECTION Private>
camel_stream_get_type
@@ -1810,10 +2118,13 @@ camel_stream_buffer_read_line
<SUBSECTION Standard>
CAMEL_STREAM_BUFFER
CAMEL_IS_STREAM_BUFFER
-CAMEL_STREAM_BUFFER_TYPE
+CAMEL_TYPE_STREAM_BUFFER
CAMEL_STREAM_BUFFER_CLASS
+CAMEL_IS_STREAM_BUFFER_CLASS
+CAMEL_STREAM_BUFFER_GET_CLASS
CamelStreamBufferClass
<SUBSECTION Private>
+CamelStreamBufferPrivate
camel_stream_buffer_get_type
</SECTION>
@@ -1821,15 +2132,18 @@ camel_stream_buffer_get_type
<FILE>camel-stream-filter</FILE>
<TITLE>CamelStreamFilter</TITLE>
CamelStreamFilter
-camel_stream_filter_new_with_stream
camel_stream_filter_add
camel_stream_filter_remove
<SUBSECTION Standard>
CAMEL_STREAM_FILTER
CAMEL_IS_STREAM_FILTER
+CAMEL_TYPE_STREAM_FILTER
CAMEL_STREAM_FILTER_CLASS
+CAMEL_IS_STREAM_FILTER_CLASS
+CAMEL_STREAM_FILTER_GET_CLASS
CamelStreamFilterClass
<SUBSECTION Private>
+CamelStreamFilterPrivate
camel_stream_filter_get_type
</SECTION>
@@ -1844,10 +2158,13 @@ camel_stream_fs_new_with_fd_and_bounds
<SUBSECTION Standard>
CAMEL_STREAM_FS
CAMEL_IS_STREAM_FS
-CAMEL_STREAM_FS_TYPE
+CAMEL_TYPE_STREAM_FS
CAMEL_STREAM_FS_CLASS
+CAMEL_IS_STREAM_FS_CLASS
+CAMEL_STREAM_FS_GET_CLASS
CamelStreamFsClass
<SUBSECTION Private>
+CamelStreamFsPrivate
camel_stream_fs_get_type
</SECTION>
@@ -1864,10 +2181,13 @@ camel_stream_mem_set_buffer
<SUBSECTION Standard>
CAMEL_STREAM_MEM
CAMEL_IS_STREAM_MEM
-CAMEL_STREAM_MEM_TYPE
+CAMEL_TYPE_STREAM_MEM
CAMEL_STREAM_MEM_CLASS
+CAMEL_IS_STREAM_MEM_CLASS
+CAMEL_STREAM_MEM_GET_CLASS
CamelStreamMemClass
<SUBSECTION Private>
+CamelStreamMemPrivate
camel_stream_mem_get_type
</SECTION>
@@ -1879,7 +2199,10 @@ camel_stream_null_new
<SUBSECTION Standard>
CAMEL_STREAM_NULL
CAMEL_IS_STREAM_NULL
+CAMEL_TYPE_STREAM_NULL
CAMEL_STREAM_NULL_CLASS
+CAMEL_IS_STREAM_NULL_CLASS
+CAMEL_STREAM_NULL_GET_CLASS
CamelStreamNullClass
<SUBSECTION Private>
camel_stream_null_get_type
@@ -1894,7 +2217,10 @@ camel_stream_process_connect
<SUBSECTION Standard>
CAMEL_STREAM_PROCESS
CAMEL_IS_STREAM_PROCESS
+CAMEL_TYPE_STREAM_PROCESS
CAMEL_STREAM_PROCESS_CLASS
+CAMEL_IS_STREAM_PROCESS_CLASS
+CAMEL_STREAM_PROCESS_GET_CLASS
CamelStreamProcessClass
<SUBSECTION Private>
camel_stream_process_get_type
@@ -1909,10 +2235,12 @@ camel_stream_vfs_new_with_uri
camel_stream_vfs_new_with_stream
camel_stream_vfs_is_writable
<SUBSECTION Standard>
-CAMEL_STREAM_VFS_TYPE
CAMEL_STREAM_VFS
-CAMEL_STREAM_VFS_CLASS
CAMEL_IS_STREAM_VFS
+CAMEL_TYPE_STREAM_VFS
+CAMEL_STREAM_VFS_CLASS
+CAMEL_IS_STREAM_VFS_CLASS
+CAMEL_STREAM_VFS_GET_CLASS
CamelStreamVFSClass
<SUBSECTION Private>
camel_stream_vfs_get_type
@@ -1926,8 +2254,10 @@ camel_tcp_stream_raw_new
<SUBSECTION Standard>
CAMEL_TCP_STREAM_RAW
CAMEL_IS_TCP_STREAM_RAW
-CAMEL_TCP_STREAM_RAW_TYPE
+CAMEL_TYPE_TCP_STREAM_RAW
CAMEL_TCP_STREAM_RAW_CLASS
+CAMEL_IS_TCP_STREAM_RAW_CLASS
+CAMEL_TCP_STREAM_RAW_GET_CLASS
CamelTcpStreamRawClass
<SUBSECTION Private>
camel_tcp_stream_raw_get_type
@@ -1947,10 +2277,13 @@ camel_tcp_stream_ssl_sockfd
<SUBSECTION Standard>
CAMEL_TCP_STREAM_SSL
CAMEL_IS_TCP_STREAM_SSL
-CAMEL_TCP_STREAM_SSL_TYPE
+CAMEL_TYPE_TCP_STREAM_SSL
CAMEL_TCP_STREAM_SSL_CLASS
+CAMEL_IS_TCP_STREAM_SSL_CLASS
+CAMEL_TCP_STREAM_SSL_GET_CLASS
CamelTcpStreamSSLClass
<SUBSECTION Private>
+CamelTcpStreamSSLPrivate
camel_tcp_stream_ssl_get_type
</SECTION>
@@ -1969,8 +2302,10 @@ camel_tcp_stream_get_remote_address
<SUBSECTION Standard>
CAMEL_TCP_STREAM
CAMEL_IS_TCP_STREAM
-CAMEL_TCP_STREAM_TYPE
+CAMEL_TYPE_TCP_STREAM
CAMEL_TCP_STREAM_CLASS
+CAMEL_IS_TCP_STREAM_CLASS
+CAMEL_TCP_STREAM_GET_CLASS
CamelTcpStreamClass
<SUBSECTION Private>
camel_tcp_stream_get_type
@@ -1997,12 +2332,37 @@ camel_text_index_validate
<SUBSECTION Standard>
CAMEL_TEXT_INDEX
CAMEL_IS_TEXT_INDEX
+CAMEL_TYPE_TEXT_INDEX
CAMEL_TEXT_INDEX_CLASS
+CAMEL_IS_TEXT_INDEX_CLASS
+CAMEL_TEXT_INDEX_GET_CLASS
+CAMEL_TEXT_INDEX_CURSOR
+CAMEL_IS_TEXT_INDEX_CURSOR
+CAMEL_TYPE_TEXT_INDEX_CURSOR
+CAMEL_TEXT_INDEX_CURSOR_CLASS
+CAMEL_IS_TEXT_INDEX_CURSOR_CLASS
+CAMEL_TEXT_INDEX_CURSOR_GET_CLASS
+CAMEL_TEXT_INDEX_KEY_CURSOR
+CAMEL_IS_TEXT_INDEX_KEY_CURSOR
+CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR
+CAMEL_TEXT_INDEX_KEY_CURSOR_CLASS
+CAMEL_IS_TEXT_INDEX_KEY_CURSOR_CLASS
+CAMEL_TEXT_INDEX_KEY_CURSOR_GET_CLASS
+CAMEL_TEXT_INDEX_NAME
+CAMEL_IS_TEXT_INDEX_NAME
+CAMEL_TYPE_TEXT_INDEX_NAME
+CAMEL_TEXT_INDEX_NAME_CLASS
+CAMEL_IS_TEXT_INDEX_NAME_CLASS
+CAMEL_TEXT_INDEX_NAME_GET_CLASS
CamelTextIndexClass
CamelTextIndexCursorClass
CamelTextIndexKeyCursorClass
CamelTextIndexNameClass
<SUBSECTION Private>
+CamelTextIndexPrivate
+CamelTextIndexCursorPrivate
+CamelTextIndexKeyCursorPrivate
+CamelTextIndexNamePrivate
camel_text_index_get_type
camel_text_index_cursor_get_type
camel_text_index_key_cursor_get_type
@@ -2017,10 +2377,13 @@ camel_transport_send_to
<SUBSECTION Standard>
CAMEL_TRANSPORT
CAMEL_IS_TRANSPORT
-CAMEL_TRANSPORT_TYPE
+CAMEL_TYPE_TRANSPORT
CAMEL_TRANSPORT_CLASS
+CAMEL_IS_TRANSPORT_CLASS
+CAMEL_TRANSPORT_GET_CLASS
CamelTransportClass
<SUBSECTION Private>
+CamelTransportPrivate
camel_transport_get_type
</SECTION>
@@ -2053,9 +2416,13 @@ camel_vee_folder_sync_headers
<SUBSECTION Standard>
CAMEL_VEE_FOLDER
CAMEL_IS_VEE_FOLDER
+CAMEL_TYPE_VEE_FOLDER
CAMEL_VEE_FOLDER_CLASS
+CAMEL_IS_VEE_FOLDER_CLASS
+CAMEL_VEE_FOLDER_GET_CLASS
CamelVeeFolderClass
<SUBSECTION Private>
+CamelVeeFolderPrivate
camel_vee_folder_get_type
</SECTION>
@@ -2069,7 +2436,10 @@ camel_vee_store_new
<SUBSECTION Standard>
CAMEL_VEE_STORE
CAMEL_IS_VEE_STORE
+CAMEL_TYPE_VEE_STORE
CAMEL_VEE_STORE_CLASS
+CAMEL_IS_VEE_STORE_CLASS
+CAMEL_VEE_STORE_GET_CLASS
CamelVeeStoreClass
<SUBSECTION Private>
camel_vee_store_get_type
@@ -2087,7 +2457,10 @@ camel_vee_summary_load_check_unread_vfolder
<SUBSECTION Standard>
CAMEL_VEE_SUMMARY
CAMEL_IS_VEE_SUMMARY
+CAMEL_TYPE_VEE_SUMMARY
CAMEL_VEE_SUMMARY_CLASS
+CAMEL_IS_VEE_SUMMARY_CLASS
+CAMEL_VEE_SUMMARY_GET_CLASS
CamelVeeSummaryClass
<SUBSECTION Private>
camel_vee_summary_get_type
@@ -2104,1081 +2477,16 @@ camel_vtrash_folder_new
<SUBSECTION Standard>
CAMEL_VTRASH_FOLDER
CAMEL_IS_VTRASH_FOLDER
+CAMEL_TYPE_VTRASH_FOLDER
CAMEL_VTRASH_FOLDER_CLASS
+CAMEL_IS_VTRASH_FOLDER_CLASS
+CAMEL_VTRASH_FOLDER_GET_CLASS
CamelVTrashFolderClass
<SUBSECTION Private>
camel_vtrash_folder_get_type
</SECTION>
<SECTION>
-<FILE>camel-disco-store</FILE>
-<TITLE>CamelDiscoStore</TITLE>
-CamelDiscoStore
-CamelDiscoStoreStatus
-camel_disco_store_status
-camel_disco_store_set_status
-camel_disco_store_can_work_offline
-camel_disco_store_check_online
-camel_disco_store_prepare_for_offline
-<SUBSECTION Standard>
-CAMEL_DISCO_STORE
-CAMEL_IS_DISCO_STORE
-CAMEL_DISCO_STORE_TYPE
-CAMEL_DISCO_STORE_CLASS
-CamelDiscoStoreClass
-<SUBSECTION Private>
-camel_disco_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-offline-journal</FILE>
-<TITLE>CamelOfflineJournal</TITLE>
-CamelOfflineJournal
-CamelOfflineJournalEntry
-camel_offline_journal_construct
-camel_offline_journal_set_filename
-camel_offline_journal_write
-camel_offline_journal_replay
-<SUBSECTION Standard>
-CAMEL_OFFLINE_JOURNAL
-CAMEL_IS_OFFLINE_JOURNAL
-CAMEL_TYPE_OFFLINE_JOURNAL
-CAMEL_OFFLINE_JOURNAL_CLASS
-CAMEL_IS_OFFLINE_JOURNAL_CLASS
-CAMEL_OFFLINE_JOURNAL_GET_CLASS
-CamelOfflineJournalClass
-<SUBSECTION Private>
-camel_offline_journal_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-offline-folder</FILE>
-<TITLE>CamelOfflineFolder</TITLE>
-CamelOfflineFolder
-camel_offline_folder_downsync
-<SUBSECTION Standard>
-CAMEL_OFFLINE_FOLDER
-CAMEL_IS_OFFLINE_FOLDER
-CAMEL_OFFLINE_FOLDER_TYPE
-CAMEL_OFFLINE_FOLDER_CLASS
-CamelOfflineFolderClass
-<SUBSECTION Private>
-camel_offline_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-offline-store</FILE>
-<TITLE>CamelOfflineStore</TITLE>
-CamelOfflineStore
-camel_offline_store_set_network_state
-camel_offline_store_get_network_state
-camel_offline_store_prepare_for_offline
-<SUBSECTION Standard>
-CAMEL_OFFLINE_STORE
-CAMEL_IS_OFFLINE_STORE
-CAMEL_TYPE_OFFLINE_STORE
-CAMEL_OFFLINE_STORE_CLASS
-CAMEL_IS_OFFLINE_STORE_CLASS
-CAMEL_OFFLINE_STORE_GET_CLASS
-CamelOfflineStoreClass
-<SUBSECTION Private>
-camel_offline_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-address</FILE>
-<TITLE>CamelNNTPAddress</TITLE>
-CamelNNTPAddress
-camel_nntp_address_new
-camel_nntp_address_add
-camel_nntp_address_get
-<SUBSECTION Standard>
-CAMEL_NNTP_ADDRESS
-CAMEL_IS_NNTP_ADDRESS
-CAMEL_NNTP_ADDRESS_CLASS
-CamelNNTPAddressClass
-<SUBSECTION Private>
-camel_nntp_address_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-folder</FILE>
-<TITLE>CamelImapFolder</TITLE>
-CamelImapFolder
-camel_imap_folder_new
-camel_imap_folder_selected
-camel_imap_folder_changed
-camel_imap_folder_fetch_data
-imap_append_resyncing
-imap_transfer_resyncing
-imap_expunge_uids_resyncing
-<SUBSECTION Standard>
-CAMEL_IMAP_FOLDER
-CAMEL_IS_IMAP_FOLDER
-CAMEL_IMAP_FOLDER_TYPE
-CAMEL_IMAP_FOLDER_CLASS
-CamelImapFolderClass
-<SUBSECTION Private>
-CamelImapFolderPrivate
-camel_imap_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-journal</FILE>
-<TITLE>CamelImapJournal</TITLE>
-CamelOfflineAction
-CamelIMAPJournalEntry
-CamelIMAPJournal
-camel_imap_journal_new
-camel_imap_journal_log
-camel_imap_journal_uidmap_add
-camel_imap_journal_uidmap_lookup
-camel_imap_journal_close_folders
-<SUBSECTION Standard>
-CAMEL_TYPE_IMAP_JOURNAL
-CAMEL_IMAP_JOURNAL
-CAMEL_IMAP_JOURNAL_CLASS
-CAMEL_IS_IMAP_JOURNAL
-CAMEL_IS_IMAP_JOURNAL_CLASS
-CAMEL_IMAP_JOURNAL_GET_CLASS
-CamelIMAPJournalClass
-<SUBSECTION Private>
-camel_imap_journal_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-message-cache</FILE>
-<TITLE>CamelImapMessageCache</TITLE>
-CamelImapMessageCache
-camel_imap_message_cache_new
-camel_imap_message_cache_set_path
-camel_imap_message_cache_max_uid
-camel_imap_message_cache_insert
-camel_imap_message_cache_insert_stream
-camel_imap_message_cache_insert_wrapper
-camel_imap_message_cache_get
-camel_imap_message_cache_get_filename
-camel_imap_message_cache_remove
-camel_imap_message_cache_clear
-camel_imap_message_cache_copy
-camel_imap_message_cache_delete
-camel_imap_message_cache_filter_cached
-<SUBSECTION Standard>
-CAMEL_IMAP_MESSAGE_CACHE
-CAMEL_IS_IMAP_MESSAGE_CACHE
-CAMEL_IMAP_MESSAGE_CACHE_TYPE
-CAMEL_IMAP_MESSAGE_CACHE_CLASS
-CamelImapMessageCacheClass
-<SUBSECTION Private>
-camel_imap_message_cache_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-search</FILE>
-<TITLE>CamelImapSearch</TITLE>
-CamelImapSearch
-camel_imap_search_new
-<SUBSECTION Standard>
-CAMEL_IMAP_SEARCH
-CAMEL_IS_IMAP_SEARCH
-CAMEL_IMAP_SEARCH_TYPE
-CAMEL_IMAP_SEARCH_CLASS
-CamelImapSearchClass
-<SUBSECTION Private>
-camel_imap_search_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-store-summary</FILE>
-<TITLE>CamelImapStoreSummary</TITLE>
-CamelImapStoreInfo
-CamelImapStoreNamespace
-CamelImapStoreSummary
-camel_imap_store_summary_new
-camel_imap_store_summary_namespace_set_main
-camel_imap_store_summary_namespace_add_secondary
-camel_imap_store_summary_get_main_namespace
-camel_imap_store_summary_namespace_find_path
-camel_imap_store_summary_namespace_find_full
-camel_imap_store_summary_full_to_path
-camel_imap_store_summary_path_to_full
-camel_imap_store_summary_full_name
-camel_imap_store_summary_add_from_full
-camel_imap_store_summary_full_from_path
-camel_imap_store_info_full_name
-<SUBSECTION Standard>
-CAMEL_IMAP_STORE_SUMMARY
-CAMEL_IS_IMAP_STORE_SUMMARY
-CAMEL_IMAP_STORE_SUMMARY_CLASS
-CamelImapStoreSummaryClass
-<SUBSECTION Private>
-camel_imap_store_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-store</FILE>
-<TITLE>CamelImapStore</TITLE>
-CamelImapMsg
-CamelImapStore
-camel_imap_msg_new
-camel_imap_msg_queue
-CAMEL_IMAP_STORE_NAMESPACE
-CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE
-CAMEL_IMAP_STORE_CHECK_ALL
-CAMEL_IMAP_STORE_FILTER_INBOX
-CAMEL_IMAP_STORE_FILTER_JUNK
-CAMEL_IMAP_STORE_FILTER_JUNK_INBOX
-CAMEL_IMAP_STORE_CHECK_LSUB
-CAMEL_IMAP_FOLDER_MARKED
-CAMEL_IMAP_FOLDER_UNMARKED
-CamelImapServerLevel
-IMAP_CAPABILITY_IMAP4
-IMAP_CAPABILITY_IMAP4REV1
-IMAP_CAPABILITY_STATUS
-IMAP_CAPABILITY_NAMESPACE
-IMAP_CAPABILITY_UIDPLUS
-IMAP_CAPABILITY_LITERALPLUS
-IMAP_CAPABILITY_STARTTLS
-IMAP_CAPABILITY_useful_lsub
-IMAP_CAPABILITY_utf8_search
-IMAP_CAPABILITY_XGWEXTENSIONS
-IMAP_CAPABILITY_XGWMOVE
-IMAP_CAPABILITY_LOGINDISABLED
-IMAP_CAPABILITY_QUOTA
-IMAP_PARAM_OVERRIDE_NAMESPACE
-IMAP_PARAM_CHECK_ALL
-IMAP_PARAM_FILTER_INBOX
-IMAP_PARAM_FILTER_JUNK
-IMAP_PARAM_FILTER_JUNK_INBOX
-IMAP_PARAM_SUBSCRIPTIONS
-IMAP_PARAM_CHECK_LSUB
-IMAP_FETCH_ALL_HEADERS
-IMAP_FETCH_MAILING_LIST_HEADERS
-IMAP_FETCH_MINIMAL_HEADERS
-camel_imap_store_connected
-camel_imap_store_readline
-<SUBSECTION Standard>
-CAMEL_IMAP_STORE
-CAMEL_IS_IMAP_STORE
-CAMEL_IMAP_STORE_TYPE
-CAMEL_IMAP_STORE_CLASS
-CamelImapStoreClass
-<SUBSECTION Private>
-camel_imap_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-summary</FILE>
-<TITLE>CamelImapSummary</TITLE>
-CAMEL_IMAP_SERVER_FLAGS
-CamelImapMessageContentInfo
-CamelImapMessageInfo
-CamelImapSummary
-camel_imap_summary_new
-camel_imap_summary_add_offline
-camel_imap_summary_add_offline_uncached
-<SUBSECTION Standard>
-CAMEL_IMAP_SUMMARY
-CAMEL_IS_IMAP_SUMMARY
-CAMEL_IMAP_SUMMARY_CLASS
-CamelImapSummaryClass
-<SUBSECTION Private>
-camel_imap_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-wrapper</FILE>
-<TITLE>CamelImapWrapper</TITLE>
-CamelImapWrapper
-camel_imap_wrapper_new
-<SUBSECTION Standard>
-CAMEL_IMAP_WRAPPER
-CAMEL_IS_IMAP_WRAPPER
-CAMEL_IMAP_WRAPPER_TYPE
-CAMEL_IMAP_WRAPPER_CLASS
-CamelImapWrapperClass
-<SUBSECTION Private>
-camel_imap_wrapper_get_type
-CamelImapWrapperPrivate
-</SECTION>
-
-<SECTION>
-<FILE>camel-groupwise-folder</FILE>
-<TITLE>CamelGroupwiseFolder</TITLE>
-CamelGroupwiseFolder
-camel_gw_folder_new
-gw_update_summary
-<SUBSECTION Standard>
-CAMEL_GROUPWISE_FOLDER
-CAMEL_IS_GROUPWISE_FOLDER
-CAMEL_GROUPWISE_FOLDER_TYPE
-CAMEL_GROUPWISE_FOLDER_CLASS
-CamelGroupwiseFolderClass
-<SUBSECTION Private>
-camel_groupwise_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-groupwise-store-summary</FILE>
-<TITLE>CamelGroupwiseStoreSummary</TITLE>
-CamelGroupwiseStoreInfo
-CamelGroupwiseStoreNamespace
-CamelGroupwiseStoreSummary
-camel_groupwise_store_summary_new
-camel_groupwise_store_summary_full_name
-camel_groupwise_store_summary_add_from_full
-camel_groupwise_store_summary_full_to_path
-camel_groupwise_store_summary_path_to_full
-camel_groupwise_store_summary_full_from_path
-camel_groupwise_store_summary_namespace_new
-camel_groupwise_store_summary_namespace_find_path
-camel_groupwise_store_summary_namespace_set
-camel_groupwise_store_info_full_name
-<SUBSECTION Standard>
-CAMEL_GW_STORE_SUMMARY
-CAMEL_IS_GW_STORE_SUMMARY
-CAMEL_GW_STORE_SUMMARY_CLASS
-CamelGroupwiseStoreSummaryClass
-<SUBSECTION Private>
-camel_groupwise_store_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-groupwise-store</FILE>
-<TITLE>CamelGroupwiseStore</TITLE>
-GW_PARAM_FILTER_INBOX
-CamelGroupwiseStore
-CamelGroupwiseStorePrivate
-groupwise_get_name
-camel_groupwise_store_container_id_lookup
-camel_groupwise_store_folder_lookup
-cnc_lookup
-storage_path_lookup
-groupwise_base_url_lookup
-create_junk_folder
-camel_groupwise_store_connected
-gw_store_reload_folder
-groupwise_store_set_current_folder
-<SUBSECTION Standard>
-CAMEL_GROUPWISE_STORE
-CAMEL_IS_GROUPWISE_STORE
-CAMEL_GROUPWISE_STORE_TYPE
-CAMEL_GROUPWISE_STORE_CLASS
-CamelGroupwiseStoreClass
-<SUBSECTION Private>
-camel_groupwise_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-groupwise-summary</FILE>
-<TITLE>CamelGroupwiseSummary</TITLE>
-CamelGroupwiseSummary
-CamelGroupwiseMessageInfo
-CamelGroupwiseMessageContentInfo
-camel_groupwise_summary_new
-camel_gw_summary_add_offline
-camel_gw_summary_add_offline_uncached
-groupwise_summary_clear
-<SUBSECTION Standard>
-CAMEL_GROUPWISE_SUMMARY
-CAMEL_IS_GROUPWISE_SUMMARY
-CAMEL_GROUPWISE_SUMMARY_CLASS
-CamelGroupwiseSummaryClass
-<SUBSECTION Private>
-camel_groupwise_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-groupwise-transport</FILE>
-<TITLE>CamelGroupwiseTransport</TITLE>
-CamelGroupwiseTransport
-<SUBSECTION Standard>
-CAMEL_GROUPWISE_TRANSPORT
-CAMEL_IS_GROUPWISE_TRANSPORT
-CAMEL_GROUPWISE_TRANSPORT_TYPE
-CAMEL_GROUPWISE_TRANSPORT_CLASS
-CamelGroupwiseTransportClass
-<SUBSECTION Private>
-camel_groupwise_transport_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-groupwise-journal</FILE>
-<TITLE>CamelGroupwiseJournal</TITLE>
-CamelGroupwiseJournal
-CamelGroupwiseJournalEntry
-camel_groupwise_journal_new
-camel_groupwise_journal_append
-camel_groupwise_journal_transfer
-<SUBSECTION Standard>
-CAMEL_GROUPWISE_JOURNAL
-CAMEL_IS_GROUPWISE_JOURNAL
-CAMEL_TYPE_GROUPWISE_JOURNAL
-CAMEL_GROUPWISE_JOURNAL_CLASS
-CAMEL_IS_GROUPWISE_JOURNAL_CLASS
-CAMEL_GROUPWISE_JOURNAL_GET_CLASS
-CamelGroupwiseJournalClass
-<SUBSECTION Private>
-camel_groupwise_journal_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-engine</FILE>
-<TITLE>CamelIMAP4Engine</TITLE>
-CamelIMAP4Engine
-camel_imap4_engine_t
-camel_imap4_level_t
-camel_imap4_resp_code_t
-CamelIMAP4RespCode
-CamelIMAP4Namespace
-CamelIMAP4NamespaceList
-CamelIMAP4ReconnectFunc
-camel_imap4_engine_new
-camel_imap4_engine_take_stream
-camel_imap4_engine_disconnect
-camel_imap4_engine_capability
-camel_imap4_engine_namespace
-camel_imap4_engine_select_folder
-camel_imap4_engine_queue
-camel_imap4_engine_prequeue
-camel_imap4_engine_dequeue
-camel_imap4_engine_iterate
-camel_imap4_engine_handle_untagged_1
-camel_imap4_engine_handle_untagged
-camel_imap4_engine_next_token
-camel_imap4_engine_line
-camel_imap4_engine_literal
-camel_imap4_engine_nstring
-camel_imap4_engine_eat_line
-camel_imap4_engine_parse_resp_code
-camel_imap4_resp_code_free
-<SUBSECTION Standard>
-CAMEL_IMAP4_ENGINE
-CAMEL_IS_IMAP4_ENGINE
-CAMEL_TYPE_IMAP4_ENGINE
-CAMEL_IMAP4_ENGINE_CLASS
-CAMEL_IS_IMAP4_ENGINE_CLASS
-CAMEL_IMAP4_ENGINE_GET_CLASS
-CamelIMAP4EngineClass
-<SUBSECTION Private>
-camel_imap4_engine_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-folder</FILE>
-<TITLE>CamelIMAP4Folder</TITLE>
-CamelIMAP4Folder
-camel_imap4_folder_new
-camel_imap4_folder_utf7_name
-<SUBSECTION Standard>
-CAMEL_IMAP4_FOLDER
-CAMEL_IS_IMAP4_FOLDER
-CAMEL_TYPE_IMAP4_FOLDER
-CAMEL_IMAP4_FOLDER_CLASS
-CAMEL_IS_IMAP4_FOLDER_CLASS
-CAMEL_IMAP4_FOLDER_GET_CLASS
-CamelIMAP4FolderClass
-<SUBSECTION Private>
-camel_imap4_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-search</FILE>
-<TITLE>CamelIMAP4Search</TITLE>
-CamelIMAP4Search
-camel_imap4_search_new
-<SUBSECTION Standard>
-CAMEL_IMAP4_SEARCH
-CAMEL_IS_IMAP4_SEARCH
-CAMEL_IMAP4_SEARCH_TYPE
-CAMEL_IMAP4_SEARCH_CLASS
-CamelIMAP4SearchClass
-<SUBSECTION Private>
-camel_imap4_search_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-store-summary</FILE>
-<TITLE>CamelIMAP4StoreSummary</TITLE>
-CamelIMAP4StoreInfo
-CamelIMAP4StoreSummary
-camel_imap4_store_summary_new
-camel_imap4_store_summary_set_capabilities
-camel_imap4_store_summary_set_namespaces
-camel_imap4_store_summary_note_info
-camel_imap4_store_summary_unnote_info
-camel_imap4_store_summary_get_folder_info
-<SUBSECTION Standard>
-CAMEL_IMAP4_STORE_SUMMARY
-CAMEL_IS_IMAP4_STORE_SUMMARY
-CAMEL_IMAP4_STORE_SUMMARY_CLASS
-CamelIMAP4StoreSummaryClass
-<SUBSECTION Private>
-camel_imap4_store_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-store</FILE>
-<TITLE>CamelIMAP4Store</TITLE>
-CamelIMAP4Store
-<SUBSECTION Standard>
-CAMEL_IMAP4_STORE
-CAMEL_IS_IMAP4_STORE
-CAMEL_TYPE_IMAP4_STORE
-CAMEL_IMAP4_STORE_CLASS
-CAMEL_IS_IMAP4_STORE_CLASS
-CAMEL_IMAP4_STORE_GET_CLASS
-CamelIMAP4StoreClass
-<SUBSECTION Private>
-camel_imap4_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-stream</FILE>
-<TITLE>CamelIMAP4Stream</TITLE>
-IMAP4_READ_PRELEN
-IMAP4_READ_BUFLEN
-camel_imap4_token_t
-CamelIMAP4Stream
-camel_imap4_stream_new
-camel_imap4_stream_next_token
-camel_imap4_stream_unget_token
-camel_imap4_stream_line
-camel_imap4_stream_literal
-<SUBSECTION Standard>
-CAMEL_IMAP4_STREAM
-CAMEL_IS_IMAP4_STREAM
-CAMEL_TYPE_IMAP4_STREAM
-CAMEL_IMAP4_STREAM_CLASS
-CamelIMAP4StreamClass
-<SUBSECTION Private>
-camel_imap4_stream_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-summary</FILE>
-<TITLE>CamelIMAP4Summary</TITLE>
-CamelIMAP4Summary
-CamelIMAP4MessageInfo
-CamelIMAP4MessageContentInfo
-CAMEL_IMAP4_MESSAGE_RECENT
-camel_imap4_summary_new
-camel_imap4_summary_set_exists
-camel_imap4_summary_set_recent
-camel_imap4_summary_set_unseen
-camel_imap4_summary_set_uidnext
-camel_imap4_summary_set_uidvalidity
-camel_imap4_summary_expunge
-camel_imap4_summary_flush_updates
-<SUBSECTION Standard>
-CAMEL_IMAP4_SUMMARY
-CAMEL_IS_IMAP4_SUMMARY
-CAMEL_TYPE_IMAP4_SUMMARY
-CAMEL_IMAP4_SUMMARY_CLASS
-CAMEL_IS_IMAP4_SUMMARY_CLASS
-CAMEL_IMAP4_SUMMARY_GET_CLASS
-CamelIMAP4SummaryClass
-<SUBSECTION Private>
-camel_imap4_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-journal</FILE>
-<TITLE>CamelIMAP4Journal</TITLE>
-CamelIMAP4Journal
-CamelIMAP4JournalEntry
-camel_imap4_journal_new
-camel_imap4_journal_readd_failed
-camel_imap4_journal_append
-<SUBSECTION Standard>
-CAMEL_IMAP4_JOURNAL
-CAMEL_IS_IMAP4_JOURNAL
-CAMEL_TYPE_IMAP4_JOURNAL
-CAMEL_IMAP4_JOURNAL_CLASS
-CAMEL_IS_IMAP4_JOURNAL_CLASS
-CAMEL_IMAP4_JOURNAL_GET_CLASS
-CamelIMAP4JournalClass
-<SUBSECTION Private>
-camel_imap4_journal_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-local-folder</FILE>
-<TITLE>CamelLocalFolder</TITLE>
-CamelLocalFolder
-camel_local_folder_construct
-camel_local_folder_lock
-camel_local_folder_unlock
-<SUBSECTION Standard>
-CAMEL_LOCAL_FOLDER
-CAMEL_IS_LOCAL_FOLDER
-CAMEL_LOCAL_FOLDER_TYPE
-CAMEL_LOCAL_FOLDER_CLASS
-CamelLocalFolderClass
-<SUBSECTION Private>
-CamelLocalFolderPrivate
-camel_local_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-local-store</FILE>
-<TITLE>CamelLocalStore</TITLE>
-CamelLocalStore
-camel_local_store_get_toplevel_dir
-camel_local_store_get_full_path
-camel_local_store_get_meta_path
-<SUBSECTION Standard>
-CAMEL_LOCAL_STORE
-CAMEL_IS_LOCAL_STORE
-CAMEL_LOCAL_STORE_TYPE
-CAMEL_LOCAL_STORE_CLASS
-CamelLocalStoreClass
-<SUBSECTION Private>
-camel_local_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-local-summary</FILE>
-<TITLE>CamelLocalSummary</TITLE>
-CamelLocalSummary
-CamelLocalMessageInfo
-camel_local_summary_construct
-camel_local_summary_load
-camel_local_summary_check
-camel_local_summary_sync
-camel_local_summary_add
-camel_local_summary_check_force
-camel_local_summary_encode_x_evolution
-camel_local_summary_decode_x_evolution
-camel_local_summary_write_headers
-<SUBSECTION Standard>
-CAMEL_LOCAL_SUMMARY
-CAMEL_IS_LOCAL_SUMMARY
-CAMEL_LOCAL_SUMMARY_CLASS
-CamelLocalSummaryClass
-<SUBSECTION Private>
-camel_local_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-maildir-folder</FILE>
-<TITLE>CamelMaildirFolder</TITLE>
-CamelMaildirFolder
-camel_maildir_folder_new
-<SUBSECTION Standard>
-CAMEL_MAILDIR_FOLDER
-CAMEL_IS_MAILDIR_FOLDER
-CAMEL_MAILDIR_FOLDER_TYPE
-CAMEL_MAILDIR_FOLDER_CLASS
-CamelMaildirFolderClass
-<SUBSECTION Private>
-camel_maildir_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-maildir-store</FILE>
-<TITLE>CamelMaildirStore</TITLE>
-CamelMaildirStore
-<SUBSECTION Standard>
-CAMEL_MAILDIR_STORE
-CAMEL_IS_MAILDIR_STORE
-CAMEL_MAILDIR_STORE_TYPE
-CAMEL_MAILDIR_STORE_CLASS
-CamelMaildirStoreClass
-<SUBSECTION Private>
-camel_maildir_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-maildir-summary</FILE>
-<TITLE>CamelMaildirSummary</TITLE>
-CamelMaildirSummary
-CamelMaildirMessageContentInfo
-CamelMaildirMessageInfo
-camel_maildir_summary_new
-camel_maildir_summary_info_to_name
-camel_maildir_summary_name_to_info
-camel_maildir_info_filename
-camel_maildir_info_set_filename
-<SUBSECTION Standard>
-CAMEL_MAILDIR_SUMMARY
-CAMEL_IS_MAILDIR_SUMMARY
-CAMEL_MAILDIR_SUMMARY_CLASS
-CamelMaildirSummaryClass
-<SUBSECTION Private>
-camel_maildir_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-mbox-folder</FILE>
-<TITLE>CamelMboxFolder</TITLE>
-CamelMboxFolder
-camel_mbox_folder_new
-<SUBSECTION Standard>
-CAMEL_MBOX_FOLDER
-CAMEL_IS_MBOX_FOLDER
-CAMEL_MBOX_FOLDER_TYPE
-CAMEL_MBOX_FOLDER_CLASS
-CamelMboxFolderClass
-<SUBSECTION Private>
-camel_mbox_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-mbox-store</FILE>
-<TITLE>CamelMboxStore</TITLE>
-CamelMboxStore
-<SUBSECTION Standard>
-CAMEL_MBOX_STORE
-CAMEL_IS_MBOX_STORE
-CAMEL_MBOX_STORE_TYPE
-CAMEL_MBOX_STORE_CLASS
-CamelMboxStoreClass
-<SUBSECTION Private>
-camel_mbox_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-mbox-summary</FILE>
-<TITLE>CamelMboxSummary</TITLE>
-STATUS_PINE
-CamelMboxSummary
-CamelMboxMessageContentInfo
-CamelMboxMessageInfo
-camel_mbox_summary_new
-camel_mbox_summary_xstatus
-camel_mbox_summary_sync_mbox
-<SUBSECTION Standard>
-CAMEL_MBOX_SUMMARY
-CAMEL_IS_MBOX_SUMMARY
-CAMEL_MBOX_SUMMARY_CLASS
-CamelMboxSummaryClass
-<SUBSECTION Private>
-camel_mbox_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-mh-folder</FILE>
-<TITLE>CamelMhFolder</TITLE>
-CamelMhFolder
-camel_mh_folder_new
-<SUBSECTION Standard>
-CAMEL_MH_FOLDER
-CAMEL_IS_MH_FOLDER
-CAMEL_MH_FOLDER_TYPE
-CAMEL_MH_FOLDER_CLASS
-CamelMhFolderClass
-<SUBSECTION Private>
-camel_mh_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-mh-store</FILE>
-<TITLE>CamelMhStore</TITLE>
-CamelMhStore
-<SUBSECTION Standard>
-CAMEL_MH_STORE
-CAMEL_IS_MH_STORE
-CAMEL_MH_STORE_TYPE
-CAMEL_MH_STORE_CLASS
-CamelMhStoreClass
-<SUBSECTION Private>
-camel_mh_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-mh-summary</FILE>
-<TITLE>CamelMhSummary</TITLE>
-CamelMhSummary
-camel_mh_summary_new
-<SUBSECTION Standard>
-CAMEL_MH_SUMMARY
-CAMEL_IS_MH_SUMMARY
-CAMEL_MH_SUMMARY_CLASS
-CamelMhSummaryClass
-<SUBSECTION Private>
-camel_mh_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-spool-folder</FILE>
-<TITLE>CamelSpoolFolder</TITLE>
-CamelSpoolFolder
-camel_spool_folder_new
-<SUBSECTION Standard>
-CAMEL_SPOOL_FOLDER
-CAMEL_IS_SPOOL_FOLDER
-CAMEL_SPOOL_FOLDER_TYPE
-CAMEL_SPOOL_FOLDER_CLASS
-CamelSpoolFolderClass
-<SUBSECTION Private>
-camel_spool_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-spool-store</FILE>
-<TITLE>CamelSpoolStore</TITLE>
-CamelSpoolStore
-camel_spool_store_t
-<SUBSECTION Standard>
-CAMEL_SPOOL_STORE
-CAMEL_IS_SPOOL_STORE
-CAMEL_SPOOL_STORE_TYPE
-CAMEL_SPOOL_STORE_CLASS
-CamelSpoolStoreClass
-<SUBSECTION Private>
-camel_spool_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-spool-summary</FILE>
-<TITLE>CamelSpoolSummary</TITLE>
-CamelSpoolSummary
-camel_spool_summary_construct
-camel_spool_summary_new
-camel_spool_summary_load
-camel_spool_summary_check
-camel_spool_summary_sync
-camel_spool_summary_add
-camel_spool_summary_encode_x_evolution
-camel_spool_summary_decode_x_evolution
-camel_spool_summary_write_headers
-<SUBSECTION Standard>
-CAMEL_SPOOL_SUMMARY
-CAMEL_IS_SPOOL_SUMMARY
-CAMEL_SPOOL_SUMMARY_CLASS
-CamelSpoolSummaryClass
-<SUBSECTION Private>
-camel_spool_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-folder</FILE>
-<TITLE>CamelNNTPFolder</TITLE>
-CamelNNTPFolder
-camel_nntp_folder_new
-camel_nntp_folder_selected
-<SUBSECTION Standard>
-CAMEL_NNTP_FOLDER
-CAMEL_IS_NNTP_FOLDER
-CAMEL_NNTP_FOLDER_TYPE
-CAMEL_NNTP_FOLDER_CLASS
-CamelNNTPFolderClass
-<SUBSECTION Private>
-CamelNNTPFolderPrivate
-camel_nntp_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-store-summary</FILE>
-<TITLE>CamelNNTPStoreSummary</TITLE>
-CamelNNTPStoreInfo
-CamelNNTPStoreSummary
-NNTP_DATE_SIZE
-camel_nntp_store_summary_new
-camel_nntp_store_info_full_name
-camel_nntp_store_summary_full_to_path
-camel_nntp_store_summary_path_to_full
-camel_nntp_store_summary_dotted_to_full
-camel_nntp_store_summary_full_name
-camel_nntp_store_summary_add_from_full
-camel_nntp_store_summary_full_from_path
-<SUBSECTION Standard>
-CAMEL_NNTP_STORE_SUMMARY
-CAMEL_IS_NNTP_STORE_SUMMARY
-CAMEL_NNTP_STORE_SUMMARY_CLASS
-CamelNNTPStoreSummaryClass
-<SUBSECTION Private>
-camel_nntp_store_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-store</FILE>
-<TITLE>CamelNNTPStore</TITLE>
-CamelNNTPStore
-CAMEL_NNTP_EXT_SEARCH
-CAMEL_NNTP_EXT_SETGET
-CAMEL_NNTP_EXT_OVER
-CAMEL_NNTP_EXT_XPATTEXT
-CAMEL_NNTP_EXT_XACTIVE
-CAMEL_NNTP_EXT_LISTMOTD
-CAMEL_NNTP_EXT_LISTSUBSCR
-CAMEL_NNTP_EXT_LISTPNAMES
-xover_t
-xover_header
-camel_nntp_raw_commandv
-camel_nntp_raw_command
-camel_nntp_raw_command_auth
-camel_nntp_command
-<SUBSECTION Standard>
-CAMEL_NNTP_STORE
-CAMEL_IS_NNTP_STORE
-CAMEL_NNTP_STORE_TYPE
-CAMEL_NNTP_STORE_CLASS
-CamelNNTPStoreClass
-<SUBSECTION Private>
-CamelNNTPStorePrivate
-camel_nntp_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-stream</FILE>
-<TITLE>CamelNNTPStream</TITLE>
-CamelNNTPStream
-camel_nntp_stream_mode_t
-camel_nntp_stream_new
-camel_nntp_stream_set_mode
-camel_nntp_stream_line
-camel_nntp_stream_gets
-camel_nntp_stream_getd
-<SUBSECTION Standard>
-CAMEL_NNTP_STREAM
-CAMEL_IS_NNTP_STREAM
-CAMEL_NNTP_STREAM_CLASS
-CamelNNTPStreamClass
-<SUBSECTION Private>
-camel_nntp_stream_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-summary</FILE>
-<TITLE>CamelNNTPSummary</TITLE>
-CamelNNTPSummary
-camel_nntp_summary_new
-camel_nntp_summary_check
-<SUBSECTION Standard>
-CAMEL_NNTP_SUMMARY
-CAMEL_IS_LOCAL_SUMMARY
-CAMEL_NNTP_SUMMARY_CLASS
-CamelNNTPSummaryClass
-<SUBSECTION Private>
-camel_nntp_summary_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-pop3-engine</FILE>
-<TITLE>CamelPOP3Engine</TITLE>
-CamelPOP3Engine
-CamelPOP3Command
-camel_pop3_engine_t
-camel_pop3_command_t
-CamelPOP3CommandFunc
-camel_pop3_engine_new
-camel_pop3_engine_reget_capabilities
-camel_pop3_engine_command_free
-camel_pop3_engine_iterate
-camel_pop3_engine_command_new
-<SUBSECTION Standard>
-CAMEL_POP3_ENGINE
-CAMEL_IS_POP3_ENGINE
-CAMEL_POP3_ENGINE_CLASS
-CamelPOP3EngineClass
-<SUBSECTION Private>
-camel_pop3_engine_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-pop3-folder</FILE>
-<TITLE>CamelPOP3Folder</TITLE>
-CamelPOP3Folder
-CamelPOP3FolderInfo
-camel_pop3_folder_new
-camel_pop3_delete_old
-<SUBSECTION Standard>
-CAMEL_POP3_FOLDER
-CAMEL_IS_POP3_FOLDER
-CAMEL_POP3_FOLDER_TYPE
-CAMEL_POP3_FOLDER_CLASS
-CamelPOP3FolderClass
-<SUBSECTION Private>
-camel_pop3_folder_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-pop3-store</FILE>
-<TITLE>CamelPOP3Store</TITLE>
-CamelPOP3Store
-camel_pop3_store_expunge
-camel_pop3_command
-camel_pop3_command_get_additional_data
-<SUBSECTION Standard>
-CAMEL_POP3_STORE
-CAMEL_IS_POP3_STORE
-CAMEL_POP3_STORE_TYPE
-CAMEL_POP3_STORE_CLASS
-CamelPOP3StoreClass
-<SUBSECTION Private>
-camel_pop3_store_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-pop3-stream</FILE>
-<TITLE>CamelPOP3Stream</TITLE>
-CamelPOP3Stream
-camel_pop3_stream_mode_t
-camel_pop3_stream_new
-camel_pop3_stream_set_mode
-camel_pop3_stream_line
-camel_pop3_stream_gets
-camel_pop3_stream_getd
-<SUBSECTION Standard>
-CAMEL_POP3_STREAM
-CAMEL_IS_POP3_STREAM
-CAMEL_POP3_STREAM_CLASS
-CamelPOP3StreamClass
-<SUBSECTION Private>
-camel_pop3_stream_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-sendmail-transport</FILE>
-<TITLE>CamelSendmailTransport</TITLE>
-CamelSendmailTransport
-<SUBSECTION Standard>
-CAMEL_SENDMAIL_TRANSPORT
-CAMEL_IS_SENDMAIL_TRANSPORT
-CAMEL_SENDMAIL_TRANSPORT_TYPE
-CAMEL_SENDMAIL_TRANSPORT_CLASS
-CamelSendmailTransportClass
-<SUBSECTION Private>
-camel_sendmail_transport_get_type
-</SECTION>
-
-<SECTION>
-<FILE>camel-smtp-transport</FILE>
-<TITLE>CamelSmtpTransport</TITLE>
-CamelSmtpTransport
-CAMEL_SMTP_TRANSPORT_IS_ESMTP
-CAMEL_SMTP_TRANSPORT_8BITMIME
-CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES
-CAMEL_SMTP_TRANSPORT_STARTTLS
-CAMEL_SMTP_TRANSPORT_AUTH_EQUAL
-<SUBSECTION Standard>
-CAMEL_SMTP_TRANSPORT
-CAMEL_IS_SMTP_TRANSPORT
-CAMEL_SMTP_TRANSPORT_TYPE
-CAMEL_SMTP_TRANSPORT_CLASS
-CamelSmtpTransportClass
-<SUBSECTION Private>
-camel_smtp_transport_get_type
-</SECTION>
-
-<SECTION>
-<FILE>session</FILE>
-<TITLE>CamelTestSession</TITLE>
-CamelTestSession
-camel_test_session_new
-<SUBSECTION Standard>
-CAMEL_TEST_SESSION
-CAMEL_TEST_IS_SESSION
-CAMEL_TEST_SESSION_TYPE
-CAMEL_TEST_SESSION_CLASS
-CamelTestSessionClass
-<SUBSECTION Private>
-camel_test_session_get_type
-</SECTION>
-
-<SECTION>
<FILE>camel-arg</FILE>
CamelArg
CamelArgV
@@ -3497,8 +2805,6 @@ camel_operation_cancel
camel_operation_uncancel
camel_operation_register
camel_operation_unregister
-camel_operation_cancel_block
-camel_operation_cancel_unblock
camel_operation_cancel_check
camel_operation_cancel_fd
camel_operation_cancel_prfd
@@ -3506,46 +2812,10 @@ camel_operation_registered
camel_operation_start
camel_operation_start_transient
camel_operation_progress
-camel_operation_progress_count
camel_operation_end
</SECTION>
<SECTION>
-<FILE>camel-partition-table</FILE>
-<TITLE>CamelPartitionTable</TITLE>
-<TITLE>CamelKeyTable</TITLE>
-camel_hash_t
-CamelPartitionKey
-CamelPartitionKeyBlock
-CamelPartitionMap
-CamelPartitionMapBlock
-CamelPartitionTable
-camel_partition_table_new
-camel_partition_table_sync
-camel_partition_table_add
-camel_partition_table_lookup
-camel_partition_table_remove
-CamelKeyBlock
-CamelKeyRootBlock
-CamelKeyKey
-CAMEL_KEY_TABLE_MAX_KEY
-CamelKeyTable
-camel_key_table_new
-camel_key_table_sync
-camel_key_table_add
-camel_key_table_set_data
-camel_key_table_set_flags
-camel_key_table_lookup
-camel_key_table_next
-<SUBSECTION Standard>
-CamelPartitionTableClass
-CamelKeyTableClass
-<SUBSECTION Private>
-camel_partition_table_get_type
-camel_key_table_get_type
-</SECTION>
-
-<SECTION>
<FILE>camel-string-utils</FILE>
camel_strcase_equal
camel_strcase_hash
@@ -3666,260 +2936,3 @@ camel_getnameinfo
WIN32_LEAN_AND_MEAN
</SECTION>
-<SECTION>
-<FILE>camel-imap-command</FILE>
-CamelImapResponseType
-CamelImapResponse
-camel_imap_command
-camel_imap_command_continuation
-camel_imap_response_free
-camel_imap_response_free_without_processing
-camel_imap_response_extract
-camel_imap_response_extract_continuation
-camel_imap_command_start
-camel_imap_command_response
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap-utils</FILE>
-imap_next_word
-namespace
-namespaces
-imap_namespaces_destroy
-imap_parse_namespace_response
-imap_parse_list_response
-imap_parse_folder_name
-imap_create_flag_list
-imap_parse_flag_list
-imap_parse_string_generic
-imap_parse_string
-imap_parse_nstring
-imap_parse_astring
-imap_parse_body
-imap_is_atom
-imap_quote_string
-imap_skip_list
-imap_uid_array_to_set
-imap_uid_set_to_array
-imap_uid_array_free
-imap_concat
-imap_namespace_concat
-imap_mailbox_encode
-imap_mailbox_decode
-IMAPPathFindFoldersCallback
-imap_path_to_physical
-imap_path_find_folders
-</SECTION>
-
-<SECTION>
-<FILE>camel-groupwise-utils</FILE>
-X_SEND_OPTIONS
-X_SEND_OPT_PRIORITY
-X_SEND_OPT_SECURITY
-X_REPLY_CONVENIENT
-X_REPLY_WITHIN
-X_EXPIRE_AFTER
-X_DELAY_UNTIL
-X_TRACK_WHEN
-X_AUTODELETE
-X_RETURN_NOTIFY_OPEN
-X_RETURN_NOTIFY_DELETE
-RECEIVED
-SENT
-DRAFT
-PERSONAL
-flags_diff_t
-EPathFindFoldersCallback
-e_path_to_physical
-e_path_find_folders
-e_path_rmdir
-camel_groupwise_util_item_from_message
-do_flags_diff
-gw_concat
-strip_lt_gt
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-command</FILE>
-CamelIMAP4Command
-CamelIMAP4Literal
-CamelIMAP4PlusCallback
-CamelIMAP4UntaggedCallback
-CamelIMAP4CommandReset
-CamelIMAP4CommandPart
-camel_imap4_command_new
-camel_imap4_command_newv
-camel_imap4_command_register_untagged
-camel_imap4_command_ref
-camel_imap4_command_unref
-camel_imap4_command_step
-camel_imap4_command_reset
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-specials</FILE>
-is_atom
-is_ctrl
-is_lwsp
-is_type
-is_qsafe
-is_wild
-camel_imap4_specials_init
-</SECTION>
-
-<SECTION>
-<FILE>camel-imap4-utils</FILE>
-flags_diff_t
-camel_imap4_flags_diff
-camel_imap4_flags_merge
-camel_imap4_merge_flags
-camel_imap4_build_folder_info_tree
-camel_imap4_namespace_clear
-camel_imap4_namespace_list_copy
-camel_imap4_namespace_list_free
-camel_imap4_get_path_delim
-camel_imap4_get_uid_set
-camel_imap4_utils_set_unexpected_token_error
-camel_imap4_parse_flags_list
-CAMEL_IMAP4_FOLDER_MARKED
-CAMEL_IMAP4_FOLDER_UNMARKED
-camel_imap4_list_t
-camel_imap4_untagged_list
-camel_imap4_status_attr_t
-camel_imap4_status_t
-camel_imap4_status_free
-camel_imap4_untagged_status
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-auth</FILE>
-camel_nntp_auth_authenticate
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-grouplist</FILE>
-_CamelNNTPGroupList
-_CamelNNTPGroupListEntry
-camel_nntp_grouplist_fetch
-camel_nntp_grouplist_update
-camel_nntp_grouplist_save
-camel_nntp_grouplist_free
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-newsrc</FILE>
-CamelNNTPNewsrc
-camel_nntp_newsrc_get_highest_article_read
-camel_nntp_newsrc_get_num_articles_read
-camel_nntp_newsrc_mark_article_read
-camel_nntp_newsrc_mark_range_read
-camel_nntp_newsrc_article_is_read
-camel_nntp_newsrc_group_is_subscribed
-camel_nntp_newsrc_subscribe_group
-camel_nntp_newsrc_unsubscribe_group
-camel_nntp_newsrc_get_subscribed_group_names
-camel_nntp_newsrc_get_all_group_names
-camel_nntp_newsrc_free_group_names
-camel_nntp_newsrc_write_to_file
-camel_nntp_newsrc_write
-camel_nntp_newsrc_read_for_server
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-resp-codes</FILE>
-CAMEL_NNTP_OK
-CAMEL_NNTP_ERR
-CAMEL_NNTP_FAIL
-NNTP_GREETING_POSTING_OK
-NNTP_GREETING_NO_POSTING
-NNTP_EXTENSIONS_SUPPORTED
-NNTP_GROUP_SELECTED
-NNTP_LIST_FOLLOWS
-NNTP_ARTICLE_FOLLOWS
-NNTP_HEAD_FOLLOWS
-NNTP_DATA_FOLLOWS
-NNTP_NEW_ARTICLE_LIST_FOLLOWS
-NNTP_NEW_GROUP_LIST_FOLLOWS
-NNTP_NO_SUCH_GROUP
-NNTP_NO_SUCH_ARTICLE
-NNTP_NO_PERMISSION
-NNTP_AUTH_ACCEPTED
-NNTP_AUTH_CONTINUE
-NNTP_AUTH_REQUIRED
-NNTP_AUTH_REJECTED
-NNTP_PROTOCOL_ERROR
-</SECTION>
-
-<SECTION>
-<FILE>camel-nntp-utils</FILE>
-camel_nntp_get_headers
-</SECTION>
-
-<SECTION>
-<FILE>address-data</FILE>
-</SECTION>
-
-<SECTION>
-<FILE>addresses</FILE>
-test_address_compare
-</SECTION>
-
-<SECTION>
-<FILE>camel-test</FILE>
-camel_test_failv
-check
-check_msg
-check_count
-check_unref
-test_free
-push
-pull
-camel_test_init
-camel_test_start
-camel_test_end
-camel_test_push
-camel_test_pull
-camel_test_fail
-camel_test_nonfatal
-camel_test_fatal
-string_equal
-</SECTION>
-
-<SECTION>
-<FILE>folders</FILE>
-test_folder_counts
-test_message_info
-test_folder_message
-test_folder_not_message
-test_folder_basic
-test_folder_message_ops
-</SECTION>
-
-<SECTION>
-<FILE>messages</FILE>
-SET_CONTENT_WAYS
-test_message_create_simple
-test_message_set_content_simple
-test_message_write_file
-test_message_read_file
-test_message_compare_content
-test_message_compare
-test_message_dump_structure
-test_message_compare_header
-test_message_compare_messages
-</SECTION>
-
-<SECTION>
-<FILE>streams</FILE>
-test_stream_seekable_writepart
-test_stream_seekable_readpart
-SEEKABLE_SUBSTREAM_WAYS
-test_seekable_substream_writepart
-test_seekable_substream_readpart
-</SECTION>
-
-<SECTION>
-<FILE>camel-test-provider</FILE>
-camel_test_provider_init
-</SECTION>
-
diff --git a/docs/reference/camel/camel.types b/docs/reference/camel/camel.types
index e69de29..78e4e53 100644
--- a/docs/reference/camel/camel.types
+++ b/docs/reference/camel/camel.types
@@ -0,0 +1,90 @@
+#include <camel/camel.h>
+
+camel_address_get_type
+camel_block_file_get_type
+camel_key_file_get_type
+camel_certdb_get_type
+camel_cipher_context_get_type
+camel_data_cache_get_type
+camel_data_wrapper_get_type
+camel_disco_diary_get_type
+camel_disco_folder_get_type
+camel_disco_store_get_type
+camel_filter_driver_get_type
+camel_folder_get_type
+camel_folder_search_get_type
+camel_folder_summary_get_type
+camel_gpg_context_get_type
+camel_html_parser_get_type
+camel_http_stream_get_type
+camel_index_cursor_get_type
+camel_index_name_get_type
+camel_index_get_type
+camel_internet_address_get_type
+camel_medium_get_type
+camel_mime_filter_basic_get_type
+camel_mime_filter_bestenc_get_type
+camel_mime_filter_canon_get_type
+camel_mime_filter_charset_get_type
+camel_mime_filter_crlf_get_type
+camel_mime_filter_enriched_get_type
+camel_mime_filter_from_get_type
+camel_mime_filter_gzip_get_type
+camel_mime_filter_get_type
+camel_mime_filter_html_get_type
+camel_mime_filter_index_get_type
+camel_mime_filter_linewrap_get_type
+camel_mime_filter_pgp_get_type
+camel_mime_filter_progress_get_type
+camel_mime_filter_save_get_type
+camel_mime_filter_tohtml_get_type
+camel_mime_filter_windows_get_type
+camel_mime_filter_yenc_get_type
+camel_mime_message_get_type
+camel_mime_parser_get_type
+camel_mime_part_get_type
+camel_multipart_encrypted_get_type
+camel_multipart_get_type
+camel_multipart_signed_get_type
+camel_nntp_address_get_type
+camel_object_get_type
+camel_offline_folder_get_type
+camel_offline_journal_get_type
+camel_offline_store_get_type
+camel_partition_table_get_type
+camel_key_table_get_type
+camel_sasl_anonymous_get_type
+camel_sasl_cram_md5_get_type
+camel_sasl_digest_md5_get_type
+camel_sasl_gssapi_get_type
+camel_sasl_get_type
+camel_sasl_login_get_type
+camel_sasl_ntlm_get_type
+camel_sasl_plain_get_type
+camel_sasl_popb4smtp_get_type
+camel_seekable_stream_get_type
+camel_seekable_substream_get_type
+camel_service_get_type
+camel_session_get_type
+camel_smime_context_get_type
+camel_store_get_type
+camel_store_summary_get_type
+camel_stream_buffer_get_type
+camel_stream_filter_get_type
+camel_stream_fs_get_type
+camel_stream_get_type
+camel_stream_mem_get_type
+camel_stream_null_get_type
+camel_stream_process_get_type
+camel_stream_vfs_get_type
+camel_tcp_stream_get_type
+camel_tcp_stream_raw_get_type
+camel_text_index_cursor_get_type
+camel_text_index_key_cursor_get_type
+camel_text_index_name_get_type
+camel_text_index_get_type
+camel_transport_get_type
+camel_vee_folder_get_type
+camel_vee_store_get_type
+camel_vee_summary_get_type
+camel_vtrash_folder_get_type
diff --git a/docs/reference/camel/tmpl/camel-address.sgml b/docs/reference/camel/tmpl/camel-address.sgml
index 343963e..f25bbf2 100644
--- a/docs/reference/camel/tmpl/camel-address.sgml
+++ b/docs/reference/camel/tmpl/camel-address.sgml
@@ -25,9 +25,6 @@ CamelAddress
</para>
- parent:
- addresses:
- priv:
<!-- ##### FUNCTION camel_address_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-block-file.sgml b/docs/reference/camel/tmpl/camel-block-file.sgml
index 2c7ad17..334dfb8 100644
--- a/docs/reference/camel/tmpl/camel-block-file.sgml
+++ b/docs/reference/camel/tmpl/camel-block-file.sgml
@@ -61,19 +61,6 @@ CamelKeyFile
</para>
- parent:
- priv:
- version:
- path:
- flags:
- fd:
- block_size:
- root:
- root_block:
- block_cache_limit:
- block_cache_count:
- block_cache:
- blocks:
<!-- ##### MACRO CAMEL_BLOCK_FILE_SYNC ##### -->
<para>
@@ -230,12 +217,6 @@ CamelKeyFile
</para>
- parent:
- priv:
- fp:
- path:
- flags:
- last:
<!-- ##### FUNCTION camel_key_file_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-certdb.sgml b/docs/reference/camel/tmpl/camel-certdb.sgml
index 9219fc7..fc345dc 100644
--- a/docs/reference/camel/tmpl/camel-certdb.sgml
+++ b/docs/reference/camel/tmpl/camel-certdb.sgml
@@ -25,16 +25,6 @@ CamelCertDB
</para>
- parent:
- priv:
- filename:
- version:
- saved_certs:
- flags:
- cert_size:
- cert_chunks:
- certs:
- cert_hash:
<!-- ##### ENUM CamelCertTrust ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-cipher-context.sgml b/docs/reference/camel/tmpl/camel-cipher-context.sgml
index 44dcb8f..c0bf9de 100644
--- a/docs/reference/camel/tmpl/camel-cipher-context.sgml
+++ b/docs/reference/camel/tmpl/camel-cipher-context.sgml
@@ -25,8 +25,11 @@ CamelCipherContext
</para>
- parent:
- priv:
+
+<!-- ##### ARG CamelCipherContext:session ##### -->
+<para>
+
+</para>
<!-- ##### STRUCT CamelCipherValidity ##### -->
<para>
@@ -101,13 +104,13 @@ CamelCipherContext
@Returns:
-<!-- ##### FUNCTION camel_cipher_context_construct ##### -->
+<!-- ##### FUNCTION camel_cipher_context_get_session ##### -->
<para>
</para>
@context:
- session:
+ Returns:
<!-- ##### FUNCTION camel_cipher_id_to_hash ##### -->
@@ -298,6 +301,34 @@ CamelCipherContext
@gpointer cert_data:
@gpointer cert_data:
@gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
@gpointer cert_data:
diff --git a/docs/reference/camel/tmpl/camel-data-cache.sgml b/docs/reference/camel/tmpl/camel-data-cache.sgml
index 4f4c015..ad3fef1 100644
--- a/docs/reference/camel/tmpl/camel-data-cache.sgml
+++ b/docs/reference/camel/tmpl/camel-data-cache.sgml
@@ -25,8 +25,11 @@ CamelDataCache
</para>
- parent:
- priv:
+
+<!-- ##### ARG CamelDataCache:path ##### -->
+<para>
+
+</para>
<!-- ##### FUNCTION camel_data_cache_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-data-wrapper.sgml b/docs/reference/camel/tmpl/camel-data-wrapper.sgml
index c81bb7f..f48475c 100644
--- a/docs/reference/camel/tmpl/camel-data-wrapper.sgml
+++ b/docs/reference/camel/tmpl/camel-data-wrapper.sgml
@@ -25,12 +25,6 @@ CamelDataWrapper
</para>
- parent:
- priv:
- encoding:
- mime_type:
- stream:
- offline:
<!-- ##### FUNCTION camel_data_wrapper_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-disco-diary.sgml b/docs/reference/camel/tmpl/camel-disco-diary.sgml
index 17328ee..15cccd7 100644
--- a/docs/reference/camel/tmpl/camel-disco-diary.sgml
+++ b/docs/reference/camel/tmpl/camel-disco-diary.sgml
@@ -25,11 +25,6 @@ CamelDiscoDiary
</para>
- parent:
- store:
- file:
- folders:
- uidmap:
<!-- ##### ENUM CamelDiscoDiaryAction ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-disco-folder.sgml b/docs/reference/camel/tmpl/camel-disco-folder.sgml
index 504e7de..f3cad62 100644
--- a/docs/reference/camel/tmpl/camel-disco-folder.sgml
+++ b/docs/reference/camel/tmpl/camel-disco-folder.sgml
@@ -25,8 +25,6 @@ CamelDiscoFolder
</para>
- parent:
- offline_sync:
<!-- ##### FUNCTION camel_disco_folder_expunge_uids ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-disco-store.sgml b/docs/reference/camel/tmpl/camel-disco-store.sgml
index 7dc0157..5a5787a 100644
--- a/docs/reference/camel/tmpl/camel-disco-store.sgml
+++ b/docs/reference/camel/tmpl/camel-disco-store.sgml
@@ -25,9 +25,6 @@ CamelDiscoStore
</para>
- parent:
- status:
- diary:
<!-- ##### ENUM CamelDiscoStoreStatus ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-filter-driver.sgml b/docs/reference/camel/tmpl/camel-filter-driver.sgml
index b429b25..eb03a68 100644
--- a/docs/reference/camel/tmpl/camel-filter-driver.sgml
+++ b/docs/reference/camel/tmpl/camel-filter-driver.sgml
@@ -25,8 +25,6 @@ CamelFilterDriver
</para>
- parent:
- priv:
<!-- ##### USER_FUNCTION CamelFilterGetFolderFunc ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-folder-search.sgml b/docs/reference/camel/tmpl/camel-folder-search.sgml
index dacfe08..2b1ce65 100644
--- a/docs/reference/camel/tmpl/camel-folder-search.sgml
+++ b/docs/reference/camel/tmpl/camel-folder-search.sgml
@@ -25,16 +25,6 @@ CamelFolderSearch
</para>
- parent:
- priv:
- sexp:
- last_search:
- folder:
- summary:
- summary_set:
- current:
- current_message:
- body_index:
<!-- ##### FUNCTION camel_folder_search_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-folder-summary.sgml b/docs/reference/camel/tmpl/camel-folder-summary.sgml
index 623666f..542349f 100644
--- a/docs/reference/camel/tmpl/camel-folder-summary.sgml
+++ b/docs/reference/camel/tmpl/camel-folder-summary.sgml
@@ -25,31 +25,6 @@ CamelFolderSummary
</para>
- parent:
- priv:
- version:
- flags:
- nextuid:
- time:
- saved_count:
- unread_count:
- deleted_count:
- junk_count:
- junk_not_deleted_count:
- visible_count:
- message_info_chunks:
- content_info_chunks:
- summary_path:
- build_content:
- uids:
- loaded_infos:
- folder:
- meta_summary:
- cache_load_time:
- timeout_handle:
- collate:
- sort_by:
- later:
<!-- ##### STRUCT CamelMessageInfo ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-folder.sgml b/docs/reference/camel/tmpl/camel-folder.sgml
index 4c42fc5..0090695 100644
--- a/docs/reference/camel/tmpl/camel-folder.sgml
+++ b/docs/reference/camel/tmpl/camel-folder.sgml
@@ -25,16 +25,6 @@ CamelFolder
</para>
- parent:
- priv:
- name:
- full_name:
- description:
- parent_store:
- summary:
- folder_flags:
- permanent_flags:
- later:
<!-- ##### STRUCT CamelFolderChangeInfo ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-gpg-context.sgml b/docs/reference/camel/tmpl/camel-gpg-context.sgml
index ade6aea..4593441 100644
--- a/docs/reference/camel/tmpl/camel-gpg-context.sgml
+++ b/docs/reference/camel/tmpl/camel-gpg-context.sgml
@@ -25,8 +25,11 @@ CamelGpgContext
</para>
- parent:
- priv:
+
+<!-- ##### ARG CamelGpgContext:always-trust ##### -->
+<para>
+
+</para>
<!-- ##### FUNCTION camel_gpg_context_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-html-parser.sgml b/docs/reference/camel/tmpl/camel-html-parser.sgml
index 078c620..e06ac2b 100644
--- a/docs/reference/camel/tmpl/camel-html-parser.sgml
+++ b/docs/reference/camel/tmpl/camel-html-parser.sgml
@@ -25,8 +25,6 @@ CamelHTMLParser
</para>
- parent:
- priv:
<!-- ##### ENUM camel_html_parser_t ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-http-stream.sgml b/docs/reference/camel/tmpl/camel-http-stream.sgml
index 7f99b9a..93b7a6f 100644
--- a/docs/reference/camel/tmpl/camel-http-stream.sgml
+++ b/docs/reference/camel/tmpl/camel-http-stream.sgml
@@ -25,20 +25,6 @@ CamelHttpStream
</para>
- parent:
- parser:
- content_type:
- headers:
- method:
- session:
- url:
- user_agent:
- proxy:
- authrealm:
- authpass:
- statuscode:
- raw:
- read:
<!-- ##### ENUM CamelHttpMethod ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-imap-store.sgml b/docs/reference/camel/tmpl/camel-imap-store.sgml
index 1799895..d8ec516 100644
--- a/docs/reference/camel/tmpl/camel-imap-store.sgml
+++ b/docs/reference/camel/tmpl/camel-imap-store.sgml
@@ -67,6 +67,18 @@ CamelImapStore
@CamelImapStore *store, struct _CamelImapMsg *m:
@CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
@CamelImapStore *store, struct _CamelImapMsg *m:
@size:
@Returns:
diff --git a/docs/reference/camel/tmpl/camel-index.sgml b/docs/reference/camel/tmpl/camel-index.sgml
index 1aa3816..1a81adc 100644
--- a/docs/reference/camel/tmpl/camel-index.sgml
+++ b/docs/reference/camel/tmpl/camel-index.sgml
@@ -25,14 +25,6 @@ CamelIndex
</para>
- parent:
- priv:
- path:
- version:
- flags:
- state:
- normalize:
- normalize_data:
<!-- ##### USER_FUNCTION CamelIndexNorm ##### -->
<para>
@@ -50,9 +42,6 @@ CamelIndex
</para>
- parent:
- priv:
- index:
<!-- ##### FUNCTION camel_index_cursor_new ##### -->
<para>
@@ -86,12 +75,6 @@ CamelIndex
</para>
- parent:
- priv:
- index:
- name:
- buffer:
- words:
<!-- ##### FUNCTION camel_index_name_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-internet-address.sgml b/docs/reference/camel/tmpl/camel-internet-address.sgml
index 7aa023a..70dd8b5 100644
--- a/docs/reference/camel/tmpl/camel-internet-address.sgml
+++ b/docs/reference/camel/tmpl/camel-internet-address.sgml
@@ -25,8 +25,6 @@ CamelInternetAddress
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_internet_address_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-medium.sgml b/docs/reference/camel/tmpl/camel-medium.sgml
index 886e6bd..7bc1e48 100644
--- a/docs/reference/camel/tmpl/camel-medium.sgml
+++ b/docs/reference/camel/tmpl/camel-medium.sgml
@@ -25,8 +25,11 @@ CamelMedium
</para>
- parent:
- content:
+
+<!-- ##### ARG CamelMedium:content ##### -->
+<para>
+
+</para>
<!-- ##### STRUCT CamelMediumHeader ##### -->
<para>
@@ -93,3 +96,21 @@ CamelMedium
@headers:
+<!-- ##### FUNCTION camel_medium_get_content ##### -->
+<para>
+
+</para>
+
+ medium:
+ Returns:
+
+
+<!-- ##### FUNCTION camel_medium_set_content ##### -->
+<para>
+
+</para>
+
+ medium:
+ content:
+
+
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-basic.sgml b/docs/reference/camel/tmpl/camel-mime-filter-basic.sgml
index 8e82673..f382da3 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-basic.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-basic.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterBasic
</para>
- parent:
- priv:
<!-- ##### ENUM CamelMimeFilterBasicType ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-bestenc.sgml b/docs/reference/camel/tmpl/camel-mime-filter-bestenc.sgml
index 9d122d7..d758045 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-bestenc.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-bestenc.sgml
@@ -45,8 +45,6 @@ CamelMimeFilterBestenc
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_bestenc_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-canon.sgml b/docs/reference/camel/tmpl/camel-mime-filter-canon.sgml
index 6ab3f99..1f471d1 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-canon.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-canon.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterCanon
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_canon_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-charset.sgml b/docs/reference/camel/tmpl/camel-mime-filter-charset.sgml
index c6b8395..a757e46 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-charset.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-charset.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterCharset
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_charset_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-crlf.sgml b/docs/reference/camel/tmpl/camel-mime-filter-crlf.sgml
index eb5a3bb..abdda64 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-crlf.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-crlf.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterCRLF
</para>
- parent:
- priv:
<!-- ##### ENUM CamelMimeFilterCRLFDirection ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-enriched.sgml b/docs/reference/camel/tmpl/camel-mime-filter-enriched.sgml
index e901f8c..8e9edf4 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-enriched.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-enriched.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterEnriched
</para>
- parent:
- priv:
<!-- ##### MACRO CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-from.sgml b/docs/reference/camel/tmpl/camel-mime-filter-from.sgml
index a14ef6c..593dcc4 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-from.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-from.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterFrom
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_from_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-gzip.sgml b/docs/reference/camel/tmpl/camel-mime-filter-gzip.sgml
index 7b47b86..d0b41f9 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-gzip.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-gzip.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterGZip
</para>
- parent:
- priv:
<!-- ##### ENUM CamelMimeFilterGZipMode ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-html.sgml b/docs/reference/camel/tmpl/camel-mime-filter-html.sgml
index 0ebb339..d8f9061 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-html.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-html.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterHTML
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_html_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-index.sgml b/docs/reference/camel/tmpl/camel-mime-filter-index.sgml
index 5a2564f..9332cbe 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-index.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-index.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterIndex
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_index_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-linewrap.sgml b/docs/reference/camel/tmpl/camel-mime-filter-linewrap.sgml
index 9511be0..bf1649c 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-linewrap.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-linewrap.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterLinewrap
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_linewrap_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-pgp.sgml b/docs/reference/camel/tmpl/camel-mime-filter-pgp.sgml
index 71c722e..b66d681 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-pgp.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-pgp.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterPgp
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_pgp_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-progress.sgml b/docs/reference/camel/tmpl/camel-mime-filter-progress.sgml
index 45b18b3..ab2d1f1 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-progress.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-progress.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterProgress
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_progress_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-save.sgml b/docs/reference/camel/tmpl/camel-mime-filter-save.sgml
index 40812dd..a285003 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-save.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-save.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterSave
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_save_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-tohtml.sgml b/docs/reference/camel/tmpl/camel-mime-filter-tohtml.sgml
index c5a1253..fdbec20 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-tohtml.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-tohtml.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterToHTML
</para>
- parent:
- priv:
<!-- ##### MACRO CAMEL_MIME_FILTER_TOHTML_PRE ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-windows.sgml b/docs/reference/camel/tmpl/camel-mime-filter-windows.sgml
index 6e95293..9894a04 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-windows.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-windows.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterWindows
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_mime_filter_windows_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter-yenc.sgml b/docs/reference/camel/tmpl/camel-mime-filter-yenc.sgml
index 8ff9221..24922e3 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter-yenc.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter-yenc.sgml
@@ -25,8 +25,6 @@ CamelMimeFilterYenc
</para>
- parent:
- priv:
<!-- ##### ENUM CamelMimeFilterYencDirection ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-filter.sgml b/docs/reference/camel/tmpl/camel-mime-filter.sgml
index a421599..ed506eb 100644
--- a/docs/reference/camel/tmpl/camel-mime-filter.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-filter.sgml
@@ -25,16 +25,6 @@ CamelMimeFilter
</para>
- parent:
- priv:
- outreal:
- outbuf:
- outptr:
- outsize:
- outpre:
- backbuf:
- backsize:
- backlen:
<!-- ##### FUNCTION camel_mime_filter_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-message.sgml b/docs/reference/camel/tmpl/camel-mime-message.sgml
index 787d1b7..8b91f07 100644
--- a/docs/reference/camel/tmpl/camel-mime-message.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-message.sgml
@@ -25,16 +25,6 @@ CamelMimeMessage
</para>
- parent:
- date:
- date_offset:
- date_received:
- date_received_offset:
- subject:
- message_id:
- reply_to:
- from:
- recipients:
<!-- ##### MACRO CAMEL_RECIPIENT_TYPE_TO ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-parser.sgml b/docs/reference/camel/tmpl/camel-mime-parser.sgml
index 00a95ec..0a829bb 100644
--- a/docs/reference/camel/tmpl/camel-mime-parser.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-parser.sgml
@@ -25,8 +25,6 @@ CamelMimeParser
</para>
- parent:
- priv:
<!-- ##### ENUM camel_mime_parser_state_t ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-mime-part.sgml b/docs/reference/camel/tmpl/camel-mime-part.sgml
index 9a88fd1..4698723 100644
--- a/docs/reference/camel/tmpl/camel-mime-part.sgml
+++ b/docs/reference/camel/tmpl/camel-mime-part.sgml
@@ -25,9 +25,26 @@ CamelMimePart
</para>
- parent:
- priv:
- headers:
+
+<!-- ##### ARG CamelMimePart:content-id ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CamelMimePart:content-md5 ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CamelMimePart:description ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CamelMimePart:disposition ##### -->
+<para>
+
+</para>
<!-- ##### FUNCTION camel_mime_part_new ##### -->
<para>
@@ -119,6 +136,24 @@ CamelMimePart
@Returns:
+<!-- ##### FUNCTION camel_mime_part_set_content_md5 ##### -->
+<para>
+
+</para>
+
+ mime_part:
+ md5sum:
+
+
+<!-- ##### FUNCTION camel_mime_part_get_content_md5 ##### -->
+<para>
+
+</para>
+
+ mime_part:
+ Returns:
+
+
<!-- ##### FUNCTION camel_mime_part_set_content_location ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-multipart-encrypted.sgml b/docs/reference/camel/tmpl/camel-multipart-encrypted.sgml
index 2c5674b..f8bd0bb 100644
--- a/docs/reference/camel/tmpl/camel-multipart-encrypted.sgml
+++ b/docs/reference/camel/tmpl/camel-multipart-encrypted.sgml
@@ -25,11 +25,6 @@ CamelMultipartEncrypted
</para>
- parent:
- version:
- content:
- decrypted:
- protocol:
<!-- ##### FUNCTION camel_multipart_encrypted_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-multipart-signed.sgml b/docs/reference/camel/tmpl/camel-multipart-signed.sgml
index 83596da..74c8069 100644
--- a/docs/reference/camel/tmpl/camel-multipart-signed.sgml
+++ b/docs/reference/camel/tmpl/camel-multipart-signed.sgml
@@ -25,16 +25,6 @@ CamelMultipartSigned
</para>
- parent:
- content:
- signature:
- contentraw:
- protocol:
- micalg:
- start1:
- end1:
- start2:
- end2:
<!-- ##### FUNCTION camel_multipart_signed_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-multipart.sgml b/docs/reference/camel/tmpl/camel-multipart.sgml
index 07ffc8a..0e20374 100644
--- a/docs/reference/camel/tmpl/camel-multipart.sgml
+++ b/docs/reference/camel/tmpl/camel-multipart.sgml
@@ -25,10 +25,6 @@ CamelMultipart
</para>
- parent:
- parts:
- preface:
- postface:
<!-- ##### FUNCTION camel_multipart_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-nntp-address.sgml b/docs/reference/camel/tmpl/camel-nntp-address.sgml
index 0f16870..919642d 100644
--- a/docs/reference/camel/tmpl/camel-nntp-address.sgml
+++ b/docs/reference/camel/tmpl/camel-nntp-address.sgml
@@ -25,8 +25,6 @@ CamelNNTPAddress
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_nntp_address_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-object.sgml b/docs/reference/camel/tmpl/camel-object.sgml
index 6e0ca83..c5c14e1 100644
--- a/docs/reference/camel/tmpl/camel-object.sgml
+++ b/docs/reference/camel/tmpl/camel-object.sgml
@@ -20,83 +20,11 @@ CamelObject
<!-- ##### SECTION Image ##### -->
-<!-- ##### MACRO CAMEL_OBJECT_TRACK_INSTANCES ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### TYPEDEF CamelType ##### -->
-<para>
-
-</para>
-
-
<!-- ##### STRUCT CamelObject ##### -->
<para>
</para>
- klass:
- magic:
- hooks:
- ref_count:
- flags:
- next:
- prev:
-
-<!-- ##### MACRO CAMEL_CHECK_CAST ##### -->
-<para>
-
-</para>
-
- obj:
- ctype:
- ptype:
-
-
-<!-- ##### MACRO CAMEL_CHECK_CLASS_CAST ##### -->
-<para>
-
-</para>
-
- klass:
- ctype:
- ptype:
-
-
-<!-- ##### MACRO CAMEL_CHECK_TYPE ##### -->
-<para>
-
-</para>
-
- obj:
- ctype:
-
-
-<!-- ##### MACRO CAMEL_CHECK_CLASS_TYPE ##### -->
-<para>
-
-</para>
-
- klass:
- ctype:
-
-
-<!-- ##### VARIABLE camel_object_type ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO CAMEL_OBJECT_GET_TYPE ##### -->
-<para>
-
-</para>
-
- o:
-
<!-- ##### TYPEDEF CamelObjectHookID ##### -->
<para>
@@ -104,39 +32,6 @@ CamelObject
</para>
-<!-- ##### USER_FUNCTION CamelObjectClassInitFunc ##### -->
-<para>
-
-</para>
-
- Param1:
-
-
-<!-- ##### USER_FUNCTION CamelObjectClassFinalizeFunc ##### -->
-<para>
-
-</para>
-
- Param1:
-
-
-<!-- ##### USER_FUNCTION CamelObjectInitFunc ##### -->
-<para>
-
-</para>
-
- Param1:
- Param2:
-
-
-<!-- ##### USER_FUNCTION CamelObjectFinalizeFunc ##### -->
-<para>
-
-</para>
-
- Param1:
-
-
<!-- ##### USER_FUNCTION CamelObjectEventPrepFunc ##### -->
<para>
@@ -157,70 +52,6 @@ CamelObject
@Param3:
-<!-- ##### MACRO CAMEL_INVALID_TYPE ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### ENUM CamelObjectFlags ##### -->
-<para>
-
-</para>
-
- CAMEL_OBJECT_DESTROY:
-
-<!-- ##### FUNCTION camel_type_init ##### -->
-<para>
-
-</para>
-
- void:
-
-
-<!-- ##### FUNCTION camel_type_register ##### -->
-<para>
-
-</para>
-
- parent:
- name:
- instance_size:
- classfuncs_size:
- class_init:
- class_finalize:
- instance_init:
- instance_finalize:
- Returns:
-
-
-<!-- ##### MACRO camel_type_get_global_classfuncs ##### -->
-<para>
-
-</para>
-
- x:
-
-
-<!-- ##### FUNCTION camel_type_to_name ##### -->
-<para>
-
-</para>
-
- type:
- Returns:
-
-
-<!-- ##### FUNCTION camel_name_to_type ##### -->
-<para>
-
-</para>
-
- name:
- Returns:
-
-
<!-- ##### FUNCTION camel_object_class_add_event ##### -->
<para>
@@ -231,80 +62,6 @@ CamelObject
@prep:
-<!-- ##### FUNCTION camel_object_class_dump_tree ##### -->
-<para>
-
-</para>
-
- root:
-
-
-<!-- ##### FUNCTION camel_object_cast ##### -->
-<para>
-
-</para>
-
- obj:
- ctype:
- Returns:
-
-
-<!-- ##### FUNCTION camel_object_is ##### -->
-<para>
-
-</para>
-
- obj:
- ctype:
- Returns:
-
-
-<!-- ##### FUNCTION camel_object_class_cast ##### -->
-<para>
-
-</para>
-
- klass:
- ctype:
- Returns:
-
-
-<!-- ##### FUNCTION camel_object_class_is ##### -->
-<para>
-
-</para>
-
- klass:
- ctype:
- Returns:
-
-
-<!-- ##### FUNCTION camel_object_new ##### -->
-<para>
-
-</para>
-
- type:
- Returns:
-
-
-<!-- ##### FUNCTION camel_object_ref ##### -->
-<para>
-
-</para>
-
- Param1:
- Returns:
-
-
-<!-- ##### FUNCTION camel_object_unref ##### -->
-<para>
-
-</para>
-
- Param1:
-
-
<!-- ##### FUNCTION camel_object_hook_event ##### -->
<para>
@@ -430,7 +187,7 @@ CamelObject
</para>
- vo:
+ object:
@Returns:
@@ -439,10 +196,10 @@ CamelObject
</para>
- hash:
- equal:
- keycopy:
- keyfree:
+ key_hash_func:
+ key_equal_func:
+ key_copy_func:
+ key_free_func:
@Returns:
@@ -483,7 +240,7 @@ CamelObject
@bag:
@key:
- vo:
+ object:
<!-- ##### FUNCTION camel_object_bag_abort ##### -->
@@ -501,8 +258,8 @@ CamelObject
</para>
@bag:
- o:
- newkey:
+ object:
+ new_key:
<!-- ##### FUNCTION camel_object_bag_list ##### -->
@@ -520,7 +277,7 @@ CamelObject
</para>
@bag:
- o:
+ object:
<!-- ##### FUNCTION camel_object_bag_destroy ##### -->
diff --git a/docs/reference/camel/tmpl/camel-offline-folder.sgml b/docs/reference/camel/tmpl/camel-offline-folder.sgml
index 2847051..d7ddf1b 100644
--- a/docs/reference/camel/tmpl/camel-offline-folder.sgml
+++ b/docs/reference/camel/tmpl/camel-offline-folder.sgml
@@ -25,8 +25,6 @@ CamelOfflineFolder
</para>
- parent:
- sync_offline:
<!-- ##### FUNCTION camel_offline_folder_downsync ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-offline-journal.sgml b/docs/reference/camel/tmpl/camel-offline-journal.sgml
index 73fa6b4..025e6ce 100644
--- a/docs/reference/camel/tmpl/camel-offline-journal.sgml
+++ b/docs/reference/camel/tmpl/camel-offline-journal.sgml
@@ -25,10 +25,6 @@ CamelOfflineJournal
</para>
- parent:
- folder:
- filename:
- queue:
<!-- ##### STRUCT CamelOfflineJournalEntry ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-offline-store.sgml b/docs/reference/camel/tmpl/camel-offline-store.sgml
index ab5ae7d..4782f5c 100644
--- a/docs/reference/camel/tmpl/camel-offline-store.sgml
+++ b/docs/reference/camel/tmpl/camel-offline-store.sgml
@@ -25,8 +25,6 @@ CamelOfflineStore
</para>
- parent:
- state:
<!-- ##### FUNCTION camel_offline_store_set_network_state ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-partition-table.sgml b/docs/reference/camel/tmpl/camel-partition-table.sgml
index 8bcb7c4..bf8aa2e 100644
--- a/docs/reference/camel/tmpl/camel-partition-table.sgml
+++ b/docs/reference/camel/tmpl/camel-partition-table.sgml
@@ -59,13 +59,6 @@ CamelKeyTable
</para>
- parent:
- priv:
- blocks:
- rootid:
- is_key:
- is_key_data:
- partition:
<!-- ##### FUNCTION camel_partition_table_new ##### -->
<para>
@@ -153,12 +146,6 @@ CamelKeyTable
</para>
- parent:
- priv:
- blocks:
- rootid:
- root:
- root_block:
<!-- ##### FUNCTION camel_key_table_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl-anonymous.sgml b/docs/reference/camel/tmpl/camel-sasl-anonymous.sgml
index 859101f..9c0d359 100644
--- a/docs/reference/camel/tmpl/camel-sasl-anonymous.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl-anonymous.sgml
@@ -25,9 +25,6 @@ CamelSaslAnonymous
</para>
- parent:
- trace_info:
- type:
<!-- ##### ENUM CamelSaslAnonTraceType ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl-cram-md5.sgml b/docs/reference/camel/tmpl/camel-sasl-cram-md5.sgml
index 42d0108..00b71e9 100644
--- a/docs/reference/camel/tmpl/camel-sasl-cram-md5.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl-cram-md5.sgml
@@ -25,8 +25,6 @@ CamelSaslCramMd5
</para>
- parent:
- priv:
<!-- ##### VARIABLE camel_sasl_cram_md5_authtype ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl-digest-md5.sgml b/docs/reference/camel/tmpl/camel-sasl-digest-md5.sgml
index fbd3e10..3d7b7e2 100644
--- a/docs/reference/camel/tmpl/camel-sasl-digest-md5.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl-digest-md5.sgml
@@ -25,8 +25,6 @@ CamelSaslDigestMd5
</para>
- parent:
- priv:
<!-- ##### VARIABLE camel_sasl_digest_md5_authtype ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl-gssapi.sgml b/docs/reference/camel/tmpl/camel-sasl-gssapi.sgml
index 5463495..44738cd 100644
--- a/docs/reference/camel/tmpl/camel-sasl-gssapi.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl-gssapi.sgml
@@ -25,8 +25,6 @@ CamelSaslGssapi
</para>
- parent:
- priv:
<!-- ##### VARIABLE camel_sasl_gssapi_authtype ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl-login.sgml b/docs/reference/camel/tmpl/camel-sasl-login.sgml
index bf282e4..4cd3fea 100644
--- a/docs/reference/camel/tmpl/camel-sasl-login.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl-login.sgml
@@ -25,8 +25,6 @@ CamelSaslLogin
</para>
- parent:
- priv:
<!-- ##### VARIABLE camel_sasl_login_authtype ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl-ntlm.sgml b/docs/reference/camel/tmpl/camel-sasl-ntlm.sgml
index 745cff0..79bab89 100644
--- a/docs/reference/camel/tmpl/camel-sasl-ntlm.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl-ntlm.sgml
@@ -25,8 +25,6 @@ CamelSaslNTLM
</para>
- parent:
- priv:
<!-- ##### VARIABLE camel_sasl_ntlm_authtype ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl-plain.sgml b/docs/reference/camel/tmpl/camel-sasl-plain.sgml
index f63a8e0..9a73f29 100644
--- a/docs/reference/camel/tmpl/camel-sasl-plain.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl-plain.sgml
@@ -25,8 +25,6 @@ CamelSaslPlain
</para>
- parent:
- priv:
<!-- ##### VARIABLE camel_sasl_plain_authtype ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl-popb4smtp.sgml b/docs/reference/camel/tmpl/camel-sasl-popb4smtp.sgml
index 393290a..3fe4e62 100644
--- a/docs/reference/camel/tmpl/camel-sasl-popb4smtp.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl-popb4smtp.sgml
@@ -25,8 +25,6 @@ CamelSaslPOPB4SMTP
</para>
- parent:
- priv:
<!-- ##### VARIABLE camel_sasl_popb4smtp_authtype ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-sasl.sgml b/docs/reference/camel/tmpl/camel-sasl.sgml
index 1e260d2..e6050d8 100644
--- a/docs/reference/camel/tmpl/camel-sasl.sgml
+++ b/docs/reference/camel/tmpl/camel-sasl.sgml
@@ -25,8 +25,26 @@ CamelSasl
</para>
- parent:
- priv:
+
+<!-- ##### ARG CamelSasl:authenticated ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CamelSasl:mechanism ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CamelSasl:service ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CamelSasl:service-name ##### -->
+<para>
+
+</para>
<!-- ##### FUNCTION camel_sasl_challenge ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-seekable-stream.sgml b/docs/reference/camel/tmpl/camel-seekable-stream.sgml
index 4bb13db..275e599 100644
--- a/docs/reference/camel/tmpl/camel-seekable-stream.sgml
+++ b/docs/reference/camel/tmpl/camel-seekable-stream.sgml
@@ -25,10 +25,6 @@ CamelSeekableStream
</para>
- parent:
- position:
- bound_start:
- bound_end:
<!-- ##### ENUM CamelStreamSeekPolicy ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-seekable-substream.sgml b/docs/reference/camel/tmpl/camel-seekable-substream.sgml
index 026babd..6ec9007 100644
--- a/docs/reference/camel/tmpl/camel-seekable-substream.sgml
+++ b/docs/reference/camel/tmpl/camel-seekable-substream.sgml
@@ -25,8 +25,6 @@ CamelSeekableSubstream
</para>
- parent:
- parent_stream:
<!-- ##### FUNCTION camel_seekable_substream_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-service.sgml b/docs/reference/camel/tmpl/camel-service.sgml
index 7deed24..0720ac4 100644
--- a/docs/reference/camel/tmpl/camel-service.sgml
+++ b/docs/reference/camel/tmpl/camel-service.sgml
@@ -25,13 +25,6 @@ CamelService
</para>
- parent:
- priv:
- session:
- provider:
- status:
- connect_op:
- url:
<!-- ##### MACRO CAMEL_SERVICE_USERNAME ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-session.sgml b/docs/reference/camel/tmpl/camel-session.sgml
index 398a968..002c8a6 100644
--- a/docs/reference/camel/tmpl/camel-session.sgml
+++ b/docs/reference/camel/tmpl/camel-session.sgml
@@ -25,13 +25,6 @@ CamelSession
</para>
- parent:
- priv:
- storage_path:
- junk_plugin:
- online:
- check_junk:
- network_state:
<!-- ##### USER_FUNCTION CamelTimeoutCallback ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-smime-context.sgml b/docs/reference/camel/tmpl/camel-smime-context.sgml
index 62819a4..3455994 100644
--- a/docs/reference/camel/tmpl/camel-smime-context.sgml
+++ b/docs/reference/camel/tmpl/camel-smime-context.sgml
@@ -25,8 +25,6 @@ CamelSMIMEContext
</para>
- parent:
- priv:
<!-- ##### ENUM camel_smime_sign_t ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-store-summary.sgml b/docs/reference/camel/tmpl/camel-store-summary.sgml
index 88a67ed..a59e8d8 100644
--- a/docs/reference/camel/tmpl/camel-store-summary.sgml
+++ b/docs/reference/camel/tmpl/camel-store-summary.sgml
@@ -56,18 +56,6 @@ CamelStoreSummary
</para>
- parent:
- priv:
- version:
- flags:
- count:
- time:
- uri_base:
- store_info_size:
- store_info_chunks:
- summary_path:
- folders:
- folders_path:
<!-- ##### MACRO CAMEL_STORE_INFO_FOLDER_UNKNOWN ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-store.sgml b/docs/reference/camel/tmpl/camel-store.sgml
index fd8e6d9..0ed8d91 100644
--- a/docs/reference/camel/tmpl/camel-store.sgml
+++ b/docs/reference/camel/tmpl/camel-store.sgml
@@ -25,14 +25,6 @@ CamelStore
</para>
- parent:
- priv:
- folders:
- cdb_r:
- cdb_w:
- flags:
- mode:
- later:
<!-- ##### STRUCT CamelFolderInfo ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-stream-buffer.sgml b/docs/reference/camel/tmpl/camel-stream-buffer.sgml
index eeb1159..7300e9f 100644
--- a/docs/reference/camel/tmpl/camel-stream-buffer.sgml
+++ b/docs/reference/camel/tmpl/camel-stream-buffer.sgml
@@ -25,8 +25,6 @@ CamelStreamBuffer
</para>
- parent:
- priv:
<!-- ##### ENUM CamelStreamBufferMode ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-stream-filter.sgml b/docs/reference/camel/tmpl/camel-stream-filter.sgml
index 0411de8..4ca78d1 100644
--- a/docs/reference/camel/tmpl/camel-stream-filter.sgml
+++ b/docs/reference/camel/tmpl/camel-stream-filter.sgml
@@ -25,8 +25,6 @@ CamelStreamFilter
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_stream_filter_add ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-stream-fs.sgml b/docs/reference/camel/tmpl/camel-stream-fs.sgml
index a699445..fc7c111 100644
--- a/docs/reference/camel/tmpl/camel-stream-fs.sgml
+++ b/docs/reference/camel/tmpl/camel-stream-fs.sgml
@@ -25,8 +25,6 @@ CamelStreamFs
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_stream_fs_new_with_name ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-stream-mem.sgml b/docs/reference/camel/tmpl/camel-stream-mem.sgml
index 951b0f9..cc9b375 100644
--- a/docs/reference/camel/tmpl/camel-stream-mem.sgml
+++ b/docs/reference/camel/tmpl/camel-stream-mem.sgml
@@ -25,8 +25,6 @@ CamelStreamMem
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_stream_mem_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-stream-null.sgml b/docs/reference/camel/tmpl/camel-stream-null.sgml
index 57db726..dc62b52 100644
--- a/docs/reference/camel/tmpl/camel-stream-null.sgml
+++ b/docs/reference/camel/tmpl/camel-stream-null.sgml
@@ -25,8 +25,6 @@ CamelStreamNull
</para>
- parent:
- written:
<!-- ##### FUNCTION camel_stream_null_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-stream-process.sgml b/docs/reference/camel/tmpl/camel-stream-process.sgml
index 66ac3ad..bd9d293 100644
--- a/docs/reference/camel/tmpl/camel-stream-process.sgml
+++ b/docs/reference/camel/tmpl/camel-stream-process.sgml
@@ -25,9 +25,6 @@ CamelStreamProcess
</para>
- parent:
- sockfd:
- childpid:
<!-- ##### FUNCTION camel_stream_process_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-stream-vfs.sgml b/docs/reference/camel/tmpl/camel-stream-vfs.sgml
index 300c52a..74a5365 100644
--- a/docs/reference/camel/tmpl/camel-stream-vfs.sgml
+++ b/docs/reference/camel/tmpl/camel-stream-vfs.sgml
@@ -25,8 +25,6 @@ CamelStreamVFS
</para>
- parent:
- stream:
<!-- ##### ENUM CamelStreamVFSOpenMethod ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-stream.sgml b/docs/reference/camel/tmpl/camel-stream.sgml
index 35c4b34..84f5063 100644
--- a/docs/reference/camel/tmpl/camel-stream.sgml
+++ b/docs/reference/camel/tmpl/camel-stream.sgml
@@ -25,8 +25,6 @@ CamelStream
</para>
- parent:
- eos:
<!-- ##### FUNCTION camel_stream_read ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-tcp-stream-raw.sgml b/docs/reference/camel/tmpl/camel-tcp-stream-raw.sgml
index e232451..7c49c5e 100644
--- a/docs/reference/camel/tmpl/camel-tcp-stream-raw.sgml
+++ b/docs/reference/camel/tmpl/camel-tcp-stream-raw.sgml
@@ -25,9 +25,6 @@ CamelTcpStreamRaw
</para>
- parent:
- sockfd:
- is_nonblocking:
<!-- ##### FUNCTION camel_tcp_stream_raw_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-tcp-stream.sgml b/docs/reference/camel/tmpl/camel-tcp-stream.sgml
index 092dc7a..ef20ba3 100644
--- a/docs/reference/camel/tmpl/camel-tcp-stream.sgml
+++ b/docs/reference/camel/tmpl/camel-tcp-stream.sgml
@@ -25,7 +25,6 @@ CamelTcpStream
</para>
- parent:
<!-- ##### ENUM CamelSockOpt ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-text-index.sgml b/docs/reference/camel/tmpl/camel-text-index.sgml
index 52fa04d..ed89d7a 100644
--- a/docs/reference/camel/tmpl/camel-text-index.sgml
+++ b/docs/reference/camel/tmpl/camel-text-index.sgml
@@ -35,32 +35,24 @@ CamelTextIndex
</para>
- parent:
- priv:
<!-- ##### STRUCT CamelTextIndexCursor ##### -->
<para>
</para>
- parent:
- priv:
<!-- ##### STRUCT CamelTextIndexKeyCursor ##### -->
<para>
</para>
- parent:
- priv:
<!-- ##### STRUCT CamelTextIndexName ##### -->
<para>
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_text_index_new ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-transport.sgml b/docs/reference/camel/tmpl/camel-transport.sgml
index bb1b27e..79b89e9 100644
--- a/docs/reference/camel/tmpl/camel-transport.sgml
+++ b/docs/reference/camel/tmpl/camel-transport.sgml
@@ -25,8 +25,6 @@ CamelTransport
</para>
- parent:
- priv:
<!-- ##### FUNCTION camel_transport_send_to ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-unused.sgml b/docs/reference/camel/tmpl/camel-unused.sgml
index 701e47e..0b60cb8 100644
--- a/docs/reference/camel/tmpl/camel-unused.sgml
+++ b/docs/reference/camel/tmpl/camel-unused.sgml
@@ -1,3 +1,59 @@
+<!-- ##### SECTION ./tmpl/address-data.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/address-data.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/address-data.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/address-data.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/address-data.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/address-data.sgml:Title ##### -->
+address-data
+
+
+<!-- ##### SECTION ./tmpl/addresses.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/addresses.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/addresses.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/addresses.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/addresses.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/addresses.sgml:Title ##### -->
+addresses
+
+
<!-- ##### SECTION ./tmpl/camel-digest-folder.sgml:Long_Description ##### -->
<para>
@@ -70,6 +126,62 @@ CamelDigestStore
CamelDigestSummary
+<!-- ##### SECTION ./tmpl/camel-groupwise-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-folder.sgml:Title ##### -->
+CamelGroupwiseFolder
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-journal.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-journal.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-journal.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-journal.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-journal.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-journal.sgml:Title ##### -->
+CamelGroupwiseJournal
+
+
<!-- ##### SECTION ./tmpl/camel-groupwise-private.sgml:Long_Description ##### -->
<para>
@@ -90,6 +202,258 @@ CamelDigestSummary
camel-groupwise-private
+<!-- ##### SECTION ./tmpl/camel-groupwise-store-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store-summary.sgml:Title ##### -->
+CamelGroupwiseStoreSummary
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-store.sgml:Title ##### -->
+CamelGroupwiseStore
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-summary.sgml:Title ##### -->
+CamelGroupwiseSummary
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-transport.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-transport.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-transport.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-transport.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-transport.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-transport.sgml:Title ##### -->
+CamelGroupwiseTransport
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-utils.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-utils.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-utils.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-utils.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-utils.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-groupwise-utils.sgml:Title ##### -->
+camel-groupwise-utils
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-command.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-command.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-command.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-command.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-command.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-command.sgml:Title ##### -->
+camel-imap-command
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-folder.sgml:Title ##### -->
+CamelImapFolder
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-journal.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-journal.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-journal.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-journal.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-journal.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-journal.sgml:Title ##### -->
+CamelImapJournal
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-message-cache.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-message-cache.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-message-cache.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-message-cache.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-message-cache.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-message-cache.sgml:Title ##### -->
+CamelImapMessageCache
+
+
<!-- ##### SECTION ./tmpl/camel-imap-private.sgml:Long_Description ##### -->
<para>
@@ -110,6 +474,118 @@ camel-groupwise-private
camel-imap-private
+<!-- ##### SECTION ./tmpl/camel-imap-search.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-search.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-search.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-search.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-search.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-search.sgml:Title ##### -->
+CamelImapSearch
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store-summary.sgml:Title ##### -->
+CamelImapStoreSummary
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-store.sgml:Title ##### -->
+CamelImapStore
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-summary.sgml:Title ##### -->
+CamelImapSummary
+
+
<!-- ##### SECTION ./tmpl/camel-imap-types.sgml:Long_Description ##### -->
<para>
@@ -130,6 +606,398 @@ camel-imap-private
camel-imap-types
+<!-- ##### SECTION ./tmpl/camel-imap-utils.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-utils.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-utils.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-utils.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-utils.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-utils.sgml:Title ##### -->
+camel-imap-utils
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-wrapper.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-wrapper.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-wrapper.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-wrapper.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-wrapper.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap-wrapper.sgml:Title ##### -->
+CamelImapWrapper
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-command.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-command.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-command.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-command.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-command.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-command.sgml:Title ##### -->
+camel-imap4-command
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-engine.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-engine.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-engine.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-engine.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-engine.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-engine.sgml:Title ##### -->
+CamelIMAP4Engine
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-folder.sgml:Title ##### -->
+CamelIMAP4Folder
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-journal.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-journal.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-journal.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-journal.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-journal.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-journal.sgml:Title ##### -->
+CamelIMAP4Journal
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-search.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-search.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-search.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-search.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-search.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-search.sgml:Title ##### -->
+CamelIMAP4Search
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-specials.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-specials.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-specials.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-specials.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-specials.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-specials.sgml:Title ##### -->
+camel-imap4-specials
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store-summary.sgml:Title ##### -->
+CamelIMAP4StoreSummary
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-store.sgml:Title ##### -->
+CamelIMAP4Store
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-stream.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-stream.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-stream.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-stream.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-stream.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-stream.sgml:Title ##### -->
+CamelIMAP4Stream
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-summary.sgml:Title ##### -->
+CamelIMAP4Summary
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-utils.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-utils.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-utils.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-utils.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-utils.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-imap4-utils.sgml:Title ##### -->
+camel-imap4-utils
+
+
+<!-- ##### SECTION ./tmpl/camel-local-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-local-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-local-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-folder.sgml:Title ##### -->
+CamelLocalFolder
+
+
<!-- ##### SECTION ./tmpl/camel-local-private.sgml:Long_Description ##### -->
<para>
@@ -150,6 +1018,230 @@ camel-imap-types
camel-local-private
+<!-- ##### SECTION ./tmpl/camel-local-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-local-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-local-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-store.sgml:Title ##### -->
+CamelLocalStore
+
+
+<!-- ##### SECTION ./tmpl/camel-local-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-local-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-local-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-local-summary.sgml:Title ##### -->
+CamelLocalSummary
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-folder.sgml:Title ##### -->
+CamelMaildirFolder
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-store.sgml:Title ##### -->
+CamelMaildirStore
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-maildir-summary.sgml:Title ##### -->
+CamelMaildirSummary
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-folder.sgml:Title ##### -->
+CamelMboxFolder
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-store.sgml:Title ##### -->
+CamelMboxStore
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mbox-summary.sgml:Title ##### -->
+CamelMboxSummary
+
+
<!-- ##### SECTION ./tmpl/camel-md5-utils.sgml:Long_Description ##### -->
<para>
@@ -174,6 +1266,90 @@ camel-local-private
camel-md5-utils
+<!-- ##### SECTION ./tmpl/camel-mh-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-folder.sgml:Title ##### -->
+CamelMhFolder
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-store.sgml:Title ##### -->
+CamelMhStore
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-mh-summary.sgml:Title ##### -->
+CamelMhSummary
+
+
<!-- ##### SECTION ./tmpl/camel-mime-part-utils.sgml:Long_Description ##### -->
<para>
@@ -222,6 +1398,118 @@ camel-mime-part-utils
CamelNewsAddress
+<!-- ##### SECTION ./tmpl/camel-nntp-auth.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-auth.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-auth.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-auth.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-auth.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-auth.sgml:Title ##### -->
+camel-nntp-auth
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-folder.sgml:Title ##### -->
+CamelNNTPFolder
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-grouplist.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-grouplist.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-grouplist.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-grouplist.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-grouplist.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-grouplist.sgml:Title ##### -->
+camel-nntp-grouplist
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-newsrc.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-newsrc.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-newsrc.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-newsrc.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-newsrc.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-newsrc.sgml:Title ##### -->
+camel-nntp-newsrc
+
+
<!-- ##### SECTION ./tmpl/camel-nntp-private.sgml:Long_Description ##### -->
<para>
@@ -242,6 +1530,146 @@ CamelNewsAddress
camel-nntp-private
+<!-- ##### SECTION ./tmpl/camel-nntp-resp-codes.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-resp-codes.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-resp-codes.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-resp-codes.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-resp-codes.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-resp-codes.sgml:Title ##### -->
+camel-nntp-resp-codes
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store-summary.sgml:Title ##### -->
+CamelNNTPStoreSummary
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-store.sgml:Title ##### -->
+CamelNNTPStore
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-stream.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-stream.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-stream.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-stream.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-stream.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-stream.sgml:Title ##### -->
+CamelNNTPStream
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-summary.sgml:Title ##### -->
+CamelNNTPSummary
+
+
<!-- ##### SECTION ./tmpl/camel-nntp-types.sgml:Long_Description ##### -->
<para>
@@ -262,6 +1690,146 @@ camel-nntp-private
camel-nntp-types
+<!-- ##### SECTION ./tmpl/camel-nntp-utils.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-utils.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-utils.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-utils.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-utils.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-nntp-utils.sgml:Title ##### -->
+camel-nntp-utils
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-engine.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-engine.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-engine.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-engine.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-engine.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-engine.sgml:Title ##### -->
+CamelPOP3Engine
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-folder.sgml:Title ##### -->
+CamelPOP3Folder
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-store.sgml:Title ##### -->
+CamelPOP3Store
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-stream.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-stream.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-stream.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-stream.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-stream.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-pop3-stream.sgml:Title ##### -->
+CamelPOP3Stream
+
+
<!-- ##### SECTION ./tmpl/camel-process.sgml:Long_Description ##### -->
<para>
@@ -330,6 +1898,202 @@ camel-search-private
camel-search-sql-sexp.h
+<!-- ##### SECTION ./tmpl/camel-sendmail-transport.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-sendmail-transport.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-sendmail-transport.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-sendmail-transport.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-sendmail-transport.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-sendmail-transport.sgml:Title ##### -->
+CamelSendmailTransport
+
+
+<!-- ##### SECTION ./tmpl/camel-smtp-transport.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-smtp-transport.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-smtp-transport.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-smtp-transport.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-smtp-transport.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-smtp-transport.sgml:Title ##### -->
+CamelSmtpTransport
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-folder.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-folder.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-folder.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-folder.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-folder.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-folder.sgml:Title ##### -->
+CamelSpoolFolder
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-store.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-store.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-store.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-store.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-store.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-store.sgml:Title ##### -->
+CamelSpoolStore
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-summary.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-summary.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-summary.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-summary.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-summary.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-spool-summary.sgml:Title ##### -->
+CamelSpoolSummary
+
+
+<!-- ##### SECTION ./tmpl/camel-test-provider.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-test-provider.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-test-provider.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-test-provider.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-test-provider.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-test-provider.sgml:Title ##### -->
+camel-test-provider
+
+
+<!-- ##### SECTION ./tmpl/camel-test.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-test.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-test.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/camel-test.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-test.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/camel-test.sgml:Title ##### -->
+camel-test
+
+
<!-- ##### SECTION ./tmpl/camel-types.sgml:Long_Description ##### -->
<para>
@@ -350,6 +2114,152 @@ camel-search-sql-sexp.h
camel-types
+<!-- ##### SECTION ./tmpl/folders.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/folders.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/folders.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/folders.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/folders.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/folders.sgml:Title ##### -->
+folders
+
+
+<!-- ##### SECTION ./tmpl/messages.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/messages.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/messages.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/messages.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/messages.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/messages.sgml:Title ##### -->
+messages
+
+
+<!-- ##### SECTION ./tmpl/session.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/session.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/session.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/session.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/session.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/session.sgml:Title ##### -->
+CamelTestSession
+
+
+<!-- ##### SECTION ./tmpl/streams.sgml:Image ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/streams.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/streams.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/streams.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/streams.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/streams.sgml:Title ##### -->
+streams
+
+
+<!-- ##### MACRO CAMEL_CHECK_CAST ##### -->
+<para>
+
+</para>
+
+ obj:
+ ctype:
+ ptype:
+
+<!-- ##### MACRO CAMEL_CHECK_CLASS_CAST ##### -->
+<para>
+
+</para>
+
+ klass:
+ ctype:
+ ptype:
+
+<!-- ##### MACRO CAMEL_CHECK_CLASS_TYPE ##### -->
+<para>
+
+</para>
+
+ klass:
+ ctype:
+
+<!-- ##### MACRO CAMEL_CHECK_TYPE ##### -->
+<para>
+
+</para>
+
+ obj:
+ ctype:
+
<!-- ##### MACRO CAMEL_GROUPWISE_FOLDER_LOCK ##### -->
<para>
@@ -392,6 +2302,12 @@ camel-types
@f:
@l:
+<!-- ##### MACRO CAMEL_IMAP_FOLDER_MARKED ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO CAMEL_IMAP_FOLDER_UNLOCK ##### -->
<para>
@@ -400,12 +2316,66 @@ camel-types
@f:
@l:
+<!-- ##### MACRO CAMEL_IMAP_FOLDER_UNMARKED ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO CAMEL_IMAP_MESSAGE_RECENT ##### -->
<para>
</para>
+<!-- ##### MACRO CAMEL_IMAP_SERVER_FLAGS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_IMAP_STORE_CHECK_ALL ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_IMAP_STORE_CHECK_LSUB ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_IMAP_STORE_FILTER_INBOX ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_IMAP_STORE_FILTER_JUNK ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_IMAP_STORE_FILTER_JUNK_INBOX ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_IMAP_STORE_NAMESPACE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO CAMEL_IMAP_WRAPPER_LOCK ##### -->
<para>
@@ -428,6 +2398,12 @@ camel-types
</para>
+<!-- ##### MACRO CAMEL_INVALID_TYPE ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO CAMEL_LOCAL_FOLDER_LOCK ##### -->
<para>
@@ -454,6 +2430,68 @@ camel-types
@parent:
@pname:
+<!-- ##### MACRO CAMEL_NNTP_ERR ##### -->
+<para>
+
+</para>
+
+ x:
+
+<!-- ##### MACRO CAMEL_NNTP_EXT_LISTMOTD ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_NNTP_EXT_LISTPNAMES ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_NNTP_EXT_LISTSUBSCR ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_NNTP_EXT_OVER ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_NNTP_EXT_SEARCH ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_NNTP_EXT_SETGET ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_NNTP_EXT_XACTIVE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_NNTP_EXT_XPATTEXT ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_NNTP_FAIL ##### -->
+<para>
+
+</para>
+
+ x:
+
<!-- ##### MACRO CAMEL_NNTP_FOLDER_LOCK ##### -->
<para>
@@ -470,6 +2508,13 @@ camel-types
@f:
@l:
+<!-- ##### MACRO CAMEL_NNTP_OK ##### -->
+<para>
+
+</para>
+
+ x:
+
<!-- ##### MACRO CAMEL_NNTP_STORE_LOCK ##### -->
<para>
@@ -486,19 +2531,50 @@ camel-types
@f:
@l:
+<!-- ##### MACRO CAMEL_OBJECT_GET_TYPE ##### -->
+<para>
+
+</para>
+
+ o:
+
+<!-- ##### MACRO CAMEL_OBJECT_TRACK_INSTANCES ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO CAMEL_OBJECT_TYPE ##### -->
<para>
</para>
-<!-- ##### ARG CamelCipherContext:session ##### -->
+<!-- ##### MACRO CAMEL_SMTP_TRANSPORT_8BITMIME ##### -->
<para>
</para>
-<!-- ##### ARG CamelDataCache:path ##### -->
+<!-- ##### MACRO CAMEL_SMTP_TRANSPORT_AUTH_EQUAL ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_SMTP_TRANSPORT_IS_ESMTP ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO CAMEL_SMTP_TRANSPORT_STARTTLS ##### -->
<para>
</para>
@@ -526,11 +2602,116 @@ camel-types
@parent_object:
-<!-- ##### ARG CamelGpgContext:always-trust ##### -->
+<!-- ##### STRUCT CamelGroupwiseFolder ##### -->
+<para>
+
+</para>
+
+ parent:
+ priv:
+ search:
+ journal:
+ cache:
+ need_rescan:
+ need_refresh:
+ read_only:
+
+<!-- ##### STRUCT CamelGroupwiseJournal ##### -->
+<para>
+
+</para>
+
+ parent:
+
+<!-- ##### STRUCT CamelGroupwiseJournalEntry ##### -->
+<para>
+
+</para>
+
+ node:
+ type:
+ uid:
+ original_uid:
+ source_container:
+
+<!-- ##### STRUCT CamelGroupwiseMessageContentInfo ##### -->
+<para>
+
+</para>
+
+ info:
+
+<!-- ##### STRUCT CamelGroupwiseMessageInfo ##### -->
+<para>
+
+</para>
+
+ info:
+ server_flags:
+
+<!-- ##### STRUCT CamelGroupwiseStore ##### -->
+<para>
+
+</para>
+
+ parent:
+ summary:
+ root_container:
+ priv:
+ current_folder:
+ refresh_stamp:
+
+<!-- ##### STRUCT CamelGroupwiseStoreInfo ##### -->
+<para>
+
+</para>
+
+ info:
+ full_name:
+
+<!-- ##### STRUCT CamelGroupwiseStoreNamespace ##### -->
<para>
</para>
+ path:
+ full_name:
+ sep:
+
+<!-- ##### STRUCT CamelGroupwiseStorePrivate ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT CamelGroupwiseStoreSummary ##### -->
+<para>
+
+</para>
+
+ summary:
+ priv:
+ version:
+ capabilities:
+ namespace:
+
+<!-- ##### STRUCT CamelGroupwiseSummary ##### -->
+<para>
+
+</para>
+
+ parent:
+ time_string:
+ version:
+ validity:
+
+<!-- ##### STRUCT CamelGroupwiseTransport ##### -->
+<para>
+
+</para>
+
+ parent:
+ connected:
<!-- ##### STRUCT CamelIMAP4Command ##### -->
<para>
@@ -786,6 +2967,28 @@ camel-types
@ex:
@Returns:
+<!-- ##### STRUCT CamelIMAPJournal ##### -->
+<para>
+
+</para>
+
+ parent:
+ folders:
+ uidmap:
+ rp_in_progress:
+
+<!-- ##### STRUCT CamelIMAPJournalEntry ##### -->
+<para>
+
+</para>
+
+ node:
+ type:
+ uids:
+ append_uid:
+ dest_folder_name:
+ move:
+
<!-- ##### STRUCT CamelISubscribe ##### -->
<para>
@@ -796,6 +2999,19 @@ camel-types
@subscribe:
@unsubscribe:
+<!-- ##### STRUCT CamelImapFolder ##### -->
+<para>
+
+</para>
+
+ parent_object:
+ priv:
+ search:
+ cache:
+ need_rescan:
+ need_refresh:
+ read_only:
+
<!-- ##### STRUCT CamelImapFolderPrivate ##### -->
<para>
@@ -803,6 +3019,157 @@ camel-types
@cache_lock:
+<!-- ##### STRUCT CamelImapMessageCache ##### -->
+<para>
+
+</para>
+
+ parent_object:
+ path:
+ parts:
+ cached:
+ max_uid:
+
+<!-- ##### STRUCT CamelImapMessageContentInfo ##### -->
+<para>
+
+</para>
+
+ info:
+
+<!-- ##### STRUCT CamelImapMessageInfo ##### -->
+<para>
+
+</para>
+
+ info:
+ server_flags:
+
+<!-- ##### STRUCT CamelImapMsg ##### -->
+<para>
+
+</para>
+
+ msg:
+ receive:
+ free:
+
+<!-- ##### STRUCT CamelImapResponse ##### -->
+<para>
+
+</para>
+
+ folder:
+ untagged:
+ status:
+
+<!-- ##### ENUM CamelImapResponseType ##### -->
+<para>
+
+</para>
+
+ CAMEL_IMAP_RESPONSE_ERROR:
+ CAMEL_IMAP_RESPONSE_CONTINUATION:
+ CAMEL_IMAP_RESPONSE_UNTAGGED:
+ CAMEL_IMAP_RESPONSE_TAGGED:
+
+<!-- ##### STRUCT CamelImapSearch ##### -->
+<para>
+
+</para>
+
+ parent:
+ lastuid:
+ validity:
+ cache:
+ matches_count:
+ matches:
+ matches_hash:
+
+<!-- ##### ENUM CamelImapServerLevel ##### -->
+<para>
+
+</para>
+
+ IMAP_LEVEL_UNKNOWN:
+ IMAP_LEVEL_IMAP4:
+ IMAP_LEVEL_IMAP4REV1:
+
+<!-- ##### STRUCT CamelImapStore ##### -->
+<para>
+
+</para>
+
+ parent_object:
+ istream:
+ ostream:
+ summary:
+ connected:
+ preauthed:
+ tag_prefix:
+ command:
+ current_folder:
+ server_level:
+ capabilities:
+ parameters:
+ braindamaged:
+ namespace:
+ dir_sep:
+ base_url:
+ storage_path:
+ authtypes:
+ renaming:
+
+<!-- ##### STRUCT CamelImapStoreInfo ##### -->
+<para>
+
+</para>
+
+ info:
+ full_name:
+
+<!-- ##### STRUCT CamelImapStoreNamespace ##### -->
+<para>
+
+</para>
+
+ path:
+ full_name:
+ sep:
+ next:
+
+<!-- ##### STRUCT CamelImapStoreSummary ##### -->
+<para>
+
+</para>
+
+ summary:
+ priv:
+ version:
+ capabilities:
+ namespace:
+
+<!-- ##### STRUCT CamelImapSummary ##### -->
+<para>
+
+</para>
+
+ parent:
+ version:
+ validity:
+
+<!-- ##### STRUCT CamelImapWrapper ##### -->
+<para>
+
+</para>
+
+ parent:
+ priv:
+ folder:
+ uid:
+ part_spec:
+ part:
+
<!-- ##### STRUCT CamelImapWrapperPrivate ##### -->
<para>
@@ -833,6 +3200,24 @@ camel-types
@reset:
@length:
+<!-- ##### STRUCT CamelLocalFolder ##### -->
+<para>
+
+</para>
+
+ parent:
+ priv:
+ flags:
+ locked:
+ locktype:
+ base_path:
+ folder_path:
+ summary_path:
+ index_path:
+ index:
+ search:
+ changes:
+
<!-- ##### STRUCT CamelLocalFolderPrivate ##### -->
<para>
@@ -840,47 +3225,156 @@ camel-types
@search_lock:
+<!-- ##### STRUCT CamelLocalMessageInfo ##### -->
+<para>
+
+</para>
+
+ info:
+
+<!-- ##### STRUCT CamelLocalStore ##### -->
+<para>
+
+</para>
+
+ parent:
+ toplevel_dir:
+
+<!-- ##### STRUCT CamelLocalSummary ##### -->
+<para>
+
+</para>
+
+ parent:
+ version:
+ folder_path:
+ index:
+ index_force:
+ check_force:
+
<!-- ##### STRUCT CamelMD5Context ##### -->
<para>
</para>
-<!-- ##### ARG CamelMedium:content ##### -->
+<!-- ##### STRUCT CamelMaildirFolder ##### -->
<para>
</para>
+ parent:
-<!-- ##### STRUCT CamelMimeFilterChomp ##### -->
+<!-- ##### STRUCT CamelMaildirMessageContentInfo ##### -->
<para>
</para>
+ info:
-<!-- ##### ARG CamelMimePart:content-id ##### -->
+<!-- ##### STRUCT CamelMaildirMessageInfo ##### -->
<para>
</para>
+ info:
+ filename:
-<!-- ##### ARG CamelMimePart:content-md5 ##### -->
+<!-- ##### STRUCT CamelMaildirStore ##### -->
<para>
</para>
+ parent:
-<!-- ##### ARG CamelMimePart:description ##### -->
+<!-- ##### STRUCT CamelMaildirSummary ##### -->
<para>
</para>
+ parent:
+ priv:
-<!-- ##### ARG CamelMimePart:disposition ##### -->
+<!-- ##### STRUCT CamelMboxFolder ##### -->
<para>
</para>
+ parent:
+ lockfd:
+
+<!-- ##### STRUCT CamelMboxMessageContentInfo ##### -->
+<para>
+
+</para>
+
+ info:
+
+<!-- ##### STRUCT CamelMboxMessageInfo ##### -->
+<para>
+
+</para>
+
+ info:
+ frompos:
+
+<!-- ##### STRUCT CamelMboxStore ##### -->
+<para>
+
+</para>
+
+ parent:
+
+<!-- ##### STRUCT CamelMboxSummary ##### -->
+<para>
+
+</para>
+
+ parent:
+ changes:
+ version:
+ folder_size:
+ xstatus:
+
+<!-- ##### STRUCT CamelMhFolder ##### -->
+<para>
+
+</para>
+
+ parent:
+
+<!-- ##### STRUCT CamelMhStore ##### -->
+<para>
+
+</para>
+
+ parent:
+ flags:
+
+<!-- ##### STRUCT CamelMhSummary ##### -->
+<para>
+
+</para>
+
+ parent:
+ priv:
+
+<!-- ##### STRUCT CamelMimeFilterChomp ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT CamelNNTPFolder ##### -->
+<para>
+
+</para>
+
+ parent:
+ priv:
+ changes:
+ storage_path:
+ search:
<!-- ##### STRUCT CamelNNTPFolderPrivate ##### -->
<para>
@@ -909,12 +3403,38 @@ camel-types
@high:
@flags:
+<!-- ##### TYPEDEF CamelNNTPNewsrc ##### -->
+<para>
+
+</para>
+
+
<!-- ##### TYPEDEF CamelNNTPOverField ##### -->
<para>
</para>
+<!-- ##### STRUCT CamelNNTPStore ##### -->
+<para>
+
+</para>
+
+ parent_object:
+ priv:
+ extensions:
+ posting_allowed:
+ do_short_folder_notation:
+ folder_hierarchy_relative:
+ summary:
+ stream:
+ mem:
+ cache:
+ current_folder:
+ storage_path:
+ base_url:
+ xover:
+
<!-- ##### STRUCT CamelNNTPStoreClass ##### -->
<para>
@@ -922,6 +3442,16 @@ camel-types
@parent_class:
+<!-- ##### STRUCT CamelNNTPStoreInfo ##### -->
+<para>
+
+</para>
+
+ info:
+ full_name:
+ first:
+ last:
+
<!-- ##### STRUCT CamelNNTPStorePrivate ##### -->
<para>
@@ -929,6 +3459,43 @@ camel-types
@dummy:
+<!-- ##### STRUCT CamelNNTPStoreSummary ##### -->
+<para>
+
+</para>
+
+ summary:
+ priv:
+ version:
+ last_newslist:
+
+<!-- ##### STRUCT CamelNNTPStream ##### -->
+<para>
+
+</para>
+
+ parent:
+ source:
+ mode:
+ state:
+ buf:
+ ptr:
+ end:
+ linebuf:
+ lineptr:
+ lineend:
+
+<!-- ##### STRUCT CamelNNTPSummary ##### -->
+<para>
+
+</para>
+
+ parent:
+ priv:
+ version:
+ high:
+ low:
+
<!-- ##### STRUCT CamelNewsAddress ##### -->
<para>
@@ -937,6 +3504,42 @@ camel-types
@parent:
@priv:
+<!-- ##### USER_FUNCTION CamelObjectClassFinalizeFunc ##### -->
+<para>
+
+</para>
+
+ Param1:
+
+<!-- ##### USER_FUNCTION CamelObjectClassInitFunc ##### -->
+<para>
+
+</para>
+
+ Param1:
+
+<!-- ##### USER_FUNCTION CamelObjectFinalizeFunc ##### -->
+<para>
+
+</para>
+
+ Param1:
+
+<!-- ##### ENUM CamelObjectFlags ##### -->
+<para>
+
+</para>
+
+ CAMEL_OBJECT_DESTROY:
+
+<!-- ##### USER_FUNCTION CamelObjectInitFunc ##### -->
+<para>
+
+</para>
+
+ Param1:
+ Param2:
+
<!-- ##### STRUCT CamelObjectMeta ##### -->
<para>
@@ -946,29 +3549,114 @@ camel-types
@value:
@name:
-<!-- ##### ARG CamelSasl:authenticated ##### -->
+<!-- ##### ENUM CamelOfflineAction ##### -->
<para>
</para>
+ CAMEL_IMAP_JOURNAL_ENTRY_EXPUNGE:
+ CAMEL_IMAP_JOURNAL_ENTRY_APPEND:
+ CAMEL_IMAP_JOURNAL_ENTRY_TRANSFER:
-<!-- ##### ARG CamelSasl:mechanism ##### -->
+<!-- ##### STRUCT CamelPOP3Command ##### -->
<para>
</para>
+ next:
+ prev:
+ flags:
+ state:
+ func:
+ func_data:
+ data_size:
+ data:
+
+<!-- ##### USER_FUNCTION CamelPOP3CommandFunc ##### -->
+<para>
+
+</para>
+
+ pe:
+ stream:
+ data:
+
+<!-- ##### STRUCT CamelPOP3Engine ##### -->
+<para>
+
+</para>
+
+ parent:
+ flags:
+ state:
+ auth:
+ capa:
+ apop:
+ line:
+ linelen:
+ stream:
+ sentlen:
+ active:
+ queue:
+ done:
+ current:
-<!-- ##### ARG CamelSasl:service ##### -->
+<!-- ##### STRUCT CamelPOP3Folder ##### -->
<para>
</para>
+ parent:
+ uids:
+ uids_uid:
+ uids_id:
-<!-- ##### ARG CamelSasl:service-name ##### -->
+<!-- ##### STRUCT CamelPOP3FolderInfo ##### -->
<para>
</para>
+ id:
+ size:
+ flags:
+ index:
+ uid:
+ err:
+ cmd:
+ stream:
+
+<!-- ##### STRUCT CamelPOP3Store ##### -->
+<para>
+
+</para>
+
+ parent:
+ engine:
+ cache:
+ delete_after:
+
+<!-- ##### STRUCT CamelPOP3Stream ##### -->
+<para>
+
+</para>
+
+ parent:
+ source:
+ mode:
+ state:
+ buf:
+ ptr:
+ end:
+ linebuf:
+ lineptr:
+ lineend:
+
+<!-- ##### STRUCT CamelSendmailTransport ##### -->
+<para>
+
+</para>
+
+ parent:
<!-- ##### STRUCT CamelSimpleDataWrapper ##### -->
<para>
@@ -976,12 +3664,85 @@ camel-types
</para>
+<!-- ##### STRUCT CamelSmtpTransport ##### -->
+<para>
+
+</para>
+
+ parent:
+ istream:
+ ostream:
+ flags:
+ connected:
+ localaddr:
+ localaddrlen:
+ authtypes:
+
+<!-- ##### STRUCT CamelSpoolFolder ##### -->
+<para>
+
+</para>
+
+ parent:
+ priv:
+ lockid:
+
+<!-- ##### STRUCT CamelSpoolStore ##### -->
+<para>
+
+</para>
+
+ parent:
+ type:
+
+<!-- ##### STRUCT CamelSpoolSummary ##### -->
+<para>
+
+</para>
+
+ parent:
+
<!-- ##### STRUCT CamelStreamDataWrapper ##### -->
<para>
</para>
+<!-- ##### STRUCT CamelTestSession ##### -->
+<para>
+
+</para>
+
+ parent:
+
+<!-- ##### TYPEDEF CamelType ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO DRAFT ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### USER_FUNCTION EPathFindFoldersCallback ##### -->
+<para>
+
+</para>
+
+ physical_path:
+ path:
+ user_data:
+ Returns:
+
+<!-- ##### MACRO GW_PARAM_FILTER_INBOX ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO IMAP4_READ_BUFLEN ##### -->
<para>
@@ -994,6 +3755,154 @@ camel-types
</para>
+<!-- ##### USER_FUNCTION IMAPPathFindFoldersCallback ##### -->
+<para>
+
+</para>
+
+ physical_path:
+ path:
+ user_data:
+ Returns:
+
+<!-- ##### MACRO IMAP_CAPABILITY_IMAP4 ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_IMAP4REV1 ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_LITERALPLUS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_LOGINDISABLED ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_NAMESPACE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_QUOTA ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_STARTTLS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_STATUS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_UIDPLUS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_XGWEXTENSIONS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_XGWMOVE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_useful_lsub ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_CAPABILITY_utf8_search ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_FETCH_ALL_HEADERS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_FETCH_MAILING_LIST_HEADERS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_FETCH_MINIMAL_HEADERS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_PARAM_CHECK_ALL ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_PARAM_CHECK_LSUB ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_PARAM_FILTER_INBOX ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_PARAM_FILTER_JUNK ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_PARAM_FILTER_JUNK_INBOX ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_PARAM_OVERRIDE_NAMESPACE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO IMAP_PARAM_SUBSCRIPTIONS ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO NI_MAXHOST ##### -->
<para>
@@ -1006,6 +3915,234 @@ camel-types
</para>
+<!-- ##### MACRO NNTP_ARTICLE_FOLLOWS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_AUTH_ACCEPTED ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_AUTH_CONTINUE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_AUTH_REJECTED ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_AUTH_REQUIRED ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_DATA_FOLLOWS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_DATE_SIZE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_EXTENSIONS_SUPPORTED ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_GREETING_NO_POSTING ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_GREETING_POSTING_OK ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_GROUP_SELECTED ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_HEAD_FOLLOWS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_LIST_FOLLOWS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_NEW_ARTICLE_LIST_FOLLOWS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_NEW_GROUP_LIST_FOLLOWS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_NO_PERMISSION ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_NO_SUCH_ARTICLE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_NO_SUCH_GROUP ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO NNTP_PROTOCOL_ERROR ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO PERSONAL ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO RECEIVED ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SEEKABLE_SUBSTREAM_WAYS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SENT ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SET_CONTENT_WAYS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO STATUS_PINE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_AUTODELETE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_DELAY_UNTIL ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_EXPIRE_AFTER ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_REPLY_CONVENIENT ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_REPLY_WITHIN ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_RETURN_NOTIFY_DELETE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_RETURN_NOTIFY_OPEN ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_SEND_OPTIONS ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_SEND_OPT_PRIORITY ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_SEND_OPT_SECURITY ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO X_TRACK_WHEN ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### TYPEDEF _CamelNNTPGroupList ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### TYPEDEF _CamelNNTPGroupListEntry ##### -->
+<para>
+
+</para>
+
+
<!-- ##### FUNCTION add_recipients ##### -->
<para>
@@ -1093,6 +4230,14 @@ camel-types
@Returns:
+<!-- ##### FUNCTION camel_cipher_context_construct ##### -->
+<para>
+
+</para>
+
+ context:
+ session:
+
<!-- ##### FUNCTION camel_data_cache_clear ##### -->
<para>
@@ -1191,6 +4336,206 @@ camel-types
@summary:
@array:
+<!-- ##### FUNCTION camel_groupwise_journal_append ##### -->
+<para>
+
+</para>
+
+ journal:
+ message:
+ mi:
+ appended_uid:
+ ex:
+
+<!-- ##### FUNCTION camel_groupwise_journal_new ##### -->
+<para>
+
+</para>
+
+ folder:
+ filename:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_journal_transfer ##### -->
+<para>
+
+</para>
+
+ journal:
+ source_folder:
+ message:
+ mi:
+ orginal_uid:
+ transferred_uid:
+ ex:
+
+<!-- ##### FUNCTION camel_groupwise_store_connected ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_container_id_lookup ##### -->
+<para>
+
+</para>
+
+ gw_store:
+ folder_name:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_folder_lookup ##### -->
+<para>
+
+</para>
+
+ gw_store:
+ container_id:
+ Returns:
+
+<!-- ##### MACRO camel_groupwise_store_info_full_name ##### -->
+<para>
+
+</para>
+
+ s:
+ i:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_add_from_full ##### -->
+<para>
+
+</para>
+
+ s:
+ full:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_full_from_path ##### -->
+<para>
+
+</para>
+
+ s:
+ path:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_full_name ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_full_to_path ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_namespace_find_path ##### -->
+<para>
+
+</para>
+
+ s:
+ path:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_namespace_new ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_namespace_set ##### -->
+<para>
+
+</para>
+
+ s:
+ ns:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_new ##### -->
+<para>
+
+</para>
+
+ void:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_store_summary_path_to_full ##### -->
+<para>
+
+</para>
+
+ s:
+ path:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_summary_new ##### -->
+<para>
+
+</para>
+
+ folder:
+ filename:
+ Returns:
+
+<!-- ##### FUNCTION camel_groupwise_util_item_from_message ##### -->
+<para>
+
+</para>
+
+ cnc:
+ message:
+ from:
+ Returns:
+
+<!-- ##### FUNCTION camel_gw_folder_new ##### -->
+<para>
+
+</para>
+
+ store:
+ folder_dir:
+ folder_name:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_gw_summary_add_offline ##### -->
+<para>
+
+</para>
+
+ summary:
+ uid:
+ messgae:
+ info:
+
+<!-- ##### FUNCTION camel_gw_summary_add_offline_uncached ##### -->
+<para>
+
+</para>
+
+ summary:
+ uid:
+ info:
+
<!-- ##### FUNCTION camel_imap4_build_folder_info_tree ##### -->
<para>
@@ -1853,6 +5198,445 @@ camel-types
@engine:
@token:
+<!-- ##### FUNCTION camel_imap_command ##### -->
+<para>
+
+</para>
+
+ store:
+ folder:
+ ex:
+ fmt:
+ Varargs:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_command_continuation ##### -->
+<para>
+
+</para>
+
+ store:
+ cmd:
+ cmdlen:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_command_response ##### -->
+<para>
+
+</para>
+
+ store:
+ response:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_command_start ##### -->
+<para>
+
+</para>
+
+ store:
+ folder:
+ ex:
+ fmt:
+ Varargs:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_folder_changed ##### -->
+<para>
+
+</para>
+
+ folder:
+ exists:
+ expunged:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_folder_fetch_data ##### -->
+<para>
+
+</para>
+
+ imap_folder:
+ uid:
+ section_text:
+ cache_only:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_folder_new ##### -->
+<para>
+
+</para>
+
+ parent:
+ folder_name:
+ folder_dir:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_folder_selected ##### -->
+<para>
+
+</para>
+
+ folder:
+ response:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_journal_close_folders ##### -->
+<para>
+
+</para>
+
+ journal:
+
+<!-- ##### FUNCTION camel_imap_journal_log ##### -->
+<para>
+
+</para>
+
+ journal:
+ action:
+ Varargs:
+
+<!-- ##### FUNCTION camel_imap_journal_new ##### -->
+<para>
+
+</para>
+
+ folder:
+ filename:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_journal_uidmap_add ##### -->
+<para>
+
+</para>
+
+ journal:
+ old_uid:
+ n_uid:
+
+<!-- ##### FUNCTION camel_imap_journal_uidmap_lookup ##### -->
+<para>
+
+</para>
+
+ journal:
+ uid:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_message_cache_clear ##### -->
+<para>
+
+</para>
+
+ cache:
+
+<!-- ##### FUNCTION camel_imap_message_cache_copy ##### -->
+<para>
+
+</para>
+
+ source:
+ source_uid:
+ dest:
+ dest_uid:
+ ex:
+
+<!-- ##### FUNCTION camel_imap_message_cache_delete ##### -->
+<para>
+
+</para>
+
+ path:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_message_cache_filter_cached ##### -->
+<para>
+
+</para>
+
+ Param1:
+ uids:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_message_cache_get ##### -->
+<para>
+
+</para>
+
+ cache:
+ uid:
+ part_spec:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_message_cache_get_filename ##### -->
+<para>
+
+</para>
+
+ cache:
+ uid:
+ part_spec:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_message_cache_insert ##### -->
+<para>
+
+</para>
+
+ cache:
+ uid:
+ part_spec:
+ data:
+ len:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_message_cache_insert_stream ##### -->
+<para>
+
+</para>
+
+ cache:
+ uid:
+ part_spec:
+ data_stream:
+ ex:
+
+<!-- ##### FUNCTION camel_imap_message_cache_insert_wrapper ##### -->
+<para>
+
+</para>
+
+ cache:
+ uid:
+ part_spec:
+ wrapper:
+ ex:
+
+<!-- ##### FUNCTION camel_imap_message_cache_max_uid ##### -->
+<para>
+
+</para>
+
+ cache:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_message_cache_new ##### -->
+<para>
+
+</para>
+
+ path:
+ summary:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_message_cache_remove ##### -->
+<para>
+
+</para>
+
+ cache:
+ uid:
+
+<!-- ##### FUNCTION camel_imap_message_cache_set_path ##### -->
+<para>
+
+</para>
+
+ cache:
+ path:
+
+<!-- ##### FUNCTION camel_imap_msg_new ##### -->
+<para>
+
+</para>
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ CamelImapStore *store, struct _CamelImapMsg *m:
+ CamelImapStore *store, struct _CamelImapMsg *m:
+
+ size:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_msg_queue ##### -->
+<para>
+
+</para>
+
+ store:
+ msg:
+
+<!-- ##### FUNCTION camel_imap_response_extract ##### -->
+<para>
+
+</para>
+
+ store:
+ response:
+ type:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_response_extract_continuation ##### -->
+<para>
+
+</para>
+
+ store:
+ response:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_response_free ##### -->
+<para>
+
+</para>
+
+ store:
+ response:
+
+<!-- ##### FUNCTION camel_imap_response_free_without_processing ##### -->
+<para>
+
+</para>
+
+ store:
+ response:
+
+<!-- ##### FUNCTION camel_imap_search_new ##### -->
+<para>
+
+</para>
+
+ cachedir:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_connected ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+ Returns:
+
+<!-- ##### MACRO camel_imap_store_info_full_name ##### -->
+<para>
+
+</para>
+
+ s:
+ i:
+
+<!-- ##### FUNCTION camel_imap_store_readline ##### -->
+<para>
+
+</para>
+
+ store:
+ dest:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_summary_add_from_full ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_summary_full_from_path ##### -->
+<para>
+
+</para>
+
+ s:
+ path:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_summary_full_name ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_summary_full_to_path ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_summary_get_main_namespace ##### -->
+<para>
+
+</para>
+
+ s:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_summary_namespace_add_secondary ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ dir_sep:
+
+<!-- ##### FUNCTION camel_imap_store_summary_namespace_find_full ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_summary_namespace_find_path ##### -->
+<para>
+
+</para>
+
+ s:
+ path:
+ Returns:
+
<!-- ##### FUNCTION camel_imap_store_summary_namespace_new ##### -->
<para>
@@ -1871,6 +5655,74 @@ camel-types
@s:
@ns:
+<!-- ##### FUNCTION camel_imap_store_summary_namespace_set_main ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ dir_sep:
+
+<!-- ##### FUNCTION camel_imap_store_summary_new ##### -->
+<para>
+
+</para>
+
+ void:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_store_summary_path_to_full ##### -->
+<para>
+
+</para>
+
+ s:
+ path:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_summary_add_offline ##### -->
+<para>
+
+</para>
+
+ summary:
+ uid:
+ message:
+ info:
+
+<!-- ##### FUNCTION camel_imap_summary_add_offline_uncached ##### -->
+<para>
+
+</para>
+
+ summary:
+ uid:
+ info:
+
+<!-- ##### FUNCTION camel_imap_summary_new ##### -->
+<para>
+
+</para>
+
+ folder:
+ filename:
+ Returns:
+
+<!-- ##### FUNCTION camel_imap_wrapper_new ##### -->
+<para>
+
+</para>
+
+ imap_folder:
+ type:
+ encoding:
+ uid:
+ part_spec:
+ part:
+ Returns:
+
<!-- ##### FUNCTION camel_index_name_get_type ##### -->
<para>
@@ -2011,6 +5863,249 @@ camel-types
@Returns:
+<!-- ##### FUNCTION camel_local_folder_construct ##### -->
+<para>
+
+</para>
+
+ lf:
+ parent_store:
+ full_name:
+ flags:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_folder_lock ##### -->
+<para>
+
+</para>
+
+ lf:
+ type:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_folder_unlock ##### -->
+<para>
+
+</para>
+
+ lf:
+ Returns:
+
+<!-- ##### MACRO camel_local_store_get_full_path ##### -->
+<para>
+
+</para>
+
+ ls:
+ name:
+
+<!-- ##### MACRO camel_local_store_get_meta_path ##### -->
+<para>
+
+</para>
+
+ ls:
+ name:
+ ext:
+
+<!-- ##### FUNCTION camel_local_store_get_toplevel_dir ##### -->
+<para>
+
+</para>
+
+ store:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_summary_add ##### -->
+<para>
+
+</para>
+
+ cls:
+ msg:
+ info:
+ Param4:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_summary_check ##### -->
+<para>
+
+</para>
+
+ cls:
+ Param2:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_summary_check_force ##### -->
+<para>
+
+</para>
+
+ cls:
+
+<!-- ##### FUNCTION camel_local_summary_construct ##### -->
+<para>
+
+</para>
+
+ new:
+ filename:
+ local_name:
+ index:
+
+<!-- ##### FUNCTION camel_local_summary_decode_x_evolution ##### -->
+<para>
+
+</para>
+
+ cls:
+ xev:
+ info:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_summary_encode_x_evolution ##### -->
+<para>
+
+</para>
+
+ cls:
+ info:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_summary_load ##### -->
+<para>
+
+</para>
+
+ cls:
+ forceindex:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_summary_sync ##### -->
+<para>
+
+</para>
+
+ cls:
+ expunge:
+ Param3:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_local_summary_write_headers ##### -->
+<para>
+
+</para>
+
+ fd:
+ header:
+ xevline:
+ status:
+ xstatus:
+ Returns:
+
+<!-- ##### FUNCTION camel_maildir_folder_new ##### -->
+<para>
+
+</para>
+
+ parent_store:
+ full_name:
+ flags:
+ ex:
+ Returns:
+
+<!-- ##### MACRO camel_maildir_info_filename ##### -->
+<para>
+
+</para>
+
+ x:
+
+<!-- ##### MACRO camel_maildir_info_set_filename ##### -->
+<para>
+
+</para>
+
+ x:
+ s:
+
+<!-- ##### FUNCTION camel_maildir_summary_info_to_name ##### -->
+<para>
+
+</para>
+
+ info:
+ Returns:
+
+<!-- ##### FUNCTION camel_maildir_summary_name_to_info ##### -->
+<para>
+
+</para>
+
+ info:
+ name:
+ Returns:
+
+<!-- ##### FUNCTION camel_maildir_summary_new ##### -->
+<para>
+
+</para>
+
+ folder:
+ filename:
+ maildirdir:
+ index:
+ Returns:
+
+<!-- ##### FUNCTION camel_mbox_folder_new ##### -->
+<para>
+
+</para>
+
+ parent_store:
+ full_name:
+ flags:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_mbox_summary_new ##### -->
+<para>
+
+</para>
+
+ Param1:
+ filename:
+ mbox_name:
+ index:
+ Returns:
+
+<!-- ##### FUNCTION camel_mbox_summary_sync_mbox ##### -->
+<para>
+
+</para>
+
+ cls:
+ flags:
+ changeinfo:
+ fd:
+ fdout:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_mbox_summary_xstatus ##### -->
+<para>
+
+</para>
+
+ mbs:
+ state:
+
<!-- ##### FUNCTION camel_md5_final ##### -->
<para>
@@ -2068,6 +6163,28 @@ camel-types
@medium:
@content:
+<!-- ##### FUNCTION camel_mh_folder_new ##### -->
+<para>
+
+</para>
+
+ parent_store:
+ full_name:
+ flags:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_mh_summary_new ##### -->
+<para>
+
+</para>
+
+ Param1:
+ filename:
+ mhdir:
+ index:
+ Returns:
+
<!-- ##### FUNCTION camel_mime_filter_basic_new_type ##### -->
<para>
@@ -2126,6 +6243,14 @@ camel-types
@mode:
@Returns:
+<!-- ##### FUNCTION camel_name_to_type ##### -->
+<para>
+
+</para>
+
+ name:
+ Returns:
+
<!-- ##### FUNCTION camel_news_address_new ##### -->
<para>
@@ -2133,6 +6258,404 @@ camel-types
@Returns:
+<!-- ##### FUNCTION camel_nntp_auth_authenticate ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_command ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+ folder:
+ line:
+ fmt:
+ Varargs:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_folder_new ##### -->
+<para>
+
+</para>
+
+ parent:
+ folder_name:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_folder_selected ##### -->
+<para>
+
+</para>
+
+ folder:
+ line:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_get_headers ##### -->
+<para>
+
+</para>
+
+ store:
+ nntp_folder:
+ ex:
+
+<!-- ##### FUNCTION camel_nntp_grouplist_fetch ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_grouplist_free ##### -->
+<para>
+
+</para>
+
+ group_list:
+
+<!-- ##### FUNCTION camel_nntp_grouplist_save ##### -->
+<para>
+
+</para>
+
+ group_list:
+ ex:
+
+<!-- ##### FUNCTION camel_nntp_grouplist_update ##### -->
+<para>
+
+</para>
+
+ group_list:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_article_is_read ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_name:
+ num:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_free_group_names ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_names:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_get_all_group_names ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_get_highest_article_read ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_name:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_get_num_articles_read ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_name:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_get_subscribed_group_names ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_group_is_subscribed ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_name:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_mark_article_read ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_name:
+ num:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_mark_range_read ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_name:
+ low:
+ high:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_read_for_server ##### -->
+<para>
+
+</para>
+
+ server:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_subscribe_group ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_name:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_unsubscribe_group ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ group_name:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_write ##### -->
+<para>
+
+</para>
+
+ newsrc:
+
+<!-- ##### FUNCTION camel_nntp_newsrc_write_to_file ##### -->
+<para>
+
+</para>
+
+ newsrc:
+ fp:
+
+<!-- ##### FUNCTION camel_nntp_raw_command ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+ line:
+ fmt:
+ Varargs:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_raw_command_auth ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+ line:
+ fmt:
+ Varargs:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_raw_commandv ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+ line:
+ fmt:
+ ap:
+ Returns:
+
+<!-- ##### MACRO camel_nntp_store_info_full_name ##### -->
+<para>
+
+</para>
+
+ s:
+ i:
+
+<!-- ##### FUNCTION camel_nntp_store_summary_add_from_full ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_store_summary_dotted_to_full ##### -->
+<para>
+
+</para>
+
+ s:
+ dotted:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_store_summary_full_from_path ##### -->
+<para>
+
+</para>
+
+ s:
+ path:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_store_summary_full_name ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_store_summary_full_to_path ##### -->
+<para>
+
+</para>
+
+ s:
+ full_name:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_store_summary_new ##### -->
+<para>
+
+</para>
+
+ void:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_store_summary_path_to_full ##### -->
+<para>
+
+</para>
+
+ s:
+ path:
+ dir_sep:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_stream_getd ##### -->
+<para>
+
+</para>
+
+ is:
+ start:
+ len:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_stream_gets ##### -->
+<para>
+
+</para>
+
+ is:
+ start:
+ len:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_stream_line ##### -->
+<para>
+
+</para>
+
+ is:
+ data:
+ len:
+ Returns:
+
+<!-- ##### ENUM camel_nntp_stream_mode_t ##### -->
+<para>
+
+</para>
+
+ CAMEL_NNTP_STREAM_LINE:
+ CAMEL_NNTP_STREAM_DATA:
+ CAMEL_NNTP_STREAM_EOD:
+
+<!-- ##### FUNCTION camel_nntp_stream_new ##### -->
+<para>
+
+</para>
+
+ source:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_stream_set_mode ##### -->
+<para>
+
+</para>
+
+ is:
+ mode:
+
+<!-- ##### FUNCTION camel_nntp_summary_check ##### -->
+<para>
+
+</para>
+
+ cns:
+ store:
+ line:
+ changes:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_nntp_summary_new ##### -->
+<para>
+
+</para>
+
+ folder:
+ path:
+ Returns:
+
+<!-- ##### FUNCTION camel_object_cast ##### -->
+<para>
+
+</para>
+
+ obj:
+ ctype:
+ Returns:
+
<!-- ##### FUNCTION camel_object_class_add_interface ##### -->
<para>
@@ -2141,6 +6664,31 @@ camel-types
@klass:
@itype:
+<!-- ##### FUNCTION camel_object_class_cast ##### -->
+<para>
+
+</para>
+
+ klass:
+ ctype:
+ Returns:
+
+<!-- ##### FUNCTION camel_object_class_dump_tree ##### -->
+<para>
+
+</para>
+
+ root:
+
+<!-- ##### FUNCTION camel_object_class_is ##### -->
+<para>
+
+</para>
+
+ klass:
+ ctype:
+ Returns:
+
<!-- ##### FUNCTION camel_object_get_int ##### -->
<para>
@@ -2170,6 +6718,15 @@ camel-types
@tag:
@Returns:
+<!-- ##### FUNCTION camel_object_is ##### -->
+<para>
+
+</para>
+
+ obj:
+ ctype:
+ Returns:
+
<!-- ##### FUNCTION camel_object_meta_get ##### -->
<para>
@@ -2189,6 +6746,14 @@ camel-types
@value:
@Returns:
+<!-- ##### FUNCTION camel_object_new ##### -->
+<para>
+
+</para>
+
+ type:
+ Returns:
+
<!-- ##### FUNCTION camel_object_new_name ##### -->
<para>
@@ -2197,6 +6762,27 @@ camel-types
@name:
@Returns:
+<!-- ##### FUNCTION camel_object_ref ##### -->
+<para>
+
+</para>
+
+ Param1:
+ Returns:
+
+<!-- ##### VARIABLE camel_object_type ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION camel_object_unref ##### -->
+<para>
+
+</para>
+
+ Param1:
+
<!-- ##### FUNCTION camel_operation_cancel_block ##### -->
<para>
@@ -2226,6 +6812,177 @@ camel-types
@Returns:
+<!-- ##### FUNCTION camel_pop3_command ##### -->
+<para>
+
+</para>
+
+ store:
+ ret:
+ ex:
+ fmt:
+ Varargs:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_command_get_additional_data ##### -->
+<para>
+
+</para>
+
+ store:
+ total:
+ ex:
+ Returns:
+
+<!-- ##### ENUM camel_pop3_command_t ##### -->
+<para>
+
+</para>
+
+ CAMEL_POP3_COMMAND_IDLE:
+ CAMEL_POP3_COMMAND_DISPATCHED:
+ CAMEL_POP3_COMMAND_OK:
+ CAMEL_POP3_COMMAND_DATA:
+ CAMEL_POP3_COMMAND_ERR:
+
+<!-- ##### FUNCTION camel_pop3_delete_old ##### -->
+<para>
+
+</para>
+
+ folder:
+ days_to_delete:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_engine_command_free ##### -->
+<para>
+
+</para>
+
+ pe:
+ pc:
+
+<!-- ##### FUNCTION camel_pop3_engine_command_new ##### -->
+<para>
+
+</para>
+
+ pe:
+ flags:
+ func:
+ data:
+ fmt:
+ Varargs:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_engine_iterate ##### -->
+<para>
+
+</para>
+
+ pe:
+ pc:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_engine_new ##### -->
+<para>
+
+</para>
+
+ source:
+ flags:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_engine_reget_capabilities ##### -->
+<para>
+
+</para>
+
+ engine:
+
+<!-- ##### ENUM camel_pop3_engine_t ##### -->
+<para>
+
+</para>
+
+ CAMEL_POP3_ENGINE_DISCONNECT:
+ CAMEL_POP3_ENGINE_AUTH:
+ CAMEL_POP3_ENGINE_TRANSACTION:
+ CAMEL_POP3_ENGINE_UPDATE:
+
+<!-- ##### FUNCTION camel_pop3_folder_new ##### -->
+<para>
+
+</para>
+
+ parent:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_store_expunge ##### -->
+<para>
+
+</para>
+
+ store:
+ ex:
+
+<!-- ##### FUNCTION camel_pop3_stream_getd ##### -->
+<para>
+
+</para>
+
+ is:
+ start:
+ len:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_stream_gets ##### -->
+<para>
+
+</para>
+
+ is:
+ start:
+ len:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_stream_line ##### -->
+<para>
+
+</para>
+
+ is:
+ data:
+ len:
+ Returns:
+
+<!-- ##### ENUM camel_pop3_stream_mode_t ##### -->
+<para>
+
+</para>
+
+ CAMEL_POP3_STREAM_LINE:
+ CAMEL_POP3_STREAM_DATA:
+ CAMEL_POP3_STREAM_EOD:
+
+<!-- ##### FUNCTION camel_pop3_stream_new ##### -->
+<para>
+
+</para>
+
+ source:
+ Returns:
+
+<!-- ##### FUNCTION camel_pop3_stream_set_mode ##### -->
+<para>
+
+</para>
+
+ is:
+ mode:
+
<!-- ##### FUNCTION camel_process_fork ##### -->
<para>
@@ -2356,6 +7113,116 @@ camel-types
@type:
@words:
+<!-- ##### FUNCTION camel_spool_folder_new ##### -->
+<para>
+
+</para>
+
+ parent_store:
+ full_name:
+ flags:
+ ex:
+ Returns:
+
+<!-- ##### ENUM camel_spool_store_t ##### -->
+<para>
+
+</para>
+
+ CAMEL_SPOOL_STORE_MBOX:
+ CAMEL_SPOOL_STORE_ELM:
+
+<!-- ##### FUNCTION camel_spool_summary_add ##### -->
+<para>
+
+</para>
+
+ cls:
+ msg:
+ info:
+ Param4:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_spool_summary_check ##### -->
+<para>
+
+</para>
+
+ cls:
+ Param2:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_spool_summary_construct ##### -->
+<para>
+
+</para>
+
+ new:
+ filename:
+ spool_name:
+ index:
+
+<!-- ##### FUNCTION camel_spool_summary_decode_x_evolution ##### -->
+<para>
+
+</para>
+
+ cls:
+ xev:
+ info:
+ Returns:
+
+<!-- ##### FUNCTION camel_spool_summary_encode_x_evolution ##### -->
+<para>
+
+</para>
+
+ cls:
+ info:
+ Returns:
+
+<!-- ##### FUNCTION camel_spool_summary_load ##### -->
+<para>
+
+</para>
+
+ cls:
+ forceindex:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_spool_summary_new ##### -->
+<para>
+
+</para>
+
+ Param1:
+ filename:
+ Returns:
+
+<!-- ##### FUNCTION camel_spool_summary_sync ##### -->
+<para>
+
+</para>
+
+ cls:
+ expunge:
+ Param3:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION camel_spool_summary_write_headers ##### -->
+<para>
+
+</para>
+
+ fd:
+ header:
+ xevline:
+ Returns:
+
<!-- ##### FUNCTION camel_stream_filter_new_with_stream ##### -->
<para>
@@ -2372,6 +7239,90 @@ camel-types
@handle:
@Returns:
+<!-- ##### FUNCTION camel_test_end ##### -->
+<para>
+
+</para>
+
+ void:
+
+<!-- ##### FUNCTION camel_test_fail ##### -->
+<para>
+
+</para>
+
+ why:
+ Varargs:
+
+<!-- ##### FUNCTION camel_test_failv ##### -->
+<para>
+
+</para>
+
+ why:
+ ap:
+
+<!-- ##### FUNCTION camel_test_fatal ##### -->
+<para>
+
+</para>
+
+ void:
+
+<!-- ##### FUNCTION camel_test_init ##### -->
+<para>
+
+</para>
+
+ argc:
+ argv:
+
+<!-- ##### FUNCTION camel_test_nonfatal ##### -->
+<para>
+
+</para>
+
+ why:
+ Varargs:
+
+<!-- ##### FUNCTION camel_test_provider_init ##### -->
+<para>
+
+</para>
+
+ argc:
+ argv:
+
+<!-- ##### FUNCTION camel_test_pull ##### -->
+<para>
+
+</para>
+
+ void:
+
+<!-- ##### FUNCTION camel_test_push ##### -->
+<para>
+
+</para>
+
+ what:
+ Varargs:
+
+<!-- ##### FUNCTION camel_test_session_new ##### -->
+<para>
+
+</para>
+
+ path:
+ Returns:
+
+<!-- ##### FUNCTION camel_test_start ##### -->
+<para>
+
+</para>
+
+ what:
+
<!-- ##### FUNCTION camel_text_index_get_type ##### -->
<para>
@@ -2393,6 +7344,43 @@ camel-types
@Returns:
+<!-- ##### MACRO camel_type_get_global_classfuncs ##### -->
+<para>
+
+</para>
+
+ x:
+
+<!-- ##### FUNCTION camel_type_init ##### -->
+<para>
+
+</para>
+
+ void:
+
+<!-- ##### FUNCTION camel_type_register ##### -->
+<para>
+
+</para>
+
+ parent:
+ name:
+ instance_size:
+ classfuncs_size:
+ class_init:
+ class_finalize:
+ instance_init:
+ instance_finalize:
+ Returns:
+
+<!-- ##### FUNCTION camel_type_to_name ##### -->
+<para>
+
+</para>
+
+ type:
+ Returns:
+
<!-- ##### FUNCTION camel_ustrstrcase ##### -->
<para>
@@ -2408,6 +7396,116 @@ camel-types
</para>
+<!-- ##### MACRO check ##### -->
+<para>
+
+</para>
+
+ x:
+
+<!-- ##### MACRO check_count ##### -->
+<para>
+
+</para>
+
+ object:
+ expected:
+
+<!-- ##### MACRO check_msg ##### -->
+<para>
+
+</para>
+
+ x:
+ y:
+ z :
+
+<!-- ##### MACRO check_unref ##### -->
+<para>
+
+</para>
+
+ object:
+ expected:
+
+<!-- ##### FUNCTION cnc_lookup ##### -->
+<para>
+
+</para>
+
+ priv:
+ Returns:
+
+<!-- ##### FUNCTION create_junk_folder ##### -->
+<para>
+
+</para>
+
+ store:
+ Returns:
+
+<!-- ##### FUNCTION do_flags_diff ##### -->
+<para>
+
+</para>
+
+ diff:
+ old:
+ _new:
+
+<!-- ##### FUNCTION e_path_find_folders ##### -->
+<para>
+
+</para>
+
+ prefix:
+ callback:
+ data:
+ Returns:
+
+<!-- ##### FUNCTION e_path_rmdir ##### -->
+<para>
+
+</para>
+
+ prefix:
+ vpath:
+ Returns:
+
+<!-- ##### FUNCTION e_path_to_physical ##### -->
+<para>
+
+</para>
+
+ prefix:
+ vpath:
+ Returns:
+
+<!-- ##### STRUCT flags_diff_t ##### -->
+<para>
+
+</para>
+
+ changed:
+ bits:
+
+<!-- ##### FUNCTION groupwise_base_url_lookup ##### -->
+<para>
+
+</para>
+
+ priv:
+ Returns:
+
+<!-- ##### FUNCTION groupwise_get_name ##### -->
+<para>
+
+</para>
+
+ service:
+ brief:
+ Returns:
+
<!-- ##### FUNCTION groupwise_refresh_folder ##### -->
<para>
@@ -2416,6 +7514,31 @@ camel-types
@folder:
@ex:
+<!-- ##### FUNCTION groupwise_store_set_current_folder ##### -->
+<para>
+
+</para>
+
+ groupwise_store:
+ folder:
+
+<!-- ##### FUNCTION groupwise_summary_clear ##### -->
+<para>
+
+</para>
+
+ summary:
+ uncache:
+
+<!-- ##### FUNCTION gw_concat ##### -->
+<para>
+
+</para>
+
+ prefix:
+ suffix:
+ Returns:
+
<!-- ##### FUNCTION gw_get_path ##### -->
<para>
@@ -2425,6 +7548,274 @@ camel-types
@folder_name:
@Returns:
+<!-- ##### FUNCTION gw_store_reload_folder ##### -->
+<para>
+
+</para>
+
+ store:
+ folder:
+ flags:
+ ex:
+
+<!-- ##### FUNCTION gw_update_summary ##### -->
+<para>
+
+</para>
+
+ folder:
+ item_list:
+ ex:
+
+<!-- ##### FUNCTION imap_append_resyncing ##### -->
+<para>
+
+</para>
+
+ folder:
+ message:
+ info:
+ appended_uid:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION imap_concat ##### -->
+<para>
+
+</para>
+
+ imap_store:
+ prefix:
+ suffix:
+ Returns:
+
+<!-- ##### FUNCTION imap_create_flag_list ##### -->
+<para>
+
+</para>
+
+ flags:
+ info:
+ permanent_flags:
+ Returns:
+
+<!-- ##### FUNCTION imap_expunge_uids_resyncing ##### -->
+<para>
+
+</para>
+
+ folder:
+ uids:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION imap_is_atom ##### -->
+<para>
+
+</para>
+
+ in:
+ Returns:
+
+<!-- ##### FUNCTION imap_mailbox_decode ##### -->
+<para>
+
+</para>
+
+ in:
+ inlen:
+ Returns:
+
+<!-- ##### FUNCTION imap_mailbox_encode ##### -->
+<para>
+
+</para>
+
+ in:
+ inlen:
+ Returns:
+
+<!-- ##### FUNCTION imap_namespace_concat ##### -->
+<para>
+
+</para>
+
+ store:
+ name:
+ Returns:
+
+<!-- ##### FUNCTION imap_namespaces_destroy ##### -->
+<para>
+
+</para>
+
+ namespaces:
+
+<!-- ##### FUNCTION imap_next_word ##### -->
+<para>
+
+</para>
+
+ buf:
+ Returns:
+
+<!-- ##### MACRO imap_parse_astring ##### -->
+<para>
+
+</para>
+
+ str_p:
+ len_p:
+
+<!-- ##### FUNCTION imap_parse_body ##### -->
+<para>
+
+</para>
+
+ body_p:
+ folder:
+ ci:
+
+<!-- ##### FUNCTION imap_parse_flag_list ##### -->
+<para>
+
+</para>
+
+ flag_list_p:
+ flags_out:
+ custom_flags_out:
+ Returns:
+
+<!-- ##### FUNCTION imap_parse_folder_name ##### -->
+<para>
+
+</para>
+
+ store:
+ folder_name:
+ Returns:
+
+<!-- ##### FUNCTION imap_parse_list_response ##### -->
+<para>
+
+</para>
+
+ store:
+ buf:
+ flags:
+ sep:
+ folder:
+ Returns:
+
+<!-- ##### FUNCTION imap_parse_namespace_response ##### -->
+<para>
+
+</para>
+
+ response:
+ Returns:
+
+<!-- ##### MACRO imap_parse_nstring ##### -->
+<para>
+
+</para>
+
+ str_p:
+ len_p:
+
+<!-- ##### MACRO imap_parse_string ##### -->
+<para>
+
+</para>
+
+ str_p:
+ len_p:
+
+<!-- ##### FUNCTION imap_parse_string_generic ##### -->
+<para>
+
+</para>
+
+ str_p:
+ len:
+ type:
+ Returns:
+
+<!-- ##### FUNCTION imap_path_find_folders ##### -->
+<para>
+
+</para>
+
+ prefix:
+ callback:
+ data:
+ Returns:
+
+<!-- ##### FUNCTION imap_path_to_physical ##### -->
+<para>
+
+</para>
+
+ prefix:
+ vpath:
+ Returns:
+
+<!-- ##### FUNCTION imap_quote_string ##### -->
+<para>
+
+</para>
+
+ str:
+ Returns:
+
+<!-- ##### FUNCTION imap_skip_list ##### -->
+<para>
+
+</para>
+
+ str_p:
+
+<!-- ##### FUNCTION imap_transfer_resyncing ##### -->
+<para>
+
+</para>
+
+ source:
+ uids:
+ dest:
+ transferred_uids:
+ delete_originals:
+ ex:
+ Returns:
+
+<!-- ##### FUNCTION imap_uid_array_free ##### -->
+<para>
+
+</para>
+
+ arr:
+
+<!-- ##### FUNCTION imap_uid_array_to_set ##### -->
+<para>
+
+</para>
+
+ summary:
+ uids:
+ uid:
+ maxlen:
+ lastuid:
+ Returns:
+
+<!-- ##### FUNCTION imap_uid_set_to_array ##### -->
+<para>
+
+</para>
+
+ summary:
+ uids:
+ Returns:
+
<!-- ##### MACRO is_atom ##### -->
<para>
@@ -2468,3 +7859,254 @@ camel-types
@x:
+<!-- ##### STRUCT namespace ##### -->
+<para>
+
+</para>
+
+ next:
+ prefix:
+ delim:
+
+<!-- ##### STRUCT namespaces ##### -->
+<para>
+
+</para>
+
+ personal:
+ other:
+ shared:
+
+<!-- ##### MACRO pull ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO push ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION storage_path_lookup ##### -->
+<para>
+
+</para>
+
+ priv:
+ Returns:
+
+<!-- ##### FUNCTION string_equal ##### -->
+<para>
+
+</para>
+
+ a:
+ b:
+ Returns:
+
+<!-- ##### FUNCTION strip_lt_gt ##### -->
+<para>
+
+</para>
+
+ string:
+ s_offset:
+ e_offset:
+
+<!-- ##### FUNCTION test_address_compare ##### -->
+<para>
+
+</para>
+
+ addr:
+ addr2:
+
+<!-- ##### FUNCTION test_folder_basic ##### -->
+<para>
+
+</para>
+
+ session:
+ storename:
+ local:
+ spool:
+
+<!-- ##### FUNCTION test_folder_counts ##### -->
+<para>
+
+</para>
+
+ folder:
+ total:
+ unread:
+
+<!-- ##### FUNCTION test_folder_message ##### -->
+<para>
+
+</para>
+
+ folder:
+ uid:
+
+<!-- ##### FUNCTION test_folder_message_ops ##### -->
+<para>
+
+</para>
+
+ session:
+ storename:
+ local:
+ foldername:
+
+<!-- ##### FUNCTION test_folder_not_message ##### -->
+<para>
+
+</para>
+
+ folder:
+ uid:
+
+<!-- ##### MACRO test_free ##### -->
+<para>
+
+</para>
+
+ mem:
+
+<!-- ##### FUNCTION test_message_compare ##### -->
+<para>
+
+</para>
+
+ msg:
+ Returns:
+
+<!-- ##### FUNCTION test_message_compare_content ##### -->
+<para>
+
+</para>
+
+ dw:
+ text:
+ len:
+ Returns:
+
+<!-- ##### FUNCTION test_message_compare_header ##### -->
+<para>
+
+</para>
+
+ m1:
+ m2:
+ Returns:
+
+<!-- ##### FUNCTION test_message_compare_messages ##### -->
+<para>
+
+</para>
+
+ m1:
+ m2:
+ Returns:
+
+<!-- ##### FUNCTION test_message_create_simple ##### -->
+<para>
+
+</para>
+
+ void:
+ Returns:
+
+<!-- ##### FUNCTION test_message_dump_structure ##### -->
+<para>
+
+</para>
+
+ m:
+
+<!-- ##### FUNCTION test_message_info ##### -->
+<para>
+
+</para>
+
+ msg:
+ info:
+
+<!-- ##### FUNCTION test_message_read_file ##### -->
+<para>
+
+</para>
+
+ name:
+ Returns:
+
+<!-- ##### FUNCTION test_message_set_content_simple ##### -->
+<para>
+
+</para>
+
+ part:
+ how:
+ type:
+ text:
+ len:
+
+<!-- ##### FUNCTION test_message_write_file ##### -->
+<para>
+
+</para>
+
+ msg:
+ name:
+ Returns:
+
+<!-- ##### FUNCTION test_seekable_substream_readpart ##### -->
+<para>
+
+</para>
+
+ s:
+
+<!-- ##### FUNCTION test_seekable_substream_writepart ##### -->
+<para>
+
+</para>
+
+ s:
+ type:
+
+<!-- ##### FUNCTION test_stream_seekable_readpart ##### -->
+<para>
+
+</para>
+
+ s:
+
+<!-- ##### FUNCTION test_stream_seekable_writepart ##### -->
+<para>
+
+</para>
+
+ s:
+
+<!-- ##### STRUCT xover_header ##### -->
+<para>
+
+</para>
+
+ next:
+ name:
+ skip:
+ type:
+
+<!-- ##### ENUM xover_t ##### -->
+<para>
+
+</para>
+
+ XOVER_STRING:
+ XOVER_MSGID:
+ XOVER_SIZE:
+
diff --git a/docs/reference/camel/tmpl/camel-vee-folder.sgml b/docs/reference/camel/tmpl/camel-vee-folder.sgml
index 925e257..78d43b0 100644
--- a/docs/reference/camel/tmpl/camel-vee-folder.sgml
+++ b/docs/reference/camel/tmpl/camel-vee-folder.sgml
@@ -25,16 +25,6 @@ CamelVeeFolder
</para>
- parent:
- priv:
- expression:
- flags:
- changes:
- search:
- parent_vee_store:
- hashes:
- loaded:
- deleted:
<!-- ##### MACRO CAMEL_UNMATCHED_NAME ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-vee-store.sgml b/docs/reference/camel/tmpl/camel-vee-store.sgml
index 5863249..75f0f8a 100644
--- a/docs/reference/camel/tmpl/camel-vee-store.sgml
+++ b/docs/reference/camel/tmpl/camel-vee-store.sgml
@@ -25,9 +25,6 @@ CamelVeeStore
</para>
- parent:
- folder_unmatched:
- unmatched_uids:
<!-- ##### MACRO CAMEL_STORE_VEE_FOLDER_AUTO ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-vee-summary.sgml b/docs/reference/camel/tmpl/camel-vee-summary.sgml
index 958a7b7..67fc2ee 100644
--- a/docs/reference/camel/tmpl/camel-vee-summary.sgml
+++ b/docs/reference/camel/tmpl/camel-vee-summary.sgml
@@ -25,9 +25,6 @@ CamelVeeSummary
</para>
- summary:
- force_counts:
- fake_visible_count:
<!-- ##### STRUCT CamelVeeMessageInfo ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-vtrash-folder.sgml b/docs/reference/camel/tmpl/camel-vtrash-folder.sgml
index e509f3f..6093afe 100644
--- a/docs/reference/camel/tmpl/camel-vtrash-folder.sgml
+++ b/docs/reference/camel/tmpl/camel-vtrash-folder.sgml
@@ -39,9 +39,6 @@ CamelVTrashFolder
</para>
- parent:
- type:
- bit:
<!-- ##### ENUM camel_vtrash_folder_t ##### -->
<para>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]