summaryrefslogtreecommitdiff
path: root/camel
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-28 13:53:24 -0400
committerMatthew Barnes <mbarnes@redhat.com>2009-05-28 13:53:24 -0400
commitbc9eadf2dc10287359471e086b9808e81734c0a6 (patch)
treecd72f8ea4a7eea5aa3e470d1237ed90447e4e9d0 /camel
parentfc3021c2d35f1f3a20ba3dc589d52fe622e18cec (diff)
downloadevolution-data-server-bc9eadf2dc10287359471e086b9808e81734c0a6.tar.gz
Prefer GLib basic types over C types.
Diffstat (limited to 'camel')
-rw-r--r--camel/camel-address.c20
-rw-r--r--camel/camel-address.h18
-rw-r--r--camel/camel-arg.c26
-rw-r--r--camel/camel-arg.h30
-rw-r--r--camel/camel-block-file.c78
-rw-r--r--camel/camel-block-file.h44
-rw-r--r--camel/camel-certdb.c38
-rw-r--r--camel/camel-certdb.h32
-rw-r--r--camel/camel-charset-map-private.h630
-rw-r--r--camel/camel-charset-map.c68
-rw-r--r--camel/camel-charset-map.h12
-rw-r--r--camel/camel-cipher-context.c36
-rw-r--r--camel/camel-cipher-context.h44
-rw-r--r--camel/camel-data-cache.c42
-rw-r--r--camel/camel-data-cache.h32
-rw-r--r--camel/camel-data-wrapper.c14
-rw-r--r--camel/camel-data-wrapper.h14
-rw-r--r--camel/camel-db.c476
-rw-r--r--camel/camel-db.h138
-rw-r--r--camel/camel-debug.c18
-rw-r--r--camel/camel-debug.h6
-rw-r--r--camel/camel-digest-folder.c32
-rw-r--r--camel/camel-digest-store.c22
-rw-r--r--camel/camel-digest-store.h2
-rw-r--r--camel/camel-disco-diary.c28
-rw-r--r--camel/camel-disco-diary.h10
-rw-r--r--camel/camel-disco-folder.c40
-rw-r--r--camel/camel-disco-folder.h20
-rw-r--r--camel/camel-disco-store.c16
-rw-r--r--camel/camel-disco-store.h12
-rw-r--r--camel/camel-exception.c12
-rw-r--r--camel/camel-exception.h8
-rw-r--r--camel/camel-file-utils.c94
-rw-r--r--camel/camel-file-utils.h40
-rw-r--r--camel/camel-filter-driver.c236
-rw-r--r--camel/camel-filter-driver.h48
-rw-r--r--camel/camel-filter-search.c138
-rw-r--r--camel/camel-filter-search.h10
-rw-r--r--camel/camel-folder-search.c292
-rw-r--r--camel/camel-folder-search.h64
-rw-r--r--camel/camel-folder-summary.c490
-rw-r--r--camel/camel-folder-summary.h178
-rw-r--r--camel/camel-folder-thread.c72
-rw-r--r--camel/camel-folder-thread.h4
-rw-r--r--camel/camel-folder.c254
-rw-r--r--camel/camel-folder.h130
-rw-r--r--camel/camel-gpg-context.c262
-rw-r--r--camel/camel-html-parser.c60
-rw-r--r--camel/camel-html-parser.h10
-rw-r--r--camel/camel-http-stream.c58
-rw-r--r--camel/camel-http-stream.h16
-rw-r--r--camel/camel-iconv.c60
-rw-r--r--camel/camel-index-control.c30
-rw-r--r--camel/camel-index.c48
-rw-r--r--camel/camel-index.h62
-rw-r--r--camel/camel-internet-address.c100
-rw-r--r--camel/camel-internet-address.h12
-rw-r--r--camel/camel-junk-plugin.c4
-rw-r--r--camel/camel-junk-plugin.h10
-rw-r--r--camel/camel-list-utils.c12
-rw-r--r--camel/camel-list-utils.h8
-rw-r--r--camel/camel-lock-client.c42
-rw-r--r--camel/camel-lock-client.h4
-rw-r--r--camel/camel-lock-helper.c46
-rw-r--r--camel/camel-lock.c42
-rw-r--r--camel/camel-lock.h16
-rw-r--r--camel/camel-medium.c30
-rw-r--r--camel/camel-medium.h20
-rw-r--r--camel/camel-mime-filter-basic.c30
-rw-r--r--camel/camel-mime-filter-basic.h6
-rw-r--r--camel/camel-mime-filter-bestenc.c20
-rw-r--r--camel/camel-mime-filter-bestenc.h30
-rw-r--r--camel/camel-mime-filter-canon.c34
-rw-r--r--camel/camel-mime-filter-charset.c18
-rw-r--r--camel/camel-mime-filter-charset.h6
-rw-r--r--camel/camel-mime-filter-crlf.c22
-rw-r--r--camel/camel-mime-filter-enriched.c98
-rw-r--r--camel/camel-mime-filter-enriched.h4
-rw-r--r--camel/camel-mime-filter-from.c24
-rw-r--r--camel/camel-mime-filter-from.h2
-rw-r--r--camel/camel-mime-filter-gzip.c40
-rw-r--r--camel/camel-mime-filter-gzip.h4
-rw-r--r--camel/camel-mime-filter-html.c20
-rw-r--r--camel/camel-mime-filter-index.c6
-rw-r--r--camel/camel-mime-filter-linewrap.c22
-rw-r--r--camel/camel-mime-filter-linewrap.h6
-rw-r--r--camel/camel-mime-filter-pgp.c20
-rw-r--r--camel/camel-mime-filter-pgp.h2
-rw-r--r--camel/camel-mime-filter-progress.c8
-rw-r--r--camel/camel-mime-filter-save.c16
-rw-r--r--camel/camel-mime-filter-tohtml.c72
-rw-r--r--camel/camel-mime-filter-tohtml.h2
-rw-r--r--camel/camel-mime-filter-windows.c20
-rw-r--r--camel/camel-mime-filter-windows.h6
-rw-r--r--camel/camel-mime-filter-yenc.c66
-rw-r--r--camel/camel-mime-filter-yenc.h18
-rw-r--r--camel/camel-mime-filter.c36
-rw-r--r--camel/camel-mime-filter.h28
-rw-r--r--camel/camel-mime-message.c148
-rw-r--r--camel/camel-mime-message.h36
-rw-r--r--camel/camel-mime-parser.c196
-rw-r--r--camel/camel-mime-parser.h26
-rw-r--r--camel/camel-mime-part-utils.c12
-rw-r--r--camel/camel-mime-part.c104
-rw-r--r--camel/camel-mime-part.h38
-rw-r--r--camel/camel-mime-utils.c820
-rw-r--r--camel/camel-mime-utils.h156
-rw-r--r--camel/camel-movemail.c76
-rw-r--r--camel/camel-movemail.h2
-rw-r--r--camel/camel-msgport.c4
-rw-r--r--camel/camel-multipart-encrypted.c2
-rw-r--r--camel/camel-multipart-encrypted.h2
-rw-r--r--camel/camel-multipart-signed.c22
-rw-r--r--camel/camel-multipart-signed.h4
-rw-r--r--camel/camel-multipart.c26
-rw-r--r--camel/camel-multipart.h12
-rw-r--r--camel/camel-net-utils.c146
-rw-r--r--camel/camel-net-utils.h16
-rw-r--r--camel/camel-nntp-address.c34
-rw-r--r--camel/camel-nntp-address.h4
-rw-r--r--camel/camel-object.c236
-rw-r--r--camel/camel-object.h104
-rw-r--r--camel/camel-offline-folder.c26
-rw-r--r--camel/camel-offline-folder.h6
-rw-r--r--camel/camel-offline-journal.c12
-rw-r--r--camel/camel-offline-journal.h14
-rw-r--r--camel/camel-offline-store.c8
-rw-r--r--camel/camel-offline-store.h8
-rw-r--r--camel/camel-operation.c46
-rw-r--r--camel/camel-operation.h12
-rw-r--r--camel/camel-partition-table.c66
-rw-r--r--camel/camel-partition-table.h28
-rw-r--r--camel/camel-private.h12
-rw-r--r--camel/camel-process.c10
-rw-r--r--camel/camel-process.h4
-rw-r--r--camel/camel-provider.c18
-rw-r--r--camel/camel-provider.h34
-rw-r--r--camel/camel-sasl-anonymous.c2
-rw-r--r--camel/camel-sasl-anonymous.h4
-rw-r--r--camel/camel-sasl-cram-md5.c4
-rw-r--r--camel/camel-sasl-digest-md5.c124
-rw-r--r--camel/camel-sasl-gssapi.c10
-rw-r--r--camel/camel-sasl-kerberos4.c8
-rw-r--r--camel/camel-sasl-login.c2
-rw-r--r--camel/camel-sasl-ntlm.c70
-rw-r--r--camel/camel-sasl-popb4smtp.c2
-rw-r--r--camel/camel-sasl.c10
-rw-r--r--camel/camel-sasl.h10
-rw-r--r--camel/camel-search-private.c116
-rw-r--r--camel/camel-search-private.h14
-rw-r--r--camel/camel-search-sql-sexp.c108
-rw-r--r--camel/camel-search-sql-sexp.h2
-rw-r--r--camel/camel-search-sql.c104
-rw-r--r--camel/camel-search-sql.h2
-rw-r--r--camel/camel-seekable-stream.c8
-rw-r--r--camel/camel-seekable-stream.h2
-rw-r--r--camel/camel-seekable-substream.c8
-rw-r--r--camel/camel-service.c30
-rw-r--r--camel/camel-service.h16
-rw-r--r--camel/camel-session.c94
-rw-r--r--camel/camel-session.h96
-rw-r--r--camel/camel-smime-context.c58
-rw-r--r--camel/camel-smime-context.h2
-rw-r--r--camel/camel-store-summary.c86
-rw-r--r--camel/camel-store-summary.h42
-rw-r--r--camel/camel-store.c130
-rw-r--r--camel/camel-store.h74
-rw-r--r--camel/camel-stream-buffer.c64
-rw-r--r--camel/camel-stream-buffer.h20
-rw-r--r--camel/camel-stream-filter.c34
-rw-r--r--camel/camel-stream-filter.h4
-rw-r--r--camel/camel-stream-fs.c22
-rw-r--r--camel/camel-stream-fs.h10
-rw-r--r--camel/camel-stream-mem.c18
-rw-r--r--camel/camel-stream-mem.h8
-rw-r--r--camel/camel-stream-null.c10
-rw-r--r--camel/camel-stream-process.c28
-rw-r--r--camel/camel-stream-process.h4
-rw-r--r--camel/camel-stream-vfs.c14
-rw-r--r--camel/camel-stream-vfs.h2
-rw-r--r--camel/camel-stream.c28
-rw-r--r--camel/camel-stream.h26
-rw-r--r--camel/camel-string-utils.c64
-rw-r--r--camel/camel-string-utils.h18
-rw-r--r--camel/camel-tcp-stream-openssl.c102
-rw-r--r--camel/camel-tcp-stream-raw.c52
-rw-r--r--camel/camel-tcp-stream-raw.h4
-rw-r--r--camel/camel-tcp-stream-ssl.c108
-rw-r--r--camel/camel-tcp-stream-ssl.h6
-rw-r--r--camel/camel-tcp-stream.c14
-rw-r--r--camel/camel-tcp-stream.h12
-rw-r--r--camel/camel-text-index.c186
-rw-r--r--camel/camel-text-index.h10
-rw-r--r--camel/camel-transport.c4
-rw-r--r--camel/camel-trie.c30
-rw-r--r--camel/camel-uid-cache.c26
-rw-r--r--camel/camel-uid-cache.h10
-rw-r--r--camel/camel-url-scanner.c76
-rw-r--r--camel/camel-url-scanner.h24
-rw-r--r--camel/camel-url.c68
-rw-r--r--camel/camel-url.h56
-rw-r--r--camel/camel-utf8.c78
-rw-r--r--camel/camel-utf8.h16
-rw-r--r--camel/camel-vee-folder.c222
-rw-r--r--camel/camel-vee-folder.h20
-rw-r--r--camel/camel-vee-store.c44
-rw-r--r--camel/camel-vee-summary.c50
-rw-r--r--camel/camel-vee-summary.h4
-rw-r--r--camel/camel-vtrash-folder.c78
-rw-r--r--camel/camel-win32.c8
-rw-r--r--camel/camel.c12
-rw-r--r--camel/camel.h2
-rw-r--r--camel/db-scrap-tools/db.c42
-rw-r--r--camel/providers/groupwise/camel-groupwise-folder.c338
-rw-r--r--camel/providers/groupwise/camel-groupwise-folder.h8
-rw-r--r--camel/providers/groupwise/camel-groupwise-journal.c20
-rw-r--r--camel/providers/groupwise/camel-groupwise-journal.h12
-rw-r--r--camel/providers/groupwise/camel-groupwise-provider.c8
-rw-r--r--camel/providers/groupwise/camel-groupwise-store-summary.c76
-rw-r--r--camel/providers/groupwise/camel-groupwise-store-summary.h22
-rw-r--r--camel/providers/groupwise/camel-groupwise-store.c140
-rw-r--r--camel/providers/groupwise/camel-groupwise-store.h12
-rw-r--r--camel/providers/groupwise/camel-groupwise-summary.c32
-rw-r--r--camel/providers/groupwise/camel-groupwise-summary.h8
-rw-r--r--camel/providers/groupwise/camel-groupwise-transport.c16
-rw-r--r--camel/providers/groupwise/camel-groupwise-utils.c112
-rw-r--r--camel/providers/groupwise/camel-groupwise-utils.h14
-rw-r--r--camel/providers/hula/camel-hula-provider.c8
-rw-r--r--camel/providers/imap/camel-imap-command.c90
-rw-r--r--camel/providers/imap/camel-imap-command.h16
-rw-r--r--camel/providers/imap/camel-imap-folder.c412
-rw-r--r--camel/providers/imap/camel-imap-folder.h20
-rw-r--r--camel/providers/imap/camel-imap-journal.c32
-rw-r--r--camel/providers/imap/camel-imap-journal.h10
-rw-r--r--camel/providers/imap/camel-imap-message-cache.c86
-rw-r--r--camel/providers/imap/camel-imap-message-cache.h40
-rw-r--r--camel/providers/imap/camel-imap-provider.c8
-rw-r--r--camel/providers/imap/camel-imap-search.c56
-rw-r--r--camel/providers/imap/camel-imap-search.h4
-rw-r--r--camel/providers/imap/camel-imap-store-summary.c80
-rw-r--r--camel/providers/imap/camel-imap-store-summary.h24
-rw-r--r--camel/providers/imap/camel-imap-store.c274
-rw-r--r--camel/providers/imap/camel-imap-store.h8
-rw-r--r--camel/providers/imap/camel-imap-summary.c44
-rw-r--r--camel/providers/imap/camel-imap-summary.h6
-rw-r--r--camel/providers/imap/camel-imap-utils.c194
-rw-r--r--camel/providers/imap/camel-imap-utils.h46
-rw-r--r--camel/providers/imap/camel-imap-wrapper.c2
-rw-r--r--camel/providers/imap/camel-imap-wrapper.h6
-rw-r--r--camel/providers/imap4/camel-imap4-command.c60
-rw-r--r--camel/providers/imap4/camel-imap4-command.h34
-rw-r--r--camel/providers/imap4/camel-imap4-engine.c98
-rw-r--r--camel/providers/imap4/camel-imap4-engine.h48
-rw-r--r--camel/providers/imap4/camel-imap4-folder.c106
-rw-r--r--camel/providers/imap4/camel-imap4-folder.h12
-rw-r--r--camel/providers/imap4/camel-imap4-journal.c16
-rw-r--r--camel/providers/imap4/camel-imap4-journal.h8
-rw-r--r--camel/providers/imap4/camel-imap4-provider.c4
-rw-r--r--camel/providers/imap4/camel-imap4-search.c28
-rw-r--r--camel/providers/imap4/camel-imap4-search.h4
-rw-r--r--camel/providers/imap4/camel-imap4-specials.c8
-rw-r--r--camel/providers/imap4/camel-imap4-specials.h2
-rw-r--r--camel/providers/imap4/camel-imap4-store-summary.c14
-rw-r--r--camel/providers/imap4/camel-imap4-store-summary.h2
-rw-r--r--camel/providers/imap4/camel-imap4-store.c190
-rw-r--r--camel/providers/imap4/camel-imap4-store.h2
-rw-r--r--camel/providers/imap4/camel-imap4-stream.c42
-rw-r--r--camel/providers/imap4/camel-imap4-stream.h32
-rw-r--r--camel/providers/imap4/camel-imap4-summary.c102
-rw-r--r--camel/providers/imap4/camel-imap4-summary.h4
-rw-r--r--camel/providers/imap4/camel-imap4-utils.c64
-rw-r--r--camel/providers/imap4/camel-imap4-utils.h18
-rw-r--r--camel/providers/imapp/camel-imapp-driver.c54
-rw-r--r--camel/providers/imapp/camel-imapp-driver.h26
-rw-r--r--camel/providers/imapp/camel-imapp-engine.c134
-rw-r--r--camel/providers/imapp/camel-imapp-engine.h42
-rw-r--r--camel/providers/imapp/camel-imapp-exception.h2
-rw-r--r--camel/providers/imapp/camel-imapp-fetch-stream.c6
-rw-r--r--camel/providers/imapp/camel-imapp-fetch-stream.h2
-rw-r--r--camel/providers/imapp/camel-imapp-folder.c14
-rw-r--r--camel/providers/imapp/camel-imapp-folder.h4
-rw-r--r--camel/providers/imapp/camel-imapp-store-summary.c74
-rw-r--r--camel/providers/imapp/camel-imapp-store-summary.h24
-rw-r--r--camel/providers/imapp/camel-imapp-store.c88
-rw-r--r--camel/providers/imapp/camel-imapp-store.h2
-rw-r--r--camel/providers/imapp/camel-imapp-stream.c92
-rw-r--r--camel/providers/imapp/camel-imapp-stream.h30
-rw-r--r--camel/providers/imapp/camel-imapp-summary.c6
-rw-r--r--camel/providers/imapp/camel-imapp-utils.c94
-rw-r--r--camel/providers/imapp/camel-imapp-utils.h28
-rw-r--r--camel/providers/local/camel-local-folder.c50
-rw-r--r--camel/providers/local/camel-local-folder.h20
-rw-r--r--camel/providers/local/camel-local-private.c10
-rw-r--r--camel/providers/local/camel-local-private.h2
-rw-r--r--camel/providers/local/camel-local-provider.c18
-rw-r--r--camel/providers/local/camel-local-store.c74
-rw-r--r--camel/providers/local/camel-local-store.h6
-rw-r--r--camel/providers/local/camel-local-summary.c92
-rw-r--r--camel/providers/local/camel-local-summary.h32
-rw-r--r--camel/providers/local/camel-maildir-folder.c26
-rw-r--r--camel/providers/local/camel-maildir-folder.h2
-rw-r--r--camel/providers/local/camel-maildir-store.c62
-rw-r--r--camel/providers/local/camel-maildir-summary.c108
-rw-r--r--camel/providers/local/camel-maildir-summary.h8
-rw-r--r--camel/providers/local/camel-mbox-folder.c36
-rw-r--r--camel/providers/local/camel-mbox-folder.h4
-rw-r--r--camel/providers/local/camel-mbox-store.c94
-rw-r--r--camel/providers/local/camel-mbox-summary.c122
-rw-r--r--camel/providers/local/camel-mbox-summary.h12
-rw-r--r--camel/providers/local/camel-mh-folder.c18
-rw-r--r--camel/providers/local/camel-mh-folder.h2
-rw-r--r--camel/providers/local/camel-mh-store.c62
-rw-r--r--camel/providers/local/camel-mh-summary.c48
-rw-r--r--camel/providers/local/camel-mh-summary.h2
-rw-r--r--camel/providers/local/camel-spool-folder.c10
-rw-r--r--camel/providers/local/camel-spool-folder.h4
-rw-r--r--camel/providers/local/camel-spool-store.c62
-rw-r--r--camel/providers/local/camel-spool-summary.c22
-rw-r--r--camel/providers/local/camel-spool-summary.h16
-rw-r--r--camel/providers/nntp/camel-nntp-auth.c4
-rw-r--r--camel/providers/nntp/camel-nntp-auth.h2
-rw-r--r--camel/providers/nntp/camel-nntp-folder.c48
-rw-r--r--camel/providers/nntp/camel-nntp-folder.h6
-rw-r--r--camel/providers/nntp/camel-nntp-grouplist.c12
-rw-r--r--camel/providers/nntp/camel-nntp-grouplist.h2
-rw-r--r--camel/providers/nntp/camel-nntp-newsrc.c74
-rw-r--r--camel/providers/nntp/camel-nntp-newsrc.h18
-rw-r--r--camel/providers/nntp/camel-nntp-private.h2
-rw-r--r--camel/providers/nntp/camel-nntp-provider.c8
-rw-r--r--camel/providers/nntp/camel-nntp-store-summary.c60
-rw-r--r--camel/providers/nntp/camel-nntp-store-summary.h22
-rw-r--r--camel/providers/nntp/camel-nntp-store.c210
-rw-r--r--camel/providers/nntp/camel-nntp-store.h20
-rw-r--r--camel/providers/nntp/camel-nntp-stream.c36
-rw-r--r--camel/providers/nntp/camel-nntp-stream.h12
-rw-r--r--camel/providers/nntp/camel-nntp-summary.c50
-rw-r--r--camel/providers/nntp/camel-nntp-summary.h4
-rw-r--r--camel/providers/nntp/camel-nntp-utils.c48
-rw-r--r--camel/providers/nntp/test-newsrc.c4
-rw-r--r--camel/providers/pop3/camel-pop3-engine.c40
-rw-r--r--camel/providers/pop3/camel-pop3-engine.h18
-rw-r--r--camel/providers/pop3/camel-pop3-folder.c72
-rw-r--r--camel/providers/pop3/camel-pop3-folder.h6
-rw-r--r--camel/providers/pop3/camel-pop3-provider.c4
-rw-r--r--camel/providers/pop3/camel-pop3-store.c64
-rw-r--r--camel/providers/pop3/camel-pop3-store.h4
-rw-r--r--camel/providers/pop3/camel-pop3-stream.c38
-rw-r--r--camel/providers/pop3/camel-pop3-stream.h12
-rw-r--r--camel/providers/sendmail/camel-sendmail-transport.c12
-rw-r--r--camel/providers/smtp/camel-smtp-provider.c4
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c132
-rw-r--r--camel/tests/folder/test1.c10
-rw-r--r--camel/tests/folder/test10.c18
-rw-r--r--camel/tests/folder/test11.c10
-rw-r--r--camel/tests/folder/test2.c10
-rw-r--r--camel/tests/folder/test3.c38
-rw-r--r--camel/tests/folder/test4.c10
-rw-r--r--camel/tests/folder/test5.c10
-rw-r--r--camel/tests/folder/test6.c10
-rw-r--r--camel/tests/folder/test7.c10
-rw-r--r--camel/tests/folder/test8.c30
-rw-r--r--camel/tests/folder/test9.c20
-rw-r--r--camel/tests/lib/address-data.h10
-rw-r--r--camel/tests/lib/addresses.c6
-rw-r--r--camel/tests/lib/camel-test-provider.c6
-rw-r--r--camel/tests/lib/camel-test-provider.h2
-rw-r--r--camel/tests/lib/camel-test.c50
-rw-r--r--camel/tests/lib/camel-test.h18
-rw-r--r--camel/tests/lib/folders.c44
-rw-r--r--camel/tests/lib/folders.h10
-rw-r--r--camel/tests/lib/messages.c38
-rw-r--r--camel/tests/lib/messages.h14
-rw-r--r--camel/tests/lib/session.c2
-rw-r--r--camel/tests/lib/session.h2
-rw-r--r--camel/tests/lib/streams.c16
-rw-r--r--camel/tests/lib/streams.h2
-rw-r--r--camel/tests/message/test1.c18
-rw-r--r--camel/tests/message/test2.c22
-rw-r--r--camel/tests/message/test3.c2
-rw-r--r--camel/tests/message/test4.c12
-rw-r--r--camel/tests/mime-filter/test-charset.c14
-rw-r--r--camel/tests/mime-filter/test-crlf.c16
-rw-r--r--camel/tests/mime-filter/test-tohtml.c12
-rw-r--r--camel/tests/mime-filter/test1.c18
-rw-r--r--camel/tests/misc/rfc2047.c18
-rw-r--r--camel/tests/misc/split.c22
-rw-r--r--camel/tests/misc/test1.c10
-rw-r--r--camel/tests/misc/test2.c20
-rw-r--r--camel/tests/misc/url-scan.c10
-rw-r--r--camel/tests/misc/url.c14
-rw-r--r--camel/tests/misc/utf7.c20
-rw-r--r--camel/tests/smime/pgp-mime.c18
-rw-r--r--camel/tests/smime/pgp.c18
-rw-r--r--camel/tests/smime/pkcs7.c16
-rw-r--r--camel/tests/stream/test1.c10
-rw-r--r--camel/tests/stream/test2.c10
-rw-r--r--camel/tests/stream/test3.c4
397 files changed, 8944 insertions, 8944 deletions
diff --git a/camel/camel-address.c b/camel/camel-address.c
index bc9c0fdf6..30fa365a8 100644
--- a/camel/camel-address.c
+++ b/camel/camel-address.c
@@ -105,7 +105,7 @@ camel_address_new_clone (const CamelAddress *addr)
*
* Returns: the number of addresses contained in @addr
**/
-int
+gint
camel_address_length (CamelAddress *addr)
{
return addr->addresses->len;
@@ -121,8 +121,8 @@ camel_address_length (CamelAddress *addr)
*
* Returns: the number of addresses parsed or %-1 on fail
**/
-int
-camel_address_decode (CamelAddress *addr, const char *raw)
+gint
+camel_address_decode (CamelAddress *addr, const gchar *raw)
{
g_return_val_if_fail(CAMEL_IS_ADDRESS(addr), -1);
@@ -138,7 +138,7 @@ camel_address_decode (CamelAddress *addr, const char *raw)
*
* Returns: the encoded address
**/
-char *
+gchar *
camel_address_encode (CamelAddress *addr)
{
g_return_val_if_fail(CAMEL_IS_ADDRESS(addr), NULL);
@@ -157,8 +157,8 @@ camel_address_encode (CamelAddress *addr)
*
* Returns: the number of addresses parsed or %-1 on fail
**/
-int
-camel_address_unformat(CamelAddress *addr, const char *raw)
+gint
+camel_address_unformat(CamelAddress *addr, const gchar *raw)
{
g_return_val_if_fail(CAMEL_IS_ADDRESS(addr), -1);
@@ -174,7 +174,7 @@ camel_address_unformat(CamelAddress *addr, const char *raw)
*
* Returns: a newly allocated string containing the formatted addresses
**/
-char *
+gchar *
camel_address_format (CamelAddress *addr)
{
g_return_val_if_fail(CAMEL_IS_ADDRESS(addr), NULL);
@@ -193,7 +193,7 @@ camel_address_format (CamelAddress *addr)
*
* Returns: the number of addresses concatenated
**/
-int
+gint
camel_address_cat (CamelAddress *dest, const CamelAddress *source)
{
g_return_val_if_fail(CAMEL_IS_ADDRESS(dest), -1);
@@ -212,7 +212,7 @@ camel_address_cat (CamelAddress *dest, const CamelAddress *source)
*
* Returns: the number of addresses copied
**/
-int
+gint
camel_address_copy (CamelAddress *dest, const CamelAddress *source)
{
g_return_val_if_fail(CAMEL_IS_ADDRESS(dest), -1);
@@ -231,7 +231,7 @@ camel_address_copy (CamelAddress *dest, const CamelAddress *source)
* Remove an address by index, or all addresses.
**/
void
-camel_address_remove (CamelAddress *addr, int index)
+camel_address_remove (CamelAddress *addr, gint index)
{
g_return_if_fail(CAMEL_IS_ADDRESS(addr));
diff --git a/camel/camel-address.h b/camel/camel-address.h
index b4824d104..23e19687c 100644
--- a/camel/camel-address.h
+++ b/camel/camel-address.h
@@ -44,15 +44,15 @@ struct _CamelAddress {
struct _CamelAddressClass {
CamelObjectClass parent_class;
- int (*decode) (CamelAddress *, const char *raw);
- char *(*encode) (CamelAddress *);
+ gint (*decode) (CamelAddress *, const gchar *raw);
+ gchar *(*encode) (CamelAddress *);
- int (*unformat) (CamelAddress *, const char *raw);
- char *(*format) (CamelAddress *);
+ gint (*unformat) (CamelAddress *, const gchar *raw);
+ gchar *(*format) (CamelAddress *);
- int (*cat) (CamelAddress *, const CamelAddress *);
+ gint (*cat) (CamelAddress *, const CamelAddress *);
- void (*remove) (CamelAddress *, int index);
+ void (*remove) (CamelAddress *, gint index);
};
CamelType camel_address_get_type (void);
@@ -60,15 +60,15 @@ CamelAddress *camel_address_new (void);
CamelAddress *camel_address_new_clone (const CamelAddress *addr);
int camel_address_length (CamelAddress *addr);
-int camel_address_decode (CamelAddress *addr, const char *raw);
+int camel_address_decode (CamelAddress *addr, const gchar *raw);
char *camel_address_encode (CamelAddress *addr);
-int camel_address_unformat (CamelAddress *addr, const char *raw);
+int camel_address_unformat (CamelAddress *addr, const gchar *raw);
char *camel_address_format (CamelAddress *addr);
int camel_address_cat (CamelAddress *dest, const CamelAddress *source);
int camel_address_copy (CamelAddress *dest, const CamelAddress *source);
-void camel_address_remove (CamelAddress *addr, int index);
+void camel_address_remove (CamelAddress *addr, gint index);
G_END_DECLS
diff --git a/camel/camel-arg.c b/camel/camel-arg.c
index 81aa19c80..4c0af6c27 100644
--- a/camel/camel-arg.c
+++ b/camel/camel-arg.c
@@ -28,12 +28,12 @@
#include "camel-arg.h"
-int camel_argv_build(CamelArgV *tv)
+gint camel_argv_build(CamelArgV *tv)
{
register guint32 tag;
- register int i;
+ register gint i;
register CamelArg *a;
- int more = TRUE;
+ gint more = TRUE;
for (i=0;i<CAMEL_ARGV_MAX;i++) {
a = &tv->argv[i];
@@ -47,7 +47,7 @@ int camel_argv_build(CamelArgV *tv)
switch((tag & CAMEL_ARG_TYPE)) {
case CAMEL_ARG_OBJ:
- a->ca_object = va_arg(tv->ap, void *);
+ a->ca_object = va_arg(tv->ap, gpointer );
break;
case CAMEL_ARG_INT:
a->ca_int = va_arg(tv->ap, int);
@@ -56,10 +56,10 @@ int camel_argv_build(CamelArgV *tv)
a->ca_double = va_arg(tv->ap, double);
break;
case CAMEL_ARG_STR:
- a->ca_str = va_arg(tv->ap, char *);
+ a->ca_str = va_arg(tv->ap, gchar *);
break;
case CAMEL_ARG_PTR:
- a->ca_ptr = va_arg(tv->ap, void *);
+ a->ca_ptr = va_arg(tv->ap, gpointer );
break;
case CAMEL_ARG_BOO:
a->ca_int = va_arg(tv->ap, int) != 0;
@@ -77,12 +77,12 @@ fail:
return more;
}
-int camel_arggetv_build(CamelArgGetV *tv)
+gint camel_arggetv_build(CamelArgGetV *tv)
{
register guint32 tag;
- register int i;
+ register gint i;
register CamelArgGet *a;
- int more = TRUE;
+ gint more = TRUE;
for (i=0;i<CAMEL_ARGV_MAX;i++) {
a = &tv->argv[i];
@@ -96,12 +96,12 @@ int camel_arggetv_build(CamelArgGetV *tv)
switch((tag & CAMEL_ARG_TYPE)) {
case CAMEL_ARG_OBJ:
- a->ca_object = va_arg(tv->ap, void **);
+ a->ca_object = va_arg(tv->ap, gpointer *);
*a->ca_object = NULL;
break;
case CAMEL_ARG_INT:
case CAMEL_ARG_BOO:
- a->ca_int = va_arg(tv->ap, int *);
+ a->ca_int = va_arg(tv->ap, gint *);
*a->ca_int = 0;
break;
case CAMEL_ARG_DBL:
@@ -109,11 +109,11 @@ int camel_arggetv_build(CamelArgGetV *tv)
*a->ca_double = 0.0;
break;
case CAMEL_ARG_STR:
- a->ca_str = va_arg(tv->ap, char **);
+ a->ca_str = va_arg(tv->ap, gchar **);
*a->ca_str = NULL;
break;
case CAMEL_ARG_PTR:
- a->ca_ptr = va_arg(tv->ap, void **);
+ a->ca_ptr = va_arg(tv->ap, gpointer *);
*a->ca_ptr = NULL;
break;
default:
diff --git a/camel/camel-arg.h b/camel/camel-arg.h
index 09a129f2d..5bc1b4cf5 100644
--- a/camel/camel-arg.h
+++ b/camel/camel-arg.h
@@ -38,7 +38,7 @@ enum camel_arg_t {
CAMEL_ARG_TAG = 0x0fffffff, /* tag field for args */
CAMEL_ARG_OBJ = 0x00000000, /* object */
- CAMEL_ARG_INT = 0x10000000, /* int */
+ CAMEL_ARG_INT = 0x10000000, /* gint */
CAMEL_ARG_DBL = 0x20000000, /* double */
CAMEL_ARG_STR = 0x30000000, /* c string */
CAMEL_ARG_PTR = 0x40000000, /* ptr */
@@ -54,21 +54,21 @@ typedef struct _CamelArgGetV CamelArgGetV;
struct _CamelArg {
guint32 tag;
union {
- void *ca_object;
- int ca_int;
+ gpointer ca_object;
+ gint ca_int;
double ca_double;
- char *ca_str;
- void *ca_ptr;
+ gchar *ca_str;
+ gpointer ca_ptr;
} u;
};
struct _CamelArgGet {
guint32 tag;
union {
- void **ca_object;
- int *ca_int;
+ gpointer *ca_object;
+ gint *ca_int;
double *ca_double;
- char **ca_str;
- void **ca_ptr;
+ gchar **ca_str;
+ gpointer *ca_ptr;
} u;
};
#define ca_object u.ca_object
@@ -82,20 +82,20 @@ struct _CamelArgGet {
struct _CamelArgV {
va_list ap;
- int argc;
+ gint argc;
CamelArg argv[CAMEL_ARGV_MAX];
};
struct _CamelArgGetV {
va_list ap;
- int argc;
+ gint argc;
CamelArgGet argv[CAMEL_ARGV_MAX];
};
#define camel_argv_start(tv, last) va_start((tv)->ap, last)
#define camel_argv_end(tv) va_end((tv)->ap)
-int camel_argv_build(CamelArgV *tv);
-int camel_arggetv_build(CamelArgGetV *tv);
+gint camel_argv_build(CamelArgV *tv);
+gint camel_arggetv_build(CamelArgGetV *tv);
/* set an arg ignored */
#define camel_argv_ignore(tv, i) ((tv)->argv[i].tag = ((tv)->argv[i].tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE)
@@ -105,8 +105,8 @@ typedef struct _CamelProperty CamelProperty;
struct _CamelProperty {
guint32 tag;
- char *name;
- char *description;
+ gchar *name;
+ gchar *description;
};
G_END_DECLS
diff --git a/camel/camel-block-file.c b/camel/camel-block-file.c
index b2ffacae7..3939570f1 100644
--- a/camel/camel-block-file.c
+++ b/camel/camel-block-file.c
@@ -55,7 +55,7 @@ struct _CamelBlockFilePrivate {
pthread_mutex_t cache_lock; /* for refcounting, flag manip, cache manip */
pthread_mutex_t io_lock; /* for all io ops */
- unsigned int deleted:1;
+ guint deleted:1;
};
@@ -72,20 +72,20 @@ static pthread_mutex_t block_file_lock = PTHREAD_MUTEX_INITIALIZER;
static CamelDList block_file_list = CAMEL_DLIST_INITIALISER(block_file_list);
/* list to store block files that are actually intialised */
static CamelDList block_file_active_list = CAMEL_DLIST_INITIALISER(block_file_active_list);
-static int block_file_count = 0;
-static int block_file_threshhold = 10;
+static gint block_file_count = 0;
+static gint block_file_threshhold = 10;
#define CBF_CLASS(o) ((CamelBlockFileClass *)(((CamelObject *)o)->klass))
-static int sync_nolock(CamelBlockFile *bs);
-static int sync_block_nolock(CamelBlockFile *bs, CamelBlock *bl);
+static gint sync_nolock(CamelBlockFile *bs);
+static gint sync_block_nolock(CamelBlockFile *bs, CamelBlock *bl);
static int
block_file_validate_root(CamelBlockFile *bs)
{
CamelBlockRoot *br;
struct stat st;
- int retval;
+ gint retval;
br = bs->root;
@@ -152,7 +152,7 @@ camel_block_file_class_init(CamelBlockFileClass *klass)
}
static guint
-block_hash_func(const void *v)
+block_hash_func(gconstpointer v)
{
return ((camel_block_t) GPOINTER_TO_UINT(v)) >> CAMEL_BLOCK_SIZE_BITS;
}
@@ -263,7 +263,7 @@ block_file_use(CamelBlockFile *bs)
{
struct _CamelBlockFilePrivate *nw, *nn, *p = bs->priv;
CamelBlockFile *bf;
- int err;
+ gint err;
/* We want to:
remove file from active list
@@ -362,7 +362,7 @@ camel_cache_remove(c, key);
*
* Return value: The new block file, or NULL if it could not be created.
**/
-CamelBlockFile *camel_block_file_new(const char *path, int flags, const char version[8], size_t block_size)
+CamelBlockFile *camel_block_file_new(const gchar *path, gint flags, const gchar version[8], size_t block_size)
{
CamelBlockFile *bs;
@@ -404,12 +404,12 @@ CamelBlockFile *camel_block_file_new(const char *path, int flags, const char ver
return bs;
}
-int
-camel_block_file_rename(CamelBlockFile *bs, const char *path)
+gint
+camel_block_file_rename(CamelBlockFile *bs, const gchar *path)
{
- int ret;
+ gint ret;
struct stat st;
- int err;
+ gint err;
CAMEL_BLOCK_FILE_LOCK(bs, io_lock);
@@ -434,10 +434,10 @@ camel_block_file_rename(CamelBlockFile *bs, const char *path)
return ret;
}
-int
+gint
camel_block_file_delete(CamelBlockFile *bs)
{
- int ret;
+ gint ret;
struct _CamelBlockFilePrivate *p = bs->priv;
CAMEL_BLOCK_FILE_LOCK(bs, io_lock);
@@ -503,7 +503,7 @@ fail:
*
*
**/
-int camel_block_file_free_block(CamelBlockFile *bs, camel_block_t id)
+gint camel_block_file_free_block(CamelBlockFile *bs, camel_block_t id)
{
CamelBlock *bl;
@@ -563,7 +563,7 @@ CamelBlock *camel_block_file_get_block(CamelBlockFile *bs, camel_block_t id)
bl = g_malloc0(sizeof(*bl));
bl->id = id;
if (lseek(bs->fd, id, SEEK_SET) == -1 ||
- camel_read (bs->fd, (char *) bl->data, CAMEL_BLOCK_SIZE) == -1) {
+ camel_read (bs->fd, (gchar *) bl->data, CAMEL_BLOCK_SIZE) == -1) {
block_file_unuse(bs);
CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
g_free(bl);
@@ -712,7 +712,7 @@ static int
sync_nolock(CamelBlockFile *bs)
{
CamelBlock *bl, *bn;
- int work = FALSE;
+ gint work = FALSE;
bl = (CamelBlock *)bs->block_cache.head;
bn = bl->next;
@@ -749,9 +749,9 @@ sync_nolock(CamelBlockFile *bs)
*
* Return value: -1 on io error.
**/
-int camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl)
+gint camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl)
{
- int ret;
+ gint ret;
/* LOCK io_lock */
if (block_file_use(bs) == -1)
@@ -772,9 +772,9 @@ int camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl)
*
* Return value: -1 on io error.
**/
-int camel_block_file_sync(CamelBlockFile *bs)
+gint camel_block_file_sync(CamelBlockFile *bs)
{
- int ret;
+ gint ret;
CAMEL_BLOCK_FILE_LOCK(bs, root_lock);
CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
@@ -801,7 +801,7 @@ struct _CamelKeyFilePrivate {
struct _CamelKeyFile *base;
pthread_mutex_t lock;
- unsigned int deleted:1;
+ guint deleted:1;
};
#define CAMEL_KEY_FILE_LOCK(kf, lock) (pthread_mutex_lock(&(kf)->priv->lock))
@@ -813,8 +813,8 @@ static pthread_mutex_t key_file_lock = PTHREAD_MUTEX_INITIALIZER;
/* lru cache of block files */
static CamelDList key_file_list = CAMEL_DLIST_INITIALISER(key_file_list);
static CamelDList key_file_active_list = CAMEL_DLIST_INITIALISER(key_file_active_list);
-static int key_file_count = 0;
-static const int key_file_threshhold = 10;
+static gint key_file_count = 0;
+static const gint key_file_threshhold = 10;
static void
camel_key_file_class_init(CamelKeyFileClass *klass)
@@ -882,8 +882,8 @@ key_file_use(CamelKeyFile *bs)
{
struct _CamelKeyFilePrivate *nw, *nn, *p = bs->priv;
CamelKeyFile *bf;
- int err, fd;
- char *flag;
+ gint err, fd;
+ gchar *flag;
/* We want to:
remove file from active list
@@ -977,11 +977,11 @@ key_file_unuse(CamelKeyFile *bs)
* be opened/created/initialised.
**/
CamelKeyFile *
-camel_key_file_new(const char *path, int flags, const char version[8])
+camel_key_file_new(const gchar *path, gint flags, const gchar version[8])
{
CamelKeyFile *kf;
off_t last;
- int err;
+ gint err;
d(printf("New key file '%s'\n", path));
@@ -1018,12 +1018,12 @@ camel_key_file_new(const char *path, int flags, const char version[8])
return kf;
}
-int
-camel_key_file_rename(CamelKeyFile *kf, const char *path)
+gint
+camel_key_file_rename(CamelKeyFile *kf, const gchar *path)
{
- int ret;
+ gint ret;
struct stat st;
- int err;
+ gint err;
CAMEL_KEY_FILE_LOCK(kf, lock);
@@ -1048,10 +1048,10 @@ camel_key_file_rename(CamelKeyFile *kf, const char *path)
return ret;
}
-int
+gint
camel_key_file_delete(CamelKeyFile *kf)
{
- int ret;
+ gint ret;
struct _CamelKeyFilePrivate *p = kf->priv;
CAMEL_KEY_FILE_LOCK(kf, lock);
@@ -1084,12 +1084,12 @@ camel_key_file_delete(CamelKeyFile *kf)
*
* Return value: -1 on io error. The key file will remain unchanged.
**/
-int
+gint
camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_key_t *records)
{
camel_block_t next;
guint32 size;
- int ret = -1;
+ gint ret = -1;
d(printf("write key %08x len = %d\n", *parent, len));
@@ -1139,13 +1139,13 @@ camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_
*
* Return value: -1 on io error.
**/
-int
+gint
camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, size_t *len, camel_key_t **records)
{
guint32 size;
long pos = *start;
camel_block_t next;
- int ret = -1;
+ gint ret = -1;
if (pos == 0)
return 0;
diff --git a/camel/camel-block-file.h b/camel/camel-block-file.h
index aa64d9186..244e80841 100644
--- a/camel/camel-block-file.h
+++ b/camel/camel-block-file.h
@@ -46,7 +46,7 @@ typedef struct _CamelBlockFileClass CamelBlockFileClass;
#define CAMEL_BLOCK_DETACHED (1<<1)
struct _CamelBlockRoot {
- char version[8]; /* version number */
+ gchar version[8]; /* version number */
guint32 flags; /* flags for file */
guint32 block_size; /* block size of this file */
@@ -66,7 +66,7 @@ struct _CamelBlock {
guint32 refcount;
guint32 align00;
- unsigned char data[CAMEL_BLOCK_SIZE];
+ guchar data[CAMEL_BLOCK_SIZE];
};
struct _CamelBlockFile {
@@ -74,19 +74,19 @@ struct _CamelBlockFile {
struct _CamelBlockFilePrivate *priv;
- char version[8];
- char *path;
- int flags;
+ gchar version[8];
+ gchar *path;
+ gint flags;
- int fd;
+ gint fd;
size_t block_size;
CamelBlockRoot *root;
CamelBlock *root_block;
/* make private? */
- int block_cache_limit;
- int block_cache_count;
+ gint block_cache_limit;
+ gint block_cache_count;
CamelDList block_cache;
GHashTable *blocks;
};
@@ -94,25 +94,25 @@ struct _CamelBlockFile {
struct _CamelBlockFileClass {
CamelObjectClass parent;
- int (*validate_root)(CamelBlockFile *);
- int (*init_root)(CamelBlockFile *);
+ gint (*validate_root)(CamelBlockFile *);
+ gint (*init_root)(CamelBlockFile *);
};
CamelType camel_block_file_get_type(void);
-CamelBlockFile *camel_block_file_new(const char *path, int flags, const char version[8], size_t block_size);
-int camel_block_file_rename(CamelBlockFile *bs, const char *path);
-int camel_block_file_delete(CamelBlockFile *kf);
+CamelBlockFile *camel_block_file_new(const gchar *path, gint flags, const gchar version[8], size_t block_size);
+gint camel_block_file_rename(CamelBlockFile *bs, const gchar *path);
+gint camel_block_file_delete(CamelBlockFile *kf);
CamelBlock *camel_block_file_new_block(CamelBlockFile *bs);
-int camel_block_file_free_block(CamelBlockFile *bs, camel_block_t id);
+gint camel_block_file_free_block(CamelBlockFile *bs, camel_block_t id);
CamelBlock *camel_block_file_get_block(CamelBlockFile *bs, camel_block_t id);
void camel_block_file_detach_block(CamelBlockFile *bs, CamelBlock *bl);
void camel_block_file_attach_block(CamelBlockFile *bs, CamelBlock *bl);
void camel_block_file_touch_block(CamelBlockFile *bs, CamelBlock *bl);
void camel_block_file_unref_block(CamelBlockFile *bs, CamelBlock *bl);
-int camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl);
-int camel_block_file_sync(CamelBlockFile *bs);
+gint camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl);
+gint camel_block_file_sync(CamelBlockFile *bs);
/* ********************************************************************** */
@@ -125,8 +125,8 @@ struct _CamelKeyFile {
struct _CamelKeyFilePrivate *priv;
FILE *fp;
- char *path;
- int flags;
+ gchar *path;
+ gint flags;
off_t last;
};
@@ -136,12 +136,12 @@ struct _CamelKeyFileClass {
CamelType camel_key_file_get_type(void);
-CamelKeyFile * camel_key_file_new(const char *path, int flags, const char version[8]);
-int camel_key_file_rename(CamelKeyFile *kf, const char *path);
+CamelKeyFile * camel_key_file_new(const gchar *path, gint flags, const gchar version[8]);
+int camel_key_file_rename(CamelKeyFile *kf, const gchar *path);
int camel_key_file_delete(CamelKeyFile *kf);
-int camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_key_t *records);
-int camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, size_t *len, camel_key_t **records);
+gint camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_key_t *records);
+gint camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, size_t *len, camel_key_t **records);
G_END_DECLS
diff --git a/camel/camel-certdb.c b/camel/camel-certdb.c
index e2a9179a4..7a571de71 100644
--- a/camel/camel-certdb.c
+++ b/camel/camel-certdb.c
@@ -51,15 +51,15 @@ static void camel_certdb_class_init (CamelCertDBClass *klass);
static void camel_certdb_init (CamelCertDB *certdb);
static void camel_certdb_finalize (CamelObject *obj);
-static int certdb_header_load (CamelCertDB *certdb, FILE *istream);
-static int certdb_header_save (CamelCertDB *certdb, FILE *ostream);
+static gint certdb_header_load (CamelCertDB *certdb, FILE *istream);
+static gint certdb_header_save (CamelCertDB *certdb, FILE *ostream);
static CamelCert *certdb_cert_load (CamelCertDB *certdb, FILE *istream);
-static int certdb_cert_save (CamelCertDB *certdb, CamelCert *cert, FILE *ostream);
+static gint certdb_cert_save (CamelCertDB *certdb, CamelCert *cert, FILE *ostream);
static CamelCert *certdb_cert_new (CamelCertDB *certdb);
static void certdb_cert_free (CamelCertDB *certdb, CamelCert *cert);
-static const char *cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string);
-static void cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *value);
+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;
@@ -199,7 +199,7 @@ camel_certdb_get_default (void)
void
-camel_certdb_set_filename (CamelCertDB *certdb, const char *filename)
+camel_certdb_set_filename (CamelCertDB *certdb, const gchar *filename)
{
g_return_if_fail (CAMEL_IS_CERTDB (certdb));
g_return_if_fail (filename != NULL);
@@ -251,12 +251,12 @@ certdb_cert_load (CamelCertDB *certdb, FILE *istream)
return NULL;
}
-int
+gint
camel_certdb_load (CamelCertDB *certdb)
{
CamelCert *cert;
FILE *in;
- int i;
+ gint i;
g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), -1);
g_return_val_if_fail (certdb->filename, -1);
@@ -326,12 +326,12 @@ certdb_cert_save (CamelCertDB *certdb, CamelCert *cert, FILE *ostream)
return 0;
}
-int
+gint
camel_certdb_save (CamelCertDB *certdb)
{
CamelCert *cert;
- char *filename;
- int fd, i;
+ gchar *filename;
+ gint fd, i;
FILE *out;
g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), -1);
@@ -421,7 +421,7 @@ camel_certdb_touch (CamelCertDB *certdb)
}
CamelCert *
-camel_certdb_get_cert (CamelCertDB *certdb, const char *fingerprint)
+camel_certdb_get_cert (CamelCertDB *certdb, const gchar *fingerprint)
{
CamelCert *cert;
@@ -562,7 +562,7 @@ void
camel_certdb_clear (CamelCertDB *certdb)
{
CamelCert *cert;
- int i;
+ gint i;
g_return_if_fail (CAMEL_IS_CERTDB (certdb));
@@ -582,8 +582,8 @@ camel_certdb_clear (CamelCertDB *certdb)
}
-static const char *
-cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string)
+static const gchar *
+cert_get_string (CamelCertDB *certdb, CamelCert *cert, gint string)
{
switch (string) {
case CAMEL_CERT_STRING_ISSUER:
@@ -600,8 +600,8 @@ cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string)
}
-const char *
-camel_cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string)
+const gchar *
+camel_cert_get_string (CamelCertDB *certdb, CamelCert *cert, gint string)
{
g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), NULL);
g_return_val_if_fail (cert != NULL, NULL);
@@ -612,7 +612,7 @@ camel_cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string)
}
static void
-cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *value)
+cert_set_string (CamelCertDB *certdb, CamelCert *cert, gint string, const gchar *value)
{
switch (string) {
case CAMEL_CERT_STRING_ISSUER:
@@ -638,7 +638,7 @@ cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *v
void
-camel_cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *value)
+camel_cert_set_string (CamelCertDB *certdb, CamelCert *cert, gint string, const gchar *value)
{
g_return_if_fail (CAMEL_IS_CERTDB (certdb));
g_return_if_fail (cert != NULL);
diff --git a/camel/camel-certdb.h b/camel/camel-certdb.h
index 831bbff5c..8acd8e4f5 100644
--- a/camel/camel-certdb.h
+++ b/camel/camel-certdb.h
@@ -59,10 +59,10 @@ typedef enum {
typedef struct {
guint32 refcount;
- char *issuer;
- char *subject;
- char *hostname;
- char *fingerprint;
+ gchar *issuer;
+ gchar *subject;
+ gchar *hostname;
+ gchar *fingerprint;
CamelCertTrust trust;
GByteArray *rawcert;
@@ -72,7 +72,7 @@ struct _CamelCertDB {
CamelObject parent_object;
struct _CamelCertDBPrivate *priv;
- char *filename;
+ gchar *filename;
guint32 version;
guint32 saved_certs;
guint32 flags;
@@ -88,17 +88,17 @@ struct _CamelCertDB {
struct _CamelCertDBClass {
CamelObjectClass parent_class;
- int (*header_load) (CamelCertDB *certdb, FILE *istream);
- int (*header_save) (CamelCertDB *certdb, FILE *ostream);
+ gint (*header_load) (CamelCertDB *certdb, FILE *istream);
+ gint (*header_save) (CamelCertDB *certdb, FILE *ostream);
CamelCert * (*cert_load) (CamelCertDB *certdb, FILE *istream);
- int (*cert_save) (CamelCertDB *certdb, CamelCert *cert, FILE *ostream);
+ gint (*cert_save) (CamelCertDB *certdb, CamelCert *cert, FILE *ostream);
CamelCert * (*cert_new) (CamelCertDB *certdb);
void (*cert_free) (CamelCertDB *certdb, CamelCert *cert);
- const char * (*cert_get_string) (CamelCertDB *certdb, CamelCert *cert, int string);
- void (*cert_set_string) (CamelCertDB *certdb, CamelCert *cert, int string, const char *value);
+ const gchar * (*cert_get_string) (CamelCertDB *certdb, CamelCert *cert, gint string);
+ void (*cert_set_string) (CamelCertDB *certdb, CamelCert *cert, gint string, const gchar *value);
};
@@ -109,14 +109,14 @@ CamelCertDB *camel_certdb_new (void);
void camel_certdb_set_default (CamelCertDB *certdb);
CamelCertDB *camel_certdb_get_default (void);
-void camel_certdb_set_filename (CamelCertDB *certdb, const char *filename);
+void camel_certdb_set_filename (CamelCertDB *certdb, const gchar *filename);
-int camel_certdb_load (CamelCertDB *certdb);
-int camel_certdb_save (CamelCertDB *certdb);
+gint camel_certdb_load (CamelCertDB *certdb);
+gint camel_certdb_save (CamelCertDB *certdb);
void camel_certdb_touch (CamelCertDB *certdb);
-CamelCert *camel_certdb_get_cert (CamelCertDB *certdb, const char *fingerprint);
+CamelCert *camel_certdb_get_cert (CamelCertDB *certdb, const gchar *fingerprint);
void camel_certdb_add (CamelCertDB *certdb, CamelCert *cert);
void camel_certdb_remove (CamelCertDB *certdb, CamelCert *cert);
@@ -128,8 +128,8 @@ void camel_certdb_cert_unref (CamelCertDB *certdb, CamelCert *cert);
void camel_certdb_clear (CamelCertDB *certdb);
-const char *camel_cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string);
-void camel_cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *value);
+const gchar *camel_cert_get_string (CamelCertDB *certdb, CamelCert *cert, gint string);
+void camel_cert_set_string (CamelCertDB *certdb, CamelCert *cert, gint string, const gchar *value);
#define camel_cert_get_issuer(certdb,cert) camel_cert_get_string (certdb, cert, CAMEL_CERT_STRING_ISSUER)
#define camel_cert_get_subject(certdb,cert) camel_cert_get_string (certdb, cert, CAMEL_CERT_STRING_SUBJECT)
diff --git a/camel/camel-charset-map-private.h b/camel/camel-charset-map-private.h
index 72a728f14..80fd9fc7e 100644
--- a/camel/camel-charset-map-private.h
+++ b/camel/camel-charset-map-private.h
@@ -1,6 +1,6 @@
/* This file is automatically generated: DO NOT EDIT */
-static unsigned char m000[256] = {
+static guchar m000[256] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@@ -35,7 +35,7 @@ static unsigned char m000[256] = {
0x02, 0x00, 0x03, 0x02, 0x03, 0x01, 0x00, 0x00,
};
-static unsigned char m001[256] = {
+static guchar m001[256] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@@ -70,7 +70,7 @@ static unsigned char m001[256] = {
0xf7, 0xf5, 0xf5, 0xf5, 0xf7, 0xf4, 0xf4, 0xf5,
};
-static unsigned char m002[256] = {
+static guchar m002[256] = {
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
@@ -105,7 +105,7 @@ static unsigned char m002[256] = {
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
};
-static unsigned char m010[256] = {
+static guchar m010[256] = {
0x02, 0x02, 0x01, 0x01, 0x03, 0x03, 0x01, 0x01,
0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x01, 0x01,
0x03, 0x03, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02,
@@ -140,7 +140,7 @@ static unsigned char m010[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m011[256] = {
+static guchar m011[256] = {
0xf2, 0xf2, 0xf0, 0xf0, 0xf2, 0xf2, 0xf2, 0xf2,
0xf0, 0xf0, 0xf0, 0xf0, 0xf2, 0xf2, 0xf0, 0xf0,
0xf0, 0xf0, 0xf2, 0xf2, 0xf0, 0xf0, 0xf2, 0xf2,
@@ -177,7 +177,7 @@ static unsigned char m011[256] = {
#define m012 m002
-static unsigned char m020[256] = {
+static guchar m020[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -212,7 +212,7 @@ static unsigned char m020[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m021[256] = {
+static guchar m021[256] = {
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
@@ -249,7 +249,7 @@ static unsigned char m021[256] = {
#define m022 m002
-static unsigned char m030[256] = {
+static guchar m030[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -288,7 +288,7 @@ static unsigned char m030[256] = {
#define m032 m002
-static unsigned char m040[256] = {
+static guchar m040[256] = {
0x00, 0x1c, 0x10, 0x10, 0x18, 0x10, 0x18, 0x18,
0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10,
0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
@@ -323,7 +323,7 @@ static unsigned char m040[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m041[256] = {
+static guchar m041[256] = {
0xf0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8,
0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0, 0xf8, 0xf8,
0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8,
@@ -360,7 +360,7 @@ static unsigned char m041[256] = {
#define m042 m002
-static unsigned char m050[256] = {
+static guchar m050[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -399,7 +399,7 @@ static unsigned char m050[256] = {
#define m052 m002
-static unsigned char m060[256] = {
+static guchar m060[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -514,7 +514,7 @@ static unsigned char m060[256] = {
#define m192 m002
-static unsigned char m1a1[256] = {
+static guchar m1a1[256] = {
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
@@ -551,7 +551,7 @@ static unsigned char m1a1[256] = {
#define m1a2 m002
-static unsigned char m1b1[256] = {
+static guchar m1b1[256] = {
0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0,
0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0,
0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0,
@@ -588,7 +588,7 @@ static unsigned char m1b1[256] = {
#define m1b2 m002
-static unsigned char m1c1[256] = {
+static guchar m1c1[256] = {
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
@@ -627,7 +627,7 @@ static unsigned char m1c1[256] = {
#define m1d1 m1c1
-static unsigned char m1d2[256] = {
+static guchar m1d2[256] = {
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0d, 0x0d, 0x0d,
@@ -664,7 +664,7 @@ static unsigned char m1d2[256] = {
#define m1e1 m1c1
-static unsigned char m1e2[256] = {
+static guchar m1e2[256] = {
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,
@@ -703,7 +703,7 @@ static unsigned char m1e2[256] = {
#define m1f2 m1e2
-static unsigned char m200[256] = {
+static guchar m200[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x80,
@@ -738,7 +738,7 @@ static unsigned char m200[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m201[256] = {
+static guchar m201[256] = {
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xf0, 0xc0, 0xc0, 0xc8, 0xc8, 0xf0, 0xf0, 0xc0,
@@ -773,7 +773,7 @@ static unsigned char m201[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m202[256] = {
+static guchar m202[256] = {
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0f, 0x0f, 0x0d,
@@ -808,7 +808,7 @@ static unsigned char m202[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m210[256] = {
+static guchar m210[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
@@ -843,7 +843,7 @@ static unsigned char m210[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m211[256] = {
+static guchar m211[256] = {
0x40, 0x40, 0x40, 0xf0, 0x40, 0x40, 0x40, 0x40,
0x40, 0xc0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0xc0, 0x40, 0x40, 0xc8, 0x40,
@@ -878,7 +878,7 @@ static unsigned char m211[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m212[256] = {
+static guchar m212[256] = {
0x0c, 0x0c, 0x0c, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0d, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0f, 0x0c,
@@ -913,7 +913,7 @@ static unsigned char m212[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m220[256] = {
+static guchar m220[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -948,7 +948,7 @@ static unsigned char m220[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m221[256] = {
+static guchar m221[256] = {
0xf0, 0x40, 0xf0, 0xf0, 0x40, 0x40, 0x40, 0xf0,
0xf0, 0x40, 0x40, 0xf0, 0x40, 0x40, 0x40, 0xc0,
0x40, 0xc0, 0x70, 0x40, 0x40, 0x40, 0x40, 0x40,
@@ -983,7 +983,7 @@ static unsigned char m221[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m222[256] = {
+static guchar m222[256] = {
0x0d, 0x0c, 0x0d, 0x0d, 0x0c, 0x0c, 0x0c, 0x0d,
0x0f, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, 0x0f,
0x0c, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -1018,7 +1018,7 @@ static unsigned char m222[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m230[256] = {
+static guchar m230[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1053,7 +1053,7 @@ static unsigned char m230[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m231[256] = {
+static guchar m231[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0xf0, 0x40, 0x40, 0x40, 0x40, 0x40,
@@ -1088,7 +1088,7 @@ static unsigned char m231[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m232[256] = {
+static guchar m232[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -1123,7 +1123,7 @@ static unsigned char m232[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m241[256] = {
+static guchar m241[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
@@ -1158,7 +1158,7 @@ static unsigned char m241[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m242[256] = {
+static guchar m242[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -1193,7 +1193,7 @@ static unsigned char m242[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m250[256] = {
+static guchar m250[256] = {
0x0c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
@@ -1228,7 +1228,7 @@ static unsigned char m250[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m251[256] = {
+static guchar m251[256] = {
0xf0, 0xf0, 0xf0, 0xf0, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0xf0, 0xc0, 0xc0, 0xf0,
0xf0, 0xc0, 0xc0, 0xf0, 0xf0, 0xc0, 0xc0, 0xf0,
@@ -1263,7 +1263,7 @@ static unsigned char m251[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m252[256] = {
+static guchar m252[256] = {
0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0e, 0x0e, 0x0e,
0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
@@ -1298,7 +1298,7 @@ static unsigned char m252[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m261[256] = {
+static guchar m261[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0xf0, 0xf0, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0xc0,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
@@ -1333,7 +1333,7 @@ static unsigned char m261[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m262[256] = {
+static guchar m262[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0f, 0x0f, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0d, 0x0d,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -1368,7 +1368,7 @@ static unsigned char m262[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m271[256] = {
+static guchar m271[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
@@ -1403,7 +1403,7 @@ static unsigned char m271[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m272[256] = {
+static guchar m272[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -1470,7 +1470,7 @@ static unsigned char m272[256] = {
#define m2f2 m272
-static unsigned char m301[256] = {
+static guchar m301[256] = {
0xf0, 0xf0, 0xf0, 0xf0, 0x40, 0x70, 0x70, 0x70,
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0x70, 0xf0, 0xf0, 0xf0, 0x40, 0x40,
@@ -1505,7 +1505,7 @@ static unsigned char m301[256] = {
0x40, 0x40, 0x40, 0x70, 0x70, 0x70, 0x70, 0x40,
};
-static unsigned char m302[256] = {
+static guchar m302[256] = {
0x0f, 0x0f, 0x0f, 0x0f, 0x0c, 0x0e, 0x0c, 0x0c,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0c, 0x0f, 0x0f, 0x0f, 0x0e, 0x0e,
@@ -1540,7 +1540,7 @@ static unsigned char m302[256] = {
0x0c, 0x0c, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m311[256] = {
+static guchar m311[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
@@ -1575,7 +1575,7 @@ static unsigned char m311[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
};
-static unsigned char m312[256] = {
+static guchar m312[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0e, 0x0e, 0x0e,
0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e,
0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e,
@@ -1610,7 +1610,7 @@ static unsigned char m312[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m321[256] = {
+static guchar m321[256] = {
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
@@ -1645,7 +1645,7 @@ static unsigned char m321[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m322[256] = {
+static guchar m322[256] = {
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,
0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d,
@@ -1680,7 +1680,7 @@ static unsigned char m322[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m331[256] = {
+static guchar m331[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1715,7 +1715,7 @@ static unsigned char m331[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m332[256] = {
+static guchar m332[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -1754,7 +1754,7 @@ static unsigned char m332[256] = {
#define m352 m272
-static unsigned char m362[256] = {
+static guchar m362[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -1789,7 +1789,7 @@ static unsigned char m362[256] = {
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
};
-static unsigned char m372[256] = {
+static guchar m372[256] = {
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
@@ -1868,7 +1868,7 @@ static unsigned char m372[256] = {
#define m4d2 m372
-static unsigned char m4e1[256] = {
+static guchar m4e1[256] = {
0xf0, 0xf0, 0x40, 0xf0, 0x40, 0x40, 0x00, 0xf0,
0xf0, 0xf0, 0xf0, 0xf0, 0x40, 0xf0, 0x70, 0x00,
0x70, 0xf0, 0x40, 0x00, 0xf0, 0xf0, 0xf0, 0x70,
@@ -1903,7 +1903,7 @@ static unsigned char m4e1[256] = {
0x00, 0x00, 0x00, 0xf0, 0x00, 0x40, 0x40, 0x40,
};
-static unsigned char m4e2[256] = {
+static guchar m4e2[256] = {
0x0f, 0x0f, 0x08, 0x0f, 0x08, 0x08, 0x08, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0f, 0x0e, 0x0c,
0x0e, 0x0f, 0x08, 0x0a, 0x0f, 0x0f, 0x0f, 0x08,
@@ -1938,7 +1938,7 @@ static unsigned char m4e2[256] = {
0x08, 0x08, 0x08, 0x0f, 0x08, 0x0e, 0x08, 0x0e,
};
-static unsigned char m4f1[256] = {
+static guchar m4f1[256] = {
0x40, 0xf0, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00,
0x40, 0xf0, 0xf0, 0xc0, 0x40, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0x40, 0x00, 0x00, 0x40, 0x40, 0x40,
@@ -1973,7 +1973,7 @@ static unsigned char m4f1[256] = {
0xf0, 0x00, 0xf0, 0x00, 0x40, 0x40, 0x70, 0x40,
};
-static unsigned char m4f2[256] = {
+static guchar m4f2[256] = {
0x0c, 0x0f, 0x0c, 0x08, 0x0c, 0x0c, 0x08, 0x08,
0x0c, 0x0f, 0x0f, 0x0d, 0x08, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x0a,
@@ -2008,7 +2008,7 @@ static unsigned char m4f2[256] = {
0x0f, 0x08, 0x0f, 0x08, 0x08, 0x08, 0x0e, 0x08,
};
-static unsigned char m501[256] = {
+static guchar m501[256] = {
0x40, 0x40, 0x80, 0x00, 0x40, 0x70, 0xf0, 0x40,
0x00, 0xf0, 0x40, 0xf0, 0x40, 0xf0, 0x40, 0x70,
0x40, 0xf0, 0xf0, 0x40, 0x70, 0x00, 0xf0, 0x40,
@@ -2043,7 +2043,7 @@ static unsigned char m501[256] = {
0x00, 0xf0, 0x40, 0xf0, 0x00, 0x00, 0x40, 0x80,
};
-static unsigned char m502[256] = {
+static guchar m502[256] = {
0x0c, 0x08, 0x09, 0x08, 0x08, 0x0c, 0x0d, 0x0c,
0x08, 0x0d, 0x08, 0x0d, 0x0e, 0x0f, 0x0c, 0x0e,
0x08, 0x0d, 0x0f, 0x0c, 0x0e, 0x0c, 0x0d, 0x0c,
@@ -2078,7 +2078,7 @@ static unsigned char m502[256] = {
0x0c, 0x0d, 0x08, 0x0f, 0x08, 0x0c, 0x0c, 0x0d,
};
-static unsigned char m511[256] = {
+static guchar m511[256] = {
0xf0, 0xf0, 0x70, 0x40, 0xf0, 0x00, 0xc0, 0x40,
0x40, 0xf0, 0x00, 0x40, 0x40, 0x40, 0x40, 0x00,
0x40, 0x00, 0xf0, 0x00, 0x70, 0x70, 0x70, 0x40,
@@ -2113,7 +2113,7 @@ static unsigned char m511[256] = {
0xf0, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0x70, 0x00,
};
-static unsigned char m512[256] = {
+static guchar m512[256] = {
0x0d, 0x09, 0x0c, 0x0c, 0x0d, 0x0c, 0x0f, 0x0e,
0x0c, 0x0d, 0x0c, 0x0e, 0x0c, 0x08, 0x08, 0x08,
0x0c, 0x0c, 0x0f, 0x0c, 0x0c, 0x0c, 0x08, 0x0c,
@@ -2148,7 +2148,7 @@ static unsigned char m512[256] = {
0x0f, 0x0f, 0x0f, 0x0a, 0x0a, 0x0f, 0x08, 0x0a,
};
-static unsigned char m521[256] = {
+static guchar m521[256] = {
0xf0, 0x40, 0x40, 0xf0, 0x70, 0x40, 0xf0, 0xf0,
0xf0, 0x00, 0xf0, 0x70, 0x00, 0x00, 0xf0, 0x00,
0x00, 0xf0, 0x40, 0x40, 0x70, 0x40, 0x40, 0xf0,
@@ -2183,7 +2183,7 @@ static unsigned char m521[256] = {
0xf0, 0x70, 0xf0, 0x80, 0x00, 0x00, 0xf0, 0xf0,
};
-static unsigned char m522[256] = {
+static guchar m522[256] = {
0x0f, 0x0e, 0x0a, 0x0f, 0x08, 0x08, 0x0f, 0x0f,
0x0f, 0x0c, 0x0f, 0x08, 0x0c, 0x0a, 0x0f, 0x08,
0x0c, 0x0f, 0x0e, 0x0c, 0x08, 0x08, 0x0e, 0x0f,
@@ -2218,7 +2218,7 @@ static unsigned char m522[256] = {
0x0d, 0x0a, 0x0f, 0x0d, 0x0c, 0x08, 0x0f, 0x0f,
};
-static unsigned char m531[256] = {
+static guchar m531[256] = {
0x40, 0x70, 0x70, 0x40, 0x00, 0xf0, 0x70, 0x00,
0xf0, 0x00, 0x40, 0x40, 0x40, 0xf0, 0x00, 0xf0,
0xf0, 0x40, 0x00, 0x40, 0x00, 0xf0, 0xf0, 0xf0,
@@ -2253,7 +2253,7 @@ static unsigned char m531[256] = {
0xf0, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m532[256] = {
+static guchar m532[256] = {
0x0a, 0x08, 0x08, 0x08, 0x08, 0x0f, 0x0e, 0x08,
0x0f, 0x0c, 0x0c, 0x0c, 0x08, 0x0f, 0x0c, 0x0f,
0x0f, 0x0c, 0x0c, 0x08, 0x08, 0x0f, 0x0f, 0x0f,
@@ -2288,7 +2288,7 @@ static unsigned char m532[256] = {
0x0f, 0x0a, 0x08, 0x0e, 0x0e, 0x0a, 0x08, 0x08,
};
-static unsigned char m541[256] = {
+static guchar m541[256] = {
0x00, 0x70, 0x40, 0xf0, 0xf0, 0x00, 0x00, 0x00,
0xf0, 0xf0, 0xf0, 0x70, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xf0, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
@@ -2323,7 +2323,7 @@ static unsigned char m541[256] = {
0x00, 0x00, 0xf0, 0x00, 0x40, 0x70, 0x40, 0x40,
};
-static unsigned char m542[256] = {
+static guchar m542[256] = {
0x08, 0x0e, 0x08, 0x0f, 0x0f, 0x08, 0x0e, 0x0c,
0x0f, 0x0f, 0x0f, 0x0c, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0e, 0x0a, 0x08, 0x0a, 0x0a, 0x0a,
@@ -2358,7 +2358,7 @@ static unsigned char m542[256] = {
0x0c, 0x08, 0x0f, 0x0c, 0x0e, 0x0e, 0x08, 0x0e,
};
-static unsigned char m551[256] = {
+static guchar m551[256] = {
0x40, 0x40, 0x00, 0x00, 0xf0, 0x40, 0xf0, 0xf0,
0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0xc0, 0x70,
0xf0, 0x00, 0x00, 0x00, 0x70, 0x40, 0x70, 0x00,
@@ -2393,7 +2393,7 @@ static unsigned char m551[256] = {
0x00, 0x70, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x40,
};
-static unsigned char m552[256] = {
+static guchar m552[256] = {
0x08, 0x0e, 0x08, 0x0c, 0x0d, 0x0c, 0x0f, 0x0f,
0x0c, 0x0e, 0x0c, 0x0c, 0x0c, 0x08, 0x0d, 0x0e,
0x0f, 0x0e, 0x0c, 0x08, 0x0e, 0x08, 0x08, 0x0c,
@@ -2428,7 +2428,7 @@ static unsigned char m552[256] = {
0x08, 0x0c, 0x0c, 0x08, 0x0c, 0x0f, 0x0f, 0x0c,
};
-static unsigned char m561[256] = {
+static guchar m561[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf0, 0x00,
0x40, 0xf0, 0x40, 0x00, 0x00, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x00, 0xf0, 0x00, 0x70, 0xf0,
@@ -2463,7 +2463,7 @@ static unsigned char m561[256] = {
0x00, 0xf0, 0xf0, 0x00, 0x00, 0x70, 0x00, 0x70,
};
-static unsigned char m562[256] = {
+static guchar m562[256] = {
0x0e, 0x0e, 0x0c, 0x08, 0x0c, 0x08, 0x0d, 0x08,
0x0e, 0x0f, 0x08, 0x08, 0x0e, 0x0c, 0x0e, 0x0e,
0x0c, 0x08, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0d,
@@ -2498,7 +2498,7 @@ static unsigned char m562[256] = {
0x08, 0x0f, 0x0f, 0x08, 0x08, 0x0a, 0x0a, 0x0e,
};
-static unsigned char m571[256] = {
+static guchar m571[256] = {
0x70, 0x40, 0x40, 0xf0, 0xf0, 0x00, 0x00, 0x40,
0xf0, 0x70, 0x40, 0xf0, 0x40, 0xf0, 0x00, 0x70,
0x00, 0x40, 0xf0, 0xf0, 0x00, 0x40, 0xf0, 0x00,
@@ -2533,7 +2533,7 @@ static unsigned char m571[256] = {
0x40, 0xf0, 0xf0, 0x00, 0xf0, 0x40, 0x40, 0x40,
};
-static unsigned char m572[256] = {
+static guchar m572[256] = {
0x08, 0x0c, 0x0c, 0x0f, 0x0f, 0x08, 0x0a, 0x0c,
0x0f, 0x0e, 0x0e, 0x0d, 0x0c, 0x0d, 0x08, 0x08,
0x08, 0x08, 0x0d, 0x0d, 0x0c, 0x08, 0x0d, 0x08,
@@ -2568,7 +2568,7 @@ static unsigned char m572[256] = {
0x0e, 0x0f, 0x0f, 0x0c, 0x0d, 0x0e, 0x08, 0x08,
};
-static unsigned char m581[256] = {
+static guchar m581[256] = {
0xf0, 0x00, 0xf0, 0x40, 0x40, 0xf0, 0xf0, 0x00,
0xc0, 0xc0, 0xf0, 0x70, 0x40, 0x40, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00,
@@ -2603,7 +2603,7 @@ static unsigned char m581[256] = {
0x00, 0xf0, 0xf0, 0xf0, 0x70, 0xf0, 0x00, 0x00,
};
-static unsigned char m582[256] = {
+static guchar m582[256] = {
0x0f, 0x0c, 0x0f, 0x08, 0x0c, 0x0d, 0x0f, 0x0e,
0x0d, 0x0d, 0x0d, 0x0e, 0x0c, 0x0e, 0x0c, 0x08,
0x0c, 0x0a, 0x08, 0x08, 0x0c, 0x0a, 0x08, 0x08,
@@ -2638,7 +2638,7 @@ static unsigned char m582[256] = {
0x08, 0x0f, 0x0d, 0x09, 0x0c, 0x0d, 0x0c, 0x0c,
};
-static unsigned char m591[256] = {
+static guchar m591[256] = {
0x00, 0x00, 0x70, 0x00, 0x00, 0x40, 0x40, 0x00,
0x00, 0x70, 0x70, 0x40, 0x40, 0x00, 0x00, 0xf0,
0x70, 0x00, 0x40, 0x40, 0xc0, 0xf0, 0xf0, 0x00,
@@ -2673,7 +2673,7 @@ static unsigned char m591[256] = {
0x80, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0,
};
-static unsigned char m592[256] = {
+static guchar m592[256] = {
0x08, 0x08, 0x0a, 0x0c, 0x0a, 0x08, 0x0c, 0x0a,
0x08, 0x08, 0x08, 0x08, 0x0c, 0x0e, 0x0c, 0x0f,
0x08, 0x08, 0x0c, 0x08, 0x0f, 0x0f, 0x0f, 0x0c,
@@ -2708,7 +2708,7 @@ static unsigned char m592[256] = {
0x09, 0x0a, 0x0c, 0x0f, 0x0c, 0x0c, 0x0c, 0x0f,
};
-static unsigned char m5a1[256] = {
+static guchar m5a1[256] = {
0x40, 0xf0, 0x00, 0xf0, 0x40, 0x00, 0x00, 0x00,
0x00, 0x70, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00,
0x00, 0xf0, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00,
@@ -2743,7 +2743,7 @@ static unsigned char m5a1[256] = {
0x00, 0x00, 0x70, 0x70, 0x00, 0x40, 0x00, 0x00,
};
-static unsigned char m5a2[256] = {
+static guchar m5a2[256] = {
0x0c, 0x0f, 0x08, 0x0f, 0x0a, 0x0a, 0x0a, 0x0a,
0x0a, 0x0e, 0x0c, 0x08, 0x0e, 0x08, 0x08, 0x0c,
0x08, 0x0f, 0x08, 0x0e, 0x08, 0x0c, 0x0c, 0x0c,
@@ -2778,7 +2778,7 @@ static unsigned char m5a2[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x0c,
};
-static unsigned char m5b1[256] = {
+static guchar m5b1[256] = {
0x40, 0x40, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x40, 0xf0, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x40,
@@ -2813,7 +2813,7 @@ static unsigned char m5b1[256] = {
0xf0, 0x00, 0xf0, 0x00, 0x00, 0x40, 0x70, 0x70,
};
-static unsigned char m5b2[256] = {
+static guchar m5b2[256] = {
0x08, 0x0c, 0x0c, 0x0c, 0x08, 0x0d, 0x08, 0x0c,
0x0c, 0x0f, 0x08, 0x0d, 0x0d, 0x08, 0x08, 0x0c,
0x0c, 0x08, 0x08, 0x0c, 0x0c, 0x08, 0x0f, 0x0e,
@@ -2848,7 +2848,7 @@ static unsigned char m5b2[256] = {
0x0f, 0x0a, 0x0f, 0x0a, 0x0a, 0x08, 0x08, 0x0a,
};
-static unsigned char m5c1[256] = {
+static guchar m5c1[256] = {
0x00, 0xf0, 0x70, 0x00, 0xf0, 0x70, 0x70, 0xf0,
0xf0, 0xf0, 0xf0, 0xf0, 0x40, 0xf0, 0xf0, 0xf0,
0x00, 0xf0, 0x00, 0x70, 0x00, 0x00, 0xf0, 0x40,
@@ -2883,7 +2883,7 @@ static unsigned char m5c1[256] = {
0x00, 0x00, 0x70, 0xf0, 0x00, 0xf0, 0x00, 0x00,
};
-static unsigned char m5c2[256] = {
+static guchar m5c2[256] = {
0x08, 0x0f, 0x08, 0x0c, 0x0f, 0x08, 0x0a, 0x0d,
0x0d, 0x0f, 0x0f, 0x0d, 0x0c, 0x0d, 0x0d, 0x0f,
0x0c, 0x0f, 0x0c, 0x08, 0x0a, 0x0e, 0x0f, 0x08,
@@ -2918,7 +2918,7 @@ static unsigned char m5c2[256] = {
0x0c, 0x0c, 0x08, 0x0f, 0x08, 0x0d, 0x08, 0x0c,
};
-static unsigned char m5d1[256] = {
+static guchar m5d1[256] = {
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf0,
0x00, 0x00, 0x00, 0x70, 0x00, 0xc0, 0xf0, 0x00,
0x00, 0xf0, 0x40, 0x00, 0xf0, 0x70, 0xf0, 0xf0,
@@ -2953,7 +2953,7 @@ static unsigned char m5d1[256] = {
0x40, 0x40, 0x00, 0x70, 0x00, 0xf0, 0xf0, 0x00,
};
-static unsigned char m5d2[256] = {
+static guchar m5d2[256] = {
0x0c, 0x0c, 0x0a, 0x0a, 0x08, 0x08, 0x0e, 0x0f,
0x08, 0x08, 0x08, 0x0c, 0x0c, 0x0d, 0x0f, 0x0c,
0x08, 0x0d, 0x0c, 0x08, 0x0f, 0x08, 0x0f, 0x0d,
@@ -2988,7 +2988,7 @@ static unsigned char m5d2[256] = {
0x08, 0x0c, 0x08, 0x08, 0x08, 0x0f, 0x0f, 0x0c,
};
-static unsigned char m5e1[256] = {
+static guchar m5e1[256] = {
0x40, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0x40,
0x00, 0x00, 0x00, 0x70, 0xf0, 0x40, 0x00, 0x00,
0x00, 0xf0, 0x40, 0x00, 0x40, 0x40, 0xf0, 0x00,
@@ -3023,7 +3023,7 @@ static unsigned char m5e1[256] = {
0x70, 0x00, 0xf0, 0xf0, 0x70, 0x00, 0x70, 0x70,
};
-static unsigned char m5e2[256] = {
+static guchar m5e2[256] = {
0x08, 0x0a, 0x0f, 0x0f, 0x0c, 0x0a, 0x0f, 0x08,
0x0a, 0x08, 0x0c, 0x08, 0x0f, 0x08, 0x0c, 0x0a,
0x0a, 0x0f, 0x08, 0x08, 0x0e, 0x0e, 0x0f, 0x0c,
@@ -3058,7 +3058,7 @@ static unsigned char m5e2[256] = {
0x08, 0x08, 0x0f, 0x09, 0x08, 0x08, 0x0e, 0x0e,
};
-static unsigned char m5f1[256] = {
+static guchar m5f1[256] = {
0x00, 0xf0, 0x40, 0x70, 0xf0, 0x00, 0x40, 0x40,
0x40, 0x70, 0xf0, 0x70, 0x70, 0x70, 0x40, 0xf0,
0x70, 0xf0, 0x00, 0xf0, 0xf0, 0xf0, 0x70, 0xf0,
@@ -3093,7 +3093,7 @@ static unsigned char m5f1[256] = {
0x70, 0x00, 0x40, 0x70, 0x40, 0xf0, 0x00, 0xf0,
};
-static unsigned char m5f2[256] = {
+static guchar m5f2[256] = {
0x0a, 0x0f, 0x0e, 0x0a, 0x0f, 0x0c, 0x08, 0x0c,
0x0e, 0x08, 0x0f, 0x0e, 0x08, 0x08, 0x08, 0x0f,
0x08, 0x0b, 0x0c, 0x0f, 0x0d, 0x0f, 0x08, 0x0f,
@@ -3128,7 +3128,7 @@ static unsigned char m5f2[256] = {
0x0e, 0x08, 0x0c, 0x0e, 0x08, 0x0f, 0x0a, 0x0f,
};
-static unsigned char m601[256] = {
+static guchar m601[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x70, 0xf0,
0x70, 0x00, 0xf0, 0x40, 0x40, 0x70, 0xf0, 0x40,
@@ -3163,7 +3163,7 @@ static unsigned char m601[256] = {
0x40, 0xf0, 0xf0, 0xf0, 0x40, 0x40, 0x00, 0x00,
};
-static unsigned char m602[256] = {
+static guchar m602[256] = {
0x0e, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x08,
0x08, 0x0c, 0x0e, 0x0c, 0x0c, 0x0e, 0x0e, 0x0f,
0x0c, 0x0c, 0x0f, 0x0c, 0x0e, 0x0e, 0x0f, 0x0c,
@@ -3198,7 +3198,7 @@ static unsigned char m602[256] = {
0x0c, 0x0f, 0x0f, 0x0d, 0x0c, 0x08, 0x0c, 0x0c,
};
-static unsigned char m611[256] = {
+static guchar m611[256] = {
0x70, 0xf0, 0x40, 0x70, 0x00, 0x00, 0xf0, 0x40,
0xf0, 0xf0, 0x40, 0x00, 0x40, 0xf0, 0xf0, 0xf0,
0x40, 0x40, 0x40, 0x40, 0x40, 0xf0, 0x40, 0x40,
@@ -3233,7 +3233,7 @@ static unsigned char m611[256] = {
0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x70, 0x70, 0xf0,
};
-static unsigned char m612[256] = {
+static guchar m612[256] = {
0x0e, 0x0f, 0x08, 0x0c, 0x0c, 0x0c, 0x0f, 0x08,
0x0f, 0x0f, 0x0c, 0x0c, 0x08, 0x0f, 0x0f, 0x0f,
0x0c, 0x08, 0x0c, 0x0c, 0x0c, 0x0f, 0x0c, 0x08,
@@ -3268,7 +3268,7 @@ static unsigned char m612[256] = {
0x0d, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x0c, 0x0f,
};
-static unsigned char m621[256] = {
+static guchar m621[256] = {
0xf0, 0x40, 0x00, 0x40, 0x40, 0x00, 0x00, 0xc0,
0xf0, 0x70, 0xf0, 0x00, 0xf0, 0xf0, 0xf0, 0x00,
0xf0, 0xf0, 0xf0, 0x40, 0x70, 0x40, 0xf0, 0x00,
@@ -3303,7 +3303,7 @@ static unsigned char m621[256] = {
0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0xf0, 0xf0,
};
-static unsigned char m622[256] = {
+static guchar m622[256] = {
0x0d, 0x0c, 0x08, 0x0c, 0x0c, 0x08, 0x02, 0x0d,
0x0f, 0x0c, 0x0f, 0x02, 0x0f, 0x0f, 0x0f, 0x0a,
0x0f, 0x0f, 0x0f, 0x08, 0x0c, 0x0e, 0x0f, 0x02,
@@ -3338,7 +3338,7 @@ static unsigned char m622[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0e, 0x0e, 0x0f, 0x0f,
};
-static unsigned char m631[256] = {
+static guchar m631[256] = {
0x00, 0xf0, 0x70, 0x40, 0x40, 0x00, 0x00, 0xf0,
0x70, 0xf0, 0x40, 0x40, 0x70, 0x40, 0x00, 0x00,
0x40, 0xf0, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00,
@@ -3373,7 +3373,7 @@ static unsigned char m631[256] = {
0x40, 0x40, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m632[256] = {
+static guchar m632[256] = {
0x0c, 0x0f, 0x0e, 0x0c, 0x08, 0x08, 0x08, 0x0f,
0x0e, 0x0f, 0x08, 0x0c, 0x0c, 0x0c, 0x0e, 0x0c,
0x0c, 0x0f, 0x08, 0x0c, 0x0c, 0x0c, 0x0e, 0x08,
@@ -3408,7 +3408,7 @@ static unsigned char m632[256] = {
0x0a, 0x0c, 0x08, 0x00, 0x00, 0x02, 0x08, 0x02,
};
-static unsigned char m641[256] = {
+static guchar m641[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00,
0x00, 0x40, 0x40, 0x00, 0x00, 0xf0, 0x00, 0xf0,
0x40, 0x00, 0x40, 0x70, 0xc0, 0x00, 0xf0, 0xf0,
@@ -3443,7 +3443,7 @@ static unsigned char m641[256] = {
0x00, 0x00, 0xf0, 0x40, 0x00, 0x70, 0xf0, 0x40,
};
-static unsigned char m642[256] = {
+static guchar m642[256] = {
0x02, 0x02, 0x02, 0x08, 0x00, 0x02, 0x0c, 0x08,
0x08, 0x0c, 0x0c, 0x0e, 0x0e, 0x0d, 0x0c, 0x0f,
0x0e, 0x08, 0x0c, 0x0e, 0x0f, 0x0c, 0x0d, 0x0d,
@@ -3478,7 +3478,7 @@ static unsigned char m642[256] = {
0x0c, 0x08, 0x0d, 0x0c, 0x0c, 0x0c, 0x0d, 0x0c,
};
-static unsigned char m651[256] = {
+static guchar m651[256] = {
0xf0, 0x40, 0x00, 0x00, 0xc0, 0x70, 0x00, 0x00,
0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x40, 0x00,
@@ -3513,7 +3513,7 @@ static unsigned char m651[256] = {
0x00, 0x40, 0xf0, 0xf0, 0x80, 0x80, 0x40, 0xc0,
};
-static unsigned char m652[256] = {
+static guchar m652[256] = {
0x0f, 0x0c, 0x08, 0x0c, 0x0d, 0x08, 0x0c, 0x0c,
0x08, 0x0e, 0x08, 0x08, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x08, 0x02, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -3548,7 +3548,7 @@ static unsigned char m652[256] = {
0x00, 0x08, 0x0f, 0x0d, 0x0d, 0x0d, 0x08, 0x09,
};
-static unsigned char m661[256] = {
+static guchar m661[256] = {
0x40, 0x00, 0x70, 0x70, 0x40, 0x00, 0xf0, 0xf0,
0x40, 0xc0, 0xf0, 0x00, 0xf0, 0x40, 0xf0, 0xf0,
0x80, 0xc0, 0x40, 0xf0, 0xf0, 0xc0, 0x40, 0x00,
@@ -3583,7 +3583,7 @@ static unsigned char m661[256] = {
0xf0, 0xf0, 0xc0, 0x40, 0xf0, 0x70, 0xf0, 0xf0,
};
-static unsigned char m662[256] = {
+static guchar m662[256] = {
0x0e, 0x08, 0x0e, 0x0e, 0x0c, 0x0c, 0x0f, 0x0d,
0x0c, 0x0d, 0x0f, 0x0c, 0x0f, 0x0c, 0x0f, 0x0f,
0x0d, 0x0d, 0x0c, 0x0f, 0x0f, 0x0f, 0x08, 0x08,
@@ -3618,7 +3618,7 @@ static unsigned char m662[256] = {
0x0d, 0x0f, 0x09, 0x00, 0x0f, 0x00, 0x0f, 0x0f,
};
-static unsigned char m671[256] = {
+static guchar m671[256] = {
0xf0, 0x00, 0x00, 0xf0, 0x00, 0x40, 0x00, 0x40,
0xf0, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x40, 0x70,
0x00, 0x00, 0x00, 0x40, 0xf0, 0xf0, 0x70, 0xf0,
@@ -3653,7 +3653,7 @@ static unsigned char m671[256] = {
0x00, 0x40, 0x00, 0xf0, 0x00, 0x00, 0xf0, 0x70,
};
-static unsigned char m672[256] = {
+static guchar m672[256] = {
0x0f, 0x0c, 0x08, 0x0d, 0x0c, 0x0c, 0x08, 0x08,
0x0f, 0x0f, 0x0e, 0x0f, 0x08, 0x0f, 0x08, 0x0c,
0x0e, 0x08, 0x0c, 0x0c, 0x0f, 0x0f, 0x08, 0x0f,
@@ -3688,7 +3688,7 @@ static unsigned char m672[256] = {
0x0c, 0x08, 0x0c, 0x09, 0x0c, 0x02, 0x09, 0x0e,
};
-static unsigned char m681[256] = {
+static guchar m681[256] = {
0x00, 0x00, 0x70, 0x70, 0x70, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0xf0, 0x40, 0x00, 0xf0, 0xf0,
@@ -3723,7 +3723,7 @@ static unsigned char m681[256] = {
0x00, 0xf0, 0xf0, 0x40, 0x40, 0x40, 0x00, 0x00,
};
-static unsigned char m682[256] = {
+static guchar m682[256] = {
0x0a, 0x08, 0x00, 0x00, 0x08, 0x0a, 0x08, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x02, 0x02,
0x08, 0x0a, 0x0d, 0x0f, 0x0c, 0x08, 0x0f, 0x0f,
@@ -3758,7 +3758,7 @@ static unsigned char m682[256] = {
0x0c, 0x0f, 0x0f, 0x0c, 0x0e, 0x0c, 0x08, 0x08,
};
-static unsigned char m691[256] = {
+static guchar m691[256] = {
0xf0, 0x70, 0x00, 0x00, 0x70, 0xf0, 0x40, 0x00,
0x70, 0x40, 0x40, 0x70, 0x70, 0xf0, 0xf0, 0x70,
0x40, 0x40, 0xf0, 0x40, 0x00, 0x00, 0x40, 0x40,
@@ -3793,7 +3793,7 @@ static unsigned char m691[256] = {
0x00, 0x70, 0x00, 0xf0, 0x00, 0xf0, 0x40, 0xf0,
};
-static unsigned char m692[256] = {
+static guchar m692[256] = {
0x09, 0x0a, 0x08, 0x08, 0x0c, 0x0f, 0x0c, 0x0c,
0x0c, 0x08, 0x0c, 0x0e, 0x0c, 0x0f, 0x0f, 0x0c,
0x0e, 0x0c, 0x0f, 0x0c, 0x0c, 0x0c, 0x08, 0x0c,
@@ -3828,7 +3828,7 @@ static unsigned char m692[256] = {
0x0c, 0x08, 0x08, 0x0d, 0x0c, 0x0f, 0x0c, 0x0f,
};
-static unsigned char m6a1[256] = {
+static guchar m6a1[256] = {
0x40, 0x40, 0xf0, 0x40, 0x00, 0x70, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x70, 0x70, 0x00, 0x00, 0x40,
0x00, 0xc0, 0x70, 0xf0, 0x70, 0x40, 0x00, 0xf0,
@@ -3863,7 +3863,7 @@ static unsigned char m6a1[256] = {
0x00, 0x00, 0x70, 0xf0, 0x40, 0x40, 0x00, 0x00,
};
-static unsigned char m6a2[256] = {
+static guchar m6a2[256] = {
0x0c, 0x0c, 0x0d, 0x08, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0f, 0x08, 0x08, 0x0c, 0x08, 0x0c,
0x08, 0x0d, 0x08, 0x0d, 0x0c, 0x0c, 0x0c, 0x0f,
@@ -3898,7 +3898,7 @@ static unsigned char m6a2[256] = {
0x0c, 0x0c, 0x0c, 0x0d, 0x0c, 0x08, 0x08, 0x08,
};
-static unsigned char m6b1[256] = {
+static guchar m6b1[256] = {
0x00, 0x00, 0x40, 0x40, 0xf0, 0x70, 0x40, 0x40,
0x00, 0x40, 0xf0, 0x00, 0x80, 0x00, 0x00, 0x40,
0x40, 0x40, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x40,
@@ -3933,7 +3933,7 @@ static unsigned char m6b1[256] = {
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
};
-static unsigned char m6b2[256] = {
+static guchar m6b2[256] = {
0x0c, 0x08, 0x0c, 0x0c, 0x0d, 0x00, 0x08, 0x08,
0x0c, 0x0c, 0x0d, 0x0c, 0x09, 0x08, 0x08, 0x0c,
0x0c, 0x0c, 0x0d, 0x0c, 0x08, 0x08, 0x0d, 0x0c,
@@ -3968,7 +3968,7 @@ static unsigned char m6b2[256] = {
0x0c, 0x0e, 0x08, 0x0c, 0x0c, 0x0e, 0x0c, 0x0c,
};
-static unsigned char m6c1[256] = {
+static guchar m6c1[256] = {
0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x00, 0x00,
0xf0, 0x40, 0x00, 0x00, 0x00, 0x40, 0x40, 0xf0,
0x40, 0xf0, 0x40, 0xf0, 0x70, 0x00, 0x00, 0x70,
@@ -4003,7 +4003,7 @@ static unsigned char m6c1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m6c2[256] = {
+static guchar m6c2[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0e, 0x0e, 0x02,
0x0d, 0x0c, 0x08, 0x0c, 0x0c, 0x0e, 0x00, 0x0f,
0x0e, 0x0f, 0x08, 0x0f, 0x0e, 0x0e, 0x0e, 0x00,
@@ -4038,7 +4038,7 @@ static unsigned char m6c2[256] = {
0x02, 0x0c, 0x02, 0x02, 0x02, 0x02, 0x02, 0x08,
};
-static unsigned char m6d1[256] = {
+static guchar m6d1[256] = {
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40,
0x00, 0x00, 0x40, 0xf0, 0xf0, 0x00, 0x40, 0x40,
0x00, 0xc0, 0x70, 0x40, 0x00, 0x00, 0x00, 0xf0,
@@ -4073,7 +4073,7 @@ static unsigned char m6d1[256] = {
0x80, 0xf0, 0xf0, 0xf0, 0x40, 0x00, 0x00, 0x00,
};
-static unsigned char m6d2[256] = {
+static guchar m6d2[256] = {
0x0c, 0x0e, 0x08, 0x0c, 0x0e, 0x08, 0x08, 0x0e,
0x0c, 0x0c, 0x0c, 0x0f, 0x0f, 0x0c, 0x0e, 0x0c,
0x0c, 0x0d, 0x0e, 0x08, 0x08, 0x08, 0x0c, 0x0f,
@@ -4108,7 +4108,7 @@ static unsigned char m6d2[256] = {
0x09, 0x0f, 0x0d, 0x0f, 0x0e, 0x0c, 0x08, 0x08,
};
-static unsigned char m6e1[256] = {
+static guchar m6e1[256] = {
0x40, 0x00, 0x00, 0x00, 0x40, 0x70, 0x00, 0x70,
0x70, 0x70, 0x70, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x80,
@@ -4143,7 +4143,7 @@ static unsigned char m6e1[256] = {
0xf0, 0x40, 0x00, 0x40, 0x00, 0x40, 0xf0, 0xf0,
};
-static unsigned char m6e2[256] = {
+static guchar m6e2[256] = {
0x0c, 0x08, 0x08, 0x0c, 0x08, 0x0e, 0x08, 0x08,
0x08, 0x08, 0x0a, 0x08, 0x0a, 0x02, 0x02, 0x08,
0x02, 0x02, 0x08, 0x00, 0x02, 0x08, 0x02, 0x0b,
@@ -4178,7 +4178,7 @@ static unsigned char m6e2[256] = {
0x0d, 0x0e, 0x08, 0x0c, 0x0c, 0x0c, 0x0d, 0x0d,
};
-static unsigned char m6f1[256] = {
+static guchar m6f1[256] = {
0x00, 0xf0, 0xf0, 0x00, 0x40, 0x00, 0xf0, 0x00,
0x40, 0x70, 0x40, 0x00, 0x40, 0x40, 0x00, 0xf0,
0x00, 0xf0, 0x00, 0x70, 0xf0, 0xf0, 0x40, 0x00,
@@ -4213,7 +4213,7 @@ static unsigned char m6f1[256] = {
0x00, 0x40, 0x70, 0x00, 0x40, 0x40, 0xf0, 0x00,
};
-static unsigned char m6f2[256] = {
+static guchar m6f2[256] = {
0x0c, 0x0d, 0x0f, 0x0c, 0x08, 0x0c, 0x0f, 0x0c,
0x0c, 0x0e, 0x0c, 0x08, 0x08, 0x0c, 0x0c, 0x0f,
0x08, 0x09, 0x0c, 0x0e, 0x0f, 0x0f, 0x08, 0x08,
@@ -4248,7 +4248,7 @@ static unsigned char m6f2[256] = {
0x08, 0x00, 0x0c, 0x0c, 0x0c, 0x08, 0x0d, 0x0c,
};
-static unsigned char m701[256] = {
+static guchar m701[256] = {
0x40, 0xf0, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x40,
0x00, 0xf0, 0x00, 0xf0, 0x00, 0x40, 0x00, 0xf0,
0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x40,
@@ -4283,7 +4283,7 @@ static unsigned char m701[256] = {
0x00, 0xf0, 0x40, 0x00, 0x00, 0xf0, 0x00, 0x00,
};
-static unsigned char m702[256] = {
+static guchar m702[256] = {
0x0c, 0x0d, 0x08, 0x08, 0x0c, 0x0d, 0x0d, 0x0c,
0x08, 0x0d, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, 0x0d,
0x08, 0x0f, 0x08, 0x08, 0x0c, 0x0d, 0x0c, 0x0c,
@@ -4318,7 +4318,7 @@ static unsigned char m702[256] = {
0x0c, 0x0f, 0x0c, 0x0c, 0x0c, 0x0f, 0x08, 0x0c,
};
-static unsigned char m711[256] = {
+static guchar m711[256] = {
0x00, 0x00, 0x00, 0x40, 0xc0, 0x40, 0x40, 0x40,
0x00, 0xf0, 0x00, 0x40, 0xc0, 0x00, 0x00, 0x40,
0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
@@ -4353,7 +4353,7 @@ static unsigned char m711[256] = {
0x40, 0x70, 0x00, 0xf0, 0xf0, 0x00, 0xc0, 0xf0,
};
-static unsigned char m712[256] = {
+static guchar m712[256] = {
0x0c, 0x08, 0x0c, 0x08, 0x0d, 0x08, 0x0c, 0x08,
0x08, 0x0f, 0x0e, 0x0c, 0x0d, 0x0c, 0x0c, 0x08,
0x0e, 0x08, 0x08, 0x0e, 0x00, 0x02, 0x02, 0x0c,
@@ -4388,7 +4388,7 @@ static unsigned char m712[256] = {
0x0c, 0x0e, 0x08, 0x0d, 0x0d, 0x0c, 0x0d, 0x0d,
};
-static unsigned char m721[256] = {
+static guchar m721[256] = {
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x40,
0x40, 0x40, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00,
0xf0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40,
@@ -4423,7 +4423,7 @@ static unsigned char m721[256] = {
0xf0, 0xf0, 0x40, 0x40, 0xf0, 0xf0, 0x40, 0x00,
};
-static unsigned char m722[256] = {
+static guchar m722[256] = {
0x09, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x0f, 0x0c,
0x08, 0x08, 0x0c, 0x08, 0x0c, 0x0c, 0x08, 0x08,
0x0d, 0x08, 0x08, 0x0c, 0x0c, 0x08, 0x08, 0x08,
@@ -4458,7 +4458,7 @@ static unsigned char m722[256] = {
0x0f, 0x0d, 0x0e, 0x0e, 0x0f, 0x0d, 0x0c, 0x0c,
};
-static unsigned char m731[256] = {
+static guchar m731[256] = {
0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40,
0x00, 0x00, 0xf0, 0x40, 0x00, 0x40, 0x00, 0x00,
0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0xf0, 0x70,
@@ -4493,7 +4493,7 @@ static unsigned char m731[256] = {
0x70, 0xc0, 0x40, 0x40, 0x00, 0xc0, 0xf0, 0x40,
};
-static unsigned char m732[256] = {
+static guchar m732[256] = {
0x0c, 0x0e, 0x08, 0x02, 0x08, 0x08, 0x08, 0x0c,
0x0c, 0x08, 0x0f, 0x0c, 0x0c, 0x08, 0x0a, 0x0c,
0x08, 0x0c, 0x0c, 0x0e, 0x08, 0x0a, 0x0f, 0x0e,
@@ -4528,7 +4528,7 @@ static unsigned char m732[256] = {
0x0c, 0x09, 0x0c, 0x08, 0x0c, 0x0d, 0x0d, 0x0c,
};
-static unsigned char m741[256] = {
+static guchar m741[256] = {
0x40, 0xc0, 0x00, 0xf0, 0x40, 0xf0, 0xf0, 0xc0,
0x00, 0xf0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
@@ -4563,7 +4563,7 @@ static unsigned char m741[256] = {
0x70, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x40,
};
-static unsigned char m742[256] = {
+static guchar m742[256] = {
0x0c, 0x0d, 0x08, 0x0f, 0x0c, 0x0f, 0x0f, 0x0d,
0x0c, 0x0f, 0x0e, 0x0c, 0x0c, 0x0c, 0x00, 0x02,
0x02, 0x00, 0x08, 0x09, 0x08, 0x08, 0x0c, 0x08,
@@ -4598,7 +4598,7 @@ static unsigned char m742[256] = {
0x08, 0x08, 0x08, 0x0c, 0x00, 0x0c, 0x0c, 0x0e,
};
-static unsigned char m751[256] = {
+static guchar m751[256] = {
0x00, 0x80, 0x00, 0x70, 0xf0, 0x70, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x70, 0x70, 0x70, 0x00,
0x00, 0xf0, 0x40, 0x70, 0x00, 0xf0, 0x40, 0x40,
@@ -4633,7 +4633,7 @@ static unsigned char m751[256] = {
0x00, 0x40, 0xf0, 0x00, 0xf0, 0x00, 0x70, 0x70,
};
-static unsigned char m752[256] = {
+static guchar m752[256] = {
0x0c, 0x09, 0x0c, 0x0c, 0x0f, 0x00, 0x08, 0x0c,
0x0c, 0x08, 0x08, 0x0c, 0x0c, 0x0e, 0x08, 0x0e,
0x0c, 0x0f, 0x0c, 0x0e, 0x0c, 0x0d, 0x0c, 0x0c,
@@ -4668,7 +4668,7 @@ static unsigned char m752[256] = {
0x0c, 0x0e, 0x0d, 0x0c, 0x0f, 0x0c, 0x0c, 0x0e,
};
-static unsigned char m761[256] = {
+static guchar m761[256] = {
0xc0, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x40,
0x40, 0x70, 0x40, 0x70, 0x40, 0xf0, 0x00, 0x40,
0x00, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00,
@@ -4703,7 +4703,7 @@ static unsigned char m761[256] = {
0xf0, 0x40, 0x00, 0x70, 0xc0, 0x00, 0xf0, 0x00,
};
-static unsigned char m762[256] = {
+static guchar m762[256] = {
0x0f, 0x0e, 0x08, 0x0e, 0x00, 0x02, 0x00, 0x08,
0x0c, 0x0c, 0x0e, 0x0c, 0x0e, 0x0d, 0x08, 0x0c,
0x0e, 0x0c, 0x08, 0x0c, 0x0c, 0x0e, 0x0c, 0x02,
@@ -4738,7 +4738,7 @@ static unsigned char m762[256] = {
0x0f, 0x0e, 0x0c, 0x0c, 0x0f, 0x08, 0x0f, 0x08,
};
-static unsigned char m771[256] = {
+static guchar m771[256] = {
0x40, 0xf0, 0x00, 0x00, 0xf0, 0x00, 0x40, 0x70,
0xf0, 0xf0, 0x40, 0xf0, 0x70, 0x00, 0x40, 0x00,
0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40,
@@ -4773,7 +4773,7 @@ static unsigned char m771[256] = {
0x40, 0x00, 0x00, 0x40, 0x70, 0x00, 0x00, 0x00,
};
-static unsigned char m772[256] = {
+static guchar m772[256] = {
0x08, 0x0f, 0x08, 0x0c, 0x0f, 0x0c, 0x08, 0x0e,
0x0f, 0x0f, 0x0c, 0x0f, 0x00, 0x02, 0x08, 0x08,
0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x08,
@@ -4808,7 +4808,7 @@ static unsigned char m772[256] = {
0x0e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0e, 0x0a, 0x02,
};
-static unsigned char m781[256] = {
+static guchar m781[256] = {
0x00, 0x00, 0xf0, 0x00, 0x00, 0x40, 0x40, 0x00,
0x00, 0x40, 0x00, 0x00, 0x70, 0x40, 0x40, 0x00,
0x00, 0x40, 0xf0, 0x00, 0x70, 0x70, 0x00, 0x00,
@@ -4843,7 +4843,7 @@ static unsigned char m781[256] = {
0x00, 0x00, 0x40, 0xc0, 0x00, 0x70, 0x00, 0x40,
};
-static unsigned char m782[256] = {
+static guchar m782[256] = {
0x02, 0x02, 0x0f, 0x0c, 0x08, 0x0c, 0x0c, 0x08,
0x08, 0x0e, 0x08, 0x08, 0x0e, 0x0e, 0x0c, 0x0c,
0x0c, 0x0e, 0x0f, 0x0c, 0x0e, 0x08, 0x02, 0x02,
@@ -4878,7 +4878,7 @@ static unsigned char m782[256] = {
0x08, 0x0c, 0x0e, 0x0d, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m791[256] = {
+static guchar m791[256] = {
0x40, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x70,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xf0, 0x00,
0x40, 0x70, 0x70, 0x00, 0x00, 0x00, 0x80, 0x00,
@@ -4913,7 +4913,7 @@ static unsigned char m791[256] = {
0x40, 0x00, 0x00, 0xf0, 0x40, 0x00, 0x00, 0x00,
};
-static unsigned char m792[256] = {
+static guchar m792[256] = {
0x08, 0x0f, 0x0c, 0x00, 0x0c, 0x0e, 0x08, 0x08,
0x08, 0x0c, 0x08, 0x08, 0x0c, 0x08, 0x0d, 0x08,
0x0c, 0x0c, 0x0c, 0x0e, 0x0c, 0x08, 0x01, 0x0c,
@@ -4948,7 +4948,7 @@ static unsigned char m792[256] = {
0x0e, 0x08, 0x0c, 0x0f, 0x08, 0x02, 0x00, 0x08,
};
-static unsigned char m7a1[256] = {
+static guchar m7a1[256] = {
0xf0, 0x00, 0x40, 0x40, 0x00, 0x80, 0x00, 0x40,
0xf0, 0x40, 0x40, 0xf0, 0x40, 0xf0, 0x70, 0x00,
0x00, 0x40, 0x00, 0x00, 0xf0, 0x40, 0x00, 0xf0,
@@ -4983,7 +4983,7 @@ static unsigned char m7a1[256] = {
0x70, 0xf0, 0xf0, 0x40, 0x00, 0x40, 0x40, 0xf0,
};
-static unsigned char m7a2[256] = {
+static guchar m7a2[256] = {
0x0f, 0x08, 0x0e, 0x0e, 0x0c, 0x0d, 0x0a, 0x08,
0x0d, 0x08, 0x0c, 0x0f, 0x0c, 0x0f, 0x0a, 0x08,
0x0c, 0x0c, 0x0c, 0x0c, 0x0f, 0x0c, 0x08, 0x0f,
@@ -5018,7 +5018,7 @@ static unsigned char m7a2[256] = {
0x08, 0x0f, 0x0f, 0x0c, 0x08, 0x0e, 0x08, 0x0f,
};
-static unsigned char m7b1[256] = {
+static guchar m7b1[256] = {
0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x40,
0x70, 0x00, 0x70, 0x70, 0x00, 0x00, 0x00, 0xf0,
0x00, 0xf0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
@@ -5053,7 +5053,7 @@ static unsigned char m7b1[256] = {
0x40, 0x40, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00,
};
-static unsigned char m7b2[256] = {
+static guchar m7b2[256] = {
0x0c, 0x0c, 0x00, 0x02, 0x0e, 0x0c, 0x0e, 0x00,
0x0e, 0x0c, 0x0e, 0x0a, 0x08, 0x08, 0x0c, 0x0f,
0x0c, 0x0f, 0x0c, 0x0c, 0x0a, 0x02, 0x08, 0x08,
@@ -5088,7 +5088,7 @@ static unsigned char m7b2[256] = {
0x0c, 0x0c, 0x08, 0x0c, 0x0a, 0x0c, 0x0e, 0x0c,
};
-static unsigned char m7c1[256] = {
+static guchar m7c1[256] = {
0x70, 0x40, 0x40, 0x40, 0x40, 0x00, 0x40, 0xf0,
0x00, 0x40, 0x00, 0x40, 0x40, 0x70, 0x40, 0x40,
0x00, 0x70, 0xf0, 0x70, 0x70, 0x00, 0x00, 0x70,
@@ -5123,7 +5123,7 @@ static unsigned char m7c1[256] = {
0x70, 0x00, 0x70, 0xf0, 0x00, 0x00, 0xf0, 0x00,
};
-static unsigned char m7c2[256] = {
+static guchar m7c2[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x0c, 0x0f,
0x08, 0x0c, 0x0c, 0x0e, 0x0e, 0x0c, 0x0c, 0x0e,
0x0c, 0x0c, 0x09, 0x00, 0x08, 0x08, 0x02, 0x00,
@@ -5158,7 +5158,7 @@ static unsigned char m7c2[256] = {
0x0e, 0x00, 0x08, 0x0f, 0x08, 0x0c, 0x0d, 0x08,
};
-static unsigned char m7d1[256] = {
+static guchar m7d1[256] = {
0xf0, 0x00, 0xf0, 0x40, 0xf0, 0xf0, 0xf0, 0xc0,
0xc0, 0x40, 0xf0, 0xf0, 0x00, 0xf0, 0x00, 0x40,
0xf0, 0x40, 0x40, 0x40, 0xf0, 0x70, 0x40, 0xf0,
@@ -5193,7 +5193,7 @@ static unsigned char m7d1[256] = {
0x00, 0x40, 0x40, 0xf0, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m7d2[256] = {
+static guchar m7d2[256] = {
0x0d, 0x0c, 0x0d, 0x0c, 0x0d, 0x0d, 0x0d, 0x0d,
0x0d, 0x0c, 0x0f, 0x0d, 0x0c, 0x0d, 0x0c, 0x0c,
0x0d, 0x0c, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0d,
@@ -5228,7 +5228,7 @@ static unsigned char m7d2[256] = {
0x08, 0x0c, 0x0c, 0x0d, 0x08, 0x08, 0x08, 0x08,
};
-static unsigned char m7e1[256] = {
+static guchar m7e1[256] = {
0x40, 0x70, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00,
0x40, 0xf0, 0xf0, 0x70, 0x00, 0x00, 0x00, 0x00,
0x40, 0x40, 0x70, 0x00, 0x00, 0xc0, 0x00, 0x40,
@@ -5263,7 +5263,7 @@ static unsigned char m7e1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m7e2[256] = {
+static guchar m7e2[256] = {
0x08, 0x08, 0x08, 0x0c, 0x08, 0x00, 0x00, 0x08,
0x0c, 0x0d, 0x0d, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c,
@@ -5298,7 +5298,7 @@ static unsigned char m7e2[256] = {
0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
};
-static unsigned char m7f1[256] = {
+static guchar m7f1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -5333,7 +5333,7 @@ static unsigned char m7f1[256] = {
0x00, 0xf0, 0x40, 0x70, 0xf0, 0x40, 0x40, 0x40,
};
-static unsigned char m7f2[256] = {
+static guchar m7f2[256] = {
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02,
0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
@@ -5368,7 +5368,7 @@ static unsigned char m7f2[256] = {
0x0c, 0x0d, 0x08, 0x0e, 0x0f, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m801[256] = {
+static guchar m801[256] = {
0xf0, 0xf0, 0x00, 0xf0, 0x70, 0xf0, 0xf0, 0x40,
0x40, 0x80, 0x40, 0x70, 0xf0, 0x40, 0x40, 0x40,
0xf0, 0x40, 0x70, 0x40, 0x40, 0xf0, 0x40, 0xf0,
@@ -5403,7 +5403,7 @@ static unsigned char m801[256] = {
0xf0, 0x40, 0x40, 0x00, 0x70, 0xf0, 0x40, 0x00,
};
-static unsigned char m802[256] = {
+static guchar m802[256] = {
0x0f, 0x0f, 0x08, 0x0f, 0x0e, 0x0f, 0x0f, 0x0c,
0x08, 0x09, 0x08, 0x0e, 0x0f, 0x0e, 0x0c, 0x0c,
0x0f, 0x0c, 0x0e, 0x08, 0x0e, 0x0f, 0x0e, 0x0f,
@@ -5438,7 +5438,7 @@ static unsigned char m802[256] = {
0x0f, 0x0c, 0x0e, 0x0c, 0x0e, 0x0f, 0x0c, 0x08,
};
-static unsigned char m811[256] = {
+static guchar m811[256] = {
0x00, 0x00, 0xf0, 0x40, 0x00, 0xf0, 0xf0, 0xf0,
0xf0, 0x70, 0xf0, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40,
@@ -5473,7 +5473,7 @@ static unsigned char m811[256] = {
0x40, 0x40, 0xf0, 0xf0, 0xf0, 0x40, 0xf0, 0x40,
};
-static unsigned char m812[256] = {
+static guchar m812[256] = {
0x0c, 0x0c, 0x0f, 0x08, 0x08, 0x0d, 0x0f, 0x09,
0x0d, 0x0a, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x0a, 0x0c, 0x0e, 0x08,
@@ -5508,7 +5508,7 @@ static unsigned char m812[256] = {
0x0c, 0x0c, 0x0d, 0x0f, 0x0f, 0x08, 0x0f, 0x0c,
};
-static unsigned char m821[256] = {
+static guchar m821[256] = {
0x40, 0x70, 0x70, 0x40, 0x00, 0xf0, 0x00, 0xf0,
0xf0, 0x70, 0xf0, 0x00, 0xf0, 0xf0, 0x70, 0x40,
0x70, 0x00, 0xf0, 0x40, 0x40, 0x00, 0x70, 0x70,
@@ -5543,7 +5543,7 @@ static unsigned char m821[256] = {
0x00, 0x70, 0x70, 0x70, 0x00, 0xc0, 0xc0, 0x00,
};
-static unsigned char m822[256] = {
+static guchar m822[256] = {
0x0e, 0x0e, 0x0e, 0x08, 0x0e, 0x0f, 0x02, 0x0d,
0x0d, 0x0c, 0x0d, 0x0c, 0x0f, 0x0f, 0x08, 0x08,
0x0e, 0x0c, 0x0f, 0x08, 0x0e, 0x0c, 0x0c, 0x00,
@@ -5578,7 +5578,7 @@ static unsigned char m822[256] = {
0x08, 0x0e, 0x0c, 0x0e, 0x08, 0x09, 0x0d, 0x08,
};
-static unsigned char m831[256] = {
+static guchar m831[256] = {
0x40, 0xc0, 0xf0, 0xf0, 0xf0, 0xf0, 0x70, 0x40,
0x40, 0xf0, 0x40, 0x40, 0x00, 0x00, 0x70, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf0,
@@ -5613,7 +5613,7 @@ static unsigned char m831[256] = {
0x40, 0xc0, 0x00, 0x70, 0x40, 0xf0, 0x00, 0x00,
};
-static unsigned char m832[256] = {
+static guchar m832[256] = {
0x0c, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0e,
0x0e, 0x0f, 0x08, 0x08, 0x0e, 0x0c, 0x0a, 0x02,
0x08, 0x02, 0x08, 0x00, 0x02, 0x02, 0x0c, 0x0f,
@@ -5648,7 +5648,7 @@ static unsigned char m832[256] = {
0x0e, 0x0f, 0x0c, 0x0c, 0x0c, 0x0f, 0x0c, 0x0c,
};
-static unsigned char m841[256] = {
+static guchar m841[256] = {
0x00, 0x40, 0x00, 0xf0, 0xf0, 0x00, 0x40, 0x70,
0x00, 0x00, 0xc0, 0x70, 0xf0, 0xf0, 0xf0, 0x40,
0x00, 0x40, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00,
@@ -5683,7 +5683,7 @@ static unsigned char m841[256] = {
0x00, 0x00, 0x40, 0x40, 0xf0, 0x40, 0x00, 0x70,
};
-static unsigned char m842[256] = {
+static guchar m842[256] = {
0x08, 0x0e, 0x08, 0x0f, 0x0f, 0x08, 0x0e, 0x0c,
0x08, 0x0c, 0x0d, 0x0e, 0x0f, 0x0f, 0x0f, 0x0e,
0x0c, 0x0e, 0x0c, 0x0c, 0x08, 0x08, 0x08, 0x08,
@@ -5718,7 +5718,7 @@ static unsigned char m842[256] = {
0x08, 0x0c, 0x0c, 0x0c, 0x0f, 0x0c, 0x0c, 0x0e,
};
-static unsigned char m851[256] = {
+static guchar m851[256] = {
0x70, 0x00, 0x40, 0x40, 0x00, 0x00, 0x70, 0x40,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00,
0x40, 0xf0, 0x00, 0xf0, 0xf0, 0x70, 0x00, 0xf0,
@@ -5753,7 +5753,7 @@ static unsigned char m851[256] = {
0x00, 0x70, 0xf0, 0xf0, 0x40, 0x00, 0x70, 0xc0,
};
-static unsigned char m852[256] = {
+static guchar m852[256] = {
0x0c, 0x08, 0x0c, 0x08, 0x08, 0x08, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c,
0x08, 0x0f, 0x0c, 0x0f, 0x0d, 0x0c, 0x0c, 0x0f,
@@ -5788,7 +5788,7 @@ static unsigned char m852[256] = {
0x0c, 0x0c, 0x0d, 0x0f, 0x08, 0x0c, 0x0c, 0x0f,
};
-static unsigned char m861[256] = {
+static guchar m861[256] = {
0x40, 0x00, 0xf0, 0x00, 0x40, 0x40, 0xf0, 0xf0,
0x00, 0x00, 0xf0, 0x70, 0x00, 0x40, 0x40, 0x00,
0x40, 0x40, 0x40, 0x70, 0x00, 0x00, 0xf0, 0xf0,
@@ -5823,7 +5823,7 @@ static unsigned char m861[256] = {
0x70, 0x70, 0x40, 0x70, 0x40, 0x40, 0xf0, 0x00,
};
-static unsigned char m862[256] = {
+static guchar m862[256] = {
0x0c, 0x0c, 0x09, 0x08, 0x0c, 0x0e, 0x0d, 0x0d,
0x08, 0x0c, 0x0d, 0x0c, 0x0c, 0x08, 0x08, 0x08,
0x08, 0x0e, 0x00, 0x08, 0x00, 0x08, 0x0b, 0x0d,
@@ -5858,7 +5858,7 @@ static unsigned char m862[256] = {
0x0e, 0x0e, 0x0c, 0x0c, 0x08, 0x08, 0x0f, 0x08,
};
-static unsigned char m871[256] = {
+static guchar m871[256] = {
0xf0, 0x00, 0xf0, 0xf0, 0x40, 0x40, 0x70, 0x40,
0xf0, 0x70, 0x70, 0x40, 0x00, 0x70, 0x40, 0x40,
0x40, 0x70, 0x70, 0x40, 0x40, 0x00, 0x00, 0x00,
@@ -5893,7 +5893,7 @@ static unsigned char m871[256] = {
0x40, 0xf0, 0x40, 0xf0, 0x00, 0x00, 0xf0, 0x40,
};
-static unsigned char m872[256] = {
+static guchar m872[256] = {
0x0f, 0x0c, 0x0f, 0x0f, 0x0c, 0x0c, 0x0c, 0x0e,
0x0f, 0x0e, 0x0e, 0x0c, 0x0c, 0x0e, 0x0c, 0x08,
0x08, 0x0c, 0x0e, 0x0e, 0x08, 0x0a, 0x08, 0x02,
@@ -5928,7 +5928,7 @@ static unsigned char m872[256] = {
0x08, 0x0f, 0x0c, 0x0d, 0x0c, 0x08, 0x0f, 0x0c,
};
-static unsigned char m881[256] = {
+static guchar m881[256] = {
0x00, 0x40, 0x00, 0x40, 0x00, 0xf0, 0x40, 0x00,
0x00, 0x40, 0x40, 0x40, 0x00, 0x70, 0x70, 0x70,
0x40, 0x70, 0x40, 0x40, 0x40, 0x70, 0x70, 0x00,
@@ -5963,7 +5963,7 @@ static unsigned char m881[256] = {
0xf0, 0x70, 0x00, 0x00, 0x70, 0xf0, 0x70, 0x00,
};
-static unsigned char m882[256] = {
+static guchar m882[256] = {
0x0c, 0x0c, 0x0c, 0x0e, 0x08, 0x0d, 0x0c, 0x08,
0x0c, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c, 0x08, 0x08,
0x0c, 0x0c, 0x08, 0x0e, 0x0c, 0x0e, 0x0e, 0x0c,
@@ -5998,7 +5998,7 @@ static unsigned char m882[256] = {
0x0f, 0x0e, 0x0c, 0x0c, 0x0e, 0x0d, 0x0e, 0x08,
};
-static unsigned char m891[256] = {
+static guchar m891[256] = {
0x00, 0x40, 0x70, 0x00, 0x70, 0x00, 0x40, 0xf0,
0x00, 0x00, 0x70, 0x00, 0x70, 0x40, 0x40, 0x40,
0xf0, 0x00, 0xf0, 0xf0, 0x00, 0x40, 0x40, 0x00,
@@ -6033,7 +6033,7 @@ static unsigned char m891[256] = {
0xf0, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40,
};
-static unsigned char m892[256] = {
+static guchar m892[256] = {
0x08, 0x0c, 0x0e, 0x08, 0x00, 0x0c, 0x0c, 0x0d,
0x08, 0x0c, 0x0e, 0x0c, 0x0c, 0x08, 0x0c, 0x08,
0x0f, 0x0c, 0x0f, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -6068,7 +6068,7 @@ static unsigned char m892[256] = {
0x0d, 0x08, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x0c,
};
-static unsigned char m8a1[256] = {
+static guchar m8a1[256] = {
0xf0, 0x00, 0xf0, 0xf0, 0x40, 0x40, 0x00, 0x40,
0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x40,
0x70, 0x40, 0x40, 0xf0, 0x40, 0x40, 0xf0, 0xf0,
@@ -6103,7 +6103,7 @@ static unsigned char m8a1[256] = {
0xf0, 0x00, 0xf0, 0x00, 0x40, 0x00, 0xf0, 0x40,
};
-static unsigned char m8a2[256] = {
+static guchar m8a2[256] = {
0x0f, 0x00, 0x0d, 0x0d, 0x0c, 0x08, 0x08, 0x0e,
0x0d, 0x08, 0x0d, 0x08, 0x0d, 0x08, 0x0d, 0x0c,
0x0c, 0x0c, 0x0c, 0x0d, 0x08, 0x0c, 0x0d, 0x0d,
@@ -6138,7 +6138,7 @@ static unsigned char m8a2[256] = {
0x0d, 0x08, 0x0d, 0x0c, 0x0c, 0x08, 0x0d, 0x0c,
};
-static unsigned char m8b1[256] = {
+static guchar m8b1[256] = {
0xf0, 0xf0, 0xf0, 0x00, 0xf0, 0x40, 0x40, 0x70,
0x00, 0x00, 0x40, 0x40, 0x70, 0x00, 0xf0, 0x00,
0xf0, 0x40, 0x00, 0x00, 0xf0, 0x00, 0xf0, 0xf0,
@@ -6173,7 +6173,7 @@ static unsigned char m8b1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m8b2[256] = {
+static guchar m8b2[256] = {
0x0d, 0x0d, 0x0d, 0x08, 0x0d, 0x0c, 0x0c, 0x0e,
0x0c, 0x08, 0x0c, 0x0c, 0x08, 0x0c, 0x0d, 0x0c,
0x0d, 0x0c, 0x0c, 0x0c, 0x0d, 0x0c, 0x0d, 0x0d,
@@ -6208,7 +6208,7 @@ static unsigned char m8b2[256] = {
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
};
-static unsigned char m8c1[256] = {
+static guchar m8c1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -6243,7 +6243,7 @@ static unsigned char m8c1[256] = {
0x40, 0x00, 0x70, 0xf0, 0xf0, 0xf0, 0x40, 0x40,
};
-static unsigned char m8c2[256] = {
+static guchar m8c2[256] = {
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
@@ -6278,7 +6278,7 @@ static unsigned char m8c2[256] = {
0x0c, 0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x0c, 0x08,
};
-static unsigned char m8d1[256] = {
+static guchar m8d1[256] = {
0x00, 0x40, 0x00, 0x40, 0xf0, 0xf0, 0x00, 0xf0,
0xf0, 0x40, 0xf0, 0x70, 0x00, 0xf0, 0x00, 0x70,
0x70, 0x00, 0x40, 0xf0, 0x70, 0x00, 0xf0, 0x40,
@@ -6313,7 +6313,7 @@ static unsigned char m8d1[256] = {
0x00, 0x00, 0x00, 0x00, 0x70, 0x40, 0x00, 0x70,
};
-static unsigned char m8d2[256] = {
+static guchar m8d2[256] = {
0x0c, 0x08, 0x0c, 0x08, 0x0d, 0x0d, 0x0c, 0x0d,
0x0d, 0x0c, 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x0c,
0x0c, 0x08, 0x08, 0x0d, 0x0c, 0x0c, 0x0d, 0x0c,
@@ -6348,7 +6348,7 @@ static unsigned char m8d2[256] = {
0x02, 0x02, 0x0e, 0x02, 0x0c, 0x0e, 0x0c, 0x0c,
};
-static unsigned char m8e1[256] = {
+static guchar m8e1[256] = {
0x00, 0x40, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00,
0x70, 0x70, 0xf0, 0x40, 0x00, 0x00, 0x00, 0xf0,
0xf0, 0x40, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00,
@@ -6383,7 +6383,7 @@ static unsigned char m8e1[256] = {
0xf0, 0x40, 0x40, 0xf0, 0x70, 0x70, 0xf0, 0x00,
};
-static unsigned char m8e2[256] = {
+static guchar m8e2[256] = {
0x0c, 0x08, 0x0c, 0x0c, 0x0c, 0x0e, 0x0c, 0x0c,
0x08, 0x0e, 0x0f, 0x08, 0x02, 0x0c, 0x00, 0x0f,
0x0d, 0x0c, 0x0c, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c,
@@ -6418,7 +6418,7 @@ static unsigned char m8e2[256] = {
0x0d, 0x0c, 0x0c, 0x0d, 0x0c, 0x08, 0x0d, 0x0c,
};
-static unsigned char m8f1[256] = {
+static guchar m8f1[256] = {
0x40, 0x00, 0x40, 0xf0, 0x00, 0xf0, 0x00, 0x40,
0x40, 0xf0, 0x70, 0x00, 0x70, 0x00, 0x00, 0x40,
0x40, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x40, 0x40,
@@ -6453,7 +6453,7 @@ static unsigned char m8f1[256] = {
0x70, 0xf0, 0x70, 0x40, 0x00, 0xf0, 0x40, 0x00,
};
-static unsigned char m8f2[256] = {
+static guchar m8f2[256] = {
0x0c, 0x0c, 0x0c, 0x0d, 0x08, 0x0d, 0x0c, 0x0c,
0x0c, 0x0d, 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x08,
0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x0d, 0x0c, 0x0c,
@@ -6488,7 +6488,7 @@ static unsigned char m8f2[256] = {
0x0e, 0x0b, 0x0c, 0x0c, 0x0c, 0x0f, 0x0c, 0x0c,
};
-static unsigned char m901[256] = {
+static guchar m901[256] = {
0xf0, 0xf0, 0xc0, 0xf0, 0x40, 0xf0, 0xf0, 0x00,
0xc0, 0x00, 0x00, 0xf0, 0x40, 0xf0, 0x70, 0xf0,
0xf0, 0xf0, 0x00, 0x70, 0xf0, 0xf0, 0x70, 0xf0,
@@ -6523,7 +6523,7 @@ static unsigned char m901[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x40, 0x40,
};
-static unsigned char m902[256] = {
+static guchar m902[256] = {
0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0f, 0x0f, 0x08,
0x09, 0x0a, 0x02, 0x0f, 0x0c, 0x0f, 0x08, 0x0f,
0x0f, 0x0f, 0x0a, 0x08, 0x0f, 0x0d, 0x0e, 0x0f,
@@ -6558,7 +6558,7 @@ static unsigned char m902[256] = {
0x02, 0x0c, 0x0c, 0x0c, 0x0c, 0x0f, 0x0e, 0x0c,
};
-static unsigned char m911[256] = {
+static guchar m911[256] = {
0x40, 0x00, 0xf0, 0x00, 0x40, 0x40, 0x40, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x40, 0x00, 0xf0, 0x00, 0x40, 0x80, 0x40, 0x40,
@@ -6593,7 +6593,7 @@ static unsigned char m911[256] = {
0x00, 0x40, 0x00, 0x40, 0x70, 0x40, 0x00, 0x70,
};
-static unsigned char m912[256] = {
+static guchar m912[256] = {
0x0c, 0x0c, 0x0f, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0d, 0x08, 0x0c, 0x09, 0x0c, 0x0c,
@@ -6628,7 +6628,7 @@ static unsigned char m912[256] = {
0x0c, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x0c,
};
-static unsigned char m921[256] = {
+static guchar m921[256] = {
0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40,
0x00, 0x40, 0x40, 0x00, 0x40, 0xf0, 0x70, 0x00,
0xc0, 0xf0, 0xc0, 0x40, 0x70, 0x70, 0x40, 0x80,
@@ -6663,7 +6663,7 @@ static unsigned char m921[256] = {
0xf0, 0x40, 0x70, 0x40, 0xf0, 0x00, 0x00, 0x40,
};
-static unsigned char m922[256] = {
+static guchar m922[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x08, 0x0c, 0x0c, 0x08, 0x0c, 0x0d, 0x08, 0x0c,
0x0d, 0x0d, 0x0d, 0x08, 0x0c, 0x0c, 0x0c, 0x0d,
@@ -6698,7 +6698,7 @@ static unsigned char m922[256] = {
0x0d, 0x0c, 0x0c, 0x0c, 0x0d, 0x08, 0x0c, 0x0c,
};
-static unsigned char m931[256] = {
+static guchar m931[256] = {
0x40, 0x00, 0x40, 0x00, 0x80, 0x00, 0x70, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x70,
0xf0, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00,
@@ -6733,7 +6733,7 @@ static unsigned char m931[256] = {
0x40, 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, 0x00,
};
-static unsigned char m932[256] = {
+static guchar m932[256] = {
0x0c, 0x0c, 0x0c, 0x08, 0x0d, 0x08, 0x0c, 0x08,
0x0c, 0x0c, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0d, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x08,
@@ -6768,7 +6768,7 @@ static unsigned char m932[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m941[256] = {
+static guchar m941[256] = {
0x00, 0x40, 0x40, 0x70, 0xc0, 0x00, 0x00, 0x70,
0x40, 0x40, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40,
0x70, 0x00, 0x00, 0x70, 0x70, 0x40, 0x40, 0x40,
@@ -6803,7 +6803,7 @@ static unsigned char m941[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m942[256] = {
+static guchar m942[256] = {
0x0c, 0x08, 0x08, 0x0c, 0x09, 0x08, 0x0c, 0x0c,
0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x08,
@@ -6838,7 +6838,7 @@ static unsigned char m942[256] = {
0x02, 0x02, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02,
};
-static unsigned char m951[256] = {
+static guchar m951[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -6873,7 +6873,7 @@ static unsigned char m951[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m952[256] = {
+static guchar m952[256] = {
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
@@ -6908,7 +6908,7 @@ static unsigned char m952[256] = {
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00,
};
-static unsigned char m961[256] = {
+static guchar m961[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -6943,7 +6943,7 @@ static unsigned char m961[256] = {
0x00, 0xf0, 0x40, 0xf0, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m962[256] = {
+static guchar m962[256] = {
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02,
@@ -6978,7 +6978,7 @@ static unsigned char m962[256] = {
0x0c, 0x0f, 0x0c, 0x0d, 0x08, 0x0c, 0x02, 0x0c,
};
-static unsigned char m971[256] = {
+static guchar m971[256] = {
0xf0, 0x00, 0x40, 0x40, 0x70, 0x40, 0xf0, 0xf0,
0x70, 0x40, 0x70, 0x00, 0x00, 0x70, 0x70, 0x70,
0x00, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0xf0, 0x00,
@@ -7013,7 +7013,7 @@ static unsigned char m971[256] = {
0x40, 0x00, 0x40, 0xf0, 0x00, 0x00, 0x00, 0xf0,
};
-static unsigned char m972[256] = {
+static guchar m972[256] = {
0x0f, 0x02, 0x0c, 0x08, 0x0e, 0x0c, 0x0f, 0x0f,
0x0e, 0x0e, 0x08, 0x0c, 0x08, 0x0e, 0x0e, 0x0e,
0x0c, 0x0d, 0x0c, 0x0f, 0x08, 0x08, 0x0f, 0x08,
@@ -7048,7 +7048,7 @@ static unsigned char m972[256] = {
0x0c, 0x0c, 0x0c, 0x0d, 0x08, 0x0c, 0x0c, 0x0d,
};
-static unsigned char m981[256] = {
+static guchar m981[256] = {
0x80, 0xf0, 0xf0, 0xf0, 0x00, 0xf0, 0xf0, 0x40,
0xf0, 0x00, 0xc0, 0x00, 0xf0, 0x40, 0x40, 0x70,
0xf0, 0xf0, 0xf0, 0xf0, 0x40, 0x00, 0x40, 0xf0,
@@ -7083,7 +7083,7 @@ static unsigned char m981[256] = {
0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0x00,
};
-static unsigned char m982[256] = {
+static guchar m982[256] = {
0x0d, 0x0d, 0x0d, 0x0d, 0x0c, 0x0d, 0x0d, 0x0c,
0x0d, 0x08, 0x0d, 0x08, 0x0d, 0x0c, 0x0c, 0x0c,
0x0d, 0x0d, 0x0d, 0x0d, 0x08, 0x08, 0x0c, 0x0d,
@@ -7118,7 +7118,7 @@ static unsigned char m982[256] = {
0x08, 0x0c, 0x0c, 0x08, 0x0d, 0x0d, 0x0d, 0x08,
};
-static unsigned char m991[256] = {
+static guchar m991[256] = {
0x00, 0x00, 0x40, 0xf0, 0x00, 0x70, 0x00, 0x40,
0x40, 0xf0, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00,
0xf0, 0x40, 0x70, 0xf0, 0x70, 0x40, 0x40, 0x40,
@@ -7153,7 +7153,7 @@ static unsigned char m991[256] = {
0x70, 0x40, 0x00, 0x70, 0x00, 0x40, 0x40, 0xf0,
};
-static unsigned char m992[256] = {
+static guchar m992[256] = {
0x0c, 0x08, 0x0c, 0x0d, 0x08, 0x0c, 0x08, 0x0c,
0x0c, 0x0d, 0x0d, 0x08, 0x0d, 0x02, 0x08, 0x00,
0x0f, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, 0x0c,
@@ -7188,7 +7188,7 @@ static unsigned char m992[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0d,
};
-static unsigned char m9a1[256] = {
+static guchar m9a1[256] = {
0x00, 0xf0, 0x40, 0x40, 0x40, 0x70, 0x00, 0x00,
0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0xf0, 0xf0,
0x40, 0x40, 0x70, 0x70, 0x00, 0x00, 0x40, 0x00,
@@ -7223,7 +7223,7 @@ static unsigned char m9a1[256] = {
0x00, 0x40, 0x40, 0x70, 0x00, 0x40, 0x00, 0x40,
};
-static unsigned char m9a2[256] = {
+static guchar m9a2[256] = {
0x08, 0x0d, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x09, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x0d, 0x0d,
0x08, 0x0c, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x08,
@@ -7258,7 +7258,7 @@ static unsigned char m9a2[256] = {
0x08, 0x0e, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c, 0x08,
};
-static unsigned char m9b1[256] = {
+static guchar m9b1[256] = {
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x70, 0x00,
0x40, 0x40, 0x00, 0x40, 0x40, 0x40, 0x40, 0x00,
0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00,
@@ -7293,7 +7293,7 @@ static unsigned char m9b1[256] = {
0x40, 0x40, 0x40, 0x00, 0x00, 0x40, 0x00, 0x40,
};
-static unsigned char m9b2[256] = {
+static guchar m9b2[256] = {
0x08, 0x0c, 0x08, 0x0e, 0x0c, 0x0c, 0x0c, 0x08,
0x0e, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0a,
0x0c, 0x0c, 0x0c, 0x02, 0x08, 0x0c, 0x0c, 0x0c,
@@ -7328,7 +7328,7 @@ static unsigned char m9b2[256] = {
0x0c, 0x08, 0x08, 0x08, 0x08, 0x0c, 0x08, 0x08,
};
-static unsigned char m9c1[256] = {
+static guchar m9c1[256] = {
0x40, 0x00, 0x40, 0x00, 0x70, 0x00, 0x70, 0x00,
0x70, 0x70, 0x70, 0x40, 0x70, 0xf0, 0x00, 0x40,
0xf0, 0x40, 0xf0, 0x70, 0x70, 0xf0, 0x40, 0x00,
@@ -7363,7 +7363,7 @@ static unsigned char m9c1[256] = {
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m9c2[256] = {
+static guchar m9c2[256] = {
0x08, 0x08, 0x08, 0x08, 0x08, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x0d, 0x0c, 0x08,
0x09, 0x08, 0x0d, 0x0c, 0x0c, 0x09, 0x08, 0x0c,
@@ -7398,7 +7398,7 @@ static unsigned char m9c2[256] = {
0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x0c,
};
-static unsigned char m9d1[256] = {
+static guchar m9d1[256] = {
0x00, 0x00, 0x40, 0x70, 0x00, 0x00, 0x70, 0x70,
0x70, 0xf0, 0x00, 0x40, 0x00, 0x00, 0x70, 0x00,
0x00, 0x40, 0x70, 0x00, 0x00, 0x70, 0x00, 0x40,
@@ -7433,7 +7433,7 @@ static unsigned char m9d1[256] = {
0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x70, 0x40, 0x00,
};
-static unsigned char m9d2[256] = {
+static guchar m9d2[256] = {
0x0c, 0x08, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0d, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08,
0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x0c, 0x08, 0x0c,
@@ -7468,7 +7468,7 @@ static unsigned char m9d2[256] = {
0x0d, 0x0d, 0x0d, 0x0c, 0x08, 0x0c, 0x0c, 0x0c,
};
-static unsigned char m9e1[256] = {
+static guchar m9e1[256] = {
0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00,
0x40, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00,
@@ -7503,7 +7503,7 @@ static unsigned char m9e1[256] = {
0x40, 0x70, 0x00, 0x70, 0x70, 0x70, 0x00, 0x40,
};
-static unsigned char m9e2[256] = {
+static guchar m9e2[256] = {
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x08, 0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x08, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x0c,
@@ -7538,7 +7538,7 @@ static unsigned char m9e2[256] = {
0x08, 0x0e, 0x0c, 0x0e, 0x0e, 0x0c, 0x0a, 0x0c,
};
-static unsigned char m9f1[256] = {
+static guchar m9f1[256] = {
0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0xf0,
0xf0, 0x40, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x40,
0x40, 0x40, 0x40, 0xf0, 0x40, 0x70, 0x40, 0x40,
@@ -7573,7 +7573,7 @@ static unsigned char m9f1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char m9f2[256] = {
+static guchar m9f2[256] = {
0x0c, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x0c, 0x0d,
0x09, 0x0c, 0x0c, 0x02, 0x00, 0x02, 0x0f, 0x0c,
0x0e, 0x08, 0x0c, 0x0f, 0x08, 0x0c, 0x0c, 0x0a,
@@ -7608,7 +7608,7 @@ static unsigned char m9f2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mac1[256] = {
+static guchar mac1[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
@@ -7643,7 +7643,7 @@ static unsigned char mac1[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
};
-static unsigned char mac2[256] = {
+static guchar mac2[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01,
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
@@ -7678,7 +7678,7 @@ static unsigned char mac2[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};
-static unsigned char mad1[256] = {
+static guchar mad1[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -7713,7 +7713,7 @@ static unsigned char mad1[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
};
-static unsigned char mad2[256] = {
+static guchar mad2[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -7748,7 +7748,7 @@ static unsigned char mad2[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01,
};
-static unsigned char mae1[256] = {
+static guchar mae1[256] = {
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -7783,7 +7783,7 @@ static unsigned char mae1[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
};
-static unsigned char mae2[256] = {
+static guchar mae2[256] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -7818,7 +7818,7 @@ static unsigned char mae2[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};
-static unsigned char maf1[256] = {
+static guchar maf1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -7853,7 +7853,7 @@ static unsigned char maf1[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char maf2[256] = {
+static guchar maf2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -7888,7 +7888,7 @@ static unsigned char maf2[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb01[256] = {
+static guchar mb01[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -7923,7 +7923,7 @@ static unsigned char mb01[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb02[256] = {
+static guchar mb02[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -7958,7 +7958,7 @@ static unsigned char mb02[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb11[256] = {
+static guchar mb11[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00,
@@ -7993,7 +7993,7 @@ static unsigned char mb11[256] = {
0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
};
-static unsigned char mb12[256] = {
+static guchar mb12[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
@@ -8028,7 +8028,7 @@ static unsigned char mb12[256] = {
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
};
-static unsigned char mb21[256] = {
+static guchar mb21[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
@@ -8063,7 +8063,7 @@ static unsigned char mb21[256] = {
0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80,
};
-static unsigned char mb22[256] = {
+static guchar mb22[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
@@ -8098,7 +8098,7 @@ static unsigned char mb22[256] = {
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01,
};
-static unsigned char mb31[256] = {
+static guchar mb31[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00,
@@ -8133,7 +8133,7 @@ static unsigned char mb31[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
};
-static unsigned char mb32[256] = {
+static guchar mb32[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00,
@@ -8168,7 +8168,7 @@ static unsigned char mb32[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};
-static unsigned char mb41[256] = {
+static guchar mb41[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8203,7 +8203,7 @@ static unsigned char mb41[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb42[256] = {
+static guchar mb42[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8238,7 +8238,7 @@ static unsigned char mb42[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb51[256] = {
+static guchar mb51[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
@@ -8273,7 +8273,7 @@ static unsigned char mb51[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb52[256] = {
+static guchar mb52[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
@@ -8308,7 +8308,7 @@ static unsigned char mb52[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb61[256] = {
+static guchar mb61[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -8343,7 +8343,7 @@ static unsigned char mb61[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb62[256] = {
+static guchar mb62[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -8378,7 +8378,7 @@ static unsigned char mb62[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb71[256] = {
+static guchar mb71[256] = {
0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8413,7 +8413,7 @@ static unsigned char mb71[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
};
-static unsigned char mb72[256] = {
+static guchar mb72[256] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8448,7 +8448,7 @@ static unsigned char mb72[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
};
-static unsigned char mb81[256] = {
+static guchar mb81[256] = {
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8483,7 +8483,7 @@ static unsigned char mb81[256] = {
0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
};
-static unsigned char mb82[256] = {
+static guchar mb82[256] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8518,7 +8518,7 @@ static unsigned char mb82[256] = {
0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
};
-static unsigned char mb91[256] = {
+static guchar mb91[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8553,7 +8553,7 @@ static unsigned char mb91[256] = {
0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mb92[256] = {
+static guchar mb92[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8588,7 +8588,7 @@ static unsigned char mb92[256] = {
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mba1[256] = {
+static guchar mba1[256] = {
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
@@ -8623,7 +8623,7 @@ static unsigned char mba1[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
};
-static unsigned char mba2[256] = {
+static guchar mba2[256] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
@@ -8658,7 +8658,7 @@ static unsigned char mba2[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};
-static unsigned char mbb1[256] = {
+static guchar mbb1[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8693,7 +8693,7 @@ static unsigned char mbb1[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
};
-static unsigned char mbb2[256] = {
+static guchar mbb2[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8728,7 +8728,7 @@ static unsigned char mbb2[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01,
};
-static unsigned char mbc1[256] = {
+static guchar mbc1[256] = {
0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x80,
0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80,
@@ -8763,7 +8763,7 @@ static unsigned char mbc1[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
};
-static unsigned char mbc2[256] = {
+static guchar mbc2[256] = {
0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
@@ -8798,7 +8798,7 @@ static unsigned char mbc2[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};
-static unsigned char mbd1[256] = {
+static guchar mbd1[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -8833,7 +8833,7 @@ static unsigned char mbd1[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mbd2[256] = {
+static guchar mbd2[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -8868,7 +8868,7 @@ static unsigned char mbd2[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mbe1[256] = {
+static guchar mbe1[256] = {
0x80, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -8903,7 +8903,7 @@ static unsigned char mbe1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mbe2[256] = {
+static guchar mbe2[256] = {
0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -8938,7 +8938,7 @@ static unsigned char mbe2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mbf1[256] = {
+static guchar mbf1[256] = {
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8973,7 +8973,7 @@ static unsigned char mbf1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mbf2[256] = {
+static guchar mbf2[256] = {
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9008,7 +9008,7 @@ static unsigned char mbf2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mc01[256] = {
+static guchar mc01[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9043,7 +9043,7 @@ static unsigned char mc01[256] = {
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mc02[256] = {
+static guchar mc02[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9078,7 +9078,7 @@ static unsigned char mc02[256] = {
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mc11[256] = {
+static guchar mc11[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
@@ -9113,7 +9113,7 @@ static unsigned char mc11[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
};
-static unsigned char mc12[256] = {
+static guchar mc12[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
@@ -9148,7 +9148,7 @@ static unsigned char mc12[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};
-static unsigned char mc21[256] = {
+static guchar mc21[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9183,7 +9183,7 @@ static unsigned char mc21[256] = {
0x80, 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00,
};
-static unsigned char mc22[256] = {
+static guchar mc22[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9218,7 +9218,7 @@ static unsigned char mc22[256] = {
0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
};
-static unsigned char mc31[256] = {
+static guchar mc31[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00,
@@ -9253,7 +9253,7 @@ static unsigned char mc31[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mc32[256] = {
+static guchar mc32[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00,
@@ -9288,7 +9288,7 @@ static unsigned char mc32[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mc41[256] = {
+static guchar mc41[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9323,7 +9323,7 @@ static unsigned char mc41[256] = {
0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80,
};
-static unsigned char mc42[256] = {
+static guchar mc42[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9358,7 +9358,7 @@ static unsigned char mc42[256] = {
0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
};
-static unsigned char mc51[256] = {
+static guchar mc51[256] = {
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -9393,7 +9393,7 @@ static unsigned char mc51[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80,
};
-static unsigned char mc52[256] = {
+static guchar mc52[256] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -9428,7 +9428,7 @@ static unsigned char mc52[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
};
-static unsigned char mc61[256] = {
+static guchar mc61[256] = {
0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9463,7 +9463,7 @@ static unsigned char mc61[256] = {
0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
};
-static unsigned char mc62[256] = {
+static guchar mc62[256] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9498,7 +9498,7 @@ static unsigned char mc62[256] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
};
-static unsigned char mc71[256] = {
+static guchar mc71[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
@@ -9533,7 +9533,7 @@ static unsigned char mc71[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mc72[256] = {
+static guchar mc72[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
@@ -9568,7 +9568,7 @@ static unsigned char mc72[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mc81[256] = {
+static guchar mc81[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x80, 0x00,
@@ -9603,7 +9603,7 @@ static unsigned char mc81[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
};
-static unsigned char mc82[256] = {
+static guchar mc82[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00,
@@ -9638,7 +9638,7 @@ static unsigned char mc82[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};
-static unsigned char mc91[256] = {
+static guchar mc91[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9673,7 +9673,7 @@ static unsigned char mc91[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
};
-static unsigned char mc92[256] = {
+static guchar mc92[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9708,7 +9708,7 @@ static unsigned char mc92[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};
-static unsigned char mca1[256] = {
+static guchar mca1[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -9743,7 +9743,7 @@ static unsigned char mca1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mca2[256] = {
+static guchar mca2[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -9778,7 +9778,7 @@ static unsigned char mca2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mcb1[256] = {
+static guchar mcb1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -9813,7 +9813,7 @@ static unsigned char mcb1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mcb2[256] = {
+static guchar mcb2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -9848,7 +9848,7 @@ static unsigned char mcb2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mcc1[256] = {
+static guchar mcc1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -9883,7 +9883,7 @@ static unsigned char mcc1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mcc2[256] = {
+static guchar mcc2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -9918,7 +9918,7 @@ static unsigned char mcc2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mcd1[256] = {
+static guchar mcd1[256] = {
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9953,7 +9953,7 @@ static unsigned char mcd1[256] = {
0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
};
-static unsigned char mcd2[256] = {
+static guchar mcd2[256] = {
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9988,7 +9988,7 @@ static unsigned char mcd2[256] = {
0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
};
-static unsigned char mce1[256] = {
+static guchar mce1[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
@@ -10023,7 +10023,7 @@ static unsigned char mce1[256] = {
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mce2[256] = {
+static guchar mce2[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -10058,7 +10058,7 @@ static unsigned char mce2[256] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mcf1[256] = {
+static guchar mcf1[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
@@ -10093,7 +10093,7 @@ static unsigned char mcf1[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
};
-static unsigned char mcf2[256] = {
+static guchar mcf2[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
@@ -10128,7 +10128,7 @@ static unsigned char mcf2[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};
-static unsigned char md01[256] = {
+static guchar md01[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10163,7 +10163,7 @@ static unsigned char md01[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md02[256] = {
+static guchar md02[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10198,7 +10198,7 @@ static unsigned char md02[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md11[256] = {
+static guchar md11[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10233,7 +10233,7 @@ static unsigned char md11[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md12[256] = {
+static guchar md12[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10268,7 +10268,7 @@ static unsigned char md12[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md21[256] = {
+static guchar md21[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10303,7 +10303,7 @@ static unsigned char md21[256] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md22[256] = {
+static guchar md22[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10338,7 +10338,7 @@ static unsigned char md22[256] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md31[256] = {
+static guchar md31[256] = {
0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00,
@@ -10373,7 +10373,7 @@ static unsigned char md31[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
};
-static unsigned char md32[256] = {
+static guchar md32[256] = {
0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
@@ -10408,7 +10408,7 @@ static unsigned char md32[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
};
-static unsigned char md41[256] = {
+static guchar md41[256] = {
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10443,7 +10443,7 @@ static unsigned char md41[256] = {
0x80, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
};
-static unsigned char md42[256] = {
+static guchar md42[256] = {
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10478,7 +10478,7 @@ static unsigned char md42[256] = {
0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
};
-static unsigned char md51[256] = {
+static guchar md51[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80,
@@ -10513,7 +10513,7 @@ static unsigned char md51[256] = {
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md52[256] = {
+static guchar md52[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
@@ -10548,7 +10548,7 @@ static unsigned char md52[256] = {
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md61[256] = {
+static guchar md61[256] = {
0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00,
@@ -10583,7 +10583,7 @@ static unsigned char md61[256] = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
};
-static unsigned char md62[256] = {
+static guchar md62[256] = {
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00,
@@ -10618,7 +10618,7 @@ static unsigned char md62[256] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};
-static unsigned char md71[256] = {
+static guchar md71[256] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10653,7 +10653,7 @@ static unsigned char md71[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char md72[256] = {
+static guchar md72[256] = {
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10688,7 +10688,7 @@ static unsigned char md72[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mf62[256] = {
+static guchar mf62[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10723,7 +10723,7 @@ static unsigned char mf62[256] = {
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
};
-static unsigned char mf72[256] = {
+static guchar mf72[256] = {
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
@@ -10758,7 +10758,7 @@ static unsigned char mf72[256] = {
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
};
-static unsigned char mf82[256] = {
+static guchar mf82[256] = {
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
@@ -10793,7 +10793,7 @@ static unsigned char mf82[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mf91[256] = {
+static guchar mf91[256] = {
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
@@ -10828,7 +10828,7 @@ static unsigned char mf91[256] = {
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
};
-static unsigned char mf92[256] = {
+static guchar mf92[256] = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
@@ -10863,7 +10863,7 @@ static unsigned char mf92[256] = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
};
-static unsigned char mfa1[256] = {
+static guchar mfa1[256] = {
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10898,7 +10898,7 @@ static unsigned char mfa1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mfa2[256] = {
+static guchar mfa2[256] = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x04, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10933,7 +10933,7 @@ static unsigned char mfa2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mfe2[256] = {
+static guchar mfe2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10968,7 +10968,7 @@ static unsigned char mfe2[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mff1[256] = {
+static guchar mff1[256] = {
0x00, 0xf0, 0x80, 0xf0, 0xf0, 0xf0, 0xf0, 0x80,
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x80, 0xf0, 0xf0,
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
@@ -11003,7 +11003,7 @@ static unsigned char mff1[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-static unsigned char mff2[256] = {
+static guchar mff2[256] = {
0x00, 0x0f, 0x03, 0x0f, 0x0f, 0x0f, 0x0f, 0x03,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
@@ -11039,9 +11039,9 @@ static unsigned char mff2[256] = {
};
static const struct {
- const unsigned char *bits0;
- const unsigned char *bits1;
- const unsigned char *bits2;
+ const guchar *bits0;
+ const guchar *bits1;
+ const guchar *bits2;
} camel_charmap[256] = {
{ m000, m001, m002, }, { m010, m011, m012, }, { m020, m021, m022, }, { m030, m031, m032, },
{ m040, m041, m042, }, { m050, m051, m052, }, { m060, m061, m062, }, { NULL, m071, m072, },
@@ -11110,8 +11110,8 @@ static const struct {
};
static const struct {
- const char *name;
- unsigned int bit;
+ const gchar *name;
+ guint bit;
} camel_charinfo[] = {
{ "iso-8859-2", 0x00000001 },
{ "iso-8859-4", 0x00000002 },
diff --git a/camel/camel-charset-map.c b/camel/camel-charset-map.c
index dc22d07e4..51f802a8a 100644
--- a/camel/camel-charset-map.c
+++ b/camel/camel-charset-map.c
@@ -59,9 +59,9 @@
#ifdef BUILD_MAP
static struct {
- char *name; /* charset name */
- int multibyte; /* charset type */
- unsigned int bit; /* assigned bit */
+ gchar *name; /* charset name */
+ gint multibyte; /* charset type */
+ guint bit; /* assigned bit */
} tables[] = {
/* These are the 8bit character sets (other than iso-8859-1,
* which is special-cased) which are supported by both other
@@ -100,7 +100,7 @@ static struct {
{ NULL, 0, 0 }
};
-unsigned int encoding_map[256 * 256];
+guint encoding_map[256 * 256];
#if G_BYTE_ORDER == G_BIG_ENDIAN
#define UCS "UCS-4BE"
@@ -111,9 +111,9 @@ unsigned int encoding_map[256 * 256];
static guint
block_hash (gconstpointer v)
{
- const signed char *p = v;
+ const gchar *p = v;
guint32 h = *p++;
- int i;
+ gint i;
for (i = 0; i < 256; i++)
h = (h << 5) - h + *p++;
@@ -127,17 +127,17 @@ block_equal (gconstpointer v1, gconstpointer v2)
return !memcmp (v1, v2, 256);
}
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
{
- unsigned char *block = NULL;
- unsigned int bit = 0x01;
+ guchar *block = NULL;
+ guint bit = 0x01;
GHashTable *table_hash;
size_t inleft, outleft;
- char *inbuf, *outbuf;
+ gchar *inbuf, *outbuf;
guint32 out[128], c;
- char in[128];
- int i, j, k;
- int bytes;
+ gchar in[128];
+ gint i, j, k;
+ gint bytes;
iconv_t cd;
/* dont count the terminator */
@@ -151,7 +151,7 @@ int main (int argc, char **argv)
cd = iconv_open (UCS, tables[j].name);
inbuf = in;
inleft = sizeof (in);
- outbuf = (char *) out;
+ outbuf = (gchar *) out;
outleft = sizeof (out);
while (iconv (cd, &inbuf, &inleft, &outbuf, &outleft) == -1) {
if (errno == EILSEQ) {
@@ -182,7 +182,7 @@ int main (int argc, char **argv)
continue;
for (c = 128, i = 0; c < 65535 && i < 65535; c++) {
- inbuf = (char *) &c;
+ inbuf = (gchar *) &c;
inleft = sizeof (c);
outbuf = in;
outleft = sizeof (in);
@@ -210,8 +210,8 @@ int main (int argc, char **argv)
for (i = 0; i < 256; i++) {
for (k = 0; k < bytes; k++) {
- char name[32], *alias;
- int has_bits = FALSE;
+ gchar name[32], *alias;
+ gint has_bits = FALSE;
if (!block) {
/* we reuse malloc'd blocks that are not added to the
@@ -236,7 +236,7 @@ int main (int argc, char **argv)
/* unique block, dump it */
g_hash_table_insert (table_hash, block, g_strdup (name));
- printf ("static unsigned char %s[256] = {\n\t", name);
+ printf ("static guchar %s[256] = {\n\t", name);
for (j = 0; j < 256; j++) {
printf ("0x%02x, ", block[j]);
if (((j + 1) & 7) == 0 && j < 255)
@@ -255,7 +255,7 @@ int main (int argc, char **argv)
printf ("static const struct {\n");
for (k = 0; k < bytes; k++)
- printf ("\tconst unsigned char *bits%d;\n", k);
+ printf ("\tconst guchar *bits%d;\n", k);
printf ("} camel_charmap[256] = {\n\t");
for (i = 0; i < 256; i++) {
@@ -278,7 +278,7 @@ int main (int argc, char **argv)
}
printf ("\n};\n\n");
- printf ("static const struct {\n\tconst char *name;\n\tunsigned int bit;\n} camel_charinfo[] = {\n");
+ printf ("static const struct {\n\tconst gchar *name;\n\tguint bit;\n} camel_charinfo[] = {\n");
for (j = 0; tables[j].name; j++)
printf ("\t{ \"%s\", 0x%08x },\n", tables[j].name, tables[j].bit);
printf ("};\n\n");
@@ -315,12 +315,12 @@ camel_charset_init (CamelCharset *c)
}
void
-camel_charset_step (CamelCharset *cc, const char *in, int len)
+camel_charset_step (CamelCharset *cc, const gchar *in, gint len)
{
- const unsigned char *inptr = (const unsigned char *) in;
- const unsigned char *inend = inptr + len;
- register unsigned int mask;
- register int level;
+ const guchar *inptr = (const guchar *) in;
+ const guchar *inend = inptr + len;
+ register guint mask;
+ register gint level;
register guint32 c;
mask = cc->mask;
@@ -347,11 +347,11 @@ camel_charset_step (CamelCharset *cc, const char *in, int len)
}
/* gets the best charset from the mask of chars in it */
-static const char *
-camel_charset_best_mask(unsigned int mask)
+static const gchar *
+camel_charset_best_mask(guint mask)
{
- const char *locale_lang, *lang;
- int i;
+ const gchar *locale_lang, *lang;
+ gint i;
locale_lang = camel_iconv_locale_language ();
for (i = 0; i < G_N_ELEMENTS (camel_charinfo); i++) {
@@ -366,7 +366,7 @@ camel_charset_best_mask(unsigned int mask)
return "UTF-8";
}
-const char *
+const gchar *
camel_charset_best_name (CamelCharset *charset)
{
if (charset->level == 1)
@@ -378,8 +378,8 @@ camel_charset_best_name (CamelCharset *charset)
}
/* finds the minimum charset for this string NULL means US-ASCII */
-const char *
-camel_charset_best (const char *in, int len)
+const gchar *
+camel_charset_best (const gchar *in, gint len)
{
CamelCharset charset;
@@ -395,8 +395,8 @@ camel_charset_best (const char *in, int len)
*
* Returns: the equivalent Windows charset.
**/
-const char *
-camel_charset_iso_to_windows (const char *isocharset)
+const gchar *
+camel_charset_iso_to_windows (const gchar *isocharset)
{
/* According to http://czyborra.com/charsets/codepages.html,
* the charset mapping is as follows:
diff --git a/camel/camel-charset-map.h b/camel/camel-charset-map.h
index 290c48029..bdc80843f 100644
--- a/camel/camel-charset-map.h
+++ b/camel/camel-charset-map.h
@@ -29,19 +29,19 @@ G_BEGIN_DECLS
typedef struct _CamelCharset CamelCharset;
struct _CamelCharset {
- unsigned int mask;
- int level;
+ guint mask;
+ gint level;
};
void camel_charset_init(CamelCharset *);
-void camel_charset_step(CamelCharset *, const char *in, int len);
+void camel_charset_step(CamelCharset *, const gchar *in, gint len);
-const char *camel_charset_best_name (CamelCharset *);
+const gchar *camel_charset_best_name (CamelCharset *);
/* helper function */
-const char *camel_charset_best(const char *in, int len);
+const gchar *camel_charset_best(const gchar *in, gint len);
-const char *camel_charset_iso_to_windows (const char *isocharset);
+const gchar *camel_charset_iso_to_windows (const gchar *isocharset);
G_END_DECLS
diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c
index 3f6b2731b..d0884d155 100644
--- a/camel/camel-cipher-context.c
+++ b/camel/camel-cipher-context.c
@@ -95,7 +95,7 @@ camel_cipher_context_construct (CamelCipherContext *context, CamelSession *sessi
}
static int
-cipher_sign (CamelCipherContext *ctx, const char *userid, CamelCipherHash hash,
+cipher_sign (CamelCipherContext *ctx, const gchar *userid, CamelCipherHash hash,
struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
{
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -117,11 +117,11 @@ cipher_sign (CamelCipherContext *ctx, const char *userid, CamelCipherHash hash,
*
* Return value: 0 for success or -1 for failure.
**/
-int
-camel_cipher_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
+gint
+camel_cipher_sign (CamelCipherContext *context, const gchar *userid, CamelCipherHash hash,
struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
{
- int retval;
+ gint retval;
g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
@@ -182,7 +182,7 @@ camel_cipher_verify (CamelCipherContext *context, struct _CamelMimePart *ipart,
}
static int
-cipher_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipients,
+cipher_encrypt (CamelCipherContext *context, const gchar *userid, GPtrArray *recipients,
struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
{
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -204,11 +204,11 @@ cipher_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *reci
*
* Return value: 0 for success or -1 for failure.
**/
-int
-camel_cipher_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipients,
+gint
+camel_cipher_encrypt (CamelCipherContext *context, const gchar *userid, GPtrArray *recipients,
struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
{
- int retval;
+ gint retval;
g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
@@ -284,7 +284,7 @@ cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream, C
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream, CamelException *ex)
{
g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
@@ -315,7 +315,7 @@ cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
struct _CamelStream *ostream, CamelException *ex)
{
@@ -327,27 +327,27 @@ camel_cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
}
static CamelCipherHash
-cipher_id_to_hash(CamelCipherContext *context, const char *id)
+cipher_id_to_hash(CamelCipherContext *context, const gchar *id)
{
return CAMEL_CIPHER_HASH_DEFAULT;
}
/* a couple of util functions */
CamelCipherHash
-camel_cipher_id_to_hash(CamelCipherContext *context, const char *id)
+camel_cipher_id_to_hash(CamelCipherContext *context, const gchar *id)
{
g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), CAMEL_CIPHER_HASH_DEFAULT);
return CCC_CLASS (context)->id_to_hash (context, id);
}
-static const char *
+static const gchar *
cipher_hash_to_id(CamelCipherContext *context, CamelCipherHash hash)
{
return NULL;
}
-const char *
+const gchar *
camel_cipher_hash_to_id(CamelCipherContext *context, CamelCipherHash hash)
{
g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), NULL);
@@ -467,7 +467,7 @@ camel_cipher_validity_clone(CamelCipherValidity *vin)
* Add a cert info to the signer or encrypter info.
**/
void
-camel_cipher_validity_add_certinfo(CamelCipherValidity *vin, enum _camel_cipher_validity_mode_t mode, const char *name, const char *email)
+camel_cipher_validity_add_certinfo(CamelCipherValidity *vin, enum _camel_cipher_validity_mode_t mode, const gchar *name, const gchar *email)
{
CamelCipherCertInfo *info;
CamelDList *list;
@@ -609,7 +609,7 @@ cc_prepare_sign(CamelMimePart *part)
{
CamelDataWrapper *dw;
CamelTransferEncoding encoding;
- int parts, i;
+ gint parts, i;
dw = camel_medium_get_content_object((CamelMedium *)part);
if (!dw)
@@ -643,12 +643,12 @@ cc_prepare_sign(CamelMimePart *part)
*
* Return value: -1 on error;
**/
-int
+gint
camel_cipher_canonical_to_stream(CamelMimePart *part, guint32 flags, CamelStream *ostream)
{
CamelStreamFilter *filter;
CamelMimeFilter *canon;
- int res = -1;
+ gint res = -1;
if (flags & (CAMEL_MIME_FILTER_CANON_FROM|CAMEL_MIME_FILTER_CANON_STRIP))
cc_prepare_sign(part);
diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h
index 033f7b129..251e6f4bc 100644
--- a/camel/camel-cipher-context.h
+++ b/camel/camel-cipher-context.h
@@ -74,8 +74,8 @@ struct _CamelCipherCertInfo {
struct _CamelCipherCertInfo *next;
struct _CamelCipherCertInfo *prev;
- char *name; /* common name */
- char *email;
+ gchar *name; /* common name */
+ gchar *email;
};
struct _CamelCipherValidity {
@@ -85,12 +85,12 @@ struct _CamelCipherValidity {
struct {
enum _camel_cipher_validity_sign_t status;
- char *description;
+ gchar *description;
CamelDList signers; /* CamelCipherCertInfo's */
} sign;
struct {
enum _camel_cipher_validity_encrypt_t status;
- char *description;
+ gchar *description;
CamelDList encrypters; /* CamelCipherCertInfo's */
} encrypt;
};
@@ -103,33 +103,33 @@ typedef struct _CamelCipherContext {
CamelSession *session;
/* these MUST be set by implementors */
- const char *sign_protocol;
- const char *encrypt_protocol;
- const char *key_protocol;
+ const gchar *sign_protocol;
+ const gchar *encrypt_protocol;
+ const gchar *key_protocol;
} CamelCipherContext;
typedef struct _CamelCipherContextClass {
CamelObjectClass parent_class;
- CamelCipherHash (*id_to_hash)(CamelCipherContext *context, const char *id);
- const char * (*hash_to_id)(CamelCipherContext *context, CamelCipherHash hash);
+ CamelCipherHash (*id_to_hash)(CamelCipherContext *context, const gchar *id);
+ const gchar * (*hash_to_id)(CamelCipherContext *context, CamelCipherHash hash);
- int (*sign) (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
+ gint (*sign) (CamelCipherContext *context, const gchar *userid, CamelCipherHash hash,
struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex);
CamelCipherValidity * (*verify) (CamelCipherContext *context, struct _CamelMimePart *ipart, CamelException *ex);
- int (*encrypt) (CamelCipherContext *context, const char *userid,
+ gint (*encrypt) (CamelCipherContext *context, const gchar *userid,
GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
CamelException *ex);
CamelCipherValidity *(*decrypt) (CamelCipherContext *context, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
CamelException *ex);
- int (*import_keys) (CamelCipherContext *context, struct _CamelStream *istream,
+ gint (*import_keys) (CamelCipherContext *context, struct _CamelStream *istream,
CamelException *ex);
- int (*export_keys) (CamelCipherContext *context, GPtrArray *keys,
+ gint (*export_keys) (CamelCipherContext *context, GPtrArray *keys,
struct _CamelStream *ostream, CamelException *ex);
} CamelCipherContextClass;
@@ -140,8 +140,8 @@ CamelCipherContext *camel_cipher_context_new (CamelSession *session);
void camel_cipher_context_construct (CamelCipherContext *context, CamelSession *session);
/* cipher context util routines */
-CamelCipherHash camel_cipher_id_to_hash (CamelCipherContext *context, const char *id);
-const char * camel_cipher_hash_to_id (CamelCipherContext *context, CamelCipherHash hash);
+CamelCipherHash camel_cipher_id_to_hash (CamelCipherContext *context, const gchar *id);
+const gchar * camel_cipher_hash_to_id (CamelCipherContext *context, CamelCipherHash hash);
/* FIXME:
There are some inconsistencies here, the api's should probably handle CamelMimePart's as input/outputs,
@@ -149,19 +149,19 @@ const char * camel_cipher_hash_to_id (CamelCipherContext *context, CamelCip
to the cipher, etc etc. */
/* cipher routines */
-int camel_cipher_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
+gint camel_cipher_sign (CamelCipherContext *context, const gchar *userid, CamelCipherHash hash,
struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex);
CamelCipherValidity *camel_cipher_verify (CamelCipherContext *context, struct _CamelMimePart *ipart, CamelException *ex);
-int camel_cipher_encrypt (CamelCipherContext *context, const char *userid,
+gint camel_cipher_encrypt (CamelCipherContext *context, const gchar *userid,
GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
CamelException *ex);
CamelCipherValidity *camel_cipher_decrypt (CamelCipherContext *context, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
CamelException *ex);
/* key/certificate routines */
-int camel_cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream,
+gint camel_cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream,
CamelException *ex);
-int camel_cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
+gint camel_cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
struct _CamelStream *ostream, CamelException *ex);
/* CamelCipherValidity utility functions */
@@ -169,11 +169,11 @@ CamelCipherValidity *camel_cipher_validity_new (void);
void camel_cipher_validity_init (CamelCipherValidity *validity);
gboolean camel_cipher_validity_get_valid (CamelCipherValidity *validity);
void camel_cipher_validity_set_valid (CamelCipherValidity *validity, gboolean valid);
-char *camel_cipher_validity_get_description (CamelCipherValidity *validity);
-void camel_cipher_validity_set_description (CamelCipherValidity *validity, const char *description);
+gchar *camel_cipher_validity_get_description (CamelCipherValidity *validity);
+void camel_cipher_validity_set_description (CamelCipherValidity *validity, const gchar *description);
void camel_cipher_validity_clear (CamelCipherValidity *validity);
CamelCipherValidity *camel_cipher_validity_clone(CamelCipherValidity *vin);
-void camel_cipher_validity_add_certinfo(CamelCipherValidity *vin, camel_cipher_validity_mode_t mode, const char *name, const char *email);
+void camel_cipher_validity_add_certinfo(CamelCipherValidity *vin, camel_cipher_validity_mode_t mode, const gchar *name, const gchar *email);
void camel_cipher_validity_envelope(CamelCipherValidity *parent, CamelCipherValidity *valid);
void camel_cipher_validity_free (CamelCipherValidity *validity);
diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c
index 6e5abce8e..02831d066 100644
--- a/camel/camel-data-cache.c
+++ b/camel/camel-data-cache.c
@@ -44,7 +44,7 @@
#include "camel-stream-mem.h"
#include "camel-file-utils.h"
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
#define dd(x) (camel_verbose_debug?(x):0)
#define d(x)
@@ -127,7 +127,7 @@ camel_data_cache_get_type(void)
* be written to.
**/
CamelDataCache *
-camel_data_cache_new(const char *path, guint32 flags, CamelException *ex)
+camel_data_cache_new(const gchar *path, guint32 flags, CamelException *ex)
{
CamelDataCache *cdc;
@@ -190,10 +190,10 @@ camel_data_cache_set_expire_access(CamelDataCache *cdc, time_t when)
}
static void
-data_cache_expire(CamelDataCache *cdc, const char *path, const char *keep, time_t now)
+data_cache_expire(CamelDataCache *cdc, const gchar *path, const gchar *keep, time_t now)
{
GDir *dir;
- const char *dname;
+ const gchar *dname;
GString *s;
struct stat st;
CamelStream *stream;
@@ -230,10 +230,10 @@ data_cache_expire(CamelDataCache *cdc, const char *path, const char *keep, time_
lazily expire old data.
If it is this directories 'turn', and we haven't done it for CYCLE_TIME seconds,
then we perform an expiry run */
-static char *
-data_cache_path(CamelDataCache *cdc, int create, const char *path, const char *key)
+static gchar *
+data_cache_path(CamelDataCache *cdc, gint create, const gchar *path, const gchar *key)
{
- char *dir, *real, *tmp;
+ gchar *dir, *real, *tmp;
guint32 hash;
hash = g_str_hash(key);
@@ -287,9 +287,9 @@ data_cache_path(CamelDataCache *cdc, int create, const char *path, const char *k
* The caller must unref this when finished.
**/
CamelStream *
-camel_data_cache_add(CamelDataCache *cdc, const char *path, const char *key, CamelException *ex)
+camel_data_cache_add(CamelDataCache *cdc, const gchar *path, const gchar *key, CamelException *ex)
{
- char *real;
+ gchar *real;
CamelStream *stream;
real = data_cache_path(cdc, TRUE, path, key);
@@ -331,9 +331,9 @@ camel_data_cache_add(CamelDataCache *cdc, const char *path, const char *key, Cam
* Return value: A cache item, or NULL if the cache item does not exist.
**/
CamelStream *
-camel_data_cache_get(CamelDataCache *cdc, const char *path, const char *key, CamelException *ex)
+camel_data_cache_get(CamelDataCache *cdc, const gchar *path, const gchar *key, CamelException *ex)
{
- char *real;
+ gchar *real;
CamelStream *stream;
real = data_cache_path(cdc, FALSE, path, key);
@@ -363,9 +363,9 @@ camel_data_cache_get(CamelDataCache *cdc, const char *path, const char *key, Cam
* Return value: The filename for a cache item
**/
gchar *
-camel_data_cache_get_filename (CamelDataCache *cdc, const char *path, const char *key, CamelException *ex)
+camel_data_cache_get_filename (CamelDataCache *cdc, const gchar *path, const gchar *key, CamelException *ex)
{
- char *real;
+ gchar *real;
real = data_cache_path(cdc, FALSE, path, key);
@@ -383,12 +383,12 @@ camel_data_cache_get_filename (CamelDataCache *cdc, const char *path, const char
*
* Return value:
**/
-int
-camel_data_cache_remove(CamelDataCache *cdc, const char *path, const char *key, CamelException *ex)
+gint
+camel_data_cache_remove(CamelDataCache *cdc, const gchar *path, const gchar *key, CamelException *ex)
{
CamelStream *stream;
- char *real;
- int ret;
+ gchar *real;
+ gint ret;
real = data_cache_path(cdc, FALSE, path, key);
stream = camel_object_bag_get(cdc->priv->busy_bag, real);
@@ -426,8 +426,8 @@ camel_data_cache_remove(CamelDataCache *cdc, const char *path, const char *key,
*
* Return value: -1 on error.
**/
-int camel_data_cache_rename(CamelDataCache *cache,
- const char *old, const char *new, CamelException *ex)
+gint camel_data_cache_rename(CamelDataCache *cache,
+ const gchar *old, const gchar *new, CamelException *ex)
{
/* blah dont care yet */
return -1;
@@ -445,8 +445,8 @@ int camel_data_cache_rename(CamelDataCache *cache,
*
* Return value: -1 on error.
**/
-int
-camel_data_cache_clear(CamelDataCache *cache, const char *path, CamelException *ex)
+gint
+camel_data_cache_clear(CamelDataCache *cache, const gchar *path, CamelException *ex)
{
/* nor for this? */
return -1;
diff --git a/camel/camel-data-cache.h b/camel/camel-data-cache.h
index f3aa86719..dec0cc981 100644
--- a/camel/camel-data-cache.h
+++ b/camel/camel-data-cache.h
@@ -44,7 +44,7 @@ struct _CamelDataCache {
struct _CamelDataCachePrivate *priv;
- char *path;
+ gchar *path;
guint32 flags;
time_t expire_age;
@@ -57,36 +57,36 @@ struct _CamelDataCacheClass {
/* None are virtual yet */
#if 0
/* Virtual methods */
- CamelStream *(*add)(CamelDataCache *cmc, const char *path, const char *key, CamelException *ex);
- CamelStream *(*get)(CamelDataCache *cmc, const char *path, const char *key, CamelException *ex);
- int (*close)(CamelDataCache *cmc, CamelStream *stream, CamelException *ex);
- int (*remove)(CamelDataCache *cmc, const char *path, const char *key, CamelException *ex);
+ CamelStream *(*add)(CamelDataCache *cmc, const gchar *path, const gchar *key, CamelException *ex);
+ CamelStream *(*get)(CamelDataCache *cmc, const gchar *path, const gchar *key, CamelException *ex);
+ gint (*close)(CamelDataCache *cmc, CamelStream *stream, CamelException *ex);
+ gint (*remove)(CamelDataCache *cmc, const gchar *path, const gchar *key, CamelException *ex);
- int (*clear)(CamelDataCache *cmc, const char *path, CamelException *ex);
+ gint (*clear)(CamelDataCache *cmc, const gchar *path, CamelException *ex);
#endif
};
/* public methods */
-CamelDataCache *camel_data_cache_new(const char *path, guint32 flags, CamelException *ex);
+CamelDataCache *camel_data_cache_new(const gchar *path, guint32 flags, CamelException *ex);
void camel_data_cache_set_expire_age(CamelDataCache *cdc, time_t when);
void camel_data_cache_set_expire_access(CamelDataCache *cdc, time_t when);
-int camel_data_cache_rename(CamelDataCache *cache,
- const char *old, const char *new, CamelException *ex);
+gint camel_data_cache_rename(CamelDataCache *cache,
+ const gchar *old, const gchar *new, CamelException *ex);
CamelStream *camel_data_cache_add(CamelDataCache *cdc,
- const char *path, const char *key, CamelException *ex);
+ const gchar *path, const gchar *key, CamelException *ex);
CamelStream *camel_data_cache_get(CamelDataCache *cdc,
- const char *path, const char *key, CamelException *ex);
-int camel_data_cache_remove(CamelDataCache *cdc,
- const char *path, const char *key, CamelException *ex);
+ const gchar *path, const gchar *key, CamelException *ex);
+gint camel_data_cache_remove(CamelDataCache *cdc,
+ const gchar *path, const gchar *key, CamelException *ex);
-int camel_data_cache_clear(CamelDataCache *cache,
- const char *path, CamelException *ex);
+gint camel_data_cache_clear(CamelDataCache *cache,
+ const gchar *path, CamelException *ex);
gchar * camel_data_cache_get_filename(CamelDataCache *cdc,
- const char *path, const char *key, CamelException *ex);
+ const gchar *path, const gchar *key, CamelException *ex);
/* Standard Camel function */
CamelType camel_data_cache_get_type (void);
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
index a74336562..927fe6e54 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -42,10 +42,10 @@ static CamelObjectClass *parent_class = NULL;
/* Returns the class for a CamelDataWrapper */
#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static int construct_from_stream(CamelDataWrapper *, CamelStream *);
+static gint construct_from_stream(CamelDataWrapper *, CamelStream *);
static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
static ssize_t decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static void set_mime_type (CamelDataWrapper *data_wrapper, const char *mime_type);
+static void set_mime_type (CamelDataWrapper *data_wrapper, const gchar *mime_type);
static gchar *get_mime_type (CamelDataWrapper *data_wrapper);
static CamelContentType *get_mime_type_field (CamelDataWrapper *data_wrapper);
static void set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type);
@@ -260,7 +260,7 @@ construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_data_wrapper_construct_from_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream)
{
@@ -272,7 +272,7 @@ camel_data_wrapper_construct_from_stream (CamelDataWrapper *data_wrapper,
static void
-set_mime_type (CamelDataWrapper *data_wrapper, const char *mime_type)
+set_mime_type (CamelDataWrapper *data_wrapper, const gchar *mime_type)
{
if (data_wrapper->mime_type)
camel_content_type_unref (data_wrapper->mime_type);
@@ -295,7 +295,7 @@ set_mime_type (CamelDataWrapper *data_wrapper, const char *mime_type)
**/
void
camel_data_wrapper_set_mime_type (CamelDataWrapper *data_wrapper,
- const char *mime_type)
+ const gchar *mime_type)
{
g_return_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper));
g_return_if_fail (mime_type != NULL);
@@ -303,7 +303,7 @@ camel_data_wrapper_set_mime_type (CamelDataWrapper *data_wrapper,
CDW_CLASS (data_wrapper)->set_mime_type (data_wrapper, mime_type);
}
-static char *
+static gchar *
get_mime_type (CamelDataWrapper *data_wrapper)
{
return camel_content_type_simple (data_wrapper->mime_type);
@@ -316,7 +316,7 @@ get_mime_type (CamelDataWrapper *data_wrapper)
*
* Returns: the MIME type which must be freed by the caller
**/
-char *
+gchar *
camel_data_wrapper_get_mime_type (CamelDataWrapper *data_wrapper)
{
g_return_val_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper), NULL);
diff --git a/camel/camel-data-wrapper.h b/camel/camel-data-wrapper.h
index fd421ee2a..993a78984 100644
--- a/camel/camel-data-wrapper.h
+++ b/camel/camel-data-wrapper.h
@@ -47,7 +47,7 @@ struct _CamelDataWrapper {
CamelContentType *mime_type;
CamelStream *stream;
- unsigned int offline:1;
+ guint offline:1;
};
typedef struct {
@@ -55,8 +55,8 @@ typedef struct {
/* Virtual methods */
void (*set_mime_type) (CamelDataWrapper *data_wrapper,
- const char *mime_type);
- char * (*get_mime_type) (CamelDataWrapper *data_wrapper);
+ const gchar *mime_type);
+ gchar * (*get_mime_type) (CamelDataWrapper *data_wrapper);
CamelContentType * (*get_mime_type_field) (CamelDataWrapper *data_wrapper);
void (*set_mime_type_field) (CamelDataWrapper *data_wrapper,
CamelContentType *mime_type_field);
@@ -67,7 +67,7 @@ typedef struct {
ssize_t (*decode_to_stream) (CamelDataWrapper *data_wrapper,
CamelStream *stream);
- int (*construct_from_stream) (CamelDataWrapper *data_wrapper,
+ gint (*construct_from_stream) (CamelDataWrapper *data_wrapper,
CamelStream *);
gboolean (*is_offline) (CamelDataWrapper *data_wrapper);
@@ -84,13 +84,13 @@ ssize_t camel_data_wrapper_decode_to_stream (CamelDataWrapper *d
CamelStream *stream);
void camel_data_wrapper_set_mime_type (CamelDataWrapper *data_wrapper,
- const char *mime_type);
-char *camel_data_wrapper_get_mime_type (CamelDataWrapper *data_wrapper);
+ const gchar *mime_type);
+gchar *camel_data_wrapper_get_mime_type (CamelDataWrapper *data_wrapper);
CamelContentType *camel_data_wrapper_get_mime_type_field (CamelDataWrapper *data_wrapper);
void camel_data_wrapper_set_mime_type_field (CamelDataWrapper *data_wrapper,
CamelContentType *mime_type);
-int camel_data_wrapper_construct_from_stream (CamelDataWrapper *data_wrapper,
+gint camel_data_wrapper_construct_from_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream);
gboolean camel_data_wrapper_is_offline (CamelDataWrapper *data_wrapper);
diff --git a/camel/camel-db.c b/camel/camel-db.c
index 86fd43d00..72ec538ea 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -51,7 +51,7 @@ typedef struct {
} CamelSqlite3File;
static int
-call_old_file_Sync (CamelSqlite3File *cFile, int flags)
+call_old_file_Sync (CamelSqlite3File *cFile, gint flags)
{
g_return_val_if_fail (old_vfs != NULL, SQLITE_ERROR);
g_return_val_if_fail (cFile != NULL, SQLITE_ERROR);
@@ -146,20 +146,20 @@ camel_sqlite3_file_ ## _nm _params \
return cFile->old_vfs_file->pMethods->_nm _call; \
}
-def_subclassed (xRead, (sqlite3_file *pFile, void *pBuf, int iAmt, sqlite3_int64 iOfst), (cFile->old_vfs_file, pBuf, iAmt, iOfst))
-def_subclassed (xWrite, (sqlite3_file *pFile, const void *pBuf, int iAmt, sqlite3_int64 iOfst), (cFile->old_vfs_file, pBuf, iAmt, iOfst))
+def_subclassed (xRead, (sqlite3_file *pFile, gpointer pBuf, gint iAmt, sqlite3_int64 iOfst), (cFile->old_vfs_file, pBuf, iAmt, iOfst))
+def_subclassed (xWrite, (sqlite3_file *pFile, gconstpointer pBuf, gint iAmt, sqlite3_int64 iOfst), (cFile->old_vfs_file, pBuf, iAmt, iOfst))
def_subclassed (xTruncate, (sqlite3_file *pFile, sqlite3_int64 size), (cFile->old_vfs_file, size))
def_subclassed (xFileSize, (sqlite3_file *pFile, sqlite3_int64 *pSize), (cFile->old_vfs_file, pSize))
-def_subclassed (xLock, (sqlite3_file *pFile, int lockType), (cFile->old_vfs_file, lockType))
-def_subclassed (xUnlock, (sqlite3_file *pFile, int lockType), (cFile->old_vfs_file, lockType))
-def_subclassed (xFileControl, (sqlite3_file *pFile, int op, void *pArg), (cFile->old_vfs_file, op, pArg))
+def_subclassed (xLock, (sqlite3_file *pFile, gint lockType), (cFile->old_vfs_file, lockType))
+def_subclassed (xUnlock, (sqlite3_file *pFile, gint lockType), (cFile->old_vfs_file, lockType))
+def_subclassed (xFileControl, (sqlite3_file *pFile, gint op, gpointer pArg), (cFile->old_vfs_file, op, pArg))
def_subclassed (xSectorSize, (sqlite3_file *pFile), (cFile->old_vfs_file))
def_subclassed (xDeviceCharacteristics, (sqlite3_file *pFile), (cFile->old_vfs_file))
#undef def_subclassed
static int
-camel_sqlite3_file_xCheckReservedLock (sqlite3_file *pFile, int *pResOut)
+camel_sqlite3_file_xCheckReservedLock (sqlite3_file *pFile, gint *pResOut)
{
CamelSqlite3File *cFile;
@@ -171,16 +171,16 @@ camel_sqlite3_file_xCheckReservedLock (sqlite3_file *pFile, int *pResOut)
/* check version in runtime */
if (sqlite3_libversion_number () < 3006000)
- return ((int (*)(sqlite3_file *)) (cFile->old_vfs_file->pMethods->xCheckReservedLock)) (cFile->old_vfs_file);
+ return ((gint (*)(sqlite3_file *)) (cFile->old_vfs_file->pMethods->xCheckReservedLock)) (cFile->old_vfs_file);
else
- return ((int (*)(sqlite3_file *, int *)) (cFile->old_vfs_file->pMethods->xCheckReservedLock)) (cFile->old_vfs_file, pResOut);
+ return ((gint (*)(sqlite3_file *, gint *)) (cFile->old_vfs_file->pMethods->xCheckReservedLock)) (cFile->old_vfs_file, pResOut);
}
static int
camel_sqlite3_file_xClose (sqlite3_file *pFile)
{
CamelSqlite3File *cFile;
- int res;
+ gint res;
g_return_val_if_fail (old_vfs != NULL, SQLITE_ERROR);
g_return_val_if_fail (pFile != NULL, SQLITE_ERROR);
@@ -226,7 +226,7 @@ camel_sqlite3_file_xClose (sqlite3_file *pFile)
}
static int
-camel_sqlite3_file_xSync (sqlite3_file *pFile, int flags)
+camel_sqlite3_file_xSync (sqlite3_file *pFile, gint flags)
{
CamelSqlite3File *cFile;
@@ -257,13 +257,13 @@ camel_sqlite3_file_xSync (sqlite3_file *pFile, int flags)
}
static int
-camel_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs, const char *zPath, sqlite3_file *pFile, int flags, int *pOutFlags)
+camel_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs, const gchar *zPath, sqlite3_file *pFile, gint flags, gint *pOutFlags)
{
static GStaticRecMutex only_once_lock = G_STATIC_REC_MUTEX_INIT;
static sqlite3_io_methods io_methods = {0};
CamelSqlite3File *cFile;
GError *error = NULL;
- int res;
+ gint res;
g_return_val_if_fail (old_vfs != NULL, -1);
g_return_val_if_fail (pFile != NULL, -1);
@@ -292,7 +292,7 @@ camel_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs, const char *zPath, sqlite3_file *pFi
/* check version in compile time */
#if SQLITE_VERSION_NUMBER < 3006000
- io_methods.xCheckReservedLock = (int (*)(sqlite3_file *)) camel_sqlite3_file_xCheckReservedLock;
+ io_methods.xCheckReservedLock = (gint (*)(sqlite3_file *)) camel_sqlite3_file_xCheckReservedLock;
#else
io_methods.xCheckReservedLock = camel_sqlite3_file_xCheckReservedLock;
#endif
@@ -347,18 +347,18 @@ init_sqlite_vfs (void)
struct _CamelDBPrivate {
GTimer *timer;
- char *file_name;
+ gchar *file_name;
};
static GStaticRecMutex trans_lock = G_STATIC_REC_MUTEX_INIT;
-static int write_mir (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex, gboolean delete_old_record);
+static gint write_mir (CamelDB *cdb, const gchar *folder_name, CamelMIRecord *record, CamelException *ex, gboolean delete_old_record);
static int
-cdb_sql_exec (sqlite3 *db, const char* stmt, CamelException *ex)
+cdb_sql_exec (sqlite3 *db, const gchar * stmt, CamelException *ex)
{
- char *errmsg = NULL;
- int ret = -1;
+ gchar *errmsg = NULL;
+ gint ret = -1;
d(g_print("Camel SQL Exec:\n%s\n", stmt));
@@ -390,13 +390,13 @@ cdb_sql_exec (sqlite3 *db, const char* stmt, CamelException *ex)
}
CamelDB *
-camel_db_open (const char *path, CamelException *ex)
+camel_db_open (const gchar *path, CamelException *ex)
{
static GOnce vfs_once = G_ONCE_INIT;
CamelDB *cdb;
sqlite3 *db;
- char *cache;
- int ret;
+ gchar *cache;
+ gint ret;
g_once (&vfs_once, (GThreadFunc) init_sqlite_vfs, NULL);
@@ -408,7 +408,7 @@ camel_db_open (const char *path, CamelException *ex)
if (!db) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Insufficient memory"));
} else {
- const char *error;
+ const gchar *error;
error = sqlite3_errmsg (db);
d(g_print("Can't open database %s: %s\n", path, error));
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _(error));
@@ -467,10 +467,10 @@ camel_db_close (CamelDB *cdb)
}
}
-int
-camel_db_set_collate (CamelDB *cdb, const char *col, const char *collate, CamelDBCollate func)
+gint
+camel_db_set_collate (CamelDB *cdb, const gchar *col, const gchar *collate, CamelDBCollate func)
{
- int ret = 0;
+ gint ret = 0;
if (!cdb)
return 0;
@@ -485,10 +485,10 @@ camel_db_set_collate (CamelDB *cdb, const char *col, const char *collate, CamelD
}
/* Should this be really exposed ? */
-int
-camel_db_command (CamelDB *cdb, const char *stmt, CamelException *ex)
+gint
+camel_db_command (CamelDB *cdb, const gchar *stmt, CamelException *ex)
{
- int ret;
+ gint ret;
if (!cdb)
return TRUE;
@@ -503,7 +503,7 @@ camel_db_command (CamelDB *cdb, const char *stmt, CamelException *ex)
}
-int
+gint
camel_db_begin_transaction (CamelDB *cdb, CamelException *ex)
{
if (!cdb)
@@ -517,10 +517,10 @@ camel_db_begin_transaction (CamelDB *cdb, CamelException *ex)
return (cdb_sql_exec (cdb->db, "BEGIN", ex));
}
-int
+gint
camel_db_end_transaction (CamelDB *cdb, CamelException *ex)
{
- int ret;
+ gint ret;
if (!cdb)
return -1;
@@ -535,10 +535,10 @@ camel_db_end_transaction (CamelDB *cdb, CamelException *ex)
return ret;
}
-int
+gint
camel_db_abort_transaction (CamelDB *cdb, CamelException *ex)
{
- int ret;
+ gint ret;
ret = cdb_sql_exec (cdb->db, "ROLLBACK", ex);
g_mutex_unlock (cdb->lock);
@@ -549,8 +549,8 @@ camel_db_abort_transaction (CamelDB *cdb, CamelException *ex)
return ret;
}
-int
-camel_db_add_to_transaction (CamelDB *cdb, const char *stmt, CamelException *ex)
+gint
+camel_db_add_to_transaction (CamelDB *cdb, const gchar *stmt, CamelException *ex)
{
if (!cdb)
return -1;
@@ -558,11 +558,11 @@ camel_db_add_to_transaction (CamelDB *cdb, const char *stmt, CamelException *ex)
return (cdb_sql_exec (cdb->db, stmt, ex));
}
-int
+gint
camel_db_transaction_command (CamelDB *cdb, GSList *qry_list, CamelException *ex)
{
- int ret;
- const char *query;
+ gint ret;
+ const gchar *query;
if (!cdb)
return -1;
@@ -590,9 +590,9 @@ end:
}
static int
-count_cb (void *data, int argc, char **argv, char **azColName)
+count_cb (gpointer data, gint argc, gchar **argv, gchar **azColName)
{
- int i;
+ gint i;
for(i=0; i<argc; i++) {
if (strstr(azColName[i], "COUNT")) {
@@ -603,11 +603,11 @@ count_cb (void *data, int argc, char **argv, char **azColName)
return 0;
}
-int
-camel_db_count_message_info (CamelDB *cdb, const char *query, guint32 *count, CamelException *ex)
+gint
+camel_db_count_message_info (CamelDB *cdb, const gchar *query, guint32 *count, CamelException *ex)
{
- int ret = -1;
- char *errmsg = NULL;
+ gint ret = -1;
+ gchar *errmsg = NULL;
g_mutex_lock (cdb->lock);
@@ -644,11 +644,11 @@ camel_db_count_message_info (CamelDB *cdb, const char *query, guint32 *count, Ca
return ret;
}
-int
-camel_db_count_junk_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex)
+gint
+camel_db_count_junk_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex)
{
- int ret;
- char *query;
+ gint ret;
+ gchar *query;
if (!cdb)
return -1;
@@ -661,11 +661,11 @@ camel_db_count_junk_message_info (CamelDB *cdb, const char *table_name, guint32
return ret;
}
-int
-camel_db_count_unread_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex)
+gint
+camel_db_count_unread_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex)
{
- int ret;
- char *query;
+ gint ret;
+ gchar *query;
if (!cdb)
return -1;
@@ -678,11 +678,11 @@ camel_db_count_unread_message_info (CamelDB *cdb, const char *table_name, guint3
return ret;
}
-int
-camel_db_count_visible_unread_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex)
+gint
+camel_db_count_visible_unread_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex)
{
- int ret;
- char *query;
+ gint ret;
+ gchar *query;
if (!cdb)
return -1;
@@ -695,11 +695,11 @@ camel_db_count_visible_unread_message_info (CamelDB *cdb, const char *table_name
return ret;
}
-int
-camel_db_count_visible_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex)
+gint
+camel_db_count_visible_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex)
{
- int ret;
- char *query;
+ gint ret;
+ gchar *query;
if (!cdb)
return -1;
@@ -712,11 +712,11 @@ camel_db_count_visible_message_info (CamelDB *cdb, const char *table_name, guint
return ret;
}
-int
-camel_db_count_junk_not_deleted_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex)
+gint
+camel_db_count_junk_not_deleted_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex)
{
- int ret;
- char *query;
+ gint ret;
+ gchar *query;
if (!cdb)
return -1;
@@ -729,11 +729,11 @@ camel_db_count_junk_not_deleted_message_info (CamelDB *cdb, const char *table_na
return ret;
}
-int
-camel_db_count_deleted_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex)
+gint
+camel_db_count_deleted_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex)
{
- int ret;
- char *query;
+ gint ret;
+ gchar *query;
if (!cdb)
return -1;
@@ -747,12 +747,12 @@ camel_db_count_deleted_message_info (CamelDB *cdb, const char *table_name, guint
}
-int
-camel_db_count_total_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex)
+gint
+camel_db_count_total_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex)
{
- int ret;
- char *query;
+ gint ret;
+ gchar *query;
if (!cdb)
return -1;
@@ -765,12 +765,12 @@ camel_db_count_total_message_info (CamelDB *cdb, const char *table_name, guint32
return ret;
}
-int
-camel_db_select (CamelDB *cdb, const char* stmt, CamelDBSelectCB callback, gpointer data, CamelException *ex)
+gint
+camel_db_select (CamelDB *cdb, const gchar * stmt, CamelDBSelectCB callback, gpointer data, CamelException *ex)
{
- char *errmsg = NULL;
+ gchar *errmsg = NULL;
/*int nrecs = 0;*/
- int ret = -1;
+ gint ret = -1;
if (!cdb)
return ret;
@@ -810,11 +810,11 @@ camel_db_select (CamelDB *cdb, const char* stmt, CamelDBSelectCB callback, gpoin
return ret;
}
-int
-camel_db_create_vfolder (CamelDB *db, const char *folder_name, CamelException *ex)
+gint
+camel_db_create_vfolder (CamelDB *db, const gchar *folder_name, CamelException *ex)
{
- int ret;
- char *table_creation_query, *safe_index;
+ gint ret;
+ gchar *table_creation_query, *safe_index;
table_creation_query = sqlite3_mprintf ("CREATE TABLE IF NOT EXISTS %Q ( vuid TEXT PRIMARY KEY)", folder_name);
@@ -834,11 +834,11 @@ camel_db_create_vfolder (CamelDB *db, const char *folder_name, CamelException *e
return ret;
}
-int
-camel_db_recreate_vfolder (CamelDB *db, const char *folder_name, CamelException *ex)
+gint
+camel_db_recreate_vfolder (CamelDB *db, const gchar *folder_name, CamelException *ex)
{
- int ret;
- char *table_query;
+ gint ret;
+ gchar *table_query;
table_query = sqlite3_mprintf ("DROP TABLE %Q", folder_name);
@@ -850,11 +850,11 @@ camel_db_recreate_vfolder (CamelDB *db, const char *folder_name, CamelException
return camel_db_create_vfolder (db, folder_name, ex);
}
-int
-camel_db_delete_uid_from_vfolder (CamelDB *db, char *folder_name, char *vuid, CamelException *ex)
+gint
+camel_db_delete_uid_from_vfolder (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex)
{
- char *del_query;
- int ret;
+ gchar *del_query;
+ gint ret;
del_query = sqlite3_mprintf ("DELETE FROM %Q WHERE vuid = %Q", folder_name, vuid);
@@ -865,11 +865,11 @@ camel_db_delete_uid_from_vfolder (CamelDB *db, char *folder_name, char *vuid, Ca
return ret;
}
-int
-camel_db_delete_uid_from_vfolder_transaction (CamelDB *db, char *folder_name, char *vuid, CamelException *ex)
+gint
+camel_db_delete_uid_from_vfolder_transaction (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex)
{
- char *del_query;
- int ret;
+ gchar *del_query;
+ gint ret;
del_query = sqlite3_mprintf ("DELETE FROM %Q WHERE vuid = %Q", folder_name, vuid);
@@ -885,14 +885,14 @@ struct _db_data_uids_flags {
GPtrArray *flags;
};
static int
-read_uids_flags_callback (void *ref, int ncol, char ** cols, char ** name)
+read_uids_flags_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
struct _db_data_uids_flags *data= (struct _db_data_uids_flags *) ref;
- int i;
+ gint i;
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "uid"))
- g_ptr_array_add (data->uids, (char *) (camel_pstring_strdup(cols [i])));
+ g_ptr_array_add (data->uids, (gchar *) (camel_pstring_strdup(cols [i])));
else if (!strcmp (name [i], "flags"))
g_ptr_array_add (data->flags, GUINT_TO_POINTER(strtoul (cols [i], NULL, 10)));
}
@@ -900,15 +900,15 @@ read_uids_flags_callback (void *ref, int ncol, char ** cols, char ** name)
return 0;
}
-int
-camel_db_get_folder_uids_flags (CamelDB *db, const char *folder_name, const char *sort_by, const char *collate, GPtrArray *summary, GHashTable *table, CamelException *ex)
+gint
+camel_db_get_folder_uids_flags (CamelDB *db, const gchar *folder_name, const gchar *sort_by, const gchar *collate, GPtrArray *summary, GHashTable *table, CamelException *ex)
{
GPtrArray *uids = summary;
GPtrArray *flags = g_ptr_array_new ();
- char *sel_query;
- int ret;
+ gchar *sel_query;
+ gint ret;
struct _db_data_uids_flags data;
- int i;
+ gint i;
data.uids = uids;
data.flags = flags;
@@ -928,28 +928,28 @@ camel_db_get_folder_uids_flags (CamelDB *db, const char *folder_name, const char
}
static int
-read_uids_callback (void *ref, int ncol, char ** cols, char ** name)
+read_uids_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
GPtrArray *array = (GPtrArray *) ref;
#if 0
- int i;
+ gint i;
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "uid"))
- g_ptr_array_add (array, (char *) (camel_pstring_strdup(cols [i])));
+ g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols [i])));
}
#else
- g_ptr_array_add (array, (char *) (camel_pstring_strdup(cols [0])));
+ g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols [0])));
#endif
return 0;
}
-int
-camel_db_get_folder_uids (CamelDB *db, const char *folder_name, const char *sort_by, const char *collate, GPtrArray *array, CamelException *ex)
+gint
+camel_db_get_folder_uids (CamelDB *db, const gchar *folder_name, const gchar *sort_by, const gchar *collate, GPtrArray *array, CamelException *ex)
{
- char *sel_query;
- int ret;
+ gchar *sel_query;
+ gint ret;
sel_query = sqlite3_mprintf("SELECT uid FROM %Q%s%s%s%s", folder_name, sort_by ? " order by " : "", sort_by ? sort_by: "", (sort_by && collate) ? " collate " : "", (sort_by && collate) ? collate : "");
@@ -960,10 +960,10 @@ camel_db_get_folder_uids (CamelDB *db, const char *folder_name, const char *sort
}
GPtrArray *
-camel_db_get_folder_junk_uids (CamelDB *db, char *folder_name, CamelException *ex)
+camel_db_get_folder_junk_uids (CamelDB *db, gchar *folder_name, CamelException *ex)
{
- char *sel_query;
- int ret;
+ gchar *sel_query;
+ gint ret;
GPtrArray *array = g_ptr_array_new();
sel_query = sqlite3_mprintf("SELECT uid FROM %Q where junk=1", folder_name);
@@ -980,10 +980,10 @@ camel_db_get_folder_junk_uids (CamelDB *db, char *folder_name, CamelException *e
}
GPtrArray *
-camel_db_get_folder_deleted_uids (CamelDB *db, char *folder_name, CamelException *ex)
+camel_db_get_folder_deleted_uids (CamelDB *db, gchar *folder_name, CamelException *ex)
{
- char *sel_query;
- int ret;
+ gchar *sel_query;
+ gint ret;
GPtrArray *array = g_ptr_array_new();
sel_query = sqlite3_mprintf("SELECT uid FROM %Q where deleted=1", folder_name);
@@ -1000,12 +1000,12 @@ camel_db_get_folder_deleted_uids (CamelDB *db, char *folder_name, CamelException
}
static int
-read_preview_callback (void *ref, int ncol, char ** cols, char ** name)
+read_preview_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
GHashTable *hash = (GHashTable *)ref;
- const char *uid=NULL;
- char *msg=NULL;
- int i;
+ const gchar *uid=NULL;
+ gchar *msg=NULL;
+ gint i;
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "uid"))
@@ -1014,16 +1014,16 @@ read_preview_callback (void *ref, int ncol, char ** cols, char ** name)
msg = g_strdup(cols[i]);
}
- g_hash_table_insert(hash, (char *)uid, msg);
+ g_hash_table_insert(hash, (gchar *)uid, msg);
return 0;
}
GHashTable *
-camel_db_get_folder_preview (CamelDB *db, char *folder_name, CamelException *ex)
+camel_db_get_folder_preview (CamelDB *db, gchar *folder_name, CamelException *ex)
{
- char *sel_query;
- int ret;
+ gchar *sel_query;
+ gint ret;
GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal);
sel_query = sqlite3_mprintf("SELECT uid, preview FROM '%s_preview'", folder_name);
@@ -1039,11 +1039,11 @@ camel_db_get_folder_preview (CamelDB *db, char *folder_name, CamelException *ex)
return hash;
}
-int
-camel_db_write_preview_record (CamelDB *db, char *folder_name, const char *uid, const char *msg, CamelException *ex)
+gint
+camel_db_write_preview_record (CamelDB *db, gchar *folder_name, const gchar *uid, const gchar *msg, CamelException *ex)
{
- char *query;
- int ret;
+ gchar *query;
+ gint ret;
query = sqlite3_mprintf("INSERT OR REPLACE INTO '%s_preview' VALUES(%Q,%Q)", folder_name, uid, msg);
@@ -1054,32 +1054,32 @@ camel_db_write_preview_record (CamelDB *db, char *folder_name, const char *uid,
}
static int
-read_vuids_callback (void *ref, int ncol, char ** cols, char ** name)
+read_vuids_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
GPtrArray *array = (GPtrArray *)ref;
#if 0
- int i;
+ gint i;
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "vuid"))
- g_ptr_array_add (array, (char *) (camel_pstring_strdup(cols [i]+8)));
+ g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols [i]+8)));
}
#else
- g_ptr_array_add (array, (char *) (camel_pstring_strdup(cols [0]+8)));
+ g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols [0]+8)));
#endif
return 0;
}
GPtrArray *
-camel_db_get_vuids_from_vfolder (CamelDB *db, char *folder_name, char *filter, CamelException *ex)
+camel_db_get_vuids_from_vfolder (CamelDB *db, gchar *folder_name, gchar *filter, CamelException *ex)
{
- char *sel_query;
- char *cond = NULL;
+ gchar *sel_query;
+ gchar *cond = NULL;
GPtrArray *array;
- char *tmp = g_strdup_printf("%s%%", filter ? filter:"");
+ gchar *tmp = g_strdup_printf("%s%%", filter ? filter:"");
if(filter)
cond = sqlite3_mprintf(" WHERE vuid LIKE %Q", tmp);
g_free(tmp);
@@ -1102,11 +1102,11 @@ camel_db_get_vuids_from_vfolder (CamelDB *db, char *folder_name, char *filter, C
return array;
}
-int
-camel_db_add_to_vfolder (CamelDB *db, char *folder_name, char *vuid, CamelException *ex)
+gint
+camel_db_add_to_vfolder (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex)
{
- char *ins_query;
- int ret;
+ gchar *ins_query;
+ gint ret;
ins_query = sqlite3_mprintf ("INSERT INTO %Q VALUES (%Q)", folder_name, vuid);
@@ -1117,11 +1117,11 @@ camel_db_add_to_vfolder (CamelDB *db, char *folder_name, char *vuid, CamelExcept
return ret;
}
-int
-camel_db_add_to_vfolder_transaction (CamelDB *db, char *folder_name, char *vuid, CamelException *ex)
+gint
+camel_db_add_to_vfolder_transaction (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex)
{
- char *ins_query;
- int ret;
+ gchar *ins_query;
+ gint ret;
ins_query = sqlite3_mprintf ("INSERT INTO %Q VALUES (%Q)", folder_name, vuid);
@@ -1133,10 +1133,10 @@ camel_db_add_to_vfolder_transaction (CamelDB *db, char *folder_name, char *vuid,
}
-int
+gint
camel_db_create_folders_table (CamelDB *cdb, CamelException *ex)
{
- char *query = "CREATE TABLE IF NOT EXISTS folders ( folder_name TEXT PRIMARY KEY, version REAL, flags INTEGER, nextuid INTEGER, time NUMERIC, saved_count INTEGER, unread_count INTEGER, deleted_count INTEGER, junk_count INTEGER, visible_count INTEGER, jnd_count INTEGER, bdata TEXT )";
+ gchar *query = "CREATE TABLE IF NOT EXISTS folders ( folder_name TEXT PRIMARY KEY, version REAL, flags INTEGER, nextuid INTEGER, time NUMERIC, saved_count INTEGER, unread_count INTEGER, deleted_count INTEGER, junk_count INTEGER, visible_count INTEGER, jnd_count INTEGER, bdata TEXT )";
CAMEL_DB_RELEASE_SQLITE_MEMORY;
return ((camel_db_command (cdb, query, ex)));
}
@@ -1144,10 +1144,10 @@ camel_db_create_folders_table (CamelDB *cdb, CamelException *ex)
static int
-camel_db_create_message_info_table (CamelDB *cdb, const char *folder_name, CamelException *ex)
+camel_db_create_message_info_table (CamelDB *cdb, const gchar *folder_name, CamelException *ex)
{
- int ret;
- char *table_creation_query, *safe_index;
+ gint ret;
+ gchar *table_creation_query, *safe_index;
/* README: It is possible to compress all system flags into a single column and use just as userflags but that makes querying for other applications difficult an d bloats the parsing code. Instead, it is better to bloat the tables. Sqlite should have some optimizations for sparse columns etc. */
table_creation_query = sqlite3_mprintf ("CREATE TABLE IF NOT EXISTS %Q ( uid TEXT PRIMARY KEY , flags INTEGER , msg_type INTEGER , read INTEGER , deleted INTEGER , replied INTEGER , important INTEGER , junk INTEGER , attachment INTEGER , dirty INTEGER , size INTEGER , dsent NUMERIC , dreceived NUMERIC , subject TEXT , mail_from TEXT , mail_to TEXT , mail_cc TEXT , mlist TEXT , followup_flag TEXT , followup_completed_on TEXT , followup_due_by TEXT , part TEXT , labels TEXT , usertags TEXT , cinfo TEXT , bdata TEXT, created TEXT, modified TEXT )", folder_name);
@@ -1198,10 +1198,10 @@ camel_db_create_message_info_table (CamelDB *cdb, const char *folder_name, Camel
}
static int
-camel_db_migrate_folder_prepare (CamelDB *cdb, const char *folder_name, gint version, CamelException *ex)
+camel_db_migrate_folder_prepare (CamelDB *cdb, const gchar *folder_name, gint version, CamelException *ex)
{
- int ret = 0;
- char *table_creation_query;
+ gint ret = 0;
+ gchar *table_creation_query;
/* Migration stage one: storing the old data */
@@ -1238,10 +1238,10 @@ camel_db_migrate_folder_prepare (CamelDB *cdb, const char *folder_name, gint ver
}
static int
-camel_db_migrate_folder_recreate (CamelDB *cdb, const char *folder_name, gint version, CamelException *ex)
+camel_db_migrate_folder_recreate (CamelDB *cdb, const gchar *folder_name, gint version, CamelException *ex)
{
- int ret = 0;
- char *table_creation_query;
+ gint ret = 0;
+ gchar *table_creation_query;
/* Migration stage two: writing back the old data */
@@ -1261,11 +1261,11 @@ camel_db_migrate_folder_recreate (CamelDB *cdb, const char *folder_name, gint ve
}
static int
-camel_db_write_folder_version (CamelDB *cdb, const char *folder_name, int old_version, CamelException *ex)
+camel_db_write_folder_version (CamelDB *cdb, const gchar *folder_name, gint old_version, CamelException *ex)
{
- int ret = 0;
- char *version_creation_query;
- char *version_insert_query;
+ gint ret = 0;
+ gchar *version_creation_query;
+ gchar *version_insert_query;
version_creation_query = sqlite3_mprintf ("CREATE TABLE IF NOT EXISTS '%q_version' ( version TEXT )", folder_name);
@@ -1284,10 +1284,10 @@ camel_db_write_folder_version (CamelDB *cdb, const char *folder_name, int old_ve
}
static int
-camel_db_get_folder_version (CamelDB *cdb, const char *folder_name, CamelException *ex)
+camel_db_get_folder_version (CamelDB *cdb, const gchar *folder_name, CamelException *ex)
{
- int version = -1, ret;
- char *query;
+ gint version = -1, ret;
+ gchar *query;
sqlite3_stmt *stmt = NULL;
query = sqlite3_mprintf ("SELECT version FROM '%q_version'", folder_name);
@@ -1306,10 +1306,10 @@ camel_db_get_folder_version (CamelDB *cdb, const char *folder_name, CamelExcepti
return version;
}
-int
-camel_db_prepare_message_info_table (CamelDB *cdb, const char *folder_name, CamelException *ex)
+gint
+camel_db_prepare_message_info_table (CamelDB *cdb, const gchar *folder_name, CamelException *ex)
{
- int ret, current_version;
+ gint ret, current_version;
/* Make sure we have the table already */
ret = camel_db_create_message_info_table (cdb, folder_name, ex);
@@ -1329,24 +1329,24 @@ camel_db_prepare_message_info_table (CamelDB *cdb, const char *folder_name, Came
return ret;
}
-int
-camel_db_write_fresh_message_info_record (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex)
+gint
+camel_db_write_fresh_message_info_record (CamelDB *cdb, const gchar *folder_name, CamelMIRecord *record, CamelException *ex)
{
return write_mir (cdb, folder_name, record, ex, FALSE);
}
-int
-camel_db_write_message_info_record (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex)
+gint
+camel_db_write_message_info_record (CamelDB *cdb, const gchar *folder_name, CamelMIRecord *record, CamelException *ex)
{
return write_mir (cdb, folder_name, record, ex, TRUE);
}
static int
-write_mir (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex, gboolean delete_old_record)
+write_mir (CamelDB *cdb, const gchar *folder_name, CamelMIRecord *record, CamelException *ex, gboolean delete_old_record)
{
- int ret;
- char *del_query;
- char *ins_query;
+ gint ret;
+ gchar *del_query;
+ gchar *ins_query;
/* FIXME: We should migrate from this DELETE followed by INSERT model to an INSERT OR REPLACE model as pointed out by pvanhoof */
@@ -1367,7 +1367,7 @@ write_mir (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelEx
del_query = sqlite3_mprintf ("DELETE FROM %Q WHERE uid = %Q", folder_name, record->uid); */
#if 0
- char *upd_query;
+ gchar *upd_query;
upd_query = g_strdup_printf ("IMPLEMENT AND THEN TRY");
camel_db_command (cdb, upd_query, ex);
@@ -1387,13 +1387,13 @@ write_mir (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelEx
return ret;
}
-int
+gint
camel_db_write_folder_info_record (CamelDB *cdb, CamelFIRecord *record, CamelException *ex)
{
- int ret;
+ gint ret;
- char *del_query;
- char *ins_query;
+ gchar *del_query;
+ gchar *ins_query;
ins_query = sqlite3_mprintf ("INSERT INTO folders VALUES ( %Q, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %Q ) ",
record->folder_name, record->version,
@@ -1405,7 +1405,7 @@ camel_db_write_folder_info_record (CamelDB *cdb, CamelFIRecord *record, CamelExc
#if 0
- char *upd_query;
+ gchar *upd_query;
upd_query = g_strdup_printf ("UPDATE folders SET version = %d, flags = %d, nextuid = %d, time = 143, saved_count = %d, unread_count = %d, deleted_count = %d, junk_count = %d, bdata = %s, WHERE folder_name = %Q", record->version, record->flags, record->nextuid, record->saved_count, record->unread_count, record->deleted_count, record->junk_count, "PROVIDER SPECIFIC DATA", record->folder_name );
camel_db_command (cdb, upd_query, ex);
@@ -1424,10 +1424,10 @@ camel_db_write_folder_info_record (CamelDB *cdb, CamelFIRecord *record, CamelExc
}
static int
-read_fir_callback (void * ref, int ncol, char ** cols, char ** name)
+read_fir_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
CamelFIRecord *record = *(CamelFIRecord **) ref;
- int i;
+ gint i;
d(g_print ("\nread_fir_callback called \n"));
#if 0
@@ -1476,11 +1476,11 @@ read_fir_callback (void * ref, int ncol, char ** cols, char ** name)
return 0;
}
-int
-camel_db_read_folder_info_record (CamelDB *cdb, const char *folder_name, CamelFIRecord **record, CamelException *ex)
+gint
+camel_db_read_folder_info_record (CamelDB *cdb, const gchar *folder_name, CamelFIRecord **record, CamelException *ex)
{
- char *query;
- int ret;
+ gchar *query;
+ gint ret;
query = sqlite3_mprintf ("SELECT * FROM folders WHERE folder_name = %Q", folder_name);
ret = camel_db_select (cdb, query, read_fir_callback, record, ex);
@@ -1489,11 +1489,11 @@ camel_db_read_folder_info_record (CamelDB *cdb, const char *folder_name, CamelFI
return (ret);
}
-int
-camel_db_read_message_info_record_with_uid (CamelDB *cdb, const char *folder_name, const char *uid, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex)
+gint
+camel_db_read_message_info_record_with_uid (CamelDB *cdb, const gchar *folder_name, const gchar *uid, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex)
{
- char *query;
- int ret;
+ gchar *query;
+ gint ret;
query = sqlite3_mprintf ("SELECT uid, flags, size, dsent, dreceived, subject, mail_from, mail_to, mail_cc, mlist, part, labels, usertags, cinfo, bdata FROM %Q WHERE uid = %Q", folder_name, uid);
ret = camel_db_select (cdb, query, read_mir_callback, p, ex);
@@ -1502,11 +1502,11 @@ camel_db_read_message_info_record_with_uid (CamelDB *cdb, const char *folder_nam
return (ret);
}
-int
-camel_db_read_message_info_records (CamelDB *cdb, const char *folder_name, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex)
+gint
+camel_db_read_message_info_records (CamelDB *cdb, const gchar *folder_name, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex)
{
- char *query;
- int ret;
+ gchar *query;
+ gint ret;
query = sqlite3_mprintf ("SELECT uid, flags, size, dsent, dreceived, subject, mail_from, mail_to, mail_cc, mlist, part, labels, usertags, cinfo, bdata FROM %Q ", folder_name);
ret = camel_db_select (cdb, query, read_mir_callback, p, ex);
@@ -1518,8 +1518,8 @@ camel_db_read_message_info_records (CamelDB *cdb, const char *folder_name, gpoin
static int
camel_db_create_deleted_table (CamelDB *cdb, CamelException *ex)
{
- int ret;
- char *table_creation_query;
+ gint ret;
+ gchar *table_creation_query;
table_creation_query = sqlite3_mprintf ("CREATE TABLE IF NOT EXISTS Deletes (id INTEGER primary key AUTOINCREMENT not null, uid TEXT, time TEXT, mailbox TEXT)");
ret = camel_db_add_to_transaction (cdb, table_creation_query, ex);
sqlite3_free (table_creation_query);
@@ -1529,7 +1529,7 @@ camel_db_create_deleted_table (CamelDB *cdb, CamelException *ex)
static int
camel_db_trim_deleted_table (CamelDB *cdb, CamelException *ex)
{
- int ret = 0;
+ gint ret = 0;
/* TODO: We need a mechanism to get rid of very old deletes, or something
* that keeps the list trimmed at a certain max (deleting upfront when
@@ -1538,11 +1538,11 @@ camel_db_trim_deleted_table (CamelDB *cdb, CamelException *ex)
return ret;
}
-int
-camel_db_delete_uid (CamelDB *cdb, const char *folder, const char *uid, CamelException *ex)
+gint
+camel_db_delete_uid (CamelDB *cdb, const gchar *folder, const gchar *uid, CamelException *ex)
{
- char *tab;
- int ret;
+ gchar *tab;
+ gint ret;
camel_db_begin_transaction (cdb, ex);
@@ -1565,11 +1565,11 @@ camel_db_delete_uid (CamelDB *cdb, const char *folder, const char *uid, CamelExc
}
static int
-cdb_delete_ids (CamelDB *cdb, const char * folder_name, GSList *uids, char *uid_prefix, const char *field, CamelException *ex)
+cdb_delete_ids (CamelDB *cdb, const gchar * folder_name, GSList *uids, gchar *uid_prefix, const gchar *field, CamelException *ex)
{
- char *tmp;
- int ret;
- char *tab;
+ gchar *tmp;
+ gint ret;
+ gchar *tab;
gboolean first = TRUE;
GString *str = g_string_new ("DELETE FROM ");
GSList *iterator;
@@ -1596,7 +1596,7 @@ cdb_delete_ids (CamelDB *cdb, const char * folder_name, GSList *uids, char *uid_
iterator = uids;
while (iterator) {
- char *foo = g_strdup_printf("%s%s", uid_prefix, (char *) iterator->data);
+ gchar *foo = g_strdup_printf("%s%s", uid_prefix, (gchar *) iterator->data);
tmp = sqlite3_mprintf ("%Q", foo);
g_free(foo);
iterator = iterator->next;
@@ -1635,8 +1635,8 @@ cdb_delete_ids (CamelDB *cdb, const char * folder_name, GSList *uids, char *uid_
return ret;
}
-int
-camel_db_delete_uids (CamelDB *cdb, const char * folder_name, GSList *uids, CamelException *ex)
+gint
+camel_db_delete_uids (CamelDB *cdb, const gchar * folder_name, GSList *uids, CamelException *ex)
{
if(!uids || !uids->data)
return 0;
@@ -1644,20 +1644,20 @@ camel_db_delete_uids (CamelDB *cdb, const char * folder_name, GSList *uids, Came
return cdb_delete_ids (cdb, folder_name, uids, "", "uid", ex);
}
-int
-camel_db_delete_vuids (CamelDB *cdb, const char * folder_name, char *hash, GSList *uids, CamelException *ex)
+gint
+camel_db_delete_vuids (CamelDB *cdb, const gchar * folder_name, gchar *hash, GSList *uids, CamelException *ex)
{
return cdb_delete_ids (cdb, folder_name, uids, hash, "vuid", ex);
}
-int
-camel_db_clear_folder_summary (CamelDB *cdb, char *folder, CamelException *ex)
+gint
+camel_db_clear_folder_summary (CamelDB *cdb, gchar *folder, CamelException *ex)
{
- int ret;
+ gint ret;
- char *folders_del;
- char *msginfo_del;
- char *tab;
+ gchar *folders_del;
+ gchar *msginfo_del;
+ gchar *tab;
folders_del = sqlite3_mprintf ("DELETE FROM folders WHERE folder_name = %Q", folder);
msginfo_del = sqlite3_mprintf ("DELETE FROM %Q ", folder);
@@ -1683,12 +1683,12 @@ camel_db_clear_folder_summary (CamelDB *cdb, char *folder, CamelException *ex)
return ret;
}
-int
-camel_db_delete_folder (CamelDB *cdb, const char *folder, CamelException *ex)
+gint
+camel_db_delete_folder (CamelDB *cdb, const gchar *folder, CamelException *ex)
{
- int ret;
- char *del;
- char *tab;
+ gint ret;
+ gchar *del;
+ gchar *tab;
camel_db_begin_transaction (cdb, ex);
@@ -1714,11 +1714,11 @@ camel_db_delete_folder (CamelDB *cdb, const char *folder, CamelException *ex)
return ret;
}
-int
-camel_db_rename_folder (CamelDB *cdb, const char *old_folder, const char *new_folder, CamelException *ex)
+gint
+camel_db_rename_folder (CamelDB *cdb, const gchar *old_folder, const gchar *new_folder, CamelException *ex)
{
- int ret;
- char *cmd, *tab;
+ gint ret;
+ gchar *cmd, *tab;
camel_db_begin_transaction (cdb, ex);
@@ -1771,14 +1771,14 @@ camel_db_camel_mir_free (CamelMIRecord *record)
}
}
-char *
-camel_db_sqlize_string (const char *string)
+gchar *
+camel_db_sqlize_string (const gchar *string)
{
return sqlite3_mprintf ("%Q", string);
}
void
-camel_db_free_sqlized_string (char *string)
+camel_db_free_sqlized_string (gchar *string)
{
sqlite3_free (string);
string = NULL;
@@ -1798,8 +1798,8 @@ followup_flag TEXT ,
followup_completed_on TEXT ,
followup_due_by TEXT ," */
-char *
-camel_db_get_column_name (const char *raw_name)
+gchar *
+camel_db_get_column_name (const gchar *raw_name)
{
if (!g_ascii_strcasecmp (raw_name, "Subject"))
return g_strdup ("subject");
@@ -1832,11 +1832,11 @@ camel_db_get_column_name (const char *raw_name)
}
-int
-camel_db_migrate_vfolders_to_14 (CamelDB *cdb, const char *folder, CamelException *ex)
+gint
+camel_db_migrate_vfolders_to_14 (CamelDB *cdb, const gchar *folder, CamelException *ex)
{
- char *cmd = sqlite3_mprintf ("ALTER TABLE %Q ADD COLUMN flags INTEGER", folder);
- int ret;
+ gchar *cmd = sqlite3_mprintf ("ALTER TABLE %Q ADD COLUMN flags INTEGER", folder);
+ gint ret;
ret = camel_db_command (cdb, cmd, ex);
sqlite3_free (cmd);
@@ -1845,10 +1845,10 @@ camel_db_migrate_vfolders_to_14 (CamelDB *cdb, const char *folder, CamelExceptio
return ret;
}
-int camel_db_start_in_memory_transactions (CamelDB *cdb, CamelException *ex)
+gint camel_db_start_in_memory_transactions (CamelDB *cdb, CamelException *ex)
{
- int ret;
- char *cmd = sqlite3_mprintf ("ATTACH DATABASE ':memory:' AS %s", CAMEL_DB_IN_MEMORY_DB);
+ gint ret;
+ gchar *cmd = sqlite3_mprintf ("ATTACH DATABASE ':memory:' AS %s", CAMEL_DB_IN_MEMORY_DB);
ret = camel_db_command (cdb, cmd, ex);
sqlite3_free (cmd);
@@ -1862,10 +1862,10 @@ int camel_db_start_in_memory_transactions (CamelDB *cdb, CamelException *ex)
return ret;
}
-int camel_db_flush_in_memory_transactions (CamelDB *cdb, const char * folder_name, CamelException *ex)
+gint camel_db_flush_in_memory_transactions (CamelDB *cdb, const gchar * folder_name, CamelException *ex)
{
- int ret;
- char *cmd = sqlite3_mprintf ("INSERT INTO %Q SELECT * FROM %Q", folder_name, CAMEL_DB_IN_MEMORY_TABLE);
+ gint ret;
+ gchar *cmd = sqlite3_mprintf ("INSERT INTO %Q SELECT * FROM %Q", folder_name, CAMEL_DB_IN_MEMORY_TABLE);
ret = camel_db_command (cdb, cmd, ex);
sqlite3_free (cmd);
diff --git a/camel/camel-db.h b/camel/camel-db.h
index eba87d441..c73b6f47c 100644
--- a/camel/camel-db.h
+++ b/camel/camel-db.h
@@ -16,7 +16,7 @@
typedef struct _CamelDBPrivate CamelDBPrivate;
-typedef int(*CamelDBCollate)(void*,int,const void*,int,const void*);
+typedef int(*CamelDBCollate)(gpointer ,int,gconstpointer ,int,gconstpointer );
struct _CamelDB {
sqlite3 *db;
@@ -59,7 +59,7 @@ struct _CamelDB {
*/
typedef struct _CamelMIRecord {
- char *uid;
+ gchar *uid;
guint32 flags;
guint32 msg_type;
guint32 dirty;
@@ -72,23 +72,23 @@ typedef struct _CamelMIRecord {
guint32 size;
time_t dsent;
time_t dreceived;
- char *subject;
- char *from;
- char *to;
- char *cc;
- char *mlist;
- char *followup_flag;
- char *followup_completed_on;
- char *followup_due_by;
- char *part;
- char *labels;
- char *usertags;
- char *cinfo;
- char *bdata;
+ gchar *subject;
+ gchar *from;
+ gchar *to;
+ gchar *cc;
+ gchar *mlist;
+ gchar *followup_flag;
+ gchar *followup_completed_on;
+ gchar *followup_due_by;
+ gchar *part;
+ gchar *labels;
+ gchar *usertags;
+ gchar *cinfo;
+ gchar *bdata;
} CamelMIRecord;
typedef struct _CamelFIRecord {
- char *folder_name;
+ gchar *folder_name;
guint32 version;
guint32 flags;
guint32 nextuid;
@@ -99,88 +99,88 @@ typedef struct _CamelFIRecord {
guint32 junk_count;
guint32 visible_count;
guint32 jnd_count; /* Junked not deleted */
- char *bdata;
+ gchar *bdata;
} CamelFIRecord;
typedef struct _CamelDB CamelDB;
-typedef int (*CamelDBSelectCB) (gpointer data, int ncol, char **colvalues, char **colnames);
+typedef gint (*CamelDBSelectCB) (gpointer data, gint ncol, gchar **colvalues, gchar **colnames);
-CamelDB * camel_db_open (const char *path, CamelException *ex);
+CamelDB * camel_db_open (const gchar *path, CamelException *ex);
CamelDB * camel_db_clone (CamelDB *cdb, CamelException *ex);
void camel_db_close (CamelDB *cdb);
-int camel_db_command (CamelDB *cdb, const char *stmt, CamelException *ex);
+gint camel_db_command (CamelDB *cdb, const gchar *stmt, CamelException *ex);
-int camel_db_transaction_command (CamelDB *cdb, GSList *qry_list, CamelException *ex);
+gint camel_db_transaction_command (CamelDB *cdb, GSList *qry_list, CamelException *ex);
-int camel_db_begin_transaction (CamelDB *cdb, CamelException *ex);
-int camel_db_add_to_transaction (CamelDB *cdb, const char *query, CamelException *ex);
-int camel_db_end_transaction (CamelDB *cdb, CamelException *ex);
-int camel_db_abort_transaction (CamelDB *cdb, CamelException *ex);
-int camel_db_clear_folder_summary (CamelDB *cdb, char *folder, CamelException *ex);
-int camel_db_rename_folder (CamelDB *cdb, const char *old_folder, const char *new_folder, CamelException *ex);
+gint camel_db_begin_transaction (CamelDB *cdb, CamelException *ex);
+gint camel_db_add_to_transaction (CamelDB *cdb, const gchar *query, CamelException *ex);
+gint camel_db_end_transaction (CamelDB *cdb, CamelException *ex);
+gint camel_db_abort_transaction (CamelDB *cdb, CamelException *ex);
+gint camel_db_clear_folder_summary (CamelDB *cdb, gchar *folder, CamelException *ex);
+gint camel_db_rename_folder (CamelDB *cdb, const gchar *old_folder, const gchar *new_folder, CamelException *ex);
-int camel_db_delete_folder (CamelDB *cdb, const char *folder, CamelException *ex);
-int camel_db_delete_uid (CamelDB *cdb, const char *folder, const char *uid, CamelException *ex);
-/*int camel_db_delete_uids (CamelDB *cdb, CamelException *ex, int nargs, ... );*/
-int camel_db_delete_uids (CamelDB *cdb, const char* folder_name, GSList *uids, CamelException *ex);
-int camel_db_delete_vuids (CamelDB *cdb, const char* folder_name, char *shash, GSList *uids, CamelException *ex);
+gint camel_db_delete_folder (CamelDB *cdb, const gchar *folder, CamelException *ex);
+gint camel_db_delete_uid (CamelDB *cdb, const gchar *folder, const gchar *uid, CamelException *ex);
+/*int camel_db_delete_uids (CamelDB *cdb, CamelException *ex, gint nargs, ... );*/
+gint camel_db_delete_uids (CamelDB *cdb, const gchar * folder_name, GSList *uids, CamelException *ex);
+gint camel_db_delete_vuids (CamelDB *cdb, const gchar * folder_name, gchar *shash, GSList *uids, CamelException *ex);
-int camel_db_create_folders_table (CamelDB *cdb, CamelException *ex);
-int camel_db_select (CamelDB *cdb, const char* stmt, CamelDBSelectCB callback, gpointer data, CamelException *ex);
+gint camel_db_create_folders_table (CamelDB *cdb, CamelException *ex);
+gint camel_db_select (CamelDB *cdb, const gchar * stmt, CamelDBSelectCB callback, gpointer data, CamelException *ex);
-int camel_db_write_folder_info_record (CamelDB *cdb, CamelFIRecord *record, CamelException *ex);
-int camel_db_read_folder_info_record (CamelDB *cdb, const char *folder_name, CamelFIRecord **record, CamelException *ex);
+gint camel_db_write_folder_info_record (CamelDB *cdb, CamelFIRecord *record, CamelException *ex);
+gint camel_db_read_folder_info_record (CamelDB *cdb, const gchar *folder_name, CamelFIRecord **record, CamelException *ex);
-int camel_db_prepare_message_info_table (CamelDB *cdb, const char *folder_name, CamelException *ex);
+gint camel_db_prepare_message_info_table (CamelDB *cdb, const gchar *folder_name, CamelException *ex);
-int camel_db_write_message_info_record (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex);
-int camel_db_write_fresh_message_info_record (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex);
-int camel_db_read_message_info_records (CamelDB *cdb, const char *folder_name, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex);
-int camel_db_read_message_info_record_with_uid (CamelDB *cdb, const char *folder_name, const char *uid, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex);
+gint camel_db_write_message_info_record (CamelDB *cdb, const gchar *folder_name, CamelMIRecord *record, CamelException *ex);
+gint camel_db_write_fresh_message_info_record (CamelDB *cdb, const gchar *folder_name, CamelMIRecord *record, CamelException *ex);
+gint camel_db_read_message_info_records (CamelDB *cdb, const gchar *folder_name, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex);
+gint camel_db_read_message_info_record_with_uid (CamelDB *cdb, const gchar *folder_name, const gchar *uid, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex);
-int camel_db_count_junk_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
-int camel_db_count_unread_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
-int camel_db_count_deleted_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
-int camel_db_count_total_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
+gint camel_db_count_junk_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex);
+gint camel_db_count_unread_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex);
+gint camel_db_count_deleted_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex);
+gint camel_db_count_total_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex);
-int camel_db_count_visible_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
-int camel_db_count_visible_unread_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
+gint camel_db_count_visible_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex);
+gint camel_db_count_visible_unread_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex);
-int camel_db_count_junk_not_deleted_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
-int camel_db_count_message_info (CamelDB *cdb, const char *query, guint32 *count, CamelException *ex);
+gint camel_db_count_junk_not_deleted_message_info (CamelDB *cdb, const gchar *table_name, guint32 *count, CamelException *ex);
+gint camel_db_count_message_info (CamelDB *cdb, const gchar *query, guint32 *count, CamelException *ex);
void camel_db_camel_mir_free (CamelMIRecord *record);
-int camel_db_create_vfolder (CamelDB *db, const char *folder_name, CamelException *ex);
-int camel_db_recreate_vfolder (CamelDB *db, const char *folder_name, CamelException *ex);
-int camel_db_delete_uid_from_vfolder (CamelDB *db, char *folder_name, char *vuid, CamelException *ex);
-int camel_db_delete_uid_from_vfolder_transaction (CamelDB *db, char *folder_name, char *vuid, CamelException *ex);
-GPtrArray * camel_db_get_vuids_from_vfolder (CamelDB *db, char *folder_name, char *filter, CamelException *ex);
-int camel_db_add_to_vfolder (CamelDB *db, char *folder_name, char *vuid, CamelException *ex);
-int camel_db_add_to_vfolder_transaction (CamelDB *db, char *folder_name, char *vuid, CamelException *ex);
+gint camel_db_create_vfolder (CamelDB *db, const gchar *folder_name, CamelException *ex);
+gint camel_db_recreate_vfolder (CamelDB *db, const gchar *folder_name, CamelException *ex);
+gint camel_db_delete_uid_from_vfolder (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex);
+gint camel_db_delete_uid_from_vfolder_transaction (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex);
+GPtrArray * camel_db_get_vuids_from_vfolder (CamelDB *db, gchar *folder_name, gchar *filter, CamelException *ex);
+gint camel_db_add_to_vfolder (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex);
+gint camel_db_add_to_vfolder_transaction (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex);
-int camel_db_get_folder_uids (CamelDB *db, const char *folder_name, const char *sort_by, const char *collate, GPtrArray *array, CamelException *ex);
-int camel_db_get_folder_uids_flags (CamelDB *db, const char *folder_name, const char *sort_by, const char *collate, GPtrArray *summary, GHashTable *table, CamelException *ex);
+gint camel_db_get_folder_uids (CamelDB *db, const gchar *folder_name, const gchar *sort_by, const gchar *collate, GPtrArray *array, CamelException *ex);
+gint camel_db_get_folder_uids_flags (CamelDB *db, const gchar *folder_name, const gchar *sort_by, const gchar *collate, GPtrArray *summary, GHashTable *table, CamelException *ex);
-GPtrArray * camel_db_get_folder_junk_uids (CamelDB *db, char *folder_name, CamelException *ex);
-GPtrArray * camel_db_get_folder_deleted_uids (CamelDB *db, char *folder_name, CamelException *ex);
+GPtrArray * camel_db_get_folder_junk_uids (CamelDB *db, gchar *folder_name, CamelException *ex);
+GPtrArray * camel_db_get_folder_deleted_uids (CamelDB *db, gchar *folder_name, CamelException *ex);
-char * camel_db_sqlize_string (const char *string);
-void camel_db_free_sqlized_string (char *string);
+gchar * camel_db_sqlize_string (const gchar *string);
+void camel_db_free_sqlized_string (gchar *string);
-char * camel_db_get_column_name (const char *raw_name);
-int camel_db_set_collate (CamelDB *cdb, const char *col, const char *collate, CamelDBCollate func);
+gchar * camel_db_get_column_name (const gchar *raw_name);
+gint camel_db_set_collate (CamelDB *cdb, const gchar *col, const gchar *collate, CamelDBCollate func);
/* Migration APIS */
-int camel_db_migrate_vfolders_to_14(CamelDB *cdb, const char *folder, CamelException *ex);
+gint camel_db_migrate_vfolders_to_14(CamelDB *cdb, const gchar *folder, CamelException *ex);
-int camel_db_start_in_memory_transactions (CamelDB *cdb, CamelException *ex);
-int camel_db_flush_in_memory_transactions (CamelDB *cdb, const char * folder_name, CamelException *ex);
+gint camel_db_start_in_memory_transactions (CamelDB *cdb, CamelException *ex);
+gint camel_db_flush_in_memory_transactions (CamelDB *cdb, const gchar * folder_name, CamelException *ex);
GHashTable *
-camel_db_get_folder_preview (CamelDB *db, char *folder_name, CamelException *ex);
-int camel_db_write_preview_record (CamelDB *db, char *folder_name, const char *uid, const char *msg, CamelException *ex);
+camel_db_get_folder_preview (CamelDB *db, gchar *folder_name, CamelException *ex);
+gint camel_db_write_preview_record (CamelDB *db, gchar *folder_name, const gchar *uid, const gchar *msg, CamelException *ex);
#endif
diff --git a/camel/camel-debug.c b/camel/camel-debug.c
index 32d688c64..5b377e7f9 100644
--- a/camel/camel-debug.c
+++ b/camel/camel-debug.c
@@ -28,7 +28,7 @@
#include "camel-debug.h"
-int camel_verbose_debug;
+gint camel_verbose_debug;
static GHashTable *debug_table = NULL;
@@ -49,7 +49,7 @@ static GHashTable *debug_table = NULL;
**/
void camel_debug_init(void)
{
- char *d;
+ gchar *d;
d = getenv("CAMEL_VERBOSE_DEBUG");
if (d)
@@ -57,7 +57,7 @@ void camel_debug_init(void)
d = g_strdup(getenv("CAMEL_DEBUG"));
if (d) {
- char *p;
+ gchar *p;
debug_table = g_hash_table_new(g_str_hash, g_str_equal);
p = d;
@@ -86,14 +86,14 @@ void camel_debug_init(void)
*
* Return value:
**/
-gboolean camel_debug(const char *mode)
+gboolean camel_debug(const gchar *mode)
{
if (camel_verbose_debug)
return TRUE;
if (debug_table) {
- char *colon;
- char *fallback;
+ gchar *colon;
+ gchar *fallback;
if (g_hash_table_lookup(debug_table, mode))
return TRUE;
@@ -130,7 +130,7 @@ static pthread_mutex_t debug_lock = PTHREAD_MUTEX_INITIALIZER;
* call debug_end when finished any screen output.
**/
gboolean
-camel_debug_start(const char *mode)
+camel_debug_start(const gchar *mode)
{
if (camel_debug(mode)) {
pthread_mutex_lock(&debug_lock);
@@ -158,7 +158,7 @@ camel_debug_end(void)
#include <sys/debugreg.h>
static unsigned
-i386_length_and_rw_bits (int len, enum target_hw_bp_type type)
+i386_length_and_rw_bits (gint len, enum target_hw_bp_type type)
{
unsigned rw;
@@ -222,7 +222,7 @@ Invalid hw breakpoint length %d in i386_length_and_rw_bits.\n", len);
/* fine idea, but it doesn't work, crashes in get_dr :-/ */
void
-camel_debug_hwatch(int wp, void *addr)
+camel_debug_hwatch(gint wp, gpointer addr)
{
guint32 control, rw;
diff --git a/camel/camel-debug.h b/camel/camel-debug.h
index aa8481649..ef1c202f9 100644
--- a/camel/camel-debug.h
+++ b/camel/camel-debug.h
@@ -31,13 +31,13 @@
G_BEGIN_DECLS
void camel_debug_init(void);
-gboolean camel_debug(const char *mode);
+gboolean camel_debug(const gchar *mode);
-gboolean camel_debug_start(const char *mode);
+gboolean camel_debug_start(const gchar *mode);
void camel_debug_end(void);
#ifndef CAMEL_DISABLE_DEPRECATED
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
#endif
G_END_DECLS
diff --git a/camel/camel-digest-folder.c b/camel/camel-digest-folder.c
index a6e0d0f49..94f8f2255 100644
--- a/camel/camel-digest-folder.c
+++ b/camel/camel-digest-folder.c
@@ -49,22 +49,22 @@ static CamelFolderClass *parent_class = NULL;
static void digest_refresh_info (CamelFolder *folder, CamelException *ex);
static void digest_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
-static const char *digest_get_full_name (CamelFolder *folder);
+static const gchar *digest_get_full_name (CamelFolder *folder);
static void digest_expunge (CamelFolder *folder, CamelException *ex);
/* message manipulation */
static CamelMimeMessage *digest_get_message (CamelFolder *folder, const gchar *uid,
CamelException *ex);
static void digest_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid, CamelException *ex);
+ const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex);
static void digest_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
CamelFolder *dest, GPtrArray **transferred_uids,
gboolean delete_originals, CamelException *ex);
-static GPtrArray *digest_search_by_expression (CamelFolder *folder, const char *expression,
+static GPtrArray *digest_search_by_expression (CamelFolder *folder, const gchar *expression,
CamelException *ex);
-static GPtrArray *digest_search_by_uids (CamelFolder *folder, const char *expression,
+static GPtrArray *digest_search_by_uids (CamelFolder *folder, const gchar *expression,
GPtrArray *uids, CamelException *ex);
static void digest_search_free (CamelFolder *folder, GPtrArray *result);
@@ -155,7 +155,7 @@ multipart_contains_message_parts (CamelMultipart *multipart)
gboolean has_message_parts = FALSE;
CamelDataWrapper *wrapper;
CamelMimePart *part;
- int i, parts;
+ gint i, parts;
parts = camel_multipart_get_number (multipart);
for (i = 0; i < parts && !has_message_parts; i++) {
@@ -172,17 +172,17 @@ multipart_contains_message_parts (CamelMultipart *multipart)
}
static void
-digest_add_multipart (CamelFolder *folder, CamelMultipart *multipart, const char *preuid)
+digest_add_multipart (CamelFolder *folder, CamelMultipart *multipart, const gchar *preuid)
{
CamelDataWrapper *wrapper;
CamelMessageInfo *info;
CamelMimePart *part;
- int parts, i;
- char *uid;
+ gint parts, i;
+ gchar *uid;
parts = camel_multipart_get_number (multipart);
for (i = 0; i < parts; i++) {
- char *tmp;
+ gchar *tmp;
part = camel_multipart_get_part (multipart, i);
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
@@ -259,7 +259,7 @@ digest_expunge (CamelFolder *folder, CamelException *ex)
/* no-op */
}
-static const char *
+static const gchar *
digest_get_full_name (CamelFolder *folder)
{
return folder->full_name;
@@ -267,7 +267,7 @@ digest_get_full_name (CamelFolder *folder)
static void
digest_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
/* no-op */
@@ -286,14 +286,14 @@ digest_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
}
static CamelMimeMessage *
-digest_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+digest_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelDigestFolder *digest = CAMEL_DIGEST_FOLDER (folder);
CamelDataWrapper *wrapper;
CamelMimeMessage *message;
CamelMimePart *part;
- char *subuid;
- int id;
+ gchar *subuid;
+ gint id;
part = CAMEL_MIME_PART (digest->priv->message);
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
@@ -318,7 +318,7 @@ digest_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
}
static GPtrArray *
-digest_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
+digest_search_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelDigestFolder *df = (CamelDigestFolder *) folder;
GPtrArray *matches;
@@ -337,7 +337,7 @@ digest_search_by_expression (CamelFolder *folder, const char *expression, CamelE
}
static GPtrArray *
-digest_search_by_uids (CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
+digest_search_by_uids (CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex)
{
CamelDigestFolder *df = (CamelDigestFolder *) folder;
GPtrArray *matches;
diff --git a/camel/camel-digest-store.c b/camel/camel-digest-store.c
index 68d23b410..2a893ba9d 100644
--- a/camel/camel-digest-store.c
+++ b/camel/camel-digest-store.c
@@ -34,20 +34,20 @@
#define d(x)
-static CamelFolder *digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static void digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static void digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex);
+static CamelFolder *digest_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex);
+static void digest_delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void digest_rename_folder (CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
static CamelFolder *digest_get_trash (CamelStore *store, CamelException *ex);
static CamelFolder *digest_get_junk (CamelStore *store, CamelException *ex);
-static CamelFolderInfo *digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
+static CamelFolderInfo *digest_get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
static void camel_digest_store_class_init (CamelDigestStoreClass *klass);
static void camel_digest_store_init (CamelDigestStore *obj);
static void camel_digest_store_finalise (CamelObject *obj);
-static int digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
static CamelStoreClass *parent_class = NULL;
@@ -132,7 +132,7 @@ digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
* Return value: A new CamelDigestStore widget.
**/
CamelStore *
-camel_digest_store_new (const char *url)
+camel_digest_store_new (const gchar *url)
{
CamelStore *store;
CamelURL *uri;
@@ -148,7 +148,7 @@ camel_digest_store_new (const char *url)
}
static CamelFolder *
-digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+digest_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
return NULL;
}
@@ -166,19 +166,19 @@ digest_get_junk (CamelStore *store, CamelException *ex)
}
static CamelFolderInfo *
-digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+digest_get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
return NULL;
}
static void
-digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+digest_delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
}
static void
-digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
+digest_rename_folder (CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
}
diff --git a/camel/camel-digest-store.h b/camel/camel-digest-store.h
index 0850b48d8..562c8ef86 100644
--- a/camel/camel-digest-store.h
+++ b/camel/camel-digest-store.h
@@ -48,7 +48,7 @@ struct _CamelDigestStoreClass {
CamelType camel_digest_store_get_type (void);
-CamelStore *camel_digest_store_new (const char *url);
+CamelStore *camel_digest_store_new (const gchar *url);
G_END_DECLS
diff --git a/camel/camel-disco-diary.c b/camel/camel-disco-diary.c
index 84c2faa75..b3fdb076a 100644
--- a/camel/camel-disco-diary.c
+++ b/camel/camel-disco-diary.c
@@ -109,7 +109,7 @@ camel_disco_diary_get_type (void)
static int
diary_encode_uids (CamelDiscoDiary *diary, GPtrArray *uids)
{
- int i, status;
+ gint i, status;
status = camel_file_util_encode_uint32 (diary->file, uids->len);
for (i = 0; status != -1 && i < uids->len; i++)
@@ -122,7 +122,7 @@ camel_disco_diary_log (CamelDiscoDiary *diary, CamelDiscoDiaryAction action,
...)
{
va_list ap;
- int status;
+ gint status;
d(printf("diary log: %s\n", diary->file?"ok":"no file!"));
@@ -152,7 +152,7 @@ camel_disco_diary_log (CamelDiscoDiary *diary, CamelDiscoDiaryAction action,
case CAMEL_DISCO_DIARY_FOLDER_APPEND:
{
CamelFolder *folder = va_arg (ap, CamelFolder *);
- char *uid = va_arg (ap, char *);
+ gchar *uid = va_arg (ap, gchar *);
d(printf(" folder append '%s'\n", folder->full_name));
@@ -193,7 +193,7 @@ camel_disco_diary_log (CamelDiscoDiary *diary, CamelDiscoDiaryAction action,
lose:
if (status == -1) {
- char *msg;
+ gchar *msg;
msg = g_strdup_printf (_("Could not write log entry: %s\n"
"Further operations on this server "
@@ -222,7 +222,7 @@ static GPtrArray *
diary_decode_uids (CamelDiscoDiary *diary)
{
GPtrArray *uids;
- char *uid;
+ gchar *uid;
guint32 i;
if (camel_file_util_decode_uint32 (diary->file, &i) == -1)
@@ -243,14 +243,14 @@ static CamelFolder *
diary_decode_folder (CamelDiscoDiary *diary)
{
CamelFolder *folder;
- char *name;
+ gchar *name;
if (camel_file_util_decode_string (diary->file, &name) == -1)
return NULL;
folder = g_hash_table_lookup (diary->folders, name);
if (!folder) {
CamelException ex;
- char *msg;
+ gchar *msg;
camel_exception_init (&ex);
folder = camel_store_get_folder (CAMEL_STORE (diary->store),
@@ -324,7 +324,7 @@ camel_disco_diary_replay (CamelDiscoDiary *diary, CamelException *ex)
case CAMEL_DISCO_DIARY_FOLDER_APPEND:
{
CamelFolder *folder;
- char *uid, *ret_uid;
+ gchar *uid, *ret_uid;
CamelMimeMessage *message;
CamelMessageInfo *info;
@@ -362,7 +362,7 @@ camel_disco_diary_replay (CamelDiscoDiary *diary, CamelException *ex)
CamelFolder *source, *destination;
GPtrArray *uids, *ret_uids;
guint32 delete_originals;
- int i;
+ gint i;
source = diary_decode_folder (diary);
destination = diary_decode_folder (diary);
@@ -408,7 +408,7 @@ camel_disco_diary_replay (CamelDiscoDiary *diary, CamelException *ex)
}
CamelDiscoDiary *
-camel_disco_diary_new (CamelDiscoStore *store, const char *filename, CamelException *ex)
+camel_disco_diary_new (CamelDiscoStore *store, const gchar *filename, CamelException *ex)
{
CamelDiscoDiary *diary;
@@ -455,15 +455,15 @@ camel_disco_diary_empty (CamelDiscoDiary *diary)
}
void
-camel_disco_diary_uidmap_add (CamelDiscoDiary *diary, const char *old_uid,
- const char *new_uid)
+camel_disco_diary_uidmap_add (CamelDiscoDiary *diary, const gchar *old_uid,
+ const gchar *new_uid)
{
g_hash_table_insert (diary->uidmap, g_strdup (old_uid),
g_strdup (new_uid));
}
-const char *
-camel_disco_diary_uidmap_lookup (CamelDiscoDiary *diary, const char *uid)
+const gchar *
+camel_disco_diary_uidmap_lookup (CamelDiscoDiary *diary, const gchar *uid)
{
return g_hash_table_lookup (diary->uidmap, uid);
}
diff --git a/camel/camel-disco-diary.h b/camel/camel-disco-diary.h
index ca3ada7c7..622d186ba 100644
--- a/camel/camel-disco-diary.h
+++ b/camel/camel-disco-diary.h
@@ -69,7 +69,7 @@ typedef struct {
/* public methods */
CamelDiscoDiary *camel_disco_diary_new (CamelDiscoStore *store,
- const char *filename,
+ const gchar *filename,
CamelException *ex);
gboolean camel_disco_diary_empty (CamelDiscoDiary *diary);
@@ -82,10 +82,10 @@ void camel_disco_diary_replay (CamelDiscoDiary *diary,
/* Temporary->Permanent UID map stuff */
void camel_disco_diary_uidmap_add (CamelDiscoDiary *diary,
- const char *old_uid,
- const char *new_uid);
-const char *camel_disco_diary_uidmap_lookup (CamelDiscoDiary *diary,
- const char *uid);
+ const gchar *old_uid,
+ const gchar *new_uid);
+const gchar *camel_disco_diary_uidmap_lookup (CamelDiscoDiary *diary,
+ const gchar *uid);
/* Standard Camel function */
CamelType camel_disco_diary_get_type (void);
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index a9bbb11de..61f29ff8c 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -43,8 +43,8 @@ static CamelProperty disco_property_list[] = {
{ CAMEL_DISCO_FOLDER_OFFLINE_SYNC, "offline_sync", N_("Copy folder content locally for offline operation") },
};
-static int disco_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static int disco_setv(CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint disco_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint disco_setv(CamelObject *object, CamelException *ex, CamelArgV *args);
static void disco_refresh_info (CamelFolder *folder, CamelException *ex);
static void disco_refresh_info_online (CamelFolder *folder, CamelException *ex);
@@ -52,7 +52,7 @@ static void disco_sync (CamelFolder *folder, gboolean expunge, CamelException *e
static void disco_expunge (CamelFolder *folder, CamelException *ex);
static void disco_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid, CamelException *ex);
+ const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex);
static void disco_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
CamelFolder *destination,
GPtrArray **transferred_uids,
@@ -60,9 +60,9 @@ static void disco_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
CamelException *ex);
static void disco_cache_message (CamelDiscoFolder *disco_folder,
- const char *uid, CamelException *ex);
+ const gchar *uid, CamelException *ex);
static void disco_prepare_for_offline (CamelDiscoFolder *disco_folder,
- const char *expression,
+ const gchar *expression,
CamelException *ex);
static void
@@ -100,13 +100,13 @@ static void
cdf_sync_offline(CamelSession *session, CamelSessionThreadMsg *mm)
{
struct _cdf_sync_msg *m = (struct _cdf_sync_msg *)mm;
- int i;
+ gint i;
camel_operation_start(NULL, _("Downloading new messages for offline mode"));
if (m->changes) {
for (i=0;i<m->changes->uid_added->len;i++) {
- int pc = i * 100 / m->changes->uid_added->len;
+ gint pc = i * 100 / m->changes->uid_added->len;
camel_operation_progress(NULL, pc);
camel_disco_folder_cache_message((CamelDiscoFolder *)m->folder,
@@ -138,7 +138,7 @@ static CamelSessionThreadOps cdf_sync_ops = {
};
static void
-cdf_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, void *dummy)
+cdf_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, gpointer dummy)
{
if (changes->uid_added->len > 0
&& (((CamelDiscoFolder *)folder)->offline_sync
@@ -165,7 +165,7 @@ CamelType
camel_disco_folder_get_type (void)
{
static CamelType camel_disco_folder_type = CAMEL_INVALID_TYPE;
- int i;
+ gint i;
if (camel_disco_folder_type == CAMEL_INVALID_TYPE) {
camel_disco_folder_type = camel_type_register (
@@ -187,7 +187,7 @@ camel_disco_folder_get_type (void)
static int
disco_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
- int i, count=0;
+ gint i, count=0;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -226,8 +226,8 @@ disco_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
static int
disco_setv(CamelObject *object, CamelException *ex, CamelArgV *args)
{
- int save = 0;
- int i;
+ gint save = 0;
+ gint i;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -339,7 +339,7 @@ static void
disco_expunge (CamelFolder *folder, CamelException *ex)
{
GPtrArray *uids;
- int i;
+ gint i;
guint count;
CamelMessageInfo *info;
@@ -361,7 +361,7 @@ disco_expunge (CamelFolder *folder, CamelException *ex)
static void
disco_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
CamelDiscoStore *disco = CAMEL_DISCO_STORE (folder->parent_store);
@@ -434,7 +434,7 @@ camel_disco_folder_expunge_uids (CamelFolder *folder, GPtrArray *uids,
static void
-disco_cache_message (CamelDiscoFolder *disco_folder, const char *uid,
+disco_cache_message (CamelDiscoFolder *disco_folder, const gchar *uid,
CamelException *ex)
{
g_warning ("CamelDiscoFolder::cache_message not implemented for '%s'",
@@ -451,7 +451,7 @@ disco_cache_message (CamelDiscoFolder *disco_folder, const char *uid,
**/
void
camel_disco_folder_cache_message (CamelDiscoFolder *disco_folder,
- const char *uid, CamelException *ex)
+ const gchar *uid, CamelException *ex)
{
CDF_CLASS (disco_folder)->cache_message (disco_folder, uid, ex);
}
@@ -459,12 +459,12 @@ camel_disco_folder_cache_message (CamelDiscoFolder *disco_folder,
static void
disco_prepare_for_offline (CamelDiscoFolder *disco_folder,
- const char *expression,
+ const gchar *expression,
CamelException *ex)
{
CamelFolder *folder = CAMEL_FOLDER (disco_folder);
GPtrArray *uids;
- int i;
+ gint i;
camel_operation_start(NULL, _("Preparing folder '%s' for offline"), folder->full_name);
@@ -479,7 +479,7 @@ disco_prepare_for_offline (CamelDiscoFolder *disco_folder,
}
for (i = 0; i < uids->len; i++) {
- int pc = i * 100 / uids->len;
+ gint pc = i * 100 / uids->len;
camel_disco_folder_cache_message (disco_folder, uids->pdata[i], ex);
camel_operation_progress(NULL, pc);
@@ -508,7 +508,7 @@ disco_prepare_for_offline (CamelDiscoFolder *disco_folder,
**/
void
camel_disco_folder_prepare_for_offline (CamelDiscoFolder *disco_folder,
- const char *expression,
+ const gchar *expression,
CamelException *ex)
{
g_return_if_fail (CAMEL_IS_DISCO_FOLDER (disco_folder));
diff --git a/camel/camel-disco-folder.h b/camel/camel-disco-folder.h
index 782c64670..c73e378d9 100644
--- a/camel/camel-disco-folder.h
+++ b/camel/camel-disco-folder.h
@@ -47,7 +47,7 @@ enum {
struct _CamelDiscoFolder {
CamelFolder parent_object;
- unsigned int offline_sync:1;
+ guint offline_sync:1;
};
typedef struct {
@@ -69,17 +69,17 @@ typedef struct {
void (*append_online) (CamelFolder *folder,
CamelMimeMessage *message,
const CamelMessageInfo *info,
- char **appended_uid,
+ gchar **appended_uid,
CamelException *ex);
void (*append_offline) (CamelFolder *folder,
CamelMimeMessage *message,
const CamelMessageInfo *info,
- char **appended_uid,
+ gchar **appended_uid,
CamelException *ex);
void (*append_resyncing) (CamelFolder *folder,
CamelMimeMessage *message,
const CamelMessageInfo *info,
- char **appended_uid,
+ gchar **appended_uid,
CamelException *ex);
void (*transfer_online) (CamelFolder *source, GPtrArray *uids,
@@ -99,13 +99,13 @@ typedef struct {
CamelException *ex);
void (*cache_message) (CamelDiscoFolder *disco_folder,
- const char *uid, CamelException *ex);
+ const gchar *uid, CamelException *ex);
void (*prepare_for_offline) (CamelDiscoFolder *disco_folder,
- const char *expression,
+ const gchar *expression,
CamelException *ex);
- void (*update_uid) (CamelFolder *folder, const char *old_uid,
- const char *new_uid);
+ void (*update_uid) (CamelFolder *folder, const gchar *old_uid,
+ const gchar *new_uid);
} CamelDiscoFolderClass;
@@ -114,10 +114,10 @@ void camel_disco_folder_expunge_uids (CamelFolder *folder, GPtrArray *uids,
CamelException *ex);
void camel_disco_folder_cache_message (CamelDiscoFolder *disco_folder,
- const char *uid,
+ const gchar *uid,
CamelException *ex);
void camel_disco_folder_prepare_for_offline (CamelDiscoFolder *disco_folder,
- const char *expression,
+ const gchar *expression,
CamelException *ex);
/* Standard Camel function */
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
index 903fa977a..0673c3180 100644
--- a/camel/camel-disco-store.c
+++ b/camel/camel-disco-store.c
@@ -48,18 +48,18 @@ static void disco_construct (CamelService *service, CamelSession *session,
static gboolean disco_connect (CamelService *service, CamelException *ex);
static void disco_cancel_connect (CamelService *service);
static gboolean disco_disconnect (CamelService *service, gboolean clean, CamelException *ex);
-static CamelFolder *disco_get_folder (CamelStore *store, const char *name,
+static CamelFolder *disco_get_folder (CamelStore *store, const gchar *name,
guint32 flags, CamelException *ex);
static CamelFolderInfo *disco_get_folder_info (CamelStore *store,
- const char *top, guint32 flags,
+ const gchar *top, guint32 flags,
CamelException *ex);
static void set_status (CamelDiscoStore *disco_store,
CamelDiscoStoreStatus status,
CamelException *ex);
static gboolean can_work_offline (CamelDiscoStore *disco_store);
-static int disco_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int disco_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint disco_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint disco_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
static void
camel_disco_store_class_init (CamelDiscoStoreClass *camel_disco_store_class)
@@ -225,7 +225,7 @@ disco_disconnect (CamelService *service, gboolean clean, CamelException *ex)
}
static CamelFolder *
-disco_get_folder (CamelStore *store, const char *name,
+disco_get_folder (CamelStore *store, const gchar *name,
guint32 flags, CamelException *ex)
{
CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (store);
@@ -246,7 +246,7 @@ disco_get_folder (CamelStore *store, const char *name,
}
static CamelFolderInfo *
-disco_get_folder_info (CamelStore *store, const char *top,
+disco_get_folder_info (CamelStore *store, const gchar *top,
guint32 flags, CamelException *ex)
{
CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (store);
@@ -314,7 +314,7 @@ set_status(CamelDiscoStore *disco_store, CamelDiscoStoreStatus status, CamelExce
if (((CamelStore *)disco_store)->folders) {
GPtrArray *folders;
CamelFolder *folder;
- int i, sync;
+ gint i, sync;
sync = camel_url_get_param(((CamelService *)disco_store)->url, "offline_sync") != NULL;
@@ -423,7 +423,7 @@ camel_disco_store_prepare_for_offline(CamelDiscoStore *disco_store, CamelExcepti
if (((CamelStore *)disco_store)->folders) {
GPtrArray *folders;
CamelFolder *folder;
- int i, sync;
+ gint i, sync;
sync = camel_url_get_param(((CamelService *)disco_store)->url, "offline_sync") != NULL;
diff --git a/camel/camel-disco-store.h b/camel/camel-disco-store.h
index bd83f6330..1a58a4895 100644
--- a/camel/camel-disco-store.h
+++ b/camel/camel-disco-store.h
@@ -73,28 +73,28 @@ typedef struct {
CamelException *);
CamelFolder * (*get_folder_online) (CamelStore *store,
- const char *name,
+ const gchar *name,
guint32 flags,
CamelException *ex);
CamelFolder * (*get_folder_offline) (CamelStore *store,
- const char *name,
+ const gchar *name,
guint32 flags,
CamelException *ex);
CamelFolder * (*get_folder_resyncing) (CamelStore *store,
- const char *name,
+ const gchar *name,
guint32 flags,
CamelException *ex);
CamelFolderInfo * (*get_folder_info_online) (CamelStore *store,
- const char *top,
+ const gchar *top,
guint32 flags,
CamelException *ex);
CamelFolderInfo * (*get_folder_info_offline) (CamelStore *store,
- const char *top,
+ const gchar *top,
guint32 flags,
CamelException *ex);
CamelFolderInfo * (*get_folder_info_resyncing) (CamelStore *store,
- const char *top,
+ const gchar *top,
guint32 flags,
CamelException *ex);
diff --git a/camel/camel-exception.c b/camel/camel-exception.c
index 64265df06..1c0c2c83f 100644
--- a/camel/camel-exception.c
+++ b/camel/camel-exception.c
@@ -130,10 +130,10 @@ camel_exception_free (CamelException *exception)
* simply returns.
**/
void
-camel_exception_set (CamelException *ex, ExceptionId id, const char *desc)
+camel_exception_set (CamelException *ex, ExceptionId id, const gchar *desc)
{
if (camel_debug("exception"))
- printf("CamelException.set(%p, %u, '%s')\n", (void *) ex, id, desc);
+ printf("CamelException.set(%p, %u, '%s')\n", (gpointer) ex, id, desc);
if (!ex)
return;
ex->id = id;
@@ -164,17 +164,17 @@ camel_exception_set (CamelException *ex, ExceptionId id, const char *desc)
* simply returns.
**/
void
-camel_exception_setv (CamelException *ex, ExceptionId id, const char *format, ...)
+camel_exception_setv (CamelException *ex, ExceptionId id, const gchar *format, ...)
{
va_list args;
- char *desc;
+ gchar *desc;
va_start(args, format);
desc = g_strdup_vprintf (format, args);
va_end (args);
if (camel_debug("exception"))
- printf("CamelException.setv(%p, %u, '%s')\n", (void *) ex, id, desc);
+ printf("CamelException.setv(%p, %u, '%s')\n", (gpointer) ex, id, desc);
if (!ex) {
g_free(desc);
@@ -252,7 +252,7 @@ camel_exception_get_id (CamelException *ex)
const gchar *
camel_exception_get_description (CamelException *ex)
{
- char *ret = NULL;
+ gchar *ret = NULL;
if (ex)
ret = ex->desc;
diff --git a/camel/camel-exception.h b/camel/camel-exception.h
index 597985e79..e305f7c67 100644
--- a/camel/camel-exception.h
+++ b/camel/camel-exception.h
@@ -40,7 +40,7 @@ typedef enum {
struct _CamelException {
/* do not access the fields directly */
ExceptionId id;
- char *desc;
+ gchar *desc;
};
#define CAMEL_EXCEPTION_INITIALISER { 0, NULL }
@@ -55,10 +55,10 @@ void camel_exception_init (CamelException *ex);
void camel_exception_clear (CamelException *ex);
void camel_exception_set (CamelException *ex,
ExceptionId id,
- const char *desc);
+ const gchar *desc);
void camel_exception_setv (CamelException *ex,
ExceptionId id,
- const char *format,
+ const gchar *format,
...);
/* exception content transfer */
@@ -68,7 +68,7 @@ void camel_exception_xfer (CamelException *ex_dst,
/* exception content retrieval */
ExceptionId camel_exception_get_id (CamelException *ex);
-const char * camel_exception_get_description (CamelException *ex);
+const gchar * camel_exception_get_description (CamelException *ex);
#define camel_exception_is_set(ex) (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE)
diff --git a/camel/camel-file-utils.c b/camel/camel-file-utils.c
index 6107991dd..2c78eb192 100644
--- a/camel/camel-file-utils.c
+++ b/camel/camel-file-utils.c
@@ -58,14 +58,14 @@
*
* Return value: %0 on success, %-1 on error.
**/
-int
+gint
camel_file_util_encode_uint32 (FILE *out, guint32 value)
{
- int i;
+ gint i;
for (i = 28; i > 0; i -= 7) {
if (value >= (1 << i)) {
- unsigned int c = (value >> i) & 0x7f;
+ guint c = (value >> i) & 0x7f;
if (fputc (c, out) == -1)
return -1;
}
@@ -84,11 +84,11 @@ camel_file_util_encode_uint32 (FILE *out, guint32 value)
* Return value: %0 on success, %-1 on error. @*dest will contain the
* decoded value.
**/
-int
+gint
camel_file_util_decode_uint32 (FILE *in, guint32 *dest)
{
guint32 value = 0;
- int v;
+ gint v;
/* until we get the last byte, keep decoding 7 bits at a time */
while ( ((v = fgetc (in)) & 0x80) == 0 && v!=EOF) {
@@ -115,7 +115,7 @@ camel_file_util_decode_uint32 (FILE *in, guint32 *dest)
*
* Return value: %0 on success, %-1 on error.
**/
-int
+gint
camel_file_util_encode_fixed_int32 (FILE *out, gint32 value)
{
guint32 save;
@@ -136,7 +136,7 @@ camel_file_util_encode_fixed_int32 (FILE *out, gint32 value)
*
* Return value: %0 on success, %-1 on error.
**/
-int
+gint
camel_file_util_decode_fixed_int32 (FILE *in, gint32 *dest)
{
guint32 save;
@@ -153,7 +153,7 @@ camel_file_util_decode_fixed_int32 (FILE *in, gint32 *dest)
int \
camel_file_util_encode_##type(FILE *out, type value) \
{ \
- int i; \
+ gint i; \
\
for (i = sizeof (type) - 1; i >= 0; i--) { \
if (fputc((value >> (i * 8)) & 0xff, out) == -1) \
@@ -167,8 +167,8 @@ int \
camel_file_util_decode_##type(FILE *in, type *dest) \
{ \
type save = 0; \
- int i = sizeof(type) - 1; \
- int v = EOF; \
+ gint i = sizeof(type) - 1; \
+ gint v = EOF; \
\
while (i >= 0 && (v = fgetc (in)) != EOF) { \
save |= ((type)v) << (i * 8); \
@@ -259,10 +259,10 @@ CFU_DECODE_T(size_t)
*
* Return value: %0 on success, %-1 on error.
**/
-int
-camel_file_util_encode_string (FILE *out, const char *str)
+gint
+camel_file_util_encode_string (FILE *out, const gchar *str)
{
- register int len;
+ register gint len;
if (str == NULL)
return camel_file_util_encode_uint32 (out, 1);
@@ -287,11 +287,11 @@ camel_file_util_encode_string (FILE *out, const char *str)
*
* Return value: %0 on success, %-1 on error.
**/
-int
-camel_file_util_decode_string (FILE *in, char **str)
+gint
+camel_file_util_decode_string (FILE *in, gchar **str)
{
guint32 len;
- register char *ret;
+ register gchar *ret;
if (camel_file_util_decode_uint32 (in, &len) == -1) {
*str = NULL;
@@ -328,10 +328,10 @@ camel_file_util_decode_string (FILE *in, char **str)
*
* Return value: %0 on success, %-1 on error.
**/
-int
-camel_file_util_encode_fixed_string (FILE *out, const char *str, size_t len)
+gint
+camel_file_util_encode_fixed_string (FILE *out, const gchar *str, size_t len)
{
- char buf[len];
+ gchar buf[len];
/* Don't allow empty strings to be written */
if (len < 1)
@@ -361,10 +361,10 @@ camel_file_util_encode_fixed_string (FILE *out, const char *str, size_t len)
*
* Return value: %0 on success, %-1 on error.
**/
-int
-camel_file_util_decode_fixed_string (FILE *in, char **str, size_t len)
+gint
+camel_file_util_decode_fixed_string (FILE *in, gchar **str, size_t len)
{
- register char *ret;
+ register gchar *ret;
if (len > 65536) {
*str = NULL;
@@ -392,13 +392,13 @@ camel_file_util_decode_fixed_string (FILE *in, char **str, size_t len)
*
* Returns: a safe filename string.
**/
-char *
-camel_file_util_safe_filename (const char *name)
+gchar *
+camel_file_util_safe_filename (const gchar *name)
{
#ifdef G_OS_WIN32
- const char *unsafe_chars = "/?()'*<>:\"\\|";
+ const gchar *unsafe_chars = "/?()'*<>:\"\\|";
#else
- const char *unsafe_chars = "/?()'*";
+ const gchar *unsafe_chars = "/?()'*";
#endif
if (name == NULL)
@@ -425,10 +425,10 @@ camel_file_util_safe_filename (const char *name)
* be set appropriately.
**/
ssize_t
-camel_read (int fd, char *buf, size_t n)
+camel_read (gint fd, gchar *buf, size_t n)
{
ssize_t nread;
- int cancel_fd;
+ gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
errno = EINTR;
@@ -445,7 +445,7 @@ camel_read (int fd, char *buf, size_t n)
} while (nread == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
} else {
#ifndef G_OS_WIN32
- int errnosav, flags, fdmax;
+ gint errnosav, flags, fdmax;
fd_set rdset;
flags = fcntl (fd, F_GETFL);
@@ -453,7 +453,7 @@ camel_read (int fd, char *buf, size_t n)
do {
struct timeval tv;
- int res;
+ gint res;
FD_ZERO (&rdset);
FD_SET (fd, &rdset);
@@ -503,10 +503,10 @@ camel_read (int fd, char *buf, size_t n)
* be set appropriately.
**/
ssize_t
-camel_write (int fd, const char *buf, size_t n)
+camel_write (gint fd, const gchar *buf, size_t n)
{
ssize_t w, written = 0;
- int cancel_fd;
+ gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
errno = EINTR;
@@ -527,7 +527,7 @@ camel_write (int fd, const char *buf, size_t n)
} while (w != -1 && written < n);
} else {
#ifndef G_OS_WIN32
- int errnosav, flags, fdmax;
+ gint errnosav, flags, fdmax;
fd_set rdset, wrset;
flags = fcntl (fd, F_GETFL);
@@ -536,7 +536,7 @@ camel_write (int fd, const char *buf, size_t n)
fdmax = MAX (fd, cancel_fd) + 1;
do {
struct timeval tv;
- int res;
+ gint res;
FD_ZERO (&rdset);
FD_ZERO (&wrset);
@@ -594,13 +594,13 @@ camel_write (int fd, const char *buf, size_t n)
* camel_read_socket() will retry the read until it gets something.
**/
ssize_t
-camel_read_socket (int fd, char *buf, size_t n)
+camel_read_socket (gint fd, gchar *buf, size_t n)
{
#ifndef G_OS_WIN32
return camel_read (fd, buf, n);
#else
ssize_t nread;
- int cancel_fd;
+ gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
errno = EINTR;
@@ -613,7 +613,7 @@ camel_read_socket (int fd, char *buf, size_t n)
nread = recv (fd, buf, n, 0);
} while (nread == SOCKET_ERROR && WSAGetLastError () == WSAEWOULDBLOCK);
} else {
- int fdmax;
+ gint fdmax;
fd_set rdset;
u_long yes = 1;
@@ -621,7 +621,7 @@ camel_read_socket (int fd, char *buf, size_t n)
fdmax = MAX (fd, cancel_fd) + 1;
do {
struct timeval tv;
- int res;
+ gint res;
FD_ZERO (&rdset);
FD_SET (fd, &rdset);
@@ -664,13 +664,13 @@ camel_read_socket (int fd, char *buf, size_t n)
* be set appropriately.
**/
ssize_t
-camel_write_socket (int fd, const char *buf, size_t n)
+camel_write_socket (gint fd, const gchar *buf, size_t n)
{
#ifndef G_OS_WIN32
return camel_write (fd, buf, n);
#else
ssize_t w, written = 0;
- int cancel_fd;
+ gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
errno = EINTR;
@@ -687,7 +687,7 @@ camel_write_socket (int fd, const char *buf, size_t n)
written += w;
} while (w != -1 && written < n);
} else {
- int fdmax;
+ gint fdmax;
fd_set rdset, wrset;
u_long arg = 1;
@@ -695,7 +695,7 @@ camel_write_socket (int fd, const char *buf, size_t n)
fdmax = MAX (fd, cancel_fd) + 1;
do {
struct timeval tv;
- int res;
+ gint res;
FD_ZERO (&rdset);
FD_ZERO (&wrset);
@@ -743,18 +743,18 @@ camel_write_socket (int fd, const char *buf, size_t n)
*
* Return value: The new pathname. It must be free'd with g_free().
**/
-char *
-camel_file_util_savename(const char *filename)
+gchar *
+camel_file_util_savename(const gchar *filename)
{
- char *dirname, *retval;
+ gchar *dirname, *retval;
dirname = g_path_get_dirname(filename);
if (strcmp (dirname, ".") == 0) {
retval = g_strconcat (".#", filename, NULL);
} else {
- char *basename = g_path_get_basename(filename);
- char *newbasename = g_strconcat (".#", basename, NULL);
+ gchar *basename = g_path_get_basename(filename);
+ gchar *newbasename = g_strconcat (".#", basename, NULL);
retval = g_build_filename (dirname, newbasename, NULL);
diff --git a/camel/camel-file-utils.h b/camel/camel-file-utils.h
index 60c5e1d9d..243e1c550 100644
--- a/camel/camel-file-utils.h
+++ b/camel/camel-file-utils.h
@@ -39,23 +39,23 @@
G_BEGIN_DECLS
-int camel_file_util_encode_fixed_int32 (FILE *out, gint32 value);
-int camel_file_util_decode_fixed_int32 (FILE *in, gint32 *dest);
-int camel_file_util_encode_uint32 (FILE *out, guint32 value);
-int camel_file_util_decode_uint32 (FILE *in, guint32 *dest);
-int camel_file_util_encode_time_t (FILE *out, time_t value);
-int camel_file_util_decode_time_t (FILE *in, time_t *dest);
-int camel_file_util_encode_off_t (FILE *out, off_t value);
-int camel_file_util_decode_off_t (FILE *in, off_t *dest);
-int camel_file_util_encode_size_t (FILE *out, size_t value);
-int camel_file_util_decode_size_t (FILE *in, size_t *dest);
-int camel_file_util_encode_string (FILE *out, const char *str);
-int camel_file_util_decode_string (FILE *in, char **str);
-int camel_file_util_encode_fixed_string (FILE *out, const char *str, size_t len);
-int camel_file_util_decode_fixed_string (FILE *in, char **str, size_t len);
+gint camel_file_util_encode_fixed_int32 (FILE *out, gint32 value);
+gint camel_file_util_decode_fixed_int32 (FILE *in, gint32 *dest);
+gint camel_file_util_encode_uint32 (FILE *out, guint32 value);
+gint camel_file_util_decode_uint32 (FILE *in, guint32 *dest);
+gint camel_file_util_encode_time_t (FILE *out, time_t value);
+gint camel_file_util_decode_time_t (FILE *in, time_t *dest);
+gint camel_file_util_encode_off_t (FILE *out, off_t value);
+gint camel_file_util_decode_off_t (FILE *in, off_t *dest);
+gint camel_file_util_encode_size_t (FILE *out, size_t value);
+gint camel_file_util_decode_size_t (FILE *in, size_t *dest);
+gint camel_file_util_encode_string (FILE *out, const gchar *str);
+gint camel_file_util_decode_string (FILE *in, gchar **str);
+gint camel_file_util_encode_fixed_string (FILE *out, const gchar *str, size_t len);
+gint camel_file_util_decode_fixed_string (FILE *in, gchar **str, size_t len);
-char *camel_file_util_safe_filename (const char *name);
+gchar *camel_file_util_safe_filename (const gchar *name);
/* Code that intends to be portable to Win32 should use camel_read()
* and camel_write() only on file descriptors returned from open(),
@@ -64,13 +64,13 @@ char *camel_file_util_safe_filename (const char *name);
* camel_read_socket() and camel_write_socket(). These are cancellable
* also on Win32.
*/
-ssize_t camel_read (int fd, char *buf, size_t n);
-ssize_t camel_write (int fd, const char *buf, size_t n);
+ssize_t camel_read (gint fd, gchar *buf, size_t n);
+ssize_t camel_write (gint fd, const gchar *buf, size_t n);
-ssize_t camel_read_socket (int fd, char *buf, size_t n);
-ssize_t camel_write_socket (int fd, const char *buf, size_t n);
+ssize_t camel_read_socket (gint fd, gchar *buf, size_t n);
+ssize_t camel_write_socket (gint fd, const gchar *buf, size_t n);
-char *camel_file_util_savename(const char *filename);
+gchar *camel_file_util_savename(const gchar *filename);
G_END_DECLS
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 188c48300..d84746d75 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -55,7 +55,7 @@
#define d(x)
/* an invalid pointer */
-#define FOLDER_INVALID ((void *)~0)
+#define FOLDER_INVALID ((gpointer)~0)
/* type of status for a log report */
enum filter_log_t {
@@ -70,9 +70,9 @@ struct _filter_rule {
struct _filter_rule *next;
struct _filter_rule *prev;
- char *match;
- char *action;
- char *name;
+ gchar *match;
+ gchar *action;
+ gchar *name;
};
struct _CamelFilterDriverPrivate {
@@ -83,24 +83,24 @@ struct _CamelFilterDriverPrivate {
CamelFolder *defaultfolder; /* defualt folder */
CamelFilterStatusFunc *statusfunc; /* status callback */
- void *statusdata; /* status callback data */
+ gpointer statusdata; /* status callback data */
CamelFilterShellFunc *shellfunc; /* execute shell command callback */
- void *shelldata; /* execute shell command callback data */
+ gpointer shelldata; /* execute shell command callback data */
CamelFilterPlaySoundFunc *playfunc; /* play-sound command callback */
- void *playdata; /* play-sound command callback data */
+ gpointer playdata; /* play-sound command callback data */
CamelFilterSystemBeepFunc *beep; /* system beep callback */
- void *beepdata; /* system beep callback data */
+ gpointer beepdata; /* system beep callback data */
/* for callback */
CamelFilterGetFolderFunc get_folder;
- void *data;
+ gpointer data;
/* run-time data */
GHashTable *folders; /* folders that message has been copied to */
- int closed; /* close count */
+ gint closed; /* close count */
GHashTable *only_once; /* actions to run only-once */
gboolean terminated; /* message processing was terminated */
@@ -110,7 +110,7 @@ struct _CamelFilterDriverPrivate {
CamelMimeMessage *message; /* input message */
CamelMessageInfo *info; /* message summary info */
- const char *uid; /* message uid */
+ const gchar *uid; /* message uid */
CamelFolder *source; /* message source folder */
gboolean modified; /* has the input message been modified? */
@@ -130,33 +130,33 @@ static void camel_filter_driver_class_init (CamelFilterDriverClass *klass);
static void camel_filter_driver_init (CamelFilterDriver *obj);
static void camel_filter_driver_finalise (CamelObject *obj);
-static void camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const char *desc, ...);
-
-static CamelFolder *open_folder (CamelFilterDriver *d, const char *folder_url);
-static int close_folders (CamelFilterDriver *d);
-
-static ESExpResult *do_delete (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_forward_to (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_adjust_score(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *set_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *unset_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_shell (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_beep (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *play_sound (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_only_once (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
+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);
+static gint close_folders (CamelFilterDriver *d);
+
+static ESExpResult *do_delete (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_forward_to (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_copy (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_move (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_stop (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_label (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_colour (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_score (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_adjust_score(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *set_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *unset_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_shell (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_beep (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *play_sound (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_only_once (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *pipe_message (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *);
/* these are our filter actions - each must have a callback */
static struct {
- char *name;
+ gchar *name;
ESExpFunc *func;
- int type; /* set to 1 if a function can perform shortcut evaluation, or
+ gint type; /* set to 1 if a function can perform shortcut evaluation, or
doesn't execute everything, 0 otherwise */
} symbols[] = {
{ "delete", (ESExpFunc *) do_delete, 0 },
@@ -210,7 +210,7 @@ static void
camel_filter_driver_init (CamelFilterDriver *obj)
{
struct _CamelFilterDriverPrivate *p;
- int i;
+ gint i;
p = _PRIVATE (obj) = g_malloc0 (sizeof (*p));
@@ -234,7 +234,7 @@ camel_filter_driver_init (CamelFilterDriver *obj)
}
static void
-free_hash_strings (void *key, void *value, void *data)
+free_hash_strings (gpointer key, gpointer value, gpointer data)
{
g_free (key);
g_free (value);
@@ -293,7 +293,7 @@ camel_filter_driver_new (CamelSession *session)
}
void
-camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc get_folder, void *data)
+camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc get_folder, gpointer data)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
@@ -310,7 +310,7 @@ camel_filter_driver_set_logfile (CamelFilterDriver *d, FILE *logfile)
}
void
-camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, void *data)
+camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, gpointer data)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
@@ -319,7 +319,7 @@ camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc
}
void
-camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, void *data)
+camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, gpointer data)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
@@ -328,7 +328,7 @@ camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *
}
void
-camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, void *data)
+camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, gpointer data)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
@@ -337,7 +337,7 @@ camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySo
}
void
-camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, void *data)
+camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, gpointer data)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
@@ -364,7 +364,7 @@ camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def)
}
void
-camel_filter_driver_add_rule(CamelFilterDriver *d, const char *name, const char *match, const char *action)
+camel_filter_driver_add_rule(CamelFilterDriver *d, const gchar *name, const gchar *match, const gchar *action)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
struct _filter_rule *node;
@@ -376,8 +376,8 @@ camel_filter_driver_add_rule(CamelFilterDriver *d, const char *name, const char
camel_dlist_addtail(&p->rules, (CamelDListNode *)node);
}
-int
-camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const char *name)
+gint
+camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const gchar *name)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
struct _filter_rule *node;
@@ -401,12 +401,12 @@ camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const char *name)
}
static void
-report_status (CamelFilterDriver *driver, enum camel_filter_status_t status, int pc, const char *desc, ...)
+report_status (CamelFilterDriver *driver, enum camel_filter_status_t status, gint pc, const gchar *desc, ...)
{
/* call user-defined status report function */
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
va_list ap;
- char *str;
+ gchar *str;
if (p->statusfunc) {
va_start (ap, desc);
@@ -419,12 +419,12 @@ report_status (CamelFilterDriver *driver, enum camel_filter_status_t status, int
#if 0
void
-camel_filter_driver_set_global (CamelFilterDriver *d, const char *name, const char *value)
+camel_filter_driver_set_global (CamelFilterDriver *d, const gchar *name, const gchar *value)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
- char *oldkey, *oldvalue;
+ gchar *oldkey, *oldvalue;
- if (g_hash_table_lookup_extended (p->globals, name, (void *)&oldkey, (void *)&oldvalue)) {
+ if (g_hash_table_lookup_extended (p->globals, name, (gpointer)&oldkey, (gpointer)&oldvalue)) {
g_free (oldvalue);
g_hash_table_insert (p->globals, oldkey, g_strdup (value));
} else {
@@ -434,7 +434,7 @@ camel_filter_driver_set_global (CamelFilterDriver *d, const char *name, const ch
#endif
static ESExpResult *
-do_delete (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_delete (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -446,7 +446,7 @@ do_delete (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDr
}
static ESExpResult *
-do_forward_to (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_forward_to (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -469,17 +469,17 @@ do_forward_to (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilt
}
static ESExpResult *
-do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_copy (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- int i;
+ gint i;
d(fprintf (stderr, "copying message...\n"));
for (i = 0; i < argc; i++) {
if (argv[i]->type == ESEXP_RES_STRING) {
/* open folders we intent to copy to */
- char *folder = argv[i]->value.string;
+ gchar *folder = argv[i]->value.string;
CamelFolder *outbox;
outbox = open_folder (driver, folder);
@@ -493,7 +493,7 @@ do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
GPtrArray *uids;
uids = g_ptr_array_new ();
- g_ptr_array_add (uids, (char *) p->uid);
+ g_ptr_array_add (uids, (gchar *) p->uid);
camel_folder_transfer_messages_to (p->source, uids, outbox, NULL, FALSE, p->ex);
g_ptr_array_free (uids, TRUE);
} else {
@@ -518,19 +518,19 @@ do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
}
static ESExpResult *
-do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_move (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- int i;
+ gint i;
d(fprintf (stderr, "moving message...\n"));
for (i = 0; i < argc; i++) {
if (argv[i]->type == ESEXP_RES_STRING) {
/* open folders we intent to move to */
- char *folder = argv[i]->value.string;
+ gchar *folder = argv[i]->value.string;
CamelFolder *outbox;
- int last;
+ gint last;
outbox = open_folder (driver, folder);
if (!outbox)
@@ -546,7 +546,7 @@ do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
GPtrArray *uids;
uids = g_ptr_array_new ();
- g_ptr_array_add (uids, (char *) p->uid);
+ g_ptr_array_add (uids, (gchar *) p->uid);
camel_folder_transfer_messages_to (p->source, uids, outbox, NULL, last, p->ex);
g_ptr_array_free (uids, TRUE);
} else {
@@ -581,7 +581,7 @@ do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
}
static ESExpResult *
-do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_stop (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -593,7 +593,7 @@ do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
}
static ESExpResult *
-do_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_label (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -601,9 +601,9 @@ do_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) {
/* This is a list of new labels, we should used these in case of passing in old names.
This all is required only because backward compatibility. */
- const char *new_labels[] = { "$Labelimportant", "$Labelwork", "$Labelpersonal", "$Labeltodo", "$Labellater", NULL};
- const char *label;
- int i;
+ const gchar *new_labels[] = { "$Labelimportant", "$Labelwork", "$Labelpersonal", "$Labeltodo", "$Labellater", NULL};
+ const gchar *label;
+ gint i;
label = argv[0]->value.string;
@@ -625,7 +625,7 @@ do_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
}
static ESExpResult *
-do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_colour (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -642,13 +642,13 @@ do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDr
}
static ESExpResult *
-do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_score (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
d(fprintf (stderr, "setting score tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
- char *value;
+ gchar *value;
value = g_strdup_printf ("%d", argv[0]->value.number);
camel_message_info_set_user_tag(p->info, "score", value);
@@ -660,16 +660,16 @@ do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
}
static ESExpResult *
-do_adjust_score(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_adjust_score(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE(driver);
d(fprintf (stderr, "adjusting score tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
- char *value;
- int old;
+ gchar *value;
+ gint old;
- value = (char *)camel_message_info_user_tag(p->info, "score");
+ value = (gchar *)camel_message_info_user_tag(p->info, "score");
old = value?atoi(value):0;
value = g_strdup_printf ("%d", old+argv[0]->value.number);
camel_message_info_set_user_tag(p->info, "score", value);
@@ -681,7 +681,7 @@ do_adjust_score(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFil
}
static ESExpResult *
-set_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+set_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
guint32 flags;
@@ -700,7 +700,7 @@ set_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
}
static ESExpResult *
-unset_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+unset_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
guint32 flags;
@@ -748,10 +748,10 @@ child_watch (GPid pid,
}
static int
-pipe_to_system (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+pipe_to_system (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- int i, pipe_to_child, pipe_from_child;
+ gint i, pipe_to_child, pipe_from_child;
CamelMimeMessage *message = NULL;
CamelMimeParser *parser;
CamelStream *stream, *mem;
@@ -871,9 +871,9 @@ pipe_to_system (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFil
}
static ESExpResult *
-pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+pipe_message (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- int i;
+ gint i;
/* make sure all args are strings */
for (i = 0; i < argc; i++) {
@@ -888,12 +888,12 @@ pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilte
}
static ESExpResult *
-do_shell (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_shell (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
GString *command;
GPtrArray *args;
- int i;
+ gint i;
d(fprintf (stderr, "executing shell command\n"));
@@ -915,7 +915,7 @@ do_shell (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
g_string_truncate (command, command->len - 1);
if (p->shellfunc && argc >= 1) {
- p->shellfunc (driver, argc, (char **) args->pdata, p->shelldata);
+ p->shellfunc (driver, argc, (gchar **) args->pdata, p->shelldata);
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Executing shell command: [%s]",
command->str);
}
@@ -929,7 +929,7 @@ do_shell (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
}
static ESExpResult *
-do_beep (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_beep (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -944,7 +944,7 @@ do_beep (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
}
static ESExpResult *
-play_sound (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+play_sound (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -959,7 +959,7 @@ play_sound (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterD
}
static ESExpResult *
-do_only_once (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+do_only_once (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -973,7 +973,7 @@ do_only_once (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilte
}
static CamelFolder *
-open_folder (CamelFilterDriver *driver, const char *folder_url)
+open_folder (CamelFilterDriver *driver, const gchar *folder_url)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
CamelFolder *camelfolder;
@@ -1008,7 +1008,7 @@ open_folder (CamelFilterDriver *driver, const char *folder_url)
}
static void
-close_folder (void *key, void *value, void *data)
+close_folder (gpointer key, gpointer value, gpointer data)
{
CamelFolder *folder = value;
CamelFilterDriver *driver = data;
@@ -1053,12 +1053,12 @@ free_key (gpointer key, gpointer value, gpointer user_data)
static void
-camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const char *desc, ...)
+camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const gchar *desc, ...)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
if (p->logfile) {
- char *str = NULL;
+ gchar *str = NULL;
if (desc) {
va_list ap;
@@ -1070,9 +1070,9 @@ camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, co
switch (status) {
case FILTER_LOG_START: {
/* write log header */
- const char *subject = NULL;
- const char *from = NULL;
- char date[50];
+ const gchar *subject = NULL;
+ const gchar *from = NULL;
+ gchar date[50];
time_t t;
/* FIXME: does this need locking? Probably */
@@ -1109,7 +1109,7 @@ struct _run_only_once {
};
static gboolean
-run_only_once (gpointer key, char *action, struct _run_only_once *data)
+run_only_once (gpointer key, gchar *action, struct _run_only_once *data)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (data->driver);
CamelException *ex = data->ex;
@@ -1170,10 +1170,10 @@ camel_filter_driver_flush (CamelFilterDriver *driver, CamelException *ex)
static int
-decode_flags_from_xev(const char *xev, CamelMessageInfoBase *mi)
+decode_flags_from_xev(const gchar *xev, CamelMessageInfoBase *mi)
{
guint32 uid, flags = 0;
- char *header;
+ gchar *header;
/* check for uid/flags */
header = camel_header_token_decode(xev);
@@ -1203,18 +1203,18 @@ decode_flags_from_xev(const char *xev, CamelMessageInfoBase *mi)
* otherwise returns 0.
*
**/
-int
-camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, const char *original_source_url, CamelException *ex)
+gint
+camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const gchar *mbox, const gchar *original_source_url, CamelException *ex)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
CamelMimeParser *mp = NULL;
- char *source_url = NULL;
- int fd = -1;
- int i = 0;
+ gchar *source_url = NULL;
+ gint fd = -1;
+ gint i = 0;
struct stat st;
- int status;
+ gint status;
off_t last = 0;
- int ret = -1;
+ gint ret = -1;
fd = g_open (mbox, O_RDONLY|O_BINARY, 0);
if (fd == -1) {
@@ -1237,8 +1237,8 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
CamelMessageInfo *info;
CamelMimeMessage *msg;
- int pc = 0;
- const char *xev;
+ gint pc = 0;
+ const gchar *xev;
if (st.st_size > 0)
pc = (int)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size));
@@ -1314,17 +1314,17 @@ fail:
* otherwise returns 0.
*
**/
-int
+gint
camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folder, CamelUIDCache *cache,
GPtrArray *uids, gboolean remove, CamelException *ex)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
gboolean freeuids = FALSE;
CamelMessageInfo *info;
- char *source_url, *service_url;
- int status = 0;
+ gchar *source_url, *service_url;
+ gint status = 0;
CamelURL *url;
- int i;
+ gint i;
service_url = camel_service_get_url (CAMEL_SERVICE (camel_folder_get_parent_store (folder)));
url = camel_url_new (service_url, NULL);
@@ -1339,7 +1339,7 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde
}
for (i = 0; i < uids->len; i++) {
- int pc = (100 * i)/uids->len;
+ gint pc = (100 * i)/uids->len;
report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d of %d"), i+1,
uids->len);
@@ -1389,23 +1389,23 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde
struct _get_message {
struct _CamelFilterDriverPrivate *p;
- const char *source_url;
+ const gchar *source_url;
};
static CamelMimeMessage *
-get_message_cb (void *data, CamelException *ex)
+get_message_cb (gpointer data, CamelException *ex)
{
struct _get_message *msgdata = data;
struct _CamelFilterDriverPrivate *p = msgdata->p;
- const char *source_url = msgdata->source_url;
+ const gchar *source_url = msgdata->source_url;
CamelMimeMessage *message;
if (p->message) {
message = p->message;
camel_object_ref (message);
} else {
- const char *uid;
+ const gchar *uid;
if (p->uid)
uid = p->uid;
@@ -1442,11 +1442,11 @@ get_message_cb (void *data, CamelException *ex)
* otherwise returns 0.
*
**/
-int
+gint
camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage *message,
- CamelMessageInfo *info, const char *uid,
- CamelFolder *source, const char *source_url,
- const char *original_source_url,
+ CamelMessageInfo *info, const gchar *uid,
+ CamelFolder *source, const gchar *source_url,
+ const gchar *original_source_url,
CamelException *ex)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -1454,7 +1454,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
gboolean freeinfo = FALSE;
gboolean filtered = FALSE;
ESExpResult *r;
- int result;
+ gint result;
/* FIXME: make me into a g_return_if_fail/g_assert or whatever... */
if (message == NULL && (source == NULL || uid == NULL)) {
@@ -1571,7 +1571,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
GPtrArray *uids;
uids = g_ptr_array_new ();
- g_ptr_array_add (uids, (char *) p->uid);
+ g_ptr_array_add (uids, (gchar *) p->uid);
camel_folder_transfer_messages_to (p->source, uids, p->defaultfolder, NULL, FALSE, p->ex);
g_ptr_array_free (uids, TRUE);
} else {
diff --git a/camel/camel-filter-driver.h b/camel/camel-filter-driver.h
index 3d3d5c697..c361f9c58 100644
--- a/camel/camel-filter-driver.h
+++ b/camel/camel-filter-driver.h
@@ -57,15 +57,15 @@ enum camel_filter_status_t {
CAMEL_FILTER_STATUS_END /* end of message */
};
-typedef CamelFolder * (*CamelFilterGetFolderFunc) (CamelFilterDriver *driver, const char *uri,
- void *data, CamelException *ex);
+typedef CamelFolder * (*CamelFilterGetFolderFunc) (CamelFilterDriver *driver, const gchar *uri,
+ gpointer data, CamelException *ex);
/* report status */
typedef void (CamelFilterStatusFunc) (CamelFilterDriver *driver, enum camel_filter_status_t status,
- int pc, const char *desc, void *data);
+ gint pc, const gchar *desc, gpointer data);
-typedef void (CamelFilterShellFunc) (CamelFilterDriver *driver, int argc, char **argv, void *data);
-typedef void (CamelFilterPlaySoundFunc) (CamelFilterDriver *driver, const char *filename, void *data);
-typedef void (CamelFilterSystemBeepFunc) (CamelFilterDriver *driver, void *data);
+typedef void (CamelFilterShellFunc) (CamelFilterDriver *driver, gint argc, gchar **argv, gpointer data);
+typedef void (CamelFilterPlaySoundFunc) (CamelFilterDriver *driver, const gchar *filename, gpointer data);
+typedef void (CamelFilterSystemBeepFunc) (CamelFilterDriver *driver, gpointer data);
CamelType camel_filter_driver_get_type (void);
CamelFilterDriver *camel_filter_driver_new (CamelSession *);
@@ -73,31 +73,31 @@ CamelFilterDriver *camel_filter_driver_new (CamelSession *);
/* modifiers */
void camel_filter_driver_set_logfile (CamelFilterDriver *d, FILE *logfile);
-void camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, void *data);
-void camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, void *data);
-void camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, void *data);
-void camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, void *data);
-void camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc fetcher, void *data);
+void camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, gpointer data);
+void camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, gpointer data);
+void camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, gpointer data);
+void camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, gpointer data);
+void camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc fetcher, gpointer data);
void camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def);
-void camel_filter_driver_add_rule (CamelFilterDriver *d, const char *name, const char *match,
- const char *action);
-int camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const char *name);
+void camel_filter_driver_add_rule (CamelFilterDriver *d, const gchar *name, const gchar *match,
+ const gchar *action);
+gint camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const gchar *name);
-/*void camel_filter_driver_set_global(CamelFilterDriver *, const char *name, const char *value);*/
+/*void camel_filter_driver_set_global(CamelFilterDriver *, const gchar *name, const gchar *value);*/
void camel_filter_driver_flush (CamelFilterDriver *driver, CamelException *ex);
-int camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage *message,
- CamelMessageInfo *info, const char *uid,
- CamelFolder *source, const char *source_url,
- const char *original_source_url, CamelException *ex);
+gint camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage *message,
+ CamelMessageInfo *info, const gchar *uid,
+ CamelFolder *source, const gchar *source_url,
+ const gchar *original_source_url, CamelException *ex);
-int camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox,
- const char *original_source_url, CamelException *ex);
+gint camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const gchar *mbox,
+ const gchar *original_source_url, CamelException *ex);
-int camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folder, CamelUIDCache *cache,
+gint camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folder, CamelUIDCache *cache,
GPtrArray *uids, gboolean remove, CamelException *ex);
#if 0
@@ -105,8 +105,8 @@ int camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelF
void camel_filter_driver_expand_option (CamelFilterDriver *d, GString *s, GString *action, struct filter_option *op);
/* get info about rules (options) */
-int camel_filter_driver_rule_count (CamelFilterDriver *d);
-struct filter_option *camel_filter_driver_rule_get (CamelFilterDriver *d, int n);
+gint camel_filter_driver_rule_count (CamelFilterDriver *d);
+struct filter_option *camel_filter_driver_rule_get (CamelFilterDriver *d, gint n);
#endif
G_END_DECLS
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index 28d941d0a..aebfcf4d4 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -65,41 +65,41 @@
typedef struct {
CamelSession *session;
CamelFilterSearchGetMessageFunc get_message;
- void *get_message_data;
+ gpointer get_message_data;
CamelMimeMessage *message;
CamelMessageInfo *info;
- const char *source;
+ const gchar *source;
CamelException *ex;
} FilterMessageSearch;
/* ESExp callbacks */
-static ESExpResult *header_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_matches (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_soundex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSearch *fms);
-static ESExpResult *body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_matches (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_starts_with (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_ends_with (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_exists (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_soundex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_full_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *match_all (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, FilterMessageSearch *fms);
+static ESExpResult *body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *body_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *user_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *user_tag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *system_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *get_sent_date (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *get_received_date (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *get_current_date (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *header_source (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *get_size (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *pipe_message (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *junk_test (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
/* builtin functions */
static struct {
- char *name;
+ gchar *name;
ESExpFunc *func;
- int type; /* set to 1 if a function can perform shortcut evaluation, or
+ gint type; /* set to 1 if a function can perform shortcut evaluation, or
doesn't execute everything, 0 otherwise */
} symbols[] = {
{ "match-all", (ESExpFunc *) match_all, 1 },
@@ -141,21 +141,21 @@ camel_filter_search_get_message (FilterMessageSearch *fms, struct _ESExp *sexp)
}
static ESExpResult *
-check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms, camel_search_match_t how)
+check_header (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms, camel_search_match_t how)
{
gboolean matched = FALSE;
ESExpResult *r;
- int i;
+ gint i;
if (argc > 1 && argv[0]->type == ESEXP_RES_STRING) {
- char *name = argv[0]->value.string;
+ gchar *name = argv[0]->value.string;
/* shortcut: a match for "" against any header always matches */
for (i=1; i<argc && !matched; i++)
matched = argv[i]->type == ESEXP_RES_STRING && argv[i]->value.string[0] == 0;
if (g_ascii_strcasecmp(name, "x-camel-mlist") == 0) {
- const char *list = camel_message_info_mlist(fms->info);
+ const gchar *list = camel_message_info_mlist(fms->info);
if (list) {
for (i=1; i<argc && !matched; i++) {
@@ -166,7 +166,7 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
} else {
CamelMimeMessage *message;
struct _camel_header_raw *header;
- const char *charset = NULL;
+ const gchar *charset = NULL;
camel_search_t type = CAMEL_SEARCH_TYPE_ENCODED;
CamelContentType *ct;
@@ -201,43 +201,43 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
}
static ESExpResult *
-header_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_CONTAINS);
}
static ESExpResult *
-header_matches (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_matches (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_EXACT);
}
static ESExpResult *
-header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_starts_with (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_STARTS);
}
static ESExpResult *
-header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_ends_with (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_ENDS);
}
static ESExpResult *
-header_soundex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_soundex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_SOUNDEX);
}
static ESExpResult *
-header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_exists (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
CamelMimeMessage *message;
gboolean matched = FALSE;
ESExpResult *r;
- int i;
+ gint i;
message = camel_filter_search_get_message (fms, f);
@@ -253,12 +253,12 @@ header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMes
}
static ESExpResult *
-header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r = e_sexp_result_new (f, ESEXP_RES_BOOL);
CamelMimeMessage *message;
regex_t pattern;
- const char *contents;
+ const gchar *contents;
message = camel_filter_search_get_message (fms, f);
@@ -278,7 +278,7 @@ get_full_header (CamelMimeMessage *message)
{
CamelMimePart *mp = CAMEL_MIME_PART (message);
GString *str = g_string_new ("");
- char *ret;
+ gchar *ret;
struct _camel_header_raw *h;
for (h = mp->headers; h; h = h->next) {
@@ -300,12 +300,12 @@ get_full_header (CamelMimeMessage *message)
}
static ESExpResult *
-header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_full_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r = e_sexp_result_new (f, ESEXP_RES_BOOL);
CamelMimeMessage *message;
regex_t pattern;
- char *contents;
+ gchar *contents;
if (camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_NEWLINE,
argc, argv, fms->ex) == 0) {
@@ -321,7 +321,7 @@ header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filte
}
static ESExpResult *
-match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSearch *fms)
+match_all (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, FilterMessageSearch *fms)
{
/* match-all: when dealing with single messages is a no-op */
ESExpResult *r;
@@ -336,7 +336,7 @@ match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSe
}
static ESExpResult *
-body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r = e_sexp_result_new (f, ESEXP_RES_BOOL);
CamelMimeMessage *message;
@@ -353,7 +353,7 @@ body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMes
}
static ESExpResult *
-body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+body_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r = e_sexp_result_new(f, ESEXP_RES_BOOL);
CamelMimeMessage *message;
@@ -371,11 +371,11 @@ body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessag
}
static ESExpResult *
-user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+user_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r;
gboolean truth = FALSE;
- int i;
+ gint i;
/* performs an OR of all words */
for (i = 0; i < argc && !truth; i++) {
@@ -393,7 +393,7 @@ user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessage
}
static ESExpResult *
-system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+system_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r;
@@ -407,10 +407,10 @@ system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessa
}
static ESExpResult *
-user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+user_tag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r;
- const char *tag;
+ const gchar *tag;
if (argc != 1 || argv[0]->type != ESEXP_RES_STRING)
e_sexp_fatal_error(f, _("Invalid arguments to (user-tag)"));
@@ -424,7 +424,7 @@ user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageS
}
static ESExpResult *
-get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+get_sent_date (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
CamelMimeMessage *message;
ESExpResult *r;
@@ -437,7 +437,7 @@ get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMes
}
static ESExpResult *
-get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+get_received_date (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
CamelMimeMessage *message;
ESExpResult *r;
@@ -450,7 +450,7 @@ get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filte
}
static ESExpResult *
-get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+get_current_date (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r;
@@ -461,12 +461,12 @@ get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filter
}
static ESExpResult *
-header_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+header_source (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
CamelMimeMessage *message;
ESExpResult *r;
- const char *src;
- int truth = FALSE, i;
+ const gchar *src;
+ gint truth = FALSE, i;
CamelProvider *provider;
CamelURL *uria, *urib;
@@ -501,7 +501,7 @@ header_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMes
/* remember, the size comparisons are done at Kbytes */
static ESExpResult *
-get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+get_size (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r;
@@ -540,12 +540,12 @@ child_watch (GPid pid,
}
static int
-run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+run_command (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
CamelMimeMessage *message;
CamelStream *stream;
- int i;
- int pipe_to_child;
+ gint i;
+ gint pipe_to_child;
GPid child_pid;
GError *error = NULL;
GPtrArray *args;
@@ -616,10 +616,10 @@ run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessa
}
static ESExpResult *
-pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+pipe_message (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r;
- int retval, i;
+ gint retval, i;
/* make sure all args are strings */
for (i = 0; i < argc; i++) {
@@ -639,7 +639,7 @@ pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
}
static ESExpResult *
-junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+junk_test (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r;
gboolean retval = FALSE;
@@ -652,7 +652,7 @@ junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessage
while (node && !retval) {
if (node->name) {
- char *value = (char *) g_hash_table_lookup ((GHashTable *) ht, node->name);
+ gchar *value = (gchar *) g_hash_table_lookup ((GHashTable *) ht, node->name);
d(printf("JunkCheckMatch: %s %s %s\n", node->name, node->value, value));
if (value)
retval = camel_strstrcase(node->value, value) != NULL;
@@ -701,17 +701,17 @@ junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessage
* Returns: one of CAMEL_SEARCH_MATCHED, CAMEL_SEARCH_NOMATCH, or
* CAMEL_SEARCH_ERROR.
**/
-int
+gint
camel_filter_search_match (CamelSession *session,
- CamelFilterSearchGetMessageFunc get_message, void *data,
- CamelMessageInfo *info, const char *source,
- const char *expression, CamelException *ex)
+ CamelFilterSearchGetMessageFunc get_message, gpointer data,
+ CamelMessageInfo *info, const gchar *source,
+ const gchar *expression, CamelException *ex)
{
FilterMessageSearch fms;
ESExp *sexp;
ESExpResult *result;
gboolean retval;
- int i;
+ gint i;
fms.session = session;
fms.get_message = get_message;
diff --git a/camel/camel-filter-search.h b/camel/camel-filter-search.h
index 8f1b3b2d4..c786d0a3b 100644
--- a/camel/camel-filter-search.h
+++ b/camel/camel-filter-search.h
@@ -36,12 +36,12 @@ enum {
CAMEL_SEARCH_MATCHED = 1
};
-typedef CamelMimeMessage * (*CamelFilterSearchGetMessageFunc) (void *data, CamelException *ex);
+typedef CamelMimeMessage * (*CamelFilterSearchGetMessageFunc) (gpointer data, CamelException *ex);
-int camel_filter_search_match (CamelSession *session,
- CamelFilterSearchGetMessageFunc get_message, void *data,
- CamelMessageInfo *info, const char *source,
- const char *expression, CamelException *ex);
+gint camel_filter_search_match (CamelSession *session,
+ CamelFilterSearchGetMessageFunc get_message, gpointer data,
+ CamelMessageInfo *info, const gchar *source,
+ const gchar *expression, CamelException *ex);
G_END_DECLS
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 8a1df4b8e..edadf6243 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -68,37 +68,37 @@ struct _CamelFolderSearchPrivate {
#define _PRIVATE(o) (((CamelFolderSearch *)(o))->priv)
-static ESExpResult *search_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-
-static ESExpResult *search_header_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_matches(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_starts_with(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_ends_with(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_soundex(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_regex(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_full_regex(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *search);
-static ESExpResult *search_match_threads(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
-static ESExpResult *search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_body_regex(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_system_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_get_size(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_uid(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_message_location(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
-static ESExpResult *search_dummy(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+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);
+static ESExpResult *search_header_matches(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_header_starts_with(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_header_ends_with(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_header_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_header_soundex(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_header_regex(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_header_full_regex(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_match_all(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *search);
+static ESExpResult *search_match_threads(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
+static ESExpResult *search_body_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_body_regex(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_user_flag(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_user_tag(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_system_flag(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_get_sent_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_get_received_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_get_current_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_get_size(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_uid(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_message_location(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+
+static ESExpResult *search_dummy(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
static void camel_folder_search_class_init (CamelFolderSearchClass *klass);
static void camel_folder_search_init (CamelFolderSearch *obj);
static void camel_folder_search_finalize (CamelObject *obj);
-static int read_uid_callback (void * ref, int ncol, char ** cols, char **name);
+static gint read_uid_callback (gpointer ref, gint ncol, gchar ** cols, gchar **name);
static CamelObjectClass *camel_folder_search_parent;
@@ -176,13 +176,13 @@ camel_folder_search_get_type (void)
#ifdef offsetof
#define CAMEL_STRUCT_OFFSET(type, field) ((gint) offsetof (type, field))
#else
-#define CAMEL_STRUCT_OFFSET(type, field) ((gint) ((gchar*) &((type *) 0)->field))
+#define CAMEL_STRUCT_OFFSET(type, field) ((gint) ((gchar *) &((type *) 0)->field))
#endif
static struct {
- char *name;
- int offset;
- int flags; /* 0x02 = immediate, 0x01 = always enter */
+ gchar *name;
+ gint offset;
+ gint flags; /* 0x02 = immediate, 0x01 = always enter */
} builtins[] = {
/* these have default implementations in e-sexp */
{ "and", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, and), 2 },
@@ -221,16 +221,16 @@ static struct {
void
camel_folder_search_construct (CamelFolderSearch *search)
{
- int i;
+ gint i;
CamelFolderSearchClass *klass = (CamelFolderSearchClass *)CAMEL_OBJECT_GET_CLASS(search);
for (i=0;i<sizeof(builtins)/sizeof(builtins[0]);i++) {
- void *func;
+ gpointer func;
/* c is sure messy sometimes */
- func = *((void **)(((char *)klass)+builtins[i].offset));
+ func = *((gpointer *)(((gchar *)klass)+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)));
- func = (void *)search_dummy;
+ func = (gpointer)search_dummy;
}
if (func != NULL) {
if (builtins[i].flags&2) {
@@ -333,11 +333,11 @@ camel_folder_search_set_body_index(CamelFolderSearch *search, CamelIndex *index)
* This must only be freed by camel_folder_search_free_result.
**/
GPtrArray *
-camel_folder_search_execute_expression(CamelFolderSearch *search, const char *expr, CamelException *ex)
+camel_folder_search_execute_expression(CamelFolderSearch *search, const gchar *expr, CamelException *ex)
{
ESExpResult *r;
GPtrArray *matches;
- int i;
+ gint i;
GHashTable *results;
struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
@@ -371,11 +371,11 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
/* reorder result in summary order */
results = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<r->value.ptrarray->len;i++) {
- d(printf("adding match: %s\n", (char *)g_ptr_array_index(r->value.ptrarray, i)));
+ d(printf("adding match: %s\n", (gchar *)g_ptr_array_index(r->value.ptrarray, i)));
g_hash_table_insert(results, g_ptr_array_index(r->value.ptrarray, i), GINT_TO_POINTER (1));
}
for (i=0;i<search->summary->len;i++) {
- char *uid = g_ptr_array_index(search->summary, i);
+ gchar *uid = g_ptr_array_index(search->summary, i);
if (g_hash_table_lookup(results, uid)) {
g_ptr_array_add(matches, (gpointer) camel_pstring_strdup(uid));
}
@@ -383,7 +383,7 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
g_hash_table_destroy(results);
} else {
for (i=0;i<r->value.ptrarray->len;i++) {
- d(printf("adding match: %s\n", (char *)g_ptr_array_index(r->value.ptrarray, i)));
+ d(printf("adding match: %s\n", (gchar *)g_ptr_array_index(r->value.ptrarray, i)));
g_ptr_array_add(matches, (gpointer) camel_pstring_strdup(g_ptr_array_index(r->value.ptrarray, i)));
}
}
@@ -422,13 +422,13 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
**/
guint32
-camel_folder_search_count(CamelFolderSearch *search, const char *expr, CamelException *ex)
+camel_folder_search_count(CamelFolderSearch *search, const gchar *expr, CamelException *ex)
{
ESExpResult *r;
GPtrArray *summary_set;
- int i;
+ gint i;
CamelDB *cdb;
- char *sql_query, *tmp, *tmp1;
+ gchar *sql_query, *tmp, *tmp1;
GHashTable *results;
guint32 count = 0;
@@ -439,7 +439,7 @@ camel_folder_search_count(CamelFolderSearch *search, const char *expr, CamelExce
p->ex = ex;
/* We route body-contains search and thread based search through memory and not via db. */
- if (strstr((const char *) expr, "body-contains") || strstr((const char *) expr, "match-threads")) {
+ if (strstr((const gchar *) expr, "body-contains") || strstr((const gchar *) expr, "match-threads")) {
/* setup our search list only contains those we're interested in */
search->summary = camel_folder_get_summary(search->folder);
@@ -471,12 +471,12 @@ camel_folder_search_count(CamelFolderSearch *search, const char *expr, CamelExce
/* reorder result in summary order */
results = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<r->value.ptrarray->len;i++) {
- d(printf("adding match: %s\n", (char *)g_ptr_array_index(r->value.ptrarray, i)));
+ d(printf("adding match: %s\n", (gchar *)g_ptr_array_index(r->value.ptrarray, i)));
g_hash_table_insert(results, g_ptr_array_index(r->value.ptrarray, i), GINT_TO_POINTER (1));
}
for (i=0;i<summary_set->len;i++) {
- char *uid = g_ptr_array_index(summary_set, i);
+ gchar *uid = g_ptr_array_index(summary_set, i);
if (g_hash_table_lookup(results, uid))
count++;
}
@@ -503,7 +503,7 @@ camel_folder_search_count(CamelFolderSearch *search, const char *expr, CamelExce
cdb = (CamelDB *) (search->folder->parent_store->cdb_r);
camel_db_count_message_info (cdb, tmp, &count, ex);
if (ex && camel_exception_is_set(ex)) {
- const char *exception = camel_exception_get_description (ex);
+ const gchar *exception = camel_exception_get_description (ex);
if (strncmp(exception, "no such table", 13) == 0) {
d(g_warning ("Error during searching %s: %s\n", tmp, exception));
camel_exception_clear (ex); /* Suppress no such table */
@@ -536,11 +536,11 @@ fail:
}
static gboolean
-do_search_in_memory (const char *expr)
+do_search_in_memory (const gchar *expr)
{
/* if the expression contains any of these tokens, then perform a memory search, instead of the SQL one */
- const char *in_memory_tokens[] = { "body-contains", "body-regex", "match-threads", "message-location", "header-soundex", "header-regex", "header-full-regex", "header-contains", NULL };
- int i;
+ const gchar *in_memory_tokens[] = { "body-contains", "body-regex", "match-threads", "message-location", "header-soundex", "header-regex", "header-full-regex", "header-contains", NULL };
+ gint i;
if (!expr)
return FALSE;
@@ -566,13 +566,13 @@ do_search_in_memory (const char *expr)
* Return value:
**/
GPtrArray *
-camel_folder_search_search(CamelFolderSearch *search, const char *expr, GPtrArray *uids, CamelException *ex)
+camel_folder_search_search(CamelFolderSearch *search, const gchar *expr, GPtrArray *uids, CamelException *ex)
{
ESExpResult *r;
GPtrArray *matches = NULL, *summary_set;
- int i;
+ gint i;
CamelDB *cdb;
- char *sql_query, *tmp, *tmp1;
+ gchar *sql_query, *tmp, *tmp1;
GHashTable *results;
struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
@@ -628,12 +628,12 @@ camel_folder_search_search(CamelFolderSearch *search, const char *expr, GPtrArra
/* reorder result in summary order */
results = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<r->value.ptrarray->len;i++) {
- d(printf("adding match: %s\n", (char *)g_ptr_array_index(r->value.ptrarray, i)));
+ d(printf("adding match: %s\n", (gchar *)g_ptr_array_index(r->value.ptrarray, i)));
g_hash_table_insert(results, g_ptr_array_index(r->value.ptrarray, i), GINT_TO_POINTER (1));
}
for (i=0;i<summary_set->len;i++) {
- char *uid = g_ptr_array_index(summary_set, i);
+ gchar *uid = g_ptr_array_index(summary_set, i);
if (g_hash_table_lookup(results, uid))
g_ptr_array_add(matches, (gpointer) camel_pstring_strdup(uid));
}
@@ -661,7 +661,7 @@ camel_folder_search_search(CamelFolderSearch *search, const char *expr, GPtrArra
cdb = (CamelDB *) (search->folder->parent_store->cdb_r);
camel_db_select (cdb, tmp, (CamelDBSelectCB) read_uid_callback, matches, ex);
if (ex && camel_exception_is_set(ex)) {
- const char *exception = camel_exception_get_description (ex);
+ const gchar *exception = camel_exception_get_description (ex);
if (strncmp(exception, "no such table", 13) == 0) {
d(g_warning ("Error during searching %s: %s\n", tmp, exception));
camel_exception_clear (ex); /* Suppress no such table */
@@ -701,7 +701,7 @@ void camel_folder_search_free_result(CamelFolderSearch *search, GPtrArray *resul
/* dummy function, returns false always, or an empty match array */
static ESExpResult *
-search_dummy(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_dummy(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
@@ -718,22 +718,22 @@ search_dummy(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolder
/* impelemnt an 'array not', i.e. everything in the summary, not in the supplied array */
static ESExpResult *
-search_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_not(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
- int i;
+ gint i;
if (argc>0) {
if (argv[0]->type == ESEXP_RES_ARRAY_PTR) {
GPtrArray *v = argv[0]->value.ptrarray;
- const char *uid;
+ const gchar *uid;
r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
r->value.ptrarray = g_ptr_array_new();
/* not against a single message?*/
if (search->current) {
- int found = FALSE;
+ gint found = FALSE;
uid = camel_message_info_uid(search->current);
for (i=0;!found && i<v->len;i++) {
@@ -742,23 +742,23 @@ search_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSe
}
if (!found)
- g_ptr_array_add(r->value.ptrarray, (char *)uid);
+ g_ptr_array_add(r->value.ptrarray, (gchar *)uid);
} else if (search->summary == NULL) {
g_warning("No summary set, 'not' against an array requires a summary");
} else {
/* 'not' against the whole summary */
GHashTable *have = g_hash_table_new(g_str_hash, g_str_equal);
- char **s;
- char **m;
+ gchar **s;
+ gchar **m;
- s = (char **)v->pdata;
+ s = (gchar **)v->pdata;
for (i=0;i<v->len;i++)
g_hash_table_insert(have, s[i], s[i]);
v = search->summary_set?search->summary_set:search->summary;
- m = (char **)v->pdata;
+ m = (gchar **)v->pdata;
for (i=0;i<v->len;i++) {
- char *uid = m[i];
+ gchar *uid = m[i];
if (g_hash_table_lookup(have, uid) == NULL)
g_ptr_array_add(r->value.ptrarray, uid);
@@ -766,7 +766,7 @@ search_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSe
g_hash_table_destroy(have);
}
} else {
- int res = TRUE;
+ gint res = TRUE;
if (argv[0]->type == ESEXP_RES_BOOL)
res = ! argv[0]->value.bool;
@@ -783,9 +783,9 @@ search_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSe
}
static ESExpResult *
-search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *search)
+search_match_all(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *search)
{
- int i;
+ gint i;
ESExpResult *r, *r1;
gchar *error_msg;
GPtrArray *v;
@@ -836,7 +836,7 @@ search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFold
for (i=0;i<v->len;i++) {
- const char *uid;
+ const gchar *uid;
search->current = camel_folder_summary_uid (search->folder->summary, v->pdata[i]);
if (!search->current)
@@ -847,7 +847,7 @@ search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFold
r1 = e_sexp_term_eval(f, argv[0]);
if (r1->type == ESEXP_RES_BOOL) {
if (r1->value.bool)
- g_ptr_array_add(r->value.ptrarray, (char *)uid);
+ g_ptr_array_add(r->value.ptrarray, (gchar *)uid);
} else {
g_warning("invalid syntax, matches require a single bool result");
error_msg = g_strdup_printf(_("(%s) requires a single bool result"), "match-all");
@@ -856,7 +856,7 @@ search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFold
}
e_sexp_result_free(f, r1);
} else {
- g_ptr_array_add(r->value.ptrarray, (char *)uid);
+ g_ptr_array_add(r->value.ptrarray, (gchar *)uid);
}
camel_message_info_free (search->current);
}
@@ -868,7 +868,7 @@ static void
fill_thread_table(struct _CamelFolderThreadNode *root, GHashTable *id_hash)
{
while (root) {
- g_hash_table_insert(id_hash, (char *)camel_message_info_uid(root->message), root);
+ g_hash_table_insert(id_hash, (gchar *)camel_message_info_uid(root->message), root);
if (root->child)
fill_thread_table(root->child, id_hash);
root = root->next;
@@ -879,7 +879,7 @@ static void
add_thread_results(struct _CamelFolderThreadNode *root, GHashTable *result_hash)
{
while (root) {
- g_hash_table_insert(result_hash, (char *)camel_message_info_uid(root->message), GINT_TO_POINTER (1));
+ g_hash_table_insert(result_hash, (gchar *)camel_message_info_uid(root->message), GINT_TO_POINTER (1));
if (root->child)
add_thread_results(root->child, result_hash);
root = root->next;
@@ -887,17 +887,17 @@ add_thread_results(struct _CamelFolderThreadNode *root, GHashTable *result_hash)
}
static void
-add_results(char *uid, void *dummy, GPtrArray *result)
+add_results(gchar *uid, gpointer dummy, GPtrArray *result)
{
g_ptr_array_add(result, uid);
}
static ESExpResult *
-search_match_threads(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *search)
+search_match_threads(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *search)
{
ESExpResult *r;
struct _CamelFolderSearchPrivate *p = search->priv;
- int i, type;
+ gint i, type;
GHashTable *results;
gchar *error_msg;
@@ -972,26 +972,26 @@ search_match_threads(struct _ESExp *f, int argc, struct _ESExpTerm **argv, Camel
if (type != 4)
g_hash_table_insert(results, g_ptr_array_index(r->value.ptrarray, i), GINT_TO_POINTER(1));
- node = g_hash_table_lookup(p->threads_hash, (char *)g_ptr_array_index(r->value.ptrarray, i));
+ node = g_hash_table_lookup(p->threads_hash, (gchar *)g_ptr_array_index(r->value.ptrarray, i));
if (node == NULL) /* this shouldn't happen but why cry over spilt milk */
continue;
/* select messages in thread according to search criteria */
if (type == 4) {
if (node->child == NULL && node->parent == NULL)
- g_hash_table_insert(results, (char *)camel_message_info_uid(node->message), GINT_TO_POINTER(1));
+ g_hash_table_insert(results, (gchar *)camel_message_info_uid(node->message), GINT_TO_POINTER(1));
} else {
if (type == 3) {
scan = node;
while (scan && scan->parent) {
scan = scan->parent;
- g_hash_table_insert(results, (char *)camel_message_info_uid(scan->message), GINT_TO_POINTER(1));
+ g_hash_table_insert(results, (gchar *)camel_message_info_uid(scan->message), GINT_TO_POINTER(1));
}
} else if (type == 1) {
while (node && node->parent)
node = node->parent;
}
- g_hash_table_insert(results, (char *)camel_message_info_uid(node->message), GINT_TO_POINTER(1));
+ g_hash_table_insert(results, (gchar *)camel_message_info_uid(node->message), GINT_TO_POINTER(1));
if (node->child)
add_thread_results(node->child, results);
}
@@ -1025,20 +1025,20 @@ get_current_message (CamelFolderSearch *search)
}
static ESExpResult *
-check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search, camel_search_match_t how)
+check_header (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search, camel_search_match_t how)
{
ESExpResult *r;
- int truth = FALSE;
+ gint truth = FALSE;
r(printf("executing check-header %d\n", how));
/* are we inside a match-all? */
if (search->current && argc>1
&& argv[0]->type == ESEXP_RES_STRING) {
- char *headername;
- const char *header = NULL, *charset = NULL;
- char strbuf[32];
- int i, j;
+ gchar *headername;
+ const gchar *header = NULL, *charset = NULL;
+ gchar strbuf[32];
+ gint i, j;
camel_search_t type = CAMEL_SEARCH_TYPE_ASIS;
struct _camel_search_words *words;
CamelMimeMessage *message = NULL;
@@ -1086,7 +1086,7 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolde
truth = TRUE;
} else if (how == CAMEL_SEARCH_MATCH_CONTAINS) {
/* doesn't make sense to split words on anything but contains i.e. we can't have an ending match different words */
- words = camel_search_words_split((const unsigned char *) argv[i]->value.string);
+ words = camel_search_words_split((const guchar *) argv[i]->value.string);
truth = TRUE;
for (j=0;j<words->len && truth;j++) {
if (message) {
@@ -1128,38 +1128,38 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolde
/*
static void
-l_printf(char *node)
+l_printf(gchar *node)
{
printf("%s\t", node);
}
*/
static ESExpResult *
-search_header_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_header_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
return check_header(f, argc, argv, search, CAMEL_SEARCH_MATCH_CONTAINS);
}
static ESExpResult *
-search_header_matches(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_header_matches(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
return check_header(f, argc, argv, search, CAMEL_SEARCH_MATCH_EXACT);
}
static ESExpResult *
-search_header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_header_starts_with (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
return check_header(f, argc, argv, search, CAMEL_SEARCH_MATCH_STARTS);
}
static ESExpResult *
-search_header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_header_ends_with (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
return check_header(f, argc, argv, search, CAMEL_SEARCH_MATCH_ENDS);
}
static ESExpResult *
-search_header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_header_exists (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
@@ -1179,13 +1179,13 @@ search_header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, Ca
}
static ESExpResult *
-search_header_soundex (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_header_soundex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
return check_header (f, argc, argv, search, CAMEL_SEARCH_MATCH_SOUNDEX);
}
static ESExpResult *
-search_header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_header_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
CamelMimeMessage *msg;
@@ -1194,7 +1194,7 @@ search_header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
if (msg) {
regex_t pattern;
- const char *contents;
+ const gchar *contents;
r = e_sexp_result_new (f, ESEXP_RES_BOOL);
@@ -1238,7 +1238,7 @@ get_full_header (CamelMimeMessage *message)
}
static ESExpResult *
-search_header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_header_full_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
CamelMimeMessage *msg;
@@ -1251,7 +1251,7 @@ search_header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv
r = e_sexp_result_new (f, ESEXP_RES_BOOL);
if (camel_search_build_match_regex (&pattern, CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_NEWLINE, argc, argv, search->priv->ex) == 0) {
- char *contents;
+ gchar *contents;
contents = get_full_header (msg);
r->value.bool = regexec (&pattern, contents, 0, NULL, 0) == 0;
@@ -1272,31 +1272,31 @@ search_header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv
/* this is just to OR results together */
struct IterData {
- int count;
+ gint count;
GPtrArray *uids;
};
/* or, store all unique values */
static void
-htor(char *key, int value, struct IterData *iter_data)
+htor(gchar *key, gint value, struct IterData *iter_data)
{
g_ptr_array_add(iter_data->uids, key);
}
/* and, only store duplicates */
static void
-htand(char *key, int value, struct IterData *iter_data)
+htand(gchar *key, gint value, struct IterData *iter_data)
{
if (value == iter_data->count)
g_ptr_array_add(iter_data->uids, key);
}
static int
-match_message_index(CamelIndex *idx, const char *uid, const char *match, CamelException *ex)
+match_message_index(CamelIndex *idx, const gchar *uid, const gchar *match, CamelException *ex)
{
CamelIndexCursor *wc, *nc;
- const char *word, *name;
- int truth = FALSE;
+ const gchar *word, *name;
+ gint truth = FALSE;
wc = camel_index_words(idx);
if (wc) {
@@ -1335,8 +1335,8 @@ match_words_index(CamelFolderSearch *search, struct _camel_search_words *words,
GHashTable *ht = g_hash_table_new(g_str_hash, g_str_equal);
struct IterData lambdafoo;
CamelIndexCursor *wc, *nc;
- const char *word, *name;
- int i;
+ const gchar *word, *name;
+ gint i;
/* we can have a maximum of 32 words, as we use it as the AND mask */
@@ -1349,10 +1349,10 @@ match_words_index(CamelFolderSearch *search, struct _camel_search_words *words,
nc = camel_index_find(search->body_index, word);
if (nc) {
while ((name = camel_index_cursor_next(nc))) {
- int mask;
+ gint mask;
mask = (GPOINTER_TO_INT(g_hash_table_lookup(ht, name))) | (1<<i);
- g_hash_table_insert(ht, (char *) camel_pstring_peek(name), GINT_TO_POINTER(mask));
+ g_hash_table_insert(ht, (gchar *) camel_pstring_peek(name), GINT_TO_POINTER(mask));
}
camel_object_unref((CamelObject *)nc);
}
@@ -1374,8 +1374,8 @@ static gboolean
match_words_1message (CamelDataWrapper *object, struct _camel_search_words *words, guint32 *mask)
{
CamelDataWrapper *containee;
- int truth = FALSE;
- int parts, i;
+ gint truth = FALSE;
+ gint parts, i;
containee = camel_medium_get_content_object (CAMEL_MEDIUM (object));
@@ -1402,7 +1402,7 @@ match_words_1message (CamelDataWrapper *object, struct _camel_search_words *word
camel_stream_write (CAMEL_STREAM (mem), "", 1);
for (i=0;i<words->len;i++) {
/* FIXME: This is horridly slow, and should use a real search algorithm */
- if (camel_ustrstrcase((const char *) mem->buffer->data, words->words[i]->word) != NULL) {
+ if (camel_ustrstrcase((const gchar *) mem->buffer->data, words->words[i]->word) != NULL) {
*mask |= (1<<i);
/* shortcut a match */
if (*mask == (1<<(words->len))-1)
@@ -1417,12 +1417,12 @@ match_words_1message (CamelDataWrapper *object, struct _camel_search_words *word
}
static gboolean
-match_words_message(CamelFolder *folder, const char *uid, struct _camel_search_words *words, CamelException *ex)
+match_words_message(CamelFolder *folder, const gchar *uid, struct _camel_search_words *words, CamelException *ex)
{
guint32 mask;
CamelMimeMessage *msg;
CamelException x = CAMEL_EXCEPTION_INITIALISER;
- int truth;
+ gint truth;
msg = camel_folder_get_message(folder, uid, &x);
if (msg) {
@@ -1440,7 +1440,7 @@ match_words_message(CamelFolder *folder, const char *uid, struct _camel_search_w
static GPtrArray *
match_words_messages(CamelFolderSearch *search, struct _camel_search_words *words, CamelException *ex)
{
- int i;
+ gint i;
GPtrArray *matches = g_ptr_array_new();
if (search->body_index) {
@@ -1452,10 +1452,10 @@ match_words_messages(CamelFolderSearch *search, struct _camel_search_words *word
camel_search_words_free(simple);
for (i=0;i<indexed->len;i++) {
- const char *uid = g_ptr_array_index(indexed, i);
+ const gchar *uid = g_ptr_array_index(indexed, i);
if (match_words_message(search->folder, uid, words, ex))
- g_ptr_array_add(matches, (char *)uid);
+ g_ptr_array_add(matches, (gchar *)uid);
}
g_ptr_array_free(indexed, TRUE);
@@ -1463,10 +1463,10 @@ match_words_messages(CamelFolderSearch *search, struct _camel_search_words *word
GPtrArray *v = search->summary_set?search->summary_set:search->summary;
for (i=0;i<v->len;i++) {
- char *uid = g_ptr_array_index(v, i);
+ gchar *uid = g_ptr_array_index(v, i);
if (match_words_message(search->folder, uid, words, ex))
- g_ptr_array_add(matches, (char *)uid);
+ g_ptr_array_add(matches, (gchar *)uid);
}
}
@@ -1474,23 +1474,23 @@ match_words_messages(CamelFolderSearch *search, struct _camel_search_words *word
}
static ESExpResult *
-search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_body_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
- int i, j;
+ gint i, j;
CamelException *ex = search->priv->ex;
struct _camel_search_words *words;
ESExpResult *r;
struct IterData lambdafoo;
if (search->current) {
- int truth = FALSE;
+ gint truth = FALSE;
if (argc == 1 && argv[0]->value.string[0] == 0) {
truth = TRUE;
} else {
for (i=0;i<argc && !truth;i++) {
if (argv[i]->type == ESEXP_RES_STRING) {
- words = camel_search_words_split((const unsigned char *) argv[i]->value.string);
+ words = camel_search_words_split((const guchar *) argv[i]->value.string);
truth = TRUE;
if ((words->type & CAMEL_SEARCH_WORD_COMPLEX) == 0 && search->body_index) {
for (j=0;j<words->len && truth;j++)
@@ -1513,7 +1513,7 @@ search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
GPtrArray *v = search->summary_set?search->summary_set:search->summary;
for (i=0;i<v->len;i++) {
- char *uid = g_ptr_array_index(v, i);
+ gchar *uid = g_ptr_array_index(v, i);
g_ptr_array_add(r->value.ptrarray, uid);
}
@@ -1523,7 +1523,7 @@ search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
for (i=0;i<argc;i++) {
if (argv[i]->type == ESEXP_RES_STRING) {
- words = camel_search_words_split((const unsigned char *) argv[i]->value.string);
+ words = camel_search_words_split((const guchar *) argv[i]->value.string);
if ((words->type & CAMEL_SEARCH_WORD_COMPLEX) == 0 && search->body_index) {
matches = match_words_index(search, words, ex);
} else {
@@ -1546,7 +1546,7 @@ search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
}
static ESExpResult *
-search_body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_body_regex (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
CamelMimeMessage *msg = get_current_message (search);
@@ -1570,13 +1570,13 @@ search_body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, Camel
r->value.ptrarray = g_ptr_array_new ();
if (camel_search_build_match_regex (&pattern, CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_NEWLINE, argc, argv, search->priv->ex) == 0) {
- int i;
+ gint i;
GPtrArray *v = search->summary_set?search->summary_set:search->summary;
CamelException x = CAMEL_EXCEPTION_INITIALISER;
CamelMimeMessage *message;
for (i = 0; i < v->len; i++) {
- char *uid = g_ptr_array_index(v, i);
+ gchar *uid = g_ptr_array_index(v, i);
message = camel_folder_get_message (search->folder, uid, &x);
if (message) {
@@ -1598,16 +1598,16 @@ search_body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, Camel
}
static ESExpResult *
-search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_user_flag(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
- int i;
+ gint i;
r(printf("executing user-flag\n"));
/* are we inside a match-all? */
if (search->current) {
- int truth = FALSE;
+ gint truth = FALSE;
/* performs an OR of all words */
for (i=0;i<argc && !truth;i++) {
if (argv[i]->type == ESEXP_RES_STRING
@@ -1627,7 +1627,7 @@ search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFo
}
static ESExpResult *
-search_system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_system_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
@@ -1650,9 +1650,9 @@ search_system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, Came
}
static ESExpResult *
-search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_user_tag(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
- const char *value = NULL;
+ const gchar *value = NULL;
ESExpResult *r;
r(printf("executing user-tag\n"));
@@ -1667,7 +1667,7 @@ search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFol
}
static ESExpResult *
-search_get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
+search_get_sent_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s)
{
ESExpResult *r;
@@ -1687,7 +1687,7 @@ search_get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
}
static ESExpResult *
-search_get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
+search_get_received_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s)
{
ESExpResult *r;
@@ -1707,7 +1707,7 @@ search_get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv,
}
static ESExpResult *
-search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
+search_get_current_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s)
{
ESExpResult *r;
@@ -1719,7 +1719,7 @@ search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv,
}
static ESExpResult *
-search_get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
+search_get_size (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s)
{
ESExpResult *r;
@@ -1738,17 +1738,17 @@ search_get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFo
}
static ESExpResult *
-search_uid(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_uid(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
- int i;
+ gint i;
r(printf("executing uid\n"));
/* are we inside a match-all? */
if (search->current) {
- int truth = FALSE;
- const char *uid = camel_message_info_uid(search->current);
+ gint truth = FALSE;
+ const gchar *uid = camel_message_info_uid(search->current);
/* performs an OR of all words */
for (i=0;i<argc && !truth;i++) {
@@ -1773,7 +1773,7 @@ search_uid(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSe
}
static int
-read_uid_callback (void * ref, int ncol, char ** cols, char **name)
+read_uid_callback (gpointer ref, gint ncol, gchar ** cols, gchar **name)
{
GPtrArray *matches;
@@ -1784,7 +1784,7 @@ read_uid_callback (void * ref, int ncol, char ** cols, char **name)
}
static ESExpResult *
-search_message_location (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+search_message_location (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
gboolean same = FALSE;
@@ -1809,11 +1809,11 @@ search_message_location (struct _ESExp *f, int argc, struct _ESExpResult **argv,
if (same) {
/* all matches */
- int i;
+ gint i;
GPtrArray *v = search->summary_set ? search->summary_set : search->summary;
for (i = 0; i < v->len; i++) {
- char *uid = g_ptr_array_index (v, i);
+ gchar *uid = g_ptr_array_index (v, i);
g_ptr_array_add (r->value.ptrarray, uid);
}
diff --git a/camel/camel-folder-search.h b/camel/camel-folder-search.h
index 2fd8c4c06..18f6c25d0 100644
--- a/camel/camel-folder-search.h
+++ b/camel/camel-folder-search.h
@@ -42,7 +42,7 @@ struct _CamelFolderSearch {
struct _CamelFolderSearchPrivate *priv;
ESExp *sexp; /* s-exp evaluator */
- char *last_search; /* last searched expression */
+ gchar *last_search; /* last searched expression */
/* these are only valid during the search, and are reset afterwards */
CamelFolder *folder; /* folder for current search */
@@ -57,76 +57,76 @@ struct _CamelFolderSearchClass {
CamelObjectClass parent_class;
/* general bool/comparison options, usually these wont need to be set, unless it is compiling into another language */
- ESExpResult * (*and)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
- ESExpResult * (*or)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
- ESExpResult * (*not)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
- ESExpResult * (*lt)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
- ESExpResult * (*gt)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
- ESExpResult * (*eq)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
+ ESExpResult * (*and)(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
+ ESExpResult * (*or)(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
+ ESExpResult * (*not)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*lt)(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
+ ESExpResult * (*gt)(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
+ ESExpResult * (*eq)(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
/* search options */
/* (match-all [boolean expression]) Apply match to all messages */
- ESExpResult * (*match_all)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
+ ESExpResult * (*match_all)(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
/* (match-threads "type" [array expression]) add all related threads */
- ESExpResult * (*match_threads)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
+ ESExpResult * (*match_threads)(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
/* (body-contains "string1" "string2" ...) Returns a list of matches, or true if in single-message mode */
- ESExpResult * (*body_contains)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*body_contains)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (body-regex "regex") Returns a list of matches, or true if in single-message mode */
- ESExpResult * (*body_regex)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*body_regex)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (header-contains "headername" "string1" ...) List of matches, or true if in single-message mode */
- ESExpResult * (*header_contains)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*header_contains)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (header-matches "headername" "string") */
- ESExpResult * (*header_matches)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*header_matches)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (header-starts-with "headername" "string") */
- ESExpResult * (*header_starts_with)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*header_starts_with)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (header-ends-with "headername" "string") */
- ESExpResult * (*header_ends_with)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*header_ends_with)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (header-exists "headername") */
- ESExpResult * (*header_exists)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*header_exists)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (header-soundex "headername" "string") */
- ESExpResult * (*header_soundex)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*header_soundex)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (header-regex "headername" "regex_string") */
- ESExpResult * (*header_regex)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*header_regex)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (header-full-regex "regex") */
- ESExpResult * (*header_full_regex)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*header_full_regex)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (user-flag "flagname" "flagname" ...) If one of user-flag set */
- ESExpResult * (*user_flag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*user_flag)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (user-tag "flagname") Returns the value of a user tag. Can only be used in match-all */
- ESExpResult * (*user_tag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*user_tag)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (system-flag "flagname") Returns the value of a system flag. Can only be used in match-all */
- ESExpResult * (*system_flag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*system_flag)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (get-sent-date) Retrieve the date that the message was sent on as a time_t */
- ESExpResult * (*get_sent_date)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*get_sent_date)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (get-received-date) Retrieve the date that the message was received on as a time_t */
- ESExpResult * (*get_received_date)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*get_received_date)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (get-current-date) Retrieve 'now' as a time_t */
- ESExpResult * (*get_current_date)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*get_current_date)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
- /* (get-size) Retrieve message size as an int (in kilobytes) */
- ESExpResult * (*get_size)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ /* (get-size) Retrieve message size as an gint (in kilobytes) */
+ ESExpResult * (*get_size)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (uid "uid" ...) True if the uid is in the list */
- ESExpResult * (*uid)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*uid)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
/* (message-location "folder_string") True if the message is in the folder's full name "folder_string" */
- ESExpResult * (*message_location)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+ ESExpResult * (*message_location)(struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
};
@@ -139,10 +139,10 @@ void camel_folder_search_set_folder(CamelFolderSearch *search, CamelFolder *fold
void camel_folder_search_set_summary(CamelFolderSearch *search, GPtrArray *summary);
void camel_folder_search_set_body_index(CamelFolderSearch *search, CamelIndex *index);
/* this interface is deprecated */
-GPtrArray *camel_folder_search_execute_expression(CamelFolderSearch *search, const char *expr, CamelException *ex);
+GPtrArray *camel_folder_search_execute_expression(CamelFolderSearch *search, const gchar *expr, CamelException *ex);
-GPtrArray *camel_folder_search_search(CamelFolderSearch *search, const char *expr, GPtrArray *uids, CamelException *ex);
-guint32 camel_folder_search_count(CamelFolderSearch *search, const char *expr, CamelException *ex);
+GPtrArray *camel_folder_search_search(CamelFolderSearch *search, const gchar *expr, GPtrArray *uids, CamelException *ex);
+guint32 camel_folder_search_count(CamelFolderSearch *search, const gchar *expr, CamelException *ex);
void camel_folder_search_free_result(CamelFolderSearch *search, GPtrArray *);
G_END_DECLS
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 0501defad..25af5c0bc 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -86,7 +86,7 @@ static pthread_mutex_t info_lock = PTHREAD_MUTEX_INITIALIZER;
#define w(x)
#if 0
-extern int strdup_count, malloc_count, free_count;
+extern gint strdup_count, malloc_count, free_count;
#endif
#define CAMEL_FOLDER_SUMMARY_VERSION (14)
@@ -106,12 +106,12 @@ struct _node {
};
static struct _node *my_list_append(struct _node **list, struct _node *n);
-static int my_list_size(struct _node **list);
+static gint my_list_size(struct _node **list);
-static int summary_header_load(CamelFolderSummary *, FILE *);
-static int summary_header_save(CamelFolderSummary *, FILE *);
-static int summary_meta_header_load(CamelFolderSummary *, FILE *);
-static int summary_meta_header_save(CamelFolderSummary *, FILE *);
+static gint summary_header_load(CamelFolderSummary *, FILE *);
+static gint summary_header_save(CamelFolderSummary *, FILE *);
+static gint summary_meta_header_load(CamelFolderSummary *, FILE *);
+static gint summary_meta_header_save(CamelFolderSummary *, FILE *);
@@ -130,10 +130,10 @@ static CamelMessageContentInfo * content_info_load(CamelFolderSummary *, FILE *)
static int content_info_save(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
static void content_info_free(CamelFolderSummary *, CamelMessageContentInfo *);
-static int save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mir, CamelException *ex);
-static int camel_read_mir_callback (void * ref, int ncol, char ** cols, char ** name);
+static gint save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mir, CamelException *ex);
+static gint camel_read_mir_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name);
-static char *next_uid_string(CamelFolderSummary *s);
+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);
@@ -143,7 +143,7 @@ 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 char *uid);
+static CamelMessageInfo * message_info_from_uid (CamelFolderSummary *s, const gchar *uid);
static void
camel_folder_summary_init (CamelFolderSummary *s)
@@ -190,7 +190,7 @@ camel_folder_summary_init (CamelFolderSummary *s)
s->timeout_handle = 0;
}
-static void free_o_name(void *key, void *value, void *data)
+static void free_o_name(gpointer key, gpointer value, gpointer data)
{
camel_object_unref((CamelObject *)value);
g_free(key);
@@ -300,7 +300,7 @@ camel_folder_summary_new (struct _CamelFolder *folder)
* Set the filename where the summary will be loaded to/saved from.
**/
void
-camel_folder_summary_set_filename(CamelFolderSummary *s, const char *name)
+camel_folder_summary_set_filename(CamelFolderSummary *s, const gchar *name)
{
CAMEL_SUMMARY_LOCK(s, summary_lock);
@@ -382,7 +382,7 @@ camel_folder_summary_count(CamelFolderSummary *s)
* Returns: the summary item, or %NULL if @index is out of range
**/
CamelMessageInfo *
-camel_folder_summary_index (CamelFolderSummary *s, int i)
+camel_folder_summary_index (CamelFolderSummary *s, gint i)
{
CamelMessageInfo *info = NULL;
@@ -390,7 +390,7 @@ camel_folder_summary_index (CamelFolderSummary *s, int i)
CAMEL_SUMMARY_LOCK(s, ref_lock);
if (i < s->uids->len) {
- char *uid;
+ gchar *uid;
uid = g_ptr_array_index (s->uids, i);
/* FIXME: Get exception from caller
@@ -423,10 +423,10 @@ camel_folder_summary_index (CamelFolderSummary *s, int i)
*
* Returns: the summary item's uid , or %NULL if @index is out of range
**/
-char *
-camel_folder_summary_uid_from_index (CamelFolderSummary *s, int i)
+gchar *
+camel_folder_summary_uid_from_index (CamelFolderSummary *s, gint i)
{
- char *uid=NULL;
+ gchar *uid=NULL;
CAMEL_SUMMARY_LOCK(s, summary_lock);
if (i<s->uids->len)
@@ -449,10 +449,10 @@ camel_folder_summary_uid_from_index (CamelFolderSummary *s, int i)
* Returns: if the uid is present in the summary or not (%TRUE or %FALSE)
**/
gboolean
-camel_folder_summary_check_uid (CamelFolderSummary *s, const char *uid)
+camel_folder_summary_check_uid (CamelFolderSummary *s, const gchar *uid)
{
gboolean ret = FALSE;
- int i;
+ gint i;
CAMEL_SUMMARY_LOCK(s, summary_lock);
@@ -483,13 +483,13 @@ GPtrArray *
camel_folder_summary_array(CamelFolderSummary *s)
{
GPtrArray *res = g_ptr_array_new();
- int i;
+ gint i;
CAMEL_SUMMARY_LOCK(s, summary_lock);
g_ptr_array_set_size(res, s->uids->len);
for (i=0;i<s->uids->len;i++)
- res->pdata[i] = (gpointer) camel_pstring_strdup ((char *)g_ptr_array_index(s->uids, i));
+ res->pdata[i] = (gpointer) camel_pstring_strdup ((gchar *)g_ptr_array_index(s->uids, i));
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
@@ -512,12 +512,12 @@ GHashTable *
camel_folder_summary_get_hashtable(CamelFolderSummary *s)
{
GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal);
- int i;
+ gint i;
CAMEL_SUMMARY_LOCK(s, summary_lock);
for (i=0;i<s->uids->len;i++)
- g_hash_table_insert (hash, (gpointer)camel_pstring_strdup ((char *)g_ptr_array_index(s->uids, i)), GINT_TO_POINTER(1));
+ g_hash_table_insert (hash, (gpointer)camel_pstring_strdup ((gchar *)g_ptr_array_index(s->uids, i)), GINT_TO_POINTER(1));
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
@@ -532,7 +532,7 @@ camel_folder_summary_free_hashtable (GHashTable *ht)
}
CamelMessageInfo *
-camel_folder_summary_peek_info (CamelFolderSummary *s, const char *uid)
+camel_folder_summary_peek_info (CamelFolderSummary *s, const gchar *uid)
{
CamelMessageInfo *info = g_hash_table_lookup(s->loaded_infos, uid);
@@ -548,10 +548,10 @@ struct _db_pass_data {
};
static CamelMessageInfo *
-message_info_from_uid (CamelFolderSummary *s, const char *uid)
+message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
{
CamelMessageInfo *info;
- int ret;
+ gint ret;
CAMEL_SUMMARY_LOCK(s, summary_lock);
CAMEL_SUMMARY_LOCK(s, ref_lock);
@@ -561,7 +561,7 @@ message_info_from_uid (CamelFolderSummary *s, const char *uid)
if (!info) {
CamelDB *cdb;
CamelException ex;
- char *folder_name;
+ gchar *folder_name;
struct _db_pass_data data;
d(printf ("\ncamel_folder_summary_uid called \n"));
@@ -592,7 +592,7 @@ message_info_from_uid (CamelFolderSummary *s, const char *uid)
info = g_hash_table_lookup (s->loaded_infos, uid);
if (!info) {
- char *errmsg = g_strdup_printf ("no uid [%s] exists", uid);
+ gchar *errmsg = g_strdup_printf ("no uid [%s] exists", uid);
/* Makes no sense now as the exception is local as of now. FIXME: Pass exception from caller */
camel_exception_set (&ex, CAMEL_EXCEPTION_SYSTEM, _(errmsg));
@@ -624,7 +624,7 @@ message_info_from_uid (CamelFolderSummary *s, const char *uid)
* Returns: the summary item, or %NULL if the uid @uid is not available
**/
CamelMessageInfo *
-camel_folder_summary_uid (CamelFolderSummary *s, const char *uid)
+camel_folder_summary_uid (CamelFolderSummary *s, const gchar *uid)
{
if (!s)
return NULL;
@@ -688,7 +688,7 @@ camel_folder_summary_set_uid(CamelFolderSummary *s, guint32 uid)
* Returns: the next uid as an unsigned integer string.
* This string must be freed by the caller.
**/
-char *
+gchar *
camel_folder_summary_next_uid_string(CamelFolderSummary *s)
{
return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->next_uid_string(s);
@@ -697,10 +697,10 @@ camel_folder_summary_next_uid_string(CamelFolderSummary *s)
static CamelMessageContentInfo *
perform_content_info_load_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
{
- int i;
+ gint i;
guint32 count;
CamelMessageContentInfo *ci, *pci;
- char *part;
+ gchar *part;
ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_from_db (s, mir);
if (ci == NULL)
@@ -731,7 +731,7 @@ perform_content_info_load_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
static CamelMessageContentInfo *
perform_content_info_load(CamelFolderSummary *s, FILE *in)
{
- int i;
+ gint i;
guint32 count;
CamelMessageContentInfo *ci, *part;
@@ -759,7 +759,7 @@ perform_content_info_load(CamelFolderSummary *s, FILE *in)
}
static void
-append_changed_uids (char *key, CamelMessageInfoBase *info, GPtrArray *array)
+append_changed_uids (gchar *key, CamelMessageInfoBase *info, GPtrArray *array)
{
if (info->dirty || info->flags & CAMEL_MESSAGE_FOLDER_FLAGGED)
g_ptr_array_add (array, (gpointer)camel_pstring_strdup((camel_message_info_uid(info))));
@@ -780,7 +780,7 @@ camel_folder_summary_get_changed (CamelFolderSummary *s)
}
static void
-count_changed_uids (char *key, CamelMessageInfoBase *info, int *count)
+count_changed_uids (gchar *key, CamelMessageInfoBase *info, gint *count)
{
if (info->dirty)
(*count)++;
@@ -789,7 +789,7 @@ count_changed_uids (char *key, CamelMessageInfoBase *info, int *count)
static int
cfs_count_dirty (CamelFolderSummary *s)
{
- int count = 0;
+ gint count = 0;
CAMEL_SUMMARY_LOCK (s, summary_lock);
g_hash_table_foreach (s->loaded_infos, (GHFunc) count_changed_uids, &count);
@@ -800,7 +800,7 @@ cfs_count_dirty (CamelFolderSummary *s)
/* FIXME[disk-summary] I should have a better LRU algorithm */
static gboolean
-remove_item (char *key, CamelMessageInfoBase *info, CamelFolderSummary *s)
+remove_item (gchar *key, CamelMessageInfoBase *info, CamelFolderSummary *s)
{
d(printf("%d(%d)\t", info->refcount, info->dirty)); /* camel_message_info_dump (info); */
CAMEL_SUMMARY_LOCK(info->summary, ref_lock);
@@ -887,7 +887,7 @@ cfs_try_release_memory (CamelFolderSummary *s)
return TRUE;
}
-int
+gint
camel_folder_summary_cache_size (CamelFolderSummary *s)
{
/* FIXME[disk-summary] this is a timely hack. fix it well */
@@ -907,7 +907,7 @@ struct _preview_update_msg {
};
static void
-msg_update_preview (const char *uid, gpointer value, CamelFolder *folder)
+msg_update_preview (const gchar *uid, gpointer value, CamelFolder *folder)
{
CamelMessageInfoBase *info = (CamelMessageInfoBase *)camel_folder_summary_uid (folder->summary, uid);
CamelMimeMessage *msg;
@@ -926,20 +926,20 @@ msg_update_preview (const char *uid, gpointer value, CamelFolder *folder)
}
static void
-pick_uids (const char *uid, CamelMessageInfoBase *mi, GPtrArray *array)
+pick_uids (const gchar *uid, CamelMessageInfoBase *mi, GPtrArray *array)
{
if (mi->preview)
- g_ptr_array_add (array, (char *)camel_pstring_strdup(uid));
+ g_ptr_array_add (array, (gchar *)camel_pstring_strdup(uid));
}
static gboolean
-fill_mi (const char *uid, const char *msg, CamelFolder *folder)
+fill_mi (const gchar *uid, const gchar *msg, CamelFolder *folder)
{
CamelMessageInfoBase *info;
info = g_hash_table_lookup (folder->summary->loaded_infos, uid);
if (info) /* We re assign the memory of msg */
- info->preview = (char *)msg;
+ info->preview = (gchar *)msg;
camel_pstring_free (uid); /* unref the uid */
return TRUE;
@@ -953,7 +953,7 @@ preview_update_exec (CamelSession *session, CamelSessionThreadMsg *msg)
GPtrArray *uids_uncached= camel_folder_get_uncached_uids (m->folder, m->folder->summary->uids, NULL);
GHashTable *hash = camel_folder_summary_get_hashtable (m->folder->summary);
GHashTable *preview_data;
- int i;
+ gint i;
preview_data = camel_db_get_folder_preview (m->folder->parent_store->cdb_r, m->folder->full_name, NULL);
if (preview_data) {
@@ -990,12 +990,12 @@ static CamelSessionThreadOps preview_update_ops = {
};
/* end */
-int
+gint
camel_folder_summary_reload_from_db (CamelFolderSummary *s, CamelException *ex)
{
CamelDB *cdb;
- char *folder_name;
- int ret = 0;
+ gchar *folder_name;
+ gint ret = 0;
struct _db_pass_data data;
/* FIXME[disk-summary] baseclass this, and vfolders we may have to
@@ -1032,7 +1032,7 @@ void
camel_folder_summary_add_preview (CamelFolderSummary *s, CamelMessageInfo *info)
{
CAMEL_SUMMARY_LOCK(s, summary_lock);
- g_hash_table_insert (_PRIVATE(s)->preview_updates, (char *)info->uid, ((CamelMessageInfoBase *)info)->preview);
+ g_hash_table_insert (_PRIVATE(s)->preview_updates, (gchar *)info->uid, ((CamelMessageInfoBase *)info)->preview);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
}
@@ -1046,7 +1046,7 @@ camel_folder_summary_add_preview (CamelFolderSummary *s, CamelMessageInfo *info)
* Loads all infos into memory, if they are not yet.
**/
void
-camel_folder_summary_ensure_infos_loaded (CamelFolderSummary *s, int at_least, CamelException *ex)
+camel_folder_summary_ensure_infos_loaded (CamelFolderSummary *s, gint at_least, CamelException *ex)
{
guint loaded, known;
@@ -1063,11 +1063,11 @@ camel_folder_summary_ensure_infos_loaded (CamelFolderSummary *s, int at_least, C
static void
camel_folder_summary_dump (CamelFolderSummary *s)
{
- int i;
+ gint i;
printf("Dumping %s\n", s->folder ? s->folder->full_name:"nil");
for (i=0; i<s->uids->len; i++)
- printf("%s\t", (char *)s->uids->pdata[i]);
+ printf("%s\t", (gchar *)s->uids->pdata[i]);
printf("\n");
}
@@ -1079,12 +1079,12 @@ camel_folder_summary_get_flag_cache (CamelFolderSummary *summary)
return p->flag_cache;
}
-int
+gint
camel_folder_summary_load_from_db (CamelFolderSummary *s, CamelException *ex)
{
CamelDB *cdb;
- char *folder_name;
- int ret = 0;
+ gchar *folder_name;
+ gint ret = 0;
struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
/* struct _db_pass_data data; */
@@ -1113,14 +1113,14 @@ camel_folder_summary_load_from_db (CamelFolderSummary *s, CamelException *ex)
}
static void
-mir_from_cols (CamelMIRecord *mir, CamelFolderSummary *s, int ncol, char ** cols, char ** name)
+mir_from_cols (CamelMIRecord *mir, CamelFolderSummary *s, gint ncol, gchar ** cols, gchar ** name)
{
- int i;
+ gint i;
for (i = 0; i < ncol; ++i) {
if ( !strcmp (name [i], "uid") )
- mir->uid = (char *) camel_pstring_strdup (cols [i]);
+ mir->uid = (gchar *) camel_pstring_strdup (cols [i]);
else if ( !strcmp (name [i], "flags") )
mir->flags = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
else if ( !strcmp (name [i], "read") )
@@ -1142,21 +1142,21 @@ mir_from_cols (CamelMIRecord *mir, CamelFolderSummary *s, int ncol, char ** cols
else if ( !strcmp (name [i], "dreceived") )
mir->dreceived = cols [i] ? strtol (cols [i], NULL, 10) : 0;
else if ( !strcmp (name [i], "subject") )
- mir->subject = (char *) camel_pstring_strdup (cols [i]);
+ mir->subject = (gchar *) camel_pstring_strdup (cols [i]);
else if ( !strcmp (name [i], "mail_from") )
- mir->from = (char *) camel_pstring_strdup (cols [i]);
+ mir->from = (gchar *) camel_pstring_strdup (cols [i]);
else if ( !strcmp (name [i], "mail_to") )
- mir->to = (char *) camel_pstring_strdup (cols [i]);
+ mir->to = (gchar *) camel_pstring_strdup (cols [i]);
else if ( !strcmp (name [i], "mail_cc") )
- mir->cc = (char *) camel_pstring_strdup(cols [i]);
+ mir->cc = (gchar *) camel_pstring_strdup(cols [i]);
else if ( !strcmp (name [i], "mlist") )
- mir->mlist = (char *) camel_pstring_strdup (cols [i]);
+ mir->mlist = (gchar *) camel_pstring_strdup (cols [i]);
else if ( !strcmp (name [i], "followup_flag") )
- mir->followup_flag = (char *) camel_pstring_strdup(cols [i]);
+ mir->followup_flag = (gchar *) camel_pstring_strdup(cols [i]);
else if ( !strcmp (name [i], "followup_completed_on") )
- mir->followup_completed_on = (char *) camel_pstring_strdup(cols [i]);
+ mir->followup_completed_on = (gchar *) camel_pstring_strdup(cols [i]);
else if ( !strcmp (name [i], "followup_due_by") )
- mir->followup_due_by = (char *) camel_pstring_strdup(cols [i]);
+ mir->followup_due_by = (gchar *) camel_pstring_strdup(cols [i]);
else if ( !strcmp (name [i], "part") )
mir->part = g_strdup (cols [i]);
else if ( !strcmp (name [i], "labels") )
@@ -1172,13 +1172,13 @@ mir_from_cols (CamelMIRecord *mir, CamelFolderSummary *s, int ncol, char ** cols
}
static int
-camel_read_mir_callback (void * ref, int ncol, char ** cols, char ** name)
+camel_read_mir_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
struct _db_pass_data *data = (struct _db_pass_data *) ref;
CamelFolderSummary *s = data->summary;
CamelMIRecord *mir;
CamelMessageInfo *info;
- int ret = 0;
+ gint ret = 0;
mir = g_new0 (CamelMIRecord , 1);
mir_from_cols (mir, s, ncol, cols, name);
@@ -1198,7 +1198,7 @@ camel_read_mir_callback (void * ref, int ncol, char ** cols, char ** name)
if (info) {
if (s->build_content) {
- char *tmp;
+ gchar *tmp;
tmp = mir->cinfo;
/* FIXME: this should be done differently, how i don't know */
((CamelMessageInfoBase *)info)->content = perform_content_info_load_from_db (s, mir);
@@ -1243,12 +1243,12 @@ camel_read_mir_callback (void * ref, int ncol, char ** cols, char ** name)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_folder_summary_load(CamelFolderSummary *s)
{
#if 0
FILE *in;
- int i;
+ gint i;
CamelMessageInfo *mi;
d(g_print ("\ncamel_folder_summary_load from FLAT FILE called \n"));
@@ -1306,14 +1306,14 @@ error:
}
-int
+gint
camel_folder_summary_migrate_infos(CamelFolderSummary *s)
{
FILE *in;
- int i;
+ gint i;
CamelMessageInfo *mi;
CamelMessageInfoBase *info;
- int ret = 0;
+ gint ret = 0;
CamelDB *cdb = s->folder->parent_store->cdb_w;
CamelFIRecord *record;
CamelException ex;
@@ -1413,7 +1413,7 @@ static int
perform_content_info_save_to_db (CamelFolderSummary *s, CamelMessageContentInfo *ci, CamelMIRecord *record)
{
CamelMessageContentInfo *part;
- char *oldr;
+ gchar *oldr;
if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->content_info_to_db (s, ci, record) == -1)
return -1;
@@ -1457,7 +1457,7 @@ perform_content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentI
typedef struct {
CamelException *ex;
gboolean migration;
- int progress;
+ gint progress;
} SaveToDBArgs;
static void
@@ -1467,7 +1467,7 @@ save_to_db_cb (gpointer key, gpointer value, gpointer data)
CamelException *ex = args->ex;
CamelMessageInfoBase *mi = (CamelMessageInfoBase *)value;
CamelFolderSummary *s = (CamelFolderSummary *)mi->summary;
- char *folder_name = s->folder->full_name;
+ gchar *folder_name = s->folder->full_name;
CamelDB *cdb = s->folder->parent_store->cdb_w;
CamelMIRecord *mir;
@@ -1518,7 +1518,7 @@ static int
save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mirs, CamelException *ex)
{
CamelDB *cdb = s->folder->parent_store->cdb_w;
- char *folder_name;
+ gchar *folder_name;
SaveToDBArgs args;
args.ex = ex;
@@ -1540,17 +1540,17 @@ save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mirs, CamelExcep
}
static void
-msg_save_preview (const char *uid, gpointer value, CamelFolder *folder)
+msg_save_preview (const gchar *uid, gpointer value, CamelFolder *folder)
{
- camel_db_write_preview_record (folder->parent_store->cdb_w, folder->full_name, uid, (char *)value, NULL);
+ camel_db_write_preview_record (folder->parent_store->cdb_w, folder->full_name, uid, (gchar *)value, NULL);
}
-int
+gint
camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex)
{
CamelDB *cdb = s->folder->parent_store->cdb_w;
CamelFIRecord *record;
- int ret, count;
+ gint ret, count;
d(printf ("\ncamel_folder_summary_save_to_db called \n"));
if (_PRIVATE(s)->need_preview && g_hash_table_size(_PRIVATE(s)->preview_updates)) {
@@ -1607,12 +1607,12 @@ camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex)
return ret;
}
-int
+gint
camel_folder_summary_header_save_to_db (CamelFolderSummary *s, CamelException *ex)
{
CamelDB *cdb = s->folder->parent_store->cdb_w;
CamelFIRecord *record;
- int ret;
+ gint ret;
d(printf ("\ncamel_folder_summary_header_save_to_db called \n"));
@@ -1646,17 +1646,17 @@ camel_folder_summary_header_save_to_db (CamelFolderSummary *s, CamelException *e
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_folder_summary_save(CamelFolderSummary *s)
{
#if 0
FILE *out;
FILE *out_meta;
- int fd, i, fd_meta;
+ gint fd, i, fd_meta;
guint32 count;
CamelMessageInfo *mi;
- char *path;
- char *path_meta;
+ gchar *path;
+ gchar *path_meta;
g_assert(s->message_info_size >= sizeof(CamelMessageInfoBase));
@@ -1779,12 +1779,12 @@ exception:
return -1;
}
-int
-camel_folder_summary_header_load_from_db (CamelFolderSummary *s, CamelStore *store, const char *folder_name, CamelException *ex)
+gint
+camel_folder_summary_header_load_from_db (CamelFolderSummary *s, CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelDB *cdb;
CamelFIRecord *record;
- int ret = 0;
+ gint ret = 0;
d(printf ("\ncamel_folder_summary_load_from_db called \n"));
s->flags &= ~CAMEL_SUMMARY_DIRTY;
@@ -1818,10 +1818,10 @@ camel_folder_summary_header_load_from_db (CamelFolderSummary *s, CamelStore *sto
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_folder_summary_header_load(CamelFolderSummary *s)
{
- int ret=-1;
+ gint ret=-1;
#if 0
FILE *in;
FILE *in_meta;
@@ -1856,14 +1856,14 @@ camel_folder_summary_header_load(CamelFolderSummary *s)
static int
summary_assign_uid(CamelFolderSummary *s, CamelMessageInfo *info)
{
- const char *uid;
+ const gchar *uid;
CamelMessageInfo *mi;
uid = camel_message_info_uid (info);
if (uid == NULL || uid[0] == 0) {
camel_pstring_free (info->uid);
- uid = info->uid = (char *)camel_pstring_add (camel_folder_summary_next_uid_string(s), TRUE);
+ uid = info->uid = (gchar *)camel_pstring_add (camel_folder_summary_next_uid_string(s), TRUE);
}
CAMEL_SUMMARY_LOCK(s, summary_lock);
@@ -1926,7 +1926,7 @@ camel_folder_summary_add (CamelFolderSummary *s, CamelMessageInfo *info)
/* FIXME[disk-summary] SHould we ref it or redesign it later on */
/* The uid array should have its own memory. We will unload the infos when not reqd.*/
g_ptr_array_add (s->uids, (gpointer) camel_pstring_strdup((camel_message_info_uid(info))));
- g_hash_table_replace (_PRIVATE(s)->flag_cache, (char *)info->uid, GUINT_TO_POINTER(camel_message_info_flags(info)));
+ g_hash_table_replace (_PRIVATE(s)->flag_cache, (gchar *)info->uid, GUINT_TO_POINTER(camel_message_info_flags(info)));
g_hash_table_insert (s->loaded_infos, (gpointer) camel_message_info_uid (info), info);
s->flags |= CAMEL_SUMMARY_DIRTY;
@@ -1955,11 +1955,11 @@ camel_folder_summary_insert (CamelFolderSummary *s, CamelMessageInfo *info, gboo
/* FIXME[disk-summary] SHould we ref it or redesign it later on */
/* The uid array should have its own memory. We will unload the infos when not reqd.*/
if (!load)
- g_ptr_array_add (s->uids, (char *) camel_pstring_strdup(camel_message_info_uid(info)));
+ g_ptr_array_add (s->uids, (gchar *) camel_pstring_strdup(camel_message_info_uid(info)));
- g_hash_table_insert (s->loaded_infos, (char *) camel_message_info_uid (info), info);
+ g_hash_table_insert (s->loaded_infos, (gchar *) camel_message_info_uid (info), info);
if (load) {
- g_hash_table_replace (_PRIVATE(s)->flag_cache, (char *)info->uid, GUINT_TO_POINTER(camel_message_info_flags(info)));
+ g_hash_table_replace (_PRIVATE(s)->flag_cache, (gchar *)info->uid, GUINT_TO_POINTER(camel_message_info_flags(info)));
}
if (!load)
@@ -1972,7 +1972,7 @@ camel_folder_summary_insert (CamelFolderSummary *s, CamelMessageInfo *info, gboo
static void
update_summary (CamelFolderSummary *summary, CamelMessageInfoBase *info)
{
- int unread=0, deleted=0, junk=0;
+ gint unread=0, deleted=0, junk=0;
guint32 flags = info->flags;
if (!(flags & CAMEL_MESSAGE_SEEN))
@@ -2125,7 +2125,7 @@ CamelMessageInfo *
camel_folder_summary_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
{
CamelMessageInfo *info = NULL;
- char *buffer;
+ gchar *buffer;
size_t len;
struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
off_t start;
@@ -2300,7 +2300,7 @@ void
camel_folder_summary_clear_db (CamelFolderSummary *s)
{
CamelDB *cdb;
- char *folder_name;
+ gchar *folder_name;
d(printf ("\ncamel_folder_summary_load_from_db called \n"));
s->flags &= ~CAMEL_SUMMARY_DIRTY;
@@ -2331,9 +2331,9 @@ camel_folder_summary_clear_db (CamelFolderSummary *s)
/* This function returns 0 on success. So the caller should not bother,
deleting the uid from db when the return value is non-zero */
static int
-summary_remove_uid (CamelFolderSummary *s, const char *uid)
+summary_remove_uid (CamelFolderSummary *s, const gchar *uid)
{
- int i;
+ gint i;
d(printf ("\nsummary_remove_uid called \n"));
@@ -2362,7 +2362,7 @@ void
camel_folder_summary_remove (CamelFolderSummary *s, CamelMessageInfo *info)
{
- int ret;
+ gint ret;
CAMEL_SUMMARY_LOCK(s, summary_lock);
@@ -2389,14 +2389,14 @@ camel_folder_summary_remove (CamelFolderSummary *s, CamelMessageInfo *info)
* Remove a specific info record from the summary, by @uid.
**/
void
-camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid)
+camel_folder_summary_remove_uid(CamelFolderSummary *s, const gchar *uid)
{
CamelMessageInfo *oldinfo;
- char *olduid;
+ gchar *olduid;
CAMEL_SUMMARY_LOCK(s, summary_lock);
CAMEL_SUMMARY_LOCK(s, ref_lock);
- if (g_hash_table_lookup_extended(s->loaded_infos, uid, (void *)&olduid, (void *)&oldinfo)) {
+ if (g_hash_table_lookup_extended(s->loaded_infos, uid, (gpointer)&olduid, (gpointer)&oldinfo)) {
/* make sure it doesn't vanish while we're removing it */
oldinfo->refcount++;
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
@@ -2404,8 +2404,8 @@ camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid)
camel_folder_summary_remove(s, oldinfo);
camel_message_info_free(oldinfo);
} else {
- char *tmpid = g_strdup (uid);
- int ret;
+ gchar *tmpid = g_strdup (uid);
+ gint ret;
/* Info isn't loaded into the memory. We must just remove the UID*/
ret = summary_remove_uid (s, uid);
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
@@ -2421,14 +2421,14 @@ camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid)
/* _fast doesn't deal with db and leaves it to the caller. */
void
-camel_folder_summary_remove_uid_fast (CamelFolderSummary *s, const char *uid)
+camel_folder_summary_remove_uid_fast (CamelFolderSummary *s, const gchar *uid)
{
CamelMessageInfo *oldinfo;
- char *olduid;
+ gchar *olduid;
CAMEL_SUMMARY_LOCK(s, summary_lock);
CAMEL_SUMMARY_LOCK(s, ref_lock);
- if (g_hash_table_lookup_extended(s->loaded_infos, uid, (void *)&olduid, (void *)&oldinfo)) {
+ if (g_hash_table_lookup_extended(s->loaded_infos, uid, (gpointer)&olduid, (gpointer)&oldinfo)) {
/* make sure it doesn't vanish while we're removing it */
oldinfo->refcount++;
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
@@ -2440,7 +2440,7 @@ camel_folder_summary_remove_uid_fast (CamelFolderSummary *s, const char *uid)
camel_message_info_free(oldinfo);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
} else {
- char *tmpid = g_strdup (uid);
+ gchar *tmpid = g_strdup (uid);
/* Info isn't loaded into the memory. We must just remove the UID*/
summary_remove_uid (s, uid);
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
@@ -2450,16 +2450,16 @@ camel_folder_summary_remove_uid_fast (CamelFolderSummary *s, const char *uid)
}
void
-camel_folder_summary_remove_index_fast (CamelFolderSummary *s, int index)
+camel_folder_summary_remove_index_fast (CamelFolderSummary *s, gint index)
{
- const char *uid = s->uids->pdata[index];
+ const gchar *uid = s->uids->pdata[index];
CamelMessageInfo *oldinfo;
- char *olduid;
+ gchar *olduid;
CAMEL_SUMMARY_LOCK(s, summary_lock);
CAMEL_SUMMARY_LOCK(s, ref_lock);
- if (g_hash_table_lookup_extended(s->loaded_infos, uid, (void *)&olduid, (void *)&oldinfo)) {
+ if (g_hash_table_lookup_extended(s->loaded_infos, uid, (gpointer)&olduid, (gpointer)&oldinfo)) {
/* make sure it doesn't vanish while we're removing it */
g_hash_table_remove (s->loaded_infos, uid);
camel_pstring_free (uid);
@@ -2486,9 +2486,9 @@ camel_folder_summary_remove_index_fast (CamelFolderSummary *s, int index)
* Remove a specific info record from the summary, by index.
**/
void
-camel_folder_summary_remove_index(CamelFolderSummary *s, int index)
+camel_folder_summary_remove_index(CamelFolderSummary *s, gint index)
{
- const char *uid = s->uids->pdata[index];
+ const gchar *uid = s->uids->pdata[index];
camel_folder_summary_remove_uid (s, uid);
}
@@ -2503,7 +2503,7 @@ camel_folder_summary_remove_index(CamelFolderSummary *s, int index)
* Removes an indexed range of info records.
**/
void
-camel_folder_summary_remove_range (CamelFolderSummary *s, int start, int end)
+camel_folder_summary_remove_range (CamelFolderSummary *s, gint start, gint end)
{
d(g_print ("\ncamel_folder_summary_remove_range called \n"));
if (end < start)
@@ -2513,16 +2513,16 @@ camel_folder_summary_remove_range (CamelFolderSummary *s, int start, int end)
if (start < s->uids->len) {
- int i;
+ gint i;
CamelDB *cdb;
CamelException ex; /* May be this should come from the caller */
- char *folder_name;
+ gchar *folder_name;
GSList *uids = NULL;
end = MIN(end+1, s->uids->len);
for (i = start; i < end; i++) {
- const char *uid = s->uids->pdata[i];
+ const gchar *uid = s->uids->pdata[i];
gpointer olduid, oldinfo;
/* the uid will be freed below and will not be used because of changing size of the s->uids array */
@@ -2564,7 +2564,7 @@ camel_folder_summary_remove_range (CamelFolderSummary *s, int start, int end)
/* This is a tokenisation mechanism for strings written to the
summary - to save space.
This list can have at most 31 words. */
-static char * tokens[] = {
+static gchar * tokens[] = {
"7bit",
"8bit",
"alternative",
@@ -2602,7 +2602,7 @@ static char * tokens[] = {
#ifdef USE_BSEARCH
static int
-token_search_cmp(char *key, char **index)
+token_search_cmp(gchar *key, gchar **index)
{
d(printf("comparing '%s' to '%s'\n", key, *index));
return strcmp(key, *index);
@@ -2620,26 +2620,26 @@ token_search_cmp(char *key, char **index)
*
* Returns: %0 on success or %-1 on fail
**/
-int
-camel_folder_summary_encode_token(FILE *out, const char *str)
+gint
+camel_folder_summary_encode_token(FILE *out, const gchar *str)
{
io(printf("Encoding token: '%s'\n", str));
if (str == NULL) {
return camel_file_util_encode_uint32(out, 0);
} else {
- int len = strlen(str);
- int i, token=-1;
+ gint len = strlen(str);
+ gint i, token=-1;
if (len <= 16) {
- char lower[32];
- char **match;
+ gchar lower[32];
+ gchar **match;
for (i=0;i<len;i++)
lower[i] = tolower(str[i]);
lower[i] = 0;
#ifdef USE_BSEARCH
- match = bsearch(lower, tokens, tokens_len, sizeof(char *), (int (*)(const void *, const void *))token_search_cmp);
+ match = bsearch(lower, tokens, tokens_len, sizeof(gchar *), (gint (*)(gconstpointer , gconstpointer ))token_search_cmp);
if (match)
token = match-tokens;
#else
@@ -2673,10 +2673,10 @@ camel_folder_summary_encode_token(FILE *out, const char *str)
*
* Returns: %0 on success or %-1 on fail
**/
-int
-camel_folder_summary_decode_token(FILE *in, char **str)
+gint
+camel_folder_summary_decode_token(FILE *in, gchar **str)
{
- char *ret;
+ gchar *ret;
guint32 len;
io(printf("Decode token ...\n"));
@@ -2738,7 +2738,7 @@ my_list_append(struct _node **list, struct _node *n)
static int
my_list_size(struct _node **list)
{
- int len = 0;
+ gint len = 0;
struct _node *ln = (struct _node *)list;
while (ln->next) {
ln = ln->next;
@@ -2850,7 +2850,7 @@ summary_header_to_db (CamelFolderSummary *s, CamelException *ex)
{
CamelFIRecord * record = g_new0 (CamelFIRecord, 1);
CamelDB *db;
- char *table_name;
+ 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;
@@ -2892,7 +2892,7 @@ summary_header_to_db (CamelFolderSummary *s, CamelException *ex)
static int
summary_header_save(CamelFolderSummary *s, FILE *out)
{
- int unread = 0, deleted = 0, junk = 0, count, i;
+ gint unread = 0, deleted = 0, junk = 0, count, i;
fseek(out, 0, SEEK_SET);
@@ -2954,7 +2954,7 @@ static CamelMessageInfo *
message_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
{
CamelMessageInfo *mi = NULL;
- int state;
+ gint state;
state = camel_mime_parser_state(mp);
switch (state) {
@@ -3012,13 +3012,13 @@ content_info_new_from_message(CamelFolderSummary *s, CamelMimePart *mp)
return ci;
}
-static char *
-summary_format_address(struct _camel_header_raw *h, const char *name, const char *charset)
+static gchar *
+summary_format_address(struct _camel_header_raw *h, const gchar *name, const gchar *charset)
{
struct _camel_header_address *addr;
- char *text, *str;
+ gchar *text, *str;
- if (!(text = (char *) camel_header_raw_find (&h, name, NULL)))
+ if (!(text = (gchar *) camel_header_raw_find (&h, name, NULL)))
return NULL;
while (isspace ((unsigned) *text))
@@ -3037,12 +3037,12 @@ summary_format_address(struct _camel_header_raw *h, const char *name, const char
return str;
}
-static char *
-summary_format_string (struct _camel_header_raw *h, const char *name, const char *charset)
+static gchar *
+summary_format_string (struct _camel_header_raw *h, const gchar *name, const gchar *charset)
{
- char *text, *str;
+ gchar *text, *str;
- if (!(text = (char *) camel_header_raw_find (&h, name, NULL)))
+ if (!(text = (gchar *) camel_header_raw_find (&h, name, NULL)))
return NULL;
while (isspace ((unsigned) *text))
@@ -3091,15 +3091,15 @@ camel_folder_summary_content_info_new(CamelFolderSummary *s)
static CamelMessageInfo *
message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
{
- const char *received, *date, *content, *charset = NULL;
+ const gchar *received, *date, *content, *charset = NULL;
struct _camel_header_references *refs, *irt, *scan;
- char *subject, *from, *to, *cc, *mlist;
+ gchar *subject, *from, *to, *cc, *mlist;
CamelContentType *ct = NULL;
CamelMessageInfoBase *mi;
guint8 *digest;
gsize length;
- char *msgid;
- int count;
+ gchar *msgid;
+ gint count;
length = g_checksum_type_get_length (G_CHECKSUM_MD5);
digest = g_alloca (length);
@@ -3200,9 +3200,9 @@ static CamelMessageInfo *
message_info_from_db (CamelFolderSummary *s, CamelMIRecord *record)
{
CamelMessageInfoBase *mi;
- int i;
- int count;
- char *part, *label;
+ gint i;
+ gint count;
+ gchar *part, *label;
mi = (CamelMessageInfoBase *)camel_message_info_new(s);
@@ -3213,12 +3213,12 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *record)
mi->date_sent = record->dsent;
mi->date_received = record->dreceived;
- mi->uid = (char *) camel_pstring_strdup (record->uid);
- mi->subject = (char *) camel_pstring_add (record->subject, FALSE);
- mi->from = (char *) camel_pstring_add (record->from, FALSE);
- mi->to = (char *) camel_pstring_add (record->to, FALSE);
- mi->cc = (char *) camel_pstring_add (record->cc, FALSE);
- mi->mlist = (char *) camel_pstring_add (record->mlist, FALSE);
+ 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);
/* Extract Message id & References */
mi->content = NULL;
@@ -3259,8 +3259,8 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *record)
part = record->usertags;
EXTRACT_FIRST_DIGIT (count)
for (i=0;i<count;i++) {
- int len;
- char *name, *value;
+ gint len;
+ gchar *name, *value;
EXTRACT_STRING (name)
EXTRACT_STRING (value)
camel_tag_set(&mi->user_tags, name, value);
@@ -3276,8 +3276,8 @@ message_info_load(CamelFolderSummary *s, FILE *in)
{
CamelMessageInfoBase *mi;
guint32 count;
- int i;
- char *subject, *from, *to, *cc, *mlist, *uid;
+ gint i;
+ gchar *subject, *from, *to, *cc, *mlist, *uid;
mi = (CamelMessageInfoBase *)camel_message_info_new(s);
@@ -3322,7 +3322,7 @@ message_info_load(CamelFolderSummary *s, FILE *in)
goto error;
for (i=0;i<count;i++) {
- char *name;
+ gchar *name;
if (camel_file_util_decode_string(in, &name) == -1 || name == NULL)
goto error;
camel_flag_set(&mi->user_flags, name, TRUE);
@@ -3333,7 +3333,7 @@ message_info_load(CamelFolderSummary *s, FILE *in)
goto error;
for (i=0;i<count;i++) {
- char *name, *value;
+ gchar *name, *value;
if (camel_file_util_decode_string(in, &name) == -1 || name == NULL
|| camel_file_util_decode_string(in, &value) == -1)
goto error;
@@ -3379,10 +3379,10 @@ message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
GString *tmp;
CamelFlag *flag;
CamelTag *tag;
- int count, i;
+ 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 = (char *) camel_pstring_strdup(camel_message_info_uid(mi));
+ 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;
@@ -3397,15 +3397,15 @@ message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
record->dsent = mi->date_sent;
record->dreceived = mi->date_received;
- record->subject = (char *) camel_pstring_strdup(camel_message_info_subject (mi));
- record->from = (char *) camel_pstring_strdup(camel_message_info_from (mi));
- record->to = (char *) camel_pstring_strdup(camel_message_info_to (mi));
- record->cc = (char *) camel_pstring_strdup(camel_message_info_cc (mi));
- record->mlist = (char *) camel_pstring_strdup(camel_message_info_mlist (mi));
+ 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 = (char *) camel_pstring_strdup(camel_message_info_user_tag(info, "follow-up"));
- record->followup_completed_on = (char *) camel_pstring_strdup(camel_message_info_user_tag(info, "completed-on"));
- record->followup_due_by = (char *) camel_pstring_strdup(camel_message_info_user_tag(info, "due-by"));
+ 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"));
tmp = g_string_new (NULL);
if (mi->references) {
@@ -3455,7 +3455,7 @@ message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
guint32 count;
CamelFlag *flag;
CamelTag *tag;
- int i;
+ gint i;
CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
io(printf("Saving message info\n"));
@@ -3548,7 +3548,7 @@ static CamelMessageContentInfo *
content_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
{
CamelMessageContentInfo *ci;
- const char *charset;
+ const gchar *charset;
ci = camel_folder_summary_content_info_new (s);
@@ -3565,11 +3565,11 @@ static CamelMessageContentInfo *
content_info_from_db(CamelFolderSummary *s, CamelMIRecord *record)
{
CamelMessageContentInfo *ci;
- char *type, *subtype;
+ gchar *type, *subtype;
guint32 count, i;
CamelContentType *ct;
- char *part = record->cinfo;
- int len;
+ gchar *part = record->cinfo;
+ gint len;
io(printf("Loading content info from db\n"));
@@ -3587,7 +3587,7 @@ content_info_from_db(CamelFolderSummary *s, CamelMIRecord *record)
EXTRACT_DIGIT (count)
for (i = 0; i < count; i++) {
- char *name, *value;
+ gchar *name, *value;
EXTRACT_STRING (name)
EXTRACT_STRING (value)
@@ -3615,7 +3615,7 @@ static CamelMessageContentInfo *
content_info_load(CamelFolderSummary *s, FILE *in)
{
CamelMessageContentInfo *ci;
- char *type, *subtype;
+ gchar *type, *subtype;
guint32 count, i;
CamelContentType *ct;
@@ -3633,7 +3633,7 @@ content_info_load(CamelFolderSummary *s, FILE *in)
goto error;
for (i = 0; i < count; i++) {
- char *name, *value;
+ gchar *name, *value;
camel_folder_summary_decode_token(in, &name);
camel_folder_summary_decode_token(in, &value);
if (!(name && value))
@@ -3668,7 +3668,7 @@ content_info_to_db(CamelFolderSummary *s, CamelMessageContentInfo *ci, CamelMIRe
CamelContentType *ct;
struct _camel_header_param *hp;
GString *str = g_string_new (NULL);
- char *oldr;
+ gchar *oldr;
io(printf("Saving content info to db\n"));
@@ -3776,7 +3776,7 @@ content_info_free(CamelFolderSummary *s, CamelMessageContentInfo *ci)
#endif
}
-static char *
+static gchar *
next_uid_string(CamelFolderSummary *s)
{
return g_strdup_printf("%u", camel_folder_summary_next_uid(s));
@@ -3792,16 +3792,16 @@ next_uid_string(CamelFolderSummary *s)
static CamelMessageContentInfo *
summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimeParser *mp)
{
- int state;
+ gint state;
size_t len;
- char *buffer;
+ gchar *buffer;
CamelMessageContentInfo *info = NULL;
CamelContentType *ct;
- int enc_id = -1, chr_id = -1, html_id = -1, idx_id = -1;
+ gint enc_id = -1, chr_id = -1, html_id = -1, idx_id = -1;
struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
CamelMimeFilterCharset *mfc;
CamelMessageContentInfo *part;
- const char *calendar_header;
+ const gchar *calendar_header;
d(printf("building content info\n"));
@@ -3835,8 +3835,8 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
camel_message_info_set_user_flag (msginfo, "$has_cal", TRUE);
if (p->index && camel_content_type_is(ct, "text", "*")) {
- char *encoding;
- const char *charset;
+ gchar *encoding;
+ const gchar *charset;
d(printf("generating index:\n"));
@@ -3959,7 +3959,7 @@ static CamelMessageContentInfo *
summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimePart *object)
{
CamelDataWrapper *containee;
- int parts, i;
+ gint parts, i;
struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
CamelMessageContentInfo *info = NULL, *child;
CamelContentType *ct;
@@ -3994,7 +3994,7 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
}
for (header = object->headers; header; header = header->next) {
- const char *value = header->value;
+ const gchar *value = header->value;
/* skip preceding spaces in the value */
while (value && *value && isspace (*value))
@@ -4031,7 +4031,7 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
}
} else if (p->filter_stream
&& camel_content_type_is(ct, "text", "*")) {
- int html_id = -1, idx_id = -1;
+ gint html_id = -1, idx_id = -1;
/* pre-attach html filter if required, otherwise just index filter */
if (camel_content_type_is(ct, "text", "html")) {
@@ -4063,7 +4063,7 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
* Returns: the state of the flag (%TRUE or %FALSE)
**/
gboolean
-camel_flag_get(CamelFlag **list, const char *name)
+camel_flag_get(CamelFlag **list, const gchar *name)
{
CamelFlag *flag;
flag = *list;
@@ -4088,7 +4088,7 @@ camel_flag_get(CamelFlag **list, const char *name)
* otherwise
**/
gboolean
-camel_flag_set(CamelFlag **list, const char *name, gboolean value)
+camel_flag_set(CamelFlag **list, const gchar *name, gboolean value)
{
CamelFlag *flag, *tmp;
@@ -4127,10 +4127,10 @@ camel_flag_set(CamelFlag **list, const char *name, gboolean value)
*
* Returns: the number of flags in the list
**/
-int
+gint
camel_flag_list_size(CamelFlag **list)
{
- int count=0;
+ gint count=0;
CamelFlag *flag;
flag = *list;
@@ -4175,7 +4175,7 @@ gboolean
camel_flag_list_copy(CamelFlag **to, CamelFlag **from)
{
CamelFlag *flag, *tmp;
- int changed = FALSE;
+ gint changed = FALSE;
if (*to == NULL && from == NULL)
return FALSE;
@@ -4213,15 +4213,15 @@ camel_flag_list_copy(CamelFlag **to, CamelFlag **from)
*
* Returns: the value of the flag or %NULL if unset
**/
-const char *
-camel_tag_get(CamelTag **list, const char *name)
+const gchar *
+camel_tag_get(CamelTag **list, const gchar *name)
{
CamelTag *tag;
tag = *list;
while (tag) {
if (!strcmp(tag->name, name))
- return (const char *)tag->value;
+ return (const gchar *)tag->value;
tag = tag->next;
}
return NULL;
@@ -4239,7 +4239,7 @@ camel_tag_get(CamelTag **list, const char *name)
* Returns: %TRUE if the value on the tag changed or %FALSE otherwise
**/
gboolean
-camel_tag_set(CamelTag **list, const char *name, const char *value)
+camel_tag_set(CamelTag **list, const gchar *name, const gchar *value)
{
CamelTag *tag, *tmp;
@@ -4283,10 +4283,10 @@ camel_tag_set(CamelTag **list, const char *name, const char *value)
*
* Returns: the number of tags
**/
-int
+gint
camel_tag_list_size(CamelTag **list)
{
- int count=0;
+ gint count=0;
CamelTag *tag;
tag = *list;
@@ -4298,7 +4298,7 @@ camel_tag_list_size(CamelTag **list)
}
static void
-rem_tag(char *key, char *value, CamelTag **to)
+rem_tag(gchar *key, gchar *value, CamelTag **to)
{
camel_tag_set(to, key, NULL);
}
@@ -4316,7 +4316,7 @@ rem_tag(char *key, char *value, CamelTag **to)
gboolean
camel_tag_list_copy(CamelTag **to, CamelTag **from)
{
- int changed = FALSE;
+ gint changed = FALSE;
CamelTag *tag;
GHashTable *left;
@@ -4368,7 +4368,7 @@ camel_tag_list_free(CamelTag **list)
}
static struct flag_names_t {
- char *name;
+ gchar *name;
guint32 value;
} flag_names[] = {
{ "answered", CAMEL_MESSAGE_ANSWERED },
@@ -4391,7 +4391,7 @@ static struct flag_names_t {
* Returns: the integer value of the system flag string
**/
guint32
-camel_system_flag (const char *name)
+camel_system_flag (const gchar *name)
{
struct flag_names_t *flag;
@@ -4415,7 +4415,7 @@ camel_system_flag (const char *name)
* Returns: %TRUE if the named flag is set or %FALSE otherwise
**/
gboolean
-camel_system_flag_get (guint32 flags, const char *name)
+camel_system_flag_get (guint32 flags, const gchar *name)
{
g_return_val_if_fail (name != NULL, FALSE);
@@ -4431,7 +4431,7 @@ camel_system_flag_get (guint32 flags, const char *name)
*
* Returns: a new #CamelMessageInfo
**/
-void *
+gpointer
camel_message_info_new (CamelFolderSummary *s)
{
CamelMessageInfo *info;
@@ -4477,7 +4477,7 @@ camel_message_info_new (CamelFolderSummary *s)
* Reference an info.
**/
void
-camel_message_info_ref(void *o)
+camel_message_info_ref(gpointer o)
{
CamelMessageInfo *mi = o;
@@ -4522,7 +4522,7 @@ camel_message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_r
* Unref's and potentially frees a #CamelMessageInfo and its contents.
**/
void
-camel_message_info_free(void *o)
+camel_message_info_free(gpointer o)
{
CamelMessageInfo *mi = o;
@@ -4585,7 +4585,7 @@ message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
memcpy(&to->message_id, &from->message_id, sizeof(to->message_id));
to->preview = g_strdup (from->preview);
if (from->references) {
- int len = sizeof(*from->references) + ((from->references->size-1) * sizeof(from->references->references[0]));
+ 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);
@@ -4619,8 +4619,8 @@ message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
*
* Returns: the duplicated #CamelMessageInfo
**/
-void *
-camel_message_info_clone(const void *o)
+gpointer
+camel_message_info_clone(gconstpointer o)
{
const CamelMessageInfo *mi = o;
@@ -4630,8 +4630,8 @@ camel_message_info_clone(const void *o)
return message_info_clone(NULL, mi);
}
-static const void *
-info_ptr(const CamelMessageInfo *mi, int id)
+static gconstpointer
+info_ptr(const CamelMessageInfo *mi, gint id)
{
switch (id) {
case CAMEL_MESSAGE_INFO_SUBJECT:
@@ -4663,7 +4663,7 @@ info_ptr(const CamelMessageInfo *mi, int id)
}
static guint32
-info_uint32(const CamelMessageInfo *mi, int id)
+info_uint32(const CamelMessageInfo *mi, gint id)
{
switch (id) {
case CAMEL_MESSAGE_INFO_FLAGS:
@@ -4676,7 +4676,7 @@ info_uint32(const CamelMessageInfo *mi, int id)
}
static time_t
-info_time(const CamelMessageInfo *mi, int id)
+info_time(const CamelMessageInfo *mi, gint id)
{
switch (id) {
case CAMEL_MESSAGE_INFO_DATE_SENT:
@@ -4689,13 +4689,13 @@ info_time(const CamelMessageInfo *mi, int id)
}
static gboolean
-info_user_flag(const CamelMessageInfo *mi, const char *id)
+info_user_flag(const CamelMessageInfo *mi, const gchar *id)
{
return camel_flag_get(&((CamelMessageInfoBase *)mi)->user_flags, id);
}
-static const char *
-info_user_tag(const CamelMessageInfo *mi, const char *id)
+static const gchar *
+info_user_tag(const CamelMessageInfo *mi, const gchar *id)
{
return camel_tag_get(&((CamelMessageInfoBase *)mi)->user_tags, id);
}
@@ -4710,8 +4710,8 @@ info_user_tag(const CamelMessageInfo *mi, const char *id)
*
* Returns: the pointer data
**/
-const void *
-camel_message_info_ptr(const CamelMessageInfo *mi, int id)
+gconstpointer
+camel_message_info_ptr(const CamelMessageInfo *mi, gint id)
{
if (mi->summary)
return ((CamelFolderSummaryClass *)((CamelObject *)mi->summary)->klass)->info_ptr(mi, id);
@@ -4725,12 +4725,12 @@ camel_message_info_ptr(const CamelMessageInfo *mi, int id)
* @mi: a #CamelMessageInfo
* @id: info to get
*
- * Generic accessor method for getting 32bit int data.
+ * Generic accessor method for getting 32bit gint data.
*
- * Returns: the int data
+ * Returns: the gint data
**/
guint32
-camel_message_info_uint32(const CamelMessageInfo *mi, int id)
+camel_message_info_uint32(const CamelMessageInfo *mi, gint id)
{
if (mi->summary)
return ((CamelFolderSummaryClass *)((CamelObject *)mi->summary)->klass)->info_uint32(mi, id);
@@ -4749,7 +4749,7 @@ camel_message_info_uint32(const CamelMessageInfo *mi, int id)
* Returns: the time_t data
**/
time_t
-camel_message_info_time(const CamelMessageInfo *mi, int id)
+camel_message_info_time(const CamelMessageInfo *mi, gint id)
{
if (mi->summary)
return ((CamelFolderSummaryClass *)((CamelObject *)mi->summary)->klass)->info_time(mi, id);
@@ -4768,7 +4768,7 @@ camel_message_info_time(const CamelMessageInfo *mi, int id)
* Returns: the state of the user flag
**/
gboolean
-camel_message_info_user_flag(const CamelMessageInfo *mi, const char *id)
+camel_message_info_user_flag(const CamelMessageInfo *mi, const gchar *id)
{
if (mi->summary)
return ((CamelFolderSummaryClass *)((CamelObject *)mi->summary)->klass)->info_user_flag(mi, id);
@@ -4786,8 +4786,8 @@ camel_message_info_user_flag(const CamelMessageInfo *mi, const char *id)
*
* Returns: the value of the user tag
**/
-const char *
-camel_message_info_user_tag(const CamelMessageInfo *mi, const char *id)
+const gchar *
+camel_message_info_user_tag(const CamelMessageInfo *mi, const gchar *id)
{
if (mi->summary)
return ((CamelFolderSummaryClass *)((CamelObject *)mi->summary)->klass)->info_user_tag(mi, id);
@@ -4800,7 +4800,7 @@ info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set)
{
guint32 old;
CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
- int read=0, deleted=0, junk=0;
+ gint read=0, deleted=0, junk=0;
/* TODO: locking? */
if (flags & CAMEL_MESSAGE_SEEN && ((set & CAMEL_MESSAGE_SEEN) != (mi->flags & CAMEL_MESSAGE_SEEN)))
@@ -4845,7 +4845,7 @@ info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set)
mi->summary->visible_count -= junk ? junk : deleted;
}
if (mi->uid)
- g_hash_table_replace (_PRIVATE(mi->summary)->flag_cache, (char *)mi->uid, GUINT_TO_POINTER(mi->flags));
+ g_hash_table_replace (_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();
@@ -4861,9 +4861,9 @@ info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set)
}
void
-camel_folder_summary_update_flag_cache (CamelFolderSummary *s, const char *uid, guint32 flag)
+camel_folder_summary_update_flag_cache (CamelFolderSummary *s, const gchar *uid, guint32 flag)
{
- g_hash_table_replace (_PRIVATE(s)->flag_cache, (char *) uid, GUINT_TO_POINTER(flag));
+ g_hash_table_replace (_PRIVATE(s)->flag_cache, (gchar *) uid, GUINT_TO_POINTER(flag));
}
/**
* camel_message_info_set_flags:
@@ -4885,10 +4885,10 @@ camel_message_info_set_flags(CamelMessageInfo *mi, guint32 flags, guint32 set)
}
static gboolean
-info_set_user_flag(CamelMessageInfo *info, const char *name, gboolean value)
+info_set_user_flag(CamelMessageInfo *info, const gchar *name, gboolean value)
{
CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
- int res;
+ gint res;
res = camel_flag_set(&mi->user_flags, name, value);
@@ -4919,7 +4919,7 @@ info_set_user_flag(CamelMessageInfo *info, const char *name, gboolean value)
* Returns: %TRUE if the state changed or %FALSE otherwise
**/
gboolean
-camel_message_info_set_user_flag(CamelMessageInfo *mi, const char *id, gboolean state)
+camel_message_info_set_user_flag(CamelMessageInfo *mi, const gchar *id, gboolean state)
{
if (mi->summary)
return ((CamelFolderSummaryClass *)((CamelObject *)mi->summary)->klass)->info_set_user_flag(mi, id, state);
@@ -4928,10 +4928,10 @@ camel_message_info_set_user_flag(CamelMessageInfo *mi, const char *id, gboolean
}
static gboolean
-info_set_user_tag(CamelMessageInfo *info, const char *name, const char *value)
+info_set_user_tag(CamelMessageInfo *info, const gchar *name, const gchar *value)
{
CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
- int res;
+ gint res;
res = camel_tag_set(&mi->user_tags, name, value);
@@ -4961,7 +4961,7 @@ info_set_user_tag(CamelMessageInfo *info, const char *name, const char *value)
* Returns: %TRUE if the value changed or %FALSE otherwise
**/
gboolean
-camel_message_info_set_user_tag(CamelMessageInfo *mi, const char *id, const char *val)
+camel_message_info_set_user_tag(CamelMessageInfo *mi, const gchar *id, const gchar *val)
{
if (mi->summary)
return ((CamelFolderSummaryClass *)((CamelObject *)mi->summary)->klass)->info_set_user_tag(mi, id, val);
@@ -4970,9 +4970,9 @@ camel_message_info_set_user_tag(CamelMessageInfo *mi, const char *id, const char
}
void
-camel_content_info_dump (CamelMessageContentInfo *ci, int depth)
+camel_content_info_dump (CamelMessageContentInfo *ci, gint depth)
{
- char *p;
+ gchar *p;
p = alloca (depth * 4 + 1);
memset (p, ' ', depth * 4);
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 0cc74c915..f36cf2f62 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -54,9 +54,9 @@ struct _CamelMessageContentInfo {
struct _CamelMessageContentInfo *parent;
CamelContentType *type;
- char *id;
- char *description;
- char *encoding; /* this should be an enum?? */
+ gchar *id;
+ gchar *description;
+ gchar *encoding; /* this should be an enum?? */
guint32 size;
};
@@ -94,20 +94,20 @@ typedef enum _CamelMessageFlags {
typedef struct _CamelFlag {
struct _CamelFlag *next;
- char name[1]; /* name allocated as part of the structure */
+ gchar name[1]; /* name allocated as part of the structure */
} CamelFlag;
typedef struct _CamelTag {
struct _CamelTag *next;
- char *value;
- char name[1]; /* name allocated as part of the structure */
+ gchar *value;
+ gchar name[1]; /* name allocated as part of the structure */
} CamelTag;
/* a summary messageid is a 64 bit identifier (partial md5 hash) */
typedef struct _CamelSummaryMessageID {
union {
guint64 id;
- unsigned char hash[8];
+ guchar hash[8];
struct {
guint32 hi;
guint32 lo;
@@ -117,7 +117,7 @@ typedef struct _CamelSummaryMessageID {
/* summary references is a fixed size array of references */
typedef struct _CamelSummaryReferences {
- int size;
+ gint size;
CamelSummaryMessageID references[1];
} CamelSummaryReferences;
@@ -150,9 +150,9 @@ struct _CamelMessageInfo {
CamelFolderSummary *summary;
guint32 refcount; /* ??? */
- const char *uid;
+ const gchar *uid;
/*FIXME: Make it work with the CAMEL_MESSADE_DB_DIRTY flag instead of another 4 bytes*/
- int dirty:1;
+ gint dirty:1;
};
/* For classes wishing to do the provided i/o, or for anonymous users,
@@ -162,15 +162,15 @@ struct _CamelMessageInfoBase {
CamelFolderSummary *summary;
guint32 refcount; /* ??? */
- const char *uid;
+ const gchar *uid;
/*FIXME: Make it work with the CAMEL_MESSADE_DB_DIRTY flag instead of another 4 bytes*/
- int dirty:1;
+ gint dirty:1;
- const char *subject;
- const char *from;
- const char *to;
- const char *cc;
- const char *mlist;
+ const gchar *subject;
+ const gchar *from;
+ const gchar *to;
+ const gchar *cc;
+ const gchar *mlist;
guint32 flags;
guint32 size;
@@ -187,7 +187,7 @@ struct _CamelMessageInfoBase {
/* tree of content description - NULL if it is not available */
CamelMessageContentInfo *content;
struct _camel_header_param *headers;
- char *preview;
+ gchar *preview;
};
@@ -230,7 +230,7 @@ struct _CamelFolderSummary {
struct _EMemChunk *message_info_chunks;
struct _EMemChunk *content_info_chunks;
- char *summary_path;
+ gchar *summary_path;
gboolean build_content; /* do we try and parse/index the content, or not? */
#if 0 /* Deprecated */
@@ -247,8 +247,8 @@ struct _CamelFolderSummary {
time_t cache_load_time;
guint timeout_handle;
- const char *collate;
- const char *sort_by;
+ const gchar *collate;
+ const gchar *sort_by;
/* Future ABI expansion */
gpointer later[4];
@@ -261,16 +261,16 @@ struct _CamelFolderSummaryClass {
CamelObjectClass parent_class;
/* load/save the global info */
- int (*summary_header_load)(CamelFolderSummary *, FILE *);
- int (*summary_header_save)(CamelFolderSummary *, FILE *);
+ gint (*summary_header_load)(CamelFolderSummary *, FILE *);
+ gint (*summary_header_save)(CamelFolderSummary *, FILE *);
/* Load/Save folder summary from DB*/
- int (*summary_header_from_db)(CamelFolderSummary *, struct _CamelFIRecord *);
+ gint (*summary_header_from_db)(CamelFolderSummary *, struct _CamelFIRecord *);
struct _CamelFIRecord * (*summary_header_to_db)(CamelFolderSummary *, CamelException *ex);
CamelMessageInfo * (*message_info_from_db) (CamelFolderSummary *, struct _CamelMIRecord*);
struct _CamelMIRecord * (*message_info_to_db) (CamelFolderSummary *, CamelMessageInfo *);
CamelMessageContentInfo * (*content_info_from_db) (CamelFolderSummary *, struct _CamelMIRecord *);
- int (*content_info_to_db) (CamelFolderSummary *, CamelMessageContentInfo *, struct _CamelMIRecord *);
+ gint (*content_info_to_db) (CamelFolderSummary *, CamelMessageContentInfo *, struct _CamelMIRecord *);
/* create/save/load an individual message info */
CamelMessageInfo * (*message_info_new_from_header)(CamelFolderSummary *, struct _camel_header_raw *);
@@ -290,27 +290,27 @@ struct _CamelFolderSummaryClass {
CamelMessageContentInfo * (*content_info_load)(CamelFolderSummary *, FILE *);
int (*content_info_save)(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
void (*content_info_free)(CamelFolderSummary *, CamelMessageContentInfo *);
- CamelMessageInfo * (*message_info_from_uid) (CamelFolderSummary *, const char *);
+ CamelMessageInfo * (*message_info_from_uid) (CamelFolderSummary *, const gchar *);
/* get the next uid */
- char *(*next_uid_string)(CamelFolderSummary *);
+ gchar *(*next_uid_string)(CamelFolderSummary *);
/* virtual accessors on messageinfo's */
- const void *(*info_ptr)(const CamelMessageInfo *mi, int id);
- guint32 (*info_uint32)(const CamelMessageInfo *mi, int id);
- time_t (*info_time)(const CamelMessageInfo *mi, int id);
+ gconstpointer (*info_ptr)(const CamelMessageInfo *mi, gint id);
+ guint32 (*info_uint32)(const CamelMessageInfo *mi, gint id);
+ time_t (*info_time)(const CamelMessageInfo *mi, gint id);
- gboolean (*info_user_flag)(const CamelMessageInfo *mi, const char *id);
- const char *(*info_user_tag)(const CamelMessageInfo *mi, const char *id);
+ gboolean (*info_user_flag)(const CamelMessageInfo *mi, const gchar *id);
+ const gchar *(*info_user_tag)(const CamelMessageInfo *mi, const gchar *id);
/* set accessors for the modifyable bits */
#if 0
- void (*info_set_ptr)(CamelMessageInfo *mi, int id, const void *val);
- void (*info_set_uint32)(CamelMessageInfo *mi, int id, guint32 val);
- void (*info_set_time)(CamelMessageInfo *mi, int id, time_t val);
+ void (*info_set_ptr)(CamelMessageInfo *mi, gint id, gconstpointer val);
+ void (*info_set_uint32)(CamelMessageInfo *mi, gint id, guint32 val);
+ void (*info_set_time)(CamelMessageInfo *mi, gint id, time_t val);
void (*info_set_references)(CamelMessageInfo *mi, CamelSummaryReferences *);
#endif
- gboolean (*info_set_user_flag)(CamelMessageInfo *mi, const char *id, gboolean state);
- gboolean (*info_set_user_tag)(CamelMessageInfo *mi, const char *id, const char *val);
+ gboolean (*info_set_user_flag)(CamelMessageInfo *mi, const gchar *id, gboolean state);
+ gboolean (*info_set_user_tag)(CamelMessageInfo *mi, const gchar *id, const gchar *val);
gboolean (*info_set_flags)(CamelMessageInfo *mi, guint32 mask, guint32 set);
};
@@ -320,35 +320,35 @@ struct _CamelFolderMetaSummary {
guint32 minor; /* Minor version of meta-summary */
guint32 uid_len; /* Length of UID (for implementors to use) */
gboolean msg_expunged; /* Whether any message is expunged or not */
- char *path; /* Path to meta-summary-file */
+ gchar *path; /* Path to meta-summary-file */
};
CamelType camel_folder_summary_get_type (void);
CamelFolderSummary *camel_folder_summary_new (struct _CamelFolder *folder);
/* Deprecated */
-void camel_folder_summary_set_filename(CamelFolderSummary *summary, const char *filename);
+void camel_folder_summary_set_filename(CamelFolderSummary *summary, const gchar *filename);
void camel_folder_summary_set_index(CamelFolderSummary *summary, CamelIndex *index);
void camel_folder_summary_set_build_content(CamelFolderSummary *summary, gboolean state);
guint32 camel_folder_summary_next_uid (CamelFolderSummary *summary);
-char *camel_folder_summary_next_uid_string (CamelFolderSummary *summary);
+gchar *camel_folder_summary_next_uid_string (CamelFolderSummary *summary);
void camel_folder_summary_set_uid (CamelFolderSummary *summary, guint32 uid);
/* load/save the summary in its entirety */
-int camel_folder_summary_load(CamelFolderSummary *summary);
-int camel_folder_summary_save(CamelFolderSummary *summary);
+gint camel_folder_summary_load(CamelFolderSummary *summary);
+gint camel_folder_summary_save(CamelFolderSummary *summary);
/* load/save the full summary from/to the db */
-int camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex);
-int camel_folder_summary_load_from_db (CamelFolderSummary *s, CamelException *ex);
+gint camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex);
+gint camel_folder_summary_load_from_db (CamelFolderSummary *s, CamelException *ex);
/* only load the header */
-int camel_folder_summary_header_load(CamelFolderSummary *summary);
-int camel_folder_summary_header_load_from_db (CamelFolderSummary *s, CamelStore *store, const char *folder_name, CamelException *ex);
-int camel_folder_summary_header_save_to_db (CamelFolderSummary *s, CamelException *ex);
+gint camel_folder_summary_header_load(CamelFolderSummary *summary);
+gint camel_folder_summary_header_load_from_db (CamelFolderSummary *s, CamelStore *store, const gchar *folder_name, CamelException *ex);
+gint camel_folder_summary_header_save_to_db (CamelFolderSummary *s, CamelException *ex);
/* set the dirty bit on the summary */
void camel_folder_summary_touch(CamelFolderSummary *summary);
@@ -357,21 +357,21 @@ void camel_folder_summary_touch(CamelFolderSummary *summary);
void camel_folder_summary_add (CamelFolderSummary *summary, CamelMessageInfo *info);
/* Peek from mem only */
-CamelMessageInfo * camel_folder_summary_peek_info (CamelFolderSummary *s, const char *uid);
+CamelMessageInfo * camel_folder_summary_peek_info (CamelFolderSummary *s, const gchar *uid);
/* Get only the uids of dirty/changed things to sync to server/db */
GPtrArray * camel_folder_summary_get_changed (CamelFolderSummary *s);
/* Gets the size of loaded mi's */
-int camel_folder_summary_cache_size (CamelFolderSummary *s);
+gint camel_folder_summary_cache_size (CamelFolderSummary *s);
/* reload the summary at any required point if required */
-int camel_folder_summary_reload_from_db (CamelFolderSummary *s, CamelException *ex);
+gint camel_folder_summary_reload_from_db (CamelFolderSummary *s, CamelException *ex);
/* ensures all CamelMessagesInfos loaded in memory */
-void camel_folder_summary_ensure_infos_loaded (CamelFolderSummary *s, int at_least, CamelException *ex);
+void camel_folder_summary_ensure_infos_loaded (CamelFolderSummary *s, gint at_least, CamelException *ex);
/* insert mi to summary */
void camel_folder_summary_insert (CamelFolderSummary *s, CamelMessageInfo *info, gboolean load);
-void camel_folder_summary_remove_index_fast (CamelFolderSummary *s, int index);
-void camel_folder_summary_remove_uid_fast (CamelFolderSummary *s, const char *uid);
+void camel_folder_summary_remove_index_fast (CamelFolderSummary *s, gint index);
+void camel_folder_summary_remove_uid_fast (CamelFolderSummary *s, const gchar *uid);
/* build/add raw summary items */
CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *summary, struct _camel_header_raw *headers);
@@ -388,9 +388,9 @@ void camel_folder_summary_content_info_free(CamelFolderSummary *summary, CamelMe
/* removes a summary item, doesn't fix content offsets */
void camel_folder_summary_remove(CamelFolderSummary *summary, CamelMessageInfo *info);
-void camel_folder_summary_remove_uid(CamelFolderSummary *summary, const char *uid);
-void camel_folder_summary_remove_index(CamelFolderSummary *summary, int index);
-void camel_folder_summary_remove_range(CamelFolderSummary *summary, int start, int end);
+void camel_folder_summary_remove_uid(CamelFolderSummary *summary, const gchar *uid);
+void camel_folder_summary_remove_index(CamelFolderSummary *summary, gint index);
+void camel_folder_summary_remove_range(CamelFolderSummary *summary, gint start, gint end);
/* remove all items */
void camel_folder_summary_clear(CamelFolderSummary *summary);
@@ -398,59 +398,59 @@ void camel_folder_summary_clear_db (CamelFolderSummary *s);
/* lookup functions */
guint camel_folder_summary_count(CamelFolderSummary *summary);
-CamelMessageInfo *camel_folder_summary_index(CamelFolderSummary *summary, int index);
-CamelMessageInfo *camel_folder_summary_uid(CamelFolderSummary *summary, const char *uid);
-char * camel_folder_summary_uid_from_index (CamelFolderSummary *s, int i);
-gboolean camel_folder_summary_check_uid (CamelFolderSummary *s, const char *uid);
+CamelMessageInfo *camel_folder_summary_index(CamelFolderSummary *summary, gint index);
+CamelMessageInfo *camel_folder_summary_uid(CamelFolderSummary *summary, const gchar *uid);
+gchar * camel_folder_summary_uid_from_index (CamelFolderSummary *s, gint i);
+gboolean camel_folder_summary_check_uid (CamelFolderSummary *s, const gchar *uid);
GPtrArray *camel_folder_summary_array(CamelFolderSummary *summary);
GHashTable *camel_folder_summary_get_hashtable(CamelFolderSummary *s);
void camel_folder_summary_free_hashtable (GHashTable *ht);
GHashTable *camel_folder_summary_get_flag_cache (CamelFolderSummary *summary);
-void camel_folder_summary_update_flag_cache (CamelFolderSummary *s, const char *uid, guint32 flag);
+void camel_folder_summary_update_flag_cache (CamelFolderSummary *s, const gchar *uid, guint32 flag);
/* basically like strings, but certain keywords can be compressed and de-cased */
-int camel_folder_summary_encode_token(FILE *out, const char *str);
-int camel_folder_summary_decode_token(FILE *in, char **str);
+gint camel_folder_summary_encode_token(FILE *out, const gchar *str);
+gint camel_folder_summary_decode_token(FILE *in, gchar **str);
/* message flag operations */
-gboolean camel_flag_get(CamelFlag **list, const char *name);
-gboolean camel_flag_set(CamelFlag **list, const char *name, gboolean value);
+gboolean camel_flag_get(CamelFlag **list, const gchar *name);
+gboolean camel_flag_set(CamelFlag **list, const gchar *name, gboolean value);
gboolean camel_flag_list_copy(CamelFlag **to, CamelFlag **from);
int camel_flag_list_size(CamelFlag **list);
void camel_flag_list_free(CamelFlag **list);
-guint32 camel_system_flag (const char *name);
-gboolean camel_system_flag_get (guint32 flags, const char *name);
+guint32 camel_system_flag (const gchar *name);
+gboolean camel_system_flag_get (guint32 flags, const gchar *name);
/* message tag operations */
-const char *camel_tag_get(CamelTag **list, const char *name);
-gboolean camel_tag_set(CamelTag **list, const char *name, const char *value);
+const char *camel_tag_get(CamelTag **list, const gchar *name);
+gboolean camel_tag_set(CamelTag **list, const gchar *name, const gchar *value);
gboolean camel_tag_list_copy(CamelTag **to, CamelTag **from);
int camel_tag_list_size(CamelTag **list);
void camel_tag_list_free(CamelTag **list);
/* Summary may be null */
/* Use anonymous pointers to avoid tons of cast crap */
-void *camel_message_info_new(CamelFolderSummary *summary);
-void camel_message_info_ref(void *info);
+gpointer camel_message_info_new(CamelFolderSummary *summary);
+void camel_message_info_ref(gpointer info);
CamelMessageInfo *camel_message_info_new_from_header(CamelFolderSummary *summary, struct _camel_header_raw *header);
-void camel_message_info_free(void *info);
-void *camel_message_info_clone(const void *info);
+void camel_message_info_free(gpointer info);
+gpointer camel_message_info_clone(gconstpointer info);
/* accessors */
-const void *camel_message_info_ptr(const CamelMessageInfo *mi, int id);
-guint32 camel_message_info_uint32(const CamelMessageInfo *mi, int id);
-time_t camel_message_info_time(const CamelMessageInfo *mi, int id);
+gconstpointer camel_message_info_ptr(const CamelMessageInfo *mi, gint id);
+guint32 camel_message_info_uint32(const CamelMessageInfo *mi, gint id);
+time_t camel_message_info_time(const CamelMessageInfo *mi, gint id);
-#define camel_message_info_uid(mi) ((const char *)((const CamelMessageInfo *)mi)->uid)
+#define camel_message_info_uid(mi) ((const gchar *)((const CamelMessageInfo *)mi)->uid)
-#define camel_message_info_subject(mi) ((const char *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_SUBJECT))
-#define camel_message_info_preview(mi) ((const char *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_PREVIEW))
-#define camel_message_info_from(mi) ((const char *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_FROM))
-#define camel_message_info_to(mi) ((const char *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_TO))
-#define camel_message_info_cc(mi) ((const char *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_CC))
-#define camel_message_info_mlist(mi) ((const char *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_MLIST))
+#define camel_message_info_subject(mi) ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_SUBJECT))
+#define camel_message_info_preview(mi) ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_PREVIEW))
+#define camel_message_info_from(mi) ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_FROM))
+#define camel_message_info_to(mi) ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_TO))
+#define camel_message_info_cc(mi) ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_CC))
+#define camel_message_info_mlist(mi) ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_MLIST))
#define camel_message_info_flags(mi) camel_message_info_uint32((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_FLAGS)
#define camel_message_info_size(mi) camel_message_info_uint32((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_SIZE)
@@ -465,24 +465,24 @@ time_t camel_message_info_time(const CamelMessageInfo *mi, int id);
#define camel_message_info_headers(mi) ((const struct _camel_header_param *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_HEADERS))
-gboolean camel_message_info_user_flag(const CamelMessageInfo *mi, const char *id);
-const char *camel_message_info_user_tag(const CamelMessageInfo *mi, const char *id);
+gboolean camel_message_info_user_flag(const CamelMessageInfo *mi, const gchar *id);
+const gchar *camel_message_info_user_tag(const CamelMessageInfo *mi, const gchar *id);
gboolean camel_message_info_set_flags(CamelMessageInfo *mi, guint32 flags, guint32 set);
-gboolean camel_message_info_set_user_flag(CamelMessageInfo *mi, const char *id, gboolean state);
-gboolean camel_message_info_set_user_tag(CamelMessageInfo *mi, const char *id, const char *val);
+gboolean camel_message_info_set_user_flag(CamelMessageInfo *mi, const gchar *id, gboolean state);
+gboolean camel_message_info_set_user_tag(CamelMessageInfo *mi, const gchar *id, const gchar *val);
void camel_folder_summary_set_need_preview (CamelFolderSummary *summary, gboolean preview);
void camel_folder_summary_add_preview (CamelFolderSummary *s, CamelMessageInfo *info);
gboolean camel_folder_summary_get_need_preview (CamelFolderSummary *summary);
/* debugging functions */
-void camel_content_info_dump (CamelMessageContentInfo *ci, int depth);
+void camel_content_info_dump (CamelMessageContentInfo *ci, gint depth);
void camel_message_info_dump (CamelMessageInfo *mi);
/* Migration code */
-int camel_folder_summary_migrate_infos(CamelFolderSummary *s);
+gint camel_folder_summary_migrate_infos(CamelFolderSummary *s);
G_END_DECLS
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c
index 4cc76db4b..6f6fd15bf 100644
--- a/camel/camel-folder-thread.c
+++ b/camel/camel-folder-thread.c
@@ -143,7 +143,7 @@ prune_empty(CamelFolderThread *thread, CamelFolderThreadNode **cp)
}
static void
-hashloop(void *key, void *value, void *data)
+hashloop(gpointer key, gpointer value, gpointer data)
{
CamelFolderThreadNode *c = value;
CamelFolderThreadNode *tail = data;
@@ -154,22 +154,22 @@ hashloop(void *key, void *value, void *data)
}
}
-static char *
+static gchar *
get_root_subject(CamelFolderThreadNode *c)
{
- char *s, *p;
+ gchar *s, *p;
CamelFolderThreadNode *scan;
s = NULL;
c->re = FALSE;
if (c->message)
- s = (char *)camel_message_info_subject(c->message);
+ s = (gchar *)camel_message_info_subject(c->message);
else {
/* one of the children will always have a message */
scan = c->child;
while (scan) {
if (scan->message) {
- s = (char *)camel_message_info_subject(scan->message);
+ s = (gchar *)camel_message_info_subject(scan->message);
break;
}
scan = scan->next;
@@ -225,7 +225,7 @@ remove_node(CamelFolderThreadNode **list, CamelFolderThreadNode *node, CamelFold
c = c->next;
}
- printf("ERROR: removing node %p failed\n", (void *) node);
+ printf("ERROR: removing node %p failed\n", (gpointer) node);
}
static void
@@ -319,10 +319,10 @@ struct _tree_info {
};
static int
-dump_tree_rec(struct _tree_info *info, CamelFolderThreadNode *c, int depth)
+dump_tree_rec(struct _tree_info *info, CamelFolderThreadNode *c, gint depth)
{
- char *p;
- int count=0;
+ gchar *p;
+ gint count=0;
p = alloca(depth*2+1);
memset(p, ' ', depth*2);
@@ -330,16 +330,16 @@ dump_tree_rec(struct _tree_info *info, CamelFolderThreadNode *c, int depth)
while (c) {
if (g_hash_table_lookup(info->visited, c)) {
- printf("WARNING: NODE REVISITED: %p\n", (void *) c);
+ printf("WARNING: NODE REVISITED: %p\n", (gpointer) c);
} else {
g_hash_table_insert(info->visited, c, c);
}
if (c->message) {
- printf("%s %p Subject: %s <%08x%08x>\n", p, (void *) c, camel_message_info_subject(c->message),
+ printf("%s %p Subject: %s <%08x%08x>\n", p, (gpointer) c, camel_message_info_subject(c->message),
camel_message_info_message_id(c->message)->id.part.hi, camel_message_info_message_id(c->message)->id.part.lo);
count += 1;
} else {
- printf("%s %p <empty>\n", p, (void *) c);
+ printf("%s %p <empty>\n", p, (gpointer) c);
}
if (c->child)
count += dump_tree_rec(info, c->child, depth+1);
@@ -348,10 +348,10 @@ dump_tree_rec(struct _tree_info *info, CamelFolderThreadNode *c, int depth)
return count;
}
-int
+gint
camel_folder_threaded_messages_dump(CamelFolderThreadNode *c)
{
- int count;
+ gint count;
struct _tree_info info;
info.visited = g_hash_table_new(g_direct_hash, g_direct_equal);
@@ -361,7 +361,7 @@ camel_folder_threaded_messages_dump(CamelFolderThreadNode *c)
}
static int
-sort_node(const void *a, const void *b)
+sort_node(gconstpointer a, gconstpointer b)
{
const CamelFolderThreadNode *a1 = ((CamelFolderThreadNode **)a)[0];
const CamelFolderThreadNode *b1 = ((CamelFolderThreadNode **)b)[0];
@@ -385,7 +385,7 @@ static void
sort_thread(CamelFolderThreadNode **cp)
{
CamelFolderThreadNode *c, *head, **carray;
- int size=0;
+ gint size=0;
c = *cp;
while (c) {
@@ -419,14 +419,14 @@ sort_thread(CamelFolderThreadNode **cp)
*cp = head;
}
-static guint id_hash(void *key)
+static guint id_hash(gpointer key)
{
CamelSummaryMessageID *id = (CamelSummaryMessageID *)key;
return id->id.part.lo;
}
-static gint id_equal(void *a, void *b)
+static gint id_equal(gpointer a, gpointer b)
{
return ((CamelSummaryMessageID *)a)->id.id == ((CamelSummaryMessageID *)b)->id.id;
}
@@ -436,7 +436,7 @@ static void
thread_summary(CamelFolderThread *thread, GPtrArray *summary)
{
GHashTable *id_table, *no_id_table;
- int i;
+ gint i;
CamelFolderThreadNode *c, *child, *head;
#ifdef TIMEIT
struct timeval start, end;
@@ -460,23 +460,23 @@ thread_summary(CamelFolderThread *thread, GPtrArray *summary)
into the right spot in the tree */
d(printf("doing: (duplicate message id)\n"));
c = e_memchunk_alloc0(thread->node_chunks);
- g_hash_table_insert(no_id_table, (void *)mi, c);
+ g_hash_table_insert(no_id_table, (gpointer)mi, c);
} else if (!c) {
d(printf("doing : %08x%08x (%s)\n", mid->id.part.hi, mid->id.part.lo, camel_message_info_subject(mi)));
c = e_memchunk_alloc0(thread->node_chunks);
- g_hash_table_insert(id_table, (void *)mid, c);
+ g_hash_table_insert(id_table, (gpointer)mid, c);
}
} else {
d(printf("doing : (no message id)\n"));
c = e_memchunk_alloc0(thread->node_chunks);
- g_hash_table_insert(no_id_table, (void *)mi, c);
+ g_hash_table_insert(no_id_table, (gpointer)mi, c);
}
c->message = mi;
c->order = i+1;
child = c;
if (references) {
- int j;
+ gint j;
d(printf("%s (%s) references:\n", G_STRLOC, G_STRFUNC); )
for (j=0;j<references->size;j++) {
@@ -488,7 +488,7 @@ thread_summary(CamelFolderThread *thread, GPtrArray *summary)
if (c == NULL) {
d(printf("%s (%s) not found\n", G_STRLOC, G_STRFUNC));
c = e_memchunk_alloc0(thread->node_chunks);
- g_hash_table_insert(id_table, (void *)&references->references[j], c);
+ g_hash_table_insert(id_table, (gpointer)&references->references[j], c);
}
if (c!=child)
container_parent_child(c, child);
@@ -601,7 +601,7 @@ camel_folder_thread_messages_new (CamelFolder *folder, GPtrArray *uids, gboolean
GHashTable *wanted = NULL;
GPtrArray *summary;
GPtrArray *fsummary;
- int i;
+ gint i;
thread = g_malloc(sizeof(*thread));
thread->refcount = 1;
@@ -625,7 +625,7 @@ camel_folder_thread_messages_new (CamelFolder *folder, GPtrArray *uids, gboolean
for (i = 0 ; i < fsummary->len ; i++) {
CamelMessageInfo *info ;
- char *uid = fsummary->pdata[i];
+ gchar *uid = fsummary->pdata[i];
if (wanted == NULL || g_hash_table_lookup(wanted, uid) != NULL) {
info = camel_folder_get_message_info (folder, uid);
@@ -650,11 +650,11 @@ static void
add_present_rec(CamelFolderThread *thread, GHashTable *have, GPtrArray *summary, CamelFolderThreadNode *node)
{
while (node) {
- const char *uid = camel_message_info_uid(node->message);
+ const gchar *uid = camel_message_info_uid(node->message);
- if (g_hash_table_lookup(have, (char *)uid)) {
- g_hash_table_remove(have, (char *)camel_message_info_uid(node->message));
- g_ptr_array_add(summary, (void *) node->message);
+ if (g_hash_table_lookup(have, (gchar *)uid)) {
+ g_hash_table_remove(have, (gchar *)camel_message_info_uid(node->message));
+ g_ptr_array_add(summary, (gpointer) node->message);
} else {
camel_folder_free_message_info(thread->folder, (CamelMessageInfo *)node->message);
}
@@ -668,7 +668,7 @@ add_present_rec(CamelFolderThread *thread, GHashTable *have, GPtrArray *summary,
void
camel_folder_thread_messages_apply(CamelFolderThread *thread, GPtrArray *uids)
{
- int i;
+ gint i;
GPtrArray *all;
GHashTable *table;
CamelMessageInfo *info;
@@ -717,7 +717,7 @@ camel_folder_thread_messages_unref(CamelFolderThread *thread)
}
if (thread->folder) {
- int i;
+ gint i;
for (i=0;i<thread->summary->len;i++)
camel_folder_free_message_info(thread->folder, thread->summary->pdata[i]);
@@ -770,7 +770,7 @@ build_summary_rec(GHashTable *have, GPtrArray *summary, CamelFolderThreadNode *n
{
while (node) {
if (node->message)
- g_hash_table_insert(have, (char *)camel_message_info_uid(node->message), node->message);
+ g_hash_table_insert(have, (gchar *)camel_message_info_uid(node->message), node->message);
g_ptr_array_add(summary, node);
if (node->child)
build_summary_rec(have, summary, node->child);
@@ -782,7 +782,7 @@ void
camel_folder_thread_messages_add(CamelFolderThread *thread, GPtrArray *summary)
{
GPtrArray *all;
- int i;
+ gint i;
GHashTable *table;
/* Instead of working out all the complex in's and out's of
@@ -822,7 +822,7 @@ remove_uid_node_rec(CamelFolderThread *thread, GHashTable *table, CamelFolderThr
remove_uid_node_rec(thread, table, &next->child, next);
/* do we have a node to remove? */
- if (next->message && g_hash_table_lookup(table, (char *)camel_message_info_uid(node->message))) {
+ if (next->message && g_hash_table_lookup(table, (gchar *)camel_message_info_uid(node->message))) {
child = next->child;
if (child) {
/*
@@ -872,7 +872,7 @@ void
camel_folder_thread_messages_remove(CamelFolderThread *thread, GPtrArray *uids)
{
GHashTable *table;
- int i;
+ gint i;
table = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<uids->len;i++)
diff --git a/camel/camel-folder-thread.h b/camel/camel-folder-thread.h
index 922a97468..1479648f5 100644
--- a/camel/camel-folder-thread.h
+++ b/camel/camel-folder-thread.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
typedef struct _CamelFolderThreadNode {
struct _CamelFolderThreadNode *next, *parent, *child;
const CamelMessageInfo *message;
- char *root_subject; /* cached root equivalent subject */
+ gchar *root_subject; /* cached root equivalent subject */
guint32 order:31;
guint32 re:1; /* re version of subject? */
} CamelFolderThreadNode;
@@ -61,7 +61,7 @@ void camel_folder_thread_messages_ref(CamelFolderThread *thread);
void camel_folder_thread_messages_unref(CamelFolderThread *thread);
/* debugging function only */
-int camel_folder_threaded_messages_dump(CamelFolderThreadNode *c);
+gint camel_folder_threaded_messages_dump(CamelFolderThreadNode *c);
G_END_DECLS
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 0699c9195..f1063394f 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -49,7 +49,7 @@
#define d(x)
#define w(x)
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
static CamelObjectClass *parent_class = NULL;
@@ -63,35 +63,35 @@ static void refresh_info (CamelFolder *folder, CamelException *ex);
static void folder_sync (CamelFolder *folder, gboolean expunge,
CamelException *ex);
-static const char *get_name (CamelFolder *folder);
-static const char *get_full_name (CamelFolder *folder);
+static const gchar *get_name (CamelFolder *folder);
+static const gchar *get_full_name (CamelFolder *folder);
static CamelStore *get_parent_store (CamelFolder *folder);
static guint32 get_permanent_flags(CamelFolder *folder);
-static guint32 get_message_flags(CamelFolder *folder, const char *uid);
-static gboolean set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
-static gboolean get_message_user_flag(CamelFolder *folder, const char *uid, const char *name);
-static void set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value);
-static const char *get_message_user_tag(CamelFolder *folder, const char *uid, const char *name);
-static void set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value);
+static guint32 get_message_flags(CamelFolder *folder, const gchar *uid);
+static gboolean set_message_flags(CamelFolder *folder, const gchar *uid, guint32 flags, guint32 set);
+static gboolean get_message_user_flag(CamelFolder *folder, const gchar *uid, const gchar *name);
+static void set_message_user_flag(CamelFolder *folder, const gchar *uid, const gchar *name, gboolean value);
+static const gchar *get_message_user_tag(CamelFolder *folder, const gchar *uid, const gchar *name);
+static void set_message_user_tag(CamelFolder *folder, const gchar *uid, const gchar *name, const gchar *value);
-static int get_message_count(CamelFolder *folder);
+static gint get_message_count(CamelFolder *folder);
static void expunge (CamelFolder *folder,
CamelException *ex);
-static int folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static void folder_free(CamelObject *o, guint32 tag, void *val);
+static gint folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static void folder_free(CamelObject *o, guint32 tag, gpointer val);
static void append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex);
static GPtrArray *get_uids (CamelFolder *folder);
static GPtrArray *get_uncached_uids (CamelFolder *, GPtrArray * uids, CamelException *);
static void free_uids (CamelFolder *folder,
GPtrArray *array);
-static gint cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2);
+static gint cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2);
static void sort_uids (CamelFolder *folder,
GPtrArray *uids);
static GPtrArray *get_summary (CamelFolder *folder);
@@ -100,21 +100,21 @@ static void free_summary (CamelFolder *folder,
static CamelMimeMessage *get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
-static CamelMessageInfo *get_message_info (CamelFolder *folder, const char *uid);
+static CamelMessageInfo *get_message_info (CamelFolder *folder, const gchar *uid);
static void free_message_info (CamelFolder *folder, CamelMessageInfo *info);
static void ref_message_info (CamelFolder *folder, CamelMessageInfo *info);
-static GPtrArray *search_by_expression (CamelFolder *folder, const char *exp, CamelException *ex);
-static guint32 count_by_expression (CamelFolder *folder, const char *exp, CamelException *ex);
+static GPtrArray *search_by_expression (CamelFolder *folder, const gchar *exp, CamelException *ex);
+static guint32 count_by_expression (CamelFolder *folder, const gchar *exp, CamelException *ex);
-static GPtrArray *search_by_uids (CamelFolder *folder, const char *exp, GPtrArray *uids, CamelException *ex);
+static GPtrArray *search_by_uids (CamelFolder *folder, const gchar *exp, GPtrArray *uids, CamelException *ex);
static void search_free (CamelFolder * folder, GPtrArray *result);
static void transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *dest,
GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex);
static void delete (CamelFolder *folder);
-static void folder_rename (CamelFolder *folder, const char *new);
+static void folder_rename (CamelFolder *folder, const gchar *new);
static void freeze (CamelFolder *folder);
static void thaw (CamelFolder *folder);
@@ -123,8 +123,8 @@ static gboolean is_frozen (CamelFolder *folder);
static gboolean folder_changed (CamelObject *object,
gpointer event_data);
-static char* get_filename (CamelFolder *folder,
- const char *uid,
+static gchar * get_filename (CamelFolder *folder,
+ const gchar *uid,
CamelException *ex);
static CamelFolderQuotaInfo *get_quota_info (CamelFolder *folder);
@@ -243,16 +243,16 @@ camel_folder_get_type (void)
return camel_folder_type;
}
-static char*
-get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar *
+get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
w(g_warning ("CamelFolder::get_filename not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
return g_strdup ("/dev/null");
}
-char *
-camel_folder_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+gchar *
+camel_folder_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
return CF_CLASS (folder)->get_filename (folder, uid, ex);
}
@@ -268,9 +268,9 @@ camel_folder_get_filename (CamelFolder *folder, const char *uid, CamelException
**/
void
camel_folder_construct (CamelFolder *folder, CamelStore *parent_store,
- const char *full_name, const char *name)
+ const gchar *full_name, const gchar *name)
{
- char *store_db_path;
+ gchar *store_db_path;
CamelService *service = (CamelService *) parent_store;
CamelException ex;
@@ -289,7 +289,7 @@ camel_folder_construct (CamelFolder *folder, CamelStore *parent_store,
store_db_path = g_build_filename (service->url->path, CAMEL_DB_FILE, NULL);
camel_exception_init(&ex);
if (strlen (store_db_path) < 2) {
- char *store_path = camel_session_get_storage_path ((CamelSession *)camel_service_get_session (service), service, &ex);
+ gchar *store_path = camel_session_get_storage_path ((CamelSession *)camel_service_get_session (service), service, &ex);
g_free (store_db_path);
store_db_path = g_build_filename (store_path, CAMEL_DB_FILE, NULL);
@@ -355,9 +355,9 @@ static int
folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
- int i;
+ gint i;
guint32 tag;
- int unread = -1, deleted = 0, junked = 0, junked_not_deleted = 0, visible = 0, count = -1;
+ gint unread = -1, deleted = 0, junked = 0, junked_not_deleted = 0, visible = 0, count = -1;
for (i = 0; i < args->argc; i++) {
CamelArgGet *arg = &args->argv[i];
@@ -463,7 +463,7 @@ folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
*arg->ca_int = count;
break;
case CAMEL_FOLDER_ARG_UID_ARRAY: {
-/* int j;
+/* gint j;
CamelMessageInfo *info;
GPtrArray *array;
@@ -497,14 +497,14 @@ folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
}
static void
-folder_free(CamelObject *o, guint32 tag, void *val)
+folder_free(CamelObject *o, guint32 tag, gpointer val)
{
CamelFolder *folder = (CamelFolder *)o;
switch (tag & CAMEL_ARG_TAG) {
case CAMEL_FOLDER_ARG_UID_ARRAY: {
GPtrArray *array = val;
- int i;
+ gint i;
for (i=0; i<array->len; i++)
g_free(array->pdata[i]);
@@ -521,7 +521,7 @@ folder_free(CamelObject *o, guint32 tag, void *val)
}
}
-static const char *
+static const gchar *
get_name (CamelFolder *folder)
{
return folder->name;
@@ -537,7 +537,7 @@ get_name (CamelFolder *folder)
*
* Returns: the short name of the folder
**/
-const char *
+const gchar *
camel_folder_get_name (CamelFolder *folder)
{
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
@@ -546,7 +546,7 @@ camel_folder_get_name (CamelFolder *folder)
}
-static const char *
+static const gchar *
get_full_name (CamelFolder *folder)
{
return folder->full_name;
@@ -561,7 +561,7 @@ get_full_name (CamelFolder *folder)
*
* Returns: the full name of the folder
**/
-const char *
+const gchar *
camel_folder_get_full_name (CamelFolder *folder)
{
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
@@ -635,10 +635,10 @@ get_message_count (CamelFolder *folder)
*
* Returns: the number of messages in the folder, or %-1 if unknown
**/
-int
+gint
camel_folder_get_message_count (CamelFolder *folder)
{
- int ret;
+ gint ret;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), -1);
@@ -657,10 +657,10 @@ camel_folder_get_message_count (CamelFolder *folder)
* Returns: the number of unread messages in the folder, or %-1 if
* unknown
**/
-int
+gint
camel_folder_get_unread_message_count (CamelFolder *folder)
{
- int count = -1;
+ gint count = -1;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), -1);
@@ -677,10 +677,10 @@ camel_folder_get_unread_message_count (CamelFolder *folder)
* Returns: the number of deleted messages in the folder, or %-1 if
* unknown
**/
-int
+gint
camel_folder_get_deleted_message_count (CamelFolder *folder)
{
- int count = -1;
+ gint count = -1;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), -1);
@@ -691,7 +691,7 @@ camel_folder_get_deleted_message_count (CamelFolder *folder)
static void
append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
@@ -720,7 +720,7 @@ append_message (CamelFolder *folder, CamelMimeMessage *message,
**/
void
camel_folder_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
g_return_if_fail (CAMEL_IS_FOLDER (folder));
@@ -755,7 +755,7 @@ camel_folder_get_permanent_flags (CamelFolder *folder)
}
static guint32
-get_message_flags(CamelFolder *folder, const char *uid)
+get_message_flags(CamelFolder *folder, const gchar *uid)
{
CamelMessageInfo *info;
guint32 flags;
@@ -784,7 +784,7 @@ get_message_flags(CamelFolder *folder, const char *uid)
* message.
**/
guint32
-camel_folder_get_message_flags (CamelFolder *folder, const char *uid)
+camel_folder_get_message_flags (CamelFolder *folder, const gchar *uid)
{
guint32 ret;
@@ -796,10 +796,10 @@ camel_folder_get_message_flags (CamelFolder *folder, const char *uid)
}
static gboolean
-set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
+set_message_flags(CamelFolder *folder, const gchar *uid, guint32 flags, guint32 set)
{
CamelMessageInfo *info;
- int res;
+ gint res;
g_return_val_if_fail(folder->summary != NULL, FALSE);
@@ -834,7 +834,7 @@ set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 s
* Returns: %TRUE if the flags were changed or %FALSE otherwise
**/
gboolean
-camel_folder_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
+camel_folder_set_message_flags(CamelFolder *folder, const gchar *uid, guint32 flags, guint32 set)
{
g_return_val_if_fail(CAMEL_IS_FOLDER(folder), FALSE);
@@ -847,7 +847,7 @@ camel_folder_set_message_flags(CamelFolder *folder, const char *uid, guint32 fla
}
static gboolean
-get_message_user_flag(CamelFolder *folder, const char *uid, const char *name)
+get_message_user_flag(CamelFolder *folder, const gchar *uid, const gchar *name)
{
CamelMessageInfo *info;
gboolean ret;
@@ -878,8 +878,8 @@ get_message_user_flag(CamelFolder *folder, const char *uid, const char *name)
* %FALSE otherwise
**/
gboolean
-camel_folder_get_message_user_flag (CamelFolder *folder, const char *uid,
- const char *name)
+camel_folder_get_message_user_flag (CamelFolder *folder, const gchar *uid,
+ const gchar *name)
{
gboolean ret;
@@ -891,7 +891,7 @@ camel_folder_get_message_user_flag (CamelFolder *folder, const char *uid,
}
static void
-set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value)
+set_message_user_flag(CamelFolder *folder, const gchar *uid, const gchar *name, gboolean value)
{
CamelMessageInfo *info;
@@ -921,19 +921,19 @@ set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gb
* folder or store is closed. See #camel_folder_get_permanent_flags)
**/
void
-camel_folder_set_message_user_flag (CamelFolder *folder, const char *uid,
- const char *name, gboolean value)
+camel_folder_set_message_user_flag (CamelFolder *folder, const gchar *uid,
+ const gchar *name, gboolean value)
{
g_return_if_fail (CAMEL_IS_FOLDER (folder));
CF_CLASS (folder)->set_message_user_flag (folder, uid, name, value);
}
-static const char *
-get_message_user_tag(CamelFolder *folder, const char *uid, const char *name)
+static const gchar *
+get_message_user_tag(CamelFolder *folder, const gchar *uid, const gchar *name)
{
CamelMessageInfo *info;
- const char *ret;
+ const gchar *ret;
g_return_val_if_fail(folder->summary != NULL, NULL);
@@ -959,10 +959,10 @@ get_message_user_tag(CamelFolder *folder, const char *uid, const char *name)
*
* Returns: the value of the user tag
**/
-const char *
-camel_folder_get_message_user_tag (CamelFolder *folder, const char *uid, const char *name)
+const gchar *
+camel_folder_get_message_user_tag (CamelFolder *folder, const gchar *uid, const gchar *name)
{
- const char *ret;
+ const gchar *ret;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
@@ -973,7 +973,7 @@ camel_folder_get_message_user_tag (CamelFolder *folder, const char *uid, const
}
static void
-set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value)
+set_message_user_tag(CamelFolder *folder, const gchar *uid, const gchar *name, const gchar *value)
{
CamelMessageInfo *info;
@@ -1003,7 +1003,7 @@ set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, con
* folder or store is closed. See #camel_folder_get_permanent_flags)
**/
void
-camel_folder_set_message_user_tag (CamelFolder *folder, const char *uid, const char *name, const char *value)
+camel_folder_set_message_user_tag (CamelFolder *folder, const gchar *uid, const gchar *name, const gchar *value)
{
g_return_if_fail (CAMEL_IS_FOLDER (folder));
@@ -1011,7 +1011,7 @@ camel_folder_set_message_user_tag (CamelFolder *folder, const char *uid, const c
}
static CamelMessageInfo *
-get_message_info (CamelFolder *folder, const char *uid)
+get_message_info (CamelFolder *folder, const gchar *uid)
{
g_return_val_if_fail(folder->summary != NULL, NULL);
@@ -1031,7 +1031,7 @@ get_message_info (CamelFolder *folder, const char *uid)
* if the uid does not exist
**/
CamelMessageInfo *
-camel_folder_get_message_info (CamelFolder *folder, const char *uid)
+camel_folder_get_message_info (CamelFolder *folder, const gchar *uid)
{
CamelMessageInfo *ret;
@@ -1119,7 +1119,7 @@ camel_folder_has_summary_capability (CamelFolder *folder)
/* UIDs stuff */
static CamelMimeMessage *
-get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
w(g_warning ("CamelFolder::get_message not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
@@ -1139,7 +1139,7 @@ get_message (CamelFolder *folder, const char *uid, CamelException *ex)
* Returns: a #CamelMimeMessage corresponding to @uid
**/
CamelMimeMessage *
-camel_folder_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+camel_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelMimeMessage *ret;
@@ -1172,7 +1172,7 @@ camel_folder_get_message (CamelFolder *folder, const char *uid, CamelException *
* Returns: void.
**/
void
-camel_folder_sync_message (CamelFolder *folder, const char *uid, CamelException *ex)
+camel_folder_sync_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
g_return_if_fail (CAMEL_IS_FOLDER (folder));
CAMEL_FOLDER_REC_LOCK(folder, lock);
@@ -1225,7 +1225,7 @@ camel_folder_get_uids (CamelFolder *folder)
static void
free_uids (CamelFolder *folder, GPtrArray *array)
{
- int i;
+ gint i;
for (i=0; i<array->len; i++)
camel_pstring_free(array->pdata[i]);
@@ -1256,13 +1256,13 @@ static GPtrArray *
get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelException *ex)
{
GPtrArray *result;
- int i;
+ gint i;
result = g_ptr_array_new();
g_ptr_array_set_size(result, uids->len);
for (i = 0; i < uids->len; i++)
- result->pdata[i] = (char *)camel_pstring_strdup(uids->pdata[i]);
+ result->pdata[i] = (gchar *)camel_pstring_strdup(uids->pdata[i]);
return result;
}
@@ -1284,7 +1284,7 @@ camel_folder_get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelExce
}
static gint
-cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2)
+cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
{
g_return_val_if_fail (uid1 != NULL, 0);
g_return_val_if_fail (uid2 != NULL, 0);
@@ -1304,7 +1304,7 @@ cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2)
* thus if provider uses different uid values, then it should subclass this function.
**/
gint
-camel_folder_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2)
+camel_folder_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
{
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0);
g_return_val_if_fail (uid1 != NULL, 0);
@@ -1316,8 +1316,8 @@ camel_folder_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2)
static gint
cmp_array_uids (gconstpointer a, gconstpointer b, gpointer user_data)
{
- const char *uid1 = *(const char **) a;
- const char *uid2 = *(const char **) b;
+ const gchar *uid1 = *(const gchar **) a;
+ const gchar *uid2 = *(const gchar **) b;
CamelFolder *folder = user_data;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0);
@@ -1328,7 +1328,7 @@ cmp_array_uids (gconstpointer a, gconstpointer b, gpointer user_data)
static void
sort_uids (CamelFolder *folder, GPtrArray *uids)
{
- g_qsort_with_data (uids->pdata, uids->len, sizeof (void *), cmp_array_uids, folder);
+ g_qsort_with_data (uids->pdata, uids->len, sizeof (gpointer), cmp_array_uids, folder);
}
@@ -1418,7 +1418,7 @@ camel_folder_has_search_capability (CamelFolder *folder)
}
static GPtrArray *
-search_by_expression (CamelFolder *folder, const char *expression,
+search_by_expression (CamelFolder *folder, const gchar *expression,
CamelException *ex)
{
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
@@ -1444,7 +1444,7 @@ search_by_expression (CamelFolder *folder, const char *expression,
* free the list and each of the elements when it is done.
**/
GPtrArray *
-camel_folder_search_by_expression (CamelFolder *folder, const char *expression,
+camel_folder_search_by_expression (CamelFolder *folder, const gchar *expression,
CamelException *ex)
{
GPtrArray *ret;
@@ -1460,7 +1460,7 @@ camel_folder_search_by_expression (CamelFolder *folder, const char *expression,
}
static guint32
-count_by_expression (CamelFolder *folder, const char *expression,
+count_by_expression (CamelFolder *folder, const gchar *expression,
CamelException *ex)
{
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
@@ -1485,7 +1485,7 @@ count_by_expression (CamelFolder *folder, const char *expression,
* Returns: an interger
**/
guint32
-camel_folder_count_by_expression (CamelFolder *folder, const char *expression,
+camel_folder_count_by_expression (CamelFolder *folder, const gchar *expression,
CamelException *ex)
{
guint32 ret;
@@ -1501,7 +1501,7 @@ camel_folder_count_by_expression (CamelFolder *folder, const char *expression,
}
static GPtrArray *
-search_by_uids(CamelFolder *folder, const char *exp, GPtrArray *uids, CamelException *ex)
+search_by_uids(CamelFolder *folder, const gchar *exp, GPtrArray *uids, CamelException *ex)
{
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
_("Unsupported operation: search by UIDs: for %s"),
@@ -1527,7 +1527,7 @@ search_by_uids(CamelFolder *folder, const char *exp, GPtrArray *uids, CamelExcep
* free the list and each of the elements when it is done.
**/
GPtrArray *
-camel_folder_search_by_uids(CamelFolder *folder, const char *expr, GPtrArray *uids, CamelException *ex)
+camel_folder_search_by_uids(CamelFolder *folder, const gchar *expr, GPtrArray *uids, CamelException *ex)
{
GPtrArray *ret;
@@ -1544,7 +1544,7 @@ camel_folder_search_by_uids(CamelFolder *folder, const char *expr, GPtrArray *ui
static void
search_free (CamelFolder *folder, GPtrArray *result)
{
- int i;
+ gint i;
for (i = 0; i < result->len; i++)
camel_pstring_free (g_ptr_array_index (result, i));
@@ -1571,8 +1571,8 @@ camel_folder_search_free (CamelFolder *folder, GPtrArray *result)
static void
-transfer_message_to (CamelFolder *source, const char *uid, CamelFolder *dest,
- char **transferred_uid, gboolean delete_original,
+transfer_message_to (CamelFolder *source, const gchar *uid, CamelFolder *dest,
+ gchar **transferred_uid, gboolean delete_original,
CamelException *ex)
{
CamelMimeMessage *msg;
@@ -1608,8 +1608,8 @@ static void
transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *dest, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex)
{
CamelException local;
- char **ret_uid = NULL;
- int i;
+ gchar **ret_uid = NULL;
+ gint i;
if (transferred_uids) {
*transferred_uids = g_ptr_array_new ();
@@ -1629,7 +1629,7 @@ transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *dest, G
}
for (i = 0; i < uids->len && !camel_exception_is_set (ex); i++) {
if (transferred_uids)
- ret_uid = (char **)&((*transferred_uids)->pdata[i]);
+ ret_uid = (gchar **)&((*transferred_uids)->pdata[i]);
transfer_message_to (source, uids->pdata[i], dest, ret_uid, delete_originals, ex);
camel_operation_progress(NULL, i * 100 / uids->len);
}
@@ -1722,9 +1722,9 @@ camel_folder_delete (CamelFolder *folder)
}
static void
-folder_rename (CamelFolder *folder, const char *new)
+folder_rename (CamelFolder *folder, const gchar *new)
{
- char *tmp;
+ gchar *tmp;
d(printf("CamelFolder:rename('%s')\n", new));
@@ -1747,9 +1747,9 @@ folder_rename (CamelFolder *folder, const char *new)
* is performed on the folder.
**/
void
-camel_folder_rename(CamelFolder *folder, const char *new)
+camel_folder_rename(CamelFolder *folder, const gchar *new)
{
- char *old;
+ gchar *old;
old = g_strdup(folder->full_name);
@@ -1884,7 +1884,7 @@ camel_folder_get_quota_info (CamelFolder *folder)
* initialized values based on the parameters, with next member set to NULL.
**/
CamelFolderQuotaInfo *
-camel_folder_quota_info_new (const char *name, guint64 used, guint64 total)
+camel_folder_quota_info_new (const gchar *name, guint64 used, guint64 total)
{
CamelFolderQuotaInfo *info;
@@ -1959,9 +1959,9 @@ filter_filter(CamelSession *session, CamelSessionThreadMsg *tmsg)
{
struct _folder_filter_msg *m = (struct _folder_filter_msg *) tmsg;
CamelMessageInfo *info;
- int i, status = 0;
+ gint i, status = 0;
CamelURL *uri;
- char *source_url;
+ gchar *source_url;
CamelException ex;
CamelJunkPlugin *csp = ((CamelService *)m->folder->parent_store)->session->junk_plugin;
@@ -1970,7 +1970,7 @@ filter_filter(CamelSession *session, CamelSessionThreadMsg *tmsg)
for (i = 0; i < m->junk->len; i ++) {
CamelMimeMessage *msg = camel_folder_get_message(m->folder, m->junk->pdata[i], NULL);
- int pc = 100 * i / m->junk->len;
+ gint pc = 100 * i / m->junk->len;
camel_operation_progress(NULL, pc);
@@ -1986,7 +1986,7 @@ filter_filter(CamelSession *session, CamelSessionThreadMsg *tmsg)
camel_operation_start (NULL, _("Learning non-junk"));
for (i = 0; i < m->notjunk->len; i ++) {
CamelMimeMessage *msg = camel_folder_get_message(m->folder, m->notjunk->pdata[i], NULL);
- int pc = 100 * i / m->notjunk->len;
+ gint pc = 100 * i / m->notjunk->len;
camel_operation_progress(NULL, pc);
@@ -2008,7 +2008,7 @@ filter_filter(CamelSession *session, CamelSessionThreadMsg *tmsg)
uri = camel_url_new(source_url, NULL);
g_free(source_url);
if (m->folder->full_name && m->folder->full_name[0] != '/') {
- char *tmp = alloca(strlen(m->folder->full_name)+2);
+ gchar *tmp = alloca(strlen(m->folder->full_name)+2);
sprintf(tmp, "/%s", m->folder->full_name);
camel_url_set_path(uri, tmp);
@@ -2018,8 +2018,8 @@ filter_filter(CamelSession *session, CamelSessionThreadMsg *tmsg)
camel_url_free(uri);
for (i=0;status == 0 && i<m->recents->len;i++) {
- char *uid = m->recents->pdata[i];
- int pc = 100 * i / m->recents->len;
+ gchar *uid = m->recents->pdata[i];
+ gint pc = 100 * i / m->recents->len;
camel_operation_progress(NULL, pc);
@@ -2089,7 +2089,7 @@ folder_changed (CamelObject *obj, gpointer event_data)
GPtrArray *junk = NULL;
GPtrArray *notjunk = NULL;
GPtrArray *recents = NULL;
- int i;
+ gint i;
d(printf ("folder_changed(%p:'%s', %p), frozen=%d\n", obj, folder->full_name, event_data, folder->priv->frozen));
d(printf(" added %d removed %d changed %d recent %d filter %d\n",
@@ -2220,7 +2220,7 @@ camel_folder_free_shallow (CamelFolder *folder, GPtrArray *array)
void
camel_folder_free_deep (CamelFolder *folder, GPtrArray *array)
{
- int i;
+ gint i;
for (i = 0; i < array->len; i++)
g_free (array->pdata[i]);
@@ -2266,7 +2266,7 @@ camel_folder_change_info_new(void)
* Add a source uid for generating a changeset.
**/
void
-camel_folder_change_info_add_source(CamelFolderChangeInfo *info, const char *uid)
+camel_folder_change_info_add_source(CamelFolderChangeInfo *info, const gchar *uid)
{
struct _CamelFolderChangeInfoPrivate *p;
@@ -2293,7 +2293,7 @@ void
camel_folder_change_info_add_source_list(CamelFolderChangeInfo *info, const GPtrArray *list)
{
struct _CamelFolderChangeInfoPrivate *p;
- int i;
+ gint i;
g_assert(info != NULL);
g_assert(list != NULL);
@@ -2304,7 +2304,7 @@ camel_folder_change_info_add_source_list(CamelFolderChangeInfo *info, const GPtr
p->uid_source = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<list->len;i++) {
- char *uid = list->pdata[i];
+ gchar *uid = list->pdata[i];
if (g_hash_table_lookup(p->uid_source, uid) == NULL)
g_hash_table_insert(p->uid_source, e_mempool_strdup(p->uid_pool, uid), GINT_TO_POINTER (1));
@@ -2320,11 +2320,11 @@ camel_folder_change_info_add_source_list(CamelFolderChangeInfo *info, const GPtr
* Add a uid from the updated list, used to generate a changeset diff.
**/
void
-camel_folder_change_info_add_update(CamelFolderChangeInfo *info, const char *uid)
+camel_folder_change_info_add_update(CamelFolderChangeInfo *info, const gchar *uid)
{
struct _CamelFolderChangeInfoPrivate *p;
- char *key;
- int value;
+ gchar *key;
+ gint value;
g_assert(info != NULL);
@@ -2353,7 +2353,7 @@ camel_folder_change_info_add_update(CamelFolderChangeInfo *info, const char *uid
void
camel_folder_change_info_add_update_list(CamelFolderChangeInfo *info, const GPtrArray *list)
{
- int i;
+ gint i;
g_assert(info != NULL);
g_assert(list != NULL);
@@ -2363,11 +2363,11 @@ camel_folder_change_info_add_update_list(CamelFolderChangeInfo *info, const GPtr
}
static void
-change_info_remove(char *key, void *value, CamelFolderChangeInfo *info)
+change_info_remove(gchar *key, gpointer value, CamelFolderChangeInfo *info)
{
struct _CamelFolderChangeInfoPrivate *p = info->priv;
GPtrArray *olduids;
- char *olduid;
+ gchar *olduid;
if (g_hash_table_lookup_extended(p->uid_stored, key, (gpointer) &olduid, (gpointer) &olduids)) {
/* if it was added/changed them removed, then remove it */
@@ -2409,41 +2409,41 @@ camel_folder_change_info_build_diff(CamelFolderChangeInfo *info)
}
static void
-change_info_recent_uid(CamelFolderChangeInfo *info, const char *uid)
+change_info_recent_uid(CamelFolderChangeInfo *info, const gchar *uid)
{
struct _CamelFolderChangeInfoPrivate *p;
GPtrArray *olduids;
- char *olduid;
+ gchar *olduid;
p = info->priv;
/* always add to recent, but dont let anyone else know */
- if (!g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
+ if (!g_hash_table_lookup_extended(p->uid_stored, uid, (gpointer *)&olduid, (gpointer *)&olduids)) {
olduid = e_mempool_strdup(p->uid_pool, uid);
}
g_ptr_array_add(info->uid_recent, olduid);
}
static void
-change_info_filter_uid(CamelFolderChangeInfo *info, const char *uid)
+change_info_filter_uid(CamelFolderChangeInfo *info, const gchar *uid)
{
struct _CamelFolderChangeInfoPrivate *p;
GPtrArray *olduids;
- char *olduid;
+ gchar *olduid;
p = info->priv;
/* always add to filter, but dont let anyone else know */
- if (!g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
+ if (!g_hash_table_lookup_extended(p->uid_stored, uid, (gpointer *)&olduid, (gpointer *)&olduids)) {
olduid = e_mempool_strdup(p->uid_pool, uid);
}
g_ptr_array_add(p->uid_filter, olduid);
}
static void
-change_info_cat(CamelFolderChangeInfo *info, GPtrArray *source, void (*add)(CamelFolderChangeInfo *info, const char *uid))
+change_info_cat(CamelFolderChangeInfo *info, GPtrArray *source, void (*add)(CamelFolderChangeInfo *info, const gchar *uid))
{
- int i;
+ gint i;
for (i=0;i<source->len;i++)
add(info, source->pdata[i]);
@@ -2479,11 +2479,11 @@ camel_folder_change_info_cat(CamelFolderChangeInfo *info, CamelFolderChangeInfo
* Add a new uid to the changeinfo.
**/
void
-camel_folder_change_info_add_uid(CamelFolderChangeInfo *info, const char *uid)
+camel_folder_change_info_add_uid(CamelFolderChangeInfo *info, const gchar *uid)
{
struct _CamelFolderChangeInfoPrivate *p;
GPtrArray *olduids;
- char *olduid;
+ gchar *olduid;
g_assert(info != NULL);
@@ -2514,11 +2514,11 @@ camel_folder_change_info_add_uid(CamelFolderChangeInfo *info, const char *uid)
* Add a uid to the removed uid list.
**/
void
-camel_folder_change_info_remove_uid(CamelFolderChangeInfo *info, const char *uid)
+camel_folder_change_info_remove_uid(CamelFolderChangeInfo *info, const gchar *uid)
{
struct _CamelFolderChangeInfoPrivate *p;
GPtrArray *olduids;
- char *olduid;
+ gchar *olduid;
g_assert(info != NULL);
@@ -2548,11 +2548,11 @@ camel_folder_change_info_remove_uid(CamelFolderChangeInfo *info, const char *uid
* Add a uid to the changed uid list.
**/
void
-camel_folder_change_info_change_uid(CamelFolderChangeInfo *info, const char *uid)
+camel_folder_change_info_change_uid(CamelFolderChangeInfo *info, const gchar *uid)
{
struct _CamelFolderChangeInfoPrivate *p;
GPtrArray *olduids;
- char *olduid;
+ gchar *olduid;
g_assert(info != NULL);
@@ -2579,7 +2579,7 @@ camel_folder_change_info_change_uid(CamelFolderChangeInfo *info, const char *uid
* filtering
**/
void
-camel_folder_change_info_recent_uid(CamelFolderChangeInfo *info, const char *uid)
+camel_folder_change_info_recent_uid(CamelFolderChangeInfo *info, const gchar *uid)
{
g_assert(info != NULL);
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index 13ef1e0a7..9c0b699b3 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -87,7 +87,7 @@ struct _CamelFolderChangeInfo {
typedef struct _CamelFolderQuotaInfo CamelFolderQuotaInfo;
struct _CamelFolderQuotaInfo {
- char *name;
+ gchar *name;
guint64 used;
guint64 total;
@@ -100,9 +100,9 @@ struct _CamelFolder {
struct _CamelFolderPrivate *priv;
/* get these via the :get() method, they might not be set otherwise */
- char *name;
- char *full_name;
- char *description;
+ gchar *name;
+ gchar *full_name;
+ gchar *description;
CamelStore *parent_store;
CamelFolderSummary *summary;
@@ -131,54 +131,54 @@ typedef struct {
void (*sync) (CamelFolder *folder, gboolean expunge,
CamelException *ex);
- const char * (*get_name) (CamelFolder *folder);
- const char * (*get_full_name) (CamelFolder *folder);
+ const gchar * (*get_name) (CamelFolder *folder);
+ const gchar * (*get_full_name) (CamelFolder *folder);
CamelStore * (*get_parent_store) (CamelFolder *folder);
void (*expunge) (CamelFolder *folder,
CamelException *ex);
- int (*get_message_count) (CamelFolder *folder);
+ gint (*get_message_count) (CamelFolder *folder);
void (*append_message) (CamelFolder *folder,
CamelMimeMessage *message,
const CamelMessageInfo *info,
- char **appended_uid,
+ gchar **appended_uid,
CamelException *ex);
guint32 (*get_permanent_flags) (CamelFolder *folder);
guint32 (*get_message_flags) (CamelFolder *folder,
- const char *uid);
+ const gchar *uid);
gboolean (*set_message_flags) (CamelFolder *folder,
- const char *uid,
+ const gchar *uid,
guint32 flags, guint32 set);
gboolean (*get_message_user_flag) (CamelFolder *folder,
- const char *uid,
- const char *name);
+ const gchar *uid,
+ const gchar *name);
void (*set_message_user_flag) (CamelFolder *folder,
- const char *uid,
- const char *name,
+ const gchar *uid,
+ const gchar *name,
gboolean value);
- const char * (*get_message_user_tag) (CamelFolder *folder,
- const char *uid,
- const char *name);
+ const gchar * (*get_message_user_tag) (CamelFolder *folder,
+ const gchar *uid,
+ const gchar *name);
void (*set_message_user_tag) (CamelFolder *folder,
- const char *uid,
- const char *name,
- const char *value);
+ const gchar *uid,
+ const gchar *name,
+ const gchar *value);
CamelMimeMessage * (*get_message) (CamelFolder *folder,
- const char *uid,
+ const gchar *uid,
CamelException *ex);
GPtrArray * (*get_uids) (CamelFolder *folder);
void (*free_uids) (CamelFolder *folder,
GPtrArray *array);
- gint (* cmp_uids) (CamelFolder *folder, const char *uid1, const char *uid2);
+ gint (* cmp_uids) (CamelFolder *folder, const gchar *uid1, const gchar *uid2);
void (* sort_uids) (CamelFolder *folder, GPtrArray *uids);
GPtrArray * (*get_summary) (CamelFolder *folder);
@@ -187,12 +187,12 @@ typedef struct {
gboolean (*has_search_capability) (CamelFolder *folder);
- GPtrArray * (*search_by_expression) (CamelFolder *, const char *, CamelException *);
- GPtrArray * (*search_by_uids) (CamelFolder *, const char *, GPtrArray *uids, CamelException *);
+ GPtrArray * (*search_by_expression) (CamelFolder *, const gchar *, CamelException *);
+ GPtrArray * (*search_by_uids) (CamelFolder *, const gchar *, GPtrArray *uids, CamelException *);
void (*search_free) (CamelFolder *folder, GPtrArray *result);
- CamelMessageInfo * (*get_message_info) (CamelFolder *, const char *uid);
+ CamelMessageInfo * (*get_message_info) (CamelFolder *, const gchar *uid);
void (*ref_message_info) (CamelFolder *, CamelMessageInfo *);
void (*free_message_info) (CamelFolder *, CamelMessageInfo *);
@@ -204,19 +204,19 @@ typedef struct {
CamelException *ex);
void (*delete) (CamelFolder *folder);
- void (*rename) (CamelFolder *folder, const char *newname);
+ void (*rename) (CamelFolder *folder, const gchar *newname);
void (*freeze) (CamelFolder *folder);
void (*thaw) (CamelFolder *folder);
gboolean (*is_frozen) (CamelFolder *folder);
CamelFolderQuotaInfo * (*get_quota_info) (CamelFolder *folder);
- guint32 (*count_by_expression) (CamelFolder *, const char *, CamelException *);
+ guint32 (*count_by_expression) (CamelFolder *, const gchar *, CamelException *);
void (*sync_message) (CamelFolder *folder,
- const char *uid,
+ const gchar *uid,
CamelException *ex);
GPtrArray * (*get_uncached_uids)(CamelFolder *, GPtrArray * uids, CamelException *);
- char * (*get_filename) (CamelFolder *, const char *uid, CamelException *);
+ gchar * (*get_filename) (CamelFolder *, const gchar *uid, CamelException *);
} CamelFolderClass;
/* Standard Camel function */
@@ -226,8 +226,8 @@ CamelType camel_folder_get_type (void);
/* public methods */
void camel_folder_construct (CamelFolder *folder,
CamelStore *parent_store,
- const char *full_name,
- const char *name);
+ const gchar *full_name,
+ const gchar *name);
void camel_folder_refresh_info (CamelFolder *folder,
CamelException *ex);
@@ -244,8 +244,8 @@ void camel_folder_expunge (CamelFolder *folder,
/* folder name operations */
-const char * camel_folder_get_name (CamelFolder *folder);
-const char * camel_folder_get_full_name (CamelFolder *folder);
+const gchar * camel_folder_get_name (CamelFolder *folder);
+const gchar * camel_folder_get_full_name (CamelFolder *folder);
/* various properties accessors */
@@ -253,30 +253,30 @@ guint32 camel_folder_get_permanent_flags (CamelFolder *folder);
#ifndef CAMEL_DISABLE_DEPRECATED
guint32 camel_folder_get_message_flags (CamelFolder *folder,
- const char *uid);
+ const gchar *uid);
gboolean camel_folder_set_message_flags (CamelFolder *folder,
- const char *uid,
+ const gchar *uid,
guint32 flags,
guint32 set);
gboolean camel_folder_get_message_user_flag (CamelFolder *folder,
- const char *uid,
- const char *name);
+ const gchar *uid,
+ const gchar *name);
void camel_folder_set_message_user_flag (CamelFolder *folder,
- const char *uid,
- const char *name,
+ const gchar *uid,
+ const gchar *name,
gboolean value);
-const char * camel_folder_get_message_user_tag (CamelFolder *folder,
- const char *uid,
- const char *name);
+const gchar * camel_folder_get_message_user_tag (CamelFolder *folder,
+ const gchar *uid,
+ const gchar *name);
void camel_folder_set_message_user_tag (CamelFolder *folder,
- const char *uid,
- const char *name,
- const char *value);
+ const gchar *uid,
+ const gchar *name,
+ const gchar *value);
#endif /* CAMEL_DISABLE_DEPRECATED */
@@ -285,7 +285,7 @@ void camel_folder_set_message_user_tag (CamelFolder *folder,
void camel_folder_append_message (CamelFolder *folder,
CamelMimeMessage *message,
const CamelMessageInfo *info,
- char **appended_uid,
+ gchar **appended_uid,
CamelException *ex);
@@ -293,13 +293,13 @@ void camel_folder_append_message (CamelFolder *folder,
gboolean camel_folder_has_summary_capability (CamelFolder *folder);
-int camel_folder_get_message_count (CamelFolder *folder);
+gint camel_folder_get_message_count (CamelFolder *folder);
#ifndef CAMEL_DISABLE_DEPRECATED
-int camel_folder_get_unread_message_count (CamelFolder *folder);
+gint camel_folder_get_unread_message_count (CamelFolder *folder);
#endif
-int camel_folder_get_deleted_message_count (CamelFolder *folder);
+gint camel_folder_get_deleted_message_count (CamelFolder *folder);
GPtrArray * camel_folder_get_summary (CamelFolder *folder);
void camel_folder_free_summary (CamelFolder *folder,
@@ -307,10 +307,10 @@ void camel_folder_free_summary (CamelFolder *folder,
/* uid based access operations */
CamelMimeMessage * camel_folder_get_message (CamelFolder *folder,
- const char *uid,
+ const gchar *uid,
CamelException *ex);
void camel_folder_sync_message (CamelFolder *folder,
- const char *uid,
+ const gchar *uid,
CamelException *ex);
#define camel_folder_delete_message(folder, uid) \
camel_folder_set_message_flags (folder, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN)
@@ -321,19 +321,19 @@ void camel_folder_free_uids (CamelFolder *folder,
GPtrArray * camel_folder_get_uncached_uids (CamelFolder *,
GPtrArray * uids,
CamelException *);
-gint camel_folder_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2);
+gint camel_folder_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2);
void camel_folder_sort_uids (CamelFolder *folder,
GPtrArray *uids);
/* search api */
gboolean camel_folder_has_search_capability (CamelFolder *folder);
-GPtrArray * camel_folder_search_by_expression (CamelFolder *folder, const char *expr, CamelException *ex);
-GPtrArray * camel_folder_search_by_uids (CamelFolder *folder, const char *expr, GPtrArray *uids, CamelException *ex);
+GPtrArray * camel_folder_search_by_expression (CamelFolder *folder, const gchar *expr, CamelException *ex);
+GPtrArray * camel_folder_search_by_uids (CamelFolder *folder, const gchar *expr, GPtrArray *uids, CamelException *ex);
void camel_folder_search_free (CamelFolder *folder, GPtrArray *result);
-guint32 camel_folder_count_by_expression (CamelFolder *folder, const char *expression, CamelException *ex);
+guint32 camel_folder_count_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex);
/* summary info */
-CamelMessageInfo *camel_folder_get_message_info (CamelFolder *folder, const char *uid);
+CamelMessageInfo *camel_folder_get_message_info (CamelFolder *folder, const gchar *uid);
void camel_folder_free_message_info (CamelFolder *folder, CamelMessageInfo *info);
#ifndef CAMEL_DISABLE_DEPRECATED
void camel_folder_ref_message_info (CamelFolder *folder, CamelMessageInfo *info);
@@ -347,7 +347,7 @@ void camel_folder_transfer_messages_to (CamelFolder *source,
CamelException *ex);
void camel_folder_delete (CamelFolder *folder);
-void camel_folder_rename (CamelFolder *folder, const char *new);
+void camel_folder_rename (CamelFolder *folder, const gchar *new);
/* stop/restart getting events */
void camel_folder_freeze (CamelFolder *folder);
@@ -357,7 +357,7 @@ gboolean camel_folder_is_frozen (CamelFolder *folder);
/* quota support */
CamelFolderQuotaInfo *camel_folder_get_quota_info (CamelFolder *folder);
-CamelFolderQuotaInfo *camel_folder_quota_info_new (const char *name, guint64 used, guint64 total);
+CamelFolderQuotaInfo *camel_folder_quota_info_new (const gchar *name, guint64 used, guint64 total);
CamelFolderQuotaInfo *camel_folder_quota_info_clone (const CamelFolderQuotaInfo *info);
void camel_folder_quota_info_free (CamelFolderQuotaInfo *info);
@@ -366,7 +366,7 @@ void camel_folder_free_nop (CamelFolder *folder, GPtrArray *array);
void camel_folder_free_shallow (CamelFolder *folder, GPtrArray *array);
void camel_folder_free_deep (CamelFolder *folder, GPtrArray *array);
-char * camel_folder_get_filename (CamelFolder *folder, const char *uid, CamelException *ex);
+gchar * camel_folder_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
/* update functions for change info */
CamelFolderChangeInfo * camel_folder_change_info_new (void);
@@ -375,18 +375,18 @@ void camel_folder_change_info_free (CamelFolderChangeInfo *info);
gboolean camel_folder_change_info_changed (CamelFolderChangeInfo *info);
/* for building diff's automatically */
-void camel_folder_change_info_add_source (CamelFolderChangeInfo *info, const char *uid);
+void camel_folder_change_info_add_source (CamelFolderChangeInfo *info, const gchar *uid);
void camel_folder_change_info_add_source_list(CamelFolderChangeInfo *info, const GPtrArray *list);
-void camel_folder_change_info_add_update (CamelFolderChangeInfo *info, const char *uid);
+void camel_folder_change_info_add_update (CamelFolderChangeInfo *info, const gchar *uid);
void camel_folder_change_info_add_update_list(CamelFolderChangeInfo *info, const GPtrArray *list);
void camel_folder_change_info_build_diff (CamelFolderChangeInfo *info);
/* for manipulating diff's directly */
void camel_folder_change_info_cat (CamelFolderChangeInfo *info, CamelFolderChangeInfo *src);
-void camel_folder_change_info_add_uid (CamelFolderChangeInfo *info, const char *uid);
-void camel_folder_change_info_remove_uid (CamelFolderChangeInfo *info, const char *uid);
-void camel_folder_change_info_change_uid (CamelFolderChangeInfo *info, const char *uid);
-void camel_folder_change_info_recent_uid (CamelFolderChangeInfo *info, const char *uid);
+void camel_folder_change_info_add_uid (CamelFolderChangeInfo *info, const gchar *uid);
+void camel_folder_change_info_remove_uid (CamelFolderChangeInfo *info, const gchar *uid);
+void camel_folder_change_info_change_uid (CamelFolderChangeInfo *info, const gchar *uid);
+void camel_folder_change_info_recent_uid (CamelFolderChangeInfo *info, const gchar *uid);
G_END_DECLS
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index 79dca62cd..951e13037 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -68,7 +68,7 @@
#define d(x)
#ifdef GPG_LOG
-static int logid;
+static gint logid;
#endif
static CamelCipherContextClass *parent_class = NULL;
@@ -116,7 +116,7 @@ camel_gpg_context_set_always_trust (CamelGpgContext *ctx, gboolean always_trust)
}
-static const char *
+static const gchar *
gpg_hash_to_id (CamelCipherContext *context, CamelCipherHash hash)
{
switch (hash) {
@@ -139,7 +139,7 @@ gpg_hash_to_id (CamelCipherContext *context, CamelCipherHash hash)
}
static CamelCipherHash
-gpg_id_to_hash (CamelCipherContext *context, const char *id)
+gpg_id_to_hash (CamelCipherContext *context, const gchar *id)
{
if (id) {
if (!strcmp (id, "pgp-md2"))
@@ -184,24 +184,24 @@ struct _GpgCtx {
GHashTable *userid_hint;
pid_t pid;
- char *userid;
- char *sigfile;
+ gchar *userid;
+ gchar *sigfile;
GPtrArray *recipients;
CamelCipherHash hash;
- int stdin_fd;
- int stdout_fd;
- int stderr_fd;
- int status_fd;
- int passwd_fd; /* only needed for sign/decrypt */
+ gint stdin_fd;
+ gint stdout_fd;
+ gint stderr_fd;
+ gint status_fd;
+ gint passwd_fd; /* only needed for sign/decrypt */
/* status-fd buffer */
- unsigned char *statusbuf;
- unsigned char *statusptr;
- unsigned int statusleft;
+ guchar *statusbuf;
+ guchar *statusptr;
+ guint statusleft;
- char *need_id;
- char *passwd;
+ gchar *need_id;
+ gchar *passwd;
CamelStream *istream;
CamelStream *ostream;
@@ -209,40 +209,40 @@ struct _GpgCtx {
GByteArray *diagbuf;
CamelStream *diagnostics;
- int exit_status;
+ gint exit_status;
- unsigned int exited:1;
- unsigned int complete:1;
- unsigned int seen_eof1:1;
- unsigned int seen_eof2:1;
- unsigned int always_trust:1;
- unsigned int armor:1;
- unsigned int need_passwd:1;
- unsigned int send_passwd:1;
+ guint exited:1;
+ guint complete:1;
+ guint seen_eof1:1;
+ guint seen_eof2:1;
+ guint always_trust:1;
+ guint armor:1;
+ guint need_passwd:1;
+ guint send_passwd:1;
- unsigned int bad_passwds:2;
+ guint bad_passwds:2;
- unsigned int hadsig:1;
- unsigned int badsig:1;
- unsigned int errsig:1;
- unsigned int goodsig:1;
- unsigned int validsig:1;
- unsigned int nopubkey:1;
- unsigned int nodata:1;
- unsigned int trust:3;
+ guint hadsig:1;
+ guint badsig:1;
+ guint errsig:1;
+ guint goodsig:1;
+ guint validsig:1;
+ guint nopubkey:1;
+ guint nodata:1;
+ guint trust:3;
- unsigned int diagflushed:1;
+ guint diagflushed:1;
- unsigned int utf8:1;
+ guint utf8:1;
- unsigned int padding:10;
+ guint padding:10;
};
static struct _GpgCtx *
gpg_ctx_new (CamelSession *session)
{
struct _GpgCtx *gpg;
- const char *charset;
+ const gchar *charset;
CamelStream *stream;
gpg = g_new (struct _GpgCtx, 1);
@@ -339,14 +339,14 @@ gpg_ctx_set_always_trust (struct _GpgCtx *gpg, gboolean trust)
}
static void
-gpg_ctx_set_userid (struct _GpgCtx *gpg, const char *userid)
+gpg_ctx_set_userid (struct _GpgCtx *gpg, const gchar *userid)
{
g_free (gpg->userid);
gpg->userid = g_strdup (userid);
}
static void
-gpg_ctx_add_recipient (struct _GpgCtx *gpg, const char *keyid)
+gpg_ctx_add_recipient (struct _GpgCtx *gpg, const gchar *keyid)
{
if (gpg->mode != GPG_CTX_MODE_ENCRYPT && gpg->mode != GPG_CTX_MODE_EXPORT)
return;
@@ -358,7 +358,7 @@ gpg_ctx_add_recipient (struct _GpgCtx *gpg, const char *keyid)
}
static void
-gpg_ctx_set_sigfile (struct _GpgCtx *gpg, const char *sigfile)
+gpg_ctx_set_sigfile (struct _GpgCtx *gpg, const gchar *sigfile)
{
g_free (gpg->sigfile);
gpg->sigfile = g_strdup (sigfile);
@@ -389,7 +389,7 @@ gpg_ctx_set_ostream (struct _GpgCtx *gpg, CamelStream *ostream)
gpg->seen_eof1 = FALSE;
}
-static const char *
+static const gchar *
gpg_ctx_get_diagnostics (struct _GpgCtx *gpg)
{
if (!gpg->diagflushed) {
@@ -401,7 +401,7 @@ gpg_ctx_get_diagnostics (struct _GpgCtx *gpg)
g_byte_array_append (gpg->diagbuf, (guchar *) "", 1);
}
- return (const char *) gpg->diagbuf->data;
+ return (const gchar *) gpg->diagbuf->data;
}
static void
@@ -414,7 +414,7 @@ userid_hint_free (gpointer key, gpointer value, gpointer user_data)
static void
gpg_ctx_free (struct _GpgCtx *gpg)
{
- int i;
+ gint i;
if (gpg == NULL)
return;
@@ -469,7 +469,7 @@ gpg_ctx_free (struct _GpgCtx *gpg)
#ifndef G_OS_WIN32
-static const char *
+static const gchar *
gpg_hash_str (CamelCipherHash hash)
{
switch (hash) {
@@ -487,12 +487,12 @@ gpg_hash_str (CamelCipherHash hash)
}
static GPtrArray *
-gpg_ctx_get_argv (struct _GpgCtx *gpg, int status_fd, char **sfd, int passwd_fd, char **pfd)
+gpg_ctx_get_argv (struct _GpgCtx *gpg, gint status_fd, gchar **sfd, gint passwd_fd, gchar **pfd)
{
- const char *hash_str;
+ const gchar *hash_str;
GPtrArray *argv;
- char *buf;
- int i;
+ gchar *buf;
+ gint i;
argv = g_ptr_array_new ();
g_ptr_array_add (argv, "gpg");
@@ -525,10 +525,10 @@ gpg_ctx_get_argv (struct _GpgCtx *gpg, int status_fd, char **sfd, int passwd_fd,
g_ptr_array_add (argv, "--armor");
hash_str = gpg_hash_str (gpg->hash);
if (hash_str)
- g_ptr_array_add (argv, (char *) hash_str);
+ g_ptr_array_add (argv, (gchar *) hash_str);
if (gpg->userid) {
g_ptr_array_add (argv, "-u");
- g_ptr_array_add (argv, (char *) gpg->userid);
+ g_ptr_array_add (argv, (gchar *) gpg->userid);
}
g_ptr_array_add (argv, "--output");
g_ptr_array_add (argv, "-");
@@ -553,7 +553,7 @@ gpg_ctx_get_argv (struct _GpgCtx *gpg, int status_fd, char **sfd, int passwd_fd,
g_ptr_array_add (argv, "--always-trust");
if (gpg->userid) {
g_ptr_array_add (argv, "-u");
- g_ptr_array_add (argv, (char *) gpg->userid);
+ g_ptr_array_add (argv, (gchar *) gpg->userid);
}
if (gpg->recipients) {
for (i = 0; i < gpg->recipients->len; i++) {
@@ -593,10 +593,10 @@ static int
gpg_ctx_op_start (struct _GpgCtx *gpg)
{
#ifndef G_OS_WIN32
- char *status_fd = NULL, *passwd_fd = NULL;
- int i, maxfd, errnosave, fds[10];
+ gchar *status_fd = NULL, *passwd_fd = NULL;
+ gint i, maxfd, errnosave, fds[10];
GPtrArray *argv;
- int flags;
+ gint flags;
for (i = 0; i < 10; i++)
fds[i] = -1;
@@ -632,7 +632,7 @@ gpg_ctx_op_start (struct _GpgCtx *gpg)
}
/* run gpg */
- execvp ("gpg", (char **) argv->pdata);
+ execvp ("gpg", (gchar **) argv->pdata);
_exit (255);
} else if (gpg->pid < 0) {
g_ptr_array_free (argv, TRUE);
@@ -698,10 +698,10 @@ gpg_ctx_op_start (struct _GpgCtx *gpg)
#ifndef G_OS_WIN32
-static const char *
-next_token (const char *in, char **token)
+static const gchar *
+next_token (const gchar *in, gchar **token)
{
- const char *start, *inptr = in;
+ const gchar *start, *inptr = in;
while (*inptr == ' ')
inptr++;
@@ -725,10 +725,10 @@ next_token (const char *in, char **token)
static int
gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
{
- register unsigned char *inptr;
- const unsigned char *status;
+ register guchar *inptr;
+ const guchar *status;
size_t nread, nwritten;
- int len;
+ gint len;
parse:
@@ -747,8 +747,8 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
if (camel_debug("gpg:status"))
printf ("status: %s\n", status);
- if (strncmp ((const char *) status, "[GNUPG:] ", 9) != 0) {
- char *message;
+ 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 (ex, CAMEL_EXCEPTION_SYSTEM,
_("Unexpected GnuPG status message encountered:\n\n%s"),
@@ -759,11 +759,11 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
status += 9;
- if (!strncmp ((char *) status, "USERID_HINT ", 12)) {
- char *hint, *user;
+ if (!strncmp ((gchar *) status, "USERID_HINT ", 12)) {
+ gchar *hint, *user;
status += 12;
- status = (const unsigned char *) next_token ((char *) status, &hint);
+ status = (const guchar *) next_token ((gchar *) status, &hint);
if (!hint) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
_("Failed to parse gpg userid hint."));
@@ -782,12 +782,12 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
g_strstrip (user);
g_hash_table_insert (gpg->userid_hint, hint, user);
- } else if (!strncmp ((char *) status, "NEED_PASSPHRASE ", 16)) {
- char *userid;
+ } else if (!strncmp ((gchar *) status, "NEED_PASSPHRASE ", 16)) {
+ gchar *userid;
status += 16;
- status = (const unsigned char *) next_token ((char *) status, &userid);
+ status = (const guchar *) next_token ((gchar *) status, &userid);
if (!userid) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
_("Failed to parse gpg passphrase request."));
@@ -796,12 +796,12 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
g_free (gpg->need_id);
gpg->need_id = userid;
- } else if (!strncmp ((char *) status, "NEED_PASSPHRASE_PIN ", 20)) {
- char *userid;
+ } else if (!strncmp ((gchar *) status, "NEED_PASSPHRASE_PIN ", 20)) {
+ gchar *userid;
status += 20;
- status = (const unsigned char *) next_token ((char *) status, &userid);
+ status = (const guchar *) next_token ((gchar *) status, &userid);
if (!userid) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
_("Failed to parse gpg passphrase request."));
@@ -810,9 +810,9 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
g_free (gpg->need_id);
gpg->need_id = userid;
- } else if (!strncmp ((char *) status, "GET_HIDDEN ", 11)) {
- const char *name = NULL;
- char *prompt, *passwd;
+ } else if (!strncmp ((gchar *) status, "GET_HIDDEN ", 11)) {
+ const gchar *name = NULL;
+ gchar *prompt, *passwd;
guint32 flags;
status += 11;
@@ -822,16 +822,16 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
else if (!name)
name = "";
- if (!strncmp ((char *) status, "passphrase.pin.ask", 18)) {
+ if (!strncmp ((gchar *) status, "passphrase.pin.ask", 18)) {
prompt = g_markup_printf_escaped (
_("You need a PIN to unlock the key for your\n"
"SmartCard: \"%s\""), name);
- } else if (!strncmp ((char *) status, "passphrase.enter", 16)) {
+ } else if (!strncmp ((gchar *) status, "passphrase.enter", 16)) {
prompt = g_markup_printf_escaped (
_("You need a passphrase to unlock the key for\n"
"user: \"%s\""), name);
} else {
- next_token ((char *) status, &prompt);
+ next_token ((gchar *) status, &prompt);
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Unexpected request from GnuPG for '%s'"), prompt);
g_free (prompt);
@@ -841,7 +841,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
flags = CAMEL_SESSION_PASSWORD_SECRET | CAMEL_SESSION_PASSPHRASE;
if ((passwd = camel_session_get_password (gpg->session, NULL, NULL, prompt, gpg->need_id, flags, ex))) {
if (!gpg->utf8) {
- char *opasswd = passwd;
+ gchar *opasswd = passwd;
if ((passwd = g_locale_to_utf8 (passwd, -1, &nread, &nwritten, NULL))) {
memset (opasswd, 0, strlen (opasswd));
@@ -863,9 +863,9 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
}
g_free (prompt);
- } else if (!strncmp ((char *) status, "GOOD_PASSPHRASE", 15)) {
+ } else if (!strncmp ((gchar *) status, "GOOD_PASSPHRASE", 15)) {
gpg->bad_passwds = 0;
- } else if (!strncmp ((char *) status, "BAD_PASSPHRASE", 14)) {
+ } else if (!strncmp ((gchar *) status, "BAD_PASSPHRASE", 14)) {
gpg->bad_passwds++;
camel_session_forget_password (gpg->session, NULL, NULL, gpg->need_id, ex);
@@ -875,16 +875,16 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
_("Failed to unlock secret key: 3 bad passphrases given."));
return -1;
}
- } else if (!strncmp ((const char *) status, "UNEXPECTED ", 11)) {
+ } else if (!strncmp ((const gchar *) status, "UNEXPECTED ", 11)) {
/* this is an error */
- char *message;
+ gchar *message;
message = g_locale_to_utf8((const gchar *) status+11, -1, NULL, NULL, NULL);
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Unexpected response from GnuPG: %s"),
message);
g_free(message);
return -1;
- } else if (!strncmp ((char *) status, "NODATA", 6)) {
+ } else if (!strncmp ((gchar *) status, "NODATA", 6)) {
/* this is an error */
/* But we ignore it anyway, we should get other response codes to say why */
gpg->nodata = TRUE;
@@ -892,56 +892,56 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
/* check to see if we are complete */
switch (gpg->mode) {
case GPG_CTX_MODE_SIGN:
- if (!strncmp ((char *) status, "SIG_CREATED ", 12)) {
+ if (!strncmp ((gchar *) status, "SIG_CREATED ", 12)) {
/* FIXME: save this state? */
}
break;
case GPG_CTX_MODE_DECRYPT:
- if (!strncmp ((char *) status, "BEGIN_DECRYPTION", 16)) {
+ if (!strncmp ((gchar *) status, "BEGIN_DECRYPTION", 16)) {
/* nothing to do... but we know to expect data on stdout soon */
break;
- } else if (!strncmp ((char *) status, "END_DECRYPTION", 14)) {
+ } else if (!strncmp ((gchar *) status, "END_DECRYPTION", 14)) {
/* nothing to do, but we know the end is near? */
break;
}
/* let if fall through to verify possible signatures too */
/* break; */
case GPG_CTX_MODE_VERIFY:
- if (!strncmp ((char *) status, "TRUST_", 6)) {
+ if (!strncmp ((gchar *) status, "TRUST_", 6)) {
status += 6;
- if (!strncmp ((char *) status, "NEVER", 5)) {
+ if (!strncmp ((gchar *) status, "NEVER", 5)) {
gpg->trust = GPG_TRUST_NEVER;
- } else if (!strncmp ((char *) status, "MARGINAL", 8)) {
+ } else if (!strncmp ((gchar *) status, "MARGINAL", 8)) {
gpg->trust = GPG_TRUST_MARGINAL;
- } else if (!strncmp ((char *) status, "FULLY", 5)) {
+ } else if (!strncmp ((gchar *) status, "FULLY", 5)) {
gpg->trust = GPG_TRUST_FULLY;
- } else if (!strncmp ((char *) status, "ULTIMATE", 8)) {
+ } else if (!strncmp ((gchar *) status, "ULTIMATE", 8)) {
gpg->trust = GPG_TRUST_ULTIMATE;
- } else if (!strncmp ((char *) status, "UNDEFINED", 9)) {
+ } else if (!strncmp ((gchar *) status, "UNDEFINED", 9)) {
gpg->trust = GPG_TRUST_UNDEFINED;
}
- } else if (!strncmp ((char *) status, "GOODSIG ", 8)) {
+ } else if (!strncmp ((gchar *) status, "GOODSIG ", 8)) {
gpg->goodsig = TRUE;
gpg->hadsig = TRUE;
- } else if (!strncmp ((char *) status, "VALIDSIG ", 9)) {
+ } else if (!strncmp ((gchar *) status, "VALIDSIG ", 9)) {
gpg->validsig = TRUE;
- } else if (!strncmp ((char *) status, "BADSIG ", 7)) {
+ } else if (!strncmp ((gchar *) status, "BADSIG ", 7)) {
gpg->badsig = FALSE;
gpg->hadsig = TRUE;
- } else if (!strncmp ((char *) status, "ERRSIG ", 7)) {
+ } else if (!strncmp ((gchar *) status, "ERRSIG ", 7)) {
/* Note: NO_PUBKEY often comes after an ERRSIG */
gpg->errsig = FALSE;
gpg->hadsig = TRUE;
- } else if (!strncmp ((char *) status, "NO_PUBKEY ", 10)) {
+ } else if (!strncmp ((gchar *) status, "NO_PUBKEY ", 10)) {
gpg->nopubkey = TRUE;
}
break;
case GPG_CTX_MODE_ENCRYPT:
- if (!strncmp ((char *) status, "BEGIN_ENCRYPTION", 16)) {
+ if (!strncmp ((gchar *) status, "BEGIN_ENCRYPTION", 16)) {
/* nothing to do... but we know to expect data on stdout soon */
- } else if (!strncmp ((char *) status, "END_ENCRYPTION", 14)) {
+ } else if (!strncmp ((gchar *) status, "END_ENCRYPTION", 14)) {
/* nothing to do, but we know the end is near? */
- } else if (!strncmp ((char *) status, "NO_RECP", 7)) {
+ } else if (!strncmp ((gchar *) status, "NO_RECP", 7)) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
_("Failed to encrypt: No valid recipients specified."));
return -1;
@@ -977,7 +977,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
#define status_backup(gpg, start, len) G_STMT_START { \
if (gpg->statusleft <= len) { \
- unsigned int slen, soff; \
+ guint slen, soff; \
\
slen = soff = gpg->statusptr - gpg->statusbuf; \
slen = slen ? slen : 1; \
@@ -1001,7 +1001,7 @@ static void
gpg_ctx_op_cancel (struct _GpgCtx *gpg)
{
pid_t retval;
- int status;
+ gint status;
if (gpg->exited)
return;
@@ -1025,7 +1025,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
{
#ifndef G_OS_WIN32
GPollFD polls[6];
- int status, i, cancel_fd;
+ gint status, i, cancel_fd;
for (i=0;i<6;i++) {
polls[i].fd = -1;
@@ -1080,7 +1080,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
if (polls[2].revents & (G_IO_IN|G_IO_HUP)) {
/* read the status message and decide what to do... */
- char buffer[4096];
+ gchar buffer[4096];
ssize_t nread;
d(printf ("reading from gpg's status-fd...\n"));
@@ -1102,7 +1102,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
}
if ((polls[0].revents & (G_IO_IN|G_IO_HUP)) && gpg->ostream) {
- char buffer[4096];
+ gchar buffer[4096];
ssize_t nread;
d(printf ("reading gpg's stdout...\n"));
@@ -1122,7 +1122,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
}
if (polls[1].revents & (G_IO_IN|G_IO_HUP)) {
- char buffer[4096];
+ gchar buffer[4096];
ssize_t nread;
d(printf ("reading gpg's stderr...\n"));
@@ -1169,7 +1169,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
}
if ((polls[3].revents & (G_IO_OUT|G_IO_HUP)) && gpg->istream) {
- char buffer[4096];
+ gchar buffer[4096];
ssize_t nread;
d(printf ("writing to gpg's stdin...\n"));
@@ -1222,7 +1222,7 @@ static gboolean
gpg_ctx_op_exited (struct _GpgCtx *gpg)
{
pid_t retval;
- int status;
+ gint status;
if (gpg->exited)
return TRUE;
@@ -1244,7 +1244,7 @@ gpg_ctx_op_wait (struct _GpgCtx *gpg)
#ifndef G_OS_WIN32
sigset_t mask, omask;
pid_t retval;
- int status;
+ gint status;
if (!gpg->exited) {
sigemptyset (&mask);
@@ -1284,13 +1284,13 @@ gpg_ctx_op_wait (struct _GpgCtx *gpg)
static int
-gpg_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
+gpg_sign (CamelCipherContext *context, const gchar *userid, CamelCipherHash hash, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
{
struct _GpgCtx *gpg = NULL;
CamelStream *ostream = camel_stream_mem_new(), *istream;
CamelDataWrapper *dw;
CamelContentType *ct;
- int res = -1;
+ gint res = -1;
CamelMimePart *sigpart;
CamelMultipartSigned *mps;
@@ -1307,7 +1307,7 @@ gpg_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
#ifdef GPG_LOG
if (camel_debug_start("gpg:sign")) {
- char *name;
+ gchar *name;
CamelStream *out;
name = g_strdup_printf("camel-gpg.%d.sign-data", logid++);
@@ -1343,7 +1343,7 @@ gpg_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
}
if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
+ const gchar *diagnostics;
diagnostics = gpg_ctx_get_diagnostics (gpg);
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -1393,12 +1393,12 @@ fail:
}
-static char *
+static gchar *
swrite (CamelMimePart *sigpart)
{
CamelStream *ostream;
- char *template;
- int fd, ret;
+ gchar *template;
+ gint fd, ret;
template = g_build_filename (g_get_tmp_dir (), "evolution-pgp.XXXXXX", NULL);
if ((fd = g_mkstemp (template)) == -1) {
@@ -1431,9 +1431,9 @@ static CamelCipherValidity *
gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
{
CamelCipherValidity *validity;
- const char *diagnostics = NULL;
+ const gchar *diagnostics = NULL;
struct _GpgCtx *gpg = NULL;
- char *sigfile = NULL;
+ gchar *sigfile = NULL;
CamelContentType *ct;
CamelMimePart *sigpart;
CamelStream *istream = NULL, *canon_stream;
@@ -1447,7 +1447,7 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
/* Inline signature (using our fake mime type) or PGP/Mime signature */
if (camel_content_type_is(ct, "multipart", "signed")) {
/* PGP/Mime Signature */
- const char *tmp;
+ const gchar *tmp;
tmp = camel_content_type_param(ct, "protocol");
if (!CAMEL_IS_MULTIPART_SIGNED(mps)
@@ -1488,7 +1488,7 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
/* Now start the real work of verifying the message */
#ifdef GPG_LOG
if (camel_debug_start("gpg:sign")) {
- char *name;
+ gchar *name;
CamelStream *out;
name = g_strdup_printf("camel-gpg.%d.verify.data", logid);
@@ -1604,11 +1604,11 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
}
static int
-gpg_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
+gpg_encrypt (CamelCipherContext *context, const gchar *userid, GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
{
CamelGpgContext *ctx = (CamelGpgContext *) context;
struct _GpgCtx *gpg;
- int i, res = -1;
+ gint i, res = -1;
CamelStream *istream, *ostream, *vstream;
CamelMimePart *encpart, *verpart;
CamelDataWrapper *dw;
@@ -1647,7 +1647,7 @@ gpg_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipie
}
if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
+ const gchar *diagnostics;
diagnostics = gpg_ctx_get_diagnostics (gpg);
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -1718,7 +1718,7 @@ gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *op
CamelMimePart *encrypted;
CamelMultipart *mp;
CamelContentType *ct;
- int rv;
+ gint rv;
if (!ipart) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -1777,7 +1777,7 @@ gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *op
}
if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
+ const gchar *diagnostics;
diagnostics = gpg_ctx_get_diagnostics (gpg);
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -1838,7 +1838,7 @@ static int
gpg_import_keys (CamelCipherContext *context, CamelStream *istream, CamelException *ex)
{
struct _GpgCtx *gpg;
- int res = -1;
+ gint res = -1;
gpg = gpg_ctx_new (context->session);
gpg_ctx_set_mode (gpg, GPG_CTX_MODE_IMPORT);
@@ -1857,7 +1857,7 @@ gpg_import_keys (CamelCipherContext *context, CamelStream *istream, CamelExcepti
}
if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
+ const gchar *diagnostics;
diagnostics = gpg_ctx_get_diagnostics (gpg);
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -1877,8 +1877,8 @@ static int
gpg_export_keys (CamelCipherContext *context, GPtrArray *keys, CamelStream *ostream, CamelException *ex)
{
struct _GpgCtx *gpg;
- int i;
- int res = -1;
+ gint i;
+ gint res = -1;
gpg = gpg_ctx_new (context->session);
gpg_ctx_set_mode (gpg, GPG_CTX_MODE_EXPORT);
@@ -1902,7 +1902,7 @@ gpg_export_keys (CamelCipherContext *context, GPtrArray *keys, CamelStream *ostr
}
if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
+ const gchar *diagnostics;
diagnostics = gpg_ctx_get_diagnostics (gpg);
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
diff --git a/camel/camel-html-parser.c b/camel/camel-html-parser.c
index ca97078cb..2265446db 100644
--- a/camel/camel-html-parser.c
+++ b/camel/camel-html-parser.c
@@ -47,26 +47,26 @@ static CamelObjectClass *camel_html_parser_parent;
typedef struct _CamelHTMLParserPrivate CamelHTMLParserPrivate;
struct _CamelHTMLParserPrivate {
- char *inbuf,
+ gchar *inbuf,
*inptr,
*inend,
*start;
enum _camel_html_parser_t state;
- char *charset;
- int eof;
+ gchar *charset;
+ gint eof;
GString *tag;
GString *ent;
- char ent_utf8[8];
- int attr;
+ gchar ent_utf8[8];
+ gint attr;
GPtrArray *attrs;
GPtrArray *values;
- int quote;
+ gint quote;
};
static void tokenise_setup(void);
static CamelHTMLParserPrivate *tokenise_init(void);
static void tokenise_free(CamelHTMLParserPrivate *p);
-static int tokenise_step(CamelHTMLParserPrivate *p, char **datap, int *lenp);
+static gint tokenise_step(CamelHTMLParserPrivate *p, gchar **datap, gint *lenp);
/* ********************************************************************** */
@@ -127,21 +127,21 @@ camel_html_parser_new (void)
}
-void camel_html_parser_set_data(CamelHTMLParser *hp, const char *start, int len, int last)
+void camel_html_parser_set_data(CamelHTMLParser *hp, const gchar *start, gint len, gint last)
{
CamelHTMLParserPrivate *p = hp->priv;
- p->inptr = p->inbuf = (char *)start;
- p->inend = (char *)start+len;
+ p->inptr = p->inbuf = (gchar *)start;
+ p->inend = (gchar *)start+len;
p->eof = last;
}
-camel_html_parser_t camel_html_parser_step(CamelHTMLParser *hp, const char **datap, int *lenp)
+camel_html_parser_t camel_html_parser_step(CamelHTMLParser *hp, const gchar **datap, gint *lenp)
{
- return tokenise_step(hp->priv, (char **)datap, lenp);
+ return tokenise_step(hp->priv, (gchar **)datap, lenp);
}
-const char *camel_html_parser_left(CamelHTMLParser *hp, int *lenp)
+const gchar *camel_html_parser_left(CamelHTMLParser *hp, gint *lenp)
{
CamelHTMLParserPrivate *p = hp->priv;
@@ -151,14 +151,14 @@ const char *camel_html_parser_left(CamelHTMLParser *hp, int *lenp)
return p->inptr;
}
-const char *camel_html_parser_tag(CamelHTMLParser *hp)
+const gchar *camel_html_parser_tag(CamelHTMLParser *hp)
{
return hp->priv->tag->str;
}
-const char *camel_html_parser_attr(CamelHTMLParser *hp, const char *name)
+const gchar *camel_html_parser_attr(CamelHTMLParser *hp, const gchar *name)
{
- int i;
+ gint i;
CamelHTMLParserPrivate *p = hp->priv;
for (i=0;i<p->attrs->len;i++) {
@@ -180,8 +180,8 @@ const GPtrArray *camel_html_parser_attr_list(CamelHTMLParser *hp, const GPtrArra
/* this map taken out of libxml */
static struct {
- unsigned int val;
- const char *name;
+ guint val;
+ const gchar *name;
} entity_map[] = {
/*
* the 4 absolute ones,
@@ -464,12 +464,12 @@ static GHashTable *entities;
/* this cannot be called in a thread context */
static void tokenise_setup(void)
{
- int i;
+ gint i;
if (entities == NULL) {
entities = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<sizeof(entity_map)/sizeof(entity_map[0]);i++) {
- g_hash_table_insert(entities, (char *)entity_map[i].name, GUINT_TO_POINTER(entity_map[i].val));
+ g_hash_table_insert(entities, (gchar *)entity_map[i].name, GUINT_TO_POINTER(entity_map[i].val));
}
}
}
@@ -496,7 +496,7 @@ static CamelHTMLParserPrivate *tokenise_init(void)
static void tokenise_free(CamelHTMLParserPrivate *p)
{
- int i;
+ gint i;
g_string_free(p->tag, TRUE);
g_string_free(p->ent, TRUE);
@@ -511,9 +511,9 @@ static void tokenise_free(CamelHTMLParserPrivate *p)
g_free(p);
}
-static int convert_entity(const char *e, char *ent)
+static gint convert_entity(const gchar *e, gchar *ent)
{
- unsigned int val;
+ guint val;
if (e[0] == '#')
return g_unichar_to_utf8(atoi(e+1), ent);
@@ -528,7 +528,7 @@ static int convert_entity(const char *e, char *ent)
#if 0
static void dump_tag(CamelHTMLParserPrivate *p)
{
- int i;
+ gint i;
printf("got tag: %s\n", p->tag->str);
printf("%d attributes:\n", p->attr);
@@ -538,13 +538,13 @@ static void dump_tag(CamelHTMLParserPrivate *p)
}
#endif
-static int tokenise_step(CamelHTMLParserPrivate *p, char **datap, int *lenp)
+static gint tokenise_step(CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
{
- char *in = p->inptr;
- char *inend = p->inend;
- char c;
- int state = p->state, ret, len;
- char *start = p->inptr;
+ gchar *in = p->inptr;
+ gchar *inend = p->inend;
+ gchar c;
+ gint state = p->state, ret, len;
+ gchar *start = p->inptr;
d(printf("Tokenise step\n"));
diff --git a/camel/camel-html-parser.h b/camel/camel-html-parser.h
index 7cad99a44..264965618 100644
--- a/camel/camel-html-parser.h
+++ b/camel/camel-html-parser.h
@@ -70,11 +70,11 @@ struct _CamelHTMLParserClass {
CamelType camel_html_parser_get_type (void);
CamelHTMLParser *camel_html_parser_new (void);
-void camel_html_parser_set_data(CamelHTMLParser *hp, const char *start, int len, int last);
-camel_html_parser_t camel_html_parser_step(CamelHTMLParser *hp, const char **datap, int *lenp);
-const char *camel_html_parser_left(CamelHTMLParser *hp, int *lenp);
-const char *camel_html_parser_tag(CamelHTMLParser *hp);
-const char *camel_html_parser_attr(CamelHTMLParser *hp, const char *name);
+void camel_html_parser_set_data(CamelHTMLParser *hp, const gchar *start, gint len, gint last);
+camel_html_parser_t camel_html_parser_step(CamelHTMLParser *hp, const gchar **datap, gint *lenp);
+const gchar *camel_html_parser_left(CamelHTMLParser *hp, gint *lenp);
+const gchar *camel_html_parser_tag(CamelHTMLParser *hp);
+const gchar *camel_html_parser_attr(CamelHTMLParser *hp, const gchar *name);
const GPtrArray *camel_html_parser_attr_list(CamelHTMLParser *hp, const GPtrArray **values);
G_END_DECLS
diff --git a/camel/camel-http-stream.c b/camel/camel-http-stream.c
index 6419741c5..ff11441c4 100644
--- a/camel/camel-http-stream.c
+++ b/camel/camel-http-stream.c
@@ -47,11 +47,11 @@
static CamelStreamClass *parent_class = NULL;
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-static int stream_reset (CamelStream *stream);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
+static gint stream_reset (CamelStream *stream);
static void
camel_http_stream_class_init (CamelHttpStreamClass *camel_http_stream_class)
@@ -149,7 +149,7 @@ CamelStream *
camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, CamelURL *url)
{
CamelHttpStream *stream;
- char *str;
+ gchar *str;
g_return_val_if_fail(CAMEL_IS_SESSION(session), NULL);
g_return_val_if_fail(url != NULL, NULL);
@@ -174,8 +174,8 @@ http_connect (CamelHttpStream *http, CamelURL *url)
{
CamelStream *stream = NULL;
struct addrinfo *ai, hints = { 0 };
- int errsave;
- char *serv;
+ gint errsave;
+ gchar *serv;
d(printf("connecting to http stream @ '%s'\n", url->host));
@@ -241,10 +241,10 @@ http_disconnect(CamelHttpStream *http)
}
}
-static const char *
-http_next_token (const unsigned char *in)
+static const gchar *
+http_next_token (const guchar *in)
{
- const unsigned char *inptr = in;
+ const guchar *inptr = in;
while (*inptr && !isspace ((int) *inptr))
inptr++;
@@ -252,14 +252,14 @@ http_next_token (const unsigned char *in)
while (*inptr && isspace ((int) *inptr))
inptr++;
- return (const char *) inptr;
+ return (const gchar *) inptr;
}
static int
http_get_statuscode (CamelHttpStream *http)
{
- const char *token;
- char buffer[4096];
+ const gchar *token;
+ gchar buffer[4096];
if (camel_stream_buffer_gets ((CamelStreamBuffer *)http->read, buffer, sizeof (buffer)) <= 0)
return -1;
@@ -268,7 +268,7 @@ http_get_statuscode (CamelHttpStream *http)
/* parse the HTTP status code */
if (!g_ascii_strncasecmp (buffer, "HTTP/", 5)) {
- token = http_next_token ((const unsigned char *) buffer);
+ token = http_next_token ((const guchar *) buffer);
http->statuscode = camel_header_decode_int (&token);
return http->statuscode;
}
@@ -282,10 +282,10 @@ static int
http_get_headers (CamelHttpStream *http)
{
struct _camel_header_raw *headers, *node, *tail;
- const char *type;
- char *buf;
+ const gchar *type;
+ gchar *buf;
size_t len;
- int err;
+ gint err;
if (http->parser)
camel_object_unref (http->parser);
@@ -350,8 +350,8 @@ http_get_headers (CamelHttpStream *http)
static int
http_method_invoke (CamelHttpStream *http)
{
- const char *method = NULL;
- char *url;
+ const gchar *method = NULL;
+ gchar *url;
switch (http->method) {
case CAMEL_HTTP_METHOD_GET:
@@ -408,10 +408,10 @@ http_method_invoke (CamelHttpStream *http)
}
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelHttpStream *http = CAMEL_HTTP_STREAM (stream);
- const char *parser_buf;
+ const gchar *parser_buf;
ssize_t nread;
if (http->method != CAMEL_HTTP_METHOD_GET && http->method != CAMEL_HTTP_METHOD_HEAD) {
@@ -447,7 +447,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
break;
case 301:
case 302: {
- char *loc;
+ gchar *loc;
CamelURL *url;
camel_content_type_unref (http->content_type);
@@ -501,7 +501,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
return -1;
}
@@ -560,7 +560,7 @@ camel_http_stream_get_content_type (CamelHttpStream *http_stream)
}
void
-camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const char *user_agent)
+camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const gchar *user_agent)
{
g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
@@ -569,7 +569,7 @@ camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const char *user
}
void
-camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url)
+camel_http_stream_set_proxy (CamelHttpStream *http_stream, const gchar *proxy_url)
{
g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
@@ -582,7 +582,7 @@ camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url
http_stream->proxy = camel_url_new (proxy_url, NULL);
if (http_stream->proxy && ((http_stream->proxy->user && *http_stream->proxy->user) || (http_stream->proxy->passwd && *http_stream->proxy->passwd))) {
- char *basic, *basic64;
+ gchar *basic, *basic64;
basic = g_strdup_printf("%s:%s", http_stream->proxy->user?http_stream->proxy->user:"",
http_stream->proxy->passwd?http_stream->proxy->passwd:"");
@@ -598,7 +598,7 @@ camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url
}
void
-camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const char *proxy_authrealm)
+camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const gchar *proxy_authrealm)
{
g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
@@ -607,7 +607,7 @@ camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const char
}
void
-camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const char *proxy_authpass)
+camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const gchar *proxy_authpass)
{
g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
diff --git a/camel/camel-http-stream.h b/camel/camel-http-stream.h
index 0a7fc4be1..890d7aaca 100644
--- a/camel/camel-http-stream.h
+++ b/camel/camel-http-stream.h
@@ -62,14 +62,14 @@ struct _CamelHttpStream {
struct _CamelSession *session;
CamelURL *url;
- char *user_agent;
+ gchar *user_agent;
/* proxy info */
CamelURL *proxy;
- char *authrealm;
- char *authpass;
+ gchar *authrealm;
+ gchar *authpass;
- int statuscode;
+ gint statuscode;
CamelStream *raw;
CamelStream *read;
@@ -87,11 +87,11 @@ CamelType camel_http_stream_get_type (void);
/* public methods */
CamelStream *camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, CamelURL *url);
-void camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const char *user_agent);
+void camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const gchar *user_agent);
-void camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url);
-void camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const char *proxy_authrealm);
-void camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const char *proxy_authpass);
+void camel_http_stream_set_proxy (CamelHttpStream *http_stream, const gchar *proxy_url);
+void camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const gchar *proxy_authrealm);
+void camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const gchar *proxy_authpass);
CamelContentType *camel_http_stream_get_content_type (CamelHttpStream *http_stream);
diff --git a/camel/camel-iconv.c b/camel/camel-iconv.c
index 95ec3612d..4cbf02f9e 100644
--- a/camel/camel-iconv.c
+++ b/camel/camel-iconv.c
@@ -72,7 +72,7 @@ struct _iconv_cache_node {
struct _iconv_cache *parent;
- int busy;
+ gint busy;
iconv_t ip;
};
@@ -80,7 +80,7 @@ struct _iconv_cache {
struct _iconv_cache *next;
struct _iconv_cache *prev;
- char *conv;
+ gchar *conv;
CamelDList open; /* stores iconv_cache_nodes, busy ones up front */
};
@@ -90,15 +90,15 @@ struct _iconv_cache {
static CamelDList iconv_cache_list;
static GHashTable *iconv_cache;
static GHashTable *iconv_cache_open;
-static unsigned int iconv_cache_size = 0;
+static guint iconv_cache_size = 0;
static GHashTable *iconv_charsets = NULL;
-static char *locale_charset = NULL;
-static char *locale_lang = NULL;
+static gchar *locale_charset = NULL;
+static gchar *locale_lang = NULL;
struct {
- char *charset;
- char *iconv_name;
+ gchar *charset;
+ gchar *iconv_name;
} known_iconv_charsets[] = {
#if 0
/* charset name, iconv-friendly charset name */
@@ -193,10 +193,10 @@ static CamelDListNode *camel_dlist_remove(CamelDListNode *n)
}
-static const char *
-e_strdown (char *str)
+static const gchar *
+e_strdown (gchar *str)
{
- register char *s = str;
+ register gchar *s = str;
while (*s) {
if (*s >= 'A' && *s <= 'Z')
@@ -207,10 +207,10 @@ e_strdown (char *str)
return str;
}
-static const char *
-e_strup (char *str)
+static const gchar *
+e_strup (gchar *str)
{
- register char *s = str;
+ register gchar *s = str;
while (*s) {
if (*s >= 'a' && *s <= 'z')
@@ -223,9 +223,9 @@ e_strup (char *str)
static void
-locale_parse_lang (const char *locale)
+locale_parse_lang (const gchar *locale)
{
- char *codeset, *lang;
+ gchar *codeset, *lang;
if ((codeset = strchr (locale, '.')))
lang = g_strndup (locale, codeset - locale);
@@ -262,10 +262,10 @@ locale_parse_lang (const char *locale)
/* NOTE: Owns the lock on return if keep is TRUE ! */
static void
-camel_iconv_init(int keep)
+camel_iconv_init(gint keep)
{
- char *from, *to, *locale;
- int i;
+ gchar *from, *to, *locale;
+ gint i;
LOCK();
@@ -318,7 +318,7 @@ camel_iconv_init(int keep)
* codeset is a character set or encoding identifier like
* ISO-8859-1 or UTF-8.
*/
- char *codeset, *p;
+ gchar *codeset, *p;
codeset = strchr (locale, '.');
if (codeset) {
@@ -350,7 +350,7 @@ camel_iconv_init(int keep)
const gchar *
camel_iconv_charset_name (const gchar *charset)
{
- char *name, *ret, *tmp;
+ gchar *name, *ret, *tmp;
if (charset == NULL)
return NULL;
@@ -369,8 +369,8 @@ camel_iconv_charset_name (const gchar *charset)
/* Unknown, try canonicalise some basic charset types to something that should work */
if (strncmp(name, "iso", 3) == 0) {
/* Convert iso-nnnn-n or isonnnn-n or iso_nnnn-n to iso-nnnn-n or isonnnn-n */
- int iso, codepage;
- char *p;
+ gint iso, codepage;
+ gchar *p;
tmp = name + 3;
if (*tmp == '-' || *tmp == '_')
@@ -448,11 +448,11 @@ flush_entry(struct _iconv_cache *ic)
iconv_t
camel_iconv_open (const gchar *oto, const gchar *ofrom)
{
- const char *to, *from;
- char *tofrom;
+ const gchar *to, *from;
+ gchar *tofrom;
struct _iconv_cache *ic;
struct _iconv_cache_node *in;
- int errnosav;
+ gint errnosav;
iconv_t ip;
if (oto == NULL || ofrom == NULL) {
@@ -509,7 +509,7 @@ camel_iconv_open (const gchar *oto, const gchar *ofrom)
* that die if the length arguments are NULL
*/
size_t buggy_iconv_len = 0;
- char *buggy_iconv_buf = NULL;
+ gchar *buggy_iconv_buf = NULL;
/* resets the converter */
iconv(ip, &buggy_iconv_buf, &buggy_iconv_len, &buggy_iconv_buf, &buggy_iconv_len);
@@ -544,7 +544,7 @@ gsize
camel_iconv (iconv_t cd, const gchar **inbuf, gsize *inbytesleft,
gchar ** outbuf, gsize *outbytesleft)
{
- return iconv(cd, (char **) inbuf, inbytesleft, outbuf, outbytesleft);
+ return iconv(cd, (gchar **) inbuf, inbytesleft, outbuf, outbytesleft);
}
void
@@ -592,8 +592,8 @@ camel_iconv_locale_language (void)
* camel_iconv_charset_name() so that we don't have to keep track of all
* the aliases too. */
static struct {
- char *charset;
- char *lang;
+ gchar *charset;
+ gchar *lang;
} cjkr_lang_map[] = {
{ "Big5", "zh" },
{ "BIG5HKSCS", "zh" },
@@ -614,7 +614,7 @@ static struct {
const gchar *
camel_iconv_charset_language (const gchar *charset)
{
- int i;
+ gint i;
if (!charset)
return NULL;
diff --git a/camel/camel-index-control.c b/camel/camel-index-control.c
index 96391e0be..e09711b27 100644
--- a/camel/camel-index-control.c
+++ b/camel/camel-index-control.c
@@ -21,7 +21,7 @@
#include "camel-text-index.h"
static void
-do_usage(char *argv0)
+do_usage(gchar *argv0)
{
fprintf(stderr, "Usage: %s [ compress | dump | info ] file(s) ...\n", argv0);
fprintf(stderr, " compress - compress (an) index file(s)\n");
@@ -31,9 +31,9 @@ do_usage(char *argv0)
}
static int
-do_compress(int argc, char **argv)
+do_compress(gint argc, gchar **argv)
{
- int i;
+ gint i;
CamelIndex *idx;
for (i=2;i<argc;i++) {
@@ -55,9 +55,9 @@ do_compress(int argc, char **argv)
}
static int
-do_dump(int argc, char **argv)
+do_dump(gint argc, gchar **argv)
{
- int i;
+ gint i;
CamelIndex *idx;
for (i=2;i<argc;i++) {
@@ -76,9 +76,9 @@ do_dump(int argc, char **argv)
}
static int
-do_info(int argc, char **argv)
+do_info(gint argc, gchar **argv)
{
- int i;
+ gint i;
CamelIndex *idx;
for (i=2;i<argc;i++) {
@@ -96,9 +96,9 @@ do_info(int argc, char **argv)
}
static int
-do_check(int argc, char **argv)
+do_check(gint argc, gchar **argv)
{
- int i;
+ gint i;
CamelIndex *idx;
for (i=2;i<argc;i++) {
@@ -115,11 +115,11 @@ do_check(int argc, char **argv)
return 1;
}
-static int do_perf(int argc, char **argv);
+static gint do_perf(gint argc, gchar **argv);
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
- extern int camel_init(const char *certdb_dir, gboolean nss_init);
+ extern gint camel_init(const gchar *certdb_dir, gboolean nss_init);
if (argc<2)
do_usage(argv[0]);
@@ -150,15 +150,15 @@ int main(int argc, char **argv)
#include "camel-stream-fs.h"
static int
-do_perf(int argc, char **argv)
+do_perf(gint argc, gchar **argv)
{
CamelIndex *idx;
DIR *dir;
- char *path = "/home/notzed/evolution/local/Inbox/mbox/cur";
+ gchar *path = "/home/notzed/evolution/local/Inbox/mbox/cur";
struct dirent *d;
CamelStream *null, *filter, *stream;
CamelMimeFilterIndex *filter_index;
- char *name;
+ gchar *name;
CamelIndexName *idn;
dir = opendir(path);
diff --git a/camel/camel-index.c b/camel/camel-index.c
index ea4b052bb..afcf497ed 100644
--- a/camel/camel-index.c
+++ b/camel/camel-index.c
@@ -40,7 +40,7 @@
#define CAMEL_INDEX_VERSION (0x01)
struct _CamelIndexPrivate {
- void *dummy;
+ gpointer dummy;
};
#define _PRIVATE(o) (((CamelIndex *)(o))->priv)
@@ -95,7 +95,7 @@ camel_index_get_type(void)
}
CamelIndex *
-camel_index_new(const char *path, int flags)
+camel_index_new(const gchar *path, gint flags)
{
CamelIndex *idx = (CamelIndex *)camel_object_new(camel_index_get_type());
@@ -105,15 +105,15 @@ camel_index_new(const char *path, int flags)
}
void
-camel_index_construct(CamelIndex *idx, const char *path, int flags)
+camel_index_construct(CamelIndex *idx, const gchar *path, gint flags)
{
g_free(idx->path);
idx->path = g_strdup_printf("%s.index", path);
idx->flags = flags;
}
-int
-camel_index_rename(CamelIndex *idx, const char *path)
+gint
+camel_index_rename(CamelIndex *idx, const gchar *path)
{
g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
@@ -126,7 +126,7 @@ camel_index_rename(CamelIndex *idx, const char *path)
}
void
-camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, void *data)
+camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, gpointer data)
{
g_return_if_fail (CAMEL_IS_INDEX (idx));
@@ -134,7 +134,7 @@ camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, void *data)
idx->normalise_data = data;
}
-int
+gint
camel_index_sync(CamelIndex *idx)
{
g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
@@ -147,7 +147,7 @@ camel_index_sync(CamelIndex *idx)
}
}
-int
+gint
camel_index_compress(CamelIndex *idx)
{
g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
@@ -160,10 +160,10 @@ camel_index_compress(CamelIndex *idx)
}
}
-int
+gint
camel_index_delete(CamelIndex *idx)
{
- int ret;
+ gint ret;
g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
@@ -178,8 +178,8 @@ camel_index_delete(CamelIndex *idx)
return ret;
}
-int
-camel_index_has_name(CamelIndex *idx, const char *name)
+gint
+camel_index_has_name(CamelIndex *idx, const gchar *name)
{
g_return_val_if_fail (CAMEL_IS_INDEX (idx), FALSE);
@@ -190,7 +190,7 @@ camel_index_has_name(CamelIndex *idx, const char *name)
}
CamelIndexName *
-camel_index_add_name(CamelIndex *idx, const char *name)
+camel_index_add_name(CamelIndex *idx, const gchar *name)
{
g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
@@ -200,7 +200,7 @@ camel_index_add_name(CamelIndex *idx, const char *name)
return NULL;
}
-int
+gint
camel_index_write_name(CamelIndex *idx, CamelIndexName *idn)
{
g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
@@ -214,7 +214,7 @@ camel_index_write_name(CamelIndex *idx, CamelIndexName *idn)
}
CamelIndexCursor *
-camel_index_find_name(CamelIndex *idx, const char *name)
+camel_index_find_name(CamelIndex *idx, const gchar *name)
{
g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
@@ -225,7 +225,7 @@ camel_index_find_name(CamelIndex *idx, const char *name)
}
void
-camel_index_delete_name(CamelIndex *idx, const char *name)
+camel_index_delete_name(CamelIndex *idx, const gchar *name)
{
g_return_if_fail (CAMEL_IS_INDEX (idx));
@@ -234,9 +234,9 @@ camel_index_delete_name(CamelIndex *idx, const char *name)
}
CamelIndexCursor *
-camel_index_find(CamelIndex *idx, const char *word)
+camel_index_find(CamelIndex *idx, const gchar *word)
{
- char *b = (char *)word;
+ gchar *b = (gchar *)word;
CamelIndexCursor *ret;
g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
@@ -322,7 +322,7 @@ camel_index_name_get_type(void)
}
CamelIndexName *
-camel_index_name_new(CamelIndex *idx, const char *name)
+camel_index_name_new(CamelIndex *idx, const gchar *name)
{
CamelIndexName *idn = (CamelIndexName *)camel_object_new(camel_index_name_get_type());
@@ -333,9 +333,9 @@ camel_index_name_new(CamelIndex *idx, const char *name)
}
void
-camel_index_name_add_word(CamelIndexName *idn, const char *word)
+camel_index_name_add_word(CamelIndexName *idn, const gchar *word)
{
- char *b = (char *)word;
+ gchar *b = (gchar *)word;
if (idn->index->normalise)
b = idn->index->normalise(idn->index, word, idn->index->normalise_data);
@@ -347,7 +347,7 @@ camel_index_name_add_word(CamelIndexName *idn, const char *word)
}
size_t
-camel_index_name_add_buffer(CamelIndexName *idn, const char *buffer, size_t len)
+camel_index_name_add_buffer(CamelIndexName *idn, const gchar *buffer, size_t len)
{
return CIN_CLASS(idn)->add_buffer(idn, buffer, len);
}
@@ -397,7 +397,7 @@ camel_index_cursor_get_type(void)
}
CamelIndexCursor *
-camel_index_cursor_new(CamelIndex *idx, const char *name)
+camel_index_cursor_new(CamelIndex *idx, const gchar *name)
{
CamelIndexCursor *idc = (CamelIndexCursor *)camel_object_new(camel_index_cursor_get_type());
@@ -407,7 +407,7 @@ camel_index_cursor_new(CamelIndex *idx, const char *name)
return idc;
}
-const char *
+const gchar *
camel_index_cursor_next(CamelIndexCursor *idc)
{
return CIC_CLASS(idc)->next(idc);
diff --git a/camel/camel-index.h b/camel/camel-index.h
index 7e38ac3c1..7707ecb8a 100644
--- a/camel/camel-index.h
+++ b/camel/camel-index.h
@@ -47,7 +47,7 @@ typedef struct _CamelIndexNameClass CamelIndexNameClass;
typedef struct _CamelIndexCursor CamelIndexCursor;
typedef struct _CamelIndexCursorClass CamelIndexCursorClass;
-typedef char * (*CamelIndexNorm)(CamelIndex *idx, const char *word, void *data);
+typedef gchar * (*CamelIndexNorm)(CamelIndex *idx, const gchar *word, gpointer data);
/* ********************************************************************** */
@@ -62,15 +62,15 @@ struct _CamelIndexCursor {
struct _CamelIndexCursorClass {
CamelObjectClass parent;
- const char * (*next) (CamelIndexCursor *idc);
+ const gchar * (*next) (CamelIndexCursor *idc);
void (*reset) (CamelIndexCursor *idc);
};
CamelType camel_index_cursor_get_type(void);
-CamelIndexCursor *camel_index_cursor_new(CamelIndex *idx, const char *name);
+CamelIndexCursor *camel_index_cursor_new(CamelIndex *idx, const gchar *name);
-const char *camel_index_cursor_next(CamelIndexCursor *idc);
+const gchar *camel_index_cursor_next(CamelIndexCursor *idc);
void camel_index_cursor_reset(CamelIndexCursor *idc);
/* ********************************************************************** */
@@ -82,7 +82,7 @@ struct _CamelIndexName {
CamelIndex *index;
- char *name; /* name being indexed */
+ gchar *name; /* name being indexed */
GByteArray *buffer; /* used for normalisation */
GHashTable *words; /* unique list of words */
@@ -91,17 +91,17 @@ struct _CamelIndexName {
struct _CamelIndexNameClass {
CamelObjectClass parent;
- int (*sync)(CamelIndexName *name);
- void (*add_word)(CamelIndexName *name, const char *word);
- size_t (*add_buffer)(CamelIndexName *name, const char *buffer, size_t len);
+ gint (*sync)(CamelIndexName *name);
+ void (*add_word)(CamelIndexName *name, const gchar *word);
+ size_t (*add_buffer)(CamelIndexName *name, const gchar *buffer, size_t len);
};
CamelType camel_index_name_get_type (void);
-CamelIndexName *camel_index_name_new(CamelIndex *idx, const char *name);
+CamelIndexName *camel_index_name_new(CamelIndex *idx, const gchar *name);
-void camel_index_name_add_word(CamelIndexName *name, const char *word);
-size_t camel_index_name_add_buffer(CamelIndexName *name, const char *buffer, size_t len);
+void camel_index_name_add_word(CamelIndexName *name, const gchar *word);
+size_t camel_index_name_add_buffer(CamelIndexName *name, const gchar *buffer, size_t len);
/* ********************************************************************** */
@@ -110,13 +110,13 @@ struct _CamelIndex {
struct _CamelIndexPrivate *priv;
- char *path;
+ gchar *path;
guint32 version;
guint32 flags; /* open flags */
guint32 state;
CamelIndexNorm normalise;
- void *normalise_data;
+ gpointer normalise_data;
};
struct _CamelIndexClass {
@@ -126,14 +126,14 @@ struct _CamelIndexClass {
int (*compress)(CamelIndex *idx);
int (*delete)(CamelIndex *idx);
- int (*rename)(CamelIndex *idx, const char *path);
+ int (*rename)(CamelIndex *idx, const gchar *path);
- int (*has_name)(CamelIndex *idx, const char *name);
- CamelIndexName * (*add_name)(CamelIndex *idx, const char *name);
+ int (*has_name)(CamelIndex *idx, const gchar *name);
+ CamelIndexName * (*add_name)(CamelIndex *idx, const gchar *name);
int (*write_name)(CamelIndex *idx, CamelIndexName *idn);
- CamelIndexCursor * (*find_name)(CamelIndex *idx, const char *name);
- void (*delete_name)(CamelIndex *idx, const char *name);
- CamelIndexCursor * (*find)(CamelIndex *idx, const char *word);
+ CamelIndexCursor * (*find_name)(CamelIndex *idx, const gchar *name);
+ void (*delete_name)(CamelIndex *idx, const gchar *name);
+ CamelIndexCursor * (*find)(CamelIndex *idx, const gchar *word);
CamelIndexCursor * (*words)(CamelIndex *idx);
CamelIndexCursor * (*names)(CamelIndex *idx);
@@ -144,22 +144,22 @@ struct _CamelIndexClass {
CamelType camel_index_get_type (void);
-CamelIndex *camel_index_new(const char *path, int flags);
-void camel_index_construct(CamelIndex *, const char *path, int flags);
-int camel_index_rename(CamelIndex *, const char *path);
+CamelIndex *camel_index_new(const gchar *path, gint flags);
+void camel_index_construct(CamelIndex *, const gchar *path, gint flags);
+int camel_index_rename(CamelIndex *, const gchar *path);
-void camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, void *data);
+void camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, gpointer data);
-int camel_index_sync(CamelIndex *idx);
-int camel_index_compress(CamelIndex *idx);
+gint camel_index_sync(CamelIndex *idx);
+gint camel_index_compress(CamelIndex *idx);
int camel_index_delete(CamelIndex *idx);
-int camel_index_has_name(CamelIndex *idx, const char *name);
-CamelIndexName *camel_index_add_name(CamelIndex *idx, const char *name);
-int camel_index_write_name(CamelIndex *idx, CamelIndexName *idn);
-CamelIndexCursor *camel_index_find_name(CamelIndex *idx, const char *name);
-void camel_index_delete_name(CamelIndex *idx, const char *name);
-CamelIndexCursor *camel_index_find(CamelIndex *idx, const char *word);
+gint camel_index_has_name(CamelIndex *idx, const gchar *name);
+CamelIndexName *camel_index_add_name(CamelIndex *idx, const gchar *name);
+gint camel_index_write_name(CamelIndex *idx, CamelIndexName *idn);
+CamelIndexCursor *camel_index_find_name(CamelIndex *idx, const gchar *name);
+void camel_index_delete_name(CamelIndex *idx, const gchar *name);
+CamelIndexCursor *camel_index_find(CamelIndex *idx, const gchar *word);
CamelIndexCursor *camel_index_words(CamelIndex *idx);
CamelIndexCursor *camel_index_names(CamelIndex *idx);
diff --git a/camel/camel-internet-address.c b/camel/camel-internet-address.c
index fafe22b9a..10329ce41 100644
--- a/camel/camel-internet-address.c
+++ b/camel/camel-internet-address.c
@@ -26,12 +26,12 @@
#define d(x)
-static int internet_decode (CamelAddress *, const char *raw);
-static char * internet_encode (CamelAddress *);
-static int internet_unformat (CamelAddress *, const char *raw);
-static char * internet_format (CamelAddress *);
-static int internet_cat (CamelAddress *dest, const CamelAddress *source);
-static void internet_remove (CamelAddress *, int index);
+static gint internet_decode (CamelAddress *, const gchar *raw);
+static gchar * internet_encode (CamelAddress *);
+static gint internet_unformat (CamelAddress *, const gchar *raw);
+static gchar * internet_format (CamelAddress *);
+static gint internet_cat (CamelAddress *dest, const CamelAddress *source);
+static void internet_remove (CamelAddress *, gint index);
static void camel_internet_address_class_init (CamelInternetAddressClass *klass);
static void camel_internet_address_init (CamelInternetAddress *obj);
@@ -39,8 +39,8 @@ static void camel_internet_address_init (CamelInternetAddress *obj);
static CamelAddressClass *camel_internet_address_parent;
struct _address {
- char *name;
- char *address;
+ gchar *name;
+ gchar *address;
};
static void
@@ -82,10 +82,10 @@ camel_internet_address_get_type(void)
}
static int
-internet_decode (CamelAddress *a, const char *raw)
+internet_decode (CamelAddress *a, const gchar *raw)
{
struct _camel_header_address *ha, *n;
- int count = a->addresses->len;
+ gint count = a->addresses->len;
/* Should probably use its own decoder or something */
ha = camel_header_address_decode(raw, NULL);
@@ -111,13 +111,13 @@ internet_decode (CamelAddress *a, const char *raw)
return a->addresses->len - count;
}
-static char *
+static gchar *
internet_encode (CamelAddress *a)
{
- int i;
+ gint i;
GString *out;
- char *ret;
- int len = 6; /* "From: ", assume longer of the address headers */
+ gchar *ret;
+ gint len = 6; /* "From: ", assume longer of the address headers */
if (a->addresses->len == 0)
return NULL;
@@ -126,7 +126,7 @@ internet_encode (CamelAddress *a)
for (i = 0;i < a->addresses->len; i++) {
struct _address *addr = g_ptr_array_index(a->addresses, i);
- char *enc;
+ gchar *enc;
if (i != 0)
g_string_append(out, ", ");
@@ -143,11 +143,11 @@ internet_encode (CamelAddress *a)
}
static int
-internet_unformat(CamelAddress *a, const char *raw)
+internet_unformat(CamelAddress *a, const gchar *raw)
{
- char *buffer, *p, *name, *addr;
- int c;
- int count = a->addresses->len;
+ gchar *buffer, *p, *name, *addr;
+ gint c;
+ gint count = a->addresses->len;
if (raw == NULL)
return 0;
@@ -208,12 +208,12 @@ internet_unformat(CamelAddress *a, const char *raw)
return a->addresses->len - count;
}
-static char *
+static gchar *
internet_format (CamelAddress *a)
{
- int i;
+ gint i;
GString *out;
- char *ret;
+ gchar *ret;
if (a->addresses->len == 0)
return NULL;
@@ -222,7 +222,7 @@ internet_format (CamelAddress *a)
for (i = 0;i < a->addresses->len; i++) {
struct _address *addr = g_ptr_array_index(a->addresses, i);
- char *enc;
+ gchar *enc;
if (i != 0)
g_string_append(out, ", ");
@@ -241,7 +241,7 @@ internet_format (CamelAddress *a)
static int
internet_cat (CamelAddress *dest, const CamelAddress *source)
{
- int i;
+ gint i;
g_assert(CAMEL_IS_INTERNET_ADDRESS(source));
@@ -254,7 +254,7 @@ internet_cat (CamelAddress *dest, const CamelAddress *source)
}
static void
-internet_remove (CamelAddress *a, int index)
+internet_remove (CamelAddress *a, gint index)
{
struct _address *addr;
@@ -294,11 +294,11 @@ camel_internet_address_new (void)
*
* Returns: the index of added entry
**/
-int
-camel_internet_address_add (CamelInternetAddress *addr, const char *name, const char *address)
+gint
+camel_internet_address_add (CamelInternetAddress *addr, const gchar *name, const gchar *address)
{
struct _address *new;
- int index;
+ gint index;
g_assert(CAMEL_IS_INTERNET_ADDRESS(addr));
@@ -324,7 +324,7 @@ camel_internet_address_add (CamelInternetAddress *addr, const char *name, const
* Returns: %TRUE if such an address exists, or %FALSE otherwise
**/
gboolean
-camel_internet_address_get (const CamelInternetAddress *addr, int index, const char **namep, const char **addressp)
+camel_internet_address_get (const CamelInternetAddress *addr, gint index, const gchar **namep, const gchar **addressp)
{
struct _address *a;
@@ -353,11 +353,11 @@ camel_internet_address_get (const CamelInternetAddress *addr, int index, const c
* Returns: the index of the address matching the name, or %-1 if no
* match was found
**/
-int
-camel_internet_address_find_name(CamelInternetAddress *addr, const char *name, const char **addressp)
+gint
+camel_internet_address_find_name(CamelInternetAddress *addr, const gchar *name, const gchar **addressp)
{
struct _address *a;
- int i, len;
+ gint i, len;
g_assert(CAMEL_IS_INTERNET_ADDRESS(addr));
@@ -384,11 +384,11 @@ camel_internet_address_find_name(CamelInternetAddress *addr, const char *name, c
*
* Returns: the index of the address, or %-1 if not found
**/
-int
-camel_internet_address_find_address(CamelInternetAddress *addr, const char *address, const char **namep)
+gint
+camel_internet_address_find_address(CamelInternetAddress *addr, const gchar *address, const gchar **namep)
{
struct _address *a;
- int i, len;
+ gint i, len;
g_assert(CAMEL_IS_INTERNET_ADDRESS(addr));
@@ -405,9 +405,9 @@ camel_internet_address_find_address(CamelInternetAddress *addr, const char *addr
}
static void
-cia_encode_addrspec(GString *out, const char *addr)
+cia_encode_addrspec(GString *out, const gchar *addr)
{
- const char *at, *p;
+ const gchar *at, *p;
at = strchr(addr, '@');
if (at == NULL)
@@ -415,7 +415,7 @@ cia_encode_addrspec(GString *out, const char *addr)
p = addr;
while (p < at) {
- char c = *p++;
+ gchar c = *p++;
/* strictly by rfc, we should split local parts on dots.
however i think 2822 changes this, and not many clients grok it, so
@@ -456,12 +456,12 @@ append:
*
* Returns: the encoded address
**/
-char *
-camel_internet_address_encode_address(int *inlen, const char *real, const char *addr)
+gchar *
+camel_internet_address_encode_address(gint *inlen, const gchar *real, const gchar *addr)
{
- char *name = camel_header_encode_phrase ((const unsigned char *) real);
- char *ret = NULL;
- int len = 0;
+ gchar *name = camel_header_encode_phrase ((const guchar *) real);
+ gchar *ret = NULL;
+ gint len = 0;
GString *out = g_string_new("");
g_assert(addr);
@@ -471,8 +471,8 @@ camel_internet_address_encode_address(int *inlen, const char *real, const char *
if (name && name[0]) {
if (inlen != NULL && (strlen(name) + len) > CAMEL_FOLD_SIZE) {
- char *folded = camel_header_address_fold(name, len);
- char *last;
+ gchar *folded = camel_header_address_fold(name, len);
+ gchar *last;
g_string_append(out, folded);
g_free(folded);
last = strrchr(out->str, '\n');
@@ -527,16 +527,16 @@ camel_internet_address_encode_address(int *inlen, const char *real, const char *
*
* Returns: a nicely formatted string containing the rfc822 address
**/
-char *
-camel_internet_address_format_address(const char *name, const char *addr)
+gchar *
+camel_internet_address_format_address(const gchar *name, const gchar *addr)
{
- char *ret = NULL;
+ gchar *ret = NULL;
g_assert(addr);
if (name && name[0]) {
- const char *p = name;
- char *o, c;
+ const gchar *p = name;
+ gchar *o, c;
while ((c = *p++)) {
if (c == '\"' || c == ',') {
diff --git a/camel/camel-internet-address.h b/camel/camel-internet-address.h
index 50ad5a541..3e4bb1954 100644
--- a/camel/camel-internet-address.h
+++ b/camel/camel-internet-address.h
@@ -45,15 +45,15 @@ struct _CamelInternetAddressClass {
CamelType camel_internet_address_get_type (void);
CamelInternetAddress *camel_internet_address_new (void);
-int camel_internet_address_add (CamelInternetAddress *addr, const char *name, const char *address);
-gboolean camel_internet_address_get (const CamelInternetAddress *addr, int index, const char **namep, const char **addressp);
+int camel_internet_address_add (CamelInternetAddress *addr, const gchar *name, const gchar *address);
+gboolean camel_internet_address_get (const CamelInternetAddress *addr, gint index, const gchar **namep, const gchar **addressp);
-int camel_internet_address_find_name(CamelInternetAddress *addr, const char *name, const char **addressp);
-int camel_internet_address_find_address(CamelInternetAddress *addr, const char *address, const char **namep);
+int camel_internet_address_find_name(CamelInternetAddress *addr, const gchar *name, const gchar **addressp);
+int camel_internet_address_find_address(CamelInternetAddress *addr, const gchar *address, const gchar **namep);
/* utility functions, for network/display formatting */
-char * camel_internet_address_encode_address(int *len, const char *name, const char *addr);
-char * camel_internet_address_format_address(const char *name, const char *addr);
+gchar * camel_internet_address_encode_address(gint *len, const gchar *name, const gchar *addr);
+gchar * camel_internet_address_format_address(const gchar *name, const gchar *addr);
G_END_DECLS
diff --git a/camel/camel-junk-plugin.c b/camel/camel-junk-plugin.c
index 3ae94898d..86d7376dd 100644
--- a/camel/camel-junk-plugin.c
+++ b/camel/camel-junk-plugin.c
@@ -30,7 +30,7 @@
#define d(x) (camel_debug("junk")?(x):0)
-const char *
+const gchar *
camel_junk_plugin_get_name (CamelJunkPlugin *csp)
{
g_return_val_if_fail (csp->get_name != NULL, NULL);
@@ -40,7 +40,7 @@ camel_junk_plugin_get_name (CamelJunkPlugin *csp)
return csp->get_name (csp);
}
-int
+gint
camel_junk_plugin_check_junk (CamelJunkPlugin *csp, CamelMimeMessage *message)
{
g_return_val_if_fail (csp->check_junk != NULL, FALSE);
diff --git a/camel/camel-junk-plugin.h b/camel/camel-junk-plugin.h
index 6f0f54ee0..82924f1d6 100644
--- a/camel/camel-junk-plugin.h
+++ b/camel/camel-junk-plugin.h
@@ -33,14 +33,14 @@ struct _CamelMimeMessage;
struct _CamelJunkPlugin
{
/* junk filter human readable name, translated */
- const char * (*get_name) (struct _CamelJunkPlugin *csp);
+ const gchar * (*get_name) (struct _CamelJunkPlugin *csp);
/* should be set to 1 */
- int api_version;
+ gint api_version;
/* when called, it should return TRUE if message is identified as junk,
FALSE otherwise */
- int (*check_junk) (struct _CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
+ gint (*check_junk) (struct _CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
/* called when user identified a message to be junk */
void (*report_junk) (struct _CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
@@ -55,8 +55,8 @@ struct _CamelJunkPlugin
void (*init) (struct _CamelJunkPlugin *csp);
};
-const char * camel_junk_plugin_get_name (CamelJunkPlugin *csp);
-int camel_junk_plugin_check_junk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
+const gchar * camel_junk_plugin_get_name (CamelJunkPlugin *csp);
+gint camel_junk_plugin_check_junk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
void camel_junk_plugin_report_junk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
void camel_junk_plugin_report_notjunk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
void camel_junk_plugin_commit_reports (CamelJunkPlugin *csp);
diff --git a/camel/camel-list-utils.c b/camel/camel-list-utils.c
index fef835f2f..bf9489bcb 100644
--- a/camel/camel-list-utils.c
+++ b/camel/camel-list-utils.c
@@ -153,7 +153,7 @@ camel_dlist_remtail (CamelDList *l)
*
* Return value: %TRUE if @l is an empty list, %FALSE otherwise.
**/
-int
+gint
camel_dlist_empty (CamelDList *l)
{
return (l->head == (CamelDListNode *)&l->tail);
@@ -167,11 +167,11 @@ camel_dlist_empty (CamelDList *l)
*
* Return value: The number of nodes.
**/
-int
+gint
camel_dlist_length (CamelDList *l)
{
CamelDListNode *n, *nn;
- int count = 0;
+ gint count = 0;
n = l->head;
nn = n->next;
@@ -264,17 +264,17 @@ camel_slist_remtail (CamelSList *l)
return n;
}
-int
+gint
camel_slist_empty (CamelSList *l)
{
return (l->head == NULL);
}
-int
+gint
camel_slist_length (CamelSList *l)
{
CamelSListNode *n;
- int count = 0;
+ gint count = 0;
n = l->head;
while (n) {
diff --git a/camel/camel-list-utils.h b/camel/camel-list-utils.h
index 5ce5a35c9..e75ef2319 100644
--- a/camel/camel-list-utils.h
+++ b/camel/camel-list-utils.h
@@ -80,8 +80,8 @@ CamelDListNode *camel_dlist_addtail(CamelDList *l, CamelDListNode *n);
CamelDListNode *camel_dlist_remove(CamelDListNode *n);
CamelDListNode *camel_dlist_remhead(CamelDList *l);
CamelDListNode *camel_dlist_remtail(CamelDList *l);
-int camel_dlist_empty(CamelDList *l);
-int camel_dlist_length(CamelDList *l);
+gint camel_dlist_empty(CamelDList *l);
+gint camel_dlist_length(CamelDList *l);
/* This is provided mostly for orthogonality with the dlist structure.
* By making the nodes contain all of the data themselves it
@@ -124,8 +124,8 @@ CamelSListNode *camel_slist_addtail(CamelSList *l, CamelSListNode *n);
CamelSListNode *camel_slist_remove(CamelSList *l, CamelSListNode *n);
CamelSListNode *camel_slist_remhead(CamelSList *l);
CamelSListNode *camel_slist_remtail(CamelSList *l);
-int camel_slist_empty(CamelSList *l);
-int camel_slist_length(CamelSList *l);
+gint camel_slist_empty(CamelSList *l);
+gint camel_slist_length(CamelSList *l);
G_END_DECLS
diff --git a/camel/camel-lock-client.c b/camel/camel-lock-client.c
index 54c8dc123..8b480d8a2 100644
--- a/camel/camel-lock-client.c
+++ b/camel/camel-lock-client.c
@@ -48,14 +48,14 @@ static pthread_mutex_t lock_lock = PTHREAD_MUTEX_INITIALIZER;
#define LOCK() pthread_mutex_lock(&lock_lock)
#define UNLOCK() pthread_mutex_unlock(&lock_lock)
-static int lock_sequence;
-static int lock_helper_pid = -1;
-static int lock_stdin_pipe[2], lock_stdout_pipe[2];
+static gint lock_sequence;
+static gint lock_helper_pid = -1;
+static gint lock_stdin_pipe[2], lock_stdout_pipe[2];
-static int read_n(int fd, void *buffer, int inlen)
+static gint read_n(gint fd, gpointer buffer, gint inlen)
{
- char *p = buffer;
- int len, left = inlen;
+ gchar *p = buffer;
+ gint len, left = inlen;
do {
len = read(fd, p, left);
@@ -71,10 +71,10 @@ static int read_n(int fd, void *buffer, int inlen)
return inlen - left;
}
-static int write_n(int fd, void *buffer, int inlen)
+static gint write_n(gint fd, gpointer buffer, gint inlen)
{
- char *p = buffer;
- int len, left = inlen;
+ gchar *p = buffer;
+ gint len, left = inlen;
do {
len = write(fd, p, left);
@@ -90,9 +90,9 @@ static int write_n(int fd, void *buffer, int inlen)
return inlen;
}
-static int camel_lock_helper_init(CamelException *ex)
+static gint camel_lock_helper_init(CamelException *ex)
{
- int i;
+ gint i;
lock_stdin_pipe[0] = -1;
lock_stdin_pipe[1] = -1;
@@ -152,12 +152,12 @@ static int camel_lock_helper_init(CamelException *ex)
return 0;
}
-int camel_lock_helper_lock(const char *path, CamelException *ex)
+gint camel_lock_helper_lock(const gchar *path, CamelException *ex)
{
struct _CamelLockHelperMsg *msg;
- int len = strlen(path);
- int res = -1;
- int retry = 3;
+ gint len = strlen(path);
+ gint res = -1;
+ gint retry = 3;
LOCK();
@@ -234,12 +234,12 @@ fail:
return res;
}
-int camel_lock_helper_unlock(int lockid)
+gint camel_lock_helper_unlock(gint lockid)
{
struct _CamelLockHelperMsg *msg;
- int res = -1;
- int retry = 3;
- int len;
+ gint res = -1;
+ gint retry = 3;
+ gint len;
d(printf("unlocking lock id %d\n", lockid));
@@ -308,9 +308,9 @@ fail:
}
#if 0
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
- int id1, id2;
+ gint id1, id2;
d(printf("locking started\n"));
camel_lock_helper_init();
diff --git a/camel/camel-lock-client.h b/camel/camel-lock-client.h
index 732a3185b..a343326ee 100644
--- a/camel/camel-lock-client.h
+++ b/camel/camel-lock-client.h
@@ -28,8 +28,8 @@
G_BEGIN_DECLS
-int camel_lock_helper_lock(const char *path , CamelException *ex);
-int camel_lock_helper_unlock(int lockid);
+gint camel_lock_helper_lock(const gchar *path , CamelException *ex);
+gint camel_lock_helper_unlock(gint lockid);
G_END_DECLS
diff --git a/camel/camel-lock-helper.c b/camel/camel-lock-helper.c
index 9146db9e1..81153a51e 100644
--- a/camel/camel-lock-helper.c
+++ b/camel/camel-lock-helper.c
@@ -47,23 +47,23 @@
struct _lock_info {
struct _lock_info *next;
uid_t uid;
- int id;
- int depth;
+ gint id;
+ gint depth;
time_t stamp; /* when last updated */
- char path[1];
+ gchar path[1];
};
-static int lock_id = 0;
+static gint lock_id = 0;
static struct _lock_info *lock_info_list;
static uid_t lock_root_uid = -1;
static uid_t lock_real_uid = -1;
/* utility functions */
-static int read_n(int fd, void *buffer, int inlen)
+static gint read_n(gint fd, gpointer buffer, gint inlen)
{
- char *p = buffer;
- int len, left = inlen;
+ gchar *p = buffer;
+ gint len, left = inlen;
do {
len = read(fd, p, left);
@@ -79,10 +79,10 @@ static int read_n(int fd, void *buffer, int inlen)
return inlen - left;
}
-static int write_n(int fd, void *buffer, int inlen)
+static gint write_n(gint fd, gpointer buffer, gint inlen)
{
- char *p = buffer;
- int len, left = inlen;
+ gchar *p = buffer;
+ gint len, left = inlen;
do {
len = write(fd, p, left);
@@ -99,7 +99,7 @@ static int write_n(int fd, void *buffer, int inlen)
}
void
-camel_exception_setv (CamelException *ex, ExceptionId id, const char *format, ...)
+camel_exception_setv (CamelException *ex, ExceptionId id, const gchar *format, ...)
{
;
}
@@ -110,18 +110,18 @@ camel_exception_clear (CamelException *exception)
;
}
-char *gettext (const char *msgid);
+gchar *gettext (const gchar *msgid);
-char *
-gettext (const char *msgid)
+gchar *
+gettext (const gchar *msgid)
{
return NULL;
}
-static int lock_path(const char *path, guint32 *lockid)
+static gint lock_path(const gchar *path, guint32 *lockid)
{
struct _lock_info *info = NULL;
- int res = CAMEL_LOCK_HELPER_STATUS_OK;
+ gint res = CAMEL_LOCK_HELPER_STATUS_OK;
struct stat st;
d(fprintf(stderr, "locking path '%s' id = %d\n", path, lock_id));
@@ -202,7 +202,7 @@ fail:
return res;
}
-static int unlock_id(guint32 lockid)
+static gint unlock_id(guint32 lockid)
{
struct _lock_info *info, *p;
@@ -238,9 +238,9 @@ static int unlock_id(guint32 lockid)
return CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
}
-static void lock_touch(const char *path)
+static void lock_touch(const gchar *path)
{
- char *name;
+ gchar *name;
/* we could also check that we haven't had our lock stolen from us here */
@@ -281,12 +281,12 @@ static void setup_process(void)
#endif
}
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
struct _CamelLockHelperMsg msg;
- int len;
- int res;
- char *path;
+ gint len;
+ gint res;
+ gchar *path;
fd_set rset;
struct timeval tv;
struct _lock_info *info;
diff --git a/camel/camel-lock.c b/camel/camel-lock.c
index 2e2a76c8a..7ebd3ccdc 100644
--- a/camel/camel-lock.c
+++ b/camel/camel-lock.c
@@ -72,13 +72,13 @@
*
* Return value: -1 on error, sets @ex appropriately.
**/
-int
-camel_lock_dot(const char *path, CamelException *ex)
+gint
+camel_lock_dot(const gchar *path, CamelException *ex)
{
#ifdef USE_DOT
- char *locktmp, *lock;
- int retry = 0;
- int fdtmp;
+ gchar *locktmp, *lock;
+ gint retry = 0;
+ gint fdtmp;
struct stat st;
/* TODO: Is there a reliable way to refresh the lock, if we're still busy with it?
@@ -155,10 +155,10 @@ camel_lock_dot(const char *path, CamelException *ex)
* Attempt to unlock a .lock lock.
**/
void
-camel_unlock_dot(const char *path)
+camel_unlock_dot(const gchar *path)
{
#ifdef USE_DOT
- char *lock;
+ gchar *lock;
lock = alloca(strlen(path) + strlen(".lock") + 1);
sprintf(lock, "%s.lock", path);
@@ -180,8 +180,8 @@ camel_unlock_dot(const char *path)
*
* Return value: -1 on error.
**/
-int
-camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex)
+gint
+camel_lock_fcntl(gint fd, CamelLockType type, CamelException *ex)
{
#ifdef USE_FCNTL
struct flock lock;
@@ -200,7 +200,7 @@ camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex)
g_strerror (errno));
return -1;
} else {
- static int failed = 0;
+ static gint failed = 0;
if (failed == 0)
fprintf(stderr, "fcntl(2) locking appears not to work on this filesystem");
@@ -218,7 +218,7 @@ camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex)
* Unlock an fcntl lock.
**/
void
-camel_unlock_fcntl(int fd)
+camel_unlock_fcntl(gint fd)
{
#ifdef USE_FCNTL
struct flock lock;
@@ -244,11 +244,11 @@ camel_unlock_fcntl(int fd)
*
* Return value: -1 on error.
**/
-int
-camel_lock_flock(int fd, CamelLockType type, CamelException *ex)
+gint
+camel_lock_flock(gint fd, CamelLockType type, CamelException *ex)
{
#ifdef USE_FLOCK
- int op;
+ gint op;
d(printf("flock locking %d\n", fd));
@@ -274,7 +274,7 @@ camel_lock_flock(int fd, CamelLockType type, CamelException *ex)
* Unlock an flock lock.
**/
void
-camel_unlock_flock(int fd)
+camel_unlock_flock(gint fd)
{
#ifdef USE_FLOCK
d(printf("flock unlocking %d\n", fd));
@@ -295,10 +295,10 @@ camel_unlock_flock(int fd)
*
* Return value: -1 on error, @ex will describe the locking system that failed.
**/
-int
-camel_lock_folder(const char *path, int fd, CamelLockType type, CamelException *ex)
+gint
+camel_lock_folder(const gchar *path, gint fd, CamelLockType type, CamelException *ex)
{
- int retry = 0;
+ gint retry = 0;
while (retry < CAMEL_LOCK_RETRY) {
if (retry > 0)
@@ -326,7 +326,7 @@ camel_lock_folder(const char *path, int fd, CamelLockType type, CamelException *
* Free a lock on a folder.
**/
void
-camel_unlock_folder(const char *path, int fd)
+camel_unlock_folder(const gchar *path, gint fd)
{
camel_unlock_dot(path);
camel_unlock_flock(fd);
@@ -334,10 +334,10 @@ camel_unlock_folder(const char *path, int fd)
}
#if 0
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelException *ex;
- int fd1, fd2;
+ gint fd1, fd2;
ex = camel_exception_new();
diff --git a/camel/camel-lock.h b/camel/camel-lock.h
index 3e2da6395..1fa23a1b3 100644
--- a/camel/camel-lock.h
+++ b/camel/camel-lock.h
@@ -41,17 +41,17 @@ typedef enum {
} CamelLockType;
/* specific locking strategies */
-int camel_lock_dot(const char *path, CamelException *ex);
-int camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex);
-int camel_lock_flock(int fd, CamelLockType type, CamelException *ex);
+gint camel_lock_dot(const gchar *path, CamelException *ex);
+gint camel_lock_fcntl(gint fd, CamelLockType type, CamelException *ex);
+gint camel_lock_flock(gint fd, CamelLockType type, CamelException *ex);
-void camel_unlock_dot(const char *path);
-void camel_unlock_fcntl(int fd);
-void camel_unlock_flock(int fd);
+void camel_unlock_dot(const gchar *path);
+void camel_unlock_fcntl(gint fd);
+void camel_unlock_flock(gint fd);
/* lock a folder in a standard way */
-int camel_lock_folder(const char *path, int fd, CamelLockType type, CamelException *ex);
-void camel_unlock_folder(const char *path, int fd);
+gint camel_lock_folder(const gchar *path, gint fd, CamelLockType type, CamelException *ex);
+void camel_unlock_folder(const gchar *path, gint fd);
G_END_DECLS
diff --git a/camel/camel-medium.c b/camel/camel-medium.c
index 0202ed63b..3ab99254c 100644
--- a/camel/camel-medium.c
+++ b/camel/camel-medium.c
@@ -40,11 +40,11 @@ static CamelDataWrapperClass *parent_class = NULL;
#define CM_CLASS(so) CAMEL_MEDIUM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
static gboolean is_offline (CamelDataWrapper *data_wrapper);
-static void add_header (CamelMedium *medium, const char *name,
- const void *value);
-static void set_header (CamelMedium *medium, const char *name, const void *value);
-static void remove_header (CamelMedium *medium, const char *name);
-static const void *get_header (CamelMedium *medium, const char *name);
+static void add_header (CamelMedium *medium, const gchar *name,
+ gconstpointer value);
+static void set_header (CamelMedium *medium, const gchar *name, gconstpointer value);
+static void remove_header (CamelMedium *medium, const gchar *name);
+static gconstpointer get_header (CamelMedium *medium, const gchar *name);
static GArray *get_headers (CamelMedium *medium);
static void free_headers (CamelMedium *medium, GArray *headers);
@@ -121,7 +121,7 @@ is_offline (CamelDataWrapper *data_wrapper)
}
static void
-add_header (CamelMedium *medium, const char *name, const void *value)
+add_header (CamelMedium *medium, const gchar *name, gconstpointer value)
{
g_warning("No %s::add_header implemented, adding %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
}
@@ -136,7 +136,7 @@ add_header (CamelMedium *medium, const char *name, const void *value)
* Adds a header to a #CamelMedium.
**/
void
-camel_medium_add_header (CamelMedium *medium, const char *name, const void *value)
+camel_medium_add_header (CamelMedium *medium, const gchar *name, gconstpointer value)
{
g_return_if_fail (CAMEL_IS_MEDIUM (medium));
g_return_if_fail (name != NULL);
@@ -146,7 +146,7 @@ camel_medium_add_header (CamelMedium *medium, const char *name, const void *valu
}
static void
-set_header (CamelMedium *medium, const char *name, const void *value)
+set_header (CamelMedium *medium, const gchar *name, gconstpointer value)
{
g_warning("No %s::set_header implemented, setting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
}
@@ -163,7 +163,7 @@ set_header (CamelMedium *medium, const char *name, const void *value)
* the header also.
**/
void
-camel_medium_set_header (CamelMedium *medium, const char *name, const void *value)
+camel_medium_set_header (CamelMedium *medium, const gchar *name, gconstpointer value)
{
g_return_if_fail (CAMEL_IS_MEDIUM (medium));
g_return_if_fail (name != NULL);
@@ -175,7 +175,7 @@ camel_medium_set_header (CamelMedium *medium, const char *name, const void *valu
}
static void
-remove_header(CamelMedium *medium, const char *name)
+remove_header(CamelMedium *medium, const gchar *name)
{
g_warning("No %s::remove_header implemented, removing %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
}
@@ -190,7 +190,7 @@ remove_header(CamelMedium *medium, const char *name)
* header are removed.
**/
void
-camel_medium_remove_header(CamelMedium *medium, const char *name)
+camel_medium_remove_header(CamelMedium *medium, const gchar *name)
{
g_return_if_fail (CAMEL_IS_MEDIUM (medium));
g_return_if_fail (name != NULL);
@@ -199,8 +199,8 @@ camel_medium_remove_header(CamelMedium *medium, const char *name)
}
-static const void *
-get_header(CamelMedium *medium, const char *name)
+static gconstpointer
+get_header(CamelMedium *medium, const gchar *name)
{
g_warning("No %s::get_header implemented, getting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
return NULL;
@@ -221,8 +221,8 @@ get_header(CamelMedium *medium, const char *name)
*
* Returns: the value of the named header, or %NULL
**/
-const void *
-camel_medium_get_header(CamelMedium *medium, const char *name)
+gconstpointer
+camel_medium_get_header(CamelMedium *medium, const gchar *name)
{
g_return_val_if_fail (CAMEL_IS_MEDIUM (medium), NULL);
g_return_val_if_fail (name != NULL, NULL);
diff --git a/camel/camel-medium.h b/camel/camel-medium.h
index c0d9de57b..527f5f881 100644
--- a/camel/camel-medium.h
+++ b/camel/camel-medium.h
@@ -37,8 +37,8 @@
G_BEGIN_DECLS
typedef struct {
- const char *name;
- const char *value;
+ const gchar *name;
+ const gchar *value;
} CamelMediumHeader;
struct _CamelMedium {
@@ -55,10 +55,10 @@ typedef struct {
CamelDataWrapperClass parent_class;
/* Virtual methods */
- void (*add_header) (CamelMedium *medium, const char *name, const void *value);
- void (*set_header) (CamelMedium *medium, const char *name, const void *value);
- void (*remove_header) (CamelMedium *medium, const char *name);
- const void * (*get_header) (CamelMedium *medium, const char *name);
+ void (*add_header) (CamelMedium *medium, const gchar *name, gconstpointer value);
+ void (*set_header) (CamelMedium *medium, const gchar *name, gconstpointer value);
+ void (*remove_header) (CamelMedium *medium, const gchar *name);
+ gconstpointer (*get_header) (CamelMedium *medium, const gchar *name);
GArray * (*get_headers) (CamelMedium *medium);
void (*free_headers) (CamelMedium *medium, GArray *headers);
@@ -71,10 +71,10 @@ typedef struct {
CamelType camel_medium_get_type (void);
/* Header get/set interface */
-void camel_medium_add_header (CamelMedium *medium, const char *name, const void *value);
-void camel_medium_set_header (CamelMedium *medium, const char *name, const void *value);
-void camel_medium_remove_header (CamelMedium *medium, const char *name);
-const void *camel_medium_get_header (CamelMedium *medium, const char *name);
+void camel_medium_add_header (CamelMedium *medium, const gchar *name, gconstpointer value);
+void camel_medium_set_header (CamelMedium *medium, const gchar *name, gconstpointer value);
+void camel_medium_remove_header (CamelMedium *medium, const gchar *name);
+gconstpointer camel_medium_get_header (CamelMedium *medium, const gchar *name);
GArray *camel_medium_get_headers (CamelMedium *medium);
void camel_medium_free_headers (CamelMedium *medium, GArray *headers);
diff --git a/camel/camel-mime-filter-basic.c b/camel/camel-mime-filter-basic.c
index 16a8ebcd3..e6a93f252 100644
--- a/camel/camel-mime-filter-basic.c
+++ b/camel/camel-mime-filter-basic.c
@@ -25,11 +25,11 @@
#include "camel-mime-utils.h"
static void reset(CamelMimeFilter *mf);
-static void complete(CamelMimeFilter *mf, char *in, size_t len,
- size_t prespace, char **out,
+static void complete(CamelMimeFilter *mf, gchar *in, size_t len,
+ size_t prespace, gchar **out,
size_t *outlen, size_t *outprespace);
-static void filter(CamelMimeFilter *mf, char *in, size_t len,
- size_t prespace, char **out,
+static void filter(CamelMimeFilter *mf, gchar *in, size_t len,
+ size_t prespace, gchar **out,
size_t *outlen, size_t *outprespace);
static void camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *klass);
@@ -92,7 +92,7 @@ reset(CamelMimeFilter *mf)
}
static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
size_t newlen = 0;
@@ -109,13 +109,13 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
case CAMEL_MIME_FILTER_BASIC_QP_ENC:
/* *4 is definetly more than needed ... */
camel_mime_filter_set_size(mf, len*4+4, FALSE);
- newlen = camel_quoted_encode_close((unsigned char *) in, len, (unsigned char *) mf->outbuf, &f->state, &f->save);
+ newlen = camel_quoted_encode_close((guchar *) in, len, (guchar *) mf->outbuf, &f->state, &f->save);
g_assert(newlen <= len*4+4);
break;
case CAMEL_MIME_FILTER_BASIC_UU_ENC:
/* won't go to more than 2 * (x + 2) + 62 */
camel_mime_filter_set_size (mf, (len + 2) * 2 + 62, FALSE);
- newlen = camel_uuencode_close ((unsigned char *) in, len, (unsigned char *) mf->outbuf, f->uubuf, &f->state, (guint32 *) &f->save);
+ newlen = camel_uuencode_close ((guchar *) in, len, (guchar *) mf->outbuf, f->uubuf, &f->state, (guint32 *) &f->save);
g_assert (newlen <= (len + 2) * 2 + 62);
break;
case CAMEL_MIME_FILTER_BASIC_BASE64_DEC:
@@ -127,14 +127,14 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
case CAMEL_MIME_FILTER_BASIC_QP_DEC:
/* output can't possibly exceed the input size, well unless its not really qp, then +2 max */
camel_mime_filter_set_size(mf, len+2, FALSE);
- newlen = camel_quoted_decode_step((unsigned char *) in, len, (unsigned char *) mf->outbuf, &f->state, (gint *) &f->save);
+ newlen = camel_quoted_decode_step((guchar *) in, len, (guchar *) mf->outbuf, &f->state, (gint *) &f->save);
g_assert(newlen <= len+2);
break;
case CAMEL_MIME_FILTER_BASIC_UU_DEC:
if ((f->state & CAMEL_UUDECODE_STATE_BEGIN) && !(f->state & CAMEL_UUDECODE_STATE_END)) {
/* "begin <mode> <filename>\n" has been found, so we can now start decoding */
camel_mime_filter_set_size (mf, len + 3, FALSE);
- newlen = camel_uudecode_step ((unsigned char *) in, len, (unsigned char *) mf->outbuf, &f->state, (guint32 *) &f->save);
+ newlen = camel_uudecode_step ((guchar *) in, len, (guchar *) mf->outbuf, &f->state, (guint32 *) &f->save);
} else {
newlen = 0;
}
@@ -157,7 +157,7 @@ donothing:
/* here we do all of the basic mime filtering */
static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
size_t newlen;
@@ -172,13 +172,13 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
case CAMEL_MIME_FILTER_BASIC_QP_ENC:
/* *4 is overly conservative, but will do */
camel_mime_filter_set_size(mf, len*4+4, FALSE);
- newlen = camel_quoted_encode_step((unsigned char *) in, len, (unsigned char *) mf->outbuf, &f->state, (gint *) &f->save);
+ newlen = camel_quoted_encode_step((guchar *) in, len, (guchar *) mf->outbuf, &f->state, (gint *) &f->save);
g_assert(newlen <= len*4+4);
break;
case CAMEL_MIME_FILTER_BASIC_UU_ENC:
/* won't go to more than 2 * (x + 2) + 62 */
camel_mime_filter_set_size (mf, (len + 2) * 2 + 62, FALSE);
- newlen = camel_uuencode_step ((unsigned char *) in, len, (unsigned char *) mf->outbuf, f->uubuf, &f->state, (guint32 *) &f->save);
+ newlen = camel_uuencode_step ((guchar *) in, len, (guchar *) mf->outbuf, f->uubuf, &f->state, (guint32 *) &f->save);
g_assert (newlen <= (len + 2) * 2 + 62);
break;
case CAMEL_MIME_FILTER_BASIC_BASE64_DEC:
@@ -190,12 +190,12 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
case CAMEL_MIME_FILTER_BASIC_QP_DEC:
/* output can't possibly exceed the input size */
camel_mime_filter_set_size(mf, len + 2, FALSE);
- newlen = camel_quoted_decode_step((unsigned char *) in, len, (unsigned char *) mf->outbuf, &f->state, (gint *) &f->save);
+ newlen = camel_quoted_decode_step((guchar *) in, len, (guchar *) mf->outbuf, &f->state, (gint *) &f->save);
g_assert(newlen <= len + 2);
break;
case CAMEL_MIME_FILTER_BASIC_UU_DEC:
if (!(f->state & CAMEL_UUDECODE_STATE_BEGIN)) {
- register char *inptr, *inend;
+ register gchar *inptr, *inend;
size_t left;
inptr = in;
@@ -232,7 +232,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
if ((f->state & CAMEL_UUDECODE_STATE_BEGIN) && !(f->state & CAMEL_UUDECODE_STATE_END)) {
/* "begin <mode> <filename>\n" has been found, so we can now start decoding */
camel_mime_filter_set_size (mf, len + 3, FALSE);
- newlen = camel_uudecode_step ((unsigned char *) in, len, (unsigned char *) mf->outbuf, &f->state, (guint32 *) &f->save);
+ newlen = camel_uudecode_step ((guchar *) in, len, (guchar *) mf->outbuf, &f->state, (guint32 *) &f->save);
} else {
newlen = 0;
}
diff --git a/camel/camel-mime-filter-basic.h b/camel/camel-mime-filter-basic.h
index 7e4a0831b..1a77993fe 100644
--- a/camel/camel-mime-filter-basic.h
+++ b/camel/camel-mime-filter-basic.h
@@ -48,9 +48,9 @@ struct _CamelMimeFilterBasic {
CamelMimeFilterBasicType type;
- unsigned char uubuf[60];
- int state;
- int save;
+ guchar uubuf[60];
+ gint state;
+ gint save;
};
struct _CamelMimeFilterBasicClass {
diff --git a/camel/camel-mime-filter-bestenc.c b/camel/camel-mime-filter-bestenc.c
index b4d7fce85..498359d48 100644
--- a/camel/camel-mime-filter-bestenc.c
+++ b/camel/camel-mime-filter-bestenc.c
@@ -70,16 +70,16 @@ reset(CamelMimeFilter *mf)
}
static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterBestenc *f = (CamelMimeFilterBestenc *)mf;
- register unsigned char *p, *pend;
+ register guchar *p, *pend;
if (len == 0)
goto donothing;
if (f->flags & CAMEL_BESTENC_GET_ENCODING) {
- register unsigned int /* hopefully reg's are assinged in the order they appear? */
+ register guint /* hopefully reg's are assinged in the order they appear? */
c,
lastc=f->lastc,
countline=f->countline,
@@ -102,7 +102,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
f->startofline = FALSE;
/* See rfc2045 section 2 for definitions of 7bit/8bit/binary */
- p = (unsigned char *) in;
+ p = (guchar *) in;
pend = p + len;
while (p<pend) {
c = *p++;
@@ -130,7 +130,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
/* Check for "^From " lines */
if ((f->flags & CAMEL_BESTENC_NO_FROM) && !f->hadfrom) {
if (pend-p >= 5) {
- f->hadfrom = strncmp((char *) p, (char *) "From ", 5) == 0;
+ f->hadfrom = strncmp((gchar *) p, (gchar *) "From ", 5) == 0;
} else if (pend-p == 0) {
f->startofline = TRUE;
} else {
@@ -164,7 +164,7 @@ donothing:
}
static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterBestenc *f = (CamelMimeFilterBestenc *)mf;
@@ -202,7 +202,7 @@ camel_mime_filter_bestenc_init (CamelMimeFilter *f)
* Returns: a new #CamelMimeFilterBestenc object
**/
CamelMimeFilterBestenc *
-camel_mime_filter_bestenc_new (unsigned int flags)
+camel_mime_filter_bestenc_new (guint flags)
{
CamelMimeFilterBestenc *new = (CamelMimeFilterBestenc *)camel_object_new(camel_mime_filter_bestenc_get_type());
new->flags = flags;
@@ -224,7 +224,7 @@ CamelTransferEncoding
camel_mime_filter_bestenc_get_best_encoding(CamelMimeFilterBestenc *filter, CamelBestencEncoding required)
{
CamelTransferEncoding bestenc;
- int istext;
+ gint istext;
istext = (required & CAMEL_BESTENC_TEXT) ? 1 : 0;
required = required & ~CAMEL_BESTENC_TEXT;
@@ -282,7 +282,7 @@ camel_mime_filter_bestenc_get_best_encoding(CamelMimeFilterBestenc *filter, Came
* Returns: the name of the best charset to use to encode the input
* text filtered by @filter
**/
-const char *
+const gchar *
camel_mime_filter_bestenc_get_best_charset (CamelMimeFilterBestenc *filter)
{
return camel_charset_best_name(&filter->charset);
@@ -297,7 +297,7 @@ camel_mime_filter_bestenc_get_best_charset (CamelMimeFilterBestenc *filter)
* Set the flags for subsequent operations.
**/
void
-camel_mime_filter_bestenc_set_flags(CamelMimeFilterBestenc *filter, unsigned int flags)
+camel_mime_filter_bestenc_set_flags(CamelMimeFilterBestenc *filter, guint flags)
{
filter->flags = flags;
}
diff --git a/camel/camel-mime-filter-bestenc.h b/camel/camel-mime-filter-bestenc.h
index 1ee3ed079..c883e7402 100644
--- a/camel/camel-mime-filter-bestenc.h
+++ b/camel/camel-mime-filter-bestenc.h
@@ -56,23 +56,23 @@ typedef enum _CamelBestencEncoding {
struct _CamelMimeFilterBestenc {
CamelMimeFilter parent;
- unsigned int flags; /* our creation flags, see above */
+ guint flags; /* our creation flags, see above */
- unsigned int count0; /* count of NUL characters */
- unsigned int count8; /* count of 8 bit characters */
- unsigned int total; /* total characters read */
+ guint count0; /* count of NUL characters */
+ guint count8; /* count of 8 bit characters */
+ guint total; /* total characters read */
- unsigned int lastc; /* the last character read */
- int crlfnoorder; /* if crlf's occured where they shouldn't have */
+ guint lastc; /* the last character read */
+ gint crlfnoorder; /* if crlf's occured where they shouldn't have */
- int startofline; /* are we at the start of a new line? */
+ gint startofline; /* are we at the start of a new line? */
- int fromcount;
- char fromsave[6]; /* save a few characters if we found an \n near the end of the buffer */
- int hadfrom; /* did we encounter a "\nFrom " in the data? */
+ gint fromcount;
+ gchar fromsave[6]; /* save a few characters if we found an \n near the end of the buffer */
+ gint hadfrom; /* did we encounter a "\nFrom " in the data? */
- unsigned int countline; /* current count of characters on a given line */
- unsigned int maxline; /* max length of any line */
+ guint countline; /* current count of characters on a given line */
+ guint maxline; /* max length of any line */
CamelCharset charset; /* used to determine the best charset to use */
};
@@ -82,12 +82,12 @@ struct _CamelMimeFilterBestencClass {
};
CamelType camel_mime_filter_bestenc_get_type (void);
-CamelMimeFilterBestenc *camel_mime_filter_bestenc_new (unsigned int flags);
+CamelMimeFilterBestenc *camel_mime_filter_bestenc_new (guint flags);
CamelTransferEncoding camel_mime_filter_bestenc_get_best_encoding(CamelMimeFilterBestenc *filter, CamelBestencEncoding required);
-const char * camel_mime_filter_bestenc_get_best_charset(CamelMimeFilterBestenc *filter);
-void camel_mime_filter_bestenc_set_flags(CamelMimeFilterBestenc *filter, unsigned int flags);
+const gchar * camel_mime_filter_bestenc_get_best_charset(CamelMimeFilterBestenc *filter);
+void camel_mime_filter_bestenc_set_flags(CamelMimeFilterBestenc *filter, guint flags);
G_END_DECLS
diff --git a/camel/camel-mime-filter-canon.c b/camel/camel-mime-filter-canon.c
index 8e372d2a0..7c0f866ea 100644
--- a/camel/camel-mime-filter-canon.c
+++ b/camel/camel-mime-filter-canon.c
@@ -31,10 +31,10 @@
#include "camel-mime-filter-canon.h"
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
+static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
+static void complete (CamelMimeFilter *f, gchar *in, size_t len,
+ size_t prespace, gchar **out, size_t *outlen,
size_t *outprespace);
static void reset (CamelMimeFilter *f);
@@ -68,20 +68,20 @@ camel_mime_filter_canon_get_type (void)
}
static void
-filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace, int last)
+filter_run(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace, gint last)
{
- register unsigned char *inptr, c;
- const unsigned char *inend, *start;
- char *starto;
- register char *o;
- int lf = 0;
+ register guchar *inptr, c;
+ const guchar *inend, *start;
+ gchar *starto;
+ register gchar *o;
+ gint lf = 0;
guint32 flags;
flags = ((CamelMimeFilterCanon *)f)->flags;
/* first, work out how much space we need */
- inptr = (unsigned char *)in;
- inend = (const unsigned char *) (in+len);
+ inptr = (guchar *)in;
+ inend = (const guchar *) (in+len);
while (inptr < inend)
if (*inptr++ == '\n')
lf++;
@@ -93,7 +93,7 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
camel_mime_filter_set_size(f, len+lf*3+4, FALSE);
o = f->outbuf;
- inptr = (unsigned char *)in;
+ inptr = (guchar *)in;
start = inptr;
starto = o;
while (inptr < inend) {
@@ -102,7 +102,7 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
if (flags & CAMEL_MIME_FILTER_CANON_FROM && c == 'F') {
inptr++;
if (inptr < inend-4) {
- if (strncmp((char*)inptr, "rom ", 4) == 0) {
+ if (strncmp((gchar *)inptr, "rom ", 4) == 0) {
strcpy(o, "=46rom ");
inptr+=4;
o+= 7;
@@ -153,7 +153,7 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
if (last) {
*outlen = o - f->outbuf;
} else {
- camel_mime_filter_backup(f, (const char*)start, inend - start);
+ camel_mime_filter_backup(f, (const gchar *)start, inend - start);
*outlen = starto - f->outbuf;
}
@@ -162,13 +162,13 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
}
static void
-filter(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
filter_run(f, in, len, prespace, out, outlen, outprespace, FALSE);
}
static void
-complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
filter_run(f, in, len, prespace, out, outlen, outprespace, TRUE);
}
diff --git a/camel/camel-mime-filter-charset.c b/camel/camel-mime-filter-charset.c
index e76e9a287..f7742e92f 100644
--- a/camel/camel-mime-filter-charset.c
+++ b/camel/camel-mime-filter-charset.c
@@ -75,8 +75,8 @@ static void
reset(CamelMimeFilter *mf)
{
CamelMimeFilterCharset *f = (CamelMimeFilterCharset *)mf;
- char buf[16];
- char *buffer;
+ gchar buf[16];
+ gchar *buffer;
size_t outlen = 16;
/* what happens with the output bytes if this resets the state? */
@@ -87,12 +87,12 @@ reset(CamelMimeFilter *mf)
}
static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterCharset *charset = (CamelMimeFilterCharset *)mf;
size_t inleft, outleft, converted = 0;
- const char *inbuf;
- char *outbuf;
+ const gchar *inbuf;
+ gchar *outbuf;
if (charset->ic == (iconv_t) -1)
goto noop;
@@ -162,12 +162,12 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
}
static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterCharset *charset = (CamelMimeFilterCharset *)mf;
size_t inleft, outleft, converted = 0;
- const char *inbuf;
- char *outbuf;
+ const gchar *inbuf;
+ gchar *outbuf;
if (charset->ic == (iconv_t) -1)
goto noop;
@@ -266,7 +266,7 @@ camel_mime_filter_charset_new (void)
* Returns: a new #CamelMimeFilterCharset object
**/
CamelMimeFilterCharset *
-camel_mime_filter_charset_new_convert (const char *from_charset, const char *to_charset)
+camel_mime_filter_charset_new_convert (const gchar *from_charset, const gchar *to_charset)
{
CamelMimeFilterCharset *new;
diff --git a/camel/camel-mime-filter-charset.h b/camel/camel-mime-filter-charset.h
index a89bcdb29..1948d079e 100644
--- a/camel/camel-mime-filter-charset.h
+++ b/camel/camel-mime-filter-charset.h
@@ -39,8 +39,8 @@ struct _CamelMimeFilterCharset {
struct _CamelMimeFilterCharsetPrivate *priv;
iconv_t ic;
- char *from;
- char *to;
+ gchar *from;
+ gchar *to;
};
struct _CamelMimeFilterCharsetClass {
@@ -50,7 +50,7 @@ struct _CamelMimeFilterCharsetClass {
CamelType camel_mime_filter_charset_get_type (void);
CamelMimeFilterCharset *camel_mime_filter_charset_new (void);
-CamelMimeFilterCharset *camel_mime_filter_charset_new_convert (const char *from_charset, const char *to_charset);
+CamelMimeFilterCharset *camel_mime_filter_charset_new_convert (const gchar *from_charset, const gchar *to_charset);
G_END_DECLS
diff --git a/camel/camel-mime-filter-crlf.c b/camel/camel-mime-filter-crlf.c
index 7184b8093..7b08fddec 100644
--- a/camel/camel-mime-filter-crlf.c
+++ b/camel/camel-mime-filter-crlf.c
@@ -22,10 +22,10 @@
#include "camel-mime-filter-crlf.h"
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
+static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
+static void complete (CamelMimeFilter *f, gchar *in, size_t len,
+ size_t prespace, gchar **out, size_t *outlen,
size_t *outprespace);
static void reset (CamelMimeFilter *f);
@@ -60,14 +60,14 @@ camel_mime_filter_crlf_get_type (void)
}
static void
-filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterCRLF *crlf = (CamelMimeFilterCRLF *)f;
- register const char *inptr;
- const char *inend;
+ register const gchar *inptr;
+ const gchar *inend;
gboolean do_dots;
- char *outptr;
+ gchar *outptr;
do_dots = crlf->mode == CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS;
@@ -144,8 +144,8 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
}
static void
-complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+complete (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
if (len)
filter (f, in, len, prespace, out, outlen, outprespace);
diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c
index aea7adfef..f543b66a0 100644
--- a/camel/camel-mime-filter-enriched.c
+++ b/camel/camel-mime-filter-enriched.c
@@ -33,15 +33,15 @@
/* text/enriched is rfc1896 */
-typedef char * (*EnrichedParamParser) (const char *inptr, int inlen);
+typedef gchar * (*EnrichedParamParser) (const gchar *inptr, gint inlen);
-static char *param_parse_colour (const char *inptr, int inlen);
-static char *param_parse_font (const char *inptr, int inlen);
-static char *param_parse_lang (const char *inptr, int inlen);
+static gchar *param_parse_colour (const gchar *inptr, gint inlen);
+static gchar *param_parse_font (const gchar *inptr, gint inlen);
+static gchar *param_parse_lang (const gchar *inptr, gint inlen);
static struct {
- char *enriched;
- char *html;
+ gchar *enriched;
+ gchar *html;
gboolean needs_param;
EnrichedParamParser parse_param; /* parses *and* validates the input */
} enriched_tags[] = {
@@ -98,10 +98,10 @@ static void camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass
static void camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter);
static void camel_mime_filter_enriched_finalize (CamelObject *obj);
-static void filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
+static void filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
+static void filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
static void filter_reset (CamelMimeFilter *filter);
@@ -131,7 +131,7 @@ static void
camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *klass)
{
CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
- int i;
+ gint i;
parent_class = CAMEL_MIME_FILTER_CLASS (camel_mime_filter_get_type ());
@@ -163,9 +163,9 @@ camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter)
#if 0
static gboolean
-enriched_tag_needs_param (const char *tag)
+enriched_tag_needs_param (const gchar *tag)
{
- int i;
+ gint i;
for (i = 0; i < NUM_ENRICHED_TAGS; i++)
if (!g_ascii_strcasecmp (tag, enriched_tags[i].enriched))
@@ -176,24 +176,24 @@ enriched_tag_needs_param (const char *tag)
#endif
static gboolean
-html_tag_needs_param (const char *tag)
+html_tag_needs_param (const gchar *tag)
{
return strstr (tag, "%s") != NULL;
}
-static const char *valid_colours[] = {
+static const gchar *valid_colours[] = {
"red", "green", "blue", "yellow", "cyan", "magenta", "black", "white"
};
#define NUM_VALID_COLOURS (sizeof (valid_colours) / sizeof (valid_colours[0]))
-static char *
-param_parse_colour (const char *inptr, int inlen)
+static gchar *
+param_parse_colour (const gchar *inptr, gint inlen)
{
- const char *inend, *end;
+ const gchar *inend, *end;
guint32 rgb = 0;
guint v;
- int i;
+ gint i;
for (i = 0; i < NUM_VALID_COLOURS; i++) {
if (!g_ascii_strncasecmp (inptr, valid_colours[i], inlen))
@@ -214,7 +214,7 @@ param_parse_colour (const char *inptr, int inlen)
}
for (i = 0; i < 3; i++) {
- v = strtoul (inptr, (char **) &end, 16);
+ v = strtoul (inptr, (gchar **) &end, 16);
if (end != inptr + 4)
goto invalid_format;
@@ -232,11 +232,11 @@ param_parse_colour (const char *inptr, int inlen)
return g_strdup ("black");
}
-static char *
-param_parse_font (const char *fontfamily, int inlen)
+static gchar *
+param_parse_font (const gchar *fontfamily, gint inlen)
{
- register const char *inptr = fontfamily;
- const char *inend = inptr + inlen;
+ register const gchar *inptr = fontfamily;
+ const gchar *inend = inptr + inlen;
/* don't allow any of '"', '<', nor '>' */
while (inptr < inend && *inptr != '"' && *inptr != '<' && *inptr != '>')
@@ -245,11 +245,11 @@ param_parse_font (const char *fontfamily, int inlen)
return g_strndup (fontfamily, inptr - fontfamily);
}
-static char *
-param_parse_lang (const char *lang, int inlen)
+static gchar *
+param_parse_lang (const gchar *lang, gint inlen)
{
- register const char *inptr = lang;
- const char *inend = inptr + inlen;
+ register const gchar *inptr = lang;
+ const gchar *inend = inptr + inlen;
/* don't allow any of '"', '<', nor '>' */
while (inptr < inend && *inptr != '"' && *inptr != '<' && *inptr != '>')
@@ -258,10 +258,10 @@ param_parse_lang (const char *lang, int inlen)
return g_strndup (lang, inptr - lang);
}
-static char *
-param_parse (const char *enriched, const char *inptr, int inlen)
+static gchar *
+param_parse (const gchar *enriched, const gchar *inptr, gint inlen)
{
- int i;
+ gint i;
for (i = 0; i < NUM_ENRICHED_TAGS; i++) {
if (!g_ascii_strcasecmp (enriched, enriched_tags[i].enriched))
@@ -276,13 +276,13 @@ param_parse (const char *enriched, const char *inptr, int inlen)
#define IS_RICHTEXT CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT
static void
-enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace, gboolean flush)
+enriched_to_html (CamelMimeFilter *filter, gchar *in, size_t inlen, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace, gboolean flush)
{
CamelMimeFilterEnriched *enriched = (CamelMimeFilterEnriched *) filter;
- const char *tag, *inend, *outend;
- register const char *inptr;
- register char *outptr;
+ const gchar *tag, *inend, *outend;
+ register const gchar *inptr;
+ register gchar *outptr;
camel_mime_filter_set_size (filter, inlen * 2 + 6, FALSE);
@@ -420,9 +420,9 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
goto backup;
}
} else {
- const char *html_tag;
- char *enriched_tag;
- int len;
+ const gchar *html_tag;
+ gchar *enriched_tag;
+ gint len;
len = inptr - tag;
enriched_tag = g_alloca (len + 1);
@@ -433,8 +433,8 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
if (html_tag) {
if (html_tag_needs_param (html_tag)) {
- const char *start;
- char *param;
+ const gchar *start;
+ gchar *param;
while (inptr < inend && *inptr != '<')
inptr++;
@@ -541,15 +541,15 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
}
static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
enriched_to_html (filter, in, len, prespace, out, outlen, outprespace, FALSE);
}
static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
enriched_to_html (filter, in, len, prespace, out, outlen, outprespace, TRUE);
}
@@ -595,19 +595,19 @@ camel_mime_filter_enriched_new (guint32 flags)
* Returns: a newly allocated string containing the enriched or
* richtext version of @in.
**/
-char *
-camel_enriched_to_html(const char *in, guint32 flags)
+gchar *
+camel_enriched_to_html(const gchar *in, guint32 flags)
{
CamelMimeFilter *filter;
size_t outlen, outpre;
- char *outbuf;
+ gchar *outbuf;
if (in == NULL)
return NULL;
filter = camel_mime_filter_enriched_new(flags);
- camel_mime_filter_complete(filter, (char *)in, strlen(in), 0, &outbuf, &outlen, &outpre);
+ camel_mime_filter_complete(filter, (gchar *)in, strlen(in), 0, &outbuf, &outlen, &outpre);
outbuf = g_strndup (outbuf, outlen);
camel_object_unref (filter);
diff --git a/camel/camel-mime-filter-enriched.h b/camel/camel-mime-filter-enriched.h
index aafa4bedb..900f95c51 100644
--- a/camel/camel-mime-filter-enriched.h
+++ b/camel/camel-mime-filter-enriched.h
@@ -42,7 +42,7 @@ struct _CamelMimeFilterEnriched {
CamelMimeFilter parent_object;
guint32 flags;
- int nofill;
+ gint nofill;
};
struct _CamelMimeFilterEnrichedClass {
@@ -53,7 +53,7 @@ struct _CamelMimeFilterEnrichedClass {
CamelType camel_mime_filter_enriched_get_type (void);
CamelMimeFilter *camel_mime_filter_enriched_new (guint32 flags);
-char *camel_enriched_to_html(const char *in, guint32 flags);
+gchar *camel_enriched_to_html(const gchar *in, guint32 flags);
G_END_DECLS
diff --git a/camel/camel-mime-filter-from.c b/camel/camel-mime-filter-from.c
index 3e62cf1f6..8cdc9292e 100644
--- a/camel/camel-mime-filter-from.c
+++ b/camel/camel-mime-filter-from.c
@@ -55,11 +55,11 @@ camel_mime_filter_from_get_type (void)
struct fromnode {
struct fromnode *next;
- char *pointer;
+ gchar *pointer;
};
static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
*out = in;
*outlen = len;
@@ -68,15 +68,15 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
/* Yes, it is complicated ... */
static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterFrom *f = (CamelMimeFilterFrom *)mf;
- register char *inptr, *inend;
- int left;
- int midline = f->midline;
- int fromcount = 0;
+ register gchar *inptr, *inend;
+ gint left;
+ gint midline = f->midline;
+ gint fromcount = 0;
struct fromnode *head = NULL, *tail = (struct fromnode *)&head, *node;
- char *outptr;
+ gchar *outptr;
inptr = in;
inend = inptr+len;
@@ -85,7 +85,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
/* first, see if we need to escape any from's */
while (inptr<inend) {
- register int c = -1;
+ register gint c = -1;
if (midline)
while (inptr < inend && (c = *inptr++) != '\n')
@@ -188,11 +188,11 @@ camel_mime_filter_from_new (void)
#include <stdio.h>
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelMimeFilterFrom *f;
- char *buffer;
- int len, prespace;
+ gchar *buffer;
+ gint len, prespace;
g_tk_init(&argc, &argv);
diff --git a/camel/camel-mime-filter-from.h b/camel/camel-mime-filter-from.h
index 2434a6c4d..6d0d35651 100644
--- a/camel/camel-mime-filter-from.h
+++ b/camel/camel-mime-filter-from.h
@@ -37,7 +37,7 @@ typedef struct _CamelMimeFilterFromClass CamelMimeFilterFromClass;
struct _CamelMimeFilterFrom {
CamelMimeFilter parent;
- int midline; /* are we between lines? */
+ gint midline; /* are we between lines? */
};
struct _CamelMimeFilterFromClass {
diff --git a/camel/camel-mime-filter-gzip.c b/camel/camel-mime-filter-gzip.c
index 17129015e..b1ee68ed3 100644
--- a/camel/camel-mime-filter-gzip.c
+++ b/camel/camel-mime-filter-gzip.c
@@ -49,7 +49,7 @@ enum {
#define GZIP_FLAG_RESERVED (GZIP_FLAG_RESERVED0 | GZIP_FLAG_RESERVED1 | GZIP_FLAG_RESERVED2)
typedef union {
- unsigned char buf[10];
+ guchar buf[10];
struct {
guint8 id1;
guint8 id2;
@@ -93,10 +93,10 @@ static void camel_mime_filter_gzip_class_init (CamelMimeFilterGZipClass *klass);
static void camel_mime_filter_gzip_init (CamelMimeFilterGZip *filter, CamelMimeFilterGZipClass *klass);
static void camel_mime_filter_gzip_finalize (CamelObject *object);
-static void filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
+static void filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
+static void filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
static void filter_reset (CamelMimeFilter *filter);
@@ -160,12 +160,12 @@ camel_mime_filter_gzip_finalize (CamelObject *object)
static void
-gzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace, int flush)
+gzip_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace, gint flush)
{
CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
struct _CamelMimeFilterGZipPrivate *priv = gzip->priv;
- int retval;
+ gint retval;
if (!priv->state.zip.wrote_hdr) {
priv->hdr.v.id1 = 31;
@@ -229,13 +229,13 @@ gzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
}
} else {
if (priv->stream->avail_in > 0)
- camel_mime_filter_backup (filter, (const char *) priv->stream->next_in, priv->stream->avail_in);
+ camel_mime_filter_backup (filter, (const gchar *) priv->stream->next_in, priv->stream->avail_in);
break;
}
} while (1);
- priv->crc32 = crc32 (priv->crc32, (unsigned char *) in, len - priv->stream->avail_in);
+ priv->crc32 = crc32 (priv->crc32, (guchar *) in, len - priv->stream->avail_in);
priv->isize += len - priv->stream->avail_in;
*out = filter->outbuf;
@@ -244,13 +244,13 @@ gzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
}
static void
-gunzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace, int flush)
+gunzip_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace, gint flush)
{
CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
struct _CamelMimeFilterGZipPrivate *priv = gzip->priv;
guint16 need, val;
- int retval;
+ gint retval;
if (!priv->state.unzip.got_hdr) {
if (len < 10) {
@@ -373,7 +373,7 @@ gunzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
priv->stream->avail_in += 8;
if (priv->stream->avail_in > 0)
- camel_mime_filter_backup (filter, (char *) priv->stream->next_in, priv->stream->avail_in);
+ camel_mime_filter_backup (filter, (gchar *) priv->stream->next_in, priv->stream->avail_in);
break;
}
@@ -391,8 +391,8 @@ gunzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
}
static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
@@ -403,8 +403,8 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
}
static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
@@ -443,10 +443,10 @@ filter_reset (CamelMimeFilter *filter)
* Returns: a new gzip (or gunzip) filter.
**/
CamelMimeFilter *
-camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode, int level)
+camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode, gint level)
{
CamelMimeFilterGZip *new;
- int retval;
+ gint retval;
new = (CamelMimeFilterGZip *) camel_object_new (CAMEL_TYPE_MIME_FILTER_GZIP);
new->mode = mode;
diff --git a/camel/camel-mime-filter-gzip.h b/camel/camel-mime-filter-gzip.h
index df49757f5..41ef84d49 100644
--- a/camel/camel-mime-filter-gzip.h
+++ b/camel/camel-mime-filter-gzip.h
@@ -49,7 +49,7 @@ struct _CamelMimeFilterGZip {
struct _CamelMimeFilterGZipPrivate *priv;
CamelMimeFilterGZipMode mode;
- int level;
+ gint level;
};
struct _CamelMimeFilterGZipClass {
@@ -60,7 +60,7 @@ struct _CamelMimeFilterGZipClass {
CamelType camel_mime_filter_gzip_get_type (void);
-CamelMimeFilter *camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode, int level);
+CamelMimeFilter *camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode, gint level);
G_END_DECLS
diff --git a/camel/camel-mime-filter-html.c b/camel/camel-mime-filter-html.c
index 98592bc56..774a4038e 100644
--- a/camel/camel-mime-filter-html.c
+++ b/camel/camel-mime-filter-html.c
@@ -52,8 +52,8 @@ struct _CamelMimeFilterHTMLPrivate {
#define ARRAY_LEN(x) (sizeof(x)/sizeof((x)[0]))
static struct {
- char *element;
- char *remap;
+ gchar *element;
+ gchar *remap;
} map_start[] = {
{ "p", "\n\n" },
{ "br", "\n" },
@@ -62,8 +62,8 @@ static struct {
static struct {
- char *element;
- char *remap;
+ gchar *element;
+ gchar *remap;
} map_end[] = {
{ "h1", "\n" }, { "h2", "\n" }, { "h3", "\n" }, { "h4", "\n" }, { "h5", "\n" }, { "h6", "\n" },
};
@@ -110,11 +110,11 @@ camel_mime_filter_html_init (CamelObject *o)
}
static void
-run(CamelMimeFilter *mf, char *in, size_t inlen, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace, int last)
+run(CamelMimeFilter *mf, gchar *in, size_t inlen, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace, gint last)
{
CamelMimeFilterHTML *f = (CamelMimeFilterHTML *) mf;
camel_html_parser_t state;
- char *outp;
+ gchar *outp;
d(printf("converting html:\n%.*s\n", (int)inlen, in));
@@ -124,8 +124,8 @@ run(CamelMimeFilter *mf, char *in, size_t inlen, size_t prespace, char **out, si
camel_html_parser_set_data (f->priv->ctxt, in, inlen, last);
do {
- const char *data;
- int len;
+ const gchar *data;
+ gint len;
state = camel_html_parser_step(f->priv->ctxt, &data, &len);
@@ -152,13 +152,13 @@ run(CamelMimeFilter *mf, char *in, size_t inlen, size_t prespace, char **out, si
}
static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
+complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace)
{
run(mf, in, len, prespace, out, outlenptr, outprespace, TRUE);
}
static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
+filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace)
{
run(mf, in, len, prespace, out, outlenptr, outprespace, FALSE);
}
diff --git a/camel/camel-mime-filter-index.c b/camel/camel-mime-filter-index.c
index 95de64842..63df3ce7f 100644
--- a/camel/camel-mime-filter-index.c
+++ b/camel/camel-mime-filter-index.c
@@ -55,7 +55,7 @@ camel_mime_filter_index_finalize(CamelObject *o)
}
static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
+complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace)
{
CamelMimeFilterIndex *f = (CamelMimeFilterIndex *)mf;
@@ -73,7 +73,7 @@ donothing:
}
static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
+filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace)
{
CamelMimeFilterIndex *f = (CamelMimeFilterIndex *)mf;
@@ -169,7 +169,7 @@ void
camel_mime_filter_index_set_index (CamelMimeFilterIndex *filter, CamelIndex *index)
{
if (filter->index) {
- char *out;
+ gchar *out;
size_t outlen, outspace;
camel_mime_filter_complete((CamelMimeFilter *)filter, "", 0, 0, &out, &outlen, &outspace);
diff --git a/camel/camel-mime-filter-linewrap.c b/camel/camel-mime-filter-linewrap.c
index ced3a8f2c..60ffcbe98 100644
--- a/camel/camel-mime-filter-linewrap.c
+++ b/camel/camel-mime-filter-linewrap.c
@@ -29,10 +29,10 @@
#include "camel-mime-filter-linewrap.h"
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
+static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
+static void complete (CamelMimeFilter *f, gchar *in, size_t len,
+ size_t prespace, gchar **out, size_t *outlen,
size_t *outprespace);
static void reset (CamelMimeFilter *f);
@@ -67,12 +67,12 @@ camel_mime_filter_linewrap_get_type (void)
}
static void
-filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterLinewrap *linewrap = (CamelMimeFilterLinewrap *)f;
- char *inend, *p, *q;
- int nchars = linewrap->nchars;
+ gchar *inend, *p, *q;
+ gint nchars = linewrap->nchars;
/* we'll be adding chars here so we need a bigger buffer */
camel_mime_filter_set_size (f, 3 * len, FALSE);
@@ -114,8 +114,8 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
}
static void
-complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+complete (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
if (len)
filter (f, in, len, prespace, out, outlen, outprespace);
@@ -130,7 +130,7 @@ reset (CamelMimeFilter *f)
}
CamelMimeFilter *
-camel_mime_filter_linewrap_new (guint preferred_len, guint max_len, char indent_char)
+camel_mime_filter_linewrap_new (guint preferred_len, guint max_len, gchar indent_char)
{
CamelMimeFilterLinewrap *linewrap =
CAMEL_MIME_FILTER_LINEWRAP (camel_object_new (CAMEL_MIME_FILTER_LINEWRAP_TYPE));
diff --git a/camel/camel-mime-filter-linewrap.h b/camel/camel-mime-filter-linewrap.h
index ee2fbf3a2..cd15d8275 100644
--- a/camel/camel-mime-filter-linewrap.h
+++ b/camel/camel-mime-filter-linewrap.h
@@ -38,8 +38,8 @@ struct _CamelMimeFilterLinewrap {
guint wrap_len;
guint max_len;
- char indent;
- int nchars;
+ gchar indent;
+ gint nchars;
};
struct _CamelMimeFilterLinewrapClass {
@@ -48,7 +48,7 @@ struct _CamelMimeFilterLinewrapClass {
CamelType camel_mime_filter_linewrap_get_type (void);
-CamelMimeFilter *camel_mime_filter_linewrap_new (guint preferred_len, guint max_len, char indent_char);
+CamelMimeFilter *camel_mime_filter_linewrap_new (guint preferred_len, guint max_len, gchar indent_char);
G_END_DECLS
diff --git a/camel/camel-mime-filter-pgp.c b/camel/camel-mime-filter-pgp.c
index 15fd2d428..949a1269e 100644
--- a/camel/camel-mime-filter-pgp.c
+++ b/camel/camel-mime-filter-pgp.c
@@ -32,10 +32,10 @@
#include "camel-mime-filter-pgp.h"
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
+static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
+static void complete (CamelMimeFilter *f, gchar *in, size_t len,
+ size_t prespace, gchar **out, size_t *outlen,
size_t *outprespace);
static void reset (CamelMimeFilter *f);
@@ -84,12 +84,12 @@ camel_mime_filter_pgp_get_type (void)
#define END_PGP_SIGNATURE_LEN (sizeof (END_PGP_SIGNATURE) - 1)
static void
-filter_run(CamelMimeFilter *f, char *in, size_t inlen, size_t prespace, char **out, size_t *outlen, size_t *outprespace, int last)
+filter_run(CamelMimeFilter *f, gchar *in, size_t inlen, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace, gint last)
{
CamelMimeFilterPgp *pgp = (CamelMimeFilterPgp *) f;
- const char *start, *inend = in + inlen;
- register const char *inptr = in;
- register char *o;
+ const gchar *start, *inend = in + inlen;
+ register const gchar *inptr = in;
+ register gchar *o;
gboolean blank;
size_t len;
@@ -168,13 +168,13 @@ filter_run(CamelMimeFilter *f, char *in, size_t inlen, size_t prespace, char **o
}
static void
-filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
filter_run (f, in, len, prespace, out, outlen, outprespace, FALSE);
}
static void
-complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+complete (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
filter_run (f, in, len, prespace, out, outlen, outprespace, TRUE);
}
diff --git a/camel/camel-mime-filter-pgp.h b/camel/camel-mime-filter-pgp.h
index 5ed155b64..852d15c1b 100644
--- a/camel/camel-mime-filter-pgp.h
+++ b/camel/camel-mime-filter-pgp.h
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
typedef struct _CamelMimeFilterPgp {
CamelMimeFilter filter;
- int state;
+ gint state;
} CamelMimeFilterPgp;
typedef struct _CamelMimeFilterPgpClass {
diff --git a/camel/camel-mime-filter-progress.c b/camel/camel-mime-filter-progress.c
index 4771d8184..35794b42c 100644
--- a/camel/camel-mime-filter-progress.c
+++ b/camel/camel-mime-filter-progress.c
@@ -73,8 +73,8 @@ camel_mime_filter_progress_init (CamelObject *o)
}
static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterProgress *progress = (CamelMimeFilterProgress *) filter;
double percent;
@@ -94,8 +94,8 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
}
static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
filter_filter (filter, in, len, prespace, out, outlen, outprespace);
}
diff --git a/camel/camel-mime-filter-save.c b/camel/camel-mime-filter-save.c
index d12421c4a..1550ebfcd 100644
--- a/camel/camel-mime-filter-save.c
+++ b/camel/camel-mime-filter-save.c
@@ -28,10 +28,10 @@
#include "camel-mime-filter-save.h"
#include "camel-stream-mem.h"
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
+static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
+static void complete (CamelMimeFilter *f, gchar *in, size_t len,
+ size_t prespace, gchar **out, size_t *outlen,
size_t *outprespace);
static void reset (CamelMimeFilter *f);
@@ -66,8 +66,8 @@ camel_mime_filter_save_get_type (void)
}
static void
-filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterSave *save = (CamelMimeFilterSave *) f;
@@ -80,8 +80,8 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
}
static void
-complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+complete (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
if (len)
filter (f, in, len, prespace, out, outlen, outprespace);
diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c
index 8996b4eed..acbdda068 100644
--- a/camel/camel-mime-filter-tohtml.c
+++ b/camel/camel-mime-filter-tohtml.c
@@ -48,7 +48,7 @@
#define CONVERT_ADDRSPEC CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES
static struct {
- unsigned int mask;
+ guint mask;
urlpattern_t pattern;
} patterns[] = {
{ CONVERT_WEB_URLS, { "file://", "", camel_url_file_start, camel_url_file_end } },
@@ -117,8 +117,8 @@ camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter)
}
-static char *
-check_size (CamelMimeFilter *filter, char *outptr, char **outend, size_t len)
+static gchar *
+check_size (CamelMimeFilter *filter, gchar *outptr, gchar **outend, size_t len)
{
size_t offset;
@@ -134,8 +134,8 @@ check_size (CamelMimeFilter *filter, char *outptr, char **outend, size_t len)
return filter->outbuf + offset;
}
-static char *
-append_string_verbatim (CamelMimeFilter *filter, const char *str, char *outptr, char **outend)
+static gchar *
+append_string_verbatim (CamelMimeFilter *filter, const gchar *str, gchar *outptr, gchar **outend)
{
size_t len = strlen (str);
@@ -147,10 +147,10 @@ append_string_verbatim (CamelMimeFilter *filter, const char *str, char *outptr,
}
static int
-citation_depth (const char *in)
+citation_depth (const gchar *in)
{
- register const char *inptr = in;
- int depth = 1;
+ register const gchar *inptr = in;
+ gint depth = 1;
if (*inptr++ != '>')
return 0;
@@ -174,11 +174,11 @@ citation_depth (const char *in)
return depth;
}
-static char *
-writeln (CamelMimeFilter *filter, const unsigned char *in, const unsigned char *inend, char *outptr, char **outend)
+static gchar *
+writeln (CamelMimeFilter *filter, const guchar *in, const guchar *inend, gchar *outptr, gchar **outend)
{
CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
- const unsigned char *inptr = in;
+ const guchar *inptr = in;
while (inptr < inend) {
guint32 u;
@@ -242,14 +242,14 @@ writeln (CamelMimeFilter *filter, const unsigned char *in, const unsigned char *
}
static void
-html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace, gboolean flush)
+html_convert (CamelMimeFilter *filter, gchar *in, size_t inlen, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace, gboolean flush)
{
CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
- register char *inptr, *outptr;
- char *start, *outend;
- const char *inend;
- int depth;
+ register gchar *inptr, *outptr;
+ gchar *start, *outend;
+ const gchar *inend;
+ gint depth;
if (inlen == 0) {
if (html->pre_open) {
@@ -323,7 +323,7 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
do {
if (camel_url_scanner_scan (html->scanner, start, len, &match)) {
/* write out anything before the first regex match */
- outptr = writeln (filter, (const unsigned char *)start, (const unsigned char *)start + match.um_so,
+ outptr = writeln (filter, (const guchar *)start, (const guchar *)start + match.um_so,
outptr, &outend);
start += match.um_so;
@@ -335,19 +335,19 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
outptr = append_string_verbatim (filter, "<a href=\"", outptr, &outend);
/* prefix shouldn't need escaping, but let's be safe */
outptr = writeln (filter,
- (const unsigned char *)match.prefix,
- (const unsigned char *)match.prefix + strlen (match.prefix),
+ (const guchar *)match.prefix,
+ (const guchar *)match.prefix + strlen (match.prefix),
outptr, &outend);
outptr = writeln (filter,
- (const unsigned char *)start,
- (const unsigned char *)start + matchlen,
+ (const guchar *)start,
+ (const guchar *)start + matchlen,
outptr, &outend);
outptr = append_string_verbatim (filter, "\">", outptr, &outend);
/* now write the matched string */
outptr = writeln (filter,
- (const unsigned char *)start,
- (const unsigned char *)start + matchlen,
+ (const guchar *)start,
+ (const guchar *)start + matchlen,
outptr, &outend);
html->column += matchlen;
start += matchlen;
@@ -357,12 +357,12 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
outptr = append_string_verbatim (filter, "</a>", outptr, &outend);
} else {
/* nothing matched so write out the remainder of this line buffer */
- outptr = writeln (filter, (const unsigned char *)start, (const unsigned char *)start + len, outptr, &outend);
+ outptr = writeln (filter, (const guchar *)start, (const guchar *)start + len, outptr, &outend);
break;
}
} while (len > 0);
} else {
- outptr = writeln (filter, (const unsigned char *)start, (const unsigned char *)inptr, outptr, &outend);
+ outptr = writeln (filter, (const guchar *)start, (const guchar *)inptr, outptr, &outend);
}
if ((html->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) && depth > 0) {
@@ -385,7 +385,7 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
if (flush) {
/* flush the rest of our input buffer */
if (start < inend)
- outptr = writeln (filter, (const unsigned char *)start, (const unsigned char *)inend, outptr, &outend);
+ outptr = writeln (filter, (const guchar *)start, (const guchar *)inend, outptr, &outend);
if (html->pre_open) {
/* close the pre-tag */
@@ -403,15 +403,15 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
}
static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
html_convert (filter, in, len, prespace, out, outlen, outprespace, FALSE);
}
static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
html_convert (filter, in, len, prespace, out, outlen, outprespace, TRUE);
}
@@ -452,7 +452,7 @@ CamelMimeFilter *
camel_mime_filter_tohtml_new (guint32 flags, guint32 colour)
{
CamelMimeFilterToHTML *new;
- int i;
+ gint i;
new = CAMEL_MIME_FILTER_TOHTML (camel_object_new (camel_mime_filter_tohtml_get_type ()));
@@ -479,18 +479,18 @@ camel_mime_filter_tohtml_new (guint32 flags, guint32 colour)
* Returns: a newly allocated string containing the HTMLified version
* of @in
**/
-char *
-camel_text_to_html (const char *in, guint32 flags, guint32 colour)
+gchar *
+camel_text_to_html (const gchar *in, guint32 flags, guint32 colour)
{
CamelMimeFilter *filter;
size_t outlen, outpre;
- char *outbuf;
+ gchar *outbuf;
g_return_val_if_fail (in != NULL, NULL);
filter = camel_mime_filter_tohtml_new (flags, colour);
- camel_mime_filter_complete (filter, (char *) in, strlen (in), 0,
+ camel_mime_filter_complete (filter, (gchar *) in, strlen (in), 0,
&outbuf, &outlen, &outpre);
outbuf = g_strndup (outbuf, outlen);
diff --git a/camel/camel-mime-filter-tohtml.h b/camel/camel-mime-filter-tohtml.h
index f585901fb..0f1f15f8e 100644
--- a/camel/camel-mime-filter-tohtml.h
+++ b/camel/camel-mime-filter-tohtml.h
@@ -70,7 +70,7 @@ CamelMimeFilter *camel_mime_filter_tohtml_new (guint32 flags, guint32 colour);
/* utility functions to replace e_text_to_html */
-char *camel_text_to_html (const char *in, guint32 flags, guint32 colour);
+gchar *camel_text_to_html (const gchar *in, guint32 flags, guint32 colour);
G_END_DECLS
diff --git a/camel/camel-mime-filter-windows.c b/camel/camel-mime-filter-windows.c
index 473eac03a..6647ebd39 100644
--- a/camel/camel-mime-filter-windows.c
+++ b/camel/camel-mime-filter-windows.c
@@ -78,19 +78,19 @@ camel_mime_filter_windows_init (CamelObject *o)
}
static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) filter;
- register unsigned char *inptr;
- unsigned char *inend;
+ register guchar *inptr;
+ guchar *inend;
if (!windows->is_windows) {
- inptr = (unsigned char *) in;
+ inptr = (guchar *) in;
inend = inptr + len;
while (inptr < inend) {
- register unsigned char c = *inptr++;
+ register guchar c = *inptr++;
if (c >= 128 && c <= 159) {
w(g_warning ("Encountered Windows charset masquerading as %s",
@@ -107,8 +107,8 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
}
static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
filter_filter (filter, in, len, prespace, out, outlen, outprespace);
}
@@ -144,7 +144,7 @@ camel_mime_filter_windows_class_init (CamelMimeFilterWindowsClass *klass)
* Returns: a new #CamelMimeFilter object
**/
CamelMimeFilter *
-camel_mime_filter_windows_new (const char *claimed_charset)
+camel_mime_filter_windows_new (const gchar *claimed_charset)
{
CamelMimeFilterWindows *new;
@@ -189,7 +189,7 @@ camel_mime_filter_windows_is_windows_charset (CamelMimeFilterWindows *filter)
*
* Returns: the name of the actual charset
**/
-const char *
+const gchar *
camel_mime_filter_windows_real_charset (CamelMimeFilterWindows *filter)
{
g_return_val_if_fail (CAMEL_IS_MIME_FILTER_WINDOWS (filter), NULL);
diff --git a/camel/camel-mime-filter-windows.h b/camel/camel-mime-filter-windows.h
index beadb7989..9c74c8f21 100644
--- a/camel/camel-mime-filter-windows.h
+++ b/camel/camel-mime-filter-windows.h
@@ -39,7 +39,7 @@ struct _CamelMimeFilterWindows {
CamelMimeFilter parent;
gboolean is_windows;
- char *claimed_charset;
+ gchar *claimed_charset;
};
struct _CamelMimeFilterWindowsClass {
@@ -50,10 +50,10 @@ struct _CamelMimeFilterWindowsClass {
CamelType camel_mime_filter_windows_get_type (void);
-CamelMimeFilter *camel_mime_filter_windows_new (const char *claimed_charset);
+CamelMimeFilter *camel_mime_filter_windows_new (const gchar *claimed_charset);
gboolean camel_mime_filter_windows_is_windows_charset (CamelMimeFilterWindows *filter);
-const char *camel_mime_filter_windows_real_charset (CamelMimeFilterWindows *filter);
+const gchar *camel_mime_filter_windows_real_charset (CamelMimeFilterWindows *filter);
G_END_DECLS
diff --git a/camel/camel-mime-filter-yenc.c b/camel/camel-mime-filter-yenc.c
index 9e1445ef6..88afefe5a 100644
--- a/camel/camel-mime-filter-yenc.c
+++ b/camel/camel-mime-filter-yenc.c
@@ -32,10 +32,10 @@
static void camel_mime_filter_yenc_class_init (CamelMimeFilterYencClass *klass);
static void camel_mime_filter_yenc_init (CamelMimeFilterYenc *filter, CamelMimeFilterYencClass *klass);
-static void filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
+static void filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
+static void filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
static void filter_reset (CamelMimeFilter *filter);
@@ -85,8 +85,8 @@ camel_mime_filter_yenc_init (CamelMimeFilterYenc *filter, CamelMimeFilterYencCla
/* here we do all of the basic yEnc filtering */
static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterYenc *yenc = (CamelMimeFilterYenc *) filter;
size_t newlen = 0;
@@ -95,13 +95,13 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
/* won't go to more than 2 * (x + 2) + 62 */
camel_mime_filter_set_size (filter, (len + 2) * 2 + 62, FALSE);
- newlen = camel_yencode_step ((const unsigned char *) in, len, (unsigned char *) filter->outbuf, &yenc->state,
+ newlen = camel_yencode_step ((const guchar *) in, len, (guchar *) filter->outbuf, &yenc->state,
&yenc->pcrc, &yenc->crc);
g_assert (newlen <= (len + 2) * 2 + 62);
break;
case CAMEL_MIME_FILTER_YENC_DIRECTION_DECODE:
if (!(yenc->state & CAMEL_MIME_YDECODE_STATE_DECODE)) {
- register char *inptr, *inend;
+ register gchar *inptr, *inend;
size_t left;
inptr = in;
@@ -166,7 +166,7 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
if ((yenc->state & CAMEL_MIME_YDECODE_STATE_DECODE) && !(yenc->state & CAMEL_MIME_YDECODE_STATE_END)) {
/* all yEnc headers have been found so we can now start decoding */
camel_mime_filter_set_size (filter, len + 3, FALSE);
- newlen = camel_ydecode_step ((const unsigned char *) in, len, (unsigned char *) filter->outbuf, &yenc->state, &yenc->pcrc, &yenc->crc);
+ newlen = camel_ydecode_step ((const guchar *) in, len, (guchar *) filter->outbuf, &yenc->state, &yenc->pcrc, &yenc->crc);
g_assert (newlen <= len + 3);
} else {
newlen = 0;
@@ -180,8 +180,8 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
}
static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterYenc *yenc = (CamelMimeFilterYenc *) filter;
size_t newlen = 0;
@@ -190,7 +190,7 @@ filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
/* won't go to more than 2 * (x + 2) + 62 */
camel_mime_filter_set_size (filter, (len + 2) * 2 + 62, FALSE);
- newlen = camel_yencode_close ((const unsigned char *) in, len, (unsigned char *) filter->outbuf, &yenc->state,
+ newlen = camel_yencode_close ((const guchar *) in, len, (guchar *) filter->outbuf, &yenc->state,
&yenc->pcrc, &yenc->crc);
g_assert (newlen <= (len + 2) * 2 + 62);
break;
@@ -198,7 +198,7 @@ filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
if ((yenc->state & CAMEL_MIME_YDECODE_STATE_DECODE) && !(yenc->state & CAMEL_MIME_YDECODE_STATE_END)) {
/* all yEnc headers have been found so we can now start decoding */
camel_mime_filter_set_size (filter, len + 3, FALSE);
- newlen = camel_ydecode_step ((const unsigned char *) in, len, (unsigned char *) filter->outbuf, &yenc->state,
+ newlen = camel_ydecode_step ((const guchar *) in, len, (guchar *) filter->outbuf, &yenc->state,
&yenc->pcrc, &yenc->crc);
g_assert (newlen <= len + 3);
} else {
@@ -270,7 +270,7 @@ camel_mime_filter_yenc_new (CamelMimeFilterYencDirection direction)
* Sets the current state of the yencoder/ydecoder
**/
void
-camel_mime_filter_yenc_set_state (CamelMimeFilterYenc *yenc, int state)
+camel_mime_filter_yenc_set_state (CamelMimeFilterYenc *yenc, gint state)
{
g_return_if_fail (CAMEL_IS_MIME_FILTER_YENC (yenc));
@@ -305,7 +305,7 @@ camel_mime_filter_yenc_set_crc (CamelMimeFilterYenc *yenc, guint32 crc)
* Returns: the part id of the current decoded yEnc stream or %-1 on
* fail.
**/
-int
+gint
camel_mime_filter_yenc_get_part (CamelMimeFilterYenc *yenc)
{
g_return_val_if_fail (CAMEL_IS_MIME_FILTER_YENC (yenc), -1);
@@ -351,7 +351,7 @@ camel_mime_filter_yenc_get_crc (CamelMimeFilterYenc *yenc)
}
-static const int yenc_crc_table[256] = {
+static const gint yenc_crc_table[256] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
@@ -413,14 +413,14 @@ static const int yenc_crc_table[256] = {
* Returns: the number of bytes decoded
**/
size_t
-camel_ydecode_step (const unsigned char *in, size_t inlen, unsigned char *out,
- int *state, guint32 *pcrc, guint32 *crc)
+camel_ydecode_step (const guchar *in, size_t inlen, guchar *out,
+ gint *state, guint32 *pcrc, guint32 *crc)
{
- register const unsigned char *inptr;
- register unsigned char *outptr;
- const unsigned char *inend;
- unsigned char ch;
- int ystate;
+ register const guchar *inptr;
+ register guchar *outptr;
+ const guchar *inend;
+ guchar ch;
+ gint ystate;
if (*state & CAMEL_MIME_YDECODE_STATE_END)
return 0;
@@ -493,14 +493,14 @@ camel_ydecode_step (const unsigned char *in, size_t inlen, unsigned char *out,
* Returns: the number of bytes encoded
**/
size_t
-camel_yencode_step (const unsigned char *in, size_t inlen, unsigned char *out,
- int *state, guint32 *pcrc, guint32 *crc)
+camel_yencode_step (const guchar *in, size_t inlen, guchar *out,
+ gint *state, guint32 *pcrc, guint32 *crc)
{
- register const unsigned char *inptr;
- register unsigned char *outptr;
- const unsigned char *inend;
- register int already;
- unsigned char ch;
+ register const guchar *inptr;
+ register guchar *outptr;
+ const guchar *inend;
+ register gint already;
+ guchar ch;
inend = in + inlen;
outptr = out;
@@ -558,10 +558,10 @@ camel_yencode_step (const unsigned char *in, size_t inlen, unsigned char *out,
* Returns: the number of bytes encoded.
**/
size_t
-camel_yencode_close (const unsigned char *in, size_t inlen, unsigned char *out,
- int *state, guint32 *pcrc, guint32 *crc)
+camel_yencode_close (const guchar *in, size_t inlen, guchar *out,
+ gint *state, guint32 *pcrc, guint32 *crc)
{
- register unsigned char *outptr;
+ register guchar *outptr;
outptr = out;
diff --git a/camel/camel-mime-filter-yenc.h b/camel/camel-mime-filter-yenc.h
index 0d49f8467..6db62baa3 100644
--- a/camel/camel-mime-filter-yenc.h
+++ b/camel/camel-mime-filter-yenc.h
@@ -67,9 +67,9 @@ struct _CamelMimeFilterYenc {
CamelMimeFilterYencDirection direction;
- int part;
+ gint part;
- int state;
+ gint state;
guint32 pcrc;
guint32 crc;
};
@@ -84,7 +84,7 @@ CamelType camel_mime_filter_yenc_get_type (void);
CamelMimeFilter *camel_mime_filter_yenc_new (CamelMimeFilterYencDirection direction);
-void camel_mime_filter_yenc_set_state (CamelMimeFilterYenc *yenc, int state);
+void camel_mime_filter_yenc_set_state (CamelMimeFilterYenc *yenc, gint state);
void camel_mime_filter_yenc_set_crc (CamelMimeFilterYenc *yenc, guint32 crc);
/*int camel_mime_filter_yenc_get_part (CamelMimeFilterYenc *yenc);*/
@@ -92,12 +92,12 @@ guint32 camel_mime_filter_yenc_get_pcrc (CamelMimeFilterYenc *yenc);
guint32 camel_mime_filter_yenc_get_crc (CamelMimeFilterYenc *yenc);
-size_t camel_ydecode_step (const unsigned char *in, size_t inlen, unsigned char *out,
- int *state, guint32 *pcrc, guint32 *crc);
-size_t camel_yencode_step (const unsigned char *in, size_t inlen, unsigned char *out,
- int *state, guint32 *pcrc, guint32 *crc);
-size_t camel_yencode_close (const unsigned char *in, size_t inlen, unsigned char *out,
- int *state, guint32 *pcrc, guint32 *crc);
+size_t camel_ydecode_step (const guchar *in, size_t inlen, guchar *out,
+ gint *state, guint32 *pcrc, guint32 *crc);
+size_t camel_yencode_step (const guchar *in, size_t inlen, guchar *out,
+ gint *state, guint32 *pcrc, guint32 *crc);
+size_t camel_yencode_close (const guchar *in, size_t inlen, guchar *out,
+ gint *state, guint32 *pcrc, guint32 *crc);
G_END_DECLS
diff --git a/camel/camel-mime-filter.c b/camel/camel-mime-filter.c
index acfe2a593..c027100dc 100644
--- a/camel/camel-mime-filter.c
+++ b/camel/camel-mime-filter.c
@@ -30,7 +30,7 @@
#endif
struct _CamelMimeFilterPrivate {
- char *inbuf;
+ gchar *inbuf;
size_t inlen;
};
@@ -41,8 +41,8 @@ struct _CamelMimeFilterPrivate {
static CamelObjectClass *camel_mime_filter_parent;
-static void complete (CamelMimeFilter *mf, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
+static void complete (CamelMimeFilter *mf, gchar *in, size_t len,
+ size_t prespace, gchar **out, size_t *outlen,
size_t *outprespace);
static void
@@ -98,7 +98,7 @@ camel_mime_filter_get_type (void)
}
static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
{
/* default - do nothing */
}
@@ -120,10 +120,10 @@ camel_mime_filter_new (void)
#ifdef MALLOC_CHECK
static void
-checkmem(void *p)
+checkmem(gpointer p)
{
if (p) {
- int status = mprobe(p);
+ gint status = mprobe(p);
switch (status) {
case MCHECK_HEAD:
@@ -141,11 +141,11 @@ checkmem(void *p)
#endif
static void filter_run(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace,
+ gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace,
void (*filterfunc)(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace))
+ gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace))
{
struct _CamelMimeFilterPrivate *p;
@@ -158,7 +158,7 @@ static void filter_run(CamelMimeFilter *f,
have the pre-space required. We make a buffer that does ...
*/
if (prespace < f->backlen) {
- int newlen = len+prespace+f->backlen;
+ gint newlen = len+prespace+f->backlen;
p = _PRIVATE(f);
if (p->inlen < newlen) {
/* NOTE: g_realloc copies data, we dont need that (slower) */
@@ -211,8 +211,8 @@ static void filter_run(CamelMimeFilter *f,
**/
void
camel_mime_filter_filter (CamelMimeFilter *filter,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+ gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
if (FCLASS(filter)->filter)
filter_run(filter, in, len, prespace, out, outlen, outprespace, FCLASS(filter)->filter);
@@ -239,8 +239,8 @@ camel_mime_filter_filter (CamelMimeFilter *filter,
**/
void
camel_mime_filter_complete (CamelMimeFilter *filter,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
+ gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace)
{
if (FCLASS(filter)->complete)
filter_run(filter, in, len, prespace, out, outlen, outprespace, FCLASS(filter)->complete);
@@ -277,7 +277,7 @@ camel_mime_filter_reset(CamelMimeFilter *filter)
* Note: New calls replace old data.
**/
void
-camel_mime_filter_backup(CamelMimeFilter *filter, const char *data, size_t length)
+camel_mime_filter_backup(CamelMimeFilter *filter, const gchar *data, size_t length)
{
if (filter->backsize < length) {
/* g_realloc copies data, unnecessary overhead */
@@ -300,10 +300,10 @@ camel_mime_filter_backup(CamelMimeFilter *filter, const char *data, size_t lengt
* for filter output.
**/
void
-camel_mime_filter_set_size(CamelMimeFilter *filter, size_t size, int keep)
+camel_mime_filter_set_size(CamelMimeFilter *filter, size_t size, gint keep)
{
if (filter->outsize < size) {
- int offset = filter->outptr - filter->outreal;
+ gint offset = filter->outptr - filter->outreal;
if (keep) {
filter->outreal = g_realloc(filter->outreal, size + PRE_HEAD*4);
} else {
diff --git a/camel/camel-mime-filter.h b/camel/camel-mime-filter.h
index b6730d5e5..70fd8cba9 100644
--- a/camel/camel-mime-filter.h
+++ b/camel/camel-mime-filter.h
@@ -41,13 +41,13 @@ struct _CamelMimeFilter {
struct _CamelMimeFilterPrivate *priv;
- char *outreal; /* real malloc'd buffer */
- char *outbuf; /* first 'writable' position allowed (outreal + outpre) */
- char *outptr;
+ gchar *outreal; /* real malloc'd buffer */
+ gchar *outbuf; /* first 'writable' position allowed (outreal + outpre) */
+ gchar *outptr;
size_t outsize;
size_t outpre; /* prespace of this buffer */
- char *backbuf;
+ gchar *backbuf;
size_t backsize;
size_t backlen; /* significant data there */
};
@@ -57,11 +57,11 @@ struct _CamelMimeFilterClass {
/* virtual functions */
void (*filter)(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
+ gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
void (*complete)(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
+ gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
void (*reset)(CamelMimeFilter *f);
};
@@ -69,20 +69,20 @@ CamelType camel_mime_filter_get_type (void);
CamelMimeFilter *camel_mime_filter_new (void);
void camel_mime_filter_filter(CamelMimeFilter *filter,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
+ gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
void camel_mime_filter_complete(CamelMimeFilter *filter,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
+ gchar *in, size_t len, size_t prespace,
+ gchar **out, size_t *outlen, size_t *outprespace);
void camel_mime_filter_reset(CamelMimeFilter *filter);
/* sets/returns number of bytes backed up on the input */
-void camel_mime_filter_backup(CamelMimeFilter *filter, const char *data, size_t length);
+void camel_mime_filter_backup(CamelMimeFilter *filter, const gchar *data, size_t length);
/* ensure this much size available for filter output */
-void camel_mime_filter_set_size(CamelMimeFilter *filter, size_t size, int keep);
+void camel_mime_filter_set_size(CamelMimeFilter *filter, size_t size, gint keep);
G_END_DECLS
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index f0c61bee4..7fcdd0e11 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -56,7 +56,7 @@
#endif
#define d(x)
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
/* these 2 below should be kept in sync */
typedef enum {
@@ -74,7 +74,7 @@ typedef enum {
HEADER_MESSAGE_ID
} CamelHeaderType;
-static char *header_names[] = {
+static gchar *header_names[] = {
/* dont include HEADER_UNKNOWN string */
"From", "Reply-To", "Subject", "To", "Resent-To", "Cc", "Resent-Cc",
"Bcc", "Resent-Bcc", "Date", "Message-Id", NULL
@@ -84,15 +84,15 @@ static GHashTable *header_name_table;
static CamelMimePartClass *parent_class = NULL;
-static char *recipient_names[] = {
+static gchar *recipient_names[] = {
"To", "Cc", "Bcc", "Resent-To", "Resent-Cc", "Resent-Bcc", NULL
};
static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static void add_header (CamelMedium *medium, const char *name, const void *value);
-static void set_header (CamelMedium *medium, const char *name, const void *value);
-static void remove_header (CamelMedium *medium, const char *name);
-static int construct_from_parser (CamelMimePart *, CamelMimeParser *);
+static void add_header (CamelMedium *medium, const gchar *name, gconstpointer value);
+static void set_header (CamelMedium *medium, const gchar *name, gconstpointer value);
+static void remove_header (CamelMedium *medium, const gchar *name);
+static gint construct_from_parser (CamelMimePart *, CamelMimeParser *);
static void unref_recipient (gpointer key, gpointer value, gpointer user_data);
/* Returns the class for a CamelMimeMessage */
@@ -106,7 +106,7 @@ camel_mime_message_class_init (CamelMimeMessageClass *camel_mime_message_class)
CamelDataWrapperClass *camel_data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (camel_mime_message_class);
CamelMimePartClass *camel_mime_part_class = CAMEL_MIME_PART_CLASS (camel_mime_message_class);
CamelMediumClass *camel_medium_class = CAMEL_MEDIUM_CLASS (camel_mime_message_class);
- int i;
+ gint i;
parent_class = CAMEL_MIME_PART_CLASS (camel_type_get_global_classfuncs (camel_mime_part_get_type ()));
@@ -129,7 +129,7 @@ static void
camel_mime_message_init (gpointer object, gpointer klass)
{
CamelMimeMessage *mime_message = (CamelMimeMessage *)object;
- int i;
+ gint i;
mime_message->recipients = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
for (i=0;recipient_names[i];i++) {
@@ -218,15 +218,15 @@ camel_mime_message_new (void)
* Set the date on a message.
**/
void
-camel_mime_message_set_date (CamelMimeMessage *message, time_t date, int offset)
+camel_mime_message_set_date (CamelMimeMessage *message, time_t date, gint offset)
{
- char *datestr;
+ gchar *datestr;
g_assert(message);
if (date == CAMEL_MESSAGE_DATE_CURRENT) {
struct tm local;
- int tz;
+ gint tz;
date = time(NULL);
e_localtime_with_offset(date, &local, &tz);
@@ -251,7 +251,7 @@ camel_mime_message_set_date (CamelMimeMessage *message, time_t date, int offset
* Returns: the date of the message
**/
time_t
-camel_mime_message_get_date (CamelMimeMessage *msg, int *offset)
+camel_mime_message_get_date (CamelMimeMessage *msg, gint *offset)
{
if (offset)
*offset = msg->date_offset;
@@ -270,10 +270,10 @@ camel_mime_message_get_date (CamelMimeMessage *msg, int *offset)
* Returns: the received date of the message
**/
time_t
-camel_mime_message_get_date_received (CamelMimeMessage *msg, int *offset)
+camel_mime_message_get_date_received (CamelMimeMessage *msg, gint *offset)
{
if (msg->date_received == CAMEL_MESSAGE_DATE_CURRENT) {
- const char *received;
+ const gchar *received;
received = camel_medium_get_header ((CamelMedium *)msg, "received");
if (received)
@@ -298,9 +298,9 @@ camel_mime_message_get_date_received (CamelMimeMessage *msg, int *offset)
* Set the message-id on a message.
**/
void
-camel_mime_message_set_message_id (CamelMimeMessage *mime_message, const char *message_id)
+camel_mime_message_set_message_id (CamelMimeMessage *mime_message, const gchar *message_id)
{
- char *id;
+ gchar *id;
g_assert (mime_message);
@@ -327,7 +327,7 @@ camel_mime_message_set_message_id (CamelMimeMessage *mime_message, const char *m
*
* Returns: the message-id of a message
**/
-const char *
+const gchar *
camel_mime_message_get_message_id (CamelMimeMessage *mime_message)
{
g_assert (mime_message);
@@ -348,7 +348,7 @@ camel_mime_message_get_message_id (CamelMimeMessage *mime_message)
void
camel_mime_message_set_reply_to (CamelMimeMessage *msg, const CamelInternetAddress *reply_to)
{
- char *addr;
+ gchar *addr;
g_assert(msg);
@@ -397,9 +397,9 @@ camel_mime_message_get_reply_to (CamelMimeMessage *mime_message)
* Set the subject text of a message.
**/
void
-camel_mime_message_set_subject (CamelMimeMessage *message, const char *subject)
+camel_mime_message_set_subject (CamelMimeMessage *message, const gchar *subject)
{
- char *text;
+ gchar *text;
g_assert(message);
@@ -407,7 +407,7 @@ camel_mime_message_set_subject (CamelMimeMessage *message, const char *subject)
if (subject) {
message->subject = g_strstrip (g_strdup (subject));
- text = camel_header_encode_string ((unsigned char *) message->subject);
+ text = camel_header_encode_string ((guchar *) message->subject);
} else {
message->subject = NULL;
text = NULL;
@@ -426,7 +426,7 @@ camel_mime_message_set_subject (CamelMimeMessage *message, const char *subject)
*
* Returns: the message subject
**/
-const char *
+const gchar *
camel_mime_message_get_subject (CamelMimeMessage *mime_message)
{
g_assert(mime_message);
@@ -450,7 +450,7 @@ camel_mime_message_get_subject (CamelMimeMessage *mime_message)
void
camel_mime_message_set_from (CamelMimeMessage *msg, const CamelInternetAddress *from)
{
- char *addr;
+ gchar *addr;
g_assert(msg);
@@ -500,9 +500,9 @@ camel_mime_message_get_from (CamelMimeMessage *mime_message)
* Set the recipients of a message.
**/
void
-camel_mime_message_set_recipients(CamelMimeMessage *mime_message, const char *type, const CamelInternetAddress *r)
+camel_mime_message_set_recipients(CamelMimeMessage *mime_message, const gchar *type, const CamelInternetAddress *r)
{
- char *text;
+ gchar *text;
CamelInternetAddress *addr;
g_assert(mime_message);
@@ -539,7 +539,7 @@ camel_mime_message_set_recipients(CamelMimeMessage *mime_message, const char *ty
* Returns: the requested recipients
**/
const CamelInternetAddress *
-camel_mime_message_get_recipients (CamelMimeMessage *mime_message, const char *type)
+camel_mime_message_get_recipients (CamelMimeMessage *mime_message, const gchar *type)
{
g_assert(mime_message);
@@ -548,10 +548,10 @@ camel_mime_message_get_recipients (CamelMimeMessage *mime_message, const char *t
void
-camel_mime_message_set_source (CamelMimeMessage *mime_message, const char *src)
+camel_mime_message_set_source (CamelMimeMessage *mime_message, const gchar *src)
{
CamelURL *url;
- char *uri;
+ gchar *uri;
g_assert (mime_message);
@@ -564,10 +564,10 @@ camel_mime_message_set_source (CamelMimeMessage *mime_message, const char *src)
}
}
-const char *
+const gchar *
camel_mime_message_get_source (CamelMimeMessage *mime_message)
{
- const char *src;
+ const gchar *src;
g_assert(mime_message);
@@ -583,11 +583,11 @@ camel_mime_message_get_source (CamelMimeMessage *mime_message)
static int
construct_from_parser (CamelMimePart *dw, CamelMimeParser *mp)
{
- char *buf;
+ gchar *buf;
size_t len;
- int state;
- int ret;
- int err;
+ gint state;
+ gint ret;
+ gint err;
d(printf("constructing mime-message\n"));
@@ -654,13 +654,13 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
/* FIXME: check format of fields. */
static gboolean
-process_header (CamelMedium *medium, const char *name, const char *value)
+process_header (CamelMedium *medium, const gchar *name, const gchar *value)
{
CamelHeaderType header_type;
CamelMimeMessage *message = CAMEL_MIME_MESSAGE (medium);
CamelInternetAddress *addr;
- const char *charset;
- char *unfolded;
+ const gchar *charset;
+ gchar *unfolded;
header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, name);
switch (header_type) {
@@ -738,14 +738,14 @@ process_header (CamelMedium *medium, const char *name, const char *value)
}
static void
-set_header (CamelMedium *medium, const char *name, const void *value)
+set_header (CamelMedium *medium, const gchar *name, gconstpointer value)
{
process_header (medium, name, value);
parent_class->parent_class.set_header (medium, name, value);
}
static void
-add_header (CamelMedium *medium, const char *name, const void *value)
+add_header (CamelMedium *medium, const gchar *name, gconstpointer value)
{
/* if we process it, then it must be forced unique as well ... */
if (process_header (medium, name, value))
@@ -755,20 +755,20 @@ add_header (CamelMedium *medium, const char *name, const void *value)
}
static void
-remove_header (CamelMedium *medium, const char *name)
+remove_header (CamelMedium *medium, const gchar *name)
{
process_header (medium, name, NULL);
parent_class->parent_class.remove_header (medium, name);
}
-typedef gboolean (*CamelPartFunc)(CamelMimeMessage *, CamelMimePart *, void *data);
+typedef gboolean (*CamelPartFunc)(CamelMimeMessage *, CamelMimePart *, gpointer data);
static gboolean
-message_foreach_part_rec (CamelMimeMessage *msg, CamelMimePart *part, CamelPartFunc callback, void *data)
+message_foreach_part_rec (CamelMimeMessage *msg, CamelMimePart *part, CamelPartFunc callback, gpointer data)
{
CamelDataWrapper *containee;
- int parts, i;
- int go = TRUE;
+ gint parts, i;
+ gint go = TRUE;
if (callback (msg, part, data) == FALSE)
return FALSE;
@@ -796,16 +796,16 @@ message_foreach_part_rec (CamelMimeMessage *msg, CamelMimePart *part, CamelPartF
/* dont make this public yet, it might need some more thinking ... */
/* MPZ */
static void
-camel_mime_message_foreach_part (CamelMimeMessage *msg, CamelPartFunc callback, void *data)
+camel_mime_message_foreach_part (CamelMimeMessage *msg, CamelPartFunc callback, gpointer data)
{
message_foreach_part_rec (msg, (CamelMimePart *)msg, callback, data);
}
static gboolean
-check_8bit (CamelMimeMessage *msg, CamelMimePart *part, void *data)
+check_8bit (CamelMimeMessage *msg, CamelMimePart *part, gpointer data)
{
CamelTransferEncoding encoding;
- int *has8bit = data;
+ gint *has8bit = data;
/* check this part, and stop as soon as we are done */
encoding = camel_mime_part_get_encoding (part);
@@ -827,7 +827,7 @@ check_8bit (CamelMimeMessage *msg, CamelMimePart *part, void *data)
gboolean
camel_mime_message_has_8bit_parts (CamelMimeMessage *msg)
{
- int has8bit = FALSE;
+ gint has8bit = FALSE;
camel_mime_message_foreach_part (msg, check_8bit, &has8bit);
@@ -836,18 +836,18 @@ camel_mime_message_has_8bit_parts (CamelMimeMessage *msg)
/* finds the best charset and transfer encoding for a given part */
static CamelTransferEncoding
-find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBestencEncoding enctype, char **charsetp)
+find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBestencEncoding enctype, gchar **charsetp)
{
CamelMimeFilterCharset *charenc = NULL;
CamelTransferEncoding encoding;
CamelMimeFilterBestenc *bestenc;
- unsigned int flags, callerflags;
+ guint flags, callerflags;
CamelDataWrapper *content;
CamelStreamFilter *filter;
- const char *charsetin = NULL;
- char *charset = NULL;
+ const gchar *charsetin = NULL;
+ gchar *charset = NULL;
CamelStream *null;
- int idb, idc = -1;
+ gint idb, idc = -1;
gboolean istext;
/* we use all these weird stream things so we can do it with streams, and
@@ -960,12 +960,12 @@ struct _enc_data {
};
static gboolean
-best_encoding (CamelMimeMessage *msg, CamelMimePart *part, void *datap)
+best_encoding (CamelMimeMessage *msg, CamelMimePart *part, gpointer datap)
{
struct _enc_data *data = datap;
CamelTransferEncoding encoding;
CamelDataWrapper *wrapper;
- char *charset;
+ gchar *charset;
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
if (!wrapper)
@@ -980,7 +980,7 @@ best_encoding (CamelMimeMessage *msg, CamelMimePart *part, void *datap)
if ((data->required & CAMEL_BESTENC_GET_CHARSET) != 0) {
if (camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
- char *newct;
+ gchar *newct;
/* FIXME: ick, the part content_type interface needs fixing bigtime */
camel_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "charset",
@@ -1046,14 +1046,14 @@ camel_mime_message_encode_8bit_parts (CamelMimeMessage *mime_message)
struct _check_content_id {
CamelMimePart *part;
- const char *content_id;
+ const gchar *content_id;
};
static gboolean
-check_content_id (CamelMimeMessage *message, CamelMimePart *part, void *data)
+check_content_id (CamelMimeMessage *message, CamelMimePart *part, gpointer data)
{
struct _check_content_id *check = (struct _check_content_id *) data;
- const char *content_id;
+ const gchar *content_id;
gboolean found;
content_id = camel_mime_part_get_content_id (part);
@@ -1078,7 +1078,7 @@ check_content_id (CamelMimeMessage *message, CamelMimePart *part, void *data)
* Returns: the MIME part with the requested id or %NULL if not found
**/
CamelMimePart *
-camel_mime_message_get_part_by_content_id (CamelMimeMessage *message, const char *id)
+camel_mime_message_get_part_by_content_id (CamelMimeMessage *message, const gchar *id)
{
struct _check_content_id check;
@@ -1095,12 +1095,12 @@ camel_mime_message_get_part_by_content_id (CamelMimeMessage *message, const char
return check.part;
}
-static const char tz_months[][4] = {
+static const gchar tz_months[][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-static const char tz_days[][4] = {
+static const gchar tz_days[][4] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
@@ -1113,15 +1113,15 @@ static const char tz_days[][4] = {
*
* Returns: an MBox from-line suitable for use in an mbox file
**/
-char *
+gchar *
camel_mime_message_build_mbox_from (CamelMimeMessage *message)
{
struct _camel_header_raw *header = ((CamelMimePart *)message)->headers;
GString *out = g_string_new("From ");
- char *ret;
- const char *tmp;
+ gchar *ret;
+ const gchar *tmp;
time_t thetime;
- int offset;
+ gint offset;
struct tm tm;
tmp = camel_header_raw_find (&header, "Sender", NULL);
@@ -1170,9 +1170,9 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
}
static gboolean
-find_attachment (CamelMimeMessage *msg, CamelMimePart *part, void *data)
+find_attachment (CamelMimeMessage *msg, CamelMimePart *part, gpointer data)
{
- const char *disp;
+ const gchar *disp;
gboolean *found = (gboolean *)data;
g_return_val_if_fail (part != NULL, FALSE);
@@ -1211,12 +1211,12 @@ camel_mime_message_has_attachment (CamelMimeMessage *message)
}
static void
-cmm_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int body, int depth)
+cmm_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, gint body, gint depth)
{
CamelDataWrapper *containee;
- int parts, i;
- int go = TRUE;
- char *s;
+ gint parts, i;
+ gint go = TRUE;
+ gchar *s;
s = alloca(depth+1);
memset(s, ' ', depth);
@@ -1256,7 +1256,7 @@ cmm_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int body, int depth)
* If body is TRUE, then dump body content of the message as well (currently unimplemented).
**/
void
-camel_mime_message_dump(CamelMimeMessage *msg, int body)
+camel_mime_message_dump(CamelMimeMessage *msg, gint body)
{
cmm_dump_rec(msg, (CamelMimePart *)msg, body, 0);
}
diff --git a/camel/camel-mime-message.h b/camel/camel-mime-message.h
index 04160d514..84bd8eb4b 100644
--- a/camel/camel-mime-message.h
+++ b/camel/camel-mime-message.h
@@ -54,15 +54,15 @@ struct _CamelMimeMessage
/* header fields */
time_t date;
- int date_offset; /* GMT offset */
+ gint date_offset; /* GMT offset */
/* cached internal copy */
time_t date_received;
- int date_received_offset; /* GMT offset */
+ gint date_received_offset; /* GMT offset */
- char *subject;
+ gchar *subject;
- char *message_id;
+ gchar *message_id;
CamelInternetAddress *reply_to;
CamelInternetAddress *from;
@@ -87,34 +87,34 @@ CamelType camel_mime_message_get_type (void);
CamelMimeMessage *camel_mime_message_new (void);
void camel_mime_message_set_date (CamelMimeMessage *message,
time_t date,
- int offset);
+ gint offset);
time_t camel_mime_message_get_date (CamelMimeMessage *message,
- int *offset);
+ gint *offset);
time_t camel_mime_message_get_date_received (CamelMimeMessage *message,
- int *offset);
+ gint *offset);
void camel_mime_message_set_message_id (CamelMimeMessage *message,
- const char *message_id);
-const char *camel_mime_message_get_message_id (CamelMimeMessage *message);
+ const gchar *message_id);
+const gchar *camel_mime_message_get_message_id (CamelMimeMessage *message);
void camel_mime_message_set_reply_to (CamelMimeMessage *message,
const CamelInternetAddress *reply_to);
const CamelInternetAddress *camel_mime_message_get_reply_to (CamelMimeMessage *message);
void camel_mime_message_set_subject (CamelMimeMessage *message,
- const char *subject);
-const char *camel_mime_message_get_subject (CamelMimeMessage *message);
+ const gchar *subject);
+const gchar *camel_mime_message_get_subject (CamelMimeMessage *message);
void camel_mime_message_set_from (CamelMimeMessage *message,
const CamelInternetAddress *from);
const CamelInternetAddress *camel_mime_message_get_from (CamelMimeMessage *message);
const CamelInternetAddress *camel_mime_message_get_recipients (CamelMimeMessage *message,
- const char *type);
+ const gchar *type);
void camel_mime_message_set_recipients (CamelMimeMessage *message,
- const char *type,
+ const gchar *type,
const CamelInternetAddress *recipients);
void camel_mime_message_set_source (CamelMimeMessage *message,
- const char *identity);
-const char *camel_mime_message_get_source (CamelMimeMessage *message);
+ const gchar *identity);
+const gchar *camel_mime_message_get_source (CamelMimeMessage *message);
/* utility functions */
@@ -124,13 +124,13 @@ void camel_mime_message_set_best_encoding (CamelMimeMess
CamelBestencEncoding enctype);
void camel_mime_message_encode_8bit_parts (CamelMimeMessage *message);
-CamelMimePart *camel_mime_message_get_part_by_content_id (CamelMimeMessage *message, const char *content_id);
+CamelMimePart *camel_mime_message_get_part_by_content_id (CamelMimeMessage *message, const gchar *content_id);
-char *camel_mime_message_build_mbox_from (CamelMimeMessage *message);
+gchar *camel_mime_message_build_mbox_from (CamelMimeMessage *message);
gboolean camel_mime_message_has_attachment (CamelMimeMessage *message);
-void camel_mime_message_dump(CamelMimeMessage *msg, int body);
+void camel_mime_message_dump(CamelMimeMessage *msg, gint body);
G_END_DECLS
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
index 9e5abe30c..49563409a 100644
--- a/camel/camel-mime-parser.c
+++ b/camel/camel-mime-parser.c
@@ -56,7 +56,7 @@
#define MEMPOOL
#ifdef PURIFY
-int inend_id = -1,
+gint inend_id = -1,
inbuffer_id = -1;
#endif
@@ -74,30 +74,30 @@ struct _header_scan_state {
camel_mime_parser_state_t state;
/* for building headers during scanning */
- char *outbuf;
- char *outptr;
- char *outend;
+ gchar *outbuf;
+ gchar *outptr;
+ gchar *outend;
- int fd; /* input for a fd input */
+ gint fd; /* input for a fd input */
CamelStream *stream; /* or for a stream */
- int ioerrno; /* io error state */
+ gint ioerrno; /* io error state */
/* for scanning input buffers */
- char *realbuf; /* the real buffer, SCAN_HEAD*2 + SCAN_BUF bytes */
- char *inbuf; /* points to a subset of the allocated memory, the underflow */
- char *inptr; /* (upto SCAN_HEAD) is for use by filters so they dont copy all data */
- char *inend;
+ gchar *realbuf; /* the real buffer, SCAN_HEAD*2 + SCAN_BUF bytes */
+ gchar *inbuf; /* points to a subset of the allocated memory, the underflow */
+ gchar *inptr; /* (upto SCAN_HEAD) is for use by filters so they dont copy all data */
+ gchar *inend;
- int atleast;
+ gint atleast;
off_t seek; /* current offset to start of buffer */
- int unstep; /* how many states to 'unstep' (repeat the current state) */
+ gint unstep; /* how many states to 'unstep' (repeat the current state) */
- unsigned int midline:1; /* are we mid-line interrupted? */
- unsigned int scan_from:1; /* do we care about From lines? */
- unsigned int scan_pre_from:1; /* do we return pre-from data? */
- unsigned int eof:1; /* reached eof? */
+ guint midline:1; /* are we mid-line interrupted? */
+ guint scan_from:1; /* do we care about From lines? */
+ guint scan_pre_from:1; /* do we return pre-from data? */
+ guint eof:1; /* reached eof? */
off_t start_of_from; /* where from started */
off_t start_of_boundary; /* where the last boundary started */
@@ -106,7 +106,7 @@ struct _header_scan_state {
off_t header_start; /* start of last header, or -1 */
/* filters to apply to all content before output */
- int filterid; /* id of next filter */
+ gint filterid; /* id of next filter */
struct _header_scan_filter *filters;
/* per message/part info */
@@ -129,45 +129,45 @@ struct _header_scan_stack {
/* I dont use GString's casue you can't efficiently append a buffer to them */
GByteArray *pretext; /* for multipart types, save the pre-boundary data here */
GByteArray *posttext; /* for multipart types, save the post-boundary data here */
- int prestage; /* used to determine if it is a pre-boundary or post-boundary data segment */
+ gint prestage; /* used to determine if it is a pre-boundary or post-boundary data segment */
GByteArray *from_line; /* the from line */
- char *boundary; /* for multipart/ * boundaries, including leading -- and trailing -- for the final part */
- int boundarylen; /* actual length of boundary, including leading -- if there is one */
- int boundarylenfinal; /* length of boundary, including trailing -- if there is one */
- int atleast; /* the biggest boundary from here to the parent */
+ gchar *boundary; /* for multipart/ * boundaries, including leading -- and trailing -- for the final part */
+ gint boundarylen; /* actual length of boundary, including leading -- if there is one */
+ gint boundarylenfinal; /* length of boundary, including trailing -- if there is one */
+ gint atleast; /* the biggest boundary from here to the parent */
};
struct _header_scan_filter {
struct _header_scan_filter *next;
- int id;
+ gint id;
CamelMimeFilter *filter;
};
-static void folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datalength);
+static void folder_scan_step(struct _header_scan_state *s, gchar **databuffer, size_t *datalength);
static void folder_scan_drop_step(struct _header_scan_state *s);
-static int folder_scan_init_with_fd(struct _header_scan_state *s, int fd);
-static int folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream);
+static gint folder_scan_init_with_fd(struct _header_scan_state *s, gint fd);
+static gint folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream);
static struct _header_scan_state *folder_scan_init(void);
static void folder_scan_close(struct _header_scan_state *s);
-static struct _header_scan_stack *folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, size_t *length);
-static struct _header_scan_stack *folder_scan_header(struct _header_scan_state *s, int *lastone);
-static int folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save);
-static off_t folder_seek(struct _header_scan_state *s, off_t offset, int whence);
+static struct _header_scan_stack *folder_scan_content(struct _header_scan_state *s, gint *lastone, gchar **data, size_t *length);
+static struct _header_scan_stack *folder_scan_header(struct _header_scan_state *s, gint *lastone);
+static gint folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save);
+static off_t folder_seek(struct _header_scan_state *s, off_t offset, gint whence);
static off_t folder_tell(struct _header_scan_state *s);
-static int folder_read(struct _header_scan_state *s);
+static gint folder_read(struct _header_scan_state *s);
static void folder_push_part(struct _header_scan_state *s, struct _header_scan_stack *h);
#ifdef MEMPOOL
-static void header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h, char *header, int offset);
+static void header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h, gchar *header, gint offset);
#endif
static void camel_mime_parser_class_init (CamelMimeParserClass *klass);
static void camel_mime_parser_init (CamelMimeParser *obj);
#if d(!)0
-static char *states[] = {
+static gchar *states[] = {
"CAMEL_MIME_PARSER_STATE_INITIAL",
"CAMEL_MIME_PARSER_STATE_PRE_FROM", /* pre-from data */
"CAMEL_MIME_PARSER_STATE_FROM", /* got 'From' line */
@@ -264,7 +264,7 @@ camel_mime_parser_new (void)
* Return value: An id that may be passed to filter_remove() to remove
* the filter, or -1 if the operation failed.
**/
-int
+gint
camel_mime_parser_filter_add(CamelMimeParser *m, CamelMimeFilter *mf)
{
struct _header_scan_state *s = _PRIVATE(m);
@@ -295,7 +295,7 @@ camel_mime_parser_filter_add(CamelMimeParser *m, CamelMimeFilter *mf)
* restriction on the order the filters can be removed.
**/
void
-camel_mime_parser_filter_remove(CamelMimeParser *m, int id)
+camel_mime_parser_filter_remove(CamelMimeParser *m, gint id)
{
struct _header_scan_state *s = _PRIVATE(m);
struct _header_scan_filter *f, *old;
@@ -326,8 +326,8 @@ camel_mime_parser_filter_remove(CamelMimeParser *m, int id)
* Return value: The header value, or NULL if the header is not
* defined.
**/
-const char *
-camel_mime_parser_header(CamelMimeParser *m, const char *name, int *offset)
+const gchar *
+camel_mime_parser_header(CamelMimeParser *m, const gchar *name, gint *offset)
{
struct _header_scan_state *s = _PRIVATE(m);
@@ -359,7 +359,7 @@ camel_mime_parser_headers_raw(CamelMimeParser *m)
return NULL;
}
-static const char *
+static const gchar *
byte_array_to_string(GByteArray *array)
{
if (array == NULL)
@@ -368,7 +368,7 @@ byte_array_to_string(GByteArray *array)
if (array->len == 0 || array->data[array->len-1] != '\0')
g_byte_array_append(array, (guint8 *) "", 1);
- return (const char *) array->data;
+ return (const gchar *) array->data;
}
/**
@@ -380,7 +380,7 @@ byte_array_to_string(GByteArray *array)
*
* Return value: The preface text, or NULL if there wasn't any.
**/
-const char *
+const gchar *
camel_mime_parser_preface(CamelMimeParser *m)
{
struct _header_scan_state *s = _PRIVATE(m);
@@ -401,7 +401,7 @@ camel_mime_parser_preface(CamelMimeParser *m)
*
* Return value: The postface text, or NULL if there wasn't any.
**/
-const char *
+const gchar *
camel_mime_parser_postface(CamelMimeParser *m)
{
struct _header_scan_state *s = _PRIVATE(m);
@@ -425,7 +425,7 @@ camel_mime_parser_postface(CamelMimeParser *m)
*
* Return value: The From line, or NULL if called out of context.
**/
-const char *
+const gchar *
camel_mime_parser_from_line(CamelMimeParser *m)
{
struct _header_scan_state *s = _PRIVATE(m);
@@ -448,8 +448,8 @@ camel_mime_parser_from_line(CamelMimeParser *m)
*
* Return value: Returns -1 on error.
**/
-int
-camel_mime_parser_init_with_fd(CamelMimeParser *m, int fd)
+gint
+camel_mime_parser_init_with_fd(CamelMimeParser *m, gint fd)
{
struct _header_scan_state *s = _PRIVATE(m);
@@ -468,7 +468,7 @@ camel_mime_parser_init_with_fd(CamelMimeParser *m, int fd)
*
* Return value: -1 on error.
**/
-int
+gint
camel_mime_parser_init_with_stream(CamelMimeParser *m, CamelStream *stream)
{
struct _header_scan_state *s = _PRIVATE(m);
@@ -605,14 +605,14 @@ camel_mime_parser_drop_step (CamelMimeParser *parser)
* is returned.
**/
camel_mime_parser_state_t
-camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *datalength)
+camel_mime_parser_step (CamelMimeParser *parser, gchar **databuffer, size_t *datalength)
{
struct _header_scan_state *s = _PRIVATE (parser);
d(printf("OLD STATE: '%s' :\n", states[s->state]));
if (s->unstep <= 0) {
- char *dummy;
+ gchar *dummy;
size_t dummylength;
if (databuffer == NULL) {
@@ -649,11 +649,11 @@ camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *data
*
* Return value: The number of bytes available, or -1 on error.
**/
-int
-camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int len)
+gint
+camel_mime_parser_read (CamelMimeParser *parser, const gchar **databuffer, gint len)
{
struct _header_scan_state *s = _PRIVATE (parser);
- int there;
+ gint there;
if (len == 0)
return 0;
@@ -781,7 +781,7 @@ camel_mime_parser_tell_start_boundary(CamelMimeParser *parser)
* stream or file descriptor).
**/
off_t
-camel_mime_parser_seek(CamelMimeParser *parser, off_t offset, int whence)
+camel_mime_parser_seek(CamelMimeParser *parser, off_t offset, gint whence)
{
struct _header_scan_state *s = _PRIVATE (parser);
@@ -814,7 +814,7 @@ camel_mime_parser_state (CamelMimeParser *parser)
* without headers.
**/
void
-camel_mime_parser_push_state(CamelMimeParser *mp, camel_mime_parser_state_t newstate, const char *boundary)
+camel_mime_parser_push_state(CamelMimeParser *mp, camel_mime_parser_state_t newstate, const gchar *boundary)
{
struct _header_scan_stack *h;
struct _header_scan_state *s = _PRIVATE(mp);
@@ -863,7 +863,7 @@ camel_mime_parser_stream (CamelMimeParser *parser)
* Return value: The file descriptor or -1 if the parser
* is reading from a stream or has not been initialised.
**/
-int
+gint
camel_mime_parser_fd (CamelMimeParser *parser)
{
struct _header_scan_state *s = _PRIVATE (parser);
@@ -872,7 +872,7 @@ camel_mime_parser_fd (CamelMimeParser *parser)
}
/* Return errno of the parser, incase any error occured during processing */
-int
+gint
camel_mime_parser_errno (CamelMimeParser *parser)
{
struct _header_scan_state *s = _PRIVATE (parser);
@@ -888,8 +888,8 @@ camel_mime_parser_errno (CamelMimeParser *parser)
static int
folder_read(struct _header_scan_state *s)
{
- int len;
- int inoffset;
+ gint len;
+ gint inoffset;
if (s->inptr<s->inend-s->atleast || s->eof)
return s->inend-s->inptr;
@@ -942,7 +942,7 @@ folder_tell(struct _header_scan_state *s)
other than top-level messages
*/
static off_t
-folder_seek(struct _header_scan_state *s, off_t offset, int whence)
+folder_seek(struct _header_scan_state *s, off_t offset, gint whence)
{
off_t newoffset;
@@ -1019,9 +1019,9 @@ folder_pull_part(struct _header_scan_state *s)
static int
folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save)
{
- int atleast = s->atleast;
- register char *inptr, *inend, c;
- int len;
+ gint atleast = s->atleast;
+ register gchar *inptr, *inend, c;
+ gint len;
s->atleast = 1;
@@ -1058,10 +1058,10 @@ folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save)
/* TODO: Is there any way to make this run faster? It gets called a lot ... */
static struct _header_scan_stack *
-folder_boundary_check(struct _header_scan_state *s, const char *boundary, int *lastone)
+folder_boundary_check(struct _header_scan_state *s, const gchar *boundary, gint *lastone)
{
struct _header_scan_stack *part;
- int len = s->inend - boundary; /* make sure we dont access past the buffer */
+ gint len = s->inend - boundary; /* make sure we dont access past the buffer */
h(printf("checking boundary marker upto %d bytes\n", len));
part = s->parts;
@@ -1074,7 +1074,7 @@ folder_boundary_check(struct _header_scan_state *s, const char *boundary, int *l
h(printf("matched boundary: %s\n", part->boundary));
/* again, make sure we're in range */
if (part->boundarylenfinal <= len) {
- int extra = part->boundarylenfinal - part->boundarylen;
+ gint extra = part->boundarylenfinal - part->boundarylen;
/* check the extra stuff on an final boundary, normally -- for mime parts */
if (extra>0) {
@@ -1099,14 +1099,14 @@ folder_boundary_check(struct _header_scan_state *s, const char *boundary, int *l
#ifdef MEMPOOL
static void
-header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h, char *header, int offset)
+header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h, gchar *header, gint offset)
{
struct _camel_header_raw *l, *n;
- char *content;
+ gchar *content;
content = strchr(header, ':');
if (content) {
- register int len;
+ register gint len;
n = e_mempool_alloc(h->pool, sizeof(*n));
n->next = NULL;
@@ -1144,12 +1144,12 @@ header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h
/* Basically an optimised version of g_byte_array_append() */
#define header_append(s, start, inptr) \
{ \
- register int headerlen = inptr-start; \
+ register gint headerlen = inptr-start; \
\
if (headerlen > 0) { \
if (headerlen >= (s->outend - s->outptr)) { \
- register char *outnew; \
- register int olen = ((s->outend - s->outbuf) + headerlen) * 2 + 1; \
+ register gchar *outnew; \
+ register gint olen = ((s->outend - s->outbuf) + headerlen) * 2 + 1; \
outnew = g_realloc(s->outbuf, olen); \
s->outptr = s->outptr - s->outbuf + outnew; \
s->outbuf = outnew; \
@@ -1165,14 +1165,14 @@ header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h
}
static struct _header_scan_stack *
-folder_scan_header(struct _header_scan_state *s, int *lastone)
+folder_scan_header(struct _header_scan_state *s, gint *lastone)
{
- int atleast = s->atleast, newatleast;
- char *start = NULL;
- int len;
+ gint atleast = s->atleast, newatleast;
+ gchar *start = NULL;
+ gint len;
struct _header_scan_stack *h;
- char *inend;
- register char *inptr;
+ gchar *inend;
+ register gchar *inptr;
h(printf("scanning first bit\n"));
@@ -1230,7 +1230,7 @@ folder_scan_header(struct _header_scan_state *s, int *lastone)
if (s->outbuf == s->outptr)
goto header_done;
- /* check for continuation/compress headers, we have atleast 1 char here to work with */
+ /* check for continuation/compress headers, we have atleast 1 gchar here to work with */
if (inptr[0] == ' ' || inptr[0] == '\t') {
h(printf("continuation\n"));
@@ -1299,15 +1299,15 @@ header_done:
}
static struct _header_scan_stack *
-folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, size_t *length)
+folder_scan_content(struct _header_scan_state *s, gint *lastone, gchar **data, size_t *length)
{
- int atleast = s->atleast, newatleast;
- register char *inptr;
- char *inend;
- char *start;
- int len;
+ gint atleast = s->atleast, newatleast;
+ register gchar *inptr;
+ gchar *inend;
+ gchar *start;
+ gint len;
struct _header_scan_stack *part;
- int onboundary = FALSE;
+ gint onboundary = FALSE;
c(printf("scanning content\n"));
@@ -1338,7 +1338,7 @@ folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, siz
&& (part = folder_boundary_check(s, inptr, lastone))) {
onboundary = TRUE;
- /* since we truncate the boundary data, we need at least 1 char here spare,
+ /* since we truncate the boundary data, we need at least 1 gchar here spare,
to remain in the same state */
if ( (inptr-start) > 1)
goto content;
@@ -1495,7 +1495,7 @@ folder_scan_reset(struct _header_scan_state *s)
}
static int
-folder_scan_init_with_fd(struct _header_scan_state *s, int fd)
+folder_scan_init_with_fd(struct _header_scan_state *s, gint fd)
{
folder_scan_reset(s);
s->fd = fd;
@@ -1516,12 +1516,12 @@ folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream)
#define USE_FROM
static void
-folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datalength)
+folder_scan_step(struct _header_scan_state *s, gchar **databuffer, size_t *datalength)
{
struct _header_scan_stack *h, *hb;
- const char *content;
- const char *bound;
- int type, state, seenlast;
+ const gchar *content;
+ const gchar *bound;
+ gint type, state, seenlast;
CamelContentType *ct = NULL;
struct _header_scan_filter *f;
size_t presize;
@@ -1803,17 +1803,17 @@ folder_scan_drop_step(struct _header_scan_state *s)
}
#ifdef STANDALONE
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
- int fd;
+ gint fd;
struct _header_scan_state *s;
- char *data;
+ gchar *data;
size_t len;
- int state;
- char *name = "/tmp/evmail/Inbox";
+ gint state;
+ gchar *name = "/tmp/evmail/Inbox";
struct _header_scan_stack *h;
- int i;
- int attach = 0;
+ gint i;
+ gint attach = 0;
if (argc==2)
name = argv[1];
@@ -1821,8 +1821,8 @@ int main(int argc, char **argv)
printf("opening: %s", name);
for (i=1;i<argc;i++) {
- const char *encoding = NULL, *charset = NULL;
- char *attachname;
+ const gchar *encoding = NULL, *charset = NULL;
+ gchar *attachname;
name = argv[i];
printf("opening: %s", name);
diff --git a/camel/camel-mime-parser.h b/camel/camel-mime-parser.h
index 19c3e6a7f..c688ce55f 100644
--- a/camel/camel-mime-parser.h
+++ b/camel/camel-mime-parser.h
@@ -71,7 +71,7 @@ struct _CamelMimeParser {
struct _CamelMimeParserClass {
CamelObjectClass parent_class;
- void (*message) (CamelMimeParser *parser, void *headers);
+ void (*message) (CamelMimeParser *parser, gpointer headers);
void (*part) (CamelMimeParser *parser);
void (*content) (CamelMimeParser *parser);
};
@@ -83,7 +83,7 @@ CamelMimeParser *camel_mime_parser_new (void);
int camel_mime_parser_errno (CamelMimeParser *parser);
/* using an fd will be a little faster, but not much (over a simple stream) */
-int camel_mime_parser_init_with_fd (CamelMimeParser *m, int fd);
+int camel_mime_parser_init_with_fd (CamelMimeParser *m, gint fd);
int camel_mime_parser_init_with_stream (CamelMimeParser *m, CamelStream *stream);
/* get the stream or fd back of the parser */
@@ -96,43 +96,43 @@ void camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from);
void camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from);
/* what headers to save, MUST include ^Content-Type: */
-int camel_mime_parser_set_header_regex (CamelMimeParser *parser, char *matchstr);
+gint camel_mime_parser_set_header_regex (CamelMimeParser *parser, gchar *matchstr);
/* normal interface */
-camel_mime_parser_state_t camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *datalength);
+camel_mime_parser_state_t camel_mime_parser_step (CamelMimeParser *parser, gchar **databuffer, size_t *datalength);
void camel_mime_parser_unstep (CamelMimeParser *parser);
void camel_mime_parser_drop_step (CamelMimeParser *parser);
camel_mime_parser_state_t camel_mime_parser_state (CamelMimeParser *parser);
-void camel_mime_parser_push_state(CamelMimeParser *mp, camel_mime_parser_state_t newstate, const char *boundary);
+void camel_mime_parser_push_state(CamelMimeParser *mp, camel_mime_parser_state_t newstate, const gchar *boundary);
/* read through the parser */
-int camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int len);
+gint camel_mime_parser_read (CamelMimeParser *parser, const gchar **databuffer, gint len);
/* get content type for the current part/header */
CamelContentType *camel_mime_parser_content_type (CamelMimeParser *parser);
/* get/change raw header by name */
-const char *camel_mime_parser_header (CamelMimeParser *m, const char *name, int *offset);
+const gchar *camel_mime_parser_header (CamelMimeParser *m, const gchar *name, gint *offset);
/* get all raw headers. READ ONLY! */
struct _camel_header_raw *camel_mime_parser_headers_raw (CamelMimeParser *m);
/* get multipart pre/postface */
-const char *camel_mime_parser_preface (CamelMimeParser *m);
-const char *camel_mime_parser_postface (CamelMimeParser *m);
+const gchar *camel_mime_parser_preface (CamelMimeParser *m);
+const gchar *camel_mime_parser_postface (CamelMimeParser *m);
/* return the from line content */
-const char *camel_mime_parser_from_line (CamelMimeParser *m);
+const gchar *camel_mime_parser_from_line (CamelMimeParser *m);
/* add a processing filter for body contents */
-int camel_mime_parser_filter_add (CamelMimeParser *m, CamelMimeFilter *mf);
-void camel_mime_parser_filter_remove (CamelMimeParser *m, int id);
+gint camel_mime_parser_filter_add (CamelMimeParser *m, CamelMimeFilter *mf);
+void camel_mime_parser_filter_remove (CamelMimeParser *m, gint id);
/* these should be used with caution, because the state will not
track the seeked position */
/* FIXME: something to bootstrap the state? */
off_t camel_mime_parser_tell (CamelMimeParser *parser);
-off_t camel_mime_parser_seek (CamelMimeParser *parser, off_t offset, int whence);
+off_t camel_mime_parser_seek (CamelMimeParser *parser, off_t offset, gint whence);
off_t camel_mime_parser_tell_start_headers (CamelMimeParser *parser);
off_t camel_mime_parser_tell_start_from (CamelMimeParser *parser);
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index facfc3bf9..2276763f0 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -57,7 +57,7 @@
static void
simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser *mp)
{
- char *buf;
+ gchar *buf;
GByteArray *buffer;
CamelStream *mem;
size_t len;
@@ -84,7 +84,7 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParse
{
CamelDataWrapper *content = NULL;
CamelContentType *ct;
- char *encoding;
+ gchar *encoding;
if (!dw)
return;
@@ -142,14 +142,14 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParse
gboolean
camel_mime_message_build_preview (CamelMimePart *msg, CamelMessageInfo *info)
{
- char *mime_type;
+ gchar *mime_type;
CamelDataWrapper *dw;
gboolean got_plain = FALSE;
dw = camel_medium_get_content_object((CamelMedium *)msg);
mime_type = camel_data_wrapper_get_mime_type(dw);
if (camel_content_type_is (dw->mime_type, "multipart", "*")) {
- int i, nparts;
+ gint i, nparts;
CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)msg);
if (!CAMEL_IS_MULTIPART(mp))
@@ -166,7 +166,7 @@ camel_mime_message_build_preview (CamelMimePart *msg, CamelMessageInfo *info)
CamelStream *mstream, *bstream;
mstream = camel_stream_mem_new();
if (camel_data_wrapper_decode_to_stream (dw, mstream) > 0) {
- char *line = NULL;
+ gchar *line = NULL;
gboolean stop = FALSE;
GString *str = g_string_new (NULL);
@@ -175,7 +175,7 @@ camel_mime_message_build_preview (CamelMimePart *msg, CamelMessageInfo *info)
/* We should fetch just 200 unquoted lines. */
while ((line = camel_stream_buffer_read_line((CamelStreamBuffer *)bstream)) && !stop && str->len < 200) {
- char *tmp = line;
+ gchar *tmp = line;
if (!line)
continue;
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 5c16bcbcd..c67dfbfd5 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -78,24 +78,24 @@ static ssize_t write_to_stream (CamelDataWrapper *dw, Ca
static int construct_from_stream (CamelDataWrapper *dw, CamelStream *stream);
/* from CamelMedium */
-static void add_header (CamelMedium *medium, const char *name, const void *value);
-static void set_header (CamelMedium *medium, const char *name, const void *value);
-static void remove_header (CamelMedium *medium, const char *name);
-static const void *get_header (CamelMedium *medium, const char *name);
+static void add_header (CamelMedium *medium, const gchar *name, gconstpointer value);
+static void set_header (CamelMedium *medium, const gchar *name, gconstpointer value);
+static void remove_header (CamelMedium *medium, const gchar *name);
+static const void *get_header (CamelMedium *medium, const gchar *name);
static GArray *get_headers (CamelMedium *medium);
static void free_headers (CamelMedium *medium, GArray *headers);
static void set_content_object (CamelMedium *medium, CamelDataWrapper *content);
/* from camel mime parser */
-static int construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp);
+static gint construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp);
/* forward references */
-static void set_disposition (CamelMimePart *mime_part, const char *disposition);
+static void set_disposition (CamelMimePart *mime_part, const gchar *disposition);
/* format output of headers */
static ssize_t write_references(CamelStream *stream, struct _camel_header_raw *h);
-/*static int write_fold(CamelStream *stream, struct _camel_header_raw *h);*/
+/*static gint write_fold(CamelStream *stream, struct _camel_header_raw *h);*/
static ssize_t write_raw(CamelStream *stream, struct _camel_header_raw *h);
@@ -210,12 +210,12 @@ camel_mime_part_get_type (void)
/* **** */
static gboolean
-process_header(CamelMedium *medium, const char *name, const char *value)
+process_header(CamelMedium *medium, const gchar *name, const gchar *value)
{
CamelMimePart *mime_part = CAMEL_MIME_PART (medium);
CamelHeaderType header_type;
- const char *charset;
- char *text;
+ const gchar *charset;
+ gchar *text;
/* Try to parse the header pair. If it corresponds to something */
/* known, the job is done in the parsing routine. If not, */
@@ -264,7 +264,7 @@ process_header(CamelMedium *medium, const char *name, const char *value)
}
static void
-set_header (CamelMedium *medium, const char *name, const void *value)
+set_header (CamelMedium *medium, const gchar *name, gconstpointer value)
{
CamelMimePart *part = CAMEL_MIME_PART (medium);
@@ -273,7 +273,7 @@ set_header (CamelMedium *medium, const char *name, const void *value)
}
static void
-add_header (CamelMedium *medium, const char *name, const void *value)
+add_header (CamelMedium *medium, const gchar *name, gconstpointer value)
{
CamelMimePart *part = CAMEL_MIME_PART (medium);
@@ -289,7 +289,7 @@ add_header (CamelMedium *medium, const char *name, const void *value)
}
static void
-remove_header (CamelMedium *medium, const char *name)
+remove_header (CamelMedium *medium, const gchar *name)
{
CamelMimePart *part = (CamelMimePart *)medium;
@@ -297,8 +297,8 @@ remove_header (CamelMedium *medium, const char *name)
camel_header_raw_remove(&part->headers, name);
}
-static const void *
-get_header (CamelMedium *medium, const char *name)
+static gconstpointer
+get_header (CamelMedium *medium, const gchar *name)
{
CamelMimePart *part = (CamelMimePart *)medium;
@@ -339,9 +339,9 @@ free_headers (CamelMedium *medium, GArray *gheaders)
* Set a description on the MIME part.
**/
void
-camel_mime_part_set_description (CamelMimePart *mime_part, const char *description)
+camel_mime_part_set_description (CamelMimePart *mime_part, const gchar *description)
{
- char *text = camel_header_encode_string ((const unsigned char *) description);
+ gchar *text = camel_header_encode_string ((const guchar *) description);
camel_medium_set_header (CAMEL_MEDIUM (mime_part),
"Content-Description", text);
@@ -357,7 +357,7 @@ camel_mime_part_set_description (CamelMimePart *mime_part, const char *descripti
*
* Returns: the description
**/
-const char *
+const gchar *
camel_mime_part_get_description (CamelMimePart *mime_part)
{
return mime_part->description;
@@ -366,7 +366,7 @@ camel_mime_part_get_description (CamelMimePart *mime_part)
/* **** Content-Disposition */
static void
-set_disposition (CamelMimePart *mime_part, const char *disposition)
+set_disposition (CamelMimePart *mime_part, const gchar *disposition)
{
camel_content_disposition_unref(mime_part->disposition);
if (disposition)
@@ -384,9 +384,9 @@ set_disposition (CamelMimePart *mime_part, const char *disposition)
* Set a disposition on the MIME part.
**/
void
-camel_mime_part_set_disposition (CamelMimePart *mime_part, const char *disposition)
+camel_mime_part_set_disposition (CamelMimePart *mime_part, const gchar *disposition)
{
- char *text;
+ gchar *text;
/* we poke in a new disposition (so we dont lose 'filename', etc) */
if (mime_part->disposition == NULL) {
@@ -413,7 +413,7 @@ camel_mime_part_set_disposition (CamelMimePart *mime_part, const char *dispositi
*
* Returns: the dispisition
**/
-const char *
+const gchar *
camel_mime_part_get_disposition (CamelMimePart *mime_part)
{
if (mime_part->disposition)
@@ -433,9 +433,9 @@ camel_mime_part_get_disposition (CamelMimePart *mime_part)
* Set the filename on a MIME part.
**/
void
-camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename)
+camel_mime_part_set_filename (CamelMimePart *mime_part, const gchar *filename)
{
- char *str;
+ gchar *str;
CamelDataWrapper *dw;
if (mime_part->disposition == NULL)
@@ -466,11 +466,11 @@ camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename)
*
* Returns: the filename of the MIME part
**/
-const char *
+const gchar *
camel_mime_part_get_filename (CamelMimePart *mime_part)
{
if (mime_part->disposition) {
- const char *name = camel_header_param (mime_part->disposition->params, "filename");
+ const gchar *name = camel_header_param (mime_part->disposition->params, "filename");
if (name)
return name;
}
@@ -489,9 +489,9 @@ camel_mime_part_get_filename (CamelMimePart *mime_part)
* Set the content-id field on a MIME part.
**/
void
-camel_mime_part_set_content_id (CamelMimePart *mime_part, const char *contentid)
+camel_mime_part_set_content_id (CamelMimePart *mime_part, const gchar *contentid)
{
- char *cid, *id;
+ gchar *cid, *id;
if (contentid)
id = g_strstrip (g_strdup (contentid));
@@ -513,7 +513,7 @@ camel_mime_part_set_content_id (CamelMimePart *mime_part, const char *contentid)
*
* Returns: the content-id field of the MIME part
**/
-const char *
+const gchar *
camel_mime_part_get_content_id (CamelMimePart *mime_part)
{
return mime_part->content_id;
@@ -529,7 +529,7 @@ camel_mime_part_get_content_id (CamelMimePart *mime_part)
* Set the content-md5 field of the MIME part.
**/
void
-camel_mime_part_set_content_MD5 (CamelMimePart *mime_part, const char *md5)
+camel_mime_part_set_content_MD5 (CamelMimePart *mime_part, const gchar *md5)
{
camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-MD5", md5);
}
@@ -543,7 +543,7 @@ camel_mime_part_set_content_MD5 (CamelMimePart *mime_part, const char *md5)
*
* Returns: the content-md5 field of the MIME part
**/
-const char *
+const gchar *
camel_mime_part_get_content_MD5 (CamelMimePart *mime_part)
{
return mime_part->content_MD5;
@@ -560,7 +560,7 @@ camel_mime_part_get_content_MD5 (CamelMimePart *mime_part)
* Set the content-location field of the MIME part.
**/
void
-camel_mime_part_set_content_location (CamelMimePart *mime_part, const char *location)
+camel_mime_part_set_content_location (CamelMimePart *mime_part, const gchar *location)
{
/* FIXME: this should perform content-location folding */
camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Location", location);
@@ -575,7 +575,7 @@ camel_mime_part_set_content_location (CamelMimePart *mime_part, const char *loca
*
* Returns: the content-location field of a MIME part
**/
-const char *
+const gchar *
camel_mime_part_get_content_location (CamelMimePart *mime_part)
{
return mime_part->content_location;
@@ -595,7 +595,7 @@ void
camel_mime_part_set_encoding (CamelMimePart *mime_part,
CamelTransferEncoding encoding)
{
- const char *text;
+ const gchar *text;
text = camel_transfer_encoding_to_string (encoding);
camel_medium_set_header (CAMEL_MEDIUM (mime_part),
@@ -666,7 +666,7 @@ camel_mime_part_get_content_languages (CamelMimePart *mime_part)
* Set the content-type on a MIME part.
**/
void
-camel_mime_part_set_content_type (CamelMimePart *mime_part, const char *content_type)
+camel_mime_part_set_content_type (CamelMimePart *mime_part, const gchar *content_type)
{
camel_medium_set_header (CAMEL_MEDIUM (mime_part),
"Content-Type", content_type);
@@ -697,7 +697,7 @@ set_content_object (CamelMedium *medium, CamelDataWrapper *content)
content_type = camel_data_wrapper_get_mime_type_field (content);
if (mime_part->mime_type != content_type) {
- char *txt;
+ gchar *txt;
txt = camel_content_type_format (content_type);
camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", txt);
@@ -711,7 +711,7 @@ static ssize_t
write_references(CamelStream *stream, struct _camel_header_raw *h)
{
ssize_t len, out, total;
- char *v, *ids, *ide;
+ gchar *v, *ids, *ide;
/* this is only approximate, based on the next >, this way it retains any content
from the original which may not be properly formatted, etc. It also doesn't handle
@@ -754,8 +754,8 @@ write_references(CamelStream *stream, struct _camel_header_raw *h)
static ssize_t
write_fold(CamelStream *stream, struct _camel_header_raw *h)
{
- char *val;
- int count;
+ gchar *val;
+ gint count;
val = camel_header_fold(h->value, strlen(h->name));
count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val);
@@ -768,7 +768,7 @@ write_fold(CamelStream *stream, struct _camel_header_raw *h)
static ssize_t
write_raw(CamelStream *stream, struct _camel_header_raw *h)
{
- char *val = h->value;
+ gchar *val = h->value;
return camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val);
}
@@ -782,7 +782,7 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
CamelDataWrapper *content;
ssize_t total = 0;
ssize_t count;
- int errnosav;
+ gint errnosav;
d(printf("mime_part::write_to_stream\n"));
@@ -791,7 +791,7 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
if (mp->headers) {
struct _camel_header_raw *h = mp->headers;
- char *val;
+ gchar *val;
ssize_t (*writefn)(CamelStream *stream, struct _camel_header_raw *);
/* fold/write the headers. But dont fold headers that are already formatted
@@ -825,10 +825,10 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
CamelMimeFilter *filter = NULL;
CamelStreamFilter *filter_stream = NULL;
CamelMimeFilter *charenc = NULL;
- const char *content_charset = NULL;
- const char *part_charset = NULL;
+ const gchar *content_charset = NULL;
+ const gchar *part_charset = NULL;
gboolean reencode = FALSE;
- const char *filename;
+ const gchar *filename;
if (camel_content_type_is (dw->mime_type, "text", "*")) {
content_charset = camel_content_type_param (content->mime_type, "charset");
@@ -930,10 +930,10 @@ construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
{
CamelDataWrapper *dw = (CamelDataWrapper *) mime_part;
struct _camel_header_raw *headers;
- const char *content;
- char *buf;
+ const gchar *content;
+ gchar *buf;
size_t len;
- int err;
+ gint err;
d(printf("mime_part::construct_from_parser()\n"));
@@ -987,7 +987,7 @@ construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_mime_part_construct_from_parser(CamelMimePart *mime_part, CamelMimeParser *mp)
{
return CMP_CLASS (mime_part)->construct_from_parser (mime_part, mp);
@@ -997,7 +997,7 @@ static int
construct_from_stream(CamelDataWrapper *dw, CamelStream *s)
{
CamelMimeParser *mp;
- int ret;
+ gint ret;
d(printf("mime_part::construct_from_stream()\n"));
@@ -1042,8 +1042,8 @@ camel_mime_part_new (void)
**/
void
camel_mime_part_set_content (CamelMimePart *mime_part,
- const char *data, int length,
- const char *type) /* why on earth is the type last? */
+ const gchar *data, gint length,
+ const gchar *type) /* why on earth is the type last? */
{
CamelMedium *medium = CAMEL_MEDIUM (mime_part);
diff --git a/camel/camel-mime-part.h b/camel/camel-mime-part.h
index 8d0eda5f1..5bbed27cc 100644
--- a/camel/camel-mime-part.h
+++ b/camel/camel-mime-part.h
@@ -46,11 +46,11 @@ struct _CamelMimePart {
/* All fields here are -** PRIVATE **- */
/* TODO: these should be in a camelcontentinfo */
- char *description;
+ gchar *description;
CamelContentDisposition *disposition;
- char *content_id;
- char *content_MD5;
- char *content_location;
+ gchar *content_id;
+ gchar *content_MD5;
+ gchar *content_location;
GList *content_languages;
CamelTransferEncoding encoding;
};
@@ -59,7 +59,7 @@ typedef struct _CamelMimePartClass {
CamelMediumClass parent_class;
/* Virtual methods */
- int (*construct_from_parser) (CamelMimePart *, CamelMimeParser *);
+ gint (*construct_from_parser) (CamelMimePart *, CamelMimeParser *);
} CamelMimePartClass;
/* Standard Camel function */
@@ -68,23 +68,23 @@ CamelType camel_mime_part_get_type (void);
/* public methods */
CamelMimePart * camel_mime_part_new (void);
-void camel_mime_part_set_description (CamelMimePart *mime_part, const char *description);
-const char *camel_mime_part_get_description (CamelMimePart *mime_part);
+void camel_mime_part_set_description (CamelMimePart *mime_part, const gchar *description);
+const gchar *camel_mime_part_get_description (CamelMimePart *mime_part);
-void camel_mime_part_set_disposition (CamelMimePart *mime_part, const char *disposition);
-const char *camel_mime_part_get_disposition (CamelMimePart *mime_part);
+void camel_mime_part_set_disposition (CamelMimePart *mime_part, const gchar *disposition);
+const gchar *camel_mime_part_get_disposition (CamelMimePart *mime_part);
-void camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename);
-const char *camel_mime_part_get_filename (CamelMimePart *mime_part);
+void camel_mime_part_set_filename (CamelMimePart *mime_part, const gchar *filename);
+const gchar *camel_mime_part_get_filename (CamelMimePart *mime_part);
-void camel_mime_part_set_content_id (CamelMimePart *mime_part, const char *contentid);
-const char *camel_mime_part_get_content_id (CamelMimePart *mime_part);
+void camel_mime_part_set_content_id (CamelMimePart *mime_part, const gchar *contentid);
+const gchar *camel_mime_part_get_content_id (CamelMimePart *mime_part);
-void camel_mime_part_set_content_MD5 (CamelMimePart *mime_part, const char *md5sum);
-const char *camel_mime_part_get_content_MD5 (CamelMimePart *mime_part);
+void camel_mime_part_set_content_MD5 (CamelMimePart *mime_part, const gchar *md5sum);
+const gchar *camel_mime_part_get_content_MD5 (CamelMimePart *mime_part);
-void camel_mime_part_set_content_location (CamelMimePart *mime_part, const char *location);
-const char *camel_mime_part_get_content_location (CamelMimePart *mime_part);
+void camel_mime_part_set_content_location (CamelMimePart *mime_part, const gchar *location);
+const gchar *camel_mime_part_get_content_location (CamelMimePart *mime_part);
void camel_mime_part_set_encoding (CamelMimePart *mime_part, CamelTransferEncoding encoding);
CamelTransferEncoding camel_mime_part_get_encoding (CamelMimePart *mime_part);
@@ -93,7 +93,7 @@ void camel_mime_part_set_content_languages (CamelMimePart *mime_part, GList *c
const GList *camel_mime_part_get_content_languages (CamelMimePart *mime_part);
/* FIXME: what about content-type parameters? what about major/minor parts? */
-void camel_mime_part_set_content_type (CamelMimePart *mime_part, const char *content_type);
+void camel_mime_part_set_content_type (CamelMimePart *mime_part, const gchar *content_type);
CamelContentType *camel_mime_part_get_content_type (CamelMimePart *mime_part);
/* construction */
@@ -101,7 +101,7 @@ int camel_mime_part_construct_from_parser (CamelMimePart *mime_part, CamelMime
/* utility functions */
void camel_mime_part_set_content (CamelMimePart *mime_part,
- const char *data, int length, const char *type);
+ const gchar *data, gint length, const gchar *type);
size_t camel_mime_part_get_content_size (CamelMimePart *mime_part);
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index fc01e78c1..df8161127 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -63,9 +63,9 @@
#endif
#if 0
-int strdup_count = 0;
-int malloc_count = 0;
-int free_count = 0;
+gint strdup_count = 0;
+gint malloc_count = 0;
+gint free_count = 0;
#define g_strdup(x) (strdup_count++, g_strdup(x))
#define g_malloc(x) (malloc_count++, g_malloc(x))
@@ -81,7 +81,7 @@ int free_count = 0;
#define CAMEL_UUENCODE_CHAR(c) ((c) ? (c) + ' ' : '`')
#define CAMEL_UUDECODE_CHAR(c) (((c) - ' ') & 077)
-static const unsigned char tohex[16] = {
+static const guchar tohex[16] = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
@@ -102,7 +102,7 @@ static const unsigned char tohex[16] = {
* Returns: the number of bytes encoded
**/
size_t
-camel_base64_encode_close(unsigned char *in, size_t inlen, gboolean break_lines, unsigned char *out, int *state, int *save)
+camel_base64_encode_close(guchar *in, size_t inlen, gboolean break_lines, guchar *out, gint *state, gint *save)
{
gsize bytes = 0;
@@ -132,7 +132,7 @@ camel_base64_encode_close(unsigned char *in, size_t inlen, gboolean break_lines,
* Returns: the number of bytes encoded
**/
size_t
-camel_base64_encode_step(unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save)
+camel_base64_encode_step(guchar *in, size_t len, gboolean break_lines, guchar *out, gint *state, gint *save)
{
return g_base64_encode_step (in, len, break_lines, (gchar *) out, state, save);
}
@@ -151,7 +151,7 @@ camel_base64_encode_step(unsigned char *in, size_t len, gboolean break_lines, un
* Returns: the number of bytes decoded (which have been dumped in @out)
**/
size_t
-camel_base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save)
+camel_base64_decode_step(guchar *in, size_t len, guchar *out, gint *state, guint *save)
{
return g_base64_decode_step ((gchar *) in, len, out, state, save);
}
@@ -166,8 +166,8 @@ camel_base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int
*
* Returns: a string containing the base64 encoded data
**/
-char *
-camel_base64_encode_simple (const char *data, size_t len)
+gchar *
+camel_base64_encode_simple (const gchar *data, size_t len)
{
return g_base64_encode ((const guchar *) data, len);
}
@@ -183,7 +183,7 @@ camel_base64_encode_simple (const char *data, size_t len)
* Returns: the new length of @data
**/
size_t
-camel_base64_decode_simple (char *data, size_t len)
+camel_base64_decode_simple (gchar *data, size_t len)
{
guchar *out_data;
gsize out_len = 0;
@@ -215,11 +215,11 @@ camel_base64_decode_simple (char *data, size_t len)
* Returns: the number of bytes encoded
**/
size_t
-camel_uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state, guint32 *save)
+camel_uuencode_close (guchar *in, size_t len, guchar *out, guchar *uubuf, gint *state, guint32 *save)
{
- register unsigned char *outptr, *bufptr;
+ register guchar *outptr, *bufptr;
register guint32 saved;
- int uulen, uufill, i;
+ gint uulen, uufill, i;
outptr = out;
@@ -243,7 +243,7 @@ camel_uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigne
if (i == 3) {
/* convert 3 normal bytes into 4 uuencoded bytes */
- unsigned char b0, b1, b2;
+ guchar b0, b1, b2;
b0 = saved >> 16;
b1 = saved >> 8 & 0xff;
@@ -261,7 +261,7 @@ camel_uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigne
}
if (uulen > 0) {
- int cplen = ((uulen / 3) * 4);
+ gint cplen = ((uulen / 3) * 4);
*outptr++ = CAMEL_UUENCODE_CHAR ((uulen - uufill) & 0xff);
memcpy (outptr, uubuf, cplen);
@@ -297,12 +297,12 @@ camel_uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigne
* Returns: the number of bytes encoded
**/
size_t
-camel_uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state, guint32 *save)
+camel_uuencode_step (guchar *in, size_t len, guchar *out, guchar *uubuf, gint *state, guint32 *save)
{
- register unsigned char *inptr, *outptr, *bufptr;
- unsigned char *inend;
+ register guchar *inptr, *outptr, *bufptr;
+ guchar *inend;
register guint32 saved;
- int uulen, i;
+ gint uulen, i;
saved = *save;
i = *state & 0xff;
@@ -324,7 +324,7 @@ camel_uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned
if (i == 3) {
/* convert 3 normal bytes into 4 uuencoded bytes */
- unsigned char b0, b1, b2;
+ guchar b0, b1, b2;
b0 = saved >> 16;
b1 = saved >> 8 & 0xff;
@@ -373,13 +373,13 @@ camel_uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned
* Returns: the number of bytes decoded
**/
size_t
-camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *state, guint32 *save)
+camel_uudecode_step (guchar *in, size_t len, guchar *out, gint *state, guint32 *save)
{
- register unsigned char *inptr, *outptr;
- unsigned char *inend, ch;
+ register guchar *inptr, *outptr;
+ guchar *inend, ch;
register guint32 saved;
gboolean last_was_eoln;
- int uulen, i;
+ gint uulen, i;
if (*state & CAMEL_UUDECODE_STATE_END)
return 0;
@@ -421,7 +421,7 @@ camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *sta
i++;
if (i == 4) {
/* convert 4 uuencoded bytes to 3 normal bytes */
- unsigned char b0, b1, b2, b3;
+ guchar b0, b1, b2, b3;
b0 = saved >> 24;
b1 = saved >> 16 & 0xff;
@@ -472,10 +472,10 @@ camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *sta
* Returns: the number of bytes encoded
**/
size_t
-camel_quoted_encode_close(unsigned char *in, size_t len, unsigned char *out, int *state, int *save)
+camel_quoted_encode_close(guchar *in, size_t len, guchar *out, gint *state, gint *save)
{
- register unsigned char *outptr = out;
- int last;
+ register guchar *outptr = out;
+ gint last;
if (len>0)
outptr += camel_quoted_encode_step(in, len, outptr, state, save);
@@ -515,12 +515,12 @@ camel_quoted_encode_close(unsigned char *in, size_t len, unsigned char *out, int
* Returns: the number of bytes encoded
**/
size_t
-camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int *statep, int *save)
+camel_quoted_encode_step (guchar *in, size_t len, guchar *out, gint *statep, gint *save)
{
register guchar *inptr, *outptr, *inend;
- unsigned char c;
- register int sofar = *save; /* keeps track of how many chars on a line */
- register int last = *statep; /* keeps track if last char to end was a space cr etc */
+ guchar c;
+ register gint sofar = *save; /* keeps track of how many chars on a line */
+ register gint last = *statep; /* keeps track if last gchar to end was a space cr etc */
inptr = in;
inend = in + len;
@@ -564,7 +564,7 @@ camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int
sofar = 0;
}
- /* delay output of space char */
+ /* delay output of space gchar */
if (c==' ' || c=='\t') {
last = c;
} else {
@@ -614,11 +614,11 @@ camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int
* Returns: the number of bytes decoded
**/
size_t
-camel_quoted_decode_step(unsigned char *in, size_t len, unsigned char *out, int *savestate, int *saveme)
+camel_quoted_decode_step(guchar *in, size_t len, guchar *out, gint *savestate, gint *saveme)
{
- register unsigned char *inptr, *outptr;
- unsigned char *inend, c;
- int state, save;
+ register guchar *inptr, *outptr;
+ guchar *inend, c;
+ gint state, save;
inend = in+len;
outptr = out;
@@ -706,13 +706,13 @@ camel_quoted_decode_step(unsigned char *in, size_t len, unsigned char *out, int
which is slightly different than plain quoted-printable (mainly by allowing 0x20 <> _)
*/
static size_t
-quoted_decode(const unsigned char *in, size_t len, unsigned char *out)
+quoted_decode(const guchar *in, size_t len, guchar *out)
{
- register const unsigned char *inptr;
- register unsigned char *outptr;
- unsigned const char *inend;
- unsigned char c, c1;
- int ret = 0;
+ register const guchar *inptr;
+ register guchar *outptr;
+ const guchar *inend;
+ guchar c, c1;
+ gint ret = 0;
inend = in+len;
outptr = out;
@@ -749,11 +749,11 @@ quoted_decode(const unsigned char *in, size_t len, unsigned char *out)
/* safemask is the mask to apply to the camel_mime_special_table to determine what
characters can safely be included without encoding */
static size_t
-quoted_encode (const unsigned char *in, size_t len, unsigned char *out, unsigned short safemask)
+quoted_encode (const guchar *in, size_t len, guchar *out, unsigned short safemask)
{
- register const unsigned char *inptr, *inend;
- unsigned char *outptr;
- unsigned char c;
+ register const guchar *inptr, *inend;
+ guchar *outptr;
+ guchar c;
inptr = in;
inend = in + len;
@@ -778,10 +778,10 @@ quoted_encode (const unsigned char *in, size_t len, unsigned char *out, unsigned
static void
-header_decode_lwsp(const char **in)
+header_decode_lwsp(const gchar **in)
{
- const char *inptr = *in;
- char c;
+ const gchar *inptr = *in;
+ gchar c;
d2(printf("is ws: '%s'\n", *in));
@@ -794,7 +794,7 @@ header_decode_lwsp(const char **in)
/* check for comments */
if (*inptr == '(') {
- int depth = 1;
+ gint depth = 1;
inptr++;
while (depth && (c=*inptr) && *inptr != '\0') {
if (c=='\\' && inptr[1]) {
@@ -811,14 +811,14 @@ header_decode_lwsp(const char **in)
*in = inptr;
}
-static char *
-camel_iconv_strndup (iconv_t cd, const char *string, size_t n)
+static gchar *
+camel_iconv_strndup (iconv_t cd, const gchar *string, size_t n)
{
size_t inleft, outleft, converted = 0;
- char *out, *outbuf;
- const char *inbuf;
+ gchar *out, *outbuf;
+ const gchar *inbuf;
size_t outlen;
- int errnosav;
+ gint errnosav;
if (cd == (iconv_t) -1)
return g_strndup (string, n);
@@ -834,7 +834,7 @@ camel_iconv_strndup (iconv_t cd, const char *string, size_t n)
outbuf = out + converted;
outleft = outlen - converted;
- converted = iconv (cd, (char **) &inbuf, &inleft, &outbuf, &outleft);
+ converted = iconv (cd, (gchar **) &inbuf, &inleft, &outbuf, &outleft);
if (converted == (size_t) -1) {
if (errno != E2BIG && errno != EINVAL)
goto fail;
@@ -895,16 +895,16 @@ camel_iconv_strndup (iconv_t cd, const char *string, size_t n)
#define is_ascii(c) isascii ((int) ((unsigned char) (c)))
-static char *
-decode_8bit (const char *text, size_t len, const char *default_charset)
+static gchar *
+decode_8bit (const gchar *text, size_t len, const gchar *default_charset)
{
- const char *charsets[4] = { "UTF-8", NULL, NULL, NULL };
+ const gchar *charsets[4] = { "UTF-8", NULL, NULL, NULL };
size_t inleft, outleft, outlen, rc, min, n;
- const char *locale_charset, *best;
- char *out, *outbuf;
- const char *inbuf;
+ const gchar *locale_charset, *best;
+ gchar *out, *outbuf;
+ const gchar *inbuf;
iconv_t cd;
- int i = 1;
+ gint i = 1;
if (default_charset && g_ascii_strcasecmp (default_charset, "UTF-8") != 0)
charsets[i++] = default_charset;
@@ -930,7 +930,7 @@ decode_8bit (const char *text, size_t len, const char *default_charset)
n = 0;
do {
- rc = iconv (cd, (char **) &inbuf, &inleft, &outbuf, &outleft);
+ rc = iconv (cd, (gchar **) &inbuf, &inleft, &outbuf, &outleft);
if (rc == (size_t) -1) {
if (errno == EINVAL) {
/* incomplete sequence at the end of the input buffer */
@@ -974,8 +974,8 @@ decode_8bit (const char *text, size_t len, const char *default_charset)
/* this shouldn't happen... but if we are here, then
* it did... the only thing we can do at this point
* is replace the 8bit garbage and pray */
- register const char *inptr = text;
- const char *inend = inptr + len;
+ register const gchar *inptr = text;
+ const gchar *inend = inptr + len;
outbuf = out;
@@ -997,7 +997,7 @@ decode_8bit (const char *text, size_t len, const char *default_charset)
inbuf = text;
do {
- rc = iconv (cd, (char **) &inbuf, &inleft, &outbuf, &outleft);
+ rc = iconv (cd, (gchar **) &inbuf, &inleft, &outbuf, &outleft);
if (rc == (size_t) -1) {
if (errno == EINVAL) {
/* incomplete sequence at the end of the input buffer */
@@ -1030,21 +1030,21 @@ decode_8bit (const char *text, size_t len, const char *default_charset)
#define is_rfc2047_encoded_word(atom, len) (len >= 7 && !strncmp (atom, "=?", 2) && !strncmp (atom + len - 2, "?=", 2))
/* decode an rfc2047 encoded-word token */
-static char *
-rfc2047_decode_word (const char *in, size_t inlen, const char *default_charset)
-{
- const unsigned char *instart = (const unsigned char *) in;
- const register unsigned char *inptr = instart + 2;
- const unsigned char *inend = instart + inlen - 2;
- unsigned char *decoded;
- const char *charset;
- char *charenc, *p;
+static gchar *
+rfc2047_decode_word (const gchar *in, size_t inlen, const gchar *default_charset)
+{
+ const guchar *instart = (const guchar *) in;
+ const register guchar *inptr = instart + 2;
+ const guchar *inend = instart + inlen - 2;
+ guchar *decoded;
+ const gchar *charset;
+ gchar *charenc, *p;
guint32 save = 0;
ssize_t declen;
- int state = 0;
+ gint state = 0;
size_t len;
iconv_t cd;
- char *buf;
+ gchar *buf;
/* skip over the charset */
if (inlen < 8 || !(inptr = memchr (inptr, '?', inend - inptr)) || inptr[2] != '?')
@@ -1057,7 +1057,7 @@ rfc2047_decode_word (const char *in, size_t inlen, const char *default_charset)
case 'b':
inptr += 2;
decoded = g_alloca (inend - inptr);
- declen = camel_base64_decode_step ((unsigned char *) inptr, inend - inptr, decoded, &state, &save);
+ declen = camel_base64_decode_step ((guchar *) inptr, inend - inptr, decoded, &state, &save);
break;
case 'Q':
case 'q':
@@ -1098,15 +1098,15 @@ rfc2047_decode_word (const char *in, size_t inlen, const char *default_charset)
/* slight optimization? */
if (!g_ascii_strcasecmp (charset, "UTF-8")) {
- p = (char *) decoded;
+ p = (gchar *) decoded;
len = declen;
- while (!g_utf8_validate (p, len, (const char **) &p)) {
- len = declen - (p - (char *) decoded);
+ while (!g_utf8_validate (p, len, (const gchar **) &p)) {
+ len = declen - (p - (gchar *) decoded);
*p = '?';
}
- return g_strndup ((char *) decoded, declen);
+ return g_strndup ((gchar *) decoded, declen);
}
if (charset[0])
@@ -1117,10 +1117,10 @@ rfc2047_decode_word (const char *in, size_t inlen, const char *default_charset)
"be corrupt: %s", charset[0] ? charset : "unspecified charset",
g_strerror (errno)));
- return decode_8bit ((char *) decoded, declen, default_charset);
+ return decode_8bit ((gchar *) decoded, declen, default_charset);
}
- buf = camel_iconv_strndup (cd, (char *) decoded, declen);
+ buf = camel_iconv_strndup (cd, (gchar *) decoded, declen);
camel_iconv_close (cd);
if (buf != NULL)
@@ -1129,7 +1129,7 @@ rfc2047_decode_word (const char *in, size_t inlen, const char *default_charset)
w(g_warning ("Failed to convert \"%.*s\" to UTF-8, display may be "
"corrupt: %s", declen, decoded, g_strerror (errno)));
- return decode_8bit ((char *) decoded, declen, charset);
+ return decode_8bit ((gchar *) decoded, declen, charset);
}
/* ok, a lot of mailers are BROKEN, and send iso-latin1 encoded
@@ -1137,9 +1137,9 @@ rfc2047_decode_word (const char *in, size_t inlen, const char *default_charset)
according to the rfc's. Anyway, since the conversion to utf-8
is trivial, just do it here without iconv */
static GString *
-append_latin1 (GString *out, const char *in, size_t len)
+append_latin1 (GString *out, const gchar *in, size_t len)
{
- unsigned int c;
+ guint c;
while (len) {
c = (unsigned int)*in++;
@@ -1155,9 +1155,9 @@ append_latin1 (GString *out, const char *in, size_t len)
}
static int
-append_8bit (GString *out, const char *inbuf, size_t inlen, const char *charset)
+append_8bit (GString *out, const gchar *inbuf, size_t inlen, const gchar *charset)
{
- char *outbase, *outbuf;
+ gchar *outbase, *outbuf;
size_t outlen;
iconv_t ic;
@@ -1187,11 +1187,11 @@ append_8bit (GString *out, const char *inbuf, size_t inlen, const char *charset)
}
static GString *
-append_quoted_pair (GString *str, const char *in, size_t inlen)
+append_quoted_pair (GString *str, const gchar *in, size_t inlen)
{
- register const char *inptr = in;
- const char *inend = in + inlen;
- char c;
+ register const gchar *inptr = in;
+ const gchar *inend = in + inlen;
+ gchar c;
while (inptr < inend) {
c = *inptr++;
@@ -1205,15 +1205,15 @@ append_quoted_pair (GString *str, const char *in, size_t inlen)
}
/* decodes a simple text, rfc822 + rfc2047 */
-static char *
-header_decode_text (const char *in, int ctext, const char *default_charset)
+static gchar *
+header_decode_text (const gchar *in, gint ctext, const gchar *default_charset)
{
- register const char *inptr = in;
+ register const gchar *inptr = in;
gboolean encoded = FALSE;
- const char *lwsp, *text;
+ const gchar *lwsp, *text;
size_t nlwsp, n;
gboolean ascii;
- char *decoded;
+ gchar *decoded;
GString *out;
if (in == NULL)
@@ -1330,8 +1330,8 @@ header_decode_text (const char *in, int ctext, const char *default_charset)
* Returns: a string containing the UTF-8 version of the decoded header
* value
**/
-char *
-camel_header_decode_string (const char *in, const char *default_charset)
+gchar *
+camel_header_decode_string (const gchar *in, const gchar *default_charset)
{
if (in == NULL)
return NULL;
@@ -1351,8 +1351,8 @@ camel_header_decode_string (const char *in, const char *default_charset)
* Returns: a string containing the UTF-8 version of the decoded header
* value
**/
-char *
-camel_header_format_ctext (const char *in, const char *default_charset)
+gchar *
+camel_header_format_ctext (const gchar *in, const gchar *default_charset)
{
if (in == NULL)
return NULL;
@@ -1366,13 +1366,13 @@ camel_header_format_ctext (const char *in, const char *default_charset)
/* FIXME: needs a way to cache iconv opens for different charsets? */
static void
-rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *type, unsigned short safemask)
+rfc2047_encode_word(GString *outstring, const gchar *in, size_t len, const gchar *type, unsigned short safemask)
{
iconv_t ic = (iconv_t) -1;
- char *buffer, *out, *ascii;
+ gchar *buffer, *out, *ascii;
size_t inlen, outlen, enclen, bufflen;
- const char *inptr, *p;
- int first = 1;
+ const gchar *inptr, *p;
+ gint first = 1;
d(printf("Converting [%d] '%.*s' to %s\n", len, len, in, type));
@@ -1389,7 +1389,7 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
while (inlen) {
ssize_t convlen, proclen;
- int i;
+ gint i;
/* break up words into smaller bits, what we really want is encoded + overhead < 75,
but we'll just guess what that means in terms of input chars, and assume its good enough */
@@ -1401,13 +1401,13 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
/* native encoding case, the easy one (?) */
/* we work out how much we can convert, and still be in length */
/* proclen will be the result of input characters that we can convert, to the nearest
- (approximated) valid utf8 char */
+ (approximated) valid utf8 gchar */
convlen = 0;
proclen = -1;
p = inptr;
i = 0;
while (p < (in+len) && convlen < (75 - strlen("=?utf-8?q?\?="))) {
- unsigned char c = *p++;
+ guchar c = *p++;
if (c >= 0xc0)
proclen = i;
@@ -1459,7 +1459,7 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
else
*out++ = ' ';
out += sprintf (out, "=?%s?Q?", type);
- out += quoted_encode ((unsigned char *) buffer, enclen, (unsigned char *) out, safemask);
+ out += quoted_encode ((guchar *) buffer, enclen, (guchar *) out, safemask);
sprintf (out, "?=");
d(printf("converted part = %s\n", ascii));
@@ -1482,16 +1482,16 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
*
* Returns: the rfc2047 encoded header
**/
-char *
-camel_header_encode_string (const unsigned char *in)
+gchar *
+camel_header_encode_string (const guchar *in)
{
- const unsigned char *inptr = in, *start, *word;
+ const guchar *inptr = in, *start, *word;
gboolean last_was_encoded = FALSE;
gboolean last_was_space = FALSE;
- const char *charset;
- int encoding;
+ const gchar *charset;
+ gint encoding;
GString *out;
- char *outstr;
+ gchar *outstr;
g_return_val_if_fail (g_utf8_validate ((const gchar *) in, -1, NULL), NULL);
@@ -1517,12 +1517,12 @@ camel_header_encode_string (const unsigned char *in)
start = inptr;
while (inptr && *inptr) {
gunichar c;
- const char *newinptr;
+ const gchar *newinptr;
newinptr = g_utf8_next_char (inptr);
c = g_utf8_get_char ((gchar *) inptr);
if (newinptr == NULL || !g_unichar_validate (c)) {
- w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, char '%c'): %s",
+ w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, gchar '%c'): %s",
(inptr-in), inptr[0], in));
inptr++;
continue;
@@ -1538,23 +1538,23 @@ camel_header_encode_string (const unsigned char *in)
switch (encoding) {
case 0:
- g_string_append_len (out, (const char *) start, inptr - start);
+ g_string_append_len (out, (const gchar *) start, inptr - start);
last_was_encoded = FALSE;
break;
case 1:
if (last_was_encoded)
g_string_append_c (out, ' ');
- rfc2047_encode_word (out, (const char *) start, inptr - start, "ISO-8859-1", CAMEL_MIME_IS_ESAFE);
+ rfc2047_encode_word (out, (const gchar *) start, inptr - start, "ISO-8859-1", CAMEL_MIME_IS_ESAFE);
last_was_encoded = TRUE;
break;
case 2:
if (last_was_encoded)
g_string_append_c (out, ' ');
- if (!(charset = camel_charset_best ((const char *) start, inptr - start)))
+ if (!(charset = camel_charset_best ((const gchar *) start, inptr - start)))
charset = "UTF-8";
- rfc2047_encode_word (out, (const char *) start, inptr - start, charset, CAMEL_MIME_IS_ESAFE);
+ rfc2047_encode_word (out, (const gchar *) start, inptr - start, charset, CAMEL_MIME_IS_ESAFE);
last_was_encoded = TRUE;
break;
}
@@ -1576,7 +1576,7 @@ camel_header_encode_string (const unsigned char *in)
if (!(c < 256 && camel_mime_is_lwsp (c)) && !word)
word = inptr;
- inptr = (const unsigned char *) newinptr;
+ inptr = (const guchar *) newinptr;
}
if (inptr - start) {
@@ -1593,15 +1593,15 @@ camel_header_encode_string (const unsigned char *in)
if (last_was_encoded)
g_string_append_c (out, ' ');
- rfc2047_encode_word (out, (const char *) start, inptr - start, "ISO-8859-1", CAMEL_MIME_IS_ESAFE);
+ rfc2047_encode_word (out, (const gchar *) start, inptr - start, "ISO-8859-1", CAMEL_MIME_IS_ESAFE);
break;
case 2:
if (last_was_encoded)
g_string_append_c (out, ' ');
- if (!(charset = camel_charset_best ((const char *) start, inptr - start)))
+ if (!(charset = camel_charset_best ((const gchar *) start, inptr - start)))
charset = "UTF-8";
- rfc2047_encode_word (out, (const char *) start, inptr - start, charset, CAMEL_MIME_IS_ESAFE);
+ rfc2047_encode_word (out, (const gchar *) start, inptr - start, charset, CAMEL_MIME_IS_ESAFE);
break;
}
}
@@ -1614,9 +1614,9 @@ camel_header_encode_string (const unsigned char *in)
/* apply quoted-string rules to a string */
static void
-quote_word(GString *out, gboolean do_quotes, const char *start, size_t len)
+quote_word(GString *out, gboolean do_quotes, const gchar *start, size_t len)
{
- int i, c;
+ gint i, c;
/* TODO: What about folding on long lines? */
if (do_quotes)
@@ -1639,9 +1639,9 @@ enum _phrase_word_t {
};
struct _phrase_word {
- const unsigned char *start, *end;
+ const guchar *start, *end;
enum _phrase_word_t type;
- int encoding;
+ gint encoding;
};
static gboolean
@@ -1662,12 +1662,12 @@ word_types_compatable (enum _phrase_word_t type1, enum _phrase_word_t type2)
/* split the input into words with info about each word
* merge common word types clean up */
static GList *
-header_encode_phrase_get_words (const unsigned char *in)
+header_encode_phrase_get_words (const guchar *in)
{
- const unsigned char *inptr = in, *start, *last;
+ const guchar *inptr = in, *start, *last;
struct _phrase_word *word;
enum _phrase_word_t type;
- int encoding, count = 0;
+ gint encoding, count = 0;
GList *words = NULL;
/* break the input into words */
@@ -1677,19 +1677,19 @@ header_encode_phrase_get_words (const unsigned char *in)
encoding = 0;
while (inptr && *inptr) {
gunichar c;
- const char *newinptr;
+ const gchar *newinptr;
newinptr = g_utf8_next_char (inptr);
c = g_utf8_get_char ((gchar *) inptr);
if (!g_unichar_validate (c)) {
- w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, char '%c'): %s",
+ w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, gchar '%c'): %s",
(inptr - in), inptr[0], in));
inptr++;
continue;
}
- inptr = (const unsigned char *) newinptr;
+ inptr = (const guchar *) newinptr;
if (g_unichar_isspace (c)) {
if (count > 0) {
word = g_new0 (struct _phrase_word, 1);
@@ -1792,14 +1792,14 @@ header_encode_phrase_merge_words (GList **wordsp)
*
* Returns: the encoded 'phrase'
**/
-char *
-camel_header_encode_phrase (const unsigned char *in)
+gchar *
+camel_header_encode_phrase (const guchar *in)
{
struct _phrase_word *word = NULL, *last_word = NULL;
GList *words, *wordl;
- const char *charset;
+ const gchar *charset;
GString *out;
- char *outstr;
+ gchar *outstr;
if (in == NULL)
return NULL;
@@ -1816,7 +1816,7 @@ camel_header_encode_phrase (const unsigned char *in)
/* output words now with spaces between them */
wordl = words;
while (wordl) {
- const char *start;
+ const gchar *start;
size_t len;
word = wordl->data;
@@ -1825,28 +1825,28 @@ camel_header_encode_phrase (const unsigned char *in)
if (last_word && !(last_word->type == WORD_2047 && word->type == WORD_2047)) {
/* one or both of the words are not encoded so we write the spaces out untouched */
len = word->start - last_word->end;
- out = g_string_append_len (out, (char *) last_word->end, len);
+ out = g_string_append_len (out, (gchar *) last_word->end, len);
}
switch (word->type) {
case WORD_ATOM:
- out = g_string_append_len (out, (char *) word->start, word->end - word->start);
+ out = g_string_append_len (out, (gchar *) word->start, word->end - word->start);
break;
case WORD_QSTRING:
- quote_word (out, TRUE, (char *) word->start, word->end - word->start);
+ quote_word (out, TRUE, (gchar *) word->start, word->end - word->start);
break;
case WORD_2047:
if (last_word && last_word->type == WORD_2047) {
/* include the whitespace chars between these 2 words in the
resulting rfc2047 encoded word. */
len = word->end - last_word->end;
- start = (const char *) last_word->end;
+ start = (const gchar *) last_word->end;
/* encoded words need to be separated by linear whitespace */
g_string_append_c (out, ' ');
} else {
len = word->end - word->start;
- start = (const char *) word->start;
+ start = (const gchar *) word->start;
}
if (word->encoding == 1) {
@@ -1878,11 +1878,11 @@ camel_header_encode_phrase (const unsigned char *in)
/* these are all internal parser functions */
-static char *
-decode_token (const char **in)
+static gchar *
+decode_token (const gchar **in)
{
- const char *inptr = *in;
- const char *start;
+ const gchar *inptr = *in;
+ const gchar *start;
header_decode_lwsp (&inptr);
start = inptr;
@@ -1906,8 +1906,8 @@ decode_token (const char **in)
*
* Returns: a new string containing the first token in @in
**/
-char *
-camel_header_token_decode(const char *in)
+gchar *
+camel_header_token_decode(const gchar *in)
{
if (in == NULL)
return NULL;
@@ -1916,20 +1916,20 @@ camel_header_token_decode(const char *in)
}
/*
- <"> * ( <any char except <"> \, cr / \ <any char> ) <">
+ <"> * ( <any gchar except <"> \, cr / \ <any char> ) <">
*/
-static char *
-header_decode_quoted_string(const char **in)
+static gchar *
+header_decode_quoted_string(const gchar **in)
{
- const char *inptr = *in;
- char *out = NULL, *outptr;
+ const gchar *inptr = *in;
+ gchar *out = NULL, *outptr;
size_t outlen;
- int c;
+ gint c;
header_decode_lwsp(&inptr);
if (*inptr == '"') {
- const char *intmp;
- int skip = 0;
+ const gchar *intmp;
+ gint skip = 0;
/* first, calc length */
inptr++;
@@ -1957,10 +1957,10 @@ header_decode_quoted_string(const char **in)
return out;
}
-static char *
-header_decode_atom(const char **in)
+static gchar *
+header_decode_atom(const gchar **in)
{
- const char *inptr = *in, *start;
+ const gchar *inptr = *in, *start;
header_decode_lwsp(&inptr);
start = inptr;
@@ -1973,10 +1973,10 @@ header_decode_atom(const char **in)
return NULL;
}
-static char *
-header_decode_word (const char **in)
+static gchar *
+header_decode_word (const gchar **in)
{
- const char *inptr = *in;
+ const gchar *inptr = *in;
header_decode_lwsp (&inptr);
if (*inptr == '"') {
@@ -1988,10 +1988,10 @@ header_decode_word (const char **in)
}
}
-static char *
-header_decode_value(const char **in)
+static gchar *
+header_decode_value(const gchar **in)
{
- const char *inptr = *in;
+ const gchar *inptr = *in;
header_decode_lwsp(&inptr);
if (*inptr == '"') {
@@ -2014,13 +2014,13 @@ header_decode_value(const char **in)
* Extracts an integer token from @in and updates the pointer to point
* to after the end of the integer token (sort of like strtol).
*
- * Returns: the int value
+ * Returns: the gint value
**/
-int
-camel_header_decode_int(const char **in)
+gint
+camel_header_decode_int(const gchar **in)
{
- const char *inptr = *in;
- int c, v=0;
+ const gchar *inptr = *in;
+ gint c, v=0;
header_decode_lwsp(&inptr);
while ( (c=*inptr++ & 0xff)
@@ -2033,17 +2033,17 @@ camel_header_decode_int(const char **in)
#define HEXVAL(c) (isdigit (c) ? (c) - '0' : tolower (c) - 'a' + 10)
-static char *
-hex_decode (const char *in, size_t len)
+static gchar *
+hex_decode (const gchar *in, size_t len)
{
- const unsigned char *inend = (const unsigned char *) (in + len);
- unsigned char *inptr, *outptr;
- char *outbuf;
+ const guchar *inend = (const guchar *) (in + len);
+ guchar *inptr, *outptr;
+ gchar *outbuf;
- outbuf = (char *) g_malloc (len + 1);
- outptr = (unsigned char *) outbuf;
+ outbuf = (gchar *) g_malloc (len + 1);
+ outptr = (guchar *) outbuf;
- inptr = (unsigned char *) in;
+ inptr = (guchar *) in;
while (inptr < inend) {
if (*inptr == '%') {
if (isxdigit (inptr[1]) && isxdigit (inptr[2])) {
@@ -2061,12 +2061,12 @@ hex_decode (const char *in, size_t len)
}
/* Tries to convert @in @from charset @to charset. Any failure, we get no data out rather than partial conversion */
-static char *
-header_convert(const char *to, const char *from, const char *in, size_t inlen)
+static gchar *
+header_convert(const gchar *to, const gchar *from, const gchar *in, size_t inlen)
{
iconv_t ic;
size_t outlen, ret;
- char *outbuf, *outbase, *result = NULL;
+ gchar *outbuf, *outbase, *result = NULL;
ic = camel_iconv_open(to, from);
if (ic == (iconv_t) -1)
@@ -2091,13 +2091,13 @@ header_convert(const char *to, const char *from, const char *in, size_t inlen)
* us-ascii'en'This%20is%20even%20more%20
*/
-static char *
-rfc2184_decode (const char *in, size_t len)
+static gchar *
+rfc2184_decode (const gchar *in, size_t len)
{
- const char *inptr = in;
- const char *inend = in + len;
- const char *charset;
- char *decoded, *decword, *encoding;
+ const gchar *inptr = in;
+ const gchar *inend = in + len;
+ const gchar *charset;
+ gchar *decoded, *decword, *encoding;
inptr = memchr (inptr, '\'', len);
if (!inptr)
@@ -2132,8 +2132,8 @@ rfc2184_decode (const char *in, size_t len)
*
* Returns: the value of the @name param
**/
-char *
-camel_header_param (struct _camel_header_param *p, const char *name)
+gchar *
+camel_header_param (struct _camel_header_param *p, const gchar *name)
{
while (p && p->name && g_ascii_strcasecmp (p->name, name) != 0)
p = p->next;
@@ -2154,7 +2154,7 @@ camel_header_param (struct _camel_header_param *p, const char *name)
* Returns: the set param
**/
struct _camel_header_param *
-camel_header_set_param (struct _camel_header_param **l, const char *name, const char *value)
+camel_header_set_param (struct _camel_header_param **l, const gchar *name, const gchar *value)
{
struct _camel_header_param *p = (struct _camel_header_param *)l, *pn;
@@ -2201,8 +2201,8 @@ camel_header_set_param (struct _camel_header_param **l, const char *name, const
*
* Returns: the value of the @name param
**/
-const char *
-camel_content_type_param (CamelContentType *t, const char *name)
+const gchar *
+camel_content_type_param (CamelContentType *t, const gchar *name)
{
if (t==NULL)
return NULL;
@@ -2219,7 +2219,7 @@ camel_content_type_param (CamelContentType *t, const char *name)
* Set a parameter on @content_type.
**/
void
-camel_content_type_set_param (CamelContentType *t, const char *name, const char *value)
+camel_content_type_set_param (CamelContentType *t, const gchar *name, const gchar *value)
{
camel_header_set_param (&t->params, name, value);
}
@@ -2237,8 +2237,8 @@ camel_content_type_set_param (CamelContentType *t, const char *name, const char
* Returns: %TRUE if the content type @ct is of type @type/@subtype or
* %FALSE otherwise
**/
-int
-camel_content_type_is(CamelContentType *ct, const char *type, const char *subtype)
+gint
+camel_content_type_is(CamelContentType *ct, const gchar *type, const gchar *subtype)
{
/* no type == text/plain or text/"*" */
if (ct==NULL || (ct->type == NULL && ct->subtype == NULL)) {
@@ -2286,7 +2286,7 @@ camel_header_param_list_free(struct _camel_header_param *p)
* Returns: the new #CamelContentType
**/
CamelContentType *
-camel_content_type_new(const char *type, const char *subtype)
+camel_content_type_new(const gchar *type, const gchar *subtype)
{
CamelContentType *t;
@@ -2337,12 +2337,12 @@ camel_content_type_unref(CamelContentType *ct)
}
/* for decoding email addresses, canonically */
-static char *
-header_decode_domain(const char **in)
+static gchar *
+header_decode_domain(const gchar **in)
{
- const char *inptr = *in;
- int go = TRUE;
- char *ret;
+ const gchar *inptr = *in;
+ gint go = TRUE;
+ gchar *ret;
GString *domain = g_string_new("");
/* domain ref | domain literal */
@@ -2363,7 +2363,7 @@ header_decode_domain(const char **in)
w(g_warning("closing ']' not found in domain: %s", *in));
}
} else {
- char *a = header_decode_atom(&inptr);
+ gchar *a = header_decode_atom(&inptr);
if (a) {
domain = g_string_append(domain, a);
g_free(a);
@@ -2388,11 +2388,11 @@ header_decode_domain(const char **in)
return ret;
}
-static char *
-header_decode_addrspec(const char **in)
+static gchar *
+header_decode_addrspec(const gchar **in)
{
- const char *inptr = *in;
- char *word;
+ const gchar *inptr = *in;
+ gchar *word;
GString *addr = g_string_new("");
header_decode_lwsp(&inptr);
@@ -2457,15 +2457,15 @@ header_decode_addrspec(const char **in)
*/
static struct _camel_header_address *
-header_decode_mailbox(const char **in, const char *charset)
+header_decode_mailbox(const gchar **in, const gchar *charset)
{
- const char *inptr = *in;
- char *pre;
- int closeme = FALSE;
+ const gchar *inptr = *in;
+ gchar *pre;
+ gint closeme = FALSE;
GString *addr;
GString *name = NULL;
struct _camel_header_address *address = NULL;
- const char *comment = NULL;
+ const gchar *comment = NULL;
addr = g_string_new("");
@@ -2476,7 +2476,7 @@ header_decode_mailbox(const char **in, const char *charset)
/* ',' and '\0' required incase it is a simple address, no @ domain part (buggy writer) */
name = g_string_new ("");
while (pre) {
- char *text, *last;
+ gchar *text, *last;
/* perform internationalised decoding, and append */
text = camel_header_decode_string (pre, charset);
@@ -2557,7 +2557,7 @@ header_decode_mailbox(const char **in, const char *charset)
/* now at '@' domain part */
if (*inptr == '@') {
- char *dom;
+ gchar *dom;
inptr++;
addr = g_string_append_c(addr, '@');
@@ -2569,7 +2569,7 @@ header_decode_mailbox(const char **in, const char *charset)
/* If we get a <, the address was probably a name part, lets try again shall we? */
/* Another fix for seriously-broken-mailers */
if (*inptr && *inptr != ',') {
- char *text;
+ gchar *text;
w(g_warning("We didn't get an '@' where we expected in '%s', trying again", *in));
w(g_warning("Name is '%s', Addr is '%s' we're at '%s'\n", name?name->str:"<UNSET>", addr->str, inptr));
@@ -2615,8 +2615,8 @@ header_decode_mailbox(const char **in, const char *charset)
w(g_warning("invalid route address, no closing '>': %s", *in));
}
} else if (name == NULL && comment != NULL && inptr>comment) { /* check for comment after address */
- char *text, *tmp;
- const char *comstart, *comend;
+ gchar *text, *tmp;
+ const gchar *comstart, *comend;
/* this is a bit messy, we go from the last known position, because
decode_domain/etc skip over any comments on the way */
@@ -2649,7 +2649,7 @@ header_decode_mailbox(const char **in, const char *charset)
if (addr->len > 0) {
if (!g_utf8_validate (addr->str, addr->len, NULL)) {
/* workaround for invalid addr-specs containing 8bit chars (see bug #42170 for details) */
- const char *locale_charset;
+ const gchar *locale_charset;
GString *out;
locale_charset = camel_iconv_locale_charset ();
@@ -2677,10 +2677,10 @@ header_decode_mailbox(const char **in, const char *charset)
}
static struct _camel_header_address *
-header_decode_address(const char **in, const char *charset)
+header_decode_address(const gchar **in, const gchar *charset)
{
- const char *inptr = *in;
- char *pre;
+ const gchar *inptr = *in;
+ gchar *pre;
GString *group = g_string_new("");
struct _camel_header_address *addr = NULL, *member;
@@ -2700,7 +2700,7 @@ header_decode_address(const char **in, const char *charset)
/* FIXME: check rfc 2047 encodings of words, here or above in the loop */
header_decode_lwsp(&inptr);
if (*inptr != ';') {
- int go = TRUE;
+ gint go = TRUE;
do {
member = header_decode_mailbox(&inptr, charset);
if (member)
@@ -2729,11 +2729,11 @@ header_decode_address(const char **in, const char *charset)
return addr;
}
-static char *
-header_msgid_decode_internal(const char **in)
+static gchar *
+header_msgid_decode_internal(const gchar **in)
{
- const char *inptr = *in;
- char *msgid = NULL;
+ const gchar *inptr = *in;
+ gchar *msgid = NULL;
d(printf("decoding Message-ID: '%s'\n", *in));
@@ -2769,8 +2769,8 @@ header_msgid_decode_internal(const char **in)
*
* Returns: the msg-id
**/
-char *
-camel_header_msgid_decode(const char *in)
+gchar *
+camel_header_msgid_decode(const gchar *in)
{
if (in == NULL)
return NULL;
@@ -2787,13 +2787,13 @@ camel_header_msgid_decode(const char *in)
*
* Returns: the extracted content-id
**/
-char *
-camel_header_contentid_decode (const char *in)
+gchar *
+camel_header_contentid_decode (const gchar *in)
{
- const char *inptr = in;
+ const gchar *inptr = in;
gboolean at = FALSE;
GString *addr;
- char *buf;
+ gchar *buf;
d(printf("decoding Content-ID: '%s'\n", in));
@@ -2855,7 +2855,7 @@ camel_header_contentid_decode (const char *in)
}
void
-camel_header_references_list_append_asis(struct _camel_header_references **list, char *ref)
+camel_header_references_list_append_asis(struct _camel_header_references **list, gchar *ref)
{
struct _camel_header_references *w = (struct _camel_header_references *)list, *n;
while (w->next)
@@ -2866,10 +2866,10 @@ camel_header_references_list_append_asis(struct _camel_header_references **list,
w->next = n;
}
-int
+gint
camel_header_references_list_size(struct _camel_header_references **list)
{
- int count = 0;
+ gint count = 0;
struct _camel_header_references *w = *list;
while (w) {
count++;
@@ -2892,11 +2892,11 @@ camel_header_references_list_clear(struct _camel_header_references **list)
}
static void
-header_references_decode_single (const char **in, struct _camel_header_references **head)
+header_references_decode_single (const gchar **in, struct _camel_header_references **head)
{
struct _camel_header_references *ref;
- const char *inptr = *in;
- char *id, *word;
+ const gchar *inptr = *in;
+ gchar *id, *word;
while (*inptr) {
header_decode_lwsp (&inptr);
@@ -2923,7 +2923,7 @@ header_references_decode_single (const char **in, struct _camel_header_reference
/* TODO: why is this needed? Can't the other interface also work? */
struct _camel_header_references *
-camel_header_references_inreplyto_decode (const char *in)
+camel_header_references_inreplyto_decode (const gchar *in)
{
struct _camel_header_references *ref = NULL;
@@ -2937,7 +2937,7 @@ camel_header_references_inreplyto_decode (const char *in)
/* generate a list of references, from most recent up */
struct _camel_header_references *
-camel_header_references_decode (const char *in)
+camel_header_references_decode (const gchar *in)
{
struct _camel_header_references *refs = NULL;
@@ -2966,7 +2966,7 @@ camel_header_references_dup(const struct _camel_header_references *list)
}
struct _camel_header_address *
-camel_header_mailbox_decode(const char *in, const char *charset)
+camel_header_mailbox_decode(const gchar *in, const gchar *charset)
{
if (in == NULL)
return NULL;
@@ -2975,9 +2975,9 @@ camel_header_mailbox_decode(const char *in, const char *charset)
}
struct _camel_header_address *
-camel_header_address_decode(const char *in, const char *charset)
+camel_header_address_decode(const gchar *in, const gchar *charset)
{
- const char *inptr = in, *last;
+ const gchar *inptr = in, *last;
struct _camel_header_address *list = NULL, *addr;
d(printf("decoding To: '%s'\n", in));
@@ -3013,12 +3013,12 @@ camel_header_address_decode(const char *in, const char *charset)
}
struct _camel_header_newsgroup *
-camel_header_newsgroups_decode(const char *in)
+camel_header_newsgroups_decode(const gchar *in)
{
- const char *inptr = in;
- register char c;
+ const gchar *inptr = in;
+ register gchar c;
struct _camel_header_newsgroup *head, *last, *ng;
- const char *start;
+ const gchar *start;
head = NULL;
last = (struct _camel_header_newsgroup *)&head;
@@ -3053,7 +3053,7 @@ camel_header_newsgroups_free(struct _camel_header_newsgroup *ng)
}
/* this must be kept in sync with the header */
-static const char *encodings[] = {
+static const gchar *encodings[] = {
"",
"7bit",
"8bit",
@@ -3063,7 +3063,7 @@ static const char *encodings[] = {
"x-uuencode",
};
-const char *
+const gchar *
camel_transfer_encoding_to_string (CamelTransferEncoding encoding)
{
if (encoding >= sizeof (encodings) / sizeof (encodings[0]))
@@ -3073,9 +3073,9 @@ camel_transfer_encoding_to_string (CamelTransferEncoding encoding)
}
CamelTransferEncoding
-camel_transfer_encoding_from_string (const char *string)
+camel_transfer_encoding_from_string (const gchar *string)
{
- int i;
+ gint i;
if (string != NULL) {
for (i = 0; i < sizeof (encodings) / sizeof (encodings[0]); i++)
@@ -3087,10 +3087,10 @@ camel_transfer_encoding_from_string (const char *string)
}
void
-camel_header_mime_decode(const char *in, int *maj, int *min)
+camel_header_mime_decode(const gchar *in, gint *maj, gint *min)
{
- const char *inptr = in;
- int major=-1, minor=-1;
+ const gchar *inptr = in;
+ gint major=-1, minor=-1;
d(printf("decoding MIME-Version: '%s'\n", in));
@@ -3118,15 +3118,15 @@ camel_header_mime_decode(const char *in, int *maj, int *min)
struct _rfc2184_param {
struct _camel_header_param param;
- int index;
+ gint index;
};
static int
-rfc2184_param_cmp(const void *ap, const void *bp)
+rfc2184_param_cmp(gconstpointer ap, gconstpointer bp)
{
- const struct _rfc2184_param *a = *(void **)ap;
- const struct _rfc2184_param *b = *(void **)bp;
- int res;
+ const struct _rfc2184_param *a = *(gpointer *)ap;
+ const struct _rfc2184_param *b = *(gpointer *)bp;
+ gint res;
res = strcmp(a->param.name, b->param.name);
if (res == 0) {
@@ -3141,7 +3141,7 @@ rfc2184_param_cmp(const void *ap, const void *bp)
/* NB: Steals name and value */
static struct _camel_header_param *
-header_append_param(struct _camel_header_param *last, char *name, char *value)
+header_append_param(struct _camel_header_param *last, gchar *name, gchar *value)
{
struct _camel_header_param *node;
@@ -3157,7 +3157,7 @@ header_append_param(struct _camel_header_param *last, char *name, char *value)
&& (node->value = header_decode_text(value, FALSE, NULL))) {
g_free(value);
} else if (g_ascii_strcasecmp (name, "boundary") != 0 && !g_utf8_validate(value, -1, NULL)) {
- const char *charset = camel_iconv_locale_charset();
+ const gchar *charset = camel_iconv_locale_charset();
if ((node->value = header_convert("UTF-8", charset?charset:"ISO-8859-1", value, strlen(value)))) {
g_free(value);
@@ -3174,19 +3174,19 @@ header_append_param(struct _camel_header_param *last, char *name, char *value)
}
static struct _camel_header_param *
-header_decode_param_list (const char **in)
+header_decode_param_list (const gchar **in)
{
struct _camel_header_param *head = NULL, *last = (struct _camel_header_param *)&head;
GPtrArray *split = NULL;
- const char *inptr = *in;
+ const gchar *inptr = *in;
struct _rfc2184_param *work;
- char *tmp;
+ gchar *tmp;
/* Dump parameters into the output list, in the order found. RFC 2184 split parameters are kept in an array */
header_decode_lwsp(&inptr);
while (*inptr == ';') {
- char *name;
- char *value = NULL;
+ gchar *name;
+ gchar *value = NULL;
inptr++;
name = decode_token(&inptr);
@@ -3197,7 +3197,7 @@ header_decode_param_list (const char **in)
}
if (name && value) {
- char *index = strchr(name, '*');
+ gchar *index = strchr(name, '*');
if (index) {
if (index[1] == 0) {
@@ -3236,7 +3236,7 @@ header_decode_param_list (const char **in)
if (split) {
GString *value = g_string_new("");
struct _rfc2184_param *first;
- int i;
+ gint i;
qsort(split->pdata, split->len, sizeof(split->pdata[0]), rfc2184_param_cmp);
first = split->pdata[0];
@@ -3272,7 +3272,7 @@ header_decode_param_list (const char **in)
}
struct _camel_header_param *
-camel_header_param_list_decode(const char *in)
+camel_header_param_list_decode(const gchar *in)
{
if (in == NULL)
return NULL;
@@ -3280,15 +3280,15 @@ camel_header_param_list_decode(const char *in)
return header_decode_param_list(&in);
}
-static char *
-header_encode_param (const unsigned char *in, gboolean *encoded, gboolean is_filename)
+static gchar *
+header_encode_param (const guchar *in, gboolean *encoded, gboolean is_filename)
{
- const unsigned char *inptr = in;
- unsigned char *outbuf = NULL;
- const char *charset;
+ const guchar *inptr = in;
+ guchar *outbuf = NULL;
+ const gchar *charset;
GString *out;
guint32 c;
- char *str;
+ gchar *str;
*encoded = FALSE;
@@ -3318,16 +3318,16 @@ header_encode_param (const unsigned char *in, gboolean *encoded, gboolean is_fil
/* if we have really broken utf8 passed in, we just treat it as binary data */
- charset = camel_charset_best((char *) in, strlen((char *) in));
+ charset = camel_charset_best((gchar *) in, strlen((gchar *) in));
if (charset == NULL) {
- return g_strdup((char *) in);
+ return g_strdup((gchar *) in);
}
if (g_ascii_strcasecmp(charset, "UTF-8") != 0) {
- if ((outbuf = (unsigned char *) header_convert(charset, "UTF-8", (const char *) in, strlen((char *) in))))
+ if ((outbuf = (guchar *) header_convert(charset, "UTF-8", (const gchar *) in, strlen((gchar *) in))))
inptr = outbuf;
else
- return g_strdup((char *) in);
+ return g_strdup((gchar *) in);
}
/* FIXME: set the 'language' as well, assuming we can get that info...? */
@@ -3353,34 +3353,34 @@ header_encode_param (const unsigned char *in, gboolean *encoded, gboolean is_fil
otherwise they will be encoded in the correct RFC 2231 way. It's because Outlook and GMail
do not understand the correct standard and refuse attachments with localized name sent
from evolution. */
-int camel_header_param_encode_filenames_in_rfc_2047 = 0;
+gint camel_header_param_encode_filenames_in_rfc_2047 = 0;
void
camel_header_param_list_format_append (GString *out, struct _camel_header_param *p)
{
- int used = out->len;
+ gint used = out->len;
while (p) {
gboolean is_filename = camel_header_param_encode_filenames_in_rfc_2047 && (g_ascii_strcasecmp (p->name, "filename") == 0 || g_ascii_strcasecmp (p->name, "name") == 0);
gboolean encoded = FALSE;
gboolean quote = FALSE;
- int here = out->len;
+ gint here = out->len;
size_t nlen, vlen;
- char *value;
+ gchar *value;
if (!p->value) {
p = p->next;
continue;
}
- value = header_encode_param ((unsigned char *) p->value, &encoded, is_filename);
+ value = header_encode_param ((guchar *) p->value, &encoded, is_filename);
if (!value) {
w(g_warning ("appending parameter %s=%s violates rfc2184", p->name, p->value));
value = g_strdup (p->value);
}
if (!encoded) {
- char *ch;
+ gchar *ch;
for (ch = value; *ch; ch++) {
if (camel_mime_is_tspecial (*ch) || camel_mime_is_lwsp (*ch))
@@ -3404,20 +3404,20 @@ camel_header_param_list_format_append (GString *out, struct _camel_header_param
if (!is_filename && nlen + vlen > CAMEL_FOLD_SIZE - 8) {
/* we need to do special rfc2184 parameter wrapping */
- int maxlen = CAMEL_FOLD_SIZE - (nlen + 8);
- char *inptr, *inend;
- int i = 0;
+ gint maxlen = CAMEL_FOLD_SIZE - (nlen + 8);
+ gchar *inptr, *inend;
+ gint i = 0;
inptr = value;
inend = value + vlen;
while (inptr < inend) {
- char *ptr = inptr + MIN (inend - inptr, maxlen);
+ gchar *ptr = inptr + MIN (inend - inptr, maxlen);
if (encoded && ptr < inend) {
- /* be careful not to break an encoded char (ie %20) */
- char *q = ptr;
- int j = 2;
+ /* be careful not to break an encoded gchar (ie %20) */
+ gchar *q = ptr;
+ gint j = 2;
for ( ; j > 0 && q > inptr && *q != '%'; j--, q--);
if (*q == '%')
@@ -3462,11 +3462,11 @@ camel_header_param_list_format_append (GString *out, struct _camel_header_param
}
}
-char *
+gchar *
camel_header_param_list_format(struct _camel_header_param *p)
{
GString *out = g_string_new("");
- char *ret;
+ gchar *ret;
camel_header_param_list_format_append(out, p);
ret = out->str;
@@ -3475,10 +3475,10 @@ camel_header_param_list_format(struct _camel_header_param *p)
}
CamelContentType *
-camel_content_type_decode(const char *in)
+camel_content_type_decode(const gchar *in)
{
- const char *inptr = in;
- char *type, *subtype = NULL;
+ const gchar *inptr = in;
+ gchar *type, *subtype = NULL;
CamelContentType *t = NULL;
if (in==NULL)
@@ -3531,11 +3531,11 @@ camel_content_type_dump(CamelContentType *ct)
printf("\n");
}
-char *
+gchar *
camel_content_type_format (CamelContentType *ct)
{
GString *out;
- char *ret;
+ gchar *ret;
if (ct == NULL)
return NULL;
@@ -3561,7 +3561,7 @@ camel_content_type_format (CamelContentType *ct)
return ret;
}
-char *
+gchar *
camel_content_type_simple (CamelContentType *ct)
{
if (ct->type == NULL) {
@@ -3577,8 +3577,8 @@ camel_content_type_simple (CamelContentType *ct)
return g_strdup_printf ("%s/%s", ct->type, ct->subtype);
}
-char *
-camel_content_transfer_encoding_decode (const char *in)
+gchar *
+camel_content_transfer_encoding_decode (const gchar *in)
{
if (in)
return decode_token (&in);
@@ -3587,10 +3587,10 @@ camel_content_transfer_encoding_decode (const char *in)
}
CamelContentDisposition *
-camel_content_disposition_decode(const char *in)
+camel_content_disposition_decode(const gchar *in)
{
CamelContentDisposition *d = NULL;
- const char *inptr = in;
+ const gchar *inptr = in;
if (in == NULL)
return NULL;
@@ -3625,11 +3625,11 @@ camel_content_disposition_unref(CamelContentDisposition *d)
}
}
-char *
+gchar *
camel_content_disposition_format(CamelContentDisposition *d)
{
GString *out;
- char *ret;
+ gchar *ret;
if (d==NULL)
return NULL;
@@ -3664,7 +3664,7 @@ camel_content_disposition_format(CamelContentDisposition *d)
#define DATE_TOKEN_NON_TIMEZONE_NUMERIC (1 << 6)
#define DATE_TOKEN_HAS_SIGN (1 << 7)
-static unsigned char camel_datetok_table[256] = {
+static guchar camel_datetok_table[256] = {
128,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
111,111,111,111,111,111,111,111, 79, 79,111,175,111,175,111,111,
@@ -3684,8 +3684,8 @@ static unsigned char camel_datetok_table[256] = {
};
static struct {
- char *name;
- int offset;
+ gchar *name;
+ gint offset;
} tz_offsets [] = {
{ "UT", 0 },
{ "GMT", 0 },
@@ -3704,12 +3704,12 @@ static struct {
{ "Y", 1200 },
};
-static const char tm_months [][4] = {
+static const gchar tm_months [][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-static const char tm_days [][4] = {
+static const gchar tm_days [][4] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
@@ -3724,8 +3724,8 @@ static const char tm_days [][4] = {
*
* Return value: a valid string representation of the date.
**/
-char *
-camel_header_format_date (time_t date, int tz_offset)
+gchar *
+camel_header_format_date (time_t date, gint tz_offset)
{
struct tm tm;
@@ -3751,17 +3751,17 @@ camel_header_format_date (time_t date, int tz_offset)
struct _date_token {
struct _date_token *next;
- unsigned char mask;
- const char *start;
+ guchar mask;
+ const gchar *start;
size_t len;
};
static struct _date_token *
-datetok (const char *date)
+datetok (const gchar *date)
{
struct _date_token *tokens = NULL, *token, *tail = (struct _date_token *) &tokens;
- const char *start, *end;
- unsigned char mask;
+ const gchar *start, *end;
+ guchar mask;
start = date;
while (*start) {
@@ -3800,11 +3800,11 @@ datetok (const char *date)
}
static int
-decode_int (const char *in, size_t inlen)
+decode_int (const gchar *in, size_t inlen)
{
- register const char *inptr;
- int sign = 1, val = 0;
- const char *inend;
+ register const gchar *inptr;
+ gint sign = 1, val = 0;
+ const gchar *inend;
inptr = in;
inend = in + inlen;
@@ -3829,7 +3829,7 @@ decode_int (const char *in, size_t inlen)
#if 0
static int
-get_days_in_month (int month, int year)
+get_days_in_month (gint month, gint year)
{
switch (month) {
case 1:
@@ -3857,9 +3857,9 @@ get_days_in_month (int month, int year)
#endif
static int
-get_wday (const char *in, size_t inlen)
+get_wday (const gchar *in, size_t inlen)
{
- int wday;
+ gint wday;
g_return_val_if_fail (in != NULL, -1);
@@ -3875,9 +3875,9 @@ get_wday (const char *in, size_t inlen)
}
static int
-get_mday (const char *in, size_t inlen)
+get_mday (const gchar *in, size_t inlen)
{
- int mday;
+ gint mday;
g_return_val_if_fail (in != NULL, -1);
@@ -3890,9 +3890,9 @@ get_mday (const char *in, size_t inlen)
}
static int
-get_month (const char *in, size_t inlen)
+get_month (const gchar *in, size_t inlen)
{
- int i;
+ gint i;
g_return_val_if_fail (in != NULL, -1);
@@ -3908,9 +3908,9 @@ get_month (const char *in, size_t inlen)
}
static int
-get_year (const char *in, size_t inlen)
+get_year (const gchar *in, size_t inlen)
{
- int year;
+ gint year;
g_return_val_if_fail (in != NULL, -1);
@@ -3927,11 +3927,11 @@ get_year (const char *in, size_t inlen)
}
static gboolean
-get_time (const char *in, size_t inlen, int *hour, int *min, int *sec)
+get_time (const gchar *in, size_t inlen, gint *hour, gint *min, gint *sec)
{
- register const char *inptr;
- int *val, colons = 0;
- const char *inend;
+ register const gchar *inptr;
+ gint *val, colons = 0;
+ const gchar *inend;
*hour = *min = *sec = 0;
@@ -3962,9 +3962,9 @@ get_time (const char *in, size_t inlen, int *hour, int *min, int *sec)
static int
get_tzone (struct _date_token **token)
{
- const char *inptr, *inend;
+ const gchar *inptr, *inend;
size_t inlen;
- int i, t;
+ gint i, t;
for (i = 0; *token && i < 2; *token = (*token)->next, i++) {
inptr = (*token)->start;
@@ -3998,9 +3998,9 @@ get_tzone (struct _date_token **token)
}
static time_t
-parse_rfc822_date (struct _date_token *tokens, int *tzone)
+parse_rfc822_date (struct _date_token *tokens, gint *tzone)
{
- int hour, min, sec, offset, n;
+ gint hour, min, sec, offset, n;
struct _date_token *token;
struct tm tm;
time_t t;
@@ -4009,7 +4009,7 @@ parse_rfc822_date (struct _date_token *tokens, int *tzone)
token = tokens;
- memset ((void *) &tm, 0, sizeof (struct tm));
+ memset ((gpointer) &tm, 0, sizeof (struct tm));
if ((n = get_wday (token->start, token->len)) != -1) {
/* not all dates may have this... */
@@ -4079,15 +4079,15 @@ parse_rfc822_date (struct _date_token *tokens, int *tzone)
#define is_tzone(t) (is_tzone_alpha (t) || is_tzone_numeric (t))
static time_t
-parse_broken_date (struct _date_token *tokens, int *tzone)
+parse_broken_date (struct _date_token *tokens, gint *tzone)
{
gboolean got_wday, got_month, got_tzone;
- int hour, min, sec, offset, n;
+ gint hour, min, sec, offset, n;
struct _date_token *token;
struct tm tm;
time_t t;
- memset ((void *) &tm, 0, sizeof (struct tm));
+ memset ((gpointer) &tm, 0, sizeof (struct tm));
got_wday = got_month = got_tzone = FALSE;
offset = 0;
@@ -4201,7 +4201,7 @@ parse_broken_date (struct _date_token *tokens, int *tzone)
* of the timezone offset will be stored.
**/
time_t
-camel_header_decode_date (const char *str, int *tz_offset)
+camel_header_decode_date (const gchar *str, gint *tz_offset)
{
struct _date_token *token, *tokens;
time_t date;
@@ -4226,12 +4226,12 @@ camel_header_decode_date (const char *str, int *tz_offset)
return date;
}
-char *
-camel_header_location_decode(const char *in)
+gchar *
+camel_header_location_decode(const gchar *in)
{
- int quote = 0;
+ gint quote = 0;
GString *out = g_string_new("");
- char c, *res;
+ gchar c, *res;
/* Sigh. RFC2557 says:
* content-location = "Content-Location:" [CFWS] URI [CFWS]
@@ -4276,9 +4276,9 @@ camel_header_location_decode(const char *in)
static void
check_header(struct _camel_header_raw *h)
{
- unsigned char *p;
+ guchar *p;
- p = (unsigned char *) h->value;
+ p = (guchar *) h->value;
while (p && *p) {
if (!isascii(*p)) {
w(g_warning("Appending header violates rfc: %s: %s", h->name, h->value));
@@ -4290,11 +4290,11 @@ check_header(struct _camel_header_raw *h)
#endif
void
-camel_header_raw_append_parse(struct _camel_header_raw **list, const char *header, int offset)
+camel_header_raw_append_parse(struct _camel_header_raw **list, const gchar *header, gint offset)
{
- register const char *in;
+ register const gchar *in;
size_t fieldlen;
- char *name;
+ gchar *name;
in = header;
while (camel_mime_is_fieldname(*in) || *in==':')
@@ -4314,7 +4314,7 @@ camel_header_raw_append_parse(struct _camel_header_raw **list, const char *heade
}
void
-camel_header_raw_append(struct _camel_header_raw **list, const char *name, const char *value, int offset)
+camel_header_raw_append(struct _camel_header_raw **list, const gchar *name, const gchar *value, gint offset)
{
struct _camel_header_raw *l, *n;
@@ -4350,7 +4350,7 @@ camel_header_raw_append(struct _camel_header_raw **list, const char *name, const
}
static struct _camel_header_raw *
-header_raw_find_node(struct _camel_header_raw **list, const char *name)
+header_raw_find_node(struct _camel_header_raw **list, const gchar *name)
{
struct _camel_header_raw *l;
@@ -4363,8 +4363,8 @@ header_raw_find_node(struct _camel_header_raw **list, const char *name)
return l;
}
-const char *
-camel_header_raw_find(struct _camel_header_raw **list, const char *name, int *offset)
+const gchar *
+camel_header_raw_find(struct _camel_header_raw **list, const gchar *name, gint *offset)
{
struct _camel_header_raw *l;
@@ -4377,8 +4377,8 @@ camel_header_raw_find(struct _camel_header_raw **list, const char *name, int *of
return NULL;
}
-const char *
-camel_header_raw_find_next(struct _camel_header_raw **list, const char *name, int *offset, const char *last)
+const gchar *
+camel_header_raw_find_next(struct _camel_header_raw **list, const gchar *name, gint *offset, const gchar *last)
{
struct _camel_header_raw *l;
@@ -4400,7 +4400,7 @@ header_raw_free(struct _camel_header_raw *l)
}
void
-camel_header_raw_remove(struct _camel_header_raw **list, const char *name)
+camel_header_raw_remove(struct _camel_header_raw **list, const gchar *name)
{
struct _camel_header_raw *l, *p;
@@ -4420,7 +4420,7 @@ camel_header_raw_remove(struct _camel_header_raw **list, const char *name)
}
void
-camel_header_raw_replace(struct _camel_header_raw **list, const char *name, const char *value, int offset)
+camel_header_raw_replace(struct _camel_header_raw **list, const gchar *name, const gchar *value, gint offset)
{
camel_header_raw_remove(list, name);
camel_header_raw_append(list, name, value, offset);
@@ -4439,17 +4439,17 @@ camel_header_raw_clear(struct _camel_header_raw **list)
*list = NULL;
}
-char *
+gchar *
camel_header_msgid_generate (void)
{
static pthread_mutex_t count_lock = PTHREAD_MUTEX_INITIALIZER;
#define COUNT_LOCK() pthread_mutex_lock (&count_lock)
#define COUNT_UNLOCK() pthread_mutex_unlock (&count_lock)
- char host[MAXHOSTNAMELEN];
- char *name;
- static int count = 0;
- char *msgid;
- int retval;
+ gchar host[MAXHOSTNAMELEN];
+ gchar *name;
+ static gint count = 0;
+ gchar *msgid;
+ gint retval;
struct addrinfo *ai = NULL, hints = { 0 };
retval = gethostname (host, sizeof (host));
@@ -4475,8 +4475,8 @@ camel_header_msgid_generate (void)
static struct {
- char *name;
- char *pattern;
+ gchar *name;
+ gchar *pattern;
regex_t regex;
} mail_list_magic[] = {
/* List-Post: <mailto:gnome-hackers@gnome.org> */
@@ -4527,13 +4527,13 @@ static pthread_once_t mailing_list_init_once = PTHREAD_ONCE_INIT;
static void
mailing_list_init(void)
{
- int i, errcode, failed=0;
+ gint i, errcode, failed=0;
/* precompile regex's for speed at runtime */
for (i = 0; i < G_N_ELEMENTS (mail_list_magic); i++) {
errcode = regcomp(&mail_list_magic[i].regex, mail_list_magic[i].pattern, REG_EXTENDED|REG_ICASE);
if (errcode != 0) {
- char *errstr;
+ gchar *errstr;
size_t len;
len = regerror(errcode, &mail_list_magic[i].regex, NULL, 0);
@@ -4549,12 +4549,12 @@ mailing_list_init(void)
g_assert(failed == 0);
}
-char *
+gchar *
camel_header_raw_check_mailing_list(struct _camel_header_raw **list)
{
- const char *v;
+ const gchar *v;
regmatch_t match[3];
- int i, j;
+ gint i, j;
pthread_once(&mailing_list_init_once, mailing_list_init);
@@ -4565,8 +4565,8 @@ camel_header_raw_check_mailing_list(struct _camel_header_raw **list)
match[j].rm_eo = -1;
}
if (v != NULL && regexec (&mail_list_magic[i].regex, v, 3, match, 0) == 0 && match[1].rm_so != -1) {
- int len1, len2;
- char *mlist;
+ gint len1, len2;
+ gchar *mlist;
len1 = match[1].rm_eo - match[1].rm_so;
len2 = match[2].rm_eo - match[2].rm_so;
@@ -4600,7 +4600,7 @@ camel_header_address_new (void)
}
struct _camel_header_address *
-camel_header_address_new_name(const char *name, const char *addr)
+camel_header_address_new_name(const gchar *name, const gchar *addr)
{
struct _camel_header_address *h;
h = camel_header_address_new();
@@ -4611,7 +4611,7 @@ camel_header_address_new_name(const char *name, const char *addr)
}
struct _camel_header_address *
-camel_header_address_new_group (const char *name)
+camel_header_address_new_group (const gchar *name)
{
struct _camel_header_address *h;
@@ -4647,7 +4647,7 @@ camel_header_address_unref(struct _camel_header_address *h)
}
void
-camel_header_address_set_name(struct _camel_header_address *h, const char *name)
+camel_header_address_set_name(struct _camel_header_address *h, const gchar *name)
{
if (h) {
g_free(h->name);
@@ -4656,7 +4656,7 @@ camel_header_address_set_name(struct _camel_header_address *h, const char *name)
}
void
-camel_header_address_set_addr(struct _camel_header_address *h, const char *addr)
+camel_header_address_set_addr(struct _camel_header_address *h, const gchar *addr)
{
if (h) {
if (h->type == CAMEL_HEADER_ADDRESS_NAME
@@ -4736,15 +4736,15 @@ camel_header_address_list_clear(struct _camel_header_address **l)
/* if encode is true, then the result is suitable for mailing, otherwise
the result is suitable for display only (and may not even be re-parsable) */
static void
-header_address_list_encode_append (GString *out, int encode, struct _camel_header_address *a)
+header_address_list_encode_append (GString *out, gint encode, struct _camel_header_address *a)
{
- char *text;
+ gchar *text;
while (a) {
switch (a->type) {
case CAMEL_HEADER_ADDRESS_NAME:
if (encode)
- text = camel_header_encode_phrase ((unsigned char *) a->name);
+ text = camel_header_encode_phrase ((guchar *) a->name);
else
text = a->name;
if (text && *text)
@@ -4756,7 +4756,7 @@ header_address_list_encode_append (GString *out, int encode, struct _camel_heade
break;
case CAMEL_HEADER_ADDRESS_GROUP:
if (encode)
- text = camel_header_encode_phrase ((unsigned char *) a->name);
+ text = camel_header_encode_phrase ((guchar *) a->name);
else
text = a->name;
g_string_append_printf (out, "%s: ", text);
@@ -4775,11 +4775,11 @@ header_address_list_encode_append (GString *out, int encode, struct _camel_heade
}
}
-char *
+gchar *
camel_header_address_list_encode (struct _camel_header_address *a)
{
GString *out;
- char *ret;
+ gchar *ret;
if (a == NULL)
return NULL;
@@ -4792,11 +4792,11 @@ camel_header_address_list_encode (struct _camel_header_address *a)
return ret;
}
-char *
+gchar *
camel_header_address_list_format (struct _camel_header_address *a)
{
GString *out;
- char *ret;
+ gchar *ret;
if (a == NULL)
return NULL;
@@ -4810,14 +4810,14 @@ camel_header_address_list_format (struct _camel_header_address *a)
return ret;
}
-char *
-camel_header_address_fold (const char *in, size_t headerlen)
+gchar *
+camel_header_address_fold (const gchar *in, size_t headerlen)
{
size_t len, outlen;
- const char *inptr = in, *space, *p, *n;
+ const gchar *inptr = in, *space, *p, *n;
GString *out;
- char *ret;
- int i, needunfold = FALSE;
+ gchar *ret;
+ gint i, needunfold = FALSE;
if (in == NULL)
return NULL;
@@ -4879,22 +4879,22 @@ camel_header_address_fold (const char *in, size_t headerlen)
g_string_free (out, FALSE);
if (needunfold)
- g_free ((char *)in);
+ g_free ((gchar *)in);
return ret;
}
/* simple header folding */
/* will work even if the header is already folded */
-char *
-camel_header_fold(const char *in, size_t headerlen)
+gchar *
+camel_header_fold(const gchar *in, size_t headerlen)
{
size_t len, outlen, tmplen;
- const char *inptr = in, *space, *p, *n;
+ const gchar *inptr = in, *space, *p, *n;
GString *out;
- char *ret;
- int needunfold = FALSE;
- char spc;
+ gchar *ret;
+ gint needunfold = FALSE;
+ gchar spc;
if (in == NULL)
return NULL;
@@ -4970,16 +4970,16 @@ camel_header_fold(const char *in, size_t headerlen)
g_string_free(out, FALSE);
if (needunfold)
- g_free((char *)in);
+ g_free((gchar *)in);
return ret;
}
-char *
-camel_header_unfold(const char *in)
+gchar *
+camel_header_unfold(const gchar *in)
{
- const char *inptr = in;
- char c, *o, *out;
+ const gchar *inptr = in;
+ gchar c, *o, *out;
if (in == NULL)
return NULL;
diff --git a/camel/camel-mime-utils.h b/camel/camel-mime-utils.h
index c9e967bc9..4bfbe305a 100644
--- a/camel/camel-mime-utils.h
+++ b/camel/camel-mime-utils.h
@@ -54,36 +54,36 @@ typedef enum _CamelTransferEncoding {
/* a list of references for this message */
struct _camel_header_references {
struct _camel_header_references *next;
- char *id;
+ gchar *id;
};
struct _camel_header_param {
struct _camel_header_param *next;
- char *name;
- char *value;
+ gchar *name;
+ gchar *value;
};
/* describes a content-type */
typedef struct {
- char *type;
- char *subtype;
+ gchar *type;
+ gchar *subtype;
struct _camel_header_param *params;
- unsigned int refcount;
+ guint refcount;
} CamelContentType;
/* a raw rfc822 header */
/* the value MUST be US-ASCII */
struct _camel_header_raw {
struct _camel_header_raw *next;
- char *name;
- char *value;
- int offset; /* in file, if known */
+ gchar *name;
+ gchar *value;
+ gint offset; /* in file, if known */
};
typedef struct _CamelContentDisposition {
- char *disposition;
+ gchar *disposition;
struct _camel_header_param *params;
- unsigned int refcount;
+ guint refcount;
} CamelContentDisposition;
typedef enum _camel_header_address_t {
@@ -95,162 +95,162 @@ typedef enum _camel_header_address_t {
struct _camel_header_address {
struct _camel_header_address *next;
camel_header_address_t type;
- char *name;
+ gchar *name;
union {
- char *addr;
+ gchar *addr;
struct _camel_header_address *members;
} v;
- unsigned int refcount;
+ guint refcount;
};
struct _camel_header_newsgroup {
struct _camel_header_newsgroup *next;
- char *newsgroup;
+ gchar *newsgroup;
};
/* Address lists */
struct _camel_header_address *camel_header_address_new (void);
-struct _camel_header_address *camel_header_address_new_name (const char *name, const char *addr);
-struct _camel_header_address *camel_header_address_new_group (const char *name);
+struct _camel_header_address *camel_header_address_new_name (const gchar *name, const gchar *addr);
+struct _camel_header_address *camel_header_address_new_group (const gchar *name);
void camel_header_address_ref (struct _camel_header_address *addrlist);
void camel_header_address_unref (struct _camel_header_address *addrlist);
-void camel_header_address_set_name (struct _camel_header_address *addrlist, const char *name);
-void camel_header_address_set_addr (struct _camel_header_address *addrlist, const char *addr);
+void camel_header_address_set_name (struct _camel_header_address *addrlist, const gchar *name);
+void camel_header_address_set_addr (struct _camel_header_address *addrlist, const gchar *addr);
void camel_header_address_set_members (struct _camel_header_address *addrlist, struct _camel_header_address *group);
void camel_header_address_add_member (struct _camel_header_address *addrlist, struct _camel_header_address *member);
void camel_header_address_list_append_list (struct _camel_header_address **addrlistp, struct _camel_header_address **addrs);
void camel_header_address_list_append (struct _camel_header_address **addrlistp, struct _camel_header_address *addr);
void camel_header_address_list_clear (struct _camel_header_address **addrlistp);
-struct _camel_header_address *camel_header_address_decode (const char *in, const char *charset);
-struct _camel_header_address *camel_header_mailbox_decode (const char *in, const char *charset);
+struct _camel_header_address *camel_header_address_decode (const gchar *in, const gchar *charset);
+struct _camel_header_address *camel_header_mailbox_decode (const gchar *in, const gchar *charset);
/* for mailing */
-char *camel_header_address_list_encode (struct _camel_header_address *addrlist);
+gchar *camel_header_address_list_encode (struct _camel_header_address *addrlist);
/* for display */
-char *camel_header_address_list_format (struct _camel_header_address *addrlist);
+gchar *camel_header_address_list_format (struct _camel_header_address *addrlist);
/* structured header prameters */
-struct _camel_header_param *camel_header_param_list_decode (const char *in);
-char *camel_header_param (struct _camel_header_param *params, const char *name);
-struct _camel_header_param *camel_header_set_param (struct _camel_header_param **paramsp, const char *name, const char *value);
+struct _camel_header_param *camel_header_param_list_decode (const gchar *in);
+gchar *camel_header_param (struct _camel_header_param *params, const gchar *name);
+struct _camel_header_param *camel_header_set_param (struct _camel_header_param **paramsp, const gchar *name, const gchar *value);
void camel_header_param_list_format_append (GString *out, struct _camel_header_param *params);
-char *camel_header_param_list_format (struct _camel_header_param *params);
+gchar *camel_header_param_list_format (struct _camel_header_param *params);
void camel_header_param_list_free (struct _camel_header_param *params);
/* Content-Type header */
-CamelContentType *camel_content_type_new (const char *type, const char *subtype);
-CamelContentType *camel_content_type_decode (const char *in);
+CamelContentType *camel_content_type_new (const gchar *type, const gchar *subtype);
+CamelContentType *camel_content_type_decode (const gchar *in);
void camel_content_type_unref (CamelContentType *content_type);
void camel_content_type_ref (CamelContentType *content_type);
-const char *camel_content_type_param (CamelContentType *content_type, const char *name);
-void camel_content_type_set_param (CamelContentType *content_type, const char *name, const char *value);
-int camel_content_type_is (CamelContentType *content_type, const char *type, const char *subtype);
-char *camel_content_type_format (CamelContentType *content_type);
-char *camel_content_type_simple (CamelContentType *content_type);
+const gchar *camel_content_type_param (CamelContentType *content_type, const gchar *name);
+void camel_content_type_set_param (CamelContentType *content_type, const gchar *name, const gchar *value);
+gint camel_content_type_is (CamelContentType *content_type, const gchar *type, const gchar *subtype);
+gchar *camel_content_type_format (CamelContentType *content_type);
+gchar *camel_content_type_simple (CamelContentType *content_type);
/* DEBUGGING function */
void camel_content_type_dump (CamelContentType *content_type);
/* Content-Disposition header */
-CamelContentDisposition *camel_content_disposition_decode (const char *in);
+CamelContentDisposition *camel_content_disposition_decode (const gchar *in);
void camel_content_disposition_ref (CamelContentDisposition *disposition);
void camel_content_disposition_unref (CamelContentDisposition *disposition);
-char *camel_content_disposition_format (CamelContentDisposition *disposition);
+gchar *camel_content_disposition_format (CamelContentDisposition *disposition);
/* decode the contents of a content-encoding header */
-char *camel_content_transfer_encoding_decode (const char *in);
+gchar *camel_content_transfer_encoding_decode (const gchar *in);
/* raw headers */
-void camel_header_raw_append (struct _camel_header_raw **list, const char *name, const char *value, int offset);
-void camel_header_raw_append_parse (struct _camel_header_raw **list, const char *header, int offset);
-const char *camel_header_raw_find (struct _camel_header_raw **list, const char *name, int *offset);
-const char *camel_header_raw_find_next (struct _camel_header_raw **list, const char *name, int *offset, const char *last);
-void camel_header_raw_replace (struct _camel_header_raw **list, const char *name, const char *value, int offset);
-void camel_header_raw_remove (struct _camel_header_raw **list, const char *name);
+void camel_header_raw_append (struct _camel_header_raw **list, const gchar *name, const gchar *value, gint offset);
+void camel_header_raw_append_parse (struct _camel_header_raw **list, const gchar *header, gint offset);
+const gchar *camel_header_raw_find (struct _camel_header_raw **list, const gchar *name, gint *offset);
+const gchar *camel_header_raw_find_next (struct _camel_header_raw **list, const gchar *name, gint *offset, const gchar *last);
+void camel_header_raw_replace (struct _camel_header_raw **list, const gchar *name, const gchar *value, gint offset);
+void camel_header_raw_remove (struct _camel_header_raw **list, const gchar *name);
void camel_header_raw_fold (struct _camel_header_raw **list);
void camel_header_raw_clear (struct _camel_header_raw **list);
-char *camel_header_raw_check_mailing_list (struct _camel_header_raw **list);
+gchar *camel_header_raw_check_mailing_list (struct _camel_header_raw **list);
/* fold a header */
-char *camel_header_address_fold (const char *in, size_t headerlen);
-char *camel_header_fold (const char *in, size_t headerlen);
-char *camel_header_unfold (const char *in);
+gchar *camel_header_address_fold (const gchar *in, size_t headerlen);
+gchar *camel_header_fold (const gchar *in, size_t headerlen);
+gchar *camel_header_unfold (const gchar *in);
/* decode a header which is a simple token */
-char *camel_header_token_decode (const char *in);
+gchar *camel_header_token_decode (const gchar *in);
-int camel_header_decode_int (const char **in);
+gint camel_header_decode_int (const gchar **in);
/* decode/encode a string type, like a subject line */
-char *camel_header_decode_string (const char *in, const char *default_charset);
-char *camel_header_encode_string (const unsigned char *in);
+gchar *camel_header_decode_string (const gchar *in, const gchar *default_charset);
+gchar *camel_header_encode_string (const guchar *in);
/* decode (text | comment) - a one-way op */
-char *camel_header_format_ctext (const char *in, const char *default_charset);
+gchar *camel_header_format_ctext (const gchar *in, const gchar *default_charset);
/* encode a phrase, like the real name of an address */
-char *camel_header_encode_phrase (const unsigned char *in);
+gchar *camel_header_encode_phrase (const guchar *in);
/* FIXME: these are the only 2 functions in this header which are ch_(action)_type
rather than ch_type_(action) */
/* decode an email date field into a GMT time, + optional offset */
-time_t camel_header_decode_date (const char *str, int *tz_offset);
-char *camel_header_format_date (time_t date, int tz_offset);
+time_t camel_header_decode_date (const gchar *str, gint *tz_offset);
+gchar *camel_header_format_date (time_t date, gint tz_offset);
/* decode a message id */
-char *camel_header_msgid_decode (const char *in);
-char *camel_header_contentid_decode (const char *in);
+gchar *camel_header_msgid_decode (const gchar *in);
+gchar *camel_header_contentid_decode (const gchar *in);
/* generate msg id */
-char *camel_header_msgid_generate (void);
+gchar *camel_header_msgid_generate (void);
/* decode a References or In-Reply-To header */
-struct _camel_header_references *camel_header_references_inreplyto_decode (const char *in);
-struct _camel_header_references *camel_header_references_decode (const char *in);
+struct _camel_header_references *camel_header_references_inreplyto_decode (const gchar *in);
+struct _camel_header_references *camel_header_references_decode (const gchar *in);
void camel_header_references_list_clear (struct _camel_header_references **list);
-void camel_header_references_list_append_asis (struct _camel_header_references **list, char *ref);
-int camel_header_references_list_size (struct _camel_header_references **list);
+void camel_header_references_list_append_asis (struct _camel_header_references **list, gchar *ref);
+gint camel_header_references_list_size (struct _camel_header_references **list);
struct _camel_header_references *camel_header_references_dup (const struct _camel_header_references *list);
/* decode content-location */
-char *camel_header_location_decode (const char *in);
+gchar *camel_header_location_decode (const gchar *in);
/* nntp stuff */
-struct _camel_header_newsgroup *camel_header_newsgroups_decode(const char *in);
+struct _camel_header_newsgroup *camel_header_newsgroups_decode(const gchar *in);
void camel_header_newsgroups_free(struct _camel_header_newsgroup *ng);
-const char *camel_transfer_encoding_to_string (CamelTransferEncoding encoding);
-CamelTransferEncoding camel_transfer_encoding_from_string (const char *string);
+const gchar *camel_transfer_encoding_to_string (CamelTransferEncoding encoding);
+CamelTransferEncoding camel_transfer_encoding_from_string (const gchar *string);
/* decode the mime-type header */
-void camel_header_mime_decode (const char *in, int *maj, int *min);
+void camel_header_mime_decode (const gchar *in, gint *maj, gint *min);
#ifndef CAMEL_DISABLE_DEPRECATED
/* do incremental base64/quoted-printable (de/en)coding */
-size_t camel_base64_decode_step (unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save);
+size_t camel_base64_decode_step (guchar *in, size_t len, guchar *out, gint *state, guint *save);
-size_t camel_base64_encode_step (unsigned char *in, size_t inlen, gboolean break_lines, unsigned char *out, int *state, int *save);
-size_t camel_base64_encode_close (unsigned char *in, size_t inlen, gboolean break_lines, unsigned char *out, int *state, int *save);
+size_t camel_base64_encode_step (guchar *in, size_t inlen, gboolean break_lines, guchar *out, gint *state, gint *save);
+size_t camel_base64_encode_close (guchar *in, size_t inlen, gboolean break_lines, guchar *out, gint *state, gint *save);
#endif
-size_t camel_uudecode_step (unsigned char *in, size_t inlen, unsigned char *out, int *state, guint32 *save);
+size_t camel_uudecode_step (guchar *in, size_t inlen, guchar *out, gint *state, guint32 *save);
-size_t camel_uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state,
+size_t camel_uuencode_step (guchar *in, size_t len, guchar *out, guchar *uubuf, gint *state,
guint32 *save);
-size_t camel_uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state,
+size_t camel_uuencode_close (guchar *in, size_t len, guchar *out, guchar *uubuf, gint *state,
guint32 *save);
-size_t camel_quoted_decode_step (unsigned char *in, size_t len, unsigned char *out, int *savestate, int *saveme);
+size_t camel_quoted_decode_step (guchar *in, size_t len, guchar *out, gint *savestate, gint *saveme);
-size_t camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int *state, int *save);
-size_t camel_quoted_encode_close (unsigned char *in, size_t len, unsigned char *out, int *state, int *save);
+size_t camel_quoted_encode_step (guchar *in, size_t len, guchar *out, gint *state, gint *save);
+size_t camel_quoted_encode_close (guchar *in, size_t len, guchar *out, gint *state, gint *save);
#ifndef CAMEL_DISABLE_DEPRECATED
-char *camel_base64_encode_simple (const char *data, size_t len);
-size_t camel_base64_decode_simple (char *data, size_t len);
+gchar *camel_base64_encode_simple (const gchar *data, size_t len);
+size_t camel_base64_decode_simple (gchar *data, size_t len);
#endif
/* camel ctype type functions for rfc822/rfc2047/other, which are non-locale specific */
diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c
index f8773e325..a71395995 100644
--- a/camel/camel-movemail.c
+++ b/camel/camel-movemail.c
@@ -56,20 +56,20 @@
#ifdef MOVEMAIL_PATH
#include <sys/wait.h>
-static void movemail_external (const char *source, const char *dest,
+static void movemail_external (const gchar *source, const gchar *dest,
CamelException *ex);
#endif
#ifdef HAVE_BROKEN_SPOOL
-static int camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, CamelMimeFilter *filter);
-static int camel_movemail_solaris (int oldsfd, int dfd, CamelException *ex);
+static gint camel_movemail_copy_filter(gint fromfd, gint tofd, off_t start, size_t bytes, CamelMimeFilter *filter);
+static gint camel_movemail_solaris (gint oldsfd, gint dfd, CamelException *ex);
#else
/* these could probably be exposed as a utility? (but only mbox needs it) */
-static int camel_movemail_copy_file(int sfd, int dfd, CamelException *ex);
+static gint camel_movemail_copy_file(gint sfd, gint dfd, CamelException *ex);
#endif
#if 0
-static int camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes);
+static gint camel_movemail_copy(gint fromfd, gint tofd, off_t start, size_t bytes);
#endif
/**
@@ -85,12 +85,12 @@ static int camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes);
*
* Return Value: Returns -1 on error.
**/
-int
-camel_movemail(const char *source, const char *dest, CamelException *ex)
+gint
+camel_movemail(const gchar *source, const gchar *dest, CamelException *ex)
{
- int lockid = -1;
- int res = -1;
- int sfd, dfd;
+ gint lockid = -1;
+ gint res = -1;
+ gint sfd, dfd;
struct stat st;
/* Stat and then open the spool file. If it doesn't exist or
@@ -168,12 +168,12 @@ camel_movemail(const char *source, const char *dest, CamelException *ex)
#ifdef MOVEMAIL_PATH
static void
-movemail_external (const char *source, const char *dest, CamelException *ex)
+movemail_external (const gchar *source, const gchar *dest, CamelException *ex)
{
sigset_t mask, omask;
pid_t pid;
- int fd[2], len = 0, nread, status;
- char buf[BUFSIZ], *output = NULL;
+ gint fd[2], len = 0, nread, status;
+ gchar buf[BUFSIZ], *output = NULL;
/* Block SIGCHLD so the app can't mess us up. */
sigemptyset (&mask);
@@ -242,13 +242,13 @@ movemail_external (const char *source, const char *dest, CamelException *ex)
#ifndef HAVE_BROKEN_SPOOL
static int
-camel_movemail_copy_file(int sfd, int dfd, CamelException *ex)
+camel_movemail_copy_file(gint sfd, gint dfd, CamelException *ex)
{
- int nread, nwrote;
- char buf[4096];
+ gint nread, nwrote;
+ gchar buf[4096];
while (1) {
- int written = 0;
+ gint written = 0;
nread = read (sfd, buf, sizeof (buf));
if (nread == 0)
@@ -283,10 +283,10 @@ camel_movemail_copy_file(int sfd, int dfd, CamelException *ex)
#if 0
static int
-camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes)
+camel_movemail_copy(gint fromfd, gint tofd, off_t start, size_t bytes)
{
- char buffer[4096];
- int written = 0;
+ gchar buffer[4096];
+ gint written = 0;
d(printf("writing %d bytes ... ", bytes));
@@ -294,7 +294,7 @@ camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes)
return -1;
while (bytes>0) {
- int toread, towrite;
+ gint toread, towrite;
toread = bytes;
if (bytes>4096)
@@ -335,12 +335,12 @@ camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes)
#ifdef HAVE_BROKEN_SPOOL
static int
-camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, CamelMimeFilter *filter)
+camel_movemail_copy_filter(gint fromfd, gint tofd, off_t start, size_t bytes, CamelMimeFilter *filter)
{
- char buffer[4096+PRE_SIZE];
- int written = 0;
- char *filterbuffer;
- int filterlen, filterpre;
+ gchar buffer[4096+PRE_SIZE];
+ gint written = 0;
+ gchar *filterbuffer;
+ gint filterlen, filterpre;
d(printf("writing %d bytes ... ", bytes));
@@ -350,7 +350,7 @@ camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, Came
return -1;
while (bytes>0) {
- int toread, towrite;
+ gint toread, towrite;
toread = bytes;
if (bytes>4096)
@@ -401,10 +401,10 @@ camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, Came
/* write the headers back out again, but not he Content-Length header, because we dont
want to maintain it! */
static int
-solaris_header_write(int fd, struct _camel_header_raw *header)
+solaris_header_write(gint fd, struct _camel_header_raw *header)
{
struct iovec iv[4];
- int outlen = 0, len;
+ gint outlen = 0, len;
iv[1].iov_base = ":";
iv[1].iov_len = 1;
@@ -447,15 +447,15 @@ solaris_header_write(int fd, struct _camel_header_raw *header)
we must convert it to a real mbox format. Thankfully this is
mostly pretty easy */
static int
-camel_movemail_solaris (int oldsfd, int dfd, CamelException *ex)
+camel_movemail_solaris (gint oldsfd, gint dfd, CamelException *ex)
{
CamelMimeParser *mp;
- char *buffer;
- int len;
- int sfd;
+ gchar *buffer;
+ gint len;
+ gint sfd;
CamelMimeFilterFrom *ffrom;
- int ret = 1;
- char *from = NULL;
+ gint ret = 1;
+ gchar *from = NULL;
/* need to dup as the mime parser will close on finish */
sfd = dup(oldsfd);
@@ -476,9 +476,9 @@ camel_movemail_solaris (int oldsfd, int dfd, CamelException *ex)
g_assert(camel_mime_parser_from_line(mp));
from = g_strdup(camel_mime_parser_from_line(mp));
if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_FROM_END) {
- const char *cl;
- int length;
- int start, body;
+ const gchar *cl;
+ gint length;
+ gint start, body;
off_t newpos;
ret = 0;
diff --git a/camel/camel-movemail.h b/camel/camel-movemail.h
index 1b9acc1a4..6f1df0ce8 100644
--- a/camel/camel-movemail.h
+++ b/camel/camel-movemail.h
@@ -30,7 +30,7 @@
G_BEGIN_DECLS
-int camel_movemail (const char *source, const char *dest, CamelException *ex);
+gint camel_movemail (const gchar *source, const gchar *dest, CamelException *ex);
G_END_DECLS
diff --git a/camel/camel-msgport.c b/camel/camel-msgport.c
index 848b98e11..96cdf15b2 100644
--- a/camel/camel-msgport.c
+++ b/camel/camel-msgport.c
@@ -65,7 +65,7 @@ struct _CamelMsgPort {
};
static int
-msgport_pipe (int *fds)
+msgport_pipe (gint *fds)
{
#ifndef G_OS_WIN32
if (pipe (fds) != -1)
@@ -78,7 +78,7 @@ msgport_pipe (int *fds)
#else
SOCKET temp, socket1 = -1, socket2 = -1;
struct sockaddr_in saddr;
- int len;
+ gint len;
u_long arg;
fd_set read_set, write_set;
struct timeval tv;
diff --git a/camel/camel-multipart-encrypted.c b/camel/camel-multipart-encrypted.c
index 9e2919778..866f4e139 100644
--- a/camel/camel-multipart-encrypted.c
+++ b/camel/camel-multipart-encrypted.c
@@ -108,7 +108,7 @@ set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type
CamelMultipartEncrypted *mpe = (CamelMultipartEncrypted *) data_wrapper;
if (mime_type) {
- const char *protocol;
+ const gchar *protocol;
protocol = camel_content_type_param (mime_type, "protocol");
g_free (mpe->protocol);
diff --git a/camel/camel-multipart-encrypted.h b/camel/camel-multipart-encrypted.h
index 00b672fa6..ec590f6eb 100644
--- a/camel/camel-multipart-encrypted.h
+++ b/camel/camel-multipart-encrypted.h
@@ -49,7 +49,7 @@ struct _CamelMultipartEncrypted {
CamelMimePart *content;
CamelMimePart *decrypted;
- char *protocol;
+ gchar *protocol;
};
struct _CamelMultipartEncryptedClass {
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
index b90e5d679..99419b9f1 100644
--- a/camel/camel-multipart-signed.c
+++ b/camel/camel-multipart-signed.c
@@ -61,8 +61,8 @@ static guint signed_get_number (CamelMultipart *multipart);
static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
static void set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type);
-static int construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static int signed_construct_from_parser (CamelMultipart *multipart, struct _CamelMimeParser *mp);
+static gint construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
+static gint signed_construct_from_parser (CamelMultipart *multipart, struct _CamelMimeParser *mp);
static CamelMultipartClass *parent_class = NULL;
@@ -183,9 +183,9 @@ camel_multipart_signed_new (void)
static int
skip_content(CamelMimeParser *cmp)
{
- char *buf;
+ gchar *buf;
size_t len;
- int state;
+ gint state;
switch (camel_mime_parser_state(cmp)) {
case CAMEL_MIME_PARSER_STATE_HEADER:
@@ -230,10 +230,10 @@ parse_content(CamelMultipartSigned *mps)
CamelMimeParser *cmp;
CamelMultipart *mp = (CamelMultipart *)mps;
CamelStreamMem *mem;
- const char *boundary;
- char *buf;
+ const gchar *boundary;
+ gchar *buf;
size_t len;
- int state;
+ gint state;
boundary = camel_multipart_get_boundary(mp);
if (boundary == NULL) {
@@ -304,7 +304,7 @@ set_mime_type_field(CamelDataWrapper *data_wrapper, CamelContentType *mime_type)
((CamelDataWrapperClass *)parent_class)->set_mime_type_field(data_wrapper, mime_type);
if (mime_type) {
- const char *micalg, *protocol;
+ const gchar *micalg, *protocol;
protocol = camel_content_type_param(mime_type, "protocol");
g_free(mps->protocol);
@@ -458,10 +458,10 @@ construct_from_stream(CamelDataWrapper *data_wrapper, CamelStream *stream)
static int
signed_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
{
- int err;
+ gint err;
CamelContentType *content_type;
CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
- char *buf;
+ gchar *buf;
size_t len;
CamelStream *mem;
@@ -492,7 +492,7 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
CamelMultipart *mp = (CamelMultipart *)mps;
- const char *boundary;
+ const gchar *boundary;
ssize_t total = 0;
ssize_t count;
diff --git a/camel/camel-multipart-signed.h b/camel/camel-multipart-signed.h
index 5b843ebd5..8e673dcca 100644
--- a/camel/camel-multipart-signed.h
+++ b/camel/camel-multipart-signed.h
@@ -69,8 +69,8 @@ struct _CamelMultipartSigned
/*int state;*/
/* just cache some info we use */
- char *protocol;
- char *micalg;
+ gchar *protocol;
+ gchar *micalg;
/* offset pointers of start of boundary in content object */
off_t start1, end1;
diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c
index a58711fff..3ed7d7b91 100644
--- a/camel/camel-multipart.c
+++ b/camel/camel-multipart.c
@@ -52,12 +52,12 @@ static CamelMimePart * get_part (CamelMultipart *multipart,
guint index);
static guint get_number (CamelMultipart *multipart);
static void set_boundary (CamelMultipart *multipart,
- const char *boundary);
+ const gchar *boundary);
static const gchar * get_boundary (CamelMultipart *multipart);
static ssize_t write_to_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream);
-static int construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp);
+static gint construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp);
static CamelDataWrapperClass *parent_class = NULL;
@@ -345,13 +345,13 @@ camel_multipart_get_number (CamelMultipart *multipart)
static void
-set_boundary (CamelMultipart *multipart, const char *boundary)
+set_boundary (CamelMultipart *multipart, const gchar *boundary)
{
CamelDataWrapper *cdw = CAMEL_DATA_WRAPPER (multipart);
- char *bgen, bbuf[27], *p;
+ gchar *bgen, bbuf[27], *p;
guint8 *digest;
gsize length;
- int state, save;
+ gint state, save;
g_return_if_fail (cdw->mime_type != NULL);
@@ -362,7 +362,7 @@ set_boundary (CamelMultipart *multipart, const char *boundary)
GChecksum *checksum;
/* Generate a fairly random boundary string. */
- bgen = g_strdup_printf ("%p:%lu:%lu", (void *) multipart,
+ bgen = g_strdup_printf ("%p:%lu:%lu", (gpointer) multipart,
(unsigned long) getpid(),
(unsigned long) time(NULL));
@@ -396,7 +396,7 @@ set_boundary (CamelMultipart *multipart, const char *boundary)
* be used.
**/
void
-camel_multipart_set_boundary (CamelMultipart *multipart, const char *boundary)
+camel_multipart_set_boundary (CamelMultipart *multipart, const gchar *boundary)
{
g_return_if_fail (CAMEL_IS_MULTIPART (multipart));
@@ -419,7 +419,7 @@ get_boundary (CamelMultipart *multipart)
*
* Returns: the boundary
**/
-const char *
+const gchar *
camel_multipart_get_boundary (CamelMultipart *multipart)
{
return CMP_CLASS (multipart)->get_boundary (multipart);
@@ -516,7 +516,7 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
* be relatively short, and will be ignored by any MIME mail client.
**/
void
-camel_multipart_set_preface(CamelMultipart *multipart, const char *preface)
+camel_multipart_set_preface(CamelMultipart *multipart, const gchar *preface)
{
if (multipart->preface != preface) {
g_free(multipart->preface);
@@ -539,7 +539,7 @@ camel_multipart_set_preface(CamelMultipart *multipart, const char *preface)
* Generally postface texts should not be sent with multipart messages.
**/
void
-camel_multipart_set_postface(CamelMultipart *multipart, const char *postface)
+camel_multipart_set_postface(CamelMultipart *multipart, const gchar *postface)
{
if (multipart->postface != postface) {
g_free(multipart->postface);
@@ -553,10 +553,10 @@ camel_multipart_set_postface(CamelMultipart *multipart, const char *postface)
static int
construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
{
- int err;
+ gint err;
CamelContentType *content_type;
CamelMimePart *bodypart;
- char *buf;
+ gchar *buf;
size_t len;
g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_MULTIPART);
@@ -598,7 +598,7 @@ construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_multipart_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
{
g_return_val_if_fail(CAMEL_IS_MULTIPART(multipart), -1);
diff --git a/camel/camel-multipart.h b/camel/camel-multipart.h
index 810574b37..4af66e857 100644
--- a/camel/camel-multipart.h
+++ b/camel/camel-multipart.h
@@ -57,10 +57,10 @@ typedef struct {
CamelMimePart * (*remove_part_at) (CamelMultipart *multipart, guint index);
CamelMimePart * (*get_part) (CamelMultipart *multipart, guint index);
guint (*get_number) (CamelMultipart *multipart);
- void (*set_boundary) (CamelMultipart *multipart, const char *boundary);
+ void (*set_boundary) (CamelMultipart *multipart, const gchar *boundary);
const gchar * (*get_boundary) (CamelMultipart *multipart);
- int (*construct_from_parser)(CamelMultipart *, struct _CamelMimeParser *);
+ gint (*construct_from_parser)(CamelMultipart *, struct _CamelMimeParser *);
/*int (*construct_from_stream)(CamelMultipart *, CamelStream *);*/
} CamelMultipartClass;
@@ -84,11 +84,11 @@ CamelMimePart * camel_multipart_get_part (CamelMultipart *multipart,
guint index);
guint camel_multipart_get_number (CamelMultipart *multipart);
void camel_multipart_set_boundary (CamelMultipart *multipart,
- const char *boundary);
-const char * camel_multipart_get_boundary (CamelMultipart *multipart);
+ const gchar *boundary);
+const gchar * camel_multipart_get_boundary (CamelMultipart *multipart);
-void camel_multipart_set_preface (CamelMultipart *multipart, const char *preface);
-void camel_multipart_set_postface (CamelMultipart *multipart, const char *postface);
+void camel_multipart_set_preface (CamelMultipart *multipart, const gchar *preface);
+void camel_multipart_set_postface (CamelMultipart *multipart, const gchar *postface);
int camel_multipart_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *parser);
diff --git a/camel/camel-net-utils.c b/camel/camel-net-utils.c
index 8d4a8f481..208e2b21b 100644
--- a/camel/camel-net-utils.c
+++ b/camel/camel-net-utils.c
@@ -60,8 +60,8 @@ typedef short in_port_t;
* i.e. g_win32_error_message().
*/
-static const char *
-gai_strerror (int error_code)
+static const gchar *
+gai_strerror (gint error_code)
{
gchar *msg = g_win32_error_message (error_code);
GQuark quark = g_quark_from_string (msg);
@@ -84,13 +84,13 @@ This should probably go away */
G_LOCK_DEFINE_STATIC (gethost_mutex);
#endif
-#define ALIGN(x) (((x) + (sizeof (char *) - 1)) & ~(sizeof (char *) - 1))
+#define ALIGN(x) (((x) + (sizeof (gchar *) - 1)) & ~(sizeof (gchar *) - 1))
#define GETHOST_PROCESS(h, host, buf, buflen, herr) G_STMT_START { \
- int num_aliases = 0, num_addrs = 0; \
- int req_length; \
- char *p; \
- int i; \
+ gint num_aliases = 0, num_addrs = 0; \
+ gint req_length; \
+ gchar *p; \
+ gint i; \
\
/* check to make sure we have enough room in our buffer */ \
req_length = 0; \
@@ -106,8 +106,8 @@ G_LOCK_DEFINE_STATIC (gethost_mutex);
num_addrs = i; \
} \
\
- req_length += sizeof (char *) * (num_aliases + 1); \
- req_length += sizeof (char *) * (num_addrs + 1); \
+ req_length += sizeof (gchar *) * (num_aliases + 1); \
+ req_length += sizeof (gchar *) * (num_addrs + 1); \
req_length += strlen (h->h_name) + 1; \
\
if (buflen < req_length) { \
@@ -120,14 +120,14 @@ G_LOCK_DEFINE_STATIC (gethost_mutex);
/* their addresses here. */ \
p = buf; \
if (num_aliases) { \
- host->h_aliases = (char **) p; \
- p += sizeof (char *) * (num_aliases + 1); \
+ host->h_aliases = (gchar **) p; \
+ p += sizeof (gchar *) * (num_aliases + 1); \
} else \
host->h_aliases = NULL; \
\
if (num_addrs) { \
- host->h_addr_list = (char **) p; \
- p += sizeof (char *) * (num_addrs + 1); \
+ host->h_addr_list = (gchar **) p; \
+ p += sizeof (gchar *) * (num_addrs + 1); \
} else \
host->h_addr_list = NULL; \
\
@@ -163,10 +163,10 @@ G_LOCK_DEFINE_STATIC (gethost_mutex);
#ifdef ENABLE_IPv6
/* some helpful utils for IPv6 lookups */
-#define IPv6_BUFLEN_MIN (sizeof (char *) * 3)
+#define IPv6_BUFLEN_MIN (sizeof (gchar *) * 3)
static int
-ai_to_herr (int error)
+ai_to_herr (gint error)
{
switch (error) {
case EAI_NONAME:
@@ -200,13 +200,13 @@ ai_to_herr (int error)
#endif /* ENABLE_IPv6 */
static int
-camel_gethostbyname_r (const char *name, struct hostent *host,
- char *buf, size_t buflen, int *herr)
+camel_gethostbyname_r (const gchar *name, struct hostent *host,
+ gchar *buf, size_t buflen, gint *herr)
{
#ifdef ENABLE_IPv6
struct addrinfo hints, *res;
- int retval, len;
- char *addr;
+ gint retval, len;
+ gchar *addr;
memset (&hints, 0, sizeof (struct addrinfo));
#ifdef HAVE_AI_ADDRCONFIG
@@ -224,7 +224,7 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
}
len = ALIGN (strlen (res->ai_canonname) + 1);
- if (buflen < IPv6_BUFLEN_MIN + len + res->ai_addrlen + sizeof (char *))
+ if (buflen < IPv6_BUFLEN_MIN + len + res->ai_addrlen + sizeof (gchar *))
return ERANGE;
/* h_name */
@@ -233,20 +233,20 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
buf += len;
/* h_aliases */
- ((char **) buf)[0] = NULL;
- host->h_aliases = (char **) buf;
- buf += sizeof (char *);
+ ((gchar **) buf)[0] = NULL;
+ host->h_aliases = (gchar **) buf;
+ buf += sizeof (gchar *);
/* h_addrtype and h_length */
host->h_length = res->ai_addrlen;
if (res->ai_family == PF_INET6) {
host->h_addrtype = AF_INET6;
- addr = (char *) &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr;
+ addr = (gchar *) &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr;
} else {
host->h_addrtype = AF_INET;
- addr = (char *) &((struct sockaddr_in *) res->ai_addr)->sin_addr;
+ addr = (gchar *) &((struct sockaddr_in *) res->ai_addr)->sin_addr;
}
memcpy (buf, addr, host->h_length);
@@ -254,9 +254,9 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
buf += ALIGN (host->h_length);
/* h_addr_list */
- ((char **) buf)[0] = addr;
- ((char **) buf)[1] = NULL;
- host->h_addr_list = (char **) buf;
+ ((gchar **) buf)[0] = addr;
+ ((gchar **) buf)[1] = NULL;
+ host->h_addr_list = (gchar **) buf;
freeaddrinfo (res);
@@ -270,7 +270,7 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
return errno;
#else
struct hostent *hp;
- int retval;
+ gint retval;
retval = gethostbyname_r (name, host, buf, buflen, &hp, herr);
if (hp != NULL) {
@@ -311,11 +311,11 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
}
static int
-camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *host,
- char *buf, size_t buflen, int *herr)
+camel_gethostbyaddr_r (const gchar *addr, gint addrlen, gint type, struct hostent *host,
+ gchar *buf, size_t buflen, gint *herr)
{
#ifdef ENABLE_IPv6
- int retval, len;
+ gint retval, len;
if ((retval = getnameinfo (addr, addrlen, buf, buflen, NULL, 0, NI_NAMEREQD)) != 0) {
*herr = ai_to_herr (retval);
@@ -323,7 +323,7 @@ camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *
}
len = ALIGN (strlen (buf) + 1);
- if (buflen < IPv6_BUFLEN_MIN + len + addrlen + sizeof (char *))
+ if (buflen < IPv6_BUFLEN_MIN + len + addrlen + sizeof (gchar *))
return ERANGE;
/* h_name */
@@ -331,9 +331,9 @@ camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *
buf += len;
/* h_aliases */
- ((char **) buf)[0] = NULL;
- host->h_aliases = (char **) buf;
- buf += sizeof (char *);
+ ((gchar **) buf)[0] = NULL;
+ host->h_aliases = (gchar **) buf;
+ buf += sizeof (gchar *);
/* h_addrtype and h_length */
host->h_length = addrlen;
@@ -344,9 +344,9 @@ camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *
buf += ALIGN (host->h_length);
/* h_addr_list */
- ((char **) buf)[0] = addr;
- ((char **) buf)[1] = NULL;
- host->h_addr_list = (char **) buf;
+ ((gchar **) buf)[0] = addr;
+ ((gchar **) buf)[1] = NULL;
+ host->h_addr_list = (gchar **) buf;
return 0;
#else /* No support for IPv6 addresses */
@@ -358,7 +358,7 @@ camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *
return errno;
#else
struct hostent *hp;
- int retval;
+ gint retval;
retval = gethostbyaddr_r (addr, addrlen, type, host, buf, buflen, &hp, herr);
if (hp != NULL) {
@@ -403,30 +403,30 @@ camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *
/* ********************************************************************** */
struct _addrinfo_msg {
CamelMsg msg;
- unsigned int cancelled:1;
+ guint cancelled:1;
/* for host lookup */
- const char *name;
- const char *service;
- int result;
+ const gchar *name;
+ const gchar *service;
+ gint result;
const struct addrinfo *hints;
struct addrinfo **res;
/* for host lookup emulation */
#ifdef NEED_ADDRINFO
struct hostent hostbuf;
- int hostbuflen;
- char *hostbufmem;
+ gint hostbuflen;
+ gchar *hostbufmem;
#endif
/* for name lookup */
const struct sockaddr *addr;
socklen_t addrlen;
- char *host;
- int hostlen;
- char *serv;
- int servlen;
- int flags;
+ gchar *host;
+ gint hostlen;
+ gchar *serv;
+ gint servlen;
+ gint flags;
};
static void
@@ -442,11 +442,11 @@ cs_freeinfo(struct _addrinfo_msg *msg)
/* returns -1 if we didn't wait for reply from thread */
static int
-cs_waitinfo(void *(worker)(void *), struct _addrinfo_msg *msg, const char *error, CamelException *ex)
+cs_waitinfo(gpointer (worker)(gpointer), struct _addrinfo_msg *msg, const gchar *error, CamelException *ex)
{
CamelMsgPort *reply_port;
pthread_t id;
- int err, cancel_fd, cancel = 0, fd;
+ gint err, cancel_fd, cancel = 0, fd;
cancel_fd = camel_operation_cancel_fd(NULL);
if (cancel_fd == -1) {
@@ -457,7 +457,7 @@ cs_waitinfo(void *(worker)(void *), struct _addrinfo_msg *msg, const char *error
reply_port = msg->msg.reply_port = camel_msgport_new();
fd = camel_msgport_fd(msg->msg.reply_port);
if ((err = pthread_create(&id, NULL, worker, msg)) == 0) {
- int status;
+ gint status;
#ifndef G_OS_WIN32
GPollFD polls[2];
@@ -525,16 +525,16 @@ cs_waitinfo(void *(worker)(void *), struct _addrinfo_msg *msg, const char *error
}
#ifdef NEED_ADDRINFO
-static void *
-cs_getaddrinfo(void *data)
+static gpointer
+cs_getaddrinfo(gpointer data)
{
struct _addrinfo_msg *msg = data;
- int herr;
+ gint herr;
struct hostent h;
struct addrinfo *res, *last = NULL;
struct sockaddr_in *sin;
in_port_t port = 0;
- int i;
+ gint i;
/* This is a pretty simplistic emulation of getaddrinfo */
@@ -566,7 +566,7 @@ cs_getaddrinfo(void *data)
/* check service mapping */
if (msg->service) {
- const char *p = msg->service;
+ const gchar *p = msg->service;
while (*p) {
if (*p < '0' || *p > '9')
@@ -575,7 +575,7 @@ cs_getaddrinfo(void *data)
}
if (*p) {
- const char *socktype = NULL;
+ const gchar *socktype = NULL;
struct servent *serv;
if (msg->hints && msg->hints->ai_socktype) {
@@ -632,8 +632,8 @@ cancel:
return NULL;
}
#else
-static void *
-cs_getaddrinfo(void *data)
+static gpointer
+cs_getaddrinfo(gpointer data)
{
struct _addrinfo_msg *info = data;
@@ -659,7 +659,7 @@ cs_getaddrinfo(void *data)
#endif /* NEED_ADDRINFO */
struct addrinfo *
-camel_getaddrinfo(const char *name, const char *service, const struct addrinfo *hints, CamelException *ex)
+camel_getaddrinfo(const gchar *name, const gchar *service, const struct addrinfo *hints, CamelException *ex)
{
struct _addrinfo_msg *msg;
struct addrinfo *res = NULL;
@@ -728,11 +728,11 @@ camel_freeaddrinfo(struct addrinfo *host)
}
#ifdef NEED_ADDRINFO
-static void *
-cs_getnameinfo(void *data)
+static gpointer
+cs_getnameinfo(gpointer data)
{
struct _addrinfo_msg *msg = data;
- int herr;
+ gint herr;
struct hostent h;
struct sockaddr_in *sin = (struct sockaddr_in *)msg->addr;
@@ -744,7 +744,7 @@ cs_getnameinfo(void *data)
/* FIXME: honour getnameinfo flags: do we care, not really */
- while ((msg->result = camel_gethostbyaddr_r((const char *)&sin->sin_addr, sizeof(sin->sin_addr), AF_INET, &h,
+ while ((msg->result = camel_gethostbyaddr_r((const gchar *)&sin->sin_addr, sizeof(sin->sin_addr), AF_INET, &h,
msg->hostbufmem, msg->hostbuflen, &herr)) == ERANGE) {
pthread_testcancel ();
msg->hostbuflen *= 2;
@@ -759,7 +759,7 @@ cs_getnameinfo(void *data)
if (msg->result == 0 && h.h_name && h.h_name[0]) {
msg->host = g_strdup(h.h_name);
} else {
- unsigned char *in = (unsigned char *)&sin->sin_addr;
+ guchar *in = (guchar *)&sin->sin_addr;
/* sin_addr is always network order which is big-endian */
msg->host = g_strdup_printf("%u.%u.%u.%u", in[0], in[1], in[2], in[3]);
@@ -777,8 +777,8 @@ cancel:
return NULL;
}
#else
-static void *
-cs_getnameinfo(void *data)
+static gpointer
+cs_getnameinfo(gpointer data)
{
struct _addrinfo_msg *msg = data;
@@ -794,11 +794,11 @@ cs_getnameinfo(void *data)
}
#endif
-int
-camel_getnameinfo(const struct sockaddr *sa, socklen_t salen, char **host, char **serv, int flags, CamelException *ex)
+gint
+camel_getnameinfo(const struct sockaddr *sa, socklen_t salen, gchar **host, gchar **serv, gint flags, CamelException *ex)
{
struct _addrinfo_msg *msg;
- int result;
+ gint result;
if (camel_operation_cancel_check(NULL)) {
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Canceled"));
diff --git a/camel/camel-net-utils.h b/camel/camel-net-utils.h
index 363571c90..8e020694e 100644
--- a/camel/camel-net-utils.h
+++ b/camel/camel-net-utils.h
@@ -52,13 +52,13 @@ struct _CamelException;
version 2.1 of the License, or (at your option) any later version.
*/
struct addrinfo {
- int ai_flags;
- int ai_family;
- int ai_socktype;
- int ai_protocol;
+ gint ai_flags;
+ gint ai_family;
+ gint ai_socktype;
+ gint ai_protocol;
size_t ai_addrlen;
struct sockaddr *ai_addr;
- char *ai_canonname;
+ gchar *ai_canonname;
struct addrinfo *ai_next;
};
@@ -87,11 +87,11 @@ struct addrinfo {
#endif
#endif
-struct addrinfo *camel_getaddrinfo(const char *name, const char *service,
+struct addrinfo *camel_getaddrinfo(const gchar *name, const gchar *service,
const struct addrinfo *hints, struct _CamelException *ex);
void camel_freeaddrinfo(struct addrinfo *host);
-int camel_getnameinfo(const struct sockaddr *sa, socklen_t salen, char **host, char **serv,
- int flags, struct _CamelException *ex);
+gint camel_getnameinfo(const struct sockaddr *sa, socklen_t salen, gchar **host, gchar **serv,
+ gint flags, struct _CamelException *ex);
G_END_DECLS
diff --git a/camel/camel-nntp-address.c b/camel/camel-nntp-address.c
index 94786707c..366d20232 100644
--- a/camel/camel-nntp-address.c
+++ b/camel/camel-nntp-address.c
@@ -26,10 +26,10 @@
#define d(x)
-static int nntp_decode (CamelAddress *, const char *raw);
-static char * nntp_encode (CamelAddress *);
-static int nntp_cat (CamelAddress *dest, const CamelAddress *source);
-static void nntp_remove (CamelAddress *, int index);
+static gint nntp_decode (CamelAddress *, const gchar *raw);
+static gchar * nntp_encode (CamelAddress *);
+static gint nntp_cat (CamelAddress *dest, const CamelAddress *source);
+static void nntp_remove (CamelAddress *, gint index);
static void camel_nntp_address_class_init (CamelNNTPAddressClass *klass);
static void camel_nntp_address_init (CamelNNTPAddress *obj);
@@ -37,8 +37,8 @@ static void camel_nntp_address_init (CamelNNTPAddress *obj);
static CamelAddressClass *camel_nntp_address_parent;
struct _address {
- char *name;
- char *address;
+ gchar *name;
+ gchar *address;
};
static void
@@ -81,10 +81,10 @@ camel_nntp_address_get_type(void)
/* since newsgropus are 7bit ascii, decode/unformat are the same */
static int
-nntp_decode(CamelAddress *a, const char *raw)
+nntp_decode(CamelAddress *a, const gchar *raw)
{
struct _camel_header_newsgroup *ha, *n;
- int count = a->addresses->len;
+ gint count = a->addresses->len;
ha = camel_header_newsgroups_decode(raw);
if (ha) {
@@ -97,12 +97,12 @@ nntp_decode(CamelAddress *a, const char *raw)
}
/* since newsgropus are 7bit ascii, encode/format are the same */
-static char *
+static gchar *
nntp_encode(CamelAddress *a)
{
- int i;
+ gint i;
GString *out;
- char *ret;
+ gchar *ret;
if (a->addresses->len == 0)
return NULL;
@@ -125,7 +125,7 @@ nntp_encode(CamelAddress *a)
static int
nntp_cat (CamelAddress *dest, const CamelAddress *source)
{
- int i;
+ gint i;
g_assert(CAMEL_IS_NNTP_ADDRESS(source));
@@ -136,7 +136,7 @@ nntp_cat (CamelAddress *dest, const CamelAddress *source)
}
static void
-nntp_remove (CamelAddress *a, int index)
+nntp_remove (CamelAddress *a, gint index)
{
if (index < 0 || index >= a->addresses->len)
return;
@@ -168,10 +168,10 @@ camel_nntp_address_new (void)
*
* Return value: Index of added entry, or existing matching entry.
**/
-int
-camel_nntp_address_add (CamelNNTPAddress *a, const char *name)
+gint
+camel_nntp_address_add (CamelNNTPAddress *a, const gchar *name)
{
- int index, i;
+ gint index, i;
g_assert(CAMEL_IS_NNTP_ADDRESS(a));
@@ -196,7 +196,7 @@ camel_nntp_address_add (CamelNNTPAddress *a, const char *name)
* Return value: TRUE if such an address exists, or FALSE otherwise.
**/
gboolean
-camel_nntp_address_get (const CamelNNTPAddress *a, int index, const char **namep)
+camel_nntp_address_get (const CamelNNTPAddress *a, gint index, const gchar **namep)
{
g_assert(CAMEL_IS_NNTP_ADDRESS(a));
diff --git a/camel/camel-nntp-address.h b/camel/camel-nntp-address.h
index 8e41034fb..e6b022b65 100644
--- a/camel/camel-nntp-address.h
+++ b/camel/camel-nntp-address.h
@@ -46,8 +46,8 @@ struct _CamelNNTPAddressClass {
CamelType camel_nntp_address_get_type (void);
CamelNNTPAddress *camel_nntp_address_new (void);
-int camel_nntp_address_add (CamelNNTPAddress *a, const char *name);
-gboolean camel_nntp_address_get (const CamelNNTPAddress *a, int index, const char **namep);
+int camel_nntp_address_add (CamelNNTPAddress *a, const gchar *name);
+gboolean camel_nntp_address_get (const CamelNNTPAddress *a, gint index, const gchar **namep);
G_END_DECLS
diff --git a/camel/camel-object.c b/camel/camel-object.c
index 1d085a748..c14264dd9 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -56,10 +56,10 @@
typedef struct _CamelHookList {
GStaticRecMutex lock;
- unsigned int depth:30; /* recursive event depth */
- unsigned int flags:2; /* flags, see below */
+ guint depth:30; /* recursive event depth */
+ guint flags:2; /* flags, see below */
- unsigned int list_length;
+ guint list_length;
struct _CamelHookPair *list;
} CamelHookList;
@@ -75,25 +75,25 @@ typedef struct _CamelHookPair
{
struct _CamelHookPair *next; /* next MUST be the first member */
- unsigned int id:30;
- unsigned int flags:2; /* removed, etc */
+ guint id:30;
+ guint flags:2; /* removed, etc */
- const char *name; /* points to the key field in the classes preplist, static memory */
+ const gchar *name; /* points to the key field in the classes preplist, static memory */
union {
CamelObjectEventHookFunc event;
CamelObjectEventPrepFunc prep;
- char *filename;
+ gchar *filename;
} func;
- void *data;
+ gpointer data;
} CamelHookPair;
struct _CamelObjectBagKey {
struct _CamelObjectBagKey *next;
- void *key; /* the key reserved */
- int waiters; /* count of threads waiting for key */
+ gpointer key; /* the key reserved */
+ gint waiters; /* count of threads waiting for key */
pthread_t owner; /* the thread that has reserved the bag for a new entry */
- int have_owner;
+ gint have_owner;
GCond *cond;
};
@@ -108,18 +108,18 @@ struct _CamelObjectBag {
};
/* used to tag a bag hookpair */
-static const char bag_name[] = "object:bag";
+static const gchar bag_name[] = "object:bag";
/* meta-data stuff */
static void co_metadata_free(CamelObject *obj, CamelObjectMeta *meta);
static CamelObjectMeta *co_metadata_get(CamelObject *obj);
-static CamelHookPair *co_metadata_pair(CamelObject *obj, int create);
+static CamelHookPair *co_metadata_pair(CamelObject *obj, gint create);
-static const char meta_name[] = "object:meta";
+static const gchar meta_name[] = "object:meta";
#define CAMEL_OBJECT_STATE_FILE_MAGIC "CLMD"
/* interface stuff */
-static const char interface_name[] = "object:interface";
+static const gchar interface_name[] = "object:interface";
/* ********************************************************************** */
@@ -193,7 +193,7 @@ hooks_free(CamelHookList *hooks)
void
camel_type_init(void)
{
- static int init = FALSE;
+ static gint init = FALSE;
if (init)
return;
@@ -234,7 +234,7 @@ cobject_finalise(CamelObject *o)
static int
cobject_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
{
- int i;
+ gint i;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -244,7 +244,7 @@ cobject_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
switch (tag & CAMEL_ARG_TAG) {
case CAMEL_OBJECT_ARG_DESCRIPTION:
- *arg->ca_str = (char *)o->klass->name;
+ *arg->ca_str = (gchar *)o->klass->name;
break;
case CAMEL_OBJECT_ARG_METADATA:
*arg->ca_ptr = co_metadata_get(o);
@@ -267,7 +267,7 @@ cobject_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
static int
cobject_setv(CamelObject *o, CamelException *ex, CamelArgV *args)
{
- int i;
+ gint i;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -293,7 +293,7 @@ cobject_setv(CamelObject *o, CamelException *ex, CamelArgV *args)
}
static void
-cobject_free(CamelObject *o, guint32 tag, void *value)
+cobject_free(CamelObject *o, guint32 tag, gpointer value)
{
switch(tag & CAMEL_ARG_TAG) {
case CAMEL_OBJECT_ARG_METADATA:
@@ -308,12 +308,12 @@ cobject_free(CamelObject *o, guint32 tag, void *value)
}
}
-static char *
-cobject_meta_get(CamelObject *obj, const char * name)
+static gchar *
+cobject_meta_get(CamelObject *obj, const gchar * name)
{
CamelHookPair *pair;
CamelObjectMeta *meta;
- char *res = NULL;
+ gchar *res = NULL;
g_return_val_if_fail(CAMEL_IS_OBJECT (obj), NULL);
g_return_val_if_fail(name != NULL, NULL);
@@ -335,10 +335,10 @@ cobject_meta_get(CamelObject *obj, const char * name)
}
static gboolean
-cobject_meta_set(CamelObject *obj, const char * name, const char *value)
+cobject_meta_set(CamelObject *obj, const gchar * name, const gchar *value)
{
CamelHookPair *pair;
- int changed = FALSE;
+ gint changed = FALSE;
CamelObjectMeta *meta, *metap;
g_return_val_if_fail(CAMEL_IS_OBJECT (obj), FALSE);
@@ -413,7 +413,7 @@ cobject_state_read(CamelObject *obj, FILE *fp)
return -1;
for (i=0;i<count;i++) {
- char *name = NULL, *value = NULL;
+ gchar *name = NULL, *value = NULL;
if (camel_file_util_decode_string(fp, &name) == 0
&& camel_file_util_decode_string(fp, &value) == 0) {
@@ -488,7 +488,7 @@ cobject_state_write(CamelObject *obj, FILE *fp)
{
gint32 count, i;
CamelObjectMeta *meta = NULL, *scan;
- int res = -1;
+ gint res = -1;
GSList *props = NULL, *l;
CamelArgGetV *arggetv = NULL;
CamelArgV *argv = NULL;
@@ -637,7 +637,7 @@ cinterface_setv(CamelObject *o, CamelException *ex, CamelArgV *args)
}
static void
-cinterface_free(CamelObject *o, guint32 tag, void *value)
+cinterface_free(CamelObject *o, guint32 tag, gpointer value)
{
/* NOOP */
}
@@ -699,8 +699,8 @@ camel_type_class_init(CamelObjectClass *klass, CamelObjectClass *type)
}
static CamelType
-co_type_register(CamelType parent, const char * name,
- /*unsigned int ver, unsigned int rev,*/
+co_type_register(CamelType parent, const gchar * name,
+ /*guint ver, guint rev,*/
size_t object_size, size_t klass_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalise,
@@ -775,7 +775,7 @@ co_type_register(CamelType parent, const char * name,
klass->finalise = object_finalise;
/* setup before class init, incase class init func uses the type or looks it up ? */
- g_hash_table_insert(type_table, (void *)name, klass);
+ g_hash_table_insert(type_table, (gpointer)name, klass);
camel_type_class_init(klass, klass);
@@ -785,8 +785,8 @@ co_type_register(CamelType parent, const char * name,
}
CamelType
-camel_type_register(CamelType parent, const char * name,
- /*unsigned int ver, unsigned int rev,*/
+camel_type_register(CamelType parent, const gchar * name,
+ /*guint ver, guint rev,*/
size_t object_size, size_t klass_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalise,
@@ -802,7 +802,7 @@ camel_type_register(CamelType parent, const char * name,
}
CamelType
-camel_interface_register(CamelType parent, const char *name,
+camel_interface_register(CamelType parent, const gchar *name,
size_t class_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalise)
@@ -858,7 +858,7 @@ camel_object_new(CamelType type)
}
void
-camel_object_ref(void *vo)
+camel_object_ref(gpointer vo)
{
register CamelObject *o = vo;
@@ -873,7 +873,7 @@ camel_object_ref(void *vo)
}
void
-camel_object_unref(void *vo)
+camel_object_unref(gpointer vo)
{
register CamelObject *o = vo;
register CamelObjectClass *klass, *k;
@@ -934,7 +934,7 @@ camel_object_unref(void *vo)
CLASS_UNLOCK(klass);
}
-const char *
+const gchar *
camel_type_to_name(CamelType type)
{
if (type == NULL)
@@ -949,17 +949,17 @@ camel_type_to_name(CamelType type)
return "(Junk class)";
}
-CamelType camel_name_to_type(const char *name)
+CamelType camel_name_to_type(const gchar *name)
{
/* TODO: Load a class off disk (!) */
return g_hash_table_lookup(type_table, name);
}
-static char *
+static gchar *
desc_data(CamelObject *o, guint32 ok)
{
- char *what;
+ gchar *what;
if (o == NULL)
what = g_strdup("NULL OBJECT");
@@ -989,9 +989,9 @@ desc_data(CamelObject *o, guint32 ok)
? 1 : check_magic_fail(o, ctype, omagic)
static gboolean
-check_magic_fail(void *o, CamelType ctype, guint32 omagic)
+check_magic_fail(gpointer o, CamelType ctype, guint32 omagic)
{
- char *what, *to;
+ gchar *what, *to;
what = desc_data(o, omagic);
to = desc_data((CamelObject *)ctype, CAMEL_OBJECT_CLASS_MAGIC);
@@ -1078,7 +1078,7 @@ camel_object_cast(CamelObject *o, CamelType ctype)
k = k->parent;
}
- g_warning("Object %p (class '%s') doesn't have '%s' in its hierarchy", (void *) o, o->klass->name, ctype->name);
+ g_warning("Object %p (class '%s') doesn't have '%s' in its hierarchy", (gpointer) o, o->klass->name, ctype->name);
return NULL;
}
@@ -1120,7 +1120,7 @@ camel_interface_cast(CamelObjectClass *k, CamelType ctype)
}
static CamelHookPair *
-co_find_pair(CamelObjectClass *klass, const char *name)
+co_find_pair(CamelObjectClass *klass, const gchar *name)
{
CamelHookPair *hook;
@@ -1135,7 +1135,7 @@ co_find_pair(CamelObjectClass *klass, const char *name)
}
static CamelHookPair *
-co_find_pair_ptr(CamelObjectClass *klass, const char *name)
+co_find_pair_ptr(CamelObjectClass *klass, const gchar *name)
{
CamelHookPair *hook;
@@ -1151,7 +1151,7 @@ co_find_pair_ptr(CamelObjectClass *klass, const char *name)
/* class functions */
void
-camel_object_class_add_event(CamelObjectClass *klass, const char *name, CamelObjectEventPrepFunc prep)
+camel_object_class_add_event(CamelObjectClass *klass, const gchar *name, CamelObjectEventPrepFunc prep)
{
CamelHookPair *pair;
@@ -1185,7 +1185,7 @@ camel_object_class_add_interface(CamelObjectClass *klass, CamelType itype)
CamelHookPair *pair;
CamelType iscan;
GPtrArray *interfaces;
- int i;
+ gint i;
if (!camel_interface_is(itype, camel_interface_type)) {
g_warning("Cannot add an interface not derived from CamelInterface on class '%s'", klass->name);
@@ -1280,12 +1280,12 @@ camel_object_get_hooks(CamelObject *o)
}
unsigned int
-camel_object_hook_event(void *vo, const char * name, CamelObjectEventHookFunc func, void *data)
+camel_object_hook_event(gpointer vo, const gchar * name, CamelObjectEventHookFunc func, gpointer data)
{
CamelObject *obj = vo;
CamelHookPair *pair, *hook;
CamelHookList *hooks;
- int id;
+ gint id;
g_return_val_if_fail(CAMEL_IS_OBJECT (obj), 0);
g_return_val_if_fail(name != NULL, 0);
@@ -1298,7 +1298,7 @@ camel_object_hook_event(void *vo, const char * name, CamelObjectEventHookFunc fu
pair = co_find_pair_ptr(obj->klass, interface_name);
if (pair) {
GPtrArray *interfaces = pair->data;
- int i;
+ gint i;
for (i=0;i<interfaces->len;i++) {
hook = co_find_pair(interfaces->pdata[i], name);
@@ -1334,7 +1334,7 @@ setup:
}
void
-camel_object_remove_event(void *vo, unsigned int id)
+camel_object_remove_event(gpointer vo, guint id)
{
CamelObject *obj = vo;
CamelHookList *hooks;
@@ -1379,7 +1379,7 @@ camel_object_remove_event(void *vo, unsigned int id)
}
void
-camel_object_unhook_event(void *vo, const char * name, CamelObjectEventHookFunc func, void *data)
+camel_object_unhook_event(gpointer vo, const gchar * name, CamelObjectEventHookFunc func, gpointer data)
{
CamelObject *obj = vo;
CamelHookList *hooks;
@@ -1423,17 +1423,17 @@ camel_object_unhook_event(void *vo, const char * name, CamelObjectEventHookFunc
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'",
- (void *) func, data, obj->klass->name, name);
+ (gpointer) func, data, obj->klass->name, name);
}
void
-camel_object_trigger_event(void *vo, const char * name, void *event_data)
+camel_object_trigger_event(gpointer vo, const gchar * name, gpointer event_data)
{
CamelObject *obj = vo;
CamelHookList *hooks;
CamelHookPair *pair, **pairs, *parent, *hook;
- int i, size;
- const char *prepname;
+ gint i, size;
+ const gchar *prepname;
g_return_if_fail (CAMEL_IS_OBJECT (obj));
g_return_if_fail (name);
@@ -1519,8 +1519,8 @@ trigger_interface:
camel_object_unref(obj);
}
-void *
-camel_object_get_interface(void *vo, CamelType itype)
+gpointer
+camel_object_get_interface(gpointer vo, CamelType itype)
{
CamelObject *obj = vo;
CamelHookPair *pair;
@@ -1531,7 +1531,7 @@ camel_object_get_interface(void *vo, CamelType itype)
pair = co_find_pair_ptr(obj->klass, interface_name);
if (pair) {
GPtrArray *interfaces = pair->data;
- int i;
+ gint i;
for (i=0;i<interfaces->len;i++) {
if (camel_interface_is((CamelType)interfaces->pdata[i], itype))
@@ -1545,12 +1545,12 @@ camel_object_get_interface(void *vo, CamelType itype)
}
/* get/set arg methods */
-int camel_object_set(void *vo, CamelException *ex, ...)
+gint camel_object_set(gpointer vo, CamelException *ex, ...)
{
CamelArgV args;
CamelObject *o = vo;
CamelObjectClass *klass = o->klass;
- int ret = 0;
+ gint ret = 0;
g_return_val_if_fail(CAMEL_IS_OBJECT(o), -1);
@@ -1566,19 +1566,19 @@ int camel_object_set(void *vo, CamelException *ex, ...)
return ret;
}
-int camel_object_setv(void *vo, CamelException *ex, CamelArgV *args)
+gint camel_object_setv(gpointer vo, CamelException *ex, CamelArgV *args)
{
g_return_val_if_fail(CAMEL_IS_OBJECT(vo), -1);
return ((CamelObject *)vo)->klass->setv(vo, ex, args);
}
-int camel_object_get(void *vo, CamelException *ex, ...)
+gint camel_object_get(gpointer vo, CamelException *ex, ...)
{
CamelObject *o = vo;
CamelArgGetV args;
CamelObjectClass *klass = o->klass;
- int ret = 0;
+ gint ret = 0;
g_return_val_if_fail(CAMEL_IS_OBJECT(o), -1);
@@ -1594,13 +1594,13 @@ int camel_object_get(void *vo, CamelException *ex, ...)
return ret;
}
-void *camel_object_get_ptr(void *vo, CamelException *ex, int tag)
+gpointer camel_object_get_ptr(gpointer vo, CamelException *ex, gint tag)
{
CamelObject *o = vo;
CamelArgGetV args;
CamelObjectClass *klass = o->klass;
- int ret = 0;
- void *val = NULL;
+ gint ret = 0;
+ gpointer val = NULL;
g_return_val_if_fail(CAMEL_IS_OBJECT(o), NULL);
g_return_val_if_fail((tag & CAMEL_ARG_TYPE) == CAMEL_ARG_OBJ
@@ -1619,13 +1619,13 @@ void *camel_object_get_ptr(void *vo, CamelException *ex, int tag)
return val;
}
-int camel_object_get_int(void *vo, CamelException *ex, int tag)
+gint camel_object_get_int(gpointer vo, CamelException *ex, gint tag)
{
CamelObject *o = vo;
CamelArgGetV args;
CamelObjectClass *klass = o->klass;
- int ret = 0;
- int val = 0;
+ gint ret = 0;
+ gint val = 0;
g_return_val_if_fail(CAMEL_IS_OBJECT(o), 0);
g_return_val_if_fail((tag & CAMEL_ARG_TYPE) == CAMEL_ARG_INT
@@ -1643,7 +1643,7 @@ int camel_object_get_int(void *vo, CamelException *ex, int tag)
return val;
}
-int camel_object_getv(void *vo, CamelException *ex, CamelArgGetV *args)
+gint camel_object_getv(gpointer vo, CamelException *ex, CamelArgGetV *args)
{
g_return_val_if_fail(CAMEL_IS_OBJECT(vo), -1);
@@ -1652,7 +1652,7 @@ int camel_object_getv(void *vo, CamelException *ex, CamelArgGetV *args)
/* NB: If this doesn't return NULL, then you must unget_hooks when done */
static CamelHookPair *
-co_metadata_pair(CamelObject *obj, int create)
+co_metadata_pair(CamelObject *obj, gint create)
{
CamelHookPair *pair;
CamelHookList *hooks;
@@ -1738,8 +1738,8 @@ co_metadata_free(CamelObject *obj, CamelObjectMeta *meta)
*
* Return value: NULL if the meta-data is not set.
**/
-char *
-camel_object_meta_get(void *vo, const char * name)
+gchar *
+camel_object_meta_get(gpointer vo, const gchar * name)
{
CamelObject *obj = vo;
@@ -1766,7 +1766,7 @@ camel_object_meta_get(void *vo, const char * name)
* metadata.
**/
gboolean
-camel_object_meta_set(void *vo, const char * name, const char *value)
+camel_object_meta_set(gpointer vo, const gchar * name, const gchar *value)
{
CamelObject *obj = vo;
@@ -1774,7 +1774,7 @@ camel_object_meta_set(void *vo, const char * name, const char *value)
g_return_val_if_fail(name != NULL, FALSE);
if (obj->klass->meta_set(obj, name, value)) {
- camel_object_trigger_event(obj, "meta_changed", (void *)name);
+ camel_object_trigger_event(obj, "meta_changed", (gpointer)name);
return TRUE;
}
@@ -1789,13 +1789,13 @@ camel_object_meta_set(void *vo, const char * name, const char *value)
*
* Return value: -1 on error.
**/
-int camel_object_state_read(void *vo)
+gint camel_object_state_read(gpointer vo)
{
CamelObject *obj = vo;
- int res = -1;
- char *file;
+ gint res = -1;
+ gchar *file;
FILE *fp;
- char magic[4];
+ gchar magic[4];
camel_object_get(vo, NULL, CAMEL_OBJECT_STATE_FILE, &file, NULL);
if (file == NULL)
@@ -1824,11 +1824,11 @@ int camel_object_state_read(void *vo)
*
* Return value: -1 on error.
**/
-int camel_object_state_write(void *vo)
+gint camel_object_state_write(gpointer vo)
{
CamelObject *obj = vo;
- int res = -1;
- char *file, *savename, *dirname;
+ gint res = -1;
+ gchar *file, *savename, *dirname;
FILE *fp;
camel_object_get(vo, NULL, CAMEL_OBJECT_STATE_FILE, &file, NULL);
@@ -1861,7 +1861,7 @@ int camel_object_state_write(void *vo)
}
/* free an arg object, you can only free objects 1 at a time */
-void camel_object_free(void *vo, guint32 tag, void *value)
+void camel_object_free(gpointer vo, guint32 tag, gpointer value)
{
g_return_if_fail(CAMEL_IS_OBJECT(vo));
@@ -1885,9 +1885,9 @@ void camel_object_free(void *vo, guint32 tag, void *value)
}
static void
-object_class_dump_tree_rec(CamelType root, int depth)
+object_class_dump_tree_rec(CamelType root, gint depth)
{
- char *p;
+ gchar *p;
#ifdef CAMEL_OBJECT_TRACK_INSTANCES
struct _CamelObject *o;
#endif
@@ -1904,7 +1904,7 @@ object_class_dump_tree_rec(CamelType root, int depth)
CamelHookPair *pair = root->hooks;
while (pair) {
- printf("%s event '%s' prep %p\n", p, pair->name, (void *) pair->func.prep);
+ printf("%s event '%s' prep %p\n", p, pair->name, (gpointer) pair->func.prep);
pair = pair->next;
}
}
@@ -1970,7 +1970,7 @@ camel_object_bag_new(GHashFunc hash, GEqualFunc equal, CamelCopyFunc keycopy, GF
}
static void
-save_object(void *key, CamelObject *o, GPtrArray *objects)
+save_object(gpointer key, CamelObject *o, GPtrArray *objects)
{
g_ptr_array_add(objects, o);
}
@@ -1979,7 +1979,7 @@ void
camel_object_bag_destroy(CamelObjectBag *bag)
{
GPtrArray *objects = g_ptr_array_new();
- int i;
+ gint i;
g_assert(bag->reserved == NULL);
@@ -1995,7 +1995,7 @@ camel_object_bag_destroy(CamelObjectBag *bag)
/* must be called with ref_lock held */
static void
-co_bag_unreserve(CamelObjectBag *bag, const void *key)
+co_bag_unreserve(CamelObjectBag *bag, gconstpointer key)
{
struct _CamelObjectBagKey *res, *resp;
@@ -2012,11 +2012,11 @@ co_bag_unreserve(CamelObjectBag *bag, const void *key)
g_assert(res->have_owner && pthread_equal(res->owner, pthread_self()));
if (res->waiters > 0) {
- b(printf("unreserve bag '%s', waking waiters\n", (char *)key));
+ 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", (char *)key));
+ 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);
@@ -2034,12 +2034,12 @@ co_bag_unreserve(CamelObjectBag *bag, const void *key)
* previously been reserved using camel_object_bag_reserve().
**/
void
-camel_object_bag_add(CamelObjectBag *bag, const void *key, void *vo)
+camel_object_bag_add(CamelObjectBag *bag, gconstpointer key, gpointer vo)
{
CamelObject *o = vo;
CamelHookList *hooks;
CamelHookPair *pair;
- void *k;
+ gpointer k;
hooks = camel_object_get_hooks(o);
REF_LOCK();
@@ -2086,8 +2086,8 @@ camel_object_bag_add(CamelObjectBag *bag, const void *key, void *vo)
* in the bag. Otherwise a ref'd object pointer which the caller owns
* the ref to.
**/
-void *
-camel_object_bag_get(CamelObjectBag *bag, const void *key)
+gpointer
+camel_object_bag_get(CamelObjectBag *bag, gconstpointer key)
{
CamelObject *o;
@@ -2095,7 +2095,7 @@ camel_object_bag_get(CamelObjectBag *bag, const void *key)
o = g_hash_table_lookup(bag->object_table, key);
if (o) {
- b(printf("object bag get '%s' = %p\n", (char *)key, o));
+ b(printf("object bag get '%s' = %p\n", (gchar *)key, o));
/* we use the same lock as the refcount */
o->ref_count++;
@@ -2110,7 +2110,7 @@ camel_object_bag_get(CamelObjectBag *bag, const void *key)
}
if (res) {
- b(printf("object bag get '%s', reserved, waiting\n", (char *)key));
+ b(printf("object bag get '%s', reserved, waiting\n", (gchar *)key));
res->waiters++;
g_assert(!res->have_owner || !pthread_equal(res->owner, pthread_self()));
@@ -2122,7 +2122,7 @@ camel_object_bag_get(CamelObjectBag *bag, const void *key)
if (o)
o->ref_count++;
- b(printf("object bag get '%s', finished waiting, got %p\n", (char *)key, o));
+ b(printf("object bag get '%s', finished waiting, got %p\n", (gchar *)key, o));
/* we don't actually reserve it */
res->owner = pthread_self();
@@ -2151,8 +2151,8 @@ camel_object_bag_get(CamelObjectBag *bag, const void *key)
* Return value: A referenced object, or NULL if @key is not
* present in the bag.
**/
-void *
-camel_object_bag_peek(CamelObjectBag *bag, const void *key)
+gpointer
+camel_object_bag_peek(CamelObjectBag *bag, gconstpointer key)
{
CamelObject *o;
@@ -2187,8 +2187,8 @@ camel_object_bag_peek(CamelObjectBag *bag, const void *key)
*
* Return value:
**/
-void *
-camel_object_bag_reserve(CamelObjectBag *bag, const void *key)
+gpointer
+camel_object_bag_reserve(CamelObjectBag *bag, gconstpointer key)
{
CamelObject *o;
@@ -2207,7 +2207,7 @@ camel_object_bag_reserve(CamelObjectBag *bag, const void *key)
}
if (res) {
- b(printf("bag reserve %s, already reserved, waiting\n", (char *)key));
+ b(printf("bag reserve %s, already reserved, waiting\n", (gchar *)key));
g_assert(!res->have_owner || !pthread_equal(res->owner, pthread_self()));
res->waiters++;
g_cond_wait(res->cond, ref_lock);
@@ -2215,19 +2215,19 @@ camel_object_bag_reserve(CamelObjectBag *bag, const void *key)
/* 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", (char *)key, 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 = pthread_self();
res->have_owner = TRUE;
co_bag_unreserve(bag, key);
} else {
- b(printf("finished wait, now owner of '%s'\n", (char *)key));
+ b(printf("finished wait, now owner of '%s'\n", (gchar *)key));
res->owner = pthread_self();
res->have_owner = TRUE;
}
} else {
- b(printf("bag reserve %s, no key, reserving\n", (char *)key));
+ 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);
@@ -2252,7 +2252,7 @@ camel_object_bag_reserve(CamelObjectBag *bag, const void *key)
* Abort a key reservation.
**/
void
-camel_object_bag_abort(CamelObjectBag *bag, const void *key)
+camel_object_bag_abort(CamelObjectBag *bag, gconstpointer key)
{
REF_LOCK();
@@ -2273,9 +2273,9 @@ camel_object_bag_abort(CamelObjectBag *bag, const void *key)
* It is an api (fatal) error if @o is not currently in the bag.
**/
void
-camel_object_bag_rekey(CamelObjectBag *bag, void *o, const void *newkey)
+camel_object_bag_rekey(CamelObjectBag *bag, gpointer o, gconstpointer newkey)
{
- void *oldkey;
+ gpointer oldkey;
REF_LOCK();
@@ -2294,7 +2294,7 @@ camel_object_bag_rekey(CamelObjectBag *bag, void *o, const void *newkey)
}
static void
-save_bag(void *key, CamelObject *o, GPtrArray *list)
+save_bag(gpointer key, CamelObject *o, GPtrArray *list)
{
/* we have the refcount lock already */
o->ref_count++;
@@ -2322,7 +2322,7 @@ static void
camel_object_bag_remove_unlocked(CamelObjectBag *inbag, CamelObject *o, CamelHookList *hooks)
{
CamelHookPair *pair, *parent;
- void *oldkey;
+ gpointer oldkey;
CamelObjectBag *bag;
parent = (CamelHookPair *)&hooks->list;
@@ -2349,7 +2349,7 @@ camel_object_bag_remove_unlocked(CamelObjectBag *inbag, CamelObject *o, CamelHoo
}
void
-camel_object_bag_remove(CamelObjectBag *inbag, void *vo)
+camel_object_bag_remove(CamelObjectBag *inbag, gpointer vo)
{
CamelObject *o = vo;
CamelHookList *hooks;
@@ -2368,7 +2368,7 @@ camel_object_bag_remove(CamelObjectBag *inbag, void *vo)
/* ********************************************************************** */
-void *camel_iterator_new(CamelIteratorVTable *klass, size_t size)
+gpointer camel_iterator_new(CamelIteratorVTable *klass, size_t size)
{
CamelIterator *it;
@@ -2380,19 +2380,19 @@ void *camel_iterator_new(CamelIteratorVTable *klass, size_t size)
return it;
}
-const void *camel_iterator_next(void *it, CamelException *ex)
+gconstpointer camel_iterator_next(gpointer it, CamelException *ex)
{
g_assert(it);
return ((CamelIterator *)it)->klass->next(it, ex);
}
-void camel_iterator_reset(void *it)
+void camel_iterator_reset(gpointer it)
{
g_assert(it);
((CamelIterator *)it)->klass->reset(it);
}
-int camel_iterator_length(void *it)
+gint camel_iterator_length(gpointer it)
{
g_assert(it);
g_return_val_if_fail(((CamelIterator *)it)->klass->length != NULL, 0);
@@ -2400,7 +2400,7 @@ int camel_iterator_length(void *it)
return ((CamelIterator *)it)->klass->length(it);
}
-void camel_iterator_free(void *it)
+void camel_iterator_free(gpointer it)
{
if (it) {
if (((CamelIterator *)it)->klass->free)
diff --git a/camel/camel-object.h b/camel/camel-object.h
index d3177d1b1..1c8d58afd 100644
--- a/camel/camel-object.h
+++ b/camel/camel-object.h
@@ -66,7 +66,7 @@ extern CamelType camel_object_type;
typedef struct _CamelObjectClass CamelObjectClass;
typedef struct _CamelObject CamelObject;
-typedef unsigned int CamelObjectHookID;
+typedef guint CamelObjectHookID;
#ifndef CAMEL_DISABLE_DEPRECATED
typedef struct _CamelObjectMeta CamelObjectMeta;
#endif /* CAMEL_DISABLE_DEPRECATED */
@@ -114,8 +114,8 @@ typedef enum _CamelObjectFlags {
struct _CamelObjectMeta {
struct _CamelObjectMeta *next;
- char *value;
- char name[1]; /* allocated as part of structure */
+ gchar *value;
+ gchar name[1]; /* allocated as part of structure */
};
/* TODO: create a simpleobject which has no events on it, or an interface for events */
@@ -143,9 +143,9 @@ struct _CamelObjectClass
struct _CamelObjectClass *next, *child; /* maintain heirarchy, just for kicks */
- const char *name;
+ const gchar *name;
- void *lock; /* lock when used in threading, else just pads struct */
+ gpointer lock; /* lock when used in threading, else just pads struct */
/*unsigned short version, revision;*/
@@ -173,18 +173,18 @@ struct _CamelObjectClass
/* root-class fields follow, type system above */
/* get/set interface */
- int (*setv)(struct _CamelObject *, struct _CamelException *ex, CamelArgV *args);
- int (*getv)(struct _CamelObject *, struct _CamelException *ex, CamelArgGetV *args);
+ gint (*setv)(struct _CamelObject *, struct _CamelException *ex, CamelArgV *args);
+ gint (*getv)(struct _CamelObject *, struct _CamelException *ex, CamelArgGetV *args);
/* we only free 1 at a time, and only pointer types, obviously */
- void (*free)(struct _CamelObject *, guint32 tag, void *ptr);
+ void (*free)(struct _CamelObject *, guint32 tag, gpointer ptr);
/* get/set meta-data interface */
- char *(*meta_get)(struct _CamelObject *, const char * name);
- gboolean (*meta_set)(struct _CamelObject *, const char * name, const char *value);
+ gchar *(*meta_get)(struct _CamelObject *, const gchar * name);
+ gboolean (*meta_set)(struct _CamelObject *, const gchar * name, const gchar *value);
/* persistence stuff */
- int (*state_read)(struct _CamelObject *, FILE *fp);
- int (*state_write)(struct _CamelObject *, FILE *fp);
+ gint (*state_read)(struct _CamelObject *, FILE *fp);
+ gint (*state_write)(struct _CamelObject *, FILE *fp);
};
#ifndef CAMEL_DISABLE_DEPRECATED
@@ -196,7 +196,7 @@ struct _CamelInterface {
/* The type system .... it's pretty simple..... */
void camel_type_init (void);
-CamelType camel_type_register(CamelType parent, const char * name, /*unsigned int ver, unsigned int rev,*/
+CamelType camel_type_register(CamelType parent, const gchar * name, /*guint ver, guint rev,*/
size_t instance_size,
size_t classfuncs_size,
CamelObjectClassInitFunc class_init,
@@ -205,7 +205,7 @@ CamelType camel_type_register(CamelType parent, const char * name, /*unsigned in
CamelObjectFinalizeFunc instance_finalize);
#ifndef CAMEL_DISABLE_DEPRECATED
-CamelType camel_interface_register(CamelType parent, const char *name,
+CamelType camel_interface_register(CamelType parent, const gchar *name,
size_t classfuncs_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalize);
@@ -215,9 +215,9 @@ CamelType camel_interface_register(CamelType parent, const char *name,
#define camel_type_get_global_classfuncs(x) ((CamelObjectClass *)(x))
/* object class methods (types == classes now) */
-const char *camel_type_to_name (CamelType type);
-CamelType camel_name_to_type (const char *name);
-void camel_object_class_add_event (CamelObjectClass *klass, const char *name, CamelObjectEventPrepFunc prep);
+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);
#ifndef CAMEL_DISABLE_DEPRECATED
void camel_object_class_add_interface(CamelObjectClass *klass, CamelType itype);
#endif /* CAMEL_DISABLE_DEPRECATED */
@@ -240,8 +240,8 @@ CamelType camel_object_get_type (void);
CamelObject *camel_object_new (CamelType type);
-void camel_object_ref(void *);
-void camel_object_unref(void *);
+void camel_object_ref(gpointer);
+void camel_object_unref(gpointer);
#ifdef CAMEL_DEBUG
#define camel_object_ref(o) (printf("%s (%s:%d):ref (%p)\n", __FUNCTION__, __FILE__, __LINE__, o), camel_object_ref(o))
@@ -249,50 +249,50 @@ void camel_object_unref(void *);
#endif
/* hooks */
-CamelObjectHookID camel_object_hook_event(void *obj, const char *name, CamelObjectEventHookFunc hook, void *data);
-void camel_object_remove_event(void *obj, CamelObjectHookID id);
-void camel_object_unhook_event(void *obj, const char *name, CamelObjectEventHookFunc hook, void *data);
-void camel_object_trigger_event(void *obj, const char *name, void *event_data);
+CamelObjectHookID camel_object_hook_event(gpointer obj, const gchar *name, CamelObjectEventHookFunc hook, gpointer data);
+void camel_object_remove_event(gpointer obj, CamelObjectHookID id);
+void camel_object_unhook_event(gpointer obj, const gchar *name, CamelObjectEventHookFunc hook, gpointer data);
+void camel_object_trigger_event(gpointer obj, const gchar *name, gpointer event_data);
#ifndef CAMEL_DISABLE_DEPRECATED
/* interfaces */
-void *camel_object_get_interface(void *vo, CamelType itype);
+gpointer camel_object_get_interface(gpointer vo, CamelType itype);
#endif /* CAMEL_DISABLE_DEPRECATED */
/* get/set methods */
-int camel_object_set(void *obj, struct _CamelException *ex, ...);
-int camel_object_setv(void *obj, struct _CamelException *ex, CamelArgV *);
-int camel_object_get(void *obj, struct _CamelException *ex, ...);
-int camel_object_getv(void *obj, struct _CamelException *ex, CamelArgGetV *);
+gint camel_object_set(gpointer obj, struct _CamelException *ex, ...);
+gint camel_object_setv(gpointer obj, struct _CamelException *ex, CamelArgV *);
+gint camel_object_get(gpointer obj, struct _CamelException *ex, ...);
+gint camel_object_getv(gpointer obj, struct _CamelException *ex, CamelArgGetV *);
/* not very efficient one-time calls */
-void *camel_object_get_ptr(void *vo, CamelException *ex, int tag);
-int camel_object_get_int(void *vo, CamelException *ex, int tag);
+gpointer camel_object_get_ptr(gpointer vo, CamelException *ex, gint tag);
+gint camel_object_get_int(gpointer vo, CamelException *ex, gint tag);
/* meta-data for user-specific data */
-char *camel_object_meta_get(void *vo, const char * name);
-gboolean camel_object_meta_set(void *vo, const char * name, const char *value);
+gchar *camel_object_meta_get(gpointer vo, const gchar * name);
+gboolean camel_object_meta_set(gpointer vo, const gchar * name, const gchar *value);
/* reads/writes the state from/to the CAMEL_OBJECT_STATE_FILE */
-int camel_object_state_read(void *vo);
-int camel_object_state_write(void *vo);
+gint camel_object_state_read(gpointer vo);
+gint camel_object_state_write(gpointer vo);
/* free a retrieved object. May be a noop for static data. */
-void camel_object_free(void *vo, guint32 tag, void *value);
+void camel_object_free(gpointer vo, guint32 tag, gpointer value);
/* for managing bags of weakly-ref'd 'child' objects */
typedef struct _CamelObjectBag CamelObjectBag;
-typedef void *(*CamelCopyFunc)(const void *vo);
+typedef gpointer (*CamelCopyFunc)(gconstpointer vo);
CamelObjectBag *camel_object_bag_new(GHashFunc hash, GEqualFunc equal, CamelCopyFunc keycopy, GFreeFunc keyfree);
-void *camel_object_bag_get(CamelObjectBag *bag, const void *key);
-void *camel_object_bag_peek(CamelObjectBag *bag, const void *key);
-void *camel_object_bag_reserve(CamelObjectBag *bag, const void *key);
-void camel_object_bag_add(CamelObjectBag *bag, const void *key, void *vo);
-void camel_object_bag_abort(CamelObjectBag *bag, const void *key);
-void camel_object_bag_rekey(CamelObjectBag *bag, void *o, const void *newkey);
+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, void *o);
+void camel_object_bag_remove(CamelObjectBag *bag, gpointer o);
void camel_object_bag_destroy(CamelObjectBag *bag);
#define CAMEL_MAKE_CLASS(type, tname, parent, pname) \
@@ -324,13 +324,13 @@ typedef struct _CamelIterator CamelIterator;
struct _CamelIteratorVTable {
/* free fields, dont free base object */
- void (*free)(void *it);
+ void (*free)(gpointer it);
/* go to the next messageinfo */
- const void *(*next)(void *it, CamelException *ex);
+ gconstpointer (*next)(gpointer it, CamelException *ex);
/* go back to the start */
- void (*reset)(void *it);
+ void (*reset)(gpointer it);
/* *ESTIMATE* how many results are in the iterator */
- int (*length)(void *it);
+ gint (*length)(gpointer it);
};
struct _CamelIterator {
@@ -339,11 +339,11 @@ struct _CamelIterator {
/* subclasses adds new fields afterwards */
};
-void *camel_iterator_new(CamelIteratorVTable *klass, size_t size);
-void camel_iterator_free(void *it);
-const void *camel_iterator_next(void *it, CamelException *ex);
-void camel_iterator_reset(void *it);
-int camel_iterator_length(void *it);
+gpointer camel_iterator_new(CamelIteratorVTable *klass, size_t size);
+void camel_iterator_free(gpointer it);
+gconstpointer camel_iterator_next(gpointer it, CamelException *ex);
+void camel_iterator_reset(gpointer it);
+gint camel_iterator_length(gpointer it);
#endif /* CAMEL_DISABLE_DEPRECATED */
G_END_DECLS
diff --git a/camel/camel-offline-folder.c b/camel/camel-offline-folder.c
index c9950487a..c1cffd53b 100644
--- a/camel/camel-offline-folder.c
+++ b/camel/camel-offline-folder.c
@@ -39,10 +39,10 @@ static void camel_offline_folder_class_init (CamelOfflineFolderClass *klass);
static void camel_offline_folder_init (CamelOfflineFolder *folder, CamelOfflineFolderClass *klass);
static void camel_offline_folder_finalize (CamelObject *object);
-static int offline_folder_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static int offline_folder_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint offline_folder_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint offline_folder_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static void offline_folder_downsync (CamelOfflineFolder *offline, const char *expression, CamelException *ex);
+static void offline_folder_downsync (CamelOfflineFolder *offline, const gchar *expression, CamelException *ex);
static CamelFolderClass *parent_class = NULL;
@@ -76,7 +76,7 @@ camel_offline_folder_get_type (void)
static void
camel_offline_folder_class_init (CamelOfflineFolderClass *klass)
{
- int i;
+ gint i;
parent_class = (CamelFolderClass *) camel_type_get_global_classfuncs (CAMEL_FOLDER_TYPE);
@@ -106,13 +106,13 @@ offline_downsync_sync (CamelSession *session, CamelSessionThreadMsg *mm)
{
struct _offline_downsync_msg *m = (struct _offline_downsync_msg *) mm;
CamelMimeMessage *message;
- int i;
+ gint i;
camel_operation_start (NULL, _("Downloading new messages for offline mode"));
if (m->changes) {
for (i = 0; i < m->changes->uid_added->len; i++) {
- int pc = i * 100 / m->changes->uid_added->len;
+ gint pc = i * 100 / m->changes->uid_added->len;
camel_operation_progress (NULL, pc);
if ((message = camel_folder_get_message (m->folder, m->changes->uid_added->pdata[i], &mm->ex)))
@@ -142,7 +142,7 @@ static CamelSessionThreadOps offline_downsync_ops = {
};
static void
-offline_folder_changed (CamelFolder *folder, CamelFolderChangeInfo *changes, void *dummy)
+offline_folder_changed (CamelFolder *folder, CamelFolderChangeInfo *changes, gpointer dummy)
{
CamelOfflineFolder *offline = (CamelOfflineFolder *) folder;
CamelService *service = (CamelService *) folder->parent_store;
@@ -177,7 +177,7 @@ static int
offline_folder_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelArgGetV props;
- int i, count = 0;
+ gint i, count = 0;
guint32 tag;
for (i = 0; i < args->argc; i++) {
@@ -216,7 +216,7 @@ offline_folder_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
CamelOfflineFolder *folder = (CamelOfflineFolder *) object;
gboolean save = FALSE;
guint32 tag;
- int i;
+ gint i;
for (i = 0; i < args->argc; i++) {
CamelArg *arg = &args->argv[i];
@@ -244,11 +244,11 @@ offline_folder_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
}
static void
-offline_folder_downsync (CamelOfflineFolder *offline, const char *expression, CamelException *ex)
+offline_folder_downsync (CamelOfflineFolder *offline, const gchar *expression, CamelException *ex)
{
CamelFolder *folder = (CamelFolder *) offline;
GPtrArray *uids, *uncached_uids = NULL;
- int i;
+ gint i;
camel_operation_start (NULL, _("Syncing messages in folder '%s' to disk"), folder->full_name);
@@ -271,7 +271,7 @@ offline_folder_downsync (CamelOfflineFolder *offline, const char *expression, Ca
goto done;
for (i = 0; i < uncached_uids->len; i++) {
- int pc = i * 100 / uncached_uids->len;
+ gint pc = i * 100 / uncached_uids->len;
camel_folder_sync_message (folder, uncached_uids->pdata[i], ex);
camel_operation_progress (NULL, pc);
}
@@ -294,7 +294,7 @@ done:
* the local machine for offline availability.
**/
void
-camel_offline_folder_downsync (CamelOfflineFolder *offline, const char *expression, CamelException *ex)
+camel_offline_folder_downsync (CamelOfflineFolder *offline, const gchar *expression, CamelException *ex)
{
g_return_if_fail (CAMEL_IS_OFFLINE_FOLDER (offline));
diff --git a/camel/camel-offline-folder.h b/camel/camel-offline-folder.h
index b2549236e..78fb0804d 100644
--- a/camel/camel-offline-folder.h
+++ b/camel/camel-offline-folder.h
@@ -48,19 +48,19 @@ enum {
struct _CamelOfflineFolder {
CamelFolder parent_object;
- unsigned int sync_offline:1;
+ guint sync_offline:1;
};
struct _CamelOfflineFolderClass {
CamelFolderClass parent_class;
- void (* downsync) (CamelOfflineFolder *folder, const char *expression, CamelException *ex);
+ void (* downsync) (CamelOfflineFolder *folder, const gchar *expression, CamelException *ex);
};
CamelType camel_offline_folder_get_type (void);
-void camel_offline_folder_downsync (CamelOfflineFolder *offline, const char *expression, CamelException *ex);
+void camel_offline_folder_downsync (CamelOfflineFolder *offline, const gchar *expression, CamelException *ex);
G_END_DECLS
diff --git a/camel/camel-offline-journal.c b/camel/camel-offline-journal.c
index a7c927009..be4b1174c 100644
--- a/camel/camel-offline-journal.c
+++ b/camel/camel-offline-journal.c
@@ -109,7 +109,7 @@ camel_offline_journal_finalize (CamelObject *object)
* Constructs a journal object.
**/
void
-camel_offline_journal_construct (CamelOfflineJournal *journal, CamelFolder *folder, const char *filename)
+camel_offline_journal_construct (CamelOfflineJournal *journal, CamelFolder *folder, const gchar *filename)
{
CamelDListNode *entry;
FILE *fp;
@@ -134,7 +134,7 @@ camel_offline_journal_construct (CamelOfflineJournal *journal, CamelFolder *fold
* Set the filename where the journal should load/save from.
**/
void
-camel_offline_journal_set_filename (CamelOfflineJournal *journal, const char *filename)
+camel_offline_journal_set_filename (CamelOfflineJournal *journal, const gchar *filename)
{
g_return_if_fail (CAMEL_IS_OFFLINE_JOURNAL (journal));
@@ -152,12 +152,12 @@ camel_offline_journal_set_filename (CamelOfflineJournal *journal, const char *fi
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_offline_journal_write (CamelOfflineJournal *journal, CamelException *ex)
{
CamelDListNode *entry;
FILE *fp;
- int fd;
+ gint fd;
if ((fd = g_open (journal->filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) == -1) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -202,12 +202,12 @@ camel_offline_journal_write (CamelOfflineJournal *journal, CamelException *ex)
*
* Returns: %0 on success (no entry failed to replay) or %-1 on fail
**/
-int
+gint
camel_offline_journal_replay (CamelOfflineJournal *journal, CamelException *ex)
{
CamelDListNode *entry, *next;
CamelException lex;
- int failed = 0;
+ gint failed = 0;
camel_exception_init (&lex);
diff --git a/camel/camel-offline-journal.h b/camel/camel-offline-journal.h
index 098ae3c44..4a42b1360 100644
--- a/camel/camel-offline-journal.h
+++ b/camel/camel-offline-journal.h
@@ -51,7 +51,7 @@ struct _CamelOfflineJournal {
CamelObject parent_object;
struct _CamelFolder *folder;
- char *filename;
+ gchar *filename;
CamelDList queue;
};
@@ -62,18 +62,18 @@ struct _CamelOfflineJournalClass {
void (* entry_free) (CamelOfflineJournal *journal, CamelDListNode *entry);
CamelDListNode * (* entry_load) (CamelOfflineJournal *journal, FILE *in);
- int (* entry_write) (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
- int (* entry_play) (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
+ gint (* entry_write) (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
+ gint (* entry_play) (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
};
CamelType camel_offline_journal_get_type (void);
-void camel_offline_journal_construct (CamelOfflineJournal *journal, struct _CamelFolder *folder, const char *filename);
-void camel_offline_journal_set_filename (CamelOfflineJournal *journal, const char *filename);
+void camel_offline_journal_construct (CamelOfflineJournal *journal, struct _CamelFolder *folder, const gchar *filename);
+void camel_offline_journal_set_filename (CamelOfflineJournal *journal, const gchar *filename);
-int camel_offline_journal_write (CamelOfflineJournal *journal, CamelException *ex);
-int camel_offline_journal_replay (CamelOfflineJournal *journal, CamelException *ex);
+gint camel_offline_journal_write (CamelOfflineJournal *journal, CamelException *ex);
+gint camel_offline_journal_replay (CamelOfflineJournal *journal, CamelException *ex);
G_END_DECLS
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index 264979b94..9bc9bf46a 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -110,7 +110,7 @@ offline_store_construct (CamelService *service, CamelSession *session,
* Return the network state either #CAMEL_OFFLINE_STORE_NETWORK_AVAIL
* or #CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL.
**/
-int
+gint
camel_offline_store_get_network_state (CamelOfflineStore *store, CamelException *ex)
{
return store->state;
@@ -126,7 +126,7 @@ camel_offline_store_get_network_state (CamelOfflineStore *store, CamelException
* or #CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL.
**/
void
-camel_offline_store_set_network_state (CamelOfflineStore *store, int state, CamelException *ex)
+camel_offline_store_set_network_state (CamelOfflineStore *store, gint state, CamelException *ex)
{
CamelException lex;
CamelService *service = CAMEL_SERVICE (store);
@@ -142,7 +142,7 @@ camel_offline_store_set_network_state (CamelOfflineStore *store, int state, Came
if (((CamelStore *) store)->folders) {
GPtrArray *folders;
CamelFolder *folder;
- int i, sync;
+ gint i, sync;
sync = camel_url_get_param (((CamelService *) store)->url, "sync_offline") != NULL;
@@ -193,7 +193,7 @@ camel_offline_store_prepare_for_offline (CamelOfflineStore *store, CamelExceptio
if (((CamelStore *) store)->folders) {
GPtrArray *folders;
CamelFolder *folder;
- int i, sync;
+ gint i, sync;
sync = camel_url_get_param (((CamelService *) store)->url, "sync_offline") != NULL;
diff --git a/camel/camel-offline-store.h b/camel/camel-offline-store.h
index acfe1b3f7..458c9c895 100644
--- a/camel/camel-offline-store.h
+++ b/camel/camel-offline-store.h
@@ -50,21 +50,21 @@ enum {
struct _CamelOfflineStore {
CamelStore parent_object;
- int state;
+ gint state;
};
struct _CamelOfflineStoreClass {
CamelStoreClass parent_class;
- void (* set_network_state) (CamelOfflineStore *store, int state, CamelException *ex);
+ void (* set_network_state) (CamelOfflineStore *store, gint state, CamelException *ex);
};
CamelType camel_offline_store_get_type (void);
-void camel_offline_store_set_network_state (CamelOfflineStore *store, int state, CamelException *ex);
-int camel_offline_store_get_network_state (CamelOfflineStore *store, CamelException *ex);
+void camel_offline_store_set_network_state (CamelOfflineStore *store, gint state, CamelException *ex);
+gint camel_offline_store_get_network_state (CamelOfflineStore *store, CamelException *ex);
void camel_offline_store_prepare_for_offline (CamelOfflineStore *store, CamelException *ex);
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index 3dda5e244..d64abfe78 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -45,9 +45,9 @@
struct _status_stack {
guint32 flags;
- char *msg;
- int pc; /* last pc reported */
- unsigned int stamp; /* last stamp reported */
+ gchar *msg;
+ gint pc; /* last pc reported */
+ guint stamp; /* last stamp reported */
};
struct _CamelOperation {
@@ -56,19 +56,19 @@ struct _CamelOperation {
pthread_t id; /* id of running thread */
guint32 flags; /* cancelled ? */
- int blocked; /* cancellation blocked depth */
- int refcount;
+ gint blocked; /* cancellation blocked depth */
+ gint refcount;
CamelOperationStatusFunc status;
- void *status_data;
- unsigned int status_update;
+ gpointer status_data;
+ guint status_update;
/* stack of status messages (struct _status_stack *) */
GSList *status_stack;
struct _status_stack *lastreport;
CamelMsgPort *cancel_port;
- int cancel_fd;
+ gint cancel_fd;
#ifdef HAVE_NSS
PRFileDesc *cancel_prfd;
#endif
@@ -85,7 +85,7 @@ static pthread_mutex_t operation_lock = PTHREAD_MUTEX_INITIALIZER;
#define UNLOCK() pthread_mutex_unlock(&operation_lock)
-static unsigned int stamp (void);
+static guint stamp (void);
static CamelDList operation_list = CAMEL_DLIST_INITIALISER(operation_list);
static pthread_key_t operation_key;
static pthread_once_t operation_once = PTHREAD_ONCE_INIT;
@@ -123,7 +123,7 @@ co_getcc(void)
* Return value: A new operation handle.
**/
CamelOperation *
-camel_operation_new (CamelOperationStatusFunc status, void *status_data)
+camel_operation_new (CamelOperationStatusFunc status, gpointer status_data)
{
CamelOperation *cc;
@@ -218,7 +218,7 @@ camel_operation_unref (CamelOperation *cc)
n = cc->status_stack;
while (n) {
- g_warning("Camel operation status stack non empty: %s", (char *)n->data);
+ g_warning("Camel operation status stack non empty: %s", (gchar *)n->data);
g_free(n->data);
n = n->next;
}
@@ -388,7 +388,7 @@ gboolean
camel_operation_cancel_check (CamelOperation *cc)
{
CamelOperationMsg *msg;
- int cancelled;
+ gint cancelled;
d(printf("checking for cancel in thread %d\n", pthread_self()));
@@ -428,7 +428,7 @@ camel_operation_cancel_check (CamelOperation *cc)
* Return value: The fd, or -1 if cancellation is not available
* (blocked, or has not been registered for this thread).
**/
-int
+gint
camel_operation_cancel_fd (CamelOperation *cc)
{
if (cc == NULL)
@@ -491,7 +491,7 @@ void
camel_operation_start (CamelOperation *cc, const gchar *what, ...)
{
va_list ap;
- char *msg;
+ gchar *msg;
struct _status_stack *s;
if (cc == NULL)
@@ -538,7 +538,7 @@ void
camel_operation_start_transient (CamelOperation *cc, const gchar *what, ...)
{
va_list ap;
- char *msg;
+ gchar *msg;
struct _status_stack *s;
if (cc == NULL)
@@ -566,7 +566,7 @@ camel_operation_start_transient (CamelOperation *cc, const gchar *what, ...)
/*cc->status(cc, msg, CAMEL_OPERATION_START, cc->status_data);*/
}
-static unsigned int stamp(void)
+static guint stamp(void)
{
GTimeVal tv;
@@ -588,11 +588,11 @@ static unsigned int stamp(void)
* camel_operation_progress_count().
**/
void
-camel_operation_progress (CamelOperation *cc, int pc)
+camel_operation_progress (CamelOperation *cc, gint pc)
{
- unsigned int now;
+ guint now;
struct _status_stack *s;
- char *msg = NULL;
+ gchar *msg = NULL;
if (cc == NULL)
cc = co_getcc();
@@ -644,7 +644,7 @@ camel_operation_progress (CamelOperation *cc, int pc)
*
**/
void
-camel_operation_progress_count (CamelOperation *cc, int sofar)
+camel_operation_progress_count (CamelOperation *cc, gint sofar)
{
camel_operation_progress(cc, sofar);
}
@@ -660,9 +660,9 @@ void
camel_operation_end (CamelOperation *cc)
{
struct _status_stack *s, *p;
- unsigned int now;
- char *msg = NULL;
- int pc = 0;
+ guint now;
+ gchar *msg = NULL;
+ gint pc = 0;
if (cc == NULL)
cc = co_getcc();
diff --git a/camel/camel-operation.h b/camel/camel-operation.h
index 940f10d76..5fff2af8b 100644
--- a/camel/camel-operation.h
+++ b/camel/camel-operation.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
typedef struct _CamelOperation CamelOperation;
-typedef void (*CamelOperationStatusFunc)(struct _CamelOperation *op, const char *what, int pc, void *data);
+typedef void (*CamelOperationStatusFunc)(struct _CamelOperation *op, const gchar *what, gint pc, gpointer data);
typedef enum _camel_operation_status_t {
CAMEL_OPERATION_START = -1,
@@ -38,7 +38,7 @@ typedef enum _camel_operation_status_t {
} camel_operation_status_t;
/* main thread functions */
-CamelOperation *camel_operation_new(CamelOperationStatusFunc status, void *status_data);
+CamelOperation *camel_operation_new(CamelOperationStatusFunc status, gpointer status_data);
void camel_operation_mute(CamelOperation *cc);
void camel_operation_ref(CamelOperation *cc);
void camel_operation_unref(CamelOperation *cc);
@@ -51,8 +51,8 @@ void camel_operation_unregister (CamelOperation *cc);
/* called internally by camel, for the current thread */
void camel_operation_cancel_block(CamelOperation *cc);
void camel_operation_cancel_unblock(CamelOperation *cc);
-int camel_operation_cancel_check(CamelOperation *cc);
-int camel_operation_cancel_fd(CamelOperation *cc);
+gint camel_operation_cancel_check(CamelOperation *cc);
+gint camel_operation_cancel_fd(CamelOperation *cc);
#ifdef HAVE_NSS
struct PRFileDesc *camel_operation_cancel_prfd(CamelOperation *cc);
#endif
@@ -61,8 +61,8 @@ CamelOperation *camel_operation_registered(void);
void camel_operation_start(CamelOperation *cc, const gchar *what, ...);
void camel_operation_start_transient(CamelOperation *cc, const gchar *what, ...);
-void camel_operation_progress(CamelOperation *cc, int pc);
-void camel_operation_progress_count(CamelOperation *cc, int sofar);
+void camel_operation_progress(CamelOperation *cc, gint pc);
+void camel_operation_progress_count(CamelOperation *cc, gint sofar);
void camel_operation_end(CamelOperation *cc);
G_END_DECLS
diff --git a/camel/camel-partition-table.c b/camel/camel-partition-table.c
index 2f9d1c625..121532396 100644
--- a/camel/camel-partition-table.c
+++ b/camel/camel-partition-table.c
@@ -129,7 +129,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 char *key)
+static camel_hash_t hash_key(const gchar *key)
{
camel_hash_t hash = 0xABADF00D;
@@ -142,9 +142,9 @@ static camel_hash_t hash_key(const char *key)
}
/* Call with lock held */
-static CamelBlock *find_partition(CamelPartitionTable *cpi, camel_hash_t id, int *indexp)
+static CamelBlock *find_partition(CamelPartitionTable *cpi, camel_hash_t id, gint *indexp)
{
- int index, jump;
+ gint index, jump;
CamelBlock *bl;
CamelPartitionMapBlock *ptb;
CamelPartitionMap *part;
@@ -244,11 +244,11 @@ fail:
}
/* sync our blocks, the caller must still sync the blockfile itself */
-int
+gint
camel_partition_table_sync(CamelPartitionTable *cpi)
{
CamelBlock *bl, *bn;
- int ret = 0;
+ gint ret = 0;
CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
@@ -269,14 +269,14 @@ fail:
return ret;
}
-camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const char *key)
+camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const gchar *key)
{
CamelPartitionKeyBlock *pkb;
CamelPartitionMapBlock *ptb;
CamelBlock *block, *ptblock;
camel_hash_t hashid;
camel_key_t keyid = 0;
- int index, i;
+ gint index, i;
hashid = hash_key(key);
@@ -313,13 +313,13 @@ camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const char *k
return keyid;
}
-void camel_partition_table_remove(CamelPartitionTable *cpi, const char *key)
+void camel_partition_table_remove(CamelPartitionTable *cpi, const gchar *key)
{
CamelPartitionKeyBlock *pkb;
CamelPartitionMapBlock *ptb;
CamelBlock *block, *ptblock;
camel_hash_t hashid;
- int index, i;
+ gint index, i;
hashid = hash_key(key);
@@ -361,7 +361,7 @@ void camel_partition_table_remove(CamelPartitionTable *cpi, const char *key)
}
static int
-keys_cmp(const void *ap, const void *bp)
+keys_cmp(gconstpointer ap, gconstpointer bp)
{
const CamelPartitionKey *a = ap;
const CamelPartitionKey *b = bp;
@@ -374,17 +374,17 @@ keys_cmp(const void *ap, const void *bp)
return 0;
}
-int
-camel_partition_table_add(CamelPartitionTable *cpi, const char *key, camel_key_t keyid)
+gint
+camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_t keyid)
{
camel_hash_t hashid, partid;
- int index, newindex = 0; /* initialisation of this and pkb/nkb is just to silence compiler */
+ gint index, newindex = 0; /* initialisation of this and pkb/nkb is just to silence compiler */
CamelPartitionMapBlock *ptb, *ptn;
CamelPartitionKeyBlock *kb, *newkb, *nkb = NULL, *pkb = NULL;
CamelBlock *block, *ptblock, *ptnblock;
- int i, half, len;
+ gint i, half, len;
struct _CamelPartitionKey keys[CAMEL_BLOCK_SIZE/4];
- int ret = -1;
+ gint ret = -1;
#define KEY_SIZE (sizeof(kb->keys)/sizeof(kb->keys[0]))
@@ -677,7 +677,7 @@ camel_key_table_new(CamelBlockFile *bs, camel_block_t root)
return ki;
}
-int
+gint
camel_key_table_sync(CamelKeyTable *ki)
{
#ifdef SYNC_UPDATES
@@ -688,12 +688,12 @@ camel_key_table_sync(CamelKeyTable *ki)
}
camel_key_t
-camel_key_table_add(CamelKeyTable *ki, const char *key, camel_block_t data, unsigned int flags)
+camel_key_table_add(CamelKeyTable *ki, const gchar *key, camel_block_t data, guint flags)
{
CamelBlock *last, *next;
CamelKeyBlock *kblast, *kbnext;
- int len, left;
- unsigned int offset;
+ gint len, left;
+ guint offset;
camel_key_t keyid = 0;
/* Maximum key size = 128 chars */
@@ -722,7 +722,7 @@ camel_key_table_add(CamelKeyTable *ki, const char *key, camel_block_t data, unsi
goto fail;
if (kblast->used > 0) {
- /*left = &kblast->u.keydata[kblast->u.keys[kblast->used-1].offset] - (char *)(&kblast->u.keys[kblast->used+1]);*/
+ /*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]),
@@ -787,7 +787,7 @@ camel_key_table_set_data(CamelKeyTable *ki, camel_key_t keyid, camel_block_t dat
{
CamelBlock *bl;
camel_block_t blockid;
- int index;
+ gint index;
CamelKeyBlock *kb;
if (keyid == 0)
@@ -814,13 +814,13 @@ camel_key_table_set_data(CamelKeyTable *ki, camel_key_t keyid, camel_block_t dat
}
void
-camel_key_table_set_flags(CamelKeyTable *ki, camel_key_t keyid, unsigned int flags, unsigned int set)
+camel_key_table_set_flags(CamelKeyTable *ki, camel_key_t keyid, guint flags, guint set)
{
CamelBlock *bl;
camel_block_t blockid;
- int index;
+ gint index;
CamelKeyBlock *kb;
- unsigned int old;
+ guint old;
if (keyid == 0)
return;
@@ -857,12 +857,12 @@ camel_key_table_set_flags(CamelKeyTable *ki, camel_key_t keyid, unsigned int fla
}
camel_block_t
-camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, char **keyp, unsigned int *flags)
+camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, gchar **keyp, guint *flags)
{
CamelBlock *bl;
camel_block_t blockid;
- int index, len, off;
- char *key;
+ gint index, len, off;
+ gchar *key;
CamelKeyBlock *kb;
if (keyp)
@@ -917,12 +917,12 @@ camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, char **keyp, unsign
/* iterate through all keys */
camel_key_t
-camel_key_table_next(CamelKeyTable *ki, camel_key_t next, char **keyp, unsigned int *flagsp, camel_block_t *datap)
+camel_key_table_next(CamelKeyTable *ki, camel_key_t next, gchar **keyp, guint *flagsp, camel_block_t *datap)
{
CamelBlock *bl;
CamelKeyBlock *kb;
camel_block_t blockid;
- int index;
+ gint index;
if (keyp)
*keyp = NULL;
@@ -965,11 +965,11 @@ camel_key_table_next(CamelKeyTable *ki, camel_key_t next, char **keyp, unsigned
/* invalid block data */
if ((kb->u.keys[index].offset >= sizeof(kb->u.keydata)
- /*|| kb->u.keys[index].offset < kb->u.keydata - (char *)&kb->u.keys[kb->used])*/
+ /*|| 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
|| (index > 0 &&
(kb->u.keys[index-1].offset >= sizeof(kb->u.keydata)
- /*|| kb->u.keys[index-1].offset < kb->u.keydata - (char *)&kb->u.keys[kb->used]))) {*/
+ /*|| 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);
@@ -984,8 +984,8 @@ camel_key_table_next(CamelKeyTable *ki, camel_key_t next, char **keyp, unsigned
*flagsp = kb->u.keys[index].flags;
if (keyp) {
- int len, off = kb->u.keys[index].offset;
- char *key;
+ gint len, off = kb->u.keys[index].offset;
+ gchar *key;
if (index == 0)
len = sizeof(kb->u.keydata) - off;
diff --git a/camel/camel-partition-table.h b/camel/camel-partition-table.h
index df2eb4c1c..92c441934 100644
--- a/camel/camel-partition-table.h
+++ b/camel/camel-partition-table.h
@@ -72,8 +72,8 @@ struct _CamelPartitionTable {
CamelBlockFile *blocks;
camel_block_t rootid;
- int (*is_key)(CamelPartitionTable *cpi, const char *key, camel_key_t keyid, void *data);
- void *is_key_data;
+ gint (*is_key)(CamelPartitionTable *cpi, const gchar *key, camel_key_t keyid, gpointer data);
+ gpointer is_key_data;
/* we keep a list of partition blocks active at all times */
CamelDList partition;
@@ -86,10 +86,10 @@ struct _CamelPartitionTableClass {
CamelType camel_partition_table_get_type(void);
CamelPartitionTable *camel_partition_table_new(struct _CamelBlockFile *bs, camel_block_t root);
-int camel_partition_table_sync(CamelPartitionTable *cpi);
-int camel_partition_table_add(CamelPartitionTable *cpi, const char *key, camel_key_t keyid);
-camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const char *key);
-void camel_partition_table_remove(CamelPartitionTable *cpi, const char *key);
+gint camel_partition_table_sync(CamelPartitionTable *cpi);
+gint camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_t keyid);
+camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const gchar *key);
+void camel_partition_table_remove(CamelPartitionTable *cpi, const gchar *key);
/* ********************************************************************** */
@@ -109,8 +109,8 @@ struct _CamelKeyRootBlock {
struct _CamelKeyKey {
camel_block_t data;
- unsigned int offset:10;
- unsigned int flags:22;
+ guint offset:10;
+ guint flags:22;
};
struct _CamelKeyBlock {
@@ -118,7 +118,7 @@ struct _CamelKeyBlock {
guint32 used;
union {
struct _CamelKeyKey keys[(CAMEL_BLOCK_SIZE-8)/sizeof(struct _CamelKeyKey)];
- char keydata[CAMEL_BLOCK_SIZE-8];
+ gchar keydata[CAMEL_BLOCK_SIZE-8];
} u;
};
@@ -144,12 +144,12 @@ struct _CamelKeyTableClass {
CamelType camel_key_table_get_type(void);
CamelKeyTable * camel_key_table_new(CamelBlockFile *bs, camel_block_t root);
-int camel_key_table_sync(CamelKeyTable *ki);
-camel_key_t camel_key_table_add(CamelKeyTable *ki, const char *key, camel_block_t data, unsigned int flags);
+gint camel_key_table_sync(CamelKeyTable *ki);
+camel_key_t camel_key_table_add(CamelKeyTable *ki, const gchar *key, camel_block_t data, guint flags);
void camel_key_table_set_data(CamelKeyTable *ki, camel_key_t keyid, camel_block_t data);
-void camel_key_table_set_flags(CamelKeyTable *ki, camel_key_t keyid, unsigned int flags, unsigned int set);
-camel_block_t camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, char **key, unsigned int *flags);
-camel_key_t camel_key_table_next(CamelKeyTable *ki, camel_key_t next, char **keyp, unsigned int *flagsp, camel_block_t *datap);
+void camel_key_table_set_flags(CamelKeyTable *ki, camel_key_t keyid, guint flags, guint set);
+camel_block_t camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, gchar **key, guint *flags);
+camel_key_t camel_key_table_next(CamelKeyTable *ki, camel_key_t next, gchar **keyp, guint *flagsp, camel_block_t *datap);
G_END_DECLS
diff --git a/camel/camel-private.h b/camel/camel-private.h
index 9738ef0ba..1a3cabab6 100644
--- a/camel/camel-private.h
+++ b/camel/camel-private.h
@@ -38,7 +38,7 @@ struct _CamelFolderPrivate {
GStaticRecMutex lock;
GStaticMutex change_lock;
/* must require the 'change_lock' to access this */
- int frozen;
+ gint frozen;
struct _CamelFolderChangeInfo *changed_frozen; /* queues changed events */
};
@@ -93,7 +93,7 @@ struct _CamelSessionPrivate {
GMutex *lock; /* for locking everything basically */
GMutex *thread_lock; /* locking threads */
- int thread_id;
+ gint thread_id;
GHashTable *thread_active;
GThreadPool *thread_pool;
@@ -161,7 +161,7 @@ struct _CamelVeeFolderPrivate {
GMutex *summary_lock; /* for locking vfolder summary */
GMutex *subfolder_lock; /* for locking the subfolder list */
GMutex *changed_lock; /* for locking the folders-changed list */
- int unread_vfolder;
+ gint unread_vfolder;
};
#define CAMEL_VEE_FOLDER_LOCK(f, l) \
@@ -196,9 +196,9 @@ struct _CamelCertDBPrivate {
#ifdef G_OS_WIN32
#define fsync(fd) _commit(fd)
-const char *_camel_get_localedir (void) G_GNUC_CONST;
-const char *_camel_get_libexecdir (void) G_GNUC_CONST;
-const char *_camel_get_providerdir (void) G_GNUC_CONST;
+const gchar *_camel_get_localedir (void) G_GNUC_CONST;
+const gchar *_camel_get_libexecdir (void) G_GNUC_CONST;
+const gchar *_camel_get_providerdir (void) G_GNUC_CONST;
#undef EVOLUTION_LOCALEDIR
#define EVOLUTION_LOCALEDIR _camel_get_localedir ()
diff --git a/camel/camel-process.c b/camel/camel-process.c
index b94c8183d..019ccd7f9 100644
--- a/camel/camel-process.c
+++ b/camel/camel-process.c
@@ -33,9 +33,9 @@
pid_t
-camel_process_fork (const char *path, char **argv, int *infd, int *outfd, int *errfd, CamelException *ex)
+camel_process_fork (const gchar *path, gchar **argv, gint *infd, gint *outfd, gint *errfd, CamelException *ex)
{
- int errnosav, fd[6], i;
+ gint errnosav, fd[6], i;
pid_t pid;
for (i = 0; i < 6; i++)
@@ -62,7 +62,7 @@ camel_process_fork (const char *path, char **argv, int *infd, int *outfd, int *e
if (!(pid = fork ())) {
/* child process */
- int maxfd, nullfd = -1;
+ gint maxfd, nullfd = -1;
if (!outfd || !errfd)
nullfd = open ("/dev/null", O_WRONLY);
@@ -118,11 +118,11 @@ camel_process_fork (const char *path, char **argv, int *infd, int *outfd, int *e
}
-int
+gint
camel_process_wait (pid_t pid)
{
sigset_t mask, omask;
- int status;
+ gint status;
pid_t r;
sigemptyset (&mask);
diff --git a/camel/camel-process.h b/camel/camel-process.h
index 1c08ef0e4..4e6b0d7b6 100644
--- a/camel/camel-process.h
+++ b/camel/camel-process.h
@@ -31,9 +31,9 @@
G_BEGIN_DECLS
-pid_t camel_process_fork (const char *path, char **argv, int *infd, int *outfd, int *errfd, CamelException *ex);
+pid_t camel_process_fork (const gchar *path, gchar **argv, gint *infd, gint *outfd, gint *errfd, CamelException *ex);
-int camel_process_wait (pid_t pid);
+gint camel_process_wait (pid_t pid);
G_END_DECLS
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
index ecdc07b16..4e96c9537 100644
--- a/camel/camel-provider.c
+++ b/camel/camel-provider.c
@@ -101,10 +101,10 @@ void
camel_provider_init (void)
{
GDir *dir;
- const char *entry;
- char *p, *name, buf[80];
+ const gchar *entry;
+ gchar *p, *name, buf[80];
CamelProviderModule *m;
- static int loaded = 0;
+ static gint loaded = 0;
pthread_once(&setup_once, provider_setup);
@@ -149,7 +149,7 @@ camel_provider_init (void)
*p = '\0';
if (*buf) {
- char *protocol = g_strdup(buf);
+ gchar *protocol = g_strdup(buf);
m->types = g_slist_prepend(m->types, protocol);
g_hash_table_insert(module_table, protocol, m);
@@ -172,7 +172,7 @@ camel_provider_init (void)
* itself with @session.
**/
void
-camel_provider_load(const char *path, CamelException *ex)
+camel_provider_load(const gchar *path, CamelException *ex)
{
GModule *module;
CamelProvider *(*camel_provider_module_init) (void);
@@ -216,7 +216,7 @@ camel_provider_load(const char *path, CamelException *ex)
void
camel_provider_register(CamelProvider *provider)
{
- int i;
+ gint i;
CamelProviderConfEntry *conf;
GList *l;
@@ -343,10 +343,10 @@ camel_provider_list(gboolean load)
* Return value: the provider, or %NULL, in which case @ex will be set.
**/
CamelProvider *
-camel_provider_get(const char *url_string, CamelException *ex)
+camel_provider_get(const gchar *url_string, CamelException *ex)
{
CamelProvider *provider = NULL;
- char *protocol;
+ gchar *protocol;
size_t len;
g_return_val_if_fail (url_string != NULL, NULL);
@@ -405,7 +405,7 @@ fail:
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_provider_auto_detect (CamelProvider *provider, CamelURL *url,
GHashTable **auto_detected, CamelException *ex)
{
diff --git a/camel/camel-provider.h b/camel/camel-provider.h
index 4a27fa366..67f17d787 100644
--- a/camel/camel-provider.h
+++ b/camel/camel-provider.h
@@ -43,7 +43,7 @@ typedef enum {
CAMEL_NUM_PROVIDER_TYPES
} CamelProviderType;
-extern char *camel_provider_type_name[CAMEL_NUM_PROVIDER_TYPES];
+extern gchar *camel_provider_type_name[CAMEL_NUM_PROVIDER_TYPES];
/* Provider flags:
*
@@ -135,8 +135,8 @@ typedef enum {
typedef struct {
CamelProviderConfType type;
- char *name, *depname;
- char *text, *value;
+ gchar *name, *depname;
+ gchar *text, *value;
} CamelProviderConfEntry;
/* Some defaults */
@@ -144,14 +144,14 @@ typedef struct {
#define CAMEL_PROVIDER_CONF_DEFAULT_HOSTNAME { CAMEL_PROVIDER_CONF_LABEL, "hostname", NULL, N_("_Host:"), NULL }
#define CAMEL_PROVIDER_CONF_DEFAULT_PATH { CAMEL_PROVIDER_CONF_ENTRY, "path", NULL, N_("_Path:"), "" }
-typedef int (*CamelProviderAutoDetectFunc) (CamelURL *url, GHashTable **auto_detected, CamelException *ex);
+typedef gint (*CamelProviderAutoDetectFunc) (CamelURL *url, GHashTable **auto_detected, CamelException *ex);
typedef struct {
/* Provider name used in CamelURLs. */
- char *protocol;
+ gchar *protocol;
/* Provider name as used by people. (May be the same as protocol) */
- char *name;
+ gchar *name;
/* Description of the provider. A novice user should be able
* to read this description, and the information provided by
@@ -159,16 +159,16 @@ typedef struct {
* this provider is relevant to him, and if so, which
* information goes with it.
*/
- char *description;
+ gchar *description;
/* The category of message that this provider works with.
* (evolution-mail will only list a provider in the store/transport
* config dialogs if its domain is "mail".)
*/
- char *domain;
+ gchar *domain;
/* Flags describing the provider, flags describing its URLs */
- int flags, url_flags;
+ gint flags, url_flags;
/* The ConfEntry and AutoDetect functions will probably be
* DEPRECATED in a future release */
@@ -197,42 +197,42 @@ typedef struct {
/* gettext translation domain (NULL for providers in the
* evolution source tree).
*/
- char *translation_domain;
+ gchar *translation_domain;
/* This string points to the provider's gconf key value
*/
- const char *license;
+ const gchar *license;
/* This holds the license file name [ ascii text format ] containing
* the license agreement. This should be the absolute file path. This
* is read only when the HAS_LICENSE flag is set
*/
- const char *license_file;
+ const gchar *license_file;
/* Private to the provider */
- void *priv;
+ gpointer priv;
} CamelProvider;
typedef struct _CamelProviderModule CamelProviderModule;
struct _CamelProviderModule {
- char *path;
+ gchar *path;
GSList *types;
guint loaded:1;
};
void camel_provider_init(void);
-void camel_provider_load(const char *path, CamelException *ex);
+void camel_provider_load(const gchar *path, CamelException *ex);
void camel_provider_register(CamelProvider *provider);
GList *camel_provider_list(gboolean load);
-CamelProvider *camel_provider_get(const char *url_string, CamelException *ex);
+CamelProvider *camel_provider_get(const gchar *url_string, CamelException *ex);
/* This is defined by each module, not by camel-provider.c. */
void camel_provider_module_init(void);
-int camel_provider_auto_detect (CamelProvider *provider, CamelURL *url,
+gint camel_provider_auto_detect (CamelProvider *provider, CamelURL *url,
GHashTable **auto_detected, CamelException *ex);
G_END_DECLS
diff --git a/camel/camel-sasl-anonymous.c b/camel/camel-sasl-anonymous.c
index fbc285182..0fa138ac4 100644
--- a/camel/camel-sasl-anonymous.c
+++ b/camel/camel-sasl-anonymous.c
@@ -99,7 +99,7 @@ camel_sasl_anonymous_get_type (void)
* Returns: a new #CamelSasl object
**/
CamelSasl *
-camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const char *trace_info)
+camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const gchar *trace_info)
{
CamelSaslAnonymous *sasl_anon;
diff --git a/camel/camel-sasl-anonymous.h b/camel/camel-sasl-anonymous.h
index fea2dd64b..6ddc42333 100644
--- a/camel/camel-sasl-anonymous.h
+++ b/camel/camel-sasl-anonymous.h
@@ -41,7 +41,7 @@ typedef enum {
typedef struct _CamelSaslAnonymous {
CamelSasl parent_object;
- char *trace_info;
+ gchar *trace_info;
CamelSaslAnonTraceType type;
} CamelSaslAnonymous;
@@ -56,7 +56,7 @@ typedef struct _CamelSaslAnonymousClass {
CamelType camel_sasl_anonymous_get_type (void);
/* public methods */
-CamelSasl *camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const char *trace_info);
+CamelSasl *camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const gchar *trace_info);
extern CamelServiceAuthType camel_sasl_anonymous_authtype;
diff --git a/camel/camel-sasl-cram-md5.c b/camel/camel-sasl-cram-md5.c
index 58fd3e16d..d8113c9b5 100644
--- a/camel/camel-sasl-cram-md5.c
+++ b/camel/camel-sasl-cram-md5.c
@@ -91,12 +91,12 @@ cram_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
GChecksum *checksum;
guint8 *digest;
gsize length;
- char *passwd;
+ gchar *passwd;
const gchar *hex;
GByteArray *ret = NULL;
guchar ipad[64];
guchar opad[64];
- int i, pw_len;
+ gint i, pw_len;
/* Need to wait for the server */
if (!token)
diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c
index 25b2179bb..cdd22a6a0 100644
--- a/camel/camel-sasl-digest-md5.c
+++ b/camel/camel-sasl-digest-md5.c
@@ -67,7 +67,7 @@ enum {
};
typedef struct {
- char *name;
+ gchar *name;
guint type;
} DataType;
@@ -124,48 +124,48 @@ static DataType cipher_types[] = {
};
struct _param {
- char *name;
- char *value;
+ gchar *name;
+ gchar *value;
};
struct _DigestChallenge {
GPtrArray *realms;
- char *nonce;
+ gchar *nonce;
guint qop;
gboolean stale;
gint32 maxbuf;
- char *charset;
- char *algorithm;
+ gchar *charset;
+ gchar *algorithm;
guint cipher;
GList *params;
};
struct _DigestURI {
- char *type;
- char *host;
- char *name;
+ gchar *type;
+ gchar *host;
+ gchar *name;
};
struct _DigestResponse {
- char *username;
- char *realm;
- char *nonce;
- char *cnonce;
- char nc[9];
+ gchar *username;
+ gchar *realm;
+ gchar *nonce;
+ gchar *cnonce;
+ gchar nc[9];
guint qop;
struct _DigestURI *uri;
- char resp[33];
+ gchar resp[33];
guint32 maxbuf;
- char *charset;
+ gchar *charset;
guint cipher;
- char *authzid;
- char *param;
+ gchar *authzid;
+ gchar *param;
};
struct _CamelSaslDigestMd5Private {
struct _DigestChallenge *challenge;
struct _DigestResponse *response;
- int state;
+ gint state;
};
static void
@@ -194,7 +194,7 @@ camel_sasl_digest_md5_finalize (CamelObject *object)
struct _DigestChallenge *c = sasl->priv->challenge;
struct _DigestResponse *r = sasl->priv->response;
GList *p;
- int i;
+ gint i;
if (c != NULL) {
for (i = 0; i < c->realms->len; i++)
@@ -255,9 +255,9 @@ camel_sasl_digest_md5_get_type (void)
}
static void
-decode_lwsp (const char **in)
+decode_lwsp (const gchar **in)
{
- const char *inptr = *in;
+ const gchar *inptr = *in;
while (isspace (*inptr))
inptr++;
@@ -265,18 +265,18 @@ decode_lwsp (const char **in)
*in = inptr;
}
-static char *
-decode_quoted_string (const char **in)
+static gchar *
+decode_quoted_string (const gchar **in)
{
- const char *inptr = *in;
- char *out = NULL, *outptr;
- int outlen;
- int c;
+ const gchar *inptr = *in;
+ gchar *out = NULL, *outptr;
+ gint outlen;
+ gint c;
decode_lwsp (&inptr);
if (*inptr == '"') {
- const char *intmp;
- int skip = 0;
+ const gchar *intmp;
+ gint skip = 0;
/* first, calc length */
inptr++;
@@ -305,11 +305,11 @@ decode_quoted_string (const char **in)
return out;
}
-static char *
-decode_token (const char **in)
+static gchar *
+decode_token (const gchar **in)
{
- const char *inptr = *in;
- const char *start;
+ const gchar *inptr = *in;
+ const gchar *start;
decode_lwsp (&inptr);
start = inptr;
@@ -325,10 +325,10 @@ decode_token (const char **in)
}
}
-static char *
-decode_value (const char **in)
+static gchar *
+decode_value (const gchar **in)
{
- const char *inptr = *in;
+ const gchar *inptr = *in;
decode_lwsp (&inptr);
if (*inptr == '"') {
@@ -341,11 +341,11 @@ decode_value (const char **in)
}
static GList *
-parse_param_list (const char *tokens)
+parse_param_list (const gchar *tokens)
{
GList *params = NULL;
struct _param *param;
- const char *ptr;
+ const gchar *ptr;
for (ptr = tokens; ptr && *ptr; ) {
param = g_new0 (struct _param, 1);
@@ -365,9 +365,9 @@ parse_param_list (const char *tokens)
}
static guint
-decode_data_type (DataType *dtype, const char *name)
+decode_data_type (DataType *dtype, const gchar *name)
{
- int i;
+ gint i;
for (i = 0; dtype[i].name; i++) {
if (!g_ascii_strcasecmp (dtype[i].name, name))
@@ -381,10 +381,10 @@ decode_data_type (DataType *dtype, const char *name)
#define decode_qop(name) decode_data_type (qop_types, name)
#define decode_cipher(name) decode_data_type (cipher_types, name)
-static const char *
+static const gchar *
type_to_string (DataType *dtype, guint type)
{
- int i;
+ gint i;
for (i = 0; dtype[i].name; i++) {
if (dtype[i].type == type)
@@ -406,11 +406,11 @@ digest_abort (gboolean *have_type, gboolean *abort)
}
static struct _DigestChallenge *
-parse_server_challenge (const char *tokens, gboolean *abort)
+parse_server_challenge (const gchar *tokens, gboolean *abort)
{
struct _DigestChallenge *challenge = NULL;
GList *params, *p;
- const char *ptr;
+ const gchar *ptr;
#ifdef PARANOID
gboolean got_algorithm = FALSE;
gboolean got_stale = FALSE;
@@ -432,13 +432,13 @@ parse_server_challenge (const char *tokens, gboolean *abort)
for (p = params; p; p = p->next) {
struct _param *param = p->data;
- int type;
+ gint type;
type = get_digest_arg (param->name);
switch (type) {
case DIGEST_REALM:
for (ptr = param->value; ptr && *ptr; ) {
- char *token;
+ gchar *token;
token = decode_token (&ptr);
if (token)
@@ -459,7 +459,7 @@ parse_server_challenge (const char *tokens, gboolean *abort)
break;
case DIGEST_QOP:
for (ptr = param->value; ptr && *ptr; ) {
- char *token;
+ gchar *token;
token = decode_token (&ptr);
if (token)
@@ -511,7 +511,7 @@ parse_server_challenge (const char *tokens, gboolean *abort)
break;
case DIGEST_CIPHER:
for (ptr = param->value; ptr && *ptr; ) {
- char *token;
+ gchar *token;
token = decode_token (&ptr);
if (token)
@@ -537,7 +537,7 @@ parse_server_challenge (const char *tokens, gboolean *abort)
return challenge;
}
-static char *
+static gchar *
digest_uri_to_string (struct _DigestURI *uri)
{
if (uri->name)
@@ -547,7 +547,7 @@ digest_uri_to_string (struct _DigestURI *uri)
}
static void
-compute_response (struct _DigestResponse *resp, const char *passwd, gboolean client, guchar out[33])
+compute_response (struct _DigestResponse *resp, const gchar *passwd, gboolean client, guchar out[33])
{
GString *buffer;
GChecksum *checksum;
@@ -645,8 +645,8 @@ compute_response (struct _DigestResponse *resp, const char *passwd, gboolean cli
}
static struct _DigestResponse *
-generate_response (struct _DigestChallenge *challenge, const char *host,
- const char *protocol, const char *user, const char *passwd)
+generate_response (struct _DigestChallenge *challenge, const gchar *host,
+ const gchar *protocol, const gchar *user, const gchar *passwd)
{
struct _DigestResponse *resp;
struct _DigestURI *uri;
@@ -669,7 +669,7 @@ generate_response (struct _DigestChallenge *challenge, const char *host,
resp->nonce = g_strdup (challenge->nonce);
/* generate the cnonce */
- bgen = g_strdup_printf ("%p:%lu:%lu", (void *) resp,
+ bgen = g_strdup_printf ("%p:%lu:%lu", (gpointer) resp,
(unsigned long) getpid (),
(unsigned long) time (NULL));
checksum = g_checksum_new (G_CHECKSUM_MD5);
@@ -722,17 +722,17 @@ static GByteArray *
digest_response (struct _DigestResponse *resp)
{
GByteArray *buffer;
- const char *str;
- char *buf;
+ const gchar *str;
+ gchar *buf;
buffer = g_byte_array_new ();
g_byte_array_append (buffer, (guint8 *) "username=\"", 10);
if (resp->charset) {
/* Encode the username using the requested charset */
- char *username, *outbuf;
- const char *charset;
+ gchar *username, *outbuf;
+ const gchar *charset;
size_t len, outlen;
- const char *inbuf;
+ const gchar *inbuf;
iconv_t cd;
charset = camel_iconv_locale_charset ();
@@ -798,7 +798,7 @@ digest_response (struct _DigestResponse *resp)
if (resp->charset) {
g_byte_array_append (buffer, (guint8 *) ",charset=", 9);
- g_byte_array_append (buffer, (guint8 *) resp->charset, strlen ((char *) resp->charset));
+ g_byte_array_append (buffer, (guint8 *) resp->charset, strlen ((gchar *) resp->charset));
}
if (resp->cipher != CIPHER_INVALID) {
@@ -827,9 +827,9 @@ digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
struct _param *rspauth;
GByteArray *ret = NULL;
gboolean abort = FALSE;
- const char *ptr;
+ const gchar *ptr;
guchar out[33];
- char *tokens;
+ gchar *tokens;
struct addrinfo *ai, hints;
/* Need to wait for the server */
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index e3117829e..3af757c63 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -84,7 +84,7 @@ enum {
#define DESIRED_SECURITY_LAYER GSSAPI_SECURITY_LAYER_NONE
struct _CamelSaslGssapiPrivate {
- int state;
+ gint state;
gss_ctx_id_t ctx;
gss_name_t target;
};
@@ -157,7 +157,7 @@ camel_sasl_gssapi_get_type (void)
static void
gssapi_set_exception (OM_uint32 major, OM_uint32 minor, CamelException *ex)
{
- const char *str;
+ const gchar *str;
switch (major) {
case GSS_S_BAD_MECH:
@@ -216,10 +216,10 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
gss_buffer_desc inbuf, outbuf;
GByteArray *challenge = NULL;
gss_buffer_t input_token;
- int conf_state;
+ gint conf_state;
gss_qop_t qop;
gss_OID mech;
- char *str;
+ gchar *str;
struct addrinfo *ai, hints;
switch (priv->state) {
@@ -309,7 +309,7 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
}
/* check that our desired security layer is supported */
- if ((((unsigned char *) outbuf.value)[0] & DESIRED_SECURITY_LAYER) != DESIRED_SECURITY_LAYER) {
+ if ((((guchar *) outbuf.value)[0] & DESIRED_SECURITY_LAYER) != DESIRED_SECURITY_LAYER) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
_("Unsupported security layer."));
#ifndef HAVE_HEIMDAL_KRB5
diff --git a/camel/camel-sasl-kerberos4.c b/camel/camel-sasl-kerberos4.c
index 798b9a59b..2995248f8 100644
--- a/camel/camel-sasl-kerberos4.c
+++ b/camel/camel-sasl-kerberos4.c
@@ -65,7 +65,7 @@ static CamelSaslClass *parent_class = NULL;
static GByteArray *krb4_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
struct _CamelSaslKerberos4Private {
- int state;
+ gint state;
guint32 nonce_n;
guint32 nonce_h;
@@ -129,9 +129,9 @@ krb4_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
{
struct _CamelSaslKerberos4Private *priv = CAMEL_SASL_KERBEROS4 (sasl)->priv;
GByteArray *ret = NULL;
- char *inst, *realm, *username;
+ gchar *inst, *realm, *username;
struct hostent *h;
- int status, len;
+ gint status, len;
KTEXT_ST authenticator;
CREDENTIALS credentials;
guint32 plus1;
@@ -212,7 +212,7 @@ krb4_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
ret->data[5] = ret->data[6] = ret->data[7] = 0;
strcpy (ret->data + 8, username);
- des_pcbc_encrypt ((void *)ret->data, (void *)ret->data, len,
+ des_pcbc_encrypt ((gpointer)ret->data, (gpointer)ret->data, len,
priv->schedule, &priv->session, 1);
memset (&priv->session, 0, sizeof (priv->session));
diff --git a/camel/camel-sasl-login.c b/camel/camel-sasl-login.c
index 52530a182..a89e052b4 100644
--- a/camel/camel-sasl-login.c
+++ b/camel/camel-sasl-login.c
@@ -55,7 +55,7 @@ static CamelSaslClass *parent_class = NULL;
static GByteArray *login_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
struct _CamelSaslLoginPrivate {
- int state;
+ gint state;
};
static void
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index 6aaa993c2..060da3e59 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -90,8 +90,8 @@ camel_sasl_ntlm_get_type (void)
static void ntlm_calc_response (const guchar key[21],
const guchar plaintext[8],
guchar results[24]);
-static void ntlm_lanmanager_hash (const char *password, char hash[21]);
-static void ntlm_nt_hash (const char *password, char hash[21]);
+static void ntlm_lanmanager_hash (const gchar *password, gchar hash[21]);
+static void ntlm_nt_hash (const gchar *password, gchar hash[21]);
typedef struct {
guint16 length;
@@ -100,7 +100,7 @@ typedef struct {
} SecurityBuffer;
static GString *
-ntlm_get_string (GByteArray *ba, int offset)
+ntlm_get_string (GByteArray *ba, gint offset)
{
SecurityBuffer *secbuf;
GString *string;
@@ -123,7 +123,7 @@ ntlm_get_string (GByteArray *ba, int offset)
}
static void
-ntlm_set_string (GByteArray *ba, int offset, const char *data, int len)
+ntlm_set_string (GByteArray *ba, gint offset, const gchar *data, gint len)
{
SecurityBuffer *secbuf;
@@ -148,9 +148,9 @@ ntlm_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
goto fail;
memcpy (nonce, token->data + NTLM_CHALLENGE_NONCE_OFFSET, 8);
- ntlm_lanmanager_hash (sasl->service->url->passwd, (char *) hash);
+ ntlm_lanmanager_hash (sasl->service->url->passwd, (gchar *) hash);
ntlm_calc_response (hash, nonce, lm_resp);
- ntlm_nt_hash (sasl->service->url->passwd, (char *) hash);
+ ntlm_nt_hash (sasl->service->url->passwd, (gchar *) hash);
ntlm_calc_response (hash, nonce, nt_resp);
domain = ntlm_get_string (token, NTLM_CHALLENGE_DOMAIN_OFFSET);
@@ -173,9 +173,9 @@ ntlm_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
ntlm_set_string (ret, NTLM_RESPONSE_HOST_OFFSET,
"UNKNOWN", sizeof ("UNKNOWN") - 1);
ntlm_set_string (ret, NTLM_RESPONSE_LM_RESP_OFFSET,
- (const char *) lm_resp, sizeof (lm_resp));
+ (const gchar *) lm_resp, sizeof (lm_resp));
ntlm_set_string (ret, NTLM_RESPONSE_NT_RESP_OFFSET,
- (const char *) nt_resp, sizeof (nt_resp));
+ (const gchar *) nt_resp, sizeof (nt_resp));
sasl->authenticated = TRUE;
@@ -194,16 +194,16 @@ exit:
}
/* MD4 */
-static void md4sum (const unsigned char *in,
- int nbytes,
- unsigned char digest[16]);
+static void md4sum (const guchar *in,
+ gint nbytes,
+ guchar digest[16]);
/* DES */
typedef guint32 DES_KS[16][2]; /* Single-key DES key schedule */
-static void deskey (DES_KS, unsigned char *, int);
+static void deskey (DES_KS, guchar *, int);
-static void des (DES_KS, unsigned char *);
+static void des (DES_KS, guchar *);
static void setup_schedule (const guchar *key_56, DES_KS ks);
@@ -214,11 +214,11 @@ static void setup_schedule (const guchar *key_56, DES_KS ks);
"\x00\x00\x00\x00\x00"
static void
-ntlm_lanmanager_hash (const char *password, char hash[21])
+ntlm_lanmanager_hash (const gchar *password, gchar hash[21])
{
guchar lm_password [15];
DES_KS ks;
- int i;
+ gint i;
for (i = 0; i < 14 && password [i]; i++)
lm_password [i] = toupper ((unsigned char) password [i]);
@@ -229,16 +229,16 @@ ntlm_lanmanager_hash (const char *password, char hash[21])
memcpy (hash, LM_PASSWORD_MAGIC, 21);
setup_schedule (lm_password, ks);
- des (ks, (unsigned char *) hash);
+ des (ks, (guchar *) hash);
setup_schedule (lm_password + 7, ks);
- des (ks, (unsigned char *) hash + 8);
+ des (ks, (guchar *) hash + 8);
}
static void
-ntlm_nt_hash (const char *password, char hash[21])
+ntlm_nt_hash (const gchar *password, gchar hash[21])
{
- unsigned char *buf, *p;
+ guchar *buf, *p;
p = buf = g_malloc (strlen (password) * 2);
@@ -247,7 +247,7 @@ ntlm_nt_hash (const char *password, char hash[21])
*p++ = '\0';
}
- md4sum (buf, p - buf, (unsigned char *) hash);
+ md4sum (buf, p - buf, (guchar *) hash);
memset (hash + 16, 0, 5);
g_free (buf);
@@ -262,7 +262,7 @@ static void
setup_schedule (const guchar *key_56, DES_KS ks)
{
guchar key[8];
- int i, c, bit;
+ gint i, c, bit;
for (i = 0; i < 8; i++) {
key [i] = KEYBITS (key_56, i * 7);
@@ -312,11 +312,11 @@ ntlm_calc_response (const guchar key[21], const guchar plaintext[8],
#define ROT(val, n) ( ((val) << (n)) | ((val) >> (32 - (n))) )
static void
-md4sum (const unsigned char *in, int nbytes, unsigned char digest[16])
+md4sum (const guchar *in, gint nbytes, guchar digest[16])
{
- unsigned char *M;
+ guchar *M;
guint32 A, B, C, D, AA, BB, CC, DD, X[16];
- int pbytes, nbits = nbytes * 8, i, j;
+ gint pbytes, nbits = nbytes * 8, i, j;
pbytes = (120 - (nbytes % 64)) % 64;
M = alloca (nbytes + pbytes + 8);
@@ -570,7 +570,7 @@ static guint32 Spbox[8][64] = {
/* Encrypt or decrypt a block of data in ECB mode */
static void
-des (guint32 ks[16][2], unsigned char block[8])
+des (guint32 ks[16][2], guchar block[8])
{
guint32 left, right, work;
@@ -663,7 +663,7 @@ des (guint32 ks[16][2], unsigned char block[8])
/* Key schedule-related tables from FIPS-46 */
/* permuted choice table (key) */
-static unsigned char pc1[] = {
+static guchar pc1[] = {
57, 49, 41, 33, 25, 17, 9,
1, 58, 50, 42, 34, 26, 18,
10, 2, 59, 51, 43, 35, 27,
@@ -676,12 +676,12 @@ static unsigned char pc1[] = {
};
/* number left rotations of pc1 */
-static unsigned char totrot[] = {
+static guchar totrot[] = {
1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28
};
/* permuted choice key (table) */
-static unsigned char pc2[] = {
+static guchar pc2[] = {
14, 17, 11, 24, 1, 5,
3, 28, 15, 6, 21, 10,
23, 19, 12, 4, 26, 8,
@@ -696,7 +696,7 @@ static unsigned char pc2[] = {
/* bit 0 is left-most in byte */
-static int bytebit[] = {
+static gint bytebit[] = {
0200,0100,040,020,010,04,02,01
};
@@ -705,13 +705,13 @@ static int bytebit[] = {
* depending on the value of "decrypt"
*/
static void
-deskey (DES_KS k, unsigned char *key, int decrypt)
+deskey (DES_KS k, guchar *key, gint decrypt)
{
- unsigned char pc1m[56]; /* place to modify pc1 into */
- unsigned char pcr[56]; /* place to rotate pc1 into */
- register int i,j,l;
- int m;
- unsigned char ks[8];
+ guchar pc1m[56]; /* place to modify pc1 into */
+ guchar pcr[56]; /* place to rotate pc1 into */
+ register gint i,j,l;
+ gint m;
+ guchar ks[8];
for (j=0; j<56; j++) { /* convert pc1 to bits of key */
l=pc1[j]-1; /* integer bit location */
diff --git a/camel/camel-sasl-popb4smtp.c b/camel/camel-sasl-popb4smtp.c
index 7214c32d3..aca41d5a4 100644
--- a/camel/camel-sasl-popb4smtp.c
+++ b/camel/camel-sasl-popb4smtp.c
@@ -96,7 +96,7 @@ camel_sasl_popb4smtp_get_type (void)
static GByteArray *
popb4smtp_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
{
- char *popuri;
+ gchar *popuri;
CamelSession *session = sasl->service->session;
CamelStore *store;
time_t now, *timep;
diff --git a/camel/camel-sasl.c b/camel/camel-sasl.c
index d72a12cf0..aeefbec99 100644
--- a/camel/camel-sasl.c
+++ b/camel/camel-sasl.c
@@ -126,11 +126,11 @@ camel_sasl_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
*
* Returns: the base64 encoded challenge string
**/
-char *
-camel_sasl_challenge_base64 (CamelSasl *sasl, const char *token, CamelException *ex)
+gchar *
+camel_sasl_challenge_base64 (CamelSasl *sasl, const gchar *token, CamelException *ex)
{
GByteArray *token_binary, *ret_binary;
- char *ret;
+ gchar *ret;
g_return_val_if_fail (CAMEL_IS_SASL (sasl), NULL);
@@ -187,7 +187,7 @@ camel_sasl_authenticated (CamelSasl *sasl)
* supported.
**/
CamelSasl *
-camel_sasl_new (const char *service_name, const char *mechanism, CamelService *service)
+camel_sasl_new (const gchar *service_name, const gchar *mechanism, CamelService *service)
{
CamelSasl *sasl;
@@ -263,7 +263,7 @@ camel_sasl_authtype_list (gboolean include_plain)
* it is supported.
**/
CamelServiceAuthType *
-camel_sasl_authtype (const char *mechanism)
+camel_sasl_authtype (const gchar *mechanism)
{
if (!strcmp (mechanism, "CRAM-MD5"))
return &camel_sasl_cram_md5_authtype;
diff --git a/camel/camel-sasl.h b/camel/camel-sasl.h
index 0780487f9..0f4ea3110 100644
--- a/camel/camel-sasl.h
+++ b/camel/camel-sasl.h
@@ -38,8 +38,8 @@ G_BEGIN_DECLS
typedef struct _CamelSasl {
CamelObject parent_object;
- char *service_name;
- char *mech; /* mechanism */
+ gchar *service_name;
+ gchar *mech; /* mechanism */
CamelService *service;
gboolean authenticated;
} CamelSasl;
@@ -58,15 +58,15 @@ CamelType camel_sasl_get_type (void);
/* public methods */
GByteArray *camel_sasl_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-char *camel_sasl_challenge_base64 (CamelSasl *sasl, const char *token, CamelException *ex);
+gchar *camel_sasl_challenge_base64 (CamelSasl *sasl, const gchar *token, CamelException *ex);
gboolean camel_sasl_authenticated (CamelSasl *sasl);
/* utility functions */
-CamelSasl *camel_sasl_new (const char *service_name, const char *mechanism, CamelService *service);
+CamelSasl *camel_sasl_new (const gchar *service_name, const gchar *mechanism, CamelService *service);
GList *camel_sasl_authtype_list (gboolean include_plain);
-CamelServiceAuthType *camel_sasl_authtype (const char *mechanism);
+CamelServiceAuthType *camel_sasl_authtype (const gchar *mechanism);
G_END_DECLS
diff --git a/camel/camel-search-private.c b/camel/camel-search-private.c
index 524d431b0..7b60f30ab 100644
--- a/camel/camel-search-private.c
+++ b/camel/camel-search-private.c
@@ -47,10 +47,10 @@
#define d(x)
static inline guint32
-camel_utf8_getc(const unsigned char **ptr)
+camel_utf8_getc(const guchar **ptr)
{
- register unsigned char *p = (unsigned char *)*ptr;
- register unsigned char c, r;
+ register guchar *p = (guchar *)*ptr;
+ register guchar c, r;
register guint32 v, m;
again:
@@ -91,14 +91,14 @@ loop:
implementations, over long content.
A small issue is that case-insenstivity wont work entirely correct for utf8 strings. */
-int
-camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, int argc,
+gint
+camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, gint argc,
struct _ESExpResult **argv, CamelException *ex)
{
GString *match = g_string_new("");
- int c, i, count=0, err;
- char *word;
- int flags;
+ gint c, i, count=0, err;
+ gchar *word;
+ gint flags;
/* build a regex pattern we can use to match the words, we OR them together */
if (argc>1)
@@ -141,8 +141,8 @@ camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, int
if (err != 0) {
/* regerror gets called twice to get the full error string
length to do proper posix error reporting */
- int len = regerror (err, pattern, 0, 0);
- char *buffer = g_malloc0 (len + 1);
+ gint len = regerror (err, pattern, 0, 0);
+ gchar *buffer = g_malloc0 (len + 1);
regerror (err, pattern, buffer, len);
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -157,7 +157,7 @@ camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, int
return err;
}
-static unsigned char soundex_table[256] = {
+static guchar soundex_table[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -197,13 +197,13 @@ soundexify (const gchar *sound, gchar code[5])
}
static gboolean
-header_soundex (const char *header, const char *match)
+header_soundex (const gchar *header, const gchar *match)
{
- char mcode[5], hcode[5];
- const char *p;
- char c;
+ gchar mcode[5], hcode[5];
+ const gchar *p;
+ gchar c;
GString *word;
- int truth = FALSE;
+ gint truth = FALSE;
soundexify (match, mcode);
@@ -230,12 +230,12 @@ header_soundex (const char *header, const char *match)
return truth;
}
-const char *
-camel_ustrstrcase (const char *haystack, const char *needle)
+const gchar *
+camel_ustrstrcase (const gchar *haystack, const gchar *needle)
{
gunichar *nuni, *puni;
gunichar u;
- const unsigned char *p;
+ const guchar *p;
g_return_val_if_fail (haystack != NULL, NULL);
g_return_val_if_fail (needle != NULL, NULL);
@@ -247,7 +247,7 @@ camel_ustrstrcase (const char *haystack, const char *needle)
puni = nuni = g_alloca (sizeof (gunichar) * strlen (needle));
- p = (const unsigned char *) needle;
+ p = (const guchar *) needle;
while ((u = camel_utf8_getc(&p)))
*puni++ = g_unichar_tolower (u);
@@ -255,14 +255,14 @@ camel_ustrstrcase (const char *haystack, const char *needle)
if (!p)
return NULL;
- p = (const unsigned char *)haystack;
+ p = (const guchar *)haystack;
while ((u = camel_utf8_getc(&p))) {
gunichar c;
c = g_unichar_tolower (u);
- /* We have valid stripped char */
+ /* We have valid stripped gchar */
if (c == nuni[0]) {
- const unsigned char *q = p;
+ const guchar *q = p;
gint npos = 1;
while (nuni + npos < puni) {
@@ -278,7 +278,7 @@ camel_ustrstrcase (const char *haystack, const char *needle)
}
if (nuni + npos == puni)
- return (const char *) p;
+ return (const gchar *) p;
}
}
@@ -296,11 +296,11 @@ camel_ustrstrcase (const char *haystack, const char *needle)
} G_STMT_END
static int
-camel_ustrcasecmp (const char *ps1, const char *ps2)
+camel_ustrcasecmp (const gchar *ps1, const gchar *ps2)
{
gunichar u1, u2 = 0;
- const unsigned char *s1 = (const unsigned char *)ps1;
- const unsigned char *s2 = (const unsigned char *)ps2;
+ const guchar *s1 = (const guchar *)ps1;
+ const guchar *s2 = (const guchar *)ps2;
CAMEL_SEARCH_COMPARE (s1, s2, NULL);
@@ -328,11 +328,11 @@ camel_ustrcasecmp (const char *ps1, const char *ps2)
}
static int
-camel_ustrncasecmp (const char *ps1, const char *ps2, size_t len)
+camel_ustrncasecmp (const gchar *ps1, const gchar *ps2, size_t len)
{
gunichar u1, u2 = 0;
- const unsigned char *s1 = (const unsigned char *)ps1;
- const unsigned char *s2 = (const unsigned char *)ps2;
+ const guchar *s1 = (const guchar *)ps1;
+ const guchar *s2 = (const guchar *)ps2;
CAMEL_SEARCH_COMPARE (s1, s2, NULL);
@@ -365,10 +365,10 @@ camel_ustrncasecmp (const char *ps1, const char *ps2, size_t len)
/* value is the match value suitable for exact match if required */
static int
-header_match(const char *value, const char *match, camel_search_match_t how)
+header_match(const gchar *value, const gchar *match, camel_search_match_t how)
{
- const unsigned char *p;
- int vlen, mlen;
+ const guchar *p;
+ gint vlen, mlen;
gunichar c;
if (how == CAMEL_SEARCH_MATCH_SOUNDEX)
@@ -381,7 +381,7 @@ header_match(const char *value, const char *match, camel_search_match_t how)
/* from dan the man, if we have mixed case, perform a case-sensitive match,
otherwise not */
- p = (const unsigned char *)match;
+ p = (const guchar *)match;
while ((c = camel_utf8_getc (&p))) {
if (g_unichar_isupper(c)) {
switch (how) {
@@ -419,18 +419,18 @@ header_match(const char *value, const char *match, camel_search_match_t how)
/* searhces for match inside value, if match is mixed case, hten use case-sensitive,
else insensitive */
gboolean
-camel_search_header_match (const char *value, const char *match, camel_search_match_t how, camel_search_t type, const char *default_charset)
+camel_search_header_match (const gchar *value, const gchar *match, camel_search_match_t how, camel_search_t type, const gchar *default_charset)
{
- const char *name, *addr;
- const unsigned char *ptr;
- int truth = FALSE, i;
+ const gchar *name, *addr;
+ const guchar *ptr;
+ gint truth = FALSE, i;
CamelInternetAddress *cia;
- char *v, *vdom, *mdom;
+ gchar *v, *vdom, *mdom;
gunichar c;
- ptr = (const unsigned char *)value;
+ ptr = (const guchar *)value;
while ((c = camel_utf8_getc(&ptr)) && g_unichar_isspace(c))
- value = (const char *)ptr;
+ value = (const gchar *)ptr;
switch(type) {
case CAMEL_SEARCH_TYPE_ENCODED:
@@ -449,12 +449,12 @@ camel_search_header_match (const char *value, const char *match, camel_search_ma
v = g_alloca(vdom-value+1);
memcpy(v, value, vdom-value);
v[vdom-value] = 0;
- value = (char *)v;
+ value = (gchar *)v;
} else if (mdom != NULL && vdom == NULL) {
v = g_alloca(mdom-match+1);
memcpy(v, match, mdom-match);
v[mdom-match] = 0;
- match = (char *)v;
+ match = (gchar *)v;
}
/* Falls through */
case CAMEL_SEARCH_TYPE_ASIS:
@@ -489,8 +489,8 @@ gboolean
camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
{
CamelDataWrapper *containee;
- int truth = FALSE;
- int parts, i;
+ gint truth = FALSE;
+ gint parts, i;
containee = camel_medium_get_content_object (CAMEL_MEDIUM (object));
@@ -515,7 +515,7 @@ camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
camel_data_wrapper_write_to_stream (containee, CAMEL_STREAM (mem));
camel_stream_write (CAMEL_STREAM (mem), "", 1);
- truth = regexec (pattern, (char *) mem->buffer->data, 0, NULL, 0) == 0;
+ truth = regexec (pattern, (gchar *) mem->buffer->data, 0, NULL, 0) == 0;
camel_object_unref (mem);
}
@@ -523,10 +523,10 @@ camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
}
static void
-output_c(GString *w, guint32 c, int *type)
+output_c(GString *w, guint32 c, gint *type)
{
- int utf8len;
- char utf8[8];
+ gint utf8len;
+ gchar utf8[8];
if (!g_unichar_isalnum(c))
*type = CAMEL_SEARCH_WORD_COMPLEX | (*type & CAMEL_SEARCH_WORD_8BIT);
@@ -543,7 +543,7 @@ output_c(GString *w, guint32 c, int *type)
}
static void
-output_w(GString *w, GPtrArray *list, int type)
+output_w(GString *w, GPtrArray *list, gint type)
{
struct _camel_search_word *word;
@@ -557,14 +557,14 @@ output_w(GString *w, GPtrArray *list, int type)
}
struct _camel_search_words *
-camel_search_words_split(const unsigned char *in)
+camel_search_words_split(const guchar *in)
{
- int type = CAMEL_SEARCH_WORD_SIMPLE, all = 0;
+ gint type = CAMEL_SEARCH_WORD_SIMPLE, all = 0;
GString *w;
struct _camel_search_words *words;
GPtrArray *list = g_ptr_array_new();
guint32 c;
- int inquote = 0;
+ gint inquote = 0;
words = g_malloc0(sizeof(*words));
w = g_string_new("");
@@ -610,9 +610,9 @@ camel_search_words_split(const unsigned char *in)
struct _camel_search_words *
camel_search_words_simple(struct _camel_search_words *wordin)
{
- int i;
- const unsigned char *ptr, *start, *last;
- int type = CAMEL_SEARCH_WORD_SIMPLE, all = 0;
+ gint i;
+ const guchar *ptr, *start, *last;
+ gint type = CAMEL_SEARCH_WORD_SIMPLE, all = 0;
GPtrArray *list = g_ptr_array_new();
struct _camel_search_word *word;
struct _camel_search_words *words;
@@ -627,7 +627,7 @@ camel_search_words_simple(struct _camel_search_words *wordin)
word->word = g_strdup(wordin->words[i]->word);
g_ptr_array_add(list, word);
} else {
- ptr = (const unsigned char *) wordin->words[i]->word;
+ ptr = (const guchar *) wordin->words[i]->word;
start = last = ptr;
do {
c = camel_utf8_getc(&ptr);
@@ -660,7 +660,7 @@ camel_search_words_simple(struct _camel_search_words *wordin)
void
camel_search_words_free(struct _camel_search_words *words)
{
- int i;
+ gint i;
for (i=0;i<words->len;i++) {
struct _camel_search_word *word = words->words[i];
diff --git a/camel/camel-search-private.h b/camel/camel-search-private.h
index 6a4807c61..3ab4fd2e7 100644
--- a/camel/camel-search-private.h
+++ b/camel/camel-search-private.h
@@ -56,14 +56,14 @@ typedef enum {
} camel_search_t;
/* builds a regex that represents a string search */
-int camel_search_build_match_regex(regex_t *pattern, camel_search_flags_t type, int argc, struct _ESExpResult **argv, CamelException *ex);
+gint camel_search_build_match_regex(regex_t *pattern, camel_search_flags_t type, gint argc, struct _ESExpResult **argv, CamelException *ex);
gboolean camel_search_message_body_contains(CamelDataWrapper *object, regex_t *pattern);
-gboolean camel_search_header_match(const char *value, const char *match, camel_search_match_t how, camel_search_t type, const char *default_charset);
-gboolean camel_search_camel_header_soundex(const char *header, const char *match);
+gboolean camel_search_header_match(const gchar *value, const gchar *match, camel_search_match_t how, camel_search_t type, const gchar *default_charset);
+gboolean camel_search_camel_header_soundex(const gchar *header, const gchar *match);
/* TODO: replace with a real search function */
-const char *camel_ustrstrcase(const char *haystack, const char *needle);
+const gchar *camel_ustrstrcase(const gchar *haystack, const gchar *needle);
/* Some crappy utility functions for handling multiple search words */
typedef enum _camel_search_word_t {
@@ -74,16 +74,16 @@ typedef enum _camel_search_word_t {
struct _camel_search_word {
camel_search_word_t type;
- char *word;
+ gchar *word;
};
struct _camel_search_words {
- int len;
+ gint len;
camel_search_word_t type; /* OR of all word types in list */
struct _camel_search_word **words;
};
-struct _camel_search_words *camel_search_words_split(const unsigned char *in);
+struct _camel_search_words *camel_search_words_split(const guchar *in);
struct _camel_search_words *camel_search_words_simple(struct _camel_search_words *wordin);
void camel_search_words_free(struct _camel_search_words *);
diff --git a/camel/camel-search-sql-sexp.c b/camel/camel-search-sql-sexp.c
index bd5005c48..d50a48afe 100644
--- a/camel/camel-search-sql-sexp.c
+++ b/camel/camel-search-sql-sexp.c
@@ -44,16 +44,16 @@ typedef enum {
CAMEL_SEARCH_MATCH_ENDS,
CAMEL_SEARCH_MATCH_SOUNDEX
} camel_search_match_t;
-char * camel_db_get_column_name (const char *raw_name);
+gchar * camel_db_get_column_name (const gchar *raw_name);
-char *
-camel_db_sqlize_string (const char *string)
+gchar *
+camel_db_sqlize_string (const gchar *string)
{
return sqlite3_mprintf ("%Q", string);
}
void
-camel_db_free_sqlized_string (char *string)
+camel_db_free_sqlized_string (gchar *string)
{
sqlite3_free (string);
string = NULL;
@@ -65,11 +65,11 @@ camel_db_free_sqlized_string (char *string)
#include "camel-search-private.h"
#endif
-static char *
-get_db_safe_string (const char *str)
+static gchar *
+get_db_safe_string (const gchar *str)
{
- char *tmp = camel_db_sqlize_string (str);
- char *ret;
+ gchar *tmp = camel_db_sqlize_string (str);
+ gchar *ret;
ret = g_strdup(tmp);
camel_db_free_sqlized_string (tmp);
@@ -80,11 +80,11 @@ get_db_safe_string (const char *str)
/* Configuration of your sexp expression */
static ESExpResult *
-func_and(ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+func_and(ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
{
ESExpResult *r, *r1;
GString *string;
- int i;
+ gint i;
d(printf("executing and: %d", argc));
@@ -113,11 +113,11 @@ func_and(ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
}
static ESExpResult *
-func_or(ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+func_or(ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
{
ESExpResult *r, *r1;
GString *string;
- int i;
+ gint i;
d(printf("executing or: %d", argc));
@@ -141,7 +141,7 @@ func_or(ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
}
static ESExpResult *
-func_not(ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+func_not(ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
{
ESExpResult *r=NULL, *r1;
@@ -164,7 +164,7 @@ func_not(ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
/* this should support all arguments ...? */
static ESExpResult *
-eval_eq(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+eval_eq(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
{
struct _ESExpResult *r, *r1, *r2;
@@ -198,8 +198,8 @@ eval_eq(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
else if (r2->type == ESEXP_RES_TIME)
g_string_append_printf(str, "%ld", r2->value.time);
else if (r2->type == ESEXP_RES_STRING) {
- char *tmp = g_strdup_printf("%c%s%c", ut ? '%':' ', r2->value.string, ut?'%':' ');
- char *safe = get_db_safe_string(tmp);
+ gchar *tmp = g_strdup_printf("%c%s%c", ut ? '%':' ', r2->value.string, ut?'%':' ');
+ gchar *safe = get_db_safe_string(tmp);
g_string_append_printf(str, "%s", safe);
g_free(safe);
g_free(tmp);
@@ -215,7 +215,7 @@ eval_eq(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
}
static ESExpResult *
-eval_lt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+eval_lt(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
{
struct _ESExpResult *r, *r1, *r2;
@@ -254,7 +254,7 @@ eval_lt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
/* this should support all arguments ...? */
static ESExpResult *
-eval_gt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+eval_gt(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
{
struct _ESExpResult *r, *r1, *r2;
@@ -292,7 +292,7 @@ eval_gt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
}
static ESExpResult *
-match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+match_all(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
{
ESExpResult *r;
@@ -310,10 +310,10 @@ match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
static ESExpResult *
-match_threads(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+match_threads(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
{
ESExpResult *r;
- int i;
+ gint i;
GString *str = g_string_new ("( ");
d(printf("executing match-threads: %d", argc));
@@ -333,17 +333,17 @@ match_threads(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
}
static ESExpResult *
-check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data, camel_search_match_t how)
+check_header (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data, camel_search_match_t how)
{
ESExpResult *r;
- char *str=NULL;
+ gchar *str=NULL;
d(printf("executing check-header %d\n", how));
/* are we inside a match-all? */
if (argc>1 && argv[0]->type == ESEXP_RES_STRING) {
- char *headername;
- int i;
+ gchar *headername;
+ gint i;
/* only a subset of headers are supported .. */
headername = camel_db_get_column_name (argv[0]->value.string);
@@ -351,7 +351,7 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
/* performs an OR of all words */
for (i=1;i<argc;i++) {
if (argv[i]->type == ESEXP_RES_STRING) {
- char *value=NULL, *tstr=NULL;
+ gchar *value=NULL, *tstr=NULL;
if (argv[i]->value.string[0] == 0)
continue;
if (how == CAMEL_SEARCH_MATCH_CONTAINS) {
@@ -386,7 +386,7 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
}
static ESExpResult *
-header_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+header_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
d(printf("executing header-contains: %d", argc));
@@ -394,7 +394,7 @@ header_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
}
static ESExpResult *
-header_matches(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+header_matches(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
d(printf("executing header-matches: %d", argc));
@@ -402,7 +402,7 @@ header_matches(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *dat
}
static ESExpResult *
-header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+header_starts_with (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
d(printf("executing header-starts-with: %d", argc));
@@ -410,7 +410,7 @@ header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, void
}
static ESExpResult *
-header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+header_ends_with (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
d(printf("executing header-ends-with: %d", argc));
@@ -419,10 +419,10 @@ header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *
static ESExpResult *
-header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+header_exists (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
- char *headername;
+ gchar *headername;
d(printf("executing header-exists: %d", argc));
@@ -434,7 +434,7 @@ header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *dat
}
static ESExpResult *
-user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+user_tag(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
@@ -454,10 +454,10 @@ user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
static ESExpResult *
-user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+user_flag(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
- char *tstr, *qstr;
+ gchar *tstr, *qstr;
d(printf("executing user-flag: %d", argc));
@@ -472,10 +472,10 @@ user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
}
static ESExpResult *
-system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+system_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
- char *tstr;
+ gchar *tstr;
d(printf("executing system-flag: %d", argc));
@@ -488,7 +488,7 @@ system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
}
static ESExpResult *
-get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+get_sent_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
@@ -501,7 +501,7 @@ get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
}
static ESExpResult *
-get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+get_received_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
@@ -514,7 +514,7 @@ get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *
}
static ESExpResult *
-get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+get_current_date(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
@@ -526,7 +526,7 @@ get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *d
}
static ESExpResult *
-get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+get_size (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
@@ -539,10 +539,10 @@ get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
}
static ESExpResult *
-sql_exp (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+sql_exp (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
{
ESExpResult *r;
- int i;
+ gint i;
GString *str = g_string_new (NULL);
d(printf("executing sql-exp\n"));
@@ -560,9 +560,9 @@ sql_exp (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
/* 'builtin' functions */
static struct {
- char *name;
+ gchar *name;
ESExpFunc *func;
- int immediate :1;
+ gint immediate :1;
} symbols[] = {
{ "and", (ESExpFunc *) func_and, 1 },
{ "or", (ESExpFunc *) func_or, 1},
@@ -592,13 +592,13 @@ static struct {
};
-char *
-camel_sexp_to_sql_sexp (const char *sql)
+gchar *
+camel_sexp_to_sql_sexp (const gchar *sql)
{
ESExp *sexp;
ESExpResult *r;
- int i;
- char *res;
+ gint i;
+ gchar *res;
sexp = e_sexp_new();
@@ -651,7 +651,7 @@ dreceived NUMERIC , (match-all (< (get-received-date) (- (get-curr
//followup_due_by TEXT ," //NOTREQD
*/
-char * camel_db_get_column_name (const char *raw_name)
+gchar * camel_db_get_column_name (const gchar *raw_name)
{
/* d(g_print ("\n\aRAW name is : [%s] \n\a", raw_name)); */
if (!g_ascii_strcasecmp (raw_name, "Subject"))
@@ -691,11 +691,11 @@ char * camel_db_get_column_name (const char *raw_name)
}
-int main ()
+gint main ()
{
- int i=0;
- char *txt[] = {
+ gint i=0;
+ gchar *txt[] = {
#if 0
"(match-all (header-contains \"From\" \"org\"))",
"(and (match-all (and (not (system-flag \"deleted\")) (not (system-flag \"junk\")))) (and (or (match-all (or (header-ends-with \"To\" \"novell.com\") (header-ends-with \"Cc\" \"novell.com\"))) (match-all (or (= (user-tag \"label\") \"work\") (user-flag \"work\"))) )))",
@@ -744,7 +744,7 @@ int main ()
};
for (i=0; i < G_N_ELEMENTS(txt); i++) {
- char *sql = NULL;
+ gchar *sql = NULL;
printf("Q: %s\n\"%c\"\n", txt[i], 40);
sql = camel_sexp_to_sql_sexp (txt[i]);
printf("A: %s\n\n\n", sql);
diff --git a/camel/camel-search-sql-sexp.h b/camel/camel-search-sql-sexp.h
index 1bcced0fd..acce35cbc 100644
--- a/camel/camel-search-sql-sexp.h
+++ b/camel/camel-search-sql-sexp.h
@@ -25,7 +25,7 @@
G_BEGIN_DECLS
/* FIXME: Weird naming, since, I want both parsers to be there for some time.*/
-char * camel_sexp_to_sql_sexp (const char *sexp);
+gchar * camel_sexp_to_sql_sexp (const gchar *sexp);
G_END_DECLS
diff --git a/camel/camel-search-sql.c b/camel/camel-search-sql.c
index e9e745100..a818d495d 100644
--- a/camel/camel-search-sql.c
+++ b/camel/camel-search-sql.c
@@ -38,16 +38,16 @@
#ifdef TEST_MAIN
#include <sqlite3.h>
-char * camel_db_get_column_name (const char *raw_name);
+gchar * camel_db_get_column_name (const gchar *raw_name);
-char *
-camel_db_sqlize_string (const char *string)
+gchar *
+camel_db_sqlize_string (const gchar *string)
{
return sqlite3_mprintf ("%Q", string);
}
void
-camel_db_free_sqlized_string (char *string)
+camel_db_free_sqlized_string (gchar *string)
{
sqlite3_free (string);
string = NULL;
@@ -55,7 +55,7 @@ camel_db_free_sqlized_string (char *string)
#else
#include "camel-db.h"
#endif
-char * escape_values (char *str);
+gchar * escape_values (gchar *str);
static GScannerConfig config =
{
@@ -96,21 +96,21 @@ static GScannerConfig config =
};
typedef struct Node {
- char *token; /* Token to search*/
- char *exact_token; /* Token to substitute */
- int nodes; /* Number of nodes to process */
- char pre_token; /* Pre token to prepend with value substitute*/
- char post_token; /* post token to apppend with substitute */
- char rval; /* rhs value for binary ops */
- int level; /* depth in the hier */
- int prefix:1 ; /* unary operator to be searched ?*/
- int sys_node:1 ; /* is it a predefined term ? */
- int ignore_lhs:1; /* ignore lhs value ?*/
- int swap :1;
- int prenode :1;
- int operator:1;
- int execute:1;
- int ref;
+ gchar *token; /* Token to search*/
+ gchar *exact_token; /* Token to substitute */
+ gint nodes; /* Number of nodes to process */
+ gchar pre_token; /* Pre token to prepend with value substitute*/
+ gchar post_token; /* post token to apppend with substitute */
+ gchar rval; /* rhs value for binary ops */
+ gint level; /* depth in the hier */
+ gint prefix:1 ; /* unary operator to be searched ?*/
+ gint sys_node:1 ; /* is it a predefined term ? */
+ gint ignore_lhs:1; /* ignore lhs value ?*/
+ gint swap :1;
+ gint prenode :1;
+ gint operator:1;
+ gint execute:1;
+ gint ref;
}Node;
/*
@@ -175,7 +175,7 @@ static void
g_list_dump (GList *l)
{
while (l) {
- printf("%s\t", (char *)l->data);
+ printf("%s\t", (gchar *)l->data);
l = l->next;
}
}
@@ -194,11 +194,11 @@ g_node_dump (GList *l)
}
-char *
-escape_values (char *str)
+gchar *
+escape_values (gchar *str)
{
- char *sql = camel_db_sqlize_string (g_strstrip(str));
- char *ret = g_strdup (sql);
+ gchar *sql = camel_db_sqlize_string (g_strstrip(str));
+ gchar *ret = g_strdup (sql);
camel_db_free_sqlized_string (sql);
/* I dont want to manage sql strings here */
@@ -214,12 +214,12 @@ escape_values (char *str)
* This is very specific to Evolution. It might crash is the sexp is invalid. The callers must ensure that the sexp is valid
**/
-char *
-camel_sexp_to_sql (const char *txt)
+gchar *
+camel_sexp_to_sql (const gchar *txt)
{
GScanner *scanner = g_scanner_new (&config);
- char *sql=NULL;
- int level = 0;
+ gchar *sql=NULL;
+ gint level = 0;
GList *tlist;
GList *operators=NULL, *operands=NULL, *all=NULL, *preserve=NULL;
GList *tmp;
@@ -235,12 +235,12 @@ camel_sexp_to_sql (const char *txt)
g_scanner_input_text (scanner, txt, strlen(txt));
while (!g_scanner_eof (scanner)) {
Node *mnode;
- int new_level = -1;
+ gint new_level = -1;
guint token = g_scanner_get_next_token (scanner);
/* Extract and identify tokens */
if (token == G_TOKEN_IDENTIFIER || token == G_TOKEN_STRING) {
- char *token = scanner->value.v_string;
+ gchar *token = scanner->value.v_string;
d(printf("token %s\n", token));
if (g_ascii_strcasecmp (token, "and") == 0 ||
@@ -258,7 +258,7 @@ camel_sexp_to_sql (const char *txt)
all = g_list_prepend (all, node);
} else {
/* Should be operand*/
- int i;
+ gint i;
Node *node;
for (i=0; i < G_N_ELEMENTS(elements); i++) {
@@ -359,9 +359,9 @@ camel_sexp_to_sql (const char *txt)
operators = g_list_prepend (operators, node);
all = g_list_prepend (all, node);
} else if (token == '+') {
- char *astr=NULL, *bstr=NULL;
+ gchar *astr=NULL, *bstr=NULL;
Node *node, *pnode = operands->data;
- int lvl=0, lval=0;
+ gint lvl=0, lval=0;
if (g_ascii_strcasecmp (pnode->token, "user-flag") == 0) {
/* Colloct all after '+' and append them to one token. Go till you find ')' */
@@ -419,9 +419,9 @@ camel_sexp_to_sql (const char *txt)
new_level = -1;
level--;
} else if (token == '-') {
- char *bstr=NULL;
+ gchar *bstr=NULL;
Node *node, *pnode = operands->data;
- int lvl=0, lval=0;
+ gint lvl=0, lval=0;
/* Colloct all after '+' and append them to one token. Go till you find ')' */
token = g_scanner_get_next_token (scanner) ;
@@ -506,7 +506,7 @@ camel_sexp_to_sql (const char *txt)
/* If we reach the operating level, which is the exec min for last seen sys-header */
if (mnode->nodes == 1) {
/* lets evaluate */
- int len = 2;
+ gint len = 2;
Node *pnode;
@@ -537,11 +537,11 @@ camel_sexp_to_sql (const char *txt)
pnode = NULL;
if (len == 3) {
- char *prefix = NULL;
- char *str, *sqstr, *escstr;
- int dyn_lvl;
+ gchar *prefix = NULL;
+ gchar *str, *sqstr, *escstr;
+ gint dyn_lvl;
Node *opnode = operators->data;
- char *temp_op="";
+ gchar *temp_op="";
if (n3->level < n2->level)
dyn_lvl = n2->level;
@@ -559,7 +559,7 @@ camel_sexp_to_sql (const char *txt)
if ((g_ascii_strcasecmp (n2->exact_token, "follow-up") == 0) ||
(g_ascii_strcasecmp (n2->exact_token, "completed-on") == 0)) {
/* swap */
- char *temp = n2->exact_token;
+ gchar *temp = n2->exact_token;
n2->exact_token = n1->exact_token;
n1->exact_token = temp;
temp = n2->exact_token;
@@ -593,7 +593,7 @@ camel_sexp_to_sql (const char *txt)
if ((g_ascii_strcasecmp (n2->exact_token, "follow-up") == 0) ||
(g_ascii_strcasecmp (n2->exact_token, "completed-on") == 0)) {
/* swap */
- char *temp = n2->exact_token;
+ gchar *temp = n2->exact_token;
n2->exact_token = n1->exact_token;
n1->exact_token = temp;
temp = n2->exact_token;
@@ -647,10 +647,10 @@ camel_sexp_to_sql (const char *txt)
d(printf("Pushed %s\n", n3->exact_token));
all = g_list_prepend (all, n3);
} else {
- char prefix = 0;
- char *str, *estr;
+ gchar prefix = 0;
+ gchar *str, *estr;
Node *opnode = operators ? operators->data : NULL;
- int dyn_lvl = n1->level;
+ gint dyn_lvl = n1->level;
if (n2->prefix && opnode && g_ascii_strcasecmp (opnode->token, "not") == 0) {
prefix = '!';
@@ -809,7 +809,7 @@ camel_sexp_to_sql (const char *txt)
} else {
/* 'not' is a valid single operand */
Node *n = res->data;
- char *str = g_strdup_printf("NOT ( %s )", n->exact_token);
+ gchar *str = g_strdup_printf("NOT ( %s )", n->exact_token);
g_free (n->exact_token);
n->exact_token = str;
all = g_list_prepend (all, n);
@@ -911,7 +911,7 @@ dreceived NUMERIC , (match-all (< (get-received-date) (- (get-curr
//followup_due_by TEXT ," //NOTREQD
*/
-char * camel_db_get_column_name (const char *raw_name)
+gchar * camel_db_get_column_name (const gchar *raw_name)
{
d(g_print ("\n\aRAW name is : [%s] \n\a", raw_name));
if (!g_ascii_strcasecmp (raw_name, "Subject"))
@@ -951,11 +951,11 @@ char * camel_db_get_column_name (const char *raw_name)
}
-int main ()
+gint main ()
{
- int i=0;
- char *txt[] = {
+ gint i=0;
+ gchar *txt[] = {
"(and (and (match-all (header-contains \"From\" \"org\")) ) (match-all (not (system-flag \"junk\"))))",
"(and (and (match-all (header-contains \"From\" \"org\"))) (and (match-all (not (system-flag \"junk\"))) (and (or (match-all (header-contains \"Subject\" \"test\")) (match-all (header-contains \"From\" \"test\"))))))",
"(and (and (match-all (header-exists \"From\")) ) (match-all (not (system-flag \"junk\"))))",
@@ -995,7 +995,7 @@ int main ()
};
for (i=0; i < G_N_ELEMENTS(txt); i++) {
- char *sql;
+ gchar *sql;
printf("Q: %s\n\n", txt[i]);
sql = camel_sexp_to_sql (txt[i]);
printf("A: %s\n\n\n", sql);
diff --git a/camel/camel-search-sql.h b/camel/camel-search-sql.h
index 845e0d177..f7421d33e 100644
--- a/camel/camel-search-sql.h
+++ b/camel/camel-search-sql.h
@@ -24,7 +24,7 @@
G_BEGIN_DECLS
-char * camel_sexp_to_sql (const char *sexp);
+gchar * camel_sexp_to_sql (const gchar *sexp);
G_END_DECLS
diff --git a/camel/camel-seekable-stream.c b/camel/camel-seekable-stream.c
index 8e93ceae6..f7883916c 100644
--- a/camel/camel-seekable-stream.c
+++ b/camel/camel-seekable-stream.c
@@ -35,8 +35,8 @@ static CamelStreamClass *parent_class = NULL;
static off_t seek (CamelSeekableStream *stream, off_t offset,
CamelStreamSeekPolicy policy);
static off_t stream_tell (CamelSeekableStream *stream);
-static int reset (CamelStream *stream);
-static int set_bounds (CamelSeekableStream *stream, off_t start, off_t end);
+static gint reset (CamelStream *stream);
+static gint set_bounds (CamelSeekableStream *stream, off_t start, off_t end);
static void
camel_seekable_stream_class_init (CamelSeekableStreamClass *camel_seekable_stream_class)
@@ -56,7 +56,7 @@ camel_seekable_stream_class_init (CamelSeekableStreamClass *camel_seekable_strea
}
static void
-camel_seekable_stream_init (void *o)
+camel_seekable_stream_init (gpointer o)
{
CamelSeekableStream *stream = (CamelSeekableStream *)o;
@@ -172,7 +172,7 @@ set_bounds (CamelSeekableStream *stream, off_t start, off_t end)
*
* Returns: %-1 on error.
**/
-int
+gint
camel_seekable_stream_set_bounds (CamelSeekableStream *stream,
off_t start, off_t end)
{
diff --git a/camel/camel-seekable-stream.h b/camel/camel-seekable-stream.h
index 04148c900..c5af67973 100644
--- a/camel/camel-seekable-stream.h
+++ b/camel/camel-seekable-stream.h
@@ -60,7 +60,7 @@ typedef struct {
off_t (*seek) (CamelSeekableStream *stream, off_t offset,
CamelStreamSeekPolicy policy);
off_t (*tell) (CamelSeekableStream *stream);
- int (*set_bounds) (CamelSeekableStream *stream,
+ gint (*set_bounds) (CamelSeekableStream *stream,
off_t start, off_t end);
} CamelSeekableStreamClass;
diff --git a/camel/camel-seekable-substream.c b/camel/camel-seekable-substream.c
index 2e02b29ff..a56e1d3e6 100644
--- a/camel/camel-seekable-substream.c
+++ b/camel/camel-seekable-substream.c
@@ -32,8 +32,8 @@ static CamelSeekableStreamClass *parent_class = NULL;
/* Returns the class for a CamelSeekableSubStream */
#define CSS_CLASS(so) CAMEL_SEEKABLE_SUBSTREAM_CLASS (CAMEL_OBJECT(so)->klass)
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
static int stream_flush (CamelStream *stream);
static int stream_close (CamelStream *stream);
static gboolean eos (CamelStream *stream);
@@ -143,7 +143,7 @@ parent_reset (CamelSeekableSubstream *seekable_substream, CamelSeekableStream *p
}
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelSeekableStream *parent;
CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM (stream);
@@ -180,7 +180,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelSeekableStream *parent;
CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM(stream);
diff --git a/camel/camel-service.c b/camel/camel-service.c
index c1505fcd7..25e449ac2 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -59,11 +59,11 @@ static gboolean service_disconnect(CamelService *service, gboolean clean,
CamelException *ex);
static void cancel_connect (CamelService *service);
static GList *query_auth_types (CamelService *service, CamelException *ex);
-static char *get_name (CamelService *service, gboolean brief);
-static char *get_path (CamelService *service);
+static gchar *get_name (CamelService *service, gboolean brief);
+static gchar *get_path (CamelService *service);
-static int service_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint service_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
static void
@@ -88,7 +88,7 @@ camel_service_class_init (CamelServiceClass *camel_service_class)
}
static void
-camel_service_init (void *o, void *k)
+camel_service_init (gpointer o, gpointer k)
{
CamelService *service = o;
@@ -155,7 +155,7 @@ service_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
CamelURL *url = service->url;
gboolean reconnect = FALSE;
guint32 tag;
- int i;
+ gint i;
for (i = 0; i < args->argc; i++) {
tag = args->argv[i].tag;
@@ -220,7 +220,7 @@ service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
CamelService *service = (CamelService *) object;
CamelURL *url = service->url;
guint32 tag;
- int i;
+ gint i;
for (i = 0; i < args->argc; i++) {
tag = args->argv[i].tag;
@@ -263,7 +263,7 @@ service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
static void
construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
{
- char *err, *url_string;
+ gchar *err, *url_string;
if (CAMEL_PROVIDER_NEEDS (provider, CAMEL_URL_PART_USER) &&
(url->user == NULL || url->user[0] == '\0')) {
@@ -415,7 +415,7 @@ camel_service_disconnect (CamelService *service, gboolean clean,
CamelException *ex)
{
gboolean res = TRUE;
- int unreg = FALSE;
+ gint unreg = FALSE;
CAMEL_SERVICE_REC_LOCK (service, connect_lock);
@@ -482,14 +482,14 @@ camel_service_cancel_connect (CamelService *service)
*
* Returns: the URL representing @service
**/
-char *
+gchar *
camel_service_get_url (CamelService *service)
{
return camel_url_to_string (service->url, CAMEL_URL_HIDE_PASSWORD);
}
-static char *
+static gchar *
get_name (CamelService *service, gboolean brief)
{
w(g_warning ("CamelService::get_name not implemented for '%s'",
@@ -510,7 +510,7 @@ get_name (CamelService *service, gboolean brief)
*
* Returns: a description of the service which the caller must free
**/
-char *
+gchar *
camel_service_get_name (CamelService *service, gboolean brief)
{
g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
@@ -520,13 +520,13 @@ camel_service_get_name (CamelService *service, gboolean brief)
}
-static char *
+static gchar *
get_path (CamelService *service)
{
CamelProvider *prov = service->provider;
CamelURL *url = service->url;
GString *gpath;
- char *path;
+ gchar *path;
/* A sort of ad-hoc default implementation that works for our
* current set of services.
@@ -575,7 +575,7 @@ get_path (CamelService *service)
*
* Returns: the path, which the caller must free
**/
-char *
+gchar *
camel_service_get_path (CamelService *service)
{
g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
diff --git a/camel/camel-service.h b/camel/camel-service.h
index 63d6309d9..bac314f5d 100644
--- a/camel/camel-service.h
+++ b/camel/camel-service.h
@@ -89,17 +89,17 @@ typedef struct {
GList * (*query_auth_types) (CamelService *service,
CamelException *ex);
- char * (*get_name) (CamelService *service,
+ gchar * (*get_name) (CamelService *service,
gboolean brief);
- char * (*get_path) (CamelService *service);
+ gchar * (*get_path) (CamelService *service);
} CamelServiceClass;
/* query_auth_types returns a GList of these */
typedef struct {
- char *name; /* user-friendly name */
- char *description;
- char *authproto;
+ gchar *name; /* user-friendly name */
+ gchar *description;
+ gchar *authproto;
gboolean need_password; /* needs a password to authenticate */
} CamelServiceAuthType;
@@ -116,10 +116,10 @@ gboolean camel_service_disconnect (CamelService *service,
gboolean clean,
CamelException *ex);
void camel_service_cancel_connect (CamelService *service);
-char * camel_service_get_url (CamelService *service);
-char * camel_service_get_name (CamelService *service,
+gchar * camel_service_get_url (CamelService *service);
+gchar * camel_service_get_name (CamelService *service,
gboolean brief);
-char * camel_service_get_path (CamelService *service);
+gchar * camel_service_get_path (CamelService *service);
CamelSession * camel_service_get_session (CamelService *service);
CamelProvider * camel_service_get_provider (CamelService *service);
GList * camel_service_query_auth_types (CamelService *service,
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 943d20946..5ffbe8c48 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -56,19 +56,19 @@
#define CS_CLASS(so) ((CamelSessionClass *)((CamelObject *)so)->klass)
static CamelService *get_service (CamelSession *session,
- const char *url_string,
+ const gchar *url_string,
CamelProviderType type,
CamelException *ex);
-static char *get_storage_path (CamelSession *session,
+static gchar *get_storage_path (CamelSession *session,
CamelService *service,
CamelException *ex);
-static void *session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size);
+static gpointer session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, guint size);
static void session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *msg);
-static int session_thread_queue(CamelSession *session, CamelSessionThreadMsg *msg, int flags);
-static void session_thread_wait(CamelSession *session, int id);
-static void session_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc);
-static void session_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex);
+static gint session_thread_queue(CamelSession *session, CamelSessionThreadMsg *msg, gint flags);
+static void session_thread_wait(CamelSession *session, gint id);
+static void session_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const gchar *text, gint pc);
+static void session_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const gchar *address, CamelException *ex);
static void
camel_session_init (CamelSession *session)
@@ -156,13 +156,13 @@ camel_session_get_type (void)
* Constructs @session.
**/
void
-camel_session_construct (CamelSession *session, const char *storage_path)
+camel_session_construct (CamelSession *session, const gchar *storage_path)
{
session->storage_path = g_strdup (storage_path);
}
static CamelService *
-get_service (CamelSession *session, const char *url_string,
+get_service (CamelSession *session, const gchar *url_string,
CamelProviderType type, CamelException *ex)
{
CamelURL *url;
@@ -236,7 +236,7 @@ get_service (CamelSession *session, const char *url_string,
* Returns: the requested #CamelService, or %NULL
**/
CamelService *
-camel_session_get_service (CamelSession *session, const char *url_string,
+camel_session_get_service (CamelSession *session, const gchar *url_string,
CamelProviderType type, CamelException *ex)
{
CamelService *service;
@@ -266,7 +266,7 @@ camel_session_get_service (CamelSession *session, const char *url_string,
**/
CamelService *
camel_session_get_service_connected (CamelSession *session,
- const char *url_string,
+ const gchar *url_string,
CamelProviderType type,
CamelException *ex)
{
@@ -287,10 +287,10 @@ camel_session_get_service_connected (CamelSession *session,
}
-static char *
+static gchar *
get_storage_path (CamelSession *session, CamelService *service, CamelException *ex)
{
- char *path, *p;
+ gchar *path, *p;
p = camel_service_get_path (service);
path = g_strdup_printf ("%s/%s", session->storage_path, p);
@@ -329,7 +329,7 @@ get_storage_path (CamelSession *session, CamelService *service, CamelException *
* Returns: the path (which the caller must free), or %NULL if an error
* occurs.
**/
-char *
+gchar *
camel_session_get_storage_path (CamelSession *session, CamelService *service,
CamelException *ex)
{
@@ -372,9 +372,9 @@ camel_session_get_storage_path (CamelSession *session, CamelService *service,
*
* Returns: the authentication information or %NULL
**/
-char *
+gchar *
camel_session_get_password (CamelSession *session, CamelService *service,
- const char *domain, const char *prompt, const char *item,
+ const gchar *domain, const gchar *prompt, const gchar *item,
guint32 flags,
CamelException *ex)
{
@@ -404,7 +404,7 @@ camel_session_get_password (CamelSession *session, CamelService *service,
**/
void
camel_session_forget_password (CamelSession *session, CamelService *service,
- const char *domain, const char *item, CamelException *ex)
+ const gchar *domain, const gchar *item, CamelException *ex)
{
g_return_if_fail (CAMEL_IS_SESSION (session));
g_return_if_fail (item != NULL);
@@ -429,7 +429,7 @@ camel_session_forget_password (CamelSession *session, CamelService *service,
*/
gboolean
camel_session_alert_user (CamelSession *session, CamelSessionAlertType type,
- const char *prompt, gboolean cancel)
+ const gchar *prompt, gboolean cancel)
{
g_return_val_if_fail (CAMEL_IS_SESSION (session), FALSE);
g_return_val_if_fail (prompt != NULL, FALSE);
@@ -438,7 +438,7 @@ camel_session_alert_user (CamelSession *session, CamelSessionAlertType type,
}
gboolean
-camel_session_lookup_addressbook (CamelSession *session, const char *name)
+camel_session_lookup_addressbook (CamelSession *session, const gchar *name)
{
g_return_val_if_fail (CAMEL_IS_SESSION (session), FALSE);
g_return_val_if_fail (name != NULL, FALSE);
@@ -457,14 +457,14 @@ camel_session_lookup_addressbook (CamelSession *session, const char *name)
*
* Returns: a newly-allocated password prompt string
**/
-char *
-camel_session_build_password_prompt (const char *type,
- const char *user,
- const char *host)
+gchar *
+camel_session_build_password_prompt (const gchar *type,
+ const gchar *user,
+ const gchar *host)
{
- char *user_markup;
- char *host_markup;
- char *prompt;
+ gchar *user_markup;
+ gchar *host_markup;
+ gchar *prompt;
g_return_val_if_fail (type != NULL, NULL);
g_return_val_if_fail (user != NULL, NULL);
@@ -527,24 +527,24 @@ camel_session_set_online (CamelSession *session, gboolean online)
**/
CamelFilterDriver *
camel_session_get_filter_driver (CamelSession *session,
- const char *type,
+ const gchar *type,
CamelException *ex)
{
return CS_CLASS (session)->get_filter_driver (session, type, ex);
}
static void
-cs_thread_status(CamelOperation *op, const char *what, int pc, void *data)
+cs_thread_status(CamelOperation *op, const gchar *what, gint pc, gpointer data)
{
CamelSessionThreadMsg *m = data;
CS_CLASS(m->session)->thread_status(m->session, m, what, pc);
}
-static void *
+static gpointer
session_thread_msg_new (CamelSession *session,
CamelSessionThreadOps *ops,
- unsigned int size)
+ guint size)
{
CamelSessionThreadMsg *m;
@@ -604,10 +604,10 @@ session_thread_proxy (CamelSessionThreadMsg *msg,
static int
session_thread_queue (CamelSession *session,
CamelSessionThreadMsg *msg,
- int flags)
+ gint flags)
{
GThreadPool *thread_pool;
- int id;
+ gint id;
CAMEL_SESSION_LOCK(session, thread_lock);
thread_pool = session->priv->thread_pool;
@@ -627,9 +627,9 @@ session_thread_queue (CamelSession *session,
static void
session_thread_wait (CamelSession *session,
- int id)
+ gint id)
{
- int wait;
+ gint wait;
/* we just busy wait, only other alternative is to setup a reply port? */
do {
@@ -645,8 +645,8 @@ session_thread_wait (CamelSession *session,
static void
session_thread_status (CamelSession *session,
CamelSessionThreadMsg *msg,
- const char *text,
- int pc)
+ const gchar *text,
+ gint pc)
{
}
@@ -664,10 +664,10 @@ session_thread_status (CamelSession *session,
*
* Returns: a new #CamelSessionThreadMsg
**/
-void *
+gpointer
camel_session_thread_msg_new (CamelSession *session,
CamelSessionThreadOps *ops,
- unsigned int size)
+ guint size)
{
g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
g_return_val_if_fail (ops != NULL, NULL);
@@ -706,10 +706,10 @@ camel_session_thread_msg_free (CamelSession *session,
*
* Returns: the id of the operation queued
**/
-int
+gint
camel_session_thread_queue (CamelSession *session,
CamelSessionThreadMsg *msg,
- int flags)
+ gint flags)
{
g_return_val_if_fail (CAMEL_IS_SESSION (session), -1);
g_return_val_if_fail (msg != NULL, -1);
@@ -726,7 +726,7 @@ camel_session_thread_queue (CamelSession *session,
**/
void
camel_session_thread_wait (CamelSession *session,
- int id)
+ gint id)
{
g_return_if_fail (CAMEL_IS_SESSION (session));
@@ -787,11 +787,11 @@ camel_session_set_network_state (CamelSession *session,
void
camel_session_set_junk_headers (CamelSession *session,
- const char **headers,
- const char **values,
- int len)
+ const gchar **headers,
+ const gchar **values,
+ gint len)
{
- int i;
+ gint i;
g_return_if_fail (CAMEL_IS_SESSION (session));
@@ -816,7 +816,7 @@ camel_session_get_junk_headers (CamelSession *session)
}
static void
-session_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex)
+session_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const gchar *address, CamelException *ex)
{
if (ex)
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Camel session doesn't support forwarding of a message."));
@@ -832,7 +832,7 @@ session_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage
* @ex Exception.
**/
void
-camel_session_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex)
+camel_session_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const gchar *address, CamelException *ex)
{
g_return_if_fail (CAMEL_IS_SESSION (session));
diff --git a/camel/camel-session.h b/camel/camel-session.h
index b7449c9f7..b7b3f7010 100644
--- a/camel/camel-session.h
+++ b/camel/camel-session.h
@@ -58,7 +58,7 @@ struct _CamelSession
CamelObject parent_object;
struct _CamelSessionPrivate *priv;
- char *storage_path;
+ gchar *storage_path;
CamelJunkPlugin *junk_plugin;
guint online:1;
@@ -73,55 +73,55 @@ typedef struct {
CamelObjectClass parent_class;
CamelService * (*get_service) (CamelSession *session,
- const char *url_string,
+ const gchar *url_string,
CamelProviderType type,
CamelException *ex);
- char * (*get_storage_path) (CamelSession *session,
+ gchar * (*get_storage_path) (CamelSession *session,
CamelService *service,
CamelException *ex);
- char * (*get_password) (CamelSession *session,
+ gchar * (*get_password) (CamelSession *session,
CamelService *service,
- const char *domain,
- const char *prompt,
- const char *item,
+ const gchar *domain,
+ const gchar *prompt,
+ const gchar *item,
guint32 flags,
CamelException *ex);
void (*forget_password) (CamelSession *session,
CamelService *service,
- const char *domain,
- const char *item,
+ const gchar *domain,
+ const gchar *item,
CamelException *ex);
gboolean (*alert_user) (CamelSession *session,
CamelSessionAlertType type,
- const char *prompt,
+ const gchar *prompt,
gboolean cancel);
CamelFilterDriver * (*get_filter_driver) (CamelSession *session,
- const char *type,
+ const gchar *type,
CamelException *ex);
/* mechanism for creating and maintaining multiple threads of control */
- void * (*thread_msg_new) (CamelSession *session,
+ gpointer (*thread_msg_new) (CamelSession *session,
CamelSessionThreadOps *ops,
- unsigned int size);
+ guint size);
void (*thread_msg_free) (CamelSession *session,
CamelSessionThreadMsg *msg);
- int (*thread_queue) (CamelSession *session,
+ gint (*thread_queue) (CamelSession *session,
CamelSessionThreadMsg *msg,
- int flags);
+ gint flags);
void (*thread_wait) (CamelSession *session,
- int id);
+ gint id);
void (*thread_status) (CamelSession *session,
CamelSessionThreadMsg *msg,
- const char *text,
- int pc);
+ const gchar *text,
+ gint pc);
gboolean (*lookup_addressbook)(CamelSession *session,
- const char *name);
+ const gchar *name);
void (*forward_to) (CamelSession *session,
struct _CamelFolder *folder,
struct _CamelMimeMessage *message,
- const char *address,
+ const gchar *address,
CamelException *ex);
} CamelSessionClass;
@@ -133,14 +133,14 @@ CamelType camel_session_get_type (void);
void camel_session_construct (CamelSession *session,
- const char *storage_path);
+ const gchar *storage_path);
CamelService * camel_session_get_service (CamelSession *session,
- const char *url_string,
+ const gchar *url_string,
CamelProviderType type,
CamelException *ex);
CamelService * camel_session_get_service_connected (CamelSession *session,
- const char *url_string,
+ const gchar *url_string,
CamelProviderType type,
CamelException *ex);
@@ -151,38 +151,38 @@ CamelService * camel_session_get_service_connected (CamelSession *session,
((CamelTransport *) camel_session_get_service_connected \
(session, url_string, CAMEL_PROVIDER_TRANSPORT, ex))
-char * camel_session_get_storage_path (CamelSession *session,
+gchar * camel_session_get_storage_path (CamelSession *session,
CamelService *service,
CamelException *ex);
-char * camel_session_get_password (CamelSession *session,
+gchar * camel_session_get_password (CamelSession *session,
CamelService *service,
- const char *domain,
- const char *prompt,
- const char *item,
+ const gchar *domain,
+ const gchar *prompt,
+ const gchar *item,
guint32 flags,
CamelException *ex);
void camel_session_forget_password (CamelSession *session,
CamelService *service,
- const char *domain,
- const char *item,
+ const gchar *domain,
+ const gchar *item,
CamelException *ex);
gboolean camel_session_alert_user (CamelSession *session,
CamelSessionAlertType type,
- const char *prompt,
+ const gchar *prompt,
gboolean cancel);
-char * camel_session_build_password_prompt
- (const char *type,
- const char *user,
- const char *host);
+gchar * camel_session_build_password_prompt
+ (const gchar *type,
+ const gchar *user,
+ const gchar *host);
gboolean camel_session_is_online (CamelSession *session);
void camel_session_set_online (CamelSession *session,
gboolean online);
CamelFilterDriver *camel_session_get_filter_driver (CamelSession *session,
- const char *type,
+ const gchar *type,
CamelException *ex);
gboolean camel_session_check_junk (CamelSession *session);
@@ -197,42 +197,42 @@ struct _CamelSessionThreadOps {
struct _CamelSessionThreadMsg {
CamelMsg msg;
- int id;
+ gint id;
CamelException ex;
CamelSessionThreadOps *ops;
struct _CamelOperation *op;
CamelSession *session;
- void *data; /* free for implementation to define, not used by camel, do not use in client code */
+ gpointer data; /* free for implementation to define, not used by camel, do not use in client code */
/* user fields follow */
};
-void * camel_session_thread_msg_new (CamelSession *session,
+gpointer camel_session_thread_msg_new (CamelSession *session,
CamelSessionThreadOps *ops,
- unsigned int size);
+ guint size);
void camel_session_thread_msg_free (CamelSession *session,
CamelSessionThreadMsg *msg);
-int camel_session_thread_queue (CamelSession *session,
+gint camel_session_thread_queue (CamelSession *session,
CamelSessionThreadMsg *msg,
- int flags);
+ gint flags);
void camel_session_thread_wait (CamelSession *session,
- int id);
+ gint id);
gboolean camel_session_get_network_state (CamelSession *session);
void camel_session_set_network_state (CamelSession *session,
gboolean network_state);
const GHashTable * camel_session_get_junk_headers (CamelSession *session);
void camel_session_set_junk_headers (CamelSession *session,
- const char **headers,
- const char **values,
- int len);
+ const gchar **headers,
+ const gchar **values,
+ gint len);
gboolean camel_session_lookup_addressbook (CamelSession *session,
- const char *name);
+ const gchar *name);
void camel_session_forward_to (CamelSession *session,
struct _CamelFolder *folder,
struct _CamelMimeMessage *message,
- const char *address,
+ const gchar *address,
CamelException *ex);
G_END_DECLS
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index b7f14ae16..a6724062f 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -65,24 +65,24 @@
struct _CamelSMIMEContextPrivate {
CERTCertDBHandle *certdb;
- char *encrypt_key;
+ gchar *encrypt_key;
camel_smime_sign_t sign_mode;
- int password_tries;
- unsigned int send_encrypt_key_prefs:1;
+ gint password_tries;
+ guint send_encrypt_key_prefs:1;
};
static CamelCipherContextClass *parent_class = NULL;
/* used for decode content callback, for streaming decode */
static void
-sm_write_stream(void *arg, const char *buf, unsigned long len)
+sm_write_stream(gpointer arg, const gchar *buf, unsigned long len)
{
camel_stream_write((CamelStream *)arg, buf, len);
}
static PK11SymKey *
-sm_decrypt_key(void *arg, SECAlgorithmID *algid)
+sm_decrypt_key(gpointer arg, SECAlgorithmID *algid)
{
printf("Decrypt key called\n");
return (PK11SymKey *)arg;
@@ -114,7 +114,7 @@ camel_smime_context_new(CamelSession *session)
}
void
-camel_smime_context_set_encrypt_key(CamelSMIMEContext *context, gboolean use, const char *key)
+camel_smime_context_set_encrypt_key(CamelSMIMEContext *context, gboolean use, const gchar *key)
{
context->priv->send_encrypt_key_prefs = use;
g_free(context->priv->encrypt_key);
@@ -134,7 +134,7 @@ camel_smime_context_describe_part(CamelSMIMEContext *context, CamelMimePart *par
{
guint32 flags = 0;
CamelContentType *ct;
- const char *tmp;
+ const gchar *tmp;
if (!part)
return flags;
@@ -162,7 +162,7 @@ camel_smime_context_describe_part(CamelSMIMEContext *context, CamelMimePart *par
NULL, NULL, /* password callback */
NULL, NULL); /* decrypt key callback */
- NSS_CMSDecoder_Update(dec, (char *) istream->buffer->data, istream->buffer->len);
+ NSS_CMSDecoder_Update(dec, (gchar *) istream->buffer->data, istream->buffer->len);
camel_object_unref(istream);
cmsg = NSS_CMSDecoder_Finish(dec);
@@ -191,7 +191,7 @@ camel_smime_context_describe_part(CamelSMIMEContext *context, CamelMimePart *par
return flags;
}
-static const char *
+static const gchar *
sm_hash_to_id(CamelCipherContext *context, CamelCipherHash hash)
{
switch(hash) {
@@ -206,7 +206,7 @@ sm_hash_to_id(CamelCipherContext *context, CamelCipherHash hash)
}
static CamelCipherHash
-sm_id_to_hash(CamelCipherContext *context, const char *id)
+sm_id_to_hash(CamelCipherContext *context, const gchar *id)
{
if (id) {
if (!strcmp(id, "md5"))
@@ -218,7 +218,7 @@ sm_id_to_hash(CamelCipherContext *context, const char *id)
return CAMEL_CIPHER_HASH_DEFAULT;
}
-static const char *
+static const gchar *
nss_error_to_string (long errorcode)
{
#define cs(a,b) case a: return b;
@@ -405,7 +405,7 @@ nss_error_to_string (long errorcode)
}
static void
-set_nss_error (CamelException *ex, const char *def_error)
+set_nss_error (CamelException *ex, const gchar *def_error)
{
long err_code;
@@ -416,7 +416,7 @@ set_nss_error (CamelException *ex, const char *def_error)
if (!err_code) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, def_error);
} else {
- const char *err_str;
+ const gchar *err_str;
err_str = nss_error_to_string (err_code);
if (!err_str)
@@ -427,7 +427,7 @@ set_nss_error (CamelException *ex, const char *def_error)
}
static NSSCMSMessage *
-sm_signing_cmsmessage(CamelSMIMEContext *context, const char *nick, SECOidTag hash, int detached, CamelException *ex)
+sm_signing_cmsmessage(CamelSMIMEContext *context, const gchar *nick, SECOidTag hash, gint detached, CamelException *ex)
{
struct _CamelSMIMEContextPrivate *p = context->priv;
NSSCMSMessage *cmsg = NULL;
@@ -437,7 +437,7 @@ sm_signing_cmsmessage(CamelSMIMEContext *context, const char *nick, SECOidTag ha
CERTCertificate *cert= NULL, *ekpcert = NULL;
if ((cert = CERT_FindUserCertByUsage(p->certdb,
- (char *)nick,
+ (gchar *)nick,
certUsageEmailSigner,
PR_FALSE,
NULL)) == NULL) {
@@ -515,7 +515,7 @@ sm_signing_cmsmessage(CamelSMIMEContext *context, const char *nick, SECOidTag ha
} else {
/* encrypt key uses same nick */
if ((ekpcert = CERT_FindUserCertByUsage(
- p->certdb, (char *)nick,
+ p->certdb, (gchar *)nick,
certUsageEmailRecipient, PR_FALSE, NULL)) == NULL) {
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Encryption certificate for '%s' does not exist"), nick);
goto fail;
@@ -564,9 +564,9 @@ fail:
}
static int
-sm_sign(CamelCipherContext *context, const char *userid, CamelCipherHash hash, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
+sm_sign(CamelCipherContext *context, const gchar *userid, CamelCipherHash hash, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
{
- int res = -1;
+ gint res = -1;
NSSCMSMessage *cmsg;
CamelStream *ostream, *istream;
SECOidTag sechash;
@@ -614,7 +614,7 @@ sm_sign(CamelCipherContext *context, const char *userid, CamelCipherHash hash, C
goto fail;
}
- if (NSS_CMSEncoder_Update(enc, (char *) ((CamelStreamMem *)istream)->buffer->data, ((CamelStreamMem *)istream)->buffer->len) != SECSuccess) {
+ if (NSS_CMSEncoder_Update(enc, (gchar *) ((CamelStreamMem *)istream)->buffer->data, ((CamelStreamMem *)istream)->buffer->len) != SECSuccess) {
NSS_CMSEncoder_Cancel(enc);
set_nss_error (ex, _("Failed to add data to CMS encoder"));
goto fail;
@@ -685,7 +685,7 @@ fail:
return res;
}
-static const char *
+static const gchar *
sm_status_description(NSSCMSVerificationStatus status)
{
/* could use this but then we can't control i18n? */
@@ -725,7 +725,7 @@ sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *ex
NSSCMSEncryptedData *encd;
SECAlgorithmID **digestalgs;
NSSCMSDigestContext *digcx;
- int count, i, nsigners, j;
+ gint count, i, nsigners, j;
SECItem **digests;
PLArenaPool *poolp = NULL;
CamelStreamMem *mem;
@@ -744,7 +744,7 @@ sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *ex
for (i = 0; i < count; i++) {
NSSCMSContentInfo *cinfo = NSS_CMSMessage_ContentLevel(cmsg, i);
SECOidTag typetag = NSS_CMSContentInfo_GetContentTypeTag(cinfo);
- int which_digest;
+ gint which_digest;
switch (typetag) {
case SEC_OID_PKCS7_SIGNED_DATA:
@@ -827,7 +827,7 @@ sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *ex
for (j = 0; j < nsigners; j++) {
NSSCMSSignerInfo *si;
- char *cn, *em;
+ gchar *cn, *em;
si = NSS_CMSSignedData_GetSignerInfo(sigd, j);
NSS_CMSSignedData_VerifySignerInfo(sigd, j, p->certdb, certUsageEmailSigner);
@@ -888,7 +888,7 @@ sm_verify(CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
CamelStream *constream = NULL;
CamelCipherValidity *valid = NULL;
CamelContentType *ct;
- const char *tmp;
+ const gchar *tmp;
CamelMimePart *sigpart;
CamelDataWrapper *dw;
@@ -935,7 +935,7 @@ sm_verify(CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
NULL, NULL); /* decrypt key callback */
camel_data_wrapper_decode_to_stream(camel_medium_get_content_object((CamelMedium *)sigpart), (CamelStream *)mem);
- (void)NSS_CMSDecoder_Update(dec, (char *) mem->buffer->data, mem->buffer->len);
+ (void)NSS_CMSDecoder_Update(dec, (gchar *) mem->buffer->data, mem->buffer->len);
cmsg = NSS_CMSDecoder_Finish(dec);
if (cmsg == NULL) {
set_nss_error (ex, _("Decoder failed"));
@@ -954,7 +954,7 @@ fail:
}
static int
-sm_encrypt(CamelCipherContext *context, const char *userid, GPtrArray *recipients, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
+sm_encrypt(CamelCipherContext *context, const gchar *userid, GPtrArray *recipients, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
{
struct _CamelSMIMEContextPrivate *p = ((CamelSMIMEContext *)context)->priv;
/*NSSCMSRecipientInfo **recipient_infos;*/
@@ -962,7 +962,7 @@ sm_encrypt(CamelCipherContext *context, const char *userid, GPtrArray *recipient
NSSCMSContentInfo *cinfo;
PK11SymKey *bulkkey = NULL;
SECOidTag bulkalgtag;
- int bulkkeysize, i;
+ gint bulkkeysize, i;
CK_MECHANISM_TYPE type;
PK11SlotInfo *slot;
PLArenaPool *poolp;
@@ -1070,7 +1070,7 @@ sm_encrypt(CamelCipherContext *context, const char *userid, GPtrArray *recipient
/* FIXME: Canonicalise the input? */
mem = (CamelStreamMem *)camel_stream_mem_new();
camel_data_wrapper_write_to_stream((CamelDataWrapper *)ipart, (CamelStream *)mem);
- if (NSS_CMSEncoder_Update(enc, (char *) mem->buffer->data, mem->buffer->len) != SECSuccess) {
+ if (NSS_CMSEncoder_Update(enc, (gchar *) mem->buffer->data, mem->buffer->len) != SECSuccess) {
NSS_CMSEncoder_Cancel(enc);
camel_object_unref(mem);
set_nss_error (ex, _("Failed to add data to encoder"));
@@ -1153,7 +1153,7 @@ sm_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *opa
NULL, NULL,
NULL, NULL); /* decrypt key callback */
- if (NSS_CMSDecoder_Update(dec, (char *) istream->buffer->data, istream->buffer->len) != SECSuccess) {
+ if (NSS_CMSDecoder_Update(dec, (gchar *) istream->buffer->data, istream->buffer->len) != SECSuccess) {
cmsg = NULL;
} else {
cmsg = NSS_CMSDecoder_Finish(dec);
diff --git a/camel/camel-smime-context.h b/camel/camel-smime-context.h
index ba704a65c..2275a6481 100644
--- a/camel/camel-smime-context.h
+++ b/camel/camel-smime-context.h
@@ -63,7 +63,7 @@ CamelType camel_smime_context_get_type(void);
CamelCipherContext *camel_smime_context_new(CamelSession *session);
/* nick to use for SMIMEEncKeyPrefs attribute for signed data */
-void camel_smime_context_set_encrypt_key(CamelSMIMEContext *context, gboolean use, const char *key);
+void camel_smime_context_set_encrypt_key(CamelSMIMEContext *context, gboolean use, const gchar *key);
/* set signing mode, clearsigned multipart/signed or enveloped */
void camel_smime_context_set_sign_mode(CamelSMIMEContext *context, camel_smime_sign_t type);
diff --git a/camel/camel-store-summary.c b/camel/camel-store-summary.c
index a9bd2ece1..9d7270f1a 100644
--- a/camel/camel-store-summary.c
+++ b/camel/camel-store-summary.c
@@ -54,16 +54,16 @@
#define _PRIVATE(o) (((CamelStoreSummary *)(o))->priv)
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
+static gint summary_header_load(CamelStoreSummary *, FILE *);
+static gint summary_header_save(CamelStoreSummary *, FILE *);
-static CamelStoreInfo * store_info_new(CamelStoreSummary *, const char *);
+static CamelStoreInfo * store_info_new(CamelStoreSummary *, const gchar *);
static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-static const char *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
-static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
+static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
+static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
static void camel_store_summary_class_init (CamelStoreSummaryClass *klass);
static void camel_store_summary_init (CamelStoreSummary *obj);
@@ -179,7 +179,7 @@ camel_store_summary_new (void)
* Set the filename where the summary will be loaded to/saved from.
**/
void
-camel_store_summary_set_filename(CamelStoreSummary *s, const char *name)
+camel_store_summary_set_filename(CamelStoreSummary *s, const gchar *name)
{
CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
@@ -216,9 +216,9 @@ camel_store_summary_set_uri_base(CamelStoreSummary *s, CamelURL *base)
*
* Get the number of summary items stored in this summary.
*
- * Returns: the number of items int he summary.
+ * Returns: the number of items gint he summary.
**/
-int
+gint
camel_store_summary_count(CamelStoreSummary *s)
{
return s->folders->len;
@@ -240,7 +240,7 @@ camel_store_summary_count(CamelStoreSummary *s)
* Returns: the summary item, or %NULL if @index is out of range
**/
CamelStoreInfo *
-camel_store_summary_index(CamelStoreSummary *s, int i)
+camel_store_summary_index(CamelStoreSummary *s, gint i)
{
CamelStoreInfo *info = NULL;
@@ -277,7 +277,7 @@ camel_store_summary_array(CamelStoreSummary *s)
{
CamelStoreInfo *info;
GPtrArray *res = g_ptr_array_new();
- int i;
+ gint i;
CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
@@ -305,7 +305,7 @@ camel_store_summary_array(CamelStoreSummary *s)
void
camel_store_summary_array_free(CamelStoreSummary *s, GPtrArray *array)
{
- int i;
+ gint i;
for (i=0;i<array->len;i++)
camel_store_summary_info_free(s, array->pdata[i]);
@@ -330,7 +330,7 @@ camel_store_summary_array_free(CamelStoreSummary *s, GPtrArray *array)
* available
**/
CamelStoreInfo *
-camel_store_summary_path(CamelStoreSummary *s, const char *path)
+camel_store_summary_path(CamelStoreSummary *s, const gchar *path)
{
CamelStoreInfo *info;
@@ -357,11 +357,11 @@ camel_store_summary_path(CamelStoreSummary *s, const char *path)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_store_summary_load(CamelStoreSummary *s)
{
FILE *in;
- int i;
+ gint i;
CamelStoreInfo *info;
g_assert(s->summary_path);
@@ -414,12 +414,12 @@ error:
*
* Returns: %0 on succes or %-1 on fail
**/
-int
+gint
camel_store_summary_save(CamelStoreSummary *s)
{
FILE *out;
- int fd;
- int i;
+ gint fd;
+ gint i;
guint32 count;
CamelStoreInfo *info;
@@ -496,11 +496,11 @@ camel_store_summary_save(CamelStoreSummary *s)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_store_summary_header_load(CamelStoreSummary *s)
{
FILE *in;
- int ret;
+ gint ret;
g_assert(s->summary_path);
@@ -545,7 +545,7 @@ camel_store_summary_add(CamelStoreSummary *s, CamelStoreInfo *info)
CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
g_ptr_array_add(s->folders, info);
- g_hash_table_insert(s->folders_path, (char *)camel_store_info_path(s, info), info);
+ g_hash_table_insert(s->folders_path, (gchar *)camel_store_info_path(s, info), info);
s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
@@ -562,7 +562,7 @@ camel_store_summary_add(CamelStoreSummary *s, CamelStoreInfo *info)
* Returns: the newly added record
**/
CamelStoreInfo *
-camel_store_summary_add_from_path(CamelStoreSummary *s, const char *path)
+camel_store_summary_add_from_path(CamelStoreSummary *s, const gchar *path)
{
CamelStoreInfo *info;
@@ -575,7 +575,7 @@ camel_store_summary_add_from_path(CamelStoreSummary *s, const char *path)
} else {
info = camel_store_summary_info_new_from_path(s, path);
g_ptr_array_add(s->folders, info);
- g_hash_table_insert(s->folders_path, (char *)camel_store_info_path(s, info), info);
+ g_hash_table_insert(s->folders_path, (gchar *)camel_store_info_path(s, info), info);
s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
}
@@ -599,7 +599,7 @@ camel_store_summary_add_from_path(CamelStoreSummary *s, const char *path)
* Returns: the #CamelStoreInfo associated with @path
**/
CamelStoreInfo *
-camel_store_summary_info_new_from_path(CamelStoreSummary *s, const char *path)
+camel_store_summary_info_new_from_path(CamelStoreSummary *s, const gchar *path)
{
return ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_new(s, path);
}
@@ -679,7 +679,7 @@ camel_store_summary_touch(CamelStoreSummary *s)
void
camel_store_summary_clear(CamelStoreSummary *s)
{
- int i;
+ gint i;
CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
if (camel_store_summary_count(s) == 0) {
@@ -726,14 +726,14 @@ camel_store_summary_remove(CamelStoreSummary *s, CamelStoreInfo *info)
* Remove a specific info record from the summary, by @path.
**/
void
-camel_store_summary_remove_path(CamelStoreSummary *s, const char *path)
+camel_store_summary_remove_path(CamelStoreSummary *s, const gchar *path)
{
CamelStoreInfo *oldinfo;
- char *oldpath;
+ gchar *oldpath;
CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- if (g_hash_table_lookup_extended(s->folders_path, path, (void *)&oldpath, (void *)&oldinfo)) {
+ if (g_hash_table_lookup_extended(s->folders_path, path, (gpointer)&oldpath, (gpointer)&oldinfo)) {
/* make sure it doesn't vanish while we're removing it */
oldinfo->refcount++;
CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
@@ -755,7 +755,7 @@ camel_store_summary_remove_path(CamelStoreSummary *s, const char *path)
* Remove a specific info record from the summary, by index.
**/
void
-camel_store_summary_remove_index(CamelStoreSummary *s, int index)
+camel_store_summary_remove_index(CamelStoreSummary *s, gint index)
{
CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
if (index < s->folders->len) {
@@ -847,8 +847,8 @@ camel_store_summary_info_new(CamelStoreSummary *s)
*
* Returns: the string value
**/
-const char *
-camel_store_info_string(CamelStoreSummary *s, const CamelStoreInfo *info, int type)
+const gchar *
+camel_store_info_string(CamelStoreSummary *s, const CamelStoreInfo *info, gint type)
{
return ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_string(s, info, type);
}
@@ -864,13 +864,13 @@ camel_store_info_string(CamelStoreSummary *s, const CamelStoreInfo *info, int ty
* Set a specific string on the @info.
**/
void
-camel_store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *info, int type, const char *value)
+camel_store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *info, gint type, const gchar *value)
{
((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_set_string(s, info, type, value);
}
static CamelStoreInfo *
-store_info_new(CamelStoreSummary *s, const char *f)
+store_info_new(CamelStoreSummary *s, const gchar *f)
{
CamelStoreInfo *info;
@@ -943,10 +943,10 @@ store_info_free(CamelStoreSummary *s, CamelStoreInfo *info)
g_slice_free1(s->store_info_size, info);
}
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *info, int type)
+static const gchar *
+store_info_string(CamelStoreSummary *s, const CamelStoreInfo *info, gint type)
{
- const char *p;
+ const gchar *p;
/* FIXME: Locks? */
@@ -976,28 +976,28 @@ store_info_string(CamelStoreSummary *s, const CamelStoreInfo *info, int type)
}
static void
-store_info_set_string (CamelStoreSummary *s, CamelStoreInfo *info, int type, const char *str)
+store_info_set_string (CamelStoreSummary *s, CamelStoreInfo *info, gint type, const gchar *str)
{
- const char *p;
- char *v;
- int len;
+ const gchar *p;
+ gchar *v;
+ gint len;
g_assert (info != NULL);
switch(type) {
case CAMEL_STORE_INFO_PATH:
CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- g_hash_table_remove(s->folders_path, (char *)camel_store_info_path(s, info));
+ g_hash_table_remove(s->folders_path, (gchar *)camel_store_info_path(s, info));
g_free(info->path);
g_free(info->uri);
info->path = g_strdup(str);
- g_hash_table_insert(s->folders_path, (char *)camel_store_info_path(s, info), info);
+ g_hash_table_insert(s->folders_path, (gchar *)camel_store_info_path(s, info), info);
s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
break;
case CAMEL_STORE_INFO_NAME:
CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- g_hash_table_remove(s->folders_path, (char *)camel_store_info_path(s, info));
+ g_hash_table_remove(s->folders_path, (gchar *)camel_store_info_path(s, info));
p = strrchr(info->path, '/');
if (p) {
len = p-info->path+1;
@@ -1009,7 +1009,7 @@ store_info_set_string (CamelStoreSummary *s, CamelStoreInfo *info, int type, con
}
g_free(info->path);
info->path = v;
- g_hash_table_insert(s->folders_path, (char *)camel_store_info_path(s, info), info);
+ g_hash_table_insert(s->folders_path, (gchar *)camel_store_info_path(s, info), info);
CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
break;
case CAMEL_STORE_INFO_URI:
diff --git a/camel/camel-store-summary.h b/camel/camel-store-summary.h
index 7c3a0a08d..f28f8e7c5 100644
--- a/camel/camel-store-summary.h
+++ b/camel/camel-store-summary.h
@@ -73,8 +73,8 @@ enum {
struct _CamelStoreInfo {
guint32 refcount;
- char *uri;
- char *path;
+ gchar *uri;
+ gchar *path;
guint32 flags;
guint32 unread;
guint32 total;
@@ -103,7 +103,7 @@ struct _CamelStoreSummary {
/* memory allocators (setup automatically) */
struct _EMemChunk *store_info_chunks;
- char *summary_path;
+ gchar *summary_path;
GPtrArray *folders; /* CamelStoreInfo's */
GHashTable *folders_path; /* CamelStoreInfo's by path name */
@@ -113,32 +113,32 @@ struct _CamelStoreSummaryClass {
CamelObjectClass parent_class;
/* load/save the global info */
- int (*summary_header_load)(CamelStoreSummary *, FILE *);
- int (*summary_header_save)(CamelStoreSummary *, FILE *);
+ gint (*summary_header_load)(CamelStoreSummary *, FILE *);
+ gint (*summary_header_save)(CamelStoreSummary *, FILE *);
/* create/save/load an individual message info */
- CamelStoreInfo * (*store_info_new)(CamelStoreSummary *, const char *path);
+ CamelStoreInfo * (*store_info_new)(CamelStoreSummary *, const gchar *path);
CamelStoreInfo * (*store_info_load)(CamelStoreSummary *, FILE *);
int (*store_info_save)(CamelStoreSummary *, FILE *, CamelStoreInfo *);
void (*store_info_free)(CamelStoreSummary *, CamelStoreInfo *);
/* virtualise access methods */
- const char *(*store_info_string)(CamelStoreSummary *, const CamelStoreInfo *, int);
- void (*store_info_set_string)(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
+ const gchar *(*store_info_string)(CamelStoreSummary *, const CamelStoreInfo *, int);
+ void (*store_info_set_string)(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
};
CamelType camel_store_summary_get_type (void);
CamelStoreSummary *camel_store_summary_new (void);
-void camel_store_summary_set_filename(CamelStoreSummary *summary, const char *filename);
+void camel_store_summary_set_filename(CamelStoreSummary *summary, const gchar *filename);
void camel_store_summary_set_uri_base(CamelStoreSummary *summary, CamelURL *base);
/* load/save the summary in its entirety */
-int camel_store_summary_load(CamelStoreSummary *summary);
-int camel_store_summary_save(CamelStoreSummary *summary);
+gint camel_store_summary_load(CamelStoreSummary *summary);
+gint camel_store_summary_save(CamelStoreSummary *summary);
/* only load the header */
-int camel_store_summary_header_load(CamelStoreSummary *summary);
+gint camel_store_summary_header_load(CamelStoreSummary *summary);
/* set the dirty bit on the summary */
void camel_store_summary_touch(CamelStoreSummary *summary);
@@ -147,32 +147,32 @@ void camel_store_summary_touch(CamelStoreSummary *summary);
void camel_store_summary_add(CamelStoreSummary *summary, CamelStoreInfo *info);
/* build/add raw summary items */
-CamelStoreInfo *camel_store_summary_add_from_path(CamelStoreSummary *summary, const char *path);
+CamelStoreInfo *camel_store_summary_add_from_path(CamelStoreSummary *summary, const gchar *path);
/* Just build raw summary items */
CamelStoreInfo *camel_store_summary_info_new(CamelStoreSummary *summary);
-CamelStoreInfo *camel_store_summary_info_new_from_path(CamelStoreSummary *summary, const char *path);
+CamelStoreInfo *camel_store_summary_info_new_from_path(CamelStoreSummary *summary, const gchar *path);
void camel_store_summary_info_ref(CamelStoreSummary *summary, CamelStoreInfo *info);
void camel_store_summary_info_free(CamelStoreSummary *summary, CamelStoreInfo *info);
/* removes a summary item */
void camel_store_summary_remove(CamelStoreSummary *summary, CamelStoreInfo *info);
-void camel_store_summary_remove_path(CamelStoreSummary *summary, const char *path);
-void camel_store_summary_remove_index(CamelStoreSummary *summary, int index);
+void camel_store_summary_remove_path(CamelStoreSummary *summary, const gchar *path);
+void camel_store_summary_remove_index(CamelStoreSummary *summary, gint index);
/* remove all items */
void camel_store_summary_clear(CamelStoreSummary *summary);
/* lookup functions */
-int camel_store_summary_count(CamelStoreSummary *summary);
-CamelStoreInfo *camel_store_summary_index(CamelStoreSummary *summary, int index);
-CamelStoreInfo *camel_store_summary_path(CamelStoreSummary *summary, const char *path);
+gint camel_store_summary_count(CamelStoreSummary *summary);
+CamelStoreInfo *camel_store_summary_index(CamelStoreSummary *summary, gint index);
+CamelStoreInfo *camel_store_summary_path(CamelStoreSummary *summary, const gchar *path);
GPtrArray *camel_store_summary_array(CamelStoreSummary *summary);
void camel_store_summary_array_free(CamelStoreSummary *summary, GPtrArray *array);
-const char *camel_store_info_string(CamelStoreSummary *summary, const CamelStoreInfo *info, int type);
-void camel_store_info_set_string(CamelStoreSummary *summary, CamelStoreInfo *info, int type, const char *value);
+const gchar *camel_store_info_string(CamelStoreSummary *summary, const CamelStoreInfo *info, gint type);
+void camel_store_info_set_string(CamelStoreSummary *summary, CamelStoreInfo *info, gint type, const gchar *value);
/* helper macro's */
#define camel_store_info_path(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_PATH))
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 9a4a3bc32..c4b002b7c 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -51,7 +51,7 @@ static CamelServiceClass *parent_class = NULL;
/* Returns the class for a CamelStore */
#define CS_CLASS(so) ((CamelStoreClass *)((CamelObject *)(so))->klass)
-static CamelFolder *get_folder (CamelStore *store, const char *folder_name,
+static CamelFolder *get_folder (CamelStore *store, const gchar *folder_name,
guint32 flags, CamelException *ex);
static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
@@ -59,22 +59,22 @@ static CamelFolder *get_trash (CamelStore *store, CamelException *ex);
static CamelFolder *get_junk (CamelStore *store, CamelException *ex);
static CamelFolderInfo *create_folder (CamelStore *store,
- const char *parent_name,
- const char *folder_name,
+ const gchar *parent_name,
+ const gchar *folder_name,
CamelException *ex);
-static void delete_folder (CamelStore *store, const char *folder_name,
+static void delete_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex);
-static void rename_folder (CamelStore *store, const char *old_name,
- const char *new_name, CamelException *ex);
+static void rename_folder (CamelStore *store, const gchar *old_name,
+ const gchar *new_name, CamelException *ex);
-static void store_sync (CamelStore *store, int expunge, CamelException *ex);
-static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top,
+static void store_sync (CamelStore *store, gint expunge, CamelException *ex);
+static CamelFolderInfo *get_folder_info (CamelStore *store, const gchar *top,
guint32 flags, CamelException *ex);
static void free_folder_info (CamelStore *store, CamelFolderInfo *tree);
-static gboolean folder_subscribed (CamelStore *store, const char *folder_name);
-static void subscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static void unsubscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex);
+static gboolean folder_subscribed (CamelStore *store, const gchar *folder_name);
+static void subscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void unsubscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex);
static void noop (CamelStore *store, CamelException *ex);
@@ -84,8 +84,8 @@ static void construct (CamelService *service, CamelSession *session,
CamelProvider *provider, CamelURL *url,
CamelException *ex);
-static int store_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint store_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
static void
camel_store_class_init (CamelStoreClass *camel_store_class)
@@ -129,7 +129,7 @@ camel_store_class_init (CamelStoreClass *camel_store_class)
}
static void
-camel_store_init (void *o)
+camel_store_init (gpointer o)
{
CamelStore *store = o;
CamelStoreClass *store_class = (CamelStoreClass *)CAMEL_OBJECT_GET_CLASS (o);
@@ -212,7 +212,7 @@ construct (CamelService *service, CamelSession *session,
CamelException *ex)
{
CamelStore *store = CAMEL_STORE(service);
- char *store_db_path, *store_path = NULL;
+ gchar *store_db_path, *store_path = NULL;
parent_class->construct(service, session, provider, url, ex);
if (camel_exception_is_set (ex))
@@ -239,7 +239,7 @@ construct (CamelService *service, CamelSession *session,
if (camel_debug("sqlite"))
printf("store_db_path %s\n", store_db_path);
if (camel_exception_is_set (ex)) {
- char *store_path;
+ gchar *store_path;
if (camel_debug("sqlite"))
g_print ("Failure for store_db_path : [%s]\n", store_db_path);
@@ -274,7 +274,7 @@ construct (CamelService *service, CamelSession *session,
}
static CamelFolder *
-get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
w(g_warning ("CamelStore::get_folder not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
@@ -297,7 +297,7 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
* Returns: the folder corresponding to the path @folder_name or %NULL.
**/
CamelFolder *
-camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+camel_store_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelFolder *folder = NULL;
@@ -372,9 +372,9 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag
}
if (camel_debug_start(":store")) {
- char *u = camel_url_to_string(((CamelService *)store)->url, CAMEL_URL_HIDE_PASSWORD);
+ gchar *u = camel_url_to_string(((CamelService *)store)->url, CAMEL_URL_HIDE_PASSWORD);
- printf("CamelStore('%s'):get_folder('%s', %u) = %p\n", u, folder_name, flags, (void *) folder);
+ printf("CamelStore('%s'):get_folder('%s', %u) = %p\n", u, folder_name, flags, (gpointer) folder);
if (ex && ex->id)
printf(" failed: '%s'\n", ex->desc);
g_free(u);
@@ -385,8 +385,8 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag
}
static CamelFolderInfo *
-create_folder (CamelStore *store, const char *parent_name,
- const char *folder_name, CamelException *ex)
+create_folder (CamelStore *store, const gchar *parent_name,
+ const gchar *folder_name, CamelException *ex)
{
w(g_warning ("CamelStore::create_folder not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
@@ -411,8 +411,8 @@ create_folder (CamelStore *store, const char *parent_name,
* free with #camel_store_free_folder_info, or %NULL.
**/
CamelFolderInfo *
-camel_store_create_folder (CamelStore *store, const char *parent_name,
- const char *folder_name, CamelException *ex)
+camel_store_create_folder (CamelStore *store, const gchar *parent_name,
+ const gchar *folder_name, CamelException *ex)
{
CamelFolderInfo *fi;
@@ -433,7 +433,7 @@ camel_store_create_folder (CamelStore *store, const char *parent_name,
/* deletes folder/removes it from the folder cache, if it's there */
static void
-cs_delete_cached_folder(CamelStore *store, const char *folder_name)
+cs_delete_cached_folder(CamelStore *store, const gchar *folder_name)
{
CamelFolder *folder;
@@ -461,7 +461,7 @@ cs_delete_cached_folder(CamelStore *store, const char *folder_name)
}
static void
-delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
w(g_warning ("CamelStore::delete_folder not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
@@ -476,7 +476,7 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
* Deletes the named folder. The folder must be empty.
**/
void
-camel_store_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+camel_store_delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelException local;
@@ -510,7 +510,7 @@ camel_store_delete_folder (CamelStore *store, const char *folder_name, CamelExce
}
static void
-rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex)
+rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name, CamelException *ex)
{
w(g_warning ("CamelStore::rename_folder not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
@@ -526,12 +526,12 @@ rename_folder (CamelStore *store, const char *old_name, const char *new_name, Ca
* Rename a named folder to a new name.
**/
void
-camel_store_rename_folder (CamelStore *store, const char *old_namein, const char *new_name, CamelException *ex)
+camel_store_rename_folder (CamelStore *store, const gchar *old_namein, const gchar *new_name, CamelException *ex)
{
CamelFolder *folder;
- int i, oldlen, namelen;
+ gint i, oldlen, namelen;
GPtrArray *folders = NULL;
- char *old_name;
+ gchar *old_name;
d(printf("store rename folder %s '%s' '%s'\n", ((CamelService *)store)->url->protocol, old_name, new_name));
@@ -583,7 +583,7 @@ camel_store_rename_folder (CamelStore *store, const char *old_namein, const char
CamelRenameInfo reninfo;
for (i=0;i<folders->len;i++) {
- char *new;
+ gchar *new;
folder = folders->pdata[i];
@@ -600,7 +600,7 @@ camel_store_rename_folder (CamelStore *store, const char *old_namein, const char
if (store->flags & CAMEL_STORE_SUBSCRIPTIONS)
flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
- reninfo.old_base = (char *)old_name;
+ reninfo.old_base = (gchar *)old_name;
reninfo.new = ((CamelStoreClass *)((CamelObject *)store)->klass)->get_folder_info(store, new_name, flags, ex);
if (reninfo.new != NULL) {
camel_object_trigger_event (store, "folder_renamed", &reninfo);
@@ -657,7 +657,7 @@ get_special(CamelStore *store, camel_vtrash_folder_t type)
{
CamelFolder *folder;
GPtrArray *folders;
- int i;
+ gint i;
folder = camel_vtrash_folder_new(store, type);
folders = camel_object_bag_list(store->folders);
@@ -729,13 +729,13 @@ ignore_no_such_table_exception (CamelException *ex)
}
static void
-store_sync (CamelStore *store, int expunge, CamelException *ex)
+store_sync (CamelStore *store, gint expunge, CamelException *ex)
{
if (store->folders) {
GPtrArray *folders;
CamelFolder *folder;
CamelException x;
- int i;
+ gint i;
/* we don't sync any vFolders, that is used to update certain vfolder queries mainly,
and we're really only interested in storing/expunging the physical mails */
@@ -766,7 +766,7 @@ store_sync (CamelStore *store, int expunge, CamelException *ex)
* folders with the real store.
**/
void
-camel_store_sync(CamelStore *store, int expunge, CamelException *ex)
+camel_store_sync(CamelStore *store, gint expunge, CamelException *ex)
{
g_return_if_fail (CAMEL_IS_STORE (store));
@@ -774,7 +774,7 @@ camel_store_sync(CamelStore *store, int expunge, CamelException *ex)
}
static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
w(g_warning ("CamelStore::get_folder_info not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
@@ -783,10 +783,10 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti
}
static void
-add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, const char *translated, gboolean unread_count, guint32 flags)
+add_special_info (CamelStore *store, CamelFolderInfo *info, const gchar *name, const gchar *translated, gboolean unread_count, guint32 flags)
{
CamelFolderInfo *fi, *vinfo, *parent;
- char *uri, *path;
+ gchar *uri, *path;
CamelURL *url;
g_return_if_fail (info != NULL);
@@ -840,9 +840,9 @@ add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, co
}
static void
-dump_fi(CamelFolderInfo *fi, int depth)
+dump_fi(CamelFolderInfo *fi, gint depth)
{
- char *s;
+ gchar *s;
s = g_alloca(depth+1);
memset(s, ' ', depth);
@@ -887,7 +887,7 @@ dump_fi(CamelFolderInfo *fi, int depth)
* #camel_store_free_folder_info, or %NULL.
**/
CamelFolderInfo *
-camel_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+camel_store_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelFolderInfo *info;
@@ -905,8 +905,8 @@ camel_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, C
}
if (camel_debug_start("store:folder_info")) {
- char *url = camel_url_to_string(((CamelService *)store)->url, CAMEL_URL_HIDE_ALL);
- printf("Get folder info(%p:%s, '%s') =\n", (void *) store, url, top?top:"<null>");
+ gchar *url = camel_url_to_string(((CamelService *)store)->url, CAMEL_URL_HIDE_ALL);
+ printf("Get folder info(%p:%s, '%s') =\n", (gpointer) store, url, top?top:"<null>");
g_free(url);
dump_fi(info, 2);
camel_debug_end();
@@ -999,7 +999,7 @@ camel_folder_info_new (void)
}
static int
-folder_info_cmp (const void *ap, const void *bp)
+folder_info_cmp (gconstpointer ap, gconstpointer bp)
{
const CamelFolderInfo *a = ((CamelFolderInfo **)ap)[0];
const CamelFolderInfo *b = ((CamelFolderInfo **)bp)[0];
@@ -1029,13 +1029,13 @@ folder_info_cmp (const void *ap, const void *bp)
* Returns: the top level of the tree of linked folder info.
**/
CamelFolderInfo *
-camel_folder_info_build (GPtrArray *folders, const char *namespace,
- char separator, gboolean short_names)
+camel_folder_info_build (GPtrArray *folders, const gchar *namespace,
+ gchar separator, gboolean short_names)
{
CamelFolderInfo *fi, *pfi, *top = NULL, *tail = NULL;
GHashTable *hash;
- char *p, *pname;
- int i, nlen;
+ gchar *p, *pname;
+ gint i, nlen;
if (!namespace)
namespace = "";
@@ -1062,9 +1062,9 @@ camel_folder_info_build (GPtrArray *folders, const char *namespace,
} else {
/* we are missing a folder in the heirarchy so
create a fake folder node */
- const char *path;
+ const gchar *path;
CamelURL *url;
- char *sep;
+ gchar *sep;
pfi = camel_folder_info_new ();
if (short_names) {
@@ -1190,7 +1190,7 @@ camel_store_supports_subscriptions (CamelStore *store)
}
static gboolean
-folder_subscribed(CamelStore *store, const char *folder_name)
+folder_subscribed(CamelStore *store, const gchar *folder_name)
{
w(g_warning ("CamelStore::folder_subscribed not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
@@ -1208,7 +1208,7 @@ folder_subscribed(CamelStore *store, const char *folder_name)
* Returns: %TRUE if the folder has been subscribed to or %FALSE otherwise
**/
gboolean
-camel_store_folder_subscribed(CamelStore *store, const char *folder_name)
+camel_store_folder_subscribed(CamelStore *store, const gchar *folder_name)
{
gboolean ret;
@@ -1225,7 +1225,7 @@ camel_store_folder_subscribed(CamelStore *store, const char *folder_name)
}
static void
-subscribe_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+subscribe_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
w(g_warning ("CamelStore::subscribe_folder not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
@@ -1240,7 +1240,7 @@ subscribe_folder(CamelStore *store, const char *folder_name, CamelException *ex)
* Subscribe to the folder described by @folder_name.
**/
void
-camel_store_subscribe_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+camel_store_subscribe_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
g_return_if_fail (CAMEL_IS_STORE (store));
g_return_if_fail (store->flags & CAMEL_STORE_SUBSCRIPTIONS);
@@ -1253,7 +1253,7 @@ camel_store_subscribe_folder(CamelStore *store, const char *folder_name, CamelEx
}
static void
-unsubscribe_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+unsubscribe_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
w(g_warning ("CamelStore::unsubscribe_folder not implemented for '%s'",
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
@@ -1269,7 +1269,7 @@ unsubscribe_folder(CamelStore *store, const char *folder_name, CamelException *e
* Unsubscribe from the folder described by @folder_name.
**/
void
-camel_store_unsubscribe_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+camel_store_unsubscribe_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelException local;
@@ -1321,12 +1321,12 @@ camel_store_noop (CamelStore *store, CamelException *ex)
*
* Returns: %TRUE if they are equal or %FALSE otherwise
**/
-int
-camel_store_folder_uri_equal (CamelStore *store, const char *uri0, const char *uri1)
+gint
+camel_store_folder_uri_equal (CamelStore *store, const gchar *uri0, const gchar *uri1)
{
CamelProvider *provider;
CamelURL *url0, *url1;
- int equal;
+ gint equal;
g_return_val_if_fail (CAMEL_IS_STORE (store), FALSE);
g_return_val_if_fail (uri0 && uri1, FALSE);
@@ -1342,7 +1342,7 @@ camel_store_folder_uri_equal (CamelStore *store, const char *uri0, const char *u
}
if ((equal = provider->url_equal (url0, url1))) {
- const char *name0, *name1;
+ const gchar *name0, *name1;
if (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) {
name0 = url0->fragment;
@@ -1418,7 +1418,7 @@ CamelType camel_isubscribe_get_type (void)
return camel_isubscribe_type;
}
-gboolean camel_isubscribe_subscribed(CamelStore *store, const char *name)
+gboolean camel_isubscribe_subscribed(CamelStore *store, const gchar *name)
{
CamelISubscribe *iface = camel_object_get_interface(store, camel_isubscribe_get_type());
@@ -1429,7 +1429,7 @@ gboolean camel_isubscribe_subscribed(CamelStore *store, const char *name)
return FALSE;
}
-void camel_isubscribe_subscribe(CamelStore *store, const char *folder_name, CamelException *ex)
+void camel_isubscribe_subscribe(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelISubscribe *iface = camel_object_get_interface(store, camel_isubscribe_get_type());
@@ -1441,7 +1441,7 @@ void camel_isubscribe_subscribe(CamelStore *store, const char *folder_name, Came
g_warning("Trying to invoke unimplemented subscribe method on a store");
}
-void camel_isubscribe_unsubscribe(CamelStore *store, const char *folder_name, CamelException *ex)
+void camel_isubscribe_unsubscribe(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelISubscribe *iface = camel_object_get_interface(store, camel_isubscribe_get_type());
diff --git a/camel/camel-store.h b/camel/camel-store.h
index 457b7e737..e4a19ee90 100644
--- a/camel/camel-store.h
+++ b/camel/camel-store.h
@@ -44,9 +44,9 @@ typedef struct _CamelFolderInfo {
struct _CamelFolderInfo *parent;
struct _CamelFolderInfo *child;
- char *uri;
- char *name;
- char *full_name;
+ gchar *uri;
+ gchar *name;
+ gchar *full_name;
guint32 flags;
gint32 unread;
@@ -100,7 +100,7 @@ typedef struct _CamelFolderInfo {
/* Structure of rename event's event_data */
typedef struct _CamelRenameInfo {
- char *old_base;
+ gchar *old_base;
struct _CamelFolderInfo *new;
} CamelRenameInfo;
@@ -161,7 +161,7 @@ typedef struct {
GCompareFunc compare_folder_name;
CamelFolder * (*get_folder) (CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
guint32 flags,
CamelException *ex);
@@ -170,33 +170,33 @@ typedef struct {
CamelFolder * (*get_junk) (CamelStore *store, CamelException *ex);
CamelFolderInfo *(*create_folder) (CamelStore *store,
- const char *parent_name,
- const char *folder_name,
+ const gchar *parent_name,
+ const gchar *folder_name,
CamelException *ex);
void (*delete_folder) (CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
CamelException *ex);
void (*rename_folder) (CamelStore *store,
- const char *old_name,
- const char *new_name,
+ const gchar *old_name,
+ const gchar *new_name,
CamelException *ex);
- void (*sync) (CamelStore *store, int expunge, CamelException *ex);
+ void (*sync) (CamelStore *store, gint expunge, CamelException *ex);
CamelFolderInfo *(*get_folder_info) (CamelStore *store,
- const char *top,
+ const gchar *top,
guint32 flags,
CamelException *ex);
void (*free_folder_info) (CamelStore *store,
CamelFolderInfo *fi);
gboolean (*folder_subscribed) (CamelStore *store,
- const char *folder_name);
+ const gchar *folder_name);
void (*subscribe_folder) (CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
CamelException *ex);
void (*unsubscribe_folder) (CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
CamelException *ex);
void (*noop) (CamelStore *store,
CamelException *ex);
@@ -212,7 +212,7 @@ CamelType camel_store_get_type (void);
/* public methods */
CamelFolder * camel_store_get_folder (CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
guint32 flags,
CamelException *ex);
CamelFolder * camel_store_get_inbox (CamelStore *store,
@@ -223,21 +223,21 @@ CamelFolder * camel_store_get_junk (CamelStore *store,
CamelException *ex);
CamelFolderInfo *camel_store_create_folder (CamelStore *store,
- const char *parent_name,
- const char *folder_name,
+ const gchar *parent_name,
+ const gchar *folder_name,
CamelException *ex);
void camel_store_delete_folder (CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
CamelException *ex);
void camel_store_rename_folder (CamelStore *store,
- const char *old_namein,
- const char *new_name,
+ const gchar *old_namein,
+ const gchar *new_name,
CamelException *ex);
-void camel_store_sync (CamelStore *store, int expunge, CamelException *ex);
+void camel_store_sync (CamelStore *store, gint expunge, CamelException *ex);
CamelFolderInfo *camel_store_get_folder_info (CamelStore *store,
- const char *top,
+ const gchar *top,
guint32 flags,
CamelException *ex);
void camel_store_free_folder_info (CamelStore *store,
@@ -252,8 +252,8 @@ CamelFolderInfo *camel_folder_info_new (void);
void camel_folder_info_free (CamelFolderInfo *fi);
#ifndef CAMEL_DISABLE_DEPRECATED
CamelFolderInfo *camel_folder_info_build (GPtrArray *folders,
- const char *namespace,
- char separator,
+ const gchar *namespace,
+ gchar separator,
gboolean short_names);
#endif /* CAMEL_DISABLE_DEPRECATED */
CamelFolderInfo *camel_folder_info_clone (CamelFolderInfo *fi);
@@ -261,20 +261,20 @@ CamelFolderInfo *camel_folder_info_clone (CamelFolderInfo *fi);
gboolean camel_store_supports_subscriptions (CamelStore *store);
gboolean camel_store_folder_subscribed (CamelStore *store,
- const char *folder_name);
+ const gchar *folder_name);
void camel_store_subscribe_folder (CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
CamelException *ex);
void camel_store_unsubscribe_folder (CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
CamelException *ex);
void camel_store_noop (CamelStore *store,
CamelException *ex);
-int camel_store_folder_uri_equal (CamelStore *store,
- const char *uri0,
- const char *uri1);
+gint camel_store_folder_uri_equal (CamelStore *store,
+ const gchar *uri0,
+ const gchar *uri1);
gboolean camel_store_can_refresh_folder (CamelStore *store,
CamelFolderInfo *info,
@@ -285,15 +285,15 @@ typedef struct _CamelISubscribe CamelISubscribe;
struct _CamelISubscribe {
CamelInterface iface;
- gboolean (*subscribed)(CamelStore *store, const char *folder_name);
- void (*subscribe)(CamelStore *store, const char *folder_name, CamelException *ex);
- void (*unsubscribe)(CamelStore *store, const char *folder_name, CamelException *ex);
+ gboolean (*subscribed)(CamelStore *store, const gchar *folder_name);
+ void (*subscribe)(CamelStore *store, const gchar *folder_name, CamelException *ex);
+ void (*unsubscribe)(CamelStore *store, const gchar *folder_name, CamelException *ex);
};
CamelType camel_isubscribe_get_type (void);
-gboolean camel_isubscribe_subscribed(CamelStore *store, const char *name);
-void camel_isubscribe_subscribe(CamelStore *store, const char *folder_name, CamelException *ex);
-void camel_isubscribe_unsubscribe(CamelStore *store, const char *folder_name, CamelException *ex);
+gboolean camel_isubscribe_subscribed(CamelStore *store, const gchar *name);
+void camel_isubscribe_subscribe(CamelStore *store, const gchar *folder_name, CamelException *ex);
+void camel_isubscribe_unsubscribe(CamelStore *store, const gchar *folder_name, CamelException *ex);
#endif /* CAMEL_DISABLE_DEPRECATED */
G_END_DECLS
diff --git a/camel/camel-stream-buffer.c b/camel/camel-stream-buffer.c
index 36146aadf..dd87644d1 100644
--- a/camel/camel-stream-buffer.c
+++ b/camel/camel-stream-buffer.c
@@ -41,13 +41,13 @@ enum {
#define BUF_SIZE 1024
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
static gboolean stream_eos (CamelStream *stream);
-static void init_vbuf(CamelStreamBuffer *sbf, CamelStream *s, CamelStreamBufferMode mode, char *buf, guint32 size);
+static void init_vbuf(CamelStreamBuffer *sbf, CamelStream *s, CamelStreamBufferMode mode, gchar *buf, guint32 size);
static void init(CamelStreamBuffer *sbuf, CamelStream *s, CamelStreamBufferMode mode);
static void
@@ -120,13 +120,13 @@ camel_stream_buffer_get_type (void)
static void
-set_vbuf(CamelStreamBuffer *sbf, char *buf, CamelStreamBufferMode mode, int size)
+set_vbuf(CamelStreamBuffer *sbf, gchar *buf, CamelStreamBufferMode mode, gint size)
{
if (sbf->buf && !(sbf->flags & BUF_USER)) {
g_free(sbf->buf);
}
if (buf) {
- sbf->buf = (unsigned char *) buf;
+ sbf->buf = (guchar *) buf;
sbf->flags |= BUF_USER;
} else {
sbf->buf = g_malloc(size);
@@ -140,7 +140,7 @@ set_vbuf(CamelStreamBuffer *sbf, char *buf, CamelStreamBufferMode mode, int size
}
static void
-init_vbuf(CamelStreamBuffer *sbf, CamelStream *s, CamelStreamBufferMode mode, char *buf, guint32 size)
+init_vbuf(CamelStreamBuffer *sbf, CamelStream *s, CamelStreamBufferMode mode, gchar *buf, guint32 size)
{
set_vbuf(sbf, buf, mode, size);
if (sbf->stream)
@@ -217,7 +217,7 @@ camel_stream_buffer_new (CamelStream *stream, CamelStreamBufferMode mode)
* Return value: A new stream with buffering applied.
**/
CamelStream *
-camel_stream_buffer_new_with_vbuf (CamelStream *stream, CamelStreamBufferMode mode, char *buf, guint32 size)
+camel_stream_buffer_new_with_vbuf (CamelStream *stream, CamelStreamBufferMode mode, gchar *buf, guint32 size)
{
CamelStreamBuffer *sbf;
sbf = CAMEL_STREAM_BUFFER (camel_object_new (camel_stream_buffer_get_type ()));
@@ -227,12 +227,12 @@ camel_stream_buffer_new_with_vbuf (CamelStream *stream, CamelStreamBufferMode mo
}
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
ssize_t bytes_read = 1;
ssize_t bytes_left;
- char *bptr = buffer;
+ gchar *bptr = buffer;
g_return_val_if_fail( (sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_READ, 0);
@@ -253,7 +253,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
bptr += bytes_read;
}
} else {
- bytes_read = camel_stream_read(sbf->stream, (char *) sbf->buf, sbf->size);
+ bytes_read = camel_stream_read(sbf->stream, (gchar *) sbf->buf, sbf->size);
if (bytes_read>0) {
size_t bytes_used = bytes_read > n ? n : bytes_read;
sbf->ptr = sbf->buf;
@@ -277,7 +277,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
/* only returns the number passed in, or -1 on an error */
static ssize_t
-stream_write_all(CamelStream *stream, const char *buffer, size_t n)
+stream_write_all(CamelStream *stream, const gchar *buffer, size_t n)
{
size_t left = n, w;
@@ -293,7 +293,7 @@ stream_write_all(CamelStream *stream, const char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
ssize_t total = n;
@@ -312,7 +312,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
/* if we've filled the buffer, write it out, reset buffer */
if (left == todo) {
- if (stream_write_all(sbf->stream, (const char *) sbf->buf, sbf->size) == -1)
+ if (stream_write_all(sbf->stream, (const gchar *) sbf->buf, sbf->size) == -1)
return -1;
sbf->ptr = sbf->buf;
@@ -340,7 +340,7 @@ stream_flush (CamelStream *stream)
if ((sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
size_t len = sbf->ptr - sbf->buf;
- if (camel_stream_write (sbf->stream, (const char *) sbf->buf, len) == -1)
+ if (camel_stream_write (sbf->stream, (const gchar *) sbf->buf, len) == -1)
return -1;
sbf->ptr = sbf->buf;
@@ -384,15 +384,15 @@ stream_eos (CamelStream *stream)
* Returns: the number of characters read, or %0 for end of file,
* and %-1 on error.
**/
-int
-camel_stream_buffer_gets(CamelStreamBuffer *sbf, char *buf, unsigned int max)
+gint
+camel_stream_buffer_gets(CamelStreamBuffer *sbf, gchar *buf, guint max)
{
- register char *outptr, *inptr, *inend, c, *outend;
- int bytes_read;
+ register gchar *outptr, *inptr, *inend, c, *outend;
+ gint bytes_read;
outptr = buf;
- inptr = (char *) sbf->ptr;
- inend = (char *) sbf->end;
+ inptr = (gchar *) sbf->ptr;
+ inend = (gchar *) sbf->end;
outend = buf+max-1; /* room for NUL */
do {
@@ -401,14 +401,14 @@ camel_stream_buffer_gets(CamelStreamBuffer *sbf, char *buf, unsigned int max)
*outptr++ = c;
if (c == '\n') {
*outptr = 0;
- sbf->ptr = (unsigned char *) inptr;
+ sbf->ptr = (guchar *) inptr;
return outptr-buf;
}
}
if (outptr == outend)
break;
- bytes_read = camel_stream_read (sbf->stream, (char *) sbf->buf, sbf->size);
+ bytes_read = camel_stream_read (sbf->stream, (gchar *) sbf->buf, sbf->size);
if (bytes_read == -1) {
if (buf == outptr)
return -1;
@@ -417,11 +417,11 @@ camel_stream_buffer_gets(CamelStreamBuffer *sbf, char *buf, unsigned int max)
}
sbf->ptr = sbf->buf;
sbf->end = sbf->buf + bytes_read;
- inptr = (char *) sbf->ptr;
- inend = (char *) sbf->end;
+ inptr = (gchar *) sbf->ptr;
+ inend = (gchar *) sbf->end;
} while (bytes_read>0);
- sbf->ptr = (unsigned char *) inptr;
+ sbf->ptr = (guchar *) inptr;
*outptr = 0;
return (int)(outptr - buf);
@@ -438,16 +438,16 @@ camel_stream_buffer_gets(CamelStreamBuffer *sbf, char *buf, unsigned int max)
* Returns: the line read, which the caller must free when done with,
* or %NULL on eof. If an error occurs, @ex will be set.
**/
-char *
+gchar *
camel_stream_buffer_read_line (CamelStreamBuffer *sbf)
{
- unsigned char *p;
- int nread;
+ guchar *p;
+ gint nread;
p = sbf->linebuf;
while (1) {
- nread = camel_stream_buffer_gets (sbf, (char *) p, sbf->linesize - (p - sbf->linebuf));
+ nread = camel_stream_buffer_gets (sbf, (gchar *) p, sbf->linesize - (p - sbf->linebuf));
if (nread <=0) {
if (p > sbf->linebuf)
break;
@@ -469,5 +469,5 @@ camel_stream_buffer_read_line (CamelStreamBuffer *sbf)
p--;
p[0] = 0;
- return g_strdup((char *) sbf->linebuf);
+ return g_strdup((gchar *) sbf->linebuf);
}
diff --git a/camel/camel-stream-buffer.h b/camel/camel-stream-buffer.h
index b7d120575..a0200de90 100644
--- a/camel/camel-stream-buffer.h
+++ b/camel/camel-stream-buffer.h
@@ -52,14 +52,14 @@ struct _CamelStreamBuffer
/* these are all of course, private */
CamelStream *stream;
- unsigned char *buf, *ptr, *end;
- int size;
+ guchar *buf, *ptr, *end;
+ gint size;
- unsigned char *linebuf; /* for reading lines at a time */
- int linesize;
+ guchar *linebuf; /* for reading lines at a time */
+ gint linesize;
CamelStreamBufferMode mode;
- unsigned int flags; /* internal flags */
+ guint flags; /* internal flags */
};
@@ -71,7 +71,7 @@ typedef struct {
CamelStreamBufferMode mode);
void (*init_vbuf) (CamelStreamBuffer *stream_buffer,
CamelStream *stream, CamelStreamBufferMode mode,
- char *buf, guint32 size);
+ gchar *buf, guint32 size);
} CamelStreamBufferClass;
@@ -85,15 +85,15 @@ CamelStream *camel_stream_buffer_new (CamelStream *stream,
CamelStreamBufferMode mode);
CamelStream *camel_stream_buffer_new_with_vbuf (CamelStream *stream,
CamelStreamBufferMode mode,
- char *buf, guint32 size);
+ gchar *buf, guint32 size);
/* unimplemented
- CamelStream *camel_stream_buffer_set_vbuf (CamelStreamBuffer *b, CamelStreamBufferMode mode, char *buf, guint32 size); */
+ CamelStream *camel_stream_buffer_set_vbuf (CamelStreamBuffer *b, CamelStreamBufferMode mode, gchar *buf, guint32 size); */
/* read a line of characters */
-int camel_stream_buffer_gets (CamelStreamBuffer *sbf, char *buf, unsigned int max);
+gint camel_stream_buffer_gets (CamelStreamBuffer *sbf, gchar *buf, guint max);
-char *camel_stream_buffer_read_line (CamelStreamBuffer *sbf);
+gchar *camel_stream_buffer_read_line (CamelStreamBuffer *sbf);
G_END_DECLS
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c
index 121d1ee85..8dd86f1ce 100644
--- a/camel/camel-stream-filter.c
+++ b/camel/camel-stream-filter.c
@@ -32,23 +32,23 @@
#define d(x)
/* use my malloc debugger? */
-/*extern void g_check(void *mp);*/
+/*extern void g_check(gpointer mp);*/
#define g_check(x)
struct _filter {
struct _filter *next;
- int id;
+ gint id;
CamelMimeFilter *filter;
};
struct _CamelStreamFilterPrivate {
struct _filter *filters;
- int filterid; /* next filter id */
+ gint filterid; /* next filter id */
- char *realbuffer; /* buffer - READ_PAD */
- char *buffer; /* READ_SIZE bytes */
+ gchar *realbuffer; /* buffer - READ_PAD */
+ gchar *buffer; /* READ_SIZE bytes */
- char *filtered; /* the filtered data */
+ gchar *filtered; /* the filtered data */
size_t filteredlen;
guint last_was_read:1; /* was the last op read or write? */
@@ -63,12 +63,12 @@ struct _CamelStreamFilterPrivate {
static void camel_stream_filter_class_init (CamelStreamFilterClass *klass);
static void camel_stream_filter_init (CamelStreamFilter *obj);
-static ssize_t do_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t do_write (CamelStream *stream, const char *buffer, size_t n);
-static int do_flush (CamelStream *stream);
-static int do_close (CamelStream *stream);
+static ssize_t do_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t do_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint do_flush (CamelStream *stream);
+static gint do_close (CamelStream *stream);
static gboolean do_eos (CamelStream *stream);
-static int do_reset (CamelStream *stream);
+static gint do_reset (CamelStream *stream);
static CamelStreamClass *camel_stream_filter_parent;
@@ -168,7 +168,7 @@ camel_stream_filter_new_with_stream(CamelStream *stream)
*
* Returns: a filter id for the added @filter.
**/
-int
+gint
camel_stream_filter_add (CamelStreamFilter *stream, CamelMimeFilter *filter)
{
struct _CamelStreamFilterPrivate *p = _PRIVATE(stream);
@@ -196,7 +196,7 @@ camel_stream_filter_add (CamelStreamFilter *stream, CamelMimeFilter *filter)
* Remove a processing filter from the stream by id.
**/
void
-camel_stream_filter_remove(CamelStreamFilter *stream, int id)
+camel_stream_filter_remove(CamelStreamFilter *stream, gint id)
{
struct _CamelStreamFilterPrivate *p = _PRIVATE(stream);
struct _filter *fn, *f;
@@ -214,7 +214,7 @@ camel_stream_filter_remove(CamelStreamFilter *stream, int id)
}
static ssize_t
-do_read (CamelStream *stream, char *buffer, size_t n)
+do_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
@@ -283,13 +283,13 @@ do_read (CamelStream *stream, char *buffer, size_t n)
write (for 'success'), we return what they asked us to write (for 'success')
rather than the true number of written bytes */
static ssize_t
-do_write (CamelStream *stream, const char *buf, size_t n)
+do_write (CamelStream *stream, const gchar *buf, size_t n)
{
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
struct _filter *f;
size_t presize, len, left = n;
- char *buffer, realbuffer[READ_SIZE+READ_PAD];
+ gchar *buffer, realbuffer[READ_SIZE+READ_PAD];
p->last_was_read = FALSE;
@@ -336,7 +336,7 @@ do_flush (CamelStream *stream)
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
struct _filter *f;
- char *buffer;
+ gchar *buffer;
size_t presize;
size_t len;
diff --git a/camel/camel-stream-filter.h b/camel/camel-stream-filter.h
index 48d709d01..cbb8e8641 100644
--- a/camel/camel-stream-filter.h
+++ b/camel/camel-stream-filter.h
@@ -50,8 +50,8 @@ CamelType camel_stream_filter_get_type (void);
CamelStreamFilter *camel_stream_filter_new_with_stream (CamelStream *stream);
-int camel_stream_filter_add (CamelStreamFilter *stream, CamelMimeFilter *filter);
-void camel_stream_filter_remove (CamelStreamFilter *stream, int id);
+gint camel_stream_filter_add (CamelStreamFilter *stream, CamelMimeFilter *filter);
+void camel_stream_filter_remove (CamelStreamFilter *stream, gint id);
G_END_DECLS
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
index 7321d853a..8d3ac83aa 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -45,10 +45,10 @@ static CamelSeekableStreamClass *parent_class = NULL;
/* Returns the class for a CamelStreamFS */
#define CSFS_CLASS(so) CAMEL_STREAM_FS_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
static off_t stream_seek (CamelSeekableStream *stream, off_t offset,
CamelStreamSeekPolicy policy);
@@ -119,7 +119,7 @@ camel_stream_fs_get_type (void)
* Returns: a new #CamelStreamFs
**/
CamelStream *
-camel_stream_fs_new_with_fd (int fd)
+camel_stream_fs_new_with_fd (gint fd)
{
CamelStreamFs *stream_fs;
off_t offset;
@@ -149,7 +149,7 @@ camel_stream_fs_new_with_fd (int fd)
* Returns: the bound stream
**/
CamelStream *
-camel_stream_fs_new_with_fd_and_bounds (int fd, off_t start, off_t end)
+camel_stream_fs_new_with_fd_and_bounds (gint fd, off_t start, off_t end)
{
CamelStream *stream;
@@ -171,9 +171,9 @@ camel_stream_fs_new_with_fd_and_bounds (int fd, off_t start, off_t end)
* Returns: the new stream, or %NULL on error.
**/
CamelStream *
-camel_stream_fs_new_with_name (const char *name, int flags, mode_t mode)
+camel_stream_fs_new_with_name (const gchar *name, gint flags, mode_t mode)
{
- int fd;
+ gint fd;
fd = g_open (name, flags|O_BINARY, mode);
if (fd == -1) {
@@ -196,7 +196,7 @@ camel_stream_fs_new_with_name (const char *name, int flags, mode_t mode)
* Returns: the stream, or %NULL on error.
**/
CamelStream *
-camel_stream_fs_new_with_name_and_bounds (const char *name, int flags,
+camel_stream_fs_new_with_name_and_bounds (const gchar *name, gint flags,
mode_t mode, off_t start, off_t end)
{
CamelStream *stream;
@@ -213,7 +213,7 @@ camel_stream_fs_new_with_name_and_bounds (const char *name, int flags,
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
@@ -231,7 +231,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
diff --git a/camel/camel-stream-fs.h b/camel/camel-stream-fs.h
index db075998b..883c2417e 100644
--- a/camel/camel-stream-fs.h
+++ b/camel/camel-stream-fs.h
@@ -43,7 +43,7 @@ G_BEGIN_DECLS
struct _CamelStreamFs {
CamelSeekableStream parent_object;
- int fd; /* file descriptor on the underlying file */
+ gint fd; /* file descriptor on the underlying file */
};
typedef struct {
@@ -55,12 +55,12 @@ typedef struct {
CamelType camel_stream_fs_get_type (void);
/* public methods */
-CamelStream * camel_stream_fs_new_with_name (const char *name, int flags, mode_t mode);
-CamelStream * camel_stream_fs_new_with_name_and_bounds (const char *name, int flags, mode_t mode,
+CamelStream * camel_stream_fs_new_with_name (const gchar *name, gint flags, mode_t mode);
+CamelStream * camel_stream_fs_new_with_name_and_bounds (const gchar *name, gint flags, mode_t mode,
off_t start, off_t end);
-CamelStream * camel_stream_fs_new_with_fd (int fd);
-CamelStream * camel_stream_fs_new_with_fd_and_bounds (int fd, off_t start, off_t end);
+CamelStream * camel_stream_fs_new_with_fd (gint fd);
+CamelStream * camel_stream_fs_new_with_fd_and_bounds (gint fd, off_t start, off_t end);
G_END_DECLS
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index f61ad012b..d75c48cc8 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -39,8 +39,8 @@ static CamelSeekableStreamClass *parent_class = NULL;
/* Returns the class for a CamelStreamMem */
#define CSM_CLASS(so) CAMEL_STREAM_MEM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
static gboolean stream_eos (CamelStream *stream);
static off_t stream_seek (CamelSeekableStream *stream, off_t offset,
CamelStreamSeekPolicy policy);
@@ -75,9 +75,9 @@ camel_stream_mem_init (CamelObject *object)
}
/* could probably be a util method */
-static void clear_mem(void *p, size_t len)
+static void clear_mem(gpointer p, size_t len)
{
- char *s = p;
+ gchar *s = p;
/* This also helps debug bad access memory errors */
while (len > 4) {
@@ -139,7 +139,7 @@ camel_stream_mem_new (void)
* Returns: a new #CamelStreamMem
**/
CamelStream *
-camel_stream_mem_new_with_buffer (const char *buffer, size_t len)
+camel_stream_mem_new_with_buffer (const gchar *buffer, size_t len)
{
GByteArray *ba;
@@ -226,7 +226,7 @@ camel_stream_mem_set_byte_array (CamelStreamMem *mem, GByteArray *buffer)
* and so may have resource implications to consider.
**/
void
-camel_stream_mem_set_buffer (CamelStreamMem *mem, const char *buffer, size_t len)
+camel_stream_mem_set_buffer (CamelStreamMem *mem, const gchar *buffer, size_t len)
{
GByteArray *ba;
@@ -252,7 +252,7 @@ camel_stream_mem_finalize (CamelObject *object)
}
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelStreamMem *camel_stream_mem = CAMEL_STREAM_MEM (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
@@ -272,7 +272,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
@@ -332,7 +332,7 @@ stream_seek (CamelSeekableStream *stream, off_t offset,
position = MAX (position, stream->bound_start);
if (position > stream_mem->buffer->len) {
- int oldlen = stream_mem->buffer->len;
+ gint oldlen = stream_mem->buffer->len;
g_byte_array_set_size (stream_mem->buffer, position);
memset (stream_mem->buffer->data + oldlen, 0,
position - oldlen);
diff --git a/camel/camel-stream-mem.h b/camel/camel-stream-mem.h
index adb352fa0..298d2f18a 100644
--- a/camel/camel-stream-mem.h
+++ b/camel/camel-stream-mem.h
@@ -41,8 +41,8 @@ typedef struct _CamelStreamMemClass CamelStreamMemClass;
struct _CamelStreamMem {
CamelSeekableStream parent_object;
- unsigned int owner:1; /* do we own the buffer? */
- unsigned int secure:1; /* do we clear the buffer on finalise (if we own it) */
+ guint owner:1; /* do we own the buffer? */
+ guint secure:1; /* do we clear the buffer on finalise (if we own it) */
GByteArray *buffer;
};
@@ -58,14 +58,14 @@ CamelType camel_stream_mem_get_type (void);
/* public methods */
CamelStream *camel_stream_mem_new(void);
CamelStream *camel_stream_mem_new_with_byte_array(GByteArray *buffer);
-CamelStream *camel_stream_mem_new_with_buffer(const char *buffer, size_t len);
+CamelStream *camel_stream_mem_new_with_buffer(const gchar *buffer, size_t len);
/* 'secure' data, currently just clears memory on finalise */
void camel_stream_mem_set_secure(CamelStreamMem *mem);
/* these are really only here for implementing classes */
void camel_stream_mem_set_byte_array(CamelStreamMem *mem, GByteArray *buffer);
-void camel_stream_mem_set_buffer(CamelStreamMem *mem, const char *buffer, size_t len);
+void camel_stream_mem_set_buffer(CamelStreamMem *mem, const gchar *buffer, size_t len);
G_END_DECLS
diff --git a/camel/camel-stream-null.c b/camel/camel-stream-null.c
index 167ab02f8..da71c0f5b 100644
--- a/camel/camel-stream-null.c
+++ b/camel/camel-stream-null.c
@@ -34,12 +34,12 @@ static CamelObjectClass *parent_class = NULL;
#define CS_CLASS(so) CAMEL_STREAM_NULL_CLASS(CAMEL_OBJECT_GET_CLASS(so))
/* dummy implementations, for a NULL stream */
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n) { return 0; }
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n) { ((CamelStreamNull *)stream)->written += n; return n; }
-static int stream_close (CamelStream *stream) { return 0; }
-static int stream_flush (CamelStream *stream) { return 0; }
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n) { return 0; }
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n) { ((CamelStreamNull *)stream)->written += n; return n; }
+static gint stream_close (CamelStream *stream) { return 0; }
+static gint stream_flush (CamelStream *stream) { return 0; }
static gboolean stream_eos (CamelStream *stream) { return TRUE; }
-static int stream_reset (CamelStream *stream) { ((CamelStreamNull *)stream)->written = 0; return 0; }
+static gint stream_reset (CamelStream *stream) { ((CamelStreamNull *)stream)->written = 0; return 0; }
static void
camel_stream_null_class_init (CamelStreamClass *camel_stream_null_class)
diff --git a/camel/camel-stream-process.c b/camel/camel-stream-process.c
index 100d1def5..651cd882d 100644
--- a/camel/camel-stream-process.c
+++ b/camel/camel-stream-process.c
@@ -42,7 +42,7 @@
#include "camel-file-utils.h"
#include "camel-stream-process.h"
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
static CamelObjectClass *parent_class = NULL;
@@ -50,10 +50,10 @@ static CamelObjectClass *parent_class = NULL;
#define CS_CLASS(so) CAMEL_STREAM_PROCESS_CLASS(CAMEL_OBJECT_GET_CLASS(so))
/* dummy implementations, for a PROCESS stream */
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_close (CamelStream *stream);
-static int stream_flush (CamelStream *stream);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_close (CamelStream *stream);
+static gint stream_flush (CamelStream *stream);
static void
camel_stream_process_finalise (CamelObject *object)
@@ -121,7 +121,7 @@ camel_stream_process_new (void)
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelStreamProcess *stream_process = CAMEL_STREAM_PROCESS (stream);
@@ -129,7 +129,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelStreamProcess *stream_process = CAMEL_STREAM_PROCESS (stream);
@@ -157,7 +157,7 @@ stream_close (CamelStream *object)
}
if (stream->childpid) {
- int ret, i;
+ gint ret, i;
for (i = 0; i < 4; i++) {
ret = waitpid (stream->childpid, NULL, WNOHANG);
if (camel_verbose_debug)
@@ -192,9 +192,9 @@ stream_close (CamelStream *object)
}
static void
-do_exec_command (int fd, const char *command, char **env)
+do_exec_command (gint fd, const gchar *command, gchar **env)
{
- int i, maxopen;
+ gint i, maxopen;
/* Not a lot we can do if there's an error other than bail. */
if (dup2 (fd, 0) == -1)
@@ -236,10 +236,10 @@ do_exec_command (int fd, const char *command, char **env)
exit (1);
}
-int
-camel_stream_process_connect (CamelStreamProcess *stream, const char *command, const char **env)
+gint
+camel_stream_process_connect (CamelStreamProcess *stream, const gchar *command, const gchar **env)
{
- int sockfds[2];
+ gint sockfds[2];
if (stream->sockfd != -1 || stream->childpid)
stream_close (CAMEL_STREAM (stream));
@@ -249,7 +249,7 @@ camel_stream_process_connect (CamelStreamProcess *stream, const char *command, c
stream->childpid = fork ();
if (!stream->childpid) {
- do_exec_command (sockfds[1], command, (char **)env);
+ do_exec_command (sockfds[1], command, (gchar **)env);
} else if (stream->childpid == -1) {
close (sockfds[0]);
close (sockfds[1]);
diff --git a/camel/camel-stream-process.h b/camel/camel-stream-process.h
index 898b61574..c996ecf89 100644
--- a/camel/camel-stream-process.h
+++ b/camel/camel-stream-process.h
@@ -37,7 +37,7 @@ typedef struct _CamelStreamProcess CamelStreamProcess;
struct _CamelStreamProcess {
CamelStream parent;
- int sockfd;
+ gint sockfd;
pid_t childpid;
};
@@ -47,7 +47,7 @@ struct _CamelStreamProcessClass {
CamelType camel_stream_process_get_type (void);
CamelStream *camel_stream_process_new (void);
-int camel_stream_process_connect(CamelStreamProcess *, const char *, const char **);
+gint camel_stream_process_connect(CamelStreamProcess *, const gchar *, const gchar **);
G_END_DECLS
diff --git a/camel/camel-stream-vfs.c b/camel/camel-stream-vfs.c
index e957a33ef..2b65d3f95 100644
--- a/camel/camel-stream-vfs.c
+++ b/camel/camel-stream-vfs.c
@@ -41,10 +41,10 @@ static CamelStreamClass *parent_class = NULL;
/* Returns the class for a CamelStreamVFS */
#define CSVFS_CLASS(so) CAMEL_STREAM_VFS_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
static void
camel_stream_vfs_class_init (CamelStreamVFSClass *camel_stream_vfs_class)
@@ -136,7 +136,7 @@ camel_stream_vfs_new_with_stream (GObject *stream)
* Returns: the new stream, or %NULL on error.
**/
CamelStream *
-camel_stream_vfs_new_with_uri (const char *uri, CamelStreamVFSOpenMethod mode)
+camel_stream_vfs_new_with_uri (const gchar *uri, CamelStreamVFSOpenMethod mode)
{
GFile *file;
GObject *stream;
@@ -187,7 +187,7 @@ camel_stream_vfs_is_writable (CamelStreamVFS *stream_vfs)
}
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
gssize nread;
GError *error = NULL;
@@ -209,7 +209,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
gboolean success;
gsize bytes_written;
diff --git a/camel/camel-stream-vfs.h b/camel/camel-stream-vfs.h
index 4226735a5..d5915bead 100644
--- a/camel/camel-stream-vfs.h
+++ b/camel/camel-stream-vfs.h
@@ -61,7 +61,7 @@ typedef enum {
} CamelStreamVFSOpenMethod;
/* public methods */
-CamelStream * camel_stream_vfs_new_with_uri (const char *uri, CamelStreamVFSOpenMethod mode);
+CamelStream * camel_stream_vfs_new_with_uri (const gchar *uri, CamelStreamVFSOpenMethod mode);
CamelStream * camel_stream_vfs_new_with_stream (GObject *stream);
gboolean camel_stream_vfs_is_writable (CamelStreamVFS *stream_vfs);
diff --git a/camel/camel-stream.c b/camel/camel-stream.c
index da6c0ee49..a9685c9f0 100644
--- a/camel/camel-stream.c
+++ b/camel/camel-stream.c
@@ -37,12 +37,12 @@ static CamelObjectClass *parent_class = NULL;
#define CS_CLASS(so) CAMEL_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
/* default implementations, do very little */
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n) { return 0; }
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n) { return n; }
-static int stream_close (CamelStream *stream) { return 0; }
-static int stream_flush (CamelStream *stream) { return 0; }
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n) { return 0; }
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n) { return n; }
+static gint stream_close (CamelStream *stream) { return 0; }
+static gint stream_flush (CamelStream *stream) { return 0; }
static gboolean stream_eos (CamelStream *stream) { return stream->eos; }
-static int stream_reset (CamelStream *stream) { return 0; }
+static gint stream_reset (CamelStream *stream) { return 0; }
static void
camel_stream_class_init (CamelStreamClass *camel_stream_class)
@@ -90,7 +90,7 @@ camel_stream_get_type (void)
* errno.
**/
ssize_t
-camel_stream_read (CamelStream *stream, char *buffer, size_t n)
+camel_stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
g_return_val_if_fail (n == 0 || buffer, -1);
@@ -111,7 +111,7 @@ camel_stream_read (CamelStream *stream, char *buffer, size_t n)
* along with setting errno.
**/
ssize_t
-camel_stream_write (CamelStream *stream, const char *buffer, size_t n)
+camel_stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
g_return_val_if_fail (n == 0 || buffer, -1);
@@ -129,7 +129,7 @@ camel_stream_write (CamelStream *stream, const char *buffer, size_t n)
*
* Returns: %0 on success or %-1 on fail along with setting errno.
**/
-int
+gint
camel_stream_flush (CamelStream *stream)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
@@ -146,7 +146,7 @@ camel_stream_flush (CamelStream *stream)
*
* Returns: %0 on success or %-1 on error.
**/
-int
+gint
camel_stream_close (CamelStream *stream)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
@@ -182,7 +182,7 @@ camel_stream_eos (CamelStream *stream)
*
* Returns: %0 on success or %-1 on error along with setting errno.
**/
-int
+gint
camel_stream_reset (CamelStream *stream)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
@@ -202,7 +202,7 @@ camel_stream_reset (CamelStream *stream)
* Returns: the number of characters written or %-1 on error.
**/
ssize_t
-camel_stream_write_string (CamelStream *stream, const char *string)
+camel_stream_write_string (CamelStream *stream, const gchar *string)
{
return camel_stream_write (stream, string, strlen (string));
}
@@ -218,10 +218,10 @@ camel_stream_write_string (CamelStream *stream, const char *string)
* Returns: the number of characters written or %-1 on error.
**/
ssize_t
-camel_stream_printf (CamelStream *stream, const char *fmt, ... )
+camel_stream_printf (CamelStream *stream, const gchar *fmt, ... )
{
va_list args;
- char *string;
+ gchar *string;
ssize_t ret;
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
@@ -253,7 +253,7 @@ camel_stream_printf (CamelStream *stream, const char *fmt, ... )
ssize_t
camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream)
{
- char tmp_buf[4096];
+ gchar tmp_buf[4096];
ssize_t total = 0;
ssize_t nb_read;
ssize_t nb_written;
diff --git a/camel/camel-stream.h b/camel/camel-stream.h
index b8a323c7d..41081f02f 100644
--- a/camel/camel-stream.h
+++ b/camel/camel-stream.h
@@ -49,12 +49,12 @@ typedef struct {
/* Virtual methods */
- ssize_t (*read) (CamelStream *stream, char *buffer, size_t n);
- ssize_t (*write) (CamelStream *stream, const char *buffer, size_t n);
- int (*close) (CamelStream *stream);
- int (*flush) (CamelStream *stream);
+ ssize_t (*read) (CamelStream *stream, gchar *buffer, size_t n);
+ ssize_t (*write) (CamelStream *stream, const gchar *buffer, size_t n);
+ gint (*close) (CamelStream *stream);
+ gint (*flush) (CamelStream *stream);
gboolean (*eos) (CamelStream *stream);
- int (*reset) (CamelStream *stream);
+ gint (*reset) (CamelStream *stream);
} CamelStreamClass;
@@ -62,17 +62,17 @@ typedef struct {
CamelType camel_stream_get_type (void);
/* public methods */
-ssize_t camel_stream_read (CamelStream *stream, char *buffer, size_t n);
-ssize_t camel_stream_write (CamelStream *stream, const char *buffer, size_t n);
-int camel_stream_flush (CamelStream *stream);
-int camel_stream_close (CamelStream *stream);
+ssize_t camel_stream_read (CamelStream *stream, gchar *buffer, size_t n);
+ssize_t camel_stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+gint camel_stream_flush (CamelStream *stream);
+gint camel_stream_close (CamelStream *stream);
gboolean camel_stream_eos (CamelStream *stream);
-int camel_stream_reset (CamelStream *stream);
+gint camel_stream_reset (CamelStream *stream);
/* utility macros and funcs */
-ssize_t camel_stream_write_string (CamelStream *stream, const char *string);
-ssize_t camel_stream_printf (CamelStream *stream, const char *fmt, ... ) G_GNUC_PRINTF (2, 3);
-ssize_t camel_stream_vprintf (CamelStream *stream, const char *fmt, va_list ap);
+ssize_t camel_stream_write_string (CamelStream *stream, const gchar *string);
+ssize_t camel_stream_printf (CamelStream *stream, const gchar *fmt, ... ) G_GNUC_PRINTF (2, 3);
+ssize_t camel_stream_vprintf (CamelStream *stream, const gchar *fmt, va_list ap);
/* Write a whole stream to another stream, until eof or error on
* either stream.
diff --git a/camel/camel-string-utils.c b/camel/camel-string-utils.c
index d9a070cb4..7044e7196 100644
--- a/camel/camel-string-utils.c
+++ b/camel/camel-string-utils.c
@@ -30,16 +30,16 @@
#include "camel-string-utils.h"
-int
+gint
camel_strcase_equal (gconstpointer a, gconstpointer b)
{
- return (g_ascii_strcasecmp ((const char *) a, (const char *) b) == 0);
+ return (g_ascii_strcasecmp ((const gchar *) a, (const gchar *) b) == 0);
}
guint
camel_strcase_hash (gconstpointer v)
{
- const char *p = (char *) v;
+ const gchar *p = (gchar *) v;
guint h = 0, g;
for ( ; *p != '\0'; p++) {
@@ -70,11 +70,11 @@ camel_string_list_free (GList *string_list)
g_list_free (string_list);
}
-char *
-camel_strstrcase (const char *haystack, const char *needle)
+gchar *
+camel_strstrcase (const gchar *haystack, const gchar *needle)
{
/* find the needle in the haystack neglecting case */
- const char *ptr;
+ const gchar *ptr;
guint len;
g_return_val_if_fail (haystack != NULL, NULL);
@@ -85,20 +85,20 @@ camel_strstrcase (const char *haystack, const char *needle)
return NULL;
if (len == 0)
- return (char *) haystack;
+ return (gchar *) haystack;
for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++)
if (!g_ascii_strncasecmp (ptr, needle, len))
- return (char *) ptr;
+ return (gchar *) ptr;
return NULL;
}
-const char *
-camel_strdown (char *str)
+const gchar *
+camel_strdown (gchar *str)
{
- register char *s = str;
+ register gchar *s = str;
while (*s) {
if (*s >= 'A' && *s <= 'Z')
@@ -117,7 +117,7 @@ camel_strdown (char *str)
*
* Return value:
**/
-char camel_tolower(char c)
+gchar camel_tolower(gchar c)
{
if (c >= 'A' && c <= 'Z')
c |= 0x20;
@@ -133,7 +133,7 @@ char camel_tolower(char c)
*
* Return value:
**/
-char camel_toupper(char c)
+gchar camel_toupper(gchar c)
{
if (c >= 'a' && c <= 'z')
c &= ~0x20;
@@ -157,12 +157,12 @@ static GHashTable *pstring_table = NULL;
* Return value: A pointer to an equivalent string of @s. Use
* camel_pstring_free() when it is no longer needed.
**/
-const char *
-camel_pstring_add (char *str, gboolean own)
+const gchar *
+camel_pstring_add (gchar *str, gboolean own)
{
- void *pcount;
- char *pstr;
- int count;
+ gpointer pcount;
+ gchar *pstr;
+ gint count;
if (str == NULL)
return NULL;
@@ -177,7 +177,7 @@ camel_pstring_add (char *str, gboolean own)
if (pstring_table == NULL)
pstring_table = g_hash_table_new (g_str_hash, g_str_equal);
- if (g_hash_table_lookup_extended (pstring_table, str, (void **) &pstr, &pcount)) {
+ if (g_hash_table_lookup_extended (pstring_table, str, (gpointer *) &pstr, &pcount)) {
count = GPOINTER_TO_INT (pcount) + 1;
g_hash_table_insert (pstring_table, pstr, GINT_TO_POINTER (count));
if (own)
@@ -203,11 +203,11 @@ camel_pstring_add (char *str, gboolean own)
* Return value: A pointer to an equivalent string of @s. Use
* camel_pstring_free() when it is no longer needed.
**/
-const char *
-camel_pstring_peek (const char *str)
+const gchar *
+camel_pstring_peek (const gchar *str)
{
- void *pcount;
- char *pstr;
+ gpointer pcount;
+ gchar *pstr;
if (str == NULL)
return NULL;
@@ -220,7 +220,7 @@ camel_pstring_peek (const char *str)
if (pstring_table == NULL)
pstring_table = g_hash_table_new (g_str_hash, g_str_equal);
- if (!g_hash_table_lookup_extended (pstring_table, str, (void **) &pstr, &pcount)) {
+ if (!g_hash_table_lookup_extended (pstring_table, str, (gpointer *) &pstr, &pcount)) {
pstr = g_strdup (str);
g_hash_table_insert (pstring_table, pstr, GINT_TO_POINTER (1));
}
@@ -243,10 +243,10 @@ camel_pstring_peek (const char *str)
* Return value: A pointer to an equivalent string of @s. Use
* camel_pstring_free() when it is no longer needed.
**/
-const char *
-camel_pstring_strdup (const char *s)
+const gchar *
+camel_pstring_strdup (const gchar *s)
{
- return camel_pstring_add ((char *) s, FALSE);
+ return camel_pstring_add ((gchar *) s, FALSE);
}
@@ -259,11 +259,11 @@ camel_pstring_strdup (const char *s)
* NULL and the empty string are special cased.
**/
void
-camel_pstring_free(const char *s)
+camel_pstring_free(const gchar *s)
{
- char *p;
- void *pcount;
- int count;
+ gchar *p;
+ gpointer pcount;
+ gint count;
if (pstring_table == NULL)
return;
@@ -271,7 +271,7 @@ camel_pstring_free(const char *s)
return;
pthread_mutex_lock(&pstring_lock);
- if (g_hash_table_lookup_extended(pstring_table, s, (void **)&p, &pcount)) {
+ if (g_hash_table_lookup_extended(pstring_table, s, (gpointer *)&p, &pcount)) {
count = GPOINTER_TO_INT(pcount)-1;
if (count == 0) {
g_hash_table_remove(pstring_table, p);
diff --git a/camel/camel-string-utils.h b/camel/camel-string-utils.h
index 3423386cb..97e268ec8 100644
--- a/camel/camel-string-utils.h
+++ b/camel/camel-string-utils.h
@@ -28,21 +28,21 @@
G_BEGIN_DECLS
-int camel_strcase_equal (gconstpointer a, gconstpointer b);
+gint camel_strcase_equal (gconstpointer a, gconstpointer b);
guint camel_strcase_hash (gconstpointer v);
void camel_string_list_free (GList *string_list);
-char *camel_strstrcase (const char *haystack, const char *needle);
+gchar *camel_strstrcase (const gchar *haystack, const gchar *needle);
-const char *camel_strdown (char *str);
-char camel_tolower(char c);
-char camel_toupper(char c);
+const gchar *camel_strdown (gchar *str);
+gchar camel_tolower(gchar c);
+gchar camel_toupper(gchar c);
-const char *camel_pstring_add (char *str, gboolean own);
-const char *camel_pstring_strdup(const char *s);
-void camel_pstring_free(const char *s);
-const char * camel_pstring_peek (const char *str);
+const gchar *camel_pstring_add (gchar *str, gboolean own);
+const gchar *camel_pstring_strdup(const gchar *s);
+void camel_pstring_free(const gchar *s);
+const gchar * camel_pstring_peek (const gchar *str);
G_END_DECLS
diff --git a/camel/camel-tcp-stream-openssl.c b/camel/camel-tcp-stream-openssl.c
index 4012debcf..1d598493c 100644
--- a/camel/camel-tcp-stream-openssl.c
+++ b/camel/camel-tcp-stream-openssl.c
@@ -55,25 +55,25 @@ static CamelTcpStreamClass *parent_class = NULL;
/* Returns the class for a CamelTcpStreamSSL */
#define CTSR_CLASS(so) CAMEL_TCP_STREAM_SSL_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-
-static int stream_connect (CamelTcpStream *stream, struct hostent *host, int port);
-static int stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-static int stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
+
+static gint stream_connect (CamelTcpStream *stream, struct hostent *host, gint port);
+static gint stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
+static gint stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
static CamelTcpAddress *stream_get_local_address (CamelTcpStream *stream);
static CamelTcpAddress *stream_get_remote_address (CamelTcpStream *stream);
-static SSL *open_ssl_connection (CamelService *service, int sockfd, CamelTcpStreamSSL *openssl);
+static SSL *open_ssl_connection (CamelService *service, gint sockfd, CamelTcpStreamSSL *openssl);
struct _CamelTcpStreamSSLPrivate {
- int sockfd;
+ gint sockfd;
SSL *ssl;
CamelService *service;
- char *expected_host;
+ gchar *expected_host;
gboolean ssl_mode;
guint32 flags;
};
@@ -171,7 +171,7 @@ camel_tcp_stream_ssl_get_type (void)
* Return value: a ssl stream (in ssl mode)
**/
CamelStream *
-camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host, guint32 flags)
+camel_tcp_stream_ssl_new (CamelService *service, const gchar *expected_host, guint32 flags)
{
CamelTcpStreamSSL *stream;
@@ -199,7 +199,7 @@ camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host, guin
* Return value: a ssl-capable stream (in non ssl mode)
**/
CamelStream *
-camel_tcp_stream_ssl_new_raw (CamelService *service, const char *expected_host, guint32 flags)
+camel_tcp_stream_ssl_new_raw (CamelService *service, const gchar *expected_host, guint32 flags)
{
CamelTcpStreamSSL *stream;
@@ -215,7 +215,7 @@ camel_tcp_stream_ssl_new_raw (CamelService *service, const char *expected_host,
static int
-ssl_errno (SSL *ssl, int ret)
+ssl_errno (SSL *ssl, gint ret)
{
switch (SSL_get_error (ssl, ret)) {
case SSL_ERROR_NONE:
@@ -249,7 +249,7 @@ ssl_errno (SSL *ssl, int ret)
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *stream)
{
SSL *ssl;
@@ -273,12 +273,12 @@ camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *stream)
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
SSL *ssl = openssl->priv->ssl;
ssize_t nread;
- int cancel_fd;
+ gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
errno = EINTR;
@@ -297,7 +297,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
} while (nread < 0 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
} else {
- int error, flags, fdmax;
+ gint error, flags, fdmax;
struct timeval timeout;
fd_set rdset;
@@ -341,12 +341,12 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
SSL *ssl = openssl->priv->ssl;
ssize_t w, written = 0;
- int cancel_fd;
+ gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
errno = EINTR;
@@ -370,7 +370,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
written += w;
} while (w != -1 && written < n);
} else {
- int error, flags, fdmax;
+ gint error, flags, fdmax;
struct timeval timeout;
fd_set rdset, wrset;
@@ -459,7 +459,7 @@ stream_close (CamelStream *stream)
/* this is a 'cancellable' connect, cancellable from camel_operation_cancel etc */
/* returns -1 & errno == EINTR if the connection was cancelled */
static int
-socket_connect (struct hostent *h, int port)
+socket_connect (struct hostent *h, gint port)
{
#ifdef ENABLE_IPv6
struct sockaddr_in6 sin6;
@@ -468,8 +468,8 @@ socket_connect (struct hostent *h, int port)
struct sockaddr *saddr;
struct timeval tv;
socklen_t len;
- int cancel_fd;
- int ret, fd;
+ gint cancel_fd;
+ gint ret, fd;
/* see if we're cancelled yet */
if (camel_operation_cancel_check (NULL)) {
@@ -509,7 +509,7 @@ socket_connect (struct hostent *h, int port)
return fd;
} else {
fd_set rdset, wrset;
- int flags, fdmax;
+ gint flags, fdmax;
flags = fcntl (fd, F_GETFL);
fcntl (fd, F_SETFL, flags | O_NONBLOCK);
@@ -564,8 +564,8 @@ socket_connect (struct hostent *h, int port)
return fd;
}
-static const char *
-x509_strerror (int err)
+static const gchar *
+x509_strerror (gint err)
{
switch (err) {
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
@@ -637,16 +637,16 @@ x509_strerror (int err)
}
static int
-ssl_verify (int ok, X509_STORE_CTX *ctx)
+ssl_verify (gint ok, X509_STORE_CTX *ctx)
{
- unsigned char md5sum[16], fingerprint[40], *f;
+ guchar md5sum[16], fingerprint[40], *f;
CamelTcpStreamSSL *stream;
CamelService *service;
CamelCertDB *certdb = NULL;
CamelCert *ccert = NULL;
- char *prompt, *cert_str;
- int err, md5len, i;
- char buf[257];
+ gchar *prompt, *cert_str;
+ gint err, md5len, i;
+ gchar buf[257];
X509 *cert;
SSL *ssl;
@@ -668,13 +668,13 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
md5len = sizeof (md5sum);
X509_digest (cert, EVP_md5 (), md5sum, &md5len);
for (i = 0, f = fingerprint; i < 16; i++, f += 3)
- sprintf ((char *) f, "%.2x%c", md5sum[i], i != 15 ? ':' : '\0');
+ sprintf ((gchar *) f, "%.2x%c", md5sum[i], i != 15 ? ':' : '\0');
#define GET_STRING(name) X509_NAME_oneline (name, buf, 256)
certdb = camel_certdb_get_default ();
if (certdb) {
- ccert = camel_certdb_get_cert (certdb, (const char *) fingerprint);
+ ccert = camel_certdb_get_cert (certdb, (const gchar *) fingerprint);
if (ccert) {
if (ccert->trust != CAMEL_CERT_TRUST_UNKNOWN) {
ok = ccert->trust != CAMEL_CERT_TRUST_NEVER;
@@ -688,8 +688,8 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
ccert = camel_certdb_cert_new (certdb);
camel_cert_set_issuer (certdb, ccert, GET_STRING (X509_get_issuer_name (cert)));
camel_cert_set_subject (certdb, ccert, GET_STRING (X509_get_subject_name (cert)));
- camel_cert_set_hostname (certdb, ccert, (const char *) stream->priv->expected_host);
- camel_cert_set_fingerprint (certdb, ccert, (const char *) fingerprint);
+ camel_cert_set_hostname (certdb, ccert, (const gchar *) stream->priv->expected_host);
+ camel_cert_set_fingerprint (certdb, ccert, (const gchar *) fingerprint);
camel_cert_set_trust (certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
/* Add the certificate to our db */
@@ -726,11 +726,11 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
}
static SSL *
-open_ssl_connection (CamelService *service, int sockfd, CamelTcpStreamSSL *openssl)
+open_ssl_connection (CamelService *service, gint sockfd, CamelTcpStreamSSL *openssl)
{
SSL_CTX *ssl_ctx = NULL;
SSL *ssl = NULL;
- int n;
+ gint n;
/* SSLv23_client_method will negotiate with SSL v2, v3, or TLS v1 */
ssl_ctx = SSL_CTX_new (SSLv23_client_method ());
@@ -745,7 +745,7 @@ open_ssl_connection (CamelService *service, int sockfd, CamelTcpStreamSSL *opens
n = SSL_connect (ssl);
if (n != 1) {
- int errnosave = ssl_errno (ssl, n);
+ gint errnosave = ssl_errno (ssl, n);
SSL_shutdown (ssl);
@@ -764,11 +764,11 @@ open_ssl_connection (CamelService *service, int sockfd, CamelTcpStreamSSL *opens
}
static int
-stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
+stream_connect (CamelTcpStream *stream, struct hostent *host, gint port)
{
CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
SSL *ssl = NULL;
- int fd;
+ gint fd;
g_return_val_if_fail (host != NULL, -1);
@@ -831,13 +831,13 @@ get_sockopt_optname (const CamelSockOptData *data)
static int
stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
{
- int optname, optlen;
+ gint optname, optlen;
if ((optname = get_sockopt_optname (data)) == -1)
return -1;
if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
- int flags;
+ gint flags;
flags = fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_GETFL);
if (flags == -1)
@@ -851,20 +851,20 @@ stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
return getsockopt (((CamelTcpStreamSSL *) stream)->priv->sockfd,
get_sockopt_level (data),
optname,
- (void *) &data->value,
+ (gpointer) &data->value,
(socklen_t *) &optlen);
}
static int
stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
{
- int optname;
+ gint optname;
if ((optname = get_sockopt_optname (data)) == -1)
return -1;
if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
- int flags, set;
+ gint flags, set;
flags = fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_GETFL);
if (flags == -1)
@@ -882,7 +882,7 @@ stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
return setsockopt (((CamelTcpStreamSSL *) stream)->priv->sockfd,
get_sockopt_level (data),
optname,
- (void *) &data->value,
+ (gpointer) &data->value,
sizeof (data->value));
}
@@ -895,7 +895,7 @@ stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
static CamelTcpAddress *
stream_get_local_address (CamelTcpStream *stream)
{
- unsigned char buf[MIN_SOCKADDR_BUFLEN];
+ guchar buf[MIN_SOCKADDR_BUFLEN];
#ifdef ENABLE_IPv6
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) buf;
#endif
@@ -903,7 +903,7 @@ stream_get_local_address (CamelTcpStream *stream)
struct sockaddr *saddr = (struct sockaddr *) buf;
gpointer address;
socklen_t len;
- int family;
+ gint family;
len = MIN_SOCKADDR_BUFLEN;
@@ -927,7 +927,7 @@ stream_get_local_address (CamelTcpStream *stream)
static CamelTcpAddress *
stream_get_remote_address (CamelTcpStream *stream)
{
- unsigned char buf[MIN_SOCKADDR_BUFLEN];
+ guchar buf[MIN_SOCKADDR_BUFLEN];
#ifdef ENABLE_IPv6
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) buf;
#endif
@@ -935,7 +935,7 @@ stream_get_remote_address (CamelTcpStream *stream)
struct sockaddr *saddr = (struct sockaddr *) buf;
gpointer address;
socklen_t len;
- int family;
+ gint family;
len = MIN_SOCKADDR_BUFLEN;
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 8a8ec0d97..93e2268c7 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -53,14 +53,14 @@ static CamelTcpStreamClass *parent_class = NULL;
/* Returns the class for a CamelTcpStreamRaw */
#define CTSR_CLASS(so) CAMEL_TCP_STREAM_RAW_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-
-static int stream_connect (CamelTcpStream *stream, struct addrinfo *host);
-static int stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-static int stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
+
+static gint stream_connect (CamelTcpStream *stream, struct addrinfo *host);
+static gint stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
+static gint stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
static struct sockaddr *stream_get_local_address (CamelTcpStream *stream, socklen_t *len);
static struct sockaddr *stream_get_remote_address (CamelTcpStream *stream, socklen_t *len);
@@ -126,11 +126,11 @@ camel_tcp_stream_raw_get_type (void)
#ifdef SIMULATE_FLAKY_NETWORK
static ssize_t
-flaky_tcp_write (int fd, const char *buffer, size_t buflen)
+flaky_tcp_write (gint fd, const gchar *buffer, size_t buflen)
{
size_t len = buflen;
ssize_t nwritten;
- int val;
+ gint val;
if (buflen == 0)
return 0;
@@ -173,11 +173,11 @@ flaky_tcp_write (int fd, const char *buffer, size_t buflen)
#define write(fd, buffer, buflen) flaky_tcp_write (fd, buffer, buflen)
static ssize_t
-flaky_tcp_read (int fd, char *buffer, size_t buflen)
+flaky_tcp_read (gint fd, gchar *buffer, size_t buflen)
{
size_t len = buflen;
ssize_t nread;
- int val;
+ gint val;
if (buflen == 0)
return 0;
@@ -245,7 +245,7 @@ camel_tcp_stream_raw_new (void)
}
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
@@ -253,7 +253,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
@@ -283,9 +283,9 @@ socket_connect(struct addrinfo *h)
{
struct timeval tv;
socklen_t len;
- int cancel_fd;
- int errnosav;
- int ret, fd;
+ gint cancel_fd;
+ gint errnosav;
+ gint ret, fd;
/* see if we're cancelled yet */
if (camel_operation_cancel_check (NULL)) {
@@ -317,9 +317,9 @@ socket_connect(struct addrinfo *h)
return fd;
} else {
#ifndef G_OS_WIN32
- int flags;
+ gint flags;
#endif
- int fdmax, status;
+ gint fdmax, status;
fd_set rdset, wrset;
#ifndef G_OS_WIN32
@@ -375,7 +375,7 @@ socket_connect(struct addrinfo *h)
} else {
len = sizeof (int);
- if (getsockopt (fd, SOL_SOCKET, SO_ERROR, (char *) &ret, &len) == -1) {
+ if (getsockopt (fd, SOL_SOCKET, SO_ERROR, (gchar *) &ret, &len) == -1) {
errnosav = errno;
SOCKET_CLOSE (fd);
errno = errnosav;
@@ -463,14 +463,14 @@ get_sockopt_optname (const CamelSockOptData *data)
static int
stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
{
- int optname, optlen;
+ gint optname, optlen;
if ((optname = get_sockopt_optname (data)) == -1)
return -1;
if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
#ifndef G_OS_WIN32
- int flags;
+ gint flags;
flags = fcntl (((CamelTcpStreamRaw *)stream)->sockfd, F_GETFL);
if (flags == -1)
@@ -486,21 +486,21 @@ stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
return getsockopt (((CamelTcpStreamRaw *)stream)->sockfd,
get_sockopt_level (data),
optname,
- (void *) &data->value,
+ (gpointer) &data->value,
(socklen_t *) &optlen);
}
static int
stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
{
- int optname;
+ gint optname;
if ((optname = get_sockopt_optname (data)) == -1)
return -1;
if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
#ifndef G_OS_WIN32
- int flags, set;
+ gint flags, set;
flags = fcntl (((CamelTcpStreamRaw *)stream)->sockfd, F_GETFL);
if (flags == -1)
@@ -523,7 +523,7 @@ stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
return setsockopt (((CamelTcpStreamRaw *)stream)->sockfd,
get_sockopt_level (data),
optname,
- (void *) &data->value,
+ (gpointer) &data->value,
sizeof (data->value));
}
diff --git a/camel/camel-tcp-stream-raw.h b/camel/camel-tcp-stream-raw.h
index 929676c0a..ab24d5e40 100644
--- a/camel/camel-tcp-stream-raw.h
+++ b/camel/camel-tcp-stream-raw.h
@@ -37,9 +37,9 @@ struct _CamelTcpStreamRaw
{
CamelTcpStream parent_object;
- int sockfd;
+ gint sockfd;
#ifdef G_OS_WIN32
- int is_nonblocking;
+ gint is_nonblocking;
#endif
};
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 33ef72289..65918d02d 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -72,16 +72,16 @@ static CamelTcpStreamClass *parent_class = NULL;
/* Returns the class for a CamelTcpStreamSSL */
#define CTSS_CLASS(so) CAMEL_TCP_STREAM_SSL_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
static PRFileDesc *enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd);
-static int stream_connect (CamelTcpStream *stream, struct addrinfo *host);
-static int stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-static int stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
+static gint stream_connect (CamelTcpStream *stream, struct addrinfo *host);
+static gint stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
+static gint stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
static struct sockaddr *stream_get_local_address (CamelTcpStream *stream, socklen_t *len);
static struct sockaddr *stream_get_remote_address (CamelTcpStream *stream, socklen_t *len);
@@ -89,7 +89,7 @@ struct _CamelTcpStreamSSLPrivate {
PRFileDesc *sockfd;
struct _CamelSession *session;
- char *expected_host;
+ gchar *expected_host;
gboolean ssl_mode;
guint32 flags;
};
@@ -180,7 +180,7 @@ camel_tcp_stream_ssl_get_type (void)
* Returns: a new #CamelTcpStreamSSL stream preset in SSL mode
**/
CamelStream *
-camel_tcp_stream_ssl_new (CamelSession *session, const char *expected_host, guint32 flags)
+camel_tcp_stream_ssl_new (CamelSession *session, const gchar *expected_host, guint32 flags)
{
CamelTcpStreamSSL *stream;
@@ -214,7 +214,7 @@ camel_tcp_stream_ssl_new (CamelSession *session, const char *expected_host, guin
* Returns: a new #CamelTcpStreamSSL stream not yet toggled into SSL mode
**/
CamelStream *
-camel_tcp_stream_ssl_new_raw (CamelSession *session, const char *expected_host, guint32 flags)
+camel_tcp_stream_ssl_new_raw (CamelSession *session, const gchar *expected_host, guint32 flags)
{
CamelTcpStreamSSL *stream;
@@ -233,7 +233,7 @@ camel_tcp_stream_ssl_new_raw (CamelSession *session, const char *expected_host,
static void
-set_errno (int code)
+set_errno (gint code)
{
/* FIXME: this should handle more. */
switch (code) {
@@ -303,7 +303,7 @@ set_errno (int code)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *ssl)
{
PRFileDesc *fd;
@@ -336,7 +336,7 @@ camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *ssl)
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
PRFileDesc *cancel_fd;
@@ -360,7 +360,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
PRSocketOptionData sockopts;
PRPollDesc pollfds[2];
gboolean nonblock;
- int error;
+ gint error;
/* get O_NONBLOCK options */
sockopts.option = PR_SockOpt_Nonblocking;
@@ -419,7 +419,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
ssize_t w, written = 0;
@@ -448,7 +448,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
PRSocketOptionData sockopts;
PRPollDesc pollfds[2];
gboolean nonblock;
- int error;
+ gint error;
/* get O_NONBLOCK options */
sockopts.option = PR_SockOpt_Nonblocking;
@@ -540,7 +540,7 @@ stream_close (CamelStream *stream)
#if 0
/* Since this is default implementation, let NSS handle it. */
static SECStatus
-ssl_get_client_auth (void *data, PRFileDesc *sockfd,
+ssl_get_client_auth (gpointer data, PRFileDesc *sockfd,
struct CERTDistNamesStr *caNames,
struct CERTCertificateStr **pRetCert,
struct SECKEYPrivateKeyStr **pRetKey)
@@ -548,12 +548,12 @@ ssl_get_client_auth (void *data, PRFileDesc *sockfd,
SECStatus status = SECFailure;
SECKEYPrivateKey *privkey;
CERTCertificate *cert;
- void *proto_win;
+ gpointer proto_win;
proto_win = SSL_RevealPinArg (sockfd);
- if ((char *) data) {
- cert = PK11_FindCertFromNickname ((char *) data, proto_win);
+ if ((gchar *) data) {
+ cert = PK11_FindCertFromNickname ((gchar *) data, proto_win);
if (cert) {
privKey = PK11_FindKeyByAnyCert (cert, proto_win);
if (privkey) {
@@ -565,7 +565,7 @@ ssl_get_client_auth (void *data, PRFileDesc *sockfd,
} else {
/* no nickname given, automatically find the right cert */
CERTCertNicknames *names;
- int i;
+ gint i;
names = CERT_GetCertNicknames (CERT_GetDefaultCertDB (),
SEC_CERT_NICKNAMES_USER,
@@ -611,12 +611,12 @@ ssl_get_client_auth (void *data, PRFileDesc *sockfd,
#if 0
/* Since this is the default NSS implementation, no need for us to use this. */
static SECStatus
-ssl_auth_cert (void *data, PRFileDesc *sockfd, PRBool checksig, PRBool is_server)
+ssl_auth_cert (gpointer data, PRFileDesc *sockfd, PRBool checksig, PRBool is_server)
{
CERTCertificate *cert;
SECStatus status;
- void *pinarg;
- char *host;
+ gpointer pinarg;
+ gchar *host;
cert = SSL_PeerCertificate (sockfd);
pinarg = SSL_RevealPinArg (sockfd);
@@ -653,15 +653,15 @@ CamelCert *camel_certdb_nss_cert_get(CamelCertDB *certdb, CERTCertificate *cert)
CamelCert *camel_certdb_nss_cert_add(CamelCertDB *certdb, CERTCertificate *cert);
void camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate *cert);
-static char *
+static gchar *
cert_fingerprint(CERTCertificate *cert)
{
GChecksum *checksum;
guint8 *digest;
gsize length;
- unsigned char fingerprint[50], *f;
- int i;
- const char tohex[16] = "0123456789abcdef";
+ guchar fingerprint[50], *f;
+ gint i;
+ const gchar tohex[16] = "0123456789abcdef";
length = g_checksum_type_get_length (G_CHECKSUM_MD5);
digest = g_alloca (length);
@@ -672,7 +672,7 @@ cert_fingerprint(CERTCertificate *cert)
g_checksum_free (checksum);
for (i=0,f = fingerprint; i < length; i++) {
- unsigned int c = digest[i];
+ guint c = digest[i];
*f++ = tohex[(c >> 4) & 0xf];
*f++ = tohex[c & 0xf];
@@ -688,14 +688,14 @@ cert_fingerprint(CERTCertificate *cert)
fingerprint[47] = 0;
- return g_strdup((char*) fingerprint);
+ return g_strdup((gchar *) fingerprint);
}
/* lookup a cert uses fingerprint to index an on-disk file */
CamelCert *
camel_certdb_nss_cert_get(CamelCertDB *certdb, CERTCertificate *cert)
{
- char *fingerprint;
+ gchar *fingerprint;
CamelCert *ccert;
fingerprint = cert_fingerprint (cert);
@@ -754,7 +754,7 @@ CamelCert *
camel_certdb_nss_cert_add(CamelCertDB *certdb, CERTCertificate *cert)
{
CamelCert *ccert;
- char *fingerprint;
+ gchar *fingerprint;
fingerprint = cert_fingerprint(cert);
@@ -778,7 +778,7 @@ camel_certdb_nss_cert_add(CamelCertDB *certdb, CERTCertificate *cert)
void
camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate *cert)
{
- char *dir, *path, *fingerprint;
+ gchar *dir, *path, *fingerprint;
CamelStream *stream;
struct stat st;
@@ -806,7 +806,7 @@ camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate
stream = camel_stream_fs_new_with_name (path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (stream != NULL) {
- if (camel_stream_write (stream, (const char *) ccert->rawcert->data, ccert->rawcert->len) == -1) {
+ if (camel_stream_write (stream, (const gchar *) ccert->rawcert->data, ccert->rawcert->len) == -1) {
g_warning ("Could not save cert: %s: %s", path, g_strerror (errno));
g_unlink (path);
}
@@ -822,11 +822,11 @@ camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate
#if 0
/* used by the mozilla-like code below */
-static char *
+static gchar *
get_nickname(CERTCertificate *cert)
{
- char *server, *nick = NULL;
- int i;
+ gchar *server, *nick = NULL;
+ gint i;
PRBool status = PR_TRUE;
server = CERT_GetCommonName(&cert->subject);
@@ -848,12 +848,12 @@ get_nickname(CERTCertificate *cert)
#endif
static SECStatus
-ssl_bad_cert (void *data, PRFileDesc *sockfd)
+ssl_bad_cert (gpointer data, PRFileDesc *sockfd)
{
gboolean accept;
CamelCertDB *certdb = NULL;
CamelCert *ccert = NULL;
- char *prompt, *cert_str, *fingerprint;
+ gchar *prompt, *cert_str, *fingerprint;
CamelTcpStreamSSL *ssl;
CERTCertificate *cert;
SECStatus status = SECFailure;
@@ -909,18 +909,18 @@ ssl_bad_cert (void *data, PRFileDesc *sockfd)
return accept ? SECSuccess : SECFailure;
#if 0
- int i, error;
+ gint i, error;
CERTCertTrust trust;
SECItem *certs[1];
- int go = 1;
- char *host, *nick;
+ gint go = 1;
+ gchar *host, *nick;
error = PR_GetError();
/* This code is basically what mozilla does - however it doesn't seem to work here
very reliably :-/ */
while (go && status != SECSuccess) {
- char *prompt = NULL;
+ gchar *prompt = NULL;
printf("looping, error '%d'\n", error);
@@ -956,7 +956,7 @@ ssl_bad_cert (void *data, PRFileDesc *sockfd)
printf(" cert type %08x\n", cert->nsCertType);
- memset((void*)&trust, 0, sizeof(trust));
+ memset((gpointer)&trust, 0, sizeof(trust));
if (CERT_GetCertTrust(cert, &trust) != SECSuccess) {
CERT_DecodeTrustString(&trust, "P");
}
@@ -1074,8 +1074,8 @@ enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd)
SSL_SetURL (ssl_fd, ssl->priv->expected_host);
- /*SSL_GetClientAuthDataHook (sslSocket, ssl_get_client_auth, (void *) certNickname);*/
- /*SSL_AuthCertificateHook (ssl_fd, ssl_auth_cert, (void *) CERT_GetDefaultCertDB ());*/
+ /*SSL_GetClientAuthDataHook (sslSocket, ssl_get_client_auth, (gpointer) certNickname);*/
+ /*SSL_AuthCertificateHook (ssl_fd, ssl_auth_cert, (gpointer) CERT_GetDefaultCertDB ());*/
SSL_BadCertHook (ssl_fd, ssl_bad_cert, ssl);
ssl->priv->ssl_mode = TRUE;
@@ -1084,7 +1084,7 @@ enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd)
}
static int
-sockaddr_to_praddr(struct sockaddr *s, int len, PRNetAddr *addr)
+sockaddr_to_praddr(struct sockaddr *s, gint len, PRNetAddr *addr)
{
/* We assume the ip addresses are the same size - they have to be anyway.
We could probably just use memcpy *shrug* */
@@ -1146,7 +1146,7 @@ socket_connect(CamelTcpStream *stream, struct addrinfo *host)
ssl_fd = enable_ssl (ssl, fd);
if (ssl_fd == NULL) {
- int errnosave;
+ gint errnosave;
set_errno (PR_GetError ());
errnosave = errno;
@@ -1163,7 +1163,7 @@ socket_connect(CamelTcpStream *stream, struct addrinfo *host)
cancel_fd = camel_operation_cancel_prfd(NULL);
if (PR_Connect (fd, &netaddr, cancel_fd?0:CONNECT_TIMEOUT) == PR_FAILURE) {
- int errnosave;
+ gint errnosave;
set_errno (PR_GetError ());
if (PR_GetError () == PR_IN_PROGRESS_ERROR ||
@@ -1235,13 +1235,13 @@ stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
{
PRSocketOptionData sodata;
- memset ((void *) &sodata, 0, sizeof (sodata));
- memcpy ((void *) &sodata, (void *) data, sizeof (CamelSockOptData));
+ memset ((gpointer) &sodata, 0, sizeof (sodata));
+ memcpy ((gpointer) &sodata, (gpointer) data, sizeof (CamelSockOptData));
if (PR_GetSocketOption (((CamelTcpStreamSSL *)stream)->priv->sockfd, &sodata) == PR_FAILURE)
return -1;
- memcpy ((void *) data, (void *) &sodata, sizeof (CamelSockOptData));
+ memcpy ((gpointer) data, (gpointer) &sodata, sizeof (CamelSockOptData));
return 0;
}
@@ -1251,8 +1251,8 @@ stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
{
PRSocketOptionData sodata;
- memset ((void *) &sodata, 0, sizeof (sodata));
- memcpy ((void *) &sodata, (void *) data, sizeof (CamelSockOptData));
+ memset ((gpointer) &sodata, 0, sizeof (sodata));
+ memcpy ((gpointer) &sodata, (gpointer) data, sizeof (CamelSockOptData));
if (PR_SetSocketOption (((CamelTcpStreamSSL *)stream)->priv->sockfd, &sodata) == PR_FAILURE)
return -1;
diff --git a/camel/camel-tcp-stream-ssl.h b/camel/camel-tcp-stream-ssl.h
index 8681ab6b2..6cd7da192 100644
--- a/camel/camel-tcp-stream-ssl.h
+++ b/camel/camel-tcp-stream-ssl.h
@@ -56,11 +56,11 @@ typedef struct {
CamelType camel_tcp_stream_ssl_get_type (void);
/* public methods */
-CamelStream *camel_tcp_stream_ssl_new (struct _CamelSession *session, const char *expected_host, guint32 flags);
+CamelStream *camel_tcp_stream_ssl_new (struct _CamelSession *session, const gchar *expected_host, guint32 flags);
-CamelStream *camel_tcp_stream_ssl_new_raw (struct _CamelSession *session, const char *expected_host, guint32 flags);
+CamelStream *camel_tcp_stream_ssl_new_raw (struct _CamelSession *session, const gchar *expected_host, guint32 flags);
-int camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *ssl);
+gint camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *ssl);
G_END_DECLS
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
index 62c742368..38dbfc50a 100644
--- a/camel/camel-tcp-stream.c
+++ b/camel/camel-tcp-stream.c
@@ -35,9 +35,9 @@ static CamelStreamClass *parent_class = NULL;
/* Returns the class for a CamelTcpStream */
#define CTS_CLASS(so) CAMEL_TCP_STREAM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static int tcp_connect (CamelTcpStream *stream, struct addrinfo *host);
-static int tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-static int tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
+static gint tcp_connect (CamelTcpStream *stream, struct addrinfo *host);
+static gint tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
+static gint tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
static struct sockaddr *tcp_get_local_address (CamelTcpStream *stream, socklen_t *len);
static struct sockaddr *tcp_get_remote_address (CamelTcpStream *stream, socklen_t *len);
@@ -57,7 +57,7 @@ camel_tcp_stream_class_init (CamelTcpStreamClass *camel_tcp_stream_class)
}
static void
-camel_tcp_stream_init (void *o)
+camel_tcp_stream_init (gpointer o)
{
;
}
@@ -99,7 +99,7 @@ tcp_connect (CamelTcpStream *stream, struct addrinfo *host)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_tcp_stream_connect (CamelTcpStream *stream, struct addrinfo *host)
{
g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
@@ -123,7 +123,7 @@ tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
{
g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
@@ -147,7 +147,7 @@ tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
*
* Returns: %0 on success or %-1 on fail
**/
-int
+gint
camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
{
g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
diff --git a/camel/camel-tcp-stream.h b/camel/camel-tcp-stream.h
index 8102a5856..f310a0e3c 100644
--- a/camel/camel-tcp-stream.h
+++ b/camel/camel-tcp-stream.h
@@ -100,9 +100,9 @@ typedef struct {
CamelStreamClass parent_class;
/* Virtual methods */
- int (*connect) (CamelTcpStream *stream, struct addrinfo *host);
- int (*getsockopt) (CamelTcpStream *stream, CamelSockOptData *data);
- int (*setsockopt) (CamelTcpStream *stream, const CamelSockOptData *data);
+ gint (*connect) (CamelTcpStream *stream, struct addrinfo *host);
+ gint (*getsockopt) (CamelTcpStream *stream, CamelSockOptData *data);
+ gint (*setsockopt) (CamelTcpStream *stream, const CamelSockOptData *data);
struct sockaddr * (*get_local_address) (CamelTcpStream *stream, socklen_t *len);
struct sockaddr * (*get_remote_address) (CamelTcpStream *stream, socklen_t *len);
@@ -112,9 +112,9 @@ typedef struct {
CamelType camel_tcp_stream_get_type (void);
/* public methods */
-int camel_tcp_stream_connect (CamelTcpStream *stream, struct addrinfo *host);
-int camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-int camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
+gint camel_tcp_stream_connect (CamelTcpStream *stream, struct addrinfo *host);
+gint camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
+gint camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
struct sockaddr *camel_tcp_stream_get_local_address (CamelTcpStream *stream, socklen_t *len);
struct sockaddr *camel_tcp_stream_get_remote_address (CamelTcpStream *stream, socklen_t *len);
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index b1034c37f..e13bdd7d7 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -60,7 +60,7 @@
#define CAMEL_TEXT_INDEX_UNLOCK(kf, lock) \
(g_static_rec_mutex_unlock(&((CamelTextIndex *)kf)->priv->lock))
-static int text_index_compress_nosync(CamelIndex *idx);
+static gint text_index_compress_nosync(CamelIndex *idx);
/* ********************************************************************** */
@@ -73,7 +73,7 @@ struct _CamelTextIndexNamePrivate {
EMemPool *pool;
};
-CamelTextIndexName *camel_text_index_name_new(CamelTextIndex *idx, const char *name, camel_key_t nameid);
+CamelTextIndexName *camel_text_index_name_new(CamelTextIndex *idx, const gchar *name, camel_key_t nameid);
/* ****************************** */
@@ -83,12 +83,12 @@ struct _CamelTextIndexCursorPrivate {
camel_block_t first;
camel_block_t next;
- int record_index;
+ gint record_index;
size_t record_count;
camel_key_t *records;
- char *current;
+ gchar *current;
};
CamelTextIndexCursor *camel_text_index_cursor_new(CamelTextIndex *idx, camel_block_t data);
@@ -100,9 +100,9 @@ struct _CamelTextIndexKeyCursorPrivate {
CamelKeyTable *table;
camel_key_t keyid;
- unsigned int flags;
+ guint flags;
camel_block_t data;
- char *current;
+ gchar *current;
};
CamelTextIndexKeyCursor *camel_text_index_key_cursor_new(CamelTextIndex *idx, CamelKeyTable *table);
@@ -123,8 +123,8 @@ struct _CamelTextIndexPrivate {
CamelPartitionTable *name_hash;
/* Cache of words to write */
- int word_cache_limit;
- int word_cache_count;
+ gint word_cache_limit;
+ gint word_cache_count;
CamelDList word_cache;
GHashTable *words;
GStaticRecMutex lock;
@@ -153,8 +153,8 @@ struct _CamelTextIndexWord {
camel_block_t data; /* where the data starts */
camel_key_t wordid;
- char *word;
- unsigned int used;
+ gchar *word;
+ guint used;
camel_key_t names[32];
};
@@ -170,7 +170,7 @@ static CamelObjectClass *camel_text_index_parent;
/* call locked */
static void
-text_index_add_name_to_word(CamelIndex *idx, const char *word, camel_key_t nameid)
+text_index_add_name_to_word(CamelIndex *idx, const gchar *word, camel_key_t nameid)
{
struct _CamelTextIndexWord *w, *wp, *ww;
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
@@ -259,7 +259,7 @@ text_index_sync(CamelIndex *idx)
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
struct _CamelTextIndexWord *ww;
struct _CamelTextIndexRoot *rb;
- int ret = 0, wfrag, nfrag, work = FALSE;
+ gint ret = 0, wfrag, nfrag, work = FALSE;
d(printf("sync: blocks = %p\n", p->blocks));
@@ -323,9 +323,9 @@ text_index_sync(CamelIndex *idx)
return ret;
}
-static void tmp_name(const char *in, char *o)
+static void tmp_name(const gchar *in, gchar *o)
{
- char *s;
+ gchar *s;
s = strrchr(in, '/');
if (s) {
@@ -340,7 +340,7 @@ static void tmp_name(const char *in, char *o)
static int
text_index_compress(CamelIndex *idx)
{
- int ret;
+ gint ret;
CAMEL_TEXT_INDEX_LOCK(idx, lock);
@@ -361,12 +361,12 @@ text_index_compress_nosync(CamelIndex *idx)
struct _CamelTextIndexPrivate *newp, *oldp;
camel_key_t oldkeyid, newkeyid;
GHashTable *remap;
- unsigned int deleted;
+ guint deleted;
camel_block_t data, newdata;
- int i, ret = -1;
- char *name = NULL;
- unsigned int flags;
- char *newpath, *savepath, *oldpath;
+ gint i, ret = -1;
+ gchar *name = NULL;
+ guint flags;
+ gchar *newpath, *savepath, *oldpath;
size_t count, newcount;
camel_key_t *records, newrecords[256];
struct _CamelTextIndexRoot *rb;
@@ -493,7 +493,7 @@ text_index_compress_nosync(CamelIndex *idx)
/* If this fails, we'll pick up something during restart? */
ret = camel_index_rename((CamelIndex *)newidx, oldpath);
-#define myswap(a, b) { void *tmp = a; a = b; b = tmp; }
+#define myswap(a, b) { gpointer tmp = a; a = b; b = tmp; }
/* Poke the private data across to the new object */
/* And change the fd's over, etc? */
/* Yes: This is a hack */
@@ -529,7 +529,7 @@ static int
text_index_delete(CamelIndex *idx)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- int ret = 0;
+ gint ret = 0;
if (camel_block_file_delete(p->blocks) == -1)
ret = -1;
@@ -540,11 +540,11 @@ text_index_delete(CamelIndex *idx)
}
static int
-text_index_rename(CamelIndex *idx, const char *path)
+text_index_rename(CamelIndex *idx, const gchar *path)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- char *newlink, *newblock;
- int err, ret;
+ gchar *newlink, *newblock;
+ gint err, ret;
CAMEL_TEXT_INDEX_LOCK(idx, lock);
@@ -576,7 +576,7 @@ text_index_rename(CamelIndex *idx, const char *path)
}
static int
-text_index_has_name(CamelIndex *idx, const char *name)
+text_index_has_name(CamelIndex *idx, const gchar *name)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
@@ -584,7 +584,7 @@ text_index_has_name(CamelIndex *idx, const char *name)
}
static CamelIndexName *
-text_index_add_name(CamelIndex *idx, const char *name)
+text_index_add_name(CamelIndex *idx, const gchar *name)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
camel_key_t keyid;
@@ -629,7 +629,7 @@ text_index_add_name(CamelIndex *idx, const char *name)
/* call locked */
static void
-hash_write_word(char *word, void *data, CamelIndexName *idn)
+hash_write_word(gchar *word, gpointer data, CamelIndexName *idn)
{
CamelTextIndexName *tin = (CamelTextIndexName *)idn;
@@ -655,14 +655,14 @@ text_index_write_name(CamelIndex *idx, CamelIndexName *idn)
}
static CamelIndexCursor *
-text_index_find_name(CamelIndex *idx, const char *name)
+text_index_find_name(CamelIndex *idx, const gchar *name)
{
/* what was this for, umm */
return NULL;
}
static void
-text_index_delete_name(CamelIndex *idx, const char *name)
+text_index_delete_name(CamelIndex *idx, const gchar *name)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
camel_key_t keyid;
@@ -686,12 +686,12 @@ text_index_delete_name(CamelIndex *idx, const char *name)
}
static CamelIndexCursor *
-text_index_find(CamelIndex *idx, const char *word)
+text_index_find(CamelIndex *idx, const gchar *word)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
camel_key_t keyid;
camel_block_t data = 0;
- unsigned int flags;
+ guint flags;
CamelIndexCursor *idc;
CAMEL_TEXT_INDEX_LOCK(idx, lock);
@@ -816,10 +816,10 @@ camel_text_index_get_type(void)
return type;
}
-static char *
-text_index_normalise(CamelIndex *idx, const char *in, void *data)
+static gchar *
+text_index_normalise(CamelIndex *idx, const gchar *in, gpointer data)
{
- char *word;
+ gchar *word;
/* Sigh, this is really expensive */
/*g_utf8_normalize(in, strlen(in), G_NORMALIZE_ALL);*/
@@ -829,12 +829,12 @@ text_index_normalise(CamelIndex *idx, const char *in, void *data)
}
CamelTextIndex *
-camel_text_index_new(const char *path, int flags)
+camel_text_index_new(const gchar *path, gint flags)
{
CamelTextIndex *idx = (CamelTextIndex *)camel_object_new(camel_text_index_get_type());
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
struct _CamelTextIndexRoot *rb;
- char *link;
+ gchar *link;
CamelBlock *bl;
camel_index_construct((CamelIndex *)idx, path, flags);
@@ -913,10 +913,10 @@ fail:
}
/* returns 0 if the index exists, is valid, and synced, -1 otherwise */
-int
-camel_text_index_check(const char *path)
+gint
+camel_text_index_check(const gchar *path)
{
- char *block, *key;
+ gchar *block, *key;
CamelBlockFile *blocks;
CamelKeyFile *keys;
@@ -942,11 +942,11 @@ camel_text_index_check(const char *path)
return 0;
}
-int
-camel_text_index_rename(const char *old, const char *new)
+gint
+camel_text_index_rename(const gchar *old, const gchar *new)
{
- char *oldname, *newname;
- int err;
+ gchar *oldname, *newname;
+ gint err;
/* TODO: camel_text_index_rename should find out if we have an active index and use that instead */
@@ -973,11 +973,11 @@ camel_text_index_rename(const char *old, const char *new)
return 0;
}
-int
-camel_text_index_remove(const char *old)
+gint
+camel_text_index_remove(const gchar *old)
{
- char *block, *key;
- int ret = 0;
+ gchar *block, *key;
+ gint ret = 0;
/* TODO: needs to poke any active indices to remain unlinked */
@@ -1000,7 +1000,7 @@ camel_text_index_info(CamelTextIndex *idx)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
- int frag;
+ gint frag;
printf("Path: '%s'\n", idx->parent.path);
printf("Version: %u\n", idx->parent.version);
@@ -1027,7 +1027,7 @@ camel_text_index_info(CamelTextIndex *idx)
enum { KEY_ROOT = 1, KEY_DATA = 2, PARTITION_MAP = 4, PARTITION_DATA = 8 };
static void
-add_type(GHashTable *map, camel_block_t id, int type)
+add_type(GHashTable *map, camel_block_t id, gint type)
{
camel_block_t old;
@@ -1045,7 +1045,7 @@ add_partition(GHashTable *map, CamelBlockFile *blocks, camel_block_t id)
{
CamelBlock *bl;
CamelPartitionMapBlock *pm;
- int i;
+ gint i;
while (id) {
add_type(map, id, PARTITION_MAP);
@@ -1103,14 +1103,14 @@ add_keys(GHashTable *map, CamelBlockFile *blocks, camel_block_t id)
}
static void
-dump_raw(GHashTable *map, char *path)
+dump_raw(GHashTable *map, gchar *path)
{
- char buf[1024];
- char line[256];
- char *p, c, *e, *a, *o;
- int v, n, len, i, type;
- char hex[16] = "0123456789ABCDEF";
- int fd;
+ gchar buf[1024];
+ gchar line[256];
+ gchar *p, c, *e, *a, *o;
+ gint v, n, len, i, type;
+ gchar hex[16] = "0123456789ABCDEF";
+ gint fd;
camel_block_t id, total;
fd = g_open(path, O_RDONLY|O_BINARY, 0);
@@ -1203,9 +1203,9 @@ camel_text_index_dump(CamelTextIndex *idx)
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
#ifndef DUMP_RAW
camel_key_t keyid;
- char *word;
- const char *name;
- unsigned int flags;
+ gchar *word;
+ const gchar *name;
+ guint flags;
camel_block_t data;
/* Iterate over all names in the file first */
@@ -1242,7 +1242,7 @@ camel_text_index_dump(CamelTextIndex *idx)
GHashTable *block_type = g_hash_table_new(NULL, NULL);
camel_block_t id;
struct stat st;
- int type;
+ gint type;
add_keys(block_type, p->blocks, p->word_index->rootid);
add_keys(block_type, p->blocks, p->name_index->rootid);
@@ -1261,11 +1261,11 @@ camel_text_index_validate(CamelTextIndex *idx)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
camel_key_t keyid;
- char *word;
- const char *name;
- unsigned int flags;
+ gchar *word;
+ const gchar *name;
+ guint flags;
camel_block_t data;
- char *oldword;
+ gchar *oldword;
camel_key_t *records;
size_t count;
@@ -1345,7 +1345,7 @@ camel_text_index_validate(CamelTextIndex *idx)
if (g_hash_table_lookup(used, name) != NULL) {
printf("word '%s' uses word '%s' more than once\n", word, name);
} else {
- g_hash_table_insert(used, g_strdup(name), (void *)1);
+ g_hash_table_insert(used, g_strdup(name), (gpointer)1);
}
}
camel_object_unref((CamelObject *)idc);
@@ -1389,12 +1389,12 @@ static CamelIndexNameClass *camel_text_index_name_parent;
#define CIN_PRIVATE(o) (((CamelTextIndexName *)(o))->priv)
static void
-text_index_name_add_word(CamelIndexName *idn, const char *word)
+text_index_name_add_word(CamelIndexName *idn, const gchar *word)
{
struct _CamelTextIndexNamePrivate *p = ((CamelTextIndexName *)idn)->priv;
if (g_hash_table_lookup(idn->words, word) == NULL) {
- char *w = e_mempool_strdup(p->pool, word);
+ gchar *w = e_mempool_strdup(p->pool, word);
g_hash_table_insert(idn->words, w, w);
}
@@ -1405,12 +1405,12 @@ text_index_name_add_word(CamelIndexName *idn, const char *word)
Used to clean up utf8 before it gets further */
static inline guint32
-camel_utf8_next(const unsigned char **ptr, const unsigned char *ptrend)
+camel_utf8_next(const guchar **ptr, const guchar *ptrend)
{
- register unsigned char *p = (unsigned char *)*ptr;
- register unsigned int c;
+ register guchar *p = (guchar *)*ptr;
+ register guint c;
register guint32 v;
- int l;
+ gint l;
if (p == ptrend)
return 0;
@@ -1435,7 +1435,7 @@ camel_utf8_next(const unsigned char **ptr, const unsigned char *ptrend)
v = c & 0x01;
l = 5;
} else
- /* Invalid, ignore and look for next start char if room */
+ /* Invalid, ignore and look for next start gchar if room */
if (p == ptrend) {
return 0;
} else {
@@ -1452,26 +1452,26 @@ camel_utf8_next(const unsigned char **ptr, const unsigned char *ptrend)
v = (v << 6) | (c & 0x3f);
}
- /* valid char */
+ /* valid gchar */
if (l == 0) {
*ptr = p;
return v;
}
- /* else look for a start char again */
+ /* else look for a start gchar again */
}
return 0;
}
static size_t
-text_index_name_add_buffer(CamelIndexName *idn, const char *buffer, size_t len)
+text_index_name_add_buffer(CamelIndexName *idn, const gchar *buffer, size_t len)
{
CamelTextIndexNamePrivate *p = CIN_PRIVATE(idn);
- const unsigned char *ptr, *ptrend;
+ const guchar *ptr, *ptrend;
guint32 c;
- char utf8[8];
- int utf8len;
+ gchar utf8[8];
+ gint utf8len;
if (buffer == NULL) {
if (p->buffer->len) {
@@ -1481,8 +1481,8 @@ text_index_name_add_buffer(CamelIndexName *idn, const char *buffer, size_t len)
return 0;
}
- ptr = (const unsigned char *) buffer;
- ptrend = (const unsigned char *) buffer+len;
+ ptr = (const guchar *) buffer;
+ ptrend = (const guchar *) buffer+len;
while ((c = camel_utf8_next(&ptr, ptrend))) {
if (g_unichar_isalnum(c)) {
c = g_unichar_tolower(c);
@@ -1557,7 +1557,7 @@ camel_text_index_name_get_type(void)
}
CamelTextIndexName *
-camel_text_index_name_new(CamelTextIndex *idx, const char *name, camel_key_t nameid)
+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());
CamelIndexName *cin = &idn->parent;
@@ -1580,12 +1580,12 @@ static CamelIndexCursorClass *camel_text_index_cursor_parent;
#define CIC_CLASS(o) ((CamelTextIndexCursorClass *)(((CamelObject *)o)->classfuncs))
#define CIC_PRIVATE(o) (((CamelTextIndexCursor *)(o))->priv)
-static const char *
+static const gchar *
text_index_cursor_next(CamelIndexCursor *idc)
{
struct _CamelTextIndexCursorPrivate *p = CIC_PRIVATE(idc);
struct _CamelTextIndexPrivate *tip = CTI_PRIVATE(idc->index);
- unsigned int flags;
+ guint flags;
c(printf("Going to next cursor for word with data '%08x' next %08x\n", p->first, p->next));
@@ -1698,7 +1698,7 @@ static CamelIndexCursorClass *camel_text_index_key_cursor_parent;
#define CIKC_CLASS(o) ((CamelTextIndexKeyCursorClass *)(((CamelObject *)o)->classfuncs))
#define CIKC_PRIVATE(o) (((CamelTextIndexKeyCursor *)(o))->priv)
-static const char *
+static const gchar *
text_index_key_cursor_next(CamelIndexCursor *idc)
{
struct _CamelTextIndexKeyCursorPrivate *p = CIKC_PRIVATE(idc);
@@ -1815,12 +1815,12 @@ struct _CamelIndexRoot {
camel_block_t name_hash_root;
};
-char wordbuffer[] = "This is a buffer of multiple words. Some of the words are duplicates"
+gchar wordbuffer[] = "This is a buffer of multiple words. Some of the words are duplicates"
" while other words are the same, some are in difFerenT Different different case cAsE casE,"
" with,with:with;with-with'with\"'\"various punctuation as well. So much for those Words. and 10"
" numbers in a row too 1,2,3,4,5,6,7,8,9,10! Yay!.";
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
#if 0
CamelBlockFile *bs;
@@ -1829,15 +1829,15 @@ int main(int argc, char **argv)
CamelBlock *keyroot, *partroot;
struct _CamelIndexRoot *root;
FILE *fp;
- char line[256], *key;
+ gchar line[256], *key;
camel_key_t keyid;
- int index = 0, flags, data;
+ gint index = 0, flags, data;
#endif
CamelIndex *idx;
CamelIndexName *idn;
CamelIndexCursor *idc;
- const char *word;
- int i;
+ const gchar *word;
+ gint i;
printf("Camel text index tester!\n");
@@ -1854,7 +1854,7 @@ int main(int argc, char **argv)
#endif
for (i=0;i<100;i++) {
- char name[16];
+ gchar name[16];
sprintf(name, "%d", i);
printf("Adding words to name '%s'\n", name);
diff --git a/camel/camel-text-index.h b/camel/camel-text-index.h
index be9c29843..01b007887 100644
--- a/camel/camel-text-index.h
+++ b/camel/camel-text-index.h
@@ -44,7 +44,7 @@ typedef struct _CamelTextIndexCursorClass CamelTextIndexCursorClass;
typedef struct _CamelTextIndexKeyCursor CamelTextIndexKeyCursor;
typedef struct _CamelTextIndexKeyCursorClass CamelTextIndexKeyCursorClass;
-typedef void (*CamelTextIndexFunc)(CamelTextIndex *idx, const char *word, char *buffer);
+typedef void (*CamelTextIndexFunc)(CamelTextIndex *idx, const gchar *word, gchar *buffer);
/* ********************************************************************** */
@@ -101,12 +101,12 @@ struct _CamelTextIndexClass {
};
CamelType camel_text_index_get_type (void);
-CamelTextIndex *camel_text_index_new(const char *path, int flags);
+CamelTextIndex *camel_text_index_new(const gchar *path, gint flags);
/* static utility functions */
-int camel_text_index_check(const char *path);
-int camel_text_index_rename(const char *old, const char *new);
-int camel_text_index_remove(const char *old);
+gint camel_text_index_check(const gchar *path);
+gint camel_text_index_rename(const gchar *old, const gchar *new);
+gint camel_text_index_remove(const gchar *old);
void camel_text_index_dump(CamelTextIndex *idx);
void camel_text_index_info(CamelTextIndex *idx);
diff --git a/camel/camel-transport.c b/camel/camel-transport.c
index 4d631cb4d..c14ceec0d 100644
--- a/camel/camel-transport.c
+++ b/camel/camel-transport.c
@@ -37,8 +37,8 @@ static CamelServiceClass *parent_class = NULL;
/* Returns the class for a CamelTransport */
#define CT_CLASS(so) CAMEL_TRANSPORT_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static int transport_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int transport_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint transport_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint transport_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
static void
diff --git a/camel/camel-trie.c b/camel/camel-trie.c
index 14e4b81e0..55d36438b 100644
--- a/camel/camel-trie.c
+++ b/camel/camel-trie.c
@@ -35,8 +35,8 @@ struct _trie_state {
struct _trie_state *next;
struct _trie_state *fail;
struct _trie_match *match;
- unsigned int final;
- int id;
+ guint final;
+ gint id;
};
struct _trie_match {
@@ -61,11 +61,11 @@ struct _CamelTrie {
static inline gunichar
-trie_utf8_getc (const unsigned char **in, size_t inlen)
+trie_utf8_getc (const guchar **in, size_t inlen)
{
- register const unsigned char *inptr = *in;
- const unsigned char *inend = inptr + inlen;
- register unsigned char c, r;
+ register const guchar *inptr = *in;
+ const guchar *inend = inptr + inlen;
+ register guchar c, r;
register gunichar u, m;
if (inlen == 0)
@@ -161,7 +161,7 @@ g (struct _trie_state *s, gunichar c)
}
static struct _trie_state *
-trie_insert (CamelTrie *trie, int depth, struct _trie_state *q, gunichar c)
+trie_insert (CamelTrie *trie, gint depth, struct _trie_state *q, gunichar c)
{
struct _trie_match *m;
@@ -177,7 +177,7 @@ trie_insert (CamelTrie *trie, int depth, struct _trie_state *q, gunichar c)
q->id = -1;
if (trie->fail_states->len < depth + 1) {
- unsigned int size = trie->fail_states->len;
+ guint size = trie->fail_states->len;
size = MAX (size + 64, depth + 1);
g_ptr_array_set_size (trie->fail_states, size);
@@ -192,9 +192,9 @@ trie_insert (CamelTrie *trie, int depth, struct _trie_state *q, gunichar c)
#if d(!)0
static void
-dump_trie (struct _trie_state *s, int depth)
+dump_trie (struct _trie_state *s, gint depth)
{
- char *p = g_alloca ((depth * 2) + 1);
+ gchar *p = g_alloca ((depth * 2) + 1);
struct _trie_match *m;
memset (p, ' ', depth * 2);
@@ -239,10 +239,10 @@ dump_trie (struct _trie_state *s, int depth)
void
camel_trie_add (CamelTrie *trie, const gchar *pattern, gint pattern_id)
{
- const unsigned char *inptr = (const unsigned char *) pattern;
+ const guchar *inptr = (const guchar *) pattern;
struct _trie_state *q, *q1, *r;
struct _trie_match *m, *n;
- int i, depth = 0;
+ gint i, depth = 0;
gunichar c;
/* Step 1: add the pattern to the trie */
@@ -336,13 +336,13 @@ const gchar *
camel_trie_search (CamelTrie *trie, const gchar *buffer, gsize buflen,
gint *matched_id)
{
- const unsigned char *inptr, *inend, *prev, *pat;
+ const guchar *inptr, *inend, *prev, *pat;
register size_t inlen = buflen;
struct _trie_state *q;
struct _trie_match *m = NULL; /* init to please gcc */
gunichar c;
- inptr = (const unsigned char *) buffer;
+ inptr = (const guchar *) buffer;
inend = inptr + buflen;
q = &trie->root;
@@ -370,7 +370,7 @@ camel_trie_search (CamelTrie *trie, const gchar *buffer, gsize buflen,
if (matched_id)
*matched_id = q->id;
- return (const char *) pat;
+ return (const gchar *) pat;
}
}
}
diff --git a/camel/camel-uid-cache.c b/camel/camel-uid-cache.c
index 808a8ba36..e91e172d5 100644
--- a/camel/camel-uid-cache.c
+++ b/camel/camel-uid-cache.c
@@ -42,7 +42,7 @@
#include "camel-uid-cache.h"
struct _uid_state {
- int level;
+ gint level;
gboolean save;
};
@@ -58,12 +58,12 @@ struct _uid_state {
* Return value: a new UID cache, or %NULL
**/
CamelUIDCache *
-camel_uid_cache_new (const char *filename)
+camel_uid_cache_new (const gchar *filename)
{
CamelUIDCache *cache;
struct stat st;
- char *dirname, *buf, **uids;
- int fd, i;
+ gchar *dirname, *buf, **uids;
+ gint fd, i;
dirname = g_path_get_dirname (filename);
if (g_mkdir_with_parents (dirname, 0777) == -1) {
@@ -154,9 +154,9 @@ maybe_write_uid (gpointer key, gpointer value, gpointer data)
gboolean
camel_uid_cache_save (CamelUIDCache *cache)
{
- char *filename;
- int errnosav;
- int fd;
+ gchar *filename;
+ gint errnosav;
+ gint fd;
filename = g_strdup_printf ("%s~", cache->filename);
if ((fd = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666)) == -1) {
@@ -274,8 +274,8 @@ camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids)
{
GPtrArray *new_uids;
gpointer old_uid;
- char *uid;
- int i;
+ gchar *uid;
+ gint i;
new_uids = g_ptr_array_new ();
cache->level++;
@@ -284,7 +284,7 @@ camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids)
struct _uid_state *state;
uid = uids->pdata[i];
- if (g_hash_table_lookup_extended (cache->uids, uid, (void **)&old_uid, (void **)&state)) {
+ if (g_hash_table_lookup_extended (cache->uids, uid, (gpointer *)&old_uid, (gpointer *)&state)) {
g_hash_table_remove (cache->uids, uid);
g_free (old_uid);
} else {
@@ -309,14 +309,14 @@ camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids)
* Marks a uid for saving.
**/
void
-camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid)
+camel_uid_cache_save_uid (CamelUIDCache *cache, const gchar *uid)
{
struct _uid_state *state;
gpointer old_uid;
g_return_if_fail (uid != NULL);
- if (g_hash_table_lookup_extended (cache->uids, uid, (void **)&old_uid, (void **)&state)) {
+ if (g_hash_table_lookup_extended (cache->uids, uid, (gpointer *)&old_uid, (gpointer *)&state)) {
state->save = TRUE;
state->level = cache->level;
} else {
@@ -338,7 +338,7 @@ camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid)
void
camel_uid_cache_free_uids (GPtrArray *uids)
{
- int i;
+ gint i;
for (i = 0; i < uids->len; i++)
g_free (uids->pdata[i]);
diff --git a/camel/camel-uid-cache.h b/camel/camel-uid-cache.h
index 7368b6a29..742bbbce8 100644
--- a/camel/camel-uid-cache.h
+++ b/camel/camel-uid-cache.h
@@ -33,21 +33,21 @@
G_BEGIN_DECLS
typedef struct {
- char *filename;
+ gchar *filename;
GHashTable *uids;
- unsigned int level;
+ guint level;
size_t expired;
size_t size;
- int fd;
+ gint fd;
} CamelUIDCache;
-CamelUIDCache *camel_uid_cache_new (const char *filename);
+CamelUIDCache *camel_uid_cache_new (const gchar *filename);
gboolean camel_uid_cache_save (CamelUIDCache *cache);
void camel_uid_cache_destroy (CamelUIDCache *cache);
GPtrArray *camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids);
-void camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid);
+void camel_uid_cache_save_uid (CamelUIDCache *cache, const gchar *uid);
void camel_uid_cache_free_uids (GPtrArray *uids);
G_END_DECLS
diff --git a/camel/camel-url-scanner.c b/camel/camel-url-scanner.c
index b49c6d506..36da666b8 100644
--- a/camel/camel-url-scanner.c
+++ b/camel/camel-url-scanner.c
@@ -74,21 +74,21 @@ camel_url_scanner_add (CamelUrlScanner *scanner, urlpattern_t *pattern)
gboolean
-camel_url_scanner_scan (CamelUrlScanner *scanner, const char *in, size_t inlen, urlmatch_t *match)
+camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, size_t inlen, urlmatch_t *match)
{
- const char *pos;
- const unsigned char *inptr, *inend;
+ const gchar *pos;
+ const guchar *inptr, *inend;
urlpattern_t *pat;
- int pattern;
+ gint pattern;
g_return_val_if_fail (scanner != NULL, FALSE);
g_return_val_if_fail (in != NULL, FALSE);
- inptr = (const unsigned char *) in;
+ inptr = (const guchar *) in;
inend = inptr + inlen;
do {
- if (!(pos = camel_trie_search (scanner->trie, (const char *)inptr, inlen, &pattern)))
+ if (!(pos = camel_trie_search (scanner->trie, (const gchar *)inptr, inlen, &pattern)))
return FALSE;
pat = g_ptr_array_index (scanner->patterns, pattern);
@@ -96,10 +96,10 @@ camel_url_scanner_scan (CamelUrlScanner *scanner, const char *in, size_t inlen,
match->pattern = pat->pattern;
match->prefix = pat->prefix;
- if (pat->start (in, pos, (const char *)inend, match) && pat->end (in, pos, (const char *)inend, match))
+ if (pat->start (in, pos, (const gchar *)inend, match) && pat->end (in, pos, (const gchar *)inend, match))
return TRUE;
- inptr = (const unsigned char *) pos;
+ inptr = (const guchar *) pos;
if (camel_utf8_getc_limit (&inptr, inend) == 0xffff)
break;
@@ -110,7 +110,7 @@ camel_url_scanner_scan (CamelUrlScanner *scanner, const char *in, size_t inlen,
}
-static unsigned char url_scanner_table[256] = {
+static guchar url_scanner_table[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 1, 1, 9, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
24,128,160,128,128,128,128,128,160,160,128,128,160,192,160,160,
@@ -150,8 +150,8 @@ enum {
static const struct {
- const char open;
- const char close;
+ const gchar open;
+ const gchar close;
} url_braces[] = {
{ '(', ')' },
{ '{', '}' },
@@ -162,9 +162,9 @@ static const struct {
};
static gboolean
-is_open_brace (char c)
+is_open_brace (gchar c)
{
- int i;
+ gint i;
for (i = 0; i < G_N_ELEMENTS (url_braces); i++) {
if (c == url_braces[i].open)
@@ -175,9 +175,9 @@ is_open_brace (char c)
}
static char
-url_stop_at_brace (const char *in, size_t so, char *open_brace)
+url_stop_at_brace (const gchar *in, size_t so, gchar *open_brace)
{
- int i;
+ gint i;
if (open_brace != NULL)
*open_brace = '\0';
@@ -197,9 +197,9 @@ url_stop_at_brace (const char *in, size_t so, char *open_brace)
gboolean
-camel_url_addrspec_start (const char *in, const char *pos, const char *inend, urlmatch_t *match)
+camel_url_addrspec_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match)
{
- register const char *inptr = pos;
+ register const gchar *inptr = pos;
g_assert (*inptr == '@');
@@ -231,10 +231,10 @@ camel_url_addrspec_start (const char *in, const char *pos, const char *inend, ur
}
gboolean
-camel_url_addrspec_end (const char *in, const char *pos, const char *inend, urlmatch_t *match)
+camel_url_addrspec_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match)
{
- const char *inptr = pos;
- int parts = 0, digits;
+ const gchar *inptr = pos;
+ gint parts = 0, digits;
gboolean got_dot = FALSE;
g_assert (*inptr == '@');
@@ -292,7 +292,7 @@ camel_url_addrspec_end (const char *in, const char *pos, const char *inend, urlm
}
gboolean
-camel_url_file_start (const char *in, const char *pos, const char *inend, urlmatch_t *match)
+camel_url_file_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match)
{
match->um_so = (pos - in);
@@ -300,10 +300,10 @@ camel_url_file_start (const char *in, const char *pos, const char *inend, urlmat
}
gboolean
-camel_url_file_end (const char *in, const char *pos, const char *inend, urlmatch_t *match)
+camel_url_file_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match)
{
- register const char *inptr = pos;
- char close_brace;
+ register const gchar *inptr = pos;
+ gchar close_brace;
inptr += strlen (match->pattern);
@@ -324,7 +324,7 @@ camel_url_file_end (const char *in, const char *pos, const char *inend, urlmatch
}
gboolean
-camel_url_web_start (const char *in, const char *pos, const char *inend, urlmatch_t *match)
+camel_url_web_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match)
{
if (pos > in && !strncmp (pos, "www", 3)) {
/* make sure we aren't actually part of another word */
@@ -338,14 +338,14 @@ camel_url_web_start (const char *in, const char *pos, const char *inend, urlmatc
}
gboolean
-camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_t *match)
+camel_url_web_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match)
{
- register const char *inptr = pos;
+ register const gchar *inptr = pos;
gboolean passwd = FALSE;
- const char *save;
- char close_brace, open_brace;
- int brace_stack = 0;
- int port;
+ const gchar *save;
+ gchar close_brace, open_brace;
+ gint brace_stack = 0;
+ gint port;
inptr += strlen (match->pattern);
@@ -484,9 +484,9 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_
static void
-table_init_bits (unsigned int mask, const unsigned char *vals)
+table_init_bits (guint mask, const guchar *vals)
{
- int i;
+ gint i;
for (i = 0; vals[i] != '\0'; i++)
url_scanner_table[vals[i]] |= mask;
@@ -495,7 +495,7 @@ table_init_bits (unsigned int mask, const unsigned char *vals)
static void
url_scanner_table_init (void)
{
- int i;
+ gint i;
for (i = 0; i < 256; i++) {
url_scanner_table[i] = 0;
@@ -514,7 +514,7 @@ url_scanner_table_init (void)
/* not defined to be special in rfc0822, but when scanning
backwards to find the beginning of the email address we do
- not want to include this char if we come accross it - so
+ not want to include this gchar if we come accross it - so
this is kind of a hack */
url_scanner_table['/'] |= IS_SPECIAL;
@@ -523,13 +523,13 @@ url_scanner_table_init (void)
table_init_bits (IS_URLSAFE, CHARS_URLSAFE);
}
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
{
- int i;
+ gint i;
url_scanner_table_init ();
- printf ("static unsigned char url_scanner_table[256] = {");
+ printf ("static guchar url_scanner_table[256] = {");
for (i = 0; i < 256; i++) {
printf ("%s%3d%s", (i % 16) ? "" : "\n\t",
url_scanner_table[i], i != 255 ? "," : "\n");
diff --git a/camel/camel-url-scanner.h b/camel/camel-url-scanner.h
index 745645438..fc8cc74a2 100644
--- a/camel/camel-url-scanner.h
+++ b/camel/camel-url-scanner.h
@@ -30,25 +30,25 @@
G_BEGIN_DECLS
typedef struct {
- const char *pattern;
- const char *prefix;
+ const gchar *pattern;
+ const gchar *prefix;
off_t um_so;
off_t um_eo;
} urlmatch_t;
-typedef gboolean (*CamelUrlScanFunc) (const char *in, const char *pos, const char *inend, urlmatch_t *match);
+typedef gboolean (*CamelUrlScanFunc) (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
/* some default CamelUrlScanFunc's */
-gboolean camel_url_file_start (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_file_end (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_web_start (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_addrspec_start (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_addrspec_end (const char *in, const char *pos, const char *inend, urlmatch_t *match);
+gboolean camel_url_file_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
+gboolean camel_url_file_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
+gboolean camel_url_web_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
+gboolean camel_url_web_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
+gboolean camel_url_addrspec_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
+gboolean camel_url_addrspec_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
typedef struct {
- char *pattern;
- char *prefix;
+ gchar *pattern;
+ gchar *prefix;
CamelUrlScanFunc start;
CamelUrlScanFunc end;
} urlpattern_t;
@@ -60,7 +60,7 @@ void camel_url_scanner_free (CamelUrlScanner *scanner);
void camel_url_scanner_add (CamelUrlScanner *scanner, urlpattern_t *pattern);
-gboolean camel_url_scanner_scan (CamelUrlScanner *scanner, const char *in, size_t inlen, urlmatch_t *match);
+gboolean camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, size_t inlen, urlmatch_t *match);
G_END_DECLS
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 669c9630e..6bb2abe24 100644
--- a/camel/camel-url.c
+++ b/camel/camel-url.c
@@ -44,7 +44,7 @@
static void copy_param (GQuark key_id, gpointer data, gpointer user_data);
static void output_param (GQuark key_id, gpointer data, gpointer user_data);
-static void append_url_encoded (GString *str, const char *in, const char *extra_enc_chars);
+static void append_url_encoded (GString *str, const gchar *in, const gchar *extra_enc_chars);
/**
* camel_url_new_with_base:
@@ -56,12 +56,12 @@ static void append_url_encoded (GString *str, const char *in, const char *extra_
* Returns: a parsed #CamelURL
**/
CamelURL *
-camel_url_new_with_base (CamelURL *base, const char *url_string)
+camel_url_new_with_base (CamelURL *base, const gchar *url_string)
{
CamelURL *url;
- const char *start;
- const char *end, *hash, *colon, *semi, *at, *slash, *question;
- const char *p;
+ const gchar *start;
+ const gchar *end, *hash, *colon, *semi, *at, *slash, *question;
+ const gchar *p;
g_return_val_if_fail (url_string != NULL, NULL);
@@ -167,8 +167,8 @@ camel_url_new_with_base (CamelURL *base, const char *url_string)
semi = memchr (url_string, ';', end - url_string);
if (semi) {
if (semi[1]) {
- const char *cur, *p, *eq;
- char *name, *value;
+ const gchar *cur, *p, *eq;
+ gchar *name, *value;
for (cur = semi + 1; cur < end; cur = p + 1) {
p = memchr (cur, ';', end - cur);
@@ -222,7 +222,7 @@ camel_url_new_with_base (CamelURL *base, const char *url_string)
url->query = g_strdup (base->query);
}
} else if (*url->path != '/') {
- char *newpath, *last, *p, *q;
+ gchar *newpath, *last, *p, *q;
/* the base->path is NULL if given Content-Base url was without last slash,
i.e. like "http://example.com" (this expected only "http://example.com/") */
@@ -298,7 +298,7 @@ copy_param (GQuark key_id, gpointer data, gpointer user_data)
* Returns: a #CamelURL if it can be parsed, or %NULL otherwise
**/
CamelURL *
-camel_url_new (const char *url_string, CamelException *ex)
+camel_url_new (const gchar *url_string, CamelException *ex)
{
CamelURL *url;
@@ -326,11 +326,11 @@ camel_url_new (const char *url_string, CamelException *ex)
*
* Returns: a string representing @url, which the caller must free
**/
-char *
+gchar *
camel_url_to_string (CamelURL *url, guint32 flags)
{
GString *str;
- char *return_result;
+ gchar *return_result;
g_return_val_if_fail (url != NULL, NULL);
@@ -395,7 +395,7 @@ output_param (GQuark key_id, gpointer data, gpointer user_data)
g_string_append_c (str, ';');
append_url_encoded (str, g_quark_to_string (key_id), "?=");
- if (*(char *)data) {
+ if (*(gchar *)data) {
g_string_append_c (str, '=');
append_url_encoded (str, data, "?");
}
@@ -434,7 +434,7 @@ camel_url_free (CamelURL *url)
#define DEFINE_CAMEL_URL_SET(part) \
void \
-camel_url_set_##part (CamelURL *url, const char *part) \
+camel_url_set_##part (CamelURL *url, const gchar *part) \
{ \
g_return_if_fail (url != NULL); \
\
@@ -531,7 +531,7 @@ DEFINE_CAMEL_URL_SET (fragment)
* Set the port on a #CamelURL.
**/
void
-camel_url_set_port (CamelURL *url, int port)
+camel_url_set_port (CamelURL *url, gint port)
{
g_return_if_fail (url != NULL);
@@ -548,7 +548,7 @@ camel_url_set_port (CamelURL *url, int port)
* Set a param on the #CamelURL.
**/
void
-camel_url_set_param (CamelURL *url, const char *name, const char *value)
+camel_url_set_param (CamelURL *url, const gchar *name, const gchar *value)
{
g_return_if_fail (url != NULL);
@@ -568,8 +568,8 @@ camel_url_set_param (CamelURL *url, const char *name, const char *value)
*
* Returns: the value of a param if found or %NULL otherwise
**/
-const char *
-camel_url_get_param (CamelURL *url, const char *name)
+const gchar *
+camel_url_get_param (CamelURL *url, const gchar *name)
{
g_return_val_if_fail (url != NULL, NULL);
@@ -577,7 +577,7 @@ camel_url_get_param (CamelURL *url, const char *name)
}
/* From RFC 2396 2.4.3, the characters that should always be encoded */
-static const char url_encoded_char[] = {
+static const gchar url_encoded_char[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00 - 0x0f */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x10 - 0x1f */
1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ' ' - '/' */
@@ -597,9 +597,9 @@ static const char url_encoded_char[] = {
};
static void
-append_url_encoded (GString *str, const char *in, const char *extra_enc_chars)
+append_url_encoded (GString *str, const gchar *in, const gchar *extra_enc_chars)
{
- const unsigned char *s = (const unsigned char *)in;
+ const guchar *s = (const guchar *)in;
while (*s) {
if (url_encoded_char[*s] ||
@@ -621,11 +621,11 @@ append_url_encoded (GString *str, const char *in, const char *extra_enc_chars)
*
* Returns: the encoded string
**/
-char *
-camel_url_encode (const char *part, const char *escape_extra)
+gchar *
+camel_url_encode (const gchar *part, const gchar *escape_extra)
{
GString *str;
- char *encoded;
+ gchar *encoded;
g_return_val_if_fail (part != NULL, NULL);
@@ -646,15 +646,15 @@ camel_url_encode (const char *part, const char *escape_extra)
* be any additional space at the end of the string.
*/
void
-camel_url_decode (char *part)
+camel_url_decode (gchar *part)
{
- unsigned char *s, *d;
+ guchar *s, *d;
g_return_if_fail (part != NULL);
#define XDIGIT(c) ((c) <= '9' ? (c) - '0' : ((c) & 0x4F) - 'A' + 10)
- s = d = (unsigned char *)part;
+ s = d = (guchar *)part;
do {
if (*s == '%' && isxdigit(s[1]) && isxdigit(s[2])) {
*d++ = (XDIGIT (s[1]) << 4) + XDIGIT (s[2]);
@@ -666,7 +666,7 @@ camel_url_decode (char *part)
guint
-camel_url_hash (const void *v)
+camel_url_hash (gconstpointer v)
{
const CamelURL *u = v;
guint hash = 0;
@@ -685,7 +685,7 @@ camel_url_hash (const void *v)
}
static int
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
if (s2 == NULL)
@@ -700,8 +700,8 @@ check_equal (char *s1, char *s2)
return strcmp (s1, s2) == 0;
}
-int
-camel_url_equal(const void *v, const void *v2)
+gint
+camel_url_equal(gconstpointer v, gconstpointer v2)
{
const CamelURL *u1 = v, *u2 = v2;
@@ -747,13 +747,13 @@ camel_url_copy(const CamelURL *in)
return out;
}
-char *
-camel_url_decode_path (const char *path)
+gchar *
+camel_url_decode_path (const gchar *path)
{
gchar **comps;
- char *new_path = NULL;
+ gchar *new_path = NULL;
GString *str;
- int i = 0;
+ gint i = 0;
if (!path)
return g_strdup(""); /* ??? or NULL? */
diff --git a/camel/camel-url.h b/camel/camel-url.h
index f7e539fec..4b4cc9b90 100644
--- a/camel/camel-url.h
+++ b/camel/camel-url.h
@@ -34,16 +34,16 @@ G_BEGIN_DECLS
/* if this changes, remember to change camel_url_copy */
typedef struct _CamelURL {
- char *protocol;
- char *user;
- char *authmech;
- char *passwd;
- char *host;
- int port;
- char *path;
+ gchar *protocol;
+ gchar *user;
+ gchar *authmech;
+ gchar *passwd;
+ gchar *host;
+ gint port;
+ gchar *path;
GData *params;
- char *query;
- char *fragment;
+ gchar *query;
+ gchar *fragment;
} CamelURL;
#define CAMEL_URL_HIDE_PASSWORD (1 << 0)
@@ -52,32 +52,32 @@ typedef struct _CamelURL {
#define CAMEL_URL_HIDE_ALL (CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS | CAMEL_URL_HIDE_AUTH)
-CamelURL *camel_url_new_with_base (CamelURL *base, const char *url_string);
-CamelURL *camel_url_new (const char *url_string, CamelException *ex);
-char *camel_url_to_string (CamelURL *url, guint32 flags);
+CamelURL *camel_url_new_with_base (CamelURL *base, const gchar *url_string);
+CamelURL *camel_url_new (const gchar *url_string, CamelException *ex);
+gchar *camel_url_to_string (CamelURL *url, guint32 flags);
void camel_url_free (CamelURL *url);
-char *camel_url_encode (const char *part, const char *escape_extra);
-void camel_url_decode (char *part);
-char *camel_url_decode_path (const char *path);
+gchar *camel_url_encode (const gchar *part, const gchar *escape_extra);
+void camel_url_decode (gchar *part);
+gchar *camel_url_decode_path (const gchar *path);
/* for editing url's */
-void camel_url_set_protocol (CamelURL *url, const char *protocol);
-void camel_url_set_user (CamelURL *url, const char *user);
-void camel_url_set_authmech (CamelURL *url, const char *authmech);
-void camel_url_set_passwd (CamelURL *url, const char *passwd);
-void camel_url_set_host (CamelURL *url, const char *host);
-void camel_url_set_port (CamelURL *url, int port);
-void camel_url_set_path (CamelURL *url, const char *path);
-void camel_url_set_param (CamelURL *url, const char *name, const char *value);
-void camel_url_set_query (CamelURL *url, const char *query);
-void camel_url_set_fragment (CamelURL *url, const char *fragment);
+void camel_url_set_protocol (CamelURL *url, const gchar *protocol);
+void camel_url_set_user (CamelURL *url, const gchar *user);
+void camel_url_set_authmech (CamelURL *url, const gchar *authmech);
+void camel_url_set_passwd (CamelURL *url, const gchar *passwd);
+void camel_url_set_host (CamelURL *url, const gchar *host);
+void camel_url_set_port (CamelURL *url, gint port);
+void camel_url_set_path (CamelURL *url, const gchar *path);
+void camel_url_set_param (CamelURL *url, const gchar *name, const gchar *value);
+void camel_url_set_query (CamelURL *url, const gchar *query);
+void camel_url_set_fragment (CamelURL *url, const gchar *fragment);
-const char *camel_url_get_param (CamelURL *url, const char *name);
+const gchar *camel_url_get_param (CamelURL *url, const gchar *name);
/* for putting url's into hash tables */
-guint camel_url_hash (const void *v);
-int camel_url_equal(const void *v, const void *v2);
+guint camel_url_hash (gconstpointer v);
+gint camel_url_equal(gconstpointer v, gconstpointer v2);
CamelURL *camel_url_copy(const CamelURL *in);
G_END_DECLS
diff --git a/camel/camel-utf8.c b/camel/camel-utf8.c
index f0d5da12c..944378352 100644
--- a/camel/camel-utf8.c
+++ b/camel/camel-utf8.c
@@ -41,9 +41,9 @@
* be written to @ptr. @ptr will be advanced to the next character position.
**/
void
-camel_utf8_putc(unsigned char **ptr, guint32 c)
+camel_utf8_putc(guchar **ptr, guint32 c)
{
- register unsigned char *p = *ptr;
+ register guchar *p = *ptr;
if (c <= 0x7f)
*p++ = c;
@@ -77,10 +77,10 @@ camel_utf8_putc(unsigned char **ptr, guint32 c)
* the next character always.
**/
guint32
-camel_utf8_getc(const unsigned char **ptr)
+camel_utf8_getc(const guchar **ptr)
{
- register unsigned char *p = (unsigned char *)*ptr;
- register unsigned char c, r;
+ register guchar *p = (guchar *)*ptr;
+ register guchar c, r;
register guint32 v, m;
again:
@@ -118,19 +118,19 @@ loop:
* @ptr:
* @end: must not be NULL.
*
- * Get the next utf8 char at @ptr, and return it, advancing @ptr to
+ * Get the next utf8 gchar at @ptr, and return it, advancing @ptr to
* the next character. If @end is reached before a full utf8
- * character can be read, then the invalid Unicode char 0xffff is
+ * character can be read, then the invalid Unicode gchar 0xffff is
* returned as a sentinel (Unicode 3.1, section 2.7), and @ptr is not
* advanced.
*
* Return value: The next utf8 char, or 0xffff.
**/
guint32
-camel_utf8_getc_limit(const unsigned char **ptr, const unsigned char *end)
+camel_utf8_getc_limit(const guchar **ptr, const guchar *end)
{
- register unsigned char *p = (unsigned char *)*ptr;
- register unsigned char c, r;
+ register guchar *p = (guchar *)*ptr;
+ register guchar c, r;
register guint32 v = 0xffff, m;
again:
@@ -172,18 +172,18 @@ loop:
void
g_string_append_u(GString *out, guint32 c)
{
- unsigned char buffer[8];
- unsigned char *p = buffer;
+ guchar buffer[8];
+ guchar *p = buffer;
camel_utf8_putc(&p, c);
*p = 0;
- g_string_append(out, (const char *) buffer);
+ g_string_append(out, (const gchar *) buffer);
}
-static const char utf7_alphabet[] =
+static const gchar utf7_alphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
-static const unsigned char utf7_rank[256] = {
+static const guchar utf7_rank[256] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3e,0x3f,0xff,0xff,0xff,
@@ -213,16 +213,16 @@ static const unsigned char utf7_rank[256] = {
*
* Return value: The converted string.
**/
-char *
-camel_utf7_utf8(const char *ptr)
+gchar *
+camel_utf7_utf8(const gchar *ptr)
{
- const unsigned char *p = (unsigned char *)ptr;
- unsigned int c;
+ const guchar *p = (guchar *)ptr;
+ guint c;
guint32 v=0, x;
GString *out;
- int i=0;
- int state = 0;
- char *ret;
+ gint i=0;
+ gint state = 0;
+ gchar *ret;
out = g_string_new("");
do {
@@ -294,16 +294,16 @@ static void utf7_closeb64(GString *out, guint32 v, guint32 i)
*
* Return value:
**/
-char *
-camel_utf8_utf7(const char *ptr)
+gchar *
+camel_utf8_utf7(const gchar *ptr)
{
- const unsigned char *p = (unsigned char *)ptr;
- unsigned int c;
+ const guchar *p = (guchar *)ptr;
+ guint c;
guint32 x, v = 0;
- int state = 0;
+ gint state = 0;
GString *out;
- int i = 0;
- char *ret;
+ gint i = 0;
+ gchar *ret;
out = g_string_new("");
@@ -351,23 +351,23 @@ camel_utf8_utf7(const char *ptr)
*
* Return value:
**/
-char *
-camel_utf8_ucs2(const char *pptr)
+gchar *
+camel_utf8_ucs2(const gchar *pptr)
{
GByteArray *work = g_byte_array_new();
guint32 c;
- char *out;
- const unsigned char *ptr = (const unsigned char *) pptr;
+ gchar *out;
+ const guchar *ptr = (const guchar *) pptr;
/* what if c is > 0xffff ? */
while ( (c = camel_utf8_getc(&ptr)) ) {
guint16 s = g_htons(c);
- g_byte_array_append(work, (unsigned char *) &s, 2);
+ g_byte_array_append(work, (guchar *) &s, 2);
}
- g_byte_array_append(work, (unsigned char *) "\000\000", 2);
+ g_byte_array_append(work, (guchar *) "\000\000", 2);
out = g_malloc(work->len);
memcpy(out, work->data, work->len);
g_byte_array_free(work, TRUE);
@@ -384,12 +384,12 @@ camel_utf8_ucs2(const char *pptr)
*
* Return value:
**/
-char *camel_ucs2_utf8(const char *ptr)
+gchar *camel_ucs2_utf8(const gchar *ptr)
{
guint16 *ucs = (guint16 *)ptr;
guint32 c;
GString *work = g_string_new("");
- char *out;
+ gchar *out;
while ( (c = *ucs++) )
g_string_append_u(work, g_ntohs(c));
@@ -407,8 +407,8 @@ char *camel_ucs2_utf8(const char *ptr)
* Ensures the returned text will be valid UTF-8 string, with incorrect letters
* changed to question marks. Returned pointer should be freed with g_free.
**/
-char *
-camel_utf8_make_valid (const char *text)
+gchar *
+camel_utf8_make_valid (const gchar *text)
{
gchar *res = g_strdup (text), *p;
diff --git a/camel/camel-utf8.h b/camel/camel-utf8.h
index a67ff85ff..24c722136 100644
--- a/camel/camel-utf8.h
+++ b/camel/camel-utf8.h
@@ -25,23 +25,23 @@
G_BEGIN_DECLS
-void camel_utf8_putc(unsigned char **ptr, guint32 c);
-guint32 camel_utf8_getc(const unsigned char **ptr);
-guint32 camel_utf8_getc_limit (const unsigned char **ptr, const unsigned char *end);
+void camel_utf8_putc(guchar **ptr, guint32 c);
+guint32 camel_utf8_getc(const guchar **ptr);
+guint32 camel_utf8_getc_limit (const guchar **ptr, const guchar *end);
/* utility func for utf8 gstrings */
void g_string_append_u(GString *out, guint32 c);
/* convert utf7 to/from utf8, actually this is modified IMAP utf7 */
-char *camel_utf7_utf8(const char *ptr);
-char *camel_utf8_utf7(const char *ptr);
+gchar *camel_utf7_utf8(const gchar *ptr);
+gchar *camel_utf8_utf7(const gchar *ptr);
/* convert ucs2 to/from utf8 */
-char *camel_utf8_ucs2(const char *ptr);
-char *camel_ucs2_utf8(const char *ptr);
+gchar *camel_utf8_ucs2(const gchar *ptr);
+gchar *camel_ucs2_utf8(const gchar *ptr);
/* make valid utf8 string */
-char *camel_utf8_make_valid (const char *text);
+gchar *camel_utf8_make_valid (const gchar *text);
G_END_DECLS
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 9b004c46d..4ffb10477 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -62,26 +62,26 @@ static void vee_freeze(CamelFolder *folder);
static void vee_thaw(CamelFolder *folder);
static CamelMimeMessage *vee_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
-static void vee_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex);
+static void vee_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex);
static void vee_transfer_messages_to(CamelFolder *source, GPtrArray *uids, CamelFolder *dest, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex);
-static guint32 vee_count_by_expression(CamelFolder *folder, const char *expression, CamelException *ex);
-static GPtrArray *vee_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex);
-static GPtrArray *vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex);
+static guint32 vee_count_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex);
+static GPtrArray *vee_search_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex);
+static GPtrArray *vee_search_by_uids(CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex);
-static void vee_rename(CamelFolder *folder, const char *new);
+static void vee_rename(CamelFolder *folder, const gchar *new);
#endif
static void camel_vee_folder_class_init (CamelVeeFolderClass *klass);
static void camel_vee_folder_init (CamelVeeFolder *obj);
static void camel_vee_folder_finalise (CamelObject *obj);
-static int vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex);
+static gint vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex);
static void vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source);
static void folder_changed(CamelFolder *sub, CamelFolderChangeInfo *changes, CamelVeeFolder *vf);
-static void subfolder_deleted(CamelFolder *f, void *event_data, CamelVeeFolder *vf);
-static void folder_renamed(CamelFolder *f, const char *old, CamelVeeFolder *vf);
+static void subfolder_deleted(CamelFolder *f, gpointer event_data, CamelVeeFolder *vf);
+static void folder_renamed(CamelFolder *f, const gchar *old, CamelVeeFolder *vf);
static CamelFolderClass *camel_vee_folder_parent;
@@ -104,7 +104,7 @@ camel_vee_folder_get_type (void)
}
void
-camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *full, const char *name, guint32 flags)
+camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const gchar *full, const gchar *name, guint32 flags)
{
CamelFolder *folder = (CamelFolder *)vf;
@@ -128,16 +128,16 @@ camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const
* Return value: A new CamelVeeFolder widget.
**/
CamelFolder *
-camel_vee_folder_new(CamelStore *parent_store, const char *full, guint32 flags)
+camel_vee_folder_new(CamelStore *parent_store, const gchar *full, guint32 flags)
{
CamelVeeFolder *vf;
- char *tmp;
+ gchar *tmp;
if (CAMEL_IS_VEE_STORE(parent_store) && strcmp(full, CAMEL_UNMATCHED_NAME) == 0) {
vf = ((CamelVeeStore *)parent_store)->folder_unmatched;
camel_object_ref(vf);
} else {
- const char *name = strrchr(full, '/');
+ const gchar *name = strrchr(full, '/');
if (name == NULL)
name = full;
@@ -161,7 +161,7 @@ camel_vee_folder_new(CamelStore *parent_store, const char *full, guint32 flags)
}
void
-camel_vee_folder_set_expression(CamelVeeFolder *vf, const char *query)
+camel_vee_folder_set_expression(CamelVeeFolder *vf, const gchar *query)
{
((CamelVeeFolderClass *)((CamelObject *)vf)->klass)->set_expression(vf, query);
}
@@ -177,7 +177,7 @@ void
camel_vee_folder_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
{
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- int i;
+ gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
if (vf == (CamelVeeFolder *)sub) {
@@ -238,7 +238,7 @@ void
camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
{
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- int i;
+ gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
@@ -315,7 +315,7 @@ camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
*
* Rebuild the folder @sub, if it should be.
**/
-int
+gint
camel_vee_folder_rebuild_folder(CamelVeeFolder *vf, CamelFolder *sub, CamelException *ex)
{
return ((CamelVeeFolderClass *)((CamelObject *)vf)->klass)->rebuild_folder(vf, sub, ex);
@@ -379,14 +379,14 @@ camel_vee_folder_set_folders(CamelVeeFolder *vf, GList *folders)
* unique, and remain static for a given folder.
**/
void
-camel_vee_folder_hash_folder(CamelFolder *folder, char buffer[8])
+camel_vee_folder_hash_folder(CamelFolder *folder, gchar buffer[8])
{
GChecksum *checksum;
guint8 *digest;
gsize length;
- int state = 0, save = 0;
- char *tmp;
- int i;
+ gint state = 0, save = 0;
+ gchar *tmp;
+ gint i;
length = g_checksum_type_get_length (G_CHECKSUM_MD5);
digest = g_alloca (length);
@@ -423,7 +423,7 @@ camel_vee_folder_hash_folder(CamelFolder *folder, char buffer[8])
* Return value:
**/
CamelFolder *
-camel_vee_folder_get_location(CamelVeeFolder *vf, const CamelVeeMessageInfo *vinfo, char **realuid)
+camel_vee_folder_get_location(CamelVeeFolder *vf, const CamelVeeMessageInfo *vinfo, gchar **realuid)
{
CamelFolder *folder;
@@ -472,17 +472,17 @@ static void vee_refresh_info(CamelFolder *folder, CamelException *ex)
}
static guint32
-count_folder (CamelFolder *f, char *expr, CamelException *ex)
+count_folder (CamelFolder *f, gchar *expr, CamelException *ex)
{
return camel_folder_count_by_expression(f, expr, ex);
}
static int
-count_result (CamelFolderSummary *summary, char *query, CamelException *ex)
+count_result (CamelFolderSummary *summary, gchar *query, CamelException *ex)
{
CamelFolder *folder = summary->folder;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
guint32 count=0;
- char *expr = g_strdup_printf ("(and %s %s)", vf->expression ? vf->expression : "", query);
+ gchar *expr = g_strdup_printf ("(and %s %s)", vf->expression ? vf->expression : "", query);
GList *node;
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
@@ -502,7 +502,7 @@ summary_header_to_db (CamelFolderSummary *s, CamelException *ex)
{
CamelFIRecord * record = g_new0 (CamelFIRecord, 1);
CamelDB *db;
- char *table_name;
+ gchar *table_name;
guint32 visible, unread, deleted, junked, junked_not_deleted;
/* We do this during write, so lets use write handle, though we gonna read */
@@ -576,7 +576,7 @@ vee_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
camel_folder_sync(f, expunge, ex);
if (camel_exception_is_set(ex) && strncmp(camel_exception_get_description(ex), "no such table", 13)) {
- const char *desc;
+ const gchar *desc;
camel_object_get(f, NULL, CAMEL_OBJECT_DESCRIPTION, &desc, NULL);
camel_exception_setv(ex, ex->id, _("Error storing '%s': %s"), desc, ex->desc);
@@ -613,7 +613,7 @@ vee_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
#endif
if (vf->priv->unread_vfolder == 1) {
/* Cleanup Junk/Trash uids */
- int i, count;
+ gint i, count;
count = folder->summary->uids->len;
GSList *del = NULL;
@@ -646,7 +646,7 @@ vee_expunge (CamelFolder *folder, CamelException *ex)
}
static CamelMimeMessage *
-vee_get_message(CamelFolder *folder, const char *uid, CamelException *ex)
+vee_get_message(CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelVeeMessageInfo *mi;
CamelMimeMessage *msg = NULL;
@@ -665,10 +665,10 @@ vee_get_message(CamelFolder *folder, const char *uid, CamelException *ex)
}
static guint32
-vee_count_by_expression(CamelFolder *folder, const char *expression, CamelException *ex)
+vee_count_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex)
{
GList *node;
- char *expr;
+ gchar *expr;
guint32 count = 0;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
@@ -699,11 +699,11 @@ vee_count_by_expression(CamelFolder *folder, const char *expression, CamelExcept
return count;
}
static GPtrArray *
-vee_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex)
+vee_search_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex)
{
GList *node;
GPtrArray *matches, *result = g_ptr_array_new ();
- char *expr;
+ gchar *expr;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
GHashTable *searched = g_hash_table_new(NULL, NULL);
@@ -717,8 +717,8 @@ vee_search_by_expression(CamelFolder *folder, const char *expression, CamelExcep
node = p->folders;
while (node) {
CamelFolder *f = node->data;
- int i;
- char hash[8];
+ gint i;
+ gchar hash[8];
/* make sure we only search each folder once - for unmatched folder to work right */
if (g_hash_table_lookup(searched, f) == NULL) {
@@ -729,7 +729,7 @@ vee_search_by_expression(CamelFolder *folder, const char *expression, CamelExcep
}
if (matches) {
for (i = 0; i < matches->len; i++) {
- char *uid = matches->pdata[i], *vuid;
+ gchar *uid = matches->pdata[i], *vuid;
vuid = g_malloc(strlen(uid)+9);
memcpy(vuid, hash, 8);
@@ -753,12 +753,12 @@ vee_search_by_expression(CamelFolder *folder, const char *expression, CamelExcep
}
static GPtrArray *
-vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
+vee_search_by_uids(CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex)
{
GList *node;
GPtrArray *matches, *result = g_ptr_array_new ();
GPtrArray *folder_uids = g_ptr_array_new();
- char *expr;
+ gchar *expr;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
GHashTable *searched = g_hash_table_new(NULL, NULL);
@@ -769,8 +769,8 @@ vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids,
node = p->folders;
while (node) {
CamelFolder *f = node->data;
- int i;
- char hash[8];
+ gint i;
+ gchar hash[8];
/* make sure we only search each folder once - for unmatched folder to work right */
if (g_hash_table_lookup(searched, f) == NULL) {
@@ -779,7 +779,7 @@ vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids,
/* map the vfolder uid's to the source folder uid's first */
g_ptr_array_set_size(folder_uids, 0);
for (i=0;i<uids->len;i++) {
- char *uid = uids->pdata[i];
+ gchar *uid = uids->pdata[i];
if (strlen(uid) >= 8 && strncmp(uid, hash, 8) == 0)
g_ptr_array_add(folder_uids, uid+8);
@@ -788,7 +788,7 @@ vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids,
matches = camel_folder_search_by_uids(f, expr, folder_uids, ex);
if (matches) {
for (i = 0; i < matches->len; i++) {
- char *uid = matches->pdata[i], *vuid;
+ gchar *uid = matches->pdata[i], *vuid;
vuid = g_malloc(strlen(uid)+9);
memcpy(vuid, hash, 8);
@@ -816,7 +816,7 @@ vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids,
}
static void
-vee_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex)
+vee_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex)
{
camel_exception_set(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot copy or move messages into a Virtual Folder"));
}
@@ -827,7 +827,7 @@ vee_transfer_messages_to (CamelFolder *folder, GPtrArray *uids, CamelFolder *des
camel_exception_set(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot copy or move messages into a Virtual Folder"));
}
-static void vee_rename(CamelFolder *folder, const char *new)
+static void vee_rename(CamelFolder *folder, const gchar *new)
{
/*CamelVeeFolder *vf = (CamelVeeFolder *)folder;*/
@@ -869,7 +869,7 @@ static void vee_delete(CamelFolder *folder)
* The only current example of a correlating expression is one that uses
* "match-threads". */
static gboolean
-expression_is_correlating(const char *expr)
+expression_is_correlating(const gchar *expr)
{
/* XXX: Actually parse the expression to avoid triggering on
* "match-threads" in the text the user is searching for! */
@@ -878,27 +878,27 @@ expression_is_correlating(const char *expr)
/* must be called with summary_lock held */
static CamelVeeMessageInfo *
-vee_folder_add_uid(CamelVeeFolder *vf, CamelFolder *f, const char *inuid, const char hash[8])
+vee_folder_add_uid(CamelVeeFolder *vf, CamelFolder *f, const gchar *inuid, const gchar hash[8])
{
CamelVeeMessageInfo *mi = NULL;
- mi = camel_vee_summary_add((CamelVeeSummary *)((CamelFolder *)vf)->summary, f->summary, (char *)inuid, hash);
+ mi = camel_vee_summary_add((CamelVeeSummary *)((CamelFolder *)vf)->summary, f->summary, (gchar *)inuid, hash);
return mi;
}
static void
vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source)
{
- int i, count, n, still = FALSE, start, last;
- char *oldkey;
+ gint i, count, n, still = FALSE, start, last;
+ gchar *oldkey;
CamelFolder *folder = (CamelFolder *)vf;
- char hash[8];
+ gchar hash[8];
CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
- void *oldval;
+ gpointer oldval;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
GHashTable *unmatched_uids = vf->parent_vee_store ? vf->parent_vee_store->unmatched_uids : NULL;
CamelFolderSummary *ssummary = source->summary;
- int killun = FALSE;
+ gint killun = FALSE;
if (vf == folder_unmatched)
return;
@@ -956,7 +956,7 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source)
CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index(folder->summary, i);
if (mi) {
if (mi->summary == ssummary) {
- const char *uid = camel_message_info_uid(mi);
+ const gchar *uid = camel_message_info_uid(mi);
camel_folder_change_info_remove_uid(vf->changes, uid);
@@ -971,7 +971,7 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source)
}
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && folder_unmatched != NULL) {
if (still) {
- if (g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, &oldval)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, uid, (gpointer *)&oldkey, &oldval)) {
n = GPOINTER_TO_INT (oldval);
if (n == 1) {
CamelMessageInfo *tinfo;
@@ -986,7 +986,7 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source)
}
}
} else {
- if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, &oldval)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (gpointer *)&oldkey, &oldval)) {
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
}
@@ -1030,17 +1030,17 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source)
struct _update_data {
CamelFolder *source;
CamelVeeFolder *vf;
- char hash[8];
+ gchar hash[8];
CamelVeeFolder *folder_unmatched;
GHashTable *unmatched_uids;
gboolean rebuilt, correlating;
};
static void
-unmatched_check_uid(char *uidin, void *value, struct _update_data *u)
+unmatched_check_uid(gchar *uidin, gpointer value, struct _update_data *u)
{
- char *uid;
- int n;
+ gchar *uid;
+ gint n;
uid = alloca(strlen(uidin)+9);
memcpy(uid, u->hash, 8);
@@ -1061,12 +1061,12 @@ unmatched_check_uid(char *uidin, void *value, struct _update_data *u)
}
static void
-folder_added_uid(char *uidin, void *value, struct _update_data *u)
+folder_added_uid(gchar *uidin, gpointer value, struct _update_data *u)
{
CamelVeeMessageInfo *mi;
- char *oldkey;
- void *oldval;
- int n;
+ gchar *oldkey;
+ gpointer oldval;
+ gint n;
if ( (mi = vee_folder_add_uid(u->vf, u->source, uidin, u->hash)) ) {
camel_folder_change_info_add_uid(u->vf->changes, camel_message_info_uid(mi));
@@ -1074,9 +1074,9 @@ folder_added_uid(char *uidin, void *value, struct _update_data *u)
/* FIXME[disk-summary] Make all these as transactions, just
* testing atm */
if (u->rebuilt && !u->correlating)
- camel_db_add_to_vfolder_transaction (((CamelFolder *) u->vf)->parent_store->cdb_w, ((CamelFolder *) u->vf)->full_name, (char *) camel_message_info_uid(mi), NULL);
+ camel_db_add_to_vfolder_transaction (((CamelFolder *) u->vf)->parent_store->cdb_w, ((CamelFolder *) u->vf)->full_name, (gchar *) camel_message_info_uid(mi), NULL);
if (!CAMEL_IS_VEE_FOLDER(u->source) && u->unmatched_uids != NULL) {
- if (g_hash_table_lookup_extended(u->unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, &oldval)) {
+ if (g_hash_table_lookup_extended(u->unmatched_uids, camel_message_info_uid(mi), (gpointer *)&oldkey, &oldval)) {
n = GPOINTER_TO_INT (oldval);
g_hash_table_insert(u->unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
} else {
@@ -1096,14 +1096,14 @@ vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
GSList *del_list = NULL;
CamelFolder *f = source;
CamelFolder *folder = (CamelFolder *)vf;
- int i, n, count, start, last;
+ gint i, n, count, start, last;
struct _update_data u;
CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
GHashTable *unmatched_uids = vf->parent_vee_store ? vf->parent_vee_store->unmatched_uids : NULL;
CamelFolderSummary *ssummary = source->summary;
gboolean rebuilded = FALSE;
- char *shash;
+ gchar *shash;
/* Since the source of a correlating vfolder has to be requeried in
* full every time it changes, caching the results in the db is not
@@ -1188,8 +1188,8 @@ vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
if (mi) {
if (mi->summary == ssummary) {
- char *uid = (char *)camel_message_info_uid(mi), *oldkey;
- void *oldval;
+ gchar *uid = (gchar *)camel_message_info_uid(mi), *oldkey;
+ gpointer oldval;
if (g_hash_table_lookup(matchhash, uid+8) == NULL) {
if (last == -1) {
@@ -1204,7 +1204,7 @@ vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
camel_folder_change_info_remove_uid(vf->changes, camel_message_info_uid(mi));
if (!CAMEL_IS_VEE_FOLDER(source)
&& unmatched_uids != NULL
- && g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, &oldval)) {
+ && g_hash_table_lookup_extended(unmatched_uids, uid, (gpointer *)&oldkey, &oldval)) {
n = GPOINTER_TO_INT (oldval);
if (n == 1) {
g_hash_table_remove(unmatched_uids, oldkey);
@@ -1237,7 +1237,7 @@ vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
/* scan unmatched, remove any that have vanished, etc */
count = camel_folder_summary_count(((CamelFolder *)folder_unmatched)->summary);
for (i=0;i<count;i++) {
- char *uid = camel_folder_summary_uid_from_index (((CamelFolder *)folder_unmatched)->summary, i);
+ gchar *uid = camel_folder_summary_uid_from_index (((CamelFolder *)folder_unmatched)->summary, i);
if (uid) {
if (strncmp (uid, u.hash, 8) == 0) {
@@ -1312,14 +1312,14 @@ vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
/* Hold all these with summary lock and unmatched summary lock held */
static void
-folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], CamelVeeFolder *vf, gboolean use_db)
+folder_changed_add_uid(CamelFolder *sub, const gchar *uid, const gchar hash[8], CamelVeeFolder *vf, gboolean use_db)
{
CamelFolder *folder = (CamelFolder *)vf;
CamelVeeMessageInfo *vinfo;
- const char *vuid;
- char *oldkey;
- void *oldval;
- int n;
+ const gchar *vuid;
+ gchar *oldkey;
+ gpointer oldval;
+ gint n;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
GHashTable *unmatched_uids = vf->parent_vee_store ? vf->parent_vee_store->unmatched_uids : NULL;
@@ -1329,10 +1329,10 @@ folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], Ca
vuid = camel_message_info_uid(vinfo);
if (use_db)
- camel_db_add_to_vfolder_transaction (folder->parent_store->cdb_w, folder->full_name, (char *)vuid, NULL);
+ camel_db_add_to_vfolder_transaction (folder->parent_store->cdb_w, folder->full_name, (gchar *)vuid, NULL);
camel_folder_change_info_add_uid(vf->changes, vuid);
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub) && folder_unmatched != NULL) {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (gpointer *)&oldkey, &oldval)) {
n = GPOINTER_TO_INT (oldval);
g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
} else {
@@ -1349,12 +1349,12 @@ folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], Ca
}
static void
-folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8], int keep, CamelVeeFolder *vf, gboolean use_db)
+folder_changed_remove_uid(CamelFolder *sub, const gchar *uid, const gchar hash[8], gint keep, CamelVeeFolder *vf, gboolean use_db)
{
CamelFolder *folder = (CamelFolder *)vf;
- char *vuid, *oldkey;
- void *oldval;
- int n;
+ gchar *vuid, *oldkey;
+ gpointer oldval;
+ gint n;
CamelVeeMessageInfo *vinfo;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
GHashTable *unmatched_uids = vf->parent_vee_store ? vf->parent_vee_store->unmatched_uids : NULL;
@@ -1371,7 +1371,7 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub) && folder_unmatched != NULL) {
if (keep) {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (gpointer *)&oldkey, &oldval)) {
n = GPOINTER_TO_INT (oldval);
if (n == 1) {
g_hash_table_remove(unmatched_uids, oldkey);
@@ -1386,7 +1386,7 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
camel_folder_change_info_add_uid(folder_unmatched->changes, oldkey);
}
} else {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (gpointer *)&oldkey, &oldval)) {
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
}
@@ -1403,9 +1403,9 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
}
static void
-folder_changed_change_uid(CamelFolder *sub, const char *uid, const char hash[8], CamelVeeFolder *vf, gboolean use_db)
+folder_changed_change_uid(CamelFolder *sub, const gchar *uid, const gchar hash[8], CamelVeeFolder *vf, gboolean use_db)
{
- char *vuid;
+ gchar *vuid;
CamelVeeMessageInfo *vinfo, *uinfo = NULL;
CamelMessageInfo *info;
CamelFolder *folder = (CamelFolder *)vf;
@@ -1458,10 +1458,10 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
CamelFolder *folder = (CamelFolder *)m->vf;
CamelVeeFolder *vf = m->vf;
CamelFolderChangeInfo *changes = m->changes;
- char *vuid = NULL, hash[8];
- const char *uid;
+ gchar *vuid = NULL, hash[8];
+ const gchar *uid;
CamelVeeMessageInfo *vinfo;
- int i, vuidlen = 0;
+ gint i, vuidlen = 0;
CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
GPtrArray *matches_added = NULL, /* newly added, that match */
*matches_changed = NULL, /* newly changed, that now match */
@@ -1516,9 +1516,9 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
strcpy(vuid+8, uid);
vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, vuid);
if (vinfo == NULL) {
- g_ptr_array_add(newchanged, (char *)uid);
+ g_ptr_array_add(newchanged, (gchar *)uid);
} else {
- g_ptr_array_add(always_changed, (char *)uid);
+ g_ptr_array_add(always_changed, (gchar *)uid);
camel_message_info_free((CamelMessageInfo *)vinfo);
}
}
@@ -1544,7 +1544,7 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
/* Always remove removed uid's, in any case */
for (i=0;i<changes->uid_removed->len;i++) {
- dd(printf(" removing uid '%s'\n", (char *)changes->uid_removed->pdata[i]));
+ dd(printf(" removing uid '%s'\n", (gchar *)changes->uid_removed->pdata[i]));
folder_changed_remove_uid(sub, changes->uid_removed->pdata[i], hash, FALSE, vf, !correlating);
}
@@ -1552,13 +1552,13 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
if (matches_added) {
matches_hash = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<matches_added->len;i++) {
- dd(printf(" %s", (char *)matches_added->pdata[i]));
+ dd(printf(" %s", (gchar *)matches_added->pdata[i]));
g_hash_table_insert(matches_hash, matches_added->pdata[i], matches_added->pdata[i]);
}
for (i=0;i<changes->uid_added->len;i++) {
uid = changes->uid_added->pdata[i];
if (g_hash_table_lookup(matches_hash, uid)) {
- dd(printf(" adding uid '%s' [newly matched]\n", (char *)uid));
+ dd(printf(" adding uid '%s' [newly matched]\n", (gchar *)uid));
folder_changed_add_uid(sub, uid, hash, vf, !correlating);
} else if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
if (strlen(uid)+9 > vuidlen) {
@@ -1569,7 +1569,7 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
strcpy(vuid+8, uid);
if (!CAMEL_IS_VEE_FOLDER(sub) && folder_unmatched != NULL && g_hash_table_lookup(unmatched_uids, vuid) == NULL) {
- dd(printf(" adding uid '%s' to Unmatched [newly unmatched]\n", (char *)uid));
+ dd(printf(" adding uid '%s' to Unmatched [newly unmatched]\n", (gchar *)uid));
vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info((CamelFolder *)folder_unmatched, vuid);
if (vinfo == NULL) {
if (vee_folder_add_uid(folder_unmatched, sub, uid, hash))
@@ -1619,7 +1619,7 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
dd(printf(" Vfolder %supdate\nuids match:", (vf->flags & CAMEL_STORE_VEE_FOLDER_AUTO)?"auto-":""));
matches_hash = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;matches_changed && i<matches_changed->len;i++) {
- dd(printf(" %s", (char *)matches_changed->pdata[i]));
+ dd(printf(" %s", (gchar *)matches_changed->pdata[i]));
g_hash_table_insert(matches_hash, matches_changed->pdata[i], matches_changed->pdata[i]);
}
dd(printf("\n"));
@@ -1770,15 +1770,15 @@ folder_changed(CamelFolder *sub, CamelFolderChangeInfo *changes, CamelVeeFolder
/* track vanishing folders */
static void
-subfolder_deleted(CamelFolder *f, void *event_data, CamelVeeFolder *vf)
+subfolder_deleted(CamelFolder *f, gpointer event_data, CamelVeeFolder *vf)
{
camel_vee_folder_remove_folder(vf, f);
}
static void
-subfolder_renamed_update(CamelVeeFolder *vf, CamelFolder *sub, char hash[8])
+subfolder_renamed_update(CamelVeeFolder *vf, CamelFolder *sub, gchar hash[8])
{
- int count, i;
+ gint count, i;
CamelFolderChangeInfo *changes = NULL;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
GHashTable *unmatched_uids = vf->parent_vee_store ? vf->parent_vee_store->unmatched_uids : NULL;
@@ -1795,9 +1795,9 @@ subfolder_renamed_update(CamelVeeFolder *vf, CamelFolder *sub, char hash[8])
continue;
if (mi->summary == ssummary) {
- char *uid = (char *)camel_message_info_uid(mi);
- char *oldkey;
- void *oldval;
+ gchar *uid = (gchar *)camel_message_info_uid(mi);
+ gchar *oldkey;
+ gpointer oldval;
camel_folder_change_info_remove_uid(vf->changes, uid);
camel_folder_summary_remove(((CamelFolder *)vf)->summary, (CamelMessageInfo *)mi);
@@ -1812,7 +1812,7 @@ subfolder_renamed_update(CamelVeeFolder *vf, CamelFolder *sub, char hash[8])
/* check unmatched uid's table for any matches */
if (vf == folder_unmatched
- && g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, &oldval)) {
+ && g_hash_table_lookup_extended(unmatched_uids, uid, (gpointer *)&oldkey, &oldval)) {
g_hash_table_remove(unmatched_uids, oldkey);
g_hash_table_insert(unmatched_uids, g_strdup(camel_message_info_uid(vinfo)), oldval);
g_free(oldkey);
@@ -1837,9 +1837,9 @@ subfolder_renamed_update(CamelVeeFolder *vf, CamelFolder *sub, char hash[8])
}
static void
-folder_renamed_base(CamelVeeFolder *vf, CamelFolder *f, const char *old)
+folder_renamed_base(CamelVeeFolder *vf, CamelFolder *f, const gchar *old)
{
- char hash[8];
+ gchar hash[8];
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
/* TODO: This could probably be done in another thread, tho it is pretty quick/memory bound */
@@ -1855,7 +1855,7 @@ folder_renamed_base(CamelVeeFolder *vf, CamelFolder *f, const char *old)
}
static void
-folder_renamed(CamelFolder *sub, const char *old, CamelVeeFolder *vf)
+folder_renamed(CamelFolder *sub, const gchar *old, CamelVeeFolder *vf)
{
((CamelVeeFolderClass *)((CamelObject *)vf)->klass)->folder_renamed(vf, sub, old);
}
@@ -1916,7 +1916,7 @@ vee_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
static void
vee_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
{
- char *shash, hash[8];
+ gchar *shash, hash[8];
camel_vee_folder_hash_folder(sub, hash);
vee_folder_remove_folder(vf, sub);
@@ -1929,7 +1929,7 @@ vee_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
}
static void
-vee_set_expression(CamelVeeFolder *vf, const char *query)
+vee_set_expression(CamelVeeFolder *vf, const gchar *query)
{
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
GList *node;
@@ -1984,9 +1984,9 @@ vf_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- int i;
+ gint i;
guint32 tag;
- int unread = -1, deleted = 0, junked = 0, visible = 0, count = -1, junked_not_deleted = -1;
+ gint unread = -1, deleted = 0, junked = 0, visible = 0, count = -1, junked_not_deleted = -1;
for (i=0;i<args->argc;i++) {
@@ -2008,7 +2008,7 @@ vf_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
/* This is so we can get the values atomically, and also so we can calculate them only once */
if (unread == -1) {
- int j;
+ gint j;
CamelMessageInfoBase *info;
CamelVeeMessageInfo *vinfo;
@@ -2161,7 +2161,7 @@ static void
vee_folder_stop_folder(CamelVeeFolder *vf, CamelFolder *sub)
{
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- int i;
+ gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
diff --git a/camel/camel-vee-folder.h b/camel/camel-vee-folder.h
index 44fa4580a..6564e0411 100644
--- a/camel/camel-vee-folder.h
+++ b/camel/camel-vee-folder.h
@@ -41,7 +41,7 @@ struct _CamelVeeFolder {
struct _CamelVeeFolderPrivate *priv;
- char *expression; /* query expression */
+ gchar *expression; /* query expression */
guint32 flags; /* folder open flags */
@@ -63,34 +63,34 @@ struct _CamelVeeFolderClass {
void (*add_folder)(CamelVeeFolder *, CamelFolder *);
void (*remove_folder)(CamelVeeFolder *, CamelFolder *);
- int (*rebuild_folder)(CamelVeeFolder *, CamelFolder *, CamelException *);
+ gint (*rebuild_folder)(CamelVeeFolder *, CamelFolder *, CamelException *);
- void (*set_expression)(CamelVeeFolder *, const char *);
+ void (*set_expression)(CamelVeeFolder *, const gchar *);
/* Called for a folder-changed event on a source folder */
void (*folder_changed)(CamelVeeFolder *, CamelFolder *sub, CamelFolderChangeInfo *changes);
/* Called for a folder-renamed event on a source folder */
- void (*folder_renamed)(CamelVeeFolder *, CamelFolder *sub, const char *old);
+ void (*folder_renamed)(CamelVeeFolder *, CamelFolder *sub, const gchar *old);
};
#define CAMEL_UNMATCHED_NAME "UNMATCHED"
CamelType camel_vee_folder_get_type (void);
-CamelFolder *camel_vee_folder_new (CamelStore *parent_store, const char *full, guint32 flags);
-void camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *full, const char *name, guint32 flags);
+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);
-CamelFolder *camel_vee_folder_get_location(CamelVeeFolder *vf, const struct _CamelVeeMessageInfo *vinfo, char **realuid);
+CamelFolder *camel_vee_folder_get_location(CamelVeeFolder *vf, const struct _CamelVeeMessageInfo *vinfo, gchar **realuid);
void camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub);
void camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub);
void camel_vee_folder_set_folders (CamelVeeFolder *vf, GList *folders);
-int camel_vee_folder_rebuild_folder(CamelVeeFolder *vf, CamelFolder *sub, CamelException *ex);
-void camel_vee_folder_set_expression (CamelVeeFolder *vf, const char *expr);
+gint camel_vee_folder_rebuild_folder(CamelVeeFolder *vf, CamelFolder *sub, CamelException *ex);
+void camel_vee_folder_set_expression (CamelVeeFolder *vf, const gchar *expr);
void camel_vee_folder_mask_event_folder_changed (CamelVeeFolder *vf, CamelFolder *sub);
void camel_vee_folder_unmask_event_folder_changed (CamelVeeFolder *vf, CamelFolder *sub);
-void camel_vee_folder_hash_folder (CamelFolder *folder, char buffer[8]);
+void camel_vee_folder_hash_folder (CamelFolder *folder, gchar buffer[8]);
void camel_vee_folder_sync_headers (CamelFolder *vf, CamelException *ex);
G_END_DECLS
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index 9b1d28180..9d2e7aefe 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -36,15 +36,15 @@
#define d(x)
-static CamelFolder *vee_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static void vee_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void vee_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
+static CamelFolder *vee_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex);
+static void vee_delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void vee_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
-static void vee_sync (CamelStore *store, int expunge, CamelException *ex);
+static void vee_sync (CamelStore *store, gint expunge, CamelException *ex);
static CamelFolder *vee_get_trash (CamelStore *store, CamelException *ex);
static CamelFolder *vee_get_junk (CamelStore *store, CamelException *ex);
-static CamelFolderInfo *vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex);
+static CamelFolderInfo *vee_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
static void camel_vee_store_class_init (CamelVeeStoreClass *klass);
static void camel_vee_store_init (CamelVeeStore *obj);
@@ -118,7 +118,7 @@ construct (CamelService *service, CamelSession *session, CamelProvider *provider
}
static void
-cvs_free_unmatched(void *key, void *value, void *data)
+cvs_free_unmatched(gpointer key, gpointer value, gpointer data)
{
g_free(key);
}
@@ -156,10 +156,10 @@ camel_vee_store_new (void)
#define CHANGE_NOSELECT (2)
static void
-change_folder(CamelStore *store, const char *name, guint32 flags, int count)
+change_folder(CamelStore *store, const gchar *name, guint32 flags, gint count)
{
CamelFolderInfo *fi;
- const char *tmp;
+ const gchar *tmp;
CamelURL *url;
fi = camel_folder_info_new ();
@@ -187,11 +187,11 @@ change_folder(CamelStore *store, const char *name, guint32 flags, int count)
}
static CamelFolder *
-vee_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+vee_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelVeeFolder *vf;
CamelFolder *folder;
- char *name, *p;
+ gchar *name, *p;
vf = (CamelVeeFolder *)camel_vee_folder_new(store, folder_name, flags);
if (vf && ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0)) {
@@ -222,7 +222,7 @@ vee_get_folder (CamelStore *store, const char *folder_name, guint32 flags, Camel
}
static void
-vee_sync(CamelStore *store, int expunge, CamelException *ex)
+vee_sync(CamelStore *store, gint expunge, CamelException *ex)
{
/* noop */;
}
@@ -240,19 +240,19 @@ vee_get_junk (CamelStore *store, CamelException *ex)
}
static int
-vee_folder_cmp(const void *ap, const void *bp)
+vee_folder_cmp(gconstpointer ap, gconstpointer bp)
{
return strcmp(((CamelFolder **)ap)[0]->full_name, ((CamelFolder **)bp)[0]->full_name);
}
static CamelFolderInfo *
-vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+vee_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelFolderInfo *info, *res = NULL, *tail;
GPtrArray *folders;
GHashTable *infos_hash;
CamelURL *url;
- int i;
+ gint i;
d(printf("Get folder info '%s'\n", top?top:"<null>"));
@@ -261,16 +261,16 @@ vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExce
qsort(folders->pdata, folders->len, sizeof(folders->pdata[0]), vee_folder_cmp);
for (i=0;i<folders->len;i++) {
CamelVeeFolder *folder = folders->pdata[i];
- int add = FALSE;
- char *name = ((CamelFolder *)folder)->full_name, *pname, *tmp;
+ gint add = FALSE;
+ gchar *name = ((CamelFolder *)folder)->full_name, *pname, *tmp;
CamelFolderInfo *pinfo;
d(printf("folder '%s'\n", name));
/* check we have to include this one */
if (top) {
- int namelen = strlen(name);
- int toplen = strlen(top);
+ gint namelen = strlen(name);
+ gint toplen = strlen(top);
add = ((namelen == toplen
&& strcmp(name, top) == 0)
@@ -376,7 +376,7 @@ vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExce
}
static void
-vee_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+vee_delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelFolder *folder;
@@ -388,7 +388,7 @@ vee_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex
folder = camel_object_bag_get(store->folders, folder_name);
if (folder) {
- char *statefile;
+ gchar *statefile;
camel_object_get(folder, NULL, CAMEL_OBJECT_STATE_FILE, &statefile, NULL);
if (statefile) {
@@ -410,10 +410,10 @@ vee_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex
}
static void
-vee_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
+vee_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
CamelFolder *folder, *oldfolder;
- char *p, *name;
+ gchar *p, *name;
d(printf("vee rename folder '%s' '%s'\n", old, new));
diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c
index 1dfaf4dd3..a17d452e9 100644
--- a/camel/camel-vee-summary.c
+++ b/camel/camel-vee-summary.c
@@ -42,7 +42,7 @@
#define d(x)
static CamelFolderSummaryClass *camel_vee_summary_parent;
-const char *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;";
+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;";
static void
vee_message_info_free(CamelFolderSummary *s, CamelMessageInfo *info)
@@ -71,8 +71,8 @@ vee_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
#define HANDLE_NULL_INFO(value) if (!rmi) { d(g_warning (G_STRLOC ": real info is NULL for %s, safeguarding\n", mi->uid)); return value; }
-static const void *
-vee_info_ptr (const CamelMessageInfo *mi, int id)
+static gconstpointer
+vee_info_ptr (const CamelMessageInfo *mi, gint id)
{
CamelVeeMessageInfo *vmi = (CamelVeeMessageInfo *) mi;
CamelMessageInfo *rmi;
@@ -87,7 +87,7 @@ vee_info_ptr (const CamelMessageInfo *mi, int id)
}
static guint32
-vee_info_uint32(const CamelMessageInfo *mi, int id)
+vee_info_uint32(const CamelMessageInfo *mi, gint id)
{
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
guint32 ret;
@@ -103,7 +103,7 @@ vee_info_uint32(const CamelMessageInfo *mi, int id)
}
static time_t
-vee_info_time(const CamelMessageInfo *mi, int id)
+vee_info_time(const CamelMessageInfo *mi, gint id)
{
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
time_t ret;
@@ -116,7 +116,7 @@ vee_info_time(const CamelMessageInfo *mi, int id)
}
static gboolean
-vee_info_user_flag(const CamelMessageInfo *mi, const char *id)
+vee_info_user_flag(const CamelMessageInfo *mi, const gchar *id)
{
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
gboolean ret;
@@ -128,11 +128,11 @@ vee_info_user_flag(const CamelMessageInfo *mi, const char *id)
return ret;
}
-static const char *
-vee_info_user_tag(const CamelMessageInfo *mi, const char *id)
+static const gchar *
+vee_info_user_tag(const CamelMessageInfo *mi, const gchar *id)
{
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
- const char *ret;
+ const gchar *ret;
HANDLE_NULL_INFO("");
ret = camel_message_info_user_tag (rmi, id);
@@ -142,9 +142,9 @@ vee_info_user_tag(const CamelMessageInfo *mi, const char *id)
}
static gboolean
-vee_info_set_user_flag(CamelMessageInfo *mi, const char *name, gboolean value)
+vee_info_set_user_flag(CamelMessageInfo *mi, const gchar *name, gboolean value)
{
- int res = FALSE;
+ gint res = FALSE;
if (mi->uid) {
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
@@ -157,9 +157,9 @@ vee_info_set_user_flag(CamelMessageInfo *mi, const char *name, gboolean value)
}
static gboolean
-vee_info_set_user_tag(CamelMessageInfo *mi, const char *name, const char *value)
+vee_info_set_user_tag(CamelMessageInfo *mi, const gchar *name, const gchar *value)
{
- int res = FALSE;
+ gint res = FALSE;
if (mi->uid) {
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
@@ -174,9 +174,9 @@ vee_info_set_user_tag(CamelMessageInfo *mi, const char *name, const char *value)
void
camel_vee_summary_load_check_unread_vfolder (CamelVeeSummary *vs)
{
- static int only_once = FALSE;
- static char *exp = NULL;
- char *meta;
+ static gint only_once = FALSE;
+ static gchar *exp = NULL;
+ gchar *meta;
gboolean hacked_unread_folder = FALSE;
CamelVeeFolder *vf;
@@ -212,7 +212,7 @@ camel_vee_summary_load_check_unread_vfolder (CamelVeeSummary *vs)
static gboolean
vee_info_set_flags(CamelMessageInfo *mi, guint32 flags, guint32 set)
{
- int res = FALSE;
+ gint res = FALSE;
CamelVeeFolder *vf = (CamelVeeFolder *)mi->summary->folder;
gboolean hacked_unread_folder = FALSE;
@@ -225,7 +225,7 @@ vee_info_set_flags(CamelMessageInfo *mi, guint32 flags, guint32 set)
if (vf->priv->unread_vfolder == 1)
hacked_unread_folder = TRUE;
else {
- char *meta = camel_object_meta_get (mi->summary->folder, "vfolder:unread");
+ gchar *meta = camel_object_meta_get (mi->summary->folder, "vfolder:unread");
if (meta && strcmp (meta, "true") == 0)
hacked_unread_folder = TRUE;
g_free(meta);
@@ -310,7 +310,7 @@ vee_info_set_flags(CamelMessageInfo *mi, guint32 flags, guint32 set)
}
static CamelMessageInfo *
-message_info_from_uid (CamelFolderSummary *s, const char *uid)
+message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
{
CamelMessageInfo *info;
@@ -329,7 +329,7 @@ message_info_from_uid (CamelFolderSummary *s, const char *uid)
if (!info) {
CamelVeeMessageInfo *vinfo;
- char tmphash[9];
+ gchar tmphash[9];
/* This function isn't really nice. But no great way
* But in vfolder case, this may not be so bad, as vuid has the hash in first 8 bytes.
@@ -442,9 +442,9 @@ camel_vee_summary_new(CamelFolder *parent)
}
GPtrArray *
-camel_vee_summary_get_ids (CamelVeeSummary *summary, char hash[8])
+camel_vee_summary_get_ids (CamelVeeSummary *summary, gchar hash[8])
{
- char *shash = g_strdup_printf("%c%c%c%c%c%c%c%c", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7]);
+ gchar *shash = g_strdup_printf("%c%c%c%c%c%c%c%c", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7]);
CamelFolderSummary *cfs = (CamelFolderSummary *)summary;
GPtrArray *array;
@@ -457,10 +457,10 @@ camel_vee_summary_get_ids (CamelVeeSummary *summary, char hash[8])
}
CamelVeeMessageInfo *
-camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const char *uid, const char hash[8])
+camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const gchar *uid, const gchar hash[8])
{
CamelVeeMessageInfo *mi;
- char *vuid;
+ gchar *vuid;
GHashTable * fcache;
vuid = g_malloc(strlen(uid)+9);
memcpy(vuid, hash, 8);
@@ -488,7 +488,7 @@ camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const cha
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);
- mi->info.uid = (char *) camel_pstring_strdup (vuid);
+ mi->info.uid = (gchar *) camel_pstring_strdup (vuid);
g_free (vuid);
camel_message_info_ref (mi);
/* Get the flags and store it. We can use it a lot * /
diff --git a/camel/camel-vee-summary.h b/camel/camel-vee-summary.h
index 3889b1f8e..4718727c1 100644
--- a/camel/camel-vee-summary.h
+++ b/camel/camel-vee-summary.h
@@ -60,8 +60,8 @@ struct _CamelVeeSummaryClass {
CamelType camel_vee_summary_get_type (void);
CamelFolderSummary *camel_vee_summary_new(struct _CamelFolder *parent);
-CamelVeeMessageInfo * camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const char *uid, const char hash[8]);
-GPtrArray * camel_vee_summary_get_ids (CamelVeeSummary *summary, char hash[8]);
+CamelVeeMessageInfo * camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const gchar *uid, const gchar hash[8]);
+GPtrArray * camel_vee_summary_get_ids (CamelVeeSummary *summary, gchar hash[8]);
void camel_vee_summary_load_check_unread_vfolder (CamelVeeSummary *vs);
G_END_DECLS
diff --git a/camel/camel-vtrash-folder.c b/camel/camel-vtrash-folder.c
index 6a8a23015..261608bf4 100644
--- a/camel/camel-vtrash-folder.c
+++ b/camel/camel-vtrash-folder.c
@@ -43,13 +43,13 @@
#define CF_CLASS(so) ((CamelFolderClass *)((CamelObject *)(so))->klass)
static struct {
- const char *full_name;
- const char *name;
- const char *expr;
+ const gchar *full_name;
+ const gchar *name;
+ const gchar *expr;
guint32 bit;
guint32 flags;
- const char *error_copy;
- const char *db_col;
+ const gchar *error_copy;
+ const gchar *db_col;
} vdata[] = {
{ CAMEL_VTRASH_NAME, N_("Trash"), "(match-all (system-flag \"Deleted\"))", CAMEL_MESSAGE_DELETED, CAMEL_FOLDER_IS_TRASH,
N_("Cannot copy messages to the Trash folder"), "deleted" },
@@ -120,9 +120,9 @@ static int
vtrash_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
- int i;
+ gint i;
guint32 tag;
- int unread = -1, deleted = 0, junked = 0, visible = 0, count = -1, junked_not_deleted = -1;
+ gint unread = -1, deleted = 0, junked = 0, visible = 0, count = -1, junked_not_deleted = -1;
for (i=0;i<args->argc;i++) {
CamelArgGet *arg = &args->argv[i];
@@ -140,7 +140,7 @@ vtrash_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
/* This is so we can get the values atomically, and also so we can calculate them only once */
if (unread == -1) {
- int j;
+ gint j;
CamelMessageInfoBase *info;
CamelVeeMessageInfo *vinfo;
@@ -205,7 +205,7 @@ vtrash_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
static void
vtrash_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, "%s",
@@ -222,7 +222,7 @@ struct _transfer_data {
static void
transfer_messages(CamelFolder *folder, struct _transfer_data *md, CamelException *ex)
{
- int i;
+ gint i;
if (!camel_exception_is_set (ex))
camel_folder_transfer_messages_to(md->folder, md->uids, md->dest, NULL, md->delete, ex);
@@ -240,9 +240,9 @@ vtrash_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
gboolean delete_originals, CamelException *ex)
{
CamelVeeMessageInfo *mi;
- int i;
+ gint i;
GHashTable *batch = NULL;
- const char *tuid;
+ const gchar *tuid;
struct _transfer_data *md;
guint32 sbit = ((CamelVTrashFolder *)source)->bit;
@@ -277,7 +277,7 @@ vtrash_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
for (i = 0; i < uids->len; i++) {
mi = (CamelVeeMessageInfo *)camel_folder_get_message_info (source, uids->pdata[i]);
if (mi == NULL) {
- g_warning ("Cannot find uid %s in source folder during transfer", (char *) uids->pdata[i]);
+ g_warning ("Cannot find uid %s in source folder during transfer", (gchar *) uids->pdata[i]);
continue;
}
@@ -313,7 +313,7 @@ vtrash_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
/* FIXME[disk-summary] rewrite the same way as camel-vee-summary.c */
static GPtrArray *
-vtrash_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex)
+vtrash_search_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex)
{
GList *node;
GPtrArray *matches, *result = g_ptr_array_new(), *uids = g_ptr_array_new();
@@ -325,8 +325,8 @@ vtrash_search_by_expression(CamelFolder *folder, const char *expression, CamelEx
node = p->folders;
while (node) {
CamelFolder *f = node->data;
- int i;
- char hash[8];
+ gint i;
+ gchar hash[8];
camel_vee_folder_hash_folder(f, hash);
@@ -336,7 +336,7 @@ vtrash_search_by_expression(CamelFolder *folder, const char *expression, CamelEx
continue;
/* if (camel_message_info_flags(mi) & ((CamelVTrashFolder *)folder)->bit) */
if (vmi->summary == f->summary) /* Belongs to this folder */
- g_ptr_array_add(uids, (void *)camel_pstring_strdup(infos->pdata[i]+8));
+ g_ptr_array_add(uids, (gpointer)camel_pstring_strdup(infos->pdata[i]+8));
camel_message_info_free (vmi);
}
@@ -345,7 +345,7 @@ vtrash_search_by_expression(CamelFolder *folder, const char *expression, CamelEx
if (uids->len > 0
&& (matches = camel_folder_search_by_uids(f, expression, uids, NULL))) {
for (i = 0; i < matches->len; i++) {
- char *uid = matches->pdata[i], *vuid;
+ gchar *uid = matches->pdata[i], *vuid;
vuid = g_malloc(strlen(uid)+9);
memcpy(vuid, hash, 8);
@@ -369,7 +369,7 @@ vtrash_search_by_expression(CamelFolder *folder, const char *expression, CamelEx
}
static GPtrArray *
-vtrash_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
+vtrash_search_by_uids(CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex)
{
GList *node;
GPtrArray *matches, *result = g_ptr_array_new(), *folder_uids = g_ptr_array_new();
@@ -380,8 +380,8 @@ vtrash_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *ui
node = p->folders;
while (node) {
CamelFolder *f = node->data;
- int i;
- char hash[8];
+ gint i;
+ gchar hash[8];
camel_vee_folder_hash_folder(f, hash);
@@ -390,7 +390,7 @@ vtrash_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *ui
/*g_ptr_array_set_size(uids, 0);*/
g_ptr_array_set_size (folder_uids, 0);
for (i=0;i<uids->len;i++) {
- char *uid = uids->pdata[i];
+ gchar *uid = uids->pdata[i];
/*if (strlen(uid) >= 8 && strncmp(uid, hash, 8) == 0) {*/
if (strncmp(uid, hash, 8) == 0) {
@@ -411,7 +411,7 @@ vtrash_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *ui
if (folder_uids->len > 0
&& (matches = camel_folder_search_by_uids(f, expression, folder_uids, ex))) {
for (i = 0; i < matches->len; i++) {
- char *uid = matches->pdata[i], *vuid;
+ gchar *uid = matches->pdata[i], *vuid;
vuid = g_malloc(strlen(uid)+9);
memcpy(vuid, hash, 8);
@@ -432,9 +432,9 @@ vtrash_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *ui
}
static void
-vtrash_uid_removed(CamelVTrashFolder *vf, const char *uid, char hash[8])
+vtrash_uid_removed(CamelVTrashFolder *vf, const gchar *uid, gchar hash[8])
{
- char *vuid;
+ gchar *vuid;
vuid = g_alloca(strlen(uid)+9);
memcpy(vuid, hash, 8);
@@ -444,9 +444,9 @@ vtrash_uid_removed(CamelVTrashFolder *vf, const char *uid, char hash[8])
}
static void
-vtrash_uid_added(CamelVTrashFolder *vf, const char *uid, CamelFolderSummary *ssummary, char hash[8])
+vtrash_uid_added(CamelVTrashFolder *vf, const gchar *uid, CamelFolderSummary *ssummary, gchar hash[8])
{
- char *vuid;
+ gchar *vuid;
CamelVeeMessageInfo *vinfo;
vuid = g_alloca(strlen(uid)+9);
@@ -467,9 +467,9 @@ static void
vtrash_folder_changed(CamelVeeFolder *vf, CamelFolder *sub, CamelFolderChangeInfo *changes)
{
CamelMessageInfo *info;
- char hash[8];
+ gchar hash[8];
CamelFolderChangeInfo *vf_changes = NULL;
- int i;
+ gint i;
camel_vee_folder_hash_folder(sub, hash);
@@ -477,11 +477,11 @@ vtrash_folder_changed(CamelVeeFolder *vf, CamelFolder *sub, CamelFolderChangeInf
/* remove any removed that we also have */
for (i=0;i<changes->uid_removed->len;i++)
- vtrash_uid_removed((CamelVTrashFolder *)vf, (const char *)changes->uid_removed->pdata[i], hash);
+ vtrash_uid_removed((CamelVTrashFolder *)vf, (const gchar *)changes->uid_removed->pdata[i], hash);
/* check any changed still deleted/junked */
for (i=0;i<changes->uid_changed->len;i++) {
- const char *uid = changes->uid_changed->pdata[i];
+ const gchar *uid = changes->uid_changed->pdata[i];
info = camel_folder_get_message_info(sub, uid);
if (info == NULL)
@@ -497,7 +497,7 @@ vtrash_folder_changed(CamelVeeFolder *vf, CamelFolder *sub, CamelFolderChangeInf
/* add any new ones which are already matching */
for (i=0;i<changes->uid_added->len;i++) {
- const char *uid = changes->uid_added->pdata[i];
+ const gchar *uid = changes->uid_added->pdata[i];
info = camel_folder_get_message_info(sub, uid);
if (info == NULL)
@@ -526,8 +526,8 @@ static void
vtrash_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
{
GPtrArray *infos=NULL;
- int i;
- char hash[8], *shash;
+ gint i;
+ gchar hash[8], *shash;
CamelFolderChangeInfo *vf_changes = NULL;
camel_vee_folder_hash_folder(sub, hash);
@@ -554,7 +554,7 @@ vtrash_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
}
for (i=0;i<infos->len;i++) {
- char *uid = infos->pdata[i];
+ gchar *uid = infos->pdata[i];
vtrash_uid_added((CamelVTrashFolder *)vf, uid, sub->summary, hash);
}
@@ -580,11 +580,11 @@ static void
vtrash_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
{
GPtrArray *infos;
- int i;
- char hash[8], *shash;
+ gint i;
+ gchar hash[8], *shash;
CamelFolderChangeInfo *vf_changes = NULL;
CamelFolderSummary *ssummary = sub->summary;
- int start, last;
+ gint start, last;
@@ -604,7 +604,7 @@ vtrash_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
}
if (mi->summary == ssummary) {
- const char *uid = camel_message_info_uid(mi);
+ const gchar *uid = camel_message_info_uid(mi);
camel_folder_change_info_remove_uid(vf->changes, uid);
diff --git a/camel/camel-win32.c b/camel/camel-win32.c
index c08068837..e665fa6a1 100644
--- a/camel/camel-win32.c
+++ b/camel/camel-win32.c
@@ -40,11 +40,11 @@ G_LOCK_DEFINE_STATIC (mutex);
/* localedir uses system codepage as it is passed to the non-UTF8ified
* gettext library
*/
-static const char *localedir = NULL;
+static const gchar *localedir = NULL;
/* The others are in UTF-8 */
-static const char *libexecdir;
-static const char *providerdir;
+static const gchar *libexecdir;
+static const gchar *providerdir;
static void
setup (void)
@@ -66,7 +66,7 @@ setup (void)
#include "camel-private.h" /* For prototypes */
#define GETTER(varbl) \
-const char * \
+const gchar * \
_camel_get_##varbl (void) \
{ \
setup (); \
diff --git a/camel/camel.c b/camel/camel.c
index aaef8adf7..644c878b3 100644
--- a/camel/camel.c
+++ b/camel/camel.c
@@ -56,15 +56,15 @@ PRLock *nss_initlock = NULL;
volatile gboolean nss_initialized = FALSE;
#endif
-static int initialised = FALSE;
+static gint initialised = FALSE;
-int camel_application_is_exiting = FALSE;
+gint camel_application_is_exiting = FALSE;
-int
-camel_init (const char *configdir, gboolean nss_init)
+gint
+camel_init (const gchar *configdir, gboolean nss_init)
{
CamelCertDB *certdb;
- char *path;
+ gchar *path;
if (initialised)
return 0;
@@ -79,7 +79,7 @@ camel_init (const char *configdir, gboolean nss_init)
#ifdef HAVE_NSS
if (nss_init) {
- char *nss_configdir;
+ gchar *nss_configdir;
PRUint16 indx;
if (nss_initlock == NULL) {
diff --git a/camel/camel.h b/camel/camel.h
index 4293a0694..9c80a36cf 100644
--- a/camel/camel.h
+++ b/camel/camel.h
@@ -142,7 +142,7 @@
G_BEGIN_DECLS
-int camel_init (const char *certdb_dir, gboolean nss_init);
+gint camel_init (const gchar *certdb_dir, gboolean nss_init);
void camel_shutdown (void);
G_END_DECLS
diff --git a/camel/db-scrap-tools/db.c b/camel/db-scrap-tools/db.c
index 5569c002b..1aaccb8e8 100644
--- a/camel/db-scrap-tools/db.c
+++ b/camel/db-scrap-tools/db.c
@@ -7,9 +7,9 @@
sqlite3 *db;
static int
-callback (void *data, int argc, char **argv, char **azColName)
+callback (gpointer data, gint argc, gchar **argv, gchar **azColName)
{
- int i;
+ gint i;
for(i=0; i<argc; i++) {
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
@@ -19,10 +19,10 @@ callback (void *data, int argc, char **argv, char **azColName)
}
static int
-select_stmt (const char* stmt) {
- char *errmsg;
- int ret;
- int nrecs = 0;
+select_stmt (const gchar * stmt) {
+ gchar *errmsg;
+ gint ret;
+ gint nrecs = 0;
ret = sqlite3_exec(db, stmt, callback, &nrecs, &errmsg);
@@ -36,9 +36,9 @@ select_stmt (const char* stmt) {
}
static int
-sql_stmt(const char* stmt) {
- char *errmsg;
- int ret;
+sql_stmt(const gchar * stmt) {
+ gchar *errmsg;
+ gint ret;
ret = sqlite3_exec(db, stmt, 0, 0, &errmsg);
@@ -53,32 +53,32 @@ sql_stmt(const char* stmt) {
#define CREATE_STMT "CREATE TABLE %s (uid TEXT PRIMARY KEY, gflags INTEGER, isize INTEGER, dsent INTEGER, dreceived INTEGER, jsubject TEXT, ffrom TEXT, tto TEXT, cc TEXT, mlist TEXT, part TEXT, userflags TEXT, usertags TEXT, bdata TEXT)"
static int
-create_table (const char *tablename)
+create_table (const gchar *tablename)
{
- char *cmd = malloc (sizeof(CREATE_STMT)+20);
+ gchar *cmd = malloc (sizeof(CREATE_STMT)+20);
sprintf(cmd, CREATE_STMT, tablename);
sql_stmt (cmd);
}
-int sort_uid (void *foo, int len, void * data1, int len2, void *data2)
+gint sort_uid (gpointer foo, gint len, gpointer data1, gint len2, gpointer data2)
{
printf("%s \n%s\n\n", data1, data2);
- int a1 = atoi (data1);
- int a2 = atoi (data2);
+ gint a1 = atoi (data1);
+ gint a2 = atoi (data2);
return a1 < a2;
}
-int sort_cmp (void *foo, int len, void * data1, int len2, void *data2)
+gint sort_cmp (gpointer foo, gint len, gpointer data1, gint len2, gpointer data2)
{
printf("%s \n%s\n\n", data1, data2);
- int a1 = atoi (data1);
- int a2 = atoi (data2);
+ gint a1 = atoi (data1);
+ gint a2 = atoi (data2);
return a1 == a2 ? 0 : a1 < a2 ? -1 : 1;
}
-int main(int argc, char **argv) {
- char *zErrMsg = 0;
- int rc;
+gint main(gint argc, gchar **argv) {
+ gchar *zErrMsg = 0;
+ gint rc;
// rc = sqlite3_open_v2("test.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE , NULL);
rc = sqlite3_open("test.db", &db);
@@ -92,7 +92,7 @@ int main(int argc, char **argv) {
sqlite3_create_collation(db, "uidcmp", SQLITE_UTF8, NULL, sort_cmp);
sqlite3_create_collation(db, "uidsort", SQLITE_UTF8, NULL, sort_uid);
- char *subject_san = "San?%*()-234@#$!@#$@#$%32424kar's Subject";
+ gchar *subject_san = "San?%*()-234@#$!@#$@#$%32424kar's Subject";
create_table ("table1");
sql_stmt (sqlite3_mprintf("INSERT INTO table1 (uid, gflags, isize, jsubject, mlist) VALUES ('5120', 100, 123, '%q', 'mlistbinary')", subject_san));
sql_stmt ("INSERT INTO table1 (uid, gflags, isize, jsubject, mlist) VALUES ('6103', 100, 123, 'nice subject', 'mlistbinary')");
diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c
index 356bf4cdc..cec0aab97 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -85,26 +85,26 @@ struct _CamelGroupwiseFolderPrivate {
/*prototypes*/
static void groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *destination, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex);
-static int gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-void convert_to_calendar (EGwItem *item, char **str, int *len);
-static void convert_to_task (EGwItem *item, char **str, int *len);
-static void convert_to_note (EGwItem *item, char **str, int *len);
+static gint gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+void convert_to_calendar (EGwItem *item, gchar **str, gint *len);
+static void convert_to_task (EGwItem *item, gchar **str, gint *len);
+static void convert_to_note (EGwItem *item, gchar **str, gint *len);
static void gw_update_all_items ( CamelFolder *folder, GList *item_list, CamelException *ex);
static void groupwise_populate_details_from_item (CamelMimeMessage *msg, EGwItem *item);
-static void groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multipart, EGwItem *item, char *body);
+static void groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multipart, EGwItem *item, gchar *body);
static void groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item);
static void gw_update_cache ( CamelFolder *folder, GList *item_list, CamelException *ex, gboolean uid_flag);
static CamelMimeMessage *groupwise_folder_item_to_msg ( CamelFolder *folder, EGwItem *item, CamelException *ex );
-static char* groupwise_get_filename (CamelFolder *folder, const char *uid, CamelException *ex);
-static const char *get_from_from_org (EGwItemOrganizer *org);
+static gchar * groupwise_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
+static const gchar *get_from_from_org (EGwItemOrganizer *org);
#define d(x)
-const char * GET_ITEM_VIEW_WITH_CACHE = "peek default recipient threading attachments subject status priority startDate created delivered size recurrenceKey message notification";
-const char * GET_ITEM_VIEW_WITHOUT_CACHE = "peek default recipient threading hasAttachment subject status priority startDate created delivered size recurrenceKey";
+const gchar * GET_ITEM_VIEW_WITH_CACHE = "peek default recipient threading attachments subject status priority startDate created delivered size recurrenceKey message notification";
+const gchar * GET_ITEM_VIEW_WITHOUT_CACHE = "peek default recipient threading hasAttachment subject status priority startDate created delivered size recurrenceKey";
-static char*
-groupwise_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar *
+groupwise_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder);
@@ -114,19 +114,19 @@ groupwise_get_filename (CamelFolder *folder, const char *uid, CamelException *ex
/* Get a message from cache if available otherwise get it from server */
static CamelMimeMessage *
-groupwise_folder_get_message( CamelFolder *folder, const char *uid, CamelException *ex )
+groupwise_folder_get_message( CamelFolder *folder, const gchar *uid, CamelException *ex )
{
CamelMimeMessage *msg = NULL;
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder);
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE(folder->parent_store);
CamelGroupwiseStorePrivate *priv = gw_store->priv;
CamelGroupwiseMessageInfo *mi = NULL;
- char *container_id;
+ gchar *container_id;
EGwConnectionStatus status;
EGwConnection *cnc;
EGwItem *item;
CamelStream *stream, *cache_stream;
- int errno;
+ gint errno;
/* see if it is there in cache */
@@ -233,16 +233,16 @@ static void
groupwise_populate_details_from_item (CamelMimeMessage *msg, EGwItem *item)
{
EGwItemType type;
- char *dtstring = NULL;
- char *temp_str = NULL;
+ gchar *dtstring = NULL;
+ gchar *temp_str = NULL;
- temp_str = (char *)e_gw_item_get_subject(item);
+ temp_str = (gchar *)e_gw_item_get_subject(item);
if(temp_str)
camel_mime_message_set_subject (msg, temp_str);
type = e_gw_item_get_item_type (item);
if (type == E_GW_ITEM_TYPE_APPOINTMENT || type == E_GW_ITEM_TYPE_NOTE || type == E_GW_ITEM_TYPE_TASK) {
- int offset = 0;
+ gint offset = 0;
dtstring = e_gw_item_get_start_date (item);
time_t actual_time = e_gw_connection_get_date_from_string (dtstring);
camel_mime_message_set_date (msg, actual_time, offset);
@@ -251,12 +251,12 @@ groupwise_populate_details_from_item (CamelMimeMessage *msg, EGwItem *item)
dtstring = e_gw_item_get_delivered_date (item);
if(dtstring) {
- int offset = 0;
+ gint offset = 0;
time_t actual_time = e_gw_connection_get_date_from_string (dtstring);
camel_mime_message_set_date (msg, actual_time, offset);
} else {
time_t actual_time;
- int offset = 0;
+ gint offset = 0;
dtstring = e_gw_item_get_creation_date (item);
if (dtstring) {
actual_time = e_gw_connection_get_date_from_string (dtstring);
@@ -268,11 +268,11 @@ groupwise_populate_details_from_item (CamelMimeMessage *msg, EGwItem *item)
/* convert an item to a msg body. set content type etc. */
static void
-groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multipart, EGwItem *item, char *body)
+groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multipart, EGwItem *item, gchar *body)
{
CamelMimePart *part;
EGwItemType type;
- const char *temp_body = NULL;
+ const gchar *temp_body = NULL;
part = camel_mime_part_new ();
camel_mime_part_set_encoding(part, CAMEL_TRANSFER_ENCODING_8BIT);
@@ -280,15 +280,15 @@ groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multi
if (!body) {
temp_body = e_gw_item_get_message (item);
if(!temp_body){
- int len = 0;
+ gint len = 0;
EGwConnectionStatus status;
status = e_gw_connection_get_attachment (cnc,
e_gw_item_get_msg_body_id (item), 0, -1,
- (const char **)&temp_body, &len);
+ (const gchar **)&temp_body, &len);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
status = e_gw_connection_get_attachment (cnc,
e_gw_item_get_msg_body_id (item), 0, -1,
- (const char **)&temp_body, &len);
+ (const gchar **)&temp_body, &len);
if (status != E_GW_CONNECTION_STATUS_OK) {
g_warning ("Could not get Messagebody\n");
}
@@ -302,8 +302,8 @@ groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multi
case E_GW_ITEM_TYPE_TASK:
case E_GW_ITEM_TYPE_NOTE:
{
- char *cal_buffer = NULL;
- int len = 0;
+ gchar *cal_buffer = NULL;
+ gint len = 0;
if (type==E_GW_ITEM_TYPE_APPOINTMENT)
convert_to_calendar (item, &cal_buffer, &len);
else if (type == E_GW_ITEM_TYPE_TASK)
@@ -342,7 +342,7 @@ groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item)
GSList *recipient_list;
EGwItemOrganizer *org;
struct _camel_header_address *ha;
- char *subs_email;
+ gchar *subs_email;
struct _camel_header_address *to_list = NULL, *cc_list = NULL, *bcc_list=NULL;
org = e_gw_item_get_organizer (item);
@@ -350,7 +350,7 @@ groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item)
if (recipient_list) {
GSList *rl;
- char *status_opt = NULL;
+ gchar *status_opt = NULL;
gboolean enabled;
for (rl = recipient_list ; rl != NULL ; rl = rl->next) {
@@ -397,7 +397,7 @@ groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item)
/* The status tracking code is working fine. someone need to remove this */
if (enabled) {
- camel_medium_add_header ( CAMEL_MEDIUM (msg), "X-gw-status-opt", (const char *)status_opt);
+ camel_medium_add_header ( CAMEL_MEDIUM (msg), "X-gw-status-opt", (const gchar *)status_opt);
g_free (status_opt);
}
}
@@ -444,14 +444,14 @@ groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item)
/* code to rename a folder. all the "meta nonsense" code should simply go away */
static void
-groupwise_folder_rename (CamelFolder *folder, const char *new)
+groupwise_folder_rename (CamelFolder *folder, const gchar *new)
{
CamelGroupwiseFolder *gw_folder = (CamelGroupwiseFolder *)folder;
CamelGroupwiseStore *gw_store = (CamelGroupwiseStore *) folder->parent_store;
CamelGroupwiseStorePrivate *priv = gw_store->priv;
- char *folder_dir, *summary_path, *state_file, *storage_path = storage_path_lookup (priv);
- char *folders;
+ gchar *folder_dir, *summary_path, *state_file, *storage_path = storage_path_lookup (priv);
+ gchar *folders;
folders = g_strconcat (storage_path, "/folders", NULL);
folder_dir = e_path_to_physical (folders, new);
@@ -476,7 +476,7 @@ groupwise_folder_rename (CamelFolder *folder, const char *new)
}
static GPtrArray *
-groupwise_folder_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
+groupwise_folder_search_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder);
GPtrArray *matches;
@@ -490,7 +490,7 @@ groupwise_folder_search_by_expression (CamelFolder *folder, const char *expressi
}
static guint32
-groupwise_folder_count_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
+groupwise_folder_count_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder);
guint32 matches;
@@ -504,7 +504,7 @@ groupwise_folder_count_by_expression (CamelFolder *folder, const char *expressio
}
static GPtrArray *
-groupwise_folder_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
+groupwise_folder_search_by_uids(CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder);
GPtrArray *matches;
@@ -554,10 +554,10 @@ free_node (EGwJunkEntry *entry)
/* This is a point of contention. We behave like the GW client and update our junk list
in the same way as the GroupWise client. Add senders to junk list */
static void
-update_junk_list (CamelStore *store, CamelMessageInfo *info, int flag)
+update_junk_list (CamelStore *store, CamelMessageInfo *info, gint flag)
{
gchar **email = NULL, *from = NULL;
- int index = 0;
+ gint index = 0;
CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(store);
CamelGroupwiseStorePrivate *priv = gw_store->priv;
EGwConnection *cnc = cnc_lookup (priv);
@@ -612,7 +612,7 @@ move_to_mailbox (CamelFolder *folder, CamelMessageInfo *info, CamelException *ex
{
CamelFolder *dest;
GPtrArray *uids;
- const char *uid = camel_message_info_uid (info);
+ const gchar *uid = camel_message_info_uid (info);
uids = g_ptr_array_new ();
g_ptr_array_add (uids, (gpointer) uid);
@@ -633,7 +633,7 @@ move_to_junk (CamelFolder *folder, CamelMessageInfo *info, CamelException *ex)
CamelFolder *dest;
CamelFolderInfo *fi;
GPtrArray *uids;
- const char *uid = camel_message_info_uid (info);
+ const gchar *uid = camel_message_info_uid (info);
uids = g_ptr_array_new ();
g_ptr_array_add (uids, (gpointer) uid);
@@ -698,10 +698,10 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
CamelGroupwiseMessageInfo *gw_info;
GList *read_items = NULL, *deleted_read_items = NULL, *unread_items = NULL;
flags_diff_t diff, unset_flags;
- const char *container_id;
+ const gchar *container_id;
EGwConnectionStatus status;
EGwConnection *cnc;
- int count, i;
+ gint count, i;
GList *deleted_items, *deleted_head;
@@ -771,21 +771,21 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
camel_message_info_free(info);
continue;
} else {
- const char *uid;
+ const gchar *uid;
uid = camel_message_info_uid (info);
if (diff.bits & CAMEL_MESSAGE_DELETED) {
/* In case a new message is READ and then deleted immediately */
if (diff.bits & CAMEL_MESSAGE_SEEN)
- deleted_read_items = g_list_prepend (deleted_read_items, (char *) uid);
+ deleted_read_items = g_list_prepend (deleted_read_items, (gchar *) uid);
if (deleted_items)
- deleted_items = g_list_prepend (deleted_items, (char *)camel_message_info_uid (info));
+ deleted_items = g_list_prepend (deleted_items, (gchar *)camel_message_info_uid (info));
else {
g_list_free (deleted_head);
deleted_head = NULL;
- deleted_head = deleted_items = g_list_prepend (deleted_items, (char *)camel_message_info_uid (info));
+ deleted_head = deleted_items = g_list_prepend (deleted_items, (gchar *)camel_message_info_uid (info));
}
if (g_list_length (deleted_items) == GROUPWISE_BULK_DELETE_LIMIT ) {
@@ -816,9 +816,9 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
status = e_gw_connection_remove_items (cnc, container_id, deleted_items);
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
if (status == E_GW_CONNECTION_STATUS_OK) {
- char *uid;
+ gchar *uid;
while (deleted_items) {
- uid = (char *)deleted_items->data;
+ uid = (gchar *)deleted_items->data;
CAMEL_GROUPWISE_FOLDER_REC_LOCK (folder, cache_lock);
camel_folder_summary_remove_uid (folder->summary, uid);
camel_data_cache_remove(gw_folder->cache, "cache", uid, NULL);
@@ -830,9 +830,9 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
}
}
} else if (diff.bits & CAMEL_MESSAGE_SEEN) {
- read_items = g_list_prepend (read_items, (char *)uid);
+ read_items = g_list_prepend (read_items, (gchar *)uid);
} else if (unset_flags.bits & CAMEL_MESSAGE_SEEN) {
- unread_items = g_list_prepend (unread_items, (char *)uid);
+ unread_items = g_list_prepend (unread_items, (gchar *)uid);
}
}
}
@@ -856,9 +856,9 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
}
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
if (status == E_GW_CONNECTION_STATUS_OK) {
- char *uid;
+ gchar *uid;
while (deleted_items) {
- uid = (char *)deleted_items->data;
+ uid = (gchar *)deleted_items->data;
CAMEL_GROUPWISE_FOLDER_REC_LOCK (folder, cache_lock);
camel_folder_summary_remove_uid (folder->summary, uid);
camel_data_cache_remove(gw_folder->cache, "cache", uid, NULL);
@@ -914,12 +914,12 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
}
CamelFolder *
-camel_gw_folder_new(CamelStore *store, const char *folder_name, const char *folder_dir, CamelException *ex)
+camel_gw_folder_new(CamelStore *store, const gchar *folder_name, const gchar *folder_dir, CamelException *ex)
{
CamelFolder *folder;
CamelGroupwiseFolder *gw_folder;
- char *summary_file, *state_file, *journal_file;
- char *short_name;
+ gchar *summary_file, *state_file, *journal_file;
+ gchar *short_name;
folder = CAMEL_FOLDER (camel_object_new(camel_groupwise_folder_get_type ()) );
@@ -929,7 +929,7 @@ camel_gw_folder_new(CamelStore *store, const char *folder_name, const char *fold
if (short_name)
short_name++;
else
- short_name = (char *) folder_name;
+ short_name = (gchar *) folder_name;
camel_folder_construct (folder, store, folder_name, short_name);
summary_file = g_strdup_printf ("%s/summary",folder_dir);
@@ -982,8 +982,8 @@ struct _folder_update_msg {
EGwConnection *cnc;
CamelFolder *folder;
- char *container_id;
- char *t_str;
+ gchar *container_id;
+ gchar *t_str;
GSList *slist;
};
@@ -991,7 +991,7 @@ static void
update_update (CamelSession *session, CamelSessionThreadMsg *msg)
{
- extern int camel_application_is_exiting;
+ extern gint camel_application_is_exiting;
struct _folder_update_msg *m = (struct _folder_update_msg *)msg;
EGwConnectionStatus status;
@@ -999,8 +999,8 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg)
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (m->folder->parent_store);
GList *item_list, *items_full_list = NULL, *last_element=NULL;
- int cursor = 0;
- const char *position = E_GW_CURSOR_POSITION_END;
+ gint cursor = 0;
+ const gchar *position = E_GW_CURSOR_POSITION_END;
gboolean done;
/* Hold the connect_lock.
@@ -1066,19 +1066,19 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg)
to be unique only until that symbol */
/*if (items_full_list) {
- int i;
+ gint i;
item_list = items_full_list;
while (item_list->next) {
i = 0;
- while (((const char *)item_list->data)[i++]!='@');
- ((char *)item_list->data)[i-1] = '\0';
+ while (((const gchar *)item_list->data)[i++]!='@');
+ ((gchar *)item_list->data)[i-1] = '\0';
item_list = item_list->next;
}
i = 0;
- while (((const char *)item_list->data)[i++]!='@');
- ((char *)item_list->data)[i-1] = '\0';
+ while (((const gchar *)item_list->data)[i++]!='@');
+ ((gchar *)item_list->data)[i-1] = '\0';
}*/
g_print ("\nNumber of items in the folder: %d \n", g_list_length(items_full_list));
@@ -1155,11 +1155,11 @@ check_for_new_mails_count (CamelGroupwiseSummary *gw_summary, GSList *ids)
{
CamelFolderSummary *summary = (CamelFolderSummary *) gw_summary;
GSList *l = NULL;
- int count = 0;
+ gint count = 0;
for (l = ids; l != NULL; l = g_slist_next (l)) {
EGwItem *item = l->data;
- const char *id = e_gw_item_get_id (item);
+ const gchar *id = e_gw_item_get_id (item);
CamelMessageInfo *info = camel_folder_summary_uid (summary, id);
if (!info)
@@ -1176,7 +1176,7 @@ compare_ids (gpointer a, gpointer b, gpointer data)
{
EGwItem *item1 = (EGwItem *) a;
EGwItem *item2 = (EGwItem *) b;
- const char *id1 = NULL, *id2 = NULL;
+ const gchar *id1 = NULL, *id2 = NULL;
id1 = e_gw_item_get_id (item1);
id2 = e_gw_item_get_id (item2);
@@ -1188,7 +1188,7 @@ static int
get_merge_lists_new_count (CamelGroupwiseSummary *summary, GSList *new, GSList *modified, GSList **merged)
{
GSList *l, *element;
- int count = 0;
+ gint count = 0;
if (new == NULL && modified == NULL){
*merged = NULL;
@@ -1221,7 +1221,7 @@ get_merge_lists_new_count (CamelGroupwiseSummary *summary, GSList *new, GSList *
}
static void
-update_summary_string (CamelFolder *folder, const char *time_string, CamelException *ex)
+update_summary_string (CamelFolder *folder, const gchar *time_string, CamelException *ex)
{
CamelGroupwiseSummary *summary = (CamelGroupwiseSummary *) folder->summary;
@@ -1244,15 +1244,15 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
CamelSession *session = ((CamelService *)folder->parent_store)->session;
gboolean is_proxy = folder->parent_store->flags & CAMEL_STORE_PROXY;
gboolean is_locked = TRUE;
- int status;
+ gint status;
GList *list = NULL;
GSList *new_items = NULL, *modified_items = NULL, *merged = NULL;
- char *container_id = NULL;
- char *old_sync_time = NULL, *new_sync_time = NULL, *modified_sync_time = NULL;
+ gchar *container_id = NULL;
+ gchar *old_sync_time = NULL, *new_sync_time = NULL, *modified_sync_time = NULL;
struct _folder_update_msg *msg;
gboolean sync_deleted = FALSE;
EGwContainer *container;
- int new_item_count = 0;
+ gint new_item_count = 0;
/* Sync-up the (un)read changes before getting updates,
so that the getFolderList will reflect the most recent changes too */
@@ -1310,7 +1310,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
/*Get the New Items*/
if (!is_proxy) {
- char *source;
+ gchar *source;
if ( !strcmp (folder->full_name, RECEIVED) || !strcmp(folder->full_name, SENT) ) {
source = NULL;
@@ -1441,16 +1441,16 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
CamelFolderChangeInfo *changes = NULL;
gboolean exists = FALSE;
GString *str = g_string_new (NULL);
- const char *priority = NULL;
- char *container_id = NULL;
+ const gchar *priority = NULL;
+ gchar *container_id = NULL;
gboolean is_junk = FALSE;
EGwConnectionStatus status;
GList *item_list = list;
- int total_items = g_list_length (item_list), i=0;
+ gint total_items = g_list_length (item_list), i=0;
gboolean is_proxy = folder->parent_store->flags & CAMEL_STORE_WRITE;
- int folder_needs_caching;
+ gint folder_needs_caching;
camel_object_get (folder, NULL, CAMEL_OFFLINE_FOLDER_SYNC_OFFLINE, &folder_needs_caching, NULL);
@@ -1473,13 +1473,13 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
EGwItem *item;
EGwItemType type = E_GW_ITEM_TYPE_UNKNOWN;
EGwItemOrganizer *org;
- char *temp_date = NULL;
- const char *id;
+ gchar *temp_date = NULL;
+ const gchar *id;
GSList *recp_list = NULL;
CamelStream *cache_stream, *t_cache_stream;
CamelMimeMessage *mail_msg = NULL;
- const char *recurrence_key = NULL;
- int rk;
+ const gchar *recurrence_key = NULL;
+ gint rk;
exists = FALSE;
status_flags = 0;
@@ -1488,7 +1488,7 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
temp_item = (EGwItem *)item_list->data;
id = e_gw_item_get_id (temp_item);
} else
- id = (char *) item_list->data;
+ id = (gchar *) item_list->data;
camel_operation_progress (NULL, (100*i)/total_items);
@@ -1570,7 +1570,7 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
recp_list = e_gw_item_get_recipient_list (item);
if (recp_list) {
GSList *rl;
- int i = 0;
+ gint i = 0;
for (rl = recp_list; rl != NULL; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
if (recp->type == E_GW_ITEM_RECIPIENT_TO) {
@@ -1664,10 +1664,10 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
camel_folder_change_info_free (changes);
}
-static const char *
+static const gchar *
get_from_from_org (EGwItemOrganizer *org)
{
- const char *ret = NULL;
+ const gchar *ret = NULL;
if (org) {
GString *str;
@@ -1705,8 +1705,8 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
CamelFolderChangeInfo *changes = NULL;
gboolean exists = FALSE;
GString *str = g_string_new (NULL);
- const char *priority = NULL;
- char *container_id = NULL;
+ const gchar *priority = NULL;
+ gchar *container_id = NULL;
gboolean is_junk = FALSE;
GList *item_list = list;
@@ -1729,11 +1729,11 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
EGwItem *item = (EGwItem *)item_list->data;
EGwItemType type = E_GW_ITEM_TYPE_UNKNOWN;
EGwItemOrganizer *org;
- char *temp_date = NULL;
- const char *id;
+ gchar *temp_date = NULL;
+ const gchar *id;
GSList *recp_list = NULL;
- const char *recurrence_key = NULL;
- int rk;
+ const gchar *recurrence_key = NULL;
+ gint rk;
status_flags = 0;
id = e_gw_item_get_id (item);
@@ -1801,7 +1801,7 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
recp_list = e_gw_item_get_recipient_list (item);
if (recp_list) {
GSList *rl;
- int i = 0;
+ gint i = 0;
for (rl = recp_list; rl != NULL; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
if (recp->type == E_GW_ITEM_RECIPIENT_TO) {
@@ -1870,16 +1870,16 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
CamelMimeMessage *msg = NULL;
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE(folder->parent_store);
CamelGroupwiseStorePrivate *priv = gw_store->priv;
- const char *container_id = NULL;
+ const gchar *container_id = NULL;
GSList *attach_list = NULL;
EGwItemType type;
EGwConnectionStatus status;
EGwConnection *cnc;
CamelMultipart *multipart = NULL;
- int errno;
- char *body = NULL;
- int body_len = 0;
- const char *uid = NULL;
+ gint errno;
+ gchar *body = NULL;
+ gint body_len = 0;
+ const gchar *uid = NULL;
gboolean is_text_html = FALSE;
gboolean has_mime_822 = FALSE, ignore_mime_822 = FALSE;
gboolean is_text_html_embed = FALSE;
@@ -1900,15 +1900,15 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
/*int attach_count = g_slist_length (attach_list);*/
GSList *al = attach_list;
EGwItemAttachment *attach = (EGwItemAttachment *)al->data;
- char *attachment = NULL;
- int len = 0;
+ gchar *attachment = NULL;
+ gint len = 0;
if (!g_ascii_strcasecmp (attach->name, "Text.htm") ||
!g_ascii_strcasecmp (attach->name, "Header")) {
status = e_gw_connection_get_attachment (cnc,
attach->id, 0, -1,
- (const char **)&attachment, &len);
+ (const gchar **)&attachment, &len);
if (status != E_GW_CONNECTION_STATUS_OK) {
g_warning ("Could not get attachment\n");
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Could not get message"));
@@ -1928,22 +1928,22 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
EGwItemAttachment *attach = (EGwItemAttachment *)al->data;
if (!g_ascii_strcasecmp (attach->name, "Mime.822")) {
if (attach->size > MAX_ATTACHMENT_SIZE) {
- int t_len , offset = 0, t_offset = 0;
- char *t_attach = NULL;
+ gint t_len , offset = 0, t_offset = 0;
+ gchar *t_attach = NULL;
GString *gstr = g_string_new (NULL);
len = 0;
do {
status = e_gw_connection_get_attachment_base64 (cnc,
attach->id, t_offset, MAX_ATTACHMENT_SIZE,
- (const char **)&t_attach, &t_len, &offset);
+ (const gchar **)&t_attach, &t_len, &offset);
if (status == E_GW_CONNECTION_STATUS_OK) {
if (t_len) {
gsize len_iter = 0;
- char *temp = NULL;
+ gchar *temp = NULL;
- temp = (char *) g_base64_decode(t_attach, &len_iter);
+ temp = (gchar *) g_base64_decode(t_attach, &len_iter);
gstr = g_string_append_len (gstr, temp, len_iter);
g_free (temp);
len += len_iter;
@@ -1959,7 +1959,7 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
} else {
status = e_gw_connection_get_attachment (cnc,
attach->id, 0, -1,
- (const char **)&attachment, &len);
+ (const gchar **)&attachment, &len);
if (status != E_GW_CONNECTION_STATUS_OK) {
g_warning ("Could not get attachment\n");
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Could not get message"));
@@ -1998,25 +1998,25 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
/*If the reply-requested flag is set. Append the mail message with the
* * approprite detail*/
if (e_gw_item_get_reply_request (item)) {
- char *reply_within;
- const char *mess = e_gw_item_get_message (item);
- char *value;
+ gchar *reply_within;
+ const gchar *mess = e_gw_item_get_message (item);
+ gchar *value;
reply_within = e_gw_item_get_reply_within (item);
if (reply_within) {
time_t t;
- char *temp;
+ gchar *temp;
t = e_gw_connection_get_date_from_string (reply_within);
temp = ctime (&t);
temp [strlen (temp)-1] = '\0';
value = g_strconcat (N_("Reply Requested: by "), temp, "\n\n", mess ? mess : "", NULL);
- e_gw_item_set_message (item, (const char *) value);
+ e_gw_item_set_message (item, (const gchar *) value);
g_free (value);
} else {
value = g_strconcat (N_("Reply Requested: When convenient"), "\n\n", mess ? mess : "", NULL);
- e_gw_item_set_message (item, (const char *) value);
+ e_gw_item_set_message (item, (const gchar *) value);
g_free (value);
}
}
@@ -2035,8 +2035,8 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
for (al = attach_list ; al != NULL ; al = al->next) {
EGwItemAttachment *attach = (EGwItemAttachment *)al->data;
- char *attachment = NULL;
- int len = 0;
+ gchar *attachment = NULL;
+ gint len = 0;
CamelMimePart *part;
EGwItem *temp_item;
is_base64_encoded = FALSE;
@@ -2074,22 +2074,22 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
g_object_unref (temp_item);
} else {
if (attach->size > MAX_ATTACHMENT_SIZE) {
- int t_len=0, offset=0, t_offset=0;
- char *t_attach = NULL;
+ gint t_len=0, offset=0, t_offset=0;
+ gchar *t_attach = NULL;
GString *gstr = g_string_new (NULL);
len = 0;
do {
status = e_gw_connection_get_attachment_base64 (cnc,
attach->id, t_offset, MAX_ATTACHMENT_SIZE,
- (const char **)&t_attach, &t_len, &offset);
+ (const gchar **)&t_attach, &t_len, &offset);
if (status == E_GW_CONNECTION_STATUS_OK) {
if (t_len) {
gsize len_iter = 0;
- char *temp = NULL;
+ gchar *temp = NULL;
- temp = (char *) g_base64_decode(t_attach, &len_iter);
+ temp = (gchar *) g_base64_decode(t_attach, &len_iter);
gstr = g_string_append_len (gstr, temp, len_iter);
g_free (temp);
len += len_iter;
@@ -2106,7 +2106,7 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
} else {
status = e_gw_connection_get_attachment (cnc,
attach->id, 0, -1,
- (const char **)&attachment, &len);
+ (const gchar **)&attachment, &len);
}
if (status != E_GW_CONNECTION_STATUS_OK) {
g_warning ("Could not get attachment\n");
@@ -2182,10 +2182,10 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER (folder);
GPtrArray *summary = NULL;
- int index = 0;
+ gint index = 0;
GList *temp;
CamelFolderChangeInfo *changes = NULL;
- char *uid;
+ gchar *uid;
changes = camel_folder_change_info_new ();
@@ -2198,7 +2198,7 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex)
temp = NULL;
if (item_list) {
- temp = g_list_find_custom (item_list, (const char *)uid, (GCompareFunc) strcmp);
+ temp = g_list_find_custom (item_list, (const gchar *)uid, (GCompareFunc) strcmp);
}
if (!temp) {
@@ -2231,17 +2231,17 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex)
static void
groupwise_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
- const char *container_id = NULL;
+ const gchar *container_id = NULL;
CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(folder->parent_store);
CamelGroupwiseStorePrivate *priv = gw_store->priv;
CamelOfflineStore *offline = (CamelOfflineStore *) folder->parent_store;
EGwConnectionStatus status = { 0, };
EGwConnection *cnc;
EGwItem *item;
- char *id;
+ gchar *id;
gboolean is_ok = FALSE;
if (!strcmp (folder->name, RECEIVED))
@@ -2312,9 +2312,9 @@ groupwise_append_message (CamelFolder *folder, CamelMimeMessage *message,
/* A function to compare uids, inspired by strcmp .
This code was used in some other provider also , imap4rev1 iirc */
static int
-uid_compar (const void *va, const void *vb)
+uid_compar (gconstpointer va, gconstpointer vb)
{
- const char **sa = (const char **)va, **sb = (const char **)vb;
+ const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
unsigned long a, b;
a = strtoul (*sa, NULL, 10);
@@ -2333,9 +2333,9 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
CamelFolder *destination, GPtrArray **transferred_uids,
gboolean delete_originals, CamelException *ex)
{
- int count, index = 0;
+ gint count, index = 0;
GList *item_ids = NULL;
- const char *source_container_id = NULL, *dest_container_id = NULL;
+ const gchar *source_container_id = NULL, *dest_container_id = NULL;
CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(source->parent_store);
CamelOfflineStore *offline = (CamelOfflineStore *) destination->parent_store;
CamelGroupwiseStorePrivate *priv = gw_store->priv;
@@ -2350,7 +2350,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
destination_is_trash = FALSE;
count = camel_folder_summary_count (destination->summary);
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+ qsort (uids->pdata, uids->len, sizeof (gpointer), uid_compar);
changes = camel_folder_change_info_new ();
while (index < uids->len) {
@@ -2373,7 +2373,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
CamelGroupwiseJournal *journal = (CamelGroupwiseJournal *) ((CamelGroupwiseFolder *) destination)->journal;
CamelMimeMessage *message;
GList *l;
- int i;
+ gint i;
if (destination_is_trash)
delete_originals = TRUE;
@@ -2416,7 +2416,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
CamelMessageInfo *info = NULL;
CamelGroupwiseMessageInfo *gw_info = NULL;
flags_diff_t diff, unset_flags;
- int count;
+ gint count;
count = camel_folder_summary_count (destination->summary);
info = camel_folder_summary_uid (source->summary, uids->pdata[index]);
@@ -2434,7 +2434,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
/* sync the read changes */
if (diff.changed) {
- const char *uid = camel_message_info_uid (info);
+ const gchar *uid = camel_message_info_uid (info);
GList *wrapper = NULL;
gw_info->info.flags &= ~CAMEL_MESSAGE_FOLDER_FLAGGED;
gw_info->server_flags = gw_info->info.flags;
@@ -2447,7 +2447,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
need/use for a e_gw_connection_mark_ITEM_[un]read
*/
- wrapper = g_list_prepend (wrapper, (char *)uid);
+ wrapper = g_list_prepend (wrapper, (gchar *)uid);
CAMEL_SERVICE_REC_LOCK (source->parent_store, connect_lock);
e_gw_connection_mark_read (cnc, wrapper);
CAMEL_SERVICE_REC_UNLOCK (source->parent_store, connect_lock);
@@ -2464,7 +2464,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
*/
if (unset_flags.bits & CAMEL_MESSAGE_SEEN) {
- wrapper = g_list_prepend (wrapper, (char *)uid);
+ wrapper = g_list_prepend (wrapper, (gchar *)uid);
CAMEL_SERVICE_REC_LOCK (source->parent_store, connect_lock);
e_gw_connection_mark_unread (cnc, wrapper);
CAMEL_SERVICE_REC_UNLOCK (source->parent_store, connect_lock);
@@ -2476,24 +2476,24 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
if (destination_is_trash) {
- e_gw_connection_remove_item (cnc, source_container_id, (const char*) uids->pdata[index]);
+ e_gw_connection_remove_item (cnc, source_container_id, (const gchar *) uids->pdata[index]);
camel_folder_summary_remove_uid (source->summary, uids->pdata[index]);
camel_folder_change_info_remove_uid (changes, uids->pdata[index]);
} else {
if (delete_originals) {
if (strcmp(source->full_name, "Sent Items")) {
- status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index],
+ status = e_gw_connection_move_item (cnc, (const gchar *)uids->pdata[index],
dest_container_id, source_container_id);
} else {
- char *container_id = NULL;
+ gchar *container_id = NULL;
container_id = e_gw_connection_get_container_id (cnc, "Mailbox");
- status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index],
+ status = e_gw_connection_move_item (cnc, (const gchar *)uids->pdata[index],
dest_container_id, container_id);
g_free (container_id);
}
} else
- status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index],
+ status = e_gw_connection_move_item (cnc, (const gchar *)uids->pdata[index],
dest_container_id, NULL);
if (status == E_GW_CONNECTION_STATUS_OK) {
@@ -2510,7 +2510,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
/*}*/
}
} else {
- g_warning ("Warning!! Could not move item : %s\n", (char *)uids->pdata[index]);
+ g_warning ("Warning!! Could not move item : %s\n", (gchar *)uids->pdata[index]);
}
}
@@ -2540,11 +2540,11 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex)
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
CamelGroupwiseMessageInfo *ginfo;
CamelMessageInfo *info;
- char *container_id;
+ gchar *container_id;
EGwConnection *cnc;
EGwConnectionStatus status;
CamelFolderChangeInfo *changes;
- int i, max;
+ gint i, max;
gboolean delete = FALSE;
GList *deleted_items, *deleted_head;
@@ -2578,11 +2578,11 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex)
if (ginfo && (ginfo->info.flags & CAMEL_MESSAGE_DELETED)) {
if (deleted_items)
- deleted_items = g_list_prepend (deleted_items, (char *)camel_message_info_uid (info));
+ deleted_items = g_list_prepend (deleted_items, (gchar *)camel_message_info_uid (info));
else {
g_list_free (deleted_head);
deleted_head = NULL;
- deleted_head = deleted_items = g_list_prepend (deleted_items, (char *)camel_message_info_uid (info));
+ deleted_head = deleted_items = g_list_prepend (deleted_items, (gchar *)camel_message_info_uid (info));
}
if (g_list_length (deleted_items) == GROUPWISE_BULK_DELETE_LIMIT ) {
/* Read the FIXME below */
@@ -2590,9 +2590,9 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex)
status = e_gw_connection_remove_items (cnc, container_id, deleted_items);
CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
if (status == E_GW_CONNECTION_STATUS_OK) {
- char *uid;
+ gchar *uid;
while (deleted_items) {
- uid = (char *)deleted_items->data;
+ uid = (gchar *)deleted_items->data;
CAMEL_GROUPWISE_FOLDER_REC_LOCK (folder, cache_lock);
camel_folder_change_info_remove_uid (changes, uid);
camel_folder_summary_remove_uid (folder->summary, uid);
@@ -2615,9 +2615,9 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex)
status = e_gw_connection_remove_items (cnc, container_id, deleted_items);
CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
if (status == E_GW_CONNECTION_STATUS_OK) {
- char *uid;
+ gchar *uid;
while (deleted_items) {
- uid = (char *)deleted_items->data;
+ uid = (gchar *)deleted_items->data;
CAMEL_GROUPWISE_FOLDER_REC_LOCK (folder, cache_lock);
camel_folder_change_info_remove_uid (changes, uid);
camel_folder_summary_remove_uid (folder->summary, uid);
@@ -2638,7 +2638,7 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex)
}
static gint
-groupwise_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2)
+groupwise_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
{
g_return_val_if_fail (uid1 != NULL, 0);
g_return_val_if_fail (uid2 != NULL, 0);
@@ -2731,7 +2731,7 @@ static int
gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
- int i, count = 0;
+ gint i, count = 0;
guint32 tag;
for (i=0 ; i<args->argc ; i++) {
@@ -2765,16 +2765,16 @@ gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
}
void
-convert_to_calendar (EGwItem *item, char **str, int *len)
+convert_to_calendar (EGwItem *item, gchar **str, gint *len)
{
EGwItemOrganizer *org = NULL;
GSList *recp_list = NULL;
GSList *attach_list = NULL;
GString *gstr = g_string_new (NULL);
- int recur_key = 0;
- char **tmp = NULL;
- const char *temp = NULL;
- const char *tmp_dt = NULL;
+ gint recur_key = 0;
+ gchar **tmp = NULL;
+ const gchar *temp = NULL;
+ const gchar *tmp_dt = NULL;
tmp = g_strsplit (e_gw_item_get_id (item), "@", -1);
@@ -2783,7 +2783,7 @@ convert_to_calendar (EGwItem *item, char **str, int *len)
gstr = g_string_append (gstr, "BEGIN:VEVENT\n");
if ((recur_key = e_gw_item_get_recurrence_key (item)) != 0) {
- char *recur_k = g_strdup_printf ("%d", recur_key);
+ gchar *recur_k = g_strdup_printf ("%d", recur_key);
g_string_append_printf (gstr, "UID:%s\n", recur_k);
g_string_append_printf (gstr, "X-GW-RECURRENCE-KEY:%s\n", recur_k);
@@ -2870,14 +2870,14 @@ convert_to_calendar (EGwItem *item, char **str, int *len)
}
static void
-convert_to_task (EGwItem *item, char **str, int *len)
+convert_to_task (EGwItem *item, gchar **str, gint *len)
{
EGwItemOrganizer *org = NULL;
GSList *recp_list = NULL;
GString *gstr = g_string_new (NULL);
- char **tmp = NULL;
- const char *temp = NULL;
- const char *tmp_dt = NULL;
+ gchar **tmp = NULL;
+ const gchar *temp = NULL;
+ const gchar *tmp_dt = NULL;
tmp = g_strsplit (e_gw_item_get_id (item), "@", -1);
@@ -2957,13 +2957,13 @@ convert_to_task (EGwItem *item, char **str, int *len)
}
static void
-convert_to_note (EGwItem *item, char **str, int *len)
+convert_to_note (EGwItem *item, gchar **str, gint *len)
{
EGwItemOrganizer *org = NULL;
GString *gstr = g_string_new (NULL);
- char **tmp = NULL;
- const char *temp = NULL;
- const char *tmp_dt = NULL;
+ gchar **tmp = NULL;
+ const gchar *temp = NULL;
+ const gchar *tmp_dt = NULL;
tmp = g_strsplit (e_gw_item_get_id (item), "@", -1);
diff --git a/camel/providers/groupwise/camel-groupwise-folder.h b/camel/providers/groupwise/camel-groupwise-folder.h
index 4be6fb115..95d30a5c7 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.h
+++ b/camel/providers/groupwise/camel-groupwise-folder.h
@@ -59,9 +59,9 @@ struct _CamelGroupwiseFolder {
CamelOfflineJournal *journal;
CamelDataCache *cache;
- unsigned int need_rescan:1;
- unsigned int need_refresh:1;
- unsigned int read_only:1;
+ guint need_rescan:1;
+ guint need_refresh:1;
+ guint read_only:1;
};
@@ -78,7 +78,7 @@ struct _CamelGroupwiseFolderClass {
CamelType camel_groupwise_folder_get_type (void);
/* implemented */
-CamelFolder * camel_gw_folder_new(CamelStore *store, const char *folder_dir, const char *folder_name, CamelException *ex) ;
+CamelFolder * camel_gw_folder_new(CamelStore *store, const gchar *folder_dir, const gchar *folder_name, CamelException *ex) ;
void gw_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex) ;
void groupwise_refresh_folder(CamelFolder *folder, CamelException *ex);
diff --git a/camel/providers/groupwise/camel-groupwise-journal.c b/camel/providers/groupwise/camel-groupwise-journal.c
index 0d1f6d588..023ad4872 100644
--- a/camel/providers/groupwise/camel-groupwise-journal.c
+++ b/camel/providers/groupwise/camel-groupwise-journal.c
@@ -56,8 +56,8 @@ static void camel_groupwise_journal_finalize (CamelObject *object);
static void groupwise_entry_free (CamelOfflineJournal *journal, CamelDListNode *entry);
static CamelDListNode *groupwise_entry_load (CamelOfflineJournal *journal, FILE *in);
-static int groupwise_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
-static int groupwise_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
+static gint groupwise_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
+static gint groupwise_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
static CamelOfflineJournalClass *parent_class = NULL;
@@ -253,7 +253,7 @@ groupwise_entry_play_transfer (CamelOfflineJournal *journal, CamelGroupwiseJourn
GPtrArray *xuids, *uids;
CamelException lex;
CamelFolder *src;
- const char *name;
+ const gchar *name;
if (!(info = (CamelMessageInfoBase *) camel_folder_summary_uid (folder->summary, entry->uid))) {
/* Note: this should never happen, but rather than crash lets make a new info */
@@ -320,7 +320,7 @@ groupwise_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, Camel
CamelOfflineJournal *
-camel_groupwise_journal_new (CamelGroupwiseFolder *folder, const char *filename)
+camel_groupwise_journal_new (CamelGroupwiseFolder *folder, const gchar *filename)
{
CamelOfflineJournal *journal;
@@ -334,7 +334,7 @@ camel_groupwise_journal_new (CamelGroupwiseFolder *folder, const char *filename)
static gboolean
update_cache (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *message,
- const CamelMessageInfo *mi, char **updated_uid, CamelException *ex)
+ const CamelMessageInfo *mi, gchar **updated_uid, CamelException *ex)
{
CamelOfflineJournal *journal = (CamelOfflineJournal *) groupwise_journal;
CamelGroupwiseFolder *groupwise_folder = (CamelGroupwiseFolder *) journal->folder;
@@ -342,7 +342,7 @@ update_cache (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *messag
CamelMessageInfo *info;
CamelStream *cache;
guint32 nextuid;
- char *uid;
+ gchar *uid;
if (groupwise_folder->cache == NULL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -391,11 +391,11 @@ update_cache (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *messag
void
camel_groupwise_journal_append (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *message,
- const CamelMessageInfo *mi, char **appended_uid, CamelException *ex)
+ const CamelMessageInfo *mi, gchar **appended_uid, CamelException *ex)
{
CamelOfflineJournal *journal = (CamelOfflineJournal *) groupwise_journal;
CamelGroupwiseJournalEntry *entry;
- char *uid;
+ gchar *uid;
if (!update_cache (groupwise_journal, message, mi, &uid, ex))
return;
@@ -413,13 +413,13 @@ camel_groupwise_journal_append (CamelGroupwiseJournal *groupwise_journal, CamelM
void
camel_groupwise_journal_transfer (CamelGroupwiseJournal *groupwise_journal, CamelGroupwiseFolder *source_folder,
CamelMimeMessage *message, const CamelMessageInfo *mi,
- const char *original_uid, char **transferred_uid,
+ const gchar *original_uid, gchar **transferred_uid,
CamelException *ex)
{
CamelOfflineJournal *journal = (CamelOfflineJournal *) groupwise_journal;
CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(journal->folder->parent_store) ;
CamelGroupwiseJournalEntry *entry;
- char *uid;
+ gchar *uid;
if (!update_cache (groupwise_journal, message, mi, &uid, ex))
return;
diff --git a/camel/providers/groupwise/camel-groupwise-journal.h b/camel/providers/groupwise/camel-groupwise-journal.h
index 8a02e2ddd..f95382b48 100644
--- a/camel/providers/groupwise/camel-groupwise-journal.h
+++ b/camel/providers/groupwise/camel-groupwise-journal.h
@@ -56,9 +56,9 @@ struct _CamelGroupwiseJournalEntry {
guint32 type;
- char *uid;
- char *original_uid;
- char *source_container;
+ gchar *uid;
+ gchar *original_uid;
+ gchar *source_container;
};
struct _CamelGroupwiseJournal {
@@ -74,13 +74,13 @@ struct _CamelGroupwiseJournalClass {
CamelType camel_groupwise_journal_get_type (void);
-CamelOfflineJournal *camel_groupwise_journal_new (struct _CamelGroupwiseFolder *folder, const char *filename);
+CamelOfflineJournal *camel_groupwise_journal_new (struct _CamelGroupwiseFolder *folder, const gchar *filename);
/* interfaces for adding a journal entry */
void camel_groupwise_journal_append (CamelGroupwiseJournal *journal, CamelMimeMessage *message, const CamelMessageInfo *mi,
- char **appended_uid, CamelException *ex);
+ gchar **appended_uid, CamelException *ex);
void camel_groupwise_journal_transfer (CamelGroupwiseJournal *journal, CamelGroupwiseFolder *source_folder, CamelMimeMessage *message,
- const CamelMessageInfo *mi, const char *orginal_uid, char **transferred_uid, CamelException *ex);
+ const CamelMessageInfo *mi, const gchar *orginal_uid, gchar **transferred_uid, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/groupwise/camel-groupwise-provider.c b/camel/providers/groupwise/camel-groupwise-provider.c
index 3f3efe920..a3ce5b7bf 100644
--- a/camel/providers/groupwise/camel-groupwise-provider.c
+++ b/camel/providers/groupwise/camel-groupwise-provider.c
@@ -42,9 +42,9 @@
#include "camel-groupwise-store.h"
#include "camel-groupwise-transport.h"
-static void add_hash (guint *hash, char *s);
+static void add_hash (guint *hash, gchar *s);
static guint groupwise_url_hash (gconstpointer key);
-static gint check_equal (char *s1, char *s2);
+static gint check_equal (gchar *s1, gchar *s2);
static gint groupwise_url_equal (gconstpointer a, gconstpointer b);
@@ -152,7 +152,7 @@ camel_provider_module_init(void)
static void
-add_hash (guint *hash, char *s)
+add_hash (guint *hash, gchar *s)
{
if (s)
*hash ^= g_str_hash(s);
@@ -172,7 +172,7 @@ groupwise_url_hash (gconstpointer key)
}
static gint
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
if (s2 == NULL)
diff --git a/camel/providers/groupwise/camel-groupwise-store-summary.c b/camel/providers/groupwise/camel-groupwise-store-summary.c
index 25422ecc7..985d5fe38 100644
--- a/camel/providers/groupwise/camel-groupwise-store-summary.c
+++ b/camel/providers/groupwise/camel-groupwise-store-summary.c
@@ -44,16 +44,16 @@
static void namespace_clear(CamelStoreSummary *s);
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
+static gint summary_header_load(CamelStoreSummary *, FILE *);
+static gint summary_header_save(CamelStoreSummary *, FILE *);
static CamelStoreInfo *store_info_load(CamelStoreSummary *s, FILE *in) ;
-static int store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi) ;
+static gint store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi) ;
static void store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi) ;
-static void store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str) ;
+static void store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str) ;
-static const char *store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type) ;
-CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_find_full(CamelGroupwiseStoreSummary *s, const char *full) ;
+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 void camel_groupwise_store_summary_class_init (CamelGroupwiseStoreSummaryClass *klass);
static void camel_groupwise_store_summary_init (CamelGroupwiseStoreSummary *obj);
@@ -125,9 +125,9 @@ camel_groupwise_store_summary_new (void)
CamelGroupwiseStoreInfo *
-camel_groupwise_store_summary_full_name(CamelGroupwiseStoreSummary *s, const char *full_name)
+camel_groupwise_store_summary_full_name(CamelGroupwiseStoreSummary *s, const gchar *full_name)
{
- int count, i;
+ gint count, i;
CamelGroupwiseStoreInfo *info;
count = camel_store_summary_count((CamelStoreSummary *)s);
@@ -143,12 +143,12 @@ camel_groupwise_store_summary_full_name(CamelGroupwiseStoreSummary *s, const cha
return NULL;
}
-char *
-camel_groupwise_store_summary_full_to_path(CamelGroupwiseStoreSummary *s, const char *full_name, char dir_sep)
+gchar *
+camel_groupwise_store_summary_full_to_path(CamelGroupwiseStoreSummary *s, const gchar *full_name, gchar dir_sep)
{
- char *path, *p;
- int c;
- const char *f;
+ gchar *path, *p;
+ gint c;
+ const gchar *f;
if (dir_sep != '/') {
p = path = alloca(strlen(full_name)*3+1);
@@ -163,7 +163,7 @@ camel_groupwise_store_summary_full_to_path(CamelGroupwiseStoreSummary *s, const
}
*p = 0;
} else
- path = (char *)full_name;
+ path = (gchar *)full_name;
return g_strdup (path);
}
@@ -225,14 +225,14 @@ namespace_load(CamelStoreSummary *s, FILE *in)
return ns;
}
-char *
-camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const char *path, char dir_sep)
+gchar *
+camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const gchar *path, gchar dir_sep)
{
- unsigned char *full, *f;
+ guchar *full, *f;
guint32 c, v = 0;
- const char *p;
- int state=0;
- char *subpath, *last = NULL;
+ const gchar *p;
+ gint state=0;
+ gchar *subpath, *last = NULL;
CamelStoreInfo *si;
CamelGroupwiseStoreNamespace *ns;
@@ -265,7 +265,7 @@ camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const
else
p = path;
- while ( (c = camel_utf8_getc((const unsigned char **)&p)) ) {
+ while ( (c = camel_utf8_getc((const guchar **)&p)) ) {
switch(state) {
case 0:
if (c == '%')
@@ -305,9 +305,9 @@ camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const
}
CamelGroupwiseStoreNamespace *
-camel_groupwise_store_summary_namespace_find_full(CamelGroupwiseStoreSummary *s, const char *full)
+camel_groupwise_store_summary_namespace_find_full(CamelGroupwiseStoreSummary *s, const gchar *full)
{
- int len;
+ gint len;
CamelGroupwiseStoreNamespace *ns;
/* NB: this currently only compares against 1 namespace, in future compare against others */
@@ -327,12 +327,12 @@ camel_groupwise_store_summary_namespace_find_full(CamelGroupwiseStoreSummary *s,
}
CamelGroupwiseStoreInfo *
-camel_groupwise_store_summary_add_from_full(CamelGroupwiseStoreSummary *s, const char *full, char dir_sep)
+camel_groupwise_store_summary_add_from_full(CamelGroupwiseStoreSummary *s, const gchar *full, gchar dir_sep)
{
CamelGroupwiseStoreInfo *info;
- char *pathu8, *prefix;
- int len;
- char *full_name;
+ gchar *pathu8, *prefix;
+ gint len;
+ gchar *full_name;
CamelGroupwiseStoreNamespace *ns;
d(printf("adding full name '%s' '%c'\n", full, dir_sep));
@@ -384,11 +384,11 @@ camel_groupwise_store_summary_add_from_full(CamelGroupwiseStoreSummary *s, const
return info;
}
-char *
-camel_groupwise_store_summary_full_from_path(CamelGroupwiseStoreSummary *s, const char *path)
+gchar *
+camel_groupwise_store_summary_full_from_path(CamelGroupwiseStoreSummary *s, const gchar *path)
{
CamelGroupwiseStoreNamespace *ns;
- char *name = NULL;
+ gchar *name = NULL;
ns = camel_groupwise_store_summary_namespace_find_path(s, path);
if (ns)
@@ -400,11 +400,11 @@ camel_groupwise_store_summary_full_from_path(CamelGroupwiseStoreSummary *s, cons
}
CamelGroupwiseStoreNamespace *
-camel_groupwise_store_summary_namespace_new(CamelGroupwiseStoreSummary *s, const char *full_name, char dir_sep)
+camel_groupwise_store_summary_namespace_new(CamelGroupwiseStoreSummary *s, const gchar *full_name, gchar dir_sep)
{
CamelGroupwiseStoreNamespace *ns;
- char *p, *o, c;
- int len;
+ gchar *p, *o, c;
+ gint len;
ns = g_malloc0(sizeof(*ns));
ns->full_name = g_strdup(full_name);
@@ -436,9 +436,9 @@ camel_groupwise_store_summary_namespace_set(CamelGroupwiseStoreSummary *s, Camel
}
CamelGroupwiseStoreNamespace *
-camel_groupwise_store_summary_namespace_find_path(CamelGroupwiseStoreSummary *s, const char *path)
+camel_groupwise_store_summary_namespace_find_path(CamelGroupwiseStoreSummary *s, const gchar *path)
{
- int len;
+ gint len;
CamelGroupwiseStoreNamespace *ns;
/* NB: this currently only compares against 1 namespace, in future compare against others */
@@ -548,8 +548,8 @@ store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
+static const gchar *
+store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
{
CamelGroupwiseStoreInfo *isi = (CamelGroupwiseStoreInfo *)mi;
@@ -566,7 +566,7 @@ store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
}
static void
-store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
+store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
{
CamelGroupwiseStoreInfo *isi = (CamelGroupwiseStoreInfo *)mi;
diff --git a/camel/providers/groupwise/camel-groupwise-store-summary.h b/camel/providers/groupwise/camel-groupwise-store-summary.h
index 5df3bcedf..4d6bd0afd 100644
--- a/camel/providers/groupwise/camel-groupwise-store-summary.h
+++ b/camel/providers/groupwise/camel-groupwise-store-summary.h
@@ -44,15 +44,15 @@ enum {
struct _CamelGroupwiseStoreInfo {
CamelStoreInfo info;
- char *full_name;
+ gchar *full_name;
};
typedef struct _CamelGroupwiseStoreNamespace CamelGroupwiseStoreNamespace;
struct _CamelGroupwiseStoreNamespace {
- char *path; /* display path */
- char *full_name; /* real name */
- char sep; /* directory separator */
+ gchar *path; /* display path */
+ gchar *full_name; /* real name */
+ gchar sep; /* directory separator */
};
struct _CamelGroupwiseStoreSummary {
@@ -72,15 +72,15 @@ struct _CamelGroupwiseStoreSummaryClass {
CamelType camel_groupwise_store_summary_get_type (void);
CamelGroupwiseStoreSummary *camel_groupwise_store_summary_new (void);
-CamelGroupwiseStoreInfo *camel_groupwise_store_summary_full_name(CamelGroupwiseStoreSummary *s, const char *full_name) ;
-CamelGroupwiseStoreInfo *camel_groupwise_store_summary_add_from_full(CamelGroupwiseStoreSummary *s, const char *full, char dir_sep) ;
+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) ;
-char *camel_groupwise_store_summary_full_to_path(CamelGroupwiseStoreSummary *s, const char *full_name, char dir_sep) ;
-char *camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const char *path, char dir_sep) ;
-char *camel_groupwise_store_summary_full_from_path(CamelGroupwiseStoreSummary *s, const char *path) ;
+gchar *camel_groupwise_store_summary_full_to_path(CamelGroupwiseStoreSummary *s, const gchar *full_name, gchar dir_sep) ;
+gchar *camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const gchar *path, gchar dir_sep) ;
+gchar *camel_groupwise_store_summary_full_from_path(CamelGroupwiseStoreSummary *s, const gchar *path) ;
-CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_new(CamelGroupwiseStoreSummary *s, const char *full_name, char dir_sep) ;
-CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_find_path(CamelGroupwiseStoreSummary *s, const char *path) ;
+CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_new(CamelGroupwiseStoreSummary *s, const gchar *full_name, gchar dir_sep) ;
+CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_find_path(CamelGroupwiseStoreSummary *s, const gchar *path) ;
void camel_groupwise_store_summary_namespace_set(CamelGroupwiseStoreSummary *s, CamelGroupwiseStoreNamespace *ns) ;
#define camel_groupwise_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_LAST))
diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c
index 34baa6996..da4ba98a9 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -56,16 +56,16 @@
#define JUNK_ENABLE 1
#define JUNK_PERSISTENCE 14
-const char * CREATE_CURSOR_VIEW = "peek id default recipient threading hasAttachment subject status priority startDate created delivered size recurrenceKey";
+const gchar * CREATE_CURSOR_VIEW = "peek id default recipient threading hasAttachment subject status priority startDate created delivered size recurrenceKey";
struct _CamelGroupwiseStorePrivate {
- char *server_name;
- char *port;
- char *user;
- char *use_ssl;
+ gchar *server_name;
+ gchar *port;
+ gchar *user;
+ gchar *use_ssl;
- char *base_url;
- char *storage_path;
+ gchar *base_url;
+ gchar *storage_path;
GHashTable *id_hash; /*get names from ids*/
GHashTable *name_hash;/*get ids from names*/
@@ -76,9 +76,9 @@ struct _CamelGroupwiseStorePrivate {
static CamelOfflineStoreClass *parent_class = NULL;
extern CamelServiceAuthType camel_groupwise_password_authtype; /*for the query_auth_types function*/
-static CamelFolderInfo *convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, const char *url, CamelException *ex);
+static CamelFolderInfo *convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, const gchar *url, CamelException *ex);
static void groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex);
-static int match_path(const char *path, const char *name);
+static gint match_path(const gchar *path, const gchar *name);
@@ -89,9 +89,9 @@ groupwise_store_construct (CamelService *service, CamelSession *session,
{
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (service);
CamelStore *store = CAMEL_STORE (service);
- const char *property_value;
+ const gchar *property_value;
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
- char *path = NULL;
+ gchar *path = NULL;
d(printf ("\nin groupwise store constrcut\n"));
@@ -180,7 +180,7 @@ groupwise_auth_loop (CamelService *service, CamelException *ex)
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
gboolean authenticated = FALSE;
- char *uri;
+ gchar *uri;
EGwConnectionErrors errors = {E_GW_CONNECTION_STATUS_INVALID_OBJECT, NULL};
if (priv->use_ssl && !g_str_equal (priv->use_ssl, "never"))
@@ -193,7 +193,7 @@ groupwise_auth_loop (CamelService *service, CamelException *ex)
while (!authenticated) {
if (!service->url->passwd && !(store->flags & CAMEL_STORE_PROXY)) {
- char *prompt;
+ gchar *prompt;
prompt = camel_session_build_password_prompt (
"GroupWise", service->url->user, service->url->host);
@@ -211,7 +211,7 @@ groupwise_auth_loop (CamelService *service, CamelException *ex)
priv->cnc = e_gw_connection_new_with_error_handler (uri, priv->user, service->url->passwd, &errors);
if (!E_IS_GW_CONNECTION(priv->cnc) && priv->use_ssl && g_str_equal (priv->use_ssl, "when-possible")) {
- char *http_uri = g_strconcat ("http://", uri + 8, NULL);
+ gchar *http_uri = g_strconcat ("http://", uri + 8, NULL);
priv->cnc = e_gw_connection_new (http_uri, priv->user, service->url->passwd);
g_free (http_uri);
}
@@ -431,7 +431,7 @@ groupwise_store_query_auth_types (CamelService *service, CamelException *ex)
}
static gboolean
-groupwise_is_system_folder (const char *folder_name)
+groupwise_is_system_folder (const gchar *folder_name)
{
if (!strcmp (folder_name, "Mailbox") ||
!strcmp (folder_name, "Trash") ||
@@ -446,10 +446,10 @@ groupwise_is_system_folder (const char *folder_name)
/*Build/populate CamelFolderInfo structure based on the imap_build_folder_info function*/
static CamelFolderInfo *
-groupwise_build_folder_info(CamelGroupwiseStore *gw_store, const char *parent_name, const char *folder_name)
+groupwise_build_folder_info(CamelGroupwiseStore *gw_store, const gchar *parent_name, const gchar *folder_name)
{
CamelURL *url;
- const char *name;
+ const gchar *name;
CamelFolderInfo *fi;
CamelGroupwiseStorePrivate *priv = gw_store->priv;
@@ -495,13 +495,13 @@ groupwise_build_folder_info(CamelGroupwiseStore *gw_store, const char *parent_na
}
static void
-groupwise_forget_folder (CamelGroupwiseStore *gw_store, const char *folder_name, CamelException *ex)
+groupwise_forget_folder (CamelGroupwiseStore *gw_store, const gchar *folder_name, CamelException *ex)
{
CamelGroupwiseStorePrivate *priv = gw_store->priv;
- char *state_file;
- char *folder_dir, *storage_path;
+ gchar *state_file;
+ gchar *folder_dir, *storage_path;
CamelFolderInfo *fi;
- const char *name;
+ const gchar *name;
name = folder_name;
@@ -529,12 +529,12 @@ groupwise_forget_folder (CamelGroupwiseStore *gw_store, const char *folder_name,
}
static CamelFolder *
-groupwise_get_folder_from_disk (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+groupwise_get_folder_from_disk (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = gw_store->priv;
CamelFolder *folder;
- char *folder_dir, *storage_path;
+ gchar *folder_dir, *storage_path;
storage_path = g_strdup_printf("%s/folders", priv->storage_path);
folder_dir = e_path_to_physical (storage_path, folder_name);
@@ -553,18 +553,18 @@ groupwise_get_folder_from_disk (CamelStore *store, const char *folder_name, guin
}
static CamelFolder *
-groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+groupwise_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = gw_store->priv;
CamelFolder *folder;
CamelGroupwiseSummary *summary;
- char *container_id, *folder_dir, *storage_path;
+ gchar *container_id, *folder_dir, *storage_path;
EGwConnectionStatus status;
GList *list = NULL;
gboolean done = FALSE, all_ok = TRUE;
- const char *position = E_GW_CURSOR_POSITION_END;
- int count = 0, cursor, summary_count = 0;
+ const gchar *position = E_GW_CURSOR_POSITION_END;
+ gint count = 0, cursor, summary_count = 0;
CamelStoreInfo *si = NULL;
guint total = 0;
@@ -710,12 +710,12 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
{
CamelGroupwiseStorePrivate *priv = gw_store->priv;
CamelGroupwiseSummary *summary;
- char *container_id;
+ gchar *container_id;
EGwConnectionStatus status;
GList *list = NULL;
gboolean done = FALSE;
- const char *position = E_GW_CURSOR_POSITION_END;
- int count = 0, cursor, summary_count = 0;
+ const gchar *position = E_GW_CURSOR_POSITION_END;
+ gint count = 0, cursor, summary_count = 0;
CamelStoreInfo *si = NULL;
guint total = 0;
@@ -829,10 +829,10 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
}
static CamelFolderInfo *
-convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, const char *url, CamelException *ex)
+convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, const gchar *url, CamelException *ex)
{
- const char *name = NULL, *id = NULL, *parent = NULL;
- char *par_name = NULL;
+ const gchar *name = NULL, *id = NULL, *parent = NULL;
+ gchar *par_name = NULL;
CamelFolderInfo *fi;
CamelGroupwiseStoreInfo *si = NULL;
CamelGroupwiseStorePrivate *priv = store->priv;
@@ -931,7 +931,7 @@ convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, con
}
static void
-get_folders_free (void *k, void *v, void *d)
+get_folders_free (gpointer k, gpointer v, gpointer d)
{
CamelFolderInfo *fi = v;
camel_folder_info_free (fi);
@@ -941,13 +941,13 @@ static void
groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
{
CamelGroupwiseStorePrivate *priv = store->priv;
- int status;
+ gint status;
GList *folder_list = NULL, *temp_list = NULL, *list = NULL;
- char *url, *temp_url;
+ gchar *url, *temp_url;
CamelFolderInfo *info = NULL, *hfi = NULL;
GHashTable *present;
CamelStoreInfo *si = NULL;
- int count, i;
+ gint count, i;
if (!priv->cnc && ((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
if (((CamelService *)store)->status == CAMEL_SERVICE_DISCONNECTED){
@@ -974,13 +974,13 @@ groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
if ( url[strlen(url) - 1] != '/') {
temp_url = g_strconcat (url, "/", NULL);
- g_free ((char *)url);
+ g_free ((gchar *)url);
url = temp_url;
}
/*populate the hash table for finding the mapping from container id <-> folder name*/
for (;temp_list != NULL ; temp_list = g_list_next (temp_list) ) {
- const char *name, *id, *parent;
+ const gchar *name, *id, *parent;
name = e_gw_container_get_name (E_GW_CONTAINER (temp_list->data));
id = e_gw_container_get_id(E_GW_CONTAINER(temp_list->data));
parent = e_gw_container_get_parent_id (E_GW_CONTAINER(temp_list->data));
@@ -1011,7 +1011,7 @@ groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
if ( (type == E_GW_CONTAINER_TYPE_CALENDAR) || (type == E_GW_CONTAINER_TYPE_CONTACTS) )
continue;
- info = convert_to_folder_info (store, E_GW_CONTAINER (folder_list->data), (const char *)url, ex);
+ info = convert_to_folder_info (store, E_GW_CONTAINER (folder_list->data), (const gchar *)url, ex);
if (info) {
hfi = g_hash_table_lookup (present, info->full_name);
if (hfi == NULL)
@@ -1023,7 +1023,7 @@ groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
}
}
- g_free ((char *)url);
+ g_free ((gchar *)url);
e_gw_connection_free_container_list (list);
count = camel_store_summary_count ((CamelStoreSummary *)store->summary);
@@ -1049,14 +1049,14 @@ groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
}
static CamelFolderInfo *
-groupwise_get_folder_info_offline (CamelStore *store, const char *top,
+groupwise_get_folder_info_offline (CamelStore *store, const gchar *top,
guint32 flags, CamelException *ex)
{
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelFolderInfo *fi;
GPtrArray *folders;
- char *path, *name;
- int i;
+ gchar *path, *name;
+ gint i;
folders = g_ptr_array_new ();
@@ -1143,12 +1143,12 @@ static CamelSessionThreadOps store_refresh_ops = {
/*** Thread stuff ends ***/
static CamelFolderInfo *
-groupwise_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+groupwise_get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
CamelFolderInfo *info = NULL;
- char *top_folder = NULL;
+ gchar *top_folder = NULL;
if (top) {
top_folder = g_hash_table_lookup (priv->name_hash, top);
@@ -1225,8 +1225,8 @@ create_junk_folder (CamelStore *store)
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
CamelFolderInfo *root = NULL;
- char *parent_name, *folder_name, *child_container_id, *parent_id;
- int status;
+ gchar *parent_name, *folder_name, *child_container_id, *parent_id;
+ gint status;
parent_name = "";
folder_name = "Junk Mail";
@@ -1257,15 +1257,15 @@ create_junk_folder (CamelStore *store)
static CamelFolderInfo*
groupwise_create_folder(CamelStore *store,
- const char *parent_name,
- const char *folder_name,
+ const gchar *parent_name,
+ const gchar *folder_name,
CamelException *ex)
{
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
CamelFolderInfo *root = NULL;
- char *parent_id , *child_container_id;
- int status;
+ gchar *parent_id , *child_container_id;
+ gint status;
if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create GroupWise folders in offline mode."));
@@ -1314,13 +1314,13 @@ groupwise_create_folder(CamelStore *store,
static void
groupwise_delete_folder(CamelStore *store,
- const char *folder_name,
+ const gchar *folder_name,
CamelException *ex)
{
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
EGwConnectionStatus status;
- const char * container;
+ const gchar * container;
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
@@ -1350,15 +1350,15 @@ groupwise_delete_folder(CamelStore *store,
static void
groupwise_rename_folder(CamelStore *store,
- const char *old_name,
- const char *new_name,
+ const gchar *old_name,
+ const gchar *new_name,
CamelException *ex)
{
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
- char *oldpath, *newpath, *storepath;
- const char *container_id;
- char *temp_new = NULL;
+ gchar *oldpath, *newpath, *storepath;
+ const gchar *container_id;
+ gchar *temp_new = NULL;
if (groupwise_is_system_folder (old_name)) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot rename GroupWise folder '%s' to '%s'"),
@@ -1380,7 +1380,7 @@ groupwise_rename_folder(CamelStore *store,
if (temp_new)
temp_new++;
else
- temp_new = (char *)new_name;
+ temp_new = (gchar *)new_name;
if (!container_id || e_gw_connection_rename_folder (priv->cnc, container_id , temp_new) != E_GW_CONNECTION_STATUS_OK)
{
@@ -1412,7 +1412,7 @@ groupwise_rename_folder(CamelStore *store,
CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
}
-char *
+gchar *
groupwise_get_name(CamelService *service, gboolean brief)
{
if(brief)
@@ -1422,16 +1422,16 @@ groupwise_get_name(CamelService *service, gboolean brief)
service->url->user, service->url->host);
}
-const char *
-camel_groupwise_store_container_id_lookup (CamelGroupwiseStore *gw_store, const char *folder_name)
+const gchar *
+camel_groupwise_store_container_id_lookup (CamelGroupwiseStore *gw_store, const gchar *folder_name)
{
CamelGroupwiseStorePrivate *priv = gw_store->priv;
return g_hash_table_lookup (priv->name_hash, folder_name);
}
-const char *
-camel_groupwise_store_folder_lookup (CamelGroupwiseStore *gw_store, const char *container_id)
+const gchar *
+camel_groupwise_store_folder_lookup (CamelGroupwiseStore *gw_store, const gchar *container_id)
{
CamelGroupwiseStorePrivate *priv = gw_store->priv;
@@ -1445,13 +1445,13 @@ cnc_lookup (CamelGroupwiseStorePrivate *priv)
return priv->cnc;
}
-char *
+gchar *
storage_path_lookup (CamelGroupwiseStorePrivate *priv)
{
return priv->storage_path;
}
-const char *
+const gchar *
groupwise_base_url_lookup (CamelGroupwiseStorePrivate *priv)
{
return priv->base_url;
@@ -1462,7 +1462,7 @@ groupwise_get_trash (CamelStore *store, CamelException *ex)
{
CamelFolder *folder = camel_store_get_folder(store, "Trash", 0, ex);
if (folder) {
- char *state = g_build_filename((CAMEL_GROUPWISE_STORE(store))->priv->storage_path, "folders", "Trash", "cmeta", NULL);
+ gchar *state = g_build_filename((CAMEL_GROUPWISE_STORE(store))->priv->storage_path, "folders", "Trash", "cmeta", NULL);
camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
g_free(state);
@@ -1500,9 +1500,9 @@ camel_groupwise_store_connected (CamelGroupwiseStore *store, CamelException *ex)
}
static int
-match_path(const char *path, const char *name)
+match_path(const gchar *path, const gchar *name)
{
- char p, n;
+ gchar p, n;
p = *path++;
n = *name++;
diff --git a/camel/providers/groupwise/camel-groupwise-store.h b/camel/providers/groupwise/camel-groupwise-store.h
index 386510fe7..0fc3f29d8 100644
--- a/camel/providers/groupwise/camel-groupwise-store.h
+++ b/camel/providers/groupwise/camel-groupwise-store.h
@@ -50,7 +50,7 @@ struct _CamelGroupwiseStore {
struct _CamelGroupwiseStoreSummary *summary;
- char *root_container;
+ gchar *root_container;
CamelGroupwiseStorePrivate *priv;
CamelFolder *current_folder;
@@ -68,14 +68,14 @@ struct _CamelGroupwiseStoreClass {
/* Standard Camel function */
CamelType camel_groupwise_store_get_type (void);
-char * groupwise_get_name(CamelService *service, gboolean brief);
+gchar * groupwise_get_name(CamelService *service, gboolean brief);
/*IMplemented*/
-const char *camel_groupwise_store_container_id_lookup (CamelGroupwiseStore *gw_store, const char *folder_name);
-const char *camel_groupwise_store_folder_lookup (CamelGroupwiseStore *gw_store, const char *container_id);
+const gchar *camel_groupwise_store_container_id_lookup (CamelGroupwiseStore *gw_store, const gchar *folder_name);
+const gchar *camel_groupwise_store_folder_lookup (CamelGroupwiseStore *gw_store, const gchar *container_id);
EGwConnection *cnc_lookup (CamelGroupwiseStorePrivate *priv);
-char *storage_path_lookup (CamelGroupwiseStorePrivate *priv);
-const char *groupwise_base_url_lookup (CamelGroupwiseStorePrivate *priv);
+gchar *storage_path_lookup (CamelGroupwiseStorePrivate *priv);
+const gchar *groupwise_base_url_lookup (CamelGroupwiseStorePrivate *priv);
CamelFolderInfo * create_junk_folder (CamelStore *store);
gboolean camel_groupwise_store_connected (CamelGroupwiseStore *store, CamelException *ex);
void gw_store_reload_folder (CamelGroupwiseStore *store, CamelFolder *folder, guint32 flags, CamelException *ex);
diff --git a/camel/providers/groupwise/camel-groupwise-summary.c b/camel/providers/groupwise/camel-groupwise-summary.c
index 2da8338e3..3b605b18f 100644
--- a/camel/providers/groupwise/camel-groupwise-summary.c
+++ b/camel/providers/groupwise/camel-groupwise-summary.c
@@ -50,21 +50,21 @@
#define d(x)
/*Prototypes*/
-static int gw_summary_header_load (CamelFolderSummary *, FILE *);
-static int gw_summary_header_save (CamelFolderSummary *, FILE *);
+static gint gw_summary_header_load (CamelFolderSummary *, FILE *);
+static gint gw_summary_header_save (CamelFolderSummary *, FILE *);
static CamelMessageInfo *gw_message_info_load (CamelFolderSummary *s, FILE *in) ;
-static int gw_message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info) ;
+static gint gw_message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info) ;
static CamelMessageContentInfo * gw_content_info_load (CamelFolderSummary *s, FILE *in) ;
-static int gw_content_info_save (CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *info) ;
+static gint gw_content_info_save (CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *info) ;
static gboolean gw_info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set);
-static int summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
+static gint summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
static CamelFIRecord * summary_header_to_db (CamelFolderSummary *s, CamelException *ex);
static CamelMIRecord * message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info);
static CamelMessageInfo * message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir);
-static int content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir);
+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_groupwise_summary_class_init (CamelGroupwiseSummaryClass *klass);
@@ -161,7 +161,7 @@ camel_groupwise_summary_init (CamelGroupwiseSummary *obj)
* Return value: A new CamelGroupwiseSummary object.
**/
CamelFolderSummary *
-camel_groupwise_summary_new (struct _CamelFolder *folder, const char *filename)
+camel_groupwise_summary_new (struct _CamelFolder *folder, const gchar *filename)
{
CamelException ex;
CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (
@@ -183,7 +183,7 @@ static int
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
{
CamelGroupwiseSummary *gms = CAMEL_GROUPWISE_SUMMARY (s);
- char *part;
+ gchar *part;
if (camel_groupwise_summary_parent->summary_header_from_db (s, mir) == -1)
return -1 ;
@@ -261,7 +261,7 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
info = camel_groupwise_summary_parent->message_info_from_db (s, mir);
if (info) {
- char *part = mir->bdata;
+ gchar *part = mir->bdata;
iinfo = (CamelGroupwiseMessageInfo *)info;
EXTRACT_FIRST_DIGIT (iinfo->server_flags)
}
@@ -315,7 +315,7 @@ gw_message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
static CamelMessageContentInfo *
content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
{
- char *part = mir->cinfo;
+ gchar *part = mir->cinfo;
guint32 type=0;
if (part) {
@@ -371,9 +371,9 @@ gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set)
{
guint32 old;
CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
- int read = 0 , deleted = 0;
+ gint read = 0 , deleted = 0;
- int junk_flag = 0, junk_learn_flag = 0;
+ gint junk_flag = 0, junk_learn_flag = 0;
/* TODO: locking? */
@@ -433,7 +433,7 @@ gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set)
void
-camel_gw_summary_add_offline (CamelFolderSummary *summary, const char *uid, CamelMimeMessage *message, const CamelMessageInfo *info)
+camel_gw_summary_add_offline (CamelFolderSummary *summary, const gchar *uid, CamelMimeMessage *message, const CamelMessageInfo *info)
{
CamelGroupwiseMessageInfo *mi ;
const CamelFlag *flag ;
@@ -464,7 +464,7 @@ camel_gw_summary_add_offline (CamelFolderSummary *summary, const char *uid, Came
}
void
-camel_gw_summary_add_offline_uncached (CamelFolderSummary *summary, const char *uid, const CamelMessageInfo *info)
+camel_gw_summary_add_offline_uncached (CamelFolderSummary *summary, const gchar *uid, const CamelMessageInfo *info)
{
CamelGroupwiseMessageInfo *mi;
@@ -478,8 +478,8 @@ groupwise_summary_clear (CamelFolderSummary *summary, gboolean uncache)
{
CamelFolderChangeInfo *changes;
CamelMessageInfo *info;
- int i, count;
- const char *uid;
+ gint i, count;
+ const gchar *uid;
changes = camel_folder_change_info_new ();
count = camel_folder_summary_count (summary);
diff --git a/camel/providers/groupwise/camel-groupwise-summary.h b/camel/providers/groupwise/camel-groupwise-summary.h
index 040516bc2..2edddd078 100644
--- a/camel/providers/groupwise/camel-groupwise-summary.h
+++ b/camel/providers/groupwise/camel-groupwise-summary.h
@@ -58,7 +58,7 @@ struct _CamelGroupwiseMessageContentInfo {
struct _CamelGroupwiseSummary {
CamelFolderSummary parent;
- char *time_string;
+ gchar *time_string;
gint32 version;
gint32 validity;
} ;
@@ -71,11 +71,11 @@ struct _CamelGroupwiseSummaryClass {
CamelType camel_groupwise_summary_get_type (void) ;
-CamelFolderSummary *camel_groupwise_summary_new (struct _CamelFolder *folder, const char *filename) ;
+CamelFolderSummary *camel_groupwise_summary_new (struct _CamelFolder *folder, const gchar *filename) ;
-void camel_gw_summary_add_offline (CamelFolderSummary *summary, const char *uid, CamelMimeMessage *messgae, const CamelMessageInfo *info) ;
+void camel_gw_summary_add_offline (CamelFolderSummary *summary, const gchar *uid, CamelMimeMessage *messgae, const CamelMessageInfo *info) ;
-void camel_gw_summary_add_offline_uncached (CamelFolderSummary *summary, const char *uid, const CamelMessageInfo *info) ;
+void camel_gw_summary_add_offline_uncached (CamelFolderSummary *summary, const gchar *uid, const CamelMessageInfo *info) ;
void groupwise_summary_clear (CamelFolderSummary *summary, gboolean uncache);
G_END_DECLS
diff --git a/camel/providers/groupwise/camel-groupwise-transport.c b/camel/providers/groupwise/camel-groupwise-transport.c
index 759c9164c..75a386ef0 100644
--- a/camel/providers/groupwise/camel-groupwise-transport.c
+++ b/camel/providers/groupwise/camel-groupwise-transport.c
@@ -51,7 +51,7 @@ static gboolean groupwise_send_to (CamelTransport *transport,
CamelException *ex);
static gboolean groupwise_transport_connect (CamelService *service, CamelException *ex);
-static char *groupwise_transport_get_name (CamelService *service, gboolean brief);
+static gchar *groupwise_transport_get_name (CamelService *service, gboolean brief);
static void groupwise_transport_construct (CamelService *service, CamelSession *session,
CamelProvider *provider, CamelURL *url, CamelException *ex);
@@ -115,7 +115,7 @@ camel_groupwise_transport_get_type (void)
return camel_groupwise_transport_type;
}
-static char *groupwise_transport_get_name (CamelService *service, gboolean brief)
+static gchar *groupwise_transport_get_name (CamelService *service, gboolean brief)
{
if (brief)
return g_strdup_printf (_("GroupWise server %s"), service->url->host);
@@ -149,8 +149,8 @@ groupwise_send_to (CamelTransport *transport,
EGwConnection *cnc = NULL;
EGwConnectionStatus status = 0;
GSList *sent_item_list = NULL;
- char *url = NULL;
- const char *reply_request = NULL;
+ gchar *url = NULL;
+ const gchar *reply_request = NULL;
EGwItemLinkInfo *info = NULL;
if (!transport) {
@@ -187,12 +187,12 @@ groupwise_send_to (CamelTransport *transport,
item = camel_groupwise_util_item_from_message (cnc, message, from);
- reply_request = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), "In-Reply-To");
+ reply_request = (gchar *)camel_medium_get_header (CAMEL_MEDIUM (message), "In-Reply-To");
if (reply_request) {
- char *id;
- int len = strlen (reply_request);
+ gchar *id;
+ gint len = strlen (reply_request);
- id = (char *)g_malloc0 (len-1);
+ id = (gchar *)g_malloc0 (len-1);
id = memcpy(id, reply_request+2, len-3);
status = e_gw_connection_reply_item (cnc, id, NULL, &temp_item);
if (status != E_GW_CONNECTION_STATUS_OK)
diff --git a/camel/providers/groupwise/camel-groupwise-utils.c b/camel/providers/groupwise/camel-groupwise-utils.c
index fb784c2f9..494b159fd 100644
--- a/camel/providers/groupwise/camel-groupwise-utils.c
+++ b/camel/providers/groupwise/camel-groupwise-utils.c
@@ -60,14 +60,14 @@ static void do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp,
*
* Return value: the expanded path
**/
-char *
-e_path_to_physical (const char *prefix, const char *vpath)
+gchar *
+e_path_to_physical (const gchar *prefix, const gchar *vpath)
{
- const char *p, *newp;
- char *dp;
- char *ppath;
- int ppath_len;
- int prefix_len;
+ const gchar *p, *newp;
+ gchar *dp;
+ gchar *ppath;
+ gint ppath_len;
+ gint prefix_len;
while (*vpath == '/')
vpath++;
@@ -137,11 +137,11 @@ e_path_to_physical (const char *prefix, const char *vpath)
static gboolean
-find_folders_recursive (const char *physical_path, const char *path,
+find_folders_recursive (const gchar *physical_path, const gchar *path,
EPathFindFoldersCallback callback, gpointer data)
{
GDir *dir;
- char *subfolder_directory_path;
+ gchar *subfolder_directory_path;
gboolean ok;
if (*path) {
@@ -167,9 +167,9 @@ find_folders_recursive (const char *physical_path, const char *path,
ok = TRUE;
while (ok) {
struct stat file_stat;
- const char *dirent;
- char *file_path;
- char *new_path;
+ const gchar *dirent;
+ gchar *file_path;
+ gchar *new_path;
dirent = g_dir_read_name (dir);
if (dirent == NULL)
@@ -209,7 +209,7 @@ find_folders_recursive (const char *physical_path, const char *path,
* Return value: %TRUE on success, %FALSE if an error occurs at any point
**/
gboolean
-e_path_find_folders (const char *prefix,
+e_path_find_folders (const gchar *prefix,
EPathFindFoldersCallback callback,
gpointer data)
{
@@ -230,10 +230,10 @@ e_path_find_folders (const char *prefix,
* specified directory. 0 otherwise, whether or not it removed
* the parent directory.
**/
-int
-e_path_rmdir (const char *prefix, const char *vpath)
+gint
+e_path_rmdir (const gchar *prefix, const gchar *vpath)
{
- char *physical_path, *p;
+ gchar *physical_path, *p;
/* Remove the directory itself */
physical_path = e_path_to_physical (prefix, vpath);
@@ -264,14 +264,14 @@ e_path_rmdir (const char *prefix, const char *vpath)
}
static GSList *
-add_recipients(GSList *recipient_list, CamelAddress *recipients, int recipient_type)
+add_recipients(GSList *recipient_list, CamelAddress *recipients, gint recipient_type)
{
- int total_add,i;
+ gint total_add,i;
EGwItemRecipient *recipient;
total_add = camel_address_length (recipients);
for (i=0 ; i<total_add ; i++) {
- const char *name = NULL, *addr = NULL;
+ const gchar *name = NULL, *addr = NULL;
if(camel_internet_address_get ((CamelInternetAddress *)recipients, i , &name, &addr )) {
recipient = g_new0 (EGwItemRecipient, 1);
@@ -287,7 +287,7 @@ add_recipients(GSList *recipient_list, CamelAddress *recipients, int recipient_t
}
static void
-send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content, CamelContentType *type, CamelDataWrapper *dw, const char *filename, const char *cid, GSList **attach_list)
+send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content, CamelContentType *type, CamelDataWrapper *dw, const gchar *filename, const gchar *cid, GSList **attach_list)
{
EGwItemLinkInfo *info = NULL;
EGwConnectionStatus status;
@@ -302,8 +302,8 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
if (filename && content->buffer->data) {
if (camel_content_type_is (type, "application", "pgp-signature")) {
- char *temp_str;
- int temp_len;
+ gchar *temp_str;
+ gint temp_len;
temp_str = g_base64_encode (content->buffer->data, content->buffer->len);
temp_len = strlen (temp_str);
attachment->data = g_strdup (temp_str);
@@ -316,8 +316,8 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
attachment->size = strlen (attachment->data);
}
} else if (content->buffer->data) {
- char *temp_str;
- int temp_len;
+ gchar *temp_str;
+ gint temp_len;
if (!strcmp (attachment->contentType, "multipart/digest")) {
/* FIXME? */
} else {
@@ -343,9 +343,9 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
attachment->name = g_strdup (filename ? filename : "");
if (camel_content_type_is (type, "message", "rfc822")) {
- const char *message_id;
- char *msgid;
- int len;
+ const gchar *message_id;
+ gchar *msgid;
+ gint len;
message_id = camel_medium_get_header (CAMEL_MEDIUM (dw), "Message-Id");
/*
@@ -356,7 +356,7 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
*/
len = strlen (message_id);
- msgid = (char *)g_malloc0 (len-1);
+ msgid = (gchar *)g_malloc0 (len-1);
msgid = memcpy(msgid, message_id+2, len-3);
g_print ("||| msgid:%s\n", msgid);
@@ -390,8 +390,8 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
{
EGwItem *item;
EGwItemOrganizer *org = g_new0 (EGwItemOrganizer, 1);
- const char *display_name = NULL, *email = NULL;
- char *send_options = NULL;
+ const gchar *display_name = NULL, *email = NULL;
+ gchar *send_options = NULL;
CamelMultipart *mp;
GSList *recipient_list = NULL, *attach_list = NULL;
CamelAddress *recipients;
@@ -433,8 +433,8 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
if (camel_content_type_is (type, "text", "plain")) {
CamelStream *filtered_stream;
CamelMimeFilter *filter;
- const char *charset;
- char *content_type;
+ const gchar *charset;
+ gchar *content_type;
content_type = camel_content_type_simple (type);
e_gw_item_set_content_type (item, content_type);
@@ -457,7 +457,7 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
camel_object_unref (filtered_stream);
camel_stream_write ((CamelStream *) content, "", 1);
- e_gw_item_set_message (item, (const char *)content->buffer->data);
+ e_gw_item_set_message (item, (const gchar *)content->buffer->data);
} else {
camel_data_wrapper_decode_to_stream (dw, (CamelStream *) content);
send_as_attachment (cnc, item, content, type, dw, NULL, NULL, &attach_list);
@@ -483,23 +483,23 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
/*send options*/
e_gw_item_set_sendoptions (item, TRUE);
- if ((char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_REPLY_CONVENIENT))
+ if ((gchar *)camel_medium_get_header (CAMEL_MEDIUM(message), X_REPLY_CONVENIENT))
e_gw_item_set_reply_request (item, TRUE);
- send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_REPLY_WITHIN);
+ send_options = (gchar *)camel_medium_get_header (CAMEL_MEDIUM(message), X_REPLY_WITHIN);
if (send_options) {
e_gw_item_set_reply_request (item, TRUE);
e_gw_item_set_reply_within (item, send_options);
}
- send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM(message),X_EXPIRE_AFTER);
+ send_options = (gchar *)camel_medium_get_header (CAMEL_MEDIUM(message),X_EXPIRE_AFTER);
if (send_options)
e_gw_item_set_expires (item, send_options);
- send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_DELAY_UNTIL);
+ send_options = (gchar *)camel_medium_get_header (CAMEL_MEDIUM(message), X_DELAY_UNTIL);
if (send_options)
e_gw_item_set_delay_until (item, send_options);
- send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_TRACK_WHEN);
+ send_options = (gchar *)camel_medium_get_header (CAMEL_MEDIUM(message), X_TRACK_WHEN);
/*we check if user has modified the status tracking options, if no then we anyway
* set status tracking all*/
@@ -517,10 +517,10 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
} else
e_gw_item_set_track_info (item, E_GW_ITEM_ALL);
- if ((char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_AUTODELETE))
+ if ((gchar *)camel_medium_get_header (CAMEL_MEDIUM(message), X_AUTODELETE))
e_gw_item_set_autodelete (item, TRUE);
- send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), X_RETURN_NOTIFY_OPEN);
+ send_options = (gchar *)camel_medium_get_header (CAMEL_MEDIUM (message), X_RETURN_NOTIFY_OPEN);
if (send_options) {
switch (atoi(send_options)) {
case 0: e_gw_item_set_notify_opened (item, E_GW_ITEM_NOTIFY_NONE);
@@ -528,7 +528,7 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
case 1: e_gw_item_set_notify_opened (item, E_GW_ITEM_NOTIFY_MAIL);
}
}
- send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), X_RETURN_NOTIFY_DELETE);
+ send_options = (gchar *)camel_medium_get_header (CAMEL_MEDIUM (message), X_RETURN_NOTIFY_DELETE);
if (send_options) {
switch (atoi(send_options)) {
case 0: e_gw_item_set_notify_deleted (item, E_GW_ITEM_NOTIFY_NONE);
@@ -537,7 +537,7 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
}
}
- send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), X_SEND_OPT_PRIORITY);
+ send_options = (gchar *)camel_medium_get_header (CAMEL_MEDIUM (message), X_SEND_OPT_PRIORITY);
if (send_options) {
switch (atoi(send_options)) {
case E_GW_PRIORITY_HIGH: e_gw_item_set_priority(item, "High");
@@ -549,7 +549,7 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
}
}
- send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), X_SEND_OPT_SECURITY);
+ send_options = (gchar *)camel_medium_get_header (CAMEL_MEDIUM (message), X_SEND_OPT_SECURITY);
if (send_options) {
switch (atoi(send_options)) {
case E_GW_SECURITY_NORMAL : e_gw_item_set_security(item, "Normal");
@@ -576,8 +576,8 @@ do_flags_diff (flags_diff_t *diff, guint32 old, guint32 _new)
diff->bits = _new & diff->changed;
}
-char *
-gw_concat ( const char *prefix, const char *suffix)
+gchar *
+gw_concat ( const gchar *prefix, const gchar *suffix)
{
size_t len;
@@ -589,15 +589,15 @@ gw_concat ( const char *prefix, const char *suffix)
}
void
-strip_lt_gt (char **string, int s_offset, int e_offset)
+strip_lt_gt (gchar **string, gint s_offset, gint e_offset)
{
- char *temp = NULL;
- int len;
+ gchar *temp = NULL;
+ gint len;
temp = g_strdup (*string);
len = strlen (*string);
- *string = (char *)g_malloc0 (len-1);
+ *string = (gchar *)g_malloc0 (len-1);
*string = memcpy(*string, temp+s_offset, len-e_offset);
g_free (temp);
}
@@ -607,7 +607,7 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
{
/*contains multiple parts*/
guint part_count;
- int i;
+ gint i;
part_count = camel_multipart_get_number (mp);
for ( i=0 ; i<part_count ; i++) {
@@ -615,8 +615,8 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
CamelMimePart *part;
CamelStreamMem *content = (CamelStreamMem *)camel_stream_mem_new ();
CamelDataWrapper *dw = NULL;
- const char *disposition, *filename;
- const char *content_id = NULL;
+ const gchar *disposition, *filename;
+ const gchar *content_id = NULL;
gboolean is_alternative = FALSE;
/*
* XXX:
@@ -639,7 +639,7 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
if (type->subtype && !strcmp (type->subtype, "alternative")) {
/* eh... I don't think this code will ever get hit? */
CamelMimePart *temp_part;
- const char *cid = NULL;
+ const gchar *cid = NULL;
CamelStreamMem *temp_content = (CamelStreamMem *)camel_stream_mem_new ();
CamelDataWrapper *temp_dw = NULL;
@@ -660,8 +660,8 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
if (i == 0 && camel_content_type_is (type, "text", "plain")) {
CamelStream *filtered_stream;
CamelMimeFilter *filter;
- const char *charset;
- char *content_type;
+ const gchar *charset;
+ gchar *content_type;
content_type = camel_content_type_simple (type);
e_gw_item_set_content_type (item, content_type);
@@ -684,7 +684,7 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
camel_object_unref (filtered_stream);
camel_stream_write ((CamelStream *) content, "", 1);
- e_gw_item_set_message (item, (const char *)content->buffer->data);
+ e_gw_item_set_message (item, (const gchar *)content->buffer->data);
} else {
filename = camel_mime_part_get_filename (part);
disposition = camel_mime_part_get_disposition (part);
diff --git a/camel/providers/groupwise/camel-groupwise-utils.h b/camel/providers/groupwise/camel-groupwise-utils.h
index b851cc64b..83407841e 100644
--- a/camel/providers/groupwise/camel-groupwise-utils.h
+++ b/camel/providers/groupwise/camel-groupwise-utils.h
@@ -61,24 +61,24 @@ typedef struct {
/* FIXME: deprecated
This is used exclusively for the legacy imap cache code. DO NOT use this in any new code */
-typedef gboolean (*EPathFindFoldersCallback) (const char *physical_path,
- const char *path,
+typedef gboolean (*EPathFindFoldersCallback) (const gchar *physical_path,
+ const gchar *path,
gpointer user_data);
-char * e_path_to_physical (const char *prefix, const char *vpath);
+gchar * e_path_to_physical (const gchar *prefix, const gchar *vpath);
-gboolean e_path_find_folders (const char *prefix,
+gboolean e_path_find_folders (const gchar *prefix,
EPathFindFoldersCallback callback,
gpointer data);
-int e_path_rmdir (const char *prefix, const char *vpath);
+gint e_path_rmdir (const gchar *prefix, const gchar *vpath);
EGwItem *camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *message, CamelAddress *from);
void do_flags_diff (flags_diff_t *diff, guint32 old, guint32 _new);
-char *gw_concat ( const char *prefix, const char *suffix);
-void strip_lt_gt (char **string, int s_offset, int e_offset);
+gchar *gw_concat ( const gchar *prefix, const gchar *suffix);
+void strip_lt_gt (gchar **string, gint s_offset, gint e_offset);
G_END_DECLS
diff --git a/camel/providers/hula/camel-hula-provider.c b/camel/providers/hula/camel-hula-provider.c
index 3615e2abd..7da65d566 100644
--- a/camel/providers/hula/camel-hula-provider.c
+++ b/camel/providers/hula/camel-hula-provider.c
@@ -37,9 +37,9 @@
#include "camel-session.h"
#include "camel-url.h"
-static void add_hash (guint *hash, char *s);
+static void add_hash (guint *hash, gchar *s);
static guint hula_url_hash (gconstpointer key);
-static gint check_equal (char *s1, char *s2);
+static gint check_equal (gchar *s1, gchar *s2);
static gint hula_url_equal (gconstpointer a, gconstpointer b);
@@ -135,7 +135,7 @@ camel_provider_module_init(void)
static void
-add_hash (guint *hash, char *s)
+add_hash (guint *hash, gchar *s)
{
if (s)
*hash ^= g_str_hash(s);
@@ -155,7 +155,7 @@ hula_url_hash (gconstpointer key)
}
static gint
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
if (s2 == NULL)
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 0b229feaa..c4ec30a11 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -47,18 +47,18 @@
#include "camel-imap-store.h"
#include "camel-imap-utils.h"
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
static gboolean imap_command_start (CamelImapStore *store, CamelFolder *folder,
- const char *cmd, CamelException *ex);
+ const gchar *cmd, CamelException *ex);
static CamelImapResponse *imap_read_response (CamelImapStore *store,
CamelException *ex);
-static char *imap_read_untagged (CamelImapStore *store, char *line,
+static gchar *imap_read_untagged (CamelImapStore *store, gchar *line,
CamelException *ex);
-static char *imap_command_strdup_vprintf (CamelImapStore *store,
- const char *fmt, va_list ap);
-static char *imap_command_strdup_printf (CamelImapStore *store,
- const char *fmt, ...);
+static gchar *imap_command_strdup_vprintf (CamelImapStore *store,
+ const gchar *fmt, va_list ap);
+static gchar *imap_command_strdup_printf (CamelImapStore *store,
+ const gchar *fmt, ...);
/**
* camel_imap_command:
@@ -89,10 +89,10 @@ static char *imap_command_strdup_printf (CamelImapStore *store,
**/
CamelImapResponse *
camel_imap_command (CamelImapStore *store, CamelFolder *folder,
- CamelException *ex, const char *fmt, ...)
+ CamelException *ex, const gchar *fmt, ...)
{
va_list ap;
- char *cmd;
+ gchar *cmd;
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
@@ -154,10 +154,10 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder,
**/
gboolean
camel_imap_command_start (CamelImapStore *store, CamelFolder *folder,
- CamelException *ex, const char *fmt, ...)
+ CamelException *ex, const gchar *fmt, ...)
{
va_list ap;
- char *cmd;
+ gchar *cmd;
gboolean ok;
va_start (ap, fmt);
@@ -175,7 +175,7 @@ camel_imap_command_start (CamelImapStore *store, CamelFolder *folder,
static gboolean
imap_command_start (CamelImapStore *store, CamelFolder *folder,
- const char *cmd, CamelException *ex)
+ const gchar *cmd, CamelException *ex)
{
ssize_t nwritten;
@@ -208,7 +208,7 @@ imap_command_start (CamelImapStore *store, CamelFolder *folder,
/* Send the command */
if (camel_verbose_debug) {
- const char *mask;
+ const gchar *mask;
if (!strncmp ("LOGIN \"", cmd, 7))
mask = "LOGIN \"xxx\" xxx";
@@ -257,7 +257,7 @@ imap_command_start (CamelImapStore *store, CamelFolder *folder,
* connect_lock will be released.
**/
CamelImapResponse *
-camel_imap_command_continuation (CamelImapStore *store, const char *cmd,
+camel_imap_command_continuation (CamelImapStore *store, const gchar *cmd,
size_t cmdlen, CamelException *ex)
{
if (!camel_imap_store_connected (store, ex))
@@ -305,11 +305,11 @@ camel_imap_command_continuation (CamelImapStore *store, const char *cmd,
* command lock will be unlocked.
**/
CamelImapResponseType
-camel_imap_command_response (CamelImapStore *store, char **response,
+camel_imap_command_response (CamelImapStore *store, gchar **response,
CamelException *ex)
{
CamelImapResponseType type;
- char *respbuf;
+ gchar *respbuf;
if (camel_imap_store_readline (store, &respbuf, ex) < 0) {
CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
@@ -319,7 +319,7 @@ camel_imap_command_response (CamelImapStore *store, char **response,
switch (*respbuf) {
case '*':
if (!g_ascii_strncasecmp (respbuf, "* BYE", 5)) {
- const char *err = NULL;
+ const gchar *err = NULL;
if (respbuf [5] && g_ascii_strncasecmp (respbuf + 6, "[ALERT] ", 8) == 0)
err = respbuf + 14;
@@ -347,7 +347,7 @@ camel_imap_command_response (CamelImapStore *store, char **response,
else if (!g_ascii_strncasecmp (respbuf, "* OK [ALERT]", 12)
|| !g_ascii_strncasecmp (respbuf, "* NO [ALERT]", 12)
|| !g_ascii_strncasecmp (respbuf, "* BAD [ALERT]", 13)) {
- char *msg;
+ gchar *msg;
/* for imap ALERT codes, account user@host */
/* we might get a ']' from a BAD response since we +12, but who cares? */
@@ -379,7 +379,7 @@ imap_read_response (CamelImapStore *store, CamelException *ex)
{
CamelImapResponse *response;
CamelImapResponseType type;
- char *respbuf, *p;
+ gchar *respbuf, *p;
/* Get another lock so that when we reach the tagged
* response and camel_imap_command_response unlocks,
@@ -440,14 +440,14 @@ imap_read_response (CamelImapStore *store, CamelException *ex)
* return the complete response, which may include an arbitrary number
* of literals.
*/
-static char *
-imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
+static gchar *
+imap_read_untagged (CamelImapStore *store, gchar *line, CamelException *ex)
{
- int fulllen, ldigits, nread, n, i, sexp = 0;
- unsigned int length;
+ gint fulllen, ldigits, nread, n, i, sexp = 0;
+ guint length;
GPtrArray *data;
GString *str;
- char *end, *p, *s, *d;
+ gchar *end, *p, *s, *d;
p = strrchr (line, '{');
if (!p)
@@ -600,9 +600,9 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
void
camel_imap_response_free (CamelImapStore *store, CamelImapResponse *response)
{
- int i, number, exists = 0;
+ gint i, number, exists = 0;
GArray *expunged = NULL;
- char *resp, *p;
+ gchar *resp, *p;
if (!response)
return;
@@ -684,14 +684,14 @@ camel_imap_response_free_without_processing (CamelImapStore *store,
*
* Return value: the desired response string, which the caller must free.
**/
-char *
+gchar *
camel_imap_response_extract (CamelImapStore *store,
CamelImapResponse *response,
- const char *type,
+ const gchar *type,
CamelException *ex)
{
- int len = strlen (type), i;
- char *resp;
+ gint len = strlen (type), i;
+ gchar *resp;
len = strlen (type);
@@ -700,7 +700,7 @@ camel_imap_response_extract (CamelImapStore *store,
/* Skip "* ", and initial sequence number, if present */
strtoul (resp + 2, &resp, 10);
if (*resp == ' ')
- resp = (char *) imap_next_word (resp);
+ resp = (gchar *) imap_next_word (resp);
if (!g_ascii_strncasecmp (resp, type, len))
break;
@@ -733,12 +733,12 @@ camel_imap_response_extract (CamelImapStore *store,
*
* Return value: the desired response string, which the caller must free.
**/
-char *
+gchar *
camel_imap_response_extract_continuation (CamelImapStore *store,
CamelImapResponse *response,
CamelException *ex)
{
- char *status;
+ gchar *status;
if (response->status && *response->status == '+') {
status = response->status;
@@ -754,14 +754,14 @@ camel_imap_response_extract_continuation (CamelImapStore *store,
return NULL;
}
-static char *
-imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
+static gchar *
+imap_command_strdup_vprintf (CamelImapStore *store, const gchar *fmt,
va_list ap)
{
GPtrArray *args;
- const char *p, *start;
- char *out, *outptr, *string;
- int num, len, i, arglen;
+ const gchar *p, *start;
+ gchar *out, *outptr, *string;
+ gint num, len, i, arglen;
args = g_ptr_array_new ();
@@ -781,7 +781,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
len += 10;
break;
case 's':
- string = va_arg (ap, char *);
+ string = va_arg (ap, gchar *);
g_ptr_array_add (args, string);
start = p + 1;
len += strlen (string);
@@ -789,10 +789,10 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
case 'S':
case 'F':
case 'G':
- string = va_arg (ap, char *);
+ string = va_arg (ap, gchar *);
/* NB: string is freed during output for %F and %G */
if (*p == 'F') {
- char *s = camel_imap_store_summary_full_from_path(store->summary, string);
+ gchar *s = camel_imap_store_summary_full_from_path(store->summary, string);
if (s) {
string = camel_utf8_utf7(s);
g_free(s);
@@ -861,7 +861,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
if (len && store->capabilities & IMAP_CAPABILITY_LITERALPLUS) {
outptr += sprintf (outptr, "{%d+}\r\n%s", len, string);
} else {
- char *quoted = imap_quote_string (string);
+ gchar *quoted = imap_quote_string (string);
outptr += sprintf (outptr, "%s", quoted);
g_free (quoted);
@@ -884,11 +884,11 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
return out;
}
-static char *
-imap_command_strdup_printf (CamelImapStore *store, const char *fmt, ...)
+static gchar *
+imap_command_strdup_printf (CamelImapStore *store, const gchar *fmt, ...)
{
va_list ap;
- char *result;
+ gchar *result;
va_start (ap, fmt);
result = imap_command_strdup_vprintf (store, fmt, ap);
diff --git a/camel/providers/imap/camel-imap-command.h b/camel/providers/imap/camel-imap-command.h
index f03921980..d6b819525 100644
--- a/camel/providers/imap/camel-imap-command.h
+++ b/camel/providers/imap/camel-imap-command.h
@@ -42,15 +42,15 @@ typedef enum {
struct _CamelImapResponse {
CamelFolder *folder;
GPtrArray *untagged;
- char *status;
+ gchar *status;
};
CamelImapResponse *camel_imap_command (CamelImapStore *store,
CamelFolder *folder,
CamelException *ex,
- const char *fmt, ...);
+ const gchar *fmt, ...);
CamelImapResponse *camel_imap_command_continuation (CamelImapStore *store,
- const char *cmd,
+ const gchar *cmd,
size_t cmdlen,
CamelException *ex);
@@ -58,20 +58,20 @@ void camel_imap_response_free (CamelImapStore *store,
CamelImapResponse *response);
void camel_imap_response_free_without_processing (CamelImapStore *store,
CamelImapResponse *response);
-char *camel_imap_response_extract (CamelImapStore *store,
+gchar *camel_imap_response_extract (CamelImapStore *store,
CamelImapResponse *response,
- const char *type,
+ const gchar *type,
CamelException *ex);
-char *camel_imap_response_extract_continuation (CamelImapStore *store,
+gchar *camel_imap_response_extract_continuation (CamelImapStore *store,
CamelImapResponse *response,
CamelException *ex);
gboolean camel_imap_command_start (CamelImapStore *store,
CamelFolder *folder,
CamelException *ex,
- const char *fmt, ...);
+ const gchar *fmt, ...);
CamelImapResponseType camel_imap_command_response (CamelImapStore *store,
- char **response,
+ gchar **response,
CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 9b8e9edb6..cc4945edf 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -91,20 +91,20 @@ static CamelProperty imap_property_list[] = {
};
static void imap_finalize (CamelObject *object);
-static int imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static int imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static void imap_rescan (CamelFolder *folder, int exists, CamelException *ex);
+static void imap_rescan (CamelFolder *folder, gint exists, CamelException *ex);
static void imap_refresh_info (CamelFolder *folder, CamelException *ex);
static void imap_sync_offline (CamelFolder *folder, CamelException *ex);
static void imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
static void imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *ex);
static void imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException *ex);
static void imap_expunge (CamelFolder *folder, CamelException *ex);
-/*static void imap_cache_message (CamelDiscoFolder *disco_folder, const char *uid, CamelException *ex);*/
-static void imap_rename (CamelFolder *folder, const char *new);
+/*static void imap_cache_message (CamelDiscoFolder *disco_folder, const gchar *uid, CamelException *ex);*/
+static void imap_rename (CamelFolder *folder, const gchar *new);
static GPtrArray * imap_get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelException *ex);
-static char* imap_get_filename (CamelFolder *folder, const char *uid, CamelException *ex);
+static gchar * imap_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
/* message manipulation */
static CamelMimeMessage *imap_get_message (CamelFolder *folder, const gchar *uid,
@@ -112,10 +112,10 @@ static CamelMimeMessage *imap_get_message (CamelFolder *folder, const gchar *uid
static void imap_sync_message (CamelFolder *folder, const gchar *uid,
CamelException *ex);
static void imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex);
static void imap_append_offline (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex);
static void imap_transfer_online (CamelFolder *source, GPtrArray *uids,
@@ -128,9 +128,9 @@ static void imap_transfer_offline (CamelFolder *source, GPtrArray *uids,
CamelException *ex);
/* searching */
-static GPtrArray *imap_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex);
-static guint32 imap_count_by_expression (CamelFolder *folder, const char *expression, CamelException *ex);
-static GPtrArray *imap_search_by_uids (CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex);
+static GPtrArray *imap_search_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex);
+static guint32 imap_count_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex);
+static GPtrArray *imap_search_by_uids (CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex);
static void imap_search_free (CamelFolder *folder, GPtrArray *uids);
static void imap_thaw (CamelFolder *folder);
@@ -138,12 +138,12 @@ static CamelFolderQuotaInfo *imap_get_quota_info (CamelFolder *folder);
static CamelObjectClass *parent_class;
-static GData *parse_fetch_response (CamelImapFolder *imap_folder, char *msg_att);
+static GData *parse_fetch_response (CamelImapFolder *imap_folder, gchar *msg_att);
/* internal helpers */
static CamelImapMessageInfo * imap_folder_summary_uid_or_error(
CamelFolderSummary *summary,
- const char * uid,
+ const gchar * uid,
CamelException *ex);
#ifdef G_OS_WIN32
@@ -212,7 +212,7 @@ camel_imap_folder_get_type (void)
static CamelType camel_imap_folder_type = CAMEL_INVALID_TYPE;
if (camel_imap_folder_type == CAMEL_INVALID_TYPE) {
- int i;
+ gint i;
parent_class = camel_offline_folder_get_type();
camel_imap_folder_type =
@@ -233,14 +233,14 @@ camel_imap_folder_get_type (void)
}
CamelFolder *
-camel_imap_folder_new (CamelStore *parent, const char *folder_name,
- const char *folder_dir, CamelException *ex)
+camel_imap_folder_new (CamelStore *parent, const gchar *folder_name,
+ const gchar *folder_dir, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (parent);
CamelFolder *folder;
CamelImapFolder *imap_folder;
- const char *short_name;
- char *summary_file, *state_file, *path;
+ const gchar *short_name;
+ gchar *summary_file, *state_file, *path;
if (g_mkdir_with_parents (folder_dir, S_IRWXU) != 0) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -314,8 +314,8 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
unsigned long exists = 0, validity = 0, val, uid;
guint32 perm_flags = 0;
GData *fetch_data;
- int i, count;
- char *resp, *old_uid;
+ gint i, count;
+ gchar *resp, *old_uid;
count = camel_folder_summary_count (folder->summary);
@@ -464,8 +464,8 @@ imap_finalize (CamelObject *object)
g_free(imap_folder->priv);
}
-static char*
-imap_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar *
+imap_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelImapFolder *imap_folder = (CamelImapFolder*) folder;
@@ -476,7 +476,7 @@ static int
imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
- int i, count=0;
+ gint i, count=0;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -488,7 +488,7 @@ imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
case CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES:
case CAMEL_FOLDER_ARG_PROPERTIES: {
CamelArgGetV props;
- int i;
+ gint i;
props.argc = 1;
props.argv[0] = *arg;
@@ -529,8 +529,8 @@ imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
static int
imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
- int save = 0;
- int i;
+ gint save = 0;
+ gint i;
guint32 tag;
for (i = 0; i < args->argc; i++) {
@@ -578,12 +578,12 @@ imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
}
static void
-imap_rename (CamelFolder *folder, const char *new)
+imap_rename (CamelFolder *folder, const gchar *new)
{
CamelImapFolder *imap_folder = (CamelImapFolder *)folder;
CamelImapStore *imap_store = (CamelImapStore *)folder->parent_store;
- char *folder_dir, *summary_path, *state_file;
- char *folders;
+ gchar *folder_dir, *summary_path, *state_file;
+ gchar *folders;
folders = g_strconcat (imap_store->storage_path, "/folders", NULL);
folder_dir = imap_path_to_physical (folders, new);
@@ -619,13 +619,13 @@ get_folder_status (CamelFolder *folder, guint32 *total, guint32 *unread, CamelEx
response = camel_imap_command (imap_store, folder, ex, "STATUS %F (MESSAGES UNSEEN)", folder->full_name);
if (response) {
- int i;
+ gint i;
for (i = 0; i < response->untagged->len; i++) {
- const char *resp = response->untagged->pdata[i];
+ const gchar *resp = response->untagged->pdata[i];
if (resp && g_str_has_prefix (resp, "* STATUS ")) {
- const char *p = NULL;
+ const gchar *p = NULL;
while (*resp) {
if (*resp == '(')
@@ -634,12 +634,12 @@ get_folder_status (CamelFolder *folder, guint32 *total, guint32 *unread, CamelEx
}
if (p && *(resp - 1) == ')') {
- const char *msgs = NULL, *unseen = NULL;
+ const gchar *msgs = NULL, *unseen = NULL;
p++;
while (p && (!msgs || !unseen)) {
- const char **dest = NULL;
+ const gchar **dest = NULL;
if (g_str_has_prefix (p, "MESSAGES "))
dest = &msgs;
@@ -685,8 +685,8 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex)
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
CamelImapResponse *response;
CamelStoreInfo *si;
- int check_rescan = -1;
- extern int camel_application_is_exiting;
+ gint check_rescan = -1;
+ extern gint camel_application_is_exiting;
if (CAMEL_OFFLINE_STORE (imap_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return;
@@ -779,10 +779,10 @@ done:
}
static void
-fillup_custom_flags (CamelMessageInfo *mi, char *custom_flags)
+fillup_custom_flags (CamelMessageInfo *mi, gchar *custom_flags)
{
gchar **array_str;
- int index = 0;
+ gint index = 0;
array_str = g_strsplit (custom_flags, " ", -1);
@@ -796,12 +796,12 @@ fillup_custom_flags (CamelMessageInfo *mi, char *custom_flags)
/* This will merge custom flags with those in message info. Returns whether was some change. */
static gboolean
-merge_custom_flags (CamelMessageInfo *mi, const char *custom_flags)
+merge_custom_flags (CamelMessageInfo *mi, const gchar *custom_flags)
{
GSList *list, *p;
GHashTable *server;
gchar **cflags;
- int i;
+ gint i;
const CamelFlag *flag;
gboolean changed = FALSE;
@@ -815,7 +815,7 @@ merge_custom_flags (CamelMessageInfo *mi, const char *custom_flags)
cflags = g_strsplit (custom_flags, " ", -1);
for (i = 0; cflags [i]; i++) {
- char *name = cflags [i];
+ gchar *name = cflags [i];
if (name && *name) {
g_hash_table_insert (server, name, name);
@@ -824,7 +824,7 @@ merge_custom_flags (CamelMessageInfo *mi, const char *custom_flags)
}
for (flag = camel_message_info_user_flags (mi); flag; flag = flag->next) {
- char *name = (char *)flag->name;
+ gchar *name = (gchar *)flag->name;
if (name && *name)
list = g_slist_prepend (list, name);
@@ -857,19 +857,19 @@ merge_custom_flags (CamelMessageInfo *mi, const char *custom_flags)
/* Called with the store's connect_lock locked */
static void
-imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
+imap_rescan (CamelFolder *folder, gint exists, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- extern int camel_application_is_exiting;
+ extern gint camel_application_is_exiting;
struct {
- char *uid;
+ gchar *uid;
guint32 flags;
- char *custom_flags;
+ gchar *custom_flags;
} *new;
- char *resp, *uid;
+ gchar *resp, *uid;
CamelImapResponseType type;
- int i, j, seq, summary_got, del=0;
+ gint i, j, seq, summary_got, del=0;
guint summary_len;
CamelMessageInfo *info;
CamelImapMessageInfo *iinfo;
@@ -911,7 +911,7 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
summary_got = 0;
while ((type = camel_imap_command_response (store, &resp, ex)) == CAMEL_IMAP_RESPONSE_UNTAGGED && !camel_application_is_exiting) {
GData *data;
- char *uid;
+ gchar *uid;
guint32 flags;
data = parse_fetch_response (imap_folder, resp);
@@ -995,7 +995,7 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
/* these will be deleted from db in a moment. So adjust the counts please */
if (info) {
CamelMessageInfoBase *dinfo = (CamelMessageInfoBase *) info;
- int unread=0, deleted=0, junk=0;
+ gint unread=0, deleted=0, junk=0;
guint32 flags;
flags = dinfo->flags;
@@ -1037,7 +1037,7 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
if (new[j].flags != iinfo->server_flags) {
guint32 server_set, server_cleared;
- int read=0, deleted=0, junk=0;
+ gint read=0, deleted=0, junk=0;
server_set = new[j].flags & ~iinfo->server_flags;
server_cleared = iinfo->server_flags & ~new[j].flags;
@@ -1126,11 +1126,11 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
for (i = seq; i <= summary_len; i++) {
CamelMessageInfoBase *dinfo;
- int j;
+ gint j;
dinfo = (CamelMessageInfoBase *) camel_folder_summary_index (folder->summary, i-1);
if (dinfo) {
/* these will be deleted from db in a moment. So adjust the counts please */
- int unread=0, deleted=0, junk=0;
+ gint unread=0, deleted=0, junk=0;
guint32 flags;
flags = dinfo->flags;
@@ -1168,7 +1168,7 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
g_array_free (removed, TRUE);
}
-/* the max number of chars that an unsigned 32-bit int can be is 10 chars plus 1 for a possible : */
+/* the max number of chars that an unsigned 32-bit gint can be is 10 chars plus 1 for a possible : */
#define UID_SET_FULL(setlen, maxlen) (maxlen > 0 ? setlen + 11 >= maxlen : FALSE)
/* Find all messages in @folder with flags matching @flags and @mask.
@@ -1178,15 +1178,15 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
* caller must free the infos, the array, and the set string.
*/
static GPtrArray *
-get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo *master_info, char **set, GPtrArray *summary)
+get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo *master_info, gchar **set, GPtrArray *summary)
{
GPtrArray *matches;
CamelImapMessageInfo *info;
- int i, max, range, last_range_uid;
+ gint i, max, range, last_range_uid;
GString *gset;
GSList *list1 = NULL;
- int count1 = 0;
- char *uid;
+ gint count1 = 0;
+ gchar *uid;
/* use the local rinfo in the close_range, because we want to keep our info untouched */
#define close_range() \
@@ -1206,7 +1206,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo
range = -1;
last_range_uid = -1;
for (i = 0; i < max && !UID_SET_FULL (gset->len, UID_SET_LIMIT); i++) {
- int uid_num;
+ gint uid_num;
uid = summary->pdata[i];
if (uid) {
@@ -1238,13 +1238,13 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo
if (strcmp (master_info->uid, ((CamelMessageInfo *)info)->uid)) {
const CamelFlag *flag;
GSList *list2 = NULL, *l1, *l2;
- int count2 = 0, cmp = 0;
+ gint count2 = 0, cmp = 0;
if (!list1) {
for (flag = camel_message_info_user_flags (master_info); flag; flag = flag->next) {
if (flag->name && *flag->name) {
count1++;
- list1 = g_slist_prepend (list1, (char *)flag->name);
+ list1 = g_slist_prepend (list1, (gchar *)flag->name);
}
}
@@ -1254,7 +1254,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo
for (flag = camel_message_info_user_flags (info); flag; flag = flag->next) {
if (flag->name && *flag->name) {
count2++;
- list2 = g_slist_prepend (list2, (char *)flag->name);
+ list2 = g_slist_prepend (list2, (gchar *)flag->name);
}
}
@@ -1347,8 +1347,8 @@ imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
CamelException local_ex;
GPtrArray *matches, *summary;
- char *set, *flaglist, *uid;
- int i, j, max;
+ gchar *set, *flaglist, *uid;
+ gint i, j, max;
if (folder->permanent_flags == 0 || CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
if (expunge) {
@@ -1506,9 +1506,9 @@ imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
}
static int
-uid_compar (const void *va, const void *vb)
+uid_compar (gconstpointer va, gconstpointer vb)
{
- const char **sa = (const char **)va, **sb = (const char **)vb;
+ const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
unsigned long a, b;
a = strtoul (*sa, NULL, 10);
@@ -1526,9 +1526,9 @@ imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException
{
CamelFolderChangeInfo *changes;
GSList *list = NULL;
- int i;
+ gint i;
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+ qsort (uids->pdata, uids->len, sizeof (gpointer), uid_compar);
changes = camel_folder_change_info_new ();
@@ -1556,11 +1556,11 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
{
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
CamelImapResponse *response;
- int uid = 0;
- char *set;
+ gint uid = 0;
+ gchar *set;
gboolean full_expunge = (store->capabilities & IMAP_CAPABILITY_UIDPLUS) == 0;
CamelFolderChangeInfo *changes;
- int i;
+ gint i;
GSList *list=NULL;
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
@@ -1573,7 +1573,7 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
}
}
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+ qsort (uids->pdata, uids->len, sizeof (gpointer), uid_compar);
while (uid < uids->len) {
set = imap_uid_array_to_set (folder->summary, uids, uid, UID_SET_LIMIT, &uid);
@@ -1659,7 +1659,7 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
GPtrArray *keep_uids, *mark_uids;
CamelImapResponse *response;
- char *result;
+ gchar *result;
if (imap_folder->read_only)
return;
@@ -1695,9 +1695,9 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
}
if (result[8] == ' ') {
- char *uid, *lasts = NULL;
+ gchar *uid, *lasts = NULL;
unsigned long euid, kuid;
- int ei, ki;
+ gint ei, ki;
keep_uids = g_ptr_array_new ();
mark_uids = g_ptr_array_new ();
@@ -1706,7 +1706,7 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
for (uid = strtok_r (result + 9, " ", &lasts); uid; uid = strtok_r (NULL, " ", &lasts))
g_ptr_array_add (keep_uids, uid);
qsort (keep_uids->pdata, keep_uids->len,
- sizeof (void *), uid_compar);
+ sizeof (gpointer), uid_compar);
/* Fill in "mark_uids", empty out "keep_uids" as needed */
for (ei = ki = 0; ei < uids->len; ei++) {
@@ -1736,8 +1736,8 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
/* Unmark messages to be kept */
if (keep_uids) {
- char *uidset;
- int uid = 0;
+ gchar *uidset;
+ gint uid = 0;
while (uid < keep_uids->len) {
uidset = imap_uid_array_to_set (folder->summary, keep_uids, uid, UID_SET_LIMIT, &uid);
@@ -1760,8 +1760,8 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
/* Mark any messages that still need to be marked */
if (mark_uids) {
- char *uidset;
- int uid = 0;
+ gchar *uidset;
+ gint uid = 0;
while (uid < mark_uids->len) {
uidset = imap_uid_array_to_set (folder->summary, mark_uids, uid, UID_SET_LIMIT, &uid);
@@ -1792,8 +1792,8 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
/* And fix the remaining messages if we mangled them */
if (keep_uids) {
- char *uidset;
- int uid = 0;
+ gchar *uidset;
+ gint uid = 0;
while (uid < keep_uids->len) {
uidset = imap_uid_array_to_set (folder->summary, keep_uids, uid, UID_SET_LIMIT, &uid);
@@ -1823,7 +1823,7 @@ get_temp_uid (void)
{
gchar *res;
- static int counter = 0;
+ static gint counter = 0;
G_LOCK_DEFINE_STATIC (lock);
G_LOCK (lock);
@@ -1837,12 +1837,12 @@ get_temp_uid (void)
static void
imap_append_offline (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
CamelImapMessageCache *cache = CAMEL_IMAP_FOLDER (folder)->cache;
CamelFolderChangeInfo *changes;
- char *uid;
+ gchar *uid;
uid = get_temp_uid ();
@@ -1867,7 +1867,7 @@ imap_append_offline (CamelFolder *folder, CamelMimeMessage *message,
}
static void
-imap_folder_add_ignore_recent (CamelImapFolder *imap_folder, const char *uid)
+imap_folder_add_ignore_recent (CamelImapFolder *imap_folder, const gchar *uid)
{
g_return_if_fail (imap_folder != NULL);
g_return_if_fail (uid != NULL);
@@ -1879,7 +1879,7 @@ imap_folder_add_ignore_recent (CamelImapFolder *imap_folder, const char *uid)
}
static gboolean
-imap_folder_uid_in_ignore_recent (CamelImapFolder *imap_folder, const char *uid)
+imap_folder_uid_in_ignore_recent (CamelImapFolder *imap_folder, const gchar *uid)
{
g_return_val_if_fail (imap_folder != NULL, FALSE);
g_return_val_if_fail (uid != NULL, FALSE);
@@ -1889,7 +1889,7 @@ imap_folder_uid_in_ignore_recent (CamelImapFolder *imap_folder, const char *uid)
static CamelImapResponse *
do_append (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **uid,
+ const CamelMessageInfo *info, gchar **uid,
CamelException *ex)
{
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
@@ -1898,7 +1898,7 @@ do_append (CamelFolder *folder, CamelMimeMessage *message,
CamelMimeFilter *crlf_filter;
CamelStreamFilter *streamfilter;
GByteArray *ba;
- char *flagstr, *end;
+ gchar *flagstr, *end;
guint32 flags = 0;
/* encode any 8bit parts so we avoid sending embedded nul-chars and such */
@@ -1957,7 +1957,7 @@ retry:
}
/* send the rest of our data - the mime message */
- response2 = camel_imap_command_continuation (store, (const char *) ba->data, ba->len, ex);
+ response2 = camel_imap_command_continuation (store, (const gchar *) ba->data, ba->len, ex);
g_byte_array_free (ba, TRUE);
/* free it only after message is sent. This may cause more FETCHes. */
@@ -1992,13 +1992,13 @@ retry:
static void
imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
CamelImapResponse *response;
- char *uid;
- int count;
+ gchar *uid;
+ gint count;
if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
imap_append_offline (folder, message, info, appended_uid, ex);
@@ -2041,12 +2041,12 @@ imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
void
imap_append_resyncing (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
CamelImapResponse *response;
- char *uid;
+ gchar *uid;
response = do_append (folder, message, info, &uid, ex);
if (!response)
@@ -2054,7 +2054,7 @@ imap_append_resyncing (CamelFolder *folder, CamelMimeMessage *message,
if (uid) {
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- const char *olduid = camel_message_info_uid (info);
+ const gchar *olduid = camel_message_info_uid (info);
CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock);
camel_imap_message_cache_copy (imap_folder->cache, olduid,
@@ -2083,8 +2083,8 @@ imap_transfer_offline (CamelFolder *source, GPtrArray *uids,
CamelFolderChangeInfo *changes;
CamelMimeMessage *message;
CamelMessageInfo *mi;
- char *uid, *destuid;
- int i;
+ gchar *uid, *destuid;
+ gint i;
/* We grab the store's command lock first, and then grab the
* source and destination cache_locks. This way we can't
@@ -2148,9 +2148,9 @@ handle_copyuid (CamelImapResponse *response, CamelFolder *source,
{
CamelImapMessageCache *scache = CAMEL_IMAP_FOLDER (source)->cache;
CamelImapMessageCache *dcache = CAMEL_IMAP_FOLDER (destination)->cache;
- char *validity, *srcset, *destset;
+ gchar *validity, *srcset, *destset;
GPtrArray *src, *dest;
- int i;
+ gint i;
validity = camel_strstrcase (response->status, "[COPYUID ");
if (!validity)
@@ -2203,9 +2203,9 @@ handle_copyuid (CamelImapResponse *response, CamelFolder *source,
static void
handle_copyuid_copy_user_tags (CamelImapResponse *response, CamelFolder *source, CamelFolder *destination)
{
- char *validity, *srcset, *destset;
+ gchar *validity, *srcset, *destset;
GPtrArray *src, *dest;
- int i;
+ gint i;
CamelException ex;
validity = camel_strstrcase (response->status, "[COPYUID ");
@@ -2280,7 +2280,7 @@ handle_copyuid_copy_user_tags (CamelImapResponse *response, CamelFolder *source,
/* returns whether any of messages from uidset has set any user tag or not */
static gboolean
-any_has_user_tag (CamelFolder *source, char *uidset)
+any_has_user_tag (CamelFolder *source, gchar *uidset)
{
GPtrArray *src;
@@ -2289,7 +2289,7 @@ any_has_user_tag (CamelFolder *source, char *uidset)
src = imap_uid_set_to_array (source->summary, uidset);
if (src) {
gboolean have = FALSE;
- int i;
+ gint i;
CAMEL_IMAP_FOLDER_REC_LOCK (source, cache_lock);
for (i = 0; i < src->len && !have; i++) {
@@ -2313,12 +2313,12 @@ any_has_user_tag (CamelFolder *source, char *uidset)
static void
do_copy (CamelFolder *source, GPtrArray *uids,
- CamelFolder *destination, int delete_originals, CamelException *ex)
+ CamelFolder *destination, gint delete_originals, CamelException *ex)
{
CamelImapStore *store = CAMEL_IMAP_STORE (source->parent_store);
CamelImapResponse *response;
- char *uidset;
- int uid = 0, last=0, i;
+ gchar *uidset;
+ gint uid = 0, last=0, i;
while (uid < uids->len && !camel_exception_is_set (ex)) {
uidset = imap_uid_array_to_set (source->summary, uids, uid, UID_SET_LIMIT, &uid);
@@ -2352,7 +2352,7 @@ imap_transfer_online (CamelFolder *source, GPtrArray *uids,
gboolean delete_originals, CamelException *ex)
{
CamelImapStore *store = CAMEL_IMAP_STORE (source->parent_store);
- int count;
+ gint count;
if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
imap_transfer_offline (source, uids, dest, transferred_uids, delete_originals, ex);
@@ -2366,7 +2366,7 @@ imap_transfer_online (CamelFolder *source, GPtrArray *uids,
count = camel_folder_summary_count (dest->summary);
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+ qsort (uids->pdata, uids->len, sizeof (gpointer), uid_compar);
/* Now copy the messages */
do_copy(source, uids, dest, delete_originals, ex);
@@ -2389,12 +2389,12 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
gboolean delete_originals, CamelException *ex)
{
GPtrArray *realuids;
- int first, i;
- const char *uid;
+ gint first, i;
+ const gchar *uid;
CamelMimeMessage *message;
CamelMessageInfo *info;
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+ qsort (uids->pdata, uids->len, sizeof (gpointer), uid_compar);
/*This is trickier than append_resyncing, because some of
* the messages we are copying may have been copied or
@@ -2416,7 +2416,7 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
if (!uid)
break;
}
- g_ptr_array_add (realuids, (char *)uid);
+ g_ptr_array_add (realuids, (gchar *)uid);
}
/* If we saw any real UIDs, do a COPY */
@@ -2429,7 +2429,7 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
/* Deal with fake UIDs */
while (i < uids->len &&
- !isdigit (*(unsigned char *)(uids->pdata[i])) &&
+ !isdigit (*(guchar *)(uids->pdata[i])) &&
!camel_exception_is_set (ex)) {
uid = uids->pdata[i];
message = camel_folder_get_message (source, uid, NULL);
@@ -2457,7 +2457,7 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
}
static GPtrArray *
-imap_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
+imap_search_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
GPtrArray *matches;
@@ -2476,7 +2476,7 @@ imap_search_by_expression (CamelFolder *folder, const char *expression, CamelExc
}
static guint32
-imap_count_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
+imap_count_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
guint32 matches;
@@ -2494,7 +2494,7 @@ imap_count_by_expression (CamelFolder *folder, const char *expression, CamelExce
return matches;
}
static GPtrArray *
-imap_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
+imap_search_by_uids(CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER(folder);
GPtrArray *matches;
@@ -2527,17 +2527,17 @@ imap_search_free (CamelFolder *folder, GPtrArray *uids)
}
static CamelMimeMessage *get_message (CamelImapFolder *imap_folder,
- const char *uid,
+ const gchar *uid,
CamelMessageContentInfo *ci,
CamelException *ex);
struct _part_spec_stack {
struct _part_spec_stack *parent;
- int part;
+ gint part;
};
static void
-part_spec_push (struct _part_spec_stack **stack, int part)
+part_spec_push (struct _part_spec_stack **stack, gint part)
{
struct _part_spec_stack *node;
@@ -2552,7 +2552,7 @@ static int
part_spec_pop (struct _part_spec_stack **stack)
{
struct _part_spec_stack *node;
- int part;
+ gint part;
g_return_val_if_fail (*stack != NULL, 0);
@@ -2565,14 +2565,14 @@ part_spec_pop (struct _part_spec_stack **stack)
return part;
}
-static char *
+static gchar *
content_info_get_part_spec (CamelMessageContentInfo *ci)
{
struct _part_spec_stack *stack = NULL;
CamelMessageContentInfo *node;
- char *part_spec, *buf;
+ gchar *part_spec, *buf;
size_t len = 1;
- int part;
+ gint part;
node = ci;
while (node->parent) {
@@ -2618,14 +2618,14 @@ content_info_get_part_spec (CamelMessageContentInfo *ci)
* of message @uid in @folder.
*/
static CamelDataWrapper *
-get_content (CamelImapFolder *imap_folder, const char *uid,
+get_content (CamelImapFolder *imap_folder, const gchar *uid,
CamelMimePart *part, CamelMessageContentInfo *ci,
- int frommsg,
+ gint frommsg,
CamelException *ex)
{
CamelDataWrapper *content = NULL;
CamelStream *stream;
- char *part_spec;
+ gchar *part_spec;
part_spec = content_info_get_part_spec (ci);
@@ -2634,8 +2634,8 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
/* There are three cases: multipart/signed, multipart, message/rfc822, and "other" */
if (camel_content_type_is (ci->type, "multipart", "signed")) {
CamelMultipartSigned *body_mp;
- char *spec;
- int ret;
+ gchar *spec;
+ gint ret;
/* Note: because we get the content parts uninterpreted anyway, we could potentially
just use the normalmultipart code, except that multipart/signed wont let you yet! */
@@ -2665,8 +2665,8 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
return (CamelDataWrapper *) body_mp;
} else if (camel_content_type_is (ci->type, "multipart", "*")) {
CamelMultipart *body_mp;
- char *child_spec;
- int speclen, num, isdigest;
+ gchar *child_spec;
+ gint speclen, num, isdigest;
if (camel_content_type_is (ci->type, "multipart", "encrypted"))
body_mp = (CamelMultipart *) camel_multipart_encrypted_new ();
@@ -2691,7 +2691,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
sprintf (child_spec + speclen, "%d.MIME", num++);
stream = camel_imap_folder_fetch_data (imap_folder, uid, child_spec, FALSE, ex);
if (stream) {
- int ret;
+ gint ret;
part = camel_mime_part_new ();
ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (part), stream);
@@ -2713,8 +2713,8 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
}
if (camel_debug("imap:folder")) {
- char *ct = camel_content_type_format(camel_mime_part_get_content_type((CamelMimePart *)part));
- char *ct2 = camel_content_type_format(ci->type);
+ gchar *ct = camel_content_type_format(camel_mime_part_get_content_type((CamelMimePart *)part));
+ gchar *ct2 = camel_content_type_format(ci->type);
printf("Setting part content type to '%s' contentinfo type is '%s'\n", ct, ct2);
g_free(ct);
@@ -2750,7 +2750,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
return content;
} else {
CamelTransferEncoding enc;
- char *spec;
+ gchar *spec;
/* NB: we need this differently to multipart/signed case above on purpose */
spec = g_alloca(strlen(part_spec) + 6);
@@ -2767,7 +2767,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
}
static CamelMimeMessage *
-get_message (CamelImapFolder *imap_folder, const char *uid,
+get_message (CamelImapFolder *imap_folder, const gchar *uid,
CamelMessageContentInfo *ci,
CamelException *ex)
{
@@ -2775,8 +2775,8 @@ get_message (CamelImapFolder *imap_folder, const char *uid,
CamelDataWrapper *content;
CamelMimeMessage *msg;
CamelStream *stream;
- char *section_text, *part_spec;
- int ret;
+ gchar *section_text, *part_spec;
+ gint ret;
part_spec = content_info_get_part_spec(ci);
d(printf("get message '%s'\n", part_spec));
@@ -2804,8 +2804,8 @@ get_message (CamelImapFolder *imap_folder, const char *uid,
}
if (camel_debug("imap:folder")) {
- char *ct = camel_content_type_format(camel_mime_part_get_content_type((CamelMimePart *)msg));
- char *ct2 = camel_content_type_format(ci->type);
+ gchar *ct = camel_content_type_format(camel_mime_part_get_content_type((CamelMimePart *)msg));
+ gchar *ct2 = camel_content_type_format(ci->type);
printf("Setting message content type to '%s' contentinfo type is '%s'\n", ct, ct2);
g_free(ct);
@@ -2822,11 +2822,11 @@ get_message (CamelImapFolder *imap_folder, const char *uid,
#define IMAP_SMALL_BODY_SIZE 5120
static CamelMimeMessage *
-get_message_simple (CamelImapFolder *imap_folder, const char *uid,
+get_message_simple (CamelImapFolder *imap_folder, const gchar *uid,
CamelStream *stream, CamelException *ex)
{
CamelMimeMessage *msg;
- int ret;
+ gint ret;
if (!stream) {
stream = camel_imap_folder_fetch_data (imap_folder, uid, "",
@@ -2869,7 +2869,7 @@ content_info_incomplete (CamelMessageContentInfo *ci)
}
static CamelImapMessageInfo *
-imap_folder_summary_uid_or_error(CamelFolderSummary *summary, const char * uid, CamelException *ex)
+imap_folder_summary_uid_or_error(CamelFolderSummary *summary, const gchar * uid, CamelException *ex)
{
CamelImapMessageInfo *mi;
mi = (CamelImapMessageInfo *)camel_folder_summary_uid (summary, uid);
@@ -2883,14 +2883,14 @@ imap_folder_summary_uid_or_error(CamelFolderSummary *summary, const char * uid,
}
static CamelMimeMessage *
-imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
CamelImapMessageInfo *mi;
CamelMimeMessage *msg = NULL;
CamelStream *stream = NULL;
- int retry;
+ gint retry;
mi = imap_folder_summary_uid_or_error(folder->summary, uid, ex);
if (!mi)
@@ -2931,8 +2931,8 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
*/
CamelImapResponse *response;
GData *fetch_data = NULL;
- char *body, *found_uid;
- int i;
+ gchar *body, *found_uid;
+ gint i;
CAMEL_SERVICE_REC_LOCK(store, connect_lock);
if (!camel_imap_store_connected(store, ex)) {
@@ -2961,7 +2961,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
if (body) {
/* NB: small race here, setting the info.content */
- imap_parse_body ((const char **) &body, folder, mi->info.content);
+ imap_parse_body ((const gchar **) &body, folder, mi->info.content);
mi->info.dirty = TRUE;
camel_folder_summary_touch (folder->summary);
}
@@ -3012,7 +3012,7 @@ done:
if (!mi->info.mlist || !*mi->info.mlist) {
/* update mailing list information, if necessary */
- char *mlist = camel_header_raw_check_mailing_list (&(CAMEL_MIME_PART (msg)->headers));
+ gchar *mlist = camel_header_raw_check_mailing_list (&(CAMEL_MIME_PART (msg)->headers));
if (mlist) {
if (mi->info.mlist)
@@ -3046,7 +3046,7 @@ fail:
* it is already local.
*/
static void
-imap_sync_message (CamelFolder *folder, const char *uid, CamelException *ex)
+imap_sync_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
CamelImapMessageInfo *mi;
@@ -3079,7 +3079,7 @@ imap_sync_message (CamelFolder *folder, const char *uid, CamelException *ex)
/* FIXME Remove it after confirming
static void
-imap_cache_message (CamelDiscoFolder *disco_folder, const char *uid,
+imap_cache_message (CamelDiscoFolder *disco_folder, const gchar *uid,
CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (disco_folder);
@@ -3102,16 +3102,16 @@ imap_cache_message (CamelDiscoFolder *disco_folder, const char *uid,
#define IMAP_PRETEND_SIZEOF_SIZE 20
#define IMAP_PRETEND_SIZEOF_HEADERS 2000
-static char *tm_months[] = {
+static gchar *tm_months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
static gboolean
-decode_time (const unsigned char **in, int *hour, int *min, int *sec)
+decode_time (const guchar **in, gint *hour, gint *min, gint *sec)
{
- register const unsigned char *inptr;
- int *val, colons = 0;
+ register const guchar *inptr;
+ gint *val, colons = 0;
*hour = *min = *sec = 0;
@@ -3141,17 +3141,17 @@ decode_time (const unsigned char **in, int *hour, int *min, int *sec)
}
static time_t
-decode_internaldate (const unsigned char *in)
+decode_internaldate (const guchar *in)
{
- const unsigned char *inptr = in;
- int hour, min, sec, n;
- unsigned char *buf;
+ const guchar *inptr = in;
+ gint hour, min, sec, n;
+ guchar *buf;
struct tm tm;
time_t date;
- memset ((void *) &tm, 0, sizeof (struct tm));
+ memset ((gpointer) &tm, 0, sizeof (struct tm));
- tm.tm_mday = strtoul ((char *) inptr, (char **) &buf, 10);
+ tm.tm_mday = strtoul ((gchar *) inptr, (gchar **) &buf, 10);
if (buf == inptr || *buf != '-')
return (time_t) -1;
@@ -3171,7 +3171,7 @@ decode_internaldate (const unsigned char *in)
inptr += 4;
- n = strtoul ((char *) inptr, (char **) &buf, 10);
+ n = strtoul ((gchar *) inptr, (gchar **) &buf, 10);
if (buf == inptr || *buf != ' ')
return (time_t) -1;
@@ -3185,7 +3185,7 @@ decode_internaldate (const unsigned char *in)
tm.tm_min = min;
tm.tm_sec = sec;
- n = strtol ((char *) inptr, NULL, 10);
+ n = strtol ((gchar *) inptr, NULL, 10);
date = e_mktime_utc (&tm);
@@ -3199,13 +3199,13 @@ decode_internaldate (const unsigned char *in)
static void
add_message_from_data (CamelFolder *folder, GPtrArray *messages,
- int first, GData *data)
+ gint first, GData *data)
{
CamelMimeMessage *msg;
CamelStream *stream;
CamelImapMessageInfo *mi;
- const char *idate;
- int seq;
+ const gchar *idate;
+ gint seq;
seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
if (seq < first)
@@ -3227,7 +3227,7 @@ add_message_from_data (CamelFolder *folder, GPtrArray *messages,
camel_object_unref (CAMEL_OBJECT (msg));
if ((idate = g_datalist_get_data (&data, "INTERNALDATE")))
- mi->info.date_received = decode_internaldate ((const unsigned char *) idate);
+ mi->info.date_received = decode_internaldate ((const guchar *) idate);
if (mi->info.date_received == -1)
mi->info.date_received = mi->info.date_sent;
@@ -3241,10 +3241,10 @@ struct _junk_data {
};
static void
-construct_junk_headers (char *header, char *value, struct _junk_data *jdata)
+construct_junk_headers (gchar *header, gchar *value, struct _junk_data *jdata)
{
- char *bs, *es, *flag=NULL;
- char *bdata = g_datalist_get_data (&(jdata->data), "BODY_PART_DATA");
+ gchar *bs, *es, *flag=NULL;
+ gchar *bdata = g_datalist_get_data (&(jdata->data), "BODY_PART_DATA");
struct _camel_header_param *node;
/* FIXME: This can be written in a much clever way.
@@ -3279,7 +3279,7 @@ construct_junk_headers (char *header, char *value, struct _junk_data *jdata)
static void
update_summary (CamelFolderSummary *summary, CamelMessageInfoBase *info)
{
- int unread=0, deleted=0, junk=0;
+ gint unread=0, deleted=0, junk=0;
guint32 flags = info->flags;
if (!(flags & CAMEL_MESSAGE_SEEN))
@@ -3318,7 +3318,7 @@ update_summary (CamelFolderSummary *summary, CamelMessageInfoBase *info)
#define MAILING_LIST_HEADERS "X-MAILING-LIST X-LOOP LIST-ID LIST-POST MAILING-LIST ORIGINATOR X-LIST SENDER RETURN-PATH X-BEENTHERE "
static void
-imap_update_summary (CamelFolder *folder, int exists,
+imap_update_summary (CamelFolder *folder, gint exists,
CamelFolderChangeInfo *changes,
CamelException *ex)
{
@@ -3326,15 +3326,15 @@ imap_update_summary (CamelFolder *folder, int exists,
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
GPtrArray *fetch_data = NULL, *messages = NULL, *needheaders;
guint32 flags, uidval;
- int i, seq, first, size, got;
+ gint i, seq, first, size, got;
CamelImapResponseType type;
GString *header_spec = NULL;
CamelImapMessageInfo *mi;
CamelStream *stream;
- char *uid, *resp, *tempuid;
+ gchar *uid, *resp, *tempuid;
GData *data;
- extern int camel_application_is_exiting;
- int k = 0, ct;
+ extern gint camel_application_is_exiting;
+ gint k = 0, ct;
if (store->server_level >= IMAP_LEVEL_IMAP4REV1) {
if (store->headers == IMAP_FETCH_ALL_HEADERS)
@@ -3455,11 +3455,11 @@ imap_update_summary (CamelFolder *folder, int exists,
/* And fetch them */
if (needheaders->len) {
- char *uidset;
- int uid = 0;
+ gchar *uidset;
+ gint uid = 0;
qsort (needheaders->pdata, needheaders->len,
- sizeof (void *), uid_compar);
+ sizeof (gpointer), uid_compar);
camel_operation_start (NULL, _("Fetching summary information for new messages in %s"), folder->name);
@@ -3521,7 +3521,7 @@ imap_update_summary (CamelFolder *folder, int exists,
mi = messages->pdata[seq - first];
if (mi == NULL) {
CamelMessageInfo *pmi = NULL;
- int j;
+ gint j;
/* This is a kludge around a bug in Exchange
* 5.5 that sometimes claims multiple messages
@@ -3552,7 +3552,7 @@ imap_update_summary (CamelFolder *folder, int exists,
mi->info.uid = camel_pstring_strdup (uid);
flags = GPOINTER_TO_INT (g_datalist_get_data (&data, "FLAGS"));
if (flags) {
- char *custom_flags = NULL;
+ gchar *custom_flags = NULL;
((CamelImapMessageInfo *)mi)->server_flags = flags;
/* "or" them in with the existing flags that may
@@ -3592,7 +3592,7 @@ imap_update_summary (CamelFolder *folder, int exists,
i + first);
break;
}
- uid = (char *)camel_message_info_uid(mi);
+ uid = (gchar *)camel_message_info_uid(mi);
if (uid[0] == 0) {
g_warning("Server provided no uid: message %d", i + first);
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -3668,18 +3668,18 @@ imap_update_summary (CamelFolder *folder, int exists,
/* Called with the store's connect_lock locked */
void
-camel_imap_folder_changed (CamelFolder *folder, int exists,
+camel_imap_folder_changed (CamelFolder *folder, gint exists,
GArray *expunged, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- extern int camel_application_is_exiting;
+ extern gint camel_application_is_exiting;
CamelFolderChangeInfo *changes;
- int len;
- char *uid;
+ gint len;
+ gchar *uid;
changes = camel_folder_change_info_new ();
if (expunged) {
- int i, id;
+ gint i, id;
GSList *deleted = NULL;
for (i = 0; i < expunged->len; i++) {
@@ -3734,8 +3734,8 @@ imap_thaw (CamelFolder *folder)
CamelStream *
-camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
- const char *section_text, gboolean cache_only,
+camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const gchar *uid,
+ const gchar *section_text, gboolean cache_only,
CamelException *ex)
{
CamelFolder *folder = CAMEL_FOLDER (imap_folder);
@@ -3743,8 +3743,8 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
CamelImapResponse *response;
CamelStream *stream;
GData *fetch_data;
- char *found_uid;
- int i;
+ gchar *found_uid;
+ gint i;
/* EXPUNGE responses have to modify the cache, which means
* they have to grab the cache_lock while holding the
@@ -3822,10 +3822,10 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
}
static GData *
-parse_fetch_response (CamelImapFolder *imap_folder, char *response)
+parse_fetch_response (CamelImapFolder *imap_folder, gchar *response)
{
GData *data = NULL;
- char *start, *part_spec = NULL, *body = NULL, *uid = NULL, *idate = NULL;
+ gchar *start, *part_spec = NULL, *body = NULL, *uid = NULL, *idate = NULL;
gboolean cache_header = TRUE, header = FALSE;
size_t body_len = 0;
@@ -3850,7 +3850,7 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
if (!g_ascii_strncasecmp (response, "FLAGS ", 6)) {
guint32 flags;
- char *custom_flags = NULL;
+ gchar *custom_flags = NULL;
response += 6;
@@ -3868,7 +3868,7 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
g_datalist_set_data (&data, "RFC822.SIZE", GUINT_TO_POINTER (size));
} else if (!g_ascii_strncasecmp (response, "BODY[", 5) ||
!g_ascii_strncasecmp (response, "RFC822 ", 7)) {
- char *p;
+ gchar *p;
if (*response == 'B') {
response += 5;
@@ -3899,7 +3899,7 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
header = TRUE;
}
- body = imap_parse_nstring ((const char **) &response, &body_len);
+ body = imap_parse_nstring ((const gchar **) &response, &body_len);
if (!response) {
g_free (part_spec);
break;
@@ -3914,20 +3914,20 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
!g_ascii_strncasecmp (response, "BODYSTRUCTURE ", 14)) {
response = strchr (response, ' ') + 1;
start = response;
- imap_skip_list ((const char **) &response);
+ imap_skip_list ((const gchar **) &response);
if (response && (response != start)) {
/* To handle IMAP Server brokenness, Returning empty body, etc. See #355640 */
g_datalist_set_data_full (&data, "BODY", g_strndup (start, response - start), g_free);
}
} else if (!g_ascii_strncasecmp (response, "UID ", 4)) {
- int len;
+ gint len;
len = strcspn (response + 4, " )");
uid = g_strndup (response + 4, len);
g_datalist_set_data_full (&data, "UID", uid, g_free);
response += 4 + len;
} else if (!g_ascii_strncasecmp (response, "INTERNALDATE ", 13)) {
- int len;
+ gint len;
response += 13;
if (*response == '"') {
@@ -3988,20 +3988,20 @@ imap_get_quota_info (CamelFolder *folder)
goto done;
if (imap_store->capabilities & IMAP_CAPABILITY_QUOTA) {
- char *folder_name = camel_imap_store_summary_path_to_full (imap_store->summary, camel_folder_get_full_name (folder), imap_store->dir_sep);
+ gchar *folder_name = camel_imap_store_summary_path_to_full (imap_store->summary, camel_folder_get_full_name (folder), imap_store->dir_sep);
response = camel_imap_command (imap_store, NULL, NULL, "GETQUOTAROOT \"%s\"", folder_name);
if (response) {
- int i;
+ gint i;
for (i = 0; i < response->untagged->len; i++) {
- const char *resp = response->untagged->pdata[i];
+ const gchar *resp = response->untagged->pdata[i];
if (resp && g_str_has_prefix (resp, "* QUOTA ")) {
gboolean skipped = TRUE;
size_t sz;
- char *astr;
+ gchar *astr;
resp = resp + 8;
astr = imap_parse_astring (&resp, &sz);
@@ -4011,8 +4011,8 @@ imap_get_quota_info (CamelFolder *folder)
resp++;
if (resp && *resp == '(') {
- char *name;
- const char *used = NULL, *total = NULL;
+ gchar *name;
+ const gchar *used = NULL, *total = NULL;
resp++;
name = imap_parse_astring (&resp, &sz);
@@ -4048,7 +4048,7 @@ imap_get_quota_info (CamelFolder *folder)
}
if (skipped)
- g_debug ("Unexpected quota response '%s'; skipping it...", (const char *)response->untagged->pdata[i]);
+ g_debug ("Unexpected quota response '%s'; skipping it...", (const gchar *)response->untagged->pdata[i]);
}
}
camel_imap_response_free (imap_store, response);
diff --git a/camel/providers/imap/camel-imap-folder.h b/camel/providers/imap/camel-imap-folder.h
index a2e37af87..246bc3465 100644
--- a/camel/providers/imap/camel-imap-folder.h
+++ b/camel/providers/imap/camel-imap-folder.h
@@ -62,10 +62,10 @@ struct _CamelImapFolder {
CamelImapMessageCache *cache;
CamelOfflineJournal *journal;
- unsigned int need_rescan:1;
- unsigned int need_refresh:1;
- unsigned int read_only:1;
- unsigned int check_folder:1;
+ guint need_rescan:1;
+ guint need_refresh:1;
+ guint read_only:1;
+ guint check_folder:1;
};
struct _CamelImapFolderClass {
@@ -78,25 +78,25 @@ struct _CamelImapFolderClass {
/* public methods */
CamelFolder *camel_imap_folder_new (CamelStore *parent,
- const char *folder_name,
- const char *folder_dir,
+ const gchar *folder_name,
+ const gchar *folder_dir,
CamelException *ex);
void camel_imap_folder_selected (CamelFolder *folder,
CamelImapResponse *response,
CamelException *ex);
-void camel_imap_folder_changed (CamelFolder *folder, int exists,
+void camel_imap_folder_changed (CamelFolder *folder, gint exists,
GArray *expunged, CamelException *ex);
CamelStream *camel_imap_folder_fetch_data (CamelImapFolder *imap_folder,
- const char *uid,
- const char *section_text,
+ const gchar *uid,
+ const gchar *section_text,
gboolean cache_only,
CamelException *ex);
void
imap_append_resyncing (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex);
void
imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
diff --git a/camel/providers/imap/camel-imap-journal.c b/camel/providers/imap/camel-imap-journal.c
index 2e48e4169..36bcce208 100644
--- a/camel/providers/imap/camel-imap-journal.c
+++ b/camel/providers/imap/camel-imap-journal.c
@@ -54,8 +54,8 @@ static void camel_imap_journal_finalize (CamelObject *object);
static void imap_entry_free (CamelOfflineJournal *journal, CamelDListNode *entry);
static CamelDListNode *imap_entry_load (CamelOfflineJournal *journal, FILE *in);
-static int imap_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
-static int imap_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
+static gint imap_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
+static gint imap_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
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);
@@ -182,7 +182,7 @@ static GPtrArray *
decode_uids (FILE *file)
{
GPtrArray *uids;
- char *uid;
+ gchar *uid;
guint32 i;
if (camel_file_util_decode_uint32 (file, &i) == -1)
@@ -254,7 +254,7 @@ imap_entry_load (CamelOfflineJournal *journal, FILE *in)
static int
encode_uids (FILE *file, GPtrArray *uids)
{
- int i, status;
+ gint i, status;
status = camel_file_util_encode_uint32 (file, uids->len);
for (i = 0; status != -1 && i < uids->len; i++)
@@ -300,20 +300,20 @@ imap_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out
}
static CamelFolder *
-journal_decode_folder (CamelIMAPJournal *journal, const char *name)
+journal_decode_folder (CamelIMAPJournal *journal, const gchar *name)
{
CamelFolder *folder;
folder = g_hash_table_lookup (journal->folders, name);
if (!folder) {
CamelException ex;
- char *msg;
+ gchar *msg;
camel_exception_init (&ex);
folder = camel_store_get_folder (CAMEL_STORE (CAMEL_OFFLINE_JOURNAL (journal)->folder->parent_store),
name, 0, &ex);
if (folder)
- g_hash_table_insert (journal->folders, (char *) name, folder);
+ g_hash_table_insert (journal->folders, (gchar *) name, folder);
else {
msg = g_strdup_printf (_("Could not open '%s':\n%s\nChanges made to this folder will not be resynchronized."),
name, camel_exception_get_description (&ex));
@@ -328,7 +328,7 @@ journal_decode_folder (CamelIMAPJournal *journal, const char *name)
return folder;
}
-int
+gint
imap_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex)
{
CamelIMAPJournalEntry *imap_entry = (CamelIMAPJournalEntry *) entry;
@@ -341,7 +341,7 @@ imap_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelExcep
return 0;
case CAMEL_IMAP_JOURNAL_ENTRY_APPEND:
{
- char *ret_uid = NULL;
+ gchar *ret_uid = NULL;
CamelMimeMessage *message;
CamelMessageInfo *info;
@@ -364,7 +364,7 @@ imap_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelExcep
{
CamelFolder *destination;
GPtrArray *ret_uids;
- int i;
+ gint i;
destination = journal_decode_folder ((CamelIMAPJournal *)journal, imap_entry->dest_folder_name);
if (!destination) {
@@ -399,7 +399,7 @@ imap_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelExcep
}
CamelOfflineJournal *
-camel_imap_journal_new (CamelImapFolder *folder, const char *filename)
+camel_imap_journal_new (CamelImapFolder *folder, const gchar *filename)
{
CamelOfflineJournal *journal;
@@ -437,7 +437,7 @@ camel_imap_journal_log (CamelOfflineJournal *journal, CamelOfflineAction action,
}
case CAMEL_IMAP_JOURNAL_ENTRY_APPEND:
{
- char *uid = va_arg (ap, char *);
+ gchar *uid = va_arg (ap, gchar *);
entry->append_uid = g_strdup (uid);
break;
}
@@ -478,15 +478,15 @@ camel_imap_journal_close_folders (CamelIMAPJournal *journal)
}
void
-camel_imap_journal_uidmap_add (CamelIMAPJournal *journal, const char *old_uid,
- const char *new_uid)
+camel_imap_journal_uidmap_add (CamelIMAPJournal *journal, const gchar *old_uid,
+ const gchar *new_uid)
{
g_hash_table_insert (journal->uidmap, g_strdup (old_uid),
g_strdup (new_uid));
}
-const char *
-camel_imap_journal_uidmap_lookup (CamelIMAPJournal *journal, const char *uid)
+const gchar *
+camel_imap_journal_uidmap_lookup (CamelIMAPJournal *journal, const gchar *uid)
{
return g_hash_table_lookup (journal->uidmap, uid);
}
diff --git a/camel/providers/imap/camel-imap-journal.h b/camel/providers/imap/camel-imap-journal.h
index c0825fded..841985967 100644
--- a/camel/providers/imap/camel-imap-journal.h
+++ b/camel/providers/imap/camel-imap-journal.h
@@ -60,8 +60,8 @@ struct _CamelIMAPJournalEntry {
GPtrArray *uids;
- char *append_uid;
- char *dest_folder_name;
+ gchar *append_uid;
+ gchar *dest_folder_name;
gboolean move;
};
@@ -81,10 +81,10 @@ struct _CamelIMAPJournalClass {
CamelType camel_imap_journal_get_type (void);
-CamelOfflineJournal *camel_imap_journal_new (struct _CamelImapFolder *folder, const char *filename);
+CamelOfflineJournal *camel_imap_journal_new (struct _CamelImapFolder *folder, const gchar *filename);
void camel_imap_journal_log (CamelOfflineJournal *journal, CamelOfflineAction action, ...);
-void camel_imap_journal_uidmap_add (CamelIMAPJournal *journal, const char *old_uid, const char *n_uid);
-const char *camel_imap_journal_uidmap_lookup (CamelIMAPJournal *journal, const char *uid);
+void camel_imap_journal_uidmap_add (CamelIMAPJournal *journal, const gchar *old_uid, const gchar *n_uid);
+const gchar *camel_imap_journal_uidmap_lookup (CamelIMAPJournal *journal, const gchar *uid);
void camel_imap_journal_close_folders (CamelIMAPJournal *journal);
G_END_DECLS
diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c
index 0aebbf0c1..effe9c0d5 100644
--- a/camel/providers/imap/camel-imap-message-cache.c
+++ b/camel/providers/imap/camel-imap-message-cache.c
@@ -59,9 +59,9 @@ struct _part_find {
/* UID name on disk - e.g. "0." or "0.HEADERS". On windows "0." is
* stored as "0.~"
*/
- char *disk_part_name;
+ gchar *disk_part_name;
/* Was the part found? */
- int found;
+ gint found;
};
@@ -112,10 +112,10 @@ finalize (CamelImapMessageCache *cache)
}
static void
-cache_put (CamelImapMessageCache *cache, const char *uid, const char *key,
+cache_put (CamelImapMessageCache *cache, const gchar *uid, const gchar *key,
CamelStream *stream)
{
- char *hash_key;
+ gchar *hash_key;
GPtrArray *subparts;
gpointer okey, ostream;
guint32 uidval;
@@ -165,13 +165,13 @@ cache_put (CamelImapMessageCache *cache, const char *uid, const char *key,
* expensive, but the parts hash is immediately usable.
**/
CamelImapMessageCache *
-camel_imap_message_cache_new (const char *path, CamelFolderSummary *summary,
+camel_imap_message_cache_new (const gchar *path, CamelFolderSummary *summary,
CamelException *ex)
{
CamelImapMessageCache *cache;
GDir *dir;
- const char *dname;
- char *uid, *p;
+ const gchar *dname;
+ gchar *uid, *p;
GPtrArray *deletes;
GError *error = NULL;
GHashTable *shash;
@@ -233,10 +233,10 @@ camel_imap_message_cache_new (const char *path, CamelFolderSummary *summary,
**/
gboolean
-camel_imap_message_cache_delete (const char *path, CamelException *ex)
+camel_imap_message_cache_delete (const gchar *path, CamelException *ex)
{
GDir *dir;
- const char *dname;
+ const gchar *dname;
GError *error = NULL;
GPtrArray *deletes;
@@ -285,7 +285,7 @@ camel_imap_message_cache_max_uid (CamelImapMessageCache *cache)
* Set the path used for the message cache.
**/
void
-camel_imap_message_cache_set_path (CamelImapMessageCache *cache, const char *path)
+camel_imap_message_cache_set_path (CamelImapMessageCache *cache, const gchar *path)
{
g_free(cache->path);
cache->path = g_strdup(path);
@@ -295,7 +295,7 @@ static void
stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data)
{
CamelImapMessageCache *cache = user_data;
- char *key;
+ gchar *key;
key = g_hash_table_lookup (cache->cached, stream);
if (!key)
@@ -306,11 +306,11 @@ stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data)
static CamelStream *
-insert_setup (CamelImapMessageCache *cache, const char *uid, const char *part_spec,
- char **path, char **key, CamelException *ex)
+insert_setup (CamelImapMessageCache *cache, const gchar *uid, const gchar *part_spec,
+ gchar **path, gchar **key, CamelException *ex)
{
CamelStream *stream;
- int fd;
+ gint fd;
#ifdef G_OS_WIN32
/* Trailing periods in file names are silently dropped on
@@ -340,7 +340,7 @@ insert_setup (CamelImapMessageCache *cache, const char *uid, const char *part_sp
}
static CamelStream *
-insert_abort (char *path, CamelStream *stream)
+insert_abort (gchar *path, CamelStream *stream)
{
g_unlink (path);
g_free (path);
@@ -349,8 +349,8 @@ insert_abort (char *path, CamelStream *stream)
}
static CamelStream *
-insert_finish (CamelImapMessageCache *cache, const char *uid, char *path,
- char *key, CamelStream *stream)
+insert_finish (CamelImapMessageCache *cache, const gchar *uid, gchar *path,
+ gchar *key, CamelStream *stream)
{
camel_stream_flush (stream);
camel_stream_reset (stream);
@@ -374,11 +374,11 @@ insert_finish (CamelImapMessageCache *cache, const char *uid, char *path,
* caller must unref.
**/
CamelStream *
-camel_imap_message_cache_insert (CamelImapMessageCache *cache, const char *uid,
- const char *part_spec, const char *data,
- int len, CamelException *ex)
+camel_imap_message_cache_insert (CamelImapMessageCache *cache, const gchar *uid,
+ const gchar *part_spec, const gchar *data,
+ gint len, CamelException *ex)
{
- char *path, *key;
+ gchar *path, *key;
CamelStream *stream;
stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
@@ -406,10 +406,10 @@ camel_imap_message_cache_insert (CamelImapMessageCache *cache, const char *uid,
**/
void
camel_imap_message_cache_insert_stream (CamelImapMessageCache *cache,
- const char *uid, const char *part_spec,
+ const gchar *uid, const gchar *part_spec,
CamelStream *data_stream, CamelException *ex)
{
- char *path, *key;
+ gchar *path, *key;
CamelStream *stream;
stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
@@ -438,10 +438,10 @@ camel_imap_message_cache_insert_stream (CamelImapMessageCache *cache,
**/
void
camel_imap_message_cache_insert_wrapper (CamelImapMessageCache *cache,
- const char *uid, const char *part_spec,
+ const gchar *uid, const gchar *part_spec,
CamelDataWrapper *wrapper, CamelException *ex)
{
- char *path, *key;
+ gchar *path, *key;
CamelStream *stream;
stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
@@ -468,13 +468,13 @@ camel_imap_message_cache_insert_wrapper (CamelImapMessageCache *cache,
*
* Return value: the filename of a cache item
**/
-char*
+gchar *
camel_imap_message_cache_get_filename (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
+ const gchar *uid,
+ const gchar *part_spec,
CamelException *ex)
{
- char *path;
+ gchar *path;
if (uid[0] == 0)
return NULL;
@@ -500,11 +500,11 @@ camel_imap_message_cache_get_filename (CamelImapMessageCache *cache,
* caller must unref), or %NULL if that data is not cached.
**/
CamelStream *
-camel_imap_message_cache_get (CamelImapMessageCache *cache, const char *uid,
- const char *part_spec, CamelException *ex)
+camel_imap_message_cache_get (CamelImapMessageCache *cache, const gchar *uid,
+ const gchar *part_spec, CamelException *ex)
{
CamelStream *stream;
- char *path, *key;
+ gchar *path, *key;
if (uid[0] == 0)
return NULL;
@@ -547,12 +547,12 @@ camel_imap_message_cache_get (CamelImapMessageCache *cache, const char *uid,
* Removes all data associated with @uid from @cache.
**/
void
-camel_imap_message_cache_remove (CamelImapMessageCache *cache, const char *uid)
+camel_imap_message_cache_remove (CamelImapMessageCache *cache, const gchar *uid)
{
GPtrArray *subparts;
- char *key, *path;
+ gchar *key, *path;
CamelObject *stream;
- int i;
+ gint i;
subparts = g_hash_table_lookup (cache->parts, uid);
if (!subparts)
@@ -593,7 +593,7 @@ void
camel_imap_message_cache_clear (CamelImapMessageCache *cache)
{
GPtrArray *uids;
- int i;
+ gint i;
uids = g_ptr_array_new ();
g_hash_table_foreach (cache->parts, add_uids, uids);
@@ -616,15 +616,15 @@ camel_imap_message_cache_clear (CamelImapMessageCache *cache)
**/
void
camel_imap_message_cache_copy (CamelImapMessageCache *source,
- const char *source_uid,
+ const gchar *source_uid,
CamelImapMessageCache *dest,
- const char *dest_uid,
+ const gchar *dest_uid,
CamelException *ex)
{
GPtrArray *subparts;
CamelStream *stream;
- char *part;
- int i;
+ gchar *part;
+ gint i;
subparts = g_hash_table_lookup (source->parts, source_uid);
if (!subparts || !subparts->len)
@@ -676,7 +676,7 @@ GPtrArray *
camel_imap_message_cache_filter_cached(CamelImapMessageCache *cache, GPtrArray *uids, CamelException *ex)
{
GPtrArray *result, *parts_list;
- int i;
+ gint i;
struct _part_find part_find;
/* Look for a part "" for each uid. */
result = g_ptr_array_sized_new(uids->len);
@@ -689,7 +689,7 @@ camel_imap_message_cache_filter_cached(CamelImapMessageCache *cache, GPtrArray *
*/
part_find.found = 0;
part_find.disk_part_name = g_strdup_printf("%s" BASE_PART_SUFFIX,
- (char *)uids->pdata[i]);
+ (gchar *)uids->pdata[i]);
g_ptr_array_foreach(parts_list, _match_part, &part_find);
g_free(part_find.disk_part_name);
if (part_find.found)
@@ -701,7 +701,7 @@ camel_imap_message_cache_filter_cached(CamelImapMessageCache *cache, GPtrArray *
/* No message parts, or message part "" not found: include the
* uid in the result.
*/
- g_ptr_array_add(result, (char *)camel_pstring_strdup(uids->pdata[i]));
+ g_ptr_array_add(result, (gchar *)camel_pstring_strdup(uids->pdata[i]));
}
return result;
}
diff --git a/camel/providers/imap/camel-imap-message-cache.h b/camel/providers/imap/camel-imap-message-cache.h
index eae080710..d4ad48899 100644
--- a/camel/providers/imap/camel-imap-message-cache.h
+++ b/camel/providers/imap/camel-imap-message-cache.h
@@ -40,7 +40,7 @@ G_BEGIN_DECLS
struct _CamelImapMessageCache {
CamelObject parent_object;
- char *path;
+ gchar *path;
/* parts contains two sorts of objects.
* If the key contains '.' then it is a stream (also reverse-indexed in
* cached).
@@ -62,53 +62,53 @@ typedef struct {
/* public methods */
-CamelImapMessageCache *camel_imap_message_cache_new (const char *path,
+CamelImapMessageCache *camel_imap_message_cache_new (const gchar *path,
CamelFolderSummary *summary,
CamelException *ex);
void camel_imap_message_cache_set_path (CamelImapMessageCache *cache,
- const char *path);
+ const gchar *path);
guint32 camel_imap_message_cache_max_uid (CamelImapMessageCache *cache);
CamelStream *camel_imap_message_cache_insert (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
- const char *data,
- int len,
+ const gchar *uid,
+ const gchar *part_spec,
+ const gchar *data,
+ gint len,
CamelException *ex);
void camel_imap_message_cache_insert_stream (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
+ const gchar *uid,
+ const gchar *part_spec,
CamelStream *data_stream,
CamelException *ex);
void camel_imap_message_cache_insert_wrapper (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
+ const gchar *uid,
+ const gchar *part_spec,
CamelDataWrapper *wrapper,
CamelException *ex);
CamelStream *camel_imap_message_cache_get (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
+ const gchar *uid,
+ const gchar *part_spec,
CamelException *ex);
-char* camel_imap_message_cache_get_filename (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
+gchar * camel_imap_message_cache_get_filename (CamelImapMessageCache *cache,
+ const gchar *uid,
+ const gchar *part_spec,
CamelException *ex);
void camel_imap_message_cache_remove (CamelImapMessageCache *cache,
- const char *uid);
+ const gchar *uid);
void camel_imap_message_cache_clear (CamelImapMessageCache *cache);
void camel_imap_message_cache_copy (CamelImapMessageCache *source,
- const char *source_uid,
+ const gchar *source_uid,
CamelImapMessageCache *dest,
- const char *dest_uid,
+ const gchar *dest_uid,
CamelException *ex);
-gboolean camel_imap_message_cache_delete (const char *path,
+gboolean camel_imap_message_cache_delete (const gchar *path,
CamelException *ex);
GPtrArray * camel_imap_message_cache_filter_cached(CamelImapMessageCache *,
GPtrArray *uids,
diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c
index a6377120c..7771257d8 100644
--- a/camel/providers/imap/camel-imap-provider.c
+++ b/camel/providers/imap/camel-imap-provider.c
@@ -34,9 +34,9 @@
#include "camel-session.h"
#include "camel-url.h"
-static void add_hash (guint *hash, char *s);
+static void add_hash (guint *hash, gchar *s);
static guint imap_url_hash (gconstpointer key);
-static gint check_equal (char *s1, char *s2);
+static gint check_equal (gchar *s1, gchar *s2);
static gint imap_url_equal (gconstpointer a, gconstpointer b);
CamelProviderConfEntry imap_conf_entries[] = {
@@ -120,7 +120,7 @@ camel_provider_module_init(void)
}
static void
-add_hash (guint *hash, char *s)
+add_hash (guint *hash, gchar *s)
{
if (s)
*hash ^= g_str_hash(s);
@@ -140,7 +140,7 @@ imap_url_hash (gconstpointer key)
}
static int
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
if (s2 == NULL)
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
index 58facb0ce..5afd569c8 100644
--- a/camel/providers/imap/camel-imap-search.c
+++ b/camel/providers/imap/camel-imap-search.c
@@ -83,19 +83,19 @@ struct _match_record {
struct _match_record *next;
struct _match_record *prev;
- char hash[17];
+ gchar hash[17];
guint32 lastuid;
guint32 validity;
- unsigned int termcount;
- char **terms;
+ guint termcount;
+ gchar **terms;
GArray *matches;
};
static void free_match(CamelImapSearch *is, struct _match_record *mr);
-static ESExpResult *imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *imap_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s);
static CamelFolderSearchClass *imap_search_parent_class;
@@ -157,7 +157,7 @@ camel_imap_search_get_type (void)
* Return value: A new CamelImapSearch widget.
**/
CamelFolderSearch *
-camel_imap_search_new (const char *cachedir)
+camel_imap_search_new (const gchar *cachedir)
{
CamelFolderSearch *new = CAMEL_FOLDER_SEARCH (camel_object_new (camel_imap_search_get_type ()));
CamelImapSearch *is = (CamelImapSearch *)new;
@@ -175,13 +175,13 @@ camel_imap_search_new (const char *cachedir)
static void
-hash_match(char hash[17], int argc, struct _ESExpResult **argv)
+hash_match(gchar hash[17], gint argc, struct _ESExpResult **argv)
{
GChecksum *checksum;
guint8 *digest;
gsize length;
- int state = 0, save = 0;
- int i;
+ gint state = 0, save = 0;
+ gint i;
length = g_checksum_type_get_length (G_CHECKSUM_MD5);
digest = g_alloca (length);
@@ -212,7 +212,7 @@ static int
save_match(CamelImapSearch *is, struct _match_record *mr)
{
guint32 mark = MATCH_MARK;
- int ret = 0;
+ gint ret = 0;
struct _match_header header;
CamelStream *stream;
@@ -234,10 +234,10 @@ save_match(CamelImapSearch *is, struct _match_record *mr)
header.lastuid = mr->lastuid;
header.validity = mr->validity;
- if (camel_stream_write(stream, (char *)&header, sizeof(header)) != sizeof(header)
+ if (camel_stream_write(stream, (gchar *)&header, sizeof(header)) != sizeof(header)
|| camel_stream_write(stream, mr->matches->data, mr->matches->len*sizeof(guint32)) != mr->matches->len*sizeof(guint32)
|| camel_seekable_stream_seek((CamelSeekableStream *)stream, 0, CAMEL_STREAM_SET) == -1
- || camel_stream_write(stream, (char *)&mark, sizeof(mark)) != sizeof(mark)) {
+ || camel_stream_write(stream, (gchar *)&mark, sizeof(mark)) != sizeof(mark)) {
d(printf(" saving failed, removing cache entry\n"));
camel_data_cache_remove(is->cache, "search/body-contains", mr->hash, NULL);
ret = -1;
@@ -250,7 +250,7 @@ save_match(CamelImapSearch *is, struct _match_record *mr)
static void
free_match(CamelImapSearch *is, struct _match_record *mr)
{
- int i;
+ gint i;
for (i=0;i<mr->termcount;i++)
g_free(mr->terms[i]);
@@ -260,12 +260,12 @@ free_match(CamelImapSearch *is, struct _match_record *mr)
}
static struct _match_record *
-load_match(CamelImapSearch *is, char hash[17], int argc, struct _ESExpResult **argv)
+load_match(CamelImapSearch *is, gchar hash[17], gint argc, struct _ESExpResult **argv)
{
struct _match_record *mr;
CamelStream *stream = NULL;
struct _match_header header;
- int i;
+ gint i;
mr = g_malloc0(sizeof(*mr));
mr->matches = g_array_new(0, 0, sizeof(guint32));
@@ -290,7 +290,7 @@ load_match(CamelImapSearch *is, char hash[17], int argc, struct _ESExpResult **a
should be sufficient to key it */
/* This check should also handle endianness changes, we just throw away
the data (its only a cache) */
- if (camel_stream_read(stream, (char *)&header, sizeof(header)) == sizeof(header)
+ if (camel_stream_read(stream, (gchar *)&header, sizeof(header)) == sizeof(header)
&& header.validity == is->validity
&& header.mark == MATCH_MARK
&& header.termcount == 0) {
@@ -318,14 +318,14 @@ load_match(CamelImapSearch *is, char hash[17], int argc, struct _ESExpResult **a
static int
sync_match(CamelImapSearch *is, struct _match_record *mr)
{
- char *p, *result, *lasts = NULL;
+ gchar *p, *result, *lasts = NULL;
CamelImapResponse *response = NULL;
guint32 uid;
CamelFolder *folder = ((CamelFolderSearch *)is)->folder;
CamelImapStore *store = (CamelImapStore *)folder->parent_store;
struct _camel_search_words *words;
GString *search;
- int i;
+ gint i;
if (mr->lastuid >= is->lastuid && mr->validity == is->validity)
return 0;
@@ -335,11 +335,11 @@ sync_match(CamelImapSearch *is, struct _match_record *mr)
/* TODO: Handle multiple search terms */
/* This handles multiple search words within a single term */
- words = camel_search_words_split ((const unsigned char *) mr->terms[0]);
+ words = camel_search_words_split ((const guchar *) mr->terms[0]);
search = g_string_new ("");
g_string_append_printf (search, "UID %d:%d", mr->lastuid + 1, is->lastuid);
for (i = 0; i < words->len; i++) {
- char *w = words->words[i]->word, c;
+ gchar *w = words->words[i]->word, c;
g_string_append_printf (search, " BODY \"");
while ((c = *w++)) {
@@ -385,9 +385,9 @@ sync_match(CamelImapSearch *is, struct _match_record *mr)
}
static struct _match_record *
-get_match(CamelImapSearch *is, int argc, struct _ESExpResult **argv)
+get_match(CamelImapSearch *is, gint argc, struct _ESExpResult **argv)
{
- char hash[17];
+ gchar hash[17];
struct _match_record *mr;
hash_match(hash, argc, argv);
@@ -422,15 +422,15 @@ get_match(CamelImapSearch *is, int argc, struct _ESExpResult **argv)
}
static ESExpResult *
-imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
+imap_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *s)
{
CamelImapStore *store = CAMEL_IMAP_STORE (s->folder->parent_store);
CamelImapSearch *is = (CamelImapSearch *)s;
- char *uid;
+ gchar *uid;
ESExpResult *r;
GHashTable *uid_hash = NULL;
GPtrArray *array;
- int i, j;
+ gint i, j;
struct _match_record *mr;
guint32 uidn, *uidp;
@@ -451,7 +451,7 @@ imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Came
r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
r->value.ptrarray = g_ptr_array_new ();
for (i = 0; i < s->summary->len; i++) {
- g_ptr_array_add(r->value.ptrarray, (char *)g_ptr_array_index(s->summary, i));
+ g_ptr_array_add(r->value.ptrarray, (gchar *)g_ptr_array_index(s->summary, i));
}
}
} else if (argc == 0 || s->summary->len == 0) {
@@ -464,10 +464,10 @@ imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Came
r->value.ptrarray = g_ptr_array_new ();
}
} else {
- int truth = FALSE;
+ gint truth = FALSE;
/* setup lastuid/validity for synchronising */
- is->lastuid = strtoul((char *)g_ptr_array_index(s->summary, s->summary->len-1), NULL, 10);
+ is->lastuid = strtoul((gchar *)g_ptr_array_index(s->summary, s->summary->len-1), NULL, 10);
is->validity = ((CamelImapSummary *)(s->folder->summary))->validity;
mr = get_match(is, argc, argv);
@@ -488,7 +488,7 @@ imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Came
/* We use the summary's strings so we dont need to alloc more */
uid_hash = g_hash_table_new(NULL, NULL);
for (i = 0; i < s->summary->len; i++) {
- uid = (char *)s->summary->pdata[i];
+ uid = (gchar *)s->summary->pdata[i];
uidn = strtoul(uid, NULL, 10);
g_hash_table_insert(uid_hash, GUINT_TO_POINTER(uidn), uid);
}
diff --git a/camel/providers/imap/camel-imap-search.h b/camel/providers/imap/camel-imap-search.h
index e9be55e04..afe4e2bbc 100644
--- a/camel/providers/imap/camel-imap-search.h
+++ b/camel/providers/imap/camel-imap-search.h
@@ -48,7 +48,7 @@ struct _CamelImapSearch {
CamelDataCache *cache; /* disk-cache for searches */
/* cache of body search matches */
- unsigned int matches_count;
+ guint matches_count;
CamelDList matches;
GHashTable *matches_hash;
};
@@ -59,7 +59,7 @@ struct _CamelImapSearchClass {
};
CamelType camel_imap_search_get_type (void);
-CamelFolderSearch *camel_imap_search_new (const char *cachedir);
+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 0deb6bfac..a7dd04a0f 100644
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ b/camel/providers/imap/camel-imap-store-summary.c
@@ -47,16 +47,16 @@
static void namespace_clear(CamelStoreSummary *s);
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
+static gint summary_header_load(CamelStoreSummary *, FILE *);
+static gint summary_header_save(CamelStoreSummary *, FILE *);
-/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const char *);*/
+/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const gchar *);*/
static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-static const char *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
-static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
+static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
+static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
static void camel_imap_store_summary_class_init (CamelImapStoreSummaryClass *klass);
static void camel_imap_store_summary_init (CamelImapStoreSummary *obj);
@@ -151,9 +151,9 @@ camel_imap_store_summary_new (void)
* It must be freed using camel_store_summary_info_free().
**/
CamelImapStoreInfo *
-camel_imap_store_summary_full_name(CamelImapStoreSummary *s, const char *full_name)
+camel_imap_store_summary_full_name(CamelImapStoreSummary *s, const gchar *full_name)
{
- int count, i;
+ gint count, i;
CamelImapStoreInfo *info;
count = camel_store_summary_count((CamelStoreSummary *)s);
@@ -169,12 +169,12 @@ camel_imap_store_summary_full_name(CamelImapStoreSummary *s, const char *full_na
return NULL;
}
-char *
-camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const char *full_name, char dir_sep)
+gchar *
+camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const gchar *full_name, gchar dir_sep)
{
- char *path, *p;
- int c;
- const char *f;
+ gchar *path, *p;
+ gint c;
+ const gchar *f;
if (dir_sep != '/') {
p = path = alloca(strlen(full_name)*3+1);
@@ -189,7 +189,7 @@ camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const char *full
}
*p = 0;
} else
- path = (char *)full_name;
+ path = (gchar *)full_name;
return g_strdup(path);
}
@@ -204,14 +204,14 @@ static guint32 hexnib(guint32 c)
return 0;
}
-char *
-camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path, char dir_sep)
+gchar *
+camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const gchar *path, gchar dir_sep)
{
- char *full, *f;
+ gchar *full, *f;
guint32 c, v = 0;
- const char *p;
- int state=0;
- char *subpath, *last = NULL;
+ const gchar *p;
+ gint state=0;
+ gchar *subpath, *last = NULL;
CamelStoreInfo *si;
CamelImapStoreNamespace *ns;
@@ -244,7 +244,7 @@ camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path
else
p = path;
- while ((c = camel_utf8_getc((const unsigned char **)&p))) {
+ while ((c = camel_utf8_getc((const guchar **)&p))) {
switch(state) {
case 0:
if (c == '%')
@@ -252,7 +252,7 @@ camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path
else {
if (c == '/')
c = dir_sep;
- camel_utf8_putc((unsigned char **) &f, c);
+ camel_utf8_putc((guchar **) &f, c);
}
break;
case 1:
@@ -262,11 +262,11 @@ camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path
case 2:
state = 0;
v |= hexnib(c);
- camel_utf8_putc((unsigned char **) &f, v);
+ camel_utf8_putc((guchar **) &f, v);
break;
}
}
- camel_utf8_putc((unsigned char **) &f, c);
+ camel_utf8_putc((guchar **) &f, c);
/* merge old path part if required */
f = g_strdup(full);
@@ -285,12 +285,12 @@ camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path
}
CamelImapStoreInfo *
-camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const char *full, char dir_sep)
+camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const gchar *full, gchar dir_sep)
{
CamelImapStoreInfo *info;
- char *pathu8, *prefix;
- int len;
- char *full_name;
+ gchar *pathu8, *prefix;
+ gint len;
+ gchar *full_name;
CamelImapStoreNamespace *ns;
d(printf("adding full name '%s' '%c'\n", full, dir_sep));
@@ -347,11 +347,11 @@ camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const char *ful
/* should this be const? */
/* TODO: deprecate/merge this function with path_to_full */
-char *
-camel_imap_store_summary_full_from_path(CamelImapStoreSummary *s, const char *path)
+gchar *
+camel_imap_store_summary_full_from_path(CamelImapStoreSummary *s, const gchar *path)
{
CamelImapStoreNamespace *ns;
- char *name = NULL;
+ gchar *name = NULL;
ns = camel_imap_store_summary_namespace_find_path(s, path);
if (ns)
@@ -363,11 +363,11 @@ camel_imap_store_summary_full_from_path(CamelImapStoreSummary *s, const char *pa
}
/* TODO: this api needs some more work */
-CamelImapStoreNamespace *camel_imap_store_summary_namespace_new(CamelImapStoreSummary *s, const char *full_name, char dir_sep)
+CamelImapStoreNamespace *camel_imap_store_summary_namespace_new(CamelImapStoreSummary *s, const gchar *full_name, gchar dir_sep)
{
CamelImapStoreNamespace *ns;
- char *p, *o, c;
- int len;
+ gchar *p, *o, c;
+ gint len;
ns = g_malloc0(sizeof(*ns));
ns->full_name = g_strdup(full_name);
@@ -398,9 +398,9 @@ void camel_imap_store_summary_namespace_set(CamelImapStoreSummary *s, CamelImapS
}
CamelImapStoreNamespace *
-camel_imap_store_summary_namespace_find_path(CamelImapStoreSummary *s, const char *path)
+camel_imap_store_summary_namespace_find_path(CamelImapStoreSummary *s, const gchar *path)
{
- int len;
+ gint len;
CamelImapStoreNamespace *ns;
/* NB: this currently only compares against 1 namespace, in future compare against others */
@@ -419,9 +419,9 @@ camel_imap_store_summary_namespace_find_path(CamelImapStoreSummary *s, const cha
}
CamelImapStoreNamespace *
-camel_imap_store_summary_namespace_find_full(CamelImapStoreSummary *s, const char *full)
+camel_imap_store_summary_namespace_find_full(CamelImapStoreSummary *s, const gchar *full)
{
- int len;
+ gint len;
CamelImapStoreNamespace *ns;
/* NB: this currently only compares against 1 namespace, in future compare against others */
@@ -584,8 +584,8 @@ store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
camel_imap_store_summary_parent->store_info_free(s, mi);
}
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
+static const gchar *
+store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
{
CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
@@ -602,7 +602,7 @@ store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
}
static void
-store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
+store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
{
CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
diff --git a/camel/providers/imap/camel-imap-store-summary.h b/camel/providers/imap/camel-imap-store-summary.h
index bc1ed51ab..e5cc6d30e 100644
--- a/camel/providers/imap/camel-imap-store-summary.h
+++ b/camel/providers/imap/camel-imap-store-summary.h
@@ -44,15 +44,15 @@ enum {
struct _CamelImapStoreInfo {
CamelStoreInfo info;
- char *full_name;
+ gchar *full_name;
};
typedef struct _CamelImapStoreNamespace CamelImapStoreNamespace;
struct _CamelImapStoreNamespace {
- char *path; /* display path */
- char *full_name; /* real name */
- char sep; /* directory separator */
+ gchar *path; /* display path */
+ gchar *full_name; /* real name */
+ gchar sep; /* directory separator */
};
struct _CamelImapStoreSummary {
@@ -74,20 +74,20 @@ CamelType camel_imap_store_summary_get_type (void);
CamelImapStoreSummary *camel_imap_store_summary_new (void);
/* TODO: this api needs some more work, needs to support lists */
-CamelImapStoreNamespace *camel_imap_store_summary_namespace_new(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
+CamelImapStoreNamespace *camel_imap_store_summary_namespace_new(CamelImapStoreSummary *s, const gchar *full_name, gchar dir_sep);
void camel_imap_store_summary_namespace_set(CamelImapStoreSummary *s, CamelImapStoreNamespace *ns);
-CamelImapStoreNamespace *camel_imap_store_summary_namespace_find_path(CamelImapStoreSummary *s, const char *path);
-CamelImapStoreNamespace *camel_imap_store_summary_namespace_find_full(CamelImapStoreSummary *s, const char *full_name);
+CamelImapStoreNamespace *camel_imap_store_summary_namespace_find_path(CamelImapStoreSummary *s, const gchar *path);
+CamelImapStoreNamespace *camel_imap_store_summary_namespace_find_full(CamelImapStoreSummary *s, const gchar *full_name);
/* converts to/from utf8 canonical nasmes */
-char *camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
-char *camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path, char dir_sep);
+gchar *camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const gchar *full_name, gchar dir_sep);
+gchar *camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const gchar *path, gchar dir_sep);
-CamelImapStoreInfo *camel_imap_store_summary_full_name(CamelImapStoreSummary *s, const char *full_name);
-CamelImapStoreInfo *camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
+CamelImapStoreInfo *camel_imap_store_summary_full_name(CamelImapStoreSummary *s, const gchar *full_name);
+CamelImapStoreInfo *camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const gchar *full_name, gchar dir_sep);
/* a convenience lookup function. always use this if path known */
-char *camel_imap_store_summary_full_from_path(CamelImapStoreSummary *s, const char *path);
+gchar *camel_imap_store_summary_full_from_path(CamelImapStoreSummary *s, const gchar *path);
/* helper macro's */
#define camel_imap_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAP_STORE_INFO_FULL_NAME))
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 83a098f82..bde63ae4a 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -79,16 +79,16 @@
static CamelOfflineStoreClass *parent_class = NULL;
-static char imap_tag_prefix = 'A';
+static gchar imap_tag_prefix = 'A';
static void construct (CamelService *service, CamelSession *session,
CamelProvider *provider, CamelURL *url,
CamelException *ex);
-static int imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static char *imap_get_name (CamelService *service, gboolean brief);
+static gchar *imap_get_name (CamelService *service, gboolean brief);
static void imap_noop (CamelStore *store, CamelException *ex);
static CamelFolder *imap_get_junk(CamelStore *store, CamelException *ex);
@@ -97,29 +97,29 @@ static GList *query_auth_types (CamelService *service, CamelException *ex);
static guint hash_folder_name (gconstpointer key);
static gint compare_folder_name (gconstpointer a, gconstpointer b);
-static CamelFolderInfo *create_folder (CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
-static void delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static void rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex);
-static gboolean folder_subscribed (CamelStore *store, const char *folder_name);
-static void subscribe_folder (CamelStore *store, const char *folder_name,
+static CamelFolderInfo *create_folder (CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex);
+static void delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name, CamelException *ex);
+static gboolean folder_subscribed (CamelStore *store, const gchar *folder_name);
+static void subscribe_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex);
-static void unsubscribe_folder (CamelStore *store, const char *folder_name,
+static void unsubscribe_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex);
-static void get_folders_sync(CamelImapStore *imap_store, const char *pattern, CamelException *ex);
+static void get_folders_sync(CamelImapStore *imap_store, const gchar *pattern, CamelException *ex);
-static void imap_folder_effectively_unsubscribed(CamelImapStore *imap_store, const char *folder_name, CamelException *ex);
-static gboolean imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_name, CamelException *ex);
-static void imap_forget_folder(CamelImapStore *imap_store, const char *folder_name, CamelException *ex);
+static void imap_folder_effectively_unsubscribed(CamelImapStore *imap_store, const gchar *folder_name, CamelException *ex);
+static gboolean imap_check_folder_still_extant (CamelImapStore *imap_store, const gchar *full_name, CamelException *ex);
+static void imap_forget_folder(CamelImapStore *imap_store, const gchar *folder_name, CamelException *ex);
static void imap_set_server_level (CamelImapStore *store);
static gboolean imap_can_refresh_folder (CamelStore *store, CamelFolderInfo *info, CamelException *ex);
static gboolean imap_connect (CamelService *service, CamelException *ex);
static gboolean imap_disconnect (CamelService *service, gboolean clean, CamelException *ex);
-static CamelFolder * get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static CamelFolderInfo * get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-static CamelFolder * get_folder_offline (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static CamelFolderInfo * get_folder_info_offline (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
+static CamelFolder * get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex);
+static CamelFolderInfo * get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
+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);
static void
camel_imap_store_class_init (CamelImapStoreClass *camel_imap_store_class)
@@ -237,7 +237,7 @@ construct (CamelService *service, CamelSession *session,
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (service);
CamelStore *store = CAMEL_STORE (service);
- char *tmp;
+ gchar *tmp;
CamelURL *summary_url;
CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
@@ -315,7 +315,7 @@ imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
CamelImapStore *store = (CamelImapStore *) object;
guint32 tag, flags;
- int i;
+ gint i;
for (i = 0; i < args->argc; i++) {
tag = args->argv[i].tag;
@@ -389,7 +389,7 @@ imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelImapStore *store = (CamelImapStore *) object;
guint32 tag;
- int i;
+ gint i;
for (i = 0; i < args->argc; i++) {
tag = args->argv[i].tag;
@@ -430,7 +430,7 @@ imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
}
-static char *
+static gchar *
imap_get_name (CamelService *service, gboolean brief)
{
if (brief)
@@ -453,7 +453,7 @@ imap_set_server_level (CamelImapStore *store)
}
static struct {
- const char *name;
+ const gchar *name;
guint32 flag;
} capabilities[] = {
{ "IMAP4", IMAP_CAPABILITY_IMAP4 },
@@ -471,10 +471,10 @@ static struct {
};
static void
-parse_capability(CamelImapStore *store, char *capa)
+parse_capability(CamelImapStore *store, gchar *capa)
{
- char *lasts = NULL;
- int i;
+ gchar *lasts = NULL;
+ gint i;
for (capa = strtok_r (capa, " ", &lasts); capa; capa = strtok_r (NULL, " ", &lasts)) {
if (!strncmp (capa, "AUTH=", 5)) {
@@ -497,7 +497,7 @@ imap_get_capability (CamelService *service, CamelException *ex)
{
CamelImapStore *store = CAMEL_IMAP_STORE (service);
CamelImapResponse *response;
- char *result;
+ gchar *result;
/* Find out the IMAP capabilities */
/* We assume we have utf8 capable search until a failed search tells us otherwise */
@@ -547,7 +547,7 @@ enum {
#endif
static gboolean
-connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, CamelException *ex)
+connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, CamelException *ex)
{
CamelImapStore *store = (CamelImapStore *) service;
CamelImapResponse *response;
@@ -555,7 +555,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
CamelSockOptData sockopt;
gboolean force_imap4 = FALSE;
gboolean clean_quit = TRUE;
- char *buf;
+ gchar *buf;
if (ssl_mode != MODE_CLEAR) {
#ifdef HAVE_SSL
@@ -775,15 +775,15 @@ exception:
/* Using custom commands to connect to IMAP servers is not supported on Win32 */
static gboolean
-connect_to_server_process (CamelService *service, const char *cmd, CamelException *ex)
+connect_to_server_process (CamelService *service, const gchar *cmd, CamelException *ex)
{
CamelImapStore *store = (CamelImapStore *) service;
CamelStream *cmd_stream;
- int ret, i = 0;
- char *buf;
- char *cmd_copy;
- char *full_cmd;
- char *child_env[7];
+ gint ret, i = 0;
+ gchar *buf;
+ gchar *cmd_copy;
+ gchar *full_cmd;
+ gchar *child_env[7];
/* Put full details in the environment, in case the connection
program needs them */
@@ -808,10 +808,10 @@ connect_to_server_process (CamelService *service, const char *cmd, CamelExceptio
full_cmd = g_strdup("");
for(;;) {
- char *pc;
- char *tmp;
- char *var;
- int len;
+ gchar *pc;
+ gchar *tmp;
+ gchar *var;
+ gint len;
pc = strchr(buf, '%');
ignore:
@@ -851,7 +851,7 @@ connect_to_server_process (CamelService *service, const char *cmd, CamelExceptio
cmd_stream = camel_stream_process_new ();
ret = camel_stream_process_connect (CAMEL_STREAM_PROCESS(cmd_stream),
- full_cmd, (const char **)child_env);
+ full_cmd, (const gchar **)child_env);
while (i)
g_free(child_env[--i]);
@@ -921,10 +921,10 @@ connect_to_server_process (CamelService *service, const char *cmd, CamelExceptio
#endif
static struct {
- char *value;
- char *serv;
- char *port;
- int mode;
+ gchar *value;
+ gchar *serv;
+ gchar *port;
+ gint mode;
} ssl_options[] = {
{ "", "imaps", IMAPS_PORT, MODE_SSL }, /* really old (1.x) */
{ "always", "imaps", IMAPS_PORT, MODE_SSL },
@@ -936,14 +936,14 @@ static struct {
static gboolean
connect_to_server_wrapper (CamelService *service, CamelException *ex)
{
- const char *ssl_mode;
+ const gchar *ssl_mode;
struct addrinfo hints, *ai;
- int mode, ret, i;
- char *serv;
- const char *port;
+ gint mode, ret, i;
+ gchar *serv;
+ const gchar *port;
#ifndef G_OS_WIN32
- const char *command;
+ const gchar *command;
if (camel_url_get_param(service->url, "use_command")
&& (command = camel_url_get_param(service->url, "command")))
@@ -1028,10 +1028,10 @@ query_auth_types (CamelService *service, CamelException *ex)
/* folder_name is path name */
static CamelFolderInfo *
-imap_build_folder_info(CamelImapStore *imap_store, const char *folder_name)
+imap_build_folder_info(CamelImapStore *imap_store, const gchar *folder_name)
{
CamelURL *url;
- const char *name;
+ const gchar *name;
CamelFolderInfo *fi;
fi = camel_folder_info_new ();
@@ -1067,7 +1067,7 @@ imap_build_folder_info(CamelImapStore *imap_store, const char *folder_name)
static void
imap_folder_effectively_unsubscribed(CamelImapStore *imap_store,
- const char *folder_name, CamelException *ex)
+ const gchar *folder_name, CamelException *ex)
{
CamelFolderInfo *fi;
CamelStoreInfo *si;
@@ -1096,13 +1096,13 @@ imap_folder_effectively_unsubscribed(CamelImapStore *imap_store,
}
static void
-imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelException *ex)
+imap_forget_folder (CamelImapStore *imap_store, const gchar *folder_name, CamelException *ex)
{
- char *state_file;
- char *journal_file;
- char *folder_dir, *storage_path;
+ gchar *state_file;
+ gchar *journal_file;
+ gchar *folder_dir, *storage_path;
CamelFolderInfo *fi;
- const char *name;
+ const gchar *name;
name = strrchr (folder_name, imap_store->dir_sep);
if (name)
@@ -1148,7 +1148,7 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
}
static gboolean
-imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_name,
+imap_check_folder_still_extant (CamelImapStore *imap_store, const gchar *full_name,
CamelException *ex)
{
CamelImapResponse *response;
@@ -1182,7 +1182,7 @@ static void
imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
{
GPtrArray *folders;
- int i;
+ gint i;
folders = camel_object_bag_list(CAMEL_STORE (store)->folders);
@@ -1220,12 +1220,12 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
#endif
static gboolean
-try_auth (CamelImapStore *store, const char *mech, CamelException *ex)
+try_auth (CamelImapStore *store, const gchar *mech, CamelException *ex)
{
CamelSasl *sasl;
CamelImapResponse *response;
- char *resp;
- char *sasl_resp;
+ gchar *resp;
+ gchar *sasl_resp;
response = camel_imap_command (store, NULL, ex, "AUTHENTICATE %s", mech);
if (!response)
@@ -1285,9 +1285,9 @@ imap_auth_loop (CamelService *service, CamelException *ex)
CamelSession *session = camel_service_get_session (service);
CamelServiceAuthType *authtype = NULL;
CamelImapResponse *response;
- char *errbuf = NULL;
+ gchar *errbuf = NULL;
gboolean authenticated = FALSE;
- const char *auth_domain;
+ const gchar *auth_domain;
auth_domain = camel_url_get_param (service->url, "auth-domain");
@@ -1332,8 +1332,8 @@ imap_auth_loop (CamelService *service, CamelException *ex)
}
if (!service->url->passwd) {
- char *base_prompt;
- char *full_prompt;
+ gchar *base_prompt;
+ gchar *full_prompt;
base_prompt = camel_session_build_password_prompt (
"IMAP", service->url->user, service->url->host);
@@ -1400,7 +1400,7 @@ imap_connect (CamelService *service, CamelException *ex)
CamelImapStore *store = CAMEL_IMAP_STORE (service);
CamelImapResponse *response;
/*struct _namespaces *namespaces;*/
- char *result, *name;
+ gchar *result, *name;
size_t len;
CamelImapStoreNamespace *ns;
@@ -1435,12 +1435,12 @@ imap_connect (CamelService *service, CamelException *ex)
name = camel_strstrcase (result, "NAMESPACE ((");
if (name) {
- char *sep;
+ gchar *sep;
name += 12;
- store->namespace = imap_parse_string ((const char **) &name, &len);
+ store->namespace = imap_parse_string ((const gchar **) &name, &len);
if (name && *name++ == ' ') {
- sep = imap_parse_string ((const char **) &name, &len);
+ sep = imap_parse_string ((const gchar **) &name, &len);
if (sep) {
store->dir_sep = *sep;
g_free (sep);
@@ -1500,7 +1500,7 @@ imap_connect (CamelService *service, CamelException *ex)
if ((store->parameters & IMAP_PARAM_SUBSCRIPTIONS)
&& camel_store_summary_count((CamelStoreSummary *)store->summary) == 0) {
CamelStoreInfo *si;
- char *pattern;
+ gchar *pattern;
get_folders_sync(store, store->namespace, ex);
if (camel_exception_is_set(ex))
@@ -1590,8 +1590,8 @@ static gboolean
imap_summary_is_dirty (CamelFolderSummary *summary)
{
CamelImapMessageInfo *info;
- int max, i;
- int found = FALSE;
+ gint max, i;
+ gint found = FALSE;
max = camel_folder_summary_count (summary);
for (i = 0; i < max && !found; i++) {
@@ -1636,7 +1636,7 @@ imap_get_trash(CamelStore *store, CamelException *ex)
CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_trash(store, ex);
if (folder) {
- char *state = g_build_filename(((CamelImapStore *)store)->storage_path, "system", "Trash.cmeta", NULL);
+ gchar *state = g_build_filename(((CamelImapStore *)store)->storage_path, "system", "Trash.cmeta", NULL);
camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
g_free(state);
@@ -1653,7 +1653,7 @@ imap_get_junk(CamelStore *store, CamelException *ex)
CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_junk(store, ex);
if (folder) {
- char *state = g_build_filename(((CamelImapStore *)store)->storage_path, "system", "Junk.cmeta", NULL);
+ gchar *state = g_build_filename(((CamelImapStore *)store)->storage_path, "system", "Junk.cmeta", NULL);
camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
g_free(state);
@@ -1687,7 +1687,7 @@ compare_folder_name (gconstpointer a, gconstpointer b)
struct imap_status_item {
struct imap_status_item *next;
- char *name;
+ gchar *name;
guint32 value;
};
@@ -1705,11 +1705,11 @@ imap_status_item_free (struct imap_status_item *items)
}
static struct imap_status_item *
-get_folder_status (CamelImapStore *imap_store, const char *folder_name, const char *type)
+get_folder_status (CamelImapStore *imap_store, const gchar *folder_name, const gchar *type)
{
struct imap_status_item *items, *item, *tail;
CamelImapResponse *response;
- char *status, *name, *p;
+ gchar *status, *name, *p;
/* FIXME: we assume the server is STATUS-capable */
@@ -1795,12 +1795,12 @@ get_folder_status (CamelImapStore *imap_store, const char *folder_name, const ch
}
static CamelFolder *
-get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
CamelImapResponse *response;
CamelFolder *new_folder;
- char *folder_dir, *storage_path;
+ gchar *folder_dir, *storage_path;
/* Try to get it locally first, if it is, then the client will
force a select when necessary */
@@ -1833,8 +1833,8 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
response = camel_imap_command (imap_store, NULL, ex, "SELECT %F", folder_name);
if (!response) {
- char *folder_real, *parent_name, *parent_real;
- const char *c;
+ gchar *folder_real, *parent_name, *parent_real;
+ const gchar *c;
if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_USER_CANCEL) {
CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
@@ -1872,9 +1872,9 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
if (parent_real != NULL) {
gboolean need_convert = FALSE;
- char *resp, *thisone;
+ gchar *resp, *thisone;
guint32 flags;
- int i;
+ gint i;
if (!(response = camel_imap_command (imap_store, NULL, ex, "LIST \"\" %G", parent_real))) {
CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
@@ -1905,7 +1905,7 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
struct imap_status_item *items, *item;
guint32 messages = 0;
CamelException lex;
- char *name;
+ gchar *name;
item = items = get_folder_status (imap_store, parent_name, "MESSAGES");
while (item != NULL) {
@@ -2014,7 +2014,7 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
}
static CamelFolder *
-get_folder_offline (CamelStore *store, const char *folder_name,
+get_folder_offline (CamelStore *store, const gchar *folder_name,
guint32 flags, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
@@ -2023,7 +2023,7 @@ get_folder_offline (CamelStore *store, const char *folder_name,
si = camel_store_summary_path((CamelStoreSummary *)imap_store->summary, folder_name);
if (si) {
- char *folder_dir, *storage_path;
+ gchar *folder_dir, *storage_path;
/* Note: Although the INBOX is defined to be case-insensitive in the IMAP RFC
* it is still up to the server how to acutally name it in a LIST response. Since
@@ -2051,7 +2051,7 @@ get_folder_offline (CamelStore *store, const char *folder_name,
}
static void
-delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
CamelImapResponse *response;
@@ -2082,13 +2082,13 @@ fail:
}
static void
-manage_subscriptions (CamelStore *store, const char *old_name, gboolean subscribe)
+manage_subscriptions (CamelStore *store, const gchar *old_name, gboolean subscribe)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
CamelStoreInfo *si;
- int olen = strlen(old_name);
- const char *path;
- int i, count;
+ gint olen = strlen(old_name);
+ const gchar *path;
+ gint i, count;
count = camel_store_summary_count((CamelStoreSummary *)imap_store->summary);
for (i=0;i<count;i++) {
@@ -2107,13 +2107,13 @@ manage_subscriptions (CamelStore *store, const char *old_name, gboolean subscrib
}
static void
-rename_folder_info (CamelImapStore *imap_store, const char *old_name, const char *new_name)
+rename_folder_info (CamelImapStore *imap_store, const gchar *old_name, const gchar *new_name)
{
- int i, count;
+ gint i, count;
CamelStoreInfo *si;
- int olen = strlen(old_name);
- const char *path;
- char *npath, *nfull;
+ gint olen = strlen(old_name);
+ const gchar *path;
+ gchar *npath, *nfull;
count = camel_store_summary_count((CamelStoreSummary *)imap_store->summary);
for (i=0;i<count;i++) {
@@ -2150,11 +2150,11 @@ rename_folder_info (CamelImapStore *imap_store, const char *old_name, const char
}
static void
-rename_folder (CamelStore *store, const char *old_name, const char *new_name_in, CamelException *ex)
+rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name_in, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
CamelImapResponse *response;
- char *oldpath, *newpath, *storage_path;
+ gchar *oldpath, *newpath, *storage_path;
CAMEL_SERVICE_REC_LOCK (imap_store, connect_lock);
@@ -2212,17 +2212,17 @@ fail:
}
static CamelFolderInfo *
-create_folder (CamelStore *store, const char *parent_name,
- const char *folder_name, CamelException *ex)
+create_folder (CamelStore *store, const gchar *parent_name,
+ const gchar *folder_name, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- char *full_name, *resp, *thisone, *parent_real, *real_name;
+ gchar *full_name, *resp, *thisone, *parent_real, *real_name;
CamelImapResponse *response;
CamelException internal_ex;
CamelFolderInfo *root = NULL;
gboolean need_convert;
- int i = 0, flags;
- const char *c;
+ gint i = 0, flags;
+ const gchar *c;
if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
@@ -2285,7 +2285,7 @@ create_folder (CamelStore *store, const char *parent_name,
if (need_convert) {
struct imap_status_item *items, *item;
guint32 messages = 0;
- char *name;
+ gchar *name;
item = items = get_folder_status (imap_store, parent_name, "MESSAGES");
while (item != NULL) {
@@ -2366,11 +2366,11 @@ create_folder (CamelStore *store, const char *parent_name,
static CamelFolderInfo *
parse_list_response_as_folder_info (CamelImapStore *imap_store,
- const char *response)
+ const gchar *response)
{
CamelFolderInfo *fi;
- int flags;
- char sep, *dir, *path;
+ gint flags;
+ gchar sep, *dir, *path;
CamelURL *url;
CamelImapStoreInfo *si;
guint32 newflags;
@@ -2424,9 +2424,9 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store,
return fi;
}
-static int imap_match_pattern(char dir_sep, const char *pattern, const char *name)
+static gint imap_match_pattern(gchar dir_sep, const gchar *pattern, const gchar *name)
{
- char p, n;
+ gchar p, n;
p = *pattern++;
n = *name++;
@@ -2451,9 +2451,9 @@ static int imap_match_pattern(char dir_sep, const char *pattern, const char *nam
/* imap needs to treat inbox case insensitive */
/* we'll assume the names are normalised already */
-static guint folder_hash(const void *ap)
+static guint folder_hash(gconstpointer ap)
{
- const char *a = ap;
+ const gchar *a = ap;
if (g_ascii_strcasecmp(a, "INBOX") == 0)
a = "INBOX";
@@ -2461,10 +2461,10 @@ static guint folder_hash(const void *ap)
return g_str_hash(a);
}
-static int folder_eq(const void *ap, const void *bp)
+static gint folder_eq(gconstpointer ap, gconstpointer bp)
{
- const char *a = ap;
- const char *b = bp;
+ const gchar *a = ap;
+ const gchar *b = bp;
if (g_ascii_strcasecmp(a, "INBOX") == 0)
a = "INBOX";
@@ -2475,18 +2475,18 @@ static int folder_eq(const void *ap, const void *bp)
}
static void
-get_folders_free(void *k, void *v, void *d)
+get_folders_free(gpointer k, gpointer v, gpointer d)
{
camel_folder_info_free(v);
}
static void
-get_folders_sync(CamelImapStore *imap_store, const char *pattern, CamelException *ex)
+get_folders_sync(CamelImapStore *imap_store, const gchar *pattern, CamelException *ex)
{
CamelImapResponse *response;
CamelFolderInfo *fi, *hfi;
- char *list;
- int i, count, j;
+ gchar *list;
+ gint i, count, j;
GHashTable *present;
CamelStoreInfo *si;
@@ -2543,7 +2543,7 @@ get_folders_sync(CamelImapStore *imap_store, const char *pattern, CamelException
camel_object_trigger_event (CAMEL_OBJECT (imap_store), "folder_subscribed", fi);
}
} else {
- char *dup_folder_name = g_strdup (camel_store_info_path (imap_store->summary, si));
+ gchar *dup_folder_name = g_strdup (camel_store_info_path (imap_store->summary, si));
if (dup_folder_name) {
CamelException eex;
@@ -2572,7 +2572,7 @@ fail:
static void
dumpfi(CamelFolderInfo *fi)
{
- int depth;
+ gint depth;
CamelFolderInfo *n = fi;
if (fi == NULL)
@@ -2635,7 +2635,7 @@ refresh_refresh(CamelSession *session, CamelSessionThreadMsg *msg)
goto done;
if (store->namespace && store->namespace[0]) {
- char *pattern;
+ gchar *pattern;
get_folders_sync(store, "INBOX", &m->ex);
if (camel_exception_is_set(&m->ex))
@@ -2669,7 +2669,7 @@ static CamelSessionThreadOps refresh_ops = {
};
static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
CamelFolderInfo *tree = NULL;
@@ -2692,7 +2692,7 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti
if ((flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)
&& camel_store_summary_count((CamelStoreSummary *)imap_store->summary) > 0) {
time_t now;
- int ref;
+ gint ref;
now = time(NULL);
ref = now > imap_store->refresh_stamp+60*60*1;
@@ -2713,8 +2713,8 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti
CAMEL_SERVICE_REC_UNLOCK(store, connect_lock);
}
} else {
- char *pattern;
- int i;
+ gchar *pattern;
+ gint i;
CAMEL_SERVICE_REC_LOCK(store, connect_lock);
@@ -2740,7 +2740,7 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti
i=0;
}
} else {
- char *name;
+ gchar *name;
name = camel_imap_store_summary_full_from_path(imap_store->summary, top);
if (name == NULL)
@@ -2774,15 +2774,15 @@ fail:
}
static CamelFolderInfo *
-get_folder_info_offline (CamelStore *store, const char *top,
+get_folder_info_offline (CamelStore *store, const gchar *top,
guint32 flags, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
gboolean include_inbox = FALSE;
CamelFolderInfo *fi;
GPtrArray *folders;
- char *pattern, *name;
- int i;
+ gchar *pattern, *name;
+ gint i;
if (camel_debug("imap:folder_info"))
printf("get folder info offline\n");
@@ -2869,11 +2869,11 @@ get_folder_info_offline (CamelStore *store, const char *top,
}
static gboolean
-folder_subscribed (CamelStore *store, const char *folder_name)
+folder_subscribed (CamelStore *store, const gchar *folder_name)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
CamelStoreInfo *si;
- int truth = FALSE;
+ gint truth = FALSE;
si = camel_store_summary_path((CamelStoreSummary *)imap_store->summary, folder_name);
if (si) {
@@ -2886,7 +2886,7 @@ folder_subscribed (CamelStore *store, const char *folder_name)
/* Note: folder_name must match a folder as listed with get_folder_info() -> full_name */
static void
-subscribe_folder (CamelStore *store, const char *folder_name,
+subscribe_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
@@ -2932,7 +2932,7 @@ done:
}
static void
-unsubscribe_folder (CamelStore *store, const char *folder_name,
+unsubscribe_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
@@ -2959,7 +2959,7 @@ static gboolean
folder_flags_have_changed (CamelFolder *folder)
{
CamelMessageInfo *info;
- int i, max;
+ gint i, max;
max = camel_folder_summary_count (folder->summary);
for (i = 0; i < max; i++) {
@@ -3001,10 +3001,10 @@ camel_imap_store_connected (CamelImapStore *store, CamelException *ex)
ssize_t
-camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *ex)
+camel_imap_store_readline (CamelImapStore *store, gchar **dest, CamelException *ex)
{
CamelStreamBuffer *stream;
- char linebuf[1024] = {0};
+ gchar linebuf[1024] = {0};
GByteArray *ba;
ssize_t nread;
diff --git a/camel/providers/imap/camel-imap-store.h b/camel/providers/imap/camel-imap-store.h
index 757b17f2b..27bd0564c 100644
--- a/camel/providers/imap/camel-imap-store.h
+++ b/camel/providers/imap/camel-imap-store.h
@@ -132,7 +132,7 @@ struct _CamelImapStore {
/* broken server - wont let us append with custom flags even if the folder allows them */
guint nocustomappend:1;
- char tag_prefix;
+ gchar tag_prefix;
guint32 command;
CamelFolder *current_folder;
@@ -140,13 +140,13 @@ struct _CamelImapStore {
CamelImapServerLevel server_level;
guint32 capabilities, parameters;
/* NB: namespace should be handled by summary->namespace */
- char *namespace, dir_sep, *base_url, *storage_path;
+ gchar *namespace, dir_sep, *base_url, *storage_path;
GHashTable *authtypes;
time_t refresh_stamp;
guint32 headers;
- char *custom_headers;
+ gchar *custom_headers;
};
typedef struct {
@@ -161,7 +161,7 @@ CamelType camel_imap_store_get_type (void);
gboolean camel_imap_store_connected (CamelImapStore *store, CamelException *ex);
-ssize_t camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *ex);
+ssize_t camel_imap_store_readline (CamelImapStore *store, gchar **dest, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
index c4c5b2ece..f1dbd6523 100644
--- a/camel/providers/imap/camel-imap-summary.c
+++ b/camel/providers/imap/camel-imap-summary.c
@@ -45,22 +45,22 @@
#define EXTRACT_FIRST_DIGIT(val) val=strtoul (part, &part, 10);
#define EXTRACT_DIGIT(val) if (*part) part++; val=strtoul (part, &part, 10);
-static int summary_header_load (CamelFolderSummary *, FILE *);
-static int summary_header_save (CamelFolderSummary *, FILE *);
+static gint summary_header_load (CamelFolderSummary *, FILE *);
+static gint summary_header_save (CamelFolderSummary *, FILE *);
static CamelMessageInfo *message_info_load (CamelFolderSummary *s, FILE *in);
-static int message_info_save (CamelFolderSummary *s, FILE *out,
+static gint message_info_save (CamelFolderSummary *s, FILE *out,
CamelMessageInfo *info);
-static gboolean info_set_user_flag (CamelMessageInfo *info, const char *id, gboolean state);
+static gboolean info_set_user_flag (CamelMessageInfo *info, const gchar *id, gboolean state);
static CamelMessageContentInfo *content_info_load (CamelFolderSummary *s, FILE *in);
-static int content_info_save (CamelFolderSummary *s, FILE *out,
+static gint content_info_save (CamelFolderSummary *s, FILE *out,
CamelMessageContentInfo *info);
-static int summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
+static gint summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
static CamelFIRecord * summary_header_to_db (CamelFolderSummary *s, CamelException *ex);
static CamelMIRecord * message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info);
static CamelMessageInfo * message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir);
-static int content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir);
+static gint content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir);
static CamelMessageContentInfo * content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir);
@@ -140,11 +140,11 @@ camel_imap_summary_init (CamelImapSummary *obj)
}
static int
-sort_uid_cmp (void *enc, int len1, void * data1, int len2, void *data2)
+sort_uid_cmp (gpointer enc, gint len1, gpointer data1, gint len2, gpointer data2)
{
- static char *sa1=NULL, *sa2=NULL;
- static int l1=0, l2=0;
- int a1, a2;
+ static gchar *sa1=NULL, *sa2=NULL;
+ static gint l1=0, l2=0;
+ gint a1, a2;
if (l1 < len1+1) {
sa1 = g_realloc (sa1, len1+1);
@@ -164,9 +164,9 @@ sort_uid_cmp (void *enc, int len1, void * data1, int len2, void *data2)
}
static int
-uid_compare (const void *va, const void *vb)
+uid_compare (gconstpointer va, gconstpointer vb)
{
- const char **sa = (const char **)va, **sb = (const char **)vb;
+ const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
unsigned long a, b;
a = strtoul (*sa, NULL, 10);
@@ -190,7 +190,7 @@ uid_compare (const void *va, const void *vb)
* Return value: A new CamelImapSummary object.
**/
CamelFolderSummary *
-camel_imap_summary_new (struct _CamelFolder *folder, const char *filename)
+camel_imap_summary_new (struct _CamelFolder *folder, const gchar *filename)
{
CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (camel_object_new (camel_imap_summary_get_type ()));
CamelException ex;
@@ -225,7 +225,7 @@ static int
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
{
CamelImapSummary *ims = CAMEL_IMAP_SUMMARY (s);
- char *part;
+ gchar *part;
if (camel_imap_summary_parent->summary_header_from_db (s, mir) == -1)
return -1;
@@ -267,7 +267,7 @@ summary_header_load (CamelFolderSummary *s, FILE *in)
if (ims->version == 2) {
/* Version 2: for compat with version 2 of the imap4 summary files */
- int have_mlist;
+ gint have_mlist;
if (camel_file_util_decode_fixed_int32 (in, &have_mlist) == -1)
return -1;
@@ -320,7 +320,7 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
info = camel_imap_summary_parent->message_info_from_db (s, mir);
if (info) {
- char *part = g_strdup (mir->bdata), *tmp;
+ gchar *part = g_strdup (mir->bdata), *tmp;
tmp = part;
iinfo = (CamelImapMessageInfo *)info;
EXTRACT_FIRST_DIGIT (iinfo->server_flags)
@@ -375,7 +375,7 @@ message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
}
static gboolean
-info_set_user_flag (CamelMessageInfo *info, const char *id, gboolean state)
+info_set_user_flag (CamelMessageInfo *info, const gchar *id, gboolean state)
{
gboolean res;
@@ -391,7 +391,7 @@ info_set_user_flag (CamelMessageInfo *info, const char *id, gboolean state)
static CamelMessageContentInfo *
content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
{
- char *part = mir->cinfo;
+ gchar *part = mir->cinfo;
guint32 type=0;
if (part) {
@@ -420,7 +420,7 @@ content_info_load (CamelFolderSummary *s, FILE *in)
static int
content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir)
{
- char *oldr;
+ gchar *oldr;
if (info->type) {
oldr = mir->cinfo;
mir->cinfo = oldr ? g_strdup_printf("%s 1", oldr) : g_strdup ("1");
@@ -446,7 +446,7 @@ content_info_save (CamelFolderSummary *s, FILE *out,
}
void
-camel_imap_summary_add_offline (CamelFolderSummary *summary, const char *uid,
+camel_imap_summary_add_offline (CamelFolderSummary *summary, const gchar *uid,
CamelMimeMessage *message,
const CamelMessageInfo *info)
{
@@ -478,7 +478,7 @@ camel_imap_summary_add_offline (CamelFolderSummary *summary, const char *uid,
}
void
-camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary, const char *uid,
+camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary, const gchar *uid,
const CamelMessageInfo *info)
{
CamelImapMessageInfo *mi;
diff --git a/camel/providers/imap/camel-imap-summary.h b/camel/providers/imap/camel-imap-summary.h
index 5e36f3b78..414543547 100644
--- a/camel/providers/imap/camel-imap-summary.h
+++ b/camel/providers/imap/camel-imap-summary.h
@@ -69,15 +69,15 @@ struct _CamelImapSummaryClass {
};
CamelType camel_imap_summary_get_type (void);
-CamelFolderSummary *camel_imap_summary_new (struct _CamelFolder *folder, const char *filename);
+CamelFolderSummary *camel_imap_summary_new (struct _CamelFolder *folder, const gchar *filename);
void camel_imap_summary_add_offline (CamelFolderSummary *summary,
- const char *uid,
+ const gchar *uid,
CamelMimeMessage *message,
const CamelMessageInfo *info);
void camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary,
- const char *uid,
+ const gchar *uid,
const CamelMessageInfo *info);
G_END_DECLS
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
index 175e11ee5..9eb6dcaa3 100644
--- a/camel/providers/imap/camel-imap-utils.c
+++ b/camel/providers/imap/camel-imap-utils.c
@@ -50,10 +50,10 @@
#define SUBFOLDER_DIR_NAME "subfolders"
#define SUBFOLDER_DIR_NAME_LEN 10
-const char *
-imap_next_word (const char *buf)
+const gchar *
+imap_next_word (const gchar *buf)
{
- const char *word;
+ const gchar *word;
/* skip over current word */
word = buf;
@@ -94,11 +94,11 @@ imap_namespaces_destroy (struct _namespaces *namespaces)
}
static gboolean
-imap_namespace_decode (const char **in, struct _namespace **namespace)
+imap_namespace_decode (const gchar **in, struct _namespace **namespace)
{
struct _namespace *list, *tail, *node;
- const char *inptr;
- char *astring;
+ const gchar *inptr;
+ gchar *astring;
size_t len;
inptr = *in;
@@ -125,7 +125,7 @@ imap_namespace_decode (const char **in, struct _namespace **namespace)
}
/* decode IMAP's modified UTF-7 into UTF-8 */
- node->prefix = imap_mailbox_decode ((const unsigned char *) astring, len);
+ node->prefix = imap_mailbox_decode ((const guchar *) astring, len);
g_free (astring);
if (!node->prefix) {
g_free (node);
@@ -242,10 +242,10 @@ namespaces_dump (struct _namespaces *namespaces)
#endif
struct _namespaces *
-imap_parse_namespace_response (const char *response)
+imap_parse_namespace_response (const gchar *response)
{
struct _namespaces *namespaces;
- const char *inptr;
+ const gchar *inptr;
d(printf ("parsing: %s\n", response));
@@ -309,10 +309,10 @@ imap_parse_namespace_response (const char *response)
* Return value: whether or not the response was successfully parsed.
**/
gboolean
-imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, char *sep, char **folder)
+imap_parse_list_response (CamelImapStore *store, const gchar *buf, gint *flags, gchar *sep, gchar **folder)
{
gboolean is_lsub = FALSE;
- const char *word;
+ const gchar *word;
size_t len;
if (*buf != '*')
@@ -374,8 +374,8 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
return FALSE;
if (folder) {
- char *astring;
- char *mailbox;
+ gchar *astring;
+ gchar *mailbox;
/* get the folder name */
word = imap_next_word (word);
@@ -385,7 +385,7 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
*folder = astring;
- mailbox = imap_mailbox_decode ((const unsigned char *) astring, strlen (astring));
+ mailbox = imap_mailbox_decode ((const guchar *) astring, strlen (astring));
g_free (astring);
if (!mailbox)
return FALSE;
@@ -424,12 +424,12 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
* Results in:
* Full, Full/Path, Full/Path/"to / from", Full/Path/"to / from"/Folder
**/
-char **
-imap_parse_folder_name (CamelImapStore *store, const char *folder_name)
+gchar **
+imap_parse_folder_name (CamelImapStore *store, const gchar *folder_name)
{
GPtrArray *heirarchy;
- char **paths;
- const char *p;
+ gchar **paths;
+ const gchar *p;
p = folder_name;
if (*p == store->dir_sep)
@@ -456,7 +456,7 @@ imap_parse_folder_name (CamelImapStore *store, const char *folder_name)
g_ptr_array_add (heirarchy, g_strdup (folder_name));
g_ptr_array_add (heirarchy, NULL);
- paths = (char **) heirarchy->pdata;
+ paths = (gchar **) heirarchy->pdata;
g_ptr_array_free (heirarchy, FALSE);
return paths;
@@ -471,11 +471,11 @@ imap_parse_folder_name (CamelImapStore *store, const char *folder_name)
* @param len Length of the flag name.
* @param server_to_evo if TRUE, then converting server names to evo's names, if FALSE then opposite.
*/
-static const char *
-rename_label_flag (const char *flag, int len, gboolean server_to_evo)
+static const gchar *
+rename_label_flag (const gchar *flag, gint len, gboolean server_to_evo)
{
- int i;
- const char *labels[] = {
+ gint i;
+ const gchar *labels[] = {
"$Label1", "$Labelimportant",
"$Label2", "$Labelwork",
"$Label3", "$Labelpersonal",
@@ -496,7 +496,7 @@ rename_label_flag (const char *flag, int len, gboolean server_to_evo)
return "";
}
-char *
+gchar *
imap_create_flag_list (guint32 flags, CamelMessageInfo *info, guint32 permanent_flags)
{
GString *gstr = g_string_new ("(");
@@ -519,7 +519,7 @@ imap_create_flag_list (guint32 flags, CamelMessageInfo *info, guint32 permanent_
/* send user flags to the server only when it supports it, otherwise store it locally only */
if (info && (permanent_flags & CAMEL_MESSAGE_USER) != 0) {
const CamelFlag *flag;
- const char *name;
+ const gchar *name;
/* FIXME: All the custom flags are sent to the server. Not just the changed ones */
flag = camel_message_info_user_flags(info);
@@ -548,13 +548,13 @@ imap_create_flag_list (guint32 flags, CamelMessageInfo *info, guint32 permanent_
}
gboolean
-imap_parse_flag_list (char **flag_list_p, guint32 *flags_out, char **custom_flags_out)
+imap_parse_flag_list (gchar **flag_list_p, guint32 *flags_out, gchar **custom_flags_out)
{
- char *flag_list = *flag_list_p;
+ gchar *flag_list = *flag_list_p;
guint32 flags = 0;
- int len;
+ gint len;
GString *custom_flags = NULL;
- char *iter;
+ gchar *iter;
*flags_out = 0;
@@ -655,7 +655,7 @@ quoted_specials ::= <"> / "\"
resp_specials ::= "]"
*/
-static unsigned char imap_atom_specials[256] = {
+static guchar imap_atom_specials[256] = {
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 00 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 10 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -678,10 +678,10 @@ static unsigned char imap_atom_specials[256] = {
#define imap_is_atom_char(c) ((imap_atom_specials[(c)&0xff] & 0x01) != 0)
gboolean
-imap_is_atom(const char *in)
+imap_is_atom(const gchar *in)
{
- register unsigned char c;
- register const char *p = in;
+ register guchar c;
+ register const gchar *p = in;
while ((c = (unsigned char)*p)) {
if (!imap_is_atom_char(c))
@@ -714,16 +714,16 @@ imap_is_atom(const char *in)
* was parsed. (In the former case, *@str_p will be %NULL; in the
* latter, it will point to the character after the NIL.)
**/
-char *
-imap_parse_string_generic (const char **str_p, size_t *len, int type)
+gchar *
+imap_parse_string_generic (const gchar **str_p, size_t *len, gint type)
{
- const char *str = *str_p;
- char *out;
+ const gchar *str = *str_p;
+ gchar *out;
if (!str)
return NULL;
else if (*str == '"') {
- char *p;
+ gchar *p;
size_t size;
str++;
@@ -751,7 +751,7 @@ imap_parse_string_generic (const char **str_p, size_t *len, int type)
*len = strlen (out);
return out;
} else if (*str == '{') {
- *len = strtoul (str + 1, (char **)&str, 10);
+ *len = strtoul (str + 1, (gchar **)&str, 10);
if (*str++ != '}' || *str++ != '\n' || strlen (str) < *len) {
*str_p = NULL;
return NULL;
@@ -779,7 +779,7 @@ imap_parse_string_generic (const char **str_p, size_t *len, int type)
}
static inline void
-skip_char (const char **in, char ch)
+skip_char (const gchar **in, gchar ch)
{
if (*in && **in == ch)
*in = *in + 1;
@@ -789,9 +789,9 @@ skip_char (const char **in, char ch)
/* Skip atom, string, or number */
static void
-skip_asn (const char **str_p)
+skip_asn (const gchar **str_p)
{
- const char *str = *str_p;
+ const gchar *str = *str_p;
if (!str)
return;
@@ -810,7 +810,7 @@ skip_asn (const char **str_p)
} else if (*str == '{') {
unsigned long len;
- len = strtoul (str + 1, (char **) &str, 10);
+ len = strtoul (str + 1, (gchar **) &str, 10);
if (*str != '}' || *(str + 1) != '\n' ||
strlen (str + 2) < len) {
*str_p = NULL;
@@ -828,7 +828,7 @@ skip_asn (const char **str_p)
}
void
-imap_skip_list (const char **str_p)
+imap_skip_list (const gchar **str_p)
{
skip_char (str_p, '(');
while (*str_p && **str_p != ')') {
@@ -843,10 +843,10 @@ imap_skip_list (const char **str_p)
}
static int
-parse_params (const char **parms_p, CamelContentType *type)
+parse_params (const gchar **parms_p, CamelContentType *type)
{
- const char *parms = *parms_p;
- char *name, *value;
+ const gchar *parms = *parms_p;
+ gchar *name, *value;
size_t len;
if (!g_ascii_strncasecmp (parms, "nil", 3)) {
@@ -881,17 +881,17 @@ parse_params (const char **parms_p, CamelContentType *type)
static CamelMessageContentInfo *
-imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *folder, GPtrArray *cis)
+imap_body_decode (const gchar **in, CamelMessageContentInfo *ci, CamelFolder *folder, GPtrArray *cis)
{
- const char *inptr = *in;
+ const gchar *inptr = *in;
CamelMessageContentInfo *child = NULL;
- char *type, *subtype, *id = NULL;
+ gchar *type, *subtype, *id = NULL;
CamelContentType *ctype = NULL;
- char *description = NULL;
- char *encoding = NULL;
+ gchar *description = NULL;
+ gchar *encoding = NULL;
size_t len;
size_t size;
- char *p;
+ gchar *p;
if (*inptr++ != '(')
return NULL;
@@ -1015,7 +1015,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
goto exception;
/* size */
- size = strtoul ((const char *) inptr, &p, 10);
+ size = strtoul ((const gchar *) inptr, &p, 10);
/* check if the size wasn't negative */
if (p) {
@@ -1029,7 +1029,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
if (size == 0)
goto exception;
- inptr = (const unsigned char *) p;
+ inptr = (const guchar *) p;
if (camel_content_type_is (ctype, "message", "rfc822")) {
/* body_type_msg */
@@ -1051,15 +1051,15 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
goto exception;
/* lines */
- strtoul ((const char *) inptr, &p, 10);
- inptr = (const unsigned char *) p;
+ strtoul ((const gchar *) inptr, &p, 10);
+ inptr = (const guchar *) p;
} else if (camel_content_type_is (ctype, "text", "*")) {
if (!inptr || *inptr++ != ' ')
goto exception;
/* lines */
- strtoul ((const char *) inptr, &p, 10);
- inptr = (const unsigned char *) p;
+ strtoul ((const gchar *) inptr, &p, 10);
+ inptr = (const guchar *) p;
} else {
/* body_type_basic */
}
@@ -1101,13 +1101,13 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
* set to %NULL and @ci will be unchanged.
**/
void
-imap_parse_body (const char **body_p, CamelFolder *folder,
+imap_parse_body (const gchar **body_p, CamelFolder *folder,
CamelMessageContentInfo *ci)
{
- const char *inptr = *body_p;
+ const gchar *inptr = *body_p;
CamelMessageContentInfo *child;
GPtrArray *children;
- int i;
+ gint i;
if (!inptr || *inptr != '(') {
*body_p = NULL;
@@ -1144,12 +1144,12 @@ imap_parse_body (const char **body_p, CamelFolder *folder,
* Return value: an IMAP "quoted" corresponding to the string, which
* the caller must free.
**/
-char *
-imap_quote_string (const char *str)
+gchar *
+imap_quote_string (const gchar *str)
{
- const char *p;
- char *quoted, *q;
- int len;
+ const gchar *p;
+ gchar *quoted, *q;
+ gint len;
g_assert (strchr (str, '\r') == NULL);
@@ -1175,10 +1175,10 @@ imap_quote_string (const char *str)
static inline unsigned long
-get_summary_uid_numeric (CamelFolderSummary *summary, int index)
+get_summary_uid_numeric (CamelFolderSummary *summary, gint index)
{
unsigned long uid;
- char *suid;
+ gchar *suid;
suid = camel_folder_summary_uid_from_index (summary, index);
uid = strtoul (suid, NULL, 10);
@@ -1187,7 +1187,7 @@ get_summary_uid_numeric (CamelFolderSummary *summary, int index)
return uid;
}
-/* the max number of chars that an unsigned 32-bit int can be is 10 chars plus 1 for a possible : */
+/* the max number of chars that an unsigned 32-bit gint can be is 10 chars plus 1 for a possible : */
#define UID_SET_FULL(setlen, maxlen) (maxlen > 0 ? setlen + 11 >= maxlen : FALSE)
/**
@@ -1210,14 +1210,14 @@ get_summary_uid_numeric (CamelFolderSummary *summary, int index)
*
* Return value: the set, which the caller must free with g_free()
**/
-char *
-imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ssize_t maxlen, int *lastuid)
+gchar *
+imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, gint uid, ssize_t maxlen, gint *lastuid)
{
unsigned long last_uid, next_summary_uid, this_uid;
gboolean range = FALSE;
- int si, scount;
+ gint si, scount;
GString *gset;
- char *set;
+ gchar *set;
g_return_val_if_fail (uids->len > uid, NULL);
@@ -1278,17 +1278,17 @@ imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ss
* imap_uid_array_free(). (Or %NULL if the uid set can't be parsed.)
**/
GPtrArray *
-imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids)
+imap_uid_set_to_array (CamelFolderSummary *summary, const gchar *uids)
{
GPtrArray *arr;
- char *p, *q;
+ gchar *p, *q;
unsigned long uid, suid;
- int si, scount;
+ gint si, scount;
arr = g_ptr_array_new ();
scount = camel_folder_summary_count (summary);
- p = (char *)uids;
+ p = (gchar *)uids;
si = 0;
do {
uid = strtoul (p, &q, 10);
@@ -1343,15 +1343,15 @@ imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids)
void
imap_uid_array_free (GPtrArray *arr)
{
- int i;
+ gint i;
for (i = 0; i < arr->len; i++)
g_free (arr->pdata[i]);
g_ptr_array_free (arr, TRUE);
}
-char *
-imap_concat (CamelImapStore *imap_store, const char *prefix, const char *suffix)
+gchar *
+imap_concat (CamelImapStore *imap_store, const gchar *prefix, const gchar *suffix)
{
size_t len;
@@ -1362,10 +1362,10 @@ imap_concat (CamelImapStore *imap_store, const char *prefix, const char *suffix)
return g_strdup_printf ("%s%c%s", prefix, imap_store->dir_sep, suffix);
}
-char *
-imap_mailbox_encode (const unsigned char *in, size_t inlen)
+gchar *
+imap_mailbox_encode (const guchar *in, size_t inlen)
{
- char *buf;
+ gchar *buf;
buf = g_alloca (inlen + 1);
memcpy (buf, in, inlen);
@@ -1374,10 +1374,10 @@ imap_mailbox_encode (const unsigned char *in, size_t inlen)
return camel_utf8_utf7 (buf);
}
-char *
-imap_mailbox_decode (const unsigned char *in, size_t inlen)
+gchar *
+imap_mailbox_decode (const guchar *in, size_t inlen)
{
- char *buf;
+ gchar *buf;
buf = g_alloca (inlen + 1);
memcpy (buf, in, inlen);
@@ -1386,12 +1386,12 @@ imap_mailbox_decode (const unsigned char *in, size_t inlen)
return camel_utf7_utf8 (buf);
}
-char *
-imap_path_to_physical (const char *prefix, const char *vpath)
+gchar *
+imap_path_to_physical (const gchar *prefix, const gchar *vpath)
{
GString *out = g_string_new(prefix);
- const char *p = vpath;
- char c, *res;
+ const gchar *p = vpath;
+ gchar c, *res;
g_string_append_c(out, '/');
p = vpath;
@@ -1411,11 +1411,11 @@ imap_path_to_physical (const char *prefix, const char *vpath)
}
static gboolean
-find_folders_recursive (const char *physical_path, const char *path,
+find_folders_recursive (const gchar *physical_path, const gchar *path,
IMAPPathFindFoldersCallback callback, gpointer data)
{
GDir *dir;
- char *subfolder_directory_path;
+ gchar *subfolder_directory_path;
gboolean ok;
if (*path) {
@@ -1441,9 +1441,9 @@ find_folders_recursive (const char *physical_path, const char *path,
ok = TRUE;
while (ok) {
struct stat file_stat;
- const char *dirent;
- char *file_path;
- char *new_path;
+ const gchar *dirent;
+ gchar *file_path;
+ gchar *new_path;
dirent = g_dir_read_name (dir);
if (dirent == NULL)
@@ -1484,7 +1484,7 @@ find_folders_recursive (const char *physical_path, const char *path,
* Return value: %TRUE on success, %FALSE if an error occurs at any point
**/
gboolean
-imap_path_find_folders (const char *prefix, IMAPPathFindFoldersCallback callback, gpointer data)
+imap_path_find_folders (const gchar *prefix, IMAPPathFindFoldersCallback callback, gpointer data)
{
return find_folders_recursive (prefix, "", callback, data);
}
diff --git a/camel/providers/imap/camel-imap-utils.h b/camel/providers/imap/camel-imap-utils.h
index 0636e2832..8d7f15006 100644
--- a/camel/providers/imap/camel-imap-utils.h
+++ b/camel/providers/imap/camel-imap-utils.h
@@ -30,12 +30,12 @@
G_BEGIN_DECLS
-const char *imap_next_word (const char *buf);
+const gchar *imap_next_word (const gchar *buf);
struct _namespace {
struct _namespace *next;
- char *prefix;
- char delim;
+ gchar *prefix;
+ gchar delim;
};
struct _namespaces {
@@ -45,19 +45,19 @@ struct _namespaces {
};
void imap_namespaces_destroy (struct _namespaces *namespaces);
-struct _namespaces *imap_parse_namespace_response (const char *response);
+struct _namespaces *imap_parse_namespace_response (const gchar *response);
-gboolean imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags,
- char *sep, char **folder);
+gboolean imap_parse_list_response (CamelImapStore *store, const gchar *buf, gint *flags,
+ gchar *sep, gchar **folder);
-char **imap_parse_folder_name (CamelImapStore *store, const char *folder_name);
+gchar **imap_parse_folder_name (CamelImapStore *store, const gchar *folder_name);
-char *imap_create_flag_list (guint32 flags, CamelMessageInfo *info, guint32 permanent_flags);
-gboolean imap_parse_flag_list (char **flag_list_p, guint32 *flags_out, char **custom_flags_out);
+gchar *imap_create_flag_list (guint32 flags, CamelMessageInfo *info, guint32 permanent_flags);
+gboolean imap_parse_flag_list (gchar **flag_list_p, guint32 *flags_out, gchar **custom_flags_out);
enum { IMAP_STRING, IMAP_NSTRING, IMAP_ASTRING };
-char *imap_parse_string_generic (const char **str_p, size_t *len, int type);
+gchar *imap_parse_string_generic (const gchar **str_p, size_t *len, gint type);
#define imap_parse_string(str_p, len_p) \
imap_parse_string_generic (str_p, len_p, IMAP_STRING)
@@ -66,28 +66,28 @@ char *imap_parse_string_generic (const char **str_p, size_t *len, int type);
#define imap_parse_astring(str_p, len_p) \
imap_parse_string_generic (str_p, len_p, IMAP_ASTRING)
-void imap_parse_body (const char **body_p, CamelFolder *folder,
+void imap_parse_body (const gchar **body_p, CamelFolder *folder,
CamelMessageContentInfo *ci);
-gboolean imap_is_atom (const char *in);
-char *imap_quote_string (const char *str);
+gboolean imap_is_atom (const gchar *in);
+gchar *imap_quote_string (const gchar *str);
-void imap_skip_list (const char **str_p);
+void imap_skip_list (const gchar **str_p);
-char *imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ssize_t maxlen, int *lastuid);
-GPtrArray *imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids);
+gchar *imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, gint uid, ssize_t maxlen, gint *lastuid);
+GPtrArray *imap_uid_set_to_array (CamelFolderSummary *summary, const gchar *uids);
void imap_uid_array_free (GPtrArray *arr);
-char *imap_concat (CamelImapStore *imap_store, const char *prefix, const char *suffix);
-char *imap_namespace_concat (CamelImapStore *store, const char *name);
+gchar *imap_concat (CamelImapStore *imap_store, const gchar *prefix, const gchar *suffix);
+gchar *imap_namespace_concat (CamelImapStore *store, const gchar *name);
-char *imap_mailbox_encode (const unsigned char *in, size_t inlen);
-char *imap_mailbox_decode (const unsigned char *in, size_t inlen);
+gchar *imap_mailbox_encode (const guchar *in, size_t inlen);
+gchar *imap_mailbox_decode (const guchar *in, size_t inlen);
-typedef gboolean (*IMAPPathFindFoldersCallback) (const char *physical_path, const char *path, gpointer user_data);
+typedef gboolean (*IMAPPathFindFoldersCallback) (const gchar *physical_path, const gchar *path, gpointer user_data);
-char *imap_path_to_physical (const char *prefix, const char *vpath);
-gboolean imap_path_find_folders (const char *prefix, IMAPPathFindFoldersCallback callback, gpointer data);
+gchar *imap_path_to_physical (const gchar *prefix, const gchar *vpath);
+gboolean imap_path_find_folders (const gchar *prefix, IMAPPathFindFoldersCallback callback, gpointer data);
G_END_DECLS
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c
index a12ecc2d4..40f8cc58c 100644
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ b/camel/providers/imap/camel-imap-wrapper.c
@@ -165,7 +165,7 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
CamelDataWrapper *
camel_imap_wrapper_new (CamelImapFolder *imap_folder,
CamelContentType *type, CamelTransferEncoding encoding,
- const char *uid, const char *part_spec,
+ const gchar *uid, const gchar *part_spec,
CamelMimePart *part)
{
CamelImapWrapper *imap_wrapper;
diff --git a/camel/providers/imap/camel-imap-wrapper.h b/camel/providers/imap/camel-imap-wrapper.h
index 2eeba0438..b0fa350bb 100644
--- a/camel/providers/imap/camel-imap-wrapper.h
+++ b/camel/providers/imap/camel-imap-wrapper.h
@@ -42,7 +42,7 @@ struct _CamelImapWrapper {
CamelImapWrapperPrivate *priv;
CamelImapFolder *folder;
- char *uid, *part_spec;
+ gchar *uid, *part_spec;
CamelMimePart *part;
};
@@ -57,8 +57,8 @@ CamelType camel_imap_wrapper_get_type (void);
CamelDataWrapper *camel_imap_wrapper_new (CamelImapFolder *imap_folder,
CamelContentType *type,
CamelTransferEncoding encoding,
- const char *uid,
- const char *part_spec,
+ const gchar *uid,
+ const gchar *part_spec,
CamelMimePart *part);
G_END_DECLS
diff --git a/camel/providers/imap4/camel-imap4-command.c b/camel/providers/imap4/camel-imap4-command.c
index 4baec847f..f957b40d8 100644
--- a/camel/providers/imap4/camel-imap4-command.c
+++ b/camel/providers/imap4/camel-imap4-command.c
@@ -51,9 +51,9 @@ enum {
};
static int
-imap4_string_get_type (const char *str)
+imap4_string_get_type (const gchar *str)
{
- int type = 0;
+ gint type = 0;
while (*str) {
if (!is_atom (*str)) {
@@ -70,7 +70,7 @@ imap4_string_get_type (const char *str)
#if 0
static gboolean
-imap4_string_is_atom_safe (const char *str)
+imap4_string_is_atom_safe (const gchar *str)
{
while (is_atom (*str))
str++;
@@ -79,7 +79,7 @@ imap4_string_is_atom_safe (const char *str)
}
static gboolean
-imap4_string_is_quote_safe (const char *str)
+imap4_string_is_quote_safe (const gchar *str)
{
while (is_qsafe (*str))
str++;
@@ -140,12 +140,12 @@ command_part_new (void)
}
static void
-imap4_command_append_string (CamelIMAP4Engine *engine, CamelIMAP4CommandPart **tail, GString *str, const char *string)
+imap4_command_append_string (CamelIMAP4Engine *engine, CamelIMAP4CommandPart **tail, GString *str, const gchar *string)
{
CamelIMAP4CommandPart *part;
CamelIMAP4Literal *literal;
- register const char *inptr;
- const char *start;
+ register const gchar *inptr;
+ const gchar *start;
switch (imap4_string_get_type (string)) {
case IMAP4_STRING_ATOM:
@@ -201,11 +201,11 @@ imap4_command_append_string (CamelIMAP4Engine *engine, CamelIMAP4CommandPart **t
}
CamelIMAP4Command *
-camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_folder, const char *format, va_list args)
+camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_folder, const gchar *format, va_list args)
{
CamelIMAP4CommandPart *parts, *part, *tail;
CamelIMAP4Command *ic;
- const char *start;
+ const gchar *start;
GString *str;
tail = parts = command_part_new ();
@@ -214,17 +214,17 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
start = format;
while (*format) {
- register char ch = *format++;
+ register gchar ch = *format++;
if (ch == '%') {
CamelIMAP4Literal *literal;
CamelIMAP4Folder *folder;
- char *function, **strv;
- unsigned int u;
- char *string;
+ gchar *function, **strv;
+ guint u;
+ gchar *string;
size_t len;
- void *obj;
- int c, d;
+ gpointer obj;
+ gint c, d;
g_string_append_len (str, start, format - start - 1);
@@ -251,12 +251,12 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
case 'F':
/* CamelIMAP4Folder */
folder = va_arg (args, CamelIMAP4Folder *);
- string = (char *) camel_imap4_folder_utf7_name (folder);
+ string = (gchar *) camel_imap4_folder_utf7_name (folder);
imap4_command_append_string (engine, &tail, str, string);
break;
case 'L':
/* Literal */
- obj = va_arg (args, void *);
+ obj = va_arg (args, gpointer );
literal = g_new (CamelIMAP4Literal, 1);
if (CAMEL_IS_DATA_WRAPPER (obj)) {
@@ -295,7 +295,7 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
function = g_strdup (function);
- strv = va_arg (args, char **);
+ strv = va_arg (args, gchar **);
for (d = 0; strv[d]; d++) {
if (d > 0)
g_string_append (str, function);
@@ -306,12 +306,12 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
break;
case 'S':
/* string which may need to be quoted or made into a literal */
- string = va_arg (args, char *);
+ string = va_arg (args, gchar *);
imap4_command_append_string (engine, &tail, str, string);
break;
case 's':
/* safe atom string */
- string = va_arg (args, char *);
+ string = va_arg (args, gchar *);
g_string_append (str, string);
break;
default:
@@ -363,7 +363,7 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
}
CamelIMAP4Command *
-camel_imap4_command_new (CamelIMAP4Engine *engine, CamelIMAP4Folder *folder, const char *format, ...)
+camel_imap4_command_new (CamelIMAP4Engine *engine, CamelIMAP4Folder *folder, const gchar *format, ...)
{
CamelIMAP4Command *command;
va_list args;
@@ -376,7 +376,7 @@ camel_imap4_command_new (CamelIMAP4Engine *engine, CamelIMAP4Folder *folder, con
}
void
-camel_imap4_command_register_untagged (CamelIMAP4Command *ic, const char *atom, CamelIMAP4UntaggedCallback untagged)
+camel_imap4_command_register_untagged (CamelIMAP4Command *ic, const gchar *atom, CamelIMAP4UntaggedCallback untagged)
{
g_hash_table_insert (ic->untagged, g_strdup (atom), untagged);
}
@@ -391,7 +391,7 @@ void
camel_imap4_command_unref (CamelIMAP4Command *ic)
{
CamelIMAP4CommandPart *part, *next;
- int i;
+ gint i;
if (ic == NULL)
return;
@@ -451,7 +451,7 @@ imap4_literal_write_to_stream (CamelIMAP4Literal *literal, CamelStream *stream)
CamelStream *istream, *ostream = NULL;
CamelDataWrapper *wrapper;
CamelMimeFilter *crlf;
- char *string;
+ gchar *string;
if (literal->type == CAMEL_IMAP4_LITERAL_STRING) {
string = literal->literal.string;
@@ -526,14 +526,14 @@ unexpected_token (camel_imap4_token_t *token)
}
}
-int
+gint
camel_imap4_command_step (CamelIMAP4Command *ic)
{
CamelIMAP4Engine *engine = ic->engine;
- int result = CAMEL_IMAP4_RESULT_NONE;
+ gint result = CAMEL_IMAP4_RESULT_NONE;
CamelIMAP4Literal *literal;
camel_imap4_token_t token;
- unsigned char *linebuf;
+ guchar *linebuf;
size_t len;
g_assert (ic->part != NULL);
@@ -545,8 +545,8 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
}
if (camel_debug ("imap4:command")) {
- int sending = ic->part != ic->parts;
- unsigned char *eoln, *eob;
+ gint sending = ic->part != ic->parts;
+ guchar *eoln, *eob;
linebuf = ic->part->buffer;
eob = linebuf + ic->part->buflen;
@@ -714,7 +714,7 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
void
camel_imap4_command_reset (CamelIMAP4Command *ic)
{
- int i;
+ gint i;
for (i = 0; i < ic->resp_codes->len; i++)
camel_imap4_resp_code_free (ic->resp_codes->pdata[i]);
diff --git a/camel/providers/imap4/camel-imap4-command.h b/camel/providers/imap4/camel-imap4-command.h
index e171b7a7b..733a6e9d2 100644
--- a/camel/providers/imap4/camel-imap4-command.h
+++ b/camel/providers/imap4/camel-imap4-command.h
@@ -41,18 +41,18 @@ struct _camel_imap4_token_t;
typedef struct _CamelIMAP4Command CamelIMAP4Command;
typedef struct _CamelIMAP4Literal CamelIMAP4Literal;
-typedef int (* CamelIMAP4PlusCallback) (struct _CamelIMAP4Engine *engine,
+typedef gint (* CamelIMAP4PlusCallback) (struct _CamelIMAP4Engine *engine,
CamelIMAP4Command *ic,
- const unsigned char *linebuf,
+ const guchar *linebuf,
size_t linelen, CamelException *ex);
-typedef int (* CamelIMAP4UntaggedCallback) (struct _CamelIMAP4Engine *engine,
+typedef gint (* CamelIMAP4UntaggedCallback) (struct _CamelIMAP4Engine *engine,
CamelIMAP4Command *ic,
guint32 index,
struct _camel_imap4_token_t *token,
CamelException *ex);
-typedef void (* CamelIMAP4CommandReset) (CamelIMAP4Command *ic, void *user_data);
+typedef void (* CamelIMAP4CommandReset) (CamelIMAP4Command *ic, gpointer user_data);
enum {
CAMEL_IMAP4_LITERAL_STRING,
@@ -61,9 +61,9 @@ enum {
};
struct _CamelIMAP4Literal {
- int type;
+ gint type;
union {
- char *string;
+ gchar *string;
CamelStream *stream;
CamelDataWrapper *wrapper;
} literal;
@@ -71,7 +71,7 @@ struct _CamelIMAP4Literal {
typedef struct _CamelIMAP4CommandPart {
struct _CamelIMAP4CommandPart *next;
- unsigned char *buffer;
+ guchar *buffer;
size_t buflen;
CamelIMAP4Literal *literal;
@@ -96,12 +96,12 @@ struct _CamelIMAP4Command {
struct _CamelIMAP4Engine *engine;
- unsigned int ref_count:26;
- unsigned int status:3;
- unsigned int result:3;
- int id;
+ guint ref_count:26;
+ guint status:3;
+ guint result:3;
+ gint id;
- char *tag;
+ gchar *tag;
GPtrArray *resp_codes;
@@ -120,21 +120,21 @@ struct _CamelIMAP4Command {
/* '+' callback/data */
CamelIMAP4PlusCallback plus;
CamelIMAP4CommandReset reset;
- void *user_data;
+ gpointer user_data;
};
CamelIMAP4Command *camel_imap4_command_new (struct _CamelIMAP4Engine *engine, struct _CamelIMAP4Folder *folder,
- const char *format, ...);
+ const gchar *format, ...);
CamelIMAP4Command *camel_imap4_command_newv (struct _CamelIMAP4Engine *engine, struct _CamelIMAP4Folder *folder,
- const char *format, va_list args);
+ const gchar *format, va_list args);
-void camel_imap4_command_register_untagged (CamelIMAP4Command *ic, const char *atom, CamelIMAP4UntaggedCallback untagged);
+void camel_imap4_command_register_untagged (CamelIMAP4Command *ic, const gchar *atom, CamelIMAP4UntaggedCallback untagged);
void camel_imap4_command_ref (CamelIMAP4Command *ic);
void camel_imap4_command_unref (CamelIMAP4Command *ic);
/* returns 1 when complete, 0 if there is more to do, or -1 on error */
-int camel_imap4_command_step (CamelIMAP4Command *ic);
+gint camel_imap4_command_step (CamelIMAP4Command *ic);
void camel_imap4_command_reset (CamelIMAP4Command *ic);
diff --git a/camel/providers/imap4/camel-imap4-engine.c b/camel/providers/imap4/camel-imap4-engine.c
index 55f0a6cd3..39c43c10e 100644
--- a/camel/providers/imap4/camel-imap4-engine.c
+++ b/camel/providers/imap4/camel-imap4-engine.c
@@ -47,7 +47,7 @@ static void camel_imap4_engine_class_init (CamelIMAP4EngineClass *klass);
static void camel_imap4_engine_init (CamelIMAP4Engine *engine, CamelIMAP4EngineClass *klass);
static void camel_imap4_engine_finalize (CamelObject *object);
-static int parse_xgwextensions (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
+static gint parse_xgwextensions (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
camel_imap4_token_t *token, CamelException *ex);
@@ -187,11 +187,11 @@ camel_imap4_engine_new (CamelService *service, CamelIMAP4ReconnectFunc reconnect
*
* Note: on error, @stream will be unref'd.
**/
-int
+gint
camel_imap4_engine_take_stream (CamelIMAP4Engine *engine, CamelStream *stream, CamelException *ex)
{
camel_imap4_token_t token;
- int code;
+ gint code;
g_return_val_if_fail (CAMEL_IS_IMAP4_ENGINE (engine), -1);
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
@@ -266,11 +266,11 @@ camel_imap4_engine_disconnect (CamelIMAP4Engine *engine)
*
* Returns: %0 on success or %-1 on fail.
**/
-int
+gint
camel_imap4_engine_capability (CamelIMAP4Engine *engine, CamelException *ex)
{
CamelIMAP4Command *ic;
- int id, retval = 0;
+ gint id, retval = 0;
ic = camel_imap4_engine_prequeue (engine, NULL, "CAPABILITY\r\n");
@@ -313,13 +313,13 @@ camel_imap4_engine_capability (CamelIMAP4Engine *engine, CamelException *ex)
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_imap4_engine_namespace (CamelIMAP4Engine *engine, CamelException *ex)
{
camel_imap4_list_t *list;
GPtrArray *array = NULL;
CamelIMAP4Command *ic;
- int id, i;
+ gint id, i;
if (engine->capa & CAMEL_IMAP4_CAPABILITY_NAMESPACE) {
ic = camel_imap4_engine_prequeue (engine, NULL, "NAMESPACE\r\n");
@@ -384,13 +384,13 @@ camel_imap4_engine_namespace (CamelIMAP4Engine *engine, CamelException *ex)
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_imap4_engine_select_folder (CamelIMAP4Engine *engine, CamelFolder *folder, CamelException *ex)
{
CamelIMAP4RespCode *resp;
CamelIMAP4Command *ic;
- int id, retval = 0;
- int i;
+ gint id, retval = 0;
+ gint i;
g_return_val_if_fail (CAMEL_IS_IMAP4_ENGINE (engine), -1);
g_return_val_if_fail (CAMEL_IS_IMAP4_FOLDER (folder), -1);
@@ -469,7 +469,7 @@ camel_imap4_engine_select_folder (CamelIMAP4Engine *engine, CamelFolder *folder,
static struct {
- const char *name;
+ const gchar *name;
guint32 flag;
} imap4_capabilities[] = {
{ "IMAP4", CAMEL_IMAP4_CAPABILITY_IMAP4 },
@@ -490,7 +490,7 @@ static struct {
};
static struct {
- const char *name;
+ const gchar *name;
guint32 flag;
} imap4_xgwextensions[] = {
{ "XGWMOVE", CAMEL_IMAP4_CAPABILITY_XGWMOVE }, /* GroupWise MOVE command */
@@ -500,7 +500,7 @@ static struct {
static int
parse_xgwextensions (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, camel_imap4_token_t *token, CamelException *ex)
{
- int i;
+ gint i;
if (camel_imap4_engine_next_token (engine, token, ex) == -1)
return -1;
@@ -537,10 +537,10 @@ auth_free (gpointer key, gpointer value, gpointer user_data)
}
static int
-engine_parse_capability (CamelIMAP4Engine *engine, int sentinel, CamelException *ex)
+engine_parse_capability (CamelIMAP4Engine *engine, gint sentinel, CamelException *ex)
{
camel_imap4_token_t token;
- int i;
+ gint i;
/* we assume UTF8 searches work until proven otherwise */
engine->capa = CAMEL_IMAP4_CAPABILITY_utf8_search;
@@ -590,7 +590,7 @@ engine_parse_capability (CamelIMAP4Engine *engine, int sentinel, CamelException
}
static int
-engine_parse_flags_list (CamelIMAP4Engine *engine, CamelIMAP4RespCode *resp, int perm, CamelException *ex)
+engine_parse_flags_list (CamelIMAP4Engine *engine, CamelIMAP4RespCode *resp, gint perm, CamelException *ex)
{
guint32 flags = 0;
@@ -644,7 +644,7 @@ engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex)
{
CamelIMAP4Namespace *namespaces[3], *node, *tail;
camel_imap4_token_t token;
- int i, n = 0;
+ gint i, n = 0;
camel_imap4_namespace_clear (&engine->namespaces.personal);
camel_imap4_namespace_clear (&engine->namespaces.other);
@@ -696,7 +696,7 @@ engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex)
node->sep = *token.v.qstring;
break;
} else {
- /* check the last char in the path component of the namespace */
+ /* check the last gchar in the path component of the namespace */
if (*node->path)
node->sep = node->path[strlen (node->path) - 1];
else
@@ -788,9 +788,9 @@ engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex)
*/
static struct {
- const char *name;
+ const gchar *name;
camel_imap4_resp_code_t code;
- int save;
+ gint save;
} imap4_resp_codes[] = {
{ "ALERT", CAMEL_IMAP4_RESP_CODE_ALERT, 0 },
{ "BADCHARSET", CAMEL_IMAP4_RESP_CODE_BADCHARSET, 0 },
@@ -819,13 +819,13 @@ static struct {
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_imap4_engine_parse_resp_code (CamelIMAP4Engine *engine, CamelException *ex)
{
CamelIMAP4RespCode *resp = NULL;
camel_imap4_resp_code_t code;
camel_imap4_token_t token;
- unsigned char *linebuf;
+ guchar *linebuf;
size_t len;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
@@ -1087,14 +1087,14 @@ camel_imap4_engine_parse_resp_code (CamelIMAP4Engine *engine, CamelException *ex
* Returns: -1 on error or one of
* CAMEL_IMAP4_UNTAGGED_[OK,NO,BAD,PREAUTH,HANDLED] on success
**/
-int
+gint
camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_token_t *token, CamelException *ex)
{
- int code = CAMEL_IMAP4_UNTAGGED_HANDLED;
+ gint code = CAMEL_IMAP4_UNTAGGED_HANDLED;
CamelIMAP4Command *ic = engine->current;
CamelIMAP4UntaggedCallback untagged;
CamelFolder *folder;
- unsigned int v;
+ guint v;
if (camel_imap4_engine_next_token (engine, token, ex) == -1)
return -1;
@@ -1277,7 +1277,7 @@ camel_imap4_engine_handle_untagged (CamelIMAP4Engine *engine, CamelException *ex
static int
imap4_process_command (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
{
- int retval;
+ gint retval;
while ((retval = camel_imap4_command_step (ic)) == 0)
;
@@ -1295,10 +1295,10 @@ static void
engine_prequeue_folder_select (CamelIMAP4Engine *engine)
{
CamelIMAP4Command *ic;
- const char *cmd;
+ const gchar *cmd;
ic = (CamelIMAP4Command *) engine->queue.head;
- cmd = (const char *) ic->parts->buffer;
+ cmd = (const gchar *) ic->parts->buffer;
if (!ic->folder || ic->folder == engine->folder ||
!strncmp (cmd, "SELECT ", 7) || !strncmp (cmd, "EXAMINE ", 8)) {
@@ -1317,8 +1317,8 @@ engine_prequeue_folder_select (CamelIMAP4Engine *engine)
static int
engine_state_change (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
{
- const char *cmd;
- int retval = 0;
+ const gchar *cmd;
+ gint retval = 0;
cmd = ic->parts->buffer;
if (!strncmp (cmd, "SELECT ", 7) || !strncmp (cmd, "EXAMINE ", 8)) {
@@ -1357,13 +1357,13 @@ engine_state_change (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
* Note: more details on the error will be held on the
* #CamelIMAP4Command that failed.
**/
-int
+gint
camel_imap4_engine_iterate (CamelIMAP4Engine *engine)
{
CamelIMAP4Command *ic, *nic;
GPtrArray *resp_codes;
- int retries = 0;
- int retval;
+ gint retries = 0;
+ gint retval;
if (camel_dlist_empty (&engine->queue))
return 0;
@@ -1454,7 +1454,7 @@ camel_imap4_engine_iterate (CamelIMAP4Engine *engine)
* Returns: the CamelIMAP4Command.
**/
CamelIMAP4Command *
-camel_imap4_engine_queue (CamelIMAP4Engine *engine, CamelFolder *folder, const char *format, ...)
+camel_imap4_engine_queue (CamelIMAP4Engine *engine, CamelFolder *folder, const gchar *format, ...)
{
CamelIMAP4Command *ic;
va_list args;
@@ -1486,7 +1486,7 @@ camel_imap4_engine_queue (CamelIMAP4Engine *engine, CamelFolder *folder, const c
* Returns: the CamelIMAP4Command.
**/
CamelIMAP4Command *
-camel_imap4_engine_prequeue (CamelIMAP4Engine *engine, CamelFolder *folder, const char *format, ...)
+camel_imap4_engine_prequeue (CamelIMAP4Engine *engine, CamelFolder *folder, const gchar *format, ...)
{
CamelIMAP4Command *ic;
va_list args;
@@ -1561,7 +1561,7 @@ camel_imap4_engine_dequeue (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
*
* Returns: %0 on success or %-1 on fail.
**/
-int
+gint
camel_imap4_engine_next_token (CamelIMAP4Engine *engine, camel_imap4_token_t *token, CamelException *ex)
{
if (camel_imap4_stream_next_token (engine->istream, token) == -1) {
@@ -1587,12 +1587,12 @@ camel_imap4_engine_next_token (CamelIMAP4Engine *engine, camel_imap4_token_t *to
*
* Returns: 0 on success or -1 on fail
**/
-int
+gint
camel_imap4_engine_eat_line (CamelIMAP4Engine *engine, CamelException *ex)
{
camel_imap4_token_t token;
- unsigned char *literal;
- int retval;
+ guchar *literal;
+ gint retval;
size_t n;
do {
@@ -1632,13 +1632,13 @@ camel_imap4_engine_eat_line (CamelIMAP4Engine *engine, CamelException *ex)
*
* Returns: 0 on success or -1 on fail
**/
-int
-camel_imap4_engine_line (CamelIMAP4Engine *engine, unsigned char **line, size_t *len, CamelException *ex)
+gint
+camel_imap4_engine_line (CamelIMAP4Engine *engine, guchar **line, size_t *len, CamelException *ex)
{
GByteArray *linebuf = NULL;
- unsigned char *buf;
+ guchar *buf;
size_t buflen;
- int retval;
+ gint retval;
if (line != NULL)
linebuf = g_byte_array_new ();
@@ -1688,13 +1688,13 @@ camel_imap4_engine_line (CamelIMAP4Engine *engine, unsigned char **line, size_t
*
* Returns: 0 on success or -1 on fail.
**/
-int
-camel_imap4_engine_literal (CamelIMAP4Engine *engine, unsigned char **literal, size_t *len, CamelException *ex)
+gint
+camel_imap4_engine_literal (CamelIMAP4Engine *engine, guchar **literal, size_t *len, CamelException *ex)
{
GByteArray *literalbuf = NULL;
- unsigned char *buf;
+ guchar *buf;
size_t buflen;
- int retval;
+ gint retval;
if (literal != NULL)
literalbuf = g_byte_array_new ();
@@ -1742,8 +1742,8 @@ camel_imap4_engine_literal (CamelIMAP4Engine *engine, unsigned char **literal, s
*
* Returns: 0 on success or -1 on fail.
**/
-int
-camel_imap4_engine_nstring (CamelIMAP4Engine *engine, unsigned char **nstring, CamelException *ex)
+gint
+camel_imap4_engine_nstring (CamelIMAP4Engine *engine, guchar **nstring, CamelException *ex)
{
camel_imap4_token_t token;
size_t n;
diff --git a/camel/providers/imap4/camel-imap4-engine.h b/camel/providers/imap4/camel-imap4-engine.h
index e80bf04d4..e62dcd101 100644
--- a/camel/providers/imap4/camel-imap4-engine.h
+++ b/camel/providers/imap4/camel-imap4-engine.h
@@ -107,19 +107,19 @@ typedef struct _CamelIMAP4RespCode {
camel_imap4_resp_code_t code;
union {
guint32 flags;
- char *parse;
+ gchar *parse;
guint32 uidnext;
guint32 uidvalidity;
guint32 unseen;
- char *newname[2];
+ gchar *newname[2];
struct {
guint32 uidvalidity;
guint32 uid;
} appenduid;
struct {
guint32 uidvalidity;
- char *srcset;
- char *destset;
+ gchar *srcset;
+ gchar *destset;
} copyuid;
} v;
} CamelIMAP4RespCode;
@@ -135,8 +135,8 @@ enum {
typedef struct _CamelIMAP4Namespace {
struct _CamelIMAP4Namespace *next;
- char *path;
- char sep;
+ gchar *path;
+ gchar sep;
} CamelIMAP4Namespace;
typedef struct _CamelIMAP4NamespaceList {
@@ -175,9 +175,9 @@ struct _CamelIMAP4Engine {
struct _CamelIMAP4Stream *istream;
CamelStream *ostream;
- unsigned char tagprefix; /* 'A'..'Z' */
- unsigned int tag; /* next command tag */
- int nextid;
+ guchar tagprefix; /* 'A'..'Z' */
+ guint tag; /* next command tag */
+ gint nextid;
struct _CamelIMAP4Folder *folder; /* currently selected folder */
@@ -188,7 +188,7 @@ struct _CamelIMAP4Engine {
struct _CamelIMAP4EngineClass {
CamelObjectClass parent_class;
- unsigned char tagprefix;
+ guchar tagprefix;
};
@@ -197,39 +197,39 @@ CamelType camel_imap4_engine_get_type (void);
CamelIMAP4Engine *camel_imap4_engine_new (CamelService *service, CamelIMAP4ReconnectFunc reconnect);
/* returns 0 on success or -1 on error */
-int camel_imap4_engine_take_stream (CamelIMAP4Engine *engine, CamelStream *stream, CamelException *ex);
+gint camel_imap4_engine_take_stream (CamelIMAP4Engine *engine, CamelStream *stream, CamelException *ex);
void camel_imap4_engine_disconnect (CamelIMAP4Engine *engine);
-int camel_imap4_engine_capability (CamelIMAP4Engine *engine, CamelException *ex);
-int camel_imap4_engine_namespace (CamelIMAP4Engine *engine, CamelException *ex);
+gint camel_imap4_engine_capability (CamelIMAP4Engine *engine, CamelException *ex);
+gint camel_imap4_engine_namespace (CamelIMAP4Engine *engine, CamelException *ex);
-int camel_imap4_engine_select_folder (CamelIMAP4Engine *engine, CamelFolder *folder, CamelException *ex);
+gint camel_imap4_engine_select_folder (CamelIMAP4Engine *engine, CamelFolder *folder, CamelException *ex);
struct _CamelIMAP4Command *camel_imap4_engine_queue (CamelIMAP4Engine *engine, CamelFolder *folder,
- const char *format, ...);
+ const gchar *format, ...);
struct _CamelIMAP4Command *camel_imap4_engine_prequeue (CamelIMAP4Engine *engine, CamelFolder *folder,
- const char *format, ...);
+ const gchar *format, ...);
void camel_imap4_engine_dequeue (CamelIMAP4Engine *engine, struct _CamelIMAP4Command *ic);
-int camel_imap4_engine_iterate (CamelIMAP4Engine *engine);
+gint camel_imap4_engine_iterate (CamelIMAP4Engine *engine);
/* untagged response utility functions */
-int camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, struct _camel_imap4_token_t *token, CamelException *ex);
+gint camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, struct _camel_imap4_token_t *token, CamelException *ex);
void camel_imap4_engine_handle_untagged (CamelIMAP4Engine *engine, CamelException *ex);
/* stream wrapper utility functions */
-int camel_imap4_engine_next_token (CamelIMAP4Engine *engine, struct _camel_imap4_token_t *token, CamelException *ex);
-int camel_imap4_engine_line (CamelIMAP4Engine *engine, unsigned char **line, size_t *len, CamelException *ex);
-int camel_imap4_engine_literal (CamelIMAP4Engine *engine, unsigned char **literal, size_t *len, CamelException *ex);
-int camel_imap4_engine_nstring (CamelIMAP4Engine *engine, unsigned char **nstring, CamelException *ex);
-int camel_imap4_engine_eat_line (CamelIMAP4Engine *engine, CamelException *ex);
+gint camel_imap4_engine_next_token (CamelIMAP4Engine *engine, struct _camel_imap4_token_t *token, CamelException *ex);
+gint camel_imap4_engine_line (CamelIMAP4Engine *engine, guchar **line, size_t *len, CamelException *ex);
+gint camel_imap4_engine_literal (CamelIMAP4Engine *engine, guchar **literal, size_t *len, CamelException *ex);
+gint camel_imap4_engine_nstring (CamelIMAP4Engine *engine, guchar **nstring, CamelException *ex);
+gint camel_imap4_engine_eat_line (CamelIMAP4Engine *engine, CamelException *ex);
/* response code stuff */
-int camel_imap4_engine_parse_resp_code (CamelIMAP4Engine *engine, CamelException *ex);
+gint camel_imap4_engine_parse_resp_code (CamelIMAP4Engine *engine, CamelException *ex);
void camel_imap4_resp_code_free (CamelIMAP4RespCode *rcode);
G_END_DECLS
diff --git a/camel/providers/imap4/camel-imap4-folder.c b/camel/providers/imap4/camel-imap4-folder.c
index f43c8d182..b98fc8326 100644
--- a/camel/providers/imap4/camel-imap4-folder.c
+++ b/camel/providers/imap4/camel-imap4-folder.c
@@ -64,21 +64,21 @@ static void camel_imap4_folder_class_init (CamelIMAP4FolderClass *klass);
static void camel_imap4_folder_init (CamelIMAP4Folder *folder, CamelIMAP4FolderClass *klass);
static void camel_imap4_folder_finalize (CamelObject *object);
-static int imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static int imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
static void imap4_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
static void imap4_refresh_info (CamelFolder *folder, CamelException *ex);
static void imap4_expunge (CamelFolder *folder, CamelException *ex);
-static CamelMimeMessage *imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex);
+static CamelMimeMessage *imap4_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
static void imap4_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid, CamelException *ex);
+ const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex);
static void imap4_transfer_messages_to (CamelFolder *src, GPtrArray *uids, CamelFolder *dest,
GPtrArray **transferred_uids, gboolean move, CamelException *ex);
-static GPtrArray *imap4_search_by_expression (CamelFolder *folder, const char *expr, CamelException *ex);
-static GPtrArray *imap4_search_by_uids (CamelFolder *folder, const char *expr, GPtrArray *uids, CamelException *ex);
+static GPtrArray *imap4_search_by_expression (CamelFolder *folder, const gchar *expr, CamelException *ex);
+static GPtrArray *imap4_search_by_uids (CamelFolder *folder, const gchar *expr, GPtrArray *uids, CamelException *ex);
static void imap4_search_free (CamelFolder *folder, GPtrArray *uids);
-static char* imap4_get_filename (CamelFolder *folder, const char *uid, CamelException *ex);
+static gchar * imap4_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
static CamelOfflineFolderClass *parent_class = NULL;
@@ -116,7 +116,7 @@ camel_imap4_folder_class_init (CamelIMAP4FolderClass *klass)
{
CamelFolderClass *folder_class = (CamelFolderClass *) klass;
CamelObjectClass *object_class = (CamelObjectClass *) klass;
- int i;
+ gint i;
parent_class = (CamelOfflineFolderClass *) camel_type_get_global_classfuncs (CAMEL_OFFLINE_FOLDER_TYPE);
@@ -171,8 +171,8 @@ camel_imap4_folder_finalize (CamelObject *object)
g_free (folder->cachedir);
}
-static char*
-imap4_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar *
+imap4_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) folder;
@@ -184,7 +184,7 @@ imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelIMAP4Folder *folder = (CamelIMAP4Folder *) object;
CamelArgGetV props;
- int i, count = 0;
+ gint i, count = 0;
guint32 tag;
for (i = 0; i < args->argc; i++) {
@@ -230,7 +230,7 @@ imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
CamelDataCache *cache = folder->cache;
gboolean save = FALSE;
guint32 tag;
- int i;
+ gint i;
for (i = 0; i < args->argc; i++) {
CamelArg *arg = &args->argv[i];
@@ -270,26 +270,26 @@ imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
}
-static char *
-imap4_get_summary_filename (const char *path)
+static gchar *
+imap4_get_summary_filename (const gchar *path)
{
/* /path/to/imap/summary */
return g_build_filename (path, "summary", NULL);
}
-static char *
-imap4_get_journal_filename (const char *path)
+static gchar *
+imap4_get_journal_filename (const gchar *path)
{
/* /path/to/imap/journal */
return g_build_filename (path, "journal", NULL);
}
-static char *
-imap4_build_filename (const char *toplevel_dir, const char *full_name)
+static gchar *
+imap4_build_filename (const gchar *toplevel_dir, const gchar *full_name)
{
- const char *inptr = full_name;
- int subdirs = 0;
- char *path, *p;
+ const gchar *inptr = full_name;
+ gint subdirs = 0;
+ gchar *path, *p;
if (*full_name == '\0')
return g_strdup (toplevel_dir);
@@ -326,12 +326,12 @@ imap4_build_filename (const char *toplevel_dir, const char *full_name)
return path;
}
-static char *
-imap4_store_build_filename (void *store, const char *full_name)
+static gchar *
+imap4_store_build_filename (gpointer store, const gchar *full_name)
{
CamelIMAP4Store *imap4_store = (CamelIMAP4Store *) store;
- char *toplevel_dir;
- char *path;
+ gchar *toplevel_dir;
+ gchar *path;
toplevel_dir = g_strdup_printf ("%s/folders", imap4_store->storage_path);
path = imap4_build_filename (toplevel_dir, full_name);
@@ -342,16 +342,16 @@ imap4_store_build_filename (void *store, const char *full_name)
CamelFolder *
-camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException *ex)
+camel_imap4_folder_new (CamelStore *store, const gchar *full_name, CamelException *ex)
{
CamelIMAP4Folder *imap4_folder;
- char *utf7_name, *name, *p;
+ gchar *utf7_name, *name, *p;
CamelFolder *folder;
- char *path;
- char sep;
+ gchar *path;
+ gchar sep;
if (!(p = strrchr (full_name, '/')))
- p = (char *) full_name;
+ p = (gchar *) full_name;
else
p++;
@@ -440,7 +440,7 @@ camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException
return folder;
}
-const char *
+const gchar *
camel_imap4_folder_utf7_name (CamelIMAP4Folder *folder)
{
return folder->utf7_name;
@@ -448,7 +448,7 @@ camel_imap4_folder_utf7_name (CamelIMAP4Folder *folder)
static struct {
- const char *name;
+ const gchar *name;
guint32 flag;
} imap4_flags[] = {
{ "\\Answered", CAMEL_MESSAGE_ANSWERED },
@@ -461,12 +461,12 @@ static struct {
static int
-imap4_sync_flag (CamelFolder *folder, GPtrArray *infos, char onoff, const char *flag, CamelException *ex)
+imap4_sync_flag (CamelFolder *folder, GPtrArray *infos, gchar onoff, const gchar *flag, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) folder->parent_store)->engine;
CamelIMAP4Command *ic;
- int i, id, retval = 0;
- char *set = NULL;
+ gint i, id, retval = 0;
+ gchar *set = NULL;
for (i = 0; i < infos->len; ) {
i += camel_imap4_get_uid_set (engine, folder->summary, infos, i, 30 + strlen (flag), &set);
@@ -516,8 +516,8 @@ imap4_sync_changes (CamelFolder *folder, GPtrArray *sync, CamelException *ex)
GPtrArray *on_set, *off_set;
CamelMessageInfo *info;
flags_diff_t diff;
- int retval = 0;
- int i, j;
+ gint retval = 0;
+ gint i, j;
on_set = g_ptr_array_new ();
off_set = g_ptr_array_new ();
@@ -579,8 +579,8 @@ imap4_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
CamelIMAP4Command *ic;
flags_diff_t diff;
GPtrArray *sync;
- int id, max, i;
- int retval;
+ gint id, max, i;
+ gint retval;
if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return;
@@ -669,7 +669,7 @@ imap4_refresh_info (CamelFolder *folder, CamelException *ex)
CamelOfflineStore *offline = (CamelOfflineStore *) folder->parent_store;
CamelFolder *selected = (CamelFolder *) engine->folder;
CamelIMAP4Command *ic;
- int id;
+ gint id;
if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return;
@@ -800,7 +800,7 @@ untagged_fetch (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
}
static CamelMimeMessage *
-imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+imap4_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) folder->parent_store)->engine;
CamelOfflineStore *offline = (CamelOfflineStore *) folder->parent_store;
@@ -808,7 +808,7 @@ imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
CamelMimeMessage *message = NULL;
CamelStream *stream, *cache;
CamelIMAP4Command *ic;
- int id;
+ gint id;
CAMEL_SERVICE_REC_LOCK (folder->parent_store, connect_lock);
@@ -916,14 +916,14 @@ imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
return message;
}
-static char *tm_months[] = {
+static gchar *tm_months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
static void
imap4_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid, CamelException *ex)
+ const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) folder->parent_store)->engine;
CamelOfflineStore *offline = (CamelOfflineStore *) folder->parent_store;
@@ -934,10 +934,10 @@ imap4_append_message (CamelFolder *folder, CamelMimeMessage *message,
CamelIMAP4Command *ic;
CamelFolderInfo *fi;
CamelException lex;
- char flags[100], *p;
- char date[50];
+ gchar flags[100], *p;
+ gchar date[50];
struct tm tm;
- int id, i;
+ gint id, i;
if (appended_uid)
*appended_uid = NULL;
@@ -975,7 +975,7 @@ imap4_append_message (CamelFolder *folder, CamelMimeMessage *message,
/* construct the optional date_time string */
if (iinfo->info.date_received > (time_t) 0) {
- int tzone;
+ gint tzone;
#ifdef HAVE_LOCALTIME_R
localtime_r (&iinfo->info.date_received, &tm);
@@ -1043,7 +1043,7 @@ imap4_append_message (CamelFolder *folder, CamelMimeMessage *message,
for (i = 0; i < ic->resp_codes->len; i++) {
resp = ic->resp_codes->pdata[i];
if (resp->code == CAMEL_IMAP4_RESP_CODE_TRYCREATE) {
- char *parent_name, *p;
+ gchar *parent_name, *p;
parent_name = g_alloca (strlen (folder->full_name) + 1);
strcpy (parent_name, folder->full_name);
@@ -1101,12 +1101,12 @@ imap4_transfer_messages_to (CamelFolder *src, GPtrArray *uids, CamelFolder *dest
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) src->parent_store)->engine;
CamelOfflineStore *offline = (CamelOfflineStore *) src->parent_store;
- int i, j, n, id, dest_namelen;
+ gint i, j, n, id, dest_namelen;
CamelMessageInfo *info;
CamelIMAP4Command *ic;
CamelException lex;
GPtrArray *infos;
- char *set;
+ gchar *set;
if (transferred_uids)
*transferred_uids = NULL;
@@ -1233,7 +1233,7 @@ imap4_transfer_messages_to (CamelFolder *src, GPtrArray *uids, CamelFolder *dest
}
static GPtrArray *
-imap4_search_by_expression (CamelFolder *folder, const char *expr, CamelException *ex)
+imap4_search_by_expression (CamelFolder *folder, const gchar *expr, CamelException *ex)
{
CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) folder;
GPtrArray *matches;
@@ -1249,7 +1249,7 @@ imap4_search_by_expression (CamelFolder *folder, const char *expr, CamelExceptio
}
static GPtrArray *
-imap4_search_by_uids (CamelFolder *folder, const char *expr, GPtrArray *uids, CamelException *ex)
+imap4_search_by_uids (CamelFolder *folder, const gchar *expr, GPtrArray *uids, CamelException *ex)
{
CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) folder;
GPtrArray *matches;
diff --git a/camel/providers/imap4/camel-imap4-folder.h b/camel/providers/imap4/camel-imap4-folder.h
index e65393cda..13ebcd775 100644
--- a/camel/providers/imap4/camel-imap4-folder.h
+++ b/camel/providers/imap4/camel-imap4-folder.h
@@ -64,11 +64,11 @@ struct _CamelIMAP4Folder {
CamelOfflineJournal *journal;
CamelDataCache *cache;
- char *cachedir;
- char *utf7_name;
+ gchar *cachedir;
+ gchar *utf7_name;
- unsigned int read_only:1;
- unsigned int enable_mlist:1;
+ guint read_only:1;
+ guint enable_mlist:1;
};
struct _CamelIMAP4FolderClass {
@@ -79,9 +79,9 @@ struct _CamelIMAP4FolderClass {
CamelType camel_imap4_folder_get_type (void);
-CamelFolder *camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException *ex);
+CamelFolder *camel_imap4_folder_new (CamelStore *store, const gchar *full_name, CamelException *ex);
-const char *camel_imap4_folder_utf7_name (CamelIMAP4Folder *folder);
+const gchar *camel_imap4_folder_utf7_name (CamelIMAP4Folder *folder);
G_END_DECLS
diff --git a/camel/providers/imap4/camel-imap4-journal.c b/camel/providers/imap4/camel-imap4-journal.c
index d2c207d89..6d6c94aa2 100644
--- a/camel/providers/imap4/camel-imap4-journal.c
+++ b/camel/providers/imap4/camel-imap4-journal.c
@@ -52,8 +52,8 @@ static void camel_imap4_journal_finalize (CamelObject *object);
static void imap4_entry_free (CamelOfflineJournal *journal, CamelDListNode *entry);
static CamelDListNode *imap4_entry_load (CamelOfflineJournal *journal, FILE *in);
-static int imap4_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
-static int imap4_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
+static gint imap4_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out);
+static gint imap4_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex);
static CamelOfflineJournalClass *parent_class = NULL;
@@ -101,7 +101,7 @@ static void
camel_imap4_journal_finalize (CamelObject *object)
{
CamelIMAP4Journal *journal = (CamelIMAP4Journal *) object;
- int i;
+ gint i;
if (journal->failed) {
for (i = 0; i < journal->failed->len; i++)
@@ -197,7 +197,7 @@ imap4_entry_play_append (CamelOfflineJournal *journal, CamelIMAP4JournalEntry *e
CamelMimeMessage *message;
CamelStream *stream;
CamelException lex;
- char *uid = NULL;
+ gchar *uid = NULL;
/* if the message isn't in the cache, the user went behind our backs so "not our problem" */
if (!imap4_folder->cache || !(stream = camel_data_cache_get (imap4_folder->cache, "cache", entry->v.append_uid, ex)))
@@ -275,7 +275,7 @@ imap4_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelExce
CamelOfflineJournal *
-camel_imap4_journal_new (CamelIMAP4Folder *folder, const char *filename)
+camel_imap4_journal_new (CamelIMAP4Folder *folder, const gchar *filename)
{
CamelOfflineJournal *journal;
@@ -292,7 +292,7 @@ void
camel_imap4_journal_readd_failed (CamelIMAP4Journal *journal)
{
CamelFolderSummary *summary = ((CamelOfflineJournal *) journal)->folder->summary;
- int i;
+ gint i;
for (i = 0; i < journal->failed->len; i++)
camel_folder_summary_add (summary, journal->failed->pdata[i]);
@@ -303,7 +303,7 @@ camel_imap4_journal_readd_failed (CamelIMAP4Journal *journal)
void
camel_imap4_journal_append (CamelIMAP4Journal *imap4_journal, CamelMimeMessage *message,
- const CamelMessageInfo *mi, char **appended_uid, CamelException *ex)
+ const CamelMessageInfo *mi, gchar **appended_uid, CamelException *ex)
{
CamelOfflineJournal *journal = (CamelOfflineJournal *) imap4_journal;
CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) journal->folder;
@@ -312,7 +312,7 @@ camel_imap4_journal_append (CamelIMAP4Journal *imap4_journal, CamelMimeMessage *
CamelMessageInfo *info;
CamelStream *cache;
guint32 nextuid;
- char *uid;
+ gchar *uid;
if (imap4_folder->cache == NULL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
diff --git a/camel/providers/imap4/camel-imap4-journal.h b/camel/providers/imap4/camel-imap4-journal.h
index 2f10c662f..f858609e8 100644
--- a/camel/providers/imap4/camel-imap4-journal.h
+++ b/camel/providers/imap4/camel-imap4-journal.h
@@ -52,10 +52,10 @@ enum {
struct _CamelIMAP4JournalEntry {
CamelDListNode node;
- int type;
+ gint type;
union {
- char *append_uid;
+ gchar *append_uid;
} v;
};
@@ -73,13 +73,13 @@ struct _CamelIMAP4JournalClass {
CamelType camel_imap4_journal_get_type (void);
-CamelOfflineJournal *camel_imap4_journal_new (struct _CamelIMAP4Folder *folder, const char *filename);
+CamelOfflineJournal *camel_imap4_journal_new (struct _CamelIMAP4Folder *folder, const gchar *filename);
void camel_imap4_journal_readd_failed (CamelIMAP4Journal *journal);
/* interfaces for adding a journal entry */
void camel_imap4_journal_append (CamelIMAP4Journal *journal, CamelMimeMessage *message, const CamelMessageInfo *mi,
- char **appended_uid, CamelException *ex);
+ gchar **appended_uid, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/imap4/camel-imap4-provider.c b/camel/providers/imap4/camel-imap4-provider.c
index fec9281b0..70686e6f4 100644
--- a/camel/providers/imap4/camel-imap4-provider.c
+++ b/camel/providers/imap4/camel-imap4-provider.c
@@ -92,7 +92,7 @@ CamelServiceAuthType camel_imap4_password_authtype = {
static void
-add_hash (guint *hash, char *s)
+add_hash (guint *hash, gchar *s)
{
if (s)
*hash ^= g_str_hash(s);
@@ -112,7 +112,7 @@ imap4_url_hash (gconstpointer key)
}
static int
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
if (s2 == NULL)
diff --git a/camel/providers/imap4/camel-imap4-search.c b/camel/providers/imap4/camel-imap4-search.c
index a0751af2e..6567e7270 100644
--- a/camel/providers/imap4/camel-imap4-search.c
+++ b/camel/providers/imap4/camel-imap4-search.c
@@ -40,7 +40,7 @@ static void camel_imap4_search_class_init (CamelIMAP4SearchClass *klass);
static void camel_imap4_search_init (CamelIMAP4Search *search, CamelIMAP4SearchClass *klass);
static void camel_imap4_search_finalize (CamelObject *object);
-static ESExpResult *imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *imap4_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search);
static CamelFolderSearchClass *parent_class = NULL;
@@ -89,7 +89,7 @@ camel_imap4_search_finalize (CamelObject *object)
CamelFolderSearch *
-camel_imap4_search_new (CamelIMAP4Engine *engine, const char *cachedir)
+camel_imap4_search_new (CamelIMAP4Engine *engine, const gchar *cachedir)
{
CamelIMAP4Search *search;
@@ -107,7 +107,7 @@ untagged_search (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
CamelFolderSummary *summary = ((CamelFolder *) engine->folder)->summary;
GPtrArray *matches = ic->user_data;
CamelMessageInfo *info;
- char uid[12];
+ gchar uid[12];
while (1) {
if (camel_imap4_engine_next_token (engine, token, ex) == -1)
@@ -121,7 +121,7 @@ untagged_search (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
sprintf (uid, "%u", token->v.number);
if ((info = camel_folder_summary_uid (summary, uid))) {
- g_ptr_array_add (matches, (char *) camel_message_info_uid (info));
+ g_ptr_array_add (matches, (gchar *) camel_message_info_uid (info));
camel_message_info_free (info);
}
}
@@ -136,21 +136,21 @@ untagged_search (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
}
static ESExpResult *
-imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+imap4_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
CamelIMAP4Search *imap4_search = (CamelIMAP4Search *) search;
CamelIMAP4Engine *engine = imap4_search->engine;
GPtrArray *strings, *matches, *infos;
- register const unsigned char *inptr;
+ register const guchar *inptr;
gboolean utf8_search = FALSE;
GPtrArray *summary_set;
CamelMessageInfo *info;
CamelIMAP4Command *ic;
- const char *expr;
+ const gchar *expr;
ESExpResult *r;
- int id, i, n;
+ gint id, i, n;
size_t used;
- char *set;
+ gchar *set;
if (((CamelOfflineStore *) engine->service)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return parent_class->body_contains (f, argc, argv, search);
@@ -181,7 +181,7 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
r->value.ptrarray->len = summary_set->len;
for (i = 0; i < summary_set->len; i++) {
info = g_ptr_array_index (summary_set, i);
- r->value.ptrarray->pdata[i] = (char *) camel_message_info_uid (info);
+ r->value.ptrarray->pdata[i] = (gchar *) camel_message_info_uid (info);
}
}
@@ -193,7 +193,7 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
if (argv[i]->type == ESEXP_RES_STRING && argv[i]->value.string[0] != '\0') {
g_ptr_array_add (strings, argv[i]->value.string);
if (!utf8_search) {
- inptr = (unsigned char *) argv[i]->value.string;
+ inptr = (guchar *) argv[i]->value.string;
while (*inptr != '\0') {
if (!isascii ((int) *inptr)) {
utf8_search = TRUE;
@@ -220,7 +220,7 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
r->value.ptrarray->len = summary_set->len;
for (i = 0; i < summary_set->len; i++) {
info = g_ptr_array_index (summary_set, i);
- r->value.ptrarray->pdata[i] = (char *) camel_message_info_uid (info);
+ r->value.ptrarray->pdata[i] = (gchar *) camel_message_info_uid (info);
}
}
@@ -266,7 +266,7 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
if (ic->result == CAMEL_IMAP4_RESULT_NO && utf8_search && (engine->capa & CAMEL_IMAP4_CAPABILITY_utf8_search)) {
- int j;
+ gint j;
/* might be because the server is lame and doesn't support UTF-8 */
for (j = 0; j < ic->resp_codes->len; j++) {
@@ -294,7 +294,7 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
g_ptr_array_free (infos, TRUE);
if (search->current) {
- const char *uid;
+ const gchar *uid;
uid = camel_message_info_uid (search->current);
r = e_sexp_result_new (f, ESEXP_RES_BOOL);
diff --git a/camel/providers/imap4/camel-imap4-search.h b/camel/providers/imap4/camel-imap4-search.h
index 9f70c8a48..59580abcd 100644
--- a/camel/providers/imap4/camel-imap4-search.h
+++ b/camel/providers/imap4/camel-imap4-search.h
@@ -53,7 +53,7 @@ struct _CamelIMAP4Search {
/* cache of body search matches */
CamelDList matches;
GHashTable *matches_hash;
- unsigned int matches_count;
+ guint matches_count;
};
struct _CamelIMAP4SearchClass {
@@ -64,7 +64,7 @@ struct _CamelIMAP4SearchClass {
CamelType camel_imap4_search_get_type (void);
-CamelFolderSearch *camel_imap4_search_new (struct _CamelIMAP4Engine *engine, const char *cachedir);
+CamelFolderSearch *camel_imap4_search_new (struct _CamelIMAP4Engine *engine, const gchar *cachedir);
G_END_DECLS
diff --git a/camel/providers/imap4/camel-imap4-specials.c b/camel/providers/imap4/camel-imap4-specials.c
index 05486ca3a..db94a3812 100644
--- a/camel/providers/imap4/camel-imap4-specials.c
+++ b/camel/providers/imap4/camel-imap4-specials.c
@@ -33,7 +33,7 @@
#define CHARS_QUOTED_SPECIALS "\\\""
#define CHARS_LIST_WILDCARDS "*%"
-unsigned char camel_imap4_specials[256] = {
+guchar camel_imap4_specials[256] = {
2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 2, 2, 6, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
20, 0, 8, 0, 0, 32, 0, 0, 1, 1, 32, 0, 0, 0, 0, 0,
@@ -54,9 +54,9 @@ unsigned char camel_imap4_specials[256] = {
static void
-imap4_init_bits (unsigned short bit, unsigned short bitcopy, int remove, unsigned char *vals)
+imap4_init_bits (unsigned short bit, unsigned short bitcopy, gint remove, guchar *vals)
{
- int i, len = strlen (vals);
+ gint i, len = strlen (vals);
if (!remove) {
for (i = 0; i < len; i++)
@@ -85,7 +85,7 @@ imap4_init_bits (unsigned short bit, unsigned short bitcopy, int remove, unsigne
void
camel_imap4_specials_init (void)
{
- int i;
+ gint i;
for (i = 0; i < 256; i++) {
camel_imap4_specials[i] = 0;
diff --git a/camel/providers/imap4/camel-imap4-specials.h b/camel/providers/imap4/camel-imap4-specials.h
index b8a13a9c9..b0456745a 100644
--- a/camel/providers/imap4/camel-imap4-specials.h
+++ b/camel/providers/imap4/camel-imap4-specials.h
@@ -36,7 +36,7 @@ enum {
IS_WILDCARD = (1 << 5),
};
-extern unsigned char camel_imap4_specials[256];
+extern guchar camel_imap4_specials[256];
#define is_atom(x) ((camel_imap4_specials[(unsigned char)(x)] & (IS_ASPECIAL|IS_SPACE|IS_CTRL|IS_WILDCARD|IS_QSPECIAL)) == 0)
#define is_ctrl(x) ((camel_imap4_specials[(unsigned char)(x)] & IS_CTRL) != 0)
diff --git a/camel/providers/imap4/camel-imap4-store-summary.c b/camel/providers/imap4/camel-imap4-store-summary.c
index 5eee60735..da852d8f1 100644
--- a/camel/providers/imap4/camel-imap4-store-summary.c
+++ b/camel/providers/imap4/camel-imap4-store-summary.c
@@ -46,11 +46,11 @@ static void camel_imap4_store_summary_class_init (CamelIMAP4StoreSummaryClass *k
static void camel_imap4_store_summary_init (CamelIMAP4StoreSummary *obj);
static void camel_imap4_store_summary_finalize (CamelObject *obj);
-static int summary_header_load (CamelStoreSummary *s, FILE *in);
-static int summary_header_save (CamelStoreSummary *s, FILE *out);
+static gint summary_header_load (CamelStoreSummary *s, FILE *in);
+static gint summary_header_save (CamelStoreSummary *s, FILE *out);
static CamelStoreInfo *store_info_load (CamelStoreSummary *s, FILE *in);
-static int store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *info);
+static gint store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *info);
static void store_info_free (CamelStoreSummary *s, CamelStoreInfo *info);
@@ -140,7 +140,7 @@ load_namespaces (FILE *in)
for (i = 0; i < n; i++) {
guint32 sep;
- char *path;
+ gchar *path;
if (camel_file_util_decode_string (in, &path) == -1)
goto exception;
@@ -353,7 +353,7 @@ static CamelFolderInfo *
store_info_to_folder_info (CamelStoreSummary *s, CamelStoreInfo *si)
{
CamelFolderInfo *fi;
- const char *name;
+ const gchar *name;
fi = camel_folder_info_new ();
fi->full_name = g_strdup (camel_store_info_path (s, si));
@@ -375,14 +375,14 @@ store_info_to_folder_info (CamelStoreSummary *s, CamelStoreInfo *si)
CamelFolderInfo *
-camel_imap4_store_summary_get_folder_info (CamelIMAP4StoreSummary *s, const char *top, guint32 flags)
+camel_imap4_store_summary_get_folder_info (CamelIMAP4StoreSummary *s, const gchar *top, guint32 flags)
{
CamelStoreSummary *ss = (CamelStoreSummary *) s;
CamelFolderInfo *fi;
GPtrArray *folders;
CamelStoreInfo *si;
size_t toplen, len;
- int i;
+ gint i;
toplen = strlen (top);
folders = g_ptr_array_new ();
diff --git a/camel/providers/imap4/camel-imap4-store-summary.h b/camel/providers/imap4/camel-imap4-store-summary.h
index cc703b1af..633525970 100644
--- a/camel/providers/imap4/camel-imap4-store-summary.h
+++ b/camel/providers/imap4/camel-imap4-store-summary.h
@@ -79,7 +79,7 @@ void camel_imap4_store_summary_note_info (CamelIMAP4StoreSummary *s, struct _Cam
void camel_imap4_store_summary_unnote_info (CamelIMAP4StoreSummary *s, struct _CamelFolderInfo *fi);
-struct _CamelFolderInfo *camel_imap4_store_summary_get_folder_info (CamelIMAP4StoreSummary *s, const char *top, guint32 flags);
+struct _CamelFolderInfo *camel_imap4_store_summary_get_folder_info (CamelIMAP4StoreSummary *s, const gchar *top, guint32 flags);
G_END_DECLS
diff --git a/camel/providers/imap4/camel-imap4-store.c b/camel/providers/imap4/camel-imap4-store.c
index 418379548..9caaefd0d 100644
--- a/camel/providers/imap4/camel-imap4-store.c
+++ b/camel/providers/imap4/camel-imap4-store.c
@@ -60,22 +60,22 @@ static void camel_imap4_store_finalize (CamelObject *object);
static void imap4_construct (CamelService *service, CamelSession *session,
CamelProvider *provider, CamelURL *url,
CamelException *ex);
-static char *imap4_get_name (CamelService *service, gboolean brief);
+static gchar *imap4_get_name (CamelService *service, gboolean brief);
static gboolean imap4_connect (CamelService *service, CamelException *ex);
static gboolean imap4_reconnect (CamelIMAP4Engine *engine, CamelException *ex);
static gboolean imap4_disconnect (CamelService *service, gboolean clean, CamelException *ex);
static GList *imap4_query_auth_types (CamelService *service, CamelException *ex);
/* store methods */
-static CamelFolder *imap4_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static CamelFolderInfo *imap4_create_folder (CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
-static void imap4_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static void imap4_rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex);
-static CamelFolderInfo *imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
+static CamelFolder *imap4_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex);
+static CamelFolderInfo *imap4_create_folder (CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex);
+static void imap4_delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void imap4_rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name, CamelException *ex);
+static CamelFolderInfo *imap4_get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
static void imap4_free_folder_info (CamelStore *store, CamelFolderInfo *fi);
-static void imap4_subscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static void imap4_unsubscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static gboolean imap4_folder_subscribed (CamelStore *store, const char *folder_name);
+static void imap4_subscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void imap4_unsubscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex);
+static gboolean imap4_folder_subscribed (CamelStore *store, const gchar *folder_name);
static void imap4_noop (CamelStore *store, CamelException *ex);
@@ -180,7 +180,7 @@ static void
imap4_construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
{
CamelIMAP4Store *store = (CamelIMAP4Store *) service;
- char *buf;
+ gchar *buf;
CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
if (camel_exception_is_set (ex))
@@ -207,7 +207,7 @@ imap4_construct (CamelService *service, CamelSession *session, CamelProvider *pr
camel_store_summary_load ((CamelStoreSummary *) store->summary);
}
-static char *
+static gchar *
imap4_get_name (CamelService *service, gboolean brief)
{
if (brief)
@@ -229,14 +229,14 @@ enum {
#endif
static gboolean
-connect_to_server (CamelIMAP4Engine *engine, struct addrinfo *ai, int ssl_mode, CamelException *ex)
+connect_to_server (CamelIMAP4Engine *engine, struct addrinfo *ai, gint ssl_mode, CamelException *ex)
{
CamelService *service = engine->service;
CamelSockOptData sockopt;
CamelStream *tcp_stream;
#ifdef HAVE_SSL
CamelIMAP4Command *ic;
- int id;
+ gint id;
#endif
if (ssl_mode != MODE_CLEAR) {
@@ -343,10 +343,10 @@ connect_to_server (CamelIMAP4Engine *engine, struct addrinfo *ai, int ssl_mode,
}
static struct {
- char *value;
- char *serv;
- char *port;
- int mode;
+ gchar *value;
+ gchar *serv;
+ gchar *port;
+ gint mode;
} ssl_options[] = {
{ "", "imaps", "993", MODE_SSL }, /* really old (1.x) */
{ "always", "imaps", "993", MODE_SSL },
@@ -360,10 +360,10 @@ connect_to_server_wrapper (CamelIMAP4Engine *engine, CamelException *ex)
{
CamelService *service = engine->service;
struct addrinfo *ai, hints;
- const char *ssl_mode;
- int mode, ret, i;
- const char *port;
- char *serv;
+ const gchar *ssl_mode;
+ gint mode, ret, i;
+ const gchar *port;
+ gchar *serv;
if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
for (i = 0; ssl_options[i].value; i++)
@@ -404,11 +404,11 @@ connect_to_server_wrapper (CamelIMAP4Engine *engine, CamelException *ex)
}
static int
-sasl_auth (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, const unsigned char *linebuf, size_t linelen, CamelException *ex)
+sasl_auth (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, const guchar *linebuf, size_t linelen, CamelException *ex)
{
/* Perform a single challenge iteration */
CamelSasl *sasl = ic->user_data;
- char *challenge;
+ gchar *challenge;
if (camel_sasl_authenticated (sasl)) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
@@ -423,7 +423,7 @@ sasl_auth (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, const unsigned char
if (*linebuf == '\0')
linebuf = NULL;
- if (!(challenge = camel_sasl_challenge_base64 (sasl, (const char *) linebuf, ex)))
+ if (!(challenge = camel_sasl_challenge_base64 (sasl, (const gchar *) linebuf, ex)))
return -1;
d(fprintf (stderr, "sending : %s\r\n", challenge));
@@ -442,22 +442,22 @@ sasl_auth (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, const unsigned char
}
static int
-imap4_try_authenticate (CamelIMAP4Engine *engine, gboolean reprompt, const char *errmsg, CamelException *ex)
+imap4_try_authenticate (CamelIMAP4Engine *engine, gboolean reprompt, const gchar *errmsg, CamelException *ex)
{
CamelService *service = engine->service;
CamelSession *session = service->session;
CamelServiceAuthType *mech = NULL;
CamelSasl *sasl = NULL;
CamelIMAP4Command *ic;
- int id;
+ gint id;
if (service->url->authmech)
mech = g_hash_table_lookup (engine->authtypes, service->url->authmech);
if ((!mech || (mech && mech->need_password)) && !service->url->passwd) {
guint32 flags = CAMEL_SESSION_PASSWORD_SECRET;
- char *base_prompt;
- char *full_prompt;
+ gchar *base_prompt;
+ gchar *full_prompt;
if (reprompt)
flags |= CAMEL_SESSION_PASSWORD_REPROMPT;
@@ -524,7 +524,7 @@ imap4_reconnect (CamelIMAP4Engine *engine, CamelException *ex)
{
CamelService *service = engine->service;
gboolean reprompt = FALSE;
- char *errmsg = NULL;
+ gchar *errmsg = NULL;
CamelException lex;
if (!connect_to_server_wrapper (engine, ex))
@@ -590,7 +590,7 @@ imap4_disconnect (CamelService *service, gboolean clean, CamelException *ex)
{
CamelIMAP4Store *store = (CamelIMAP4Store *) service;
CamelIMAP4Command *ic;
- int id;
+ gint id;
if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return TRUE;
@@ -641,12 +641,12 @@ imap4_query_auth_types (CamelService *service, CamelException *ex)
return g_list_prepend (sasl_types, &camel_imap4_password_authtype);
}
-static char *
-imap4_folder_utf7_name (CamelStore *store, const char *folder_name, char wildcard)
+static gchar *
+imap4_folder_utf7_name (CamelStore *store, const gchar *folder_name, gchar wildcard)
{
- char *real_name, *p;
- char sep = '\0';
- int len;
+ gchar *real_name, *p;
+ gchar sep = '\0';
+ gint len;
if (*folder_name) {
sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, folder_name);
@@ -682,7 +682,7 @@ imap4_folder_utf7_name (CamelStore *store, const char *folder_name, char wildcar
}
static CamelFolder *
-imap4_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+imap4_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
CamelFolder *folder = NULL;
@@ -690,9 +690,9 @@ imap4_get_folder (CamelStore *store, const char *folder_name, guint32 flags, Cam
CamelIMAP4Command *ic;
CamelFolderInfo *fi;
GPtrArray *array;
- char *utf7_name;
- int create;
- int id, i;
+ gchar *utf7_name;
+ gint create;
+ gint id, i;
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
@@ -746,9 +746,9 @@ imap4_get_folder (CamelStore *store, const char *folder_name, guint32 flags, Cam
camel_imap4_command_unref (ic);
if (create) {
- const char *basename;
- char *parent;
- int len;
+ const gchar *basename;
+ gchar *parent;
+ gint len;
if (!(flags & CAMEL_STORE_FOLDER_CREATE))
goto done;
@@ -780,15 +780,15 @@ imap4_get_folder (CamelStore *store, const char *folder_name, guint32 flags, Cam
static gboolean
-imap4_folder_can_contain_folders (CamelStore *store, const char *folder_name, CamelException *ex)
+imap4_folder_can_contain_folders (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
guint32 flags = CAMEL_FOLDER_NOINFERIORS;
camel_imap4_list_t *list;
CamelIMAP4Command *ic;
GPtrArray *array;
- char *utf7_name;
- int id, i;
+ gchar *utf7_name;
+ gint id, i;
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
@@ -851,15 +851,15 @@ imap4_folder_can_contain_folders (CamelStore *store, const char *folder_name, Ca
}
static CamelFolderInfo *
-imap4_folder_create (CamelStore *store, const char *folder_name, const char *subfolder_hint, CamelException *ex)
+imap4_folder_create (CamelStore *store, const gchar *folder_name, const gchar *subfolder_hint, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
CamelFolderInfo *fi = NULL;
CamelIMAP4Command *ic;
- char *utf7_name;
+ gchar *utf7_name;
CamelURL *url;
- const char *c;
- int id;
+ const gchar *c;
+ gint id;
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
@@ -921,11 +921,11 @@ imap4_folder_create (CamelStore *store, const char *folder_name, const char *sub
}
static gboolean
-imap4_folder_recreate (CamelStore *store, const char *folder_name, CamelException *ex)
+imap4_folder_recreate (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelFolderInfo *fi = NULL;
- char hint[2];
- char sep;
+ gchar hint[2];
+ gchar sep;
sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, folder_name);
sprintf (hint, "%c", sep);
@@ -943,12 +943,12 @@ imap4_folder_recreate (CamelStore *store, const char *folder_name, CamelExceptio
}
static CamelFolderInfo *
-imap4_create_folder (CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
+imap4_create_folder (CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
{
CamelFolderInfo *fi = NULL;
- const char *c;
- char *name;
- char sep;
+ const gchar *c;
+ gchar *name;
+ gchar sep;
sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, parent_name);
@@ -997,16 +997,16 @@ imap4_create_folder (CamelStore *store, const char *parent_name, const char *fol
}
static void
-imap4_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+imap4_delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
CamelFolder *selected = (CamelFolder *) engine->folder;
CamelIMAP4Command *ic, *ic0 = NULL;
CamelFolderInfo *fi;
- char *utf7_name;
+ gchar *utf7_name;
CamelURL *url;
- const char *p;
- int id;
+ const gchar *p;
+ gint id;
if (!g_ascii_strcasecmp (folder_name, "INBOX")) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -1092,12 +1092,12 @@ imap4_delete_folder (CamelStore *store, const char *folder_name, CamelException
}
static void
-imap4_rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex)
+imap4_rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
- char *old_uname, *new_uname;
+ gchar *old_uname, *new_uname;
CamelIMAP4Command *ic;
- int id;
+ gint id;
if (!g_ascii_strcasecmp (old_name, "INBOX")) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -1164,7 +1164,7 @@ static void
list_remove_duplicates (GPtrArray *array)
{
camel_imap4_list_t *list, *last;
- int i;
+ gint i;
last = array->pdata[0];
for (i = 1; i < array->len; i++) {
@@ -1178,10 +1178,10 @@ list_remove_duplicates (GPtrArray *array)
}
}
-static char *
+static gchar *
list_parent (camel_imap4_list_t *mbox)
{
- const char *d;
+ const gchar *d;
if (!(d = strrchr (mbox->name, mbox->delim)))
return NULL;
@@ -1191,9 +1191,9 @@ list_parent (camel_imap4_list_t *mbox)
/* bloody glib... GPtrArray doesn't have an insert method */
static void
-array_insert (GPtrArray *array, int index, void *data)
+array_insert (GPtrArray *array, gint index, gpointer data)
{
- int i;
+ gint i;
if ((index + 1) == array->len) {
/* special case, adding to the end of the array */
@@ -1222,8 +1222,8 @@ list_add_ghosts (GPtrArray *array)
{
camel_imap4_list_t *mbox;
GHashTable *list_hash;
- char delim, *parent;
- int i = 0;
+ gchar delim, *parent;
+ gint i = 0;
list_hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1264,8 +1264,8 @@ imap4_status (CamelStore *store, CamelFolderInfo *fi)
camel_imap4_status_t *status;
CamelIMAP4Command *ic;
GPtrArray *array;
- char *mailbox;
- int id, i;
+ gchar *mailbox;
+ gint id, i;
mailbox = imap4_folder_utf7_name (store, fi->full_name, '\0');
ic = camel_imap4_engine_queue (engine, NULL, "STATUS %S (MESSAGES UNSEEN)\r\n", mailbox);
@@ -1311,8 +1311,8 @@ imap4_subscription_info (CamelStore *store, CamelFolderInfo *fi)
camel_imap4_list_t *lsub;
CamelIMAP4Command *ic;
GPtrArray *array;
- char *mailbox;
- int id, i;
+ gchar *mailbox;
+ gint id, i;
mailbox = imap4_folder_utf7_name (store, fi->full_name, '\0');
ic = camel_imap4_engine_queue (engine, NULL, "LSUB \"\" %S\r\n", mailbox);
@@ -1337,16 +1337,16 @@ imap4_subscription_info (CamelStore *store, CamelFolderInfo *fi)
}
static CamelFolderInfo *
-imap4_build_folder_info (CamelStore *store, const char *top, guint32 flags, GPtrArray *array)
+imap4_build_folder_info (CamelStore *store, const gchar *top, guint32 flags, GPtrArray *array)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
CamelFolder *folder = (CamelFolder *) engine->folder;
gboolean lsub = (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED);
camel_imap4_list_t *list;
CamelFolderInfo *fi;
- char *name, *p;
+ gchar *name, *p;
CamelURL *url;
- int i;
+ gint i;
if (array->len == 0) {
g_ptr_array_free (array, TRUE);
@@ -1424,18 +1424,18 @@ imap4_build_folder_info (CamelStore *store, const char *top, guint32 flags, GPtr
}
static CamelFolderInfo *
-imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+imap4_get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
CamelIMAP4Command *ic, *ic0 = NULL, *ic1 = NULL;
CamelFolderInfo *inbox = NULL, *fi = NULL;
- const char *base, *namespace;
+ const gchar *base, *namespace;
camel_imap4_list_t *list;
GPtrArray *array;
- const char *cmd;
- char *pattern;
- char wildcard;
- int id, i;
+ const gchar *cmd;
+ gchar *pattern;
+ gchar wildcard;
+ gint id, i;
if (top == NULL)
top = "";
@@ -1514,7 +1514,7 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
if (*top != '\0') {
size_t len;
- char sep;
+ gchar sep;
len = strlen (pattern);
sep = pattern[len - 2];
@@ -1609,11 +1609,11 @@ imap4_free_folder_info (CamelStore *store, CamelFolderInfo *fi)
}
static gboolean
-imap4_folder_subscribed (CamelStore *store, const char *folder_name)
+imap4_folder_subscribed (CamelStore *store, const gchar *folder_name)
{
CamelIMAP4Store *imap4_store = (CamelIMAP4Store *) store;
CamelStoreInfo *si;
- int truth = FALSE;
+ gint truth = FALSE;
if ((si = camel_store_summary_path ((CamelStoreSummary *) imap4_store->summary, folder_name))) {
truth = (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) != 0;
@@ -1624,15 +1624,15 @@ imap4_folder_subscribed (CamelStore *store, const char *folder_name)
}
static void
-imap4_subscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+imap4_subscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
CamelIMAP4Command *ic;
CamelFolderInfo *fi;
- char *utf7_name;
+ gchar *utf7_name;
CamelURL *url;
- const char *p;
- int id;
+ const gchar *p;
+ gint id;
if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot subscribe to IMAP folders in offline mode."));
@@ -1696,15 +1696,15 @@ imap4_subscribe_folder (CamelStore *store, const char *folder_name, CamelExcepti
}
static void
-imap4_unsubscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+imap4_unsubscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
CamelIMAP4Command *ic;
CamelFolderInfo *fi;
- char *utf7_name;
+ gchar *utf7_name;
CamelURL *url;
- const char *p;
- int id;
+ const gchar *p;
+ gint id;
if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot unsubscribe from IMAP folders in offline mode."));
@@ -1773,7 +1773,7 @@ imap4_noop (CamelStore *store, CamelException *ex)
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
CamelFolder *folder = (CamelFolder *) engine->folder;
CamelIMAP4Command *ic;
- int id;
+ gint id;
if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return;
diff --git a/camel/providers/imap4/camel-imap4-store.h b/camel/providers/imap4/camel-imap4-store.h
index f70687746..5ef6449ac 100644
--- a/camel/providers/imap4/camel-imap4-store.h
+++ b/camel/providers/imap4/camel-imap4-store.h
@@ -44,7 +44,7 @@ struct _CamelIMAP4Store {
struct _CamelIMAP4StoreSummary *summary;
struct _CamelIMAP4Engine *engine;
- char *storage_path;
+ gchar *storage_path;
};
struct _CamelIMAP4StoreClass {
diff --git a/camel/providers/imap4/camel-imap4-stream.c b/camel/providers/imap4/camel-imap4-stream.c
index cc7513024..7e5190632 100644
--- a/camel/providers/imap4/camel-imap4-stream.c
+++ b/camel/providers/imap4/camel-imap4-stream.c
@@ -43,10 +43,10 @@ static void camel_imap4_stream_class_init (CamelIMAP4StreamClass *klass);
static void camel_imap4_stream_init (CamelIMAP4Stream *stream, CamelIMAP4StreamClass *klass);
static void camel_imap4_stream_finalize (CamelObject *object);
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
+static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
static gboolean stream_eos (CamelStream *stream);
@@ -123,7 +123,7 @@ camel_imap4_stream_finalize (CamelObject *object)
static ssize_t
imap4_fill (CamelIMAP4Stream *imap4)
{
- unsigned char *inbuf, *inptr, *inend;
+ guchar *inbuf, *inptr, *inend;
ssize_t nread;
size_t inlen;
@@ -172,7 +172,7 @@ imap4_fill (CamelIMAP4Stream *imap4)
}
static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
+stream_read (CamelStream *stream, gchar *buffer, size_t n)
{
CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
ssize_t len, nread = 0;
@@ -211,7 +211,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+stream_write (CamelStream *stream, const gchar *buffer, size_t n)
{
CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
ssize_t nwritten;
@@ -293,7 +293,7 @@ camel_imap4_stream_new (CamelStream *stream)
#define token_save(imap4, start, len) G_STMT_START { \
if (imap4->tokenleft <= len) { \
- unsigned int tlen, toff; \
+ guint tlen, toff; \
\
tlen = toff = imap4->tokenptr - imap4->tokenbuf; \
tlen = tlen ? tlen : 1; \
@@ -327,15 +327,15 @@ camel_imap4_stream_new (CamelStream *stream)
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *token)
{
- register unsigned char *inptr;
- unsigned char *inend, *start, *p;
+ register guchar *inptr;
+ guchar *inend, *start, *p;
gboolean escaped = FALSE;
size_t literal = 0;
guint32 nz_number;
- int ret;
+ gint ret;
g_return_val_if_fail (CAMEL_IS_IMAP4_STREAM (stream), -1);
g_return_val_if_fail (stream->mode != CAMEL_IMAP4_STREAM_MODE_LITERAL, -1);
@@ -484,7 +484,7 @@ camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *to
} else if (*inptr >= '0' && *inptr <= '9') {
/* number token */
*inend = '\0';
- nz_number = strtoul ((char *) inptr, (char **) &start, 10);
+ nz_number = strtoul ((gchar *) inptr, (gchar **) &start, 10);
if (start == inend)
goto refill;
@@ -600,7 +600,7 @@ camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *to
*
* Returns: 0 on success or -1 on fail.
**/
-int
+gint
camel_imap4_stream_unget_token (CamelIMAP4Stream *stream, camel_imap4_token_t *token)
{
if (stream->have_unget)
@@ -628,11 +628,11 @@ camel_imap4_stream_unget_token (CamelIMAP4Stream *stream, camel_imap4_token_t *t
* Returns: -1 on error, 0 if the line read is complete, or 1 if the
* read is incomplete.
**/
-int
-camel_imap4_stream_line (CamelIMAP4Stream *stream, unsigned char **line, size_t *len)
+gint
+camel_imap4_stream_line (CamelIMAP4Stream *stream, guchar **line, size_t *len)
{
- register unsigned char *inptr;
- unsigned char *inend;
+ register guchar *inptr;
+ guchar *inend;
g_return_val_if_fail (CAMEL_IS_IMAP4_STREAM (stream), -1);
g_return_val_if_fail (stream->mode != CAMEL_IMAP4_STREAM_MODE_LITERAL, -1);
@@ -690,10 +690,10 @@ camel_imap4_stream_line (CamelIMAP4Stream *stream, unsigned char **line, size_t
* Returns: >0 if more literal data exists, 0 if the end of the literal
* has been reached or -1 on fail.
**/
-int
-camel_imap4_stream_literal (CamelIMAP4Stream *stream, unsigned char **literal, size_t *len)
+gint
+camel_imap4_stream_literal (CamelIMAP4Stream *stream, guchar **literal, size_t *len)
{
- unsigned char *inptr, *inend;
+ guchar *inptr, *inend;
size_t nread;
g_return_val_if_fail (CAMEL_IS_IMAP4_STREAM (stream), -1);
diff --git a/camel/providers/imap4/camel-imap4-stream.h b/camel/providers/imap4/camel-imap4-stream.h
index 6ad7f3fa0..18a94790b 100644
--- a/camel/providers/imap4/camel-imap4-stream.h
+++ b/camel/providers/imap4/camel-imap4-stream.h
@@ -47,7 +47,7 @@ enum {
CAMEL_IMAP4_TOKEN_NUMBER = -3,
CAMEL_IMAP4_TOKEN_QSTRING = -2,
CAMEL_IMAP4_TOKEN_LITERAL = -1,
- /* CAMEL_IMAP4_TOKEN_CHAR would just be the char we got */
+ /* CAMEL_IMAP4_TOKEN_CHAR would just be the gchar we got */
CAMEL_IMAP4_TOKEN_EOLN = '\n',
CAMEL_IMAP4_TOKEN_LPAREN = '(',
CAMEL_IMAP4_TOKEN_RPAREN = ')',
@@ -58,11 +58,11 @@ enum {
};
typedef struct _camel_imap4_token_t {
- int token;
+ gint token;
union {
- char *atom;
- char *flag;
- char *qstring;
+ gchar *atom;
+ gchar *flag;
+ gchar *qstring;
size_t literal;
guint32 number;
} v;
@@ -86,15 +86,15 @@ struct _CamelIMAP4Stream {
size_t literal;
/* i/o buffers */
- unsigned char realbuf[IMAP4_READ_PRELEN + IMAP4_READ_BUFLEN + 1];
- unsigned char *inbuf;
- unsigned char *inptr;
- unsigned char *inend;
+ guchar realbuf[IMAP4_READ_PRELEN + IMAP4_READ_BUFLEN + 1];
+ guchar *inbuf;
+ guchar *inptr;
+ guchar *inend;
/* token buffers */
- unsigned char *tokenbuf;
- unsigned char *tokenptr;
- unsigned int tokenleft;
+ guchar *tokenbuf;
+ guchar *tokenptr;
+ guint tokenleft;
camel_imap4_token_t unget;
};
@@ -111,11 +111,11 @@ CamelType camel_imap4_stream_get_type (void);
CamelStream *camel_imap4_stream_new (CamelStream *stream);
-int camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *token);
-int camel_imap4_stream_unget_token (CamelIMAP4Stream *stream, camel_imap4_token_t *token);
+gint camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *token);
+gint camel_imap4_stream_unget_token (CamelIMAP4Stream *stream, camel_imap4_token_t *token);
-int camel_imap4_stream_line (CamelIMAP4Stream *stream, unsigned char **line, size_t *len);
-int camel_imap4_stream_literal (CamelIMAP4Stream *stream, unsigned char **literal, size_t *len);
+gint camel_imap4_stream_line (CamelIMAP4Stream *stream, guchar **line, size_t *len);
+gint camel_imap4_stream_literal (CamelIMAP4Stream *stream, guchar **literal, size_t *len);
G_END_DECLS
diff --git a/camel/providers/imap4/camel-imap4-summary.c b/camel/providers/imap4/camel-imap4-summary.c
index e294d3f43..64804a645 100644
--- a/camel/providers/imap4/camel-imap4-summary.c
+++ b/camel/providers/imap4/camel-imap4-summary.c
@@ -63,14 +63,14 @@ static void camel_imap4_summary_class_init (CamelIMAP4SummaryClass *klass);
static void camel_imap4_summary_init (CamelIMAP4Summary *summary, CamelIMAP4SummaryClass *klass);
static void camel_imap4_summary_finalize (CamelObject *object);
-static int imap4_header_load (CamelFolderSummary *summary, FILE *fin);
-static int imap4_header_save (CamelFolderSummary *summary, FILE *fout);
+static gint imap4_header_load (CamelFolderSummary *summary, FILE *fin);
+static gint imap4_header_save (CamelFolderSummary *summary, FILE *fout);
static CamelMessageInfo *imap4_message_info_new_from_header (CamelFolderSummary *summary, struct _camel_header_raw *header);
static CamelMessageInfo *imap4_message_info_load (CamelFolderSummary *summary, FILE *fin);
-static int imap4_message_info_save (CamelFolderSummary *summary, FILE *fout, CamelMessageInfo *info);
+static gint imap4_message_info_save (CamelFolderSummary *summary, FILE *fout, CamelMessageInfo *info);
static CamelMessageInfo *imap4_message_info_clone (CamelFolderSummary *summary, const CamelMessageInfo *mi);
static CamelMessageContentInfo *imap4_content_info_load (CamelFolderSummary *summary, FILE *in);
-static int imap4_content_info_save (CamelFolderSummary *summary, FILE *out, CamelMessageContentInfo *info);
+static gint imap4_content_info_save (CamelFolderSummary *summary, FILE *out, CamelMessageContentInfo *info);
static CamelFolderSummaryClass *parent_class = NULL;
@@ -163,7 +163,7 @@ imap4_header_load (CamelFolderSummary *summary, FILE *fin)
if (imap4_summary->version == 2) {
/* check that we have Mailing-List info */
- int have_mlist;
+ gint have_mlist;
if (camel_file_util_decode_fixed_int32 (fin, &have_mlist) == -1)
return -1;
@@ -200,12 +200,12 @@ imap4_header_save (CamelFolderSummary *summary, FILE *fout)
static int
envelope_decode_address (CamelIMAP4Engine *engine, GString *addrs, CamelException *ex)
{
- char *addr, *name = NULL, *user = NULL;
+ gchar *addr, *name = NULL, *user = NULL;
struct _camel_header_address *cia;
- unsigned char *literal = NULL;
+ guchar *literal = NULL;
camel_imap4_token_t token;
- const char *domain = NULL;
- int part = 0;
+ const gchar *domain = NULL;
+ gint part = 0;
size_t n;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
@@ -301,7 +301,7 @@ envelope_decode_address (CamelIMAP4Engine *engine, GString *addrs, CamelExceptio
}
static int
-envelope_decode_addresses (CamelIMAP4Engine *engine, char **addrlist, CamelException *ex)
+envelope_decode_addresses (CamelIMAP4Engine *engine, gchar **addrlist, CamelException *ex)
{
camel_imap4_token_t token;
GString *addrs;
@@ -349,9 +349,9 @@ envelope_decode_addresses (CamelIMAP4Engine *engine, char **addrlist, CamelExcep
static int
envelope_decode_date (CamelIMAP4Engine *engine, time_t *date, CamelException *ex)
{
- unsigned char *literal = NULL;
+ guchar *literal = NULL;
camel_imap4_token_t token;
- const char *nstring;
+ const gchar *nstring;
size_t n;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
@@ -386,10 +386,10 @@ envelope_decode_date (CamelIMAP4Engine *engine, time_t *date, CamelException *ex
}
static int
-envelope_decode_nstring (CamelIMAP4Engine *engine, char **nstring, gboolean rfc2047, CamelException *ex)
+envelope_decode_nstring (CamelIMAP4Engine *engine, gchar **nstring, gboolean rfc2047, CamelException *ex)
{
camel_imap4_token_t token;
- unsigned char *literal;
+ guchar *literal;
size_t n;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
@@ -431,7 +431,7 @@ envelope_decode_nstring (CamelIMAP4Engine *engine, char **nstring, gboolean rfc2
}
static CamelSummaryReferences *
-decode_references (const char *refstr, const char *irtstr)
+decode_references (const gchar *refstr, const gchar *irtstr)
{
struct _camel_header_references *refs, *irt, *r;
CamelSummaryReferences *references;
@@ -481,7 +481,7 @@ static int
decode_envelope (CamelIMAP4Engine *engine, CamelMessageInfo *info, camel_imap4_token_t *token, CamelException *ex)
{
CamelIMAP4MessageInfo *iinfo = (CamelIMAP4MessageInfo *) info;
- char *nstring, *msgid;
+ gchar *nstring, *msgid;
MD5Context checksum;
guint8 digest[16];
@@ -584,16 +584,16 @@ decode_envelope (CamelIMAP4Engine *engine, CamelMessageInfo *info, camel_imap4_t
return -1;
}
-static char *tm_months[] = {
+static gchar *tm_months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
static gboolean
-decode_time (const char **in, int *hour, int *min, int *sec)
+decode_time (const gchar **in, gint *hour, gint *min, gint *sec)
{
- register const unsigned char *inptr = (const unsigned char *) *in;
- int *val, colons = 0;
+ register const guchar *inptr = (const guchar *) *in;
+ gint *val, colons = 0;
*hour = *min = *sec = 0;
@@ -647,15 +647,15 @@ mktime_utc (struct tm *tm)
}
static time_t
-decode_internaldate (const char *in)
+decode_internaldate (const gchar *in)
{
- const char *inptr = in;
- int hour, min, sec, n;
+ const gchar *inptr = in;
+ gint hour, min, sec, n;
struct tm tm;
time_t date;
- char *buf;
+ gchar *buf;
- memset ((void *) &tm, 0, sizeof (struct tm));
+ memset ((gpointer) &tm, 0, sizeof (struct tm));
tm.tm_mday = strtoul (inptr, &buf, 10);
if (buf == inptr || *buf != '-')
@@ -736,7 +736,7 @@ static void
imap4_fetch_all_free (struct imap4_fetch_all_t *fetch)
{
struct imap4_envelope_t *envelope;
- int i;
+ gint i;
for (i = 0; i < fetch->added->len; i++) {
if (!(envelope = fetch->added->pdata[i]))
@@ -756,7 +756,7 @@ static void
courier_imap_show_error (CamelFolderSummary *summary, guint32 msg)
{
CamelSession *session = ((CamelService *) summary->folder->parent_store)->session;
- char *warning;
+ gchar *warning;
warning = g_strdup_printf ("IMAP server did not respond with an untagged FETCH response "
"for message #%u. This is illegal according to rfc3501 (and "
@@ -853,7 +853,7 @@ imap4_fetch_all_update (struct imap4_fetch_all_t *fetch)
CamelFolderChangeInfo *changes;
CamelMessageInfo *info;
guint32 flags;
- int total, i;
+ gint total, i;
changes = fetch->changes;
@@ -911,7 +911,7 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
CamelIMAP4MessageInfo *iinfo;
CamelMessageInfo *info;
guint32 changed = 0;
- char uid[16];
+ gchar uid[16];
if (index < fetch->first) {
/* This can happen if the connection to the
@@ -920,14 +920,14 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
* client expunged messages in the range
* before fetch->first in the period between
* our previous attempt and now. */
- size_t movelen = added->len * sizeof (void *);
+ size_t movelen = added->len * sizeof (gpointer);
size_t extra = index - fetch->first;
- void *dest;
+ gpointer dest;
g_assert (fetch->all);
g_ptr_array_set_size (added, added->len + extra);
- dest = ((char *) added->pdata) + (extra * sizeof (void *));
+ dest = ((gchar *) added->pdata) + (extra * sizeof (gpointer));
memmove (dest, added->pdata, movelen);
fetch->total += extra;
fetch->first = index;
@@ -976,7 +976,7 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
changed |= IMAP4_FETCH_ENVELOPE;
} else {
CamelMessageInfo *tmp;
- int rv;
+ gint rv;
g_warning ("Hmmm, server is sending us ENVELOPE data for a message we didn't ask for (message %u)\n",
index);
@@ -1025,7 +1025,7 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
changed |= IMAP4_FETCH_RFC822SIZE;
} else if (!strcmp (token->v.atom, "UID")) {
- const char *iuid;
+ const gchar *iuid;
if (camel_imap4_engine_next_token (engine, token, ex) == -1)
goto exception;
@@ -1043,7 +1043,7 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
} else {
g_free (info->uid);
info->uid = g_strdup (uid);
- g_hash_table_insert (fetch->uid_hash, (void *) camel_message_info_uid (info), envelope);
+ g_hash_table_insert (fetch->uid_hash, (gpointer) camel_message_info_uid (info), envelope);
changed |= IMAP4_FETCH_UID;
}
} else if (!strcmp (token->v.atom, "BODY[HEADER.FIELDS")) {
@@ -1051,9 +1051,9 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
CamelContentType *content_type;
struct _camel_header_raw *h;
CamelMimeParser *parser;
- unsigned char *literal;
- const char *refs, *str;
- char *mlist;
+ guchar *literal;
+ const gchar *refs, *str;
+ gchar *mlist;
size_t n;
/* '(' */
@@ -1192,10 +1192,10 @@ imap4_fetch_all_reset (CamelIMAP4Command *ic, struct imap4_fetch_all_t *fetch)
struct imap4_envelope_t *envelope;
CamelMessageInfo *info;
guint32 seqid, iuid;
- const char *query;
- char uid[32];
- int scount;
- int i;
+ const gchar *query;
+ gchar uid[32];
+ gint scount;
+ gint i;
/* sync everything we've gotten so far to the summary */
imap4_fetch_all_add (fetch, FALSE);
@@ -1249,14 +1249,14 @@ imap4_fetch_all_reset (CamelIMAP4Command *ic, struct imap4_fetch_all_t *fetch)
}
static CamelIMAP4Command *
-imap4_summary_fetch_all (CamelFolderSummary *summary, guint32 seqid, const char *uid)
+imap4_summary_fetch_all (CamelFolderSummary *summary, guint32 seqid, const gchar *uid)
{
CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
CamelFolder *folder = summary->folder;
struct imap4_fetch_all_t *fetch;
CamelIMAP4Engine *engine;
CamelIMAP4Command *ic;
- const char *query;
+ const gchar *query;
guint32 total;
engine = ((CamelIMAP4Store *) folder->parent_store)->engine;
@@ -1297,7 +1297,7 @@ imap4_summary_fetch_flags (CamelFolderSummary *summary)
CamelIMAP4Engine *engine;
CamelIMAP4Command *ic;
guint32 total;
- int scount;
+ gint scount;
engine = ((CamelIMAP4Store *) folder->parent_store)->engine;
@@ -1466,7 +1466,7 @@ imap4_summary_clear (CamelFolderSummary *summary, gboolean uncache)
{
CamelFolderChangeInfo *changes;
CamelMessageInfo *info;
- int i, count;
+ gint i, count;
changes = camel_folder_change_info_new ();
count = camel_folder_summary_count (summary);
@@ -1506,12 +1506,12 @@ camel_imap4_summary_set_uidvalidity (CamelFolderSummary *summary, guint32 uidval
}
void
-camel_imap4_summary_expunge (CamelFolderSummary *summary, int seqid)
+camel_imap4_summary_expunge (CamelFolderSummary *summary, gint seqid)
{
CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
CamelFolderChangeInfo *changes;
CamelMessageInfo *info;
- const char *uid;
+ const gchar *uid;
g_return_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary));
@@ -1550,7 +1550,7 @@ info_uid_sort (const CamelMessageInfo **info0, const CamelMessageInfo **info1)
}
#endif
-int
+gint
camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *ex)
{
CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) summary->folder;
@@ -1560,8 +1560,8 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *
CamelMessageInfo *info;
CamelIMAP4Command *ic;
guint32 iuid, seqid = 0;
- int scount, id;
- char uid[16];
+ gint scount, id;
+ gchar uid[16];
g_return_val_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary), -1);
diff --git a/camel/providers/imap4/camel-imap4-summary.h b/camel/providers/imap4/camel-imap4-summary.h
index 567d9455f..59862a7db 100644
--- a/camel/providers/imap4/camel-imap4-summary.h
+++ b/camel/providers/imap4/camel-imap4-summary.h
@@ -92,9 +92,9 @@ void camel_imap4_summary_set_uidnext (CamelFolderSummary *summary, guint32 uidne
void camel_imap4_summary_set_uidvalidity (CamelFolderSummary *summary, guint32 uidvalidity);
-void camel_imap4_summary_expunge (CamelFolderSummary *summary, int seqid);
+void camel_imap4_summary_expunge (CamelFolderSummary *summary, gint seqid);
-int camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *ex);
+gint camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/imap4/camel-imap4-utils.c b/camel/providers/imap4/camel-imap4-utils.c
index bcc07d986..90b9e1da0 100644
--- a/camel/providers/imap4/camel-imap4-utils.c
+++ b/camel/providers/imap4/camel-imap4-utils.c
@@ -45,13 +45,13 @@
CamelFolderInfo *
-camel_imap4_build_folder_info_tree (GPtrArray *array, const char *top)
+camel_imap4_build_folder_info_tree (GPtrArray *array, const gchar *top)
{
CamelFolderInfo *cur, *fi, *root = NULL;
- const char *p;
+ const gchar *p;
size_t n = 0;
- char *pname;
- int i;
+ gchar *pname;
+ gint i;
if (array->len == 0)
return NULL;
@@ -208,12 +208,12 @@ camel_imap4_namespace_list_free (CamelIMAP4NamespaceList *nsl)
char
-camel_imap4_get_path_delim (CamelIMAP4StoreSummary *s, const char *full_name)
+camel_imap4_get_path_delim (CamelIMAP4StoreSummary *s, const gchar *full_name)
{
CamelIMAP4Namespace *namespace;
- const char *slash;
+ const gchar *slash;
size_t len;
- char *top;
+ gchar *top;
g_return_val_if_fail (s->namespaces != NULL, '/');
@@ -265,7 +265,7 @@ struct _uidset_range {
struct _uidset_range *next;
guint32 first, last;
uint8_t buflen;
- char buf[24];
+ gchar buf[24];
};
struct _uidset {
@@ -308,9 +308,9 @@ uidset_add (struct _uidset *uidset, CamelMessageInfo *info)
{
GPtrArray *messages = uidset->summary->messages;
struct _uidset_range *node, *tail = uidset->tail;
- const char *iuid = camel_message_info_uid (info);
+ const gchar *iuid = camel_message_info_uid (info);
size_t uidlen, len;
- const char *colon;
+ const gchar *colon;
guint32 index;
/* Note: depends on integer overflow for initial 'add' */
@@ -373,12 +373,12 @@ uidset_add (struct _uidset *uidset, CamelMessageInfo *info)
return 1;
}
-static char *
+static gchar *
uidset_to_string (struct _uidset *uidset)
{
struct _uidset_range *range;
GString *string;
- char *str;
+ gchar *str;
string = g_string_new ("");
@@ -396,13 +396,13 @@ uidset_to_string (struct _uidset *uidset)
return str;
}
-int
-camel_imap4_get_uid_set (CamelIMAP4Engine *engine, CamelFolderSummary *summary, GPtrArray *infos, int cur, size_t linelen, char **set)
+gint
+camel_imap4_get_uid_set (CamelIMAP4Engine *engine, CamelFolderSummary *summary, GPtrArray *infos, gint cur, size_t linelen, gchar **set)
{
struct _uidset uidset;
size_t maxlen;
- int rv = 0;
- int i;
+ gint rv = 0;
+ gint i;
if (engine->maxlentype == CAMEL_IMAP4_ENGINE_MAXLEN_LINE)
maxlen = engine->maxlen - linelen;
@@ -471,7 +471,7 @@ camel_imap4_utils_set_unexpected_token_error (CamelException *ex, CamelIMAP4Engi
static struct {
- const char *name;
+ const gchar *name;
guint32 flag;
} imap4_flags[] = {
{ "\\Answered", CAMEL_MESSAGE_ANSWERED },
@@ -487,12 +487,12 @@ static struct {
{ "NonJunk", 0 },
};
-int
+gint
camel_imap4_parse_flags_list (CamelIMAP4Engine *engine, guint32 *flags, CamelException *ex)
{
camel_imap4_token_t token;
guint32 new = 0;
- int i;
+ gint i;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
return -1;
@@ -535,7 +535,7 @@ camel_imap4_parse_flags_list (CamelIMAP4Engine *engine, guint32 *flags, CamelExc
static struct {
- const char *name;
+ const gchar *name;
guint32 flag;
} list_flags[] = {
{ "\\Marked", CAMEL_IMAP4_FOLDER_MARKED },
@@ -546,17 +546,17 @@ static struct {
{ "\\HasNoChildren", CAMEL_FOLDER_NOCHILDREN },
};
-int
+gint
camel_imap4_untagged_list (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, camel_imap4_token_t *token, CamelException *ex)
{
GPtrArray *array = ic->user_data;
camel_imap4_list_t *list;
- unsigned char *buf;
+ guchar *buf;
guint32 flags = 0;
GString *literal;
- char delim;
+ gchar delim;
size_t n;
- int i;
+ gint i;
if (camel_imap4_engine_next_token (engine, token, ex) == -1)
return -1;
@@ -648,8 +648,8 @@ camel_imap4_untagged_list (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guin
static struct {
- const char *name;
- int type;
+ const gchar *name;
+ gint type;
} imap4_status[] = {
{ "MESSAGES", CAMEL_IMAP4_STATUS_MESSAGES },
{ "RECENT", CAMEL_IMAP4_STATUS_RECENT },
@@ -676,17 +676,17 @@ camel_imap4_status_free (camel_imap4_status_t *status)
}
-int
+gint
camel_imap4_untagged_status (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, camel_imap4_token_t *token, CamelException *ex)
{
camel_imap4_status_attr_t *attr, *tail, *list = NULL;
GPtrArray *array = ic->user_data;
camel_imap4_status_t *status;
- unsigned char *literal;
- char *mailbox;
+ guchar *literal;
+ gchar *mailbox;
size_t len;
- int type;
- int i;
+ gint type;
+ gint i;
if (camel_imap4_engine_next_token (engine, token, ex) == -1)
return -1;
@@ -702,7 +702,7 @@ camel_imap4_untagged_status (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, gu
if (camel_imap4_engine_literal (engine, &literal, &len, ex) == -1)
return -1;
- mailbox = (char *) literal;
+ mailbox = (gchar *) literal;
break;
default:
fprintf (stderr, "Unexpected token in IMAP4 untagged STATUS response: %s%c\n",
diff --git a/camel/providers/imap4/camel-imap4-utils.h b/camel/providers/imap4/camel-imap4-utils.h
index d534b955c..c08411ec0 100644
--- a/camel/providers/imap4/camel-imap4-utils.h
+++ b/camel/providers/imap4/camel-imap4-utils.h
@@ -49,19 +49,19 @@ struct _CamelIMAP4StoreSummary;
struct _CamelIMAP4NamespaceList;
struct _CamelIMAP4Namespace;
-struct _CamelFolderInfo *camel_imap4_build_folder_info_tree (GPtrArray *array, const char *top);
+struct _CamelFolderInfo *camel_imap4_build_folder_info_tree (GPtrArray *array, const gchar *top);
void camel_imap4_namespace_clear (struct _CamelIMAP4Namespace **ns);
struct _CamelIMAP4NamespaceList *camel_imap4_namespace_list_copy (const struct _CamelIMAP4NamespaceList *nsl);
void camel_imap4_namespace_list_free (struct _CamelIMAP4NamespaceList *nsl);
-char camel_imap4_get_path_delim (struct _CamelIMAP4StoreSummary *s, const char *full_name);
+gchar camel_imap4_get_path_delim (struct _CamelIMAP4StoreSummary *s, const gchar *full_name);
-int camel_imap4_get_uid_set (struct _CamelIMAP4Engine *engine, struct _CamelFolderSummary *summary, GPtrArray *infos, int cur, size_t linelen, char **set);
+gint camel_imap4_get_uid_set (struct _CamelIMAP4Engine *engine, struct _CamelFolderSummary *summary, GPtrArray *infos, gint cur, size_t linelen, gchar **set);
void camel_imap4_utils_set_unexpected_token_error (CamelException *ex, struct _CamelIMAP4Engine *engine, struct _camel_imap4_token_t *token);
-int camel_imap4_parse_flags_list (struct _CamelIMAP4Engine *engine, guint32 *flags, CamelException *ex);
+gint camel_imap4_parse_flags_list (struct _CamelIMAP4Engine *engine, guint32 *flags, CamelException *ex);
/* Note: make sure these don't clash with any bit flags in camel-store.h */
#define CAMEL_IMAP4_FOLDER_MARKED (1 << 17)
@@ -69,11 +69,11 @@ int camel_imap4_parse_flags_list (struct _CamelIMAP4Engine *engine, guint32 *fla
typedef struct {
guint32 flags;
- char delim;
- char *name;
+ gchar delim;
+ gchar *name;
} camel_imap4_list_t;
-int camel_imap4_untagged_list (struct _CamelIMAP4Engine *engine, struct _CamelIMAP4Command *ic,
+gint camel_imap4_untagged_list (struct _CamelIMAP4Engine *engine, struct _CamelIMAP4Command *ic,
guint32 index, struct _camel_imap4_token_t *token, CamelException *ex);
@@ -94,12 +94,12 @@ typedef struct _camel_imap4_status_attr {
typedef struct {
camel_imap4_status_attr_t *attr_list;
- char *mailbox;
+ gchar *mailbox;
} camel_imap4_status_t;
void camel_imap4_status_free (camel_imap4_status_t *status);
-int camel_imap4_untagged_status (struct _CamelIMAP4Engine *engine, struct _CamelIMAP4Command *ic,
+gint camel_imap4_untagged_status (struct _CamelIMAP4Engine *engine, struct _CamelIMAP4Command *ic,
guint32 index, struct _camel_imap4_token_t *token, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/imapp/camel-imapp-driver.c b/camel/providers/imapp/camel-imapp-driver.c
index 59f91b88a..198b2a95c 100644
--- a/camel/providers/imapp/camel-imapp-driver.c
+++ b/camel/providers/imapp/camel-imapp-driver.c
@@ -26,10 +26,10 @@
#define d(x)
-static int driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
-static int driver_resp_expunge(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
-static int driver_resp_exists(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
-static int driver_resp_list(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
+static gint driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
+static gint driver_resp_expunge(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
+static gint driver_resp_exists(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
+static gint driver_resp_list(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
static void driver_status(CamelIMAPPEngine *ie, struct _status_info *sinfo, CamelIMAPPDriver *sdata);
@@ -96,14 +96,14 @@ camel_imapp_driver_new(CamelIMAPPStream *stream)
}
void
-camel_imapp_driver_set_sasl_factory(CamelIMAPPDriver *id, CamelIMAPPSASLFunc get_sasl, void *sasl_data)
+camel_imapp_driver_set_sasl_factory(CamelIMAPPDriver *id, CamelIMAPPSASLFunc get_sasl, gpointer sasl_data)
{
id->get_sasl = get_sasl;
id->get_sasl_data = sasl_data;
}
void
-camel_imapp_driver_set_login_query(CamelIMAPPDriver *id, CamelIMAPPLoginFunc get_login, void *login_data)
+camel_imapp_driver_set_login_query(CamelIMAPPDriver *id, CamelIMAPPLoginFunc get_login, gpointer login_data)
{
id->get_login = get_login;
id->get_login_data = login_data;
@@ -127,7 +127,7 @@ camel_imapp_driver_login(CamelIMAPPDriver *id)
ic = camel_imapp_engine_command_new(id->engine, "AUTHENTICATE", NULL, "AUTHENTICATE %A", sasl);
camel_object_unref(sasl);
} else {
- char *user, *pass;
+ gchar *user, *pass;
g_assert(id->get_login);
id->get_login(id, &user, &pass, id->get_login_data);
@@ -277,7 +277,7 @@ camel_imapp_driver_update(CamelIMAPPDriver *id, CamelIMAPPFolder *folder)
/* FIXME: this is basically a copy of the same in camel-imapp-utils.c */
static struct {
- char *name;
+ gchar *name;
guint32 flag;
} flag_table[] = {
{ "\\ANSWERED", CAMEL_MESSAGE_ANSWERED },
@@ -311,7 +311,7 @@ imapp_write_flags(CamelIMAPPDriver *id, guint32 orset, gboolean on, CamelFolderS
count = camel_folder_summary_count(summary);
for (j=0;j<sizeof(flag_table)/sizeof(flag_table[0]);j++) {
- int flush;
+ gint flush;
if ((orset & flag_table[j].flag) == 0)
continue;
@@ -443,14 +443,14 @@ fetch_data_free(CamelIMAPPFetch *fd)
}
#endif
-struct _CamelStream * camel_imapp_driver_fetch(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const char *uid, const char *body)
+struct _CamelStream * camel_imapp_driver_fetch(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const gchar *uid, const gchar *body)
{
return NULL;
}
#if 0
void
-camel_imapp_driver_fetch(CamelIMAPPDriver *id, CamelIMAPPFolder *folder, const char *uid, const char *section, CamelIMAPPFetchFunc done, void *data)
+camel_imapp_driver_fetch(CamelIMAPPDriver *id, CamelIMAPPFolder *folder, const gchar *uid, const gchar *section, CamelIMAPPFetchFunc done, gpointer data)
{
struct _fetch_data *fd;
CamelIMAPPCommand *ic;
@@ -485,7 +485,7 @@ camel_imapp_driver_fetch(CamelIMAPPDriver *id, CamelIMAPPFolder *folder, const c
#endif
GPtrArray *
-camel_imapp_driver_list(CamelIMAPPDriver *id, const char *name, guint32 flags)
+camel_imapp_driver_list(CamelIMAPPDriver *id, const gchar *name, guint32 flags)
{
CamelIMAPPCommand * volatile ic;
GPtrArray *res;
@@ -522,7 +522,7 @@ camel_imapp_driver_list(CamelIMAPPDriver *id, const char *name, guint32 flags)
}
} CAMEL_CATCH(e) {
GSList *top = id->list_commands;
- int i;
+ gint i;
camel_imapp_engine_command_free(id->engine, ic);
@@ -565,9 +565,9 @@ driver_resp_list(CamelIMAPPEngine *ie, guint32 idx, CamelIMAPPDriver *id)
if ((linfo->flags & CAMEL_FOLDER_NOINFERIORS) == 0
&& (id->list_flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE)
&& linfo->separator) {
- int depth = 0;
- char *p = linfo->name;
- char c = linfo->separator;
+ gint depth = 0;
+ gchar *p = linfo->name;
+ gchar c = linfo->separator;
/* this is expensive ... but if we've listed this deep we're going slow anyway */
while (*p && depth < 10) {
@@ -671,7 +671,7 @@ driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
{
struct _fetch_info *finfo = NULL;
CamelIMAPPMessageInfo *info, *uinfo;
- unsigned int i;
+ guint i;
CamelFolderSummary *summary;
printf("got fetch response %d\n", id);
@@ -704,7 +704,7 @@ driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
printf("inserting new info @ %u\n", i);
info->info.uid = g_strdup(finfo->uid);
} else {
- char uidtmp[32];
+ gchar uidtmp[32];
sprintf(uidtmp, "blank-%u", i);
info->info.uid = g_strdup(uidtmp);
@@ -802,13 +802,13 @@ struct _CamelIMAPPMsg {
union {
struct {
struct _CamelIMAPPFolder *folder;
- char *uid;
- char *section;
+ gchar *uid;
+ gchar *section;
struct _CamelStream *body;
struct _CamelIMAPPCommand *ic;
} fetch;
struct {
- char *name;
+ gchar *name;
guint32 flags;
GPtrArray *result;
GSList *ics;
@@ -818,7 +818,7 @@ struct _CamelIMAPPMsg {
} quit;
struct {
struct _CamelIMAPPFolder *folder;
- char *search;
+ gchar *search;
GPtrArray *results;
} search;
struct {
@@ -852,11 +852,11 @@ camel_imapp_msg_new(camel_imapp_msg_t type, struct _CamelException *ex, struct _
case CAMEL_IMAPP_MSG_FETCH:
m->data.fetch.folder = va_arg(ap, struct _CamelIMAPPFolder *);
camel_object_ref(m->data.fetch.folder);
- m->data.fetch.uid = g_strdup(va_arg(ap, char *));
- m->data.fetch.section = g_strdup(va_arg(ap, char *));
+ m->data.fetch.uid = g_strdup(va_arg(ap, gchar *));
+ m->data.fetch.section = g_strdup(va_arg(ap, gchar *));
break;
case CAMEL_IMAPP_MSG_LIST:
- m->data.list.name = g_strdup(va_arg(ap, char *));
+ m->data.list.name = g_strdup(va_arg(ap, gchar *));
m->data.list.flags = va_arg(ap, guint32);
break;
case CAMEL_IMAPP_MSG_QUIT:
@@ -865,7 +865,7 @@ camel_imapp_msg_new(camel_imapp_msg_t type, struct _CamelException *ex, struct _
case CAMEL_IMAPP_MSG_SEARCH:
m->data.search.folder = va_arg(ap, struct _CamelIMAPPFolder *);
camel_object_ref(m->data.search.folder);
- m->data.search.search = g_strdup(va_arg(ap, char *));
+ m->data.search.search = g_strdup(va_arg(ap, gchar *));
break;
case CAMEL_IMAPP_MSG_SYNC:
m->data.sync.folder = va_arg(ap, struct _CamelIMAPPFolder *);
@@ -925,7 +925,7 @@ void
camel_imapp_driver_worker(CamelIMAPPDriver *id)
{
CamelIMAPPMsg *m;
- int go = TRUE;
+ gint go = TRUE;
do {
/*m = (CamelIMAPPMsg *)camel_msgport_try_pop(id->queue);*/
diff --git a/camel/providers/imapp/camel-imapp-driver.h b/camel/providers/imapp/camel-imapp-driver.h
index ef028cfa0..a2fe8666c 100644
--- a/camel/providers/imapp/camel-imapp-driver.h
+++ b/camel/providers/imapp/camel-imapp-driver.h
@@ -19,9 +19,9 @@ typedef struct _CamelIMAPPDriverClass CamelIMAPPDriverClass;
typedef struct _CamelIMAPPFetch CamelIMAPPFetch;
-typedef int (*CamelIMAPPDriverFunc)(struct _CamelIMAPPDriver *driver, void *data);
-typedef struct _CamelSasl * (*CamelIMAPPSASLFunc)(struct _CamelIMAPPDriver *driver, void *data);
-typedef void (*CamelIMAPPLoginFunc)(struct _CamelIMAPPDriver *driver, char **login, char **pass, void *data);
+typedef gint (*CamelIMAPPDriverFunc)(struct _CamelIMAPPDriver *driver, gpointer data);
+typedef struct _CamelSasl * (*CamelIMAPPSASLFunc)(struct _CamelIMAPPDriver *driver, gpointer data);
+typedef void (*CamelIMAPPLoginFunc)(struct _CamelIMAPPDriver *driver, gchar **login, gchar **pass, gpointer data);
typedef void (*CamelIMAPPFetchFunc)(struct _CamelIMAPPDriver *driver, CamelIMAPPFetch *);
@@ -32,11 +32,11 @@ struct _CamelIMAPPFetch {
CamelStream *body; /* the content fetched */
struct _CamelIMAPPFolder *folder;
- char *uid;
- char *section;
+ gchar *uid;
+ gchar *section;
CamelIMAPPFetchFunc done;
- void *data;
+ gpointer data;
};
struct _CamelMimeMessage;
@@ -69,11 +69,11 @@ struct _CamelIMAPPDriver {
/* factory to get an appropriate sasl mech */
CamelIMAPPSASLFunc get_sasl;
- void *get_sasl_data;
+ gpointer get_sasl_data;
/* callbacks, get login username/pass */
CamelIMAPPLoginFunc get_login;
- void *get_login_data;
+ gpointer get_login_data;
};
struct _CamelIMAPPDriverClass {
@@ -84,8 +84,8 @@ CamelType camel_imapp_driver_get_type (void);
CamelIMAPPDriver * camel_imapp_driver_new(CamelIMAPPStream *stream);
-void camel_imapp_driver_set_sasl_factory(CamelIMAPPDriver *id, CamelIMAPPSASLFunc get_sasl, void *sasl_data);
-void camel_imapp_driver_set_login_query(CamelIMAPPDriver *id, CamelIMAPPLoginFunc get_login, void *login_data);
+void camel_imapp_driver_set_sasl_factory(CamelIMAPPDriver *id, CamelIMAPPSASLFunc get_sasl, gpointer sasl_data);
+void camel_imapp_driver_set_login_query(CamelIMAPPDriver *id, CamelIMAPPLoginFunc get_login, gpointer login_data);
void camel_imapp_driver_login(CamelIMAPPDriver *id);
@@ -93,11 +93,11 @@ void camel_imapp_driver_select(CamelIMAPPDriver *id, struct _CamelIMAPPFolder
void camel_imapp_driver_update(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder);
void camel_imapp_driver_sync(CamelIMAPPDriver *id, gboolean expunge, struct _CamelIMAPPFolder *folder);
-struct _CamelStream * camel_imapp_driver_fetch(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const char *uid, const char *body);
+struct _CamelStream * camel_imapp_driver_fetch(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const gchar *uid, const gchar *body);
-GPtrArray * camel_imapp_driver_list(CamelIMAPPDriver *id, const char *name, guint32 flags);
+GPtrArray * camel_imapp_driver_list(CamelIMAPPDriver *id, const gchar *name, guint32 flags);
-struct _CamelStream *camel_imapp_driver_get(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const char *uid);
+struct _CamelStream *camel_imapp_driver_get(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const gchar *uid);
void camel_imapp_driver_append(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, struct _CamelDataWrapper *);
G_END_DECLS
diff --git a/camel/providers/imapp/camel-imapp-engine.c b/camel/providers/imapp/camel-imapp-engine.c
index afa83f7bb..e9157dfd4 100644
--- a/camel/providers/imapp/camel-imapp-engine.c
+++ b/camel/providers/imapp/camel-imapp-engine.c
@@ -20,13 +20,13 @@
#define e(x)
#define c(x) /* command build debug */
-static void imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, va_list ap);
+static void imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const gchar *fmt, va_list ap);
static void imap_engine_command_complete(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic);
struct _handler {
CamelIMAPPEngineFunc func;
- void *data;
- char name[1];
+ gpointer data;
+ gchar name[1];
};
static void
@@ -56,7 +56,7 @@ object_init(CamelIMAPPEngine *ie, CamelIMAPPEngineClass *ieclass)
}
static void
-handler_free(void *key, void *mem, void *data)
+handler_free(gpointer key, gpointer mem, gpointer data)
{
g_free(mem);
}
@@ -94,7 +94,7 @@ camel_imapp_engine_get_type (void)
/* FIXME: check this, just taken from old code, not rfc */
struct {
- char *name;
+ gchar *name;
guint32 flag;
} capa_table[] = {
{ "IMAP4", IMAP_CAPABILITY_IMAP4 },
@@ -114,10 +114,10 @@ capability_data ::= "CAPABILITY" SPACE [1#capability SPACE] "IMAP4rev1"
;; compatibility MUST list "IMAP4" as the first
;; capability.
*/
-static int resp_capability(CamelIMAPPEngine *ie, guint32 id, void *data)
+static gint resp_capability(CamelIMAPPEngine *ie, guint32 id, gpointer data)
{
- int tok, len, i;
- unsigned char *token, *p, c;
+ gint tok, len, i;
+ guchar *token, *p, c;
/* FIXME: handle auth types */
@@ -152,14 +152,14 @@ static int resp_capability(CamelIMAPPEngine *ie, guint32 id, void *data)
/* expunge command, id is expunged seq number */
/* message_data ::= nz_number SPACE ("EXPUNGE" /
("FETCH" SPACE msg_att)) */
-static int resp_expunge(CamelIMAPPEngine *ie, guint32 id, void *data)
+static gint resp_expunge(CamelIMAPPEngine *ie, guint32 id, gpointer data)
{
printf("message expunged: %d\n", id);
return camel_imapp_engine_skip(ie);
}
-static int resp_flags(CamelIMAPPEngine *ie, guint32 id, void *data)
+static gint resp_flags(CamelIMAPPEngine *ie, guint32 id, gpointer data)
{
guint32 flags;
@@ -171,7 +171,7 @@ static int resp_flags(CamelIMAPPEngine *ie, guint32 id, void *data)
}
/* exists count */
-static int resp_exists(CamelIMAPPEngine *ie, guint32 id, void *data)
+static gint resp_exists(CamelIMAPPEngine *ie, guint32 id, gpointer data)
{
printf("messages exist: %d\n", id);
@@ -181,7 +181,7 @@ static int resp_exists(CamelIMAPPEngine *ie, guint32 id, void *data)
return camel_imapp_engine_skip(ie);
}
-static int resp_recent(CamelIMAPPEngine *ie, guint32 id, void *data)
+static gint resp_recent(CamelIMAPPEngine *ie, guint32 id, gpointer data)
{
printf("messages recent: %d\n", id);
@@ -191,7 +191,7 @@ static int resp_recent(CamelIMAPPEngine *ie, guint32 id, void *data)
return camel_imapp_engine_skip(ie);
}
-static int resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data)
+static gint resp_fetch(CamelIMAPPEngine *ie, guint32 id, gpointer data)
{
struct _fetch_info *finfo;
@@ -203,7 +203,7 @@ static int resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data)
}
#if 0
-static int resp_list(CamelIMAPPEngine *ie, guint32 id, void *data)
+static gint resp_list(CamelIMAPPEngine *ie, guint32 id, gpointer data)
{
struct _list_info *linfo;
@@ -241,9 +241,9 @@ camel_imapp_engine_new(CamelIMAPPStream *stream)
/* TODO: move this to a driver:connect call? */
CAMEL_TRY {
- unsigned char *token;
- unsigned int len;
- int tok;
+ guchar *token;
+ guint len;
+ gint tok;
tok = camel_imapp_stream_token(stream, &token, &len);
if (tok == '*') {
@@ -280,11 +280,11 @@ camel_imapp_engine_new(CamelIMAPPStream *stream)
}
void
-camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const char *response, CamelIMAPPEngineFunc func, void *data)
+camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const gchar *response, CamelIMAPPEngineFunc func, gpointer data)
{
struct _handler *h;
- const unsigned char *p;
- unsigned char *o, c;
+ const guchar *p;
+ guchar *o, c;
h = g_malloc0(sizeof(*h) + strlen(response));
h->func = func;
@@ -299,7 +299,7 @@ camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const char *response, Cam
g_hash_table_insert(imap->handlers, h->name, h);
}
-int
+gint
camel_imapp_engine_capabilities(CamelIMAPPEngine *ie)
{
CamelIMAPPCommand *ic;
@@ -317,12 +317,12 @@ camel_imapp_engine_capabilities(CamelIMAPPEngine *ie)
}
/* skip the rest of the line of tokens */
-int
+gint
camel_imapp_engine_skip(CamelIMAPPEngine *imap)
{
- int tok;
- unsigned char *token;
- unsigned int len;
+ gint tok;
+ guchar *token;
+ guint len;
do {
tok = camel_imapp_stream_token(imap->stream, &token, &len);
@@ -344,9 +344,9 @@ camel_imapp_engine_skip(CamelIMAPPEngine *imap)
static int
iterate_untagged(CamelIMAPPEngine *imap)
{
- unsigned int id, len;
- unsigned char *token, *p, c;
- int tok;
+ guint id, len;
+ guchar *token, *p, c;
+ gint tok;
struct _handler *h;
struct _status_info *sinfo;
@@ -468,9 +468,9 @@ iterate_continuation(CamelIMAPPEngine *imap)
break;
case CAMEL_IMAPP_COMMAND_AUTH: {
CamelException *ex = camel_exception_new();
- char *resp;
- unsigned char *token;
- int tok, len;
+ gchar *resp;
+ guchar *token;
+ gint tok, len;
tok = camel_imapp_stream_token(imap->stream, &token, &len);
resp = camel_sasl_challenge_base64((CamelSasl *)cp->ob, token, ex);
@@ -522,10 +522,10 @@ iterate_continuation(CamelIMAPPEngine *imap)
/* handle a completion line */
static int
-iterate_completion(CamelIMAPPEngine *imap, unsigned char *token)
+iterate_completion(CamelIMAPPEngine *imap, guchar *token)
{
CamelIMAPPCommand *ic;
- unsigned int tag;
+ guint tag;
if (token[0] != imap->tagprefix)
camel_exception_throw(1, "Server sent unexpected response: %s", token);
@@ -577,13 +577,13 @@ iterate_completion(CamelIMAPPEngine *imap, unsigned char *token)
/* Do work if there's any to do */
-int
+gint
camel_imapp_engine_iterate(CamelIMAPPEngine *imap, CamelIMAPPCommand *icwait)
/* throws IO,PARSE exception */
{
- unsigned int len;
- unsigned char *token;
- int tok;
+ guint len;
+ guchar *token;
+ gint tok;
if ((icwait && icwait->status != NULL) || camel_dlist_empty(&imap->active))
return 0;
@@ -609,7 +609,7 @@ camel_imapp_engine_iterate(CamelIMAPPEngine *imap, CamelIMAPPCommand *icwait)
}
CamelIMAPPCommand *
-camel_imapp_engine_command_new(CamelIMAPPEngine *imap, const char *name, const char *select, const char *fmt, ...)
+camel_imapp_engine_command_new(CamelIMAPPEngine *imap, const gchar *name, const gchar *select, const gchar *fmt, ...)
{
CamelIMAPPCommand *ic;
va_list ap;
@@ -631,7 +631,7 @@ camel_imapp_engine_command_new(CamelIMAPPEngine *imap, const char *name, const c
}
void
-camel_imapp_engine_command_add(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, ...)
+camel_imapp_engine_command_add(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const gchar *fmt, ...)
{
va_list ap;
@@ -645,7 +645,7 @@ camel_imapp_engine_command_add(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, co
}
void
-camel_imapp_engine_command_complete(CamelIMAPPEngine *imap, struct _CamelIMAPPCommand *ic, CamelIMAPPCommandFunc func, void *data)
+camel_imapp_engine_command_complete(CamelIMAPPEngine *imap, struct _CamelIMAPPCommand *ic, CamelIMAPPCommandFunc func, gpointer data)
{
ic->complete = func;
ic->complete_data = data;
@@ -692,7 +692,7 @@ camel_imapp_engine_command_queue(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic)
}
CamelIMAPPCommand *
-camel_imapp_engine_command_find (CamelIMAPPEngine *imap, const char *name)
+camel_imapp_engine_command_find (CamelIMAPPEngine *imap, const gchar *name)
{
CamelIMAPPCommand *ic, *in;
@@ -714,7 +714,7 @@ camel_imapp_engine_command_find (CamelIMAPPEngine *imap, const char *name)
}
CamelIMAPPCommand *
-camel_imapp_engine_command_find_tag(CamelIMAPPEngine *imap, unsigned int tag)
+camel_imapp_engine_command_find_tag(CamelIMAPPEngine *imap, guint tag)
{
CamelIMAPPCommand *ic, *in;
@@ -737,7 +737,7 @@ camel_imapp_engine_command_find_tag(CamelIMAPPEngine *imap, unsigned int tag)
/* ********************************************************************** */
CamelIMAPPSelectResponse *
-camel_imapp_engine_select(CamelIMAPPEngine *imap, const char *name)
+camel_imapp_engine_select(CamelIMAPPEngine *imap, const gchar *name)
{
CamelIMAPPSelectResponse * volatile resp;
CamelIMAPPCommand * volatile ic = NULL;
@@ -784,7 +784,7 @@ imap_engine_command_add_part(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, came
{
CamelIMAPPCommandPart *cp;
CamelStreamNull *null;
- unsigned int ob_size = 0;
+ guint ob_size = 0;
switch(type & CAMEL_IMAPP_COMMAND_MASK) {
case CAMEL_IMAPP_COMMAND_DATAWRAPPER:
@@ -831,9 +831,9 @@ imap_engine_command_add_part(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, came
}
#if c(!)0
-static int len(CamelDList *list)
+static gint len(CamelDList *list)
{
- int count = 0;
+ gint count = 0;
CamelDListNode *n = list->head;
while (n->next) {
@@ -859,24 +859,24 @@ imap_engine_command_complete(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic)
}
static void
-imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, va_list ap)
+imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const gchar *fmt, va_list ap)
{
- const unsigned char *p, *ps, *start;
- unsigned char c;
- unsigned int width;
- char ch;
- int llong;
- int left;
- int fill;
- int zero;
- char *s;
- int d;
- long int l;
+ const guchar *p, *ps, *start;
+ guchar c;
+ guint width;
+ gchar ch;
+ gint llong;
+ gint left;
+ gint fill;
+ gint zero;
+ gchar *s;
+ gint d;
+ long gint l;
guint32 f;
CamelStream *S;
CamelDataWrapper *D;
CamelSasl *A;
- char buffer[16];
+ gchar buffer[16];
c(printf("adding command, fmt = '%s'\n", fmt));
@@ -936,17 +936,17 @@ imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const ch
imap_engine_command_add_part(imap, ic, CAMEL_IMAPP_COMMAND_DATAWRAPPER, (CamelObject *)D);
break;
case 't': /* token */
- s = va_arg(ap, char *);
+ s = va_arg(ap, gchar *);
camel_stream_write((CamelStream *)ic->mem, s, strlen(s));
break;
case 's': /* simple string */
- s = va_arg(ap, char *);
+ s = va_arg(ap, gchar *);
c(printf("got string '%s'\n", s));
/* FIXME: escpae chars, convert to literal or literal+, etc */
camel_stream_printf((CamelStream *)ic->mem, "\"%s\"", s);
break;
case 'f': /* imap folder name */
- s = va_arg(ap, char *);
+ s = va_arg(ap, gchar *);
c(printf("got folder '%s'\n", s));
/* FIXME: encode folder name */
/* FIXME: namespace? */
@@ -965,13 +965,13 @@ imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const ch
case 'u':
if (llong) {
l = va_arg(ap, long int);
- c(printf("got long int '%d'\n", (int)l));
+ c(printf("got long gint '%d'\n", (int)l));
memcpy(buffer, start, p-start);
buffer[p-start] = 0;
camel_stream_printf((CamelStream *)ic->mem, buffer, l);
} else {
d = va_arg(ap, int);
- c(printf("got int '%d'\n", d));
+ c(printf("got gint '%d'\n", d));
memcpy(buffer, start, p-start);
buffer[p-start] = 0;
camel_stream_printf((CamelStream *)ic->mem, buffer, d);
@@ -997,8 +997,8 @@ imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const ch
}
-static void *
-cie_worker(void *data)
+static gpointer
+cie_worker(gpointer data)
{
CamelIMAPPCommand *ic = data;
CamelIMAPPEngine *imap;
@@ -1116,7 +1116,7 @@ camel_exception_throw_ex(CamelException *ex)
}
void
-camel_exception_throw(int id, char *fmt, ...)
+camel_exception_throw(gint id, gchar *fmt, ...)
{
CamelException *ex;
va_list ap;
diff --git a/camel/providers/imapp/camel-imapp-engine.h b/camel/providers/imapp/camel-imapp-engine.h
index 6bfc93c58..37f2a4011 100644
--- a/camel/providers/imapp/camel-imapp-engine.h
+++ b/camel/providers/imapp/camel-imapp-engine.h
@@ -37,35 +37,35 @@ struct _CamelIMAPPCommandPart {
struct _CamelIMAPPCommand *parent;
- int data_size;
- char *data;
+ gint data_size;
+ gchar *data;
camel_imapp_command_part_t type;
- int ob_size;
+ gint ob_size;
CamelObject *ob;
};
-typedef int (*CamelIMAPPEngineFunc)(struct _CamelIMAPPEngine *engine, guint32 id, void *data);
-typedef void (*CamelIMAPPCommandFunc)(struct _CamelIMAPPEngine *engine, struct _CamelIMAPPCommand *, void *data);
+typedef gint (*CamelIMAPPEngineFunc)(struct _CamelIMAPPEngine *engine, guint32 id, gpointer data);
+typedef void (*CamelIMAPPCommandFunc)(struct _CamelIMAPPEngine *engine, struct _CamelIMAPPCommand *, gpointer data);
struct _CamelIMAPPCommand {
CamelMsg msg;
- const char *name; /* command name/type (e.g. FETCH) */
+ const gchar *name; /* command name/type (e.g. FETCH) */
/* FIXME: remove this select stuff */
- char *select; /* if we need to run against a specific folder */
+ gchar *select; /* if we need to run against a specific folder */
struct _status_info *status; /* status for command, indicates it is complete if != NULL */
- unsigned int tag;
+ guint tag;
struct _CamelStreamMem *mem; /* for building the part */
CamelDList parts;
CamelIMAPPCommandPart *current;
CamelIMAPPCommandFunc complete;
- void *complete_data;
+ gpointer complete_data;
};
typedef struct _CamelIMAPPSelectResponse CamelIMAPPSelectResponse;
@@ -111,11 +111,11 @@ struct _CamelIMAPPEngine {
GHashTable *handlers;
- unsigned char tagprefix; /* out tag prefix 'A' 'B' ... 'Z' */
- unsigned int tag; /* next command tag */
+ guchar tagprefix; /* out tag prefix 'A' 'B' ... 'Z' */
+ guint tag; /* next command tag */
- char *select; /* *currently* selected folder */
- char *last_select; /* last selected or to-be selected folder (e.g. outstanding queued select) */
+ gchar *select; /* *currently* selected folder */
+ gchar *last_select; /* last selected or to-be selected folder (e.g. outstanding queued select) */
CamelIMAPPCommand *literal;/* current literal op */
CamelDList active; /* active queue */
CamelDList queue; /* outstanding queue */
@@ -128,7 +128,7 @@ struct _CamelIMAPPEngine {
struct _CamelIMAPPEngineClass {
CamelObjectClass parent_class;
- unsigned char tagprefix;
+ guchar tagprefix;
/* Events:
status(struct _status_info *);
@@ -139,21 +139,21 @@ CamelType camel_imapp_engine_get_type (void);
CamelIMAPPEngine *camel_imapp_engine_new(CamelIMAPPStream *stream);
-void camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const char *response, CamelIMAPPEngineFunc func, void *data);
+void camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const gchar *response, CamelIMAPPEngineFunc func, gpointer data);
int camel_imapp_engine_iterate(CamelIMAPPEngine *imap, CamelIMAPPCommand *wait); /* throws PARSE,IO exception */
int camel_imapp_engine_skip(CamelIMAPPEngine *imap);
int camel_imapp_engine_capabilities(CamelIMAPPEngine *imap);
-CamelIMAPPCommand *camel_imapp_engine_command_new (CamelIMAPPEngine *imap, const char *name, const char *select, const char *fmt, ...);
-void camel_imapp_engine_command_complete(CamelIMAPPEngine *imap, struct _CamelIMAPPCommand *, CamelIMAPPCommandFunc func, void *data);
-void camel_imapp_engine_command_add (CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, ...);
+CamelIMAPPCommand *camel_imapp_engine_command_new (CamelIMAPPEngine *imap, const gchar *name, const gchar *select, const gchar *fmt, ...);
+void camel_imapp_engine_command_complete(CamelIMAPPEngine *imap, struct _CamelIMAPPCommand *, CamelIMAPPCommandFunc func, gpointer data);
+void camel_imapp_engine_command_add (CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const gchar *fmt, ...);
void camel_imapp_engine_command_free (CamelIMAPPEngine *imap, CamelIMAPPCommand *ic);
void camel_imapp_engine_command_queue(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic); /* throws IO exception */
-CamelIMAPPCommand *camel_imapp_engine_command_find (CamelIMAPPEngine *imap, const char *name);
-CamelIMAPPCommand *camel_imapp_engine_command_find_tag(CamelIMAPPEngine *imap, unsigned int tag);
+CamelIMAPPCommand *camel_imapp_engine_command_find (CamelIMAPPEngine *imap, const gchar *name);
+CamelIMAPPCommand *camel_imapp_engine_command_find_tag(CamelIMAPPEngine *imap, guint tag);
/* util functions */
-CamelIMAPPSelectResponse *camel_imapp_engine_select(CamelIMAPPEngine *imap, const char *name);
+CamelIMAPPSelectResponse *camel_imapp_engine_select(CamelIMAPPEngine *imap, const gchar *name);
void camel_imapp_engine_select_free(CamelIMAPPEngine *imap, CamelIMAPPSelectResponse *select);
G_END_DECLS
diff --git a/camel/providers/imapp/camel-imapp-exception.h b/camel/providers/imapp/camel-imapp-exception.h
index 65af32214..f658b6f86 100644
--- a/camel/providers/imapp/camel-imapp-exception.h
+++ b/camel/providers/imapp/camel-imapp-exception.h
@@ -32,7 +32,7 @@ void camel_exception_drop(struct _CamelExceptionEnv *env);
/* user functions */
void camel_exception_throw_ex(CamelException *ex) __attribute__ ((noreturn));
-void camel_exception_throw(int id, char *fmt, ...) __attribute__ ((noreturn));
+void camel_exception_throw(gint id, gchar *fmt, ...) __attribute__ ((noreturn));
G_END_DECLS
diff --git a/camel/providers/imapp/camel-imapp-fetch-stream.c b/camel/providers/imapp/camel-imapp-fetch-stream.c
index 3f7734db9..7d6e01a8b 100644
--- a/camel/providers/imapp/camel-imapp-fetch-stream.c
+++ b/camel/providers/imapp/camel-imapp-fetch-stream.c
@@ -45,7 +45,7 @@ static CamelObjectClass *parent_class = NULL;
#define CS_CLASS(so) CAMEL_IMAPP_FETCH_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
+stream_read(CamelStream *stream, gchar *buffer, size_t n)
{
CamelIMAPPFetchStream *is = (CamelIMAPPFetchStream *)stream;
ssize_t max;
@@ -76,7 +76,7 @@ stream_read(CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
+stream_write(CamelStream *stream, const gchar *buffer, size_t n)
{
CamelIMAPPFetchStream *is = (CamelIMAPPFetchStream *)stream;
@@ -167,7 +167,7 @@ camel_imapp_fetch_stream_get_type (void)
* Return value: the stream
**/
CamelStream *
-camel_imapp_fetch_stream_new(CamelIMAPPEngine *ie, const char *uid, const char *body)
+camel_imapp_fetch_stream_new(CamelIMAPPEngine *ie, const gchar *uid, const gchar *body)
{
CamelIMAPPFetchStream *is;
diff --git a/camel/providers/imapp/camel-imapp-fetch-stream.h b/camel/providers/imapp/camel-imapp-fetch-stream.h
index a230f4c82..42cb01669 100644
--- a/camel/providers/imapp/camel-imapp-fetch-stream.h
+++ b/camel/providers/imapp/camel-imapp-fetch-stream.h
@@ -44,7 +44,7 @@ struct _CamelIMAPPFetchStreamClass {
CamelType camel_imapp_fetch_stream_get_type (void);
-CamelStream *camel_imapp_fetch_stream_new (struct _CamelIMAPPEngine *src, const char *uid, const char *spec);
+CamelStream *camel_imapp_fetch_stream_new (struct _CamelIMAPPEngine *src, const gchar *uid, const gchar *spec);
G_END_DECLS
diff --git a/camel/providers/imapp/camel-imapp-folder.c b/camel/providers/imapp/camel-imapp-folder.c
index b9f98cc38..bd81593f8 100644
--- a/camel/providers/imapp/camel-imapp-folder.c
+++ b/camel/providers/imapp/camel-imapp-folder.c
@@ -53,7 +53,7 @@ static CamelFolderClass *parent_class;
static void imap_finalize (CamelObject *object);
static void imap_refresh_info (CamelFolder *folder, CamelException *ex);
static void imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
-static CamelMimeMessage *imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex);
+static CamelMimeMessage *imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
static void
imap_folder_class_init (CamelIMAPPFolderClass *camel_imapp_folder_class)
@@ -114,10 +114,10 @@ imap_finalize (CamelObject *object)
}
CamelFolder *
-camel_imapp_folder_new(CamelStore *store, const char *path)
+camel_imapp_folder_new(CamelStore *store, const gchar *path)
{
CamelFolder *folder;
- char *root;
+ gchar *root;
d(printf("opening imap folder '%s'\n", path));
@@ -130,8 +130,8 @@ camel_imapp_folder_new(CamelStore *store, const char *path)
root = camel_session_get_storage_path(((CamelService *)store)->session, (CamelService *)store, NULL);
if (root) {
- char *base = g_build_filename(root, path, NULL);
- char *file = g_build_filename(base, ".ev-summary", NULL);
+ gchar *base = g_build_filename(root, path, NULL);
+ gchar *file = g_build_filename(base, ".ev-summary", NULL);
g_mkdir_with_parents (base, 0777);
g_free(base);
@@ -160,7 +160,7 @@ camel_imapp_folder_delete(CamelIMAPPFolder *folder, CamelException *ex)
}
void
-camel_imapp_folder_rename(CamelIMAPPFolder *folder, const char *new, CamelException *ex)
+camel_imapp_folder_rename(CamelIMAPPFolder *folder, const gchar *new, CamelException *ex)
{
}
@@ -183,7 +183,7 @@ imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
}
static CamelMimeMessage *
-imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelMimeMessage * volatile msg = NULL;
CamelStream * volatile stream = NULL;
diff --git a/camel/providers/imapp/camel-imapp-folder.h b/camel/providers/imapp/camel-imapp-folder.h
index 708c27eb0..d9c93b203 100644
--- a/camel/providers/imapp/camel-imapp-folder.h
+++ b/camel/providers/imapp/camel-imapp-folder.h
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
typedef struct _CamelIMAPPFolder {
CamelFolder parent_object;
- char *raw_name;
+ gchar *raw_name;
CamelFolderChangeInfo *changes;
guint32 exists;
@@ -54,7 +54,7 @@ typedef struct _CamelIMAPPFolderClass {
CamelType camel_imapp_folder_get_type (void);
/* public methods */
-CamelFolder *camel_imapp_folder_new(CamelStore *parent, const char *path);
+CamelFolder *camel_imapp_folder_new(CamelStore *parent, const gchar *path);
G_END_DECLS
diff --git a/camel/providers/imapp/camel-imapp-store-summary.c b/camel/providers/imapp/camel-imapp-store-summary.c
index 79c8b25ed..57317ff10 100644
--- a/camel/providers/imapp/camel-imapp-store-summary.c
+++ b/camel/providers/imapp/camel-imapp-store-summary.c
@@ -44,16 +44,16 @@
#define _PRIVATE(o) (((CamelIMAPPStoreSummary *)(o))->priv)
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
+static gint summary_header_load(CamelStoreSummary *, FILE *);
+static gint summary_header_save(CamelStoreSummary *, FILE *);
-/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const char *);*/
+/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const gchar *);*/
static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-static const char *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
-static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
+static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
+static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
static void camel_imapp_store_summary_class_init (CamelIMAPPStoreSummaryClass *klass);
static void camel_imapp_store_summary_init (CamelIMAPPStoreSummary *obj);
@@ -148,9 +148,9 @@ camel_imapp_store_summary_new (void)
* It must be freed using camel_store_summary_info_free().
**/
CamelIMAPPStoreInfo *
-camel_imapp_store_summary_full_name(CamelIMAPPStoreSummary *s, const char *full_name)
+camel_imapp_store_summary_full_name(CamelIMAPPStoreSummary *s, const gchar *full_name)
{
- int count, i;
+ gint count, i;
CamelIMAPPStoreInfo *info;
count = camel_store_summary_count((CamelStoreSummary *)s);
@@ -166,12 +166,12 @@ camel_imapp_store_summary_full_name(CamelIMAPPStoreSummary *s, const char *full_
return NULL;
}
-char *
-camel_imapp_store_summary_full_to_path(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep)
+gchar *
+camel_imapp_store_summary_full_to_path(CamelIMAPPStoreSummary *s, const gchar *full_name, gchar dir_sep)
{
- char *path, *p;
- int c;
- const char *f;
+ gchar *path, *p;
+ gint c;
+ const gchar *f;
if (dir_sep != '/') {
p = path = alloca(strlen(full_name)*3+1);
@@ -186,7 +186,7 @@ camel_imapp_store_summary_full_to_path(CamelIMAPPStoreSummary *s, const char *fu
}
*p = 0;
} else
- path = (char *)full_name;
+ path = (gchar *)full_name;
return camel_utf7_utf8(path);
}
@@ -201,14 +201,14 @@ static guint32 hexnib(guint32 c)
return 0;
}
-char *
-camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const char *path, char dir_sep)
+gchar *
+camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const gchar *path, gchar dir_sep)
{
- unsigned char *full, *f;
+ guchar *full, *f;
guint32 c, v = 0;
- const char *p;
- int state=0;
- char *subpath, *last = NULL;
+ const gchar *p;
+ gint state=0;
+ gchar *subpath, *last = NULL;
CamelStoreInfo *si;
CamelIMAPPStoreNamespace *ns;
@@ -241,7 +241,7 @@ camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const char *pa
else
p = path;
- while ( (c = camel_utf8_getc((const unsigned char **)&p)) ) {
+ while ( (c = camel_utf8_getc((const guchar **)&p)) ) {
switch(state) {
case 0:
if (c == '%')
@@ -282,12 +282,12 @@ camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const char *pa
}
CamelIMAPPStoreInfo *
-camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const char *full, char dir_sep)
+camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const gchar *full, gchar dir_sep)
{
CamelIMAPPStoreInfo *info;
- char *pathu8, *prefix;
- int len;
- char *full_name;
+ gchar *pathu8, *prefix;
+ gint len;
+ gchar *full_name;
CamelIMAPPStoreNamespace *ns;
d(printf("adding full name '%s' '%c'\n", full, dir_sep));
@@ -341,11 +341,11 @@ camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const char *f
/* should this be const? */
/* TODO: deprecate/merge this function with path_to_full */
-char *
-camel_imapp_store_summary_full_from_path(CamelIMAPPStoreSummary *s, const char *path)
+gchar *
+camel_imapp_store_summary_full_from_path(CamelIMAPPStoreSummary *s, const gchar *path)
{
CamelIMAPPStoreNamespace *ns;
- char *name = NULL;
+ gchar *name = NULL;
ns = camel_imapp_store_summary_namespace_find_path(s, path);
if (ns)
@@ -357,11 +357,11 @@ camel_imapp_store_summary_full_from_path(CamelIMAPPStoreSummary *s, const char *
}
/* TODO: this api needs some more work */
-CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_new(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep)
+CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_new(CamelIMAPPStoreSummary *s, const gchar *full_name, gchar dir_sep)
{
CamelIMAPPStoreNamespace *ns;
- char *p;
- int len;
+ gchar *p;
+ gint len;
ns = g_malloc0(sizeof(*ns));
ns->full_name = g_strdup(full_name);
@@ -391,9 +391,9 @@ void camel_imapp_store_summary_namespace_set(CamelIMAPPStoreSummary *s, CamelIMA
}
CamelIMAPPStoreNamespace *
-camel_imapp_store_summary_namespace_find_path(CamelIMAPPStoreSummary *s, const char *path)
+camel_imapp_store_summary_namespace_find_path(CamelIMAPPStoreSummary *s, const gchar *path)
{
- int len;
+ gint len;
CamelIMAPPStoreNamespace *ns;
/* NB: this currently only compares against 1 namespace, in future compare against others */
@@ -412,9 +412,9 @@ camel_imapp_store_summary_namespace_find_path(CamelIMAPPStoreSummary *s, const c
}
CamelIMAPPStoreNamespace *
-camel_imapp_store_summary_namespace_find_full(CamelIMAPPStoreSummary *s, const char *full)
+camel_imapp_store_summary_namespace_find_full(CamelIMAPPStoreSummary *s, const gchar *full)
{
- int len;
+ gint len;
CamelIMAPPStoreNamespace *ns;
/* NB: this currently only compares against 1 namespace, in future compare against others */
@@ -573,8 +573,8 @@ store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
camel_imapp_store_summary_parent->store_info_free(s, mi);
}
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
+static const gchar *
+store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
{
CamelIMAPPStoreInfo *isi = (CamelIMAPPStoreInfo *)mi;
@@ -591,7 +591,7 @@ store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
}
static void
-store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
+store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
{
CamelIMAPPStoreInfo *isi = (CamelIMAPPStoreInfo *)mi;
diff --git a/camel/providers/imapp/camel-imapp-store-summary.h b/camel/providers/imapp/camel-imapp-store-summary.h
index bf8a1734c..13e2d6981 100644
--- a/camel/providers/imapp/camel-imapp-store-summary.h
+++ b/camel/providers/imapp/camel-imapp-store-summary.h
@@ -44,15 +44,15 @@ enum {
struct _CamelIMAPPStoreInfo {
CamelStoreInfo info;
- char *full_name;
+ gchar *full_name;
};
typedef struct _CamelIMAPPStoreNamespace CamelIMAPPStoreNamespace;
struct _CamelIMAPPStoreNamespace {
- char *path; /* display path */
- char *full_name; /* real name */
- char sep; /* directory separator */
+ gchar *path; /* display path */
+ gchar *full_name; /* real name */
+ gchar sep; /* directory separator */
};
struct _CamelIMAPPStoreSummary {
@@ -74,20 +74,20 @@ CamelType camel_imapp_store_summary_get_type (void);
CamelIMAPPStoreSummary *camel_imapp_store_summary_new (void);
/* TODO: this api needs some more work, needs to support lists */
-CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_new(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
+CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_new(CamelIMAPPStoreSummary *s, const gchar *full_name, gchar dir_sep);
void camel_imapp_store_summary_namespace_set(CamelIMAPPStoreSummary *s, CamelIMAPPStoreNamespace *ns);
-CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_find_path(CamelIMAPPStoreSummary *s, const char *path);
-CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_find_full(CamelIMAPPStoreSummary *s, const char *full_name);
+CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_find_path(CamelIMAPPStoreSummary *s, const gchar *path);
+CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_find_full(CamelIMAPPStoreSummary *s, const gchar *full_name);
/* converts to/from utf8 canonical nasmes */
-char *camel_imapp_store_summary_full_to_path(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
-char *camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const char *path, char dir_sep);
+gchar *camel_imapp_store_summary_full_to_path(CamelIMAPPStoreSummary *s, const gchar *full_name, gchar dir_sep);
+gchar *camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const gchar *path, gchar dir_sep);
-CamelIMAPPStoreInfo *camel_imapp_store_summary_full_name(CamelIMAPPStoreSummary *s, const char *full_name);
-CamelIMAPPStoreInfo *camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
+CamelIMAPPStoreInfo *camel_imapp_store_summary_full_name(CamelIMAPPStoreSummary *s, const gchar *full_name);
+CamelIMAPPStoreInfo *camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const gchar *full_name, gchar dir_sep);
/* a convenience lookup function. always use this if path known */
-char *camel_imapp_store_summary_full_from_path(CamelIMAPPStoreSummary *s, const char *path);
+gchar *camel_imapp_store_summary_full_from_path(CamelIMAPPStoreSummary *s, const gchar *path);
/* helper macro's */
#define camel_imapp_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAPP_STORE_INFO_FULL_NAME))
diff --git a/camel/providers/imapp/camel-imapp-store.c b/camel/providers/imapp/camel-imapp-store.c
index 676f57578..1cf195fee 100644
--- a/camel/providers/imapp/camel-imapp-store.c
+++ b/camel/providers/imapp/camel-imapp-store.c
@@ -68,20 +68,20 @@ static CamelStoreClass *parent_class = NULL;
static void finalize (CamelObject *object);
static void imap_construct(CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
-/* static char *imap_get_name(CamelService *service, gboolean brief);*/
+/* static gchar *imap_get_name(CamelService *service, gboolean brief);*/
static gboolean imap_connect (CamelService *service, CamelException *ex);
static gboolean imap_disconnect (CamelService *service, gboolean clean, CamelException *ex);
static GList *imap_query_auth_types (CamelService *service, CamelException *ex);
static CamelFolder *imap_get_trash (CamelStore *store, CamelException *ex);
-static CamelFolder *imap_get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
+static CamelFolder *imap_get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex);
static CamelFolder *imap_get_inbox (CamelStore *store, CamelException *ex);
-static void imap_rename_folder(CamelStore *store, const char *old_name, const char *new_name, CamelException *ex);
-static CamelFolderInfo *imap_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-static void imap_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void imap_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-static CamelFolderInfo *imap_create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
+static void imap_rename_folder(CamelStore *store, const gchar *old_name, const gchar *new_name, CamelException *ex);
+static CamelFolderInfo *imap_get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
+static void imap_delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void imap_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
+static CamelFolderInfo *imap_create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex);
/* yet to see if this should go global or not */
void camel_imapp_store_folder_selected(CamelIMAPPStore *store, CamelIMAPPFolder *folder, CamelIMAPPSelectResponse *select);
@@ -154,7 +154,7 @@ finalize (CamelObject *object)
static void imap_construct(CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
{
- char *root, *summary;
+ gchar *root, *summary;
CamelIMAPPStore *store = (CamelIMAPPStore *)service;
CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
@@ -186,19 +186,19 @@ enum {
#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
static void
-connect_to_server (CamelService *service, int ssl_mode, int try_starttls)
+connect_to_server (CamelService *service, gint ssl_mode, gint try_starttls)
/* throws IO exception */
{
CamelIMAPPStore *store = CAMEL_IMAPP_STORE (service);
CamelStream * volatile tcp_stream = NULL;
CamelIMAPPStream * volatile imap_stream = NULL;
- int ret;
+ gint ret;
CamelException *ex;
ex = camel_exception_new();
CAMEL_TRY {
- char *serv;
- const char *port = NULL;
+ gchar *serv;
+ const gchar *port = NULL;
struct addrinfo *ai, hints = { 0 };
/* parent class connect initialization */
@@ -275,8 +275,8 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls)
static struct {
- char *value;
- int mode;
+ gchar *value;
+ gint mode;
} ssl_options[] = {
{ "", USE_SSL_ALWAYS },
{ "always", USE_SSL_ALWAYS },
@@ -289,8 +289,8 @@ static gboolean
connect_to_server_wrapper (CamelService *service, CamelException *ex)
{
#ifdef HAVE_SSL
- const char *use_ssl;
- int i, ssl_mode;
+ const gchar *use_ssl;
+ gint i, ssl_mode;
use_ssl = camel_url_get_param (service->url, "use_ssl");
if (use_ssl) {
@@ -357,8 +357,8 @@ static void
store_get_pass(CamelIMAPPStore *store)
{
if (((CamelService *)store)->url->passwd == NULL) {
- char *base_prompt;
- char *full_prompt;
+ gchar *base_prompt;
+ gchar *full_prompt;
CamelException ex;
camel_exception_init(&ex);
@@ -396,7 +396,7 @@ store_get_sasl(struct _CamelIMAPPDriver *driver, CamelIMAPPStore *store)
}
static void
-store_get_login(struct _CamelIMAPPDriver *driver, char **login, char **pass, CamelIMAPPStore *store)
+store_get_login(struct _CamelIMAPPDriver *driver, gchar **login, gchar **pass, CamelIMAPPStore *store)
{
store_get_pass(store);
@@ -408,13 +408,13 @@ static gboolean
imap_connect (CamelService *service, CamelException *ex)
{
CamelIMAPPStore *store = (CamelIMAPPStore *)service;
- volatile int ret = FALSE;
+ volatile gint ret = FALSE;
CAMEL_TRY {
- volatile int retry = TRUE;
+ volatile gint retry = TRUE;
if (store->cache == NULL) {
- char *root;
+ gchar *root;
root = camel_session_get_storage_path(service->session, service, ex);
if (root) {
@@ -496,7 +496,7 @@ imap_get_trash (CamelStore *store, CamelException *ex)
}
static CamelFolder *
-imap_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+imap_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelIMAPPStore *istore = (CamelIMAPPStore *)store;
CamelIMAPPFolder * volatile folder = NULL;
@@ -530,12 +530,12 @@ imap_get_inbox(CamelStore *store, CamelException *ex)
}
/* 8 bit, string compare */
-static int folders_build_cmp(const void *app, const void *bpp)
+static gint folders_build_cmp(gconstpointer app, gconstpointer bpp)
{
struct _list_info *a = *((struct _list_info **)app);
struct _list_info *b = *((struct _list_info **)bpp);
- unsigned char *ap = (unsigned char *)(a->name);
- unsigned char *bp = (unsigned char *)(b->name);
+ guchar *ap = (guchar *)(a->name);
+ guchar *bp = (guchar *)(b->name);
printf("qsort, cmp '%s' <> '%s'\n", ap, bp);
@@ -555,7 +555,7 @@ static int folders_build_cmp(const void *app, const void *bpp)
static CamelFolderInfo *
folders_build_info(CamelURL *base, struct _list_info *li)
{
- char *path, *full_name, *name;
+ gchar *path, *full_name, *name;
CamelFolderInfo *fi;
full_name = imapp_list_get_path(li);
@@ -600,9 +600,9 @@ folders_build_info(CamelURL *base, struct _list_info *li)
/* note, pname is the raw name, not the folderinfo name */
/* note also this free's as we go, since we never go 'backwards' */
static CamelFolderInfo *
-folders_build_rec(CamelURL *base, GPtrArray *folders, int *ip, CamelFolderInfo *pfi, char *pname)
+folders_build_rec(CamelURL *base, GPtrArray *folders, gint *ip, CamelFolderInfo *pfi, gchar *pname)
{
- int plen = 0;
+ gint plen = 0;
CamelFolderInfo *last = NULL, *first = NULL;
if (pfi)
@@ -626,7 +626,7 @@ folders_build_rec(CamelURL *base, GPtrArray *folders, int *ip, CamelFolderInfo *
/* is this not an immediate child of the parent? */
#if 0
- char *p;
+ gchar *p;
if (pfi != NULL
&& li->separator != 0
&& (p = strchr(li->name + plen + 1, li->separator)) != NULL) {
@@ -663,9 +663,9 @@ folders_build_rec(CamelURL *base, GPtrArray *folders, int *ip, CamelFolderInfo *
}
static void
-folder_info_dump(CamelFolderInfo *fi, int depth)
+folder_info_dump(CamelFolderInfo *fi, gint depth)
{
- char *s;
+ gchar *s;
s = alloca(depth+1);
memset(s, ' ', depth);
@@ -680,18 +680,18 @@ folder_info_dump(CamelFolderInfo *fi, int depth)
}
static CamelFolderInfo *
-imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+imap_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelIMAPPStore *istore = (CamelIMAPPStore *)store;
CamelFolderInfo * fi= NULL;
- char *name;
+ gchar *name;
/* FIXME: temporary, since this is not a disco store */
if (istore->driver == NULL
&& !camel_service_connect((CamelService *)store, ex))
return NULL;
- name = (char *)top;
+ name = (gchar *)top;
if (name == NULL || name[0] == 0) {
/* namespace? */
name = "";
@@ -701,7 +701,7 @@ imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExc
CAMEL_TRY {
CamelURL *base;
- int i;
+ gint i;
GPtrArray *folders;
/* FIXME: subscriptions? lsub? */
@@ -783,19 +783,19 @@ imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExc
}
static void
-imap_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+imap_delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
camel_exception_setv(ex, 1, "delete_folder::unimplemented");
}
static void
-imap_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
+imap_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
camel_exception_setv(ex, 1, "rename_folder::unimplemented");
}
static CamelFolderInfo *
-imap_create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
+imap_create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
{
camel_exception_setv(ex, 1, "create_folder::unimplemented");
return NULL;
@@ -803,7 +803,7 @@ imap_create_folder(CamelStore *store, const char *parent_name, const char *folde
/* ********************************************************************** */
#if 0
-static int store_resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data)
+static gint store_resp_fetch(CamelIMAPPEngine *ie, guint32 id, gpointer data)
{
struct _fetch_info *finfo;
CamelIMAPPStore *istore = data;
@@ -890,7 +890,7 @@ static int store_resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data)
if (pending == NULL) {
pending = e_memchunk_alloc(istore->pending_fetch_chunks);
pending->info = info;
- g_hash_table_insert(istore->pending_fetch_table, (char *)camel_message_info_uid(info), pending);
+ g_hash_table_insert(istore->pending_fetch_table, (gchar *)camel_message_info_uid(info), pending);
camel_dlist_addtail(&istore->pending_fetch_list, (CamelDListNode *)pending);
}
} else {
@@ -924,7 +924,7 @@ camel_imapp_store_folder_selected(CamelIMAPPStore *store, CamelIMAPPFolder *fold
{
CamelIMAPPCommand * volatile ic = NULL;
CamelIMAPPStore *istore = (CamelIMAPPStore *)store;
- int i;
+ gint i;
struct _uidset_state ss;
GPtrArray *fetch;
CamelMessageInfo *info;
@@ -1004,14 +1004,14 @@ camel_imapp_store_folder_selected(CamelIMAPPStore *store, CamelIMAPPFolder *fold
#if 0
/*char *uids[] = {"1", "2", "4", "5", "6", "7", "9", "11", "12", 0};*/
/*char *uids[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", 0};*/
-char *uids[] = {"1", "3", "5", "7", "9", "11", "12", "13", "14", "15", "20", "21", "24", "25", "26", 0};
+gchar *uids[] = {"1", "3", "5", "7", "9", "11", "12", "13", "14", "15", "20", "21", "24", "25", "26", 0};
void
uidset_test(CamelIMAPPEngine *ie)
{
struct _uidset_state ss;
CamelIMAPPCommand *ic;
- int i;
+ gint i;
/*ic = camel_imapp_engine_command_new(ie, 0, "FETCH", NULL, "FETCH ");*/
uidset_init(&ss, 0, 0);
diff --git a/camel/providers/imapp/camel-imapp-store.h b/camel/providers/imapp/camel-imapp-store.h
index 10d508a6c..67971a70f 100644
--- a/camel/providers/imapp/camel-imapp-store.h
+++ b/camel/providers/imapp/camel-imapp-store.h
@@ -51,7 +51,7 @@ typedef struct {
struct _CamelDataCache *cache;
/* if we had a login error, what to show to user */
- char *login_error;
+ gchar *login_error;
GPtrArray *pending_list;
} CamelIMAPPStore;
diff --git a/camel/providers/imapp/camel-imapp-stream.c b/camel/providers/imapp/camel-imapp-stream.c
index 4411c5163..2ba1db094 100644
--- a/camel/providers/imapp/camel-imapp-stream.c
+++ b/camel/providers/imapp/camel-imapp-stream.c
@@ -52,7 +52,7 @@ static CamelObjectClass *parent_class = NULL;
static int
stream_fill(CamelIMAPPStream *is)
{
- int left = 0;
+ gint left = 0;
if (is->source) {
left = is->end - is->ptr;
@@ -76,7 +76,7 @@ stream_fill(CamelIMAPPStream *is)
}
static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
+stream_read(CamelStream *stream, gchar *buffer, size_t n)
{
CamelIMAPPStream *is = (CamelIMAPPStream *)stream;
ssize_t max;
@@ -103,7 +103,7 @@ stream_read(CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
+stream_write(CamelStream *stream, const gchar *buffer, size_t n)
{
CamelIMAPPStream *is = (CamelIMAPPStream *)stream;
@@ -234,7 +234,7 @@ list_wildcards ::= "%" / "*"
quoted_specials ::= <"> / "\"
*/
-static unsigned char imap_specials[256] = {
+static guchar imap_specials[256] = {
/* 00 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 10 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 20 */0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1,
@@ -259,8 +259,8 @@ static unsigned char imap_specials[256] = {
/* could be pregenerated, but this is cheap */
static struct {
- unsigned char *chars;
- unsigned char mask;
+ guchar *chars;
+ guchar mask;
} is_masks[] = {
{ "\n*()[]+", 2 },
{ " \r\n()[]+", 4 },
@@ -268,8 +268,8 @@ static struct {
static void setup_table(void)
{
- int i;
- unsigned char *p, c;
+ gint i;
+ guchar *p, c;
for (i=0;i<(int)(sizeof(is_masks)/sizeof(is_masks[0]));i++) {
p = is_masks[i].chars;
@@ -281,10 +281,10 @@ static void setup_table(void)
#if 0
static int
-skip_ws(CamelIMAPPStream *is, unsigned char *pp, unsigned char *pe)
+skip_ws(CamelIMAPPStream *is, guchar *pp, guchar *pe)
{
- register unsigned char c, *p;
- unsigned char *e;
+ register guchar c, *p;
+ guchar *e;
p = is->ptr;
e = is->end;
@@ -309,10 +309,10 @@ skip_ws(CamelIMAPPStream *is, unsigned char *pp, unsigned char *pe)
/* FIXME: these should probably handle it themselves,
and get rid of the token interface? */
-int
-camel_imapp_stream_atom(CamelIMAPPStream *is, unsigned char **data, unsigned int *lenp)
+gint
+camel_imapp_stream_atom(CamelIMAPPStream *is, guchar **data, guint *lenp)
{
- unsigned char *p, c;
+ guchar *p, c;
/* this is only 'approximate' atom */
switch(camel_imapp_stream_token(is, data, lenp)) {
@@ -332,11 +332,11 @@ camel_imapp_stream_atom(CamelIMAPPStream *is, unsigned char **data, unsigned int
}
/* gets an atom, a quoted_string, or a literal */
-int
-camel_imapp_stream_astring(CamelIMAPPStream *is, unsigned char **data)
+gint
+camel_imapp_stream_astring(CamelIMAPPStream *is, guchar **data)
{
- unsigned char *p, *start;
- unsigned int len, inlen;
+ guchar *p, *start;
+ guint len, inlen;
switch(camel_imapp_stream_token(is, data, &len)) {
case IMAP_TOK_TOKEN:
@@ -372,11 +372,11 @@ camel_imapp_stream_astring(CamelIMAPPStream *is, unsigned char **data)
}
/* check for NIL or (small) quoted_string or literal */
-int
-camel_imapp_stream_nstring(CamelIMAPPStream *is, unsigned char **data)
+gint
+camel_imapp_stream_nstring(CamelIMAPPStream *is, guchar **data)
{
- unsigned char *p, *start;
- unsigned int len, inlen;
+ guchar *p, *start;
+ guint len, inlen;
switch(camel_imapp_stream_token(is, data, &len)) {
case IMAP_TOK_STRING:
@@ -415,13 +415,13 @@ camel_imapp_stream_nstring(CamelIMAPPStream *is, unsigned char **data)
}
/* parse an nstring as a stream */
-int
+gint
camel_imapp_stream_nstring_stream(CamelIMAPPStream *is, CamelStream **stream)
/* throws IO,PARSE exception */
{
- unsigned char *token;
- unsigned int len;
- int ret = 0;
+ guchar *token;
+ guint len;
+ gint ret = 0;
CamelStream * volatile mem = NULL;
*stream = NULL;
@@ -463,8 +463,8 @@ camel_imapp_stream_nstring_stream(CamelIMAPPStream *is, CamelStream **stream)
guint32
camel_imapp_stream_number(CamelIMAPPStream *is)
{
- unsigned char *token;
- unsigned int len;
+ guchar *token;
+ guint len;
if (camel_imapp_stream_token(is, &token, &len) != IMAP_TOK_INT) {
camel_exception_throw(1, "expecting number");
@@ -474,13 +474,13 @@ camel_imapp_stream_number(CamelIMAPPStream *is)
return strtoul(token, 0, 10);
}
-int
-camel_imapp_stream_text(CamelIMAPPStream *is, unsigned char **text)
+gint
+camel_imapp_stream_text(CamelIMAPPStream *is, guchar **text)
{
GByteArray *build = g_byte_array_new();
- unsigned char *token;
- unsigned int len;
- int tok;
+ guchar *token;
+ guint len;
+ gint tok;
CAMEL_TRY {
while (is->unget > 0) {
@@ -519,12 +519,12 @@ camel_imapp_stream_text(CamelIMAPPStream *is, unsigned char **text)
/* Get one token from the imap stream */
camel_imapp_token_t
/* throws IO,PARSE exception */
-camel_imapp_stream_token(CamelIMAPPStream *is, unsigned char **data, unsigned int *len)
+camel_imapp_stream_token(CamelIMAPPStream *is, guchar **data, guint *len)
{
- register unsigned char c, *p, *o, *oe;
- unsigned char *e;
- unsigned int literal;
- int digits;
+ register guchar c, *p, *o, *oe;
+ guchar *e;
+ guint literal;
+ gint digits;
if (is->unget > 0) {
is->unget--;
@@ -587,7 +587,7 @@ camel_imapp_stream_token(CamelIMAPPStream *is, unsigned char **data, unsigned in
if (isdigit(c))
printf("Protocol error: literal too big\n");
else
- printf("Protocol error: literal contains invalid char %02x '%c'\n", c, isprint(c)?c:c);
+ printf("Protocol error: literal contains invalid gchar %02x '%c'\n", c, isprint(c)?c:c);
goto protocol_error;
}
}
@@ -692,7 +692,7 @@ protocol_error:
}
void
-camel_imapp_stream_ungettoken(CamelIMAPPStream *is, camel_imapp_token_t tok, unsigned char *token, unsigned int len)
+camel_imapp_stream_ungettoken(CamelIMAPPStream *is, camel_imapp_token_t tok, guchar *token, guint len)
{
/*printf("ungettoken: '%c' '%s'\n", tok, token);*/
is->unget_tok = tok;
@@ -702,10 +702,10 @@ camel_imapp_stream_ungettoken(CamelIMAPPStream *is, camel_imapp_token_t tok, uns
}
/* returns -1 on error, 0 if last lot of data, >0 if more remaining */
-int camel_imapp_stream_gets(CamelIMAPPStream *is, unsigned char **start, unsigned int *len)
+gint camel_imapp_stream_gets(CamelIMAPPStream *is, guchar **start, guint *len)
{
- int max;
- unsigned char *end;
+ gint max;
+ guchar *end;
*len = 0;
@@ -727,15 +727,15 @@ int camel_imapp_stream_gets(CamelIMAPPStream *is, unsigned char **start, unsigne
return end == NULL?1:0;
}
-void camel_imapp_stream_set_literal(CamelIMAPPStream *is, unsigned int literal)
+void camel_imapp_stream_set_literal(CamelIMAPPStream *is, guint literal)
{
is->literal = literal;
}
/* returns -1 on erorr, 0 if last data, >0 if more data left */
-int camel_imapp_stream_getl(CamelIMAPPStream *is, unsigned char **start, unsigned int *len)
+gint camel_imapp_stream_getl(CamelIMAPPStream *is, guchar **start, guint *len)
{
- int max;
+ gint max;
*len = 0;
diff --git a/camel/providers/imapp/camel-imapp-stream.h b/camel/providers/imapp/camel-imapp-stream.h
index 4af986f73..44570bdbc 100644
--- a/camel/providers/imapp/camel-imapp-stream.h
+++ b/camel/providers/imapp/camel-imapp-stream.h
@@ -47,15 +47,15 @@ struct _CamelIMAPPStream {
CamelStream *source;
/*int state;*/
- unsigned char *buf, *ptr, *end;
- unsigned int literal;
+ guchar *buf, *ptr, *end;
+ guint literal;
- unsigned int unget;
+ guint unget;
camel_imapp_token_t unget_tok;
- unsigned char *unget_token;
- unsigned int unget_len;
+ guchar *unget_token;
+ guint unget_len;
- unsigned char *tokenbuf, *tokenptr, *tokenend;
+ guchar *tokenbuf, *tokenptr, *tokenend;
};
struct _CamelIMAPPStreamClass {
@@ -66,25 +66,25 @@ CamelType camel_imapp_stream_get_type (void);
CamelStream *camel_imapp_stream_new (CamelStream *source);
-camel_imapp_token_t camel_imapp_stream_token (CamelIMAPPStream *is, unsigned char **start, unsigned int *len); /* throws IO,PARSE exception */
-void camel_imapp_stream_ungettoken (CamelIMAPPStream *is, camel_imapp_token_t tok, unsigned char *token, unsigned int len);
+camel_imapp_token_t camel_imapp_stream_token (CamelIMAPPStream *is, guchar **start, guint *len); /* throws IO,PARSE exception */
+void camel_imapp_stream_ungettoken (CamelIMAPPStream *is, camel_imapp_token_t tok, guchar *token, guint len);
-void camel_imapp_stream_set_literal (CamelIMAPPStream *is, unsigned int literal);
-int camel_imapp_stream_gets (CamelIMAPPStream *is, unsigned char **start, unsigned int *len);
-int camel_imapp_stream_getl (CamelIMAPPStream *is, unsigned char **start, unsigned int *len);
+void camel_imapp_stream_set_literal (CamelIMAPPStream *is, guint literal);
+int camel_imapp_stream_gets (CamelIMAPPStream *is, guchar **start, guint *len);
+int camel_imapp_stream_getl (CamelIMAPPStream *is, guchar **start, guint *len);
/* all throw IO,PARSE exceptions */
/* gets an atom, upper-cases */
-int camel_imapp_stream_atom (CamelIMAPPStream *is, unsigned char **start, unsigned int *len);
+int camel_imapp_stream_atom (CamelIMAPPStream *is, guchar **start, guint *len);
/* gets an atom or string */
-int camel_imapp_stream_astring (CamelIMAPPStream *is, unsigned char **start);
+int camel_imapp_stream_astring (CamelIMAPPStream *is, guchar **start);
/* gets a NIL or a string, start==NULL if NIL */
-int camel_imapp_stream_nstring (CamelIMAPPStream *is, unsigned char **start);
+int camel_imapp_stream_nstring (CamelIMAPPStream *is, guchar **start);
/* gets a NIL or string into a stream, stream==NULL if NIL */
int camel_imapp_stream_nstring_stream(CamelIMAPPStream *is, CamelStream **stream);
/* gets 'text' */
-int camel_imapp_stream_text (CamelIMAPPStream *is, unsigned char **text);
+int camel_imapp_stream_text (CamelIMAPPStream *is, guchar **text);
/* gets a 'number' */
guint32 camel_imapp_stream_number(CamelIMAPPStream *is);
diff --git a/camel/providers/imapp/camel-imapp-summary.c b/camel/providers/imapp/camel-imapp-summary.c
index e784e1060..ab84a2d71 100644
--- a/camel/providers/imapp/camel-imapp-summary.c
+++ b/camel/providers/imapp/camel-imapp-summary.c
@@ -38,11 +38,11 @@
#define CAMEL_IMAPP_SUMMARY_VERSION (1)
-static int summary_header_load(CamelFolderSummary *, FILE *);
-static int summary_header_save(CamelFolderSummary *, FILE *);
+static gint summary_header_load(CamelFolderSummary *, FILE *);
+static gint summary_header_save(CamelFolderSummary *, FILE *);
static CamelMessageInfo *message_info_load(CamelFolderSummary *s, FILE *in);
-static int message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *info);
+static gint message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *info);
static void camel_imapp_summary_class_init(CamelIMAPPSummaryClass *klass);
static void camel_imapp_summary_init (CamelIMAPPSummary *obj);
diff --git a/camel/providers/imapp/camel-imapp-utils.c b/camel/providers/imapp/camel-imapp-utils.c
index e66afad51..2260ad304 100644
--- a/camel/providers/imapp/camel-imapp-utils.c
+++ b/camel/providers/imapp/camel-imapp-utils.c
@@ -21,7 +21,7 @@
/* ANSI-C code produced by gperf version 2.7 */
/* Command-line: gperf -H imap_hash -N imap_tokenise -L ANSI-C -o -t -k1,$ imap-tokens.txt */
-struct _imap_keyword { char *name; camel_imapp_id_t id; };
+struct _imap_keyword { gchar *name; camel_imapp_id_t id; };
/*
gperf input file
best hash generated using: gperf -o -s-2 -k1,'$' -t -H imap_hash -N imap_tokenise -L ANSI-C
@@ -38,9 +38,9 @@ struct _imap_keyword { char *name; camel_imapp_id_t id; };
__inline
#endif
static unsigned int
-imap_hash (register const char *str, register unsigned int len)
+imap_hash (register const gchar *str, register guint len)
{
- static unsigned char asso_values[] =
+ static guchar asso_values[] =
{
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
@@ -76,7 +76,7 @@ imap_hash (register const char *str, register unsigned int len)
__inline
#endif
camel_imapp_id_t
-imap_tokenise (register const char *str, register unsigned int len)
+imap_tokenise (register const gchar *str, register guint len)
{
static struct _imap_keyword wordlist[] =
{
@@ -115,11 +115,11 @@ imap_tokenise (register const char *str, register unsigned int len)
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register int key = imap_hash (str, len);
+ register gint key = imap_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register const char *s = wordlist[key].name;
+ register const gchar *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return wordlist[key].id;
@@ -130,7 +130,7 @@ imap_tokenise (register const char *str, register unsigned int len)
/* flag table */
static struct {
- char *name;
+ gchar *name;
guint32 flag;
} flag_table[] = {
{ "\\ANSWERED", CAMEL_MESSAGE_ANSWERED },
@@ -149,8 +149,8 @@ void
imap_parse_flags(CamelIMAPPStream *stream, guint32 *flagsp)
/* throws IO,PARSE exception */
{
- int tok, len, i;
- unsigned char *token, *p, c;
+ gint tok, len, i;
+ guchar *token, *p, c;
guint32 flags = 0;
*flagsp = flags;
@@ -181,7 +181,7 @@ void
imap_write_flags(CamelStream *stream, guint32 flags)
/* throws IO exception */
{
- int i;
+ gint i;
/* all this ugly exception throwing goes away once camel streams throw their own? */
if (camel_stream_write(stream, "(", 1) == -1)
@@ -319,7 +319,7 @@ media_text ::= <"> "TEXT" <"> SPACE media_subtype
/*
struct _body_fields {
CamelContentType *ct;
- char *msgid, *desc;
+ gchar *msgid, *desc;
CamelTransferEncoding encoding;
guint32 size;
};*/
@@ -347,8 +347,8 @@ imap_free_body(struct _CamelMessageContentInfo *cinfo)
void
imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist)
{
- int tok, len;
- unsigned char *token, *param;
+ gint tok, len;
+ guchar *token, *param;
p(printf("body_fld_param\n"));
@@ -373,8 +373,8 @@ imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist)
struct _CamelContentDisposition *
imap_parse_ext_optional(CamelIMAPPStream *is)
{
- int tok, len;
- unsigned char *token;
+ gint tok, len;
+ guchar *token;
struct _CamelContentDisposition * volatile dinfo = NULL;
/* this parses both extension types, from the body_fld_dsp onwards */
@@ -458,7 +458,7 @@ imap_parse_ext_optional(CamelIMAPPStream *is)
struct _CamelMessageContentInfo *
imap_parse_body_fields(CamelIMAPPStream *is)
{
- unsigned char *token, *type;
+ guchar *token, *type;
struct _CamelMessageContentInfo *cinfo;
/* body_fields ::= body_fld_param SPACE body_fld_id SPACE
@@ -505,8 +505,8 @@ struct _camel_header_address *
imap_parse_address_list(CamelIMAPPStream *is)
/* throws PARSE,IO exception */
{
- int tok, len;
- unsigned char *token, *host, *mbox;
+ gint tok, len;
+ guchar *token, *host, *mbox;
struct _camel_header_address *list = NULL;
/* "(" 1*address ")" / nil */
@@ -555,7 +555,7 @@ imap_parse_address_list(CamelIMAPPStream *is)
group = addr;
}
} else {
- addr->v.addr = g_strdup_printf("%s%s%s", mbox?(char *)mbox:"", host?"@":"", host?(char *)host:"");
+ addr->v.addr = g_strdup_printf("%s%s%s", mbox?(gchar *)mbox:"", host?"@":"", host?(gchar *)host:"");
g_free(mbox);
d(printf("adding address '%s'\n", addr->v.addr));
if (group != NULL)
@@ -581,10 +581,10 @@ imap_parse_address_list(CamelIMAPPStream *is)
struct _CamelMessageInfo *
imap_parse_envelope(CamelIMAPPStream *is)
{
- int tok, len;
- unsigned char *token;
+ gint tok, len;
+ guchar *token;
struct _camel_header_address *addr, *addr_from;
- char *addrstr;
+ gchar *addrstr;
struct _CamelMessageInfoBase *minfo;
/* envelope ::= "(" env_date SPACE env_subject SPACE env_from
@@ -688,8 +688,8 @@ imap_parse_envelope(CamelIMAPPStream *is)
struct _CamelMessageContentInfo *
imap_parse_body(CamelIMAPPStream *is)
{
- int tok, len;
- unsigned char *token;
+ gint tok, len;
+ guchar *token;
struct _CamelMessageContentInfo * volatile cinfo = NULL;
struct _CamelMessageContentInfo *subinfo, *last;
struct _CamelContentDisposition * volatile dinfo = NULL;
@@ -800,7 +800,7 @@ imap_parse_body(CamelIMAPPStream *is)
if (tok != ')') {
camel_imapp_stream_nstring(is, &token);
- d(printf("md5: %s\n", token?(char *)token:"NIL"));
+ d(printf("md5: %s\n", token?(gchar *)token:"NIL"));
/* body_fld_dsp ::= "(" string SPACE body_fld_param ")" / nil */
@@ -837,12 +837,12 @@ imap_parse_body(CamelIMAPPStream *is)
return cinfo;
}
-char *
+gchar *
imap_parse_section(CamelIMAPPStream *is)
{
- int tok, len;
- unsigned char *token;
- char * volatile section = NULL;
+ gint tok, len;
+ guchar *token;
+ gchar * volatile section = NULL;
/* currently we only return the part within the [section] specifier
any header fields are parsed, but dropped */
@@ -917,7 +917,7 @@ imap_free_fetch(struct _fetch_info *finfo)
g_free(finfo);
}
-extern void camel_content_info_dump(CamelMessageContentInfo *ci, int depth);
+extern void camel_content_info_dump(CamelMessageContentInfo *ci, gint depth);
extern void camel_message_info_dump(CamelMessageInfo *mi);
#include "camel-stream-fs.h"
@@ -927,7 +927,7 @@ void
imap_dump_fetch(struct _fetch_info *finfo)
{
CamelStream *sout;
- int fd;
+ gint fd;
printf("Fetch info:\n");
if (finfo == NULL) {
@@ -975,8 +975,8 @@ imap_dump_fetch(struct _fetch_info *finfo)
struct _fetch_info *
imap_parse_fetch(CamelIMAPPStream *is)
{
- int tok, len;
- unsigned char *token, *p, c;
+ gint tok, len;
+ guchar *token, *p, c;
struct _fetch_info *finfo;
finfo = g_malloc0(sizeof(*finfo));
@@ -1071,8 +1071,8 @@ imap_parse_fetch(CamelIMAPPStream *is)
struct _status_info *
imap_parse_status(CamelIMAPPStream *is)
{
- int tok, len;
- unsigned char *token;
+ gint tok, len;
+ guchar *token;
struct _status_info *sinfo;
sinfo = g_malloc0(sizeof(*sinfo));
@@ -1147,7 +1147,7 @@ imap_parse_status(CamelIMAPPStream *is)
}
/* and take the human readable response */
- camel_imapp_stream_text(is, (unsigned char **)&sinfo->text);
+ camel_imapp_stream_text(is, (guchar **)&sinfo->text);
} CAMEL_CATCH(ex) {
imap_free_status(sinfo);
camel_exception_throw_ex(ex);
@@ -1177,7 +1177,7 @@ imap_free_status(struct _status_info *sinfo)
/* FIXME: use tokeniser? */
/* FIXME: real flags */
static struct {
- char *name;
+ gchar *name;
guint32 flag;
} list_flag_table[] = {
{ "\\NOINFERIORS", CAMEL_FOLDER_NOINFERIORS },
@@ -1190,8 +1190,8 @@ struct _list_info *
imap_parse_list(CamelIMAPPStream *is)
/* throws io, parse */
{
- int tok, len, i;
- unsigned char *token, *p, c;
+ gint tok, len, i;
+ guchar *token, *p, c;
struct _list_info * volatile linfo;
linfo = g_malloc0(sizeof(*linfo));
@@ -1230,12 +1230,12 @@ imap_parse_list(CamelIMAPPStream *is)
return linfo;
}
-char *
+gchar *
imapp_list_get_path(struct _list_info *li)
{
- char *path, *p;
- int c;
- const char *f;
+ gchar *path, *p;
+ gint c;
+ const gchar *f;
if (li->separator != 0 && li->separator != '/') {
p = path = alloca(strlen(li->name)*3+1);
@@ -1282,10 +1282,10 @@ imapp_uidset_init(struct _uidset_state *ss, CamelIMAPPEngine *ie)
ss->last = 0;
}
-int
+gint
imapp_uidset_done(struct _uidset_state *ss, CamelIMAPPCommand *ic)
{
- int ret = 0;
+ gint ret = 0;
if (ss->last != 0 && ss->last != ss->start) {
camel_imapp_engine_command_add(ss->ie, ic, ":%d", ss->last);
@@ -1301,8 +1301,8 @@ imapp_uidset_done(struct _uidset_state *ss, CamelIMAPPCommand *ic)
return ret;
}
-int
-imapp_uidset_add(struct _uidset_state *ss, CamelIMAPPCommand *ic, const char *uid)
+gint
+imapp_uidset_add(struct _uidset_state *ss, CamelIMAPPCommand *ic, const gchar *uid)
{
guint32 uidn;
diff --git a/camel/providers/imapp/camel-imapp-utils.h b/camel/providers/imapp/camel-imapp-utils.h
index e7f84f62a..75497886f 100644
--- a/camel/providers/imapp/camel-imapp-utils.h
+++ b/camel/providers/imapp/camel-imapp-utils.h
@@ -38,7 +38,7 @@ typedef enum _camel_imapp_id_t {
} camel_imapp_id_t;
/* str MUST be in upper case, tokenised using gperf function */
-camel_imapp_id_t imap_tokenise(register const char *str, register unsigned int len);
+camel_imapp_id_t imap_tokenise(register const gchar *str, register guint len);
/* this flag should be part of imapfoldersummary */
enum {
@@ -56,7 +56,7 @@ struct _CamelMessageContentInfo *imap_parse_body_fields(CamelIMAPPStream *is); /
struct _camel_header_address *imap_parse_address_list(CamelIMAPPStream *is); /* IO,PARSE */
struct _CamelMessageInfo *imap_parse_envelope(CamelIMAPPStream *is); /* IO, PARSE */
struct _CamelMessageContentInfo *imap_parse_body(CamelIMAPPStream *is); /* IO,PARSE */
-char *imap_parse_section(CamelIMAPPStream *is); /* IO,PARSE */
+gchar *imap_parse_section(CamelIMAPPStream *is); /* IO,PARSE */
void imap_free_body(struct _CamelMessageContentInfo *cinfo);
/* ********************************************************************** */
@@ -72,9 +72,9 @@ struct _fetch_info {
guint32 size; /* RFC822.SIZE */
guint32 offset; /* start offset of a BODY[]<offset.length> request */
guint32 flags; /* FLAGS */
- char *date; /* INTERNALDATE */
- char *section; /* section for a BODY[section] request */
- char *uid; /* UID */
+ gchar *date; /* INTERNALDATE */
+ gchar *section; /* section for a BODY[section] request */
+ gchar *uid; /* UID */
};
#define FETCH_BODY (1<<0)
@@ -101,15 +101,15 @@ struct _status_info {
union {
struct {
- char *oldname;
- char *newname;
+ gchar *oldname;
+ gchar *newname;
} newname;
guint32 permanentflags;
guint32 uidvalidity;
guint32 unseen;
} u;
- char *text;
+ gchar *text;
};
struct _status_info *imap_parse_status(CamelIMAPPStream *is);
@@ -121,19 +121,19 @@ void imap_free_status(struct _status_info *sinfo);
should this just return the name & flags & separator by reference? */
struct _list_info {
guint32 flags:24;
- char separator;
- char *name;
+ gchar separator;
+ gchar *name;
};
struct _list_info *imap_parse_list(CamelIMAPPStream *is);
-char *imapp_list_get_path(struct _list_info *li);
+gchar *imapp_list_get_path(struct _list_info *li);
void imap_free_list(struct _list_info *linfo);
/* ********************************************************************** */
struct _uidset_state {
struct _CamelIMAPPEngine *ie;
- int len;
+ gint len;
guint32 start;
guint32 last;
};
@@ -141,8 +141,8 @@ struct _uidset_state {
struct _CamelIMAPPEngine;
struct _CamelIMAPPCommand;
void imapp_uidset_init(struct _uidset_state *ss, struct _CamelIMAPPEngine *ie);
-int imapp_uidset_done(struct _uidset_state *ss, struct _CamelIMAPPCommand *ic);
-int imapp_uidset_add(struct _uidset_state *ss, struct _CamelIMAPPCommand *ic, const char *uid);
+gint imapp_uidset_done(struct _uidset_state *ss, struct _CamelIMAPPCommand *ic);
+gint imapp_uidset_add(struct _uidset_state *ss, struct _CamelIMAPPCommand *ic, const gchar *uid);
G_END_DECLS
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index bdf1754af..4fe9328d1 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -69,10 +69,10 @@ static GSList *local_folder_properties;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
#define CLOCALS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static int local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static int local_setv(CamelObject *object, CamelException *ex, CamelArgV *args);
+static gint local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
+static gint local_setv(CamelObject *object, CamelException *ex, CamelArgV *args);
-static int local_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
+static gint local_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
static void local_unlock(CamelLocalFolder *lf);
static void local_refresh_info(CamelFolder *folder, CamelException *ex);
@@ -80,14 +80,14 @@ static void local_refresh_info(CamelFolder *folder, CamelException *ex);
static void local_sync(CamelFolder *folder, gboolean expunge, CamelException *ex);
static void local_expunge(CamelFolder *folder, CamelException *ex);
-static GPtrArray *local_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex);
-static guint32 local_count_by_expression(CamelFolder *folder, const char *expression, CamelException *ex);
-static GPtrArray *local_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex);
+static GPtrArray *local_search_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex);
+static guint32 local_count_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex);
+static GPtrArray *local_search_by_uids(CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex);
static void local_search_free(CamelFolder *folder, GPtrArray * result);
static GPtrArray * local_get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelException *ex);
static void local_delete(CamelFolder *folder);
-static void local_rename(CamelFolder *folder, const char *newname);
+static void local_rename(CamelFolder *folder, const gchar *newname);
static void local_finalize(CamelObject * object);
@@ -184,7 +184,7 @@ camel_local_folder_get_type(void)
static CamelType camel_local_folder_type = CAMEL_INVALID_TYPE;
if (camel_local_folder_type == CAMEL_INVALID_TYPE) {
- int i;
+ gint i;
parent_class = (CamelFolderClass *)camel_folder_get_type();
camel_local_folder_type = camel_type_register(camel_folder_get_type(), "CamelLocalFolder",
@@ -205,18 +205,18 @@ camel_local_folder_get_type(void)
}
CamelLocalFolder *
-camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
+camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex)
{
CamelFolderInfo *fi;
CamelFolder *folder;
- const char *root_dir_path;
- char *name;
- char *tmp, *statepath;
+ const gchar *root_dir_path;
+ gchar *name;
+ gchar *tmp, *statepath;
#ifndef G_OS_WIN32
- char folder_path[PATH_MAX];
+ gchar folder_path[PATH_MAX];
struct stat st;
#endif
- int forceindex, len;
+ gint forceindex, len;
CamelURL *url;
CamelLocalStore *ls = (CamelLocalStore *)parent_store;
@@ -270,7 +270,7 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
/* if we have no/invalid index file, force it */
forceindex = camel_text_index_check(lf->index_path) == -1;
if (lf->flags & CAMEL_STORE_FOLDER_BODY_INDEX) {
- int flag = O_RDWR|O_CREAT;
+ gint flag = O_RDWR|O_CREAT;
if (forceindex)
flag |= O_TRUNC;
@@ -337,7 +337,7 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
/* lock the folder, may be called repeatedly (with matching unlock calls),
with type the same or less than the first call */
-int camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
+gint camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
{
if (lf->locked > 0) {
/* lets be anal here - its important the code knows what its doing */
@@ -354,7 +354,7 @@ int camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelExcep
}
/* unlock folder */
-int camel_local_folder_unlock(CamelLocalFolder *lf)
+gint camel_local_folder_unlock(CamelLocalFolder *lf)
{
g_assert(lf->locked>0);
lf->locked--;
@@ -368,7 +368,7 @@ static int
local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
- int i;
+ gint i;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -379,7 +379,7 @@ local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
switch (tag & CAMEL_ARG_TAG) {
case CAMEL_OBJECT_ARG_DESCRIPTION:
if (folder->description == NULL) {
- char *tmp, *path;
+ gchar *tmp, *path;
/* check some common prefixes to shorten the name */
tmp = ((CamelService *)folder->parent_store)->url->path;
@@ -437,7 +437,7 @@ local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
static int
local_setv(CamelObject *object, CamelException *ex, CamelArgV *args)
{
- int i;
+ gint i;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -555,10 +555,10 @@ local_delete(CamelFolder *folder)
}
static void
-local_rename(CamelFolder *folder, const char *newname)
+local_rename(CamelFolder *folder, const gchar *newname)
{
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
- char *statepath;
+ gchar *statepath;
CamelLocalStore *ls = (CamelLocalStore *)folder->parent_store;
d(printf("renaming local folder paths to '%s'\n", newname));
@@ -585,7 +585,7 @@ local_rename(CamelFolder *folder, const char *newname)
}
static GPtrArray *
-local_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex)
+local_search_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelLocalFolder *local_folder = CAMEL_LOCAL_FOLDER(folder);
GPtrArray *matches;
@@ -605,7 +605,7 @@ local_search_by_expression(CamelFolder *folder, const char *expression, CamelExc
}
static guint32
-local_count_by_expression(CamelFolder *folder, const char *expression, CamelException *ex)
+local_count_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelLocalFolder *local_folder = CAMEL_LOCAL_FOLDER(folder);
gint matches;
@@ -625,7 +625,7 @@ local_count_by_expression(CamelFolder *folder, const char *expression, CamelExce
}
static GPtrArray *
-local_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
+local_search_by_uids(CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex)
{
CamelLocalFolder *local_folder = CAMEL_LOCAL_FOLDER(folder);
GPtrArray *matches;
diff --git a/camel/providers/local/camel-local-folder.h b/camel/providers/local/camel-local-folder.h
index a4010385f..b4b8b8df4 100644
--- a/camel/providers/local/camel-local-folder.h
+++ b/camel/providers/local/camel-local-folder.h
@@ -57,13 +57,13 @@ struct _CamelLocalFolder {
guint32 flags; /* open mode flags */
- int locked; /* lock counter */
+ gint locked; /* lock counter */
CamelLockType locktype; /* what type of lock we have */
- char *base_path; /* base path of the local folder */
- char *folder_path; /* the path to the folder itself */
- char *summary_path; /* where the summary lives */
- char *index_path; /* where the index file lives */
+ gchar *base_path; /* base path of the local folder */
+ gchar *folder_path; /* the path to the folder itself */
+ gchar *summary_path; /* where the summary lives */
+ gchar *index_path; /* where the index file lives */
CamelIndex *index; /* index for this folder */
CamelFolderSearch *search; /* used to run searches, we just use the real thing (tm) */
@@ -76,10 +76,10 @@ struct _CamelLocalFolderClass {
/* Virtual methods */
/* summary factory, only used at init */
- CamelLocalSummary *(*create_summary)(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
+ CamelLocalSummary *(*create_summary)(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index);
/* Lock the folder for my operations */
- int (*lock)(CamelLocalFolder *, CamelLockType type, CamelException *ex);
+ gint (*lock)(CamelLocalFolder *, CamelLockType type, CamelException *ex);
/* Unlock the folder for my operations */
void (*unlock)(CamelLocalFolder *);
@@ -89,15 +89,15 @@ struct _CamelLocalFolderClass {
/* public methods */
/* flags are taken from CAMEL_STORE_FOLDER_* flags */
CamelLocalFolder *camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store,
- const char *full_name, guint32 flags, CamelException *ex);
+ const gchar *full_name, guint32 flags, CamelException *ex);
/* Standard Camel function */
CamelType camel_local_folder_get_type(void);
/* Lock the folder for internal use. May be called repeatedly */
/* UNIMPLEMENTED */
-int camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
-int camel_local_folder_unlock(CamelLocalFolder *lf);
+gint camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
+gint camel_local_folder_unlock(CamelLocalFolder *lf);
G_END_DECLS
diff --git a/camel/providers/local/camel-local-private.c b/camel/providers/local/camel-local-private.c
index d8b9b2198..8e93b8a39 100644
--- a/camel/providers/local/camel-local-private.c
+++ b/camel/providers/local/camel-local-private.c
@@ -28,12 +28,12 @@
#include "camel-local-private.h"
-int
-camel_local_frompos_sort (void *enc, int len1, void * data1, int len2, void *data2)
+gint
+camel_local_frompos_sort (gpointer enc, gint len1, gpointer data1, gint len2, gpointer data2)
{
- static char *sa1=NULL, *sa2=NULL;
- static int l1=0, l2=0;
- int a1, a2;
+ static gchar *sa1=NULL, *sa2=NULL;
+ static gint l1=0, l2=0;
+ gint a1, a2;
if (l1 < len1+1) {
sa1 = g_realloc (sa1, len1+1);
diff --git a/camel/providers/local/camel-local-private.h b/camel/providers/local/camel-local-private.h
index 731aaa3a5..134969aa2 100644
--- a/camel/providers/local/camel-local-private.h
+++ b/camel/providers/local/camel-local-private.h
@@ -43,7 +43,7 @@ struct _CamelLocalFolderPrivate {
#define CAMEL_LOCAL_FOLDER_LOCK(f, l) (g_mutex_lock(((CamelLocalFolder *)f)->priv->l))
#define CAMEL_LOCAL_FOLDER_UNLOCK(f, l) (g_mutex_unlock(((CamelLocalFolder *)f)->priv->l))
-int camel_local_frompos_sort (void *enc, int len1, void * data1, int len2, void *data2);
+gint camel_local_frompos_sort (gpointer enc, gint len1, gpointer data1, gint len2, gpointer data2);
G_END_DECLS
diff --git a/camel/providers/local/camel-local-provider.c b/camel/providers/local/camel-local-provider.c
index 210bdd609..275cd0a6f 100644
--- a/camel/providers/local/camel-local-provider.c
+++ b/camel/providers/local/camel-local-provider.c
@@ -135,10 +135,10 @@ static CamelProvider spool_directory_provider = {
#endif
/* build a canonical 'path' */
-static char *
-make_can_path(char *p, char *o)
+static gchar *
+make_can_path(gchar *p, gchar *o)
{
- char c, last, *start = o;
+ gchar c, last, *start = o;
d(printf("canonical '%s' = ", p));
@@ -163,7 +163,7 @@ make_can_path(char *p, char *o)
#define get_can_path(p) ((p == NULL) ? NULL : (make_can_path ((p), g_alloca (strlen (p) + 1))))
static guint
-local_url_hash (const void *v)
+local_url_hash (gconstpointer v)
{
const CamelURL *u = v;
guint hash = 0;
@@ -184,7 +184,7 @@ local_url_hash (const void *v)
}
static int
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL || *s1 == 0) {
if (s2 == NULL || *s2 == 0)
@@ -200,10 +200,10 @@ check_equal (char *s1, char *s2)
}
static int
-local_url_equal(const void *v, const void *v2)
+local_url_equal(gconstpointer v, gconstpointer v2)
{
const CamelURL *u1 = v, *u2 = v2;
- char *p1, *p2;
+ gchar *p1, *p2;
p1 = get_can_path(u1->path);
p2 = get_can_path(u2->path);
@@ -214,9 +214,9 @@ local_url_equal(const void *v, const void *v2)
void camel_provider_module_init(void)
{
#ifndef G_OS_WIN32
- char *path;
+ gchar *path;
#endif
- static int init = 0;
+ static gint init = 0;
if (init)
abort();
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index aaf524025..f98cdf4a8 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -52,19 +52,19 @@
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
-static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
-static char *get_name(CamelService *service, gboolean brief);
+static CamelFolder *get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex);
+static gchar *get_name(CamelService *service, gboolean brief);
static CamelFolder *local_get_inbox (CamelStore *store, CamelException *ex);
static CamelFolder *local_get_junk(CamelStore *store, CamelException *ex);
static CamelFolder *local_get_trash(CamelStore *store, CamelException *ex);
-static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-static CamelFolderInfo *create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
+static CamelFolderInfo *get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
+static void delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
+static CamelFolderInfo *create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex);
static gboolean local_can_refresh_folder (CamelStore *store, CamelFolderInfo *info, CamelException *ex);
-static char *local_get_full_path(CamelLocalStore *lf, const char *full_name);
-static char *local_get_meta_path(CamelLocalStore *lf, const char *full_name, const char *ext);
+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 CamelStoreClass *parent_class = NULL;
@@ -130,7 +130,7 @@ static void
construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
{
CamelLocalStore *local_store = CAMEL_LOCAL_STORE (service);
- int len;
+ gint len;
CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
if (camel_exception_is_set (ex))
@@ -143,17 +143,17 @@ construct (CamelService *service, CamelSession *session, CamelProvider *provider
local_store->toplevel_dir = g_strdup (service->url->path);
}
-const char *
+const gchar *
camel_local_store_get_toplevel_dir (CamelLocalStore *store)
{
return store->toplevel_dir;
}
static CamelFolder *
-get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex)
+get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex)
{
- int len = strlen(((CamelLocalStore *)store)->toplevel_dir);
- char *path = g_alloca(len + 1);
+ gint len = strlen(((CamelLocalStore *)store)->toplevel_dir);
+ gchar *path = g_alloca(len + 1);
struct stat st;
strcpy(path, ((CamelLocalStore *)store)->toplevel_dir);
@@ -208,7 +208,7 @@ local_get_trash(CamelStore *store, CamelException *ex)
CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_trash(store, ex);
if (folder) {
- char *state = camel_local_store_get_meta_path(store, CAMEL_VTRASH_NAME, ".cmeta");
+ gchar *state = camel_local_store_get_meta_path(store, CAMEL_VTRASH_NAME, ".cmeta");
camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
g_free(state);
@@ -225,7 +225,7 @@ local_get_junk(CamelStore *store, CamelException *ex)
CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_junk(store, ex);
if (folder) {
- char *state = camel_local_store_get_meta_path(store, CAMEL_VJUNK_NAME, ".cmeta");
+ gchar *state = camel_local_store_get_meta_path(store, CAMEL_VJUNK_NAME, ".cmeta");
camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
g_free(state);
@@ -236,10 +236,10 @@ local_get_junk(CamelStore *store, CamelException *ex)
return folder;
}
-static char *
+static gchar *
get_name (CamelService *service, gboolean brief)
{
- char *dir = ((CamelLocalStore*)service)->toplevel_dir;
+ gchar *dir = ((CamelLocalStore*)service)->toplevel_dir;
if (brief)
return g_strdup (dir);
@@ -248,7 +248,7 @@ get_name (CamelService *service, gboolean brief)
}
static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top,
+get_folder_info (CamelStore *store, const gchar *top,
guint32 flags, CamelException *ex)
{
/* FIXME: This is broken, but it corresponds to what was
@@ -261,10 +261,10 @@ get_folder_info (CamelStore *store, const char *top,
}
static CamelFolderInfo *
-create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
+create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
{
- char *path = ((CamelLocalStore *)store)->toplevel_dir;
- char *name;
+ gchar *path = ((CamelLocalStore *)store)->toplevel_dir;
+ gchar *name;
CamelFolder *folder;
CamelFolderInfo *info = NULL;
struct stat st;
@@ -312,13 +312,13 @@ create_folder(CamelStore *store, const char *parent_name, const char *folder_nam
return info;
}
-static int xrename(const char *oldp, const char *newp, const char *prefix, const char *suffix, int missingok, CamelException *ex)
+static gint xrename(const gchar *oldp, const gchar *newp, const gchar *prefix, const gchar *suffix, gint missingok, CamelException *ex)
{
struct stat st;
- char *old = g_strconcat(prefix, oldp, suffix, NULL);
- char *new = g_strconcat(prefix, newp, suffix, NULL);
- int ret = -1;
- int err = 0;
+ gchar *old = g_strconcat(prefix, oldp, suffix, NULL);
+ gchar *new = g_strconcat(prefix, newp, suffix, NULL);
+ gint ret = -1;
+ gint err = 0;
d(printf("renaming %s%s to %s%s\n", oldp, suffix, newp, suffix));
@@ -350,12 +350,12 @@ static int xrename(const char *oldp, const char *newp, const char *prefix, const
/* default implementation, rename all */
static void
-rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
+rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
- char *path = CAMEL_LOCAL_STORE (store)->toplevel_dir;
+ gchar *path = CAMEL_LOCAL_STORE (store)->toplevel_dir;
CamelLocalFolder *folder = NULL;
- char *newibex = g_strdup_printf("%s%s.ibex", path, new);
- char *oldibex = g_strdup_printf("%s%s.ibex", path, old);
+ gchar *newibex = g_strdup_printf("%s%s.ibex", path, new);
+ gchar *oldibex = g_strdup_printf("%s%s.ibex", path, old);
/* try to rollback failures, has obvious races */
@@ -419,13 +419,13 @@ ibex_failed:
/* default implementation, only delete metadata */
static void
-delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelFolderInfo *fi;
CamelException lex;
CamelFolder *lf;
- char *name;
- char *str;
+ gchar *name;
+ gchar *str;
/* remove metadata only */
name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
@@ -477,14 +477,14 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
camel_folder_info_free (fi);
}
-static char *
-local_get_full_path(CamelLocalStore *ls, const char *full_name)
+static gchar *
+local_get_full_path(CamelLocalStore *ls, const gchar *full_name)
{
return g_strdup_printf("%s%s", ls->toplevel_dir, full_name);
}
-static char *
-local_get_meta_path(CamelLocalStore *ls, const char *full_name, const char *ext)
+static gchar *
+local_get_meta_path(CamelLocalStore *ls, const gchar *full_name, const gchar *ext)
{
return g_strdup_printf("%s%s%s", ls->toplevel_dir, full_name, ext);
}
diff --git a/camel/providers/local/camel-local-store.h b/camel/providers/local/camel-local-store.h
index 6408ebe88..0983c2a8a 100644
--- a/camel/providers/local/camel-local-store.h
+++ b/camel/providers/local/camel-local-store.h
@@ -35,14 +35,14 @@ G_BEGIN_DECLS
typedef struct {
CamelStore parent_object;
- char *toplevel_dir;
+ gchar *toplevel_dir;
} CamelLocalStore;
typedef struct {
CamelStoreClass parent_class;
- char *(*get_full_path)(CamelLocalStore *ls, const char *full_name);
- char *(*get_meta_path)(CamelLocalStore *ls, const char *full_name, const char *ext);
+ gchar *(*get_full_path)(CamelLocalStore *ls, const gchar *full_name);
+ gchar *(*get_meta_path)(CamelLocalStore *ls, const gchar *full_name, const gchar *ext);
} CamelLocalStoreClass;
/* Standard Camel function */
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index 1ef01b32e..b6d81a814 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -51,21 +51,21 @@
#define EXTRACT_FIRST_DIGIT(val) val=strtoul (part, &part, 10);
static CamelFIRecord * summary_header_to_db (CamelFolderSummary *, CamelException *ex);
-static int summary_header_from_db (CamelFolderSummary *, CamelFIRecord *);
+static gint summary_header_from_db (CamelFolderSummary *, CamelFIRecord *);
-static int summary_header_load (CamelFolderSummary *, FILE *);
-static int summary_header_save (CamelFolderSummary *, FILE *);
+static gint summary_header_load (CamelFolderSummary *, FILE *);
+static gint summary_header_save (CamelFolderSummary *, FILE *);
static CamelMessageInfo * message_info_new_from_header (CamelFolderSummary *, struct _camel_header_raw *);
-static int local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelLocalMessageInfo *mi);
-static char *local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *mi);
+static gint local_summary_decode_x_evolution(CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo *mi);
+static gchar *local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *mi);
-static int local_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
-static int local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint local_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex);
+static gint local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
static CamelMessageInfo *local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-static int local_summary_need_index(void);
+static gint local_summary_need_index(void);
static void camel_local_summary_class_init (CamelLocalSummaryClass *klass);
static void camel_local_summary_init (CamelLocalSummary *obj);
@@ -139,7 +139,7 @@ camel_local_summary_finalise(CamelObject *obj)
}
void
-camel_local_summary_construct(CamelLocalSummary *new, const char *filename, const char *local_name, CamelIndex *index)
+camel_local_summary_construct(CamelLocalSummary *new, const gchar *filename, const gchar *local_name, CamelIndex *index)
{
camel_folder_summary_set_build_content(CAMEL_FOLDER_SUMMARY(new), FALSE);
camel_folder_summary_set_filename(CAMEL_FOLDER_SUMMARY(new), filename);
@@ -150,15 +150,15 @@ camel_local_summary_construct(CamelLocalSummary *new, const char *filename, cons
}
static int
-local_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
+local_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex)
{
d(g_print ("\nlocal_summary_load called \n"));
return camel_folder_summary_load_from_db ((CamelFolderSummary *)cls, ex);
}
/* load/check the summary */
-int
-camel_local_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
+gint
+camel_local_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex)
{
d(printf("Loading summary ...\n"));
@@ -177,14 +177,14 @@ void camel_local_summary_check_force(CamelLocalSummary *cls)
cls->check_force = 1;
}
-char *
+gchar *
camel_local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *info)
{
return ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->encode_x_evolution(cls, info);
}
-int
-camel_local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelLocalMessageInfo *info)
+gint
+camel_local_summary_decode_x_evolution(CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo *info)
{
return ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->decode_x_evolution(cls, xev, info);
}
@@ -192,12 +192,12 @@ camel_local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev,
/*#define DOSTATS*/
#ifdef DOSTATS
struct _stat_info {
- int mitotal;
- int micount;
- int citotal;
- int cicount;
- int msgid;
- int msgcount;
+ gint mitotal;
+ gint micount;
+ gint citotal;
+ gint cicount;
+ gint msgid;
+ gint msgcount;
};
static void
@@ -269,16 +269,16 @@ do_stat_mi(CamelLocalSummary *cls, struct _stat_info *info, CamelMessageInfo *mi
#endif
-int
+gint
camel_local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
- int ret;
+ gint ret;
ret = ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->check(cls, changeinfo, ex);
#ifdef DOSTATS
if (ret != -1) {
- int i;
+ gint i;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
struct _stat_info stats = { 0 };
@@ -300,7 +300,7 @@ camel_local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changei
return ret;
}
-int
+gint
camel_local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
return ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->sync(cls, expunge, changeinfo, ex);
@@ -327,11 +327,11 @@ camel_local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const Cam
*
* Return value: -1 on error, otherwise the number of bytes written.
**/
-int
-camel_local_summary_write_headers(int fd, struct _camel_header_raw *header, const char *xevline, const char *status, const char *xstatus)
+gint
+camel_local_summary_write_headers(gint fd, struct _camel_header_raw *header, const gchar *xevline, const gchar *status, const gchar *xstatus)
{
- int outlen = 0, len;
- int newfd;
+ gint outlen = 0, len;
+ gint newfd;
FILE *out;
/* dum de dum, maybe the whole sync function should just use stdio for output */
@@ -410,7 +410,7 @@ local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, C
static int
local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
- int ret = 0;
+ gint ret = 0;
ret = camel_folder_summary_save_to_db ((CamelFolderSummary *)cls, ex);
if (ret == -1) {
@@ -432,7 +432,7 @@ local_summary_need_index(void) {
static void
update_summary (CamelFolderSummary *summary, CamelMessageInfoBase *info, CamelMessageInfoBase *old)
{
- int unread=0, deleted=0, junk=0;
+ gint unread=0, deleted=0, junk=0;
guint32 flags = info->flags;
guint32 oldflags = old->flags;
@@ -468,7 +468,7 @@ local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMess
{
CamelLocalMessageInfo *mi;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
- char *xev;
+ gchar *xev;
d(printf("Adding message to summary\n"));
@@ -517,7 +517,7 @@ local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMess
return (CamelMessageInfo *)mi;
}
-static char *
+static gchar *
local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *mi)
{
GString *out = g_string_new("");
@@ -525,8 +525,8 @@ local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessage
GString *val = g_string_new("");
CamelFlag *flag = mi->info.user_flags;
CamelTag *tag = mi->info.user_tags;
- char *ret;
- const char *p, *uidstr;
+ gchar *ret;
+ const gchar *p, *uidstr;
guint32 uid;
/* FIXME: work out what to do with uid's that aren't stored here? */
@@ -575,13 +575,13 @@ local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessage
}
static int
-local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelLocalMessageInfo *mi)
+local_summary_decode_x_evolution(CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo *mi)
{
struct _camel_header_param *params, *scan;
guint32 uid, flags;
- char *header;
- int i;
- char uidstr[20];
+ gchar *header;
+ gint i;
+ gchar uidstr[20];
uidstr[0] = 0;
@@ -607,14 +607,14 @@ local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelL
scan = params;
while (scan) {
if (!g_ascii_strcasecmp(scan->name, "flags")) {
- char **flagv = g_strsplit(scan->value, ",", 1000);
+ gchar **flagv = g_strsplit(scan->value, ",", 1000);
for (i=0;flagv[i];i++)
camel_message_info_set_user_flag((CamelMessageInfo *)mi, flagv[i], TRUE);
g_strfreev(flagv);
} else if (!g_ascii_strcasecmp(scan->name, "tags")) {
- char **tagv = g_strsplit(scan->value, ",", 10000);
- char *val;
+ gchar **tagv = g_strsplit(scan->value, ",", 10000);
+ gchar *val;
for (i=0;tagv[i];i++) {
val = strchr(tagv[i], '=');
@@ -642,7 +642,7 @@ static int
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *fir)
{
CamelLocalSummary *cls = (CamelLocalSummary *)s;
- char *part, *tmp;
+ gchar *part, *tmp;
/* We dont actually add our own headers, but version that we don't anyway */
@@ -712,8 +712,8 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
mi = (CamelLocalMessageInfo *)((CamelFolderSummaryClass *)camel_local_summary_parent)->message_info_new_from_header(s, h);
if (mi) {
- const char *xev;
- int doindex = FALSE;
+ const gchar *xev;
+ gint doindex = FALSE;
xev = camel_header_raw_find(&h, "X-Evolution", NULL);
if (xev==NULL || camel_local_summary_decode_x_evolution(cls, xev, mi) == -1) {
diff --git a/camel/providers/local/camel-local-summary.h b/camel/providers/local/camel-local-summary.h
index dff4a7dc3..f9cdcd1ca 100644
--- a/camel/providers/local/camel-local-summary.h
+++ b/camel/providers/local/camel-local-summary.h
@@ -53,35 +53,35 @@ struct _CamelLocalSummary {
guint32 version; /* file version being loaded */
- char *folder_path; /* name of matching folder */
+ gchar *folder_path; /* name of matching folder */
CamelIndex *index;
- unsigned int index_force:1; /* do we force index during creation? */
- unsigned int check_force:1; /* does a check force a full check? */
+ guint index_force:1; /* do we force index during creation? */
+ guint check_force:1; /* does a check force a full check? */
};
struct _CamelLocalSummaryClass {
CamelFolderSummaryClass parent_class;
- int (*load)(CamelLocalSummary *cls, int forceindex, CamelException *ex);
- int (*check)(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
- int (*sync)(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+ gint (*load)(CamelLocalSummary *cls, gint forceindex, CamelException *ex);
+ gint (*check)(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+ gint (*sync)(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
CamelMessageInfo *(*add)(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
- char *(*encode_x_evolution)(CamelLocalSummary *cls, const CamelLocalMessageInfo *info);
- int (*decode_x_evolution)(CamelLocalSummary *cls, const char *xev, CamelLocalMessageInfo *info);
- int (*need_index)(void);
+ gchar *(*encode_x_evolution)(CamelLocalSummary *cls, const CamelLocalMessageInfo *info);
+ gint (*decode_x_evolution)(CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo *info);
+ gint (*need_index)(void);
};
CamelType camel_local_summary_get_type (void);
-void camel_local_summary_construct (CamelLocalSummary *new, const char *filename, const char *local_name, CamelIndex *index);
+void camel_local_summary_construct (CamelLocalSummary *new, const gchar *filename, const gchar *local_name, CamelIndex *index);
/* load/check the summary */
-int camel_local_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
+gint camel_local_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex);
/* check for new/removed messages */
-int camel_local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *, CamelException *ex);
+gint camel_local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *, CamelException *ex);
/* perform a folder sync or expunge, if needed */
-int camel_local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *, CamelException *ex);
+gint camel_local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *, CamelException *ex);
/* add a new message to the summary */
CamelMessageInfo *camel_local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
@@ -89,11 +89,11 @@ CamelMessageInfo *camel_local_summary_add(CamelLocalSummary *cls, CamelMimeMessa
void camel_local_summary_check_force(CamelLocalSummary *cls);
/* generate an X-Evolution header line */
-char *camel_local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *info);
-int camel_local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelLocalMessageInfo *info);
+gchar *camel_local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *info);
+gint camel_local_summary_decode_x_evolution(CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo *info);
/* utility functions - write headers to a file with optional X-Evolution header and/or status header */
-int camel_local_summary_write_headers(int fd, struct _camel_header_raw *header, const char *xevline, const char *status, const char *xstatus);
+gint camel_local_summary_write_headers(gint fd, struct _camel_header_raw *header, const gchar *xevline, const gchar *status, const gchar *xstatus);
G_END_DECLS
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index 638a2771d..d3c1e7fd8 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -52,12 +52,12 @@ static CamelLocalFolderClass *parent_class = NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
#define CMAILDIRS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static CamelLocalSummary *maildir_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
+static CamelLocalSummary *maildir_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index);
-static void maildir_append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, char **appended_uid, CamelException * ex);
+static void maildir_append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, gchar **appended_uid, CamelException * ex);
static CamelMimeMessage *maildir_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex);
-static char* maildir_get_filename (CamelFolder *folder, const char *uid, CamelException *ex);
-static gint maildir_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2);
+static gchar * maildir_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
+static gint maildir_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2);
static void maildir_sort_uids (CamelFolder *folder, GPtrArray *uids);
static void maildir_finalize(CamelObject * object);
@@ -66,7 +66,7 @@ static int
maildir_folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
- int i;
+ gint i;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -141,7 +141,7 @@ CamelType camel_maildir_folder_get_type(void)
}
CamelFolder *
-camel_maildir_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
+camel_maildir_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex)
{
CamelFolder *folder;
@@ -159,20 +159,20 @@ camel_maildir_folder_new(CamelStore *parent_store, const char *full_name, guint3
return folder;
}
-static CamelLocalSummary *maildir_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index)
+static CamelLocalSummary *maildir_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index)
{
return (CamelLocalSummary *)camel_maildir_summary_new((CamelFolder *)lf, path, folder, index);
}
static void
-maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex)
+maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex)
{
CamelMaildirFolder *maildir_folder = (CamelMaildirFolder *)folder;
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
CamelStream *output_stream;
CamelMessageInfo *mi;
CamelMaildirMessageInfo *mdi;
- char *name, *dest = NULL;
+ gchar *name, *dest = NULL;
d(printf("Appending message\n"));
@@ -241,8 +241,8 @@ maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const Ca
g_free (dest);
}
-static char*
-maildir_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar *
+maildir_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
CamelMaildirMessageInfo *mdi;
@@ -270,7 +270,7 @@ maildir_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex
CamelStream *message_stream = NULL;
CamelMimeMessage *message = NULL;
CamelMessageInfo *info;
- char *name;
+ gchar *name;
CamelMaildirMessageInfo *mdi;
d(printf("getting message: %s\n", uid));
@@ -316,7 +316,7 @@ maildir_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex
}
static gint
-maildir_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2)
+maildir_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
{
CamelMessageInfo *a, *b;
time_t tma, tmb;
diff --git a/camel/providers/local/camel-maildir-folder.h b/camel/providers/local/camel-maildir-folder.h
index 8e21dc92b..86aa70706 100644
--- a/camel/providers/local/camel-maildir-folder.h
+++ b/camel/providers/local/camel-maildir-folder.h
@@ -45,7 +45,7 @@ typedef struct {
} CamelMaildirFolderClass;
/* public methods */
-CamelFolder *camel_maildir_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex);
+CamelFolder *camel_maildir_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex);
/* Standard Camel function */
CamelType camel_maildir_folder_get_type(void);
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index fd6b8fc13..b6e2bca31 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -50,15 +50,15 @@ static CamelLocalStoreClass *parent_class = NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
#define CMAILDIRF_CLASS(so) CAMEL_MAILDIR_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
+static CamelFolder *get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex);
static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
-static void delete_folder(CamelStore * store, const char *folder_name, CamelException * ex);
-static void maildir_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
+static void delete_folder(CamelStore * store, const gchar *folder_name, CamelException * ex);
+static void maildir_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
-static CamelFolderInfo * get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
+static CamelFolderInfo * get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
-static gboolean maildir_compare_folder_name(const void *a, const void *b);
-static guint maildir_hash_folder_name(const void *a);
+static gboolean maildir_compare_folder_name(gconstpointer a, gconstpointer b);
+static guint maildir_hash_folder_name(gconstpointer a);
static void camel_maildir_store_class_init(CamelObjectClass * camel_maildir_store_class)
{
@@ -97,8 +97,8 @@ CamelType camel_maildir_store_get_type(void)
}
/* This fixes up some historical cruft of names starting with "./" */
-static const char *
-md_canon_name(const char *a)
+static const gchar *
+md_canon_name(const gchar *a)
{
if (a != NULL) {
if (a[0] == '/')
@@ -109,20 +109,20 @@ md_canon_name(const char *a)
return a;
}
-static guint maildir_hash_folder_name(const void *a)
+static guint maildir_hash_folder_name(gconstpointer a)
{
return g_str_hash(md_canon_name(a));
}
-static gboolean maildir_compare_folder_name(const void *a, const void *b)
+static gboolean maildir_compare_folder_name(gconstpointer a, gconstpointer b)
{
return g_str_equal(md_canon_name(a), md_canon_name(b));
}
static CamelFolder *
-get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex)
+get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex)
{
- char *name, *tmp, *cur, *new;
+ gchar *name, *tmp, *cur, *new;
struct stat st;
CamelFolder *folder = NULL;
@@ -209,9 +209,9 @@ get_inbox (CamelStore *store, CamelException *ex)
return camel_store_get_folder(store, ".", CAMEL_STORE_FOLDER_CREATE, ex);
}
-static void delete_folder(CamelStore * store, const char *folder_name, CamelException * ex)
+static void delete_folder(CamelStore * store, const gchar *folder_name, CamelException * ex)
{
- char *name, *tmp, *cur, *new;
+ gchar *name, *tmp, *cur, *new;
struct stat st;
if (strcmp(folder_name, ".") == 0) {
@@ -235,7 +235,7 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce
folder_name, errno ? g_strerror (errno) :
_("not a maildir directory"));
} else {
- int err = 0;
+ gint err = 0;
/* remove subdirs first - will fail if not empty */
if (rmdir(cur) == -1 || rmdir(new) == -1) {
@@ -248,7 +248,7 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce
dir = opendir(tmp);
if (dir) {
while ( (d=readdir(dir)) ) {
- char *name = d->d_name, *file;
+ gchar *name = d->d_name, *file;
if (!strcmp(name, ".") || !strcmp(name, ".."))
continue;
@@ -284,7 +284,7 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce
}
static void
-maildir_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
+maildir_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
if (strcmp(old, ".") == 0) {
camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
@@ -313,9 +313,9 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
fi->total = camel_folder_get_message_count(folder);
camel_object_unref(folder);
} else {
- char *path, *folderpath;
+ gchar *path, *folderpath;
CamelFolderSummary *s;
- const char *root;
+ const gchar *root;
/* This should be fast enough not to have to test for INFO_FAST */
root = camel_local_store_get_toplevel_dir((CamelLocalStore *)store);
@@ -342,29 +342,29 @@ struct _scan_node {
ino_t inode;
};
-static guint scan_hash(const void *d)
+static guint scan_hash(gconstpointer d)
{
const struct _scan_node *v = d;
return v->inode ^ v->dnode;
}
-static gboolean scan_equal(const void *a, const void *b)
+static gboolean scan_equal(gconstpointer a, gconstpointer b)
{
const struct _scan_node *v1 = a, *v2 = b;
return v1->inode == v2->inode && v1->dnode == v2->dnode;
}
-static void scan_free(void *k, void *v, void *d)
+static void scan_free(gpointer k, gpointer v, gpointer d)
{
g_free(k);
}
-static CamelFolderInfo *scan_fi(CamelStore *store, guint32 flags, CamelURL *url, const char *full, const char *name)
+static CamelFolderInfo *scan_fi(CamelStore *store, guint32 flags, CamelURL *url, const gchar *full, const gchar *name)
{
CamelFolderInfo *fi;
- char *tmp, *cur, *new;
+ gchar *tmp, *cur, *new;
struct stat st;
fi = camel_folder_info_new();
@@ -405,11 +405,11 @@ scan_dirs(CamelStore *store, guint32 flags, CamelFolderInfo *topfi, CamelURL *ur
{
CamelDList queue = CAMEL_DLIST_INITIALISER(queue);
struct _scan_node *sn;
- const char *root = ((CamelService *)store)->url->path;
- char *tmp;
+ const gchar *root = ((CamelService *)store)->url->path;
+ gchar *tmp;
GHashTable *visited;
struct stat st;
- int res = -1;
+ gint res = -1;
visited = g_hash_table_new(scan_hash, scan_equal);
@@ -419,7 +419,7 @@ scan_dirs(CamelStore *store, guint32 flags, CamelFolderInfo *topfi, CamelURL *ur
g_hash_table_insert(visited, sn, sn);
while (!camel_dlist_empty(&queue)) {
- char *name;
+ gchar *name;
DIR *dir;
struct dirent *d;
CamelFolderInfo *last;
@@ -461,7 +461,7 @@ scan_dirs(CamelStore *store, guint32 flags, CamelFolderInfo *topfi, CamelURL *ur
/* see if we've visited already */
if (g_hash_table_lookup(visited, &in) == NULL) {
struct _scan_node *snew = g_malloc(sizeof(*snew));
- char *full;
+ gchar *full;
snew->dnode = in.dnode;
snew->inode = in.inode;
@@ -501,7 +501,7 @@ fail:
}
static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelFolderInfo *fi = NULL;
CamelLocalStore *local_store = (CamelLocalStore *)store;
@@ -530,7 +530,7 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti
fi = scan_fi(store, flags, url, ".", _("Inbox"));
fi->flags |= CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_NOCHILDREN|CAMEL_FOLDER_NOINFERIORS|CAMEL_FOLDER_TYPE_INBOX;
} else {
- const char *name = strrchr(top, '/');
+ const gchar *name = strrchr(top, '/');
fi = scan_fi(store, flags, url, top, name?name+1:top);
if (scan_dirs(store, flags, fi, url, ex) == -1)
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index 62ffefedb..dc8494ba4 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -54,14 +54,14 @@ 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);
-static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
-static int maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint maildir_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex);
+static gint maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
static CamelMessageInfo *maildir_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-static char *maildir_summary_next_uid_string(CamelFolderSummary *s);
-static int maildir_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelLocalMessageInfo *mi);
-static char *maildir_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *mi);
+static gchar *maildir_summary_next_uid_string(CamelFolderSummary *s);
+static gint maildir_summary_decode_x_evolution(CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo *mi);
+static gchar *maildir_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *mi);
static void camel_maildir_summary_class_init (CamelMaildirSummaryClass *class);
static void camel_maildir_summary_init (CamelMaildirSummary *gspaper);
@@ -70,8 +70,8 @@ static void camel_maildir_summary_finalise (CamelObject *obj);
#define _PRIVATE(x) (((CamelMaildirSummary *)(x))->priv)
struct _CamelMaildirSummaryPrivate {
- char *current_file;
- char *hostname;
+ gchar *current_file;
+ gchar *hostname;
GHashTable *load_map;
GMutex *summary_lock;
@@ -123,7 +123,7 @@ static void
camel_maildir_summary_init (CamelMaildirSummary *o)
{
struct _CamelFolderSummary *s = (CamelFolderSummary *) o;
- char hostname[256];
+ gchar hostname[256];
o->priv = g_malloc0(sizeof(*o->priv));
/* set unique file version */
@@ -165,7 +165,7 @@ camel_maildir_summary_finalise(CamelObject *obj)
* Return value: A new #CamelMaildirSummary object.
**/
CamelMaildirSummary
-*camel_maildir_summary_new(struct _CamelFolder *folder, const char *filename, const char *maildirdir, CamelIndex *index)
+*camel_maildir_summary_new(struct _CamelFolder *folder, const gchar *filename, const gchar *maildirdir, CamelIndex *index)
{
CamelMaildirSummary *o = (CamelMaildirSummary *)camel_object_new(camel_maildir_summary_get_type ());
@@ -181,7 +181,7 @@ CamelMaildirSummary
/* the 'standard' maildir flags. should be defined in sorted order. */
static struct {
- char flag;
+ gchar flag;
guint32 flagbit;
} flagbits[] = {
{ 'D', CAMEL_MESSAGE_DRAFT },
@@ -193,11 +193,11 @@ static struct {
};
/* convert the uid + flags into a unique:info maildir format */
-char *camel_maildir_summary_info_to_name(const CamelMaildirMessageInfo *info)
+gchar *camel_maildir_summary_info_to_name(const CamelMaildirMessageInfo *info)
{
- const char *uid;
- char *p, *buf;
- int i;
+ const gchar *uid;
+ gchar *p, *buf;
+ gint i;
uid = camel_message_info_uid (info);
buf = g_alloca (strlen (uid) + strlen (":2,") + (sizeof (flagbits) / sizeof (flagbits[0])) + 1);
@@ -213,12 +213,12 @@ char *camel_maildir_summary_info_to_name(const CamelMaildirMessageInfo *info)
}
/* returns 0 if the info matches (or there was none), otherwise we changed it */
-int camel_maildir_summary_name_to_info(CamelMaildirMessageInfo *info, const char *name)
+gint camel_maildir_summary_name_to_info(CamelMaildirMessageInfo *info, const gchar *name)
{
- char *p, c;
+ gchar *p, c;
guint32 set = 0; /* what we set */
/*guint32 all = 0;*/ /* all flags */
- int i;
+ gint i;
p = strstr (name, ":2,");
@@ -248,12 +248,12 @@ int camel_maildir_summary_name_to_info(CamelMaildirMessageInfo *info, const char
}
/* for maildir, x-evolution isn't used, so dont try and get anything out of it */
-static int maildir_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelLocalMessageInfo *mi)
+static gint maildir_summary_decode_x_evolution(CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo *mi)
{
return -1;
}
-static char *maildir_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *mi)
+static gchar *maildir_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessageInfo *mi)
{
return NULL;
}
@@ -282,7 +282,7 @@ static CamelMessageInfo *message_info_new_from_header(CamelFolderSummary * s, st
CamelMessageInfo *mi, *info;
CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
CamelMaildirMessageInfo *mdi;
- const char *uid;
+ const gchar *uid;
mi = ((CamelFolderSummaryClass *) parent_class)->message_info_new_from_header(s, h);
/* assign the uid and new filename */
@@ -306,7 +306,7 @@ static CamelMessageInfo *message_info_new_from_header(CamelFolderSummary * s, st
if (mds->priv->current_file) {
#if 0
- char *p1, *p2, *p3;
+ gchar *p1, *p2, *p3;
unsigned long uid;
#endif
/* if setting from a file, grab the flags from it */
@@ -352,7 +352,7 @@ message_info_free(CamelFolderSummary *s, CamelMessageInfo *mi)
}
-static char *maildir_summary_next_uid_string(CamelFolderSummary *s)
+static gchar *maildir_summary_next_uid_string(CamelFolderSummary *s)
{
CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
@@ -360,7 +360,7 @@ static char *maildir_summary_next_uid_string(CamelFolderSummary *s)
/* if we have a current file, then use that to get the uid */
if (mds->priv->current_file) {
- char *cln;
+ gchar *cln;
cln = strchr(mds->priv->current_file, ':');
if (cln)
@@ -373,9 +373,9 @@ static char *maildir_summary_next_uid_string(CamelFolderSummary *s)
return g_strdup_printf("%ld.%d_%u.%s", time(0), getpid(), camel_folder_summary_next_uid(s), mds->priv->hostname);
#else
CamelLocalSummary *cls = (CamelLocalSummary *)s;
- char *name = NULL, *uid = NULL;
+ gchar *name = NULL, *uid = NULL;
struct stat st;
- int retry = 0;
+ gint retry = 0;
guint32 nextuid = camel_folder_summary_next_uid(s);
/* we use time.pid_count.hostname */
@@ -406,7 +406,7 @@ message_info_load(CamelFolderSummary *s, FILE *in)
mi = ((CamelFolderSummaryClass *) parent_class)->message_info_load(s, in);
if (mi) {
- char *name;
+ gchar *name;
if (mds->priv->load_map
&& (name = g_hash_table_lookup(mds->priv->load_map, camel_message_info_uid(mi)))) {
@@ -419,15 +419,15 @@ message_info_load(CamelFolderSummary *s, FILE *in)
return mi;
}
-static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
+static gint maildir_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex)
{
- char *cur;
+ gchar *cur;
DIR *dir;
struct dirent *d;
CamelMaildirSummary *mds = (CamelMaildirSummary *)cls;
- char *uid;
+ gchar *uid;
EMemPool *pool;
- int ret;
+ gint ret;
cur = g_strdup_printf("%s/cur", cls->folder_path);
@@ -452,7 +452,7 @@ static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelExc
/* map the filename -> uid */
uid = strchr(d->d_name, ':');
if (uid) {
- int len = uid-d->d_name;
+ gint len = uid-d->d_name;
uid = e_mempool_alloc(pool, len+1);
memcpy(uid, d->d_name, len);
uid[len] = 0;
@@ -475,11 +475,11 @@ static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelExc
}
static int
-camel_maildir_summary_add (CamelLocalSummary *cls, const char *name, int forceindex)
+camel_maildir_summary_add (CamelLocalSummary *cls, const gchar *name, gint forceindex)
{
CamelMaildirSummary *maildirs = (CamelMaildirSummary *)cls;
- char *filename = g_strdup_printf("%s/cur/%s", cls->folder_path, name);
- int fd;
+ gchar *filename = g_strdup_printf("%s/cur/%s", cls->folder_path, name);
+ gint fd;
CamelMimeParser *mp;
d(printf("summarising: %s\n", name));
@@ -499,7 +499,7 @@ camel_maildir_summary_add (CamelLocalSummary *cls, const char *name, int forcein
} else {
camel_folder_summary_set_index((CamelFolderSummary *)maildirs, NULL);
}
- maildirs->priv->current_file = (char *)name;
+ maildirs->priv->current_file = (gchar *)name;
camel_folder_summary_add_from_parser((CamelFolderSummary *)maildirs, mp);
camel_object_unref((CamelObject *)mp);
maildirs->priv->current_file = NULL;
@@ -514,7 +514,7 @@ struct _remove_data {
};
static void
-remove_summary(char *key, CamelMessageInfo *info, struct _remove_data *rd)
+remove_summary(gchar *key, CamelMessageInfo *info, struct _remove_data *rd)
{
d(printf("removing message %s from summary\n", key));
if (rd->cls->index)
@@ -530,15 +530,15 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
{
DIR *dir;
struct dirent *d;
- char *p;
+ gchar *p;
CamelMessageInfo *info;
CamelMaildirMessageInfo *mdi;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
GHashTable *left;
- int i, count, total;
- int forceindex;
- char *new, *cur;
- char *uid;
+ gint i, count, total;
+ gint forceindex;
+ gchar *new, *cur;
+ gchar *uid;
struct _remove_data rd = { cls, changes };
g_mutex_lock (((CamelMaildirSummary *) cls)->priv->summary_lock);
@@ -575,7 +575,7 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
for (i=0;i<count;i++) {
info = camel_folder_summary_index((CamelFolderSummary *)cls, i);
if (info) {
- g_hash_table_insert(left, (char *)camel_message_info_uid(info), info);
+ g_hash_table_insert(left, (gchar *)camel_message_info_uid(info), info);
}
}
@@ -587,7 +587,7 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
rewinddir(dir);
while ( (d = readdir(dir)) ) {
- int pc = count * 100 / total;
+ gint pc = count * 100 / total;
camel_operation_progress(NULL, pc);
count++;
@@ -617,7 +617,7 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
if (changes)
camel_folder_change_info_add_uid(changes, uid);
} else {
- const char *filename;
+ const gchar *filename;
if (cls->index && (!camel_index_has_name(cls->index, uid))) {
/* message_info_new will handle duplicates */
@@ -636,7 +636,7 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
info->strings = e_strv_set_ref(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name);
info->strings = e_strv_pack(info->strings);
- g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
+ g_hash_table_insert(s->messages_uid, (gchar *)camel_message_info_uid(info), info);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
#else
# ifdef DOEPOOLV
@@ -669,9 +669,9 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
rewinddir(dir);
while ( (d = readdir(dir)) ) {
- char *name, *newname, *destname, *destfilename;
- char *src, *dest;
- int pc = count * 100 / total;
+ gchar *name, *newname, *destname, *destfilename;
+ gchar *src, *dest;
+ gint pc = count * 100 / total;
camel_operation_progress(NULL, pc);
count++;
@@ -729,13 +729,13 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
static int
maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changes, CamelException *ex)
{
- int count, i;
+ gint count, i;
CamelMessageInfo *info;
CamelMaildirMessageInfo *mdi;
#ifdef DOESTRV
CamelFolderSummary *s = (CamelFolderSummary *)cls;
#endif
- char *name;
+ gchar *name;
struct stat st;
d(printf("summary_sync(expunge=%s)\n", expunge?"true":"false"));
@@ -765,8 +765,8 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange
}
g_free(name);
} else if (mdi && (mdi->info.info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
- char *newname = camel_maildir_summary_info_to_name(mdi);
- char *dest;
+ gchar *newname = camel_maildir_summary_info_to_name(mdi);
+ gchar *dest;
/* do we care about additional metainfo stored inside the message? */
/* probably should all go in the filename? */
@@ -790,7 +790,7 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange
g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
info->strings = e_strv_set_ref_free(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname);
info->strings = e_strv_pack(info->strings);
- g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
+ g_hash_table_insert(s->messages_uid, (gchar *)camel_message_info_uid(info), info);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
#else
# ifdef DOEPOOLV
diff --git a/camel/providers/local/camel-maildir-summary.h b/camel/providers/local/camel-maildir-summary.h
index 3ecbfebe7..223769e44 100644
--- a/camel/providers/local/camel-maildir-summary.h
+++ b/camel/providers/local/camel-maildir-summary.h
@@ -47,7 +47,7 @@ enum {
typedef struct _CamelMaildirMessageInfo {
CamelLocalMessageInfo info;
- char *filename; /* maildir has this annoying status on the end of the filename, use this to get the real message id */
+ gchar *filename; /* maildir has this annoying status on the end of the filename, use this to get the real message id */
} CamelMaildirMessageInfo;
struct _CamelMaildirSummary {
@@ -64,11 +64,11 @@ struct _CamelMaildirSummaryClass {
};
CamelType camel_maildir_summary_get_type (void);
-CamelMaildirSummary *camel_maildir_summary_new (struct _CamelFolder *folder, const char *filename, const char *maildirdir, CamelIndex *index);
+CamelMaildirSummary *camel_maildir_summary_new (struct _CamelFolder *folder, const gchar *filename, const gchar *maildirdir, CamelIndex *index);
/* convert some info->flags to/from the messageinfo */
-char *camel_maildir_summary_info_to_name(const CamelMaildirMessageInfo *info);
-int camel_maildir_summary_name_to_info(CamelMaildirMessageInfo *info, const char *name);
+gchar *camel_maildir_summary_info_to_name(const CamelMaildirMessageInfo *info);
+gint camel_maildir_summary_name_to_info(CamelMaildirMessageInfo *info, const gchar *name);
/* TODO: could proably use get_string stuff */
#define camel_maildir_info_filename(x) (((CamelMaildirMessageInfo *)x)->filename)
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index a06c6d33a..15e95ae5f 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -66,14 +66,14 @@ static CamelLocalFolderClass *parent_class = NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
#define CMBOXS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static int mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
+static gint mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
static void mbox_unlock(CamelLocalFolder *lf);
-static void mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const CamelMessageInfo * info, char **appended_uid, CamelException *ex);
+static void mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const CamelMessageInfo * info, gchar **appended_uid, CamelException *ex);
static CamelMimeMessage *mbox_get_message(CamelFolder *folder, const gchar * uid, CamelException *ex);
-static CamelLocalSummary *mbox_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
-static char* mbox_get_filename (CamelFolder *folder, const char *uid, CamelException *ex);
-static gint mbox_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2);
+static CamelLocalSummary *mbox_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index);
+static gchar * mbox_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
+static gint mbox_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2);
static void mbox_sort_uids (CamelFolder *folder, GPtrArray *uids);
static void mbox_finalise(CamelObject * object);
@@ -135,7 +135,7 @@ CamelType camel_mbox_folder_get_type(void)
}
CamelFolder *
-camel_mbox_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
+camel_mbox_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex)
{
CamelFolder *folder;
@@ -148,12 +148,12 @@ camel_mbox_folder_new(CamelStore *parent_store, const char *full_name, guint32 f
return folder;
}
-static CamelLocalSummary *mbox_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index)
+static CamelLocalSummary *mbox_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index)
{
return (CamelLocalSummary *)camel_mbox_summary_new((CamelFolder *)lf, path, folder, index);
}
-static int mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
+static gint mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
{
#ifndef G_OS_WIN32
CamelMboxFolder *mf = (CamelMboxFolder *)lf;
@@ -191,18 +191,18 @@ static void mbox_unlock(CamelLocalFolder *lf)
}
static void
-mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const CamelMessageInfo * info, char **appended_uid, CamelException *ex)
+mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const CamelMessageInfo * info, gchar **appended_uid, CamelException *ex)
{
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
CamelStream *output_stream = NULL, *filter_stream = NULL;
CamelMimeFilter *filter_from;
CamelMboxSummary *mbs = (CamelMboxSummary *)folder->summary;
CamelMessageInfo *mi;
- char *fromline = NULL;
+ gchar *fromline = NULL;
struct stat st;
- int retval;
+ gint retval;
#if 0
- char *xev;
+ gchar *xev;
#endif
/* If we can't lock, dont do anything */
if (camel_local_folder_lock(lf, CAMEL_LOCK_WRITE, ex) == -1)
@@ -334,13 +334,13 @@ fail:
}
}
-static char*
-mbox_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar *
+mbox_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
CamelMboxMessageInfo *info;
off_t frompos;
- char *filename = NULL;
+ gchar *filename = NULL;
d(printf("Getting message %s\n", uid));
@@ -389,8 +389,8 @@ mbox_get_message(CamelFolder *folder, const gchar * uid, CamelException *ex)
CamelMimeMessage *message = NULL;
CamelMboxMessageInfo *info;
CamelMimeParser *parser = NULL;
- int fd, retval;
- int retried = FALSE;
+ gint fd, retval;
+ gint retried = FALSE;
off_t frompos;
d(printf("Getting message %s\n", uid));
@@ -497,7 +497,7 @@ fail:
}
static gint
-mbox_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2)
+mbox_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
{
CamelMboxMessageInfo *a, *b;
diff --git a/camel/providers/local/camel-mbox-folder.h b/camel/providers/local/camel-mbox-folder.h
index 91aa772ec..e442133d5 100644
--- a/camel/providers/local/camel-mbox-folder.h
+++ b/camel/providers/local/camel-mbox-folder.h
@@ -35,7 +35,7 @@ G_BEGIN_DECLS
typedef struct {
CamelLocalFolder parent_object;
- int lockfd; /* for when we have a lock on the folder */
+ gint lockfd; /* for when we have a lock on the folder */
} CamelMboxFolder;
typedef struct {
@@ -47,7 +47,7 @@ typedef struct {
/* public methods */
/* flags are taken from CAMEL_STORE_FOLDER_* flags */
-CamelFolder *camel_mbox_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex);
+CamelFolder *camel_mbox_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex);
/* Standard Camel function */
CamelType camel_mbox_folder_get_type(void);
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index 5459acdf0..ea219fc88 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -54,13 +54,13 @@ static CamelLocalStoreClass *parent_class = NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS(CAMEL_OBJECT_GET_CLASS(so))
#define CMBOXF_CLASS(so) CAMEL_MBOX_FOLDER_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-static CamelFolder *get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-static CamelFolderInfo *create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
-static CamelFolderInfo *get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-static char *mbox_get_meta_path(CamelLocalStore *ls, const char *full_name, const char *ext);
-static char *mbox_get_full_path(CamelLocalStore *ls, const char *full_name);
+static CamelFolder *get_folder(CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex);
+static void delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
+static CamelFolderInfo *create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex);
+static CamelFolderInfo *get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
+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);
static void
camel_mbox_store_class_init(CamelMboxStoreClass *camel_mbox_store_class)
@@ -100,14 +100,14 @@ camel_mbox_store_get_type(void)
return camel_mbox_store_type;
}
-static char *extensions[] = {
+static gchar *extensions[] = {
".msf", ".ev-summary", ".ev-summary-meta", ".ibex.index", ".ibex.index.data", ".cmeta", ".lock", ".db", ".journal"
};
static gboolean
-ignore_file(const char *filename, gboolean sbd)
+ignore_file(const gchar *filename, gboolean sbd)
{
- int flen, len, i;
+ gint flen, len, i;
/* TODO: Should probably just be 1 regex */
flen = strlen(filename);
@@ -127,10 +127,10 @@ ignore_file(const char *filename, gboolean sbd)
}
static CamelFolder *
-get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+get_folder(CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
struct stat st;
- char *name;
+ gchar *name;
if (!((CamelStoreClass *) parent_class)->get_folder(store, folder_name, flags, ex))
return NULL;
@@ -138,9 +138,9 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
name = camel_local_store_get_full_path(store, folder_name);
if (g_stat(name, &st) == -1) {
- char *basename;
- char *dirname;
- int fd;
+ gchar *basename;
+ gchar *dirname;
+ gint fd;
if (errno != ENOENT) {
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
@@ -212,12 +212,12 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
}
static void
-delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelFolderInfo *fi;
CamelException lex;
CamelFolder *lf;
- char *name, *path;
+ gchar *name, *path;
struct stat st;
name = camel_local_store_get_full_path(store, folder_name);
@@ -344,13 +344,13 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
}
static CamelFolderInfo *
-create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
+create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
{
/* FIXME: this is almost an exact copy of CamelLocalStore::create_folder() except that we use
* different path schemes... need to find a way to share parent's code? */
- const char *toplevel_dir =((CamelLocalStore *) store)->toplevel_dir;
+ const gchar *toplevel_dir =((CamelLocalStore *) store)->toplevel_dir;
CamelFolderInfo *info = NULL;
- char *path, *name, *dir;
+ gchar *path, *name, *dir;
CamelFolder *folder;
struct stat st;
@@ -413,13 +413,13 @@ create_folder(CamelStore *store, const char *parent_name, const char *folder_nam
}
static int
-xrename(CamelStore *store, const char *old_name, const char *new_name, const char *ext, gboolean missingok)
+xrename(CamelStore *store, const gchar *old_name, const gchar *new_name, const gchar *ext, gboolean missingok)
{
CamelLocalStore *ls = (CamelLocalStore *)store;
- char *oldpath, *newpath;
+ gchar *oldpath, *newpath;
struct stat st;
- int ret = -1;
- int err = 0;
+ gint ret = -1;
+ gint err = 0;
if (ext != NULL) {
oldpath = camel_local_store_get_meta_path(ls, old_name, ext);
@@ -474,11 +474,11 @@ xrename(CamelStore *store, const char *old_name, const char *new_name, const cha
}
static void
-rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
+rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
CamelLocalFolder *folder = NULL;
- char *oldibex, *newibex, *newdir;
- int errnosav;
+ gchar *oldibex, *newibex, *newdir;
+ gint errnosav;
if (new[0] == '.' || ignore_file(new, TRUE)) {
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
@@ -593,7 +593,7 @@ struct _inode {
};
static guint
-inode_hash(const void *d)
+inode_hash(gconstpointer d)
{
const struct _inode *v = d;
@@ -601,7 +601,7 @@ inode_hash(const void *d)
}
static gboolean
-inode_equal(const void *a, const void *b)
+inode_equal(gconstpointer a, gconstpointer b)
{
const struct _inode *v1 = a, *v2 = b;
@@ -609,7 +609,7 @@ inode_equal(const void *a, const void *b)
}
static void
-inode_free(void *k, void *v, void *d)
+inode_free(gpointer k, gpointer v, gpointer d)
{
g_free(k);
}
@@ -630,7 +630,7 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
fi->total = camel_folder_get_message_count(folder);
camel_object_unref(folder);
} else {
- char *path, *folderpath;
+ gchar *path, *folderpath;
CamelMboxSummary *mbs;
/* This should be fast enough not to have to test for INFO_FAST */
@@ -651,12 +651,12 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
}
static CamelFolderInfo *
-scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo *parent, const char *root,
- const char *name, guint32 flags, CamelException *ex)
+scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo *parent, const gchar *root,
+ const gchar *name, guint32 flags, CamelException *ex)
{
CamelFolderInfo *folders, *tail, *fi;
GHashTable *folder_hash;
- const char *dent;
+ const gchar *dent;
GDir *dir;
tail = folders = NULL;
@@ -671,7 +671,7 @@ scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo
* directory descriptors open at any given time... */
while ((dent = g_dir_read_name(dir))) {
- char *short_name, *full_name, *path, *ext;
+ gchar *short_name, *full_name, *path, *ext;
struct stat st;
if (dent[0] == '.')
@@ -770,15 +770,15 @@ scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo
}
static CamelFolderInfo *
-get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
GHashTable *visited;
#ifndef G_OS_WIN32
struct _inode *inode;
#endif
- char *path, *subdir;
+ gchar *path, *subdir;
CamelFolderInfo *fi;
- char *basename;
+ gchar *basename;
struct stat st;
CamelURL *url;
@@ -856,12 +856,12 @@ get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExceptio
return fi;
}
-static char *
-mbox_get_full_path(CamelLocalStore *ls, const char *full_name)
+static gchar *
+mbox_get_full_path(CamelLocalStore *ls, const gchar *full_name)
{
- const char *inptr = full_name;
- int subdirs = 0;
- char *path, *p;
+ const gchar *inptr = full_name;
+ gint subdirs = 0;
+ gchar *path, *p;
while (*inptr != '\0') {
if (G_IS_DIR_SEPARATOR (*inptr))
@@ -892,12 +892,12 @@ mbox_get_full_path(CamelLocalStore *ls, const char *full_name)
return path;
}
-static char *
-mbox_get_meta_path(CamelLocalStore *ls, const char *full_name, const char *ext)
+static gchar *
+mbox_get_meta_path(CamelLocalStore *ls, const gchar *full_name, const gchar *ext)
{
/*#define USE_HIDDEN_META_FILES*/
#ifdef USE_HIDDEN_META_FILES
- char *name, *slash;
+ gchar *name, *slash;
name = g_alloca (strlen (full_name) + strlen (ext) + 2);
if ((slash = strrchr (full_name, '/')))
@@ -907,7 +907,7 @@ mbox_get_meta_path(CamelLocalStore *ls, const char *full_name, const char *ext)
return mbox_get_full_path(ls, name);
#else
- char *full_path, *path;
+ gchar *full_path, *path;
full_path = mbox_get_full_path(ls, full_name);
path = g_strdup_printf ("%s%s", full_path, ext);
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 45319a1d9..f9ed01fca 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -57,13 +57,13 @@
#define EXTRACT_FIRST_DIGIT(val) val=strtoul (part, &part, 10);
static CamelFIRecord * summary_header_to_db (CamelFolderSummary *, CamelException *ex);
-static int summary_header_from_db (CamelFolderSummary *, CamelFIRecord *);
+static gint summary_header_from_db (CamelFolderSummary *, CamelFIRecord *);
static CamelMessageInfo * message_info_from_db(CamelFolderSummary *s, CamelMIRecord *record);
static CamelMIRecord * message_info_to_db(CamelFolderSummary *s, CamelMessageInfo *info);
-static int summary_header_load (CamelFolderSummary *, FILE *);
-static int summary_header_save (CamelFolderSummary *, FILE *);
+static gint summary_header_load (CamelFolderSummary *, FILE *);
+static gint summary_header_save (CamelFolderSummary *, FILE *);
static CamelMessageInfo * message_info_new_from_header(CamelFolderSummary *, struct _camel_header_raw *);
static CamelMessageInfo * message_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
@@ -72,16 +72,16 @@ static int message_info_save (CamelFolderSummary *, FILE *, CamelMessageInfo
static int meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMessageInfo *mi);
/*static void message_info_free (CamelFolderSummary *, CamelMessageInfo *);*/
-static char *mbox_summary_encode_x_evolution (CamelLocalSummary *cls, const CamelLocalMessageInfo *mi);
+static gchar *mbox_summary_encode_x_evolution (CamelLocalSummary *cls, const CamelLocalMessageInfo *mi);
-static int mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
#ifdef STATUS_PINE
static CamelMessageInfo *mbox_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *ci, CamelException *ex);
#endif
-static int mbox_summary_sync_quick(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int mbox_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint mbox_summary_sync_quick(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint mbox_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
static void camel_mbox_summary_class_init (CamelMboxSummaryClass *klass);
static void camel_mbox_summary_init (CamelMboxSummary *obj);
@@ -92,8 +92,8 @@ static void camel_mbox_summary_finalise (CamelObject *obj);
#define STATUS_XSTATUS (CAMEL_MESSAGE_FLAGGED|CAMEL_MESSAGE_ANSWERED|CAMEL_MESSAGE_DELETED)
#define STATUS_STATUS (CAMEL_MESSAGE_SEEN)
-static void encode_status(guint32 flags, char status[8]);
-static guint32 decode_status(const char *status);
+static void encode_status(guint32 flags, gchar status[8]);
+static guint32 decode_status(const gchar *status);
#endif
static CamelLocalSummaryClass *camel_mbox_summary_parent;
@@ -116,9 +116,9 @@ camel_mbox_summary_get_type(void)
return type;
}
static gboolean
-mbox_info_set_user_flag(CamelMessageInfo *mi, const char *name, gboolean value)
+mbox_info_set_user_flag(CamelMessageInfo *mi, const gchar *name, gboolean value)
{
- int res;
+ gint res;
res = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->info_set_user_flag(mi, name, value);
if (res)
@@ -128,9 +128,9 @@ mbox_info_set_user_flag(CamelMessageInfo *mi, const char *name, gboolean value)
}
static gboolean
-mbox_info_set_user_tag(CamelMessageInfo *mi, const char *name, const char *value)
+mbox_info_set_user_tag(CamelMessageInfo *mi, const gchar *name, const gchar *value)
{
- int res;
+ gint res;
res = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->info_set_user_tag(mi, name, value);
if (res)
@@ -221,7 +221,7 @@ camel_mbox_summary_finalise(CamelObject *obj)
* Return value: A new CamelMboxSummary widget.
**/
CamelMboxSummary *
-camel_mbox_summary_new(struct _CamelFolder *folder, const char *filename, const char *mbox_name, CamelIndex *index)
+camel_mbox_summary_new(struct _CamelFolder *folder, const gchar *filename, const gchar *mbox_name, CamelIndex *index)
{
CamelMboxSummary *new = (CamelMboxSummary *)camel_object_new(camel_mbox_summary_get_type());
@@ -239,15 +239,15 @@ camel_mbox_summary_new(struct _CamelFolder *folder, const char *filename, const
return new;
}
-void camel_mbox_summary_xstatus(CamelMboxSummary *mbs, int state)
+void camel_mbox_summary_xstatus(CamelMboxSummary *mbs, gint state)
{
mbs->xstatus = state;
}
-static char *
+static gchar *
mbox_summary_encode_x_evolution (CamelLocalSummary *cls, const CamelLocalMessageInfo *mi)
{
- const char *p, *uidstr;
+ const gchar *p, *uidstr;
guint32 uid;
/* This is busted, it is supposed to encode ALL DATA */
@@ -266,7 +266,7 @@ static int
summary_header_from_db (CamelFolderSummary *s, struct _CamelFIRecord *fir)
{
CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(s);
- char *part;
+ gchar *part;
((CamelFolderSummaryClass *)camel_mbox_summary_parent)->summary_header_from_db(s, fir);
@@ -305,7 +305,7 @@ summary_header_to_db (CamelFolderSummary *s, CamelException *ex)
{
CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(s);
struct _CamelFIRecord *fir;
- char *tmp;
+ gchar *tmp;
fir = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->summary_header_to_db (s, ex);
if (fir) {
@@ -338,11 +338,11 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
mi = (CamelMboxMessageInfo *)((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_new_from_header(s, h);
if (mi) {
- const char *xev, *uid;
+ const gchar *xev, *uid;
CamelMboxMessageInfo *info = NULL;
- int add = 0; /* bitmask of things to add, 1 assign uid, 2, just add as new, 4 = recent */
+ gint add = 0; /* bitmask of things to add, 1 assign uid, 2, just add as new, 4 = recent */
#ifdef STATUS_PINE
- const char *status = NULL, *xstatus = NULL;
+ const gchar *status = NULL, *xstatus = NULL;
guint32 flags = 0;
if (mbs->xstatus) {
@@ -430,7 +430,7 @@ static CamelMessageInfo *
message_info_from_db(CamelFolderSummary *s, struct _CamelMIRecord *mir)
{
CamelMessageInfo *mi;
- char *part;
+ gchar *part;
mi = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_from_db(s, mir);
@@ -511,13 +511,13 @@ message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *mi)
static int
summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
- int i, count;
+ gint i, count;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
CamelMimeParser *mp;
CamelMboxMessageInfo *mi;
- int fd;
- int ok = 0;
+ gint fd;
+ gint ok = 0;
struct stat st;
off_t size = 0;
GSList *del = NULL;
@@ -636,8 +636,8 @@ mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Camel
CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
struct stat st;
- int ret = 0;
- int i, count;
+ gint ret = 0;
+ gint i, count;
d(printf("Checking summary\n"));
@@ -702,8 +702,8 @@ static int
mbox_summary_sync_full(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
CamelLocalSummary *cls = (CamelLocalSummary *)mbs;
- int fd = -1, fdout = -1;
- char *tmpname = NULL;
+ gint fd = -1, fdout = -1;
+ gchar *tmpname = NULL;
guint32 flags = (expunge?1:0);
d(printf("performing full summary/sync\n"));
@@ -791,11 +791,11 @@ cms_sort_frompos (gpointer a, gpointer b, gpointer data)
{
CamelFolderSummary *summary = (CamelFolderSummary *)data;
CamelMboxMessageInfo *info1, *info2;
- int ret = 0;
+ gint ret = 0;
/* Things are in memory already. Sorting speeds up syncing, if things are sorted by from pos. */
- info1 = (CamelMboxMessageInfo *)camel_folder_summary_uid (summary, *(char **)a);
- info2 = (CamelMboxMessageInfo *)camel_folder_summary_uid (summary, *(char **)b);
+ info1 = (CamelMboxMessageInfo *)camel_folder_summary_uid (summary, *(gchar **)a);
+ info2 = (CamelMboxMessageInfo *)camel_folder_summary_uid (summary, *(gchar **)b);
if (info1->frompos > info2->frompos)
ret = 1;
@@ -817,12 +817,12 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
CamelLocalSummary *cls = (CamelLocalSummary *)mbs;
CamelFolderSummary *s = (CamelFolderSummary *)mbs;
CamelMimeParser *mp = NULL;
- int i;
+ gint i;
CamelMboxMessageInfo *info = NULL;
- int fd = -1, pfd;
- char *xevnew, *xevtmp;
- const char *xev;
- int len;
+ gint fd = -1, pfd;
+ gchar *xevnew, *xevtmp;
+ const gchar *xev;
+ gint len;
off_t lastpos;
GPtrArray *summary = NULL;
@@ -861,8 +861,8 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
g_ptr_array_sort_with_data (summary, (GCompareDataFunc)cms_sort_frompos, (gpointer) mbs);
for (i = 0; i < summary->len; i++) {
- int xevoffset;
- int pc = (i+1)*100/summary->len;
+ gint xevoffset;
+ gint pc = (i+1)*100/summary->len;
camel_operation_progress(NULL, pc);
@@ -976,9 +976,9 @@ mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInf
struct stat st;
CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
- int i;
- int quick = TRUE, work=FALSE;
- int ret;
+ gint i;
+ gint quick = TRUE, work=FALSE;
+ gint ret;
GPtrArray *summary = NULL;
/* first, sync ourselves up, just to make sure */
@@ -1048,22 +1048,22 @@ mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInf
return ((CamelLocalSummaryClass *)camel_mbox_summary_parent)->sync(cls, expunge, changeinfo, ex);
}
-int
-camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderChangeInfo *changeinfo, int fd, int fdout, CamelException *ex)
+gint
+camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderChangeInfo *changeinfo, gint fd, gint fdout, CamelException *ex)
{
CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
CamelFolderSummary *s = (CamelFolderSummary *)mbs;
CamelMimeParser *mp = NULL;
- int i, count;
+ gint i, count;
CamelMboxMessageInfo *info = NULL;
- char *buffer, *xevnew = NULL;
+ gchar *buffer, *xevnew = NULL;
size_t len;
- const char *fromline;
- int lastdel = FALSE;
+ const gchar *fromline;
+ gint lastdel = FALSE;
gboolean touched = FALSE;
GSList *del=NULL;
#ifdef STATUS_PINE
- char statnew[8], xstatnew[8];
+ gchar statnew[8], xstatnew[8];
#endif
d(printf("performing full summary/sync\n"));
@@ -1084,7 +1084,7 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
count = camel_folder_summary_count(s);
for (i = 0; i < count; i++) {
- int pc = (i + 1) * 100 / count;
+ gint pc = (i + 1) * 100 / count;
camel_operation_progress(NULL, pc);
@@ -1116,9 +1116,9 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
lastdel = FALSE;
if ((flags&1) && info->info.info.flags & CAMEL_MESSAGE_DELETED) {
- const char *uid = camel_message_info_uid(info);
+ const gchar *uid = camel_message_info_uid(info);
guint32 flags = camel_message_info_flags(info);
- int read, junk;
+ gint read, junk;
d(printf("Deleting %s\n", uid));
if (((CamelLocalSummary *)cls)->index)
@@ -1266,7 +1266,7 @@ mbox_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessa
mi = (CamelMboxMessageInfo *)((CamelLocalSummaryClass *)camel_mbox_summary_parent)->add(cls, msg, info, ci, ex);
if (mi && ((CamelMboxSummary *)cls)->xstatus) {
- char status[8];
+ gchar status[8];
/* we snoop and add status/x-status headers to suit */
encode_status(mi->info.info.flags & STATUS_STATUS, status);
@@ -1279,7 +1279,7 @@ mbox_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessa
}
static struct {
- char tag;
+ gchar tag;
guint32 flag;
} status_flags[] = {
{ 'F', CAMEL_MESSAGE_FLAGGED },
@@ -1289,10 +1289,10 @@ static struct {
};
static void
-encode_status(guint32 flags, char status[8])
+encode_status(guint32 flags, gchar status[8])
{
size_t i;
- char *p;
+ gchar *p;
p = status;
for (i = 0; i < G_N_ELEMENTS (status_flags); i++)
@@ -1303,12 +1303,12 @@ encode_status(guint32 flags, char status[8])
}
static guint32
-decode_status(const char *status)
+decode_status(const gchar *status)
{
- const char *p;
+ const gchar *p;
guint32 flags = 0;
size_t i;
- char c;
+ gchar c;
p = status;
while ((c = *p++)) {
diff --git a/camel/providers/local/camel-mbox-summary.h b/camel/providers/local/camel-mbox-summary.h
index 3eb83ee29..1e5644f1f 100644
--- a/camel/providers/local/camel-mbox-summary.h
+++ b/camel/providers/local/camel-mbox-summary.h
@@ -53,26 +53,26 @@ struct _CamelMboxSummary {
guint32 version;
size_t folder_size; /* size of the mbox file, last sync */
- unsigned int xstatus:1; /* do we store/honour xstatus/status headers */
+ guint xstatus:1; /* do we store/honour xstatus/status headers */
};
struct _CamelMboxSummaryClass {
CamelLocalSummaryClass parent_class;
/* sync in-place */
- int (*sync_quick)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+ gint (*sync_quick)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
/* sync requires copy */
- int (*sync_full)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+ gint (*sync_full)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
};
CamelType camel_mbox_summary_get_type (void);
-CamelMboxSummary *camel_mbox_summary_new (struct _CamelFolder *, const char *filename, const char *mbox_name, CamelIndex *index);
+CamelMboxSummary *camel_mbox_summary_new (struct _CamelFolder *, const gchar *filename, const gchar *mbox_name, CamelIndex *index);
/* do we honour/use xstatus headers, etc */
-void camel_mbox_summary_xstatus(CamelMboxSummary *mbs, int state);
+void camel_mbox_summary_xstatus(CamelMboxSummary *mbs, gint state);
/* build a new mbox from an existing mbox storing summary information */
-int camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderChangeInfo *changeinfo, int fd, int fdout, CamelException *ex);
+gint camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderChangeInfo *changeinfo, gint fd, gint fdout, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index a115573ca..d3aa951a3 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -51,11 +51,11 @@ static CamelLocalFolderClass *parent_class = NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
#define CMHS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static CamelLocalSummary *mh_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
+static CamelLocalSummary *mh_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index);
-static void mh_append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, char **appended_uid, CamelException * ex);
+static void 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 char* mh_get_filename (CamelFolder *folder, const char *uid, CamelException *ex);
+static gchar * mh_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex);
static void mh_finalize(CamelObject * object);
@@ -105,7 +105,7 @@ CamelType camel_mh_folder_get_type(void)
}
CamelFolder *
-camel_mh_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
+camel_mh_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex)
{
CamelFolder *folder;
@@ -118,19 +118,19 @@ camel_mh_folder_new(CamelStore *parent_store, const char *full_name, guint32 fla
return folder;
}
-static CamelLocalSummary *mh_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index)
+static CamelLocalSummary *mh_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index)
{
return (CamelLocalSummary *)camel_mh_summary_new((CamelFolder *)lf, path, folder, index);
}
static void
-mh_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex)
+mh_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex)
{
CamelMhFolder *mh_folder = (CamelMhFolder *)folder;
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
CamelStream *output_stream;
CamelMessageInfo *mi;
- char *name;
+ gchar *name;
/* FIXME: probably needs additional locking (although mh doesn't appear do do it) */
@@ -192,7 +192,7 @@ mh_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMe
g_free (name);
}
-static char* mh_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar * mh_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
@@ -206,7 +206,7 @@ static CamelMimeMessage *mh_get_message(CamelFolder * folder, const gchar * uid,
CamelStream *message_stream = NULL;
CamelMimeMessage *message = NULL;
CamelMessageInfo *info;
- char *name;
+ gchar *name;
d(printf("getting message: %s\n", uid));
diff --git a/camel/providers/local/camel-mh-folder.h b/camel/providers/local/camel-mh-folder.h
index abc65568d..08f8f2c36 100644
--- a/camel/providers/local/camel-mh-folder.h
+++ b/camel/providers/local/camel-mh-folder.h
@@ -45,7 +45,7 @@ typedef struct {
} CamelMhFolderClass;
/* public methods */
-CamelFolder *camel_mh_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex);
+CamelFolder *camel_mh_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex);
/* Standard Camel function */
CamelType camel_mh_folder_get_type(void);
diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c
index 426ae5530..7d2a6b190 100644
--- a/camel/providers/local/camel-mh-store.c
+++ b/camel/providers/local/camel-mh-store.c
@@ -51,11 +51,11 @@ static CamelLocalStoreClass *parent_class = NULL;
#define CMHF_CLASS(so) CAMEL_MH_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
-static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
+static CamelFolder *get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex);
static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
-static void delete_folder(CamelStore * store, const char *folder_name, CamelException * ex);
-static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-static CamelFolderInfo * get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
+static void delete_folder(CamelStore * store, const gchar *folder_name, CamelException * ex);
+static void 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);
static void camel_mh_store_class_init(CamelObjectClass * camel_mh_store_class)
{
@@ -113,11 +113,11 @@ enum {
/* update the .folders file if it exists, or create it if it doesn't */
static void
-folders_update(const char *root, int mode, const char *folder, const char *new)
+folders_update(const gchar *root, gint mode, const gchar *folder, const gchar *new)
{
- char *tmp, *tmpnew, *line = NULL;
+ gchar *tmp, *tmpnew, *line = NULL;
CamelStream *stream, *in = NULL, *out = NULL;
- int flen = strlen(folder);
+ gint flen = strlen(folder);
tmpnew = g_alloca (strlen (root) + 16);
sprintf (tmpnew, "%s.folders~", root);
@@ -140,7 +140,7 @@ folders_update(const char *root, int mode, const char *folder, const char *new)
}
while ((line = camel_stream_buffer_read_line((CamelStreamBuffer *)in))) {
- int copy = TRUE;
+ gint copy = TRUE;
switch (mode) {
case UPDATE_REMOVE:
@@ -158,7 +158,7 @@ folders_update(const char *root, int mode, const char *folder, const char *new)
}
break;
case UPDATE_ADD: {
- int cmp = strcmp(line, folder);
+ gint cmp = strcmp(line, folder);
if (cmp > 0) {
/* found insertion point */
@@ -201,9 +201,9 @@ fail:
}
static CamelFolder *
-get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex)
+get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex)
{
- char *name;
+ gchar *name;
struct stat st;
if (!((CamelStoreClass *)parent_class)->get_folder(store, folder_name, flags, ex))
@@ -262,9 +262,9 @@ get_inbox (CamelStore *store, CamelException *ex)
return get_folder (store, "inbox", 0, ex);
}
-static void delete_folder(CamelStore * store, const char *folder_name, CamelException * ex)
+static void delete_folder(CamelStore * store, const gchar *folder_name, CamelException * ex)
{
- char *name;
+ gchar *name;
/* remove folder directory - will fail if not empty */
name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
@@ -286,7 +286,7 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce
}
static void
-rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
+rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
CamelException e;
@@ -322,9 +322,9 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
fi->total = camel_folder_get_message_count(folder);
camel_object_unref(folder);
} else {
- char *path, *folderpath;
+ gchar *path, *folderpath;
CamelFolderSummary *s;
- const char *root;
+ const gchar *root;
/* This should be fast enough not to have to test for INFO_FAST */
@@ -347,11 +347,11 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
}
static CamelFolderInfo *
-folder_info_new (CamelStore *store, CamelURL *url, const char *root, const char *path, guint32 flags)
+folder_info_new (CamelStore *store, CamelURL *url, const gchar *root, const gchar *path, guint32 flags)
{
/* FIXME: need to set fi->flags = CAMEL_FOLDER_NOSELECT (and possibly others) when appropriate */
CamelFolderInfo *fi;
- char *base;
+ gchar *base;
base = strrchr(path, '/');
@@ -379,9 +379,9 @@ struct _inode {
* root and path should have a trailing "/" if they aren't empty. */
static void
recursive_scan (CamelStore *store, CamelURL *url, CamelFolderInfo **fip, CamelFolderInfo *parent,
- GHashTable *visited, const char *root, const char *path, guint32 flags)
+ GHashTable *visited, const gchar *root, const gchar *path, guint32 flags)
{
- char *fullpath, *tmp;
+ gchar *fullpath, *tmp;
DIR *dp;
struct dirent *d;
struct stat st;
@@ -393,7 +393,7 @@ recursive_scan (CamelStore *store, CamelURL *url, CamelFolderInfo **fip, CamelFo
fullpath = alloca (strlen (root) + strlen (path) + 2);
sprintf (fullpath, "%s/%s", root, path);
} else
- fullpath = (char *)root;
+ fullpath = (gchar *)root;
if (stat(fullpath, &st) == -1 || !S_ISDIR(st.st_mode))
return;
@@ -449,15 +449,15 @@ recursive_scan (CamelStore *store, CamelURL *url, CamelFolderInfo **fip, CamelFo
/* scan a .folders file */
static void
-folders_scan(CamelStore *store, CamelURL *url, const char *root, const char *top, CamelFolderInfo **fip, guint32 flags)
+folders_scan(CamelStore *store, CamelURL *url, const gchar *root, const gchar *top, CamelFolderInfo **fip, guint32 flags)
{
CamelFolderInfo *fi;
- char line[512], *path, *tmp;
+ gchar line[512], *path, *tmp;
CamelStream *stream, *in;
struct stat st;
GPtrArray *folders;
GHashTable *visited;
- int len;
+ gint len;
tmp = g_alloca (strlen (root) + 16);
sprintf (tmp, "%s/.folders", root);
@@ -479,7 +479,7 @@ folders_scan(CamelStore *store, CamelURL *url, const char *root, const char *top
continue;
/* check for invalidly long lines, we abort evreything and fallback */
if (line[len-1] != '\n') {
- int i;
+ gint i;
for (i=0;i<folders->len;i++)
camel_folder_info_free(folders->pdata[i]);
@@ -491,7 +491,7 @@ folders_scan(CamelStore *store, CamelURL *url, const char *root, const char *top
/* check for \r ? */
if (top && top[0]) {
- int toplen = strlen(top);
+ gint toplen = strlen(top);
/* check is dir or subdir */
if (strncmp(top, line, toplen) != 0
@@ -530,31 +530,31 @@ folders_scan(CamelStore *store, CamelURL *url, const char *root, const char *top
}
/* FIXME: move to camel-local, this is shared with maildir code */
-static guint inode_hash(const void *d)
+static guint inode_hash(gconstpointer d)
{
const struct _inode *v = d;
return v->inode ^ v->dnode;
}
-static gboolean inode_equal(const void *a, const void *b)
+static gboolean inode_equal(gconstpointer a, gconstpointer b)
{
const struct _inode *v1 = a, *v2 = b;
return v1->inode == v2->inode && v1->dnode == v2->dnode;
}
-static void inode_free(void *k, void *v, void *d)
+static void inode_free(gpointer k, gpointer v, gpointer d)
{
g_free(k);
}
static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelFolderInfo *fi = NULL;
CamelURL *url;
- char *root;
+ gchar *root;
root = ((CamelService *)store)->url->path;
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index 346edf0fd..55bed7e19 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -46,11 +46,11 @@
#define CAMEL_MH_SUMMARY_VERSION (0x2000)
-static int mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-/*static int mh_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);*/
+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);*/
-static char *mh_summary_next_uid_string(CamelFolderSummary *s);
+static gchar *mh_summary_next_uid_string(CamelFolderSummary *s);
static void camel_mh_summary_class_init (CamelMhSummaryClass *class);
static void camel_mh_summary_init (CamelMhSummary *gspaper);
@@ -59,7 +59,7 @@ static void camel_mh_summary_finalise (CamelObject *obj);
#define _PRIVATE(x) (((CamelMhSummary *)(x))->priv)
struct _CamelMhSummaryPrivate {
- char *current_uid;
+ gchar *current_uid;
};
static CamelLocalSummaryClass *parent_class;
@@ -123,7 +123,7 @@ camel_mh_summary_finalise(CamelObject *obj)
*
* Return value: A new #CamelMhSummary object.
**/
-CamelMhSummary *camel_mh_summary_new(struct _CamelFolder *folder, const char *filename, const char *mhdir, CamelIndex *index)
+CamelMhSummary *camel_mh_summary_new(struct _CamelFolder *folder, const gchar *filename, const gchar *mhdir, CamelIndex *index)
{
CamelMhSummary *o = (CamelMhSummary *)camel_object_new(camel_mh_summary_get_type ());
@@ -138,14 +138,14 @@ CamelMhSummary *camel_mh_summary_new(struct _CamelFolder *folder, const char *fi
return o;
}
-static char *mh_summary_next_uid_string(CamelFolderSummary *s)
+static gchar *mh_summary_next_uid_string(CamelFolderSummary *s)
{
CamelMhSummary *mhs = (CamelMhSummary *)s;
CamelLocalSummary *cls = (CamelLocalSummary *)s;
- int fd = -1;
+ gint fd = -1;
guint32 uid;
- char *name;
- char *uidstr;
+ gchar *name;
+ gchar *uidstr;
/* if we are working to add an existing file, then use current_uid */
if (mhs->priv->current_uid) {
@@ -173,11 +173,11 @@ static char *mh_summary_next_uid_string(CamelFolderSummary *s)
return uidstr;
}
-static int camel_mh_summary_add(CamelLocalSummary *cls, const char *name, int forceindex)
+static gint camel_mh_summary_add(CamelLocalSummary *cls, const gchar *name, gint forceindex)
{
CamelMhSummary *mhs = (CamelMhSummary *)cls;
- char *filename = g_strdup_printf("%s/%s", cls->folder_path, name);
- int fd;
+ gchar *filename = g_strdup_printf("%s/%s", cls->folder_path, name);
+ gint fd;
CamelMimeParser *mp;
d(printf("summarising: %s\n", name));
@@ -197,7 +197,7 @@ static int camel_mh_summary_add(CamelLocalSummary *cls, const char *name, int fo
} else {
camel_folder_summary_set_index((CamelFolderSummary *)mhs, NULL);
}
- mhs->priv->current_uid = (char *)name;
+ mhs->priv->current_uid = (gchar *)name;
camel_folder_summary_add_from_parser((CamelFolderSummary *)mhs, mp);
camel_object_unref((CamelObject *)mp);
mhs->priv->current_uid = NULL;
@@ -207,7 +207,7 @@ static int camel_mh_summary_add(CamelLocalSummary *cls, const char *name, int fo
}
static void
-remove_summary(char *key, CamelMessageInfo *info, CamelLocalSummary *cls)
+remove_summary(gchar *key, CamelMessageInfo *info, CamelLocalSummary *cls)
{
d(printf("removing message %s from summary\n", key));
if (cls->index)
@@ -222,12 +222,12 @@ mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, Came
{
DIR *dir;
struct dirent *d;
- char *p, c;
+ gchar *p, c;
CamelMessageInfo *info;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
GHashTable *left;
- int i, count;
- int forceindex;
+ gint i, count;
+ gint forceindex;
/* FIXME: Handle changeinfo */
@@ -250,7 +250,7 @@ mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, Came
for (i=0;i<count;i++) {
info = camel_folder_summary_index((CamelFolderSummary *)cls, i);
if (info) {
- g_hash_table_insert(left, (char *)camel_message_info_uid(info), info);
+ g_hash_table_insert(left, (gchar *)camel_message_info_uid(info), info);
}
}
@@ -272,7 +272,7 @@ mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, Came
}
camel_mh_summary_add(cls, d->d_name, forceindex);
} else {
- const char *uid = camel_message_info_uid(info);
+ const gchar *uid = camel_message_info_uid(info);
CamelMessageInfo *old = g_hash_table_lookup(left, uid);
if (old) {
@@ -298,10 +298,10 @@ mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, Came
static int
mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changes, CamelException *ex)
{
- int count, i;
+ gint count, i;
CamelLocalMessageInfo *info;
- char *name;
- const char *uid;
+ gchar *name;
+ const gchar *uid;
d(printf("summary_sync(expunge=%s)\n", expunge?"true":"false"));
@@ -324,7 +324,7 @@ mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo
/* FIXME: put this in folder_summary::remove()? */
if (cls->index)
- camel_index_delete_name(cls->index, (char *)uid);
+ camel_index_delete_name(cls->index, (gchar *)uid);
camel_folder_change_info_remove_uid(changes, uid);
camel_folder_summary_remove((CamelFolderSummary *)cls, (CamelMessageInfo *)info);
diff --git a/camel/providers/local/camel-mh-summary.h b/camel/providers/local/camel-mh-summary.h
index 28de15a53..81d43a868 100644
--- a/camel/providers/local/camel-mh-summary.h
+++ b/camel/providers/local/camel-mh-summary.h
@@ -49,7 +49,7 @@ struct _CamelMhSummaryClass {
};
CamelType camel_mh_summary_get_type (void);
-CamelMhSummary *camel_mh_summary_new(struct _CamelFolder *, const char *filename, const char *mhdir, CamelIndex *index);
+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 2ba964b11..18b986788 100644
--- a/camel/providers/local/camel-spool-folder.c
+++ b/camel/providers/local/camel-spool-folder.c
@@ -58,9 +58,9 @@ static CamelFolderClass *parent_class = NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
#define CSPOOLS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static CamelLocalSummary *spool_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
+static CamelLocalSummary *spool_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index);
-static int spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
+static gint spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
static void spool_unlock(CamelLocalFolder *lf);
static void spool_finalize(CamelObject * object);
@@ -109,7 +109,7 @@ CamelType camel_spool_folder_get_type(void)
}
CamelFolder *
-camel_spool_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
+camel_spool_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex)
{
CamelFolder *folder;
@@ -132,7 +132,7 @@ camel_spool_folder_new(CamelStore *parent_store, const char *full_name, guint32
}
static CamelLocalSummary *
-spool_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index)
+spool_create_summary(CamelLocalFolder *lf, const gchar *path, const gchar *folder, CamelIndex *index)
{
return (CamelLocalSummary *)camel_spool_summary_new((CamelFolder *)lf, folder);
}
@@ -140,7 +140,7 @@ spool_create_summary(CamelLocalFolder *lf, const char *path, const char *folder,
static int
spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
{
- int retry = 0;
+ gint retry = 0;
CamelMboxFolder *mf = (CamelMboxFolder *)lf;
CamelSpoolFolder *sf = (CamelSpoolFolder *)lf;
diff --git a/camel/providers/local/camel-spool-folder.h b/camel/providers/local/camel-spool-folder.h
index 5317e273e..ce057b892 100644
--- a/camel/providers/local/camel-spool-folder.h
+++ b/camel/providers/local/camel-spool-folder.h
@@ -42,7 +42,7 @@ typedef struct {
struct _CamelSpoolFolderPrivate *priv;
- int lockid; /* lock id for dot locking */
+ gint lockid; /* lock id for dot locking */
} CamelSpoolFolder;
typedef struct {
@@ -52,7 +52,7 @@ typedef struct {
/* Standard Camel function */
CamelType camel_spool_folder_get_type(void);
-CamelFolder *camel_spool_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex);
+CamelFolder *camel_spool_folder_new(CamelStore *parent_store, const gchar *full_name, guint32 flags, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c
index c60581653..3d3cb050c 100644
--- a/camel/providers/local/camel-spool-store.c
+++ b/camel/providers/local/camel-spool-store.c
@@ -56,18 +56,18 @@
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
-static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
-static char *get_name(CamelService *service, gboolean brief);
+static CamelFolder *get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex);
+static gchar *get_name(CamelService *service, gboolean brief);
static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
-static void rename_folder(CamelStore *store, const char *old_name, const char *new_name, CamelException *ex);
-static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
+static void rename_folder(CamelStore *store, const gchar *old_name, const gchar *new_name, CamelException *ex);
+static CamelFolderInfo *get_folder_info (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex);
static void free_folder_info (CamelStore *store, CamelFolderInfo *fi);
-static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
+static void delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex);
+static void rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
-static char *spool_get_meta_path(CamelLocalStore *ls, const char *full_name, const char *ext);
-static char *spool_get_full_path(CamelLocalStore *ls, const char *full_name);
+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 CamelStoreClass *parent_class = NULL;
@@ -151,11 +151,11 @@ construct (CamelService *service, CamelSession *session, CamelProvider *provider
}
static CamelFolder *
-get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex)
+get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelException * ex)
{
CamelFolder *folder = NULL;
struct stat st;
- char *name;
+ gchar *name;
d(printf("opening folder %s on path %s\n", folder_name, path));
@@ -212,7 +212,7 @@ get_inbox(CamelStore *store, CamelException *ex)
}
}
-static char *
+static gchar *
get_name (CamelService *service, gboolean brief)
{
if (brief)
@@ -224,7 +224,7 @@ get_name (CamelService *service, gboolean brief)
/* default implementation, rename all */
static void
-rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
+rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Spool folders cannot be renamed"));
@@ -232,7 +232,7 @@ rename_folder(CamelStore *store, const char *old, const char *new, CamelExceptio
/* default implementation, only delete metadata */
static void
-delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Spool folders cannot be deleted"));
@@ -267,10 +267,10 @@ spool_fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
}
static CamelFolderInfo *
-spool_new_fi(CamelStore *store, CamelFolderInfo *parent, CamelFolderInfo **fip, const char *full, guint32 flags)
+spool_new_fi(CamelStore *store, CamelFolderInfo *parent, CamelFolderInfo **fip, const gchar *full, guint32 flags)
{
CamelFolderInfo *fi;
- const char *name;
+ const gchar *name;
CamelURL *url;
name = strrchr(full, '/');
@@ -306,15 +306,15 @@ struct _inode {
};
/* returns number of records found at or below this level */
-static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const char *path, guint32 flags, CamelFolderInfo *parent, CamelFolderInfo **fip, CamelException *ex)
+static gint scan_dir(CamelStore *store, GHashTable *visited, gchar *root, const gchar *path, guint32 flags, CamelFolderInfo *parent, CamelFolderInfo **fip, CamelException *ex)
{
DIR *dir;
struct dirent *d;
- char *name, *tmp, *fname;
+ gchar *name, *tmp, *fname;
CamelFolderInfo *fi = NULL;
struct stat st;
CamelFolder *folder;
- char from[80];
+ gchar from[80];
FILE *fp;
d(printf("checking dir '%s' part '%s' for mbox content\n", root, path));
@@ -366,7 +366,7 @@ static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const ch
fname = g_strdup(d->d_name);
if (S_ISREG(st.st_mode)) {
- int isfolder = FALSE;
+ gint isfolder = FALSE;
/* first, see if we already have it open */
folder = camel_object_bag_get(store->folders, fname);
@@ -415,27 +415,27 @@ static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const ch
return 0;
}
-static guint inode_hash(const void *d)
+static guint inode_hash(gconstpointer d)
{
const struct _inode *v = d;
return v->inode ^ v->dnode;
}
-static gboolean inode_equal(const void *a, const void *b)
+static gboolean inode_equal(gconstpointer a, gconstpointer b)
{
const struct _inode *v1 = a, *v2 = b;
return v1->inode == v2->inode && v1->dnode == v2->dnode;
}
-static void inode_free(void *k, void *v, void *d)
+static void inode_free(gpointer k, gpointer v, gpointer d)
{
g_free(k);
}
static CamelFolderInfo *
-get_folder_info_elm(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+get_folder_info_elm(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelFolderInfo *fi = NULL;
GHashTable *visited;
@@ -454,7 +454,7 @@ get_folder_info_elm(CamelStore *store, const char *top, guint32 flags, CamelExce
}
static CamelFolderInfo *
-get_folder_info_mbox(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+get_folder_info_mbox(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelFolderInfo *fi = NULL, *fip = NULL;
@@ -469,7 +469,7 @@ get_folder_info_mbox(CamelStore *store, const char *top, guint32 flags, CamelExc
}
static CamelFolderInfo *
-get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
if (((CamelSpoolStore *)store)->type == CAMEL_SPOOL_STORE_MBOX)
return get_folder_info_mbox(store, top, flags, ex);
@@ -477,8 +477,8 @@ get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExceptio
return get_folder_info_elm(store, top, flags, ex);
}
-static char *
-spool_get_full_path(CamelLocalStore *ls, const char *full_name)
+static gchar *
+spool_get_full_path(CamelLocalStore *ls, const gchar *full_name)
{
if (((CamelSpoolStore *)ls)->type == CAMEL_SPOOL_STORE_MBOX)
/* a trailing / is always present on toplevel_dir from CamelLocalStore */
@@ -487,11 +487,11 @@ spool_get_full_path(CamelLocalStore *ls, const char *full_name)
return g_strdup_printf("%s/%s", ls->toplevel_dir, full_name);
}
-static char *
-spool_get_meta_path(CamelLocalStore *ls, const char *full_name, const char *ext)
+static gchar *
+spool_get_meta_path(CamelLocalStore *ls, const gchar *full_name, const gchar *ext)
{
- char *root = camel_session_get_storage_path(((CamelService *)ls)->session, (CamelService *)ls, NULL);
- char *path, *key;
+ gchar *root = camel_session_get_storage_path(((CamelService *)ls)->session, (CamelService *)ls, NULL);
+ gchar *path, *key;
if (root == NULL)
return NULL;
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
index f8c44daae..7e41ca79a 100644
--- a/camel/providers/local/camel-spool-summary.c
+++ b/camel/providers/local/camel-spool-summary.c
@@ -48,11 +48,11 @@
#define CAMEL_SPOOL_SUMMARY_VERSION (0x400)
-static int spool_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
-static int spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint spool_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex);
+static gint spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int spool_summary_need_index(void);
+static gint spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
+static gint spool_summary_need_index(void);
static void camel_spool_summary_class_init (CamelSpoolSummaryClass *klass);
static void camel_spool_summary_init (CamelSpoolSummary *obj);
@@ -111,7 +111,7 @@ camel_spool_summary_finalise(CamelObject *obj)
}
CamelSpoolSummary *
-camel_spool_summary_new(struct _CamelFolder *folder, const char *mbox_name)
+camel_spool_summary_new(struct _CamelFolder *folder, const gchar *mbox_name)
{
CamelSpoolSummary *new = (CamelSpoolSummary *)camel_object_new(camel_spool_summary_get_type());
@@ -127,7 +127,7 @@ camel_spool_summary_new(struct _CamelFolder *folder, const char *mbox_name)
}
static int
-spool_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
+spool_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex)
{
g_warning("spool summary - not loading anything\n");
return 0;
@@ -137,11 +137,11 @@ spool_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
static int
spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
- int fd = -1, fdout = -1;
- char tmpname[64] = { '\0' };
- char *buffer, *p;
+ gint fd = -1, fdout = -1;
+ gchar tmpname[64] = { '\0' };
+ gchar *buffer, *p;
off_t spoollen, outlen;
- int size, sizeout;
+ gint size, sizeout;
struct stat st;
guint32 flags = (expunge?1:0);
@@ -308,7 +308,7 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
static int
spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
- int i, work, count;
+ gint i, work, count;
struct stat st;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
diff --git a/camel/providers/local/camel-spool-summary.h b/camel/providers/local/camel-spool-summary.h
index 081948ee8..f2137f1cf 100644
--- a/camel/providers/local/camel-spool-summary.h
+++ b/camel/providers/local/camel-spool-summary.h
@@ -46,26 +46,26 @@ struct _CamelSpoolSummaryClass {
};
CamelType camel_spool_summary_get_type (void);
-void camel_spool_summary_construct (CamelSpoolSummary *new, const char *filename, const char *spool_name, CamelIndex *index);
+void camel_spool_summary_construct (CamelSpoolSummary *new, const gchar *filename, const gchar *spool_name, CamelIndex *index);
/* create the summary, in-memory only */
-CamelSpoolSummary *camel_spool_summary_new(struct _CamelFolder *, const char *filename);
+CamelSpoolSummary *camel_spool_summary_new(struct _CamelFolder *, const gchar *filename);
/* load/check the summary */
-int camel_spool_summary_load(CamelSpoolSummary *cls, int forceindex, CamelException *ex);
+gint camel_spool_summary_load(CamelSpoolSummary *cls, gint forceindex, CamelException *ex);
/* check for new/removed messages */
-int camel_spool_summary_check(CamelSpoolSummary *cls, CamelFolderChangeInfo *, CamelException *ex);
+gint camel_spool_summary_check(CamelSpoolSummary *cls, CamelFolderChangeInfo *, CamelException *ex);
/* perform a folder sync or expunge, if needed */
-int camel_spool_summary_sync(CamelSpoolSummary *cls, gboolean expunge, CamelFolderChangeInfo *, CamelException *ex);
+gint camel_spool_summary_sync(CamelSpoolSummary *cls, gboolean expunge, CamelFolderChangeInfo *, CamelException *ex);
/* add a new message to the summary */
CamelMessageInfo *camel_spool_summary_add(CamelSpoolSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
/* generate an X-Evolution header line */
-char *camel_spool_summary_encode_x_evolution(CamelSpoolSummary *cls, const CamelMessageInfo *info);
-int camel_spool_summary_decode_x_evolution(CamelSpoolSummary *cls, const char *xev, CamelMessageInfo *info);
+gchar *camel_spool_summary_encode_x_evolution(CamelSpoolSummary *cls, const CamelMessageInfo *info);
+gint camel_spool_summary_decode_x_evolution(CamelSpoolSummary *cls, const gchar *xev, CamelMessageInfo *info);
/* utility functions - write headers to a file with optional X-Evolution header */
-int camel_spool_summary_write_headers(int fd, struct _camel_header_raw *header, char *xevline);
+gint camel_spool_summary_write_headers(gint fd, struct _camel_header_raw *header, gchar *xevline);
G_END_DECLS
diff --git a/camel/providers/nntp/camel-nntp-auth.c b/camel/providers/nntp/camel-nntp-auth.c
index ea94595bd..f015f0987 100644
--- a/camel/providers/nntp/camel-nntp-auth.c
+++ b/camel/providers/nntp/camel-nntp-auth.c
@@ -33,12 +33,12 @@
#include "camel-nntp-store.h"
#include "camel-nntp-resp-codes.h"
-int
+gint
camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex)
{
CamelService *service = CAMEL_SERVICE (store);
CamelSession *session = camel_service_get_session (service);
- int resp;
+ gint resp;
if (!service->url->authmech && !service->url->passwd) {
gchar *prompt;
diff --git a/camel/providers/nntp/camel-nntp-auth.h b/camel/providers/nntp/camel-nntp-auth.h
index 8f6b4f720..7aaba83f3 100644
--- a/camel/providers/nntp/camel-nntp-auth.h
+++ b/camel/providers/nntp/camel-nntp-auth.h
@@ -30,7 +30,7 @@
G_BEGIN_DECLS
-int camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex);
+gint camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index 2fbbf4472..e25f984ad 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -66,7 +66,7 @@ static CamelDiscoFolderClass *parent_class = NULL;
#define CNNTPS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
void
-camel_nntp_folder_selected(CamelNNTPFolder *folder, char *line, CamelException *ex)
+camel_nntp_folder_selected(CamelNNTPFolder *folder, gchar *line, CamelException *ex)
{
camel_nntp_summary_check((CamelNNTPSummary *)((CamelFolder *)folder)->summary,
(CamelNNTPStore *)((CamelFolder *)folder)->parent_store,
@@ -79,7 +79,7 @@ nntp_folder_refresh_info_online (CamelFolder *folder, CamelException *ex)
CamelNNTPStore *nntp_store;
CamelFolderChangeInfo *changes = NULL;
CamelNNTPFolder *nntp_folder;
- char *line;
+ gchar *line;
nntp_store = (CamelNNTPStore *) folder->parent_store;
nntp_folder = (CamelNNTPFolder *) folder;
@@ -118,16 +118,16 @@ nntp_folder_sync_offline (CamelFolder *folder, CamelException *ex)
}
static gboolean
-nntp_folder_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
+nntp_folder_set_message_flags (CamelFolder *folder, const gchar *uid, guint32 flags, guint32 set)
{
return ((CamelFolderClass *) folder_class)->set_message_flags (folder, uid, flags, set);
}
-static char*
-nntp_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar *
+nntp_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelNNTPStore *nntp_store = (CamelNNTPStore *) folder->parent_store;
- char *article, *msgid;
+ gchar *article, *msgid;
article = alloca(strlen(uid)+1);
strcpy(article, uid);
@@ -143,12 +143,12 @@ nntp_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
}
static CamelStream *
-nntp_folder_download_message (CamelNNTPFolder *nntp_folder, const char *id, const char *msgid, CamelException *ex)
+nntp_folder_download_message (CamelNNTPFolder *nntp_folder, const gchar *id, const gchar *msgid, CamelException *ex)
{
CamelNNTPStore *nntp_store = (CamelNNTPStore *) ((CamelFolder *) nntp_folder)->parent_store;
CamelStream *stream = NULL;
- int ret;
- char *line;
+ gint ret;
+ gchar *line;
ret = camel_nntp_command (nntp_store, ex, nntp_folder, &line, "article %s", id);
if (ret == 220) {
@@ -181,11 +181,11 @@ nntp_folder_download_message (CamelNNTPFolder *nntp_folder, const char *id, cons
static void
-nntp_folder_cache_message (CamelDiscoFolder *disco_folder, const char *uid, CamelException *ex)
+nntp_folder_cache_message (CamelDiscoFolder *disco_folder, const gchar *uid, CamelException *ex)
{
CamelNNTPStore *nntp_store = (CamelNNTPStore *)((CamelFolder *) disco_folder)->parent_store;
CamelStream *stream;
- char *article, *msgid;
+ gchar *article, *msgid;
article = alloca(strlen(uid)+1);
strcpy(article, uid);
@@ -207,14 +207,14 @@ nntp_folder_cache_message (CamelDiscoFolder *disco_folder, const char *uid, Came
}
static CamelMimeMessage *
-nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+nntp_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelMimeMessage *message = NULL;
CamelNNTPStore *nntp_store;
CamelFolderChangeInfo *changes;
CamelNNTPFolder *nntp_folder;
CamelStream *stream = NULL;
- char *article, *msgid;
+ gchar *article, *msgid;
nntp_store = (CamelNNTPStore *) folder->parent_store;
nntp_folder = (CamelNNTPFolder *) folder;
@@ -275,7 +275,7 @@ fail:
}
static GPtrArray*
-nntp_folder_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
+nntp_folder_search_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
GPtrArray *matches;
@@ -294,7 +294,7 @@ nntp_folder_search_by_expression (CamelFolder *folder, const char *expression, C
}
static guint32
-nntp_folder_count_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
+nntp_folder_count_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex)
{
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
guint32 count;
@@ -313,7 +313,7 @@ nntp_folder_count_by_expression (CamelFolder *folder, const char *expression, Ca
}
static GPtrArray *
-nntp_folder_search_by_uids (CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
+nntp_folder_search_by_uids (CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex)
{
CamelNNTPFolder *nntp_folder = (CamelNNTPFolder *) folder;
GPtrArray *matches;
@@ -346,17 +346,17 @@ nntp_folder_search_free (CamelFolder *folder, GPtrArray *result)
static void
nntp_folder_append_message_online (CamelFolder *folder, CamelMimeMessage *mime_message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
CamelNNTPStore *nntp_store = (CamelNNTPStore *) folder->parent_store;
CamelStream *stream = (CamelStream*)nntp_store->stream;
CamelStreamFilter *filtered_stream;
CamelMimeFilter *crlffilter;
- int ret;
- unsigned int u;
+ gint ret;
+ guint u;
struct _camel_header_raw *header, *savedhdrs, *n, *tail;
- char *group, *line;
+ gchar *group, *line;
CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
@@ -406,7 +406,7 @@ nntp_folder_append_message_online (CamelFolder *folder, CamelMimeMessage *mime_m
|| camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (mime_message), CAMEL_STREAM (filtered_stream)) == -1
|| camel_stream_flush (CAMEL_STREAM (filtered_stream)) == -1
|| camel_stream_write (stream, "\r\n.\r\n", 5) == -1
- || (ret = camel_nntp_stream_line (nntp_store->stream, (unsigned char **)&line, &u)) == -1) {
+ || (ret = camel_nntp_stream_line (nntp_store->stream, (guchar **)&line, &u)) == -1) {
if (errno == EINTR)
camel_exception_setv (ex, CAMEL_EXCEPTION_USER_CANCEL, _("User canceled"));
else
@@ -426,7 +426,7 @@ nntp_folder_append_message_online (CamelFolder *folder, CamelMimeMessage *mime_m
static void
nntp_folder_append_message_offline (CamelFolder *folder, CamelMimeMessage *mime_message,
- const CamelMessageInfo *info, char **appended_uid,
+ const CamelMessageInfo *info, gchar **appended_uid,
CamelException *ex)
{
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
@@ -524,11 +524,11 @@ camel_nntp_folder_get_type (void)
}
CamelFolder *
-camel_nntp_folder_new (CamelStore *parent, const char *folder_name, CamelException *ex)
+camel_nntp_folder_new (CamelStore *parent, const gchar *folder_name, CamelException *ex)
{
CamelFolder *folder;
CamelNNTPFolder *nntp_folder;
- char *root;
+ gchar *root;
CamelService *service;
CamelStoreInfo *si;
gboolean subscribed = TRUE;
diff --git a/camel/providers/nntp/camel-nntp-folder.h b/camel/providers/nntp/camel-nntp-folder.h
index 3c832c774..67184a9bb 100644
--- a/camel/providers/nntp/camel-nntp-folder.h
+++ b/camel/providers/nntp/camel-nntp-folder.h
@@ -48,7 +48,7 @@ struct _CamelNNTPFolder {
CamelNNTPFolderPrivate *priv;
struct _CamelFolderChangeInfo *changes;
- char *storage_path;
+ gchar *storage_path;
CamelFolderSearch *search;
};
@@ -61,9 +61,9 @@ struct _CamelNNTPFolderClass {
/* Standard Camel function */
CamelType camel_nntp_folder_get_type (void);
-CamelFolder *camel_nntp_folder_new (CamelStore *parent, const char *folder_name, CamelException *ex);
+CamelFolder *camel_nntp_folder_new (CamelStore *parent, const gchar *folder_name, CamelException *ex);
-void camel_nntp_folder_selected(CamelNNTPFolder *folder, char *line, CamelException *ex);
+void camel_nntp_folder_selected(CamelNNTPFolder *folder, gchar *line, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/nntp/camel-nntp-grouplist.c b/camel/providers/nntp/camel-nntp-grouplist.c
index a54fab1ac..7e4eccbc7 100644
--- a/camel/providers/nntp/camel-nntp-grouplist.c
+++ b/camel/providers/nntp/camel-nntp-grouplist.c
@@ -39,7 +39,7 @@
static CamelNNTPGroupList *
camel_nntp_get_grouplist_from_server (CamelNNTPStore *store, CamelException *ex)
{
- int status;
+ gint status;
gboolean done = FALSE;
CamelNNTPGroupList *list;
@@ -56,7 +56,7 @@ camel_nntp_get_grouplist_from_server (CamelNNTPStore *store, CamelException *ex)
list->time = time (NULL);
while (!done) {
- char *line;
+ gchar *line;
if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (store), &line, ex) < 0) {
list->group_list = g_list_reverse(list->group_list);
@@ -68,7 +68,7 @@ camel_nntp_get_grouplist_from_server (CamelNNTPStore *store, CamelException *ex)
}
else {
CamelNNTPGroupListEntry *entry = g_new (CamelNNTPGroupListEntry, 1);
- char **split_line = g_strsplit (line, " ", 4);
+ gchar **split_line = g_strsplit (line, " ", 4);
entry->group_name = g_strdup (split_line[0]);
entry->high = atoi (split_line[1]);
@@ -92,7 +92,7 @@ camel_nntp_get_grouplist_from_file (CamelNNTPStore *store, CamelException *ex)
gchar *grouplist_file = g_strdup_printf ("%s/grouplist", root_dir);
CamelNNTPGroupList *list;
FILE *fp;
- char buf[300];
+ gchar buf[300];
unsigned long time;
g_free (root_dir);
@@ -125,7 +125,7 @@ camel_nntp_get_grouplist_from_file (CamelNNTPStore *store, CamelException *ex)
while (fgets (buf, sizeof (buf), fp)) {
CamelNNTPGroupListEntry *entry = g_new (CamelNNTPGroupListEntry, 1);
- char **split_line = g_strsplit (buf, " ", 4);
+ gchar **split_line = g_strsplit (buf, " ", 4);
entry->group_name = g_strdup (split_line[0]);
entry->high = atoi (split_line[1]);
@@ -175,7 +175,7 @@ camel_nntp_grouplist_save (CamelNNTPGroupList *group_list, CamelException *ex)
}
static void
-free_entry (CamelNNTPGroupListEntry *entry, void *data)
+free_entry (CamelNNTPGroupListEntry *entry, gpointer data)
{
g_free (entry->group_name);
g_free (entry);
diff --git a/camel/providers/nntp/camel-nntp-grouplist.h b/camel/providers/nntp/camel-nntp-grouplist.h
index 7f66aa8db..036b13541 100644
--- a/camel/providers/nntp/camel-nntp-grouplist.h
+++ b/camel/providers/nntp/camel-nntp-grouplist.h
@@ -30,7 +30,7 @@
G_BEGIN_DECLS
struct CamelNNTPGroupListEntry {
- char *group_name;
+ gchar *group_name;
guint32 low;
guint32 high;
guint32 flags;
diff --git a/camel/providers/nntp/camel-nntp-newsrc.c b/camel/providers/nntp/camel-nntp-newsrc.c
index 5f8cb9120..52e7e5c7d 100644
--- a/camel/providers/nntp/camel-nntp-newsrc.c
+++ b/camel/providers/nntp/camel-nntp-newsrc.c
@@ -48,7 +48,7 @@ typedef struct {
} ArticleRange;
typedef struct {
- char *name;
+ gchar *name;
GArray *ranges;
gboolean subscribed;
} NewsrcGroup;
@@ -62,7 +62,7 @@ struct CamelNNTPNewsrc {
static NewsrcGroup *
-camel_nntp_newsrc_group_add (CamelNNTPNewsrc *newsrc, const char *group_name, gboolean subscribed)
+camel_nntp_newsrc_group_add (CamelNNTPNewsrc *newsrc, const gchar *group_name, gboolean subscribed)
{
NewsrcGroup *new_group = g_malloc(sizeof(NewsrcGroup));
@@ -89,8 +89,8 @@ camel_nntp_newsrc_group_get_highest_article_read(CamelNNTPNewsrc *newsrc, Newsrc
static int
camel_nntp_newsrc_group_get_num_articles_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group)
{
- int i;
- int count = 0;
+ gint i;
+ gint count = 0;
if (group == NULL)
return 0;
@@ -106,7 +106,7 @@ camel_nntp_newsrc_group_get_num_articles_read(CamelNNTPNewsrc *newsrc, NewsrcGro
static void
camel_nntp_newsrc_group_mark_range_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group, long low, long high)
{
- int i;
+ gint i;
if (group->ranges->len == 1
&& g_array_index (group->ranges, ArticleRange, 0).low == 0
@@ -188,11 +188,11 @@ camel_nntp_newsrc_group_mark_range_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *gr
}
}
-int
-camel_nntp_newsrc_get_highest_article_read (CamelNNTPNewsrc *newsrc, const char *group_name)
+gint
+camel_nntp_newsrc_get_highest_article_read (CamelNNTPNewsrc *newsrc, const gchar *group_name)
{
NewsrcGroup *group;
- int ret;
+ gint ret;
NEWSRC_LOCK(newsrc, lock);
@@ -208,11 +208,11 @@ camel_nntp_newsrc_get_highest_article_read (CamelNNTPNewsrc *newsrc, const char
return ret;
}
-int
-camel_nntp_newsrc_get_num_articles_read (CamelNNTPNewsrc *newsrc, const char *group_name)
+gint
+camel_nntp_newsrc_get_num_articles_read (CamelNNTPNewsrc *newsrc, const gchar *group_name)
{
NewsrcGroup *group;
- int ret;
+ gint ret;
NEWSRC_LOCK(newsrc, lock);
@@ -229,13 +229,13 @@ camel_nntp_newsrc_get_num_articles_read (CamelNNTPNewsrc *newsrc, const char *gr
}
void
-camel_nntp_newsrc_mark_article_read (CamelNNTPNewsrc *newsrc, const char *group_name, int num)
+camel_nntp_newsrc_mark_article_read (CamelNNTPNewsrc *newsrc, const gchar *group_name, gint num)
{
camel_nntp_newsrc_mark_range_read (newsrc, group_name, num, num);
}
void
-camel_nntp_newsrc_mark_range_read(CamelNNTPNewsrc *newsrc, const char *group_name, long low, long high)
+camel_nntp_newsrc_mark_range_read(CamelNNTPNewsrc *newsrc, const gchar *group_name, long low, long high)
{
NewsrcGroup *group;
@@ -257,11 +257,11 @@ camel_nntp_newsrc_mark_range_read(CamelNNTPNewsrc *newsrc, const char *group_nam
}
gboolean
-camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc, const char *group_name, long num)
+camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc, const gchar *group_name, long num)
{
- int i;
+ gint i;
NewsrcGroup *group;
- int ret = FALSE;
+ gint ret = FALSE;
NEWSRC_LOCK(newsrc, lock);
group = g_hash_table_lookup (newsrc->groups, group_name);
@@ -282,10 +282,10 @@ camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc, const char *group_na
}
gboolean
-camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const char *group_name)
+camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const gchar *group_name)
{
NewsrcGroup *group;
- int ret = FALSE;
+ gint ret = FALSE;
NEWSRC_LOCK(newsrc, lock);
@@ -301,7 +301,7 @@ camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const char *grou
}
void
-camel_nntp_newsrc_subscribe_group (CamelNNTPNewsrc *newsrc, const char *group_name)
+camel_nntp_newsrc_subscribe_group (CamelNNTPNewsrc *newsrc, const gchar *group_name)
{
NewsrcGroup *group;
@@ -322,7 +322,7 @@ camel_nntp_newsrc_subscribe_group (CamelNNTPNewsrc *newsrc, const char *group_na
}
void
-camel_nntp_newsrc_unsubscribe_group (CamelNNTPNewsrc *newsrc, const char *group_name)
+camel_nntp_newsrc_unsubscribe_group (CamelNNTPNewsrc *newsrc, const gchar *group_name)
{
NewsrcGroup *group;
@@ -348,7 +348,7 @@ struct newsrc_ptr_array {
/* this needs to strdup the grup_name, if the group array is likely to change */
static void
-get_group_foreach (char *group_name, NewsrcGroup *group, struct newsrc_ptr_array *npa)
+get_group_foreach (gchar *group_name, NewsrcGroup *group, struct newsrc_ptr_array *npa)
{
if (group->subscribed || !npa->subscribed_only) {
g_ptr_array_add (npa->ptr_array, group_name);
@@ -411,7 +411,7 @@ camel_nntp_newsrc_write_group_line(gpointer key, NewsrcGroup *group, struct news
{
CamelNNTPNewsrc *newsrc;
FILE *fp;
- int i;
+ gint i;
fp = newsrc_fp->fp;
newsrc = newsrc_fp->newsrc;
@@ -433,7 +433,7 @@ camel_nntp_newsrc_write_group_line(gpointer key, NewsrcGroup *group, struct news
fprintf (fp, " ");
for (i = 0; i < group->ranges->len; i ++) {
- char range_buffer[100];
+ gchar range_buffer[100];
guint low = g_array_index (group->ranges, ArticleRange, i).low;
guint high = g_array_index (group->ranges, ArticleRange, i).high;
@@ -501,9 +501,9 @@ camel_nntp_newsrc_write(CamelNNTPNewsrc *newsrc)
}
static void
-camel_nntp_newsrc_parse_line(CamelNNTPNewsrc *newsrc, char *line)
+camel_nntp_newsrc_parse_line(CamelNNTPNewsrc *newsrc, gchar *line)
{
- char *p, *comma, *dash;
+ gchar *p, *comma, *dash;
gboolean is_subscribed;
NewsrcGroup *group;
@@ -555,11 +555,11 @@ camel_nntp_newsrc_parse_line(CamelNNTPNewsrc *newsrc, char *line)
} while(comma);
}
-static char*
-get_line (char *buf, char **p)
+static gchar *
+get_line (gchar *buf, gchar **p)
{
- char *l;
- char *line;
+ gchar *l;
+ gchar *line;
g_assert (*p == NULL || **p == '\n' || **p == '\0');
@@ -597,15 +597,15 @@ get_line (char *buf, char **p)
}
CamelNNTPNewsrc *
-camel_nntp_newsrc_read_for_server (const char *server)
+camel_nntp_newsrc_read_for_server (const gchar *server)
{
- int fd;
- char buf[1024];
- char *file_contents, *line, *p;
- char *filename;
+ gint fd;
+ gchar buf[1024];
+ gchar *file_contents, *line, *p;
+ gchar *filename;
CamelNNTPNewsrc *newsrc;
- int newsrc_len;
- int len_read = 0;
+ gint newsrc_len;
+ gint len_read = 0;
struct stat sb;
filename = g_strdup_printf ("%s/.newsrc-%s", g_get_home_dir(), server);
@@ -630,7 +630,7 @@ camel_nntp_newsrc_read_for_server (const char *server)
file_contents = g_malloc (newsrc_len + 1);
while (len_read < newsrc_len) {
- int c = read (fd, buf, sizeof (buf));
+ gint c = read (fd, buf, sizeof (buf));
if (c == -1)
break;
diff --git a/camel/providers/nntp/camel-nntp-newsrc.h b/camel/providers/nntp/camel-nntp-newsrc.h
index 9feee1fe0..fd6507a70 100644
--- a/camel/providers/nntp/camel-nntp-newsrc.h
+++ b/camel/providers/nntp/camel-nntp-newsrc.h
@@ -9,19 +9,19 @@ G_BEGIN_DECLS
typedef struct CamelNNTPNewsrc CamelNNTPNewsrc;
-int camel_nntp_newsrc_get_highest_article_read (CamelNNTPNewsrc *newsrc, const char *group_name);
-int camel_nntp_newsrc_get_num_articles_read (CamelNNTPNewsrc *newsrc, const char *group_name);
+gint camel_nntp_newsrc_get_highest_article_read (CamelNNTPNewsrc *newsrc, const gchar *group_name);
+gint camel_nntp_newsrc_get_num_articles_read (CamelNNTPNewsrc *newsrc, const gchar *group_name);
void camel_nntp_newsrc_mark_article_read (CamelNNTPNewsrc *newsrc,
- const char *group_name, int num);
+ const gchar *group_name, gint num);
void camel_nntp_newsrc_mark_range_read (CamelNNTPNewsrc *newsrc,
- const char *group_name, long low, long high);
+ const gchar *group_name, long low, long high);
gboolean camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc,
- const char *group_name, long num);
+ const gchar *group_name, long num);
-gboolean camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const char *group_name);
-void camel_nntp_newsrc_subscribe_group (CamelNNTPNewsrc *newsrc, const char *group_name);
-void camel_nntp_newsrc_unsubscribe_group (CamelNNTPNewsrc *newsrc, const char *group_name);
+gboolean camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const gchar *group_name);
+void camel_nntp_newsrc_subscribe_group (CamelNNTPNewsrc *newsrc, const gchar *group_name);
+void camel_nntp_newsrc_unsubscribe_group (CamelNNTPNewsrc *newsrc, const gchar *group_name);
GPtrArray* camel_nntp_newsrc_get_subscribed_group_names (CamelNNTPNewsrc *newsrc);
GPtrArray* camel_nntp_newsrc_get_all_group_names (CamelNNTPNewsrc *newsrc);
@@ -29,7 +29,7 @@ void camel_nntp_newsrc_free_group_names (CamelNNTPNewsrc *
void camel_nntp_newsrc_write_to_file (CamelNNTPNewsrc *newsrc, FILE *fp);
void camel_nntp_newsrc_write (CamelNNTPNewsrc *newsrc);
-CamelNNTPNewsrc *camel_nntp_newsrc_read_for_server (const char *server);
+CamelNNTPNewsrc *camel_nntp_newsrc_read_for_server (const gchar *server);
G_END_DECLS
diff --git a/camel/providers/nntp/camel-nntp-private.h b/camel/providers/nntp/camel-nntp-private.h
index 81d3e0204..87bad82af 100644
--- a/camel/providers/nntp/camel-nntp-private.h
+++ b/camel/providers/nntp/camel-nntp-private.h
@@ -33,7 +33,7 @@
G_BEGIN_DECLS
struct _CamelNNTPStorePrivate {
- int dummy;
+ gint dummy;
};
#define CAMEL_NNTP_STORE_LOCK(f, l) (e_mutex_lock(((CamelNNTPStore *)f)->priv->l))
diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c
index 8ca318b82..be8e29ed0 100644
--- a/camel/providers/nntp/camel-nntp-provider.c
+++ b/camel/providers/nntp/camel-nntp-provider.c
@@ -34,9 +34,9 @@
#include "camel-provider.h"
#include "camel-session.h"
-static void add_hash (guint *hash, char *s);
+static void add_hash (guint *hash, gchar *s);
static guint nntp_url_hash (gconstpointer key);
-static gint check_equal (char *s1, char *s2);
+static gint check_equal (gchar *s1, gchar *s2);
static gint nntp_url_equal (gconstpointer a, gconstpointer b);
static CamelProviderConfEntry nntp_conf_entries[] = {
@@ -94,7 +94,7 @@ camel_provider_module_init(void)
}
static void
-add_hash (guint *hash, char *s)
+add_hash (guint *hash, gchar *s)
{
if (s)
*hash ^= g_str_hash(s);
@@ -114,7 +114,7 @@ nntp_url_hash (gconstpointer key)
}
static gint
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
if (s2 == NULL)
diff --git a/camel/providers/nntp/camel-nntp-store-summary.c b/camel/providers/nntp/camel-nntp-store-summary.c
index 39d3dbb35..d1df63d56 100644
--- a/camel/providers/nntp/camel-nntp-store-summary.c
+++ b/camel/providers/nntp/camel-nntp-store-summary.c
@@ -45,16 +45,16 @@
#define _PRIVATE(o) (((CamelNNTPStoreSummary *)(o))->priv)
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
+static gint summary_header_load(CamelStoreSummary *, FILE *);
+static gint summary_header_save(CamelStoreSummary *, FILE *);
-/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const char *);*/
+/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const gchar *);*/
static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-static const char *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
-static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
+static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
+static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
static void camel_nntp_store_summary_class_init (CamelNNTPStoreSummaryClass *klass);
static void camel_nntp_store_summary_init (CamelNNTPStoreSummary *obj);
@@ -148,9 +148,9 @@ camel_nntp_store_summary_new (void)
* It must be freed using camel_store_summary_info_free().
**/
CamelNNTPStoreInfo *
-camel_nntp_store_summary_full_name(CamelNNTPStoreSummary *s, const char *full_name)
+camel_nntp_store_summary_full_name(CamelNNTPStoreSummary *s, const gchar *full_name)
{
- int count, i;
+ gint count, i;
CamelNNTPStoreInfo *info;
count = camel_store_summary_count ((CamelStoreSummary *) s);
@@ -166,12 +166,12 @@ camel_nntp_store_summary_full_name(CamelNNTPStoreSummary *s, const char *full_na
return NULL;
}
-char *
-camel_nntp_store_summary_full_to_path (CamelNNTPStoreSummary *s, const char *full_name, char dir_sep)
+gchar *
+camel_nntp_store_summary_full_to_path (CamelNNTPStoreSummary *s, const gchar *full_name, gchar dir_sep)
{
- char *path, *p;
- int c;
- const char *f;
+ gchar *path, *p;
+ gint c;
+ const gchar *f;
if (dir_sep != '/') {
p = path = g_alloca (strlen (full_name) * 3 + 1);
@@ -186,7 +186,7 @@ camel_nntp_store_summary_full_to_path (CamelNNTPStoreSummary *s, const char *ful
}
*p = 0;
} else
- path = (char *) full_name;
+ path = (gchar *) full_name;
return camel_utf7_utf8 (path);
}
@@ -202,14 +202,14 @@ hexnib (guint32 c)
return 0;
}
-char *
-camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *path, char dir_sep)
+gchar *
+camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const gchar *path, gchar dir_sep)
{
- char *full, *f;
+ gchar *full, *f;
guint32 c, v = 0;
- const char *p;
- int state=0;
- char *subpath, *last = NULL;
+ const gchar *p;
+ gint state=0;
+ gchar *subpath, *last = NULL;
CamelStoreInfo *si;
/* check to see if we have a subpath of path already defined */
@@ -237,7 +237,7 @@ camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *pat
else
p = path;
- while ((c = camel_utf8_getc ((const unsigned char **) &p))) {
+ while ((c = camel_utf8_getc ((const guchar **) &p))) {
switch (state) {
case 0:
if (c == '%') {
@@ -245,7 +245,7 @@ camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *pat
} else {
if (c == '/')
c = dir_sep;
- camel_utf8_putc((unsigned char **) &f, c);
+ camel_utf8_putc((guchar **) &f, c);
}
break;
case 1:
@@ -255,11 +255,11 @@ camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *pat
case 2:
state = 0;
v |= hexnib (c);
- camel_utf8_putc ((unsigned char **) &f, v);
+ camel_utf8_putc ((guchar **) &f, v);
break;
}
}
- camel_utf8_putc ((unsigned char **) &f, c);
+ camel_utf8_putc ((guchar **) &f, c);
/* merge old path part if required */
f = camel_utf8_utf7 (full);
@@ -274,12 +274,12 @@ camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *pat
}
CamelNNTPStoreInfo *
-camel_nntp_store_summary_add_from_full (CamelNNTPStoreSummary *s, const char *full, char dir_sep)
+camel_nntp_store_summary_add_from_full (CamelNNTPStoreSummary *s, const gchar *full, gchar dir_sep)
{
CamelNNTPStoreInfo *info;
- char *pathu8;
- int len;
- char *full_name;
+ gchar *pathu8;
+ gint len;
+ gchar *full_name;
d(printf("adding full name '%s' '%c'\n", full, dir_sep));
@@ -395,8 +395,8 @@ store_info_free (CamelStoreSummary *s, CamelStoreInfo *mi)
camel_nntp_store_summary_parent->store_info_free (s, mi);
}
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
+static const gchar *
+store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
{
CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *)mi;
@@ -413,7 +413,7 @@ store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
}
static void
-store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
+store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
{
CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *)mi;
diff --git a/camel/providers/nntp/camel-nntp-store-summary.h b/camel/providers/nntp/camel-nntp-store-summary.h
index 730b4c9fb..cc35974fe 100644
--- a/camel/providers/nntp/camel-nntp-store-summary.h
+++ b/camel/providers/nntp/camel-nntp-store-summary.h
@@ -46,7 +46,7 @@ enum {
struct _CamelNNTPStoreInfo {
CamelStoreInfo info;
- char *full_name;
+ gchar *full_name;
guint32 first; /* from LIST or NEWGROUPS return */
guint32 last;
};
@@ -60,7 +60,7 @@ struct _CamelNNTPStoreSummary {
/* header info */
guint32 version; /* version of base part of file */
- char last_newslist[NNTP_DATE_SIZE];
+ gchar last_newslist[NNTP_DATE_SIZE];
};
struct _CamelNNTPStoreSummaryClass {
@@ -71,25 +71,25 @@ CamelType 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 */
-/*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_new(CamelNNTPStoreSummary *s, const char *full_name, char dir_sep);*/
+/*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_new(CamelNNTPStoreSummary *s, const gchar *full_name, gchar dir_sep);*/
/*void camel_nntp_store_summary_namespace_set(CamelNNTPStoreSummary *s, CamelNNTPStoreNamespace *ns);*/
-/*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_find_path(CamelNNTPStoreSummary *s, const char *path);*/
-/*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_find_full(CamelNNTPStoreSummary *s, const char *full_name);*/
+/*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_find_path(CamelNNTPStoreSummary *s, const gchar *path);*/
+/*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_find_full(CamelNNTPStoreSummary *s, const gchar *full_name);*/
/* helper macro's */
#define camel_nntp_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_NNTP_STORE_INFO_FULL_NAME))
/* converts to/from utf8 canonical nasmes */
-char *camel_nntp_store_summary_full_to_path(CamelNNTPStoreSummary *s, const char *full_name, char dir_sep);
+gchar *camel_nntp_store_summary_full_to_path(CamelNNTPStoreSummary *s, const gchar *full_name, gchar dir_sep);
-char *camel_nntp_store_summary_path_to_full(CamelNNTPStoreSummary *s, const char *path, char dir_sep);
-char *camel_nntp_store_summary_dotted_to_full(CamelNNTPStoreSummary *s, const char *dotted, char dir_sep);
+gchar *camel_nntp_store_summary_path_to_full(CamelNNTPStoreSummary *s, const gchar *path, gchar dir_sep);
+gchar *camel_nntp_store_summary_dotted_to_full(CamelNNTPStoreSummary *s, const gchar *dotted, gchar dir_sep);
-CamelNNTPStoreInfo *camel_nntp_store_summary_full_name(CamelNNTPStoreSummary *s, const char *full_name);
-CamelNNTPStoreInfo *camel_nntp_store_summary_add_from_full(CamelNNTPStoreSummary *s, const char *full_name, char dir_sep);
+CamelNNTPStoreInfo *camel_nntp_store_summary_full_name(CamelNNTPStoreSummary *s, const gchar *full_name);
+CamelNNTPStoreInfo *camel_nntp_store_summary_add_from_full(CamelNNTPStoreSummary *s, const gchar *full_name, gchar dir_sep);
/* a convenience lookup function. always use this if path known */
-char *camel_nntp_store_summary_full_from_path(CamelNNTPStoreSummary *s, const char *path);
+gchar *camel_nntp_store_summary_full_from_path(CamelNNTPStoreSummary *s, const gchar *path);
G_END_DECLS
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index 594a91aa2..1ed56d86b 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -70,7 +70,7 @@ static CamelServiceClass *service_class = NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
#define CNNTPF_CLASS(so) CAMEL_NNTP_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static int camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex);
+static gint camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex);
static void nntp_construct (CamelService *service, CamelSession *session,
CamelProvider *provider, CamelURL *url,
@@ -84,8 +84,8 @@ nntp_can_work_offline(CamelDiscoStore *store)
}
static struct {
- const char *name;
- int type;
+ const gchar *name;
+ gint type;
} headers[] = {
{ "subject", 0 },
{ "from", 0 },
@@ -98,10 +98,10 @@ static struct {
static int
xover_setup(CamelNNTPStore *store, CamelException *ex)
{
- int ret, i;
- char *line;
- unsigned int len;
- unsigned char c, *p;
+ gint ret, i;
+ gchar *line;
+ guint len;
+ guchar c, *p;
struct _xover_header *xover, *last;
/* manual override */
@@ -118,8 +118,8 @@ xover_setup(CamelNNTPStore *store, CamelException *ex)
last = (struct _xover_header *)&store->xover;
/* supported command */
- while ((ret = camel_nntp_stream_line(store->stream, (unsigned char **)&line, &len)) > 0) {
- p = (unsigned char *) line;
+ while ((ret = camel_nntp_stream_line(store->stream, (guchar **)&line, &len)) > 0) {
+ p = (guchar *) line;
xover = g_malloc0(sizeof(*xover));
last->next = xover;
last = xover;
@@ -129,7 +129,7 @@ xover_setup(CamelNNTPStore *store, CamelException *ex)
for (i=0;i<sizeof(headers)/sizeof(headers[0]);i++) {
if (strcmp(line, headers[i].name) == 0) {
xover->name = headers[i].name;
- if (strncmp((char *) p, "full", 4) == 0)
+ if (strncmp((gchar *) p, "full", 4) == 0)
xover->skip = strlen(xover->name)+1;
else
xover->skip = 0;
@@ -159,15 +159,15 @@ enum {
#endif
static gboolean
-connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, CamelException *ex)
+connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, CamelException *ex)
{
CamelNNTPStore *store = (CamelNNTPStore *) service;
CamelDiscoStore *disco_store = (CamelDiscoStore*) service;
CamelStream *tcp_stream;
gboolean retval = FALSE;
- unsigned char *buf;
- unsigned int len;
- char *path;
+ guchar *buf;
+ guint len;
+ gchar *path;
CAMEL_SERVICE_REC_LOCK(store, connect_lock);
@@ -223,7 +223,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
goto fail;
}
- len = strtoul ((char *) buf, (char **) &buf, 10);
+ len = strtoul ((gchar *) buf, (gchar **) &buf, 10);
if (len != 200 && len != 201) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("NNTP server %s returned error code %d: %s"),
@@ -242,8 +242,8 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
goto fail;
/* set 'reader' mode & ignore return code, also ping the server, inn goes offline very quickly otherwise */
- if (camel_nntp_raw_command_auth (store, ex, (char **) &buf, "mode reader") == -1
- || camel_nntp_raw_command_auth (store, ex, (char **) &buf, "date") == -1)
+ if (camel_nntp_raw_command_auth (store, ex, (gchar **) &buf, "mode reader") == -1
+ || camel_nntp_raw_command_auth (store, ex, (gchar **) &buf, "date") == -1)
goto fail;
if (xover_setup(store, ex) == -1)
@@ -266,10 +266,10 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
}
static struct {
- char *value;
- char *serv;
- char *port;
- int mode;
+ gchar *value;
+ gchar *serv;
+ gchar *port;
+ gint mode;
} ssl_options[] = {
{ "", "nntps", NNTPS_PORT, MODE_SSL }, /* really old (1.x) */
{ "always", "nntps", NNTPS_PORT, MODE_SSL },
@@ -282,10 +282,10 @@ static gboolean
nntp_connect_online (CamelService *service, CamelException *ex)
{
struct addrinfo hints, *ai;
- const char *ssl_mode;
- int mode, ret, i;
- char *serv;
- const char *port;
+ const gchar *ssl_mode;
+ gint mode, ret, i;
+ gchar *serv;
+ const gchar *port;
if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
for (i = 0; ssl_options[i].value; i++)
@@ -329,7 +329,7 @@ nntp_connect_offline (CamelService *service, CamelException *ex)
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(service);
CamelDiscoStore *disco_store = (CamelDiscoStore *) nntp_store;
- char *path;
+ gchar *path;
if (nntp_store->storage_path == NULL)
return FALSE;
@@ -362,7 +362,7 @@ static gboolean
nntp_disconnect_online (CamelService *service, gboolean clean, CamelException *ex)
{
CamelNNTPStore *store = CAMEL_NNTP_STORE (service);
- char *line;
+ gchar *line;
CAMEL_SERVICE_REC_LOCK(store, connect_lock);
@@ -402,7 +402,7 @@ nntp_disconnect_offline (CamelService *service, gboolean clean, CamelException *
return TRUE;
}
-static char *
+static gchar *
nntp_store_get_name (CamelService *service, gboolean brief)
{
if (brief)
@@ -421,7 +421,7 @@ nntp_store_query_auth_types (CamelService *service, CamelException *ex)
}
static CamelFolder *
-nntp_get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+nntp_get_folder(CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
CamelFolder *folder;
@@ -440,11 +440,11 @@ nntp_get_folder(CamelStore *store, const char *folder_name, guint32 flags, Camel
* e.g. nl.comp.os.linux.programmeren becomes n.c.o.l.programmeren
*/
-static char *
-nntp_newsgroup_name_short (const char *name)
+static gchar *
+nntp_newsgroup_name_short (const gchar *name)
{
- char *resptr, *tmp;
- const char *ptr2;
+ gchar *resptr, *tmp;
+ const gchar *ptr2;
resptr = tmp = g_malloc0 (strlen (name) + 1);
@@ -475,7 +475,7 @@ nntp_folder_info_from_store_info (CamelNNTPStore *store, gboolean short_notation
CamelURL *base_url = ((CamelService *) store)->url;
CamelFolderInfo *fi;
CamelURL *url;
- char *path;
+ gchar *path;
fi = camel_folder_info_new ();
fi->full_name = g_strdup (si->path);
@@ -498,12 +498,12 @@ nntp_folder_info_from_store_info (CamelNNTPStore *store, gboolean short_notation
}
static CamelFolderInfo *
-nntp_folder_info_from_name (CamelNNTPStore *store, gboolean short_notation, const char *name)
+nntp_folder_info_from_name (CamelNNTPStore *store, gboolean short_notation, const gchar *name)
{
CamelURL *base_url = ((CamelService *)store)->url;
CamelFolderInfo *fi;
CamelURL *url;
- char *path;
+ gchar *path;
fi = camel_folder_info_new ();
fi->full_name = g_strdup (name);
@@ -526,13 +526,13 @@ nntp_folder_info_from_name (CamelNNTPStore *store, gboolean short_notation, cons
/* handle list/newgroups response */
static CamelNNTPStoreInfo *
-nntp_store_info_update(CamelNNTPStore *store, char *line)
+nntp_store_info_update(CamelNNTPStore *store, gchar *line)
{
CamelStoreSummary *summ = (CamelStoreSummary *)store->summary;
CamelURL *base_url = ((CamelService *)store)->url;
CamelNNTPStoreInfo *si, *fsi;
CamelURL *url;
- char *relpath, *tmp;
+ gchar *relpath, *tmp;
guint32 last = 0, first = 0, new = 0;
tmp = strchr(line, ' ');
@@ -590,9 +590,9 @@ nntp_store_info_update(CamelNNTPStore *store, char *line)
}
static CamelFolderInfo *
-nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const char *top, guint flags, CamelException *ex)
+nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const gchar *top, guint flags, CamelException *ex)
{
- int i;
+ gint i;
CamelStoreInfo *si;
CamelFolderInfo *first = NULL, *last = NULL, *fi = NULL;
@@ -609,7 +609,7 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const char *top, g
our storeinfo too; in a very round-about way */
if ((flags & CAMEL_STORE_FOLDER_INFO_FAST) == 0) {
CamelNNTPFolder *folder;
- char *line;
+ gchar *line;
folder = (CamelNNTPFolder *)camel_store_get_folder((CamelStore *)store, si->path, 0, ex);
if (folder) {
@@ -648,17 +648,17 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const char *top, g
* get folder info, using the information in our StoreSummary
*/
static CamelFolderInfo *
-nntp_store_get_cached_folder_info (CamelNNTPStore *store, const char *orig_top, guint flags, CamelException *ex)
+nntp_store_get_cached_folder_info (CamelNNTPStore *store, const gchar *orig_top, guint flags, CamelException *ex)
{
- int i;
- int subscribed_or_flag = (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED) ? 0 : 1,
+ gint i;
+ gint subscribed_or_flag = (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED) ? 0 : 1,
root_or_flag = (orig_top == NULL || orig_top[0] == '\0') ? 1 : 0,
recursive_flag = flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE;
CamelStoreInfo *si;
CamelFolderInfo *first = NULL, *last = NULL, *fi = NULL, *l;
- char *tmpname;
- char *top = g_strconcat(orig_top?orig_top:"", ".", NULL);
- int toplen = strlen(top);
+ gchar *tmpname;
+ gchar *top = g_strconcat(orig_top?orig_top:"", ".", NULL);
+ gint toplen = strlen(top);
for (i = 0; (si = camel_store_summary_index ((CamelStoreSummary *) store->summary, i)); i++) {
if ((subscribed_or_flag || (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED))
@@ -730,14 +730,14 @@ nntp_store_get_cached_folder_info (CamelNNTPStore *store, const char *orig_top,
static gboolean
nntp_get_date(CamelNNTPStore *nntp_store, CamelException *ex)
{
- unsigned char *line;
- int ret = camel_nntp_command(nntp_store, ex, NULL, (char **)&line, "date");
- char *ptr;
+ guchar *line;
+ gint ret = camel_nntp_command(nntp_store, ex, NULL, (gchar **)&line, "date");
+ gchar *ptr;
nntp_store->summary->last_newslist[0] = 0;
if (ret == 111) {
- ptr = (char *) line + 3;
+ ptr = (gchar *) line + 3;
while (*ptr == ' ' || *ptr == '\t')
ptr++;
@@ -750,7 +750,7 @@ nntp_get_date(CamelNNTPStore *nntp_store, CamelException *ex)
}
static void
-store_info_remove(void *key, void *value, void *data)
+store_info_remove(gpointer key, gpointer value, gpointer data)
{
CamelStoreSummary *summary = data;
CamelStoreInfo *si = value;
@@ -765,13 +765,13 @@ store_info_sort (gconstpointer a, gconstpointer b)
}
static CamelFolderInfo *
-nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guint32 flags, gboolean online, CamelException *ex)
+nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const gchar *top, guint32 flags, gboolean online, CamelException *ex)
{
CamelNNTPStoreSummary *summary = nntp_store->summary;
CamelNNTPStoreInfo *si;
- unsigned int len;
- unsigned char *line;
- int ret = -1;
+ guint len;
+ guchar *line;
+ gint ret = -1;
CamelFolderInfo *fi = NULL;
CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
@@ -782,7 +782,7 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guin
if (online && (top == NULL || top[0] == 0)) {
/* we may need to update */
if (summary->last_newslist[0] != 0) {
- char date[14];
+ gchar date[14];
memcpy(date, summary->last_newslist + 2, 6); /* YYMMDDD */
date[6] = ' ';
memcpy(date + 7, summary->last_newslist + 8, 6); /* HHMMSS */
@@ -792,7 +792,7 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guin
if (!nntp_get_date (nntp_store, NULL))
goto do_complete_list_nodate;
- ret = camel_nntp_command (nntp_store, ex, NULL, (char **) &line, "newgroups %s", date);
+ ret = camel_nntp_command (nntp_store, ex, NULL, (gchar **) &line, "newgroups %s", date);
if (ret == -1)
goto error;
else if (ret != 231) {
@@ -802,17 +802,17 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guin
}
while ((ret = camel_nntp_stream_line (nntp_store->stream, &line, &len)) > 0)
- nntp_store_info_update(nntp_store, (char *) line);
+ nntp_store_info_update(nntp_store, (gchar *) line);
} else {
GHashTable *all;
- int i;
+ gint i;
do_complete_list:
/* seems we do need a complete list */
/* at first, we do a DATE to find out the last load occasion */
nntp_get_date (nntp_store, NULL);
do_complete_list_nodate:
- ret = camel_nntp_command (nntp_store, ex, NULL, (char **)&line, "list");
+ ret = camel_nntp_command (nntp_store, ex, NULL, (gchar **)&line, "list");
if (ret == -1)
goto error;
else if (ret != 215) {
@@ -826,7 +826,7 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guin
g_hash_table_insert(all, si->info.path, si);
while ((ret = camel_nntp_stream_line(nntp_store->stream, &line, &len)) > 0) {
- si = nntp_store_info_update(nntp_store, (char *) line);
+ si = nntp_store_info_update(nntp_store, (gchar *) line);
g_hash_table_remove(all, si->info.path);
}
@@ -850,7 +850,7 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guin
}
static CamelFolderInfo *
-nntp_get_folder_info (CamelStore *store, const char *top, guint32 flags, gboolean online, CamelException *ex)
+nntp_get_folder_info (CamelStore *store, const gchar *top, guint32 flags, gboolean online, CamelException *ex)
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(store);
CamelFolderInfo *first = NULL;
@@ -871,23 +871,23 @@ nntp_get_folder_info (CamelStore *store, const char *top, guint32 flags, gboolea
}
static CamelFolderInfo *
-nntp_get_folder_info_online (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+nntp_get_folder_info_online (CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
return nntp_get_folder_info (store, top, flags, TRUE, ex);
}
static CamelFolderInfo *
-nntp_get_folder_info_offline(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+nntp_get_folder_info_offline(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
return nntp_get_folder_info (store, top, flags, FALSE, ex);
}
static gboolean
-nntp_store_folder_subscribed (CamelStore *store, const char *folder_name)
+nntp_store_folder_subscribed (CamelStore *store, const gchar *folder_name)
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
CamelStoreInfo *si;
- int truth = FALSE;
+ gint truth = FALSE;
si = camel_store_summary_path ((CamelStoreSummary *) nntp_store->summary, folder_name);
if (si) {
@@ -899,7 +899,7 @@ nntp_store_folder_subscribed (CamelStore *store, const char *folder_name)
}
static void
-nntp_store_subscribe_folder (CamelStore *store, const char *folder_name,
+nntp_store_subscribe_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex)
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(store);
@@ -931,7 +931,7 @@ nntp_store_subscribe_folder (CamelStore *store, const char *folder_name,
}
static void
-nntp_store_unsubscribe_folder (CamelStore *store, const char *folder_name,
+nntp_store_unsubscribe_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex)
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(store);
@@ -964,8 +964,8 @@ nntp_store_unsubscribe_folder (CamelStore *store, const char *folder_name,
/* stubs for various folder operations we're not implementing */
static CamelFolderInfo *
-nntp_create_folder (CamelStore *store, const char *parent_name,
- const char *folder_name, CamelException *ex)
+nntp_create_folder (CamelStore *store, const gchar *parent_name,
+ const gchar *folder_name, CamelException *ex)
{
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
_("You cannot create a folder in a News store: subscribe instead."));
@@ -973,14 +973,14 @@ nntp_create_folder (CamelStore *store, const char *parent_name,
}
static void
-nntp_rename_folder (CamelStore *store, const char *old_name, const char *new_name_in, CamelException *ex)
+nntp_rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name_in, CamelException *ex)
{
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
_("You cannot rename a folder in a News store."));
}
static void
-nntp_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+nntp_delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
nntp_store_unsubscribe_folder (store, folder_name, ex);
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
@@ -1087,7 +1087,7 @@ nntp_construct (CamelService *service, CamelSession *session,
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(service);
CamelURL *summary_url;
- char *tmp;
+ gchar *tmp;
/* construct the parent first */
CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
@@ -1174,8 +1174,8 @@ camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex)
{
CamelService *service = (CamelService *) store;
CamelSession *session = camel_service_get_session (service);
- int ret;
- char *line = NULL;
+ gint ret;
+ gchar *line = NULL;
if (!service->url->user) {
camel_exception_setv(ex, CAMEL_EXCEPTION_INVALID_PARAM,
@@ -1185,12 +1185,12 @@ camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex)
/* if nessecary, prompt for the password */
if (!service->url->passwd) {
- char *prompt, *base;
+ gchar *prompt, *base;
retry:
base = camel_session_build_password_prompt (
"NNTP", service->url->user, service->url->host);
if (line) {
- char *top = g_markup_printf_escaped (
+ gchar *top = g_markup_printf_escaped (
_("Cannot authenticate to server: %s"), line);
prompt = g_strdup_printf("%s\n\n%s", top, base);
@@ -1234,31 +1234,31 @@ camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex)
}
/* Enter owning lock */
-int
-camel_nntp_raw_commandv (CamelNNTPStore *store, CamelException *ex, char **line, const char *fmt, va_list ap)
+gint
+camel_nntp_raw_commandv (CamelNNTPStore *store, CamelException *ex, gchar **line, const gchar *fmt, va_list ap)
{
- const unsigned char *p, *ps;
- unsigned char c;
- char *s;
- int d;
- unsigned int u, u2;
+ const guchar *p, *ps;
+ guchar c;
+ gchar *s;
+ gint d;
+ guint u, u2;
g_assert(store->stream->mode != CAMEL_NNTP_STREAM_DATA);
camel_nntp_stream_set_mode(store->stream, CAMEL_NNTP_STREAM_LINE);
- p = (const unsigned char *) fmt;
- ps = (const unsigned char *) p;
+ p = (const guchar *) fmt;
+ ps = (const guchar *) p;
while ((c = *p++)) {
switch (c) {
case '%':
c = *p++;
- camel_stream_write ((CamelStream *) store->mem, (const char *) ps, p - ps - (c == '%' ? 1 : 2));
+ camel_stream_write ((CamelStream *) store->mem, (const gchar *) ps, p - ps - (c == '%' ? 1 : 2));
ps = p;
switch (c) {
case 's':
- s = va_arg(ap, char *);
+ s = va_arg(ap, gchar *);
camel_stream_write((CamelStream *)store->mem, s, strlen(s));
break;
case 'd':
@@ -1270,7 +1270,7 @@ camel_nntp_raw_commandv (CamelNNTPStore *store, CamelException *ex, char **line,
camel_stream_printf((CamelStream *)store->mem, "%u", u);
break;
case 'm':
- s = va_arg(ap, char *);
+ s = va_arg(ap, gchar *);
camel_stream_printf((CamelStream *)store->mem, "<%s>", s);
break;
case 'r':
@@ -1288,18 +1288,18 @@ camel_nntp_raw_commandv (CamelNNTPStore *store, CamelException *ex, char **line,
}
}
- camel_stream_write ((CamelStream *) store->mem, (const char *) ps, p-ps-1);
+ camel_stream_write ((CamelStream *) store->mem, (const gchar *) ps, p-ps-1);
dd(printf("NNTP_COMMAND: '%.*s'\n", (int)store->mem->buffer->len, store->mem->buffer->data));
camel_stream_write ((CamelStream *) store->mem, "\r\n", 2);
- if (camel_stream_write((CamelStream *) store->stream, (const char *) store->mem->buffer->data, store->mem->buffer->len) == -1)
+ if (camel_stream_write((CamelStream *) store->stream, (const gchar *) store->mem->buffer->data, store->mem->buffer->len) == -1)
goto ioerror;
/* FIXME: hack */
camel_stream_reset ((CamelStream *) store->mem);
g_byte_array_set_size (store->mem->buffer, 0);
- if (camel_nntp_stream_line (store->stream, (unsigned char **) line, &u) == -1)
+ if (camel_nntp_stream_line (store->stream, (guchar **) line, &u) == -1)
goto ioerror;
u = strtoul (*line, NULL, 10);
@@ -1318,10 +1318,10 @@ ioerror:
return -1;
}
-int
-camel_nntp_raw_command(CamelNNTPStore *store, CamelException *ex, char **line, const char *fmt, ...)
+gint
+camel_nntp_raw_command(CamelNNTPStore *store, CamelException *ex, gchar **line, const gchar *fmt, ...)
{
- int ret;
+ gint ret;
va_list ap;
va_start(ap, fmt);
@@ -1332,10 +1332,10 @@ camel_nntp_raw_command(CamelNNTPStore *store, CamelException *ex, char **line, c
}
/* use this where you also need auth to be handled, i.e. most cases where you'd try raw command */
-int
-camel_nntp_raw_command_auth(CamelNNTPStore *store, CamelException *ex, char **line, const char *fmt, ...)
+gint
+camel_nntp_raw_command_auth(CamelNNTPStore *store, CamelException *ex, gchar **line, const gchar *fmt, ...)
{
- int ret, retry, go;
+ gint ret, retry, go;
va_list ap;
retry = 0;
@@ -1358,13 +1358,13 @@ camel_nntp_raw_command_auth(CamelNNTPStore *store, CamelException *ex, char **li
return ret;
}
-int
-camel_nntp_command (CamelNNTPStore *store, CamelException *ex, CamelNNTPFolder *folder, char **line, const char *fmt, ...)
+gint
+camel_nntp_command (CamelNNTPStore *store, CamelException *ex, CamelNNTPFolder *folder, gchar **line, const gchar *fmt, ...)
{
- const unsigned char *p;
+ const guchar *p;
va_list ap;
- int ret, retry;
- unsigned int u;
+ gint ret, retry;
+ guint u;
if (((CamelDiscoStore *)store)->status == CAMEL_DISCO_STORE_OFFLINE) {
camel_exception_setv(ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED,
@@ -1383,7 +1383,7 @@ camel_nntp_command (CamelNNTPStore *store, CamelException *ex, CamelNNTPFolder *
/* Check for unprocessed data, ! */
if (store->stream->mode == CAMEL_NNTP_STREAM_DATA) {
g_warning("Unprocessed data left in stream, flushing");
- while (camel_nntp_stream_getd(store->stream, (unsigned char **)&p, &u) > 0)
+ while (camel_nntp_stream_getd(store->stream, (guchar **)&p, &u) > 0)
;
}
camel_nntp_stream_set_mode(store->stream, CAMEL_NNTP_STREAM_LINE);
diff --git a/camel/providers/nntp/camel-nntp-store.h b/camel/providers/nntp/camel-nntp-store.h
index 9197ae2ef..8336d4bb5 100644
--- a/camel/providers/nntp/camel-nntp-store.h
+++ b/camel/providers/nntp/camel-nntp-store.h
@@ -61,8 +61,8 @@ typedef enum _xover_t {
struct _xover_header {
struct _xover_header *next;
- const char *name;
- unsigned int skip:8;
+ const gchar *name;
+ guint skip:8;
xover_t type:8;
};
@@ -73,9 +73,9 @@ struct _CamelNNTPStore {
guint32 extensions;
- unsigned int posting_allowed:1;
- unsigned int do_short_folder_notation:1;
- unsigned int folder_hierarchy_relative:1;
+ guint posting_allowed:1;
+ guint do_short_folder_notation:1;
+ guint folder_hierarchy_relative:1;
struct _CamelNNTPStoreSummary *summary;
@@ -84,7 +84,7 @@ struct _CamelNNTPStore {
struct _CamelDataCache *cache;
- char *current_folder, *storage_path, *base_url;
+ gchar *current_folder, *storage_path, *base_url;
struct _xover_header *xover;
};
@@ -97,10 +97,10 @@ struct _CamelNNTPStoreClass {
/* Standard Camel function */
CamelType camel_nntp_store_get_type (void);
-int camel_nntp_raw_commandv (CamelNNTPStore *store, struct _CamelException *ex, char **line, const char *fmt, va_list ap);
-int camel_nntp_raw_command(CamelNNTPStore *store, struct _CamelException *ex, char **line, const char *fmt, ...);
-int camel_nntp_raw_command_auth(CamelNNTPStore *store, struct _CamelException *ex, char **line, const char *fmt, ...);
-int camel_nntp_command (CamelNNTPStore *store, struct _CamelException *ex, struct _CamelNNTPFolder *folder, char **line, const char *fmt, ...);
+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, ...);
+gint camel_nntp_raw_command_auth(CamelNNTPStore *store, struct _CamelException *ex, gchar **line, const gchar *fmt, ...);
+gint camel_nntp_command (CamelNNTPStore *store, struct _CamelException *ex, struct _CamelNNTPFolder *folder, gchar **line, const gchar *fmt, ...);
G_END_DECLS
diff --git a/camel/providers/nntp/camel-nntp-stream.c b/camel/providers/nntp/camel-nntp-stream.c
index 3211292b8..541d82aff 100644
--- a/camel/providers/nntp/camel-nntp-stream.c
+++ b/camel/providers/nntp/camel-nntp-stream.c
@@ -51,14 +51,14 @@ static CamelObjectClass *parent_class = NULL;
static int
stream_fill(CamelNNTPStream *is)
{
- int left = 0;
+ gint left = 0;
if (is->source) {
left = is->end - is->ptr;
memcpy(is->buf, is->ptr, left);
is->end = is->buf + left;
is->ptr = is->buf;
- left = camel_stream_read(is->source, (char *) is->end, CAMEL_NNTP_STREAM_SIZE - (is->end - is->buf));
+ left = camel_stream_read(is->source, (gchar *) is->end, CAMEL_NNTP_STREAM_SIZE - (is->end - is->buf));
if (left > 0) {
is->end += left;
is->end[0] = '\n';
@@ -75,12 +75,12 @@ stream_fill(CamelNNTPStream *is)
}
static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
+stream_read(CamelStream *stream, gchar *buffer, size_t n)
{
CamelNNTPStream *is = (CamelNNTPStream *)stream;
- char *o, *oe;
- unsigned char *p, *e, c;
- int state;
+ gchar *o, *oe;
+ guchar *p, *e, c;
+ gint state;
if (is->mode != CAMEL_NNTP_STREAM_DATA || n == 0)
return 0;
@@ -147,7 +147,7 @@ stream_read(CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
+stream_write(CamelStream *stream, const gchar *buffer, size_t n)
{
CamelNNTPStream *is = (CamelNNTPStream *)stream;
@@ -263,12 +263,12 @@ camel_nntp_stream_new(CamelStream *source)
}
/* Get one line from the nntp stream */
-int
-camel_nntp_stream_line(CamelNNTPStream *is, unsigned char **data, unsigned int *len)
+gint
+camel_nntp_stream_line(CamelNNTPStream *is, guchar **data, guint *len)
{
- register unsigned char c, *p, *o, *oe;
- int newlen, oldlen;
- unsigned char *e;
+ register guchar c, *p, *o, *oe;
+ gint newlen, oldlen;
+ guchar *e;
if (is->mode == CAMEL_NNTP_STREAM_EOD) {
*data = is->linebuf;
@@ -348,10 +348,10 @@ camel_nntp_stream_line(CamelNNTPStream *is, unsigned char **data, unsigned int *
}
/* returns -1 on error, 0 if last lot of data, >0 if more remaining */
-int camel_nntp_stream_gets(CamelNNTPStream *is, unsigned char **start, unsigned int *len)
+gint camel_nntp_stream_gets(CamelNNTPStream *is, guchar **start, guint *len)
{
- int max;
- unsigned char *end;
+ gint max;
+ guchar *end;
*len = 0;
@@ -381,10 +381,10 @@ void camel_nntp_stream_set_mode(CamelNNTPStream *is, camel_nntp_stream_mode_t mo
}
/* returns -1 on erorr, 0 if last data, >0 if more data left */
-int camel_nntp_stream_getd(CamelNNTPStream *is, unsigned char **start, unsigned int *len)
+gint camel_nntp_stream_getd(CamelNNTPStream *is, guchar **start, guint *len)
{
- unsigned char *p, *e, *s;
- int state;
+ guchar *p, *e, *s;
+ gint state;
*len = 0;
diff --git a/camel/providers/nntp/camel-nntp-stream.h b/camel/providers/nntp/camel-nntp-stream.h
index 676bd1136..b024bfb12 100644
--- a/camel/providers/nntp/camel-nntp-stream.h
+++ b/camel/providers/nntp/camel-nntp-stream.h
@@ -44,10 +44,10 @@ struct _CamelNNTPStream {
CamelStream *source;
camel_nntp_stream_mode_t mode;
- int state;
+ gint state;
- unsigned char *buf, *ptr, *end;
- unsigned char *linebuf, *lineptr, *lineend;
+ guchar *buf, *ptr, *end;
+ guchar *linebuf, *lineptr, *lineend;
};
struct _CamelNNTPStreamClass {
@@ -61,9 +61,9 @@ CamelStream *camel_nntp_stream_new (CamelStream *source);
void camel_nntp_stream_set_mode (CamelNNTPStream *is, camel_nntp_stream_mode_t mode);
-int camel_nntp_stream_line (CamelNNTPStream *is, unsigned char **data, unsigned int *len);
-int camel_nntp_stream_gets (CamelNNTPStream *is, unsigned char **start, unsigned int *len);
-int camel_nntp_stream_getd (CamelNNTPStream *is, unsigned char **start, unsigned int *len);
+gint camel_nntp_stream_line (CamelNNTPStream *is, guchar **data, guint *len);
+int camel_nntp_stream_gets (CamelNNTPStream *is, guchar **start, guint *len);
+int camel_nntp_stream_getd (CamelNNTPStream *is, guchar **start, guint *len);
G_END_DECLS
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index d06a56bb1..7ee1ef35d 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -57,18 +57,18 @@
#define EXTRACT_DIGIT(val) part++; val=strtoul (part, &part, 10);
struct _CamelNNTPSummaryPrivate {
- char *uid;
+ gchar *uid;
struct _xover_header *xover; /* xoverview format */
- int xover_setup;
+ gint xover_setup;
};
#define _PRIVATE(o) (((CamelNNTPSummary *)(o))->priv)
static CamelMessageInfo * message_info_new_from_header (CamelFolderSummary *, struct _camel_header_raw *);
-static int summary_header_load(CamelFolderSummary *, FILE *);
-static int summary_header_save(CamelFolderSummary *, FILE *);
-static int summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
+static gint summary_header_load(CamelFolderSummary *, FILE *);
+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 void camel_nntp_summary_class_init (CamelNNTPSummaryClass *klass);
@@ -133,7 +133,7 @@ camel_nntp_summary_finalise(CamelObject *obj)
}
CamelNNTPSummary *
-camel_nntp_summary_new(struct _CamelFolder *folder, const char *path)
+camel_nntp_summary_new(struct _CamelFolder *folder, const gchar *path)
{
CamelNNTPSummary *cns = (CamelNNTPSummary *)camel_object_new(camel_nntp_summary_get_type());
@@ -170,7 +170,7 @@ static int
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
{
CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(s);
- char *part;
+ gchar *part;
if (camel_nntp_summary_parent->summary_header_from_db (s, mir) == -1)
@@ -256,14 +256,14 @@ summary_header_save(CamelFolderSummary *s, FILE *out)
/* Note: This will be called from camel_nntp_command, so only use camel_nntp_raw_command */
static int
-add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high, unsigned int low, CamelFolderChangeInfo *changes, CamelException *ex)
+add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, guint high, guint low, CamelFolderChangeInfo *changes, CamelException *ex)
{
CamelFolderSummary *s;
CamelMessageInfoBase *mi;
struct _camel_header_raw *headers = NULL;
- char *line, *tab;
- int len, ret;
- unsigned int n, count, total, size;
+ gchar *line, *tab;
+ gint len, ret;
+ guint n, count, total, size;
struct _xover_header *xover;
s = (CamelFolderSummary *)cns;
@@ -281,7 +281,7 @@ add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high,
count = 0;
total = high-low+1;
- while ((ret = camel_nntp_stream_line(store->stream, (unsigned char **)&line, &len)) > 0) {
+ while ((ret = camel_nntp_stream_line(store->stream, (guchar **)&line, &len)) > 0) {
camel_operation_progress(NULL, (count * 100) / total);
count++;
n = strtoul(line, &tab, 10);
@@ -348,12 +348,12 @@ add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high,
/* Note: This will be called from camel_nntp_command, so only use camel_nntp_raw_command */
static int
-add_range_head(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high, unsigned int low, CamelFolderChangeInfo *changes, CamelException *ex)
+add_range_head(CamelNNTPSummary *cns, CamelNNTPStore *store, guint high, guint low, CamelFolderChangeInfo *changes, CamelException *ex)
{
CamelFolderSummary *s;
- int ret = -1;
- char *line, *msgid;
- unsigned int i, n, count, total;
+ gint ret = -1;
+ gchar *line, *msgid;
+ guint i, n, count, total;
CamelMessageInfo *mi;
CamelMimeParser *mp;
@@ -430,14 +430,14 @@ ioerror:
/* Assumes we have the stream */
/* Note: This will be called from camel_nntp_command, so only use camel_nntp_raw_command */
-int
-camel_nntp_summary_check(CamelNNTPSummary *cns, CamelNNTPStore *store, char *line, CamelFolderChangeInfo *changes, CamelException *ex)
+gint
+camel_nntp_summary_check(CamelNNTPSummary *cns, CamelNNTPStore *store, gchar *line, CamelFolderChangeInfo *changes, CamelException *ex)
{
CamelFolderSummary *s;
- int ret = 0, i;
- unsigned int n, f, l;
- int count;
- char *folder = NULL;
+ gint ret = 0, i;
+ guint n, f, l;
+ gint count;
+ gchar *folder = NULL;
CamelNNTPStoreInfo *si;
GSList *del = NULL;
@@ -448,7 +448,7 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelNNTPStore *store, char *lin
f = strtoul(line, &line, 10);
l = strtoul(line, &line, 10);
if (line[0] == ' ') {
- char *tmp;
+ gchar *tmp;
folder = line+1;
tmp = strchr(folder, ' ');
@@ -470,8 +470,8 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelNNTPStore *store, char *lin
if (cns->low != f) {
count = camel_folder_summary_count(s);
for (i = 0; i < count; i++) {
- char *uid;
- const char *msgid;
+ gchar *uid;
+ const gchar *msgid;
uid = camel_folder_summary_uid_from_index(s, i);
n = strtoul(uid, NULL, 10);
diff --git a/camel/providers/nntp/camel-nntp-summary.h b/camel/providers/nntp/camel-nntp-summary.h
index 9fc9e5821..3a112d211 100644
--- a/camel/providers/nntp/camel-nntp-summary.h
+++ b/camel/providers/nntp/camel-nntp-summary.h
@@ -50,9 +50,9 @@ struct _CamelNNTPSummaryClass {
};
CamelType camel_nntp_summary_get_type (void);
-CamelNNTPSummary *camel_nntp_summary_new(struct _CamelFolder *folder, const char *path);
+CamelNNTPSummary *camel_nntp_summary_new(struct _CamelFolder *folder, const gchar *path);
-int camel_nntp_summary_check(CamelNNTPSummary *cns, struct _CamelNNTPStore *store, char *line, struct _CamelFolderChangeInfo *changes, struct _CamelException *ex);
+gint camel_nntp_summary_check(CamelNNTPSummary *cns, struct _CamelNNTPStore *store, gchar *line, struct _CamelFolderChangeInfo *changes, struct _CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/nntp/camel-nntp-utils.c b/camel/providers/nntp/camel-nntp-utils.c
index 7c6342a19..0e5623c0d 100644
--- a/camel/providers/nntp/camel-nntp-utils.c
+++ b/camel/providers/nntp/camel-nntp-utils.c
@@ -35,9 +35,9 @@
static void
get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
- int first_message, int last_message, CamelException *ex)
+ gint first_message, gint last_message, CamelException *ex)
{
- int status;
+ gint status;
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
guint8 *digest;
gsize length;
@@ -54,7 +54,7 @@ get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
gboolean done = FALSE;
while (!done) {
- char *line;
+ gchar *line;
if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (nntp_store), &line, ex) < 0) {
g_warning ("failed to recv_line while building OVER header list\n");
@@ -68,9 +68,9 @@ get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
else {
CamelMessageInfo *new_info = camel_folder_summary_info_new(folder->summary);
GChecksum *checksum;
- char **split_line = g_strsplit (line, "\t", 7);
- char *subject, *from, *date, *message_id, *bytes;
- char *uid;
+ gchar **split_line = g_strsplit (line, "\t", 7);
+ gchar *subject, *from, *date, *message_id, *bytes;
+ gchar *uid;
subject = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_SUBJECT].index];
from = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_FROM].index];
@@ -131,10 +131,10 @@ get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
#if 0
static GArray*
get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
- int first_message, int last_message, CamelException *ex)
+ gint first_message, gint last_message, CamelException *ex)
{
- int i;
- int status;
+ gint i;
+ gint status;
for (i = first_message; i < last_message; i ++) {
status = camel_nntp_command (nntp_store, ex, NULL,
@@ -142,10 +142,10 @@ get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
if (status == NNTP_HEAD_FOLLOWS) {
gboolean done = FALSE;
- char *buf;
- int buf_len;
- int buf_alloc;
- int h;
+ gchar *buf;
+ gint buf_len;
+ gint buf_alloc;
+ gint h;
CamelStream *header_stream;
GArray *header_array;
CamelStream *nntp_istream;
@@ -161,8 +161,8 @@ get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
nntp_istream = nntp_store->istream;
while (!done) {
- char *line;
- int line_length;
+ gchar *line;
+ gint line_length;
line = camel_stream_buffer_read_line (
CAMEL_STREAM_BUFFER ( nntp_istream ));
@@ -200,7 +200,7 @@ get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
else if (!g_ascii_strcasecmp(header->name, "Subject"))
new_info->subject = g_strdup(header->value);
else if (!g_ascii_strcasecmp(header->name, "Message-ID")) {
- char *uid = g_strdup_printf("%d,%s", i, header->value);
+ gchar *uid = g_strdup_printf("%d,%s", i, header->value);
new_info->uid = camel_pstring_strdup (uid);
g_free (uid);
@@ -227,11 +227,11 @@ get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
#endif
static inline int
-uid_num (CamelFolderSummary *summary, int index)
+uid_num (CamelFolderSummary *summary, gint index)
{
- char *tmp;
- char *brk;
- int ret;
+ gchar *tmp;
+ gchar *brk;
+ gint ret;
tmp = camel_folder_summary_uid_from_index(summary, index);
@@ -254,10 +254,10 @@ camel_nntp_get_headers (CamelStore *store,
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
CamelFolder *folder = CAMEL_FOLDER (nntp_folder);
- char *ret;
- int first_message, nb_message, last_message, last_summary;
- int status;
- int i;
+ gchar *ret;
+ gint first_message, nb_message, last_message, last_summary;
+ gint status;
+ gint i;
status = camel_nntp_command (nntp_store, ex, &ret,
"GROUP %s", folder->name);
diff --git a/camel/providers/nntp/test-newsrc.c b/camel/providers/nntp/test-newsrc.c
index c4b985e56..6f997b634 100644
--- a/camel/providers/nntp/test-newsrc.c
+++ b/camel/providers/nntp/test-newsrc.c
@@ -2,8 +2,8 @@
#include <glib.h>
#include "camel-nntp-newsrc.h"
-int
-main(int argc, char *argv[])
+gint
+main(gint argc, gchar *argv[])
{
CamelNNTPNewsrc *newsrc = camel_nntp_newsrc_read_for_server (argv[1]);
camel_nntp_newsrc_write_to_file (newsrc, stdout);
diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c
index 002faebc0..488587646 100644
--- a/camel/providers/pop3/camel-pop3-engine.c
+++ b/camel/providers/pop3/camel-pop3-engine.c
@@ -41,7 +41,7 @@
#define CAMEL_POP3_SEND_LIMIT (1024)
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
#define dd(x) (camel_verbose_debug?(x):0)
static void get_capabilities(CamelPOP3Engine *pe);
@@ -103,16 +103,16 @@ read_greeting (CamelPOP3Engine *pe)
{
extern CamelServiceAuthType camel_pop3_password_authtype;
extern CamelServiceAuthType camel_pop3_apop_authtype;
- unsigned char *line, *apop, *apopend;
- unsigned int len;
+ guchar *line, *apop, *apopend;
+ guint len;
/* first, read the greeting */
if (camel_pop3_stream_line (pe->stream, &line, &len) == -1
- || strncmp ((char *) line, "+OK", 3) != 0)
+ || strncmp ((gchar *) line, "+OK", 3) != 0)
return -1;
- if ((apop = (unsigned char *) strchr ((char *) line + 3, '<'))
- && (apopend = (unsigned char *) strchr ((char *) apop, '>'))) {
+ if ((apop = (guchar *) strchr ((gchar *) line + 3, '<'))
+ && (apopend = (guchar *) strchr ((gchar *) apop, '>'))) {
apopend[1] = 0;
pe->apop = g_strdup ((gchar *) apop);
pe->capa = CAMEL_POP3_CAP_APOP;
@@ -174,7 +174,7 @@ camel_pop3_engine_reget_capabilities (CamelPOP3Engine *engine)
/* TODO: read implementation too?
etc? */
static struct {
- char *cap;
+ gchar *cap;
guint32 flag;
} capa[] = {
{ "APOP" , CAMEL_POP3_CAP_APOP },
@@ -185,12 +185,12 @@ static struct {
};
static void
-cmd_capa(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
+cmd_capa(CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data)
{
- unsigned char *line, *tok, *next;
- unsigned int len;
- int ret;
- int i;
+ guchar *line, *tok, *next;
+ guint len;
+ gint ret;
+ gint i;
CamelServiceAuthType *auth;
dd(printf("cmd_capa\n"));
@@ -198,14 +198,14 @@ cmd_capa(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
do {
ret = camel_pop3_stream_line(stream, &line, &len);
if (ret >= 0) {
- if (strncmp((char *) line, "SASL ", 5) == 0) {
+ if (strncmp((gchar *) line, "SASL ", 5) == 0) {
tok = line+5;
dd(printf("scanning tokens '%s'\n", tok));
while (tok) {
- next = (unsigned char *) strchr((char *) tok, ' ');
+ next = (guchar *) strchr((gchar *) tok, ' ');
if (next)
*next++ = 0;
- auth = camel_sasl_authtype((const char *) tok);
+ auth = camel_sasl_authtype((const gchar *) tok);
if (auth) {
dd(printf("got auth type '%s'\n", tok));
pe->auth = g_list_prepend(pe->auth, auth);
@@ -216,7 +216,7 @@ cmd_capa(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
}
} else {
for (i=0;i<sizeof(capa)/sizeof(capa[0]);i++) {
- if (strcmp((char *) capa[i].cap, (char *) line) == 0)
+ if (strcmp((gchar *) capa[i].cap, (gchar *) line) == 0)
pe->capa |= capa[i].flag;
}
}
@@ -278,11 +278,11 @@ engine_command_queue(CamelPOP3Engine *pe, CamelPOP3Command *pc)
}
/* returns -1 on error (sets errno), 0 when no work to do, or >0 if work remaining */
-int
+gint
camel_pop3_engine_iterate(CamelPOP3Engine *pe, CamelPOP3Command *pcwait)
{
- unsigned char *p;
- unsigned int len;
+ guchar *p;
+ guint len;
CamelPOP3Command *pc, *pw, *pn;
if (pcwait && pcwait->state >= CAMEL_POP3_COMMAND_OK)
@@ -386,7 +386,7 @@ ioerror:
}
CamelPOP3Command *
-camel_pop3_engine_command_new(CamelPOP3Engine *pe, guint32 flags, CamelPOP3CommandFunc func, void *data, const char *fmt, ...)
+camel_pop3_engine_command_new(CamelPOP3Engine *pe, guint32 flags, CamelPOP3CommandFunc func, gpointer data, const gchar *fmt, ...)
{
CamelPOP3Command *pc;
va_list ap;
diff --git a/camel/providers/pop3/camel-pop3-engine.h b/camel/providers/pop3/camel-pop3-engine.h
index 06a3e480e..d7df9f485 100644
--- a/camel/providers/pop3/camel-pop3-engine.h
+++ b/camel/providers/pop3/camel-pop3-engine.h
@@ -75,7 +75,7 @@ enum {
CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS = 1<<0
};
-typedef void (*CamelPOP3CommandFunc)(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data);
+typedef void (*CamelPOP3CommandFunc)(CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data);
struct _CamelPOP3Command {
struct _CamelPOP3Command *next;
@@ -85,10 +85,10 @@ struct _CamelPOP3Command {
camel_pop3_command_t state;
CamelPOP3CommandFunc func;
- void *func_data;
+ gpointer func_data;
- int data_size;
- char *data;
+ gint data_size;
+ gchar *data;
};
struct _CamelPOP3Engine {
@@ -101,14 +101,14 @@ struct _CamelPOP3Engine {
GList *auth; /* authtypes supported */
guint32 capa; /* capabilities */
- char *apop; /* apop time string */
+ gchar *apop; /* apop time string */
- unsigned char *line; /* current line buffer */
- unsigned int linelen;
+ guchar *line; /* current line buffer */
+ guint linelen;
struct _CamelPOP3Stream *stream;
- unsigned int sentlen; /* data sent (so we dont overflow network buffer) */
+ guint sentlen; /* data sent (so we dont overflow network buffer) */
CamelDList active; /* active commands */
CamelDList queue; /* queue of waiting commands */
@@ -131,7 +131,7 @@ void camel_pop3_engine_command_free(CamelPOP3Engine *pe, CamelPOP3C
int camel_pop3_engine_iterate (CamelPOP3Engine *pe, CamelPOP3Command *pc);
-CamelPOP3Command *camel_pop3_engine_command_new (CamelPOP3Engine *pe, guint32 flags, CamelPOP3CommandFunc func, void *data, const char *fmt, ...);
+CamelPOP3Command *camel_pop3_engine_command_new (CamelPOP3Engine *pe, guint32 flags, CamelPOP3CommandFunc func, gpointer data, const gchar *fmt, ...);
G_END_DECLS
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index 65cad8bc1..ded30b9f1 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -52,9 +52,9 @@ static void pop3_refresh_info (CamelFolder *folder, CamelException *ex);
static void pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
static gint pop3_get_message_count (CamelFolder *folder);
static GPtrArray *pop3_get_uids (CamelFolder *folder);
-static CamelMimeMessage *pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex);
-static gboolean pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
-static char* pop3_get_filename (CamelFolder *folder, const char *uid, CamelException *ex);
+static CamelMimeMessage *pop3_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
+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);
static void
camel_pop3_folder_class_init (CamelPOP3FolderClass *camel_pop3_folder_class)
@@ -100,7 +100,7 @@ pop3_finalize (CamelObject *object)
CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (object);
CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
CamelPOP3Store *pop3_store = (CamelPOP3Store *)((CamelFolder *)pop3_folder)->parent_store;
- int i;
+ gint i;
if (pop3_folder->uids) {
for (i=0;i<pop3_folder->uids->len;i++,fi++) {
@@ -141,7 +141,7 @@ camel_pop3_folder_new (CamelStore *parent, CamelException *ex)
/* create a uid from md5 of 'top' output */
static void
-cmd_builduid(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
+cmd_builduid(CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data)
{
GChecksum *checksum;
CamelPOP3FolderInfo *fi = data;
@@ -186,11 +186,11 @@ cmd_builduid(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
}
static void
-cmd_list(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
+cmd_list(CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data)
{
- int ret;
- unsigned int len, id, size;
- unsigned char *line;
+ gint ret;
+ guint len, id, size;
+ guchar *line;
CamelFolder *folder = data;
CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store);
CamelPOP3FolderInfo *fi;
@@ -198,7 +198,7 @@ cmd_list(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
do {
ret = camel_pop3_stream_line(stream, &line, &len);
if (ret>=0) {
- if (sscanf((char *) line, "%u %u", &id, &size) == 2) {
+ if (sscanf((gchar *) line, "%u %u", &id, &size) == 2) {
fi = g_malloc0(sizeof(*fi));
fi->size = size;
fi->id = id;
@@ -213,22 +213,22 @@ cmd_list(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
}
static void
-cmd_uidl(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
+cmd_uidl(CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data)
{
- int ret;
- unsigned int len;
- unsigned char *line;
- char uid[1025];
- unsigned int id;
+ gint ret;
+ guint len;
+ guchar *line;
+ gchar uid[1025];
+ guint id;
CamelPOP3FolderInfo *fi;
CamelPOP3Folder *folder = data;
do {
ret = camel_pop3_stream_line(stream, &line, &len);
if (ret>=0) {
- if (strlen((char *) line) > 1024)
+ if (strlen((gchar *) line) > 1024)
line[1024] = 0;
- if (sscanf((char *) line, "%u %s", &id, uid) == 2) {
+ if (sscanf((gchar *) line, "%u %s", &id, uid) == 2) {
fi = g_hash_table_lookup(folder->uids_id, GINT_TO_POINTER(id));
if (fi) {
camel_operation_progress(NULL, (fi->index+1) * 100 / folder->uids->len);
@@ -248,7 +248,7 @@ pop3_refresh_info (CamelFolder *folder, CamelException *ex)
CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store);
CamelPOP3Folder *pop3_folder = (CamelPOP3Folder *) folder;
CamelPOP3Command *pcl, *pcu = NULL;
- int i;
+ gint i;
camel_operation_start (NULL, _("Retrieving POP summary"));
@@ -302,7 +302,7 @@ pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
{
CamelPOP3Folder *pop3_folder;
CamelPOP3Store *pop3_store;
- int i;
+ gint i;
CamelPOP3FolderInfo *fi;
pop3_folder = CAMEL_POP3_FOLDER (folder);
@@ -363,11 +363,11 @@ pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
}
static gboolean
-pop3_get_message_time_from_cache (CamelFolder *folder, const char *uid, time_t *message_time)
+pop3_get_message_time_from_cache (CamelFolder *folder, const gchar *uid, time_t *message_time)
{
CamelPOP3Store *pop3_store;
CamelStream *stream = NULL;
- char buffer[1];
+ gchar buffer[1];
gboolean res = FALSE;
g_return_val_if_fail (folder != NULL, FALSE);
@@ -404,12 +404,12 @@ pop3_get_message_time_from_cache (CamelFolder *folder, const char *uid, time_t *
return res;
}
-int
-camel_pop3_delete_old(CamelFolder *folder, int days_to_delete, CamelException *ex)
+gint
+camel_pop3_delete_old(CamelFolder *folder, gint days_to_delete, CamelException *ex)
{
CamelPOP3Folder *pop3_folder;
CamelPOP3FolderInfo *fi;
- int i;
+ gint i;
CamelPOP3Store *pop3_store;
time_t temp, message_time;
@@ -424,7 +424,7 @@ camel_pop3_delete_old(CamelFolder *folder, int days_to_delete, CamelException *e
d(printf("%s(%d): fi->uid=[%s]\n", __FILE__, __LINE__, fi->uid));
if (pop3_get_message_time_from_cache (folder, fi->uid, &message_time)) {
double time_diff = difftime(temp,message_time);
- int day_lag = time_diff/(60*60*24);
+ gint day_lag = time_diff/(60*60*24);
d(printf("%s(%d): message_time= [%ld]\n", __FILE__, __LINE__, message_time));
d(printf("%s(%d): day_lag=[%d] \t days_to_delete=[%d]\n",
@@ -475,11 +475,11 @@ camel_pop3_delete_old(CamelFolder *folder, int days_to_delete, CamelException *e
}
static void
-cmd_tocache(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
+cmd_tocache(CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data)
{
CamelPOP3FolderInfo *fi = data;
- char buffer[2048];
- int w = 0, n;
+ gchar buffer[2048];
+ gint w = 0, n;
/* What if it fails? */
@@ -517,8 +517,8 @@ done:
fi->stream = NULL;
}
-static char*
-pop3_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
+static gchar *
+pop3_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelPOP3Folder *pop3_folder = (CamelPOP3Folder *)folder;
CamelPOP3Store *pop3_store = (CamelPOP3Store *)((CamelFolder *)pop3_folder)->parent_store;
@@ -535,15 +535,15 @@ pop3_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
}
static CamelMimeMessage *
-pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+pop3_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelMimeMessage *message = NULL;
CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store);
CamelPOP3Folder *pop3_folder = (CamelPOP3Folder *)folder;
CamelPOP3Command *pcr;
CamelPOP3FolderInfo *fi;
- char buffer[1];
- int i, last;
+ gchar buffer[1];
+ gint i, last;
CamelStream *stream = NULL;
fi = g_hash_table_lookup(pop3_folder->uids_uid, uid);
@@ -671,7 +671,7 @@ fail:
}
static gboolean
-pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
+pop3_set_message_flags (CamelFolder *folder, const gchar *uid, guint32 flags, guint32 set)
{
CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
CamelPOP3FolderInfo *fi;
@@ -704,7 +704,7 @@ pop3_get_uids (CamelFolder *folder)
CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
GPtrArray *uids = g_ptr_array_new();
CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
- int i;
+ gint i;
for (i=0;i<pop3_folder->uids->len;i++,fi++) {
if (fi[0]->uid)
diff --git a/camel/providers/pop3/camel-pop3-folder.h b/camel/providers/pop3/camel-pop3-folder.h
index ff703b1f2..16fde5cfe 100644
--- a/camel/providers/pop3/camel-pop3-folder.h
+++ b/camel/providers/pop3/camel-pop3-folder.h
@@ -40,8 +40,8 @@ typedef struct {
guint32 size;
guint32 flags;
guint32 index; /* index of request */
- char *uid;
- int err;
+ gchar *uid;
+ gint err;
struct _CamelPOP3Command *cmd;
struct _CamelStream *stream;
} CamelPOP3FolderInfo;
@@ -67,7 +67,7 @@ CamelFolder *camel_pop3_folder_new (CamelStore *parent, CamelException *ex);
/* Standard Camel function */
CamelType camel_pop3_folder_get_type (void);
-int camel_pop3_delete_old(CamelFolder *folder, int days_to_delete, CamelException *ex);
+gint camel_pop3_delete_old(CamelFolder *folder, gint days_to_delete, CamelException *ex);
G_END_DECLS
diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c
index 43337142a..379ae529c 100644
--- a/camel/providers/pop3/camel-pop3-provider.c
+++ b/camel/providers/pop3/camel-pop3-provider.c
@@ -112,7 +112,7 @@ camel_provider_module_init(void)
}
static void
-add_hash (guint *hash, char *s)
+add_hash (guint *hash, gchar *s)
{
if (s)
*hash ^= g_str_hash(s);
@@ -132,7 +132,7 @@ pop3_url_hash (gconstpointer key)
}
static gint
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
if (s2 == NULL)
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 7ec1b287e..b4efac5a5 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -68,7 +68,7 @@ static gboolean pop3_connect (CamelService *service, CamelException *ex);
static gboolean pop3_disconnect (CamelService *service, gboolean clean, CamelException *ex);
static GList *query_auth_types (CamelService *service, CamelException *ex);
-static CamelFolder *get_folder (CamelStore *store, const char *folder_name,
+static CamelFolder *get_folder (CamelStore *store, const gchar *folder_name,
guint32 flags, CamelException *ex);
static CamelFolder *get_trash (CamelStore *store, CamelException *ex);
@@ -150,14 +150,14 @@ enum {
#endif
static gboolean
-connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, CamelException *ex)
+connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, CamelException *ex)
{
CamelPOP3Store *store = CAMEL_POP3_STORE (service);
CamelStream *tcp_stream;
CamelPOP3Command *pc;
guint32 flags = 0;
- int clean_quit = TRUE;
- int ret;
+ gint clean_quit = TRUE;
+ gint ret;
const gchar *delete_days;
if (ssl_mode != MODE_CLEAR) {
@@ -283,10 +283,10 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
}
static struct {
- char *value;
- char *serv;
- char *port;
- int mode;
+ gchar *value;
+ gchar *serv;
+ gchar *port;
+ gint mode;
} ssl_options[] = {
{ "", "pop3s", POP3S_PORT, MODE_SSL }, /* really old (1.x) */
{ "always", "pop3s", POP3S_PORT, MODE_SSL },
@@ -299,10 +299,10 @@ static gboolean
connect_to_server_wrapper (CamelService *service, CamelException *ex)
{
struct addrinfo hints, *ai;
- const char *ssl_mode;
- int mode, ret, i;
- char *serv;
- const char *port;
+ const gchar *ssl_mode;
+ gint mode, ret, i;
+ gchar *serv;
+ const gchar *port;
if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
for (i = 0; ssl_options[i].value; i++)
@@ -390,13 +390,13 @@ camel_pop3_store_expunge (CamelPOP3Store *store, CamelException *ex)
}
static int
-try_sasl(CamelPOP3Store *store, const char *mech, CamelException *ex)
+try_sasl(CamelPOP3Store *store, const gchar *mech, CamelException *ex)
{
CamelPOP3Stream *stream = store->engine->stream;
- unsigned char *line, *resp;
+ guchar *line, *resp;
CamelSasl *sasl;
- unsigned int len;
- int ret;
+ guint len;
+ gint ret;
sasl = camel_sasl_new("pop", mech, (CamelService *)store);
if (sasl == NULL) {
@@ -413,9 +413,9 @@ try_sasl(CamelPOP3Store *store, const char *mech, CamelException *ex)
while (1) {
if (camel_pop3_stream_line(stream, &line, &len) == -1)
goto ioerror;
- if (strncmp((char *) line, "+OK", 3) == 0)
+ if (strncmp((gchar *) line, "+OK", 3) == 0)
break;
- if (strncmp((char *) line, "-ERR", 4) == 0) {
+ if (strncmp((gchar *) line, "-ERR", 4) == 0) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
_("SASL '%s' Login failed for POP server %s: %s"),
mech, CAMEL_SERVICE (store)->url->host, line);
@@ -423,9 +423,9 @@ try_sasl(CamelPOP3Store *store, const char *mech, CamelException *ex)
}
/* If we dont get continuation, or the sasl object's run out of work, or we dont get a challenge,
its a protocol error, so fail, and try reset the server */
- if (strncmp((char *) line, "+ ", 2) != 0
+ if (strncmp((gchar *) line, "+ ", 2) != 0
|| camel_sasl_authenticated(sasl)
- || (resp = (unsigned char *) camel_sasl_challenge_base64(sasl, (const char *) line+2, ex)) == NULL) {
+ || (resp = (guchar *) camel_sasl_challenge_base64(sasl, (const gchar *) line+2, ex)) == NULL) {
camel_stream_printf((CamelStream *)stream, "*\r\n");
camel_pop3_stream_line(stream, &line, &len);
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
@@ -457,19 +457,19 @@ try_sasl(CamelPOP3Store *store, const char *mech, CamelException *ex)
}
static int
-pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *errmsg, CamelException *ex)
+pop3_try_authenticate (CamelService *service, gboolean reprompt, const gchar *errmsg, CamelException *ex)
{
CamelPOP3Store *store = (CamelPOP3Store *)service;
CamelPOP3Command *pcu = NULL, *pcp = NULL;
- int status;
+ gint status;
/* override, testing only */
/*printf("Forcing authmech to 'login'\n");
service->url->authmech = g_strdup("LOGIN");*/
if (!service->url->passwd) {
- char *base_prompt;
- char *full_prompt;
+ gchar *base_prompt;
+ gchar *full_prompt;
guint32 flags = CAMEL_SESSION_PASSWORD_SECRET;
if (reprompt)
@@ -498,7 +498,7 @@ pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *err
pcu = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "USER %s\r\n", service->url->user);
pcp = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "PASS %s\r\n", service->url->passwd);
} else if (strcmp(service->url->authmech, "+APOP") == 0 && store->engine->apop) {
- char *secret, *md5asc, *d;
+ gchar *secret, *md5asc, *d;
d = store->engine->apop;
@@ -558,13 +558,13 @@ pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *err
_("Unable to connect to POP server %s.\n"
"Error sending username: %s"),
CAMEL_SERVICE (store)->url->host,
- store->engine->line ? (char *)store->engine->line : _("Unknown error"));
+ store->engine->line ? (gchar *)store->engine->line : _("Unknown error"));
} else if (pcp->state != CAMEL_POP3_COMMAND_OK) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
_("Unable to connect to POP server %s.\n"
"Error sending password: %s"),
CAMEL_SERVICE (store)->url->host,
- store->engine->line ? (char *)store->engine->line : _("Unknown error"));
+ store->engine->line ? (gchar *)store->engine->line : _("Unknown error"));
}
camel_pop3_engine_command_free (store->engine, pcp);
@@ -581,13 +581,13 @@ pop3_connect (CamelService *service, CamelException *ex)
CamelPOP3Store *store = (CamelPOP3Store *)service;
gboolean reprompt = FALSE;
CamelSession *session;
- char *errbuf = NULL;
- int status;
+ gchar *errbuf = NULL;
+ gint status;
session = camel_service_get_session (service);
if (store->cache == NULL) {
- char *root;
+ gchar *root;
root = camel_session_get_storage_path (session, service, ex);
if (root) {
@@ -611,7 +611,7 @@ pop3_connect (CamelService *service, CamelException *ex)
/* we only re-prompt if we failed to authenticate, any other error and we just abort */
if (status == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE) {
- char *tmp = camel_utf8_make_valid (camel_exception_get_description (ex));
+ gchar *tmp = camel_utf8_make_valid (camel_exception_get_description (ex));
errbuf = g_markup_printf_escaped ("%s\n\n", tmp);
g_free (tmp);
camel_exception_clear (ex);
@@ -664,7 +664,7 @@ pop3_disconnect (CamelService *service, gboolean clean, CamelException *ex)
}
static CamelFolder *
-get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
if (g_ascii_strcasecmp (folder_name, "inbox") != 0) {
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
diff --git a/camel/providers/pop3/camel-pop3-store.h b/camel/providers/pop3/camel-pop3-store.h
index e57999d26..d709666ea 100644
--- a/camel/providers/pop3/camel-pop3-store.h
+++ b/camel/providers/pop3/camel-pop3-store.h
@@ -61,8 +61,8 @@ void camel_pop3_store_expunge (CamelPOP3Store *store, CamelException *ex);
/* support functions */
enum { CAMEL_POP3_OK, CAMEL_POP3_ERR, CAMEL_POP3_FAIL };
-int camel_pop3_command (CamelPOP3Store *store, char **ret, CamelException *ex, char *fmt, ...);
-char *camel_pop3_command_get_additional_data (CamelPOP3Store *store, int total, CamelException *ex);
+gint camel_pop3_command (CamelPOP3Store *store, gchar **ret, CamelException *ex, gchar *fmt, ...);
+gchar *camel_pop3_command_get_additional_data (CamelPOP3Store *store, gint total, CamelException *ex);
/* Standard Camel function */
CamelType camel_pop3_store_get_type (void);
diff --git a/camel/providers/pop3/camel-pop3-stream.c b/camel/providers/pop3/camel-pop3-stream.c
index 7e1e6bd95..6fcd53067 100644
--- a/camel/providers/pop3/camel-pop3-stream.c
+++ b/camel/providers/pop3/camel-pop3-stream.c
@@ -36,7 +36,7 @@
#include "camel-pop3-stream.h"
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
#define dd(x) (camel_verbose_debug?(x):0)
static CamelObjectClass *parent_class = NULL;
@@ -50,14 +50,14 @@ static CamelObjectClass *parent_class = NULL;
static int
stream_fill(CamelPOP3Stream *is)
{
- int left = 0;
+ gint left = 0;
if (is->source) {
left = is->end - is->ptr;
memmove(is->buf, is->ptr, left);
is->end = is->buf + left;
is->ptr = is->buf;
- left = camel_stream_read(is->source, (char *) is->end, CAMEL_POP3_STREAM_SIZE - (is->end - is->buf));
+ left = camel_stream_read(is->source, (gchar *) is->end, CAMEL_POP3_STREAM_SIZE - (is->end - is->buf));
if (left > 0) {
is->end += left;
is->end[0] = '\n';
@@ -72,12 +72,12 @@ stream_fill(CamelPOP3Stream *is)
}
static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
+stream_read(CamelStream *stream, gchar *buffer, size_t n)
{
CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
- char *o, *oe;
- unsigned char *p, *e, c;
- int state;
+ gchar *o, *oe;
+ guchar *p, *e, c;
+ gint state;
if (is->mode != CAMEL_POP3_STREAM_DATA || n == 0)
return 0;
@@ -144,7 +144,7 @@ stream_read(CamelStream *stream, char *buffer, size_t n)
}
static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
+stream_write(CamelStream *stream, const gchar *buffer, size_t n)
{
CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
@@ -265,12 +265,12 @@ camel_pop3_stream_new(CamelStream *source)
}
/* Get one line from the pop3 stream */
-int
-camel_pop3_stream_line(CamelPOP3Stream *is, unsigned char **data, unsigned int *len)
+gint
+camel_pop3_stream_line(CamelPOP3Stream *is, guchar **data, guint *len)
{
- register unsigned char c, *p, *o, *oe;
- int newlen, oldlen;
- unsigned char *e;
+ register guchar c, *p, *o, *oe;
+ gint newlen, oldlen;
+ guchar *e;
if (is->mode == CAMEL_POP3_STREAM_EOD) {
*data = is->linebuf;
@@ -350,10 +350,10 @@ camel_pop3_stream_line(CamelPOP3Stream *is, unsigned char **data, unsigned int *
}
/* returns -1 on error, 0 if last lot of data, >0 if more remaining */
-int camel_pop3_stream_gets(CamelPOP3Stream *is, unsigned char **start, unsigned int *len)
+gint camel_pop3_stream_gets(CamelPOP3Stream *is, guchar **start, guint *len)
{
- int max;
- unsigned char *end;
+ gint max;
+ guchar *end;
*len = 0;
@@ -383,10 +383,10 @@ void camel_pop3_stream_set_mode(CamelPOP3Stream *is, camel_pop3_stream_mode_t mo
}
/* returns -1 on erorr, 0 if last data, >0 if more data left */
-int camel_pop3_stream_getd(CamelPOP3Stream *is, unsigned char **start, unsigned int *len)
+gint camel_pop3_stream_getd(CamelPOP3Stream *is, guchar **start, guint *len)
{
- unsigned char *p, *e, *s;
- int state;
+ guchar *p, *e, *s;
+ gint state;
*len = 0;
diff --git a/camel/providers/pop3/camel-pop3-stream.h b/camel/providers/pop3/camel-pop3-stream.h
index bf90cee8e..104f643b8 100644
--- a/camel/providers/pop3/camel-pop3-stream.h
+++ b/camel/providers/pop3/camel-pop3-stream.h
@@ -47,10 +47,10 @@ struct _CamelPOP3Stream {
CamelStream *source;
camel_pop3_stream_mode_t mode;
- int state;
+ gint state;
- unsigned char *buf, *ptr, *end;
- unsigned char *linebuf, *lineptr, *lineend;
+ guchar *buf, *ptr, *end;
+ guchar *linebuf, *lineptr, *lineend;
};
struct _CamelPOP3StreamClass {
@@ -64,9 +64,9 @@ CamelStream *camel_pop3_stream_new (CamelStream *source);
void camel_pop3_stream_set_mode (CamelPOP3Stream *is, camel_pop3_stream_mode_t mode);
-int camel_pop3_stream_line (CamelPOP3Stream *is, unsigned char **data, unsigned int *len);
-int camel_pop3_stream_gets (CamelPOP3Stream *is, unsigned char **start, unsigned int *len);
-int camel_pop3_stream_getd (CamelPOP3Stream *is, unsigned char **start, unsigned int *len);
+gint camel_pop3_stream_line (CamelPOP3Stream *is, guchar **data, guint *len);
+int camel_pop3_stream_gets (CamelPOP3Stream *is, guchar **start, guint *len);
+int camel_pop3_stream_getd (CamelPOP3Stream *is, guchar **start, guint *len);
G_END_DECLS
diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c
index 2f6a013d6..0e4075cd9 100644
--- a/camel/providers/sendmail/camel-sendmail-transport.c
+++ b/camel/providers/sendmail/camel-sendmail-transport.c
@@ -43,7 +43,7 @@
#include "camel-stream-filter.h"
#include "camel-stream-fs.h"
-static char *get_name (CamelService *service, gboolean brief);
+static gchar *get_name (CamelService *service, gboolean brief);
static gboolean sendmail_send_to (CamelTransport *transport,
CamelMimeMessage *message,
@@ -90,8 +90,8 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
CamelException *ex)
{
struct _camel_header_raw *header, *savedbcc, *n, *tail;
- const char *from_addr, *addr, **argv;
- int i, len, fd[2], nullfd, wstat;
+ const gchar *from_addr, *addr, **argv;
+ gint i, len, fd[2], nullfd, wstat;
CamelStreamFilter *filter;
CamelMimeFilter *crlf;
sigset_t mask, omask;
@@ -102,7 +102,7 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
return FALSE;
len = camel_address_length (recipients);
- argv = g_malloc ((len + 6) * sizeof (char *));
+ argv = g_malloc ((len + 6) * sizeof (gchar *));
argv[0] = "sendmail";
argv[1] = "-i";
argv[2] = "-f";
@@ -185,7 +185,7 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
close (nullfd);
close (fd[1]);
- execv (SENDMAIL_PATH, (char **)argv);
+ execv (SENDMAIL_PATH, (gchar **)argv);
_exit (255);
}
g_free (argv);
@@ -256,7 +256,7 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
return TRUE;
}
-static char *
+static gchar *
get_name (CamelService *service, gboolean brief)
{
if (brief)
diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c
index d130f8be5..8140eb527 100644
--- a/camel/providers/smtp/camel-smtp-provider.c
+++ b/camel/providers/smtp/camel-smtp-provider.c
@@ -67,7 +67,7 @@ camel_provider_module_init(void)
}
static void
-add_hash (guint *hash, char *s)
+add_hash (guint *hash, gchar *s)
{
if (s)
*hash ^= g_str_hash(s);
@@ -87,7 +87,7 @@ smtp_url_hash (gconstpointer key)
}
static gint
-check_equal (char *s1, char *s2)
+check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
if (s2 == NULL)
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index f3e680ffe..e70f7ca98 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -61,7 +61,7 @@
#include "camel-tcp-stream-ssl.h"
#endif
-extern int camel_verbose_debug;
+extern gint camel_verbose_debug;
#define d(x) (camel_verbose_debug ? (x) : 0)
/* Specified in RFC 821 */
@@ -78,21 +78,21 @@ static void smtp_construct (CamelService *service, CamelSession *session,
CamelException *ex);
static gboolean smtp_connect (CamelService *service, CamelException *ex);
static gboolean smtp_disconnect (CamelService *service, gboolean clean, CamelException *ex);
-static GHashTable *esmtp_get_authtypes (const unsigned char *buffer);
+static GHashTable *esmtp_get_authtypes (const guchar *buffer);
static GList *query_auth_types (CamelService *service, CamelException *ex);
-static char *get_name (CamelService *service, gboolean brief);
+static gchar *get_name (CamelService *service, gboolean brief);
static gboolean smtp_helo (CamelSmtpTransport *transport, CamelException *ex);
-static gboolean smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex);
-static gboolean smtp_mail (CamelSmtpTransport *transport, const char *sender,
+static gboolean smtp_auth (CamelSmtpTransport *transport, const gchar *mech, CamelException *ex);
+static gboolean smtp_mail (CamelSmtpTransport *transport, const gchar *sender,
gboolean has_8bit_parts, CamelException *ex);
-static gboolean smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException *ex);
+static gboolean smtp_rcpt (CamelSmtpTransport *transport, const gchar *recipient, CamelException *ex);
static gboolean smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelException *ex);
static gboolean smtp_rset (CamelSmtpTransport *transport, CamelException *ex);
static gboolean smtp_quit (CamelSmtpTransport *transport, CamelException *ex);
-static void smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const char *respbuf,
- const char *message, CamelException *ex);
+static void smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const gchar *respbuf,
+ const gchar *message, CamelException *ex);
/* private data members */
static CamelTransportClass *parent_class = NULL;
@@ -153,8 +153,8 @@ smtp_construct (CamelService *service, CamelSession *session,
CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
}
-static const char *
-smtp_error_string (int error)
+static const gchar *
+smtp_error_string (gint error)
{
/* SMTP error codes grabbed from rfc821 */
switch (error) {
@@ -234,12 +234,12 @@ enum {
#endif
static gboolean
-connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, CamelException *ex)
+connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, CamelException *ex)
{
CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
CamelStream *tcp_stream;
- char *respbuf = NULL;
- int ret;
+ gchar *respbuf = NULL;
+ gint ret;
if (!CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex))
return FALSE;
@@ -396,10 +396,10 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
}
static struct {
- char *value;
- char *serv;
- char *port;
- int mode;
+ gchar *value;
+ gchar *serv;
+ gchar *port;
+ gint mode;
} ssl_options[] = {
{ "", "smtps", SMTPS_PORT, MODE_SSL }, /* really old (1.x) */
{ "always", "smtps", SMTPS_PORT, MODE_SSL },
@@ -412,10 +412,10 @@ static gboolean
connect_to_server_wrapper (CamelService *service, CamelException *ex)
{
struct addrinfo hints, *ai;
- const char *ssl_mode;
- int mode, ret, i;
- char *serv;
- const char *port;
+ const gchar *ssl_mode;
+ gint mode, ret, i;
+ gchar *serv;
+ const gchar *port;
if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
for (i = 0; ssl_options[i].value; i++)
@@ -463,7 +463,7 @@ smtp_connect (CamelService *service, CamelException *ex)
/* We (probably) need to check popb4smtp before we connect ... */
if (service->url->authmech && !strcmp (service->url->authmech, "POPB4SMTP")) {
- int truth;
+ gint truth;
GByteArray *chal;
CamelSasl *sasl;
@@ -490,7 +490,7 @@ smtp_connect (CamelService *service, CamelException *ex)
CamelServiceAuthType *authtype;
gboolean authenticated = FALSE;
guint32 password_flags;
- char *errbuf = NULL;
+ gchar *errbuf = NULL;
if (!g_hash_table_lookup (transport->authtypes, service->url->authmech)) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
@@ -532,8 +532,8 @@ smtp_connect (CamelService *service, CamelException *ex)
}
if (!service->url->passwd) {
- char *base_prompt;
- char *full_prompt;
+ gchar *base_prompt;
+ gchar *full_prompt;
base_prompt = camel_session_build_password_prompt (
"SMTP", service->url->user, service->url->host);
@@ -633,9 +633,9 @@ smtp_disconnect (CamelService *service, gboolean clean, CamelException *ex)
}
static GHashTable *
-esmtp_get_authtypes (const unsigned char *buffer)
+esmtp_get_authtypes (const guchar *buffer)
{
- const unsigned char *start, *end;
+ const guchar *start, *end;
GHashTable *table = NULL;
/* advance to the first token */
@@ -649,14 +649,14 @@ esmtp_get_authtypes (const unsigned char *buffer)
table = g_hash_table_new (g_str_hash, g_str_equal);
for ( ; *start; ) {
- char *type;
+ gchar *type;
/* advance to the end of the token */
end = start;
while (*end && !isspace ((int) *end))
end++;
- type = g_strndup ((gchar*) start, end - start);
+ type = g_strndup ((gchar *) start, end - start);
g_hash_table_insert (table, type, type);
/* advance to the next token */
@@ -694,7 +694,7 @@ query_auth_types (CamelService *service, CamelException *ex)
return types;
}
-static char *
+static gchar *
get_name (CamelService *service, gboolean brief)
{
if (brief)
@@ -713,8 +713,8 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
CamelSmtpTransport *smtp_transport = CAMEL_SMTP_TRANSPORT (transport);
const CamelInternetAddress *cia;
gboolean has_8bit_parts;
- const char *addr;
- int i, len;
+ const gchar *addr;
+ gint i, len;
if (!smtp_transport->connected) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED,
@@ -750,7 +750,7 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
cia = CAMEL_INTERNET_ADDRESS (recipients);
for (i = 0; i < len; i++) {
- char *enc;
+ gchar *enc;
if (!camel_internet_address_get (cia, i, NULL, &addr)) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -782,19 +782,19 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
return TRUE;
}
-static const char *
-smtp_next_token (const char *buf)
+static const gchar *
+smtp_next_token (const gchar *buf)
{
- const unsigned char *token;
+ const guchar *token;
- token = (const unsigned char *) buf;
+ token = (const guchar *) buf;
while (*token && !isspace ((int) *token))
token++;
while (*token && isspace ((int) *token))
token++;
- return (const char *) token;
+ return (const gchar *) token;
}
#define HEXVAL(c) (isdigit (c) ? (c) - '0' : (c) - 'A' + 10)
@@ -821,17 +821,17 @@ smtp_next_token (const char *buf)
* hexchar = ASCII "+" immediately followed by two upper case
* hexadecimal digits
*/
-static char *
-smtp_decode_status_code (const char *in, size_t len)
+static gchar *
+smtp_decode_status_code (const gchar *in, size_t len)
{
- unsigned char *inptr, *outptr;
- const unsigned char *inend;
- char *outbuf;
+ guchar *inptr, *outptr;
+ const guchar *inend;
+ gchar *outbuf;
- outbuf = (char *) g_malloc (len + 1);
- outptr = (unsigned char *) outbuf;
+ outbuf = (gchar *) g_malloc (len + 1);
+ outptr = (guchar *) outbuf;
- inptr = (unsigned char *) in;
+ inptr = (guchar *) in;
inend = inptr + len;
while (inptr < inend) {
if (*inptr == '+') {
@@ -858,12 +858,12 @@ smtp_decode_status_code (const char *in, size_t len)
static void
convert_to_local (GString *str)
{
- char *buf;
+ gchar *buf;
buf = g_locale_from_utf8 (str->str, str->len, NULL, NULL, NULL);
if (!buf) {
- int i;
+ gint i;
gchar c;
GString *s = g_string_new_len (str->str, str->len);
@@ -888,12 +888,12 @@ convert_to_local (GString *str)
}
static void
-smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const char *respbuf, const char *message, CamelException *ex)
+smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const gchar *respbuf, const gchar *message, CamelException *ex)
{
- const char *token, *rbuf = respbuf;
- char *buffer = NULL;
+ const gchar *token, *rbuf = respbuf;
+ gchar *buffer = NULL;
GString *string;
- int error;
+ gint error;
if (!respbuf) {
fake_status_code:
@@ -966,8 +966,8 @@ smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const ch
static gboolean
smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
{
- char *name = NULL, *cmdbuf = NULL, *respbuf = NULL;
- const char *token, *numeric = NULL;
+ gchar *name = NULL, *cmdbuf = NULL, *respbuf = NULL;
+ const gchar *token, *numeric = NULL;
struct sockaddr *addr;
socklen_t addrlen;
@@ -1069,7 +1069,7 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
g_hash_table_destroy (transport->authtypes);
}
- transport->authtypes = esmtp_get_authtypes ((const unsigned char *) token);
+ transport->authtypes = esmtp_get_authtypes ((const guchar *) token);
}
}
}
@@ -1082,10 +1082,10 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
}
static gboolean
-smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
+smtp_auth (CamelSmtpTransport *transport, const gchar *mech, CamelException *ex)
{
CamelService *service;
- char *cmdbuf, *respbuf = NULL, *challenge;
+ gchar *cmdbuf, *respbuf = NULL, *challenge;
gboolean auth_challenge = FALSE;
CamelSasl *sasl = NULL;
@@ -1213,10 +1213,10 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
}
static gboolean
-smtp_mail (CamelSmtpTransport *transport, const char *sender, gboolean has_8bit_parts, CamelException *ex)
+smtp_mail (CamelSmtpTransport *transport, const gchar *sender, gboolean has_8bit_parts, CamelException *ex)
{
/* we gotta tell the smtp server who we are. (our email addy) */
- char *cmdbuf, *respbuf = NULL;
+ gchar *cmdbuf, *respbuf = NULL;
if (transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME && has_8bit_parts)
cmdbuf = g_strdup_printf ("MAIL FROM:<%s> BODY=8BITMIME\r\n", sender);
@@ -1256,11 +1256,11 @@ smtp_mail (CamelSmtpTransport *transport, const char *sender, gboolean has_8bit_
}
static gboolean
-smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException *ex)
+smtp_rcpt (CamelSmtpTransport *transport, const gchar *recipient, CamelException *ex)
{
/* we gotta tell the smtp server who we are going to be sending
* our email to */
- char *cmdbuf, *respbuf = NULL;
+ gchar *cmdbuf, *respbuf = NULL;
cmdbuf = g_strdup_printf ("RCPT TO:<%s>\r\n", recipient);
@@ -1286,7 +1286,7 @@ smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException
d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
if (!respbuf || strncmp (respbuf, "250", 3)) {
- char *message;
+ gchar *message;
message = g_strdup_printf (_("RCPT TO <%s> failed"), recipient);
smtp_set_exception (transport, TRUE, respbuf, message, ex);
@@ -1306,10 +1306,10 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
struct _camel_header_raw *header, *savedbcc, *n, *tail;
CamelBestencEncoding enctype = CAMEL_BESTENC_8BIT;
CamelStreamFilter *filtered_stream;
- char *cmdbuf, *respbuf = NULL;
+ gchar *cmdbuf, *respbuf = NULL;
CamelMimeFilter *filter;
CamelStreamNull *null;
- int ret;
+ gint ret;
/* If the server doesn't support 8BITMIME, set our required encoding to be 7bit */
if (!(transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME))
@@ -1446,7 +1446,7 @@ static gboolean
smtp_rset (CamelSmtpTransport *transport, CamelException *ex)
{
/* we are going to reset the smtp server (just to be nice) */
- char *cmdbuf, *respbuf = NULL;
+ gchar *cmdbuf, *respbuf = NULL;
cmdbuf = g_strdup ("RSET\r\n");
@@ -1485,7 +1485,7 @@ static gboolean
smtp_quit (CamelSmtpTransport *transport, CamelException *ex)
{
/* we are going to reset the smtp server (just to be nice) */
- char *cmdbuf, *respbuf = NULL;
+ gchar *cmdbuf, *respbuf = NULL;
cmdbuf = g_strdup ("QUIT\r\n");
diff --git a/camel/tests/folder/test1.c b/camel/tests/folder/test1.c
index 1f2d33b4c..639b1c0a4 100644
--- a/camel/tests/folder/test1.c
+++ b/camel/tests/folder/test1.c
@@ -11,22 +11,22 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *local_drivers[] = {
+static const gchar *local_drivers[] = {
"local"
};
-static char *local_providers[] = {
+static gchar *local_providers[] = {
"mbox",
"mh",
"maildir"
};
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelException *ex;
- int i;
- char *path;
+ gint i;
+ gchar *path;
camel_test_init(argc, argv);
camel_test_provider_init(1, local_drivers);
diff --git a/camel/tests/folder/test10.c b/camel/tests/folder/test10.c
index 29af44c06..493adab6c 100644
--- a/camel/tests/folder/test10.c
+++ b/camel/tests/folder/test10.c
@@ -20,21 +20,21 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *local_drivers[] = { "local" };
-static char *local_providers[] = {
+static const gchar *local_drivers[] = { "local" };
+static gchar *local_providers[] = {
"mbox",
"mh",
"maildir"
};
-static char *path;
+static gchar *path;
static CamelSession *session;
-static int testid;
+static gint testid;
-static void *
-worker(void *d)
+static gpointer
+worker(gpointer d)
{
- int i;
+ gint i;
CamelException *ex = camel_exception_new();
CamelStore *store;
CamelFolder *folder;
@@ -58,10 +58,10 @@ worker(void *d)
return NULL;
}
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelException *ex;
- int i, j;
+ gint i, j;
pthread_t threads[MAX_THREADS];
camel_test_init(argc, argv);
diff --git a/camel/tests/folder/test11.c b/camel/tests/folder/test11.c
index 46088d8ef..39ba8159a 100644
--- a/camel/tests/folder/test11.c
+++ b/camel/tests/folder/test11.c
@@ -19,7 +19,7 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *local_drivers[] = { "local" };
+static const gchar *local_drivers[] = { "local" };
static CamelSession *session;
@@ -48,7 +48,7 @@ static CamelFolderInfo fi_list_3[] = {
};
static int
-cmp_fi(const void *a, const void *b)
+cmp_fi(gconstpointer a, gconstpointer b)
{
const CamelFolderInfo *fa = ((const CamelFolderInfo **)a)[0];
const CamelFolderInfo *fb = ((const CamelFolderInfo **)b)[0];
@@ -68,10 +68,10 @@ add_fi(GPtrArray *folders, CamelFolderInfo *fi)
}
static void
-check_fi(CamelFolderInfo *fi, CamelFolderInfo *list, int len)
+check_fi(CamelFolderInfo *fi, CamelFolderInfo *list, gint len)
{
GPtrArray *folders = g_ptr_array_new();
- int i;
+ gint i;
add_fi(folders, fi);
check_msg(folders->len == len, "unexpected number of folders returned from folderinfo");
@@ -99,7 +99,7 @@ check_fi(CamelFolderInfo *fi, CamelFolderInfo *list, int len)
g_ptr_array_free(folders, TRUE);
}
-int main(int argc, char **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 78b755f85..dd265dcec 100644
--- a/camel/tests/folder/test2.c
+++ b/camel/tests/folder/test2.c
@@ -20,19 +20,19 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *local_drivers[] = { "local" };
+static const gchar *local_drivers[] = { "local" };
-static char *stores[] = {
+static gchar *stores[] = {
"mbox:///tmp/camel-test/mbox",
"mh:///tmp/camel-test/mh",
"maildir:///tmp/camel-test/maildir"
};
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelException *ex;
- int i;
+ gint i;
camel_test_init(argc, argv);
camel_test_provider_init(1, local_drivers);
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
/* we iterate over all stores we want to test, with indexing or indexing turned on or off */
for (i=0;i<ARRAY_LEN(stores);i++) {
- char *name = stores[i];
+ gchar *name = stores[i];
test_folder_message_ops(session, name, TRUE, "testbox");
}
diff --git a/camel/tests/folder/test3.c b/camel/tests/folder/test3.c
index 99b1f79cc..e3bc7aae5 100644
--- a/camel/tests/folder/test3.c
+++ b/camel/tests/folder/test3.c
@@ -19,12 +19,12 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
static void
-test_folder_search_sub(CamelFolder *folder, const char *expr, int expected)
+test_folder_search_sub(CamelFolder *folder, const gchar *expr, gint expected)
{
CamelException *ex = camel_exception_new();
GPtrArray *uids;
GHashTable *hash;
- int i;
+ gint i;
uids = camel_folder_search_by_expression(folder, expr, ex);
check(uids != NULL);
@@ -45,9 +45,9 @@ test_folder_search_sub(CamelFolder *folder, const char *expr, int expected)
}
static void
-test_folder_search(CamelFolder *folder, const char *expr, int expected)
+test_folder_search(CamelFolder *folder, const gchar *expr, gint expected)
{
- char *matchall;
+ gchar *matchall;
#if 0
/* FIXME: ??? */
@@ -66,8 +66,8 @@ test_folder_search(CamelFolder *folder, const char *expr, int expected)
}
static struct {
- int counts[3];
- char *expr;
+ gint counts[3];
+ gchar *expr;
} searches[] = {
{ { 1, 1, 0 }, "(header-matches \"subject\" \"Test1 message99 subject\")" },
@@ -117,9 +117,9 @@ static struct {
};
static void
-run_search(CamelFolder *folder, int m)
+run_search(CamelFolder *folder, gint m)
{
- int i, j = 0;
+ gint i, j = 0;
check(m == 50 || m == 100 || m == 0);
@@ -138,23 +138,23 @@ run_search(CamelFolder *folder, int m)
pull();
}
-static const char *local_drivers[] = { "local" };
+static const gchar *local_drivers[] = { "local" };
-static char *stores[] = {
+static gchar *stores[] = {
"mbox:///tmp/camel-test/mbox",
"mh:///tmp/camel-test/mh",
"maildir:///tmp/camel-test/maildir"
};
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelStore *store;
CamelException *ex;
CamelFolder *folder;
CamelMimeMessage *msg;
- int i, j;
- int indexed;
+ gint i, j;
+ gint indexed;
GPtrArray *uids;
camel_test_init(argc, argv);
@@ -172,10 +172,10 @@ int main(int argc, char **argv)
/* we iterate over all stores we want to test, with indexing or indexing turned on or off */
for (i=0;i<ARRAY_LEN(stores);i++) {
- char *name = stores[i];
+ gchar *name = stores[i];
for (indexed = 0;indexed<2;indexed++) {
- char *what = g_strdup_printf("folder search: %s (%sindexed)", name, indexed?"":"non-");
- int flags;
+ gchar *what = g_strdup_printf("folder search: %s (%sindexed)", name, indexed?"":"non-");
+ gint flags;
camel_test_start(what);
test_free(what);
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
/* append a bunch of messages with specific content */
push("appending 100 test messages");
for (j=0;j<100;j++) {
- char *content, *subject;
+ gchar *content, *subject;
push("creating test message");
msg = test_message_create_simple();
@@ -231,7 +231,7 @@ int main(int argc, char **argv)
uids = camel_folder_get_uids(folder);
check(uids->len == 100);
for (j=0;j<100;j++) {
- char *uid = uids->pdata[j];
+ gchar *uid = uids->pdata[j];
if ((j/13)*13 == j) {
camel_folder_set_message_user_flag(folder, uid, "every13", TRUE);
@@ -240,7 +240,7 @@ int main(int argc, char **argv)
camel_folder_set_message_user_flag(folder, uid, "every17", TRUE);
}
if ((j/7)*7 == j) {
- char *tag = g_strdup_printf("7tag%d", j/7);
+ gchar *tag = g_strdup_printf("7tag%d", j/7);
camel_folder_set_message_user_tag(folder, uid, "every7", tag);
test_free(tag);
}
diff --git a/camel/tests/folder/test4.c b/camel/tests/folder/test4.c
index 94f1fd852..11072a5c7 100644
--- a/camel/tests/folder/test4.c
+++ b/camel/tests/folder/test4.c
@@ -11,18 +11,18 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *imap_drivers[] = { "imap4" };
+static const gchar *imap_drivers[] = { "imap4" };
-static char *remote_providers[] = {
+static gchar *remote_providers[] = {
"IMAP_TEST_URL",
};
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelException *ex;
- int i;
- char *path;
+ gint i;
+ gchar *path;
camel_test_init(argc, argv);
camel_test_provider_init(1, imap_drivers);
diff --git a/camel/tests/folder/test5.c b/camel/tests/folder/test5.c
index da0994713..16b786a15 100644
--- a/camel/tests/folder/test5.c
+++ b/camel/tests/folder/test5.c
@@ -11,18 +11,18 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *nntp_drivers[] = { "nntp" };
+static const gchar *nntp_drivers[] = { "nntp" };
-static char *remote_providers[] = {
+static gchar *remote_providers[] = {
"NNTP_TEST_URL",
};
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelException *ex;
- int i;
- char *path;
+ gint i;
+ gchar *path;
camel_test_init(argc, argv);
camel_test_provider_init(1, nntp_drivers);
diff --git a/camel/tests/folder/test6.c b/camel/tests/folder/test6.c
index 8dd1b19fe..84c8b4816 100644
--- a/camel/tests/folder/test6.c
+++ b/camel/tests/folder/test6.c
@@ -15,17 +15,17 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *imap_drivers[] = { "imap4" };
-static char *remote_providers[] = {
+static const gchar *imap_drivers[] = { "imap4" };
+static gchar *remote_providers[] = {
"IMAP_TEST_URL",
};
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelException *ex;
- int i;
- char *path;
+ gint i;
+ gchar *path;
camel_test_init(argc, argv);
camel_test_provider_init(1, imap_drivers);
diff --git a/camel/tests/folder/test7.c b/camel/tests/folder/test7.c
index dc45bc1b4..cd8851710 100644
--- a/camel/tests/folder/test7.c
+++ b/camel/tests/folder/test7.c
@@ -16,17 +16,17 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *nntp_drivers[] = { "nntp" };
-static char *remote_providers[] = {
+static const gchar *nntp_drivers[] = { "nntp" };
+static gchar *remote_providers[] = {
"NNTP_TEST_URL",
};
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelException *ex;
- int i;
- char *path;
+ gint i;
+ gchar *path;
camel_test_init(argc, argv);
camel_test_provider_init(1, nntp_drivers);
diff --git a/camel/tests/folder/test8.c b/camel/tests/folder/test8.c
index b2bc105e7..a42cbacb5 100644
--- a/camel/tests/folder/test8.c
+++ b/camel/tests/folder/test8.c
@@ -20,20 +20,20 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *local_drivers[] = { "local" };
+static const gchar *local_drivers[] = { "local" };
-static char *local_providers[] = {
+static gchar *local_providers[] = {
"mbox",
"mh",
"maildir"
};
static void
-test_add_message(CamelFolder *folder, int j)
+test_add_message(CamelFolder *folder, gint j)
{
CamelMimeMessage *msg;
- char *content;
- char *subject;
+ gchar *content;
+ gchar *subject;
CamelException ex;
camel_exception_init(&ex);
@@ -57,16 +57,16 @@ test_add_message(CamelFolder *folder, int j)
}
struct _threadinfo {
- int id;
+ gint id;
CamelFolder *folder;
};
-static void *
-worker(void *d)
+static gpointer
+worker(gpointer d)
{
struct _threadinfo *info = d;
- int i, j, id = info->id;
- char *sub, *content;
+ gint i, j, id = info->id;
+ gchar *sub, *content;
GPtrArray *res;
CamelException *ex = camel_exception_new();
CamelMimeMessage *msg;
@@ -86,7 +86,7 @@ worker(void *d)
pull();
push("getting message '%s'", res->pdata[0]);
- msg = camel_folder_get_message(info->folder, (char *)res->pdata[0], ex);
+ msg = camel_folder_get_message(info->folder, (gchar *)res->pdata[0], ex);
check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
pull();
@@ -125,12 +125,12 @@ worker(void *d)
return info;
}
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelException *ex;
- int i, j, index;
- char *path;
+ gint i, j, index;
+ gchar *path;
CamelStore *store;
pthread_t threads[MAX_THREADS];
struct _threadinfo *info;
@@ -174,7 +174,7 @@ int main(int argc, char **argv)
}
for (i=0;i<MAX_THREADS;i++) {
- pthread_join(threads[i], (void **)&info);
+ pthread_join(threads[i], (gpointer *)&info);
g_free(info);
}
pull();
diff --git a/camel/tests/folder/test9.c b/camel/tests/folder/test9.c
index d1e2d6d7f..f945e3076 100644
--- a/camel/tests/folder/test9.c
+++ b/camel/tests/folder/test9.c
@@ -20,10 +20,10 @@
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-static const char *local_drivers[] = { "local" };
+static const gchar *local_drivers[] = { "local" };
struct {
- char *name;
+ gchar *name;
CamelFolder *folder;
} mailboxes[] = {
{ "INBOX", NULL },
@@ -34,7 +34,7 @@ struct {
};
struct {
- char *name, *match, *action;
+ gchar *name, *match, *action;
} rules[] = {
{ "empty1", "(match-all (header-contains \"Frobnitz\"))", "(copy-to \"folder1\")" },
{ "empty2", "(header-contains \"Frobnitz\")", "(copy-to \"folder2\")" },
@@ -49,7 +49,7 @@ struct {
/* broken match rules */
struct {
- char *name, *match, *action;
+ 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 */
@@ -65,7 +65,7 @@ struct {
/* broken action rules */
struct {
- char *name, *match, *action;
+ 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 */
@@ -77,9 +77,9 @@ struct {
{ "a", "(body-contains \"data2\")", "" }, /* empty */
};
-static CamelFolder *get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelException *ex)
+static CamelFolder *get_folder(CamelFilterDriver *d, const gchar *uri, gpointer data, CamelException *ex)
{
- int i;
+ gint i;
for (i=0;i<ARRAY_LEN(mailboxes);i++)
if (!strcmp(mailboxes[i].name, uri)) {
@@ -89,14 +89,14 @@ static CamelFolder *get_folder(CamelFilterDriver *d, const char *uri, void *data
return NULL;
}
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSession *session;
CamelStore *store;
CamelException *ex;
CamelFolder *folder;
CamelMimeMessage *msg;
- int i, j;
+ gint i, j;
CamelStream *mbox;
CamelFilterDriver *driver;
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
push("creating 100 test message mbox");
mbox = camel_stream_fs_new_with_name("/tmp/camel-test/inbox", O_WRONLY|O_CREAT|O_EXCL, 0600);
for (j=0;j<100;j++) {
- char *content, *subject;
+ gchar *content, *subject;
push("creating test message");
msg = test_message_create_simple();
diff --git a/camel/tests/lib/address-data.h b/camel/tests/lib/address-data.h
index acecac596..33d27ab18 100644
--- a/camel/tests/lib/address-data.h
+++ b/camel/tests/lib/address-data.h
@@ -4,9 +4,9 @@
*/
static struct _a {
- int count;
- char *addr;
- char *utf8; /* the utf8 in this table was generated by camel itself. As a result i'm making the assumption it
+ gint count;
+ gchar *addr;
+ gchar *utf8; /* the utf8 in this table was generated by camel itself. As a result i'm making the assumption it
was right when it was created. It also depends on the format of ::format(),. which is likely to
change, to handle other bugs ! */
} test_address[] = {
@@ -50,8 +50,8 @@ static struct _a {
};
static struct _l {
- char *type;
- char *line;
+ gchar *type;
+ gchar *line;
} test_lines[] = {
/* commented out unsupported charsets - FIXME: camel should somehow handle this, although it can't really of course */
/*{ "windows-1251", "Ĺäčí ŕďëĺň íĺ îňăîâŕđ˙ íŕ çŕ˙âęŕ çŕ çŕďčń.\nÄŕ ăî ďđĺěŕőíŕ ëč čëč äŕ ďî÷ŕęŕě?" },*/
diff --git a/camel/tests/lib/addresses.c b/camel/tests/lib/addresses.c
index 0ccae3267..6c2594b76 100644
--- a/camel/tests/lib/addresses.c
+++ b/camel/tests/lib/addresses.c
@@ -8,9 +8,9 @@
void
test_address_compare(CamelInternetAddress *addr, CamelInternetAddress *addr2)
{
- const char *r1, *r2, *a1, *a2;
- char *e1, *e2, *f1, *f2;
- int j;
+ const gchar *r1, *r2, *a1, *a2;
+ gchar *e1, *e2, *f1, *f2;
+ gint j;
check(camel_address_length(CAMEL_ADDRESS(addr)) == camel_address_length(CAMEL_ADDRESS(addr2)));
for (j=0;j<camel_address_length(CAMEL_ADDRESS(addr));j++) {
diff --git a/camel/tests/lib/camel-test-provider.c b/camel/tests/lib/camel-test-provider.c
index 7f166ffd3..03e13f6dc 100644
--- a/camel/tests/lib/camel-test-provider.c
+++ b/camel/tests/lib/camel-test-provider.c
@@ -5,10 +5,10 @@
#include "camel-provider.h"
-void camel_test_provider_init(int argc, char **argv)
+void camel_test_provider_init(gint argc, gchar **argv)
{
- char *name, *path;
- int i;
+ gchar *name, *path;
+ gint i;
CamelException ex = { 0 };
for (i=0;i<argc;i++) {
diff --git a/camel/tests/lib/camel-test-provider.h b/camel/tests/lib/camel-test-provider.h
index 08606cf2f..4958ef6d0 100644
--- a/camel/tests/lib/camel-test-provider.h
+++ b/camel/tests/lib/camel-test-provider.h
@@ -2,6 +2,6 @@
#ifndef _CAMEL_TEST_PROVIDER_H
#define _CAMEL_TEST_PROVIDER_H
-void camel_test_provider_init(int argc, char **argv);
+void camel_test_provider_init(gint argc, gchar **argv);
#endif
diff --git a/camel/tests/lib/camel-test.c b/camel/tests/lib/camel-test.c
index 86935921f..e6157a978 100644
--- a/camel/tests/lib/camel-test.c
+++ b/camel/tests/lib/camel-test.c
@@ -24,28 +24,28 @@ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
#define CAMEL_TEST_UNLOCK pthread_mutex_unlock(&lock)
#define CAMEL_TEST_ID (pthread_self())
-static int setup;
-static int ok;
+static gint setup;
+static gint ok;
struct _stack {
struct _stack *next;
- int fatal;
- char *what;
+ gint fatal;
+ gchar *what;
};
/* per-thread state */
struct _state {
- char *test;
- int nonfatal;
+ gchar *test;
+ gint nonfatal;
struct _stack *state;
};
static GHashTable *info_table;
-int camel_test_verbose;
+gint camel_test_verbose;
static void
-dump_action(int id, struct _state *s, void *d)
+dump_action(gint id, struct _state *s, gpointer d)
{
struct _stack *node;
@@ -62,9 +62,9 @@ dump_action(int id, struct _state *s, void *d)
printf("\tTest: %s\n", s->test);
}
-static void die(int sig)
+static void die(gint sig)
{
- static int indie = 0;
+ static gint indie = 0;
if (!indie) {
indie = 1;
@@ -88,20 +88,20 @@ current_state(void)
if (info_table == NULL)
info_table = g_hash_table_new(0, 0);
- info = g_hash_table_lookup(info_table, (void *)CAMEL_TEST_ID);
+ info = g_hash_table_lookup(info_table, (gpointer)CAMEL_TEST_ID);
if (info == NULL) {
info = g_malloc0(sizeof(*info));
- g_hash_table_insert(info_table, (void *)CAMEL_TEST_ID, info);
+ g_hash_table_insert(info_table, (gpointer)CAMEL_TEST_ID, info);
}
return info;
}
-void camel_test_init(int argc, char **argv)
+void camel_test_init(gint argc, gchar **argv)
{
struct stat st;
- char *path;
- int i;
+ gchar *path;
+ gint i;
setup = 1;
@@ -145,7 +145,7 @@ void camel_test_init(int argc, char **argv)
}
}
-void camel_test_start(const char *what)
+void camel_test_start(const gchar *what)
{
struct _state *s;
@@ -168,11 +168,11 @@ void camel_test_start(const char *what)
CAMEL_TEST_UNLOCK;
}
-void camel_test_push(const char *what, ...)
+void camel_test_push(const gchar *what, ...)
{
struct _stack *node;
va_list ap;
- char *text;
+ gchar *text;
struct _state *s;
CAMEL_TEST_LOCK;
@@ -226,7 +226,7 @@ void camel_test_break(void)
{
}
-void camel_test_fail(const char *why, ...)
+void camel_test_fail(const gchar *why, ...)
{
va_list ap;
@@ -236,9 +236,9 @@ void camel_test_fail(const char *why, ...)
}
-void camel_test_failv(const char *why, va_list ap)
+void camel_test_failv(const gchar *why, va_list ap)
{
- char *text;
+ gchar *text;
struct _state *s;
CAMEL_TEST_LOCK;
@@ -273,11 +273,11 @@ void camel_test_failv(const char *why, va_list ap)
CAMEL_TEST_UNLOCK;
}
-void camel_test_nonfatal(const char *what, ...)
+void camel_test_nonfatal(const gchar *what, ...)
{
struct _stack *node;
va_list ap;
- char *text;
+ gchar *text;
struct _state *s;
CAMEL_TEST_LOCK;
@@ -322,9 +322,9 @@ void camel_test_end(void)
/* compare strings, ignore whitespace though */
-int string_equal(const char *a, const char *b)
+gint string_equal(const gchar *a, const gchar *b)
{
- const char *ap, *bp;
+ const gchar *ap, *bp;
ap = a;
bp = b;
diff --git a/camel/tests/lib/camel-test.h b/camel/tests/lib/camel-test.h
index 986a943fa..8ee6b9bdd 100644
--- a/camel/tests/lib/camel-test.h
+++ b/camel/tests/lib/camel-test.h
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include <glib.h>
-void camel_test_failv(const char *why, va_list ap);
+void camel_test_failv(const gchar *why, va_list ap);
/* perform a check assertion */
#define check(x) do {if (!(x)) { camel_test_fail("%s:%d: %s", __FILE__, __LINE__, #x); } } while (0)
@@ -14,7 +14,7 @@ void camel_test_failv(const char *why, va_list ap);
#ifdef __GNUC__
#define check_msg(x, y, z...) do {if (!(x)) { camel_test_fail("%s:%d: %s\n\t" #y, __FILE__, __LINE__, #x, ##z); } } while (0)
#else
-static void check_msg(int truth, char *fmt, ...)
+static void check_msg(gint truth, gchar *fmt, ...)
{
/* no gcc, we lose the condition that failed, nm */
if (!truth) {
@@ -45,24 +45,24 @@ static void check_msg(int truth, char *fmt, ...)
#define push camel_test_push
#define pull camel_test_pull
-void camel_test_init(int argc, char **argv);
+void camel_test_init(gint argc, gchar **argv);
/* start/finish a new test */
-void camel_test_start(const char *what);
+void camel_test_start(const gchar *what);
void camel_test_end(void);
/* start/finish a new test part */
-void camel_test_push(const char *what, ...);
+void camel_test_push(const gchar *what, ...);
void camel_test_pull(void);
/* fail a test, with a reason why */
-void camel_test_fail(const char *why, ...);
-void camel_test_failv(const char *why, va_list ap);
+void camel_test_fail(const gchar *why, ...);
+void camel_test_failv(const gchar *why, va_list ap);
/* Set whether a failed test quits. May be nested, but must be called in nonfatal/fatal pairs */
-void camel_test_nonfatal(const char *why, ...);
+void camel_test_nonfatal(const gchar *why, ...);
void camel_test_fatal(void);
/* utility functions */
/* compare strings, ignore whitespace though */
-int string_equal(const char *a, const char *b);
+gint string_equal(const gchar *a, const gchar *b);
diff --git a/camel/tests/lib/folders.c b/camel/tests/lib/folders.c
index 641383829..2c7a89c53 100644
--- a/camel/tests/lib/folders.c
+++ b/camel/tests/lib/folders.c
@@ -8,11 +8,11 @@
/* check the total/unread is what we think it should be */
void
-test_folder_counts(CamelFolder *folder, int total, int unread)
+test_folder_counts(CamelFolder *folder, gint total, gint unread)
{
GPtrArray *s;
- int i, myunread;
- int gettotal, getunread;
+ gint i, myunread;
+ gint gettotal, getunread;
CamelMessageInfo *info;
push("test folder counts %d total %d unread", total, unread);
@@ -53,7 +53,7 @@ test_folder_counts(CamelFolder *folder, int total, int unread)
}
static int
-safe_strcmp(const char *a, const char *b)
+safe_strcmp(const gchar *a, const gchar *b)
{
if (a == NULL && b == NULL)
return 0;
@@ -82,14 +82,14 @@ test_message_info(CamelMimeMessage *msg, const CamelMessageInfo *info)
/* check a message is present */
void
-test_folder_message(CamelFolder *folder, const char *uid)
+test_folder_message(CamelFolder *folder, const gchar *uid)
{
CamelMimeMessage *msg;
CamelMessageInfo *info;
GPtrArray *s;
- int i;
+ gint i;
CamelException *ex = camel_exception_new();
- int found;
+ gint found;
push("uid %s is in folder", uid);
@@ -139,14 +139,14 @@ test_folder_message(CamelFolder *folder, const char *uid)
/* check message not present */
void
-test_folder_not_message(CamelFolder *folder, const char *uid)
+test_folder_not_message(CamelFolder *folder, const gchar *uid)
{
CamelMimeMessage *msg;
CamelMessageInfo *info;
GPtrArray *s;
- int i;
+ gint i;
CamelException *ex = camel_exception_new();
- int found;
+ gint found;
push("uid '%s' is not in folder", uid);
@@ -199,12 +199,12 @@ test_folder_not_message(CamelFolder *folder, const char *uid)
/* test basic store operations on folders */
/* TODO: Add subscription stuff */
void
-test_folder_basic(CamelSession *session, const char *storename, int local, int spool)
+test_folder_basic(CamelSession *session, const gchar *storename, gint local, gint spool)
{
CamelStore *store;
CamelException *ex = camel_exception_new();
CamelFolder *folder;
- char *what = g_strdup_printf("testing store: %s", storename);
+ gchar *what = g_strdup_printf("testing store: %s", storename);
camel_test_start(what);
test_free(what);
@@ -322,22 +322,22 @@ test_folder_basic(CamelSession *session, const char *storename, int local, int s
/* todo: cross-check everything with folder_info checks as well */
/* this should probably take a folder instead of a session ... */
void
-test_folder_message_ops(CamelSession *session, const char *name, int local, const char *mailbox)
+test_folder_message_ops(CamelSession *session, const gchar *name, gint local, const gchar *mailbox)
{
CamelStore *store;
CamelException *ex = camel_exception_new();
CamelFolder *folder;
CamelMimeMessage *msg;
- int j;
- int indexed, max;
+ gint j;
+ gint indexed, max;
GPtrArray *uids;
CamelMessageInfo *info;
max=local?2:1;
for (indexed = 0;indexed<max;indexed++) {
- char *what = g_strdup_printf("folder ops: %s %s", name, local?(indexed?"indexed":"non-indexed"):"");
- int flags;
+ gchar *what = g_strdup_printf("folder ops: %s %s", name, local?(indexed?"indexed":"non-indexed"):"");
+ gint flags;
camel_test_start(what);
test_free(what);
@@ -358,7 +358,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons
/* we can't create mailbox outside of namespace, since we have no api for it, try
using inbox namespace, works for courier */
if (folder == NULL) {
- char *mbox = g_strdup_printf("INBOX/%s", mailbox);
+ gchar *mbox = g_strdup_printf("INBOX/%s", mailbox);
mailbox = mbox;
camel_exception_clear(ex);
folder = camel_store_get_folder(store, mailbox, flags, ex);
@@ -373,7 +373,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons
test_folder_not_message(folder, "");
for (j=0;j<10;j++) {
- char *content, *subject;
+ gchar *content, *subject;
push("creating test message");
msg = test_message_create_simple();
@@ -461,7 +461,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons
check(uids != NULL);
check(uids->len == 10);
for (j=0;j<10;j++) {
- char *subject = g_strdup_printf("Test message %d", j);
+ gchar *subject = g_strdup_printf("Test message %d", j);
push("verify reload of %s", subject);
test_folder_message(folder, uids->pdata[j]);
@@ -488,7 +488,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons
check(uids != NULL);
check(uids->len == 9);
for (j=0;j<9;j++) {
- char *subject = g_strdup_printf("Test message %d", j+1);
+ gchar *subject = g_strdup_printf("Test message %d", j+1);
push("verify after expunge of %s", subject);
test_folder_message(folder, uids->pdata[j]);
@@ -517,7 +517,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons
check(uids != NULL);
check(uids->len == 8);
for (j=0;j<8;j++) {
- char *subject = g_strdup_printf("Test message %d", j+1);
+ gchar *subject = g_strdup_printf("Test message %d", j+1);
push("verify after expunge of %s", subject);
test_folder_message(folder, uids->pdata[j]);
diff --git a/camel/tests/lib/folders.h b/camel/tests/lib/folders.h
index ae981611d..de2fb1061 100644
--- a/camel/tests/lib/folders.h
+++ b/camel/tests/lib/folders.h
@@ -7,14 +7,14 @@
#include <camel/camel-mime-message.h>
/* check the total/unread is what we think it should be, everywhere it can be determined */
-void test_folder_counts(CamelFolder *folder, int total, int unread);
+void test_folder_counts(CamelFolder *folder, gint total, gint unread);
/* cross-check info/msg */
void test_message_info(CamelMimeMessage *msg, const CamelMessageInfo *info);
/* check a message is present everywhere it should be */
-void test_folder_message(CamelFolder *folder, const char *uid);
+void test_folder_message(CamelFolder *folder, const gchar *uid);
/* check message not present everywhere it shouldn't be */
-void test_folder_not_message(CamelFolder *folder, const char *uid);
+void test_folder_not_message(CamelFolder *folder, const gchar *uid);
/* test basic folder ops on a store */
-void test_folder_basic(CamelSession *session, const char *storename, int local, int spool);
+void test_folder_basic(CamelSession *session, const gchar *storename, gint local, gint spool);
/* test basic message operations on a folder */
-void test_folder_message_ops(CamelSession *session, const char *storename, int local, const char *foldername);
+void test_folder_message_ops(CamelSession *session, const gchar *storename, gint local, const gchar *foldername);
diff --git a/camel/tests/lib/messages.c b/camel/tests/lib/messages.c
index 98f8113f4..000ebdcda 100644
--- a/camel/tests/lib/messages.c
+++ b/camel/tests/lib/messages.c
@@ -37,13 +37,13 @@ test_message_create_simple(void)
}
static void
-content_finalise(CamelObject *folder, void *crap, void *ba)
+content_finalise(CamelObject *folder, gpointer crap, gpointer ba)
{
g_byte_array_free(ba, TRUE);
}
void
-test_message_set_content_simple(CamelMimePart *part, int how, const char *type, const char *text, int len)
+test_message_set_content_simple(CamelMimePart *part, gint how, const gchar *type, const gchar *text, gint len)
{
CamelStreamMem *content = NULL;
CamelDataWrapper *dw;
@@ -90,11 +90,11 @@ test_message_set_content_simple(CamelMimePart *part, int how, const char *type,
}
}
-int
-test_message_write_file(CamelMimeMessage *msg, const char *name)
+gint
+test_message_write_file(CamelMimeMessage *msg, const gchar *name)
{
CamelStreamFs *file;
- int ret;
+ gint ret;
file = (CamelStreamFs *)camel_stream_fs_new_with_name(name, O_CREAT|O_WRONLY, 0600);
camel_data_wrapper_write_to_stream((CamelDataWrapper *)msg, (CamelStream *)file);
@@ -107,7 +107,7 @@ test_message_write_file(CamelMimeMessage *msg, const char *name)
}
CamelMimeMessage *
-test_message_read_file(const char *name)
+test_message_read_file(const gchar *name)
{
CamelStreamFs *file;
CamelMimeMessage *msg2;
@@ -124,11 +124,11 @@ test_message_read_file(const char *name)
}
static void
-hexdump (const unsigned char *in, int inlen)
+hexdump (const guchar *in, gint inlen)
{
- const unsigned char *inptr = in, *start = inptr;
- const unsigned char *inend = in + inlen;
- int octets;
+ const guchar *inptr = in, *start = inptr;
+ const guchar *inend = in + inlen;
+ gint octets;
while (inptr < inend) {
octets = 0;
@@ -153,8 +153,8 @@ hexdump (const unsigned char *in, int inlen)
}
}
-int
-test_message_compare_content(CamelDataWrapper *dw, const char *text, int len)
+gint
+test_message_compare_content(CamelDataWrapper *dw, const gchar *text, gint len)
{
CamelStreamMem *content;
@@ -182,7 +182,7 @@ test_message_compare_content(CamelDataWrapper *dw, const char *text, int len)
return 0;
}
-int
+gint
test_message_compare (CamelMimeMessage *msg)
{
CamelMimeMessage *msg2;
@@ -228,25 +228,25 @@ test_message_compare (CamelMimeMessage *msg)
return 0;
}
-int
+gint
test_message_compare_header(CamelMimeMessage *m1, CamelMimeMessage *m2)
{
return 0;
}
-int
+gint
test_message_compare_messages(CamelMimeMessage *m1, CamelMimeMessage *m2)
{
return 0;
}
static void
-message_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int depth)
+message_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, gint depth)
{
CamelDataWrapper *containee;
- int parts, i;
- char *s;
- char *mime_type;
+ gint parts, i;
+ gchar *s;
+ gchar *mime_type;
s = alloca(depth+1);
memset(s, ' ', depth);
diff --git a/camel/tests/lib/messages.h b/camel/tests/lib/messages.h
index 24e0407af..6b4d56026 100644
--- a/camel/tests/lib/messages.h
+++ b/camel/tests/lib/messages.h
@@ -6,13 +6,13 @@
/* messages.c */
CamelMimeMessage *test_message_create_simple(void);
-void test_message_set_content_simple(CamelMimePart *part, int how, const char *type, const char *text, int len);
-int test_message_write_file(CamelMimeMessage *msg, const char *name);
-CamelMimeMessage *test_message_read_file(const char *name);
-int test_message_compare_content(CamelDataWrapper *dw, const char *text, int len);
-int test_message_compare (CamelMimeMessage *msg);
+void test_message_set_content_simple(CamelMimePart *part, gint how, const gchar *type, const gchar *text, gint len);
+gint test_message_write_file(CamelMimeMessage *msg, const gchar *name);
+CamelMimeMessage *test_message_read_file(const gchar *name);
+gint test_message_compare_content(CamelDataWrapper *dw, const gchar *text, gint len);
+gint test_message_compare (CamelMimeMessage *msg);
void test_message_dump_structure(CamelMimeMessage *m);
-int test_message_compare_header(CamelMimeMessage *m1, CamelMimeMessage *m2);
-int test_message_compare_messages(CamelMimeMessage *m1, CamelMimeMessage *m2);
+gint test_message_compare_header(CamelMimeMessage *m1, CamelMimeMessage *m2);
+gint test_message_compare_messages(CamelMimeMessage *m1, CamelMimeMessage *m2);
diff --git a/camel/tests/lib/session.c b/camel/tests/lib/session.c
index 29fa0e45f..a3d3d2b95 100644
--- a/camel/tests/lib/session.c
+++ b/camel/tests/lib/session.c
@@ -32,7 +32,7 @@ camel_test_session_get_type (void)
}
CamelSession *
-camel_test_session_new (const char *path)
+camel_test_session_new (const gchar *path)
{
CamelSession *session;
diff --git a/camel/tests/lib/session.h b/camel/tests/lib/session.h
index fdc5b4793..d2943b176 100644
--- a/camel/tests/lib/session.h
+++ b/camel/tests/lib/session.h
@@ -16,4 +16,4 @@ typedef struct _CamelTestSessionClass {
} CamelTestSessionClass;
CamelType camel_test_session_get_type (void);
-CamelSession *camel_test_session_new (const char *path);
+CamelSession *camel_test_session_new (const gchar *path);
diff --git a/camel/tests/lib/streams.c b/camel/tests/lib/streams.c
index d62db5093..19a787da6 100644
--- a/camel/tests/lib/streams.c
+++ b/camel/tests/lib/streams.c
@@ -15,15 +15,15 @@
#include "camel-test.h"
-static char teststring[] = "\xaa\x55\xc0\x0c\xff\x00";
-static char testbuf[10240];
+static gchar teststring[] = "\xaa\x55\xc0\x0c\xff\x00";
+static gchar testbuf[10240];
/* pass in an empty read/write stream */
void
test_stream_seekable_writepart(CamelSeekableStream *s)
{
off_t end;
- int i;
+ gint i;
push("seekable stream test, writing ");
@@ -58,7 +58,7 @@ void
test_stream_seekable_readpart(CamelSeekableStream *s)
{
off_t off, new, end;
- int i, j;
+ gint i, j;
push("seekable stream test, re-reading");
@@ -89,7 +89,7 @@ test_stream_seekable_readpart(CamelSeekableStream *s)
check(camel_stream_read(CAMEL_STREAM(s), testbuf, i*3) == i*3);
for (j=0;j<i*3;j++) {
- int k = new + j;
+ gint k = new + j;
if (k==0) {
check(testbuf[j] == '\n');
@@ -120,12 +120,12 @@ test_stream_seekable_readpart(CamelSeekableStream *s)
1 = write to the parent stream at the right spot
*/
void
-test_seekable_substream_writepart(CamelStream *s, int type)
+test_seekable_substream_writepart(CamelStream *s, gint type)
{
CamelSeekableStream *ss = (CamelSeekableStream *)s;
CamelSeekableSubstream *sus = (CamelSeekableSubstream *)s;
CamelSeekableStream *sp = sus->parent_stream;
- int i, len;
+ gint i, len;
push("writing substream, type %d", type);
@@ -175,7 +175,7 @@ test_seekable_substream_readpart(CamelStream *s)
CamelSeekableStream *ss = (CamelSeekableStream *)s;
CamelSeekableSubstream *sus = (CamelSeekableSubstream *)s;
CamelSeekableStream *sp = sus->parent_stream;
- int i, len;
+ gint i, len;
push("reading substream");
diff --git a/camel/tests/lib/streams.h b/camel/tests/lib/streams.h
index df52e283d..aac9a80df 100644
--- a/camel/tests/lib/streams.h
+++ b/camel/tests/lib/streams.h
@@ -8,5 +8,5 @@ void test_stream_seekable_readpart(CamelSeekableStream *s);
/* same, for substreams, multiple ways of writing */
#define SEEKABLE_SUBSTREAM_WAYS (2)
-void test_seekable_substream_writepart(CamelStream *s, int type);
+void test_seekable_substream_writepart(CamelStream *s, gint type);
void test_seekable_substream_readpart(CamelStream *s);
diff --git a/camel/tests/message/test1.c b/camel/tests/message/test1.c
index 12b585a13..e21f7c02d 100644
--- a/camel/tests/message/test1.c
+++ b/camel/tests/message/test1.c
@@ -31,8 +31,8 @@
#include <camel/camel-stream-mem.h>
struct _text {
- char *text;
- int len;
+ gchar *text;
+ gint len;
};
#define MAX_TEXTS (14)
@@ -41,8 +41,8 @@ struct _text texts[MAX_TEXTS];
static void
setup(void)
{
- int i, j;
- char *p;
+ gint i, j;
+ gchar *p;
/* setup various edge and other general cases */
texts[0].text = "";
@@ -97,19 +97,19 @@ setup(void)
static void cleanup(void)
{
- int i;
+ gint i;
for (i=6;i<14;i++) {
g_free(texts[i].text);
}
}
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelMimeMessage *msg, *msg2;
- int i, j;
- char *text;
- int len;
+ gint i, j;
+ gchar *text;
+ gint len;
camel_test_init(argc, argv);
diff --git a/camel/tests/message/test2.c b/camel/tests/message/test2.c
index 556cd973d..3b43fb4cc 100644
--- a/camel/tests/message/test2.c
+++ b/camel/tests/message/test2.c
@@ -14,11 +14,11 @@
#include "address-data.h"
-static char *convert(const char *in, const char *from, const char *to)
+static gchar *convert(const gchar *in, const gchar *from, const gchar *to)
{
iconv_t ic = iconv_open(to, from);
- char *out, *outp;
- const char *inp;
+ gchar *out, *outp;
+ const gchar *inp;
size_t inlen, outlen;
if (ic == (iconv_t)-1)
@@ -49,7 +49,7 @@ static char *convert(const char *in, const char *from, const char *to)
#if 0
/* lets see if we can convert back again? */
{
- char *nout, *noutp;
+ gchar *nout, *noutp;
iconv_t ic = iconv_open(from, to);
if (ic == (iconv_t)-1)
@@ -82,14 +82,14 @@ fail:
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
- int i;
+ gint i;
CamelInternetAddress *addr, *addr2;
- char *name;
- char *charset;
- const char *real, *where;
- char *enc, *enc2, *format, *format2;
+ gchar *name;
+ gchar *charset;
+ const gchar *real, *where;
+ gchar *enc, *enc2, *format, *format2;
camel_test_init(argc, argv);
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
push("Test add many");
for (i=1;i<10;i++) {
- char name[16], a[32];
+ gchar name[16], a[32];
sprintf(name, "Zed %d", i);
sprintf(a, "nowhere@here-%d.com.au", i);
camel_internet_address_add(addr, name, a);
diff --git a/camel/tests/message/test3.c b/camel/tests/message/test3.c
index eeac76a52..92f512dbb 100644
--- a/camel/tests/message/test3.c
+++ b/camel/tests/message/test3.c
@@ -15,7 +15,7 @@
#include <camel/camel-stream-mem.h>
#include "camel/camel-multipart.h"
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelMimeMessage *msg, *msg2, *msg3;
CamelMultipart *mp, *mp2;
diff --git a/camel/tests/message/test4.c b/camel/tests/message/test4.c
index 2d4eba112..0fc2eeaca 100644
--- a/camel/tests/message/test4.c
+++ b/camel/tests/message/test4.c
@@ -39,11 +39,11 @@
#if 0
static void
-dump_mime_struct (CamelMimePart *mime_part, int depth)
+dump_mime_struct (CamelMimePart *mime_part, gint depth)
{
CamelDataWrapper *content;
- char *mime_type;
- int i = 0;
+ gchar *mime_type;
+ gint i = 0;
while (i < depth) {
printf (" ");
@@ -71,11 +71,11 @@ dump_mime_struct (CamelMimePart *mime_part, int depth)
}
#endif
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
{
struct dirent *dent;
DIR *dir;
- int fd;
+ gint fd;
camel_test_init (argc, argv);
@@ -87,7 +87,7 @@ int main (int argc, char **argv)
while ((dent = readdir (dir)) != NULL) {
CamelMimeMessage *message;
CamelStream *stream;
- char *filename;
+ gchar *filename;
struct stat st;
if (dent->d_name[0] == '.')
diff --git a/camel/tests/mime-filter/test-charset.c b/camel/tests/mime-filter/test-charset.c
index 3a023a31b..00dc1dd7a 100644
--- a/camel/tests/mime-filter/test-charset.c
+++ b/camel/tests/mime-filter/test-charset.c
@@ -20,17 +20,17 @@
#define CHUNK_SIZE 4096
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
- char comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
+ gchar comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
CamelStream *source;
CamelStream *correct;
CamelStreamFilter *filter;
CamelMimeFilter *f;
struct dirent *dent;
- int i, test = 0;
+ gint i, test = 0;
DIR *dir;
camel_test_init(argc, argv);
@@ -40,8 +40,8 @@ main (int argc, char **argv)
return 1;
while ((dent = readdir (dir))) {
- char *infile, *outfile, *charset, *work;
- const char *ext;
+ gchar *infile, *outfile, *charset, *work;
+ const gchar *ext;
ext = strrchr (dent->d_name, '.');
if (!(!strncmp (dent->d_name, "charset-", 8) && ext && !strcmp (ext, ".in")))
@@ -75,7 +75,7 @@ main (int argc, char **argv)
charset = g_strdup (dent->d_name + 8);
ext = strchr (charset, '.');
- *((char *) ext) = '\0';
+ *((gchar *) ext) = '\0';
if (!(f = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "UTF-8"))) {
camel_test_fail ("Couldn't create CamelMimeFilterCharset??");
diff --git a/camel/tests/mime-filter/test-crlf.c b/camel/tests/mime-filter/test-crlf.c
index a37876fa5..82a90ba3c 100644
--- a/camel/tests/mime-filter/test-crlf.c
+++ b/camel/tests/mime-filter/test-crlf.c
@@ -25,23 +25,23 @@ enum {
CRLF_DONE
};
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
CamelStream *source;
CamelStream *correct;
CamelStreamFilter *filter;
CamelMimeFilter *sh;
- char *work;
- int i;
+ gchar *work;
+ gint i;
ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
- int comp_i;
- char comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
+ gint comp_i;
+ gchar comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
camel_test_init(argc, argv);
for (i = 0; i < NUM_CASES; i++) {
- int j;
+ gint j;
work = g_strdup_printf ("CRLF/DOT filter, test case %d", i);
camel_test_start (work);
@@ -49,7 +49,7 @@ main (int argc, char **argv)
for (j = CRLF_ENCODE; j < CRLF_DONE; j++) {
CamelMimeFilterCRLFDirection direction;
- char *infile = NULL, *outfile = NULL;
+ gchar *infile = NULL, *outfile = NULL;
switch (j) {
case CRLF_ENCODE:
diff --git a/camel/tests/mime-filter/test-tohtml.c b/camel/tests/mime-filter/test-tohtml.c
index 9df14339b..2495a950a 100644
--- a/camel/tests/mime-filter/test-tohtml.c
+++ b/camel/tests/mime-filter/test-tohtml.c
@@ -24,11 +24,11 @@
#define CHUNK_SIZE 4096
static void
-test_filter(CamelMimeFilter *f, const char *inname, const char *outname)
+test_filter(CamelMimeFilter *f, const gchar *inname, const gchar *outname)
{
CamelStreamMem *in, *out;
CamelStream *indisk, *outdisk, *filter;
- int id;
+ gint id;
camel_test_push("Data file '%s'", inname);
@@ -99,17 +99,17 @@ test_filter(CamelMimeFilter *f, const char *inname, const char *outname)
camel_test_pull();
}
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
- int i;
+ gint i;
camel_test_init(argc, argv);
camel_test_start("HTML Stream filtering");
for (i=0;i<100;i++) {
- char inname[32], outname[32];
+ gchar inname[32], outname[32];
CamelMimeFilter *f;
struct stat st;
diff --git a/camel/tests/mime-filter/test1.c b/camel/tests/mime-filter/test1.c
index 94a75753a..4e67ef9c5 100644
--- a/camel/tests/mime-filter/test1.c
+++ b/camel/tests/mime-filter/test1.c
@@ -20,9 +20,9 @@
#define CHUNK_SIZE 4096
struct {
- int flags;
- char *in;
- char *out;
+ gint flags;
+ gchar *in;
+ gchar *out;
} tests[] = {
{ CAMEL_MIME_FILTER_CANON_FROM|CAMEL_MIME_FILTER_CANON_CRLF,
"From \nRussia - with love.\n\n",
@@ -53,26 +53,26 @@ struct {
"Tasmiania with fur\r\n=46rom here or there ?\r\n" },
};
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
CamelStreamFilter *filter;
CamelMimeFilter *sh;
- int i;
+ gint i;
camel_test_init(argc, argv);
camel_test_start("canonicalisation filter tests");
for (i=0;i<sizeof(tests)/sizeof(tests[0]);i++) {
- int step;
+ gint step;
camel_test_push("Data test %d '%s'\n", i, tests[i].in);
/* try all write sizes */
for (step=1;step<20;step++) {
CamelStreamMem *out;
- char *p;
+ gchar *p;
camel_test_push("Chunk size %d\n", step);
@@ -84,7 +84,7 @@ main (int argc, char **argv)
p = tests[i].in;
while (*p) {
- int w = MIN(strlen(p), step);
+ gint w = MIN(strlen(p), step);
check(camel_stream_write((CamelStream *)filter, p, w) == w);
p += w;
diff --git a/camel/tests/misc/rfc2047.c b/camel/tests/misc/rfc2047.c
index 7c77ba52d..feabc525a 100644
--- a/camel/tests/misc/rfc2047.c
+++ b/camel/tests/misc/rfc2047.c
@@ -35,9 +35,9 @@
#include "camel-test.h"
struct {
- const char *encoded;
- const char *decoded;
- int dummy;
+ const gchar *encoded;
+ const gchar *decoded;
+ gint dummy;
} test1[] = {
/* the first half are rfc compliant cases (which are the most important) */
{ "=?iso-8859-1?q?this=20is=20some=20text?=", "this is some text", 0 },
@@ -66,19 +66,19 @@ struct {
};
struct {
- const char *encoded;
- const char *decoded;
- int dummy;
+ const gchar *encoded;
+ const gchar *decoded;
+ gint dummy;
} test2[] = {
/* ctext tests */
{ "Test of ctext (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)", "Test of ctext (ab)", 1 },
{ "ctext with \\\"quoted\\\" pairs", "ctext with \"quoted\" pairs", 1 }
};
-int main (int argc, char ** argv)
+gint main (gint argc, gchar ** argv)
{
- char *decoded;
- int i;
+ gchar *decoded;
+ gint i;
camel_test_init (argc, argv);
diff --git a/camel/tests/misc/split.c b/camel/tests/misc/split.c
index 4fa8d18ea..a612c76d6 100644
--- a/camel/tests/misc/split.c
+++ b/camel/tests/misc/split.c
@@ -14,11 +14,11 @@
/* TODO: should put utf8 stuff here too */
static struct {
- char *word;
- int count;
+ gchar *word;
+ gint count;
struct {
- char *word;
- int type;
+ gchar *word;
+ gint type;
} splits[5];
} split_tests[] = {
{ "simple", 1, { { "simple", CAMEL_SEARCH_WORD_SIMPLE } } },
@@ -36,11 +36,11 @@ static struct {
#define SPLIT_LENGTH (sizeof(split_tests)/sizeof(split_tests[0]))
static struct {
- char *word;
- int count;
+ gchar *word;
+ gint count;
struct {
- char *word;
- int type;
+ gchar *word;
+ gint type;
} splits[5];
} simple_tests[] = {
{ "simple", 1, { {"simple", CAMEL_SEARCH_WORD_SIMPLE } } },
@@ -55,10 +55,10 @@ static struct {
#define SIMPLE_LENGTH (sizeof(simple_tests)/sizeof(simple_tests[0]))
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
- int i, j;
+ gint i, j;
struct _camel_search_words *words, *tmp;
camel_test_init(argc, argv);
diff --git a/camel/tests/misc/test1.c b/camel/tests/misc/test1.c
index 0aae4fc5d..c23a73009 100644
--- a/camel/tests/misc/test1.c
+++ b/camel/tests/misc/test1.c
@@ -11,8 +11,8 @@
#include "camel-test.h"
struct {
- char *header;
- char *values[5];
+ gchar *header;
+ gchar *values[5];
} test1[] = {
{ "<test@camel.host>", { "test@camel.host" } },
{ "(this is a comment) <test@camel.host>", { "test@camel.host" } },
@@ -27,10 +27,10 @@ struct {
{ "test.groupwise@bug.novell", "test@camel.host", "test.groupwise@bug.novell" } },
};
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
- int i, j;
+ gint i, j;
camel_test_init(argc, argv);
diff --git a/camel/tests/misc/test2.c b/camel/tests/misc/test2.c
index f142dbb61..af22c6335 100644
--- a/camel/tests/misc/test2.c
+++ b/camel/tests/misc/test2.c
@@ -14,9 +14,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 {
- char *list;
- int count;
- char *params[8];
+ gchar *list;
+ gint count;
+ gchar *params[8];
} test1[] = {
{ "; charset=\"iso-8859-1\"",
1,
@@ -46,9 +46,9 @@ struct {
};
struct {
- int count;
- char *params[8];
- char *list;
+ gint count;
+ gchar *params[8];
+ gchar *list;
} test2[] = {
{ 1,
{ "name", "Doul\xC3\xADk01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123457890123456789123456789" },
@@ -64,10 +64,10 @@ struct {
"; name*=ISO-8859-1''%22%25$#%40%20special%20chars%3F%3B%3B%20!%ED" },
};
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
- int i, j;
+ gint i, j;
camel_test_init(argc, argv);
@@ -97,7 +97,7 @@ main (int argc, char **argv)
for (i=0;i<sizeof(test2)/sizeof(test2[0]);i++) {
struct _camel_header_param *head = NULL, *scan;
- char *text;
+ gchar *text;
camel_test_push("param encoding[%d]", i);
diff --git a/camel/tests/misc/url-scan.c b/camel/tests/misc/url-scan.c
index e0c79de24..bb821a142 100644
--- a/camel/tests/misc/url-scan.c
+++ b/camel/tests/misc/url-scan.c
@@ -34,7 +34,7 @@
#include "camel-test.h"
struct {
- char *text, *url;
+ gchar *text, *url;
} url_tests[] = {
{ "bob@foo.com", "mailto:bob@foo.com" },
{ "Ends with bob@foo.com", "mailto:bob@foo.com" },
@@ -83,12 +83,12 @@ struct {
};
-static int num_url_tests = G_N_ELEMENTS (url_tests);
+static gint num_url_tests = G_N_ELEMENTS (url_tests);
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
{
- char *html, *url, *p;
- int i, errors = 0;
+ gchar *html, *url, *p;
+ gint i, errors = 0;
guint32 flags;
camel_test_init (argc, argv);
diff --git a/camel/tests/misc/url.c b/camel/tests/misc/url.c
index c2db80662..062b8d4d9 100644
--- a/camel/tests/misc/url.c
+++ b/camel/tests/misc/url.c
@@ -9,10 +9,10 @@
#include "camel-test.h"
-char *base = "http://a/b/c/d;p?q#f";
+gchar *base = "http://a/b/c/d;p?q#f";
struct {
- char *url_string, *result;
+ gchar *url_string, *result;
} tests[] = {
{ "g:h", "g:h" },
{ "g", "http://a/b/c/g" },
@@ -69,15 +69,15 @@ struct {
{ "pop://us%3ar@host", "pop://us%3ar@host" },
{ "pop://us%2fr@host", "pop://us%2fr@host" }
};
-int num_tests = sizeof (tests) / sizeof (tests[0]);
+gint num_tests = sizeof (tests) / sizeof (tests[0]);
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
CamelURL *base_url, *url;
CamelException ex;
- char *url_string;
- int i;
+ gchar *url_string;
+ gint i;
camel_test_init (argc, argv);
diff --git a/camel/tests/misc/utf7.c b/camel/tests/misc/utf7.c
index 9bccb2b91..0aea68b47 100644
--- a/camel/tests/misc/utf7.c
+++ b/camel/tests/misc/utf7.c
@@ -11,11 +11,11 @@
#include "camel-test.h"
static struct {
- unsigned char *utf8;
- char *utf7;
+ guchar *utf8;
+ gchar *utf7;
guint32 unicode[200];
} tests[] = {
- /* the escape char */
+ /* the escape gchar */
{ "&", "&-",
{ 0x0026, } },
/* part of set D */
@@ -43,13 +43,13 @@ static struct {
};
#define TESTS_LENGTH (sizeof(tests)/sizeof(tests[0]))
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
- char *utf8, *utf7, *p;
- int i, j;
+ gchar *utf8, *utf7, *p;
+ gint i, j;
guint32 u;
- char utf8enc[256];
+ gchar utf8enc[256];
GString *out;
camel_test_init(argc, argv);
@@ -64,7 +64,7 @@ main (int argc, char **argv)
p = tests[i].utf8;
j = 0;
do {
- u = camel_utf8_getc((const unsigned char **)&p);
+ u = camel_utf8_getc((const guchar **)&p);
check(u == tests[i].unicode[j]);
j++;
} while (u);
@@ -90,7 +90,7 @@ main (int argc, char **argv)
j = 0;
do {
u = tests[i].unicode[j++];
- camel_utf8_putc((unsigned char **)&p, u);
+ camel_utf8_putc((guchar **)&p, u);
g_string_append_u(out, u);
} while (u);
diff --git a/camel/tests/smime/pgp-mime.c b/camel/tests/smime/pgp-mime.c
index d95dfba25..b1cb71161 100644
--- a/camel/tests/smime/pgp-mime.c
+++ b/camel/tests/smime/pgp-mime.c
@@ -38,7 +38,7 @@
#include "camel-test.h"
#include "session.h"
-static char test_msg[] = "Since we need to make sure that\nFrom lines work okay, we should test that"
+static gchar test_msg[] = "Since we need to make sure that\nFrom lines work okay, we should test that"
"as well as test 8bit chars and other fun stuff? 8bit chars: Dražen Kačar\n\nOkay, I guess that covers"
"the basics at least...\n";
@@ -60,9 +60,9 @@ typedef struct _CamelPgpSessionClass {
} CamelPgpSessionClass;
-static char *get_password (CamelSession *session, const char *prompt,
+static gchar *get_password (CamelSession *session, const gchar *prompt,
guint32 flags,
- CamelService *service, const char *item,
+ CamelService *service, const gchar *item,
CamelException *ex);
static void
@@ -101,15 +101,15 @@ camel_pgp_session_get_type (void)
return type;
}
-static char *
-get_password (CamelSession *session, const char *prompt, guint32 flags,
- CamelService *service, const char *item, CamelException *ex)
+static gchar *
+get_password (CamelSession *session, const gchar *prompt, guint32 flags,
+ CamelService *service, const gchar *item, CamelException *ex)
{
return g_strdup ("no.secret");
}
static CamelSession *
-camel_pgp_session_new (const char *path)
+camel_pgp_session_new (const gchar *path)
{
CamelSession *session;
@@ -121,7 +121,7 @@ camel_pgp_session_new (const char *path)
}
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
{
CamelSession *session;
CamelCipherContext *ctx;
@@ -131,7 +131,7 @@ int main (int argc, char **argv)
CamelMultipartSigned *mps;
CamelMultipartEncrypted *mpe;
GPtrArray *recipients;
- int ret;
+ gint ret;
camel_test_init (argc, argv);
diff --git a/camel/tests/smime/pgp.c b/camel/tests/smime/pgp.c
index 8f9d88ba0..fcd043615 100644
--- a/camel/tests/smime/pgp.c
+++ b/camel/tests/smime/pgp.c
@@ -53,9 +53,9 @@ typedef struct _CamelPgpSessionClass {
} CamelPgpSessionClass;
-static char *get_password (CamelSession *session, const char *prompt,
+static gchar *get_password (CamelSession *session, const gchar *prompt,
guint32 flags,
- CamelService *service, const char *item,
+ CamelService *service, const gchar *item,
CamelException *ex);
static void
@@ -94,15 +94,15 @@ camel_pgp_session_get_type (void)
return type;
}
-static char *
-get_password (CamelSession *session, const char *prompt, guint32 flags,
- CamelService *service, const char *item, CamelException *ex)
+static gchar *
+get_password (CamelSession *session, const gchar *prompt, guint32 flags,
+ CamelService *service, const gchar *item, CamelException *ex)
{
return g_strdup ("no.secret");
}
static CamelSession *
-camel_pgp_session_new (const char *path)
+camel_pgp_session_new (const gchar *path)
{
CamelSession *session;
@@ -114,7 +114,7 @@ camel_pgp_session_new (const char *path)
}
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
{
CamelSession *session;
CamelCipherContext *ctx;
@@ -125,8 +125,8 @@ int main (int argc, char **argv)
CamelDataWrapper *dw;
GPtrArray *recipients;
GByteArray *buf;
- char *before, *after;
- int ret;
+ gchar *before, *after;
+ gint ret;
if (getenv("CAMEL_TEST_GPG") == NULL)
return 77;
diff --git a/camel/tests/smime/pkcs7.c b/camel/tests/smime/pkcs7.c
index 9445dcfb5..384c55969 100644
--- a/camel/tests/smime/pkcs7.c
+++ b/camel/tests/smime/pkcs7.c
@@ -26,9 +26,9 @@ typedef struct _CamelTestSessionClass {
} CamelTestSessionClass;
-static char *get_password (CamelSession *session, const char *prompt,
+static gchar *get_password (CamelSession *session, const gchar *prompt,
guint32 flags, CamelService *service,
- const char *item, CamelException *ex);
+ const gchar *item, CamelException *ex);
static void
init (CamelTestSession *session)
@@ -66,15 +66,15 @@ camel_test_session_get_type (void)
return type;
}
-static char *
-get_password (CamelSession *session, const char *prompt, guint32 flags,
- CamelService *service, const char *item, CamelException *ex)
+static gchar *
+get_password (CamelSession *session, const gchar *prompt, guint32 flags,
+ CamelService *service, const gchar *item, CamelException *ex)
{
return g_strdup ("S/MIME v3 is rfc263x, now go and read them.");
}
static CamelSession *
-camel_test_session_new (const char *path)
+camel_test_session_new (const gchar *path)
{
CamelSession *session;
@@ -86,7 +86,7 @@ camel_test_session_new (const char *path)
}
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
{
CamelSession *session;
CamelSMimeContext *ctx;
@@ -95,7 +95,7 @@ int main (int argc, char **argv)
CamelStream *stream1, *stream2, *stream3;
GPtrArray *recipients;
GByteArray *buf;
- char *before, *after;
+ gchar *before, *after;
camel_test_init (argc, argv);
diff --git a/camel/tests/stream/test1.c b/camel/tests/stream/test1.c
index 0ca68c847..f48d16f9f 100644
--- a/camel/tests/stream/test1.c
+++ b/camel/tests/stream/test1.c
@@ -10,14 +10,14 @@
#include "camel/camel-stream-fs.h"
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSeekableStream *ss = NULL;
- int i;
- int fd = -1;
+ gint i;
+ gint fd = -1;
struct stat st;
- int size;
- char buffer[1024];
+ gint size;
+ gchar buffer[1024];
camel_test_init(argc, argv);
diff --git a/camel/tests/stream/test2.c b/camel/tests/stream/test2.c
index 02ad88e95..04961a92e 100644
--- a/camel/tests/stream/test2.c
+++ b/camel/tests/stream/test2.c
@@ -10,14 +10,14 @@
#include "camel/camel-stream-mem.h"
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSeekableStream *ss = NULL;
- int i;
- int fd = -1;
+ gint i;
+ gint fd = -1;
struct stat st;
- int size;
- char buffer[1024];
+ gint size;
+ gchar buffer[1024];
GByteArray *ba;
camel_test_init(argc, argv);
diff --git a/camel/tests/stream/test3.c b/camel/tests/stream/test3.c
index de829cc76..864b64c7a 100644
--- a/camel/tests/stream/test3.c
+++ b/camel/tests/stream/test3.c
@@ -35,10 +35,10 @@ struct {
{ 10245, CAMEL_STREAM_UNBOUND },
};
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
CamelSeekableStream *ss = NULL;
- int i, j;
+ gint i, j;
CamelSeekableSubstream *sus, *sus2;
camel_test_init(argc, argv);