[evolution-data-server] Prefer GLib basic types over C types.



commit bc9eadf2dc10287359471e086b9808e81734c0a6
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu May 28 13:53:24 2009 -0400

    Prefer GLib basic types over C types.
---
 .../backends/file/e-book-backend-file-factory.c    |    2 +-
 addressbook/backends/file/e-book-backend-file.c    |  176 ++--
 .../google/e-book-backend-google-factory.c         |    4 +-
 .../backends/google/e-book-backend-google.c        |   22 +-
 addressbook/backends/google/google-book.c          |   58 +-
 addressbook/backends/google/google-book.h          |   10 +-
 addressbook/backends/google/util.c                 |   88 +-
 addressbook/backends/google/util.h                 |    2 +-
 addressbook/backends/groupwise/create-account.c    |   10 +-
 .../groupwise/e-book-backend-groupwise-factory.c   |    2 +-
 .../backends/groupwise/e-book-backend-groupwise.c  |  322 ++++----
 .../backends/ldap/e-book-backend-ldap-factory.c    |    2 +-
 addressbook/backends/ldap/e-book-backend-ldap.c    |  568 +++++++-------
 addressbook/backends/ldap/openldap-extract.h       |  192 +++---
 .../backends/vcf/e-book-backend-vcf-factory.c      |    2 +-
 addressbook/backends/vcf/e-book-backend-vcf.c      |   80 +-
 .../webdav/e-book-backend-webdav-factory.c         |    2 +-
 .../backends/webdav/e-book-backend-webdav.c        |   84 +-
 addressbook/libebook/e-address-western.c           |   12 +-
 addressbook/libebook/e-address-western.h           |   16 +-
 addressbook/libebook/e-book-listener.c             |   14 +-
 addressbook/libebook/e-book-listener.h             |    6 +-
 addressbook/libebook/e-book-query.c                |   84 +-
 addressbook/libebook/e-book-query.h                |   18 +-
 addressbook/libebook/e-book-view-listener.c        |    8 +-
 addressbook/libebook/e-book-view-listener.h        |    2 +-
 addressbook/libebook/e-book-view.c                 |    2 +-
 addressbook/libebook/e-book-view.h                 |    2 +-
 addressbook/libebook/e-book.c                      |  108 ++--
 addressbook/libebook/e-book.h                      |   40 +-
 addressbook/libebook/e-contact.c                   |  206 +++---
 addressbook/libebook/e-contact.h                   |   60 +-
 addressbook/libebook/e-destination.c               |  156 ++--
 addressbook/libebook/e-destination.h               |   34 +-
 addressbook/libebook/e-name-western-tables.h       |    6 +-
 addressbook/libebook/e-name-western.c              |  162 ++--
 addressbook/libebook/e-name-western.h              |   16 +-
 addressbook/libebook/e-vcard.c                     |  176 ++--
 addressbook/libebook/e-vcard.h                     |   48 +-
 addressbook/libedata-book/e-book-backend-cache.c   |   46 +-
 addressbook/libedata-book/e-book-backend-cache.h   |   18 +-
 .../libedata-book/e-book-backend-db-cache.c        |   54 +-
 .../libedata-book/e-book-backend-db-cache.h        |   22 +-
 addressbook/libedata-book/e-book-backend-factory.c |    2 +-
 addressbook/libedata-book/e-book-backend-factory.h |    6 +-
 addressbook/libedata-book/e-book-backend-sexp.c    |  204 +++---
 addressbook/libedata-book/e-book-backend-sexp.h    |    4 +-
 addressbook/libedata-book/e-book-backend-summary.c |  194 +++---
 addressbook/libedata-book/e-book-backend-summary.h |   14 +-
 addressbook/libedata-book/e-book-backend-sync.c    |   38 +-
 addressbook/libedata-book/e-book-backend-sync.h    |   28 +-
 addressbook/libedata-book/e-book-backend.c         |   26 +-
 addressbook/libedata-book/e-book-backend.h         |   40 +-
 addressbook/libedata-book/e-data-book-factory.c    |   40 +-
 addressbook/libedata-book/e-data-book-factory.h    |    6 +-
 addressbook/libedata-book/e-data-book-view.c       |   48 +-
 addressbook/libedata-book/e-data-book-view.h       |   22 +-
 addressbook/libedata-book/e-data-book.c            |   42 +-
 addressbook/libedata-book/e-data-book.h            |    2 +-
 addressbook/tests/ebook/test-categories.c          |   12 +-
 addressbook/tests/ebook/test-changes.c             |    6 +-
 addressbook/tests/ebook/test-date.c                |    4 +-
 addressbook/tests/ebook/test-ebook-async.c         |   10 +-
 addressbook/tests/ebook/test-ebook-view.c          |   12 +-
 addressbook/tests/ebook/test-ebook.c               |   10 +-
 addressbook/tests/ebook/test-nonexistent-id.c      |    2 +-
 addressbook/tests/ebook/test-photo.c               |    6 +-
 addressbook/tests/ebook/test-query.c               |   10 +-
 addressbook/tests/ebook/test-search.c              |    4 +-
 addressbook/tests/ebook/test-self.c                |    6 +-
 addressbook/tests/ebook/test-stress-bookviews.c    |   14 +-
 addressbook/tests/ebook/test-string.c              |    4 +-
 addressbook/tests/ebook/test-undefinedfield.c      |    4 +-
 addressbook/tests/ebook/test-untyped-phones.c      |    8 +-
 addressbook/tests/vcard/dump-vcard.c               |    8 +-
 .../backends/caldav/e-cal-backend-caldav-factory.c |    4 +-
 .../backends/caldav/e-cal-backend-caldav-factory.h |    2 +-
 calendar/backends/caldav/e-cal-backend-caldav.c    |  278 ++++----
 .../contacts/e-cal-backend-contacts-factory.c      |    4 +-
 .../contacts/e-cal-backend-contacts-factory.h      |    2 +-
 .../backends/contacts/e-cal-backend-contacts.c     |   94 ++--
 .../backends/file/e-cal-backend-file-factory.c     |    4 +-
 .../backends/file/e-cal-backend-file-factory.h     |    2 +-
 calendar/backends/file/e-cal-backend-file.c        |  196 +++---
 calendar/backends/file/e-cal-backend-file.h        |    4 +-
 .../backends/google/e-cal-backend-google-factory.c |    2 +-
 .../backends/google/e-cal-backend-google-factory.h |    2 +-
 .../backends/google/e-cal-backend-google-utils.c   |   26 +-
 calendar/backends/google/e-cal-backend-google.c    |   82 +-
 .../groupwise/e-cal-backend-groupwise-factory.c    |    4 +-
 .../groupwise/e-cal-backend-groupwise-factory.h    |    2 +-
 .../groupwise/e-cal-backend-groupwise-utils.c      |  218 +++---
 .../groupwise/e-cal-backend-groupwise-utils.h      |   10 +-
 .../backends/groupwise/e-cal-backend-groupwise.c   |  270 ++++----
 .../backends/groupwise/e-cal-backend-groupwise.h   |    2 +-
 .../backends/http/e-cal-backend-http-factory.c     |    4 +-
 .../backends/http/e-cal-backend-http-factory.h     |    2 +-
 calendar/backends/http/e-cal-backend-http.c        |   78 +-
 .../weather/e-cal-backend-weather-factory.c        |    4 +-
 .../weather/e-cal-backend-weather-factory.h        |    2 +-
 calendar/backends/weather/e-cal-backend-weather.c  |   60 +-
 calendar/backends/weather/e-weather-source-ccf.c   |   76 +-
 calendar/backends/weather/e-weather-source-ccf.h   |    2 +-
 calendar/backends/weather/e-weather-source.c       |    4 +-
 calendar/backends/weather/e-weather-source.h       |    2 +-
 calendar/libecal/e-cal-check-timezones.c           |   54 +-
 calendar/libecal/e-cal-check-timezones.h           |   16 +-
 calendar/libecal/e-cal-component.c                 |  218 +++---
 calendar/libecal/e-cal-component.h                 |   90 +-
 calendar/libecal/e-cal-listener.c                  |   10 +-
 calendar/libecal/e-cal-listener.h                  |   24 +-
 calendar/libecal/e-cal-recur.c                     |   40 +-
 calendar/libecal/e-cal-recur.h                     |    6 +-
 calendar/libecal/e-cal-system-timezone.c           |   86 +-
 calendar/libecal/e-cal-system-timezone.h           |    2 +-
 calendar/libecal/e-cal-time-util.c                 |   50 +-
 calendar/libecal/e-cal-time-util.h                 |   26 +-
 calendar/libecal/e-cal-util.c                      |   68 +-
 calendar/libecal/e-cal-util.h                      |   14 +-
 calendar/libecal/e-cal-view-listener.c             |    6 +-
 calendar/libecal/e-cal-view-listener.h             |    2 +-
 calendar/libecal/e-cal-view.c                      |    2 +-
 calendar/libecal/e-cal-view.h                      |    2 +-
 calendar/libecal/e-cal.c                           |  214 +++---
 calendar/libecal/e-cal.h                           |   52 +-
 calendar/libedata-cal/e-cal-backend-cache.c        |   84 +-
 calendar/libedata-cal/e-cal-backend-cache.h        |   26 +-
 calendar/libedata-cal/e-cal-backend-factory.c      |    2 +-
 calendar/libedata-cal/e-cal-backend-factory.h      |    4 +-
 .../libedata-cal/e-cal-backend-loader-factory.h    |    2 +-
 calendar/libedata-cal/e-cal-backend-sexp.c         |  128 ++--
 calendar/libedata-cal/e-cal-backend-sexp.h         |   16 +-
 calendar/libedata-cal/e-cal-backend-sync.c         |  108 ++--
 calendar/libedata-cal/e-cal-backend-sync.h         |  104 ++--
 calendar/libedata-cal/e-cal-backend-util.c         |   12 +-
 calendar/libedata-cal/e-cal-backend-util.h         |    6 +-
 calendar/libedata-cal/e-cal-backend.c              |   52 +-
 calendar/libedata-cal/e-cal-backend.h              |   84 +-
 calendar/libedata-cal/e-data-cal-factory.c         |   30 +-
 calendar/libedata-cal/e-data-cal-factory.h         |    6 +-
 calendar/libedata-cal/e-data-cal-view.c            |   32 +-
 calendar/libedata-cal/e-data-cal-view.h            |   12 +-
 calendar/libedata-cal/e-data-cal.c                 |   42 +-
 calendar/libedata-cal/e-data-cal.h                 |   26 +-
 calendar/tests/ecal/test-ecal.c                    |  100 ++--
 calendar/tests/ecal/test-recur.c                   |    4 +-
 calendar/tests/ecal/test-search.c                  |    6 +-
 camel/camel-address.c                              |   20 +-
 camel/camel-address.h                              |   18 +-
 camel/camel-arg.c                                  |   26 +-
 camel/camel-arg.h                                  |   30 +-
 camel/camel-block-file.c                           |   78 +-
 camel/camel-block-file.h                           |   44 +-
 camel/camel-certdb.c                               |   38 +-
 camel/camel-certdb.h                               |   32 +-
 camel/camel-charset-map-private.h                  |  630 ++++++++--------
 camel/camel-charset-map.c                          |   68 +-
 camel/camel-charset-map.h                          |   12 +-
 camel/camel-cipher-context.c                       |   36 +-
 camel/camel-cipher-context.h                       |   44 +-
 camel/camel-data-cache.c                           |   42 +-
 camel/camel-data-cache.h                           |   32 +-
 camel/camel-data-wrapper.c                         |   14 +-
 camel/camel-data-wrapper.h                         |   14 +-
 camel/camel-db.c                                   |  476 ++++++------
 camel/camel-db.h                                   |  138 ++--
 camel/camel-debug.c                                |   18 +-
 camel/camel-debug.h                                |    6 +-
 camel/camel-digest-folder.c                        |   32 +-
 camel/camel-digest-store.c                         |   22 +-
 camel/camel-digest-store.h                         |    2 +-
 camel/camel-disco-diary.c                          |   28 +-
 camel/camel-disco-diary.h                          |   10 +-
 camel/camel-disco-folder.c                         |   40 +-
 camel/camel-disco-folder.h                         |   20 +-
 camel/camel-disco-store.c                          |   16 +-
 camel/camel-disco-store.h                          |   12 +-
 camel/camel-exception.c                            |   12 +-
 camel/camel-exception.h                            |    8 +-
 camel/camel-file-utils.c                           |   94 ++--
 camel/camel-file-utils.h                           |   40 +-
 camel/camel-filter-driver.c                        |  236 +++---
 camel/camel-filter-driver.h                        |   48 +-
 camel/camel-filter-search.c                        |  138 ++--
 camel/camel-filter-search.h                        |   10 +-
 camel/camel-folder-search.c                        |  292 ++++----
 camel/camel-folder-search.h                        |   64 +-
 camel/camel-folder-summary.c                       |  490 ++++++------
 camel/camel-folder-summary.h                       |  178 ++--
 camel/camel-folder-thread.c                        |   72 +-
 camel/camel-folder-thread.h                        |    4 +-
 camel/camel-folder.c                               |  254 +++---
 camel/camel-folder.h                               |  130 ++--
 camel/camel-gpg-context.c                          |  262 +++---
 camel/camel-html-parser.c                          |   60 +-
 camel/camel-html-parser.h                          |   10 +-
 camel/camel-http-stream.c                          |   58 +-
 camel/camel-http-stream.h                          |   16 +-
 camel/camel-iconv.c                                |   60 +-
 camel/camel-index-control.c                        |   30 +-
 camel/camel-index.c                                |   48 +-
 camel/camel-index.h                                |   62 +-
 camel/camel-internet-address.c                     |  100 ++--
 camel/camel-internet-address.h                     |   12 +-
 camel/camel-junk-plugin.c                          |    4 +-
 camel/camel-junk-plugin.h                          |   10 +-
 camel/camel-list-utils.c                           |   12 +-
 camel/camel-list-utils.h                           |    8 +-
 camel/camel-lock-client.c                          |   42 +-
 camel/camel-lock-client.h                          |    4 +-
 camel/camel-lock-helper.c                          |   46 +-
 camel/camel-lock.c                                 |   42 +-
 camel/camel-lock.h                                 |   16 +-
 camel/camel-medium.c                               |   30 +-
 camel/camel-medium.h                               |   20 +-
 camel/camel-mime-filter-basic.c                    |   30 +-
 camel/camel-mime-filter-basic.h                    |    6 +-
 camel/camel-mime-filter-bestenc.c                  |   20 +-
 camel/camel-mime-filter-bestenc.h                  |   30 +-
 camel/camel-mime-filter-canon.c                    |   34 +-
 camel/camel-mime-filter-charset.c                  |   18 +-
 camel/camel-mime-filter-charset.h                  |    6 +-
 camel/camel-mime-filter-crlf.c                     |   22 +-
 camel/camel-mime-filter-enriched.c                 |   98 ++--
 camel/camel-mime-filter-enriched.h                 |    4 +-
 camel/camel-mime-filter-from.c                     |   24 +-
 camel/camel-mime-filter-from.h                     |    2 +-
 camel/camel-mime-filter-gzip.c                     |   40 +-
 camel/camel-mime-filter-gzip.h                     |    4 +-
 camel/camel-mime-filter-html.c                     |   20 +-
 camel/camel-mime-filter-index.c                    |    6 +-
 camel/camel-mime-filter-linewrap.c                 |   22 +-
 camel/camel-mime-filter-linewrap.h                 |    6 +-
 camel/camel-mime-filter-pgp.c                      |   20 +-
 camel/camel-mime-filter-pgp.h                      |    2 +-
 camel/camel-mime-filter-progress.c                 |    8 +-
 camel/camel-mime-filter-save.c                     |   16 +-
 camel/camel-mime-filter-tohtml.c                   |   72 +-
 camel/camel-mime-filter-tohtml.h                   |    2 +-
 camel/camel-mime-filter-windows.c                  |   20 +-
 camel/camel-mime-filter-windows.h                  |    6 +-
 camel/camel-mime-filter-yenc.c                     |   66 +-
 camel/camel-mime-filter-yenc.h                     |   18 +-
 camel/camel-mime-filter.c                          |   36 +-
 camel/camel-mime-filter.h                          |   28 +-
 camel/camel-mime-message.c                         |  148 ++--
 camel/camel-mime-message.h                         |   36 +-
 camel/camel-mime-parser.c                          |  196 +++---
 camel/camel-mime-parser.h                          |   26 +-
 camel/camel-mime-part-utils.c                      |   12 +-
 camel/camel-mime-part.c                            |  104 ++--
 camel/camel-mime-part.h                            |   38 +-
 camel/camel-mime-utils.c                           |  820 ++++++++++----------
 camel/camel-mime-utils.h                           |  156 ++--
 camel/camel-movemail.c                             |   76 +-
 camel/camel-movemail.h                             |    2 +-
 camel/camel-msgport.c                              |    4 +-
 camel/camel-multipart-encrypted.c                  |    2 +-
 camel/camel-multipart-encrypted.h                  |    2 +-
 camel/camel-multipart-signed.c                     |   22 +-
 camel/camel-multipart-signed.h                     |    4 +-
 camel/camel-multipart.c                            |   26 +-
 camel/camel-multipart.h                            |   12 +-
 camel/camel-net-utils.c                            |  146 ++--
 camel/camel-net-utils.h                            |   16 +-
 camel/camel-nntp-address.c                         |   34 +-
 camel/camel-nntp-address.h                         |    4 +-
 camel/camel-object.c                               |  236 +++---
 camel/camel-object.h                               |  104 ++--
 camel/camel-offline-folder.c                       |   26 +-
 camel/camel-offline-folder.h                       |    6 +-
 camel/camel-offline-journal.c                      |   12 +-
 camel/camel-offline-journal.h                      |   14 +-
 camel/camel-offline-store.c                        |    8 +-
 camel/camel-offline-store.h                        |    8 +-
 camel/camel-operation.c                            |   46 +-
 camel/camel-operation.h                            |   12 +-
 camel/camel-partition-table.c                      |   66 +-
 camel/camel-partition-table.h                      |   28 +-
 camel/camel-private.h                              |   12 +-
 camel/camel-process.c                              |   10 +-
 camel/camel-process.h                              |    4 +-
 camel/camel-provider.c                             |   18 +-
 camel/camel-provider.h                             |   34 +-
 camel/camel-sasl-anonymous.c                       |    2 +-
 camel/camel-sasl-anonymous.h                       |    4 +-
 camel/camel-sasl-cram-md5.c                        |    4 +-
 camel/camel-sasl-digest-md5.c                      |  124 ++--
 camel/camel-sasl-gssapi.c                          |   10 +-
 camel/camel-sasl-kerberos4.c                       |    8 +-
 camel/camel-sasl-login.c                           |    2 +-
 camel/camel-sasl-ntlm.c                            |   70 +-
 camel/camel-sasl-popb4smtp.c                       |    2 +-
 camel/camel-sasl.c                                 |   10 +-
 camel/camel-sasl.h                                 |   10 +-
 camel/camel-search-private.c                       |  116 ++--
 camel/camel-search-private.h                       |   14 +-
 camel/camel-search-sql-sexp.c                      |  108 ++--
 camel/camel-search-sql-sexp.h                      |    2 +-
 camel/camel-search-sql.c                           |  104 ++--
 camel/camel-search-sql.h                           |    2 +-
 camel/camel-seekable-stream.c                      |    8 +-
 camel/camel-seekable-stream.h                      |    2 +-
 camel/camel-seekable-substream.c                   |    8 +-
 camel/camel-service.c                              |   30 +-
 camel/camel-service.h                              |   16 +-
 camel/camel-session.c                              |   94 ++--
 camel/camel-session.h                              |   96 ++--
 camel/camel-smime-context.c                        |   58 +-
 camel/camel-smime-context.h                        |    2 +-
 camel/camel-store-summary.c                        |   86 +-
 camel/camel-store-summary.h                        |   42 +-
 camel/camel-store.c                                |  130 ++--
 camel/camel-store.h                                |   74 +-
 camel/camel-stream-buffer.c                        |   64 +-
 camel/camel-stream-buffer.h                        |   20 +-
 camel/camel-stream-filter.c                        |   34 +-
 camel/camel-stream-filter.h                        |    4 +-
 camel/camel-stream-fs.c                            |   22 +-
 camel/camel-stream-fs.h                            |   10 +-
 camel/camel-stream-mem.c                           |   18 +-
 camel/camel-stream-mem.h                           |    8 +-
 camel/camel-stream-null.c                          |   10 +-
 camel/camel-stream-process.c                       |   28 +-
 camel/camel-stream-process.h                       |    4 +-
 camel/camel-stream-vfs.c                           |   14 +-
 camel/camel-stream-vfs.h                           |    2 +-
 camel/camel-stream.c                               |   28 +-
 camel/camel-stream.h                               |   26 +-
 camel/camel-string-utils.c                         |   64 +-
 camel/camel-string-utils.h                         |   18 +-
 camel/camel-tcp-stream-openssl.c                   |  102 ++--
 camel/camel-tcp-stream-raw.c                       |   52 +-
 camel/camel-tcp-stream-raw.h                       |    4 +-
 camel/camel-tcp-stream-ssl.c                       |  108 ++--
 camel/camel-tcp-stream-ssl.h                       |    6 +-
 camel/camel-tcp-stream.c                           |   14 +-
 camel/camel-tcp-stream.h                           |   12 +-
 camel/camel-text-index.c                           |  186 +++---
 camel/camel-text-index.h                           |   10 +-
 camel/camel-transport.c                            |    4 +-
 camel/camel-trie.c                                 |   30 +-
 camel/camel-uid-cache.c                            |   26 +-
 camel/camel-uid-cache.h                            |   10 +-
 camel/camel-url-scanner.c                          |   76 +-
 camel/camel-url-scanner.h                          |   24 +-
 camel/camel-url.c                                  |   68 +-
 camel/camel-url.h                                  |   56 +-
 camel/camel-utf8.c                                 |   78 +-
 camel/camel-utf8.h                                 |   16 +-
 camel/camel-vee-folder.c                           |  222 +++---
 camel/camel-vee-folder.h                           |   20 +-
 camel/camel-vee-store.c                            |   44 +-
 camel/camel-vee-summary.c                          |   50 +-
 camel/camel-vee-summary.h                          |    4 +-
 camel/camel-vtrash-folder.c                        |   78 +-
 camel/camel-win32.c                                |    8 +-
 camel/camel.c                                      |   12 +-
 camel/camel.h                                      |    2 +-
 camel/db-scrap-tools/db.c                          |   42 +-
 camel/providers/groupwise/camel-groupwise-folder.c |  338 ++++----
 camel/providers/groupwise/camel-groupwise-folder.h |    8 +-
 .../providers/groupwise/camel-groupwise-journal.c  |   20 +-
 .../providers/groupwise/camel-groupwise-journal.h  |   12 +-
 .../providers/groupwise/camel-groupwise-provider.c |    8 +-
 .../groupwise/camel-groupwise-store-summary.c      |   76 +-
 .../groupwise/camel-groupwise-store-summary.h      |   22 +-
 camel/providers/groupwise/camel-groupwise-store.c  |  140 ++--
 camel/providers/groupwise/camel-groupwise-store.h  |   12 +-
 .../providers/groupwise/camel-groupwise-summary.c  |   32 +-
 .../providers/groupwise/camel-groupwise-summary.h  |    8 +-
 .../groupwise/camel-groupwise-transport.c          |   16 +-
 camel/providers/groupwise/camel-groupwise-utils.c  |  112 ++--
 camel/providers/groupwise/camel-groupwise-utils.h  |   14 +-
 camel/providers/hula/camel-hula-provider.c         |    8 +-
 camel/providers/imap/camel-imap-command.c          |   90 +-
 camel/providers/imap/camel-imap-command.h          |   16 +-
 camel/providers/imap/camel-imap-folder.c           |  412 +++++-----
 camel/providers/imap/camel-imap-folder.h           |   20 +-
 camel/providers/imap/camel-imap-journal.c          |   32 +-
 camel/providers/imap/camel-imap-journal.h          |   10 +-
 camel/providers/imap/camel-imap-message-cache.c    |   86 +-
 camel/providers/imap/camel-imap-message-cache.h    |   40 +-
 camel/providers/imap/camel-imap-provider.c         |    8 +-
 camel/providers/imap/camel-imap-search.c           |   56 +-
 camel/providers/imap/camel-imap-search.h           |    4 +-
 camel/providers/imap/camel-imap-store-summary.c    |   80 +-
 camel/providers/imap/camel-imap-store-summary.h    |   24 +-
 camel/providers/imap/camel-imap-store.c            |  274 ++++----
 camel/providers/imap/camel-imap-store.h            |    8 +-
 camel/providers/imap/camel-imap-summary.c          |   44 +-
 camel/providers/imap/camel-imap-summary.h          |    6 +-
 camel/providers/imap/camel-imap-utils.c            |  194 +++---
 camel/providers/imap/camel-imap-utils.h            |   46 +-
 camel/providers/imap/camel-imap-wrapper.c          |    2 +-
 camel/providers/imap/camel-imap-wrapper.h          |    6 +-
 camel/providers/imap4/camel-imap4-command.c        |   60 +-
 camel/providers/imap4/camel-imap4-command.h        |   34 +-
 camel/providers/imap4/camel-imap4-engine.c         |   98 ++--
 camel/providers/imap4/camel-imap4-engine.h         |   48 +-
 camel/providers/imap4/camel-imap4-folder.c         |  106 ++--
 camel/providers/imap4/camel-imap4-folder.h         |   12 +-
 camel/providers/imap4/camel-imap4-journal.c        |   16 +-
 camel/providers/imap4/camel-imap4-journal.h        |    8 +-
 camel/providers/imap4/camel-imap4-provider.c       |    4 +-
 camel/providers/imap4/camel-imap4-search.c         |   28 +-
 camel/providers/imap4/camel-imap4-search.h         |    4 +-
 camel/providers/imap4/camel-imap4-specials.c       |    8 +-
 camel/providers/imap4/camel-imap4-specials.h       |    2 +-
 camel/providers/imap4/camel-imap4-store-summary.c  |   14 +-
 camel/providers/imap4/camel-imap4-store-summary.h  |    2 +-
 camel/providers/imap4/camel-imap4-store.c          |  190 +++---
 camel/providers/imap4/camel-imap4-store.h          |    2 +-
 camel/providers/imap4/camel-imap4-stream.c         |   42 +-
 camel/providers/imap4/camel-imap4-stream.h         |   32 +-
 camel/providers/imap4/camel-imap4-summary.c        |  102 ++--
 camel/providers/imap4/camel-imap4-summary.h        |    4 +-
 camel/providers/imap4/camel-imap4-utils.c          |   64 +-
 camel/providers/imap4/camel-imap4-utils.h          |   18 +-
 camel/providers/imapp/camel-imapp-driver.c         |   54 +-
 camel/providers/imapp/camel-imapp-driver.h         |   26 +-
 camel/providers/imapp/camel-imapp-engine.c         |  134 ++--
 camel/providers/imapp/camel-imapp-engine.h         |   42 +-
 camel/providers/imapp/camel-imapp-exception.h      |    2 +-
 camel/providers/imapp/camel-imapp-fetch-stream.c   |    6 +-
 camel/providers/imapp/camel-imapp-fetch-stream.h   |    2 +-
 camel/providers/imapp/camel-imapp-folder.c         |   14 +-
 camel/providers/imapp/camel-imapp-folder.h         |    4 +-
 camel/providers/imapp/camel-imapp-store-summary.c  |   74 +-
 camel/providers/imapp/camel-imapp-store-summary.h  |   24 +-
 camel/providers/imapp/camel-imapp-store.c          |   88 +-
 camel/providers/imapp/camel-imapp-store.h          |    2 +-
 camel/providers/imapp/camel-imapp-stream.c         |   92 ++--
 camel/providers/imapp/camel-imapp-stream.h         |   30 +-
 camel/providers/imapp/camel-imapp-summary.c        |    6 +-
 camel/providers/imapp/camel-imapp-utils.c          |   94 ++--
 camel/providers/imapp/camel-imapp-utils.h          |   28 +-
 camel/providers/local/camel-local-folder.c         |   50 +-
 camel/providers/local/camel-local-folder.h         |   20 +-
 camel/providers/local/camel-local-private.c        |   10 +-
 camel/providers/local/camel-local-private.h        |    2 +-
 camel/providers/local/camel-local-provider.c       |   18 +-
 camel/providers/local/camel-local-store.c          |   74 +-
 camel/providers/local/camel-local-store.h          |    6 +-
 camel/providers/local/camel-local-summary.c        |   92 ++--
 camel/providers/local/camel-local-summary.h        |   32 +-
 camel/providers/local/camel-maildir-folder.c       |   26 +-
 camel/providers/local/camel-maildir-folder.h       |    2 +-
 camel/providers/local/camel-maildir-store.c        |   62 +-
 camel/providers/local/camel-maildir-summary.c      |  108 ++--
 camel/providers/local/camel-maildir-summary.h      |    8 +-
 camel/providers/local/camel-mbox-folder.c          |   36 +-
 camel/providers/local/camel-mbox-folder.h          |    4 +-
 camel/providers/local/camel-mbox-store.c           |   94 ++--
 camel/providers/local/camel-mbox-summary.c         |  122 ++--
 camel/providers/local/camel-mbox-summary.h         |   12 +-
 camel/providers/local/camel-mh-folder.c            |   18 +-
 camel/providers/local/camel-mh-folder.h            |    2 +-
 camel/providers/local/camel-mh-store.c             |   62 +-
 camel/providers/local/camel-mh-summary.c           |   48 +-
 camel/providers/local/camel-mh-summary.h           |    2 +-
 camel/providers/local/camel-spool-folder.c         |   10 +-
 camel/providers/local/camel-spool-folder.h         |    4 +-
 camel/providers/local/camel-spool-store.c          |   62 +-
 camel/providers/local/camel-spool-summary.c        |   22 +-
 camel/providers/local/camel-spool-summary.h        |   16 +-
 camel/providers/nntp/camel-nntp-auth.c             |    4 +-
 camel/providers/nntp/camel-nntp-auth.h             |    2 +-
 camel/providers/nntp/camel-nntp-folder.c           |   48 +-
 camel/providers/nntp/camel-nntp-folder.h           |    6 +-
 camel/providers/nntp/camel-nntp-grouplist.c        |   12 +-
 camel/providers/nntp/camel-nntp-grouplist.h        |    2 +-
 camel/providers/nntp/camel-nntp-newsrc.c           |   74 +-
 camel/providers/nntp/camel-nntp-newsrc.h           |   18 +-
 camel/providers/nntp/camel-nntp-private.h          |    2 +-
 camel/providers/nntp/camel-nntp-provider.c         |    8 +-
 camel/providers/nntp/camel-nntp-store-summary.c    |   60 +-
 camel/providers/nntp/camel-nntp-store-summary.h    |   22 +-
 camel/providers/nntp/camel-nntp-store.c            |  210 +++---
 camel/providers/nntp/camel-nntp-store.h            |   20 +-
 camel/providers/nntp/camel-nntp-stream.c           |   36 +-
 camel/providers/nntp/camel-nntp-stream.h           |   12 +-
 camel/providers/nntp/camel-nntp-summary.c          |   50 +-
 camel/providers/nntp/camel-nntp-summary.h          |    4 +-
 camel/providers/nntp/camel-nntp-utils.c            |   48 +-
 camel/providers/nntp/test-newsrc.c                 |    4 +-
 camel/providers/pop3/camel-pop3-engine.c           |   40 +-
 camel/providers/pop3/camel-pop3-engine.h           |   18 +-
 camel/providers/pop3/camel-pop3-folder.c           |   72 +-
 camel/providers/pop3/camel-pop3-folder.h           |    6 +-
 camel/providers/pop3/camel-pop3-provider.c         |    4 +-
 camel/providers/pop3/camel-pop3-store.c            |   64 +-
 camel/providers/pop3/camel-pop3-store.h            |    4 +-
 camel/providers/pop3/camel-pop3-stream.c           |   38 +-
 camel/providers/pop3/camel-pop3-stream.h           |   12 +-
 .../providers/sendmail/camel-sendmail-transport.c  |   12 +-
 camel/providers/smtp/camel-smtp-provider.c         |    4 +-
 camel/providers/smtp/camel-smtp-transport.c        |  132 ++--
 camel/tests/folder/test1.c                         |   10 +-
 camel/tests/folder/test10.c                        |   18 +-
 camel/tests/folder/test11.c                        |   10 +-
 camel/tests/folder/test2.c                         |   10 +-
 camel/tests/folder/test3.c                         |   38 +-
 camel/tests/folder/test4.c                         |   10 +-
 camel/tests/folder/test5.c                         |   10 +-
 camel/tests/folder/test6.c                         |   10 +-
 camel/tests/folder/test7.c                         |   10 +-
 camel/tests/folder/test8.c                         |   30 +-
 camel/tests/folder/test9.c                         |   20 +-
 camel/tests/lib/address-data.h                     |   10 +-
 camel/tests/lib/addresses.c                        |    6 +-
 camel/tests/lib/camel-test-provider.c              |    6 +-
 camel/tests/lib/camel-test-provider.h              |    2 +-
 camel/tests/lib/camel-test.c                       |   50 +-
 camel/tests/lib/camel-test.h                       |   18 +-
 camel/tests/lib/folders.c                          |   44 +-
 camel/tests/lib/folders.h                          |   10 +-
 camel/tests/lib/messages.c                         |   38 +-
 camel/tests/lib/messages.h                         |   14 +-
 camel/tests/lib/session.c                          |    2 +-
 camel/tests/lib/session.h                          |    2 +-
 camel/tests/lib/streams.c                          |   16 +-
 camel/tests/lib/streams.h                          |    2 +-
 camel/tests/message/test1.c                        |   18 +-
 camel/tests/message/test2.c                        |   22 +-
 camel/tests/message/test3.c                        |    2 +-
 camel/tests/message/test4.c                        |   12 +-
 camel/tests/mime-filter/test-charset.c             |   14 +-
 camel/tests/mime-filter/test-crlf.c                |   16 +-
 camel/tests/mime-filter/test-tohtml.c              |   12 +-
 camel/tests/mime-filter/test1.c                    |   18 +-
 camel/tests/misc/rfc2047.c                         |   18 +-
 camel/tests/misc/split.c                           |   22 +-
 camel/tests/misc/test1.c                           |   10 +-
 camel/tests/misc/test2.c                           |   20 +-
 camel/tests/misc/url-scan.c                        |   10 +-
 camel/tests/misc/url.c                             |   14 +-
 camel/tests/misc/utf7.c                            |   20 +-
 camel/tests/smime/pgp-mime.c                       |   18 +-
 camel/tests/smime/pgp.c                            |   18 +-
 camel/tests/smime/pkcs7.c                          |   16 +-
 camel/tests/stream/test1.c                         |   10 +-
 camel/tests/stream/test2.c                         |   10 +-
 camel/tests/stream/test3.c                         |    4 +-
 iconv-detect.c                                     |   18 +-
 libdb/btree/bt_compare.c                           |   16 +-
 libdb/btree/bt_conv.c                              |   18 +-
 libdb/btree/bt_curadj.c                            |   54 +-
 libdb/btree/bt_cursor.c                            |  126 ++--
 libdb/btree/bt_delete.c                            |   22 +-
 libdb/btree/bt_method.c                            |   46 +-
 libdb/btree/bt_open.c                              |   40 +-
 libdb/btree/bt_put.c                               |   26 +-
 libdb/btree/bt_rec.c                               |   92 ++--
 libdb/btree/bt_reclaim.c                           |   14 +-
 libdb/btree/bt_recno.c                             |   78 +-
 libdb/btree/bt_rsearch.c                           |   22 +-
 libdb/btree/bt_search.c                            |   26 +-
 libdb/btree/bt_split.c                             |   40 +-
 libdb/btree/bt_stat.c                              |   36 +-
 libdb/btree/bt_upgrade.c                           |   32 +-
 libdb/btree/bt_verify.c                            |  110 ++--
 libdb/btree/btree_auto.c                           |  328 ++++----
 libdb/build_vxworks/db.h                           |  478 ++++++------
 libdb/build_vxworks/db_archive/db_archive.c        |   42 +-
 libdb/build_vxworks/db_checkpoint/db_checkpoint.c  |   40 +-
 libdb/build_vxworks/db_deadlock/db_deadlock.c      |   42 +-
 libdb/build_vxworks/db_dump/db_dump.c              |   88 +-
 libdb/build_vxworks/db_int.h                       |    4 +-
 libdb/build_vxworks/db_load/db_load.c              |  142 ++--
 libdb/build_vxworks/db_printlog/db_printlog.c      |   56 +-
 libdb/build_vxworks/db_recover/db_recover.c        |   54 +-
 libdb/build_vxworks/db_stat/db_stat.c              |  134 ++--
 libdb/build_vxworks/db_upgrade/db_upgrade.c        |   42 +-
 libdb/build_vxworks/db_verify/db_verify.c          |   44 +-
 libdb/build_vxworks/dbdemo/dbdemo.c                |   34 +-
 libdb/build_win32/db.h                             |  486 ++++++------
 libdb/build_win32/db_config.h                      |    6 +-
 libdb/build_win32/db_cxx.h                         |  392 +++++-----
 libdb/build_win32/db_int.h                         |    4 +-
 libdb/clib/getcwd.c                                |   16 +-
 libdb/clib/getopt.c                                |   18 +-
 libdb/clib/memcmp.c                                |   12 +-
 libdb/clib/memmove.c                               |   20 +-
 libdb/clib/raise.c                                 |    8 +-
 libdb/clib/snprintf.c                              |   18 +-
 libdb/clib/strcasecmp.c                            |   28 +-
 libdb/clib/strdup.c                                |   10 +-
 libdb/clib/strerror.c                              |   18 +-
 libdb/clib/vsnprintf.c                             |   10 +-
 libdb/common/db_byteorder.c                        |   16 +-
 libdb/common/db_err.c                              |  112 ++--
 libdb/common/db_getlong.c                          |   26 +-
 libdb/common/db_idspace.c                          |   12 +-
 libdb/common/db_log2.c                             |    2 +-
 libdb/common/util_arg.c                            |   30 +-
 libdb/common/util_cache.c                          |   12 +-
 libdb/common/util_log.c                            |   10 +-
 libdb/common/util_sig.c                            |    8 +-
 libdb/db/crdel_auto.c                              |   64 +-
 libdb/db/crdel_rec.c                               |   12 +-
 libdb/db/db.c                                      |  108 ++--
 libdb/db/db_am.c                                   |   86 +-
 libdb/db/db_auto.c                                 |  330 ++++----
 libdb/db/db_cam.c                                  |  108 ++--
 libdb/db/db_conv.c                                 |   24 +-
 libdb/db/db_dispatch.c                             |  174 ++--
 libdb/db/db_dup.c                                  |   22 +-
 libdb/db/db_iface.c                                |  118 ++--
 libdb/db/db_join.c                                 |   34 +-
 libdb/db/db_meta.c                                 |   36 +-
 libdb/db/db_method.c                               |  104 ++--
 libdb/db/db_open.c                                 |   70 +-
 libdb/db/db_overflow.c                             |   64 +-
 libdb/db/db_pr.c                                   |  116 ++--
 libdb/db/db_rec.c                                  |   92 ++--
 libdb/db/db_reclaim.c                              |   34 +-
 libdb/db/db_remove.c                               |   44 +-
 libdb/db/db_rename.c                               |   42 +-
 libdb/db/db_ret.c                                  |   24 +-
 libdb/db/db_truncate.c                             |    8 +-
 libdb/db/db_upg.c                                  |   36 +-
 libdb/db/db_upg_opd.c                              |   26 +-
 libdb/db/db_vrfy.c                                 |  188 +++---
 libdb/db/db_vrfyutil.c                             |  130 ++--
 libdb/db185/db185.c                                |   34 +-
 libdb/db_archive/db_archive.c                      |   34 +-
 libdb/db_checkpoint/db_checkpoint.c                |   32 +-
 libdb/db_deadlock/db_deadlock.c                    |   34 +-
 libdb/db_dump/db_dump.c                            |   80 +-
 libdb/db_dump185/db_dump185.c                      |   28 +-
 libdb/db_load/db_load.c                            |  134 ++--
 libdb/db_printlog/db_printlog.c                    |   48 +-
 libdb/db_recover/db_recover.c                      |   46 +-
 libdb/db_stat/db_stat.c                            |  126 ++--
 libdb/db_upgrade/db_upgrade.c                      |   34 +-
 libdb/db_verify/db_verify.c                        |   36 +-
 libdb/dbinc/btree.h                                |    2 +-
 libdb/dbinc/crypto.h                               |    6 +-
 libdb/dbinc/cxx_except.h                           |   34 +-
 libdb/dbinc/cxx_int.h                              |   12 +-
 libdb/dbinc/db_am.h                                |    4 +-
 libdb/dbinc/db_dispatch.h                          |    4 +-
 libdb/dbinc/db_server_int.h                        |   12 +-
 libdb/dbinc/debug.h                                |    4 +-
 libdb/dbinc/globals.h                              |   26 +-
 libdb/dbinc/hash.h                                 |    2 +-
 libdb/dbinc/lock.h                                 |    2 +-
 libdb/dbinc/mp.h                                   |    4 +-
 libdb/dbinc/mutex.h                                |   56 +-
 libdb/dbinc/qam.h                                  |   10 +-
 libdb/dbinc/queue.h                                |   20 +-
 libdb/dbinc/region.h                               |    2 +-
 libdb/dbinc/rep.h                                  |    4 +-
 libdb/dbinc/shqueue.h                              |   16 +-
 libdb/dbinc/tcl_db.h                               |   14 +-
 libdb/dbinc/xa.h                                   |   34 +-
 libdb/dbinc_auto/btree_ext.h                       |  230 +++---
 libdb/dbinc_auto/clib_ext.h                        |   24 +-
 libdb/dbinc_auto/common_ext.h                      |   48 +-
 libdb/dbinc_auto/crypto_ext.h                      |   40 +-
 libdb/dbinc_auto/db_ext.h                          |  402 +++++-----
 libdb/dbinc_auto/db_server.h                       |  194 +++---
 libdb/dbinc_auto/dbreg_ext.h                       |   56 +-
 libdb/dbinc_auto/env_ext.h                         |   52 +-
 libdb/dbinc_auto/fileops_ext.h                     |   78 +-
 libdb/dbinc_auto/hash_ext.h                        |  208 +++---
 libdb/dbinc_auto/hmac_ext.h                        |    8 +-
 libdb/dbinc_auto/lock_ext.h                        |   42 +-
 libdb/dbinc_auto/log_ext.h                         |   30 +-
 libdb/dbinc_auto/mp_ext.h                          |   48 +-
 libdb/dbinc_auto/mutex_ext.h                       |   38 +-
 libdb/dbinc_auto/os_ext.h                          |  106 ++--
 libdb/dbinc_auto/qam_ext.h                         |  112 ++--
 libdb/dbinc_auto/rep_ext.h                         |   34 +-
 libdb/dbinc_auto/rpc_client_ext.h                  |  302 ++++----
 libdb/dbinc_auto/rpc_server_ext.h                  |   50 +-
 libdb/dbinc_auto/tcl_ext.h                         |  120 ++--
 libdb/dbinc_auto/txn_ext.h                         |  104 ++--
 libdb/dbinc_auto/xa_ext.h                          |   12 +-
 libdb/dbm/dbm.c                                    |   52 +-
 libdb/dbreg/dbreg.c                                |   46 +-
 libdb/dbreg/dbreg_auto.c                           |   66 +-
 libdb/dbreg/dbreg_rec.c                            |   18 +-
 libdb/dbreg/dbreg_util.c                           |  108 ++--
 libdb/env/db_salloc.c                              |   36 +-
 libdb/env/db_shash.c                               |   12 +-
 libdb/env/env_file.c                               |   30 +-
 libdb/env/env_method.c                             |  114 ++--
 libdb/env/env_open.c                               |   98 ++--
 libdb/env/env_recover.c                            |   38 +-
 libdb/env/env_region.c                             |   74 +-
 libdb/examples_c/bench_001.c                       |   40 +-
 libdb/examples_c/ex_access.c                       |   26 +-
 libdb/examples_c/ex_apprec/ex_apprec.c             |   40 +-
 libdb/examples_c/ex_apprec/ex_apprec.h             |   14 +-
 libdb/examples_c/ex_apprec/ex_apprec_auto.c        |   40 +-
 libdb/examples_c/ex_apprec/ex_apprec_rec.c         |   12 +-
 libdb/examples_c/ex_btrec.c                        |   18 +-
 libdb/examples_c/ex_dbclient.c                     |   42 +-
 libdb/examples_c/ex_env.c                          |   22 +-
 libdb/examples_c/ex_lock.c                         |   34 +-
 libdb/examples_c/ex_mpool.c                        |   64 +-
 libdb/examples_c/ex_repquote/ex_repquote.h         |   46 +-
 libdb/examples_c/ex_repquote/ex_rq_client.c        |   48 +-
 libdb/examples_c/ex_repquote/ex_rq_main.c          |   36 +-
 libdb/examples_c/ex_repquote/ex_rq_master.c        |   22 +-
 libdb/examples_c/ex_repquote/ex_rq_net.c           |  116 ++--
 libdb/examples_c/ex_repquote/ex_rq_util.c          |   74 +-
 libdb/examples_c/ex_thread.c                       |  108 ++--
 libdb/examples_c/ex_tpcb.c                         |   84 +-
 libdb/fileops/fileops_auto.c                       |  210 +++---
 libdb/fileops/fop_basic.c                          |   62 +-
 libdb/fileops/fop_rec.c                            |   72 +-
 libdb/fileops/fop_util.c                           |   90 +-
 libdb/hash/hash.c                                  |   96 ++--
 libdb/hash/hash_auto.c                             |  334 ++++----
 libdb/hash/hash_conv.c                             |   22 +-
 libdb/hash/hash_dup.c                              |   46 +-
 libdb/hash/hash_func.c                             |   24 +-
 libdb/hash/hash_meta.c                             |   18 +-
 libdb/hash/hash_method.c                           |   22 +-
 libdb/hash/hash_open.c                             |   38 +-
 libdb/hash/hash_page.c                             |  110 ++--
 libdb/hash/hash_rec.c                              |   96 ++--
 libdb/hash/hash_reclaim.c                          |   14 +-
 libdb/hash/hash_stat.c                             |   32 +-
 libdb/hash/hash_upgrade.c                          |   40 +-
 libdb/hash/hash_verify.c                           |   66 +-
 libdb/hmac/hmac.c                                  |   18 +-
 libdb/hmac/sha1.c                                  |   42 +-
 libdb/hsearch/hsearch.c                            |   12 +-
 libdb/libdb_java/java_Db.c                         |   62 +-
 libdb/libdb_java/java_DbEnv.c                      |  100 ++--
 libdb/libdb_java/java_DbLock.c                     |    2 +-
 libdb/libdb_java/java_DbLogc.c                     |    6 +-
 libdb/libdb_java/java_DbLsn.c                      |    2 +-
 libdb/libdb_java/java_DbTxn.c                      |    6 +-
 libdb/libdb_java/java_DbUtil.c                     |    2 +-
 libdb/libdb_java/java_DbXAResource.c               |   38 +-
 libdb/libdb_java/java_Dbc.c                        |   14 +-
 libdb/libdb_java/java_Dbt.c                        |    4 +-
 libdb/libdb_java/java_info.c                       |   82 +-
 libdb/libdb_java/java_info.h                       |   38 +-
 libdb/libdb_java/java_locked.c                     |    8 +-
 libdb/libdb_java/java_locked.h                     |   12 +-
 libdb/libdb_java/java_stat_auto.c                  |   16 +-
 libdb/libdb_java/java_stat_auto.h                  |   16 +-
 libdb/libdb_java/java_util.c                       |  166 ++--
 libdb/libdb_java/java_util.h                       |  148 ++--
 libdb/lock/lock.c                                  |  120 ++--
 libdb/lock/lock_deadlock.c                         |   30 +-
 libdb/lock/lock_method.c                           |   20 +-
 libdb/lock/lock_region.c                           |   22 +-
 libdb/lock/lock_stat.c                             |   22 +-
 libdb/lock/lock_util.c                             |   14 +-
 libdb/log/log.c                                    |   78 +-
 libdb/log/log_archive.c                            |   62 +-
 libdb/log/log_compare.c                            |    6 +-
 libdb/log/log_get.c                                |   62 +-
 libdb/log/log_method.c                             |   12 +-
 libdb/log/log_put.c                                |   90 +-
 libdb/mp/mp_alloc.c                                |   18 +-
 libdb/mp/mp_bh.c                                   |   38 +-
 libdb/mp/mp_fget.c                                 |   24 +-
 libdb/mp/mp_fopen.c                                |   82 +-
 libdb/mp/mp_fput.c                                 |   10 +-
 libdb/mp/mp_fset.c                                 |   10 +-
 libdb/mp/mp_method.c                               |    8 +-
 libdb/mp/mp_region.c                               |   36 +-
 libdb/mp/mp_register.c                             |   18 +-
 libdb/mp/mp_stat.c                                 |   30 +-
 libdb/mp/mp_sync.c                                 |   40 +-
 libdb/mp/mp_trickle.c                              |   10 +-
 libdb/mutex/mut_fcntl.c                            |   20 +-
 libdb/mutex/mut_pthread.c                          |   30 +-
 libdb/mutex/mut_tas.c                              |   20 +-
 libdb/mutex/mut_win32.c                            |   24 +-
 libdb/mutex/mutex.c                                |   24 +-
 libdb/mutex/tm.c                                   |   94 ++--
 libdb/os/os_abs.c                                  |    8 +-
 libdb/os/os_alloc.c                                |  122 ++--
 libdb/os/os_clock.c                                |   12 +-
 libdb/os/os_config.c                               |    6 +-
 libdb/os/os_dir.c                                  |   24 +-
 libdb/os/os_errno.c                                |   12 +-
 libdb/os/os_fid.c                                  |   14 +-
 libdb/os/os_fsync.c                                |   20 +-
 libdb/os/os_handle.c                               |   20 +-
 libdb/os/os_id.c                                   |    2 +-
 libdb/os/os_map.c                                  |   58 +-
 libdb/os/os_method.c                               |  128 ++--
 libdb/os/os_oflags.c                               |   12 +-
 libdb/os/os_open.c                                 |   36 +-
 libdb/os/os_region.c                               |   14 +-
 libdb/os/os_rename.c                               |   12 +-
 libdb/os/os_root.c                                 |    6 +-
 libdb/os/os_rpath.c                                |   16 +-
 libdb/os/os_rw.c                                   |   36 +-
 libdb/os/os_seek.c                                 |   10 +-
 libdb/os/os_sleep.c                                |    8 +-
 libdb/os/os_spin.c                                 |   10 +-
 libdb/os/os_stat.c                                 |   22 +-
 libdb/os/os_tmpdir.c                               |   16 +-
 libdb/os/os_unlink.c                               |   22 +-
 libdb/os_vxworks/os_vx_abs.c                       |   10 +-
 libdb/os_vxworks/os_vx_config.c                    |    6 +-
 libdb/os_vxworks/os_vx_map.c                       |   76 +-
 libdb/os_win32/os_abs.c                            |    6 +-
 libdb/os_win32/os_clock.c                          |    4 +-
 libdb/os_win32/os_config.c                         |    4 +-
 libdb/os_win32/os_dir.c                            |   18 +-
 libdb/os_win32/os_errno.c                          |   12 +-
 libdb/os_win32/os_fid.c                            |   10 +-
 libdb/os_win32/os_fsync.c                          |    8 +-
 libdb/os_win32/os_handle.c                         |   18 +-
 libdb/os_win32/os_map.c                            |   46 +-
 libdb/os_win32/os_open.c                           |   14 +-
 libdb/os_win32/os_rename.c                         |    8 +-
 libdb/os_win32/os_rw.c                             |   36 +-
 libdb/os_win32/os_seek.c                           |    8 +-
 libdb/os_win32/os_sleep.c                          |    4 +-
 libdb/os_win32/os_spin.c                           |    4 +-
 libdb/os_win32/os_stat.c                           |   20 +-
 libdb/os_win32/os_type.c                           |    8 +-
 libdb/perl/BerkeleyDB/constants.h                  |   34 +-
 libdb/perl/BerkeleyDB/ppport.h                     |   10 +-
 libdb/perl/DB_File/fallback.h                      |   14 +-
 libdb/perl/DB_File/ppport.h                        |   10 +-
 libdb/perl/DB_File/version.c                       |    4 +-
 libdb/qam/qam.c                                    |   74 +-
 libdb/qam/qam_auto.c                               |  196 +++---
 libdb/qam/qam_conv.c                               |   12 +-
 libdb/qam/qam_files.c                              |   56 +-
 libdb/qam/qam_method.c                             |   48 +-
 libdb/qam/qam_open.c                               |   34 +-
 libdb/qam/qam_rec.c                                |   52 +-
 libdb/qam/qam_stat.c                               |   10 +-
 libdb/qam/qam_upgrade.c                            |   14 +-
 libdb/qam/qam_verify.c                             |   18 +-
 libdb/rep/rep_method.c                             |   70 +-
 libdb/rep/rep_record.c                             |   36 +-
 libdb/rep/rep_region.c                             |   26 +-
 libdb/rep/rep_util.c                               |   94 ++--
 libdb/rpc_client/client.c                          |   80 +-
 libdb/rpc_client/db_server_clnt.c                  |  100 ++--
 libdb/rpc_client/gen_client.c                      |  842 ++++++++++----------
 libdb/rpc_client/gen_client_ret.c                  |  178 ++--
 libdb/rpc_server/c/db_server_proc.c                |  232 +++---
 libdb/rpc_server/c/db_server_svc.c                 |  112 ++--
 libdb/rpc_server/c/db_server_util.c                |   82 +-
 libdb/rpc_server/c/db_server_xdr.c                 |   64 +-
 libdb/rpc_server/c/gen_db_server.c                 |   32 +-
 libdb/tcl/tcl_compat.c                             |   68 +-
 libdb/tcl/tcl_db.c                                 |  132 ++--
 libdb/tcl/tcl_db_pkg.c                             |  126 ++--
 libdb/tcl/tcl_dbcursor.c                           |   46 +-
 libdb/tcl/tcl_env.c                                |   78 +-
 libdb/tcl/tcl_internal.c                           |  160 ++--
 libdb/tcl/tcl_lock.c                               |   82 +-
 libdb/tcl/tcl_log.c                                |   86 +-
 libdb/tcl/tcl_mp.c                                 |  116 ++--
 libdb/tcl/tcl_rep.c                                |   68 +-
 libdb/tcl/tcl_txn.c                                |   68 +-
 libdb/tcl/tcl_util.c                               |   34 +-
 libdb/test/scr017/t.c                              |   20 +-
 libdb/test/scr018/t.c                              |   12 +-
 libdb/txn/txn.c                                    |  106 ++--
 libdb/txn/txn_auto.c                               |  202 +++---
 libdb/txn/txn_method.c                             |    6 +-
 libdb/txn/txn_rec.c                                |   58 +-
 libdb/txn/txn_recover.c                            |   18 +-
 libdb/txn/txn_region.c                             |   28 +-
 libdb/txn/txn_stat.c                               |    8 +-
 libdb/txn/txn_util.c                               |   28 +-
 libdb/xa/xa.c                                      |   50 +-
 libdb/xa/xa_db.c                                   |   44 +-
 libdb/xa/xa_map.c                                  |   28 +-
 libebackend/e-data-server-module.c                 |   16 +-
 libebackend/e-data-server-module.h                 |    2 +-
 libebackend/e-db3-utils.c                          |   50 +-
 libebackend/e-db3-utils.h                          |    4 +-
 libebackend/e-dbhash.c                             |   18 +-
 libebackend/e-dbhash.h                             |   10 +-
 libebackend/e-file-cache.c                         |   44 +-
 libebackend/e-file-cache.h                         |   12 +-
 libedataserver/e-account-list.c                    |   20 +-
 libedataserver/e-account-list.h                    |    4 +-
 libedataserver/e-account.c                         |  144 ++--
 libedataserver/e-account.h                         |   52 +-
 libedataserver/e-categories.c                      |   20 +-
 libedataserver/e-categories.h                      |   16 +-
 libedataserver/e-data-server-util.c                |   76 +-
 libedataserver/e-data-server-util.h                |   16 +-
 libedataserver/e-iconv.c                           |   74 +-
 libedataserver/e-iconv.h                           |   12 +-
 libedataserver/e-iterator.c                        |    4 +-
 libedataserver/e-iterator.h                        |   10 +-
 libedataserver/e-list-iterator.c                   |   18 +-
 libedataserver/e-list.c                            |   12 +-
 libedataserver/e-list.h                            |    6 +-
 libedataserver/e-memory.c                          |  174 ++--
 libedataserver/e-memory.h                          |   32 +-
 libedataserver/e-msgport.c                         |  100 ++--
 libedataserver/e-msgport.h                         |   34 +-
 libedataserver/e-proxy.c                           |   34 +-
 libedataserver/e-proxy.h                           |    4 +-
 libedataserver/e-sexp.c                            |  192 +++---
 libedataserver/e-sexp.h                            |   58 +-
 libedataserver/e-source-group.c                    |   46 +-
 libedataserver/e-source-group.h                    |   30 +-
 libedataserver/e-source-list.c                     |   66 +-
 libedataserver/e-source-list.h                     |   24 +-
 libedataserver/e-source.c                          |   82 +-
 libedataserver/e-source.h                          |   36 +-
 libedataserver/e-time-utils.c                      |  158 ++--
 libedataserver/e-time-utils.h                      |    4 +-
 libedataserver/e-trie.c                            |   36 +-
 libedataserver/e-trie.h                            |    4 +-
 libedataserver/e-uid.c                             |    8 +-
 libedataserver/e-uid.h                             |    2 +-
 libedataserver/e-url.c                             |   40 +-
 libedataserver/e-url.h                             |   28 +-
 libedataserver/e-xml-hash-utils.c                  |   22 +-
 libedataserver/e-xml-hash-utils.h                  |   18 +-
 libedataserver/e-xml-utils.c                       |   12 +-
 libedataserver/e-xml-utils.h                       |    4 +-
 libedataserver/libedataserver-private.h            |    6 +-
 libedataserver/md5-utils.c                         |    2 +-
 libedataserver/test-source-list.c                  |   52 +-
 libedataserverui/e-book-auth-util.c                |   12 +-
 libedataserverui/e-categories-dialog.c             |   28 +-
 libedataserverui/e-destination-store.c             |    6 +-
 libedataserverui/e-destination-store.h             |    2 +-
 libedataserverui/e-name-selector-dialog.c          |    4 +-
 libedataserverui/e-name-selector-entry.c           |   68 +-
 libedataserverui/e-name-selector-entry.h           |    8 +-
 libedataserverui/e-name-selector-list.c            |   22 +-
 libedataserverui/e-name-selector-list.h            |    2 +-
 libedataserverui/e-passwords.c                     |   12 +-
 libedataserverui/e-passwords.h                     |   18 +-
 libedataserverui/e-source-option-menu.c            |   12 +-
 libedataserverui/e-source-selector-dialog.c        |    2 +-
 libedataserverui/e-source-selector.c               |   30 +-
 libedataserverui/test-category-completion.c        |    4 +-
 libedataserverui/test-contact-store.c              |   10 +-
 libedataserverui/test-name-selector.c              |    6 +-
 libedataserverui/test-source-combo-box.c           |   10 +-
 libedataserverui/test-source-selector.c            |   12 +-
 servers/exchange/lib/actest.c                      |   16 +-
 servers/exchange/lib/cptest.c                      |   14 +-
 servers/exchange/lib/davcat.c                      |   14 +-
 servers/exchange/lib/e2k-action.c                  |   42 +-
 servers/exchange/lib/e2k-autoconfig.c              |   92 ++--
 servers/exchange/lib/e2k-autoconfig.h              |   36 +-
 servers/exchange/lib/e2k-context.c                 |  274 ++++----
 servers/exchange/lib/e2k-context.h                 |  136 ++--
 servers/exchange/lib/e2k-freebusy.c                |   48 +-
 servers/exchange/lib/e2k-freebusy.h                |   10 +-
 servers/exchange/lib/e2k-global-catalog-ldap.h     |    2 +-
 servers/exchange/lib/e2k-global-catalog.c          |  130 ++--
 servers/exchange/lib/e2k-global-catalog.h          |   34 +-
 servers/exchange/lib/e2k-http-utils.c              |   26 +-
 servers/exchange/lib/e2k-http-utils.h              |   10 +-
 servers/exchange/lib/e2k-kerberos.c                |   26 +-
 servers/exchange/lib/e2k-kerberos.h                |   16 +-
 servers/exchange/lib/e2k-path.c                    |   32 +-
 servers/exchange/lib/e2k-path.h                    |   10 +-
 servers/exchange/lib/e2k-properties.c              |   78 +-
 servers/exchange/lib/e2k-properties.h              |   52 +-
 servers/exchange/lib/e2k-restriction.c             |   74 +-
 servers/exchange/lib/e2k-restriction.h             |   42 +-
 servers/exchange/lib/e2k-result.c                  |   46 +-
 servers/exchange/lib/e2k-result.h                  |   22 +-
 servers/exchange/lib/e2k-rule-xml.c                |   88 +-
 servers/exchange/lib/e2k-rule.c                    |   34 +-
 servers/exchange/lib/e2k-rule.h                    |   34 +-
 servers/exchange/lib/e2k-security-descriptor.c     |   40 +-
 servers/exchange/lib/e2k-security-descriptor.h     |    2 +-
 servers/exchange/lib/e2k-sid.c                     |   24 +-
 servers/exchange/lib/e2k-sid.h                     |   10 +-
 servers/exchange/lib/e2k-uri.c                     |   52 +-
 servers/exchange/lib/e2k-uri.h                     |   40 +-
 servers/exchange/lib/e2k-utils.c                   |   92 ++--
 servers/exchange/lib/e2k-utils.h                   |   32 +-
 servers/exchange/lib/e2k-validate.h                |   10 +-
 servers/exchange/lib/e2k-xml-utils.c               |   14 +-
 servers/exchange/lib/e2k-xml-utils.h               |   10 +-
 servers/exchange/lib/ebrowse.c                     |  116 ++--
 servers/exchange/lib/fbtest.c                      |   10 +-
 servers/exchange/lib/gctest.c                      |   32 +-
 servers/exchange/lib/ruletest.c                    |   12 +-
 servers/exchange/lib/test-utils.c                  |   38 +-
 servers/exchange/lib/test-utils.h                  |   14 +-
 servers/exchange/lib/urltest.c                     |    8 +-
 servers/exchange/storage/e-folder-exchange.c       |  102 ++--
 servers/exchange/storage/e-folder-exchange.h       |   84 +-
 servers/exchange/storage/e-folder-tree.c           |   56 +-
 servers/exchange/storage/e-folder-tree.h           |   16 +-
 servers/exchange/storage/e-folder-type-registry.c  |   84 +-
 servers/exchange/storage/e-folder-type-registry.h  |   36 +-
 servers/exchange/storage/e-folder.c                |   66 +-
 servers/exchange/storage/e-folder.h                |   44 +-
 servers/exchange/storage/e-storage.c               |  144 ++--
 servers/exchange/storage/e-storage.h               |  102 ++--
 servers/exchange/storage/exchange-account.c        |  206 +++---
 servers/exchange/storage/exchange-account.h        |   80 +-
 servers/exchange/storage/exchange-esource.c        |   26 +-
 servers/exchange/storage/exchange-esource.h        |    6 +-
 servers/exchange/storage/exchange-folder-size.c    |    8 +-
 servers/exchange/storage/exchange-folder-size.h    |    6 +-
 .../storage/exchange-hierarchy-favorites.c         |   38 +-
 .../storage/exchange-hierarchy-favorites.h         |   14 +-
 .../exchange/storage/exchange-hierarchy-foreign.c  |   98 ++--
 .../exchange/storage/exchange-hierarchy-foreign.h  |   16 +-
 servers/exchange/storage/exchange-hierarchy-gal.c  |    4 +-
 servers/exchange/storage/exchange-hierarchy-gal.h  |    4 +-
 .../exchange/storage/exchange-hierarchy-somedav.c  |   20 +-
 .../exchange/storage/exchange-hierarchy-somedav.h  |    6 +-
 .../exchange/storage/exchange-hierarchy-webdav.c   |  128 ++--
 .../exchange/storage/exchange-hierarchy-webdav.h   |   24 +-
 servers/exchange/storage/exchange-hierarchy.c      |   26 +-
 servers/exchange/storage/exchange-hierarchy.h      |   26 +-
 servers/exchange/storage/exchange-oof.c            |   28 +-
 servers/exchange/storage/exchange-oof.h            |    4 +-
 servers/exchange/xntlm/xntlm-des.c                 |   22 +-
 servers/exchange/xntlm/xntlm-des.h                 |    4 +-
 servers/exchange/xntlm/xntlm-md4.c                 |   12 +-
 servers/exchange/xntlm/xntlm-md4.h                 |    4 +-
 servers/exchange/xntlm/xntlm.c                     |   42 +-
 servers/exchange/xntlm/xntlm.h                     |   10 +-
 .../google/libgdata-google/gdata-google-service.c  |    4 +-
 servers/google/libgdata/gdata-entry.h              |    6 +-
 servers/google/libgdata/gdata-feed.c               |    6 +-
 servers/google/libgdata/gdata-service-iface.c      |    4 +-
 servers/groupwise/create-account.c                 |   10 +-
 servers/groupwise/e-gw-connection.c                |  256 +++---
 servers/groupwise/e-gw-connection.h                |  126 ++--
 servers/groupwise/e-gw-container.c                 |   70 +-
 servers/groupwise/e-gw-container.h                 |   24 +-
 servers/groupwise/e-gw-filter.c                    |   20 +-
 servers/groupwise/e-gw-filter.h                    |    4 +-
 servers/groupwise/e-gw-item.c                      |  356 ++++----
 servers/groupwise/e-gw-item.h                      |  202 +++---
 servers/groupwise/e-gw-message.c                   |   20 +-
 servers/groupwise/e-gw-message.h                   |   24 +-
 servers/groupwise/e-gw-proxy.c                     |    6 +-
 servers/groupwise/e-gw-proxy.h                     |    8 +-
 servers/groupwise/e-gw-recur-utils.c               |    4 +-
 servers/groupwise/e-gw-recur-utils.h               |   11 +-
 servers/groupwise/e-gw-sendoptions.c               |   22 +-
 servers/groupwise/soap-test.c                      |    6 +-
 servers/groupwise/soup-soap-message.c              |   70 +-
 servers/groupwise/soup-soap-message.h              |   58 +-
 servers/groupwise/soup-soap-response.c             |   64 +-
 servers/groupwise/soup-soap-response.h             |   26 +-
 src/offline-listener.c                             |    2 +-
 src/server-logging.c                               |    4 +-
 src/server-logging.h                               |    2 +-
 src/server.c                                       |   18 +-
 1060 files changed, 25605 insertions(+), 25604 deletions(-)

diff --git a/addressbook/backends/file/e-book-backend-file-factory.c b/addressbook/backends/file/e-book-backend-file-factory.c
index e4a7b81..af1c8a3 100644
--- a/addressbook/backends/file/e-book-backend-file-factory.c
+++ b/addressbook/backends/file/e-book-backend-file-factory.c
@@ -47,7 +47,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = & file_type;
 	*num_types = 1;
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index 560a891..739a414 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -68,27 +68,27 @@
 G_DEFINE_TYPE (EBookBackendFile, e_book_backend_file, E_TYPE_BOOK_BACKEND_SYNC)
 
 struct _EBookBackendFilePrivate {
-	char     *dirname;
-	char     *filename;
-	char     *summary_filename;
+	gchar     *dirname;
+	gchar     *filename;
+	gchar     *summary_filename;
 	DB       *file_db;
 	DB_ENV   *env;
 	EBookBackendSummary *summary;
 	/* for future use */
-	void *reserved1;
-	void *reserved2;
-	void *reserved3;
-	void *reserved4;
+	gpointer reserved1;
+	gpointer reserved2;
+	gpointer reserved3;
+	gpointer reserved4;
 };
 
 G_LOCK_DEFINE_STATIC (global_env);
 static struct {
-	int ref_count;
+	gint ref_count;
 	DB_ENV *env;
 } global_env;
 
 static EBookBackendSyncStatus
-db_error_to_status (const int db_error)
+db_error_to_status (const gint db_error)
 {
 	switch (db_error) {
 	case 0:
@@ -103,16 +103,16 @@ db_error_to_status (const int db_error)
 }
 
 static void
-string_to_dbt(const char *str, DBT *dbt)
+string_to_dbt(const gchar *str, DBT *dbt)
 {
 	memset (dbt, 0, sizeof (*dbt));
-	dbt->data = (void*)str;
+	dbt->data = (gpointer)str;
 	dbt->size = strlen (str) + 1;
 	dbt->flags = DB_DBT_USERMEM;
 }
 
 static EContact*
-create_contact (char *uid, const char *vcard)
+create_contact (gchar *uid, const gchar *vcard)
 {
 	EContact *contact = e_contact_new_from_vcard (vcard);
 	if (!e_contact_get_const (contact, E_CONTACT_UID))
@@ -126,7 +126,7 @@ build_summary (EBookBackendFilePrivate *bfpriv)
 {
 	DB             *db = bfpriv->file_db;
 	DBC            *dbc;
-	int            db_error;
+	gint            db_error;
 	DBT  id_dbt, vcard_dbt;
 
 	db_error = db->cursor (db, NULL, &dbc, 0);
@@ -159,7 +159,7 @@ build_summary (EBookBackendFilePrivate *bfpriv)
 	return TRUE;
 }
 
-static char *
+static gchar *
 e_book_backend_file_create_unique_id (void)
 {
 	/* use a 32 counter and the 32 bit timestamp to make an id.
@@ -172,7 +172,7 @@ e_book_backend_file_create_unique_id (void)
 static void
 set_revision (EContact *contact)
 {
-	char time_string[100] = {0};
+	gchar time_string[100] = {0};
 	const struct tm *tm = NULL;
 	time_t t;
 
@@ -186,15 +186,15 @@ set_revision (EContact *contact)
 
 static EBookBackendSyncStatus
 do_create(EBookBackendFile  *bf,
-	  const char      *vcard_req,
+	  const gchar      *vcard_req,
 	  EContact **contact)
 {
 	DB             *db = bf->priv->file_db;
 	DBT            id_dbt, vcard_dbt;
-	int            db_error;
-	char           *id;
-	char           *vcard;
-	const char *rev;
+	gint            db_error;
+	gchar           *id;
+	gchar           *vcard;
+	const gchar *rev;
 
 	g_assert (bf);
 	g_assert (vcard_req);
@@ -237,7 +237,7 @@ static EBookBackendSyncStatus
 e_book_backend_file_create_contact (EBookBackendSync *backend,
 				    EDataBook *book,
 				    guint32 opid,
-				    const char *vcard,
+				    const gchar *vcard,
 				    EContact **contact)
 {
 	EBookBackendSyncStatus status;
@@ -260,8 +260,8 @@ e_book_backend_file_remove_contacts (EBookBackendSync *backend,
 	EBookBackendFile *bf = E_BOOK_BACKEND_FILE (backend);
 	DB             *db = bf->priv->file_db;
 	DBT            id_dbt;
-	int            db_error;
-	char          *id;
+	gint            db_error;
+	gchar          *id;
 	GList         *l;
 	GList         *removed_cards = NULL;
 	GNOME_Evolution_Addressbook_CallStatus rv = GNOME_Evolution_Addressbook_Success;
@@ -291,7 +291,7 @@ e_book_backend_file_remove_contacts (EBookBackendSync *backend,
 	*ids = removed_cards;
 
 	for (l = removed_cards; l; l = l->next) {
-		char *id = l->data;
+		gchar *id = l->data;
 		e_book_backend_summary_remove_contact (bf->priv->summary, id);
 	}
 
@@ -302,15 +302,15 @@ static EBookBackendSyncStatus
 e_book_backend_file_modify_contact (EBookBackendSync *backend,
 				    EDataBook *book,
 				    guint32 opid,
-				    const char *vcard,
+				    const gchar *vcard,
 				    EContact **contact)
 {
 	EBookBackendFile *bf = E_BOOK_BACKEND_FILE (backend);
 	DB             *db = bf->priv->file_db;
 	DBT            id_dbt, vcard_dbt;
-	int            db_error;
-	const char    *id, *lookup_id;
-	char          *vcard_with_rev;
+	gint            db_error;
+	const gchar    *id, *lookup_id;
+	gchar          *vcard_with_rev;
 
 	*contact = e_contact_new_from_vcard (vcard);
 	id = e_contact_get_const (*contact, E_CONTACT_UID);
@@ -361,13 +361,13 @@ static EBookBackendSyncStatus
 e_book_backend_file_get_contact (EBookBackendSync *backend,
 				 EDataBook *book,
 				 guint32 opid,
-				 const char *id,
-				 char **vcard)
+				 const gchar *id,
+				 gchar **vcard)
 {
 	EBookBackendFile *bf;
 	DB             *db;
 	DBT             id_dbt, vcard_dbt;
-	int             db_error = 0;
+	gint             db_error = 0;
 
 	bf = E_BOOK_BACKEND_FILE (backend);
 	db = bf->priv->file_db;
@@ -392,17 +392,17 @@ static EBookBackendSyncStatus
 e_book_backend_file_get_contact_list (EBookBackendSync *backend,
 				      EDataBook *book,
 				      guint32 opid,
-				      const char *query,
+				      const gchar *query,
 				      GList **contacts)
 {
 	EBookBackendFile *bf = E_BOOK_BACKEND_FILE (backend);
 	DB             *db = bf->priv->file_db;
 	DBC            *dbc;
-	int            db_error;
+	gint            db_error;
 	DBT  id_dbt, vcard_dbt;
 	EBookBackendSExp *card_sexp = NULL;
 	gboolean search_needed;
-	const char *search = query;
+	const gchar *search = query;
 	GList *contact_list = NULL;
 	EBookBackendSyncStatus status;
 
@@ -412,13 +412,13 @@ e_book_backend_file_get_contact_list (EBookBackendSync *backend,
 
 		/* do a summary query */
 		GPtrArray *ids = e_book_backend_summary_search (bf->priv->summary, search);
-		int i;
+		gint i;
 
 		if (!ids)
 			return GNOME_Evolution_Addressbook_ContactNotFound;
 
 		for (i = 0; i < ids->len; i ++) {
-			char *id = g_ptr_array_index (ids, i);
+			gchar *id = g_ptr_array_index (ids, i);
 			string_to_dbt (id, &id_dbt);
 			memset (&vcard_dbt, 0, sizeof (vcard_dbt));
 			vcard_dbt.flags = DB_DBT_MALLOC;
@@ -531,10 +531,10 @@ book_view_thread (gpointer data)
 	EDataBookView *book_view;
 	FileBackendSearchClosure *closure;
 	EBookBackendFile *bf;
-	const char *query;
+	const gchar *query;
 	DB  *db;
 	DBT id_dbt, vcard_dbt;
-	int db_error;
+	gint db_error;
 	gboolean allcontacts;
 
 	g_return_val_if_fail (E_IS_DATA_BOOK_VIEW (data), NULL);
@@ -570,13 +570,13 @@ book_view_thread (gpointer data)
 	if (e_book_backend_summary_is_summary_query (bf->priv->summary, query)) {
 		/* do a summary query */
 		GPtrArray *ids = e_book_backend_summary_search (bf->priv->summary, e_data_book_view_get_card_query (book_view));
-		int i;
+		gint i;
 
 		if (!ids)
 			goto done;
 
 		for (i = 0; i < ids->len; i ++) {
-			char *id = g_ptr_array_index (ids, i);
+			gchar *id = g_ptr_array_index (ids, i);
 
 			if (!e_flag_is_set (closure->running))
 				break;
@@ -698,12 +698,12 @@ typedef struct {
 } EBookBackendFileChangeContext;
 
 static void
-e_book_backend_file_changes_foreach_key (const char *key, gpointer user_data)
+e_book_backend_file_changes_foreach_key (const gchar *key, gpointer user_data)
 {
 	EBookBackendFileChangeContext *ctx = user_data;
 	DB      *db = ctx->db;
 	DBT     id_dbt, vcard_dbt;
-	int     db_error = 0;
+	gint     db_error = 0;
 
 	string_to_dbt (key, &id_dbt);
 	memset (&vcard_dbt, 0, sizeof (vcard_dbt));
@@ -713,8 +713,8 @@ e_book_backend_file_changes_foreach_key (const char *key, gpointer user_data)
 
 	if (db_error != 0) {
 		EContact *contact;
-		char *id = id_dbt.data;
-		char *vcard_string;
+		gchar *id = id_dbt.data;
+		gchar *vcard_string;
 
 		contact = e_contact_new ();
 		e_contact_set (contact, E_CONTACT_UID, id);
@@ -736,13 +736,13 @@ static EBookBackendSyncStatus
 e_book_backend_file_get_changes (EBookBackendSync *backend,
 				 EDataBook *book,
 				 guint32 opid,
-				 const char *change_id,
+				 const gchar *change_id,
 				 GList **changes_out)
 {
 	EBookBackendFile *bf = E_BOOK_BACKEND_FILE (backend);
-	int     db_error = 0;
+	gint     db_error = 0;
 	DBT     id_dbt, vcard_dbt;
-	char    *filename;
+	gchar    *filename;
 	EDbHash *ehash;
 	GList *i, *v;
 	DB      *db = bf->priv->file_db;
@@ -776,8 +776,8 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 			if (id_dbt.size != strlen(E_BOOK_BACKEND_FILE_VERSION_NAME) + 1
 			    || strcmp (id_dbt.data, E_BOOK_BACKEND_FILE_VERSION_NAME)) {
 				EContact *contact;
-				char *id = id_dbt.data;
-				char *vcard_string;
+				gchar *id = id_dbt.data;
+				gchar *vcard_string;
 
 				/* Remove fields the user can't change
 				 * and can change without the rest of the
@@ -823,8 +823,8 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 	else {
 		/* Update the hash and build our changes list */
 		for (i = ctx.add_ids, v = ctx.add_cards; i != NULL; i = i->next, v = v->next){
-			char *id = i->data;
-			char *vcard = v->data;
+			gchar *id = i->data;
+			gchar *vcard = v->data;
 
 			e_dbhash_add (ehash, id, vcard);
 			changes = g_list_prepend (changes,
@@ -834,8 +834,8 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 			g_free (v->data);
 		}
 		for (i = ctx.mod_ids, v = ctx.mod_cards; i != NULL; i = i->next, v = v->next){
-			char *id = i->data;
-			char *vcard = v->data;
+			gchar *id = i->data;
+			gchar *vcard = v->data;
 
 			e_dbhash_add (ehash, id, vcard);
 			changes = g_list_prepend (changes,
@@ -845,8 +845,8 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 			g_free (v->data);
 		}
 		for (i = ctx.del_ids, v = ctx.del_cards; i != NULL; i = i->next, v = v->next){
-			char *id = i->data;
-			char *vcard = v->data;
+			gchar *id = i->data;
+			gchar *vcard = v->data;
 
 			e_dbhash_remove (ehash, id);
 
@@ -867,8 +867,8 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 	return GNOME_Evolution_Addressbook_Success;
 }
 
-static char *
-e_book_backend_file_extract_path_from_uri (const char *uri)
+static gchar *
+e_book_backend_file_extract_path_from_uri (const gchar *uri)
 {
 	g_assert (g_ascii_strncasecmp (uri, "file://", 7) == 0);
 
@@ -879,9 +879,9 @@ static EBookBackendSyncStatus
 e_book_backend_file_authenticate_user (EBookBackendSync *backend,
 				       EDataBook *book,
 				       guint32 opid,
-				       const char *user,
-				       const char *passwd,
-				       const char *auth_method)
+				       const gchar *user,
+				       const gchar *passwd,
+				       const gchar *auth_method)
 {
 	return GNOME_Evolution_Addressbook_Success;
 }
@@ -907,7 +907,7 @@ e_book_backend_file_get_supported_fields (EBookBackendSync *backend,
 					  GList **fields_out)
 {
 	GList *fields = NULL;
-	int i;
+	gint i;
 
 	/* XXX we need a way to say "we support everything", since the
 	   file backend does */
@@ -931,10 +931,10 @@ e_book_backend_file_get_supported_fields (EBookBackendSync *backend,
 **     came about.
 */
 static gboolean
-e_book_backend_file_upgrade_db (EBookBackendFile *bf, char *old_version)
+e_book_backend_file_upgrade_db (EBookBackendFile *bf, gchar *old_version)
 {
 	DB  *db = bf->priv->file_db;
-	int db_error;
+	gint db_error;
 	DBT version_name_dbt, version_dbt;
 
 	if (strcmp (old_version, "0.0")
@@ -949,7 +949,7 @@ e_book_backend_file_upgrade_db (EBookBackendFile *bf, char *old_version)
                    giving them valid ids if they don't have them */
 		DBT  id_dbt, vcard_dbt;
 		DBC *dbc;
-		int  card_failed = 0;
+		gint  card_failed = 0;
 
 		db_error = db->cursor (db, NULL, &dbc, 0);
 		if (db_error != 0) {
@@ -976,7 +976,7 @@ e_book_backend_file_upgrade_db (EBookBackendFile *bf, char *old_version)
 				   so, we need to modify the card to
 				   have the same id as the the dbt. */
 				if (strcmp (id_dbt.data, e_contact_get_const (contact, E_CONTACT_UID))) {
-					char *vcard;
+					gchar *vcard;
 
 					e_contact_set (contact, E_CONTACT_UID, id_dbt.data);
 
@@ -1019,8 +1019,8 @@ e_book_backend_file_maybe_upgrade_db (EBookBackendFile *bf)
 {
 	DB   *db = bf->priv->file_db;
 	DBT  version_name_dbt, version_dbt;
-	int  db_error;
-	char *version;
+	gint  db_error;
+	gchar *version;
 	gboolean ret_val = TRUE;
 
 	string_to_dbt (E_BOOK_BACKEND_FILE_VERSION_NAME, &version_name_dbt);
@@ -1051,9 +1051,9 @@ e_book_backend_file_maybe_upgrade_db (EBookBackendFile *bf)
 
 static void
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
-file_errcall (const DB_ENV *env, const char *buf1, const char *buf2)
+file_errcall (const DB_ENV *env, const gchar *buf1, const gchar *buf2)
 #else
-file_errcall (const char *buf1, char *buf2)
+file_errcall (const gchar *buf1, gchar *buf2)
 #endif
 {
 	g_warning ("libdb error: %s", buf2);
@@ -1066,9 +1066,9 @@ e_book_backend_file_load_source (EBookBackend           *backend,
 				 gboolean                only_if_exists)
 {
 	EBookBackendFile *bf = E_BOOK_BACKEND_FILE (backend);
-	char           *dirname, *filename;
+	gchar           *dirname, *filename;
 	gboolean        writable = FALSE;
-	int             db_error;
+	gint             db_error;
 	DB *db;
 	DB_ENV *env;
 	time_t db_mtime;
@@ -1106,8 +1106,8 @@ e_book_backend_file_load_source (EBookBackend           *backend,
 		env->set_errcall (env, file_errcall);
 
 		/* Set the allocation routines to the non-aborting GLib functions */
-		env->set_alloc (env, (void *(*)(size_t))g_try_malloc,
-				(void *(*)(void *, size_t))g_try_realloc,
+		env->set_alloc (env, (gpointer (*)(size_t))g_try_malloc,
+				(gpointer (*)(gpointer , size_t))g_try_realloc,
 				g_free);
 
 		db_error = (*env->open) (env, NULL, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_THREAD, 0);
@@ -1174,7 +1174,7 @@ e_book_backend_file_load_source (EBookBackend           *backend,
 		db_error = (*db->open) (db, NULL, filename, NULL, DB_HASH, DB_RDONLY | DB_THREAD, 0666);
 
 		if (db_error != 0 && !only_if_exists) {
-			int rv;
+			gint rv;
 
 			/* the database didn't exist, so we create the
 			   directory then the .db */
@@ -1269,9 +1269,9 @@ e_book_backend_file_load_source (EBookBackend           *backend,
 }
 
 static gboolean
-select_changes (const char *name)
+select_changes (const gchar *name)
 {
-	char *p;
+	gchar *p;
 
 	if (strlen (name) < strlen (CHANGES_DB_SUFFIX))
 		return FALSE;
@@ -1309,11 +1309,11 @@ e_book_backend_file_remove (EBookBackendSync *backend,
 
 	dir = g_dir_open (bf->priv->dirname, 0, NULL);
 	if (dir) {
-		const char *name;
+		const gchar *name;
 
 		while ((name = g_dir_read_name (dir))) {
 			if (select_changes (name)) {
-				char *full_path = g_build_filename (bf->priv->dirname, name, NULL);
+				gchar *full_path = g_build_filename (bf->priv->dirname, name, NULL);
 				if (-1 == g_unlink (full_path)) {
 					g_warning ("failed to remove change db `%s': %s", full_path, g_strerror (errno));
 				}
@@ -1335,7 +1335,7 @@ e_book_backend_file_remove (EBookBackendSync *backend,
 	return GNOME_Evolution_Addressbook_Success;
 }
 
-static char *
+static gchar *
 e_book_backend_file_get_static_capabilities (EBookBackend *backend)
 {
 	return g_strdup("local,do-initial-query,bulk-removes,contact-lists");
@@ -1359,7 +1359,7 @@ static void
 e_book_backend_file_sync (EBookBackend *backend)
 {
 	EBookBackendFile *bf = E_BOOK_BACKEND_FILE (backend);
-	int db_error;
+	gint db_error;
 
 	g_return_if_fail (bf != NULL);
 
@@ -1451,9 +1451,9 @@ e_book_backend_file_finalize (GObject *object)
  */
 
 static int
-my_open (const char *name, int oflag, ...)
+my_open (const gchar *name, gint oflag, ...)
 {
-	int mode = 0;
+	gint mode = 0;
 
 	if (oflag & O_CREAT) {
 		va_list arg;
@@ -1465,14 +1465,14 @@ my_open (const char *name, int oflag, ...)
 	return g_open (name, oflag, mode);
 }
 
-int
-my_rename (const char *oldname, const char *newname)
+gint
+my_rename (const gchar *oldname, const gchar *newname)
 {
 	return g_rename (oldname, newname);
 }
 
-int
-my_exists (const char *name, int *isdirp)
+gint
+my_exists (const gchar *name, gint *isdirp)
 {
 	if (!g_file_test (name, G_FILE_TEST_EXISTS))
 		return ENOENT;
@@ -1481,8 +1481,8 @@ my_exists (const char *name, int *isdirp)
 	return 0;
 }
 
-int
-my_unlink (const char *name)
+gint
+my_unlink (const gchar *name)
 {
 	return g_unlink (name);
 }
diff --git a/addressbook/backends/google/e-book-backend-google-factory.c b/addressbook/backends/google/e-book-backend-google-factory.c
index fd21c1d..6deb02c 100644
--- a/addressbook/backends/google/e-book-backend-google-factory.c
+++ b/addressbook/backends/google/e-book-backend-google-factory.c
@@ -33,7 +33,7 @@ e_book_backend_google_factory_instance_init (EBookBackendGoogleFactory *factory)
 {
 }
 
-static const char *
+static const gchar *
 _get_protocol (EBookBackendFactory *factory)
 {
     return "google";
@@ -88,7 +88,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
     *types = &google_type;
     *num_types = 1;
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index 04e7a4b..802b48c 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -108,7 +108,7 @@ e_book_backend_google_remove_contacts (EBookBackendSync *backend,
 
     for (id_iter = id_list; id_iter; id_iter = id_iter->next) {
 	GError *error = NULL;
-	const char *uid;
+	const gchar *uid;
 
 	uid = id_iter->data;
 	google_book_remove_contact (priv->book, uid, &error);
@@ -224,7 +224,7 @@ e_book_backend_google_get_contact_list (EBookBackendSync *backend,
 
 	contact = all_contacts->data;
 	if (e_book_backend_sexp_match_contact (sexp, contact)) {
-	    char *vcard_str;
+	    gchar *vcard_str;
 	    vcard_str = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
 	    *contacts = g_list_append (*contacts, vcard_str);
 	}
@@ -250,7 +250,7 @@ on_google_book_contact_added (GoogleBook *book, EContact *contact, gpointer user
 }
 
 static void
-on_google_book_contact_removed (GoogleBook *book, const char *uid, gpointer user_data)
+on_google_book_contact_removed (GoogleBook *book, const gchar *uid, gpointer user_data)
 {
     EBookBackendGooglePrivate *priv;
     GList *iter;
@@ -351,7 +351,7 @@ e_book_backend_google_authenticate_user (EBookBackendSync *backend,
     EBookBackendGooglePrivate *priv;
     EBookBackendSyncStatus status = GNOME_Evolution_Addressbook_Success;
     GError *error = NULL;
-    char *book_username;
+    gchar *book_username;
     gboolean match;
 
     __debug__ (G_STRFUNC);
@@ -395,7 +395,7 @@ e_book_backend_google_get_supported_auth_methods (EBookBackendSync	*backend,
 						  guint32		opid,
 						  GList		**methods)
 {
-    char *auth_method;
+    gchar *auth_method;
 
     __debug__ (G_STRFUNC);
     auth_method = g_strdup_printf ("plain/password");
@@ -422,7 +422,7 @@ e_book_backend_google_get_supported_fields (EBookBackendSync	*backend,
 					    guint32		opid,
 					    GList		**fields_out)
 {
-    const int supported_fields[] =
+    const gint supported_fields[] =
     {
 	E_CONTACT_FULL_NAME,
 	E_CONTACT_EMAIL_1,
@@ -452,12 +452,12 @@ e_book_backend_google_get_supported_fields (EBookBackendSync	*backend,
 	E_CONTACT_ADDRESS_OTHER
     };
     GList *fields = NULL;
-    int i;
+    gint i;
 
     __debug__ (G_STRFUNC);
 
     for (i = 0; i < G_N_ELEMENTS (supported_fields); i++) {
-	const char *field_name;
+	const gchar *field_name;
 
 	field_name = e_contact_field_name (supported_fields[i]);
 	fields = g_list_append (fields, g_strdup (field_name));
@@ -500,10 +500,10 @@ e_book_backend_google_load_source (EBookBackend *backend,
 				   gboolean	only_if_exists)
 {
     EBookBackendGooglePrivate *priv = GET_PRIVATE (backend);
-    const char *refresh_interval_str, *use_ssl_str, *use_cache_str;
+    const gchar *refresh_interval_str, *use_ssl_str, *use_cache_str;
     guint refresh_interval;
     gboolean use_ssl, use_cache;
-    const char *username;
+    const gchar *username;
 
     if (priv->book) {
 	g_warning ("Source already loaded!");
@@ -564,7 +564,7 @@ e_book_backend_google_load_source (EBookBackend *backend,
     return GNOME_Evolution_Addressbook_Success;
 }
 
-static char *
+static gchar *
 e_book_backend_google_get_static_capabilities (EBookBackend *backend)
 {
     __debug__ (G_STRFUNC);
diff --git a/addressbook/backends/google/google-book.c b/addressbook/backends/google/google-book.c
index cee0c00..875c381 100644
--- a/addressbook/backends/google/google-book.c
+++ b/addressbook/backends/google/google-book.c
@@ -67,7 +67,7 @@ typedef enum
 
 struct _GoogleBookPrivate
 {
-    char *username;
+    gchar *username;
     CacheType cache_type;
     union {
         EBookBackendCache *on_disk;
@@ -82,9 +82,9 @@ struct _GoogleBookPrivate
     GDataService *service;
     EProxy *proxy;
     guint refresh_interval;
-    char *base_uri;
+    gchar *base_uri;
     /* FIXME - this one should not be needed */
-    char *add_base_uri;
+    gchar *add_base_uri;
 
     gboolean live_mode;
 
@@ -96,13 +96,13 @@ struct _GoogleBookPrivate
 
 static gboolean
 google_book_get_new_contacts_in_chunks (GoogleBook *book,
-                                        int         chunk_size,
+                                        gint         chunk_size,
                                         GError    **error);
 
 static void
 google_book_error_from_soup_error      (GError *soup_error,
                                         GError **error,
-                                        const char *message);
+                                        const gchar *message);
 
 static void
 google_book_cache_init (GoogleBook *book, gboolean on_disk)
@@ -127,7 +127,7 @@ google_book_cache_add_contact (GoogleBook *book, GDataEntry *entry)
 {
     GoogleBookPrivate *priv = GET_PRIVATE (book);
     EContact *contact;
-    const char *uid;
+    const gchar *uid;
 
     switch (priv->cache_type) {
     case ON_DISK_CACHE:
@@ -151,7 +151,7 @@ google_book_cache_add_contact (GoogleBook *book, GDataEntry *entry)
 }
 
 static gboolean
-google_book_cache_remove_contact (GoogleBook *book, const char *uid)
+google_book_cache_remove_contact (GoogleBook *book, const gchar *uid)
 {
     GoogleBookPrivate *priv = GET_PRIVATE (book);
     gboolean success = TRUE;
@@ -169,7 +169,7 @@ google_book_cache_remove_contact (GoogleBook *book, const char *uid)
 }
 
 static EContact*
-google_book_cache_get_contact (GoogleBook *book, const char *uid, GDataEntry **entry)
+google_book_cache_get_contact (GoogleBook *book, const gchar *uid, GDataEntry **entry)
 {
     GoogleBookPrivate *priv = GET_PRIVATE (book);
     EContact *contact;
@@ -179,7 +179,7 @@ google_book_cache_get_contact (GoogleBook *book, const char *uid, GDataEntry **e
         contact = e_book_backend_cache_get_contact (priv->cache.on_disk, uid);
         if (contact) {
             if (entry) {
-                const char *entry_xml;
+                const gchar *entry_xml;
                 entry_xml = _e_contact_get_gdata_entry_xml (contact);
                 *entry = gdata_entry_new_from_xml (entry_xml);
             }
@@ -263,7 +263,7 @@ google_book_cache_thaw (GoogleBook *book)
     }
 }
 
-static char*
+static gchar *
 google_book_cache_get_last_update (GoogleBook *book)
 {
     GoogleBookPrivate *priv = GET_PRIVATE (book);
@@ -286,8 +286,8 @@ static gboolean
 google_book_cache_get_last_update_tv (GoogleBook *book, GTimeVal *tv)
 {
     GoogleBookPrivate *priv = GET_PRIVATE (book);
-    char *last_update;
-    int rv;
+    gchar *last_update;
+    gint rv;
 
     switch (priv->cache_type) {
     case ON_DISK_CACHE:
@@ -308,7 +308,7 @@ static void
 google_book_cache_set_last_update (GoogleBook *book, GTimeVal *tv)
 {
     GoogleBookPrivate *priv = GET_PRIVATE (book);
-    char *time;
+    gchar *time;
 
     switch (priv->cache_type) {
     case ON_DISK_CACHE:
@@ -373,7 +373,7 @@ google_book_cache_refresh_if_needed (GoogleBook *book, GError **error)
 {
     GoogleBookPrivate *priv = GET_PRIVATE (book);
     guint remaining_secs;
-    int rv = TRUE;
+    gint rv = TRUE;
     gboolean install_timeout;
 
     __debug__ (G_STRFUNC);
@@ -448,8 +448,8 @@ google_book_cache_destroy (GoogleBook *book)
 static void
 google_book_construct_base_uri (GoogleBook *book, gboolean use_ssl)
 {
-    const char format[] = "%swww.google.com/m8/feeds/contacts/%s/base";
-    char *esc_username;
+    const gchar format[] = "%swww.google.com/m8/feeds/contacts/%s/base";
+    gchar *esc_username;
     GoogleBookPrivate *priv = GET_PRIVATE (book);
 
     __debug__ (G_STRFUNC);
@@ -585,7 +585,7 @@ google_book_emit_contact_changed (GoogleBook *book, EContact *contact)
 }
 
 static void
-google_book_emit_contact_removed (GoogleBook *book, const char *uid)
+google_book_emit_contact_removed (GoogleBook *book, const gchar *uid)
 {
     GoogleBookPrivate *priv;
 
@@ -722,7 +722,7 @@ google_book_init (GoogleBook *self)
 }
 
 GoogleBook*
-google_book_new (const char *username, gboolean use_cache)
+google_book_new (const gchar *username, gboolean use_cache)
 {
     return g_object_new (TYPE_GOOGLE_BOOK,
                          "username", username,
@@ -749,7 +749,7 @@ proxy_settings_changed (EProxy *proxy, gpointer user_data)
 }
 
 gboolean
-google_book_connect_to_google (GoogleBook *book, const char *password, GError **error)
+google_book_connect_to_google (GoogleBook *book, const gchar *password, GError **error)
 {
     GoogleBookPrivate *priv;
     GDataService *service;
@@ -869,7 +869,7 @@ google_book_update_contact (GoogleBook *book,
     GDataEntry *entry, *new_entry;
     GError *soup_error = NULL;
     EContact *cached_contact;
-    const char *uid;
+    const gchar *uid;
 
     *out_contact = NULL;
 
@@ -913,7 +913,7 @@ google_book_update_contact (GoogleBook *book,
 }
 
 gboolean
-google_book_remove_contact (GoogleBook *book, const char *uid, GError **error)
+google_book_remove_contact (GoogleBook *book, const gchar *uid, GError **error)
 {
     GoogleBookPrivate *priv;
     GDataEntry *entry = NULL;
@@ -958,7 +958,7 @@ process_subsequent_entry (gpointer list_data, gpointer user_data)
     GDataEntry *entry;
     EContact *cached_contact;
     gboolean is_deleted;
-    const char *uid;
+    const gchar *uid;
 
     __debug__ (G_STRFUNC);
     priv = GET_PRIVATE (book);
@@ -996,7 +996,7 @@ process_initial_entry (gpointer list_data, gpointer user_data)
     GoogleBookPrivate *priv;
     GoogleBook *book = user_data;
     GDataEntry *entry;
-    const char* uid;
+    const gchar * uid;
     EContact *contact;
 
     __debug__ (G_STRFUNC);
@@ -1012,12 +1012,12 @@ process_initial_entry (gpointer list_data, gpointer user_data)
 
 static gboolean
 google_book_get_new_contacts_in_chunks (GoogleBook *book,
-                                        int         chunk_size,
+                                        gint         chunk_size,
                                         GError    **error)
 {
     GoogleBookPrivate *priv;
-    int start_index = 1;
-    char *last_updated;
+    gint start_index = 1;
+    gchar *last_updated;
     GError *our_error = NULL;
     gboolean rv = TRUE;
 
@@ -1034,7 +1034,7 @@ google_book_get_new_contacts_in_chunks (GoogleBook *book,
         GDataFeed *feed;
         GSList *entries;
         GString *uri;
-        int results;
+        gint results;
         GError *soup_error = NULL;
 
         uri = g_string_new (priv->base_uri);
@@ -1091,7 +1091,7 @@ out:
 
 EContact*
 google_book_get_contact (GoogleBook *book,
-                         const char *uid,
+                         const gchar *uid,
                          GError    **error)
 {
     GoogleBookPrivate *priv;
@@ -1216,7 +1216,7 @@ google_book_set_live_mode (GoogleBook *book, gboolean live_mode)
 static void
 google_book_error_from_soup_error (GError     *soup_error,
                                    GError    **error,
-                                   const char *message)
+                                   const gchar *message)
 {
     GoogleBookError code;
 
diff --git a/addressbook/backends/google/google-book.h b/addressbook/backends/google/google-book.h
index 0d390ae..ea1e85c 100644
--- a/addressbook/backends/google/google-book.h
+++ b/addressbook/backends/google/google-book.h
@@ -58,7 +58,7 @@ struct _GoogleBookClass
 
     void (*contact_added) (EContact* contact);
     void (*contact_changed) (EContact* contact);
-    void (*contact_removed) (const char *uid);
+    void (*contact_removed) (const gchar *uid);
     void (*sequence_complete) (GError *error);
 
     void (*auth_required) (void);
@@ -82,18 +82,18 @@ typedef void (*GoogleBookContactRetrievedCallback) (EContact *contact, gpointer
 
 GType google_book_get_type (void);
 
-GoogleBook* google_book_new (const char *username, gboolean use_cache);
+GoogleBook* google_book_new (const gchar *username, gboolean use_cache);
 
-gboolean google_book_connect_to_google (GoogleBook *book, const char *password, GError **error);
+gboolean google_book_connect_to_google (GoogleBook *book, const gchar *password, GError **error);
 
 void google_book_set_offline_mode (GoogleBook *book, gboolean offline);
 void google_book_set_live_mode    (GoogleBook *book, gboolean live_mode);
 
 gboolean google_book_add_contact    (GoogleBook *book, EContact *contact, EContact **out_contact, GError **error);
 gboolean google_book_update_contact (GoogleBook *book, EContact *contact, EContact **out_contact, GError **error);
-gboolean google_book_remove_contact (GoogleBook *book, const char *uid, GError **error);
+gboolean google_book_remove_contact (GoogleBook *book, const gchar *uid, GError **error);
 
-EContact *google_book_get_contact                   (GoogleBook *book, const char* uid, GError **error);
+EContact *google_book_get_contact                   (GoogleBook *book, const gchar * uid, GError **error);
 GList    *google_book_get_all_contacts              (GoogleBook *book, GError **error);
 GList    *google_book_get_all_contacts_in_live_mode (GoogleBook *book);
 
diff --git a/addressbook/backends/google/util.c b/addressbook/backends/google/util.c
index 9ac30c5..6fc0646 100644
--- a/addressbook/backends/google/util.c
+++ b/addressbook/backends/google/util.c
@@ -56,7 +56,7 @@ gdata_entry_postal_address_from_attribute (EVCardAttribute         *attr,
                                            gboolean                *primary);
 
 static gboolean
-is_known_google_im_protocol (const char *protocol);
+is_known_google_im_protocol (const gchar *protocol);
 
 GDataEntry*
 _gdata_entry_new_from_e_contact (EContact *contact)
@@ -84,7 +84,7 @@ _gdata_entry_update_from_e_contact (GDataEntry *entry,
                                     EContact   *contact)
 {
     GList *attributes, *iter;
-    char *fullname = NULL;
+    gchar *fullname = NULL;
     GSList *email_addresses = NULL;
     GSList *im_addresses = NULL;
     GSList *phone_numbers = NULL;
@@ -109,7 +109,7 @@ _gdata_entry_update_from_e_contact (GDataEntry *entry,
     iter = g_list_last (attributes);
     for (; iter; iter = iter->prev) {
         EVCardAttribute *attr;
-        const char *name;
+        const gchar *name;
 
         attr = iter->data;
         name = e_vcard_attribute_get_name (attr);
@@ -173,8 +173,8 @@ _gdata_entry_update_from_e_contact (GDataEntry *entry,
             GList *values;
 
             values = e_vcard_attribute_get_values (attr);
-            if (values && values->data && ((char*)values->data)[0]) {
-                __debug__ ("unsupported vcard field: %s: %s", name, (char*)values->data);
+            if (values && values->data && ((gchar *)values->data)[0]) {
+                __debug__ ("unsupported vcard field: %s: %s", name, (gchar *)values->data);
             }
         }
     }
@@ -194,8 +194,8 @@ _e_contact_new_from_gdata_entry (GDataEntry *entry)
     EVCard *vcard;
     EVCardAttribute *attr;
     GSList *email_addresses, *im_addresses, *phone_numbers, *postal_addresses;
-    const char *name;
-    const char *uid;
+    const gchar *name;
+    const gchar *uid;
     GSList *itr;
     GDataEntryEmailAddress *email;
     GDataEntryIMAddress *im;
@@ -216,7 +216,7 @@ _e_contact_new_from_gdata_entry (GDataEntry *entry)
     /* FN - TODO: get title */
     name = gdata_entry_get_title (entry);
     if (name) {
-        e_contact_set (E_CONTACT (vcard), E_CONTACT_FULL_NAME, (const gpointer)name);
+        e_contact_set (E_CONTACT (vcard), E_CONTACT_FULL_NAME, (gconstpointer)name);
     }
 
     /* EMAIL - primary first */
@@ -297,7 +297,7 @@ void
 _e_contact_add_gdata_entry_xml (EContact *contact, GDataEntry *entry)
 {
     EVCardAttribute *attr;
-    const char* entry_xml;
+    const gchar * entry_xml;
 
     entry_xml = gdata_entry_generate_xml (entry);
 
@@ -312,7 +312,7 @@ _e_contact_remove_gdata_entry_xml (EContact *contact)
     e_vcard_remove_attributes (E_VCARD (contact), NULL, GDATA_ENTRY_XML_ATTR);
 }
 
-const char*
+const gchar *
 _e_contact_get_gdata_entry_xml (EContact *contact)
 {
     EVCardAttribute *attr;
@@ -325,8 +325,8 @@ _e_contact_get_gdata_entry_xml (EContact *contact)
 }
 
 struct RelTypeMap {
-    const char* rel;
-    const char* types[3];
+    const gchar * rel;
+    const gchar * types[3];
 };
 
 const struct RelTypeMap rel_type_map_phone[] = {
@@ -349,11 +349,11 @@ const struct RelTypeMap rel_type_map_others[] = {
 static gboolean
 _add_type_param_from_google_rel (EVCardAttribute *attr,
                                  const struct RelTypeMap rel_type_map[],
-                                 int map_len,
-                                 const char *rel)
+                                 gint map_len,
+                                 const gchar *rel)
 {
-    const char* field;
-    int i;
+    const gchar * field;
+    gint i;
 
     field = strstr (rel ? rel : "", "#");
     if (NULL == field)
@@ -363,7 +363,7 @@ _add_type_param_from_google_rel (EVCardAttribute *attr,
     for (i = 0; i < map_len; i++) {
         if (0 == g_ascii_strcasecmp (rel_type_map[i].rel, field)) {
             EVCardAttributeParam *param;
-            const char * const * type;
+            const gchar * const * type;
             param = e_vcard_attribute_param_new ("TYPE");
             for (type = rel_type_map[i].types; *type; type++) {
                 e_vcard_attribute_param_add_value (param, *type);
@@ -378,7 +378,7 @@ _add_type_param_from_google_rel (EVCardAttribute *attr,
 }
 
 static gboolean
-add_type_param_from_google_rel_phone (EVCardAttribute *attr, const char *rel)
+add_type_param_from_google_rel_phone (EVCardAttribute *attr, const gchar *rel)
 {
     return _add_type_param_from_google_rel (attr,
                                             rel_type_map_phone,
@@ -387,7 +387,7 @@ add_type_param_from_google_rel_phone (EVCardAttribute *attr, const char *rel)
 }
 
 static gboolean
-add_type_param_from_google_rel (EVCardAttribute *attr, const char *rel)
+add_type_param_from_google_rel (EVCardAttribute *attr, const gchar *rel)
 {
     return _add_type_param_from_google_rel (attr,
                                             rel_type_map_others,
@@ -396,7 +396,7 @@ add_type_param_from_google_rel (EVCardAttribute *attr, const char *rel)
 }
 
 static void
-add_label_param (EVCardAttribute *attr, const char *label)
+add_label_param (EVCardAttribute *attr, const gchar *label)
 {
     if (label && label[0] != '\0') {
         EVCardAttributeParam *param;
@@ -405,15 +405,15 @@ add_label_param (EVCardAttribute *attr, const char *label)
     }
 }
 
-static char*
+static gchar *
 _google_rel_from_types (GList *types,
                         const struct RelTypeMap rel_type_map[],
-                        int map_len)
+                        gint map_len)
 {
-    const char format[] = "http://schemas.google.com/g/2005#%s";;
+    const gchar format[] = "http://schemas.google.com/g/2005#%s";;
 
     while (types) {
-        int i;
+        gint i;
         GList *cur = types;
         types = types->next;
 
@@ -433,7 +433,7 @@ _google_rel_from_types (GList *types,
     return g_strdup_printf (format, "other");
 }
 
-static char*
+static gchar *
 google_rel_from_types (GList *types)
 {
     return _google_rel_from_types (types,
@@ -441,7 +441,7 @@ google_rel_from_types (GList *types)
                                    G_N_ELEMENTS (rel_type_map_others));
 }
 
-static char*
+static gchar *
 google_rel_from_types_phone (GList *types)
 {
     return _google_rel_from_types (types,
@@ -450,14 +450,14 @@ google_rel_from_types_phone (GList *types)
 }
 
 static gboolean
-is_known_google_im_protocol (const char *protocol)
+is_known_google_im_protocol (const gchar *protocol)
 {
-    const char *known_protocols[] =
+    const gchar *known_protocols[] =
     {
         "AIM", "MSN", "YAHOO", "SKYPE", "QQ",
         "GOOGLE_TALK", "ICQ", "JABBER"
     };
-    int i;
+    gint i;
 
     if (NULL == protocol)
         return FALSE;
@@ -469,10 +469,10 @@ is_known_google_im_protocol (const char *protocol)
     return FALSE;
 }
 
-static char*
-field_name_from_google_im_protocol (const char* google_protocol)
+static gchar *
+field_name_from_google_im_protocol (const gchar * google_protocol)
 {
-    char *protocol;
+    gchar *protocol;
     if (NULL == google_protocol)
         return NULL;
 
@@ -482,10 +482,10 @@ field_name_from_google_im_protocol (const char* google_protocol)
     return g_strdup_printf ("X-%s", protocol + 1);
 }
 
-static char*
-google_im_protocol_from_field_name (const char* field_name)
+static gchar *
+google_im_protocol_from_field_name (const gchar * field_name)
 {
-    const char format[] = "http://schemas.google.com/g/2005#%s";;
+    const gchar format[] = "http://schemas.google.com/g/2005#%s";;
 
     if (NULL == field_name ||
         strlen (field_name) < 3) {
@@ -510,7 +510,7 @@ add_primary_param (EVCardAttribute *attr, gboolean has_type)
 static GList*
 get_google_primary_type_label (EVCardAttribute *attr,
                                gboolean *primary,
-                               const char **label)
+                               const gchar **label)
 {
     GList *params;
     GList *types = NULL;
@@ -519,7 +519,7 @@ get_google_primary_type_label (EVCardAttribute *attr,
     *label = NULL;
     params = e_vcard_attribute_get_params (attr);
     while (params) {
-        const char *name;
+        const gchar *name;
 
         name = e_vcard_attribute_param_get_name (params->data);
         if (0 == g_ascii_strcasecmp (name, GOOGLE_PRIMARY_PARAM)) {
@@ -527,7 +527,7 @@ get_google_primary_type_label (EVCardAttribute *attr,
 
             values = e_vcard_attribute_param_get_values (params->data);
             if (values && values->data &&
-                (((const char*)values->data)[0] == '1' ||
+                (((const gchar *)values->data)[0] == '1' ||
                  0 == g_ascii_strcasecmp (values->data, "yes"))) {
                 *primary = TRUE;
             }
@@ -571,7 +571,7 @@ attribute_from_gdata_entry_im_address (GDataEntryIMAddress *im)
 {
     EVCardAttribute *attr;
     gboolean has_type;
-    char *field_name;
+    gchar *field_name;
 
     if (NULL == im || NULL == im->address)
         return NULL;;
@@ -637,7 +637,7 @@ gdata_entry_email_address_from_attribute (EVCardAttribute *attr, gboolean *have_
     values = e_vcard_attribute_get_values (attr);
     if (values) {
         GList *types;
-        const char *label;
+        const gchar *label;
         gboolean primary;
 
         types = get_google_primary_type_label (attr, &primary, &label);
@@ -667,14 +667,14 @@ gdata_entry_im_address_from_attribute (EVCardAttribute *attr, gboolean *have_pri
 {
     GDataEntryIMAddress *im = NULL;
     GList *values;
-    const char *name;
+    const gchar *name;
 
     name = e_vcard_attribute_get_name (attr);
 
     values = e_vcard_attribute_get_values (attr);
     if (values) {
         GList *types;
-        const char *label;
+        const gchar *label;
         gboolean primary;
 
         types = get_google_primary_type_label (attr, &primary, &label);
@@ -711,7 +711,7 @@ gdata_entry_phone_number_from_attribute (EVCardAttribute *attr, gboolean *have_p
     if (values) {
         GList *types;
         gboolean primary;
-        const char *label;
+        const gchar *label;
 
         types = get_google_primary_type_label (attr, &primary, &label);
         if (FALSE == *have_primary) {
@@ -744,7 +744,7 @@ gdata_entry_postal_address_from_attribute (EVCardAttribute *attr, gboolean *have
     values = e_vcard_attribute_get_values (attr);
     if (values) {
         GList *types;
-        const char *label;
+        const gchar *label;
         gboolean primary;
 
         types = get_google_primary_type_label (attr, &primary, &label);
diff --git a/addressbook/backends/google/util.h b/addressbook/backends/google/util.h
index 483e2b1..54291f4 100644
--- a/addressbook/backends/google/util.h
+++ b/addressbook/backends/google/util.h
@@ -40,6 +40,6 @@ EContact*   _e_contact_new_from_gdata_entry    (GDataEntry *entry);
 void        _e_contact_add_gdata_entry_xml     (EContact   *contact,
                                                 GDataEntry *entry);
 void        _e_contact_remove_gdata_entry_xml  (EContact   *contact);
-const char* _e_contact_get_gdata_entry_xml     (EContact *contact);
+const gchar * _e_contact_get_gdata_entry_xml     (EContact *contact);
 
 #endif
diff --git a/addressbook/backends/groupwise/create-account.c b/addressbook/backends/groupwise/create-account.c
index 4eaece0..a6433ab 100644
--- a/addressbook/backends/groupwise/create-account.c
+++ b/addressbook/backends/groupwise/create-account.c
@@ -6,15 +6,15 @@
 
 static GConfClient *conf_client;
 static GMainLoop *main_loop;
-static char *arg_hostname, *arg_username, *arg_password;
+static gchar *arg_hostname, *arg_username, *arg_password;
 
 static void
-add_account (const char *conf_key, const char *hostname, const char *username, const char *password)
+add_account (const gchar *conf_key, const gchar *hostname, const gchar *username, const gchar *password)
 {
 	ESourceList *source_list;
 	ESourceGroup *group;
 	ESource *source;
-	char *group_name;
+	gchar *group_name;
 
 	source_list = e_source_list_new_for_gconf (conf_client, conf_key);
 
@@ -58,8 +58,8 @@ idle_cb (gpointer data)
 	return FALSE;
 }
 
-int
-main (int argc, char *argv[])
+gint
+main (gint argc, gchar *argv[])
 {
 	g_type_init ();
 
diff --git a/addressbook/backends/groupwise/e-book-backend-groupwise-factory.c b/addressbook/backends/groupwise/e-book-backend-groupwise-factory.c
index 6a42910..67fe7b0 100644
--- a/addressbook/backends/groupwise/e-book-backend-groupwise-factory.c
+++ b/addressbook/backends/groupwise/e-book-backend-groupwise-factory.c
@@ -45,7 +45,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = & groupwise_type;
 	*num_types = 1;
diff --git a/addressbook/backends/groupwise/e-book-backend-groupwise.c b/addressbook/backends/groupwise/e-book-backend-groupwise.c
index d37c576..61ad2de 100644
--- a/addressbook/backends/groupwise/e-book-backend-groupwise.c
+++ b/addressbook/backends/groupwise/e-book-backend-groupwise.c
@@ -66,11 +66,11 @@ typedef struct {
 
 struct _EBookBackendGroupwisePrivate {
 	EGwConnection *cnc;
-	char *uri;
-	char *container_id;
-	char *book_name;
-	char *original_uri;
-	char *summary_file_name;
+	gchar *uri;
+	gchar *container_id;
+	gchar *book_name;
+	gchar *original_uri;
+	gchar *summary_file_name;
 	gboolean only_if_exists;
 	GHashTable *categories_by_id;
 	GHashTable *categories_by_name;
@@ -78,8 +78,8 @@ struct _EBookBackendGroupwisePrivate {
 	gboolean is_cache_ready;
 	gboolean is_summary_ready;
 	gboolean marked_for_offline;
-	char *use_ssl;
-	int mode;
+	gchar *use_ssl;
+	gint mode;
 	EBookBackendSummary *summary;
 	GMutex *update_cache_mutex;
 	GMutex *update_mutex;
@@ -93,7 +93,7 @@ struct _EBookBackendGroupwisePrivate {
 
 static GStaticMutex global_env_lock = G_STATIC_MUTEX_INIT;
 static struct {
-	int ref_count;
+	gint ref_count;
 	DB_ENV *env;
 } global_env;
 
@@ -125,8 +125,8 @@ static void fill_contact_from_gw_item (EContact *contact, EGwItem *item, GHashTa
 
 static const struct field_element_mapping {
 	EContactField field_id;
-	int element_type;
-	char *element_name;
+	gint element_type;
+	gchar *element_name;
 	void (*populate_contact_func)(EContact *contact,    gpointer data);
 	void (*set_value_in_gw_item) (EGwItem *item, gpointer data);
 	void (*set_changes) (EGwItem *new_item, EGwItem *old_item);
@@ -191,7 +191,7 @@ populate_ims (EContact *contact, gpointer data)
 	for (; im_list != NULL; im_list = g_list_next (im_list)) {
 		EVCardAttribute *attr;
 		GList **im_attr_list = NULL;
-		int im_field_id = -1;
+		gint im_field_id = -1;
 
 		address = (IMAddress *) (im_list->data);
 		if (address->service == NULL) {
@@ -260,7 +260,7 @@ populate_ims (EContact *contact, gpointer data)
 }
 
 static void
-append_ims_to_list (GList **im_list, EContact *contact,  char *service_name, EContactField field_id)
+append_ims_to_list (GList **im_list, EContact *contact,  gchar *service_name, EContactField field_id)
 {
 	GList *list;
 	IMAddress *address;
@@ -437,12 +437,12 @@ copy_postal_address (PostalAddress *address)
 }
 
 static void
-set_postal_address_change (EGwItem *new_item, EGwItem *old_item,  char *address_type)
+set_postal_address_change (EGwItem *new_item, EGwItem *old_item,  gchar *address_type)
 {
 	PostalAddress *old_postal_address;
 	PostalAddress *new_postal_address;
 	PostalAddress *update_postal_address, *delete_postal_address;
-	char *s1, *s2;
+	gchar *s1, *s2;
 	update_postal_address = g_new0(PostalAddress, 1);
 	delete_postal_address = g_new0 (PostalAddress, 1);
 
@@ -511,7 +511,7 @@ static void
 populate_birth_date (EContact *contact, gpointer data)
 {
 	EGwItem *item;
-	char *value ;
+	gchar *value ;
 	EContactDate *date;
 
 	item = E_GW_ITEM (data);
@@ -528,7 +528,7 @@ set_birth_date_in_gw_item (EGwItem *item, gpointer data)
 {
 	EContact *contact;
 	EContactDate *date;
-	char *date_string;
+	gchar *date_string;
 	contact = E_CONTACT (data);
 	date = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
 	if (date) {
@@ -543,8 +543,8 @@ set_birth_date_in_gw_item (EGwItem *item, gpointer data)
 static void
 set_birth_date_changes (EGwItem *new_item, EGwItem *old_item)
 {
-	char *new_birthday;
-	char *old_birthday;
+	gchar *new_birthday;
+	gchar *old_birthday;
 
 	new_birthday = e_gw_item_get_field_value (new_item, "birthday");
 	old_birthday = e_gw_item_get_field_value (old_item, "birthday");
@@ -561,7 +561,7 @@ set_birth_date_changes (EGwItem *new_item, EGwItem *old_item)
 	}
 }
 
-static const int email_fields[3] = {
+static const gint email_fields[3] = {
 	E_CONTACT_EMAIL_1,
 	E_CONTACT_EMAIL_2,
 	E_CONTACT_EMAIL_3
@@ -573,7 +573,7 @@ populate_emails (EContact *contact, gpointer data)
 {
 	GList *email_list;
 	EGwItem *item;
-	int i;
+	gint i;
 
 	item = E_GW_ITEM (data);
 	email_list = e_gw_item_get_email_list(item);
@@ -590,8 +590,8 @@ set_emails_in_gw_item (EGwItem *item, gpointer data)
 {
 	GList *email_list;
 	EContact *contact;
-	char *email;
-	int i;
+	gchar *email;
+	gint i;
 
 	contact = E_CONTACT (data);
 	email_list = NULL;
@@ -608,7 +608,7 @@ compare_string_lists ( GList *old_list, GList *new_list, GList **additions, GLis
 {
 	GList *temp, *old_list_copy;
 	gboolean strings_matched;
-	char *string1, *string2;
+	gchar *string1, *string2;
 
 	if (old_list && new_list) {
 		old_list_copy = g_list_copy (old_list);
@@ -657,7 +657,7 @@ populate_full_name (EContact *contact, gpointer data)
 {
 	EGwItem *item;
 	FullName  *full_name ;
-	char *full_name_string;
+	gchar *full_name_string;
 
 	item = E_GW_ITEM(data);
 	full_name = e_gw_item_get_full_name (item);
@@ -677,7 +677,7 @@ static void
 set_full_name_in_gw_item (EGwItem *item, gpointer data)
 {
 	EContact *contact;
-	char   *name;
+	gchar   *name;
 	EContactName *contact_name;
 	FullName *full_name;
 
@@ -718,7 +718,7 @@ set_full_name_changes (EGwItem *new_item, EGwItem *old_item)
 	FullName *old_full_name;
 	FullName *new_full_name;
 	FullName  *update_full_name, *delete_full_name;
-	char *s1, *s2;
+	gchar *s1, *s2;
 	update_full_name = g_new0(FullName, 1);
 	delete_full_name = g_new0 (FullName, 1);
 
@@ -786,8 +786,8 @@ populate_contact_members (EContact *contact, gpointer data)
                                                         e_vcard_attribute_param_new (EVC_X_DEST_CONTACT_UID),
 							member->id);
 		if (member->name) {
-			int len = strlen (member->name);
-			char *value;
+			gint len = strlen (member->name);
+			gchar *value;
 
 			if (member->name [0] == '\"' && member->name [len - 1] == '\"')
 				value = g_strdup_printf ("%s <%s>", member->name, member->email);
@@ -809,15 +809,15 @@ set_members_in_gw_item (EGwItem  *item, EContact *contact, EBookBackendGroupwise
 {
 	GList  *members, *temp, *dtemp, *items, *p, *emails_without_ids, *dest_without_ids;
 	GList *group_members;
-	char *email;
+	gchar *email;
 	EGwFilter *filter;
-	int status;
-	char *id;
+	gint status;
+	gchar *id;
 	EGwItem *temp_item;
-	int count = 0;
-	int element_type;
-	int i;
-	char *value;
+	gint count = 0;
+	gint element_type;
+	gint i;
+	gchar *value;
 	EGroupMember *member;
 
 	members = e_contact_get_attributes (contact, E_CONTACT_EMAIL);
@@ -836,7 +836,7 @@ set_members_in_gw_item (EGwItem  *item, EContact *contact, EBookBackendGroupwise
 
 		for (p = e_vcard_attribute_get_params (attr); p; p = p->next) {
 			EVCardAttributeParam *param = p->data;
-			const char *param_name = e_vcard_attribute_param_get_name (param);
+			const gchar *param_name = e_vcard_attribute_param_get_name (param);
 
 			if (!g_ascii_strcasecmp (param_name,
 						 EVC_X_DEST_CONTACT_UID)) {
@@ -890,7 +890,7 @@ set_members_in_gw_item (EGwItem  *item, EContact *contact, EBookBackendGroupwise
 		temp_item = E_GW_ITEM (items->data);
 		emails = e_gw_item_get_email_list (temp_item);
 		if (emails_without_ids && (ptr = g_list_find_custom (emails_without_ids, emails->data, (GCompareFunc)strcasecmp ))) {
-			int pos = g_list_position (emails_without_ids, ptr);
+			gint pos = g_list_position (emails_without_ids, ptr);
 			emails_without_ids = g_list_remove_link (emails_without_ids, ptr);
 			g_list_free (ptr);
 
@@ -1027,11 +1027,11 @@ set_member_changes (EGwItem *new_item, EGwItem *old_item, EBookBackendGroupwise
 static void
 set_organization_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise *egwb)
 {
-	char *organization_name;
+	gchar *organization_name;
 	EGwItem *org_item, *temp_item;
 	EGwFilter *filter;
-	int status;
-	char *id;
+	gint status;
+	gchar *id;
 	GList *items;
 
 	organization_name = e_contact_get (contact, E_CONTACT_ORG);
@@ -1087,10 +1087,10 @@ set_organization_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroup
 static void
 set_organization_changes_in_gw_item (EGwItem *new_item, EGwItem *old_item)
 {
-	char *old_value;
-	char *new_value;
-	char *old_org_id;
-	char *new_org_id;
+	gchar *old_value;
+	gchar *new_value;
+	gchar *old_org_id;
+	gchar *new_org_id;
 
 	old_value = e_gw_item_get_field_value (old_item, "organization");
 	new_value = e_gw_item_get_field_value (new_item, "organization");
@@ -1115,8 +1115,8 @@ set_categories_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwi
 {
 	GHashTable *categories_by_name;
 	GList *category_names,  *category_ids;
-	char *id;
-	int status;
+	gchar *id;
+	gint status;
 
 	categories_by_name = egwb->priv->categories_by_name;
 	category_names = e_contact_get (contact, E_CONTACT_CATEGORY_LIST);
@@ -1136,8 +1136,8 @@ set_categories_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwi
 			e_gw_item_set_category_name (category_item, category_names->data);
 			status = e_gw_connection_create_item (egwb->priv->cnc, category_item, &id);
 			if (status == E_GW_CONNECTION_STATUS_OK && id != NULL) {
-				char **components = g_strsplit (id, "@", -1);
-				char *temp_id = components[0];
+				gchar **components = g_strsplit (id, "@", -1);
+				gchar *temp_id = components[0];
 
 				g_hash_table_insert (categories_by_name, g_strdup (category_names->data), g_strdup(temp_id));
 				g_hash_table_insert (egwb->priv->categories_by_id, g_strdup(temp_id), g_strdup (category_names->data));
@@ -1158,7 +1158,7 @@ set_categories_changes (EGwItem *new_item, EGwItem *old_item)
 	GList *new_category_list;
 	GList *temp, *old_categories_copy, *added_categories = NULL;
 	gboolean categories_matched;
-	char *category1, *category2;
+	gchar *category1, *category2;
 
 	old_category_list = e_gw_item_get_categories (old_item);
 	new_category_list = e_gw_item_get_categories (new_item);
@@ -1195,9 +1195,9 @@ set_categories_changes (EGwItem *new_item, EGwItem *old_item)
 static void
 fill_contact_from_gw_item (EContact *contact, EGwItem *item, GHashTable *categories_by_ids)
 {
-	char* value;
-	int element_type;
-	int i;
+	gchar * value;
+	gint element_type;
+	gint i;
 	gboolean is_contact_list;
 	gboolean is_organization;
 
@@ -1222,7 +1222,7 @@ fill_contact_from_gw_item (EContact *contact, EGwItem *item, GHashTable *categor
 		} else if (element_type == ELEMENT_TYPE_COMPLEX) {
 			if (mappings[i].field_id == E_CONTACT_CATEGORIES) {
 				GList *category_ids, *category_names;
-				char *name;
+				gchar *name;
 
 				category_names = NULL;
 				category_ids = e_gw_item_get_categories (item);
@@ -1246,16 +1246,16 @@ static void
 e_book_backend_groupwise_create_contact (EBookBackend *backend,
 					 EDataBook *book,
 					 guint32 opid,
-					 const char *vcard )
+					 const gchar *vcard )
 {
 	EContact *contact;
 	EBookBackendGroupwise *egwb;
-	char *id;
-	int status;
+	gchar *id;
+	gint status;
 	EGwItem *item;
-	int element_type;
-	char* value;
-	int i;
+	gint element_type;
+	gchar * value;
+	gint i;
 
 	if (enable_debug)
 		printf("\ne_book_backend_groupwise_create_contact...\n");
@@ -1333,7 +1333,7 @@ e_book_backend_groupwise_remove_contacts (EBookBackend *backend,
 					  guint32 opid,
 					  GList *id_list)
 {
-	char *id;
+	gchar *id;
 	EBookBackendGroupwise *ebgw;
 	GList *deleted_ids = NULL;
 
@@ -1360,7 +1360,7 @@ e_book_backend_groupwise_remove_contacts (EBookBackend *backend,
 		}
 
 		for ( ; id_list != NULL; id_list = g_list_next (id_list)) {
-			id = (char*) id_list->data;
+			id = (gchar *) id_list->data;
 			e_gw_connection_remove_item (ebgw->priv->cnc, ebgw->priv->container_id, id);
 			deleted_ids =  g_list_append (deleted_ids, id);
 			e_book_backend_db_cache_remove_contact (ebgw->priv->file_db, id);
@@ -1378,10 +1378,10 @@ e_book_backend_groupwise_remove_contacts (EBookBackend *backend,
 static void
 set_changes_in_gw_item (EGwItem *new_item, EGwItem *old_item)
 {
-	char* new_value;
-	char *old_value;
-	int element_type;
-	int i;
+	gchar * new_value;
+	gchar *old_value;
+	gint element_type;
+	gint i;
 
 	g_return_if_fail (E_IS_GW_ITEM(new_item));
 	g_return_if_fail (E_IS_GW_ITEM(old_item));
@@ -1416,17 +1416,17 @@ static void
 e_book_backend_groupwise_modify_contact (EBookBackend *backend,
 					 EDataBook    *book,
 					 guint32       opid,
-					 const char   *vcard)
+					 const gchar   *vcard)
 {
 	EContact *contact;
 	EBookBackendGroupwise *egwb;
-	char *id;
-	int status;
+	gchar *id;
+	gint status;
 	EGwItem *new_item;
 	EGwItem *old_item;
-	int element_type;
-	char* value;
-	int i;
+	gint element_type;
+	gchar * value;
+	gint i;
 
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_modify_contact...\n");
@@ -1512,13 +1512,13 @@ static void
 e_book_backend_groupwise_get_contact (EBookBackend *backend,
 				      EDataBook    *book,
 				      guint32       opid,
-				      const char   *id)
+				      const gchar   *id)
 {
 	EBookBackendGroupwise *gwb;
-	int status ;
+	gint status ;
 	EGwItem *item;
 	EContact *contact;
-	char *vcard;
+	gchar *vcard;
 
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_get_contact...\n");
@@ -1571,12 +1571,12 @@ typedef struct {
 	EGwFilter *filter;
 	gboolean is_filter_valid;
 	gboolean is_personal_book;
-	int auto_completion;
-	char *search_string;
+	gint auto_completion;
+	gchar *search_string;
 } EBookBackendGroupwiseSExpData;
 
 static ESExpResult *
-func_and(ESExp *f, int argc, ESExpResult **argv, void *data)
+func_and(ESExp *f, gint argc, ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
 	EGwFilter *filter;
@@ -1593,7 +1593,7 @@ func_and(ESExp *f, int argc, ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_or(ESExp *f, int argc, ESExpResult **argv, void *data)
+func_or(ESExp *f, gint argc, ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
 	EGwFilter *filter;
@@ -1610,7 +1610,7 @@ func_or(ESExp *f, int argc, ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_not(ESExp *f, int argc, ESExpResult **argv, void *data)
+func_not(ESExp *f, gint argc, ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
 	EBookBackendGroupwiseSExpData *sexp_data;
@@ -1624,7 +1624,7 @@ func_not(ESExp *f, int argc, ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
 	EGwFilter *filter;
@@ -1636,9 +1636,9 @@ func_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *dat
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = argv[1]->value.string;
-		char *gw_field_name;
+		gchar *propname = argv[0]->value.string;
+		gchar *str = argv[1]->value.string;
+		gchar *gw_field_name;
 
 		if (g_str_equal (propname, "x-evolution-any-field")) {
 			if (!sexp_data->is_personal_book && str && strlen(str) == 0) {
@@ -1685,7 +1685,7 @@ func_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *dat
 }
 
 static ESExpResult *
-func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_is(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
 	EGwFilter *filter;
@@ -1697,9 +1697,9 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = argv[1]->value.string;
-		char *gw_field_name;
+		gchar *propname = argv[0]->value.string;
+		gchar *str = argv[1]->value.string;
+		gchar *gw_field_name;
 
 		gw_field_name = NULL;
 		if (g_str_equal (propname, "full_name"))
@@ -1743,7 +1743,7 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 #define AUTO_COMPLETION_QUERY 15
 
 static ESExpResult *
-func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_beginswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
 	EGwFilter *filter;
@@ -1755,9 +1755,9 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = argv[1]->value.string;
-		char *gw_field_name;
+		gchar *propname = argv[0]->value.string;
+		gchar *str = argv[1]->value.string;
+		gchar *gw_field_name;
 
 		if (!sexp_data->is_personal_book && str && strlen(str) == 0) {
 			/* ignore the NULL query */
@@ -1814,7 +1814,7 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
 }
 
 static ESExpResult *
-func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_endswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendGroupwiseSExpData *sexp_data;
 	ESExpResult *r;
@@ -1830,7 +1830,7 @@ func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 }
 
 static ESExpResult *
-func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
 	EGwFilter *filter;
@@ -1841,9 +1841,9 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 
 	if (argc == 1
 	    && argv[0]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = argv[1]->value.string;
-		char *gw_field_name;
+		gchar *propname = argv[0]->value.string;
+		gchar *str = argv[1]->value.string;
+		gchar *gw_field_name;
 
 		gw_field_name = NULL;
 		if (g_str_equal (propname, "full_name"))
@@ -1883,9 +1883,9 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 
 /* 'builtin' functions */
 static const 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[] = {
 	{ "and", func_and, 0 },
@@ -1899,13 +1899,13 @@ static const struct {
 };
 
 static EGwFilter*
-e_book_backend_groupwise_build_gw_filter (EBookBackendGroupwise *ebgw, const char *query, gpointer is_auto_completion, char ** search_string)
+e_book_backend_groupwise_build_gw_filter (EBookBackendGroupwise *ebgw, const gchar *query, gpointer is_auto_completion, gchar ** search_string)
 {
 	ESExp *sexp;
 	ESExpResult *r;
 	EBookBackendGroupwiseSExpData *sexp_data;
 	EGwFilter *filter;
-	int i;
+	gint i;
 
 	sexp = e_sexp_new();
 	filter = e_gw_filter_new ();
@@ -1952,10 +1952,10 @@ static void
 e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
 					   EDataBook    *book,
 					   guint32       opid,
-					   const char   *query )
+					   const gchar   *query )
 {
 	GList *vcard_list;
-	int status;
+	gint status;
 	GList *gw_items, *contacts = NULL, *temp;
 	EContact *contact;
 	EBookBackendGroupwise *egwb;
@@ -1983,13 +1983,13 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
 
 		if (egwb->priv->is_summary_ready &&
 		    e_book_backend_summary_is_summary_query (egwb->priv->summary, query)) {
-			int i;
+			gint i;
 			ids = e_book_backend_summary_search (egwb->priv->summary, query);
 			if (!ids)
 				return;
 
 			for (i = 0; i < ids->len; i ++) {
-				char *uid = g_ptr_array_index (ids, i);
+				gchar *uid = g_ptr_array_index (ids, i);
 
 				EContact *contact =
 					e_book_backend_db_cache_get_contact (egwb->priv->file_db, uid);
@@ -2034,9 +2034,9 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
 				ids = e_book_backend_summary_search (egwb->priv->summary, query);
 
 				if (!egwb->priv->is_writable) {
-					int i;
+					gint i;
 					for (i = 0; i < ids->len; i ++) {
-						char *uid = g_ptr_array_index (ids, i);
+						gchar *uid = g_ptr_array_index (ids, i);
 						contact = e_book_backend_db_cache_get_contact (egwb->priv->file_db, uid);
 						vcard_list = g_list_append (vcard_list,
                                                             e_vcard_to_string (E_VCARD (contact),
@@ -2153,17 +2153,17 @@ get_closure (EDataBookView *book_view)
 
 static void
 get_contacts_from_cache (EBookBackendGroupwise *ebgw,
-			 const char *query,
+			 const gchar *query,
 			 GPtrArray *ids,
 			 EDataBookView *book_view,
 			 GroupwiseBackendSearchClosure *closure)
 {
-	int i;
+	gint i;
 
 	if (enable_debug)
 		printf ("\nread contacts from cache for the ids found in summary\n");
 	for (i = 0; i < ids->len; i ++) {
-		char *uid;
+		gchar *uid;
 		EContact *contact;
 
                 if (!e_flag_is_set (closure->running))
@@ -2184,18 +2184,18 @@ get_contacts_from_cache (EBookBackendGroupwise *ebgw,
 static gpointer
 book_view_thread (gpointer data)
 {
-	int status, count = 0;
+	gint status, count = 0;
 	GList *gw_items, *temp_list, *contacts;
 	EContact *contact;
 	EBookBackendGroupwise *gwb;
-	const char *query = NULL;
+	const gchar *query = NULL;
 	EGwFilter *filter = NULL;
 	GPtrArray *ids = NULL;
 	EDataBookView *book_view = data;
 	GroupwiseBackendSearchClosure *closure = get_closure (book_view);
-	char *view = NULL;
+	gchar *view = NULL;
 	gboolean is_auto_completion = FALSE;
-	char *search_string = NULL;
+	gchar *search_string = NULL;
 	GTimeVal start, end;
 	unsigned long diff;
 
@@ -2428,7 +2428,7 @@ book_view_thread (gpointer data)
 			if (e_contact_get_const (contact, E_CONTACT_UID))
 				e_data_book_view_notify_update (book_view, contact);
 			else
-				g_critical ("Id missing for item %s\n", (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+				g_critical ("Id missing for item %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 			g_object_unref(contact);
 			g_object_unref (gw_items->data);
 		}
@@ -2484,7 +2484,7 @@ static void
 e_book_backend_groupwise_get_changes (EBookBackend *backend,
 				      EDataBook    *book,
 				      guint32       opid,
-				      const char *change_id  )
+				      const gchar *change_id  )
 {
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_get_changes...\n");
@@ -2494,7 +2494,7 @@ e_book_backend_groupwise_get_changes (EBookBackend *backend,
 }
 
 static void
-book_view_notify_status (EDataBookView *view, const char *status)
+book_view_notify_status (EDataBookView *view, const gchar *status)
 {
 	if (!view)
 		return;
@@ -2538,7 +2538,7 @@ get_sequence_from_cache (DB *db,
 		gdouble *cache_last_po_rebuild_time)
 {
 	DBT uid_dbt, vcard_dbt;
-	int db_error;
+	gint db_error;
 
 	string_to_dbt ("firstSequence", &uid_dbt);
 	memset (&vcard_dbt, 0, sizeof(vcard_dbt));
@@ -2593,7 +2593,7 @@ add_sequence_to_cache (DB *db,
 {
 		gchar *tmp;
 		DBT   uid_dbt, vcard_dbt;
-		int db_error;
+		gint db_error;
 
 		if (enable_debug) {
 			printf("Adding sequences to cache\n");
@@ -2642,12 +2642,12 @@ add_sequence_to_cache (DB *db,
 static gpointer
 build_cache (EBookBackendGroupwise *ebgw)
 {
-	int status, contact_num = 0;
+	gint status, contact_num = 0;
 	GList *gw_items = NULL;
 	EContact *contact;
 	EDataBookView *book_view;
 	EBookBackendGroupwisePrivate *priv = ebgw->priv;
-	char *status_msg;
+	gchar *status_msg;
 
 	status = e_gw_connection_get_items (ebgw->priv->cnc, ebgw->priv->container_id, "name email default members", NULL, &gw_items);
 	if (status != E_GW_CONNECTION_STATUS_OK)
@@ -2685,16 +2685,16 @@ till it gets fixed we will use get items. cursor implementation is below */
 static gpointer
 build_cache (EBookBackendGroupwise *ebgw)
 {
-	int status;
+	gint status;
 	GList *gw_items = NULL, *l;
 	EContact *contact;
-	int cursor, contact_num = 0;
+	gint cursor, contact_num = 0;
 	gboolean done = FALSE;
 	EBookBackendGroupwisePrivate *priv = ebgw->priv;
-	const char *position = E_GW_CURSOR_POSITION_START;
+	const gchar *position = E_GW_CURSOR_POSITION_START;
 	EDataBookView *book_view;
 	GroupwiseBackendSearchClosure *closure;
-	char *status_msg;
+	gchar *status_msg;
 	GTimeVal start, end;
 	GTimeVal tstart, tend;
 	unsigned long diff;
@@ -2840,15 +2840,15 @@ build_summary (EBookBackendGroupwise *ebgw)
 static gboolean
 update_cache (EBookBackendGroupwise *ebgw)
 {
-	int status, contact_num = 0;
+	gint status, contact_num = 0;
 	GList *gw_items = NULL;
 	EContact *contact;
 	EGwFilter *filter;
 	time_t mod_time;
-	char cache_time_string[100], *status_msg;
+	gchar cache_time_string[100], *status_msg;
 	const struct tm *tm;
 	struct stat buf;
-	char *cache_file_name;
+	gchar *cache_file_name;
 	EDataBookView *book_view;
 	GroupwiseBackendSearchClosure *closure;
 	GTimeVal start, end;
@@ -2894,7 +2894,7 @@ update_cache (EBookBackendGroupwise *ebgw)
 	}
 
 	for (; gw_items != NULL; gw_items = g_list_next(gw_items)) {
-		const char *id;
+		const gchar *id;
 
 		contact = e_contact_new ();
 		fill_contact_from_gw_item (contact, E_GW_ITEM (gw_items->data),
@@ -2950,10 +2950,10 @@ update_cache (EBookBackendGroupwise *ebgw)
 static gboolean
 update_address_book_deltas (EBookBackendGroupwise *ebgw)
 {
-	int status, contact_num = 0;
+	gint status, contact_num = 0;
 	gdouble server_first_sequence = -1, server_last_sequence = -1, server_last_po_rebuild_time = -1;
 	gdouble cache_first_sequence = -1, cache_last_sequence = -1, cache_last_po_rebuild_time = -1;
-	char *count, *sequence, *status_msg;
+	gchar *count, *sequence, *status_msg;
 	gboolean sync_required = FALSE;
 	GList *add_list = NULL, *delete_list = NULL;
 	EContact *contact;
@@ -2964,7 +2964,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 
 	GTimeVal start, end;
 	unsigned long diff;
-	char *cache_file_name;
+	gchar *cache_file_name;
 	struct stat buf;
 	time_t mod_time;
 
@@ -3072,7 +3072,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 			}
 
 			for (; delete_list != NULL; delete_list = g_list_next(delete_list)) {
-				const char *id;
+				const gchar *id;
 
 				/* deleted from the server */
 				contact = e_contact_new ();
@@ -3080,7 +3080,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 							   E_GW_ITEM (delete_list->data),
 							   ebgw->priv->categories_by_id);
 				if (enable_debug)
-					printf("contact email:%s, contact name:%s\n", (char *) e_contact_get(contact, E_CONTACT_EMAIL_1), (char *) e_contact_get(contact, E_CONTACT_GIVEN_NAME));
+					printf("contact email:%s, contact name:%s\n", (gchar *) e_contact_get(contact, E_CONTACT_EMAIL_1), (gchar *) e_contact_get(contact, E_CONTACT_GIVEN_NAME));
 				e_contact_set (contact,
 					       E_CONTACT_BOOK_URI,
 					       priv->original_uri);
@@ -3103,7 +3103,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 			}
 
 			for (; add_list != NULL; add_list = g_list_next(add_list)) {
-				const char *id;
+				const gchar *id;
 
 				/* newly added to server */
 				contact = e_contact_new ();
@@ -3126,7 +3126,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 				}
 
 				if (enable_debug)
-					printf("contact email:%s, contact name:%s\n", (char *)e_contact_get(contact, E_CONTACT_EMAIL_1),(char *) e_contact_get(contact, E_CONTACT_GIVEN_NAME));
+					printf("contact email:%s, contact name:%s\n", (gchar *)e_contact_get(contact, E_CONTACT_EMAIL_1),(gchar *) e_contact_get(contact, E_CONTACT_GIVEN_NAME));
 				e_contact_set (contact,
 					       E_CONTACT_BOOK_URI,
 					       priv->original_uri);
@@ -3261,19 +3261,19 @@ static void
 e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
 					    EDataBook    *book,
 					    guint32       opid,
-					    const char *user,
-					    const char *passwd,
-					    const char *auth_method)
+					    const gchar *user,
+					    const gchar *passwd,
+					    const gchar *auth_method)
 {
 	EBookBackendGroupwise *ebgw;
 	EBookBackendGroupwisePrivate *priv;
 	EGwConnectionErrors error;
-	char *id, *tmpfile;
-	int status;
-	char *http_uri;
+	gchar *id, *tmpfile;
+	gint status;
+	gchar *http_uri;
 	gboolean is_writable;
-	const char *cache_refresh_interval_set;
-	int cache_refresh_interval = CACHE_REFRESH_INTERVAL;
+	const gchar *cache_refresh_interval_set;
+	gint cache_refresh_interval = CACHE_REFRESH_INTERVAL;
 
 	ebgw = E_BOOK_BACKEND_GROUPWISE (backend);
 	priv = ebgw->priv;
@@ -3451,7 +3451,7 @@ e_book_backend_groupwise_get_required_fields (EBookBackend *backend,
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_get_required_fields...\n");
 
-	fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FILE_AS));
+	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FILE_AS));
 	e_data_book_respond_get_supported_fields (book, opid,
 						  GNOME_Evolution_Addressbook_Success,
 						  fields);
@@ -3465,7 +3465,7 @@ e_book_backend_groupwise_get_supported_fields (EBookBackend *backend,
 					       guint32       opid)
 {
 	GList *fields = NULL;
-	int i;
+	gint i;
 
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_get_supported_fields...\n");
@@ -3498,9 +3498,9 @@ e_book_backend_groupwise_cancel_operation (EBookBackend *backend, EDataBook *boo
 
 static void
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
-file_errcall (const DB_ENV *env, const char *buf1, const char *buf2)
+file_errcall (const DB_ENV *env, const gchar *buf1, const gchar *buf2)
 #else
-file_errcall (const char *buf1, char *buf2)
+file_errcall (const gchar *buf1, gchar *buf2)
 #endif
 {
 	g_warning ("libdb error: %s", buf2);
@@ -3513,18 +3513,18 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
 {
 	EBookBackendGroupwise *ebgw;
 	EBookBackendGroupwisePrivate *priv;
-	char *dirname, *filename, *tmp;
-        char *book_name;
-        char *uri;
-	char **tokens;
-	const char *port;
-	int db_error;
+	gchar *dirname, *filename, *tmp;
+        gchar *book_name;
+        gchar *uri;
+	gchar **tokens;
+	const gchar *port;
+	gint db_error;
 	DB *db;
 	DB_ENV *env;
 	EUri *parsed_uri;
-	int i;
-	const char *use_ssl;
-	const char *offline;
+	gint i;
+	const gchar *use_ssl;
+	const gchar *offline;
 
 
 	if (enable_debug)
@@ -3646,7 +3646,7 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
 	ebgw->priv->file_db = db;
 
 	if (db_error != 0) {
-		int rv;
+		gint rv;
 
 		/* the databade didn't exist, so we create the
 		   directory then the .db */
@@ -3723,7 +3723,7 @@ e_book_backend_groupwise_remove (EBookBackend *backend,
 				 guint32           opid)
 {
 	EBookBackendGroupwise *ebgw;
-	int status;
+	gint status;
 
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_remove...\n");
@@ -3744,7 +3744,7 @@ e_book_backend_groupwise_remove (EBookBackend *backend,
 	g_unlink (e_book_backend_db_cache_get_filename(ebgw->priv->file_db));
 }
 
-static char *
+static gchar *
 e_book_backend_groupwise_get_static_capabilities (EBookBackend *backend)
 {
 	EBookBackendGroupwise *ebgw;
@@ -3765,7 +3765,7 @@ static void
 e_book_backend_groupwise_get_supported_auth_methods (EBookBackend *backend, EDataBook *book, guint32 opid)
 {
 	GList *auth_methods = NULL;
-	char *auth_method;
+	gchar *auth_method;
 
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_get_supported_auth_methods...\n");
@@ -3780,7 +3780,7 @@ e_book_backend_groupwise_get_supported_auth_methods (EBookBackend *backend, EDat
 }
 
 static void
-e_book_backend_groupwise_set_mode (EBookBackend *backend, int mode)
+e_book_backend_groupwise_set_mode (EBookBackend *backend, gint mode)
 {
 	EBookBackendGroupwise *bg;
 
diff --git a/addressbook/backends/ldap/e-book-backend-ldap-factory.c b/addressbook/backends/ldap/e-book-backend-ldap-factory.c
index e0754df..73da037 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap-factory.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap-factory.c
@@ -45,7 +45,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = &ldap_type;
 	*num_types = 1;
diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c
index 802927e..80db1cd 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -154,7 +154,7 @@ typedef enum {
 static gboolean enable_debug = FALSE;
 
 static gchar *query_prop_to_ldap(gchar *query_prop);
-static gchar *e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const char *query);
+static gchar *e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const gchar *query);
 
 typedef struct LDAPOp LDAPOp;
 
@@ -164,13 +164,13 @@ struct _EBookBackendLDAPPrivate {
 	gboolean connected;
 
 	gchar    *ldap_host;   /* the hostname of the server */
-	int      ldap_port;    /* the port of the server */
-	char     *schema_dn;   /* the base dn for schema information */
+	gint      ldap_port;    /* the port of the server */
+	gchar     *schema_dn;   /* the base dn for schema information */
 	gchar    *ldap_rootdn; /* the base dn of our searches */
-	int      ldap_scope;   /* the scope used for searches */
+	gint      ldap_scope;   /* the scope used for searches */
 	gchar	*ldap_search_filter;
-	int      ldap_limit;   /* the search limit */
-	int      ldap_timeout; /* the search timeout */
+	gint      ldap_limit;   /* the search limit */
+	gint      ldap_timeout; /* the search timeout */
 
 	gchar   *auth_dn;
 	gchar   *auth_passwd;
@@ -196,23 +196,23 @@ struct _EBookBackendLDAPPrivate {
 	gboolean evolutionPersonChecked;
 	gboolean marked_for_offline;
 
-	int mode;
+	gint mode;
 	/* our operations */
 	GStaticRecMutex op_hash_mutex;
 	GHashTable *id_to_op;
-	int active_ops;
-	int poll_timeout;
+	gint active_ops;
+	gint poll_timeout;
 
 	/* summary file related */
-	char *summary_file_name;
+	gchar *summary_file_name;
 	gboolean is_summary_ready;
 	EBookBackendSummary *summary;
 
 	/* for future use */
-	void *reserved1;
-	void *reserved2;
-	void *reserved3;
-	void *reserved4;
+	gpointer reserved1;
+	gpointer reserved2;
+	gpointer reserved3;
+	gpointer reserved4;
 };
 
 typedef void (*LDAPOpHandler)(LDAPOp *op, LDAPMessage *res);
@@ -225,69 +225,69 @@ struct LDAPOp {
 	EDataBook     *book;
 	EDataBookView *view;
 	guint32        opid; /* the libebook operation id */
-	int            id;   /* the ldap msg id */
+	gint            id;   /* the ldap msg id */
 };
 
 /* every access to priv->ldap should be guarded with this lock */
 static GStaticRecMutex eds_ldap_handler_lock = G_STATIC_REC_MUTEX_INIT;
 
 static void     ldap_op_add (LDAPOp *op, EBookBackend *backend, EDataBook *book,
-			     EDataBookView *view, int opid, int msgid, LDAPOpHandler handler, LDAPOpDtor dtor);
+			     EDataBookView *view, gint opid, gint msgid, LDAPOpHandler handler, LDAPOpDtor dtor);
 static void     ldap_op_finished (LDAPOp *op);
 
 static gboolean poll_ldap (EBookBackendLDAP *bl);
 
 static EContact *build_contact_from_entry (EBookBackendLDAP *bl, LDAPMessage *e, GList **existing_objectclasses);
 
-static void email_populate (EContact *contact, char **values);
+static void email_populate (EContact *contact, gchar **values);
 static struct berval** email_ber (EContact *contact);
 static gboolean email_compare (EContact *contact1, EContact *contact2);
 
-static void member_populate (EContact *contact, char **values);
+static void member_populate (EContact *contact, gchar **values);
 static struct berval** member_ber (EContact *contact);
 static gboolean member_compare (EContact *contact1, EContact *contact2);
 
-static void homephone_populate (EContact *contact, char **values);
+static void homephone_populate (EContact *contact, gchar **values);
 static struct berval** homephone_ber (EContact *contact);
 static gboolean homephone_compare (EContact *contact1, EContact *contact2);
 
-static void business_populate (EContact *contact, char **values);
+static void business_populate (EContact *contact, gchar **values);
 static struct berval** business_ber (EContact *contact);
 static gboolean business_compare (EContact *contact1, EContact *contact2);
 
-static void anniversary_populate (EContact *contact, char **values);
+static void anniversary_populate (EContact *contact, gchar **values);
 static struct berval** anniversary_ber (EContact *contact);
 static gboolean anniversary_compare (EContact *contact1, EContact *contact2);
 
-static void birthday_populate (EContact *contact, char **values);
+static void birthday_populate (EContact *contact, gchar **values);
 static struct berval** birthday_ber (EContact *contact);
 static gboolean birthday_compare (EContact *contact1, EContact *contact2);
 
-static void category_populate (EContact *contact, char **values);
+static void category_populate (EContact *contact, gchar **values);
 static struct berval** category_ber (EContact *contact);
 static gboolean category_compare (EContact *contact1, EContact *contact2);
 
-static void home_address_populate(EContact * card, char **values);
+static void home_address_populate(EContact * card, gchar **values);
 static struct berval **home_address_ber(EContact * card);
 static gboolean home_address_compare(EContact * ecard1, EContact * ecard2);
 
-static void work_address_populate(EContact * card, char **values);
+static void work_address_populate(EContact * card, gchar **values);
 static struct berval **work_address_ber(EContact * card);
 static gboolean work_address_compare(EContact * ecard1, EContact * ecard2);
 
-static void other_address_populate(EContact * card, char **values);
+static void other_address_populate(EContact * card, gchar **values);
 static struct berval **other_address_ber(EContact * card);
 static gboolean other_address_compare(EContact * ecard1, EContact * ecard2);
 
-static void work_city_populate(EContact * card, char **values);
-static void work_state_populate(EContact * card, char **values);
-static void work_po_populate(EContact * card, char **values);
-static void work_zip_populate(EContact * card, char **values);
-static void work_country_populate(EContact * card, char **values);
-static void home_city_populate(EContact * card, char **values);
-static void home_state_populate(EContact * card, char **values);
-static void home_zip_populate(EContact * card, char **values);
-static void home_country_populate(EContact * card, char **values);
+static void work_city_populate(EContact * card, gchar **values);
+static void work_state_populate(EContact * card, gchar **values);
+static void work_po_populate(EContact * card, gchar **values);
+static void work_zip_populate(EContact * card, gchar **values);
+static void work_country_populate(EContact * card, gchar **values);
+static void home_city_populate(EContact * card, gchar **values);
+static void home_state_populate(EContact * card, gchar **values);
+static void home_zip_populate(EContact * card, gchar **values);
+static void home_country_populate(EContact * card, gchar **values);
 
 static void photo_populate (EContact *contact, struct berval **ber_values);
 static struct berval **photo_ber (EContact * contact);
@@ -297,7 +297,7 @@ static void cert_populate (EContact *contact, struct berval **ber_values);
 
 static struct prop_info {
 	EContactField field_id;
-	char *ldap_attr;
+	gchar *ldap_attr;
 #define PROP_TYPE_STRING    0x01
 #define PROP_TYPE_COMPLEX   0x02
 #define PROP_TYPE_BINARY    0x04
@@ -305,12 +305,12 @@ static struct prop_info {
 #define PROP_EVOLVE         0x10
 #define PROP_WRITE_ONLY     0x20
 #define PROP_TYPE_GROUP     0x40
-	int prop_type;
+	gint prop_type;
 
 	/* the remaining items are only used for the TYPE_COMPLEX props */
 
 	/* used when reading from the ldap server populates EContact with the values in **values. */
-	void (*populate_contact_func)(EContact *contact, char **values);
+	void (*populate_contact_func)(EContact *contact, gchar **values);
 	/* used when writing to an ldap server.  returns a NULL terminated array of berval*'s */
 	struct berval** (*ber_func)(EContact *contact);
 	/* used to compare list attributes */
@@ -419,11 +419,11 @@ static struct prop_info {
 #undef GROUP_PROP
 };
 
-static int num_prop_infos = sizeof(prop_info) / sizeof(prop_info[0]);
+static gint num_prop_infos = sizeof(prop_info) / sizeof(prop_info[0]);
 
 #if 0
 static void
-remove_view (int msgid, LDAPOp *op, EDataBookView *view)
+remove_view (gint msgid, LDAPOp *op, EDataBookView *view)
 {
 	if (op->view == view)
 		op->view = NULL;
@@ -501,7 +501,7 @@ can_browse (EBookBackend *backend)
 }
 
 static void
-book_view_notify_status (EDataBookView *view, const char *status)
+book_view_notify_status (EDataBookView *view, const gchar *status)
 {
 	if (!view)
 		return;
@@ -529,11 +529,11 @@ find_book_view (EBookBackendLDAP *bl)
 }
 
 static void
-add_to_supported_fields (EBookBackendLDAP *bl, char **attrs, GHashTable *attr_hash)
+add_to_supported_fields (EBookBackendLDAP *bl, gchar **attrs, GHashTable *attr_hash)
 {
-	int i;
+	gint i;
 	for (i = 0; attrs[i]; i ++) {
-		char *query_prop = g_hash_table_lookup (attr_hash, attrs[i]);
+		gchar *query_prop = g_hash_table_lookup (attr_hash, attrs[i]);
 
 		if (query_prop) {
 			bl->priv->supported_fields = g_list_append (bl->priv->supported_fields, g_strdup (query_prop));
@@ -562,11 +562,11 @@ add_to_supported_fields (EBookBackendLDAP *bl, char **attrs, GHashTable *attr_ha
 static void
 add_oc_attributes_to_supported_fields (EBookBackendLDAP *bl, LDAPObjectClass *oc)
 {
-	int i;
+	gint i;
 	GHashTable *attr_hash = g_hash_table_new (g_str_hash, g_str_equal);
 
 	for (i = 0; i < num_prop_infos; i ++)
-		g_hash_table_insert (attr_hash, prop_info[i].ldap_attr, (char*)e_contact_field_name (prop_info[i].field_id));
+		g_hash_table_insert (attr_hash, prop_info[i].ldap_attr, (gchar *)e_contact_field_name (prop_info[i].field_id));
 
 	if (oc->oc_at_oids_must)
 		add_to_supported_fields (bl, oc->oc_at_oids_must, attr_hash);
@@ -580,7 +580,7 @@ add_oc_attributes_to_supported_fields (EBookBackendLDAP *bl, LDAPObjectClass *oc
 static void
 check_schema_support (EBookBackendLDAP *bl)
 {
-	char *attrs[2];
+	gchar *attrs[2];
 	LDAPMessage *resp;
 	struct timeval timeout;
 
@@ -606,17 +606,17 @@ check_schema_support (EBookBackendLDAP *bl)
 	if (ldap_search_ext_s (bl->priv->ldap, bl->priv->schema_dn, LDAP_SCOPE_BASE,
 			       "(objectClass=subschema)", attrs, 0,
 			       NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp) == LDAP_SUCCESS) {
-		char **values;
+		gchar **values;
 
 		values = ldap_get_values (bl->priv->ldap, resp, "objectClasses");
 		g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
 
 		if (values) {
-			int i;
+			gint i;
 			for (i = 0; values[i]; i ++) {
-				int j;
-				int code;
-				const char *err;
+				gint j;
+				gint code;
+				const gchar *err;
 				LDAPObjectClass *oc = ldap_str2objectclass (values[i], &code, &err, 0);
 
 				if (!oc)
@@ -690,7 +690,7 @@ get_ldap_library_info (void)
 		g_warning ("couldn't get ldap api info");
 	}
 	else {
-		int i;
+		gint i;
 		g_message ("libldap vendor/version: %s %2d.%02d.%02d",
 			   info.ldapai_vendor_name,
 			   info.ldapai_vendor_version / 10000,
@@ -700,7 +700,7 @@ get_ldap_library_info (void)
 		g_message ("library extensions present:");
 		/* yuck.  we have to free these? */
 		for (i = 0; info.ldapai_extensions[i]; i++) {
-			char *extension = info.ldapai_extensions[i];
+			gchar *extension = info.ldapai_extensions[i];
 			g_message ("%s", extension);
 			ldap_memfree (extension);
 		}
@@ -717,9 +717,9 @@ query_ldap_root_dse (EBookBackendLDAP *bl)
 {
 #define MAX_DSE_ATTRS 20
 	LDAPMessage *resp;
-	int ldap_error = LDAP_OTHER;
-	char *attrs[MAX_DSE_ATTRS], **values;
-	int i = 0;
+	gint ldap_error = LDAP_OTHER;
+	gchar *attrs[MAX_DSE_ATTRS], **values;
+	gint i = 0;
 	struct timeval timeout;
 
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
@@ -778,7 +778,7 @@ query_ldap_root_dse (EBookBackendLDAP *bl)
 	values = ldap_get_values (bl->priv->ldap, resp, "supportedSASLMechanisms");
 	g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
 	if (values) {
-		char *auth_method;
+		gchar *auth_method;
 		if (bl->priv->supported_auth_methods) {
 			g_list_foreach (bl->priv->supported_auth_methods, (GFunc)g_free, NULL);
 			g_list_free (bl->priv->supported_auth_methods);
@@ -827,11 +827,11 @@ static GNOME_Evolution_Addressbook_CallStatus
 e_book_backend_ldap_connect (EBookBackendLDAP *bl)
 {
 	EBookBackendLDAPPrivate *blpriv = bl->priv;
-	int protocol_version = LDAP_VERSION3;
+	gint protocol_version = LDAP_VERSION3;
 	GTimeVal start, end;
 	unsigned long diff;
 #ifdef SUNLDAP
-	int ldap_flag;
+	gint ldap_flag;
 #endif
 
 	if (enable_debug) {
@@ -847,7 +847,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
 
 #ifdef SUNLDAP
 	if (bl->priv->use_tls != E_BOOK_BACKEND_LDAP_TLS_NO) {
-		char *evolution_dir_path =
+		gchar *evolution_dir_path =
 			g_build_path ("/", g_get_home_dir (), ".evolution", NULL);
 		ldap_flag = ldapssl_client_init (evolution_dir_path, NULL);
 		g_free (evolution_dir_path);
@@ -858,12 +858,12 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
 
 #if defined (DEBUG) && defined (LDAP_OPT_DEBUG_LEVEL)
 	{
-		int debug_level = 4;
+		gint debug_level = 4;
 		ldap_set_option (blpriv->ldap, LDAP_OPT_DEBUG_LEVEL, &debug_level);
 	}
 #endif
 	if (NULL != blpriv->ldap) {
-		int ldap_error;
+		gint ldap_error;
 
 		ldap_error = ldap_set_option (blpriv->ldap, LDAP_OPT_PROTOCOL_VERSION, &protocol_version);
 		if (LDAP_SUCCESS != ldap_error) {
@@ -896,7 +896,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
 				}
 #else
 #if defined (LDAP_OPT_X_TLS_HARD) && defined (LDAP_OPT_X_TLS)
-				int tls_level = LDAP_OPT_X_TLS_HARD;
+				gint tls_level = LDAP_OPT_X_TLS_HARD;
 				ldap_set_option (blpriv->ldap, LDAP_OPT_X_TLS, &tls_level);
 #elif defined (G_OS_WIN32)
 				ldap_set_option (blpriv->ldap, LDAP_OPT_SSL, LDAP_OPT_ON);
@@ -1026,7 +1026,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
 }
 
 static gboolean
-e_book_backend_ldap_reconnect (EBookBackendLDAP *bl, EDataBookView *book_view, int ldap_status)
+e_book_backend_ldap_reconnect (EBookBackendLDAP *bl, EDataBookView *book_view, gint ldap_status)
 {
 	GTimeVal start, end;
 	unsigned long diff;
@@ -1048,7 +1048,7 @@ e_book_backend_ldap_reconnect (EBookBackendLDAP *bl, EDataBookView *book_view, i
 	/* we need to reconnect if we were previously connected */
 	if (bl->priv->connected && ldap_status == LDAP_SERVER_DOWN) {
 		GNOME_Evolution_Addressbook_CallStatus status;
-		int ldap_error = LDAP_SUCCESS;
+		gint ldap_error = LDAP_SUCCESS;
 
 		if (book_view)
 			book_view_notify_status (book_view, _("Reconnecting to LDAP server..."));
@@ -1092,8 +1092,8 @@ e_book_backend_ldap_reconnect (EBookBackendLDAP *bl, EDataBookView *book_view, i
 static void
 ldap_op_add (LDAPOp *op, EBookBackend *backend,
 	     EDataBook *book, EDataBookView *view,
-	     int opid,
-	     int msgid,
+	     gint opid,
+	     gint msgid,
 	     LDAPOpHandler handler, LDAPOpDtor dtor)
 {
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
@@ -1156,7 +1156,7 @@ ldap_op_finished (LDAPOp *op)
 }
 
 static void
-ldap_op_change_id (LDAPOp *op, int msg_id)
+ldap_op_change_id (LDAPOp *op, gint msg_id)
 {
 	EBookBackend *backend = op->backend;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
@@ -1172,7 +1172,7 @@ ldap_op_change_id (LDAPOp *op, int msg_id)
 }
 
 static int
-ldap_error_to_response (int ldap_error)
+ldap_error_to_response (gint ldap_error)
 {
 	if (ldap_error == LDAP_SUCCESS)
 		return GNOME_Evolution_Addressbook_Success;
@@ -1195,18 +1195,18 @@ ldap_error_to_response (int ldap_error)
 }
 
 
-static char *
-create_dn_from_contact (EContact *contact, const char *root_dn)
+static gchar *
+create_dn_from_contact (EContact *contact, const gchar *root_dn)
 {
-	char *cn, *cn_part = NULL;
-	char *dn;
+	gchar *cn, *cn_part = NULL;
+	gchar *dn;
 
 	cn = e_contact_get (contact, E_CONTACT_FULL_NAME);
 	if (cn) {
 		if (strchr (cn, ',')) {
 			/* need to escape commas */
-			char *new_cn = g_malloc0 (strlen (cn) * 3 + 1);
-			int i, j;
+			gchar *new_cn = g_malloc0 (strlen (cn) * 3 + 1);
+			gint i, j;
 
 			for (i = 0, j = 0; i < strlen (cn); i ++) {
 				if (cn[i] == ',') {
@@ -1242,11 +1242,11 @@ create_dn_from_contact (EContact *contact, const char *root_dn)
 static void
 free_mods (GPtrArray *mods)
 {
-	int i = 0;
+	gint i = 0;
 	LDAPMod *mod;
 
 	while ((mod = g_ptr_array_index (mods, i++))) {
-		int j;
+		gint j;
 		g_free (mod->mod_type);
 
 		if (mod->mod_op & LDAP_MOD_BVALUES && mod->mod_bvalues) {
@@ -1270,7 +1270,7 @@ build_mods_from_contacts (EBookBackendLDAP *bl, EContact *current, EContact *new
 {
 	gboolean adding = (current == NULL), is_list = FALSE;
 	GPtrArray *result = g_ptr_array_new();
-	int i;
+	gint i;
 
 	if (new_dn_needed)
 		*new_dn_needed = FALSE;
@@ -1285,8 +1285,8 @@ build_mods_from_contacts (EBookBackendLDAP *bl, EContact *current, EContact *new
 		gboolean new_prop_present = FALSE;
 		gboolean current_prop_present = FALSE;
 		struct berval** new_prop_bers = NULL;
-		char *new_prop = NULL;
-		char *current_prop = NULL;
+		gchar *new_prop = NULL;
+		gchar *current_prop = NULL;
 
 		/* XXX if it's an evolutionPerson prop and the ldap
                    server doesn't support that objectclass, skip it. */
@@ -1340,7 +1340,7 @@ build_mods_from_contacts (EBookBackendLDAP *bl, EContact *current, EContact *new
 					include = (new_prop != current_prop) && (!new_prop || *new_prop); /* empty strings cause problems */
 			}
 			else {
-				int j;
+				gint j;
 				struct berval **current_prop_bers = prop_info[i].ber_func ? prop_info[i].ber_func (current) : NULL;
 
 				current_prop_present = (current_prop_bers != NULL);
@@ -1382,7 +1382,7 @@ build_mods_from_contacts (EBookBackendLDAP *bl, EContact *current, EContact *new
 			mod->mod_type = g_strdup (prop_info[i].ldap_attr);
 
 			if (prop_info[i].prop_type & PROP_TYPE_STRING) {
-				mod->mod_values = g_new (char*, 2);
+				mod->mod_values = g_new (gchar *, 2);
 				mod->mod_values[0] = new_prop;
 				mod->mod_values[1] = NULL;
 			}
@@ -1436,7 +1436,7 @@ add_objectclass_mod (EBookBackendLDAP *bl, GPtrArray *mod_array, GList *existing
 
 		if (objectclasses->len) {
 			g_ptr_array_add (objectclasses, NULL);
-			objectclass_mod->mod_values = (char**)objectclasses->pdata;
+			objectclass_mod->mod_values = (gchar **)objectclasses->pdata;
 			g_ptr_array_add (mod_array, objectclass_mod);
 			g_ptr_array_free (objectclasses, FALSE);
 		}
@@ -1465,7 +1465,7 @@ add_objectclass_mod (EBookBackendLDAP *bl, GPtrArray *mod_array, GList *existing
 				INSERT(EVOLUTIONPERSON);
 		}
 		g_ptr_array_add (objectclasses, NULL);
-		objectclass_mod->mod_values = (char**)objectclasses->pdata;
+		objectclass_mod->mod_values = (gchar **)objectclasses->pdata;
 		g_ptr_array_add (mod_array, objectclass_mod);
 		g_ptr_array_free (objectclasses, FALSE);
 	}
@@ -1473,7 +1473,7 @@ add_objectclass_mod (EBookBackendLDAP *bl, GPtrArray *mod_array, GList *existing
 
 typedef struct {
 	LDAPOp op;
-	char *dn;
+	gchar *dn;
 	EContact *new_contact;
 } LDAPCreateOp;
 
@@ -1482,9 +1482,9 @@ create_contact_handler (LDAPOp *op, LDAPMessage *res)
 {
 	LDAPCreateOp *create_op = (LDAPCreateOp*)op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
-	char *ldap_error_msg;
-	int ldap_error;
-	int response;
+	gchar *ldap_error_msg;
+	gint ldap_error;
+	gint response;
 
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 	if (!bl->priv->ldap) {
@@ -1546,14 +1546,14 @@ static void
 e_book_backend_ldap_create_contact (EBookBackend *backend,
 				    EDataBook    *book,
 				    guint32       opid,
-				    const char   *vcard)
+				    const gchar   *vcard)
 {
 	LDAPCreateOp *create_op = g_new (LDAPCreateOp, 1);
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
 	EDataBookView *book_view;
-	int create_contact_msgid;
-	int response;
-	int err;
+	gint create_contact_msgid;
+	gint response;
+	gint err;
 	GPtrArray *mod_array;
 	LDAPMod **ldap_mods;
 
@@ -1613,7 +1613,7 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
 
 #ifdef LDAP_DEBUG_ADD
 		{
-			int i;
+			gint i;
 			printf ("Sending the following to the server as ADD\n");
 
 			for (i = 0; g_ptr_array_index(mod_array, i); i ++) {
@@ -1632,12 +1632,12 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
 				printf (" %s:\n", mod->mod_type);
 
 				if (mod->mod_op & LDAP_MOD_BVALUES) {
-					int j;
+					gint j;
 					for (j = 0; mod->mod_bvalues[j] && mod->mod_bvalues[j]->bv_val; j++)
 						printf ("\t\t'%s'\n", mod->mod_bvalues[j]->bv_val);
 				}
 				else {
-					int j;
+					gint j;
 
 					for (j = 0; mod->mod_values[j]; j++)
 						printf ("\t\t'%s'\n", mod->mod_values[j]);
@@ -1681,7 +1681,7 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
 
 typedef struct {
 	LDAPOp op;
-	char *id;
+	gchar *id;
 } LDAPRemoveOp;
 
 static void
@@ -1689,8 +1689,8 @@ remove_contact_handler (LDAPOp *op, LDAPMessage *res)
 {
 	LDAPRemoveOp *remove_op = (LDAPRemoveOp*)op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
-	char *ldap_error_msg;
-	int ldap_error;
+	gchar *ldap_error_msg;
+	gint ldap_error;
 	GList *ids = NULL;
 
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
@@ -1755,8 +1755,8 @@ e_book_backend_ldap_remove_contacts (EBookBackend *backend,
 	LDAPRemoveOp *remove_op = g_new (LDAPRemoveOp, 1);
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
 	EDataBookView *book_view;
-	int remove_msgid;
-	int ldap_error;
+	gint remove_msgid;
+	gint ldap_error;
 
 	switch (bl->priv->mode) {
 
@@ -1826,7 +1826,7 @@ e_book_backend_ldap_remove_contacts (EBookBackend *backend,
 
 typedef struct {
 	LDAPOp op;
-	const char *id; /* the id of the contact we're modifying */
+	const gchar *id; /* the id of the contact we're modifying */
 	EContact *current_contact;
 	EContact *contact;
 	GList *existing_objectclasses;
@@ -1837,8 +1837,8 @@ modify_contact_modify_handler (LDAPOp *op, LDAPMessage *res)
 {
 	LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
-	char *ldap_error_msg;
-	int ldap_error;
+	gchar *ldap_error_msg;
+	gint ldap_error;
 
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 	if (!bl->priv->ldap) {
@@ -1889,7 +1889,7 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
 {
 	LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
-	int msg_type;
+	gint msg_type;
 
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 	if (!bl->priv->ldap) {
@@ -1927,13 +1927,13 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
 								       &modify_op->existing_objectclasses);
 	}
 	else if (msg_type == LDAP_RES_SEARCH_RESULT) {
-		char *ldap_error_msg;
-		int ldap_error;
+		gchar *ldap_error_msg;
+		gint ldap_error;
 		LDAPMod **ldap_mods;
 		GPtrArray *mod_array;
 		gboolean differences;
 		gboolean need_new_dn;
-		int modify_contact_msgid;
+		gint modify_contact_msgid;
 
 		/* grab the result code, and set up the actual modify
                    if it was successful */
@@ -1980,7 +1980,7 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
 
 #ifdef LDAP_DEBUG_MODIFY
 			{
-				int i;
+				gint i;
 				printf ("Sending the following to the server as MOD\n");
 
 				for (i = 0; g_ptr_array_index(mod_array, i); i ++) {
@@ -1999,12 +1999,12 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
 					printf (" %s:\n", mod->mod_type);
 
 					if (mod->mod_op & LDAP_MOD_BVALUES) {
-						int j;
+						gint j;
 						for (j = 0; mod->mod_bvalues[j] && mod->mod_bvalues[j]->bv_val; j++)
 							printf ("\t\t'%s'\n", mod->mod_bvalues[j]->bv_val);
 					}
 					else {
-						int j;
+						gint j;
 						for (j = 0; mod->mod_values[j]; j++)
 							printf ("\t\t'%s'\n", mod->mod_values[j]);
 					}
@@ -2065,12 +2065,12 @@ static void
 e_book_backend_ldap_modify_contact (EBookBackend *backend,
 				    EDataBook    *book,
 				    guint32       opid,
-				    const char   *vcard)
+				    const gchar   *vcard)
 {
 	LDAPModifyOp *modify_op = g_new0 (LDAPModifyOp, 1);
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
-	int ldap_error;
-	int modify_contact_msgid;
+	gint ldap_error;
+	gint modify_contact_msgid;
 	EDataBookView *book_view;
 
 
@@ -2134,7 +2134,7 @@ static void
 get_contact_handler (LDAPOp *op, LDAPMessage *res)
 {
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
-	int msg_type;
+	gint msg_type;
 	GTimeVal start, end;
 	unsigned long diff;
 
@@ -2161,7 +2161,7 @@ get_contact_handler (LDAPOp *op, LDAPMessage *res)
 	if (msg_type == LDAP_RES_SEARCH_ENTRY) {
 		LDAPMessage *e;
 		EContact *contact;
-		char *vcard;
+		gchar *vcard;
 
 		g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 		e = ldap_first_entry (bl->priv->ldap, res);
@@ -2197,8 +2197,8 @@ get_contact_handler (LDAPOp *op, LDAPMessage *res)
 		}
 	}
 	else if (msg_type == LDAP_RES_SEARCH_RESULT) {
-		char *ldap_error_msg;
-		int ldap_error;
+		gchar *ldap_error_msg;
+		gint ldap_error;
 
 		g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 		ldap_parse_result (bl->priv->ldap, res, &ldap_error,
@@ -2240,13 +2240,13 @@ static void
 e_book_backend_ldap_get_contact (EBookBackend *backend,
 				 EDataBook    *book,
 				 guint32       opid,
-				 const char   *id)
+				 const gchar   *id)
 {
 	LDAPGetContactOp *get_contact_op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
-	int get_contact_msgid;
+	gint get_contact_msgid;
 	EDataBookView *book_view;
-	int ldap_error;
+	gint ldap_error;
 	GTimeVal start, end;
 	unsigned long diff;
 
@@ -2343,7 +2343,7 @@ contact_list_handler (LDAPOp *op, LDAPMessage *res)
 	LDAPGetContactListOp *contact_list_op = (LDAPGetContactListOp*)op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	LDAPMessage *e;
-	int msg_type;
+	gint msg_type;
 	GTimeVal start, end;
 	unsigned long diff;
 
@@ -2371,7 +2371,7 @@ contact_list_handler (LDAPOp *op, LDAPMessage *res)
 
 		while (NULL != e) {
 			EContact *contact;
-			char *vcard;
+			gchar *vcard;
 
 			contact = build_contact_from_entry (bl, e, NULL);
 
@@ -2390,8 +2390,8 @@ contact_list_handler (LDAPOp *op, LDAPMessage *res)
 		}
 	}
 	else if (msg_type == LDAP_RES_SEARCH_RESULT) {
-		char *ldap_error_msg;
-		int ldap_error;
+		gchar *ldap_error_msg;
+		gint ldap_error;
 
 		g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 		ldap_parse_result (bl->priv->ldap, res, &ldap_error,
@@ -2459,14 +2459,14 @@ static void
 e_book_backend_ldap_get_contact_list (EBookBackend *backend,
 				      EDataBook    *book,
 				      guint32       opid,
-				      const char   *query)
+				      const gchar   *query)
 {
 	LDAPGetContactListOp *contact_list_op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
-	int contact_list_msgid;
+	gint contact_list_msgid;
 	EDataBookView *book_view;
-	int ldap_error;
-	char *ldap_query;
+	gint ldap_error;
+	gchar *ldap_query;
 	GTimeVal start, end;
 	unsigned long diff;
 
@@ -2566,9 +2566,9 @@ static EContactField email_ids[4] = {
 
 /* List property functions */
 static void
-email_populate(EContact *contact, char **values)
+email_populate(EContact *contact, gchar **values)
 {
-	int i;
+	gint i;
 	for (i = 0; values[i] && i < 4; i ++)
 		e_contact_set (contact, email_ids[i], values[i]);
 }
@@ -2577,8 +2577,8 @@ static struct berval**
 email_ber(EContact *contact)
 {
 	struct berval** result;
-	const char *emails[4];
-	int i, j, num = 0;
+	const gchar *emails[4];
+	gint i, j, num = 0;
 
 	if (e_contact_get (contact, E_CONTACT_IS_LIST))
 		return NULL;
@@ -2613,8 +2613,8 @@ email_ber(EContact *contact)
 static gboolean
 email_compare (EContact *contact1, EContact *contact2)
 {
-	const char *email1, *email2;
-	int i;
+	const gchar *email1, *email2;
+	gint i;
 	/*
 	if (e_contact_get (contact1, E_CONTACT_IS_LIST))
 		return TRUE;
@@ -2639,9 +2639,9 @@ email_compare (EContact *contact1, EContact *contact2)
 
 
 static void
-member_populate (EContact *contact, char **values)
+member_populate (EContact *contact, gchar **values)
 {
-	int i;
+	gint i;
 	gchar **member_info;
 
 	for (i = 0; values[i]; i ++) {
@@ -2653,8 +2653,8 @@ member_populate (EContact *contact, char **values)
 		e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_X_DEST_CONTACT_UID), member_info [1]);
 
 		if (member_info [2]) {
-			int len = strlen (member_info [2]);
-			char *value;
+			gint len = strlen (member_info [2]);
+			gchar *value;
 
 			if (member_info [2][0] == '\"' && member_info [2][len - 1] == '\"')
 				value = g_strdup_printf ("%s <%s>", member_info [2], member_info [0]);
@@ -2677,8 +2677,8 @@ member_ber (EContact *contact)
 {
 	struct berval** result;
 	GList *members, *l, *p;
-	int i=0, num = 0;
-	char *dn;
+	gint i=0, num = 0;
+	gchar *dn;
 
 	if (!(e_contact_get (contact, E_CONTACT_IS_LIST)))
 		return NULL;
@@ -2696,7 +2696,7 @@ member_ber (EContact *contact)
 
 		for (p = e_vcard_attribute_get_params (attr); p; p = p->next) {
 			EVCardAttributeParam *param = p->data;
-			const char *param_name = e_vcard_attribute_param_get_name (param);
+			const gchar *param_name = e_vcard_attribute_param_get_name (param);
 
 			if (!g_ascii_strcasecmp (param_name, EVC_X_DEST_CONTACT_UID)) {
 				GList *v = e_vcard_attribute_param_get_values (param);
@@ -2718,8 +2718,8 @@ static gboolean
 member_compare (EContact *contact_new, EContact *contact_current)
 {
 	GList *members_new, *members_cur, *l1, *l2, *p_new, *p_cur;
-	int len1 = 0, len2 = 0;
-	char *list_name1, *list_name2;
+	gint len1 = 0, len2 = 0;
+	gchar *list_name1, *list_name2;
 	gboolean equal;
 
 	if (!(e_contact_get (contact_new, E_CONTACT_IS_LIST)))
@@ -2746,11 +2746,11 @@ member_compare (EContact *contact_new, EContact *contact_current)
 
 	for (l1 = members_new; l1 != NULL; l1 = g_list_next (l1)) {
 		EVCardAttribute *attr_new = l1->data;
-		char *dn_new = NULL;
+		gchar *dn_new = NULL;
 
 		for (p_new = e_vcard_attribute_get_params (attr_new); p_new; p_new = p_new->next) {
 			EVCardAttributeParam *param = p_new->data;
-			const char *param_name1 = e_vcard_attribute_param_get_name (param);
+			const gchar *param_name1 = e_vcard_attribute_param_get_name (param);
 
 			if (!g_ascii_strcasecmp (param_name1, EVC_X_DEST_CONTACT_UID)) {
 				gboolean found = FALSE;
@@ -2759,11 +2759,11 @@ member_compare (EContact *contact_new, EContact *contact_current)
 				if (dn_new) {
 					for (l2 = members_cur; l2 != NULL; l2 = g_list_next (l2)) {
 						EVCardAttribute *attr_cur = l2->data;
-						char *dn_cur = NULL;
+						gchar *dn_cur = NULL;
 
 						for (p_cur = e_vcard_attribute_get_params (attr_cur); p_cur; p_cur = p_cur->next) {
 							EVCardAttributeParam *param2 = p_cur->data;
-							const char *param_name2 = e_vcard_attribute_param_get_name (param2);
+							const gchar *param_name2 = e_vcard_attribute_param_get_name (param2);
 
 							if (!g_ascii_strcasecmp (param_name2, EVC_X_DEST_CONTACT_UID)) {
 								GList *v2 = e_vcard_attribute_param_get_values (param2);
@@ -2792,7 +2792,7 @@ member_compare (EContact *contact_new, EContact *contact_current)
 }
 
 static void
-homephone_populate(EContact *contact, char **values)
+homephone_populate(EContact *contact, gchar **values)
 {
 	if (values[0]) {
 		e_contact_set (contact, E_CONTACT_PHONE_HOME, values[0]);
@@ -2805,8 +2805,8 @@ static struct berval**
 homephone_ber(EContact *contact)
 {
 	struct berval** result;
-	const char *homephones[3];
-	int i, j, num;
+	const gchar *homephones[3];
+	gint i, j, num;
 
 	num = 0;
 	if ((homephones[0] = e_contact_get (contact, E_CONTACT_PHONE_HOME)))
@@ -2838,9 +2838,9 @@ homephone_ber(EContact *contact)
 static gboolean
 homephone_compare (EContact *contact1, EContact *contact2)
 {
-	int phone_ids[2] = { E_CONTACT_PHONE_HOME, E_CONTACT_PHONE_HOME_2 };
-	const char *phone1, *phone2;
-	int i;
+	gint phone_ids[2] = { E_CONTACT_PHONE_HOME, E_CONTACT_PHONE_HOME_2 };
+	const gchar *phone1, *phone2;
+	gint i;
 
 	for (i = 0; i < 2; i ++) {
 		gboolean equal;
@@ -2860,7 +2860,7 @@ homephone_compare (EContact *contact1, EContact *contact2)
 }
 
 static void
-business_populate(EContact *contact, char **values)
+business_populate(EContact *contact, gchar **values)
 {
 	if (values[0]) {
 		e_contact_set (contact, E_CONTACT_PHONE_BUSINESS, values[0]);
@@ -2873,8 +2873,8 @@ static struct berval**
 business_ber(EContact *contact)
 {
 	struct berval** result;
-	const char *business_phones[3];
-	int i, j, num;
+	const gchar *business_phones[3];
+	gint i, j, num;
 
 	num = 0;
 	if ((business_phones[0] = e_contact_get (contact, E_CONTACT_PHONE_BUSINESS)))
@@ -2906,9 +2906,9 @@ business_ber(EContact *contact)
 static gboolean
 business_compare (EContact *contact1, EContact *contact2)
 {
-	int phone_ids[2] = { E_CONTACT_PHONE_BUSINESS, E_CONTACT_PHONE_BUSINESS_2 };
-	const char *phone1, *phone2;
-	int i;
+	gint phone_ids[2] = { E_CONTACT_PHONE_BUSINESS, E_CONTACT_PHONE_BUSINESS_2 };
+	const gchar *phone1, *phone2;
+	gint i;
 
 	for (i = 0; i < 2; i ++) {
 		gboolean equal;
@@ -2928,7 +2928,7 @@ business_compare (EContact *contact1, EContact *contact2)
 }
 
 static void
-anniversary_populate (EContact *contact, char **values)
+anniversary_populate (EContact *contact, gchar **values)
 {
 	if (values[0]) {
 		EContactDate *dt = e_contact_date_from_string (values[0]);
@@ -2946,7 +2946,7 @@ anniversary_ber (EContact *contact)
 	dt = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
 
 	if (dt) {
-		char *anniversary;
+		gchar *anniversary;
 
 		anniversary = e_contact_date_to_string (dt);
 
@@ -2981,7 +2981,7 @@ anniversary_compare (EContact *contact1, EContact *contact2)
 }
 
 static void
-birthday_populate (EContact *contact, char **values)
+birthday_populate (EContact *contact, gchar **values)
 {
 	if (values[0]) {
 		EContactDate *dt = e_contact_date_from_string (values[0]);
@@ -2998,7 +2998,7 @@ birthday_ber (EContact *contact)
 
 	dt = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
 	if (dt) {
-		char *birthday;
+		gchar *birthday;
 
 		birthday = e_contact_date_to_string (dt);
 
@@ -3033,9 +3033,9 @@ birthday_compare (EContact *contact1, EContact *contact2)
 }
 
 static void
-category_populate (EContact *contact, char **values)
+category_populate (EContact *contact, gchar **values)
 {
-	int i;
+	gint i;
 	GList *categories = NULL;
 
 	for (i = 0; values[i]; i++)
@@ -3052,7 +3052,7 @@ category_ber (EContact *contact)
 {
 	struct berval** result = NULL;
 	GList *categories;
-	const char *category_string;
+	const gchar *category_string;
 
 	category_string = e_contact_get (contact, E_CONTACT_CATEGORIES);
 	if (!category_string || !*category_string)
@@ -3061,12 +3061,12 @@ category_ber (EContact *contact)
 	categories = e_contact_get (contact, E_CONTACT_CATEGORY_LIST);
 
 	if (g_list_length (categories) != 0) {
-		int i;
+		gint i;
 		GList *iter;
 		result = g_new0 (struct berval*, g_list_length (categories) + 1);
 
 		for (iter = categories, i = 0; iter; iter = iter->next) {
-			char *category = iter->data;
+			gchar *category = iter->data;
 
 			if (category && *category) {
 				result[i] = g_new (struct berval, 1);
@@ -3085,7 +3085,7 @@ category_ber (EContact *contact)
 static gboolean
 category_compare (EContact *contact1, EContact *contact2)
 {
-	const char *categories1, *categories2;
+	const gchar *categories1, *categories2;
 	gboolean equal;
 
 	categories1 = e_contact_get_const (contact1, E_CONTACT_CATEGORIES);
@@ -3110,12 +3110,12 @@ static EContactAddress * getormakeEContactAddress(EContact * card, EContactField
 
 
 static void
-address_populate(EContact * card, char **values, EContactField field, EContactField other_field)
+address_populate(EContact * card, gchar **values, EContactField field, EContactField other_field)
 {
 	if (values[0]) {
 		EContactAddress *contact_addr;
-		char *temp = g_strdup(values[0]);
-		char *i;
+		gchar *temp = g_strdup(values[0]);
+		gchar *i;
 		for (i = temp; *i != '\0'; i++) {
 			if (*i == '$') {
 				*i = '\n';
@@ -3133,7 +3133,7 @@ address_populate(EContact * card, char **values, EContactField field, EContactFi
 }
 
 static void
-work_city_populate(EContact * card, char **values)
+work_city_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_WORK);
         contact_addr->locality = g_strdup (values[0]);
@@ -3142,7 +3142,7 @@ work_city_populate(EContact * card, char **values)
 }
 
 static void
-work_state_populate(EContact * card, char **values)
+work_state_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_WORK);
         contact_addr->region = g_strdup (values[0]);
@@ -3151,7 +3151,7 @@ work_state_populate(EContact * card, char **values)
 }
 
 static void
-work_po_populate(EContact * card, char **values)
+work_po_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_WORK);
         contact_addr->po = g_strdup (values[0]);
@@ -3160,7 +3160,7 @@ work_po_populate(EContact * card, char **values)
 }
 
 static void
-work_zip_populate(EContact * card, char **values)
+work_zip_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_WORK);
         contact_addr->code = g_strdup (values[0]);
@@ -3169,7 +3169,7 @@ work_zip_populate(EContact * card, char **values)
 }
 
 static void
-work_country_populate(EContact * card, char **values)
+work_country_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_WORK);
         contact_addr->country = g_strdup (values[0]);
@@ -3178,7 +3178,7 @@ work_country_populate(EContact * card, char **values)
 }
 
 static void
-home_city_populate(EContact * card, char **values)
+home_city_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_HOME);
         contact_addr->locality = g_strdup (values[0]);
@@ -3187,7 +3187,7 @@ home_city_populate(EContact * card, char **values)
 }
 
 static void
-home_state_populate(EContact * card, char **values)
+home_state_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_HOME);
         contact_addr->region = g_strdup (values[0]);
@@ -3196,7 +3196,7 @@ home_state_populate(EContact * card, char **values)
 }
 
 static void
-home_zip_populate(EContact * card, char **values)
+home_zip_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_HOME);
         contact_addr->code = g_strdup (values[0]);
@@ -3205,7 +3205,7 @@ home_zip_populate(EContact * card, char **values)
 }
 
 static void
-home_country_populate(EContact * card, char **values)
+home_country_populate(EContact * card, gchar **values)
 {
 	EContactAddress *contact_addr = getormakeEContactAddress(card, E_CONTACT_ADDRESS_HOME);
         contact_addr->country = g_strdup (values[0]);
@@ -3214,19 +3214,19 @@ home_country_populate(EContact * card, char **values)
 }
 
 static void
-home_address_populate(EContact * card, char **values)
+home_address_populate(EContact * card, gchar **values)
 {
 	address_populate(card, values, E_CONTACT_ADDRESS_LABEL_HOME, E_CONTACT_ADDRESS_HOME);
 }
 
 static void
-work_address_populate(EContact * card, char **values)
+work_address_populate(EContact * card, gchar **values)
 {
 	address_populate(card, values, E_CONTACT_ADDRESS_LABEL_WORK, E_CONTACT_ADDRESS_WORK);
 }
 
 static void
-other_address_populate(EContact * card, char **values)
+other_address_populate(EContact * card, gchar **values)
 {
 	address_populate(card, values, E_CONTACT_ADDRESS_LABEL_OTHER, E_CONTACT_ADDRESS_OTHER);
 }
@@ -3235,7 +3235,7 @@ static struct berval **
 address_ber(EContact * card, EContactField field)
 {
 	struct berval **result = NULL;
-	char *address, *i;
+	gchar *address, *i;
 
 	address = e_contact_get(card, field);
 	if (address) {
@@ -3276,7 +3276,7 @@ other_address_ber(EContact * card)
 static gboolean
 address_compare(EContact * ecard1, EContact * ecard2, EContactField field)
 {
-	const char *address1, *address2;
+	const gchar *address1, *address2;
 
 	gboolean equal;
 	address1 = e_contact_get_const(ecard1, field);
@@ -3315,7 +3315,7 @@ photo_populate (EContact *contact, struct berval **ber_values)
                 EContactPhoto photo;
                 photo.type = E_CONTACT_PHOTO_TYPE_INLINED;
                 photo.data.inlined.mime_type = NULL;
-                photo.data.inlined.data = (guchar*)ber_values[0]->bv_val;
+                photo.data.inlined.data = (guchar *)ber_values[0]->bv_val;
                 photo.data.inlined.length = ber_values[0]->bv_len;
 
                 e_contact_set (contact, E_CONTACT_PHOTO, &photo);
@@ -3396,12 +3396,12 @@ typedef struct {
 } EBookBackendLDAPSExpData;
 
 #define IS_RFC2254_CHAR(c) ((c) == '*' || (c) =='\\' || (c) == '(' || (c) == ')' || (c) == '\0')
-static char *
-rfc2254_escape(char *str)
+static gchar *
+rfc2254_escape(gchar *str)
 {
-	int i;
-	int len = strlen(str);
-	int newlen = 0;
+	gint i;
+	gint len = strlen(str);
+	gint newlen = 0;
 
 	for (i = 0; i < len; i ++) {
 		if (IS_RFC2254_CHAR(str[i]))
@@ -3414,8 +3414,8 @@ rfc2254_escape(char *str)
 		return g_strdup (str);
 	}
 	else {
-		char *newstr = g_malloc0 (newlen + 1);
-		int j = 0;
+		gchar *newstr = g_malloc0 (newlen + 1);
+		gint j = 0;
 		for (i = 0; i < len; i ++) {
 			if (IS_RFC2254_CHAR(str[i])) {
 				sprintf (newstr + j, "\\%02x", str[i]);
@@ -3435,12 +3435,12 @@ rfc2254_escape(char *str)
  * Return value is changed @param str. (ie. this function is changeing
  * str itself, didn't alocate new memory.)
  */
-static char *
-extend_query_value (char *str)
+static gchar *
+extend_query_value (gchar *str)
 {
 	if(str && g_utf8_strlen (str, -1) > 0){
-		char *next;
-		char *last_star = NULL;
+		gchar *next;
+		gchar *last_star = NULL;
 		gboolean have_nonspace = FALSE;
 
 		for (next = str; next && *next; next = g_utf8_next_char (next) ){
@@ -3466,16 +3466,16 @@ extend_query_value (char *str)
 }
 
 static ESExpResult *
-func_and(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_and(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendLDAPSExpData *ldap_data = data;
 	ESExpResult *r;
-	char ** strings;
+	gchar ** strings;
 
 	if (argc > 0) {
-		int i;
+		gint i;
 
-		strings = g_new0(char*, argc+3);
+		strings = g_new0(gchar *, argc+3);
 		strings[0] = g_strdup ("(&");
 		strings[argc+3 - 2] = g_strdup (")");
 
@@ -3503,16 +3503,16 @@ func_and(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_or(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_or(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendLDAPSExpData *ldap_data = data;
 	ESExpResult *r;
-	char ** strings;
+	gchar ** strings;
 
 	if (argc > 0) {
-		int i;
+		gint i;
 
-		strings = g_new0(char*, argc+3);
+		strings = g_new0(gchar *, argc+3);
 		strings[0] = g_strdup ("(|");
 		strings[argc+3 - 2] = g_strdup (")");
 
@@ -3540,14 +3540,14 @@ func_or(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_not(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendLDAPSExpData *ldap_data = data;
 	ESExpResult *r;
 
 	/* just replace the head of the list with the NOT of it. */
 	if (argc > 0) {
-		char *term = ldap_data->list->data;
+		gchar *term = ldap_data->list->data;
 		ldap_data->list->data = g_strdup_printf("(!%s)", term);
 		g_free (term);
 	}
@@ -3559,7 +3559,7 @@ func_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendLDAPSExpData *ldap_data = data;
 	ESExpResult *r;
@@ -3567,18 +3567,18 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = extend_query_value( rfc2254_escape (argv[1]->value.string));
+		gchar *propname = argv[0]->value.string;
+		gchar *str = extend_query_value( rfc2254_escape (argv[1]->value.string));
 		gboolean one_star = FALSE;
 
 		if (strlen(str) == 0)
 			one_star = TRUE;
 
 		if (!strcmp (propname, "x-evolution-any-field")) {
-			int i;
-			int query_length;
-			char *big_query;
-			char *match_str;
+			gint i;
+			gint query_length;
+			gchar *big_query;
+			gchar *match_str;
 			if (one_star) {
 				g_free (str);
 
@@ -3610,7 +3610,7 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 			g_free (match_str);
 		}
 		else {
-			char *ldap_attr = query_prop_to_ldap(propname);
+			gchar *ldap_attr = query_prop_to_ldap(propname);
 
 			if (ldap_attr)
 				ldap_data->list = g_list_prepend(ldap_data->list,
@@ -3630,7 +3630,7 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 }
 
 static ESExpResult *
-func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_is(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendLDAPSExpData *ldap_data = data;
 	ESExpResult *r;
@@ -3638,9 +3638,9 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = rfc2254_escape(argv[1]->value.string);
-		char *ldap_attr = query_prop_to_ldap(propname);
+		gchar *propname = argv[0]->value.string;
+		gchar *str = rfc2254_escape(argv[1]->value.string);
+		gchar *ldap_attr = query_prop_to_ldap(propname);
 
 		if (ldap_attr)
 			ldap_data->list = g_list_prepend(ldap_data->list,
@@ -3663,7 +3663,7 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_beginswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendLDAPSExpData *ldap_data = data;
 	ESExpResult *r;
@@ -3671,9 +3671,9 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = rfc2254_escape(argv[1]->value.string);
-		char *ldap_attr = query_prop_to_ldap(propname);
+		gchar *propname = argv[0]->value.string;
+		gchar *str = rfc2254_escape(argv[1]->value.string);
+		gchar *ldap_attr = query_prop_to_ldap(propname);
 
 		if (strlen (str) == 0) {
 			g_free (str);
@@ -3720,7 +3720,7 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
 }
 
 static ESExpResult *
-func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_endswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendLDAPSExpData *ldap_data = data;
 	ESExpResult *r;
@@ -3728,9 +3728,9 @@ func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = rfc2254_escape(argv[1]->value.string);
-		char *ldap_attr = query_prop_to_ldap(propname);
+		gchar *propname = argv[0]->value.string;
+		gchar *str = rfc2254_escape(argv[1]->value.string);
+		gchar *ldap_attr = query_prop_to_ldap(propname);
 
 		if (ldap_attr)
 			ldap_data->list = g_list_prepend(ldap_data->list,
@@ -3747,20 +3747,20 @@ func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 }
 
 static ESExpResult *
-func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendLDAPSExpData *ldap_data = data;
 	ESExpResult *r;
 
 	if (argc == 1
 	    && argv[0]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
+		gchar *propname = argv[0]->value.string;
 
 		if (!strcmp (propname, "x-evolution-any-field")) {
-			int i;
-			int query_length;
-			char *big_query;
-			char *match_str;
+			gint i;
+			gint query_length;
+			gchar *big_query;
+			gchar *match_str;
 
 			match_str = g_strdup("=*)");
 
@@ -3784,7 +3784,7 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 			g_free (match_str);
 		}
 		else {
-			char *ldap_attr = query_prop_to_ldap(propname);
+			gchar *ldap_attr = query_prop_to_ldap(propname);
 
 			if (ldap_attr)
 				ldap_data->list = g_list_prepend(ldap_data->list,
@@ -3800,9 +3800,9 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 
 /* '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[] = {
 	{ "and", func_and, 0 },
@@ -3816,14 +3816,14 @@ static struct {
 };
 
 static gchar *
-e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const char *query)
+e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const gchar *query)
 {
 	ESExp *sexp;
 	ESExpResult *r;
 	gchar *retval;
 	EBookBackendLDAPSExpData data;
-	int i;
-	char **strings;
+	gint i;
+	gchar **strings;
 
 	data.list = NULL;
 	data.bl = bl;
@@ -3857,7 +3857,7 @@ e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const char *query)
 		else {
 			if (bl->priv->ldap_search_filter && *bl->priv->ldap_search_filter
 				&& g_ascii_strncasecmp(bl->priv->ldap_search_filter,"(objectClass=*)",sizeof(bl->priv->ldap_search_filter))){
-				strings = g_new0(char*, 5);
+				strings = g_new0(gchar *, 5);
 				strings[0] = g_strdup ("(&");
 				strings[1] = g_strdup_printf ("%s", bl->priv->ldap_search_filter);
 				strings[2] = data.list->data;
@@ -3884,7 +3884,7 @@ e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const char *query)
 static gchar *
 query_prop_to_ldap(gchar *query_prop)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < num_prop_infos; i ++)
 		if (!strcmp (query_prop, e_contact_field_name (prop_info[i].field_id)))
@@ -3909,8 +3909,8 @@ build_contact_from_entry (EBookBackendLDAP *bl,
 			  GList **existing_objectclasses)
 {
 	EContact *contact = e_contact_new ();
-	char *dn;
-	char *attr;
+	gchar *dn;
+	gchar *attr;
 	BerElement *ber = NULL;
 
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
@@ -3922,9 +3922,9 @@ build_contact_from_entry (EBookBackendLDAP *bl,
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 	for (attr = ldap_first_attribute (bl->priv->ldap, e, &ber); attr;
 	     attr = ldap_next_attribute (bl->priv->ldap, e, ber)) {
-		int i;
+		gint i;
 		struct prop_info *info = NULL;
-		char **values;
+		gchar **values;
 
 		g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
 
@@ -3991,11 +3991,11 @@ build_contact_from_entry (EBookBackendLDAP *bl,
 										    values);
 						}
 						else if (info->prop_type & PROP_TYPE_GROUP) {
-							char *grpattrs[3];
-							int j, view_limit = -1, ldap_error, count;
+							gchar *grpattrs[3];
+							gint j, view_limit = -1, ldap_error, count;
 							EDataBookView *book_view;
 							LDAPMessage *result;
-							char **email_values, **cn_values, **member_info;
+							gchar **email_values, **cn_values, **member_info;
 
 							grpattrs[0] = "cn";
 							grpattrs[1] = "mail";
@@ -4086,10 +4086,10 @@ build_contact_from_entry (EBookBackendLDAP *bl,
 static gboolean
 poll_ldap (EBookBackendLDAP *bl)
 {
-	int            rc;
+	gint            rc;
 	LDAPMessage    *res;
 	struct timeval timeout;
-	const char *ldap_timeout_string;
+	const gchar *ldap_timeout_string;
 
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 	if (!bl->priv->ldap) {
@@ -4128,7 +4128,7 @@ poll_ldap (EBookBackendLDAP *bl)
 #endif
 		}
 		else {
-			int msgid = ldap_msgid (res);
+			gint msgid = ldap_msgid (res);
 			LDAPOp *op;
 
 			g_static_rec_mutex_lock (&bl->priv->op_hash_mutex);
@@ -4159,7 +4159,7 @@ ldap_search_handler (LDAPOp *op, LDAPMessage *res)
 	EDataBookView *view = search_op->view;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	LDAPMessage *e;
-	int msg_type;
+	gint msg_type;
 	GTimeVal start, end;
 	unsigned long diff;
 
@@ -4201,8 +4201,8 @@ ldap_search_handler (LDAPOp *op, LDAPMessage *res)
 		}
 	}
 	else if (msg_type == LDAP_RES_SEARCH_RESULT) {
-		char *ldap_error_msg;
-		int ldap_error;
+		gchar *ldap_error_msg;
+		gint ldap_error;
 
 		g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 		ldap_parse_result (bl->priv->ldap, res, &ldap_error,
@@ -4264,7 +4264,7 @@ e_book_backend_ldap_search (EBookBackendLDAP *bl,
 			    EDataBook        *book,
 			    EDataBookView    *view)
 {
-	char *ldap_query;
+	gchar *ldap_query;
 	GList *contacts;
 	GList *l;
 	GTimeVal start, end;
@@ -4305,9 +4305,9 @@ e_book_backend_ldap_search (EBookBackendLDAP *bl,
 
 		g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 		if (ldap_query != NULL && bl->priv->ldap) {
-			int ldap_err;
-			int search_msgid;
-			int view_limit;
+			gint ldap_err;
+			gint search_msgid;
+			gint view_limit;
 
 			g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
 
@@ -4419,7 +4419,7 @@ static void
 e_book_backend_ldap_get_changes (EBookBackend *backend,
 				 EDataBook    *book,
 				 guint32       opid,
-				 const char   *change_id)
+				 const gchar   *change_id)
 {
 	/* FIXME: implement */
 }
@@ -4472,8 +4472,8 @@ generate_cache_handler (LDAPOp *op, LDAPMessage *res)
 		}
 	} else {
 		GList *l;
-		int contact_num = 0;
-		char *status_msg;
+		gint contact_num = 0;
+		gchar *status_msg;
 
 		e_file_cache_clean (E_FILE_CACHE (bl->priv->cache));
 
@@ -4585,14 +4585,14 @@ static void
 e_book_backend_ldap_authenticate_user (EBookBackend *backend,
 				       EDataBook    *book,
 				       guint32       opid,
-				       const char   *user,
-				       const char   *passwd,
-				       const char   *auth_method)
+				       const gchar   *user,
+				       const gchar   *passwd,
+				       const gchar   *auth_method)
 {
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
-	int ldap_error;
-	int status;
-	char *dn = NULL;
+	gint ldap_error;
+	gint status;
+	gchar *dn = NULL;
 
 	if (enable_debug)
 		printf ("e_book_backend_ldap_authenticate_user ... \n");
@@ -4610,7 +4610,7 @@ e_book_backend_ldap_authenticate_user (EBookBackend *backend,
 
 		if (!strcmp (auth_method, "ldap/simple-email")) {
 			LDAPMessage    *res, *e;
-			char *query = g_strdup_printf ("(mail=%s)", user);
+			gchar *query = g_strdup_printf ("(mail=%s)", user);
 
 			g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 			ldap_error = ldap_search_s (bl->priv->ldap,
@@ -4622,7 +4622,7 @@ e_book_backend_ldap_authenticate_user (EBookBackend *backend,
 			g_free (query);
 
 			if (ldap_error == LDAP_SUCCESS) {
-				char *entry_dn;
+				gchar *entry_dn;
 
 				g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 				e = ldap_first_entry (bl->priv->ldap, res);
@@ -4775,9 +4775,9 @@ e_book_backend_ldap_get_required_fields (EBookBackend *backend,
 
 	/*FIMEME we should look at mandatory attributs in the schema
 	  and return all those fields here */
-	fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FILE_AS));
-	fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FULL_NAME));
-	fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FAMILY_NAME));
+	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FILE_AS));
+	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FULL_NAME));
+	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FAMILY_NAME));
 
 
 	e_data_book_respond_get_required_fields (book,
@@ -4817,7 +4817,7 @@ e_book_backend_ldap_get_supported_auth_methods (EBookBackend *backend,
 }
 
 static void
-ldap_cancel_op(void *key, void *value, void *data)
+ldap_cancel_op(gpointer key, gpointer value, gpointer data)
 {
 	EBookBackendLDAP *bl = data;
 	LDAPOp *op = value;
@@ -4848,12 +4848,12 @@ e_book_backend_ldap_load_source (EBookBackend             *backend,
 {
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
 	LDAPURLDesc    *lud;
-	int ldap_error;
-	int limit = 100;
-	int timeout = 60; /* 1 minute */
+	gint ldap_error;
+	gint limit = 100;
+	gint timeout = 60; /* 1 minute */
 	gchar *uri;
-	const char *str;
-	const char *offline;
+	const gchar *str;
+	const gchar *offline;
 	gint result;
 
 	g_assert (bl->priv->connected == FALSE);
@@ -4886,7 +4886,7 @@ e_book_backend_ldap_load_source (EBookBackend             *backend,
 	if (str)
 		timeout = atoi (str);
 
-	ldap_error = ldap_url_parse ((char*) uri, &lud);
+	ldap_error = ldap_url_parse ((gchar *) uri, &lud);
 
 	if (ldap_error == LDAP_SUCCESS) {
 		bl->priv->ldap_host = g_strdup(lud->lud_host);
@@ -4975,7 +4975,7 @@ e_book_backend_ldap_remove (EBookBackend *backend, EDataBook *book, guint32 opid
 	e_data_book_respond_remove (book, opid, GNOME_Evolution_Addressbook_Success);
 }
 
-static char*
+static gchar *
 e_book_backend_ldap_get_static_capabilities (EBookBackend *backend)
 {
 	if (can_browse (backend))
@@ -5025,7 +5025,7 @@ start_views (EBookBackend *backend)
 #endif
 
 static void
-e_book_backend_ldap_set_mode (EBookBackend *backend, int mode)
+e_book_backend_ldap_set_mode (EBookBackend *backend, gint mode)
 {
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
 
@@ -5115,7 +5115,7 @@ e_book_backend_ldap_new (void)
 }
 
 static gboolean
-call_dtor (int msgid, LDAPOp *op, gpointer data)
+call_dtor (gint msgid, LDAPOp *op, gpointer data)
 {
 	EBookBackendLDAP *bl;
 
diff --git a/addressbook/backends/ldap/openldap-extract.h b/addressbook/backends/ldap/openldap-extract.h
index 6b4ac39..7888a24 100644
--- a/addressbook/backends/ldap/openldap-extract.h
+++ b/addressbook/backends/ldap/openldap-extract.h
@@ -38,7 +38,7 @@
 #define LBER_CALLOC(n,s)        calloc((n),(s))
 #define LBER_REALLOC(p,s)       realloc((p),(s))
 /*   vfree is defined in openldap-extract.h */
-#define LBER_VFREE(v)           vfree((void**)(v))
+#define LBER_VFREE(v)           vfree((gpointer *)(v))
 #define LBER_FREE(p)            free((p))
 #define LDAP_OPT_SSL 10
 #endif
@@ -61,7 +61,7 @@
 #define LDAP_CALLOC(n,s) calloc((n),(s))
 #define LDAP_REALLOC(p,s) realloc((p),(s))
 #define LDAP_FREE(p) free((p))
-#define LDAP_VFREE(p) vfree((void **)(p))
+#define LDAP_VFREE(p) vfree((gpointer *)(p))
 #define LDAP_STRDUP(s) strdup((s))
 
 #define LDAP_RANGE(n,x,y)	(((x) <= (n)) && ((n) <= (y)))
@@ -102,21 +102,21 @@
 #define	LDAP_SCHEMA_SKIP			0x80U /* Don't malloc any result      */
 
 typedef struct ldap_objectclass {
-	char *oc_oid;		/* REQUIRED */
-	char **oc_names;	/* OPTIONAL */
-	char *oc_desc;		/* OPTIONAL */
-	int  oc_obsolete;	/* 0=no, 1=yes */
-	char **oc_sup_oids;	/* OPTIONAL */
-	int  oc_kind;		/* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */
-	char **oc_at_oids_must;	/* OPTIONAL */
-	char **oc_at_oids_may;	/* OPTIONAL */
+	gchar *oc_oid;		/* REQUIRED */
+	gchar **oc_names;	/* OPTIONAL */
+	gchar *oc_desc;		/* OPTIONAL */
+	gint  oc_obsolete;	/* 0=no, 1=yes */
+	gchar **oc_sup_oids;	/* OPTIONAL */
+	gint  oc_kind;		/* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */
+	gchar **oc_at_oids_must;	/* OPTIONAL */
+	gchar **oc_at_oids_may;	/* OPTIONAL */
 } LDAPObjectClass;
 
 
 static void
-vfree(void **vec)
+vfree(gpointer *vec)
 {
-  int i;
+  gint i;
 
   for (i = 0; vec[i] != NULL; i++)
     free(vec[i]);
@@ -158,17 +158,17 @@ vfree(void **vec)
 #define TK_QDESCR	TK_QDSTRING
 
 struct token {
-	int type;
-	char *sval;
+	gint type;
+	gchar *sval;
 };
 
 static int
-get_token( const char ** sp, char ** token_val )
+get_token( const gchar ** sp, gchar ** token_val )
 {
-	int kind;
-	const char * p;
-	const char * q;
-	char * res;
+	gint kind;
+	const gchar * p;
+	const gchar * q;
+	gchar * res;
 
 	*token_val = NULL;
 	switch (**sp) {
@@ -238,20 +238,20 @@ get_token( const char ** sp, char ** token_val )
 
 /* Gobble optional whitespace */
 static void
-parse_whsp(const char **sp)
+parse_whsp(const gchar **sp)
 {
 	while (LDAP_SPACE(**sp))
 		(*sp)++;
 }
 
 /* Parse a sequence of dot-separated decimal strings */
-static char *
-ldap_int_parse_numericoid(const char **sp, int *code, const int flags)
+static gchar *
+ldap_int_parse_numericoid(const gchar **sp, gint *code, const gint flags)
 {
-	char * res = NULL;
-	const char * start = *sp;
-	int len;
-	int quoted = 0;
+	gchar * res = NULL;
+	const gchar * start = *sp;
+	gint len;
+	gint quoted = 0;
 
 	/* Netscape puts the SYNTAX value in quotes (incorrectly) */
 	if ( flags & LDAP_SCHEMA_ALLOW_QUOTED && **sp == '\'' ) {
@@ -263,7 +263,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags)
 	while (**sp) {
 		if ( !LDAP_DIGIT(**sp) ) {
 			/*
-			 * Initial char is not a digit or char after dot is
+			 * Initial gchar is not a digit or gchar after dot is
 			 * not a digit
 			 */
 			*code = LDAP_SCHERR_NODIGIT;
@@ -277,7 +277,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags)
 		/* Otherwise, gobble the dot and loop again */
 		(*sp)++;
 	}
-	/* Now *sp points at the char past the numericoid. Perfect. */
+	/* Now *sp points at the gchar past the numericoid. Perfect. */
 	len = *sp - start;
 	if ( flags & LDAP_SCHEMA_ALLOW_QUOTED && quoted ) {
 		if ( **sp == '\'' ) {
@@ -288,7 +288,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags)
 		}
 	}
 	if (flags & LDAP_SCHEMA_SKIP) {
-		res = (char *)start;
+		res = (gchar *)start;
 	} else {
 		res = LDAP_MALLOC(len+1);
 		if (!res) {
@@ -302,22 +302,22 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags)
 }
 
 /* Parse a qdescr or a list of them enclosed in () */
-static char **
-parse_qdescrs(const char **sp, int *code)
+static gchar **
+parse_qdescrs(const gchar **sp, gint *code)
 {
-	char ** res;
-	char ** res1;
-	int kind;
-	char * sval;
-	int size;
-	int pos;
+	gchar ** res;
+	gchar ** res1;
+	gint kind;
+	gchar * sval;
+	gint size;
+	gint pos;
 
 	parse_whsp(sp);
 	kind = get_token(sp,&sval);
 	if ( kind == TK_LEFTPAREN ) {
 		/* Let's presume there will be at least 2 entries */
 		size = 3;
-		res = LDAP_CALLOC(3,sizeof(char *));
+		res = LDAP_CALLOC(3,sizeof(gchar *));
 		if ( !res ) {
 			*code = LDAP_SCHERR_OUTOFMEM;
 			return NULL;
@@ -331,7 +331,7 @@ parse_qdescrs(const char **sp, int *code)
 			if ( kind == TK_QDESCR ) {
 				if ( pos == size-2 ) {
 					size++;
-					res1 = LDAP_REALLOC(res,size*sizeof(char *));
+					res1 = LDAP_REALLOC(res,size*sizeof(gchar *));
 					if ( !res1 ) {
 						LDAP_VFREE(res);
 						LDAP_FREE(sval);
@@ -353,7 +353,7 @@ parse_qdescrs(const char **sp, int *code)
 		parse_whsp(sp);
 		return(res);
 	} else if ( kind == TK_QDESCR ) {
-		res = LDAP_CALLOC(2,sizeof(char *));
+		res = LDAP_CALLOC(2,sizeof(gchar *));
 		if ( !res ) {
 			*code = LDAP_SCHERR_OUTOFMEM;
 			return NULL;
@@ -370,15 +370,15 @@ parse_qdescrs(const char **sp, int *code)
 }
 
 /* Parse a woid or a $-separated list of them enclosed in () */
-static char **
-parse_oids(const char **sp, int *code, const int allow_quoted)
+static gchar **
+parse_oids(const gchar **sp, gint *code, const gint allow_quoted)
 {
-	char ** res;
-	char ** res1;
-	int kind;
-	char * sval;
-	int size;
-	int pos;
+	gchar ** res;
+	gchar ** res1;
+	gint kind;
+	gchar * sval;
+	gint size;
+	gint pos;
 
 	/*
 	 * Strictly speaking, doing this here accepts whsp before the
@@ -391,7 +391,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted)
 	if ( kind == TK_LEFTPAREN ) {
 		/* Let's presume there will be at least 2 entries */
 		size = 3;
-		res = LDAP_CALLOC(3,sizeof(char *));
+		res = LDAP_CALLOC(3,sizeof(gchar *));
 		if ( !res ) {
 			*code = LDAP_SCHERR_OUTOFMEM;
 			return NULL;
@@ -422,7 +422,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted)
 				       kind == TK_QDSTRING ) ) {
 					if ( pos == size-2 ) {
 						size++;
-						res1 = LDAP_REALLOC(res,size*sizeof(char *));
+						res1 = LDAP_REALLOC(res,size*sizeof(gchar *));
 						if ( !res1 ) {
 							LDAP_FREE(sval);
 							LDAP_VFREE(res);
@@ -451,7 +451,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted)
 		return(res);
 	} else if ( kind == TK_BAREWORD ||
 		    ( allow_quoted && kind == TK_QDSTRING ) ) {
-		res = LDAP_CALLOC(2,sizeof(char *));
+		res = LDAP_CALLOC(2,sizeof(gchar *));
 		if ( !res ) {
 			LDAP_FREE(sval);
 			*code = LDAP_SCHERR_OUTOFMEM;
@@ -481,24 +481,24 @@ ldap_objectclass_free(LDAPObjectClass * oc)
 }
 
 static LDAPObjectClass *
-ldap_str2objectclass( LDAP_CONST char * s,
-	int * code,
-	LDAP_CONST char ** errp,
+ldap_str2objectclass( LDAP_CONST gchar * s,
+	gint * code,
+	LDAP_CONST gchar ** errp,
 	LDAP_CONST unsigned flags )
 {
-	int kind;
-	const char * ss = s;
-	char * sval;
-	int seen_name = 0;
-	int seen_desc = 0;
-	int seen_obsolete = 0;
-	int seen_sup = 0;
-	int seen_kind = 0;
-	int seen_must = 0;
-	int seen_may = 0;
+	gint kind;
+	const gchar * ss = s;
+	gchar * sval;
+	gint seen_name = 0;
+	gint seen_desc = 0;
+	gint seen_obsolete = 0;
+	gint seen_sup = 0;
+	gint seen_kind = 0;
+	gint seen_must = 0;
+	gint seen_may = 0;
 	LDAPObjectClass * oc;
-	char ** ext_vals;
-	const char * savepos;
+	gchar ** ext_vals;
+	const gchar * savepos;
 
 	if ( !s ) {
 		*code = LDAP_SCHERR_EMPTY;
@@ -554,7 +554,7 @@ ldap_str2objectclass( LDAP_CONST char * s,
 				} else if ( flags &
 					LDAP_SCHEMA_ALLOW_OID_MACRO ) {
 					/* Non-numerical OID, ignore */
-					int len = ss-savepos;
+					gint len = ss-savepos;
 					oc->oc_oid = LDAP_MALLOC(len+1);
 					strncpy(oc->oc_oid, savepos, len);
 					oc->oc_oid[len] = 0;
@@ -757,21 +757,21 @@ ldap_str2objectclass( LDAP_CONST char * s,
 #define LDAP_UTF8_INCR(p) ((p)=LDAP_UTF8_NEXT((p)))
 #define ldap_x_utf8_to_ucs4(str) g_utf8_get_char(str)
 
-static char *ldap_utf8_strchr( const char *str, const char *chr )
+static gchar *ldap_utf8_strchr( const gchar *str, const gchar *chr )
 {
 	for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) {
 		if( ldap_x_utf8_to_ucs4( str ) == ldap_x_utf8_to_ucs4( chr ) ) {
-			return (char *) str;
+			return (gchar *) str;
 		}
 	}
 
 	return NULL;
 }
 
-static size_t ldap_utf8_strcspn( const char *str, const char *set )
+static size_t ldap_utf8_strcspn( const gchar *str, const gchar *set )
 {
-	const char *cstr;
-	const char *cset;
+	const gchar *cstr;
+	const gchar *cset;
 
 	for( cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr) ) {
 		for( cset = set; *cset != '\0'; LDAP_UTF8_INCR(cset) ) {
@@ -784,10 +784,10 @@ static size_t ldap_utf8_strcspn( const char *str, const char *set )
 	return cstr - str;
 }
 
-static size_t ldap_utf8_strspn( const char *str, const char *set )
+static size_t ldap_utf8_strspn( const gchar *str, const gchar *set )
 {
-	const char *cstr;
-	const char *cset;
+	const gchar *cstr;
+	const gchar *cset;
 
 	for( cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr) ) {
 		for( cset = set; ; LDAP_UTF8_INCR(cset) ) {
@@ -804,10 +804,10 @@ static size_t ldap_utf8_strspn( const char *str, const char *set )
 	return cstr - str;
 }
 
-static char *ldap_utf8_strtok(char *str, const char *sep, char **last)
+static gchar *ldap_utf8_strtok(gchar *str, const gchar *sep, gchar **last)
 {
-	char *begin;
-	char *end;
+	gchar *begin;
+	gchar *end;
 
 	if( last == NULL ) return NULL;
 
@@ -823,7 +823,7 @@ static char *ldap_utf8_strtok(char *str, const char *sep, char **last)
 	end = &begin[ ldap_utf8_strcspn( begin, sep ) ];
 
 	if( *end != '\0' ) {
-		char *next = LDAP_UTF8_NEXT( end );
+		gchar *next = LDAP_UTF8_NEXT( end );
 		*end = '\0';
 		end = next;
 	}
@@ -872,17 +872,17 @@ typedef struct ldap_url_desc {
 
 /* from url.c */
 
-static const char*
+static const gchar *
 skip_url_prefix(
-	const char *url,
-	int *enclosedp,
-	const char **scheme )
+	const gchar *url,
+	gint *enclosedp,
+	const gchar **scheme )
 {
 	/*
 	 * return non-zero if this looks like a LDAP URL; zero if not
 	 * if non-zero returned, *urlp will be moved past "ldap://"; part of URL
 	 */
-	const char *p;
+	const gchar *p;
 
 	if ( url == NULL ) {
 		return( NULL );
@@ -940,7 +940,7 @@ skip_url_prefix(
 	return( NULL );
 }
 
-static int str2scope( const char *p )
+static gint str2scope( const gchar *p )
 {
 	if ( strcasecmp( p, "one" ) == 0 ) {
 		return LDAP_SCOPE_ONELEVEL;
@@ -996,7 +996,7 @@ ldap_free_urldesc( LDAPURLDesc *ludp )
 }
 
 static int
-ldap_int_unhex( int c )
+ldap_int_unhex( gint c )
 {
 	return( c >= '0' && c <= '9' ? c - '0'
 	    : c >= 'A' && c <= 'F' ? c - 'A' + 10
@@ -1004,7 +1004,7 @@ ldap_int_unhex( int c )
 }
 
 static void
-ldap_pvt_hex_unescape( char *s )
+ldap_pvt_hex_unescape( gchar *s )
 {
 	/*
 	 * Remove URL hex escapes from s... done in place.  The basic concept for
@@ -1030,8 +1030,8 @@ ldap_pvt_hex_unescape( char *s )
 	*p = '\0';
 }
 
-static char **
-ldap_str2charray( const char *str_in, const char *brkstr )
+static gchar **
+ldap_str2charray( const gchar *str_in, const gchar *brkstr )
 {
 	char	**res;
 	char	*str, *s;
@@ -1051,7 +1051,7 @@ ldap_str2charray( const char *str_in, const char *brkstr )
 		}
 	}
 
-	res = (char **) LDAP_MALLOC( (i + 1) * sizeof(char *) );
+	res = (gchar **) LDAP_MALLOC( (i + 1) * sizeof(gchar *) );
 
 	if( res == NULL ) {
 		LDAP_FREE( str );
@@ -1085,7 +1085,7 @@ ldap_str2charray( const char *str_in, const char *brkstr )
 }
 
 static int
-ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
+ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
 {
 /*
  *  Pick apart the pieces of an LDAP URL.
@@ -1094,9 +1094,9 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
 	LDAPURLDesc	*ludp;
 	char	*p, *q, *r;
 	int		i, enclosed;
-	const char *scheme = NULL;
-	const char *url_tmp;
-	char *url;
+	const gchar *scheme = NULL;
+	const gchar *url_tmp;
+	gchar *url;
 
 	if( url_in == NULL || ludpp == NULL ) {
 		return LDAP_URL_ERR_PARAM;
@@ -1409,9 +1409,9 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
 }
 
 static int
-ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
+ldap_url_parse( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
 {
-	int rc = ldap_url_parse_ext( url_in, ludpp );
+	gint rc = ldap_url_parse_ext( url_in, ludpp );
 
 	if( rc != LDAP_URL_SUCCESS ) {
 		return rc;
diff --git a/addressbook/backends/vcf/e-book-backend-vcf-factory.c b/addressbook/backends/vcf/e-book-backend-vcf-factory.c
index 1975208..cc3e716 100644
--- a/addressbook/backends/vcf/e-book-backend-vcf-factory.c
+++ b/addressbook/backends/vcf/e-book-backend-vcf-factory.c
@@ -45,7 +45,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = & vcf_type;
 	*num_types = 1;
diff --git a/addressbook/backends/vcf/e-book-backend-vcf.c b/addressbook/backends/vcf/e-book-backend-vcf.c
index f0208ef..0b72997 100644
--- a/addressbook/backends/vcf/e-book-backend-vcf.c
+++ b/addressbook/backends/vcf/e-book-backend-vcf.c
@@ -62,15 +62,15 @@ typedef struct _EBookBackendVCFBookView EBookBackendVCFBookView;
 typedef struct _EBookBackendVCFSearchContext EBookBackendVCFSearchContext;
 
 struct _EBookBackendVCFPrivate {
-	char       *filename;
+	gchar       *filename;
 	GMutex     *mutex;
 	GHashTable *contacts;
 	GList      *contact_list;
 	gboolean    dirty;
-	int         flush_timeout_tag;
+	gint         flush_timeout_tag;
 };
 
-static char *
+static gchar *
 e_book_backend_vcf_create_unique_id (void)
 {
 	/* use a 32 counter and the 32 bit timestamp to make an id.
@@ -81,14 +81,14 @@ e_book_backend_vcf_create_unique_id (void)
 }
 
 static void
-insert_contact (EBookBackendVCF *vcf, char *vcard)
+insert_contact (EBookBackendVCF *vcf, gchar *vcard)
 {
 	EContact *contact = e_contact_new_from_vcard (vcard);
-	char *id;
+	gchar *id;
 
 	id = e_contact_get (contact, E_CONTACT_UID);
 	if (id) {
-		char *vcard = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
+		gchar *vcard = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
 
 		vcf->priv->contact_list = g_list_prepend (vcf->priv->contact_list, vcard);
 
@@ -99,11 +99,11 @@ insert_contact (EBookBackendVCF *vcf, char *vcard)
 }
 
 static void
-load_file (EBookBackendVCF *vcf, int fd)
+load_file (EBookBackendVCF *vcf, gint fd)
 {
 	FILE *fp;
 	GString *str;
-	char buf[1024];
+	gchar buf[1024];
 
 	fp = fdopen (fd, "rb");
 	if (!fp) {
@@ -140,8 +140,8 @@ save_file (EBookBackendVCF *vcf)
 {
 	gboolean retv = FALSE;
 	GList *l;
-	char *new_path;
-	int fd, rv;
+	gchar *new_path;
+	gint fd, rv;
 
 	g_warning ("EBookBackendVCF flushing file to disk");
 
@@ -156,8 +156,8 @@ save_file (EBookBackendVCF *vcf)
 	}
 
 	for (l = vcf->priv->contact_list; l; l = l->next) {
-		char *vcard_str = l->data;
-		int len = strlen (vcard_str);
+		gchar *vcard_str = l->data;
+		gint len = strlen (vcard_str);
 
 		rv = write (fd, vcard_str, len);
 
@@ -216,7 +216,7 @@ vcf_flush_file (gpointer data)
 static void
 set_revision (EContact *contact)
 {
-	char time_string[100] = {0};
+	gchar time_string[100] = {0};
 	const struct tm *tm = NULL;
 	time_t t;
 
@@ -229,13 +229,13 @@ set_revision (EContact *contact)
 
 static EContact *
 do_create(EBookBackendVCF  *bvcf,
-	  const char     *vcard_req,
+	  const gchar     *vcard_req,
 	  gboolean        dirty_the_file)
 {
-	char           *id;
+	gchar           *id;
 	EContact       *contact;
-	char           *vcard;
-	const char     *rev;
+	gchar           *vcard;
+	const gchar     *rev;
 
 	/* at the very least we need the unique_id generation to be
 	   protected by the lock, even if the actual vcard parsing
@@ -272,7 +272,7 @@ static EBookBackendSyncStatus
 e_book_backend_vcf_create_contact (EBookBackendSync *backend,
 				   EDataBook *book,
 				   guint32 opid,
-				   const char *vcard,
+				   const gchar *vcard,
 				   EContact **contact)
 {
 	EBookBackendVCF *bvcf = E_BOOK_BACKEND_VCF (backend);
@@ -297,7 +297,7 @@ e_book_backend_vcf_remove_contacts (EBookBackendSync *backend,
 {
 	/* FIXME: make this handle bulk deletes like the file backend does */
 	EBookBackendVCF *bvcf = E_BOOK_BACKEND_VCF (backend);
-	char *id = id_list->data;
+	gchar *id = id_list->data;
 	GList *elem;
 
 	g_mutex_lock (bvcf->priv->mutex);
@@ -330,12 +330,12 @@ static EBookBackendSyncStatus
 e_book_backend_vcf_modify_contact (EBookBackendSync *backend,
 				   EDataBook *book,
 				   guint32 opid,
-				   const char *vcard,
+				   const gchar *vcard,
 				   EContact **contact)
 {
 	EBookBackendVCF *bvcf = E_BOOK_BACKEND_VCF (backend);
 	GList *elem;
-	const char *id;
+	const gchar *id;
 
 	/* create a new ecard from the request data */
 	*contact = e_contact_new_from_vcard (vcard);
@@ -363,8 +363,8 @@ static EBookBackendSyncStatus
 e_book_backend_vcf_get_contact (EBookBackendSync *backend,
 				EDataBook *book,
 				guint32 opid,
-				const char *id,
-				char **vcard)
+				const gchar *id,
+				gchar **vcard)
 {
 	EBookBackendVCF *bvcf = E_BOOK_BACKEND_VCF (backend);
 	GList *elem;
@@ -389,7 +389,7 @@ typedef struct {
 } GetContactListClosure;
 
 static void
-foreach_get_contact_compare (char *vcard_string, GetContactListClosure *closure)
+foreach_get_contact_compare (gchar *vcard_string, GetContactListClosure *closure)
 {
 	if ((!closure->search_needed) || e_book_backend_sexp_match_vcard  (closure->card_sexp, vcard_string)) {
 		closure->list = g_list_append (closure->list, g_strdup (vcard_string));
@@ -400,11 +400,11 @@ static EBookBackendSyncStatus
 e_book_backend_vcf_get_contact_list (EBookBackendSync *backend,
 				     EDataBook *book,
 				     guint32 opid,
-				     const char *query,
+				     const gchar *query,
 				     GList **contacts)
 {
 	EBookBackendVCF *bvcf = E_BOOK_BACKEND_VCF (backend);
-	const char *search = query;
+	const gchar *search = query;
 	GetContactListClosure closure;
 
 	closure.bvcf = bvcf;
@@ -462,7 +462,7 @@ book_view_thread (gpointer data)
 {
 	EDataBookView *book_view = data;
 	VCFBackendSearchClosure *closure = get_closure (book_view);
-	const char *query;
+	const gchar *query;
 	GList *l;
 
 	/* ref the book view because it'll be removed and unrefed
@@ -480,7 +480,7 @@ book_view_thread (gpointer data)
 	e_flag_set (closure->running);
 
 	for (l = closure->bvcf->priv->contact_list; l; l = l->next) {
-		char *vcard_string = l->data;
+		gchar *vcard_string = l->data;
 		EContact *contact = e_contact_new_from_vcard (vcard_string);
 		e_data_book_view_notify_update (closure->view, contact);
 		g_object_unref (contact);
@@ -532,8 +532,8 @@ e_book_backend_vcf_stop_book_view (EBookBackend  *backend,
 		g_thread_join (closure->thread);
 }
 
-static char *
-e_book_backend_vcf_extract_path_from_uri (const char *uri)
+static gchar *
+e_book_backend_vcf_extract_path_from_uri (const gchar *uri)
 {
 	g_assert (g_ascii_strncasecmp (uri, "vcf://", 6) == 0);
 
@@ -544,9 +544,9 @@ static EBookBackendSyncStatus
 e_book_backend_vcf_authenticate_user (EBookBackendSync *backend,
 				      EDataBook *book,
 				      guint32 opid,
-				      const char *user,
-				      const char *passwd,
-				      const char *auth_method)
+				      const gchar *user,
+				      const gchar *passwd,
+				      const gchar *auth_method)
 {
 	return GNOME_Evolution_Addressbook_Success;
 }
@@ -571,12 +571,12 @@ e_book_backend_vcf_get_supported_fields (EBookBackendSync *backend,
 					 GList **fields_out)
 {
 	GList *fields = NULL;
-	int i;
+	gint i;
 
 	/* XXX we need a way to say "we support everything", since the
 	   vcf backend does */
 	for (i = 0; i < E_CONTACT_FIELD_LAST; i ++)
-		fields = g_list_append (fields, (char*)e_contact_field_name (i));
+		fields = g_list_append (fields, (gchar *)e_contact_field_name (i));
 
 	*fields_out = fields;
 	return GNOME_Evolution_Addressbook_Success;
@@ -592,10 +592,10 @@ e_book_backend_vcf_load_source (EBookBackend             *backend,
 				gboolean                  only_if_exists)
 {
 	EBookBackendVCF *bvcf = E_BOOK_BACKEND_VCF (backend);
-	char           *dirname;
+	gchar           *dirname;
 	gboolean        writable = FALSE;
 	gchar          *uri;
-	int fd;
+	gint fd;
 
 	uri = e_source_get_uri (source);
 
@@ -615,7 +615,7 @@ e_book_backend_vcf_load_source (EBookBackend             *backend,
 		fd = g_open (bvcf->priv->filename, O_RDONLY | O_BINARY, 0);
 
 		if (fd == -1 && !only_if_exists) {
-			int rv;
+			gint rv;
 
 			/* the database didn't exist, so we create the
 			   directory then the .vcf file */
@@ -662,7 +662,7 @@ e_book_backend_vcf_load_source (EBookBackend             *backend,
 	return GNOME_Evolution_Addressbook_Success;
 }
 
-static char *
+static gchar *
 e_book_backend_vcf_get_static_capabilities (EBookBackend *backend)
 {
 	return g_strdup("local,do-initial-query,contact-lists");
@@ -675,7 +675,7 @@ e_book_backend_vcf_cancel_operation (EBookBackend *backend, EDataBook *book)
 }
 
 static void
-e_book_backend_vcf_set_mode (EBookBackend *backend, int mode)
+e_book_backend_vcf_set_mode (EBookBackend *backend, gint mode)
 {
 	if (e_book_backend_is_loaded (backend)) {
 		e_book_backend_notify_writable (backend, TRUE);
diff --git a/addressbook/backends/webdav/e-book-backend-webdav-factory.c b/addressbook/backends/webdav/e-book-backend-webdav-factory.c
index b26b0c3..49dcb2b 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav-factory.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav-factory.c
@@ -37,7 +37,7 @@ void eds_module_shutdown(void)
 {
 }
 
-void eds_module_list_types(const GType **types, int *num_types)
+void eds_module_list_types(const GType **types, gint *num_types)
 {
 	*types     = &webdav_type;
 	*num_types = 1;
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c b/addressbook/backends/webdav/e-book-backend-webdav.c
index b636b7f..7c087c9 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -58,13 +58,13 @@
 static EBookBackendClass *parent_class;
 
 struct _EBookBackendWebdavPrivate {
-	int                mode;
+	gint                mode;
 	gboolean           marked_for_offline;
 	SoupSession       *session;
 	EProxy		  *proxy;
 	gchar             *uri;
-	char              *username;
-	char              *password;
+	gchar              *username;
+	gchar              *password;
 
 	EBookBackendCache *cache;
 };
@@ -107,8 +107,8 @@ static EContact*
 download_contact(EBookBackendWebdav *webdav, const gchar *uri)
 {
 	SoupMessage *message;
-	const char  *content_type;
-	const char  *etag;
+	const gchar  *content_type;
+	const gchar  *etag;
 	EContact    *contact;
 	guint        status;
 
@@ -150,9 +150,9 @@ download_contact(EBookBackendWebdav *webdav, const gchar *uri)
 
 	/* we use our URI as UID
 	 * the etag is rememebered in the revision field */
-	e_contact_set(contact, E_CONTACT_UID, (const gpointer) uri);
+	e_contact_set(contact, E_CONTACT_UID, (gconstpointer) uri);
 	if (etag != NULL) {
-		e_contact_set(contact, E_CONTACT_REV, (const gpointer) etag);
+		e_contact_set(contact, E_CONTACT_REV, (gconstpointer) etag);
 	}
 
 	g_object_unref(message);
@@ -166,10 +166,10 @@ upload_contact(EBookBackendWebdav *webdav, EContact *contact)
 	SoupMessage *message;
 	gchar       *uri;
 	gchar       *etag;
-	const char  *new_etag;
-	char        *request;
+	const gchar  *new_etag;
+	gchar        *request;
 	guint        status;
-	const char  *property;
+	const gchar  *property;
 	gboolean     avoid_ifmatch;
 
 	uri = e_contact_get(contact, E_CONTACT_UID);
@@ -218,7 +218,7 @@ upload_contact(EBookBackendWebdav *webdav, EContact *contact)
 	new_etag = soup_message_headers_get(message->response_headers, "ETag");
 
 	/* set UID and REV fields */
-	e_contact_set(contact, E_CONTACT_REV, (const gpointer) new_etag);
+	e_contact_set(contact, E_CONTACT_REV, (gconstpointer) new_etag);
 	e_contact_set(contact, E_CONTACT_UID, uri);
 
 	g_object_unref(message);
@@ -247,7 +247,7 @@ e_book_backend_handle_auth_request(EBookBackendWebdav *webdav)
 
 static void
 e_book_backend_webdav_create_contact(EBookBackend *backend,
-		EDataBook *book, guint32 opid, const char *vcard)
+		EDataBook *book, guint32 opid, const gchar *vcard)
 {
 	EBookBackendWebdav        *webdav = E_BOOK_BACKEND_WEBDAV (backend);
 	EBookBackendWebdavPrivate *priv   = webdav->priv;
@@ -315,7 +315,7 @@ e_book_backend_webdav_create_contact(EBookBackend *backend,
 }
 
 static guint
-delete_contact(EBookBackendWebdav *webdav, const char *uri)
+delete_contact(EBookBackendWebdav *webdav, const gchar *uri)
 {
 	SoupMessage *message;
 	guint        status;
@@ -346,7 +346,7 @@ e_book_backend_webdav_remove_contacts(EBookBackend *backend,
 	}
 
 	for (list = id_list; list != NULL; list = list->next) {
-		const char *uid = (const char*) list->data;
+		const gchar *uid = (const gchar *) list->data;
 		guint       status;
 
 		status = delete_contact(webdav, uid);
@@ -371,13 +371,13 @@ e_book_backend_webdav_remove_contacts(EBookBackend *backend,
 
 static void
 e_book_backend_webdav_modify_contact(EBookBackend *backend,
-		EDataBook *book, guint32 opid, const char *vcard)
+		EDataBook *book, guint32 opid, const gchar *vcard)
 {
 	EBookBackendWebdav        *webdav  = E_BOOK_BACKEND_WEBDAV(backend);
 	EBookBackendWebdavPrivate *priv    = webdav->priv;
 	EContact                  *contact = e_contact_new_from_vcard(vcard);
-	const char                *uid;
-	const char                *etag;
+	const gchar                *uid;
+	const gchar                *etag;
 	guint status;
 
 	if (priv->mode == GNOME_Evolution_Addressbook_MODE_LOCAL) {
@@ -437,12 +437,12 @@ e_book_backend_webdav_modify_contact(EBookBackend *backend,
 
 static void
 e_book_backend_webdav_get_contact(EBookBackend *backend, EDataBook *book,
-		guint32 opid, const char *uid)
+		guint32 opid, const gchar *uid)
 {
 	EBookBackendWebdav        *webdav = E_BOOK_BACKEND_WEBDAV(backend);
 	EBookBackendWebdavPrivate *priv   = webdav->priv;
 	EContact                  *contact;
-	char                      *vcard;
+	gchar                      *vcard;
 
 	if (priv->mode == GNOME_Evolution_Addressbook_MODE_LOCAL) {
 		contact = e_book_backend_cache_get_contact(priv->cache, uid);
@@ -490,7 +490,7 @@ parse_response_tag(const parser_strings_t *strings, xmlTextReaderPtr reader)
 {
 	xmlChar            *href  = NULL;
 	xmlChar            *etag  = NULL;
-	int                 depth = xmlTextReaderDepth(reader);
+	gint                 depth = xmlTextReaderDepth(reader);
 	response_element_t *element;
 
 	while (xmlTextReaderRead(reader) && xmlTextReaderDepth(reader) > depth) {
@@ -510,10 +510,10 @@ parse_response_tag(const parser_strings_t *strings, xmlTextReaderPtr reader)
 			href = xmlTextReaderReadString(reader);
 		} else if (tag_name == strings->propstat) {
 			/* find <propstat><prop><getetag> hierarchy */
-			int depth2 = xmlTextReaderDepth(reader);
+			gint depth2 = xmlTextReaderDepth(reader);
 			while (xmlTextReaderRead(reader)
 					&& xmlTextReaderDepth(reader) > depth2) {
-				int depth3;
+				gint depth3;
 				if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT)
 					continue;
 
@@ -619,7 +619,7 @@ send_propfind(EBookBackendWebdav *webdav)
 				    "User-Agent", USERAGENT);
 	soup_message_headers_append(message->request_headers, "Depth", "1");
 	soup_message_set_request(message, "text/xml", SOUP_MEMORY_TEMPORARY,
-			(gchar*) request, strlen(request));
+			(gchar *) request, strlen(request));
 
 	soup_session_send_message(priv->session, message);
 
@@ -637,8 +637,8 @@ download_contacts(EBookBackendWebdav *webdav, EFlag *running,
 	response_element_t        *elements;
 	response_element_t        *element;
 	response_element_t        *next;
-	int                        count;
-	int                        i;
+	gint                        count;
+	gint                        i;
 
 	if (book_view != NULL) {
 		e_data_book_view_notify_status_message(book_view,
@@ -684,7 +684,7 @@ download_contacts(EBookBackendWebdav *webdav, EFlag *running,
 	/* download contacts */
 	i = 0;
 	for (element = elements; element != NULL; element = element->next, ++i) {
-		const char  *uri;
+		const gchar  *uri;
 		const gchar *etag;
 		EContact    *contact;
 		gchar *complete_uri;
@@ -695,13 +695,13 @@ download_contacts(EBookBackendWebdav *webdav, EFlag *running,
 
 		if (book_view != NULL) {
 			float percent = 100.0 / count * i;
-			char buf[100];
+			gchar buf[100];
 			snprintf(buf, sizeof(buf), "Loading Contacts (%d%%)", (int)percent);
 			e_data_book_view_notify_status_message(book_view, buf);
 		}
 
 		/* skip collections */
-		uri = (const char *) element->href;
+		uri = (const gchar *) element->href;
 		if (uri[strlen(uri)-1] == '/')
 			continue;
 
@@ -716,7 +716,7 @@ download_contacts(EBookBackendWebdav *webdav, EFlag *running,
 			complete_uri = g_strdup(uri);
 		}
 
-		etag = (const gchar*) element->etag;
+		etag = (const gchar *) element->etag;
 
 		contact = e_book_backend_cache_get_contact(priv->cache, complete_uri);
 		/* download contact if it is not cached or its ETag changed */
@@ -790,7 +790,7 @@ e_book_backend_webdav_start_book_view(EBookBackend *backend,
 
 		e_flag_wait(closure->running);
 	} else {
-		const char *query = e_data_book_view_get_card_query(book_view);
+		const gchar *query = e_data_book_view_get_card_query(book_view);
 		GList *contacts = e_book_backend_cache_get_contacts(priv->cache, query);
 		GList *l;
 
@@ -830,7 +830,7 @@ e_book_backend_webdav_stop_book_view(EBookBackend *backend,
 
 static void
 e_book_backend_webdav_get_contact_list(EBookBackend *backend, EDataBook *book,
-		guint32 opid, const char *query)
+		guint32 opid, const gchar *query)
 {
 	EBookBackendWebdav        *webdav = E_BOOK_BACKEND_WEBDAV(backend);
 	EBookBackendWebdavPrivate *priv   = webdav->priv;
@@ -854,7 +854,7 @@ e_book_backend_webdav_get_contact_list(EBookBackend *backend, EDataBook *book,
 	vcard_list   = NULL;
 	for (c = contact_list; c != NULL; c = g_list_next(c)) {
 		EContact *contact = c->data;
-		char     *vcard
+		gchar     *vcard
 			= e_vcard_to_string(E_VCARD(contact), EVC_FORMAT_VCARD_30);
 		vcard_list = g_list_append(vcard_list, vcard);
 		g_object_unref(contact);
@@ -867,8 +867,8 @@ e_book_backend_webdav_get_contact_list(EBookBackend *backend, EDataBook *book,
 
 static void
 e_book_backend_webdav_authenticate_user(EBookBackend *backend, EDataBook *book,
-		guint32 opid, const char *user, const char *password,
-		const char *auth_method)
+		guint32 opid, const gchar *user, const gchar *password,
+		const gchar *auth_method)
 {
 	EBookBackendWebdav        *webdav = E_BOOK_BACKEND_WEBDAV(backend);
 	EBookBackendWebdavPrivate *priv   = webdav->priv;
@@ -903,7 +903,7 @@ e_book_backend_webdav_get_supported_fields(EBookBackend *backend,
 		EDataBook *book, guint32 opid)
 {
 	GList *fields = NULL;
-	int    i;
+	gint    i;
 
 	/* we support everything */
 	for (i = 1; i < E_CONTACT_FIELD_LAST; ++i) {
@@ -986,11 +986,11 @@ e_book_backend_webdav_load_source(EBookBackend *backend,
 	EBookBackendWebdav        *webdav = E_BOOK_BACKEND_WEBDAV(backend);
 	EBookBackendWebdavPrivate *priv   = webdav->priv;
 	const gchar               *uri;
-	const char                *offline;
-	const char                *uri_without_protocol;
-	const char                *protocol;
-	const char                *use_ssl;
-	const char                *suffix;
+	const gchar                *offline;
+	const gchar                *uri_without_protocol;
+	const gchar                *protocol;
+	const gchar                *use_ssl;
+	const gchar                *suffix;
 	SoupSession               *session;
 
 	uri = e_source_get_uri(source);
@@ -1058,7 +1058,7 @@ e_book_backend_webdav_remove(EBookBackend *backend,	EDataBook *book,
 }
 
 static void
-e_book_backend_webdav_set_mode(EBookBackend *backend, int mode)
+e_book_backend_webdav_set_mode(EBookBackend *backend, gint mode)
 {
 	EBookBackendWebdav *webdav = E_BOOK_BACKEND_WEBDAV(backend);
 
@@ -1079,7 +1079,7 @@ e_book_backend_webdav_set_mode(EBookBackend *backend, int mode)
 	}
 }
 
-static char *
+static gchar *
 e_book_backend_webdav_get_static_capabilities(EBookBackend *backend)
 {
 	return g_strdup("net,do-initial-query,contact-lists");
diff --git a/addressbook/libebook/e-address-western.c b/addressbook/libebook/e-address-western.c
index b159e66..44c7f63 100644
--- a/addressbook/libebook/e-address-western.c
+++ b/addressbook/libebook/e-address-western.c
@@ -19,7 +19,7 @@
 /* These are the keywords that will distinguish the start of an extended
    address. */
 
-static char *extended_keywords[] = {
+static gchar *extended_keywords[] = {
 	"apt", "apartment", "suite", NULL
 };
 
@@ -144,12 +144,12 @@ static gboolean
 e_address_western_is_postal (gchar *line)
 {
 	gboolean retval;
-	int cntr;
+	gint cntr;
 
 	if (strchr (line, ',') == NULL)
 		retval = FALSE;  /* No comma. */
 	else {
-		int index;
+		gint index;
 
 		/* Ensure that the first character after the comma is
 		 a letter. */
@@ -190,7 +190,7 @@ e_address_western_extract_po_box (gchar *line)
 	/* Return everything from the beginning of the line to
 	   the end of the first word that contains a number. */
 
-	int index;
+	gint index;
 
 	index = 0;
 	while (!isdigit(line[index]))
@@ -255,7 +255,7 @@ e_address_western_extract_region (gchar *line)
 static gchar *
 e_address_western_extract_postal_code (gchar *line)
 {
-	int start, end;
+	gint start, end;
 
 	end = strlen (line) - 1;
 	while (isspace(line[end]))
@@ -362,7 +362,7 @@ e_address_western_parse (const gchar *in_address)
 	/* Convert the newlines at the end of each line (except the last,
 	 because it is already NULL terminated) to NULLs. */
 	for (cntr = 0; cntr < (linecntr - 1); cntr++) {
-		char *p;
+		gchar *p;
 		p = strchr (lines[cntr], '\n');
 		if (p)
 			*p = '\0';
diff --git a/addressbook/libebook/e-address-western.h b/addressbook/libebook/e-address-western.h
index e62c7c0..98c0e03 100644
--- a/addressbook/libebook/e-address-western.h
+++ b/addressbook/libebook/e-address-western.h
@@ -8,16 +8,16 @@ G_BEGIN_DECLS
 typedef struct {
 
 	/* Public */
-	char *po_box;
-	char *extended;  /* I'm not sure what this is. */
-	char *street;
-	char *locality;  /* For example, the city or town. */
-	char *region;	/* The state or province. */
-	char *postal_code;
-	char *country;
+	gchar *po_box;
+	gchar *extended;  /* I'm not sure what this is. */
+	gchar *street;
+	gchar *locality;  /* For example, the city or town. */
+	gchar *region;	/* The state or province. */
+	gchar *postal_code;
+	gchar *country;
 } EAddressWestern;
 
-EAddressWestern *e_address_western_parse (const char *in_address);
+EAddressWestern *e_address_western_parse (const gchar *in_address);
 void e_address_western_free (EAddressWestern *eaw);
 
 G_END_DECLS
diff --git a/addressbook/libebook/e-book-listener.c b/addressbook/libebook/e-book-listener.c
index 242b6dd..4c4b45e 100644
--- a/addressbook/libebook/e-book-listener.c
+++ b/addressbook/libebook/e-book-listener.c
@@ -72,7 +72,7 @@ static void
 impl_BookListener_respond_create_contact (PortableServer_Servant servant,
 					  const CORBA_long opid,
 					  const GNOME_Evolution_Addressbook_CallStatus status,
-					  const CORBA_char* id,
+					  const CORBA_char * id,
 					  CORBA_Environment *ev)
 {
 	EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
@@ -124,7 +124,7 @@ static void
 impl_BookListener_respond_get_contact (PortableServer_Servant servant,
 				       const CORBA_long opid,
 				       const GNOME_Evolution_Addressbook_CallStatus status,
-				       const CORBA_char* card,
+				       const CORBA_char * card,
 				       CORBA_Environment *ev)
 {
 	EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
@@ -149,7 +149,7 @@ impl_BookListener_respond_get_contact_list (PortableServer_Servant servant,
 {
 	EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
 	EBookListenerResponse response;
-	int i;
+	gint i;
 
 	if (listener->priv->stopped)
 		return;
@@ -201,7 +201,7 @@ impl_BookListener_respond_get_changes (PortableServer_Servant servant,
 {
 	EBookListener        *listener = E_BOOK_LISTENER (bonobo_object (servant));
 	EBookListenerResponse response;
-	int i;
+	gint i;
 
 	response.op     = GetChangesResponse;
 	response.opid   = opid;
@@ -288,7 +288,7 @@ impl_BookListener_respond_get_required_fields (PortableServer_Servant servant,
 {
 	EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
 	EBookListenerResponse response;
-	int i;
+	gint i;
 
 	response.op     = GetRequiredFieldsResponse;
 	response.opid   = opid;
@@ -311,7 +311,7 @@ impl_BookListener_respond_get_supported_fields (PortableServer_Servant servant,
 {
 	EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
 	EBookListenerResponse response;
-	int i;
+	gint i;
 
 	response.op     = GetSupportedFieldsResponse;
 	response.opid   = opid;
@@ -333,7 +333,7 @@ impl_BookListener_respond_get_supported_auth_methods (PortableServer_Servant ser
 {
 	EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
 	EBookListenerResponse response;
-	int i;
+	gint i;
 
 	response.op     = GetSupportedAuthMethodsResponse;
 	response.opid   = opid;
diff --git a/addressbook/libebook/e-book-listener.h b/addressbook/libebook/e-book-listener.h
index 2ac29a5..3d16c40 100644
--- a/addressbook/libebook/e-book-listener.h
+++ b/addressbook/libebook/e-book-listener.h
@@ -96,7 +96,7 @@ struct _EBookListenerResponse {
 	GList                                    *list;
 
 	/* For ProgressEvent */
-	char                   *msg;
+	gchar                   *msg;
 	short                   percent;
 
 	/* For LinkStatusEvent */
@@ -106,8 +106,8 @@ struct _EBookListenerResponse {
 	gboolean                writable;
 
 	/* For Card[Added|Removed|Modified]Event */
-	char                   *id;
-	char                   *vcard;
+	gchar                   *id;
+	gchar                   *vcard;
 };
 
 
diff --git a/addressbook/libebook/e-book-query.c b/addressbook/libebook/e-book-query.c
index fe51eb6..3413543 100644
--- a/addressbook/libebook/e-book-query.c
+++ b/addressbook/libebook/e-book-query.c
@@ -19,7 +19,7 @@ typedef enum {
 
 struct EBookQuery {
 	EBookQueryType type;
-	int ref_count;
+	gint ref_count;
 
 	union {
 		struct {
@@ -33,26 +33,26 @@ struct EBookQuery {
 
 		struct {
 			EBookQueryTest test;
-			char          *field_name;
-			char          *value;
+			gchar          *field_name;
+			gchar          *value;
 		} field_test;
 
 		struct {
 			EContactField  field;
-			char          *vcard_field;
+			gchar          *vcard_field;
 		} exist;
 
 		struct {
-			char          *value;
+			gchar          *value;
 		} any_field_contains;
 	} query;
 };
 
 static EBookQuery *
-conjoin (EBookQueryType type, int nqs, EBookQuery **qs, gboolean unref)
+conjoin (EBookQueryType type, gint nqs, EBookQuery **qs, gboolean unref)
 {
 	EBookQuery *ret = g_new0 (EBookQuery, 1);
-	int i;
+	gint i;
 
 	ret->type = type;
 	ret->query.andor.nqs = nqs;
@@ -77,7 +77,7 @@ conjoin (EBookQueryType type, int nqs, EBookQuery **qs, gboolean unref)
  * Return value: A new #EBookQuery
  **/
 EBookQuery *
-e_book_query_and (int nqs, EBookQuery **qs, gboolean unref)
+e_book_query_and (gint nqs, EBookQuery **qs, gboolean unref)
 {
 	return conjoin (E_BOOK_QUERY_TYPE_AND, nqs, qs, unref);
 }
@@ -93,7 +93,7 @@ e_book_query_and (int nqs, EBookQuery **qs, gboolean unref)
  * Return value: A new #EBookQuery
  **/
 EBookQuery *
-e_book_query_or (int nqs, EBookQuery **qs, gboolean unref)
+e_book_query_or (gint nqs, EBookQuery **qs, gboolean unref)
 {
 	return conjoin (E_BOOK_QUERY_TYPE_OR, nqs, qs, unref);
 }
@@ -190,7 +190,7 @@ e_book_query_not (EBookQuery *q, gboolean unref)
 EBookQuery *
 e_book_query_field_test (EContactField field,
 			 EBookQueryTest test,
-			 const char *value)
+			 const gchar *value)
 {
 	EBookQuery *ret = g_new0 (EBookQuery, 1);
 
@@ -213,9 +213,9 @@ e_book_query_field_test (EContactField field,
  * Return value: the new #EBookQuery
  **/
 EBookQuery *
-e_book_query_vcard_field_test (const char     *field,
+e_book_query_vcard_field_test (const gchar     *field,
 			       EBookQueryTest  test,
-			       const char     *value)
+			       const gchar     *value)
 {
 	EBookQuery *ret = g_new0 (EBookQuery, 1);
 
@@ -255,7 +255,7 @@ e_book_query_field_exists (EContactField field)
  * Return value: the new #EBookQuery
  **/
 EBookQuery *
-e_book_query_vcard_field_exists (const char *field)
+e_book_query_vcard_field_exists (const gchar *field)
 {
 	EBookQuery *ret = g_new0 (EBookQuery, 1);
 
@@ -275,7 +275,7 @@ e_book_query_vcard_field_exists (const char *field)
  * Return value: the new #EBookQuery
  **/
 EBookQuery *
-e_book_query_any_field_contains (const char *value)
+e_book_query_any_field_contains (const gchar *value)
 {
 	EBookQuery *ret = g_new0 (EBookQuery, 1);
 
@@ -295,7 +295,7 @@ e_book_query_any_field_contains (const char *value)
 void
 e_book_query_unref (EBookQuery *q)
 {
-	int i;
+	gint i;
 
 	if (q->ref_count--)
 		return;
@@ -347,14 +347,14 @@ e_book_query_ref (EBookQuery *q)
 }
 
 static ESExpResult *
-func_and(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_and(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	GList **list = data;
 	ESExpResult *r;
 	EBookQuery **qs;
 
 	if (argc > 0) {
-		int i;
+		gint i;
 
 		qs = g_new0(EBookQuery*, argc);
 
@@ -379,14 +379,14 @@ func_and(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_or(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_or(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	GList **list = data;
 	ESExpResult *r;
 	EBookQuery **qs;
 
 	if (argc > 0) {
-		int i;
+		gint i;
 
 		qs = g_new0(EBookQuery*, argc);
 
@@ -411,7 +411,7 @@ func_or(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_not(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	GList **list = data;
 	ESExpResult *r;
@@ -429,7 +429,7 @@ func_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	GList **list = data;
 	ESExpResult *r;
@@ -437,8 +437,8 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = argv[1]->value.string;
+		gchar *propname = argv[0]->value.string;
+		gchar *str = argv[1]->value.string;
 
 		if (!strcmp (propname, "x-evolution-any-field")) {
 			*list = g_list_prepend (*list, e_book_query_any_field_contains (str));
@@ -464,7 +464,7 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 }
 
 static ESExpResult *
-func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_is(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	GList **list = data;
 	ESExpResult *r;
@@ -472,8 +472,8 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = argv[1]->value.string;
+		gchar *propname = argv[0]->value.string;
+		gchar *str = argv[1]->value.string;
 		EContactField field = e_contact_field_id (propname);
 
 		if (field)
@@ -493,7 +493,7 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_beginswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	GList **list = data;
 	ESExpResult *r;
@@ -501,8 +501,8 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = argv[1]->value.string;
+		gchar *propname = argv[0]->value.string;
+		gchar *str = argv[1]->value.string;
 		EContactField field = e_contact_field_id (propname);
 
 		if (field)
@@ -522,7 +522,7 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
 }
 
 static ESExpResult *
-func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_endswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	GList **list = data;
 	ESExpResult *r;
@@ -530,8 +530,8 @@ func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
-		char *str = argv[1]->value.string;
+		gchar *propname = argv[0]->value.string;
+		gchar *str = argv[1]->value.string;
 		EContactField field = e_contact_field_id (propname);
 
 		if (field)
@@ -551,14 +551,14 @@ func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 }
 
 static ESExpResult *
-func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	GList **list = data;
 	ESExpResult *r;
 
 	if (argc == 1
 	    && argv[0]->type == ESEXP_RES_STRING) {
-		char *propname = argv[0]->value.string;
+		gchar *propname = argv[0]->value.string;
 		EContactField field = e_contact_field_id (propname);
 
 		if (field)
@@ -575,9 +575,9 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 
 /* 'builtin' functions */
 static const 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[] = {
 	{ "and", func_and, 0 },
@@ -599,13 +599,13 @@ static const struct {
  * Return value: the new #EBookQuery.
  **/
 EBookQuery*
-e_book_query_from_string  (const char *query_string)
+e_book_query_from_string  (const gchar *query_string)
 {
 	ESExp *sexp;
 	ESExpResult *r;
 	EBookQuery *retval;
 	GList *list = NULL;
-	int i;
+	gint i;
 
 	sexp = e_sexp_new();
 
@@ -655,13 +655,13 @@ e_book_query_from_string  (const char *query_string)
  * Return value: The string form of the query. This string should be freed when
  * finished with.
  **/
-char*
+gchar *
 e_book_query_to_string    (EBookQuery *q)
 {
 	GString *str = g_string_new ("(");
 	GString *encoded = g_string_new ("");
-	int i;
-	char *s = NULL;
+	gint i;
+	gchar *s = NULL;
 
 	switch (q->type) {
 	case E_BOOK_QUERY_TYPE_AND:
@@ -749,7 +749,7 @@ e_book_query_get_type (void)
 EBookQuery*
 e_book_query_copy (EBookQuery *q)
 {
-	char *str = e_book_query_to_string (q);
+	gchar *str = e_book_query_to_string (q);
 	EBookQuery *nq = e_book_query_from_string (str);
 
 	g_free (str);
diff --git a/addressbook/libebook/e-book-query.h b/addressbook/libebook/e-book-query.h
index 4c81818..4bf9667 100644
--- a/addressbook/libebook/e-book-query.h
+++ b/addressbook/libebook/e-book-query.h
@@ -27,30 +27,30 @@ typedef enum {
   */
 } EBookQueryTest;
 
-EBookQuery* e_book_query_from_string  (const char *query_string);
-char*       e_book_query_to_string    (EBookQuery *q);
+EBookQuery* e_book_query_from_string  (const gchar *query_string);
+gchar *       e_book_query_to_string    (EBookQuery *q);
 
 EBookQuery* e_book_query_ref          (EBookQuery *q);
 void        e_book_query_unref        (EBookQuery *q);
 
-EBookQuery* e_book_query_and          (int nqs, EBookQuery **qs, gboolean unref);
+EBookQuery* e_book_query_and          (gint nqs, EBookQuery **qs, gboolean unref);
 EBookQuery* e_book_query_andv         (EBookQuery *q, ...);
-EBookQuery* e_book_query_or           (int nqs, EBookQuery **qs, gboolean unref);
+EBookQuery* e_book_query_or           (gint nqs, EBookQuery **qs, gboolean unref);
 EBookQuery* e_book_query_orv          (EBookQuery *q, ...);
 
 EBookQuery* e_book_query_not          (EBookQuery *q, gboolean unref);
 
 EBookQuery* e_book_query_field_exists (EContactField   field);
-EBookQuery* e_book_query_vcard_field_exists (const char *field);
+EBookQuery* e_book_query_vcard_field_exists (const gchar *field);
 EBookQuery* e_book_query_field_test   (EContactField   field,
 				       EBookQueryTest     test,
-				       const char        *value);
-EBookQuery* e_book_query_vcard_field_test (const char    *field,
+				       const gchar        *value);
+EBookQuery* e_book_query_vcard_field_test (const gchar    *field,
 				       EBookQueryTest     test,
-				       const char        *value);
+				       const gchar        *value);
 
 /* a special any field contains query */
-EBookQuery* e_book_query_any_field_contains (const char  *value);
+EBookQuery* e_book_query_any_field_contains (const gchar  *value);
 
 GType       e_book_query_get_type (void);
 EBookQuery* e_book_query_copy     (EBookQuery *q);
diff --git a/addressbook/libebook/e-book-view-listener.c b/addressbook/libebook/e-book-view-listener.c
index e0d5935..75da9a0 100644
--- a/addressbook/libebook/e-book-view-listener.c
+++ b/addressbook/libebook/e-book-view-listener.c
@@ -127,7 +127,7 @@ e_book_view_listener_queue_idlist_event (EBookViewListener          *listener,
 					 const GNOME_Evolution_Addressbook_ContactIdList *ids)
 {
 	EBookViewListenerResponse *resp;
-	int i;
+	gint i;
 
 	if (listener->priv->stopped)
 		return;
@@ -151,7 +151,7 @@ e_book_view_listener_queue_sequence_event (EBookViewListener          *listener,
 					   const GNOME_Evolution_Addressbook_VCardList  *vcards)
 {
 	EBookViewListenerResponse *resp;
-	int i;
+	gint i;
 
 	if (listener->priv->stopped)
 		return;
@@ -173,7 +173,7 @@ e_book_view_listener_queue_sequence_event (EBookViewListener          *listener,
 static void
 e_book_view_listener_queue_message_event (EBookViewListener          *listener,
 					  EBookViewListenerOperation  op,
-					  const char                 *message)
+					  const gchar                 *message)
 {
 	EBookViewListenerResponse *resp;
 
@@ -242,7 +242,7 @@ impl_BookViewListener_notify_sequence_complete (PortableServer_Servant servant,
 
 static void
 impl_BookViewListener_notify_progress (PortableServer_Servant  servant,
-				       const char             *message,
+				       const gchar             *message,
 				       const CORBA_short       percent,
 				       CORBA_Environment      *ev)
 {
diff --git a/addressbook/libebook/e-book-view-listener.h b/addressbook/libebook/e-book-view-listener.h
index 57d9374..6d4bf78 100644
--- a/addressbook/libebook/e-book-view-listener.h
+++ b/addressbook/libebook/e-book-view-listener.h
@@ -79,7 +79,7 @@ struct _EBookViewListenerResponse {
 	GList                  *contacts; /* Of type EContact. */
 
 	/* For StatusMessageEvent */
-	char                   *message;
+	gchar                   *message;
 
 };
 
diff --git a/addressbook/libebook/e-book-view.c b/addressbook/libebook/e-book-view.c
index acb6cf4..1ebe549 100644
--- a/addressbook/libebook/e-book-view.c
+++ b/addressbook/libebook/e-book-view.c
@@ -24,7 +24,7 @@ struct _EBookViewPrivate {
 
 	EBookViewListener     *listener;
 
-	int                    response_id;
+	gint                    response_id;
 };
 
 enum {
diff --git a/addressbook/libebook/e-book-view.h b/addressbook/libebook/e-book-view.h
index 8a5321f..a537646 100644
--- a/addressbook/libebook/e-book-view.h
+++ b/addressbook/libebook/e-book-view.h
@@ -46,7 +46,7 @@ struct _EBookViewClass {
 	void (* contacts_removed)  (EBookView *book_view, const GList *ids);
 	void (* contacts_added)    (EBookView *book_view, const GList *contacts);
 	void (* sequence_complete) (EBookView *book_view, EBookViewStatus status);
-	void (* status_message)    (EBookView *book_view, const char *message);
+	void (* status_message)    (EBookView *book_view, const gchar *message);
 
 	/* Padding for future expansion */
 	void (*_ebook_reserved0) (void);
diff --git a/addressbook/libebook/e-book.c b/addressbook/libebook/e-book.c
index e8ee2ef..50f3158 100644
--- a/addressbook/libebook/e-book.c
+++ b/addressbook/libebook/e-book.c
@@ -99,7 +99,7 @@ typedef struct {
 	EFlag *flag;
 	EBook *book;
 	EBookStatus status;
-	char *id;
+	gchar *id;
 	GList *list;
 	EList *elist;
 	EContact *contact;
@@ -127,7 +127,7 @@ typedef enum {
 
 struct _EBookPrivate {
 	/* cached capabilites */
-	char *cap;
+	gchar *cap;
 	gboolean cap_queried;
 
 	/* cached writable status */
@@ -196,7 +196,7 @@ e_book_new_op (EBook *book, gboolean sync)
 }
 
 static EBookOp*
-e_book_get_op (EBook *book, int opid)
+e_book_get_op (EBook *book, gint opid)
 {
 	return (EBookOp*)g_hash_table_lookup (book->priv->id_to_op,
 					      &opid);
@@ -209,7 +209,7 @@ e_book_get_current_sync_op (EBook *book)
 }
 
 static EBookOp *
-e_book_find_op (EBook *book, guint32 opid, const char *func_name)
+e_book_find_op (EBook *book, guint32 opid, const gchar *func_name)
 {
 	EBookOp *op;
 
@@ -271,7 +271,7 @@ do_add_contact (gboolean          sync,
 	EBookOp *our_op;
 	EBookStatus status;
 	CORBA_Environment ev;
-	char *vcard_str;
+	gchar *vcard_str;
 
 	d(printf ("do_add_contact\n"));
 
@@ -441,7 +441,7 @@ static void
 e_book_response_add_contact (EBook       *book,
 			     guint32      opid,
 			     EBookStatus  status,
-			     char        *id)
+			     gchar        *id)
 {
 	EBookOp *op;
 
@@ -485,7 +485,7 @@ do_commit_contact (gboolean        sync,
 	EBookOp *our_op;
 	EBookStatus status;
 	CORBA_Environment ev;
-	char *vcard_str;
+	gchar *vcard_str;
 
 	g_mutex_lock (book->priv->mutex);
 
@@ -1191,9 +1191,9 @@ e_book_response_get_supported_auth_methods (EBook                 *book,
 static gboolean
 do_authenticate_user (gboolean        sync,
 		      EBook          *book,
-		      const char     *user,
-		      const char     *passwd,
-		      const char     *auth_method,
+		      const gchar     *user,
+		      const gchar     *passwd,
+		      const gchar     *auth_method,
 		      GError        **error,
 		      EBookCallback   cb,
 		      gpointer        closure)
@@ -1297,9 +1297,9 @@ do_authenticate_user (gboolean        sync,
  **/
 gboolean
 e_book_authenticate_user (EBook         *book,
-			  const char    *user,
-			  const char    *passwd,
-			  const char    *auth_method,
+			  const gchar    *user,
+			  const gchar    *passwd,
+			  const gchar    *auth_method,
 			  GError       **error)
 {
 	e_return_error_if_fail (book && E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG, FALSE);
@@ -1330,9 +1330,9 @@ e_book_authenticate_user (EBook         *book,
  **/
 guint
 e_book_async_authenticate_user (EBook                 *book,
-				const char            *user,
-				const char            *passwd,
-				const char            *auth_method,
+				const gchar            *user,
+				const gchar            *passwd,
+				const gchar            *auth_method,
 				EBookCallback         cb,
 				gpointer              closure)
 {
@@ -1351,7 +1351,7 @@ e_book_async_authenticate_user (EBook                 *book,
 static gboolean
 do_get_contact (gboolean sync,
 		EBook *book,
-		const char *id,
+		const gchar *id,
 		EContact **contact,
 		GError **error,
 		EBookContactCallback cb,
@@ -1453,7 +1453,7 @@ do_get_contact (gboolean sync,
  **/
 gboolean
 e_book_get_contact (EBook       *book,
-		    const char  *id,
+		    const gchar  *id,
 		    EContact   **contact,
 		    GError     **error)
 {
@@ -1479,7 +1479,7 @@ e_book_get_contact (EBook       *book,
  **/
 guint
 e_book_async_get_contact (EBook                 *book,
-			  const char            *id,
+			  const gchar            *id,
 			  EBookContactCallback   cb,
 			  gpointer               closure)
 {
@@ -1562,7 +1562,7 @@ do_remove_contacts (gboolean sync,
 	GNOME_Evolution_Addressbook_ContactIdList idlist;
 	CORBA_Environment ev;
 	GList *iter;
-	int num_ids, i;
+	gint num_ids, i;
 	EBookOp *our_op;
 	EBookStatus status;
 
@@ -1663,7 +1663,7 @@ do_remove_contacts (gboolean sync,
  **/
 gboolean
 e_book_remove_contact (EBook       *book,
-		       const char  *id,
+		       const gchar  *id,
 		       GError     **error)
 {
 	GList *list;
@@ -1672,7 +1672,7 @@ e_book_remove_contact (EBook       *book,
 	e_return_error_if_fail (book && E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG, FALSE);
 	e_return_error_if_fail (id,                       E_BOOK_ERROR_INVALID_ARG, FALSE);
 
-	list = g_list_append (NULL, (char*)id);
+	list = g_list_append (NULL, (gchar *)id);
 
 	rv = e_book_remove_contacts (book, list, error);
 
@@ -1684,7 +1684,7 @@ e_book_remove_contact (EBook       *book,
 /**
  * e_book_remove_contacts:
  * @book: an #EBook
- * @ids: an #GList of const char *id's
+ * @ids: an #GList of const gchar *id's
  * @error: a #GError to set on failure
  *
  * Removes the contacts with ids from the list @ids from @book.  This is
@@ -1724,7 +1724,7 @@ e_book_async_remove_contact (EBook                 *book,
 			     EBookCallback          cb,
 			     gpointer               closure)
 {
-	const char *id;
+	const gchar *id;
 
 	g_return_val_if_fail (E_IS_BOOK (book), TRUE);
 	g_return_val_if_fail (E_IS_CONTACT (contact), TRUE);
@@ -1747,7 +1747,7 @@ e_book_async_remove_contact (EBook                 *book,
  **/
 guint
 e_book_async_remove_contact_by_id (EBook                 *book,
-				   const char            *id,
+				   const gchar            *id,
 				   EBookCallback          cb,
 				   gpointer               closure)
 {
@@ -1764,7 +1764,7 @@ e_book_async_remove_contact_by_id (EBook                 *book,
 /**
  * e_book_async_remove_contacts:
  * @book: an #EBook
- * @ids: a #GList of const char *id's
+ * @ids: a #GList of const gchar *id's
  * @cb: a function to call when the operation finishes
  * @closure: data to pass to callback function
  *
@@ -1795,7 +1795,7 @@ do_get_book_view (gboolean sync,
 		  EBook *book,
 		  EBookQuery *query,
 		  GList *requested_fields,
-		  int max_results,
+		  gint max_results,
 		  EBookView **book_view,
 		  GError **error,
 		  EBookBookViewCallback cb,
@@ -1805,9 +1805,9 @@ do_get_book_view (gboolean sync,
 	CORBA_Environment ev;
 	EBookOp *our_op;
 	EBookStatus status;
-	int num_fields, i;
+	gint num_fields, i;
 	GList *iter;
-	char *query_string;
+	gchar *query_string;
 
 	g_mutex_lock (book->priv->mutex);
 
@@ -1847,7 +1847,7 @@ do_get_book_view (gboolean sync,
 	stringlist._length = num_fields;
 
 	for (i = 0, iter = requested_fields; iter; iter = iter->next, i ++) {
-		stringlist._buffer[i] = CORBA_string_dup ((char*)iter->data);
+		stringlist._buffer[i] = CORBA_string_dup ((gchar *)iter->data);
 	}
 
 	query_string = e_book_query_to_string (query);
@@ -1926,7 +1926,7 @@ gboolean
 e_book_get_book_view (EBook       *book,
 		      EBookQuery  *query,
 		      GList       *requested_fields,
-		      int          max_results,
+		      gint          max_results,
 		      EBookView  **book_view,
 		      GError     **error)
 {
@@ -1957,7 +1957,7 @@ guint
 e_book_async_get_book_view (EBook                 *book,
 			    EBookQuery            *query,
 			    GList                 *requested_fields,
-			    int                    max_results,
+			    gint                    max_results,
 			    EBookBookViewCallback  cb,
 			    gpointer               closure)
 {
@@ -2044,7 +2044,7 @@ do_get_contacts (gboolean sync,
 	CORBA_Environment ev;
 	EBookOp *our_op;
 	EBookStatus status;
-	char *query_string;
+	gchar *query_string;
 
 	g_mutex_lock (book->priv->mutex);
 
@@ -2244,7 +2244,7 @@ e_book_response_get_contacts (EBook       *book,
 static gboolean
 do_get_changes (gboolean sync,
 		EBook *book,
-		char *changeid,
+		gchar *changeid,
 		GList **changes,
 		GError **error,
 		EBookListCallback cb,
@@ -2345,7 +2345,7 @@ do_get_changes (gboolean sync,
  */
 gboolean
 e_book_get_changes (EBook       *book,
-		    char        *changeid,
+		    gchar        *changeid,
 		    GList      **changes,
 		    GError     **error)
 {
@@ -2372,7 +2372,7 @@ e_book_get_changes (EBook       *book,
  */
 guint
 e_book_async_get_changes (EBook             *book,
-			  char              *changeid,
+			  gchar              *changeid,
 			  EBookListCallback  cb,
 			  gpointer           closure)
 {
@@ -2515,7 +2515,7 @@ e_book_response_generic (EBook       *book,
 }
 
 static gboolean
-do_cancel (EBook *book, GError **error, EBookOp *op, const char *func_name)
+do_cancel (EBook *book, GError **error, EBookOp *op, const gchar *func_name)
 {
 	EBookStatus status;
 	gboolean rv;
@@ -3244,12 +3244,12 @@ backend_died_cb (EComponentListener *cl, gpointer user_data)
 }
 
 static GList *
-activate_factories_for_uri (EBook *book, const char *uri)
+activate_factories_for_uri (EBook *book, const gchar *uri)
 {
 	CORBA_Environment ev;
 	Bonobo_ServerInfoList *info_list = NULL;
-	int i;
-	char *query;
+	gint i;
+	gchar *query;
 	GList *factories = NULL;
 
 	query = "repo_ids.has ('IDL:GNOME/Evolution/DataServer/BookFactory:" API_VERSION "')";
@@ -3259,7 +3259,7 @@ activate_factories_for_uri (EBook *book, const char *uri)
 	info_list = bonobo_activation_query (query, NULL, &ev);
 
 	if (ev._major != CORBA_NO_EXCEPTION) {
-		char *exc_text = bonobo_exception_get_text (&ev);
+		gchar *exc_text = bonobo_exception_get_text (&ev);
 		g_warning ("Cannot perform bonobo-activation query for book factories: %s", exc_text);
 		g_free (exc_text);
 		CORBA_exception_free (&ev);
@@ -3403,7 +3403,7 @@ fetch_corba_book (EBook       *book,
  *
  * Return value: The URI.
  */
-const char *
+const gchar *
 e_book_get_uri (EBook *book)
 {
 	g_return_val_if_fail (book && E_IS_BOOK (book), NULL);
@@ -3437,7 +3437,7 @@ e_book_get_source (EBook *book)
  *
  * Return value: The capabilities list
  */
-const char *
+const gchar *
 e_book_get_static_capabilities (EBook   *book,
 				GError **error)
 {
@@ -3445,7 +3445,7 @@ e_book_get_static_capabilities (EBook   *book,
 
 	if (!book->priv->cap_queried) {
 		CORBA_Environment ev;
-		char *temp;
+		gchar *temp;
 
 		CORBA_exception_init (&ev);
 
@@ -3489,9 +3489,9 @@ e_book_get_static_capabilities (EBook   *book,
  */
 gboolean
 e_book_check_static_capability (EBook *book,
-				const char  *cap)
+				const gchar  *cap)
 {
-	const char *caps;
+	const gchar *caps;
 
 	g_return_val_if_fail (book && E_IS_BOOK (book), FALSE);
 
@@ -3575,7 +3575,7 @@ e_book_get_self (EContact **contact, EBook **book, GError **error)
 	GError *e = NULL;
 	GConfClient *gconf;
 	gboolean status;
-	char *uid;
+	gchar *uid;
 
 	*book = e_book_new_system_addressbook (&e);
 
@@ -3658,7 +3658,7 @@ gboolean
 e_book_is_self (EContact *contact)
 {
 	GConfClient *gconf;
-	char *uid;
+	gchar *uid;
 	gboolean rv;
 
 	/* XXX this should probably be e_return_error_if_fail, but we
@@ -3716,7 +3716,7 @@ gboolean
 e_book_set_default_source (ESource *source, GError **error)
 {
 	ESourceList *sources;
-	const char *uid;
+	const gchar *uid;
 	GError *err = NULL;
 	GSList *g;
 
@@ -3787,8 +3787,8 @@ e_book_get_addressbooks (ESourceList **addressbook_sources, GError **error)
 }
 
 
-static void*
-startup_mainloop (void *arg)
+static gpointer
+startup_mainloop (gpointer arg)
 {
 	GMainLoop *loop = g_main_loop_new (_ebook_context, FALSE);
 	g_main_loop_run (loop);
@@ -3861,7 +3861,7 @@ e_book_new (ESource *source, GError **error)
  * Return value: a new but unopened #EBook.
  */
 EBook*
-e_book_new_from_uri (const char *uri, GError **error)
+e_book_new_from_uri (const gchar *uri, GError **error)
 {
 	ESourceGroup *group;
 	ESource *source;
@@ -3927,8 +3927,8 @@ e_book_new_system_addressbook    (GError **error)
 		book = e_book_new (system_source, &err);
 	}
 	else {
-		char *filename;
-		char *uri;
+		gchar *filename;
+		gchar *uri;
 
 		filename = g_build_filename (g_get_home_dir(),
 					     ".evolution/addressbook/local/system",
diff --git a/addressbook/libebook/e-book.h b/addressbook/libebook/e-book.h
index 8234572..a888ecb 100644
--- a/addressbook/libebook/e-book.h
+++ b/addressbook/libebook/e-book.h
@@ -37,10 +37,10 @@ typedef struct _EBookPrivate EBookPrivate;
 
 typedef void (*EBookCallback) (EBook *book, EBookStatus status, gpointer closure);
 typedef void (*EBookOpenProgressCallback)     (EBook          *book,
-					       const char     *status_message,
+					       const gchar     *status_message,
 					       short           percent,
 					       gpointer        closure);
-typedef void (*EBookIdCallback)       (EBook *book, EBookStatus status, const char *id, gpointer closure);
+typedef void (*EBookIdCallback)       (EBook *book, EBookStatus status, const gchar *id, gpointer closure);
 typedef void (*EBookContactCallback)  (EBook *book, EBookStatus status, EContact *contact, gpointer closure);
 typedef void (*EBookListCallback)     (EBook *book, EBookStatus status, GList *list, gpointer closure);
 typedef void (*EBookBookViewCallback) (EBook *book, EBookStatus status, EBookView *book_view, gpointer closure);
@@ -74,7 +74,7 @@ struct _EBookClass {
 
 /* Creating a new addressbook. */
 EBook    *e_book_new                       (ESource *source, GError **error);
-EBook    *e_book_new_from_uri              (const char *uri, GError **error);
+EBook    *e_book_new_from_uri              (const gchar *uri, GError **error);
 EBook    *e_book_new_system_addressbook    (GError **error);
 EBook    *e_book_new_default_addressbook   (GError **error);
 
@@ -120,32 +120,32 @@ guint    e_book_async_get_supported_auth_methods (EBook              *book,
 
 /* User authentication. */
 gboolean e_book_authenticate_user          (EBook       *book,
-					    const char  *user,
-					    const char  *passwd,
-					    const char  *auth_method,
+					    const gchar  *user,
+					    const gchar  *passwd,
+					    const gchar  *auth_method,
 					    GError     **error);
 
 guint e_book_async_authenticate_user       (EBook                 *book,
-					    const char            *user,
-					    const char            *passwd,
-					    const char            *auth_method,
+					    const gchar            *user,
+					    const gchar            *passwd,
+					    const gchar            *auth_method,
 					    EBookCallback         cb,
 					    gpointer              closure);
 
 /* Fetching contacts. */
 gboolean e_book_get_contact                (EBook       *book,
-					    const char  *id,
+					    const gchar  *id,
 					    EContact   **contact,
 					    GError     **error);
 
 guint     e_book_async_get_contact         (EBook                 *book,
-					    const char            *id,
+					    const gchar            *id,
 					    EBookContactCallback   cb,
 					    gpointer               closure);
 
 /* Deleting contacts. */
 gboolean e_book_remove_contact             (EBook       *book,
-					    const char  *id,
+					    const gchar  *id,
 					    GError     **error);
 
 guint    e_book_async_remove_contact       (EBook                 *book,
@@ -153,7 +153,7 @@ guint    e_book_async_remove_contact       (EBook                 *book,
 					    EBookCallback          cb,
 					    gpointer               closure);
 guint    e_book_async_remove_contact_by_id (EBook                 *book,
-					    const char            *id,
+					    const gchar            *id,
 					    EBookCallback          cb,
 					    gpointer               closure);
 
@@ -190,14 +190,14 @@ guint e_book_async_commit_contact          (EBook                 *book,
 gboolean e_book_get_book_view              (EBook       *book,
 					    EBookQuery  *query,
 					    GList       *requested_fields,
-					    int          max_results,
+					    gint          max_results,
 					    EBookView  **book_view,
 					    GError     **error);
 
 guint e_book_async_get_book_view           (EBook                 *book,
 					    EBookQuery            *query,
 					    GList                 *requested_fields,
-					    int                    max_results,
+					    gint                    max_results,
 					    EBookBookViewCallback  cb,
 					    gpointer               closure);
 
@@ -214,24 +214,24 @@ guint     e_book_async_get_contacts        (EBook             *book,
 
 /* Needed for syncing */
 gboolean e_book_get_changes                (EBook       *book,
-					    char        *changeid,
+					    gchar        *changeid,
 					    GList      **changes,
 					    GError     **error);
 
 guint    e_book_async_get_changes          (EBook             *book,
-					    char              *changeid,
+					    gchar              *changeid,
 					    EBookListCallback  cb,
 					    gpointer           closure);
 
 void     e_book_free_change_list           (GList       *change_list);
 
-const char *e_book_get_uri                 (EBook       *book);
+const gchar *e_book_get_uri                 (EBook       *book);
 ESource    *e_book_get_source              (EBook       *book);
 
-const char *e_book_get_static_capabilities (EBook    *book,
+const gchar *e_book_get_static_capabilities (EBook    *book,
 					    GError  **error);
 gboolean    e_book_check_static_capability (EBook       *book,
-					    const char  *cap);
+					    const gchar  *cap);
 gboolean    e_book_is_opened               (EBook       *book);
 gboolean    e_book_is_writable             (EBook       *book);
 
diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c
index 6f09bb3..95b5b73 100644
--- a/addressbook/libebook/e-contact.c
+++ b/addressbook/libebook/e-contact.c
@@ -42,12 +42,12 @@
 #define d(x)
 
 struct _EContactPrivate {
-	char *cached_strings [E_CONTACT_FIELD_LAST];
+	gchar *cached_strings [E_CONTACT_FIELD_LAST];
 };
 
 #define E_CONTACT_FIELD_TYPE_STRING       0x00000001   /* used for simple single valued attributes */
 /*E_CONTACT_FIELD_TYPE_FLOAT*/
-#define E_CONTACT_FIELD_TYPE_LIST         0x00000002   /* used for multivalued single attributes - the elements are of type char* */
+#define E_CONTACT_FIELD_TYPE_LIST         0x00000002   /* used for multivalued single attributes - the elements are of type gchar * */
 #define E_CONTACT_FIELD_TYPE_MULTI        0x00000004   /* used for multivalued attributes - the elements are of type EVCardAttribute */
 #define E_CONTACT_FIELD_TYPE_GETSET       0x00000008   /* used for attributes that need custom handling for getting/setting */
 #define E_CONTACT_FIELD_TYPE_STRUCT       0x00000010   /* used for structured types (N and ADR properties, in particular) */
@@ -62,36 +62,36 @@ typedef struct {
 	guint32 t;
 
 	EContactField field_id;
-	const char *vcard_field_name;
-	const char *field_name;      /* non translated */
-	const char *pretty_name;     /* translated */
+	const gchar *vcard_field_name;
+	const gchar *field_name;      /* non translated */
+	const gchar *pretty_name;     /* translated */
 
 	gboolean read_only;
 
-	int list_elem;
-	const char *attr_type1;
-	const char *attr_type2;
+	gint list_elem;
+	const gchar *attr_type1;
+	const gchar *attr_type2;
 
-	void* (*struct_getter)(EContact *contact, EVCardAttribute *attribute);
-	void (*struct_setter)(EContact *contact, EVCardAttribute *attribute, void *data);
+	gpointer  (*struct_getter)(EContact *contact, EVCardAttribute *attribute);
+	void (*struct_setter)(EContact *contact, EVCardAttribute *attribute, gpointer data);
 
 	GType (*boxed_type_getter) (void);
 } EContactFieldInfo;
 
-static void* photo_getter (EContact *contact, EVCardAttribute *attr);
-static void photo_setter (EContact *contact, EVCardAttribute *attr, void *data);
-static void* geo_getter (EContact *contact, EVCardAttribute *attr);
-static void geo_setter (EContact *contact, EVCardAttribute *attr, void *data);
-static void* fn_getter (EContact *contact, EVCardAttribute *attr);
-static void fn_setter (EContact *contact, EVCardAttribute *attr, void *data);
-static void* n_getter (EContact *contact, EVCardAttribute *attr);
-static void n_setter (EContact *contact, EVCardAttribute *attr, void *data);
-static void* adr_getter (EContact *contact, EVCardAttribute *attr);
-static void adr_setter (EContact *contact, EVCardAttribute *attr, void *data);
-static void* date_getter (EContact *contact, EVCardAttribute *attr);
-static void date_setter (EContact *contact, EVCardAttribute *attr, void *data);
-static void* cert_getter (EContact *contact, EVCardAttribute *attr);
-static void cert_setter (EContact *contact, EVCardAttribute *attr, void *data);
+static gpointer  photo_getter (EContact *contact, EVCardAttribute *attr);
+static void photo_setter (EContact *contact, EVCardAttribute *attr, gpointer data);
+static gpointer  geo_getter (EContact *contact, EVCardAttribute *attr);
+static void geo_setter (EContact *contact, EVCardAttribute *attr, gpointer data);
+static gpointer  fn_getter (EContact *contact, EVCardAttribute *attr);
+static void fn_setter (EContact *contact, EVCardAttribute *attr, gpointer data);
+static gpointer  n_getter (EContact *contact, EVCardAttribute *attr);
+static void n_setter (EContact *contact, EVCardAttribute *attr, gpointer data);
+static gpointer  adr_getter (EContact *contact, EVCardAttribute *attr);
+static void adr_setter (EContact *contact, EVCardAttribute *attr, gpointer data);
+static gpointer  date_getter (EContact *contact, EVCardAttribute *attr);
+static void date_setter (EContact *contact, EVCardAttribute *attr, gpointer data);
+static gpointer  cert_getter (EContact *contact, EVCardAttribute *attr);
+static void cert_setter (EContact *contact, EVCardAttribute *attr, gpointer data);
 
 #define STRING_FIELD(id,vc,n,pn,ro)  { E_CONTACT_FIELD_TYPE_STRING, (id), (vc), (n), (pn), (ro) }
 #define BOOLEAN_FIELD(id,vc,n,pn,ro)  { E_CONTACT_FIELD_TYPE_BOOLEAN, (id), (vc), (n), (pn), (ro) }
@@ -301,7 +301,7 @@ static void
 e_contact_finalize (GObject *object)
 {
 	EContact *ec = E_CONTACT (object);
-	int i;
+	gint i;
 
 	for (i = E_CONTACT_FIELD_FIRST; i < E_CONTACT_FIELD_LAST; i++) {
 		g_free (ec->priv->cached_strings[i]);
@@ -319,7 +319,7 @@ static void
 e_contact_class_init (EContactClass *klass)
 {
 	GObjectClass *object_class;
-	int i;
+	gint i;
 
 	object_class = G_OBJECT_CLASS(klass);
 
@@ -399,7 +399,7 @@ e_contact_get_type (void)
 }
 
 static EVCardAttribute*
-e_contact_get_first_attr (EContact *contact, const char *attr_name)
+e_contact_get_first_attr (EContact *contact, const gchar *attr_name)
 {
 	GList *attrs, *l;
 
@@ -407,7 +407,7 @@ e_contact_get_first_attr (EContact *contact, const char *attr_name)
 
 	for (l = attrs; l; l = l->next) {
 		EVCardAttribute *attr = l->data;
-		const char *name;
+		const gchar *name;
 
 		name = e_vcard_attribute_get_name (attr);
 
@@ -420,7 +420,7 @@ e_contact_get_first_attr (EContact *contact, const char *attr_name)
 
 
 
-static void*
+static gpointer
 geo_getter (EContact *contact, EVCardAttribute *attr)
 {
 	if (attr) {
@@ -437,10 +437,10 @@ geo_getter (EContact *contact, EVCardAttribute *attr)
 }
 
 static void
-geo_setter (EContact *contact, EVCardAttribute *attr, void *data)
+geo_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 {
 	EContactGeo *geo = data;
-	char buf[G_ASCII_DTOSTR_BUF_SIZE];
+	gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
 
 	e_vcard_attribute_add_value
 		(attr, g_ascii_dtostr (buf, sizeof (buf), geo->latitude));
@@ -449,7 +449,7 @@ geo_setter (EContact *contact, EVCardAttribute *attr, void *data)
 		(attr, g_ascii_dtostr (buf, sizeof (buf), geo->longitude));
 }
 
-static void*
+static gpointer
 photo_getter (EContact *contact, EVCardAttribute *attr)
 {
 	GList *values;
@@ -477,7 +477,7 @@ photo_getter (EContact *contact, EVCardAttribute *attr)
 
 			values = e_vcard_attribute_get_param (attr, EVC_TYPE);
 			if (values && values->data)
-				photo->data.inlined.mime_type = g_strdup_printf("image/%s", (char*)values->data);
+				photo->data.inlined.mime_type = g_strdup_printf("image/%s", (gchar *)values->data);
 			return photo;
 		}
 	}
@@ -494,10 +494,10 @@ photo_getter (EContact *contact, EVCardAttribute *attr)
 }
 
 static void
-photo_setter (EContact *contact, EVCardAttribute *attr, void *data)
+photo_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 {
 	EContactPhoto *photo = data;
-	char *image_type, *p;
+	gchar *image_type, *p;
 
 	switch (photo->type) {
 	case E_CONTACT_PHOTO_TYPE_INLINED:
@@ -515,7 +515,7 @@ photo_setter (EContact *contact, EVCardAttribute *attr, void *data)
 							e_vcard_attribute_param_new (EVC_TYPE),
 							image_type);
 
-		e_vcard_attribute_add_value_decoded (attr, (char*)photo->data.inlined.data, photo->data.inlined.length);
+		e_vcard_attribute_add_value_decoded (attr, (gchar *)photo->data.inlined.data, photo->data.inlined.length);
 		break;
 	case E_CONTACT_PHOTO_TYPE_URI:
 		e_vcard_attribute_add_param_with_value (attr,
@@ -530,7 +530,7 @@ photo_setter (EContact *contact, EVCardAttribute *attr, void *data)
 }
 
 
-static void*
+static gpointer
 fn_getter (EContact *contact, EVCardAttribute *attr)
 {
 	if (attr) {
@@ -543,7 +543,7 @@ fn_getter (EContact *contact, EVCardAttribute *attr)
 }
 
 static void
-fn_setter (EContact *contact, EVCardAttribute *attr, void *data)
+fn_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 {
 	gchar *name_str = data;
 
@@ -551,7 +551,7 @@ fn_setter (EContact *contact, EVCardAttribute *attr, void *data)
 
 	attr = e_contact_get_first_attr (contact, EVC_N);
 	if (!attr) {
-		EContactName *name = e_contact_name_from_string ((char*)data);
+		EContactName *name = e_contact_name_from_string ((gchar *)data);
 
 		attr = e_vcard_attribute_new (NULL, EVC_N);
 		e_vcard_add_attribute (E_VCARD (contact), attr);
@@ -565,12 +565,12 @@ fn_setter (EContact *contact, EVCardAttribute *attr, void *data)
 
 
 
-static void*
+static gpointer
 n_getter (EContact *contact, EVCardAttribute *attr)
 {
 	EContactName *name = g_new0 (EContactName, 1);
 	EVCardAttribute *new_attr;
-	char *name_str;
+	gchar *name_str;
 
 	if (attr) {
 		GList *p = e_vcard_attribute_get_values (attr);
@@ -595,7 +595,7 @@ n_getter (EContact *contact, EVCardAttribute *attr)
 }
 
 static void
-n_setter (EContact *contact, EVCardAttribute *attr, void *data)
+n_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 {
 	EContactName *name = data;
 
@@ -608,8 +608,8 @@ n_setter (EContact *contact, EVCardAttribute *attr, void *data)
 	/* now find the attribute for FileAs.  if it's not present, fill it in */
 	attr = e_contact_get_first_attr (contact, EVC_X_FILE_AS);
 	if (!attr) {
-		char *strings[3], **stringptr;
-		char *string;
+		gchar *strings[3], **stringptr;
+		gchar *string;
 		attr = e_vcard_attribute_new (NULL, EVC_X_FILE_AS);
 		e_vcard_add_attribute (E_VCARD (contact), attr);
 
@@ -629,7 +629,7 @@ n_setter (EContact *contact, EVCardAttribute *attr, void *data)
 
 
 
-static void*
+static gpointer
 adr_getter (EContact *contact, EVCardAttribute *attr)
 {
 	if (attr) {
@@ -652,7 +652,7 @@ adr_getter (EContact *contact, EVCardAttribute *attr)
 }
 
 static void
-adr_setter (EContact *contact, EVCardAttribute *attr, void *data)
+adr_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 {
 	EContactAddress *addr = data;
 
@@ -667,7 +667,7 @@ adr_setter (EContact *contact, EVCardAttribute *attr, void *data)
 
 
 
-static void*
+static gpointer
 date_getter (EContact *contact, EVCardAttribute *attr)
 {
 	if (attr) {
@@ -675,7 +675,7 @@ date_getter (EContact *contact, EVCardAttribute *attr)
 		EContactDate *date;
 
 		if (p && p->data && ((gchar *) p->data) [0])
-			date = e_contact_date_from_string ((char *) p->data);
+			date = e_contact_date_from_string ((gchar *) p->data);
 		else
 			date = NULL;
 
@@ -686,10 +686,10 @@ date_getter (EContact *contact, EVCardAttribute *attr)
 }
 
 static void
-date_setter (EContact *contact, EVCardAttribute *attr, void *data)
+date_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 {
 	EContactDate *date = data;
-	char *str;
+	gchar *str;
 
 	str = e_contact_date_to_string (date);
 
@@ -699,7 +699,7 @@ date_setter (EContact *contact, EVCardAttribute *attr, void *data)
 
 
 
-static void*
+static gpointer
 cert_getter (EContact *contact, EVCardAttribute *attr)
 {
 	if (attr) {
@@ -728,7 +728,7 @@ cert_getter (EContact *contact, EVCardAttribute *attr)
 }
 
 static void
-cert_setter (EContact *contact, EVCardAttribute *attr, void *data)
+cert_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 {
 	EContactCert *cert = data;
 
@@ -770,7 +770,7 @@ e_contact_set_property (GObject *object,
 		for (l = new_values; l; l = l->next)
 			e_vcard_add_attribute_with_value (E_VCARD (contact),
 							  e_vcard_attribute_new (NULL, info->vcard_field_name),
-							  (char*)l->data);
+							  (gchar *)l->data);
 	}
 	else if (info->t & E_CONTACT_FIELD_TYPE_SYNTHETIC) {
 		if (info->t & E_CONTACT_FIELD_TYPE_MULTI_ELEM) {
@@ -782,13 +782,13 @@ e_contact_set_property (GObject *object,
 			   dunno which is worse. */
 			EVCardAttribute *attr = NULL;
 			gboolean found = FALSE;
-			int num_left = info->list_elem;
+			gint num_left = info->list_elem;
 			GList *attrs = e_vcard_get_attributes (E_VCARD (contact));
 			GList *l;
-			const char *sval;
+			const gchar *sval;
 
 			for (l = attrs; l; l = l->next) {
-				const char *name;
+				const gchar *name;
 
 				attr = l->data;
 				name = e_vcard_attribute_get_name (attr);
@@ -837,12 +837,12 @@ e_contact_set_property (GObject *object,
 			   dunno which is worse. */
 			EVCardAttribute *attr = NULL;
 			gboolean found = FALSE;
-			int num_left = info->list_elem;
+			gint num_left = info->list_elem;
 			GList *attrs = e_vcard_get_attributes (E_VCARD (contact));
 			GList *l;
 
 			for (l = attrs; l && !found; l = l->next) {
-				const char *name;
+				const gchar *name;
 				gboolean found_needed1, found_needed2;
 
 				found_needed1 = (info->attr_type1 == NULL);
@@ -856,18 +856,18 @@ e_contact_set_property (GObject *object,
 
 					for (params = e_vcard_attribute_get_params (attr); params; params = params->next) {
 						EVCardAttributeParam *param = params->data;
-						const char *param_name = e_vcard_attribute_param_get_name (param);
+						const gchar *param_name = e_vcard_attribute_param_get_name (param);
 
 						if (!g_ascii_strcasecmp (param_name, EVC_TYPE)) {
 							gboolean matches = FALSE;
 							GList *values = e_vcard_attribute_param_get_values (param);
 
 							while (values && values->data) {
-								if (!found_needed1 && !g_ascii_strcasecmp ((char*)values->data, info->attr_type1)) {
+								if (!found_needed1 && !g_ascii_strcasecmp ((gchar *)values->data, info->attr_type1)) {
 									found_needed1 = TRUE;
 									matches = TRUE;
 								}
-								else if (!found_needed2 && !g_ascii_strcasecmp ((char*)values->data, info->attr_type2)) {
+								else if (!found_needed2 && !g_ascii_strcasecmp ((gchar *)values->data, info->attr_type2)) {
 									found_needed2 = TRUE;
 									matches = TRUE;
 								} else {
@@ -916,16 +916,16 @@ e_contact_set_property (GObject *object,
 			}
 
 			if (info->t & E_CONTACT_FIELD_TYPE_STRUCT || info->t & E_CONTACT_FIELD_TYPE_GETSET) {
-				void *data = info->t & E_CONTACT_FIELD_TYPE_STRUCT ? g_value_get_boxed (value) : (char*)g_value_get_string (value);
+				gpointer data = info->t & E_CONTACT_FIELD_TYPE_STRUCT ? g_value_get_boxed (value) : (gchar *)g_value_get_string (value);
 
 				if ((info->t & E_CONTACT_FIELD_TYPE_STRUCT && data)
-				    || (data && *(char*)data))
+				    || (data && *(gchar *)data))
 					info->struct_setter (contact, attr, data);
 				else
 					e_vcard_remove_attribute (E_VCARD (contact), attr);
 			}
 			else {
-				const char *sval = g_value_get_string (value);
+				const gchar *sval = g_value_get_string (value);
 
 				if (sval && *sval)
 					e_vcard_attribute_add_value (attr, sval);
@@ -937,7 +937,7 @@ e_contact_set_property (GObject *object,
 			EVCardAttribute *attr = e_contact_get_first_attr (contact, info->vcard_field_name);
 			GList *values;
 			GList *p;
-			const char *sval = g_value_get_string (value);
+			const gchar *sval = g_value_get_string (value);
 
 			if (!attr) {
 				if (!sval || !*sval)
@@ -958,7 +958,7 @@ e_contact_set_property (GObject *object,
 			}
 			else {
 				/* there weren't enough elements in the list, pad it */
-				int count = info->list_elem - g_list_length (values);
+				gint count = info->list_elem - g_list_length (values);
 
 				while (count--)
 					e_vcard_attribute_add_value (attr, "");
@@ -970,8 +970,8 @@ e_contact_set_property (GObject *object,
 			switch (info->field_id) {
 			case E_CONTACT_CATEGORIES: {
 				EVCardAttribute *attr = e_contact_get_first_attr (contact, EVC_CATEGORIES);
-				char **split, **s;
-				const char *str;
+				gchar **split, **s;
+				const gchar *str;
 
 				if (attr)
 					e_vcard_attribute_remove_values (attr);
@@ -1007,11 +1007,11 @@ e_contact_set_property (GObject *object,
 	}
 	else if (info->t & E_CONTACT_FIELD_TYPE_STRUCT || info->t & E_CONTACT_FIELD_TYPE_GETSET) {
 		EVCardAttribute *attr = e_contact_get_first_attr (contact, info->vcard_field_name);
-		void *data = info->t & E_CONTACT_FIELD_TYPE_STRUCT ? g_value_get_boxed (value) : (char*)g_value_get_string (value);
+		gpointer data = info->t & E_CONTACT_FIELD_TYPE_STRUCT ? g_value_get_boxed (value) : (gchar *)g_value_get_string (value);
 
 		if (attr) {
 			if ((info->t & E_CONTACT_FIELD_TYPE_STRUCT && data)
-			    || (data && *(char*)data)) {
+			    || (data && *(gchar *)data)) {
 				d(printf ("overwriting existing %s\n", info->vcard_field_name));
 				/* remove all existing values and parameters.
 				   the setter will add the correct ones */
@@ -1027,7 +1027,7 @@ e_contact_set_property (GObject *object,
 			}
 		}
 		else if ((info->t & E_CONTACT_FIELD_TYPE_STRUCT && data)
-			 || (data && *(char*)data)) {
+			 || (data && *(gchar *)data)) {
 			d(printf ("adding new %s\n", info->vcard_field_name));
 			attr = e_vcard_attribute_new (NULL, info->vcard_field_name);
 
@@ -1055,7 +1055,7 @@ e_contact_set_property (GObject *object,
 	}
 	else if (info->t & E_CONTACT_FIELD_TYPE_STRING) {
 		EVCardAttribute *attr;
-		const char *sval = g_value_get_string (value);
+		const gchar *sval = g_value_get_string (value);
 
 		/* first we search for an attribute we can overwrite */
 		attr = e_contact_get_first_attr (contact, info->vcard_field_name);
@@ -1107,7 +1107,7 @@ e_contact_set_property (GObject *object,
 }
 
 static EVCardAttribute *
-e_contact_find_attribute_with_types (EContact *contact, const char *attr_name, const char *type_needed1, const char *type_needed2, int nth)
+e_contact_find_attribute_with_types (EContact *contact, const gchar *attr_name, const gchar *type_needed1, const gchar *type_needed2, gint nth)
 {
 	GList *l, *attrs;
 	gboolean found_needed1, found_needed2;
@@ -1116,7 +1116,7 @@ e_contact_find_attribute_with_types (EContact *contact, const char *attr_name, c
 
 	for (l = attrs; l; l = l->next) {
 		EVCardAttribute *attr = l->data;
-		const char *name;
+		const gchar *name;
 
 		found_needed1 = (type_needed1 == NULL);
 		found_needed2 = (type_needed2 == NULL);
@@ -1128,18 +1128,18 @@ e_contact_find_attribute_with_types (EContact *contact, const char *attr_name, c
 
 			for (params = e_vcard_attribute_get_params (attr); params; params = params->next) {
 				EVCardAttributeParam *param = params->data;
-				const char *param_name = e_vcard_attribute_param_get_name (param);
+				const gchar *param_name = e_vcard_attribute_param_get_name (param);
 
 				if (!g_ascii_strcasecmp (param_name, EVC_TYPE)) {
 					gboolean matches = FALSE;
 					GList *values = e_vcard_attribute_param_get_values (param);
 
 					while (values && values->data) {
-						if (!found_needed1 && !g_ascii_strcasecmp ((char*)values->data, type_needed1)) {
+						if (!found_needed1 && !g_ascii_strcasecmp ((gchar *)values->data, type_needed1)) {
 							found_needed1 = TRUE;
 							matches = TRUE;
 						}
-						else if (!found_needed2 && !g_ascii_strcasecmp ((char*)values->data, type_needed2)) {
+						else if (!found_needed2 && !g_ascii_strcasecmp ((gchar *)values->data, type_needed2)) {
 							found_needed2 = TRUE;
 							matches = TRUE;
 						} else {
@@ -1234,7 +1234,7 @@ e_contact_new (void)
  * Return value: A new #EContact.
  **/
 EContact*
-e_contact_new_from_vcard  (const char *vcard)
+e_contact_new_from_vcard  (const gchar *vcard)
 {
 	EContact *contact;
 	const gchar *file_as;
@@ -1294,7 +1294,7 @@ e_contact_new_from_vcard  (const char *vcard)
 EContact*
 e_contact_duplicate (EContact *contact)
 {
-	char *vcard;
+	gchar *vcard;
 	EContact *c;
 
 	g_return_val_if_fail (E_IS_CONTACT (contact), NULL);
@@ -1314,7 +1314,7 @@ e_contact_duplicate (EContact *contact)
  *
  * Return value: The string representation of @field_id, or %NULL if it doesn't exist.
  **/
-const char *
+const gchar *
 e_contact_field_name (EContactField field_id)
 {
 	g_return_val_if_fail (field_id >= 1 && field_id <= E_CONTACT_FIELD_LAST, "");
@@ -1331,7 +1331,7 @@ e_contact_field_name (EContactField field_id)
  *
  * Return value: The human-readable representation of @field_id, or %NULL if it doesn't exist.
  **/
-const char *
+const gchar *
 e_contact_pretty_name (EContactField field_id)
 {
 	g_return_val_if_fail (field_id >= 1 && field_id <= E_CONTACT_FIELD_LAST, "");
@@ -1352,7 +1352,7 @@ e_contact_pretty_name (EContactField field_id)
  *
  * Return value: The vcard attribute corresponding to @field_id, or %NULL if it doesn't exist.
  **/
-const char*
+const gchar *
 e_contact_vcard_attribute  (EContactField field_id)
 {
 	g_return_val_if_fail (field_id >= 1 && field_id <= E_CONTACT_FIELD_LAST, "");
@@ -1369,9 +1369,9 @@ e_contact_vcard_attribute  (EContactField field_id)
  * Return value: An #EContactField corresponding to @field_name, or %0 if it doesn't exist.
  **/
 EContactField
-e_contact_field_id (const char *field_name)
+e_contact_field_id (const gchar *field_name)
 {
-	int i;
+	gint i;
 	for (i = E_CONTACT_FIELD_FIRST; i < E_CONTACT_FIELD_LAST; i ++) {
 		if (!g_ascii_strcasecmp (field_info[i].field_name, field_name))
 			return field_info[i].field_id;
@@ -1390,9 +1390,9 @@ e_contact_field_id (const char *field_name)
  * Return value: An #EContactField corresponding to @vcard_field, or %0 if it doesn't exist.
  **/
 EContactField
-e_contact_field_id_from_vcard (const char *vcard_field)
+e_contact_field_id_from_vcard (const gchar *vcard_field)
 {
-	int i;
+	gint i;
 
 	for (i = E_CONTACT_FIELD_FIRST; i < E_CONTACT_FIELD_LAST; i ++) {
 		if (field_info[i].vcard_field_name == NULL)
@@ -1432,7 +1432,7 @@ e_contact_get (EContact *contact, EContactField field_id)
 
 		if (attr) {
 			GList *v = e_vcard_attribute_get_values (attr);
-			rv = v && v->data && !g_ascii_strcasecmp ((char*)v->data, "true");
+			rv = v && v->data && !g_ascii_strcasecmp ((gchar *)v->data, "true");
 			return rv ? "1" : NULL;
 		}
 	}
@@ -1464,13 +1464,13 @@ e_contact_get (EContact *contact, EContactField field_id)
 	else if (info->t & E_CONTACT_FIELD_TYPE_MULTI_ELEM) {
 		if (info->t & E_CONTACT_FIELD_TYPE_STRING) {
 			GList *attrs, *l;
-			int num_left = info->list_elem;
+			gint num_left = info->list_elem;
 
 			attrs = e_vcard_get_attributes (E_VCARD (contact));
 
 			for (l = attrs; l; l = l->next) {
 				EVCardAttribute *attr = l->data;
-				const char *name;
+				const gchar *name;
 
 				name = e_vcard_attribute_get_name (attr);
 
@@ -1508,7 +1508,7 @@ e_contact_get (EContact *contact, EContactField field_id)
 	}
 	else if (info->t & E_CONTACT_FIELD_TYPE_GETSET) {
 		EVCardAttribute *attr = e_contact_get_first_attr (contact, info->vcard_field_name);
-		void *rv = NULL;
+		gpointer rv = NULL;
 
 		if (attr)
 			rv = info->struct_getter (contact, attr);
@@ -1521,7 +1521,7 @@ e_contact_get (EContact *contact, EContactField field_id)
 	else if (info->t & E_CONTACT_FIELD_TYPE_SYNTHETIC) {
 		switch (info->field_id) {
 		case E_CONTACT_NAME_OR_ORG: {
-			const char *str;
+			const gchar *str;
 
 			str = e_contact_get_const (contact, E_CONTACT_FILE_AS);
 			if (!str)
@@ -1541,13 +1541,13 @@ e_contact_get (EContact *contact, EContactField field_id)
 		}
 		case E_CONTACT_CATEGORIES: {
 			EVCardAttribute *attr = e_contact_get_first_attr (contact, EVC_CATEGORIES);
-			char *rv = NULL;
+			gchar *rv = NULL;
 
 			if (attr) {
 				GString *str = g_string_new ("");
 				GList *v = e_vcard_attribute_get_values (attr);
 				while (v) {
-					g_string_append (str, (char*)v->data);
+					g_string_append (str, (gchar *)v->data);
 					v = v->next;
 					if (v)
 						g_string_append_c (str, ',');
@@ -1571,7 +1571,7 @@ e_contact_get (EContact *contact, EContactField field_id)
 
 		for (l = attrs; l; l = l->next) {
 			EVCardAttribute *attr = l->data;
-			const char *name;
+			const gchar *name;
 
 			name = e_vcard_attribute_get_name (attr);
 
@@ -1630,7 +1630,7 @@ e_contact_get_const (EContact *contact, EContactField field_id)
  * Sets the value of @contact's field specified by @field_id to @value.
  **/
 void
-e_contact_set (EContact *contact, EContactField field_id, const gpointer value)
+e_contact_set (EContact *contact, EContactField field_id, gconstpointer value)
 {
 	d(printf ("e_contact_set (%p, %d, %p)\n", contact, field_id, value));
 
@@ -1671,7 +1671,7 @@ e_contact_get_attributes (EContact *contact, EContactField field_id)
 
 	for (a = attrs; a; a = a->next) {
 		EVCardAttribute *attr = a->data;
-		const char *name;
+		const gchar *name;
 
 		name = e_vcard_attribute_get_name (attr);
 
@@ -1730,10 +1730,10 @@ e_contact_name_new (void)
  *
  * Return value: The string representation of @name.
  **/
-char *
+gchar *
 e_contact_name_to_string(const EContactName *name)
 {
-	char *strings[6], **stringptr = strings;
+	gchar *strings[6], **stringptr = strings;
 
 	g_return_val_if_fail (name != NULL, NULL);
 
@@ -1760,7 +1760,7 @@ e_contact_name_to_string(const EContactName *name)
  * Return value: A new #EContactName struct.
  **/
 EContactName*
-e_contact_name_from_string (const char *name_str)
+e_contact_name_from_string (const gchar *name_str)
 {
 	EContactName *name = e_contact_name_new();
 	ENameWestern *western;
@@ -1848,11 +1848,11 @@ e_contact_name_get_type (void)
  * Return value: A new #EContactDate struct.
  **/
 EContactDate*
-e_contact_date_from_string (const char *str)
+e_contact_date_from_string (const gchar *str)
 {
 	EContactDate* date;
-	int length;
-	char *t;
+	gint length;
+	gchar *t;
 
 	g_return_val_if_fail (str != NULL, NULL);
 
@@ -1885,7 +1885,7 @@ e_contact_date_from_string (const char *str)
  *
  * Return value: A date string, owned by the caller.
  **/
-char *
+gchar *
 e_contact_date_to_string (EContactDate *dt)
 {
 	if (dt)
diff --git a/addressbook/libebook/e-contact.h b/addressbook/libebook/e-contact.h
index ed9ebeb..e7484c7 100644
--- a/addressbook/libebook/e-contact.h
+++ b/addressbook/libebook/e-contact.h
@@ -226,11 +226,11 @@ typedef enum {
 } EContactField;
 
 typedef struct {
-	char *family;
-	char *given;
-	char *additional;
-	char *prefixes;
-	char *suffixes;
+	gchar *family;
+	gchar *given;
+	gchar *additional;
+	gchar *prefixes;
+	gchar *suffixes;
 } EContactName;
 
 typedef struct {
@@ -247,36 +247,36 @@ typedef struct {
 	EContactPhotoType type;
 	union {
 		struct {
-			char *mime_type;
+			gchar *mime_type;
 			gsize length;
 			guchar *data;
 		} inlined;
-		char *uri;
+		gchar *uri;
 	} data;
 } EContactPhoto;
 
 typedef struct {
-	char *address_format; /* the two letter country code that
+	gchar *address_format; /* the two letter country code that
 				 determines the format/meaning of the
 				 following fields */
-	char *po;
-	char *ext;
-	char *street;
-	char *locality;
-	char *region;
-	char *code;
-	char *country;
+	gchar *po;
+	gchar *ext;
+	gchar *street;
+	gchar *locality;
+	gchar *region;
+	gchar *code;
+	gchar *country;
 } EContactAddress;
 
 typedef struct {
-	unsigned int year;
-	unsigned int month;
-	unsigned int day;
+	guint year;
+	guint month;
+	guint day;
 } EContactDate;
 
 typedef struct {
 	gsize length;
-	char *data;
+	gchar *data;
 } EContactCert;
 
 struct _EContact {
@@ -299,13 +299,13 @@ struct _EContactClass {
 GType                   e_contact_get_type (void);
 
 EContact*               e_contact_new              (void);
-EContact*               e_contact_new_from_vcard   (const char *vcard);
+EContact*               e_contact_new_from_vcard   (const gchar *vcard);
 
 EContact*               e_contact_duplicate        (EContact *contact);
 
 gpointer                e_contact_get              (EContact *contact, EContactField field_id);
 gconstpointer		e_contact_get_const        (EContact *contact, EContactField field_id);
-void                    e_contact_set              (EContact *contact, EContactField field_id, const gpointer value);
+void                    e_contact_set              (EContact *contact, EContactField field_id, gconstpointer value);
 
 /* the following two calls return and take a GList of
    EVCardAttribute*'s. */
@@ -315,16 +315,16 @@ void                    e_contact_set_attributes   (EContact *contact, EContactF
 /* misc functions for structured values */
 GType                   e_contact_date_get_type    (void);
 EContactDate           *e_contact_date_new         (void);
-EContactDate           *e_contact_date_from_string (const char *str);
-char                   *e_contact_date_to_string   (EContactDate *dt);
+EContactDate           *e_contact_date_from_string (const gchar *str);
+gchar                   *e_contact_date_to_string   (EContactDate *dt);
 gboolean                e_contact_date_equal       (EContactDate *dt1,
 						    EContactDate *dt2);
 void                    e_contact_date_free        (EContactDate *date);
 
 GType                   e_contact_name_get_type    (void);
 EContactName           *e_contact_name_new         (void);
-char                   *e_contact_name_to_string   (const EContactName *name);
-EContactName           *e_contact_name_from_string (const char *name_str);
+gchar                   *e_contact_name_to_string   (const EContactName *name);
+EContactName           *e_contact_name_from_string (const gchar *name_str);
 EContactName           *e_contact_name_copy        (EContactName *n);
 void                    e_contact_name_free        (EContactName *name);
 
@@ -342,11 +342,11 @@ GType                   e_contact_address_get_type (void);
 void                    e_contact_address_free     (EContactAddress *address);
 
 
-const char*             e_contact_field_name       (EContactField field_id);
-const char*             e_contact_pretty_name      (EContactField field_id);
-const char*             e_contact_vcard_attribute  (EContactField field_id);
-EContactField           e_contact_field_id         (const char *field_name);
-EContactField           e_contact_field_id_from_vcard (const char *vcard_field);
+const gchar *             e_contact_field_name       (EContactField field_id);
+const gchar *             e_contact_pretty_name      (EContactField field_id);
+const gchar *             e_contact_vcard_attribute  (EContactField field_id);
+EContactField           e_contact_field_id         (const gchar *field_name);
+EContactField           e_contact_field_id_from_vcard (const gchar *vcard_field);
 
 G_END_DECLS
 
diff --git a/addressbook/libebook/e-destination.c b/addressbook/libebook/e-destination.c
index ec298ec..8307dda 100644
--- a/addressbook/libebook/e-destination.c
+++ b/addressbook/libebook/e-destination.c
@@ -51,17 +51,17 @@
 struct _EDestinationPrivate {
 	gchar *raw;
 
-	char *source_uid;
+	gchar *source_uid;
 
 	EContact *contact;
-	char *contact_uid;
+	gchar *contact_uid;
 
-	int email_num;
+	gint email_num;
 
-	char *name;
-	char *email;
-	char *addr;
-	char *textrep;
+	gchar *name;
+	gchar *email;
+	gchar *addr;
+	gchar *textrep;
 	gboolean ignored;
 
 	GList *list_dests;
@@ -274,7 +274,7 @@ e_destination_clear (EDestination *dest)
 }
 
 static gboolean
-nonempty (const char *s)
+nonempty (const gchar *s)
 {
 	gunichar c;
 	if (s == NULL)
@@ -329,7 +329,7 @@ gboolean
 e_destination_equal (const EDestination *a, const EDestination *b)
 {
 	const struct _EDestinationPrivate *pa, *pb;
-	const char *na, *nb;
+	const gchar *na, *nb;
 
 	g_return_val_if_fail (E_IS_DESTINATION (a), FALSE);
 	g_return_val_if_fail (E_IS_DESTINATION (b), FALSE);
@@ -403,14 +403,14 @@ e_destination_set_contact (EDestination *dest, EContact *contact, gint email_num
 					EVCardAttribute *attr = iter->data;
 					GList *p;
 					EDestination *list_dest = e_destination_new ();
-					char *contact_uid = NULL;
-					char *value;
-					int email_num = -1;
+					gchar *contact_uid = NULL;
+					gchar *value;
+					gint email_num = -1;
 					gboolean html_pref = FALSE;
 
 					for (p = e_vcard_attribute_get_params (attr); p; p = p->next) {
 						EVCardAttributeParam *param = p->data;
-						const char *param_name = e_vcard_attribute_param_get_name (param);
+						const gchar *param_name = e_vcard_attribute_param_get_name (param);
 						if (!g_ascii_strcasecmp (param_name,
 									 EVC_X_DEST_CONTACT_UID)) {
 							GList *v = e_vcard_attribute_param_get_values (param);
@@ -502,7 +502,7 @@ e_destination_set_book (EDestination *dest, EBook *book)
  * addresses indicated by @email_num.
  **/
 void
-e_destination_set_contact_uid (EDestination *dest, const char *uid, gint email_num)
+e_destination_set_contact_uid (EDestination *dest, const gchar *uid, gint email_num)
 {
 	g_return_if_fail (dest && E_IS_DESTINATION (dest));
 	g_return_if_fail (uid != NULL);
@@ -528,7 +528,7 @@ e_destination_set_contact_uid (EDestination *dest, const char *uid, gint email_n
 }
 
 static void
-e_destination_set_source_uid (EDestination *dest, const char *uid)
+e_destination_set_source_uid (EDestination *dest, const gchar *uid)
 {
 	g_return_if_fail (dest && E_IS_DESTINATION (dest));
 	g_return_if_fail (uid != NULL);
@@ -551,7 +551,7 @@ e_destination_set_source_uid (EDestination *dest, const char *uid)
  * Sets the full name of @dest's addressee.
  **/
 void
-e_destination_set_name (EDestination *dest, const char *name)
+e_destination_set_name (EDestination *dest, const gchar *name)
 {
 	gboolean changed = FALSE;
 
@@ -587,7 +587,7 @@ e_destination_set_name (EDestination *dest, const char *name)
  * Sets the e-mail address of @dest's addressee.
  **/
 void
-e_destination_set_email (EDestination *dest, const char *email)
+e_destination_set_email (EDestination *dest, const gchar *email)
 {
 	gboolean changed = FALSE;
 
@@ -683,7 +683,7 @@ e_destination_get_contact (const EDestination *dest)
  *
  * Return value: A unique contact ID, or %NULL if none was set.
  */
-const char *
+const gchar *
 e_destination_get_contact_uid (const EDestination *dest)
 {
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
@@ -700,7 +700,7 @@ e_destination_get_contact_uid (const EDestination *dest)
  *
  * Return value: A unique source ID, or %NULL if none was set.
  */
-const char *
+const gchar *
 e_destination_get_source_uid (const EDestination *dest)
 {
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
@@ -737,7 +737,7 @@ e_destination_get_email_num (const EDestination *dest)
  *
  * Return value: The full name of the addressee, or %NULL if none was set.
  **/
-const char *
+const gchar *
 e_destination_get_name (const EDestination *dest)
 {
 	struct _EDestinationPrivate *priv;
@@ -767,7 +767,7 @@ e_destination_get_name (const EDestination *dest)
 			CamelInternetAddress *addr = camel_internet_address_new ();
 
 			if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
-				const char *camel_name = NULL;
+				const gchar *camel_name = NULL;
 
 				camel_internet_address_get (addr, 0, &camel_name, NULL);
 				priv->name = g_strdup (camel_name);
@@ -815,7 +815,7 @@ e_destination_set_ignored (EDestination *dest, gboolean ignored)
  *
  * Return value: An e-mail address, or an empty string if none was set.
  **/
-const char *
+const gchar *
 e_destination_get_email (const EDestination *dest)
 {
 	struct _EDestinationPrivate *priv;
@@ -829,7 +829,7 @@ e_destination_get_email (const EDestination *dest)
 			/* Pull the address out of the card. */
 			GList *email = e_contact_get (priv->contact, E_CONTACT_EMAIL);
 			if (email) {
-				char *e = g_list_nth_data (email, priv->email_num);
+				gchar *e = g_list_nth_data (email, priv->email_num);
 
 				if (e)
 					priv->email = g_strdup (e);
@@ -843,7 +843,7 @@ e_destination_get_email (const EDestination *dest)
 			CamelInternetAddress *addr = camel_internet_address_new ();
 
 			if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
-				const char *camel_email = NULL;
+				const gchar *camel_email = NULL;
 				camel_internet_address_get (addr, 0, NULL, &camel_email);
 				priv->email = g_strdup (camel_email);
 			}
@@ -869,7 +869,7 @@ e_destination_get_email (const EDestination *dest)
  *
  * Return value: A formatted destination string, or %NULL if the destination was empty.
  **/
-const char *
+const gchar *
 e_destination_get_address (const EDestination *dest)
 {
 	struct _EDestinationPrivate *priv;
@@ -888,7 +888,7 @@ e_destination_get_address (const EDestination *dest)
 				EDestination *list_dest = E_DESTINATION (iter->data);
 
 				if (!e_destination_empty (list_dest) && !list_dest->priv->ignored) {
-					const char *name, *email;
+					const gchar *name, *email;
 					name = e_destination_get_name (list_dest);
 					email = e_destination_get_email (list_dest);
 
@@ -910,7 +910,7 @@ e_destination_get_address (const EDestination *dest)
 				priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
 			}
 		} else {
-			const char *name, *email;
+			const gchar *name, *email;
 			name = e_destination_get_name (dest);
 			email = e_destination_get_email (dest);
 
@@ -940,7 +940,7 @@ e_destination_get_address (const EDestination *dest)
  * parsing the supplied string. Useful for user input.
  **/
 void
-e_destination_set_raw (EDestination *dest, const char *raw)
+e_destination_set_raw (EDestination *dest, const gchar *raw)
 {
 	g_return_if_fail (E_IS_DESTINATION (dest));
 	g_return_if_fail (raw != NULL);
@@ -964,10 +964,10 @@ e_destination_set_raw (EDestination *dest, const char *raw)
  *
  * Return value: A textual representation of the destination.
  **/
-const char *
+const gchar *
 e_destination_get_textrep (const EDestination *dest, gboolean include_email)
 {
-	const char *name, *email;
+	const gchar *name, *email;
 
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
 
@@ -1107,12 +1107,12 @@ e_destination_set_html_mail_pref (EDestination *dest, gboolean flag)
  *
  * Return value: The text representation of @destv.
  **/
-char *
+gchar *
 e_destination_get_textrepv (EDestination **destv)
 {
-	int i, j, len = 0;
-	char **strv;
-	char *str;
+	gint i, j, len = 0;
+	gchar **strv;
+	gchar *str;
 
 	g_return_val_if_fail (destv, NULL);
 
@@ -1128,11 +1128,11 @@ e_destination_get_textrepv (EDestination **destv)
 		len++;
 	}
 
-	strv = g_new0 (char *, len + 1);
+	strv = g_new0 (gchar *, len + 1);
 	for (i = 0, j = 0; destv[i]; i++) {
 		if (!e_destination_empty (destv[i])) {
-			const char *addr = e_destination_get_address (destv[i]);
-			strv[j++] = addr ? (char *) addr : "";
+			const gchar *addr = e_destination_get_address (destv[i]);
+			strv[j++] = addr ? (gchar *) addr : "";
 		}
 	}
 
@@ -1155,7 +1155,7 @@ xmlNodePtr
 e_destination_xml_encode (const EDestination *dest)
 {
 	xmlNodePtr dest_node;
-	const char *str;
+	const gchar *str;
 
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
 
@@ -1209,7 +1209,7 @@ e_destination_xml_encode (const EDestination *dest)
 
 	str = e_destination_get_contact_uid (dest);
 	if (str) {
-		char buf[16];
+		gchar buf[16];
 
 		xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, (xmlChar*)"card_uid", (xmlChar*)str);
 		g_snprintf (buf, 16, "%d", e_destination_get_email_num (dest));
@@ -1237,38 +1237,38 @@ e_destination_xml_encode (const EDestination *dest)
 gboolean
 e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 {
-	char *name = NULL, *email = NULL, *source_uid = NULL, *card_uid = NULL;
+	gchar *name = NULL, *email = NULL, *source_uid = NULL, *card_uid = NULL;
 	gboolean is_list = FALSE, show_addr = FALSE, auto_recip = FALSE;
 	gboolean html_mail = FALSE;
 	GList *list_dests = NULL;
-	int email_num = -1;
-	char *tmp;
+	gint email_num = -1;
+	gchar *tmp;
 
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
 	g_return_val_if_fail (node != NULL, FALSE);
 
-	if (strcmp ((char*)node->name, "destination"))
+	if (strcmp ((gchar *)node->name, "destination"))
 		return FALSE;
 
-	tmp = (char*)xmlGetProp (node, (xmlChar*)"html_mail");
+	tmp = (gchar *)xmlGetProp (node, (xmlChar*)"html_mail");
 	if (tmp) {
 		html_mail = !strcmp (tmp, "yes");
 		xmlFree (tmp);
 	}
 
-	tmp = (char*)xmlGetProp (node, (xmlChar*)"is_list");
+	tmp = (gchar *)xmlGetProp (node, (xmlChar*)"is_list");
 	if (tmp) {
 		is_list = !strcmp (tmp, "yes");
 		xmlFree (tmp);
 	}
 
-	tmp = (char*)xmlGetProp (node, (xmlChar*)"show_addresses");
+	tmp = (gchar *)xmlGetProp (node, (xmlChar*)"show_addresses");
 	if (tmp) {
 		show_addr = !strcmp (tmp, "yes");
 		xmlFree (tmp);
 	}
 
-	tmp = (char*)xmlGetProp (node, (xmlChar*)"auto_recipient");
+	tmp = (gchar *)xmlGetProp (node, (xmlChar*)"auto_recipient");
 	if (tmp) {
 		auto_recip = !strcmp (tmp, "yes");
 		xmlFree (tmp);
@@ -1276,28 +1276,28 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 
 	node = node->xmlChildrenNode;
 	while (node) {
-		if (!strcmp ((char*)node->name, "name")) {
-			tmp = (char*)xmlNodeGetContent (node);
+		if (!strcmp ((gchar *)node->name, "name")) {
+			tmp = (gchar *)xmlNodeGetContent (node);
 			g_free (name);
 			name = g_strdup (tmp);
 			xmlFree (tmp);
-		} else if (!is_list && !strcmp ((char*)node->name, "email")) {
-			tmp = (char*)xmlNodeGetContent (node);
+		} else if (!is_list && !strcmp ((gchar *)node->name, "email")) {
+			tmp = (gchar *)xmlNodeGetContent (node);
 			g_free (email);
 			email = g_strdup (tmp);
 			xmlFree (tmp);
-		} else if (is_list && !strcmp ((char*)node->name, "list_entry")) {
+		} else if (is_list && !strcmp ((gchar *)node->name, "list_entry")) {
 			xmlNodePtr subnode = node->xmlChildrenNode;
-			char *list_name = NULL, *list_email = NULL;
+			gchar *list_name = NULL, *list_email = NULL;
 
 			while (subnode) {
-				if (!strcmp ((char*)subnode->name, "name")) {
-					tmp = (char*)xmlNodeGetContent (subnode);
+				if (!strcmp ((gchar *)subnode->name, "name")) {
+					tmp = (gchar *)xmlNodeGetContent (subnode);
 					g_free (list_name);
 					list_name = g_strdup (tmp);
 					xmlFree (tmp);
-				} else if (!strcmp ((char*)subnode->name, "email")) {
-					tmp = (char*)xmlNodeGetContent (subnode);
+				} else if (!strcmp ((gchar *)subnode->name, "email")) {
+					tmp = (gchar *)xmlNodeGetContent (subnode);
 					g_free (list_email);
 					list_email = g_strdup (tmp);
 					xmlFree (tmp);
@@ -1319,18 +1319,18 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 
 				list_dests = g_list_append (list_dests, list_dest);
 			}
-		} else if (!strcmp ((char*)node->name, "source_uid")) {
-			tmp = (char*)xmlNodeGetContent (node);
+		} else if (!strcmp ((gchar *)node->name, "source_uid")) {
+			tmp = (gchar *)xmlNodeGetContent (node);
 			g_free (source_uid);
 			source_uid = g_strdup (tmp);
 			xmlFree (tmp);
-		} else if (!strcmp ((char*)node->name, "card_uid")) {
-			tmp = (char*)xmlNodeGetContent (node);
+		} else if (!strcmp ((gchar *)node->name, "card_uid")) {
+			tmp = (gchar *)xmlNodeGetContent (node);
 			g_free (card_uid);
 			card_uid = g_strdup (tmp);
 			xmlFree (tmp);
 
-			tmp = (char*)xmlGetProp (node, (xmlChar*)"email_num");
+			tmp = (gchar *)xmlGetProp (node, (xmlChar*)"email_num");
 			email_num = atoi (tmp);
 			xmlFree (tmp);
 		}
@@ -1369,16 +1369,16 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 	return TRUE;
 }
 
-static char *
+static gchar *
 null_terminate_and_remove_extra_whitespace (xmlChar *xml_in, gint size)
 {
 	gboolean skip_white = FALSE;
-	char *xml, *r, *w;
+	gchar *xml, *r, *w;
 
 	if (xml_in == NULL || size <= 0)
 		return NULL;
 
-	xml = g_strndup ((char*)xml_in, size);
+	xml = g_strndup ((gchar *)xml_in, size);
 	r = w = xml;
 
 	while (*r) {
@@ -1411,14 +1411,14 @@ null_terminate_and_remove_extra_whitespace (xmlChar *xml_in, gint size)
  *
  * Return value: An XML string, allocated with g_malloc.
  **/
-char *
+gchar *
 e_destination_export (const EDestination *dest)
 {
 	xmlNodePtr dest_node;
 	xmlDocPtr dest_doc;
 	xmlChar *buffer = NULL;
-	int size = -1;
-	char *str;
+	gint size = -1;
+	gchar *str;
 
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
 
@@ -1447,7 +1447,7 @@ e_destination_export (const EDestination *dest)
  * Return value: An #EDestination, or %NULL if the document was not well-formed.
  **/
 EDestination *
-e_destination_import (const char *str)
+e_destination_import (const gchar *str)
 {
 	EDestination *dest = NULL;
 	xmlDocPtr dest_doc;
@@ -1455,7 +1455,7 @@ e_destination_import (const char *str)
 	if (!(str && *str))
 		return NULL;
 
-	dest_doc = xmlParseMemory ((char *) str, strlen (str));
+	dest_doc = xmlParseMemory ((gchar *) str, strlen (str));
 	if (dest_doc && dest_doc->xmlRootNode) {
 		dest = e_destination_new ();
 		if (! e_destination_xml_decode (dest, dest_doc->xmlRootNode)) {
@@ -1476,14 +1476,14 @@ e_destination_import (const char *str)
  *
  * Return value: An XML string, allocated with g_malloc.
  **/
-char *
+gchar *
 e_destination_exportv (EDestination **destv)
 {
 	xmlDocPtr destv_doc;
 	xmlNodePtr destv_node;
 	xmlChar *buffer = NULL;
-	int i, size = -1;
-	char *str;
+	gint i, size = -1;
+	gchar *str;
 
 	if (destv == NULL || *destv == NULL)
 		return NULL;
@@ -1519,7 +1519,7 @@ e_destination_exportv (EDestination **destv)
  * Return value: A %NULL-terminated array of pointers to #EDestination elements.
  **/
 EDestination **
-e_destination_importv (const char *str)
+e_destination_importv (const gchar *str)
 {
 	GPtrArray *dest_array = NULL;
 	xmlDocPtr destv_doc;
@@ -1529,13 +1529,13 @@ e_destination_importv (const char *str)
 	if (!(str && *str))
 		return NULL;
 
-	destv_doc = xmlParseMemory ((char *)str, strlen (str));
+	destv_doc = xmlParseMemory ((gchar *)str, strlen (str));
 	if (destv_doc == NULL)
 		return NULL;
 
 	node = destv_doc->xmlRootNode;
 
-	if (strcmp ((char*)node->name, "destinations"))
+	if (strcmp ((gchar *)node->name, "destinations"))
 		goto finished;
 
 	node = node->xmlChildrenNode;
@@ -1576,7 +1576,7 @@ e_destination_importv (const char *str)
 void
 e_destination_freev (EDestination **destv)
 {
-	int i;
+	gint i;
 
 	if (destv) {
 		for (i = 0; destv[i] != NULL; ++i) {
@@ -1610,7 +1610,7 @@ e_destination_export_to_vcard_attribute (EDestination *dest, EVCardAttribute *at
 							e_vcard_attribute_param_new (EVC_X_DEST_SOURCE_UID),
 							e_destination_get_source_uid (dest));
 	if (-1 != e_destination_get_email_num (dest)) {
-		char buf[10];
+		gchar buf[10];
 		g_snprintf (buf, sizeof (buf), "%d", e_destination_get_email_num (dest));
 		e_vcard_attribute_add_param_with_value (attr,
 							e_vcard_attribute_param_new (EVC_X_DEST_EMAIL_NUM),
diff --git a/addressbook/libebook/e-destination.h b/addressbook/libebook/e-destination.h
index d823cce..ea41335 100644
--- a/addressbook/libebook/e-destination.h
+++ b/addressbook/libebook/e-destination.h
@@ -75,20 +75,20 @@ gboolean       e_destination_empty              (const EDestination *dest);
 gboolean       e_destination_equal              (const EDestination *a, const EDestination *b);
 
 /* for use with EDestinations that wrap a particular contact */
-void           e_destination_set_contact        (EDestination *dest, EContact *contact, int email_num);
-void           e_destination_set_contact_uid    (EDestination *dest, const char *uid, gint email_num);
+void           e_destination_set_contact        (EDestination *dest, EContact *contact, gint email_num);
+void           e_destination_set_contact_uid    (EDestination *dest, const gchar *uid, gint email_num);
 void           e_destination_set_book           (EDestination *dest, EBook *book);
 EContact      *e_destination_get_contact        (const EDestination *dest);
-const char    *e_destination_get_source_uid     (const EDestination *dest);
-const char    *e_destination_get_contact_uid    (const EDestination *dest);
-int            e_destination_get_email_num      (const EDestination *dest);
+const gchar    *e_destination_get_source_uid     (const EDestination *dest);
+const gchar    *e_destination_get_contact_uid    (const EDestination *dest);
+gint            e_destination_get_email_num      (const EDestination *dest);
 
 /* for use with EDestinations built up from strings (not corresponding to contacts in a user's address books) */
-void           e_destination_set_name           (EDestination *dest, const char *name);
-void           e_destination_set_email          (EDestination *dest, const char *email);
-const char    *e_destination_get_name           (const EDestination *dest);  /* "Jane Smith" */
-const char    *e_destination_get_email          (const EDestination *dest);  /* "jane assbarn com" */
-const char    *e_destination_get_address        (const EDestination *dest);  /* "Jane Smith <jane assbarn com>" (or a comma-sep set of such for a list) */
+void           e_destination_set_name           (EDestination *dest, const gchar *name);
+void           e_destination_set_email          (EDestination *dest, const gchar *email);
+const gchar    *e_destination_get_name           (const EDestination *dest);  /* "Jane Smith" */
+const gchar    *e_destination_get_email          (const EDestination *dest);  /* "jane assbarn com" */
+const gchar    *e_destination_get_address        (const EDestination *dest);  /* "Jane Smith <jane assbarn com>" (or a comma-sep set of such for a list) */
 
 gboolean       e_destination_is_evolution_list   (const EDestination *dest);
 gboolean       e_destination_list_show_addresses (const EDestination *dest);
@@ -108,17 +108,17 @@ gboolean       e_destination_is_auto_recipient  (const EDestination *dest);
 void           e_destination_set_auto_recipient (EDestination *dest, gboolean value);
 
 /* parse out an EDestination (name/email, not contact) from a free form string. */
-void           e_destination_set_raw            (EDestination *dest, const char *raw);
+void           e_destination_set_raw            (EDestination *dest, const gchar *raw);
 
 /* generate a plain-text representation of an EDestination* or EDestination** */
-const char    *e_destination_get_textrep        (const EDestination *dest, gboolean include_email);  /* "Jane Smith" or "jane assbarn com" */
-char          *e_destination_get_textrepv       (EDestination **destv);
+const gchar    *e_destination_get_textrep        (const EDestination *dest, gboolean include_email);  /* "Jane Smith" or "jane assbarn com" */
+gchar          *e_destination_get_textrepv       (EDestination **destv);
 
 /* XML export/import routines. */
-char          *e_destination_export             (const EDestination *dest);
-char          *e_destination_exportv            (EDestination **destv);
-EDestination  *e_destination_import             (const char *str);
-EDestination **e_destination_importv            (const char *str);
+gchar          *e_destination_export             (const EDestination *dest);
+gchar          *e_destination_exportv            (EDestination **destv);
+EDestination  *e_destination_import             (const gchar *str);
+EDestination **e_destination_importv            (const gchar *str);
 
 /* EVCard "export" routines */
 void          e_destination_export_to_vcard_attribute   (EDestination *dest, EVCardAttribute *attr);
diff --git a/addressbook/libebook/e-name-western-tables.h b/addressbook/libebook/e-name-western-tables.h
index 52b8c50..18453b4 100644
--- a/addressbook/libebook/e-name-western-tables.h
+++ b/addressbook/libebook/e-name-western-tables.h
@@ -1,5 +1,5 @@
 /* This file is generated by gen-western-table.py. DO NOT EDIT */
-static const char western_pfx_table[] = {
+static const gchar western_pfx_table[] = {
   "mister\0"
   "miss.\0"
   "mr.\0"
@@ -198,7 +198,7 @@ static const guint western_pfx_index[] = {
   772,
 };
 
-static const char western_sfx_table[] = {
+static const gchar western_sfx_table[] = {
   "junior\0"
   "senior\0"
   "jr\0"
@@ -273,7 +273,7 @@ static const guint western_sfx_index[] = {
   133,
 };
 
-static const char western_complex_last_table[] = {
+static const gchar western_complex_last_table[] = {
   "van\0"
   "von\0"
   "de\0"
diff --git a/addressbook/libebook/e-name-western.c b/addressbook/libebook/e-name-western.c
index be4ef0f..cb046df 100644
--- a/addressbook/libebook/e-name-western.c
+++ b/addressbook/libebook/e-name-western.c
@@ -19,19 +19,19 @@
 #include "e-name-western-tables.h"
 
 typedef struct {
-	int prefix_idx;
-	int first_idx;
-	int middle_idx;
-	int nick_idx;
-	int last_idx;
-	int suffix_idx;
+	gint prefix_idx;
+	gint first_idx;
+	gint middle_idx;
+	gint nick_idx;
+	gint last_idx;
+	gint suffix_idx;
 } ENameWesternIdxs;
 
 static int
-e_name_western_str_count_words (const char *str)
+e_name_western_str_count_words (const gchar *str)
 {
-	int word_count;
-	const char *p;
+	gint word_count;
+	const gchar *p;
 
 	word_count = 0;
 
@@ -44,10 +44,10 @@ e_name_western_str_count_words (const char *str)
 }
 
 static void
-e_name_western_cleanup_string (char **str)
+e_name_western_cleanup_string (gchar **str)
 {
-	char *newstr;
-	char *p;
+	gchar *newstr;
+	gchar *p;
 
 	if (*str == NULL)
 		return;
@@ -77,12 +77,12 @@ e_name_western_cleanup_string (char **str)
 	*str = newstr;
 }
 
-static char *
-e_name_western_get_words_at_idx (char *str, int idx, int num_words)
+static gchar *
+e_name_western_get_words_at_idx (gchar *str, gint idx, gint num_words)
 {
 	GString *words;
-	char *p;
-	int   word_count;
+	gchar *p;
+	gint   word_count;
 
 	/*
 	 * Walk to the end of the words.
@@ -106,7 +106,7 @@ e_name_western_get_words_at_idx (char *str, int idx, int num_words)
 }
 
 static int
-e_name_western_max (const int a, const int b)
+e_name_western_max (const gint a, const gint b)
 {
 	if (a > b)
 		return a;
@@ -115,9 +115,9 @@ e_name_western_max (const int a, const int b)
 }
 
 static gboolean
-e_name_western_word_is_suffix (char *word)
+e_name_western_word_is_suffix (gchar *word)
 {
-	int i;
+	gint i;
 	gchar *folded_word = g_utf8_casefold (word, -1);
 
 	/* The suffix table is already in lowercase, and we know that
@@ -125,7 +125,7 @@ e_name_western_word_is_suffix (char *word)
 	 * don't need to casefold the suffixes.
 	 */
 	for (i = 0; i < G_N_ELEMENTS (western_sfx_index); i++) {
-		const char *suffix = western_sfx_table + western_sfx_index[i];
+		const gchar *suffix = western_sfx_table + western_sfx_index[i];
 
 		if (!g_utf8_collate (folded_word, suffix)) {
 			g_free (folded_word);
@@ -136,20 +136,20 @@ e_name_western_word_is_suffix (char *word)
 	return FALSE;
 }
 
-static char *
-e_name_western_get_one_prefix_at_str (char *str)
+static gchar *
+e_name_western_get_one_prefix_at_str (gchar *str)
 {
-	char *word;
-	int   i;
+	gchar *word;
+	gint   i;
 
 	/*
 	 * Check for prefixes from our table.
 	 */
 	for (i = 0; i < G_N_ELEMENTS (western_pfx_index); i++) {
-		int pfx_words;
-		const char *prefix;
-		char *words;
-		char *folded_words;
+		gint pfx_words;
+		const gchar *prefix;
+		gchar *words;
+		gchar *folded_words;
 
 		prefix = western_pfx_table + western_pfx_index[i];
 		pfx_words = e_name_western_str_count_words (prefix);
@@ -181,13 +181,13 @@ e_name_western_get_one_prefix_at_str (char *str)
 	return NULL;
 }
 
-static char *
-e_name_western_get_prefix_at_str (char *str)
+static gchar *
+e_name_western_get_prefix_at_str (gchar *str)
 {
-	char *pfx;
-	char *pfx1;
-	char *pfx2;
-	char *p;
+	gchar *pfx;
+	gchar *pfx1;
+	gchar *pfx2;
+	gchar *p;
 
 	/* Get the first prefix. */
 	pfx1 = e_name_western_get_one_prefix_at_str (str);
@@ -203,7 +203,7 @@ e_name_western_get_prefix_at_str (char *str)
 	pfx2 = e_name_western_get_one_prefix_at_str (p);
 
 	if (pfx2 != NULL) {
-		int pfx_len;
+		gint pfx_len;
 
 		pfx_len = (p + strlen (pfx2)) - str;
 		pfx = g_malloc0 (pfx_len + 1);
@@ -221,7 +221,7 @@ e_name_western_get_prefix_at_str (char *str)
 static void
 e_name_western_extract_prefix (ENameWestern *name, ENameWesternIdxs *idxs)
 {
-	char *pfx;
+	gchar *pfx;
 
 	pfx = e_name_western_get_prefix_at_str (name->full);
 
@@ -233,13 +233,13 @@ e_name_western_extract_prefix (ENameWestern *name, ENameWesternIdxs *idxs)
 }
 
 static gboolean
-e_name_western_is_complex_last_beginning (char *word)
+e_name_western_is_complex_last_beginning (gchar *word)
 {
-	int i;
-	char *folded_word = g_utf8_casefold (word, -1);
+	gint i;
+	gchar *folded_word = g_utf8_casefold (word, -1);
 
 	for (i = 0; i < G_N_ELEMENTS (western_complex_last_index); i++) {
-		const char *last = western_complex_last_table + western_complex_last_index[i];
+		const gchar *last = western_complex_last_table + western_complex_last_index[i];
 		if (! g_utf8_collate (folded_word, last)) {
 			g_free (folded_word);
 			return TRUE;
@@ -256,8 +256,8 @@ e_name_western_extract_first (ENameWestern *name, ENameWesternIdxs *idxs)
 	 * If there's a prefix, then the first name is right after it.
 	 */
 	if (idxs->prefix_idx != -1) {
-		int   first_idx;
-		char *p;
+		gint   first_idx;
+		gchar *p;
 
 		first_idx = idxs->prefix_idx + strlen (name->prefix);
 
@@ -299,8 +299,8 @@ e_name_western_extract_first (ENameWestern *name, ENameWesternIdxs *idxs)
 static void
 e_name_western_extract_middle (ENameWestern *name, ENameWesternIdxs *idxs)
 {
-	char *word;
-	char *middle;
+	gchar *word;
+	gchar *middle;
 
 	/*
 	 * Middle names can only exist if you have a first name.
@@ -377,8 +377,8 @@ e_name_western_extract_middle (ENameWestern *name, ENameWesternIdxs *idxs)
 static void
 e_name_western_extract_nickname (ENameWestern *name, ENameWesternIdxs *idxs)
 {
-	char *nick;
-	int   start_idx;
+	gchar *nick;
+	gint   start_idx;
 	GString *str;
 
 	if (idxs->first_idx == -1)
@@ -422,7 +422,7 @@ e_name_western_extract_nickname (ENameWestern *name, ENameWesternIdxs *idxs)
 static int
 e_name_western_last_get_max_idx (ENameWestern *name, ENameWesternIdxs *idxs)
 {
-	int max_idx = -1;
+	gint max_idx = -1;
 
 	if (name->prefix != NULL)
 		max_idx = e_name_western_max (
@@ -446,9 +446,9 @@ e_name_western_last_get_max_idx (ENameWestern *name, ENameWesternIdxs *idxs)
 static void
 e_name_western_extract_last (ENameWestern *name, ENameWesternIdxs *idxs)
 {
-	char *word;
-	int   idx = -1;
-	char *last;
+	gchar *word;
+	gint   idx = -1;
+	gchar *last;
 
 	idx = e_name_western_last_get_max_idx (name, idxs);
 
@@ -505,12 +505,12 @@ e_name_western_extract_last (ENameWestern *name, ENameWesternIdxs *idxs)
 	idxs->last_idx = last - name->full;
 }
 
-static char *
-e_name_western_get_preceding_word (char *str, int idx)
+static gchar *
+e_name_western_get_preceding_word (gchar *str, gint idx)
 {
-	int   word_len;
-	char *word;
-	char *p;
+	gint   word_len;
+	gchar *word;
+	gchar *p;
 
 	p = str + idx;
 
@@ -531,11 +531,11 @@ e_name_western_get_preceding_word (char *str, int idx)
 	return word;
 }
 
-static char *
-e_name_western_get_suffix_at_str_end (char *str)
+static gchar *
+e_name_western_get_suffix_at_str_end (gchar *str)
 {
-	char *suffix;
-	char *p;
+	gchar *suffix;
+	gchar *p;
 
 	/*
 	 * Walk backwards till we reach the beginning of the
@@ -543,8 +543,8 @@ e_name_western_get_suffix_at_str_end (char *str)
 	 */
 	p = str + strlen (str);
 	while (1) {
-		char *nextp;
-		char *word;
+		gchar *nextp;
+		gchar *word;
 
 		word = e_name_western_get_preceding_word (str, p - str);
 		nextp = p - strlen (word);
@@ -593,8 +593,8 @@ e_name_western_extract_suffix (ENameWestern *name, ENameWesternIdxs *idxs)
 static gboolean
 e_name_western_detect_backwards (ENameWestern *name, ENameWesternIdxs *idxs)
 {
-	char *comma;
-	char *word;
+	gchar *comma;
+	gchar *word;
 
 	comma = g_utf8_strchr (name->full, -1, ',');
 
@@ -621,14 +621,14 @@ e_name_western_detect_backwards (ENameWestern *name, ENameWesternIdxs *idxs)
 static void
 e_name_western_reorder_asshole (ENameWestern *name, ENameWesternIdxs *idxs)
 {
-	char *prefix;
-	char *last;
-	char *suffix;
-	char *firstmidnick;
-	char *newfull;
+	gchar *prefix;
+	gchar *last;
+	gchar *suffix;
+	gchar *firstmidnick;
+	gchar *newfull;
 
-	char *comma;
-	char *p;
+	gchar *comma;
+	gchar *p;
 
 	if (! e_name_western_detect_backwards (name, idxs))
 		return;
@@ -693,7 +693,7 @@ e_name_western_reorder_asshole (ENameWestern *name, ENameWesternIdxs *idxs)
 		p = g_utf8_next_char (p);
 
 	if (suffix != NULL) {
-		char *q;
+		gchar *q;
 
 		/*
 		 * Point q at the beginning of the suffix.
@@ -735,7 +735,7 @@ e_name_western_reorder_asshole (ENameWestern *name, ENameWesternIdxs *idxs)
 }
 
 static void
-e_name_western_zap_nil (char **str, int *idx)
+e_name_western_zap_nil (gchar **str, gint *idx)
 {
 	if (*str == NULL)
 		return;
@@ -749,11 +749,11 @@ e_name_western_zap_nil (char **str, int *idx)
 }
 
 #define FINISH_CHECK_MIDDLE_NAME_FOR_CONJUNCTION			\
-	char *last_start = NULL;					\
+	gchar *last_start = NULL;					\
 	if (name->last)							\
 		last_start = g_utf8_strchr (name->last, -1, ' ');	\
 	if (last_start) {						\
-		char *new_last, *new_first;				\
+		gchar *new_last, *new_first;				\
 									\
 		new_last = g_strdup (g_utf8_next_char (last_start));	\
 		*last_start = '\0';					\
@@ -775,7 +775,7 @@ e_name_western_zap_nil (char **str, int *idx)
 									\
 		idxs->middle_idx = -1;					\
 	} else {							\
-		char *new_first;					\
+		gchar *new_first;					\
 									\
 		new_first = g_strdup_printf ("%s %s %s",		\
 					     name->first,		\
@@ -832,12 +832,12 @@ e_name_western_fixup (ENameWestern *name, ENameWesternIdxs *idxs)
 	 */
 	if (idxs->suffix_idx != -1 && idxs->last_idx != -1 &&
 	    idxs->suffix_idx < (idxs->last_idx + strlen (name->last))) {
-		char *sfx;
+		gchar *sfx;
 
 		sfx = name->last + (idxs->suffix_idx - idxs->last_idx);
 		if (sfx != NULL) {
-			char *newlast;
-			char *p;
+			gchar *newlast;
+			gchar *p;
 
 			p = sfx;
 			p = g_utf8_prev_char (p);
@@ -933,13 +933,13 @@ e_name_western_fixup (ENameWestern *name, ENameWesternIdxs *idxs)
  * Return value: A new #ENameWestern struct.
  **/
 ENameWestern *
-e_name_western_parse (const char *full_name)
+e_name_western_parse (const gchar *full_name)
 {
 	ENameWesternIdxs *idxs;
 	ENameWestern *wname;
-	char *end;
+	gchar *end;
 
-	if (!g_utf8_validate (full_name, -1, (const char **)&end)) {
+	if (!g_utf8_validate (full_name, -1, (const gchar **)&end)) {
 		g_warning ("e_name_western_parse passed invalid UTF-8 sequence");
 		*end = '\0';
 	}
diff --git a/addressbook/libebook/e-name-western.h b/addressbook/libebook/e-name-western.h
index 66acf93..eace451 100644
--- a/addressbook/libebook/e-name-western.h
+++ b/addressbook/libebook/e-name-western.h
@@ -8,18 +8,18 @@ G_BEGIN_DECLS
 typedef struct {
 
 	/* Public */
-	char *prefix;
-	char *first;
-	char *middle;
-	char *nick;
-	char *last;
-	char *suffix;
+	gchar *prefix;
+	gchar *first;
+	gchar *middle;
+	gchar *nick;
+	gchar *last;
+	gchar *suffix;
 
 	/* Private */
-	char *full;
+	gchar *full;
 } ENameWestern;
 
-ENameWestern *e_name_western_parse (const char   *full_name);
+ENameWestern *e_name_western_parse (const gchar   *full_name);
 void          e_name_western_free  (ENameWestern *w);
 
 G_END_DECLS
diff --git a/addressbook/libebook/e-vcard.c b/addressbook/libebook/e-vcard.c
index 2bebb22..a7e5233 100644
--- a/addressbook/libebook/e-vcard.c
+++ b/addressbook/libebook/e-vcard.c
@@ -48,8 +48,8 @@ struct _EVCardPrivate {
 };
 
 struct _EVCardAttribute {
-	char  *group;
-	char  *name;
+	gchar  *group;
+	gchar  *name;
 	GList *params; /* EVCardParam */
 	GList *values;
 	GList *decoded_values;
@@ -58,8 +58,8 @@ struct _EVCardAttribute {
 };
 
 struct _EVCardAttributeParam {
-	char     *name;
-	GList    *values;  /* GList of char*'s*/
+	gchar     *name;
+	GList    *values;  /* GList of gchar *'s*/
 };
 
 static GObjectClass *parent_class;
@@ -131,12 +131,12 @@ e_vcard_get_type (void)
  *  newline characters if found, taking care of equal characters
  *  and other strange things.
  */
-static char*
-skip_newline (char *str, gboolean quoted_printable)
+static gchar *
+skip_newline (gchar *str, gboolean quoted_printable)
 {
-	char *p;
-	char *next;
-	char *next2;
+	gchar *p;
+	gchar *next;
+	gchar *next2;
 	p = str;
 
 	/* -- swallow equal signs at end of line for quoted printable */
@@ -179,9 +179,9 @@ skip_newline (char *str, gboolean quoted_printable)
 
 /* skip forward until we hit the CRLF, or \0 */
 static void
-skip_to_next_line (char **p)
+skip_to_next_line (gchar **p)
 {
-	char *lp;
+	gchar *lp;
 	lp = *p;
 
 	while (*lp != '\n' && *lp != '\r' && *lp != '\0')
@@ -198,15 +198,15 @@ skip_to_next_line (char **p)
 /* skip forward until we hit a character in @s, CRLF, or \0.  leave *p
    pointing at the character that causes us to stop */
 static void
-skip_until (char **p, char *s)
+skip_until (gchar **p, gchar *s)
 {
-	char *lp;
+	gchar *lp;
 
 	lp = *p;
 
 	while (*lp != '\r' && *lp != '\0') {
 		gboolean s_matches = FALSE;
-		char *ls;
+		gchar *ls;
 		for (ls = s; *ls; ls = g_utf8_next_char (ls)) {
 			if (g_utf8_get_char (ls) == g_utf8_get_char (lp)) {
 				s_matches = TRUE;
@@ -223,9 +223,9 @@ skip_until (char **p, char *s)
 }
 
 static void
-read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable, const char *charset)
+read_attribute_value (EVCardAttribute *attr, gchar **p, gboolean quoted_printable, const gchar *charset)
 {
-	char *lp = *p;
+	gchar *lp = *p;
 	GString *str;
 
 	/* read in the value */
@@ -235,11 +235,11 @@ read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable
 	     lp = skip_newline( lp, quoted_printable ) ) {
 
 		if (*lp == '=' && quoted_printable) {
-			char a, b;
+			gchar a, b;
 			if ((a = *(++lp)) == '\0') break;
 			if ((b = *(++lp)) == '\0') break;
 			if (isxdigit(a) && isxdigit (b)) {
-				char c;
+				gchar c;
 
 				a = tolower (a);
 				b = tolower (b);
@@ -290,7 +290,7 @@ read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable
 		else if ((*lp == ';') ||
 			 (*lp == ',' && !g_ascii_strcasecmp (attr->name, "CATEGORIES"))) {
 			if (charset) {
-				char *tmp;
+				gchar *tmp;
 
 				tmp = g_convert (str->str, str->len, "UTF-8", charset, NULL, NULL, NULL);
 				if (tmp) {
@@ -310,7 +310,7 @@ read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable
 	}
 	if (str) {
 		if (charset) {
-			char *tmp;
+			gchar *tmp;
 
 			tmp = g_convert (str->str, str->len, "UTF-8", charset, NULL, NULL, NULL);
 			if (tmp) {
@@ -329,9 +329,9 @@ read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable
 }
 
 static void
-read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printable, char **charset)
+read_attribute_params (EVCardAttribute *attr, gchar **p, gboolean *quoted_printable, gchar **charset)
 {
-	char *lp;
+	gchar *lp;
 	GString *str;
 	EVCardAttributeParam *param = NULL;
 	gboolean in_quote = FALSE;
@@ -420,7 +420,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
 			}
 			else {
 				if (str->len > 0) {
-					char *param_name;
+					gchar *param_name;
 					if (!g_ascii_strcasecmp (str->str,
 								 "quoted-printable")) {
 						param_name = "ENCODING";
@@ -487,15 +487,15 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
 /* reads an entire attribute from the input buffer, leaving p pointing
    at the start of the next line (past the \r\n) */
 static EVCardAttribute*
-read_attribute (char **p)
+read_attribute (gchar **p)
 {
-	char *attr_group = NULL;
-	char *attr_name = NULL;
+	gchar *attr_group = NULL;
+	gchar *attr_name = NULL;
 	EVCardAttribute *attr = NULL;
 	GString *str;
-	char *lp;
+	gchar *lp;
 	gboolean is_qp = FALSE;
-	char *charset = NULL;
+	gchar *charset = NULL;
 
 	/* first read in the group/name */
 	str = g_string_new ("");
@@ -628,10 +628,10 @@ make_valid_utf8 (const gchar *name)
  * try to return *something*.
  */
 static void
-parse (EVCard *evc, const char *str)
+parse (EVCard *evc, const gchar *str)
 {
-	char *buf ;
-	char *p;
+	gchar *buf ;
+	gchar *p;
 	EVCardAttribute *attr;
 
 	buf = make_valid_utf8 (str);
@@ -686,11 +686,11 @@ parse (EVCard *evc, const char *str)
  *
  * Return value: A newly allocated, escaped string.
  **/
-char*
-e_vcard_escape_string (const char *s)
+gchar *
+e_vcard_escape_string (const gchar *s)
 {
 	GString *str;
-	const char *p;
+	const gchar *p;
 
 	str = g_string_new ("");
 
@@ -731,11 +731,11 @@ e_vcard_escape_string (const char *s)
  *
  * Return value: A newly allocated, unescaped string.
  **/
-char*
-e_vcard_unescape_string (const char *s)
+gchar *
+e_vcard_unescape_string (const gchar *s)
 {
 	GString *str;
-	const char *p;
+	const gchar *p;
 
 	g_return_val_if_fail (s != NULL, NULL);
 
@@ -768,7 +768,7 @@ e_vcard_unescape_string (const char *s)
 }
 
 void
-e_vcard_construct (EVCard *evc, const char *str)
+e_vcard_construct (EVCard *evc, const gchar *str)
 {
 	g_return_if_fail (E_IS_VCARD (evc));
 	g_return_if_fail (str != NULL);
@@ -800,7 +800,7 @@ e_vcard_new (void)
  * Return value: A new #EVCard.
  **/
 EVCard *
-e_vcard_new_from_string (const char *str)
+e_vcard_new_from_string (const gchar *str)
 {
 	EVCard *evc;
 
@@ -813,14 +813,14 @@ e_vcard_new_from_string (const char *str)
 	return evc;
 }
 
-static char*
+static gchar *
 e_vcard_to_string_vcard_21  (EVCard *evc)
 {
 	g_warning ("need to implement e_vcard_to_string_vcard_21");
 	return g_strdup ("");
 }
 
-static char*
+static gchar *
 e_vcard_to_string_vcard_30 (EVCard *evc)
 {
 	GList *l;
@@ -868,8 +868,8 @@ e_vcard_to_string_vcard_30 (EVCard *evc)
 			if (param->values) {
 				g_string_append_c (attr_str, '=');
 				for (v = param->values; v; v = v->next) {
-					char *value = v->data;
-					char *pval = value;
+					gchar *value = v->data;
+					gchar *pval = value;
 					gboolean quotes = FALSE;
 					while (*pval) {
 						if (!g_unichar_isalnum (g_utf8_get_char (pval))) {
@@ -880,7 +880,7 @@ e_vcard_to_string_vcard_30 (EVCard *evc)
 					}
 
 					if (quotes) {
-						int i;
+						gint i;
 
 						g_string_append_c (attr_str, '"');
 
@@ -905,8 +905,8 @@ e_vcard_to_string_vcard_30 (EVCard *evc)
 		g_string_append_c (attr_str, ':');
 
 		for (v = attr->values; v; v = v->next) {
-			char *value = v->data;
-			char *escaped_value = NULL;
+			gchar *value = v->data;
+			gchar *escaped_value = NULL;
 
 			escaped_value = e_vcard_escape_string (value);
 
@@ -970,7 +970,7 @@ e_vcard_to_string_vcard_30 (EVCard *evc)
  *
  * Return value: A newly allocated string representing the vcard.
  **/
-char*
+gchar *
 e_vcard_to_string (EVCard *evc, EVCardFormat format)
 {
 	g_return_val_if_fail (E_IS_VCARD (evc), NULL);
@@ -998,7 +998,7 @@ e_vcard_dump_structure (EVCard *evc)
 {
 	GList *a;
 	GList *v;
-	int i;
+	gint i;
 
 	g_return_if_fail (E_IS_VCARD (evc));
 
@@ -1015,7 +1015,7 @@ e_vcard_dump_structure (EVCard *evc)
 				printf ("    |   [%d] = %s", i,param->name);
 				printf ("(");
 				for (v = param->values; v; v = v->next) {
-					char *value = e_vcard_escape_string ((char*)v->data);
+					gchar *value = e_vcard_escape_string ((gchar *)v->data);
 					printf ("%s", value);
 					if (v->next)
 						printf (",");
@@ -1027,7 +1027,7 @@ e_vcard_dump_structure (EVCard *evc)
 		}
 		printf ("    +- values=\n");
 		for (v = attr->values, i = 0; v; v = v->next, i++) {
-			printf ("        [%d] = `%s'\n", i, (char*)v->data);
+			printf ("        [%d] = `%s'\n", i, (gchar *)v->data);
 		}
 	}
 }
@@ -1043,7 +1043,7 @@ e_vcard_dump_structure (EVCard *evc)
  * Return value: A new #EVCardAttribute.
  **/
 EVCardAttribute*
-e_vcard_attribute_new (const char *attr_group, const char *attr_name)
+e_vcard_attribute_new (const gchar *attr_group, const gchar *attr_name)
 {
 	EVCardAttribute *attr;
 
@@ -1115,7 +1115,7 @@ e_vcard_attribute_copy (EVCardAttribute *attr)
  * their group names.
  **/
 void
-e_vcard_remove_attributes (EVCard *evc, const char *attr_group, const char *attr_name)
+e_vcard_remove_attributes (EVCard *evc, const gchar *attr_group, const gchar *attr_name)
 {
 	GList *attr;
 
@@ -1186,7 +1186,7 @@ e_vcard_add_attribute (EVCard *evc, EVCardAttribute *attr)
  **/
 void
 e_vcard_add_attribute_with_value (EVCard *evcard,
-				  EVCardAttribute *attr, const char *value)
+				  EVCardAttribute *attr, const gchar *value)
 {
 	g_return_if_fail (E_IS_VCARD (evcard));
 	g_return_if_fail (attr != NULL);
@@ -1208,14 +1208,14 @@ void
 e_vcard_add_attribute_with_values (EVCard *evcard, EVCardAttribute *attr, ...)
 {
 	va_list ap;
-	char *v;
+	gchar *v;
 
 	g_return_if_fail (E_IS_VCARD (evcard));
 	g_return_if_fail (attr != NULL);
 
 	va_start (ap, attr);
 
-	while ((v = va_arg (ap, char*))) {
+	while ((v = va_arg (ap, gchar *))) {
 		e_vcard_attribute_add_value (attr, v);
 	}
 
@@ -1232,7 +1232,7 @@ e_vcard_add_attribute_with_values (EVCard *evcard, EVCardAttribute *attr, ...)
  * Adds @value to @attr's list of values.
  **/
 void
-e_vcard_attribute_add_value (EVCardAttribute *attr, const char *value)
+e_vcard_attribute_add_value (EVCardAttribute *attr, const gchar *value)
 {
 	g_return_if_fail (attr != NULL);
 
@@ -1249,7 +1249,7 @@ e_vcard_attribute_add_value (EVCardAttribute *attr, const char *value)
  * adds it to @attr's list of values.
  **/
 void
-e_vcard_attribute_add_value_decoded (EVCardAttribute *attr, const char *value, int len)
+e_vcard_attribute_add_value_decoded (EVCardAttribute *attr, const gchar *value, gint len)
 {
 	g_return_if_fail (attr != NULL);
 
@@ -1258,7 +1258,7 @@ e_vcard_attribute_add_value_decoded (EVCardAttribute *attr, const char *value, i
 		g_warning ("can't add_value_decoded with an attribute using RAW encoding.  you must set the ENCODING parameter first");
 		break;
 	case EVC_ENCODING_BASE64: {
-		char *b64_data = g_base64_encode (value, len);
+		gchar *b64_data = g_base64_encode (value, len);
 		GString *decoded = g_string_new_len (value, len);
 
 		/* make sure the decoded list is up to date */
@@ -1289,13 +1289,13 @@ e_vcard_attribute_add_values (EVCardAttribute *attr,
 			      ...)
 {
 	va_list ap;
-	char *v;
+	gchar *v;
 
 	g_return_if_fail (attr != NULL);
 
 	va_start (ap, attr);
 
-	while ((v = va_arg (ap, char*))) {
+	while ((v = va_arg (ap, gchar *))) {
 		e_vcard_attribute_add_value (attr, v);
 	}
 
@@ -1336,7 +1336,7 @@ e_vcard_attribute_remove_values (EVCardAttribute *attr)
  * Removes from the value list in @attr the value @s.
  **/
 void
-e_vcard_attribute_remove_value (EVCardAttribute *attr, const char *s)
+e_vcard_attribute_remove_value (EVCardAttribute *attr, const gchar *s)
 {
 	GList *l;
 
@@ -1361,7 +1361,7 @@ e_vcard_attribute_remove_value (EVCardAttribute *attr, const char *s)
  * Since 1.11.3.
  */
 void
-e_vcard_attribute_remove_param (EVCardAttribute *attr, const char *param_name)
+e_vcard_attribute_remove_param (EVCardAttribute *attr, const gchar *param_name)
 {
 	GList *l;
 	EVCardAttributeParam *param;
@@ -1409,7 +1409,7 @@ e_vcard_attribute_remove_params (EVCardAttribute *attr)
  * Return value: A new #EVCardAttributeParam.
  **/
 EVCardAttributeParam*
-e_vcard_attribute_param_new (const char *name)
+e_vcard_attribute_param_new (const gchar *name)
 {
 	EVCardAttributeParam *param = g_slice_new (EVCardAttributeParam);
 	param->values = NULL;
@@ -1478,7 +1478,7 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
 {
 	gboolean contains;
 	GList *params, *p;
-	const char *par_name;
+	const gchar *par_name;
 
 	g_return_if_fail (attr != NULL);
 	g_return_if_fail (param != NULL);
@@ -1499,14 +1499,14 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
 			vals = param->values;
 
 			for (v = vals; v; v = v->next) {
-				const char *my_value;
+				const gchar *my_value;
 				GList *vals2,*v2;
 
-				my_value = (const char *)v->data;
+				my_value = (const gchar *)v->data;
 				vals2 = param2->values;
 
 				for (v2 = vals2; v2; v2 = v2->next) {
-					if (g_ascii_strcasecmp ((const char *)v2->data, my_value) == 0) {
+					if (g_ascii_strcasecmp ((const gchar *)v2->data, my_value) == 0) {
 						break;
 					}
 				}
@@ -1538,14 +1538,14 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
 		}
 
 		if (param->values && param->values->data) {
-			if (!g_ascii_strcasecmp ((char*)param->values->data, "b") ||
-			    !g_ascii_strcasecmp ((char*)param->values->data, "BASE64"))
+			if (!g_ascii_strcasecmp ((gchar *)param->values->data, "b") ||
+			    !g_ascii_strcasecmp ((gchar *)param->values->data, "BASE64"))
 				attr->encoding = EVC_ENCODING_BASE64;
-			else if (!g_ascii_strcasecmp ((char*)param->values->data, EVC_QUOTEDPRINTABLE))
+			else if (!g_ascii_strcasecmp ((gchar *)param->values->data, EVC_QUOTEDPRINTABLE))
 				attr->encoding = EVC_ENCODING_QP;
 			else {
 				g_warning ("Unknown value `%s' for ENCODING parameter.  values will be treated as raw",
-					   (char*)param->values->data);
+					   (gchar *)param->values->data);
 			}
 
 			attr->encoding_set = TRUE;
@@ -1569,7 +1569,7 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
  **/
 void
 e_vcard_attribute_param_add_value (EVCardAttributeParam *param,
-				   const char *value)
+				   const gchar *value)
 {
 	g_return_if_fail (param != NULL);
 
@@ -1588,13 +1588,13 @@ e_vcard_attribute_param_add_values (EVCardAttributeParam *param,
 				    ...)
 {
 	va_list ap;
-	char *v;
+	gchar *v;
 
 	g_return_if_fail (param != NULL);
 
 	va_start (ap, param);
 
-	while ((v = va_arg (ap, char*))) {
+	while ((v = va_arg (ap, gchar *))) {
 		e_vcard_attribute_param_add_value (param, v);
 	}
 
@@ -1611,7 +1611,7 @@ e_vcard_attribute_param_add_values (EVCardAttributeParam *param,
  **/
 void
 e_vcard_attribute_add_param_with_value (EVCardAttribute *attr,
-					EVCardAttributeParam *param, const char *value)
+					EVCardAttributeParam *param, const gchar *value)
 {
 	g_return_if_fail (attr != NULL);
 	g_return_if_fail (param != NULL);
@@ -1635,14 +1635,14 @@ e_vcard_attribute_add_param_with_values (EVCardAttribute *attr,
 					 EVCardAttributeParam *param, ...)
 {
 	va_list ap;
-	char *v;
+	gchar *v;
 
 	g_return_if_fail (attr != NULL);
 	g_return_if_fail (param != NULL);
 
 	va_start (ap, param);
 
-	while ((v = va_arg (ap, char*))) {
+	while ((v = va_arg (ap, gchar *))) {
 		e_vcard_attribute_param_add_value (param, v);
 	}
 
@@ -1676,7 +1676,7 @@ e_vcard_attribute_param_remove_values (EVCardAttributeParam *param)
  * Removes the value @s from the parameter @param_name on the attribute @attr.
  **/
 void
-e_vcard_attribute_remove_param_value (EVCardAttribute *attr, const char *param_name, const char *s)
+e_vcard_attribute_remove_param_value (EVCardAttribute *attr, const gchar *param_name, const gchar *s)
 {
 	GList *l, *params;
 	EVCardAttributeParam *param;
@@ -1736,7 +1736,7 @@ e_vcard_get_attributes (EVCard *evcard)
  **/
 EVCardAttribute *
 e_vcard_get_attribute (EVCard     *evc,
-		       const char *name)
+		       const gchar *name)
 {
         GList *attrs, *l;
 
@@ -1762,7 +1762,7 @@ e_vcard_get_attribute (EVCard     *evc,
  *
  * Return value: The attribute's group name.
  **/
-const char*
+const gchar *
 e_vcard_attribute_get_group (EVCardAttribute *attr)
 {
 	g_return_val_if_fail (attr != NULL, NULL);
@@ -1778,7 +1778,7 @@ e_vcard_attribute_get_group (EVCardAttribute *attr)
  *
  * Return value: The attribute's name.
  **/
-const char*
+const gchar *
 e_vcard_attribute_get_name (EVCardAttribute *attr)
 {
 	g_return_val_if_fail (attr != NULL, NULL);
@@ -1823,7 +1823,7 @@ e_vcard_attribute_get_values_decoded (EVCardAttribute *attr)
 		switch (attr->encoding) {
 		case EVC_ENCODING_RAW:
 			for (l = attr->values; l; l = l->next)
-				attr->decoded_values = g_list_prepend (attr->decoded_values, g_string_new ((char*)l->data));
+				attr->decoded_values = g_list_prepend (attr->decoded_values, g_string_new ((gchar *)l->data));
 			attr->decoded_values = g_list_reverse (attr->decoded_values);
 			break;
 		case EVC_ENCODING_BASE64:
@@ -1874,7 +1874,7 @@ e_vcard_attribute_is_single_valued (EVCardAttribute *attr)
  *
  * Return value: A newly allocated string representing the value.
  **/
-char*
+gchar *
 e_vcard_attribute_get_value (EVCardAttribute *attr)
 {
 	GList *values;
@@ -1886,7 +1886,7 @@ e_vcard_attribute_get_value (EVCardAttribute *attr)
 	if (!e_vcard_attribute_is_single_valued (attr))
 		g_warning ("e_vcard_attribute_get_value called on multivalued attribute");
 
-	return values ? g_strdup ((char*)values->data) : NULL;
+	return values ? g_strdup ((gchar *)values->data) : NULL;
 }
 
 /**
@@ -1929,7 +1929,7 @@ e_vcard_attribute_get_value_decoded (EVCardAttribute *attr)
  * Return value: %TRUE if such a parameter exists, %FALSE otherwise.
  **/
 gboolean
-e_vcard_attribute_has_type (EVCardAttribute *attr, const char *typestr)
+e_vcard_attribute_has_type (EVCardAttribute *attr, const gchar *typestr)
 {
 	GList *params;
 	GList *p;
@@ -1947,7 +1947,7 @@ e_vcard_attribute_has_type (EVCardAttribute *attr, const char *typestr)
 			GList *v;
 
 			for (v = values; v; v = v->next) {
-				if (!g_ascii_strcasecmp ((char*)v->data, typestr))
+				if (!g_ascii_strcasecmp ((gchar *)v->data, typestr))
 					return TRUE;
 			}
 		}
@@ -1984,7 +1984,7 @@ e_vcard_attribute_get_params (EVCardAttribute *attr)
  * Return value: A list of string elements representing the parameter's values.
  **/
 GList *
-e_vcard_attribute_get_param (EVCardAttribute *attr, const char *name)
+e_vcard_attribute_get_param (EVCardAttribute *attr, const gchar *name)
 {
 	GList *params, *p;
 
@@ -2011,7 +2011,7 @@ e_vcard_attribute_get_param (EVCardAttribute *attr, const char *name)
  *
  * Return value: The name of the parameter.
  **/
-const char*
+const gchar *
 e_vcard_attribute_param_get_name (EVCardAttributeParam *param)
 {
 	g_return_val_if_fail (param != NULL, NULL);
diff --git a/addressbook/libebook/e-vcard.h b/addressbook/libebook/e-vcard.h
index eaecf86..a23a38c 100644
--- a/addressbook/libebook/e-vcard.h
+++ b/addressbook/libebook/e-vcard.h
@@ -131,75 +131,75 @@ struct _EVCardClass {
 
 GType   e_vcard_get_type                     (void);
 
-void    e_vcard_construct                    (EVCard *evc, const char *str);
+void    e_vcard_construct                    (EVCard *evc, const gchar *str);
 EVCard* e_vcard_new                          (void);
-EVCard* e_vcard_new_from_string              (const char *str);
+EVCard* e_vcard_new_from_string              (const gchar *str);
 
-char*   e_vcard_to_string                    (EVCard *evc, EVCardFormat format);
+gchar *   e_vcard_to_string                    (EVCard *evc, EVCardFormat format);
 
 /* mostly for debugging */
 void    e_vcard_dump_structure               (EVCard *evc);
 
 
 /* attributes */
-EVCardAttribute *e_vcard_attribute_new               (const char *attr_group, const char *attr_name);
+EVCardAttribute *e_vcard_attribute_new               (const gchar *attr_group, const gchar *attr_name);
 void             e_vcard_attribute_free              (EVCardAttribute *attr);
 EVCardAttribute *e_vcard_attribute_copy              (EVCardAttribute *attr);
-void             e_vcard_remove_attributes           (EVCard *evc, const char *attr_group, const char *attr_name);
+void             e_vcard_remove_attributes           (EVCard *evc, const gchar *attr_group, const gchar *attr_name);
 void             e_vcard_remove_attribute            (EVCard *evc, EVCardAttribute *attr);
 void             e_vcard_add_attribute               (EVCard *evc, EVCardAttribute *attr);
-void             e_vcard_add_attribute_with_value    (EVCard *evcard, EVCardAttribute *attr, const char *value);
+void             e_vcard_add_attribute_with_value    (EVCard *evcard, EVCardAttribute *attr, const gchar *value);
 void             e_vcard_add_attribute_with_values   (EVCard *evcard, EVCardAttribute *attr, ...);
-void             e_vcard_attribute_add_value         (EVCardAttribute *attr, const char *value);
-void             e_vcard_attribute_add_value_decoded (EVCardAttribute *attr, const char *value, int len);
+void             e_vcard_attribute_add_value         (EVCardAttribute *attr, const gchar *value);
+void             e_vcard_attribute_add_value_decoded (EVCardAttribute *attr, const gchar *value, gint len);
 void             e_vcard_attribute_add_values        (EVCardAttribute *attr, ...);
-void             e_vcard_attribute_remove_value      (EVCardAttribute *attr, const char *s);
+void             e_vcard_attribute_remove_value      (EVCardAttribute *attr, const gchar *s);
 void             e_vcard_attribute_remove_values     (EVCardAttribute *attr);
 void             e_vcard_attribute_remove_params     (EVCardAttribute *attr);
-void             e_vcard_attribute_remove_param      (EVCardAttribute *attr, const char *param_name);
-void             e_vcard_attribute_remove_param_value (EVCardAttribute *attr, const char *param_name, const char *s);
+void             e_vcard_attribute_remove_param      (EVCardAttribute *attr, const gchar *param_name);
+void             e_vcard_attribute_remove_param_value (EVCardAttribute *attr, const gchar *param_name, const gchar *s);
 
 /* attribute parameters */
-EVCardAttributeParam* e_vcard_attribute_param_new             (const char *name);
+EVCardAttributeParam* e_vcard_attribute_param_new             (const gchar *name);
 void                  e_vcard_attribute_param_free            (EVCardAttributeParam *param);
 EVCardAttributeParam* e_vcard_attribute_param_copy            (EVCardAttributeParam *param);
 void                  e_vcard_attribute_add_param             (EVCardAttribute *attr, EVCardAttributeParam *param);
 void                  e_vcard_attribute_add_param_with_value  (EVCardAttribute *attr,
-							       EVCardAttributeParam *param, const char *value);
+							       EVCardAttributeParam *param, const gchar *value);
 void                  e_vcard_attribute_add_param_with_values (EVCardAttribute *attr,
 							       EVCardAttributeParam *param, ...);
 
 void                  e_vcard_attribute_param_add_value       (EVCardAttributeParam *param,
-							       const char *value);
+							       const gchar *value);
 void                  e_vcard_attribute_param_add_values      (EVCardAttributeParam *param,
 							       ...);
 void                  e_vcard_attribute_param_remove_values   (EVCardAttributeParam *param);
 
 /* EVCard* accessors.  nothing returned from these functions should be
    freed by the caller. */
-EVCardAttribute *e_vcard_get_attribute        (EVCard *evc, const char *name);
+EVCardAttribute *e_vcard_get_attribute        (EVCard *evc, const gchar *name);
 GList*           e_vcard_get_attributes       (EVCard *evcard);
-const char*      e_vcard_attribute_get_group  (EVCardAttribute *attr);
-const char*      e_vcard_attribute_get_name   (EVCardAttribute *attr);
-GList*           e_vcard_attribute_get_values (EVCardAttribute *attr);  /* GList elements are of type char* */
+const gchar *      e_vcard_attribute_get_group  (EVCardAttribute *attr);
+const gchar *      e_vcard_attribute_get_name   (EVCardAttribute *attr);
+GList*           e_vcard_attribute_get_values (EVCardAttribute *attr);  /* GList elements are of type gchar * */
 GList*           e_vcard_attribute_get_values_decoded (EVCardAttribute *attr); /* GList elements are of type GString* */
 
 /* special accessors for single valued attributes */
 gboolean              e_vcard_attribute_is_single_valued      (EVCardAttribute *attr);
-char*                 e_vcard_attribute_get_value             (EVCardAttribute *attr);
+gchar *                 e_vcard_attribute_get_value             (EVCardAttribute *attr);
 GString*              e_vcard_attribute_get_value_decoded     (EVCardAttribute *attr);
 
 GList*           e_vcard_attribute_get_params       (EVCardAttribute *attr);
-GList*           e_vcard_attribute_get_param        (EVCardAttribute *attr, const char *name);
-const char*      e_vcard_attribute_param_get_name   (EVCardAttributeParam *param);
+GList*           e_vcard_attribute_get_param        (EVCardAttribute *attr, const gchar *name);
+const gchar *      e_vcard_attribute_param_get_name   (EVCardAttributeParam *param);
 GList*           e_vcard_attribute_param_get_values (EVCardAttributeParam *param);
 
 /* special TYPE= parameter predicate (checks for TYPE= typestr */
-gboolean         e_vcard_attribute_has_type         (EVCardAttribute *attr, const char *typestr);
+gboolean         e_vcard_attribute_has_type         (EVCardAttribute *attr, const gchar *typestr);
 
 /* Utility functions. */
-char*            e_vcard_escape_string (const char *s);
-char*            e_vcard_unescape_string (const char *s);
+gchar *            e_vcard_escape_string (const gchar *s);
+gchar *            e_vcard_unescape_string (const gchar *s);
 
 G_END_DECLS
 
diff --git a/addressbook/libedata-book/e-book-backend-cache.c b/addressbook/libedata-book/e-book-backend-cache.c
index d8daa68..b4424e7 100644
--- a/addressbook/libedata-book/e-book-backend-cache.c
+++ b/addressbook/libedata-book/e-book-backend-cache.c
@@ -28,7 +28,7 @@
 #include "e-book-backend-sexp.h"
 
 struct _EBookBackendCachePrivate {
-	char *uri;
+	gchar *uri;
 };
 
 /* Property IDs */
@@ -39,11 +39,11 @@ enum {
 
 static GObjectClass *parent_class = NULL;
 
-static char *
-get_filename_from_uri (const char *uri)
+static gchar *
+get_filename_from_uri (const gchar *uri)
 {
-	char *mangled_uri, *filename;
-	int i;
+	gchar *mangled_uri, *filename;
+	gint i;
 
 	/* mangle the URI to not contain invalid characters */
 	mangled_uri = g_strdup (uri);
@@ -70,7 +70,7 @@ e_book_backend_cache_set_property (GObject *object, guint property_id, const GVa
 {
 	EBookBackendCache *cache;
 	EBookBackendCachePrivate *priv;
-	char *cache_file;
+	gchar *cache_file;
 
 	cache = E_BOOK_BACKEND_CACHE (object);
 	priv = cache->priv;
@@ -141,8 +141,8 @@ e_book_backend_cache_constructor (GType type,
                                  GObjectConstructParam *construct_properties)
 {
 	GObject *obj;
-	const char *uri;
-	char *cache_file;
+	const gchar *uri;
+	gchar *cache_file;
 
 	/* Invoke parent constructor. */
 	obj = parent_class->constructor (type,
@@ -224,7 +224,7 @@ e_book_backend_cache_get_type (void)
  * Return value: A new #EBookBackendCache.
  */
 EBookBackendCache *
-e_book_backend_cache_new (const char *uri)
+e_book_backend_cache_new (const gchar *uri)
 {
 	EBookBackendCache *cache;
 
@@ -245,9 +245,9 @@ e_book_backend_cache_new (const char *uri)
  * Return value: A cached #EContact, or %NULL if @uid is not cached.
  **/
 EContact *
-e_book_backend_cache_get_contact (EBookBackendCache *cache, const char *uid)
+e_book_backend_cache_get_contact (EBookBackendCache *cache, const gchar *uid)
 {
-	const char *vcard_str;
+	const gchar *vcard_str;
 	EContact *contact = NULL;
 
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_CACHE (cache), NULL);
@@ -276,8 +276,8 @@ gboolean
 e_book_backend_cache_add_contact (EBookBackendCache *cache,
 				   EContact *contact)
 {
-	char *vcard_str;
-	const char *uid;
+	gchar *vcard_str;
+	const gchar *uid;
 	gboolean retval;
 	EBookBackendCachePrivate *priv;
 
@@ -310,7 +310,7 @@ e_book_backend_cache_add_contact (EBookBackendCache *cache,
  **/
 gboolean
 e_book_backend_cache_remove_contact (EBookBackendCache *cache,
-				    const char *uid)
+				    const gchar *uid)
 
 {
 	gboolean retval;
@@ -342,7 +342,7 @@ e_book_backend_cache_remove_contact (EBookBackendCache *cache,
  * Return value: %TRUE if the cache contains the contact, %FALSE otherwise.
  **/
 gboolean
-e_book_backend_cache_check_contact (EBookBackendCache *cache, const char *uid)
+e_book_backend_cache_check_contact (EBookBackendCache *cache, const gchar *uid)
 {
 
 	gboolean retval;
@@ -371,14 +371,14 @@ e_book_backend_cache_check_contact (EBookBackendCache *cache, const char *uid)
  * Return value: A #GList of pointers to #EContact.
  **/
 GList *
-e_book_backend_cache_get_contacts (EBookBackendCache *cache, const char *query)
+e_book_backend_cache_get_contacts (EBookBackendCache *cache, const gchar *query)
 {
-        char *vcard_str;
+        gchar *vcard_str;
         GSList *l, *lcache;
 	GList *list = NULL;
 	EContact *contact;
         EBookBackendSExp *sexp = NULL;
-	const char *uid;
+	const gchar *uid;
 
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_CACHE (cache), NULL);
 	if (query) {
@@ -422,7 +422,7 @@ e_book_backend_cache_get_contacts (EBookBackendCache *cache, const char *query)
  * Return value: A #GPtrArray of pointers to contact ID strings.
  **/
 GPtrArray *
-e_book_backend_cache_search (EBookBackendCache *cache, const char *query)
+e_book_backend_cache_search (EBookBackendCache *cache, const gchar *query)
 {
 	GList *matching_contacts, *temp;
 	GPtrArray *ptr_array;
@@ -449,9 +449,9 @@ e_book_backend_cache_search (EBookBackendCache *cache, const char *query)
  * Return value: %TRUE if cache exists, %FALSE if not.
  **/
 gboolean
-e_book_backend_cache_exists (const char *uri)
+e_book_backend_cache_exists (const gchar *uri)
 {
-	char *file_name;
+	gchar *file_name;
 	gboolean exists = FALSE;
 	file_name = get_filename_from_uri (uri);
 
@@ -496,13 +496,13 @@ e_book_backend_cache_is_populated (EBookBackendCache *cache)
 }
 
 void
-e_book_backend_cache_set_time (EBookBackendCache *cache, const char *t)
+e_book_backend_cache_set_time (EBookBackendCache *cache, const gchar *t)
 {
 	g_return_if_fail (E_IS_BOOK_BACKEND_CACHE (cache));
 	e_file_cache_add_object (E_FILE_CACHE (cache), "last_update_time", t);
 }
 
-char *
+gchar *
 e_book_backend_cache_get_time (EBookBackendCache *cache)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_CACHE (cache), NULL);
diff --git a/addressbook/libedata-book/e-book-backend-cache.h b/addressbook/libedata-book/e-book-backend-cache.h
index d85907e..0e86a90 100644
--- a/addressbook/libedata-book/e-book-backend-cache.h
+++ b/addressbook/libedata-book/e-book-backend-cache.h
@@ -46,20 +46,20 @@ typedef struct {
 } EBookBackendCacheClass;
 
 GType e_book_backend_cache_get_type (void);
-EBookBackendCache* e_book_backend_cache_new (const char *uri);
-EContact* e_book_backend_cache_get_contact (EBookBackendCache *cache, const char *uid);
+EBookBackendCache* e_book_backend_cache_new (const gchar *uri);
+EContact* e_book_backend_cache_get_contact (EBookBackendCache *cache, const gchar *uid);
 gboolean e_book_backend_cache_add_contact (EBookBackendCache *cache,
 					   EContact *contact);
 gboolean e_book_backend_cache_remove_contact (EBookBackendCache *cache,
-					      const char *uid);
-gboolean e_book_backend_cache_check_contact (EBookBackendCache *cache, const char *uid);
-GList*   e_book_backend_cache_get_contacts (EBookBackendCache *cache, const char *query);
-gboolean e_book_backend_cache_exists (const char *uri);
+					      const gchar *uid);
+gboolean e_book_backend_cache_check_contact (EBookBackendCache *cache, const gchar *uid);
+GList*   e_book_backend_cache_get_contacts (EBookBackendCache *cache, const gchar *query);
+gboolean e_book_backend_cache_exists (const gchar *uri);
 void     e_book_backend_cache_set_populated (EBookBackendCache *cache);
 gboolean e_book_backend_cache_is_populated (EBookBackendCache *cache);
-void e_book_backend_cache_set_time (EBookBackendCache *cache, const char *t);
-char *e_book_backend_cache_get_time (EBookBackendCache *cache);
-GPtrArray* e_book_backend_cache_search (EBookBackendCache *cache, const char *query);
+void e_book_backend_cache_set_time (EBookBackendCache *cache, const gchar *t);
+gchar *e_book_backend_cache_get_time (EBookBackendCache *cache);
+GPtrArray* e_book_backend_cache_search (EBookBackendCache *cache, const gchar *query);
 
 
 
diff --git a/addressbook/libedata-book/e-book-backend-db-cache.c b/addressbook/libedata-book/e-book-backend-db-cache.c
index 2f37c1f..adf25d7 100644
--- a/addressbook/libedata-book/e-book-backend-db-cache.c
+++ b/addressbook/libedata-book/e-book-backend-db-cache.c
@@ -29,19 +29,19 @@
 #include "e-book-backend-sexp.h"
 
 void
-string_to_dbt(const char *str, DBT *dbt)
+string_to_dbt(const gchar *str, DBT *dbt)
 {
 	memset(dbt, 0, sizeof(dbt));
-	dbt->data = (void *)str;
+	dbt->data = (gpointer)str;
 	dbt->size = strlen(str) + 1;
 	dbt->flags = DB_DBT_USERMEM;
 }
 
-static char *
-get_filename_from_uri (const char *uri)
+static gchar *
+get_filename_from_uri (const gchar *uri)
 {
-	char *mangled_uri, *filename;
-	int i;
+	gchar *mangled_uri, *filename;
+	gint i;
 
 	/* mangle the URI to not contain invalid characters */
 	mangled_uri = g_strdup (uri);
@@ -72,10 +72,10 @@ get_filename_from_uri (const char *uri)
  **/
 
 void
-e_book_backend_db_cache_set_filename(DB *db, const char *filename)
+e_book_backend_db_cache_set_filename(DB *db, const gchar *filename)
 {
 	DBT uid_dbt, vcard_dbt;
-	int db_error;
+	gint db_error;
 
 	string_to_dbt ("filename", &uid_dbt);
 	string_to_dbt (filename, &vcard_dbt);
@@ -94,12 +94,12 @@ e_book_backend_db_cache_set_filename(DB *db, const char *filename)
  * Get the filename for db cacahe file.
  **/
 
-char *
+gchar *
 e_book_backend_db_cache_get_filename(DB *db)
 {
 	DBT  uid_dbt, vcard_dbt;
-	int db_error;
-	char *filename;
+	gint db_error;
+	gchar *filename;
 
 	string_to_dbt ("filename", &uid_dbt);
 	memset (&vcard_dbt, 0 , sizeof(vcard_dbt));
@@ -129,7 +129,7 @@ e_book_backend_db_cache_get_filename(DB *db)
  * Return value: A cached #EContact, or %NULL if @uid is not cached.
  **/
 EContact *
-e_book_backend_db_cache_get_contact (DB *db, const char *uid)
+e_book_backend_db_cache_get_contact (DB *db, const gchar *uid)
 {
 	DBT	uid_dbt, vcard_dbt;
 	int	db_error;
@@ -147,7 +147,7 @@ e_book_backend_db_cache_get_contact (DB *db, const char *uid)
 		return NULL;
 	}
 
-	contact = e_contact_new_from_vcard ((const char *)vcard_dbt.data);
+	contact = e_contact_new_from_vcard ((const gchar *)vcard_dbt.data);
 	g_free (vcard_dbt.data);
 	return contact;
 }
@@ -168,14 +168,14 @@ e_book_backend_db_cache_add_contact (DB *db,
 	DBT	uid_dbt, vcard_dbt;
 	int	db_error;
 	char	*vcard_str;
-	const char *uid;
+	const gchar *uid;
 
 	uid = e_contact_get_const (contact, E_CONTACT_UID);
 	if (!uid) {
 		printf ("no uid\n");
 		printf("name:%s, email:%s\n",
-			(char*)e_contact_get (contact, E_CONTACT_GIVEN_NAME),
-			(char*)e_contact_get (contact, E_CONTACT_EMAIL_1));
+			(gchar *)e_contact_get (contact, E_CONTACT_GIVEN_NAME),
+			(gchar *)e_contact_get (contact, E_CONTACT_EMAIL_1));
 		return FALSE;
 	}
 	string_to_dbt (uid, &uid_dbt);
@@ -207,7 +207,7 @@ e_book_backend_db_cache_add_contact (DB *db,
  **/
 gboolean
 e_book_backend_db_cache_remove_contact (DB *db,
-					const char *uid)
+					const gchar *uid)
 
 {
 	DBT	uid_dbt;
@@ -237,7 +237,7 @@ e_book_backend_db_cache_remove_contact (DB *db,
  * Return value: %TRUE if the cache contains the contact, %FALSE otherwise.
  **/
 gboolean
-e_book_backend_db_cache_check_contact (DB *db, const char *uid)
+e_book_backend_db_cache_check_contact (DB *db, const gchar *uid)
 {
 	DBT	uid_dbt, vcard_dbt;
 	int	db_error;
@@ -269,7 +269,7 @@ e_book_backend_db_cache_check_contact (DB *db, const char *uid)
  * Return value: A #GList of pointers to #EContact.
  **/
 GList *
-e_book_backend_db_cache_get_contacts (DB *db, const char *query)
+e_book_backend_db_cache_get_contacts (DB *db, const gchar *query)
 {
 	DBC	*dbc;
 	DBT	uid_dbt, vcard_dbt;
@@ -330,7 +330,7 @@ e_book_backend_db_cache_get_contacts (DB *db, const char *query)
  * Return value: A #GPtrArray of pointers to contact ID strings.
  **/
 GPtrArray *
-e_book_backend_db_cache_search (DB *db, const char *query)
+e_book_backend_db_cache_search (DB *db, const gchar *query)
 {
 	GList *matching_contacts, *temp;
 	GPtrArray *ptr_array;
@@ -357,9 +357,9 @@ e_book_backend_db_cache_search (DB *db, const char *query)
  * Return value: %TRUE if cache exists, %FALSE if not.
  **/
 gboolean
-e_book_backend_db_cache_exists (const char *uri)
+e_book_backend_db_cache_exists (const gchar *uri)
 {
-	char *file_name;
+	gchar *file_name;
 	gboolean exists = FALSE;
 	file_name = get_filename_from_uri (uri);
 
@@ -422,10 +422,10 @@ e_book_backend_db_cache_is_populated (DB *db)
 }
 
 void
-e_book_backend_db_cache_set_time(DB *db, const char *t)
+e_book_backend_db_cache_set_time(DB *db, const gchar *t)
 {
 	DBT uid_dbt, vcard_dbt;
-	int db_error;
+	gint db_error;
 
 	string_to_dbt ("last_update_time", &uid_dbt);
 	string_to_dbt (t, &vcard_dbt);
@@ -436,12 +436,12 @@ e_book_backend_db_cache_set_time(DB *db, const char *t)
 	}
 }
 
-char *
+gchar *
 e_book_backend_db_cache_get_time (DB *db)
 {
 	DBT uid_dbt, vcard_dbt;
-	int db_error;
-	char *t = NULL;
+	gint db_error;
+	gchar *t = NULL;
 
 	string_to_dbt ("last_update_time", &uid_dbt);
 	memset (&vcard_dbt, 0, sizeof(vcard_dbt));
diff --git a/addressbook/libedata-book/e-book-backend-db-cache.h b/addressbook/libedata-book/e-book-backend-db-cache.h
index eb8957f..c72d071 100644
--- a/addressbook/libedata-book/e-book-backend-db-cache.h
+++ b/addressbook/libedata-book/e-book-backend-db-cache.h
@@ -27,22 +27,22 @@
 
 G_BEGIN_DECLS
 
-EContact* e_book_backend_db_cache_get_contact (DB *db, const char *uid);
-void string_to_dbt(const char *str, DBT *dbt);
-char *e_book_backend_db_cache_get_filename(DB *db);
-void e_book_backend_db_cache_set_filename(DB *db, const char *filename);
+EContact* e_book_backend_db_cache_get_contact (DB *db, const gchar *uid);
+void string_to_dbt(const gchar *str, DBT *dbt);
+gchar *e_book_backend_db_cache_get_filename(DB *db);
+void e_book_backend_db_cache_set_filename(DB *db, const gchar *filename);
 gboolean e_book_backend_db_cache_add_contact (DB *db,
 					   EContact *contact);
 gboolean e_book_backend_db_cache_remove_contact (DB *db,
-					      const char *uid);
-gboolean e_book_backend_db_cache_check_contact (DB *db, const char *uid);
-GList*   e_book_backend_db_cache_get_contacts (DB *db, const char *query);
-gboolean e_book_backend_db_cache_exists (const char *uri);
+					      const gchar *uid);
+gboolean e_book_backend_db_cache_check_contact (DB *db, const gchar *uid);
+GList*   e_book_backend_db_cache_get_contacts (DB *db, const gchar *query);
+gboolean e_book_backend_db_cache_exists (const gchar *uri);
 void     e_book_backend_db_cache_set_populated (DB *db);
 gboolean e_book_backend_db_cache_is_populated (DB *db);
-GPtrArray* e_book_backend_db_cache_search (DB *db, const char *query);
-void e_book_backend_db_cache_set_time(DB *db, const char *t);
-char * e_book_backend_db_cache_get_time (DB *db);
+GPtrArray* e_book_backend_db_cache_search (DB *db, const gchar *query);
+void e_book_backend_db_cache_set_time(DB *db, const gchar *t);
+gchar * e_book_backend_db_cache_get_time (DB *db);
 
 G_END_DECLS
 
diff --git a/addressbook/libedata-book/e-book-backend-factory.c b/addressbook/libedata-book/e-book-backend-factory.c
index 0ec6d6e..66fdcc0 100644
--- a/addressbook/libedata-book/e-book-backend-factory.c
+++ b/addressbook/libedata-book/e-book-backend-factory.c
@@ -57,7 +57,7 @@ e_book_backend_factory_get_type (void)
  *
  * Return value: A string representing a protocol.
  **/
-const char*
+const gchar *
 e_book_backend_factory_get_protocol (EBookBackendFactory *factory)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_FACTORY (factory), NULL);
diff --git a/addressbook/libedata-book/e-book-backend-factory.h b/addressbook/libedata-book/e-book-backend-factory.h
index 6c530c5..cfa606d 100644
--- a/addressbook/libedata-book/e-book-backend-factory.h
+++ b/addressbook/libedata-book/e-book-backend-factory.h
@@ -44,13 +44,13 @@ typedef struct {
 typedef struct {
 	GObjectClass parent_class;
 
-	const char*   (*get_protocol) (EBookBackendFactory *factory);
+	const gchar *   (*get_protocol) (EBookBackendFactory *factory);
 	EBookBackend* (*new_backend)  (EBookBackendFactory *factory);
 } EBookBackendFactoryClass;
 
 GType                e_book_backend_factory_get_type             (void);
 
-const char*          e_book_backend_factory_get_protocol         (EBookBackendFactory *factory);
+const gchar *          e_book_backend_factory_get_protocol         (EBookBackendFactory *factory);
 EBookBackend*        e_book_backend_factory_new_backend          (EBookBackendFactory *factory);
 
 
@@ -69,7 +69,7 @@ _ ## p ##_factory_instance_init (EBookBackend## t ##Factory *factory) \
 { \
 } \
 \
-static const char * \
+static const gchar * \
 _ ## p ##_get_protocol (EBookBackendFactory *factory) \
 { \
 	return #p; \
diff --git a/addressbook/libedata-book/e-book-backend-sexp.c b/addressbook/libedata-book/e-book-backend-sexp.c
index 8872e5e..676708c 100644
--- a/addressbook/libedata-book/e-book-backend-sexp.c
+++ b/addressbook/libedata-book/e-book-backend-sexp.c
@@ -37,8 +37,8 @@ struct _SearchContext {
 };
 
 static gboolean
-compare_im (EContact *contact, const char *str,
-	    char *(*compare)(const char*, const char*),
+compare_im (EContact *contact, const gchar *str,
+	    gchar *(*compare)(const gchar *, const gchar *),
 	    EContactField im_field)
 {
 	GList    *aims, *l;
@@ -47,7 +47,7 @@ compare_im (EContact *contact, const char *str,
 	aims = e_contact_get (contact, im_field);
 
 	for (l = aims; l != NULL; l = l->next) {
-		char *im = (char *) l->data;
+		gchar *im = (gchar *) l->data;
 
 		if (im && compare (im, str)) {
 			found_it = TRUE;
@@ -62,70 +62,70 @@ compare_im (EContact *contact, const char *str,
 }
 
 static gboolean
-compare_im_aim (EContact *contact, const char *str,
-		char *(*compare)(const char*, const char*))
+compare_im_aim (EContact *contact, const gchar *str,
+		gchar *(*compare)(const gchar *, const gchar *))
 {
 	return compare_im (contact, str, compare, E_CONTACT_IM_AIM);
 }
 
 static gboolean
-compare_im_msn (EContact *contact, const char *str,
-		char *(*compare)(const char*, const char*))
+compare_im_msn (EContact *contact, const gchar *str,
+		gchar *(*compare)(const gchar *, const gchar *))
 {
 	return compare_im (contact, str, compare, E_CONTACT_IM_MSN);
 }
 
 static gboolean
-compare_im_skype (EContact *contact, const char *str,
-		char *(*compare)(const char*, const char*))
+compare_im_skype (EContact *contact, const gchar *str,
+		gchar *(*compare)(const gchar *, const gchar *))
 {
 	return compare_im (contact, str, compare, E_CONTACT_IM_SKYPE);
 }
 
 static gboolean
-compare_im_icq (EContact *contact, const char *str,
-		char *(*compare)(const char*, const char*))
+compare_im_icq (EContact *contact, const gchar *str,
+		gchar *(*compare)(const gchar *, const gchar *))
 {
 	return compare_im (contact, str, compare, E_CONTACT_IM_ICQ);
 }
 
 static gboolean
-compare_im_yahoo (EContact *contact, const char *str,
-		  char *(*compare)(const char*, const char*))
+compare_im_yahoo (EContact *contact, const gchar *str,
+		  gchar *(*compare)(const gchar *, const gchar *))
 {
 	return compare_im (contact, str, compare, E_CONTACT_IM_YAHOO);
 }
 
 static gboolean
-compare_im_gadugadu (EContact *contact, const char *str,
-		  char *(*compare)(const char*, const char*))
+compare_im_gadugadu (EContact *contact, const gchar *str,
+		  gchar *(*compare)(const gchar *, const gchar *))
 {
 	return compare_im (contact, str, compare, E_CONTACT_IM_GADUGADU);
 }
 
 
 static gboolean
-compare_im_jabber (EContact *contact, const char *str,
-		   char *(*compare)(const char*, const char*))
+compare_im_jabber (EContact *contact, const gchar *str,
+		   gchar *(*compare)(const gchar *, const gchar *))
 {
 	return compare_im (contact, str, compare, E_CONTACT_IM_JABBER);
 }
 
 static gboolean
-compare_im_groupwise (EContact *contact, const char *str,
-		      char *(*compare)(const char*, const char*))
+compare_im_groupwise (EContact *contact, const gchar *str,
+		      gchar *(*compare)(const gchar *, const gchar *))
 {
 	return compare_im (contact, str, compare, E_CONTACT_IM_GROUPWISE);
 }
 
 static gboolean
-compare_email (EContact *contact, const char *str,
-	       char *(*compare)(const char*, const char*))
+compare_email (EContact *contact, const gchar *str,
+	       gchar *(*compare)(const gchar *, const gchar *))
 {
-	int i;
+	gint i;
 
 	for (i = E_CONTACT_EMAIL_1; i <= E_CONTACT_EMAIL_4; i ++) {
-		const char *email = e_contact_get_const (contact, i);
+		const gchar *email = e_contact_get_const (contact, i);
 
 		if (email && compare(email, str))
 			return TRUE;
@@ -135,14 +135,14 @@ compare_email (EContact *contact, const char *str,
 }
 
 static gboolean
-compare_phone (EContact *contact, const char *str,
-	       char *(*compare)(const char*, const char*))
+compare_phone (EContact *contact, const gchar *str,
+	       gchar *(*compare)(const gchar *, const gchar *))
 {
-	int i;
+	gint i;
 	gboolean rv = FALSE;
 
 	for (i = E_CONTACT_FIRST_PHONE_ID; i <= E_CONTACT_LAST_PHONE_ID; i ++) {
-		char *phone = e_contact_get (contact, i);
+		gchar *phone = e_contact_get (contact, i);
 
 		rv = phone && compare(phone, str);
 		g_free (phone);
@@ -155,10 +155,10 @@ compare_phone (EContact *contact, const char *str,
 }
 
 static gboolean
-compare_name (EContact *contact, const char *str,
-	      char *(*compare)(const char*, const char*))
+compare_name (EContact *contact, const gchar *str,
+	      gchar *(*compare)(const gchar *, const gchar *))
 {
-	const char *name;
+	const gchar *name;
 
 	name = e_contact_get_const (contact, E_CONTACT_FULL_NAME);
 	if (name && compare (name, str))
@@ -180,11 +180,11 @@ compare_name (EContact *contact, const char *str,
 }
 
 static gboolean
-compare_address (EContact *contact, const char *str,
-		 char *(*compare)(const char*, const char*))
+compare_address (EContact *contact, const gchar *str,
+		 gchar *(*compare)(const gchar *, const gchar *))
 {
 
-	int i;
+	gint i;
 	gboolean rv = FALSE;
 
 	for (i = E_CONTACT_FIRST_ADDRESS_ID; i <= E_CONTACT_LAST_ADDRESS_ID; i ++) {
@@ -210,8 +210,8 @@ compare_address (EContact *contact, const char *str,
 }
 
 static gboolean
-compare_category (EContact *contact, const char *str,
-		  char *(*compare)(const char*, const char*))
+compare_category (EContact *contact, const gchar *str,
+		  gchar *(*compare)(const gchar *, const gchar *))
 {
 	GList *categories;
 	GList *iterator;
@@ -220,7 +220,7 @@ compare_category (EContact *contact, const char *str,
 	categories = e_contact_get (contact, E_CONTACT_CATEGORY_LIST);
 
 	for (iterator = categories; iterator; iterator = iterator->next) {
-		const char *category = iterator->data;
+		const gchar *category = iterator->data;
 
 		if (compare(category, str)) {
 			ret_val = TRUE;
@@ -236,12 +236,12 @@ compare_category (EContact *contact, const char *str,
 
 static struct prop_info {
 	EContactField field_id;
-	const char *query_prop;
+	const gchar *query_prop;
 #define PROP_TYPE_NORMAL   0x01
 #define PROP_TYPE_LIST     0x02
-	int prop_type;
-	gboolean (*list_compare)(EContact *contact, const char *str,
-				 char *(*compare)(const char*, const char*));
+	gint prop_type;
+	gboolean (*list_compare)(EContact *contact, const gchar *str,
+				 gchar *(*compare)(const gchar *, const gchar *));
 
 } prop_info_table[] = {
 #define NORMAL_PROP(f,q) {f, q, PROP_TYPE_NORMAL, NULL}
@@ -287,18 +287,18 @@ static struct prop_info {
 
 static ESExpResult *
 entry_compare(SearchContext *ctx, struct _ESExp *f,
-	      int argc, struct _ESExpResult **argv,
-	      char *(*compare)(const char*, const char*))
+	      gint argc, struct _ESExpResult **argv,
+	      gchar *(*compare)(const gchar *, const gchar *))
 {
 	ESExpResult *r;
-	int truth = FALSE;
+	gint truth = FALSE;
 
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname;
+		gchar *propname;
 		struct prop_info *info = NULL;
-		int i;
+		gint i;
 		gboolean any_field;
 		gboolean saw_any = FALSE;
 
@@ -319,7 +319,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
 					truth = FALSE;
 				}
 				else if (info->prop_type == PROP_TYPE_NORMAL) {
-					const char *prop = NULL;
+					const gchar *prop = NULL;
 					/* straight string property matches */
 
 					prop = e_contact_get_const (ctx->contact, info->field_id);
@@ -352,7 +352,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
 			EContactField fid = e_contact_field_id (propname);
 
 			if (fid >= E_CONTACT_FIELD_FIRST && fid < E_CONTACT_FIELD_LAST) {
-				const char *prop = e_contact_get_const (ctx->contact, fid);
+				const gchar *prop = e_contact_get_const (ctx->contact, fid);
 
 				if (prop && compare (prop, argv[1]->value.string)) {
 					truth = TRUE;
@@ -368,7 +368,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
 				GList *l, *values = attr ? e_vcard_attribute_get_values (attr) : NULL;
 
 				for (l = values; l && !truth; l = l->next) {
-					const char *value = l->data;
+					const gchar *value = l->data;
 
 					if (value && compare (value, argv[1]->value.string)) {
 						truth = TRUE;
@@ -393,7 +393,7 @@ contains_helper_free_word (gpointer data, gpointer user_data)
 	}
 }
 
-static char *
+static gchar *
 try_contains_word (const gchar *s1, GSList *word)
 {
 	const gchar *o, *p;
@@ -403,7 +403,7 @@ try_contains_word (const gchar *s1, GSList *word)
 	if (s1 == NULL)
 		return NULL;
 	if (word == NULL)
-		return (char*)s1; /* previous was last word */
+		return (gchar *)s1; /* previous was last word */
 	if (word->data == NULL)
 		return NULL; /* illegal structure */
 
@@ -430,7 +430,7 @@ try_contains_word (const gchar *s1, GSList *word)
 				/* we read whole word and no illegal character has been found */
 				if (word->next == NULL ||
 				    try_contains_word (e_util_unicode_get_utf8 (o, &unival), word->next)) {
-					return (char*)o;
+					return (gchar *)o;
 				}
 			}
 		}
@@ -445,7 +445,7 @@ try_contains_word (const gchar *s1, GSList *word)
    returns newly allocated GString
 */
 static GString *
-chars_to_unistring_lowercase (const char *pstr)
+chars_to_unistring_lowercase (const gchar *pstr)
 {
 	GString *res;
 	gunichar unich;
@@ -478,17 +478,17 @@ chars_to_unistring_lowercase (const char *pstr)
 /* first space between words is treated as wildcard character;
    we are looking for s2 in s1, so s2 will be breaked into words
 */
-static char *
-contains_helper (const char *s1, const char *s2)
+static gchar *
+contains_helper (const gchar *s1, const gchar *s2)
 {
 	GString *s1uni;
 	GString *s2uni;
 	GSList *words;
-	char *next;
+	gchar *next;
 	gboolean have_nonspace;
 	gboolean have_space;
 	GString *last_word, *w;
-	char *res = NULL;
+	gchar *res = NULL;
 	gunichar unich;
 	glong len1, len2;
 
@@ -497,7 +497,7 @@ contains_helper (const char *s1, const char *s2)
 
 	/* the initial word contains an empty string for sure */
 	if (!*s2)
-		return (char *)s1;
+		return (gchar *)s1;
 
 	s1uni = chars_to_unistring_lowercase (s1);
 	if (s1uni == NULL)
@@ -517,7 +517,7 @@ contains_helper (const char *s1, const char *s2)
 
 		/* both are empty strings */
 		if (len1 == len2)
-			return (char *)s1;
+			return (gchar *)s1;
 
 		return NULL;
 	}
@@ -570,23 +570,23 @@ contains_helper (const char *s1, const char *s2)
 }
 
 static ESExpResult *
-func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 
 	return entry_compare (ctx, f, argc, argv, contains_helper);
 }
 
-static char *
-is_helper (const char *ps1, const char *ps2)
+static gchar *
+is_helper (const gchar *ps1, const gchar *ps2)
 {
-	char *s1, *s2, *res;
+	gchar *s1, *s2, *res;
 
 	s1 = e_util_utf8_remove_accents (ps1);
 	s2 = e_util_utf8_remove_accents (ps2);
 
 	if (!e_util_utf8_strcasecmp (s1, s2))
-		res = (char*)ps1;
+		res = (gchar *)ps1;
 	else
 		res = NULL;
 
@@ -597,26 +597,26 @@ is_helper (const char *ps1, const char *ps2)
 }
 
 static ESExpResult *
-func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_is(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 
 	return entry_compare (ctx, f, argc, argv, is_helper);
 }
 
-static char *
-endswith_helper (const char *ps1, const char *ps2)
+static gchar *
+endswith_helper (const gchar *ps1, const gchar *ps2)
 {
-	char *s1 = e_util_utf8_remove_accents (ps1);
-	char *s2 = e_util_utf8_remove_accents (ps2);
-	char *res;
+	gchar *s1 = e_util_utf8_remove_accents (ps1);
+	gchar *s2 = e_util_utf8_remove_accents (ps2);
+	gchar *res;
 	glong s1len = g_utf8_strlen (s1, -1);
 	glong s2len = g_utf8_strlen (s2, -1);
 
 	if (s1len < s2len)
 		res = NULL;
 	else
-		res = (char *)e_util_utf8_strstrcase (g_utf8_offset_to_pointer (s1, s1len - s2len), s2);
+		res = (gchar *)e_util_utf8_strstrcase (g_utf8_offset_to_pointer (s1, s1len - s2len), s2);
 
 	g_free (s1);
 	g_free (s2);
@@ -625,23 +625,23 @@ endswith_helper (const char *ps1, const char *ps2)
 }
 
 static ESExpResult *
-func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_endswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 
 	return entry_compare (ctx, f, argc, argv, endswith_helper);
 }
 
-static char *
-beginswith_helper (const char *ps1, const char *ps2)
+static gchar *
+beginswith_helper (const gchar *ps1, const gchar *ps2)
 {
-	char *p, *res;
-	char *s1 = e_util_utf8_remove_accents (ps1);
-	char *s2 = e_util_utf8_remove_accents (ps2);
+	gchar *p, *res;
+	gchar *s1 = e_util_utf8_remove_accents (ps1);
+	gchar *s2 = e_util_utf8_remove_accents (ps2);
 
-	if ((p = (char*) e_util_utf8_strstrcase(s1, s2))
+	if ((p = (gchar *) e_util_utf8_strstrcase(s1, s2))
 	    && (p == s1))
-		res = (char *)ps1;
+		res = (gchar *)ps1;
 	else
 		res = NULL;
 
@@ -652,21 +652,21 @@ beginswith_helper (const char *ps1, const char *ps2)
 }
 
 static ESExpResult *
-func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_beginswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 
 	return entry_compare (ctx, f, argc, argv, beginswith_helper);
 }
 
-static char *
-exists_helper (const char *ps1, const char *ps2)
+static gchar *
+exists_helper (const gchar *ps1, const gchar *ps2)
 {
-	char *res;
-	char *s1 = e_util_utf8_remove_accents (ps1);
-	char *s2 = e_util_utf8_remove_accents (ps2);
+	gchar *res;
+	gchar *s1 = e_util_utf8_remove_accents (ps1);
+	gchar *s2 = e_util_utf8_remove_accents (ps2);
 
-	res = (char *)e_util_utf8_strstrcase (s1, s2);
+	res = (gchar *)e_util_utf8_strstrcase (s1, s2);
 
 	g_free (s1);
 	g_free (s2);
@@ -675,17 +675,17 @@ exists_helper (const char *ps1, const char *ps2)
 }
 
 static ESExpResult *
-func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *r;
-	int truth = FALSE;
+	gint truth = FALSE;
 
 	if (argc == 1
 	    && argv[0]->type == ESEXP_RES_STRING) {
-		char *propname;
+		gchar *propname;
 		struct prop_info *info = NULL;
-		int i;
+		gint i;
 		gboolean saw_any = FALSE;
 
 		propname = argv[0]->value.string;
@@ -696,7 +696,7 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 				info = &prop_info_table[i];
 
 				if (info->prop_type == PROP_TYPE_NORMAL) {
-					const char *prop = NULL;
+					const gchar *prop = NULL;
 					/* searches where the query's property
 					   maps directly to an ecard property */
 
@@ -721,7 +721,7 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 			EContactField fid = e_contact_field_id (propname);
 
 			if (fid >= E_CONTACT_FIELD_FIRST && fid < E_CONTACT_FIELD_LAST) {
-				const char *prop = e_contact_get_const (ctx->contact, fid);
+				const gchar *prop = e_contact_get_const (ctx->contact, fid);
 
 				if (prop && *prop)
 					truth = TRUE;
@@ -731,7 +731,7 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 				GList *l, *values = attr ? e_vcard_attribute_get_values (attr) : NULL;
 
 				for (l = values; l && !truth; l = l->next) {
-					const char *value = l->data;
+					const gchar *value = l->data;
 
 					if (value && *value)
 						truth = TRUE;
@@ -746,17 +746,17 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_exists_vcard(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_exists_vcard(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *r;
-	int truth = FALSE;
+	gint truth = FALSE;
 
 	if (argc == 1 && argv[0]->type == ESEXP_RES_STRING) {
-		const char *attr_name;
+		const gchar *attr_name;
 		EVCardAttribute *attr;
 		GList *values;
-		char *s;
+		gchar *s;
 
 		attr_name = argv[0]->value.string;
 		attr = e_vcard_get_attribute (E_VCARD (ctx->contact), attr_name);
@@ -779,9 +779,9 @@ func_exists_vcard(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *
 
 /* '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[] = {
 	{ "contains", func_contains, 0 },
@@ -835,7 +835,7 @@ e_book_backend_sexp_match_contact (EBookBackendSExp *sexp, EContact *contact)
  * Return value: %TRUE if the VCard matches, %FALSE otherwise.
  **/
 gboolean
-e_book_backend_sexp_match_vcard (EBookBackendSExp *sexp, const char *vcard)
+e_book_backend_sexp_match_vcard (EBookBackendSExp *sexp, const gchar *vcard)
 {
 	EContact *contact;
 	gboolean retval;
@@ -860,11 +860,11 @@ e_book_backend_sexp_match_vcard (EBookBackendSExp *sexp, const char *vcard)
  * Return value: A new #EBookBackendSExp.
  **/
 EBookBackendSExp *
-e_book_backend_sexp_new (const char *text)
+e_book_backend_sexp_new (const gchar *text)
 {
 	EBookBackendSExp *sexp = g_object_new (E_TYPE_BACKEND_SEXP, NULL);
-	int esexp_error;
-	int i;
+	gint esexp_error;
+	gint i;
 
 	sexp->priv->search_sexp = e_sexp_new();
 
diff --git a/addressbook/libedata-book/e-book-backend-sexp.h b/addressbook/libedata-book/e-book-backend-sexp.h
index 6eeccea..42d6e93 100644
--- a/addressbook/libedata-book/e-book-backend-sexp.h
+++ b/addressbook/libedata-book/e-book-backend-sexp.h
@@ -49,10 +49,10 @@ struct _EBookBackendSExpClass {
 	GObjectClass parent_class;
 };
 
-EBookBackendSExp *e_book_backend_sexp_new      (const char *text);
+EBookBackendSExp *e_book_backend_sexp_new      (const gchar *text);
 GType               e_book_backend_sexp_get_type (void);
 
-gboolean            e_book_backend_sexp_match_vcard (EBookBackendSExp *sexp, const char *vcard);
+gboolean            e_book_backend_sexp_match_vcard (EBookBackendSExp *sexp, const gchar *vcard);
 gboolean            e_book_backend_sexp_match_contact (EBookBackendSExp *sexp, EContact *contact);
 
 G_END_DECLS
diff --git a/addressbook/libedata-book/e-book-backend-summary.c b/addressbook/libedata-book/e-book-backend-summary.c
index 079ccd4..f9c7d95 100644
--- a/addressbook/libedata-book/e-book-backend-summary.c
+++ b/addressbook/libedata-book/e-book-backend-summary.c
@@ -45,33 +45,33 @@
 static GObjectClass *parent_class;
 
 struct _EBookBackendSummaryPrivate {
-	char *summary_path;
+	gchar *summary_path;
 	FILE *fp;
 	guint32 file_version;
 	time_t mtime;
 	gboolean upgraded;
 	gboolean dirty;
-	int flush_timeout_millis;
-	int flush_timeout;
+	gint flush_timeout_millis;
+	gint flush_timeout;
 	GPtrArray *items;
 	GHashTable *id_to_item;
 	guint32 num_items; /* used only for loading */
 #ifdef SUMMARY_STATS
-	int size;
+	gint size;
 #endif
 };
 
 typedef struct {
-	char *id;
-	char *nickname;
-	char *full_name;
-	char *given_name;
-	char *surname;
-	char *file_as;
-	char *email_1;
-	char *email_2;
-	char *email_3;
-	char *email_4;
+	gchar *id;
+	gchar *nickname;
+	gchar *full_name;
+	gchar *given_name;
+	gchar *surname;
+	gchar *file_as;
+	gchar *email_1;
+	gchar *email_2;
+	gchar *email_3;
+	gchar *email_4;
 	gboolean wants_html;
 	gboolean wants_html_set;
 	gboolean list;
@@ -133,8 +133,8 @@ free_summary_item (EBookBackendSummaryItem *item)
 static void
 clear_items (EBookBackendSummary *summary)
 {
-	int i;
-	int num = summary->priv->items->len;
+	gint i;
+	gint num = summary->priv->items->len;
 	for (i = 0; i < num; i++) {
 		EBookBackendSummaryItem *item = g_ptr_array_remove_index_fast (summary->priv->items, 0);
 		if (item) {
@@ -157,7 +157,7 @@ clear_items (EBookBackendSummary *summary)
  * Return value: A new #EBookBackendSummary.
  **/
 EBookBackendSummary*
-e_book_backend_summary_new (const char *summary_path, int flush_timeout_millis)
+e_book_backend_summary_new (const gchar *summary_path, gint flush_timeout_millis)
 {
 	EBookBackendSummary *summary = g_object_new (E_TYPE_BACKEND_SUMMARY, NULL);
 
@@ -265,8 +265,8 @@ e_book_backend_summary_get_type (void)
 static gboolean
 e_book_backend_summary_check_magic (EBookBackendSummary *summary, FILE *fp)
 {
-	char buf [PAS_SUMMARY_MAGIC_LEN + 1];
-	int rv;
+	gchar buf [PAS_SUMMARY_MAGIC_LEN + 1];
+	gint rv;
 
 	memset (buf, 0, sizeof (buf));
 
@@ -283,7 +283,7 @@ static gboolean
 e_book_backend_summary_load_header (EBookBackendSummary *summary, FILE *fp,
 				 EBookBackendSummaryHeader *header)
 {
-	int rv;
+	gint rv;
 
 	rv = fread (&header->file_version, sizeof (header->file_version), 1, fp);
 	if (rv != 1)
@@ -309,11 +309,11 @@ e_book_backend_summary_load_header (EBookBackendSummary *summary, FILE *fp,
 	return TRUE;
 }
 
-static char *
-read_string (FILE *fp, int len)
+static gchar *
+read_string (FILE *fp, gint len)
 {
-	char *buf;
-	int rv;
+	gchar *buf;
+	gint rv;
 
 	buf = g_new0 (char, len + 1);
 
@@ -331,12 +331,12 @@ e_book_backend_summary_load_item (EBookBackendSummary *summary,
 			       EBookBackendSummaryItem **new_item)
 {
 	EBookBackendSummaryItem *item;
-	char *buf;
+	gchar *buf;
 	FILE *fp = summary->priv->fp;
 
 	if (summary->priv->file_version >= PAS_SUMMARY_FILE_VERSION_4_0) {
 		EBookBackendSummaryDiskItem disk_item;
-		int rv = fread (&disk_item, sizeof (disk_item), 1, fp);
+		gint rv = fread (&disk_item, sizeof (disk_item), 1, fp);
 		if (rv != 1)
 			return FALSE;
 
@@ -478,7 +478,7 @@ e_book_backend_summary_open (EBookBackendSummary *summary)
 		/* if there's no summary present, look for the .new
 		   file and rename it if it's there, and attempt to
 		   load that */
-		char *new_filename = g_strconcat (summary->priv->summary_path, ".new", NULL);
+		gchar *new_filename = g_strconcat (summary->priv->summary_path, ".new", NULL);
 		if (g_stat (new_filename, &sb) == -1) {
 			g_free (new_filename);
 			return FALSE;
@@ -529,7 +529,7 @@ gboolean
 e_book_backend_summary_load (EBookBackendSummary *summary)
 {
 	EBookBackendSummaryItem *new_item;
-	int i;
+	gint i;
 
 	g_return_val_if_fail (summary != NULL, FALSE);
 
@@ -563,7 +563,7 @@ e_book_backend_summary_load (EBookBackendSummary *summary)
 static gboolean
 e_book_backend_summary_save_magic (FILE *fp)
 {
-	int rv;
+	gint rv;
 	rv = fwrite (PAS_SUMMARY_MAGIC, PAS_SUMMARY_MAGIC_LEN, 1, fp);
 	if (rv != 1)
 		return FALSE;
@@ -575,7 +575,7 @@ static gboolean
 e_book_backend_summary_save_header (EBookBackendSummary *summary, FILE *fp)
 {
 	EBookBackendSummaryHeader header;
-	int rv;
+	gint rv;
 
 	header.file_version = g_htonl (PAS_SUMMARY_FILE_VERSION);
 	header.num_items = g_htonl (summary->priv->items->len);
@@ -589,9 +589,9 @@ e_book_backend_summary_save_header (EBookBackendSummary *summary, FILE *fp)
 }
 
 static gboolean
-save_string (const char *str, FILE *fp)
+save_string (const gchar *str, FILE *fp)
 {
-	int rv;
+	gint rv;
 
 	if (!str || !*str)
 		return TRUE;
@@ -604,8 +604,8 @@ static gboolean
 e_book_backend_summary_save_item (EBookBackendSummary *summary, FILE *fp, EBookBackendSummaryItem *item)
 {
 	EBookBackendSummaryDiskItem disk_item;
-	int len;
-	int rv;
+	gint len;
+	gint rv;
 
 	len = item->id ? strlen (item->id) : 0;
 	disk_item.id_len = g_htons (len);
@@ -683,8 +683,8 @@ e_book_backend_summary_save (EBookBackendSummary *summary)
 {
 	struct stat sb;
 	FILE *fp = NULL;
-	char *new_filename = NULL;
-	int i;
+	gchar *new_filename = NULL;
+	gint i;
 
 	g_return_val_if_fail (summary != NULL, FALSE);
 
@@ -763,7 +763,7 @@ void
 e_book_backend_summary_add_contact (EBookBackendSummary *summary, EContact *contact)
 {
 	EBookBackendSummaryItem *new_item;
-	char *id = NULL;
+	gchar *id = NULL;
 
 	g_return_if_fail (summary != NULL);
 
@@ -824,7 +824,7 @@ e_book_backend_summary_add_contact (EBookBackendSummary *summary, EContact *cont
  * Removes the summary of the contact identified by @id from @summary.
  **/
 void
-e_book_backend_summary_remove_contact (EBookBackendSummary *summary, const char *id)
+e_book_backend_summary_remove_contact (EBookBackendSummary *summary, const gchar *id)
 {
 	EBookBackendSummaryItem *item;
 
@@ -854,7 +854,7 @@ e_book_backend_summary_remove_contact (EBookBackendSummary *summary, const char
  * Return value: %TRUE if the summary exists, %FALSE otherwise.
  **/
 gboolean
-e_book_backend_summary_check_contact (EBookBackendSummary *summary, const char *id)
+e_book_backend_summary_check_contact (EBookBackendSummary *summary, const gchar *id)
 {
 	g_return_val_if_fail (summary != NULL, FALSE);
 
@@ -929,15 +929,15 @@ e_book_backend_summary_is_up_to_date (EBookBackendSummary *summary, time_t t)
 /* we only want to do summary queries if the query is over the set fields in the summary */
 
 static ESExpResult *
-func_check(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_check(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
-	int truth = FALSE;
+	gint truth = FALSE;
 
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *query_name = argv[0]->value.string;
+		gchar *query_name = argv[0]->value.string;
 
 		if (!strcmp (query_name, "nickname") ||
 		    !strcmp (query_name, "full_name") ||
@@ -955,9 +955,9 @@ func_check(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 
 /* 'builtin' functions */
 static const 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 */
 } check_symbols[] = {
 	{ "contains", func_check, 0 },
@@ -978,13 +978,13 @@ static const struct {
  * Return value: %TRUE if the query can be satisfied, %FALSE otherwise.
  **/
 gboolean
-e_book_backend_summary_is_summary_query (EBookBackendSummary *summary, const char *query)
+e_book_backend_summary_is_summary_query (EBookBackendSummary *summary, const gchar *query)
 {
 	ESExp *sexp;
 	ESExpResult *r;
 	gboolean retval;
-	int i;
-	int esexp_error;
+	gint i;
+	gint esexp_error;
 
 	g_return_val_if_fail (summary != NULL, FALSE);
 
@@ -1022,13 +1022,13 @@ e_book_backend_summary_is_summary_query (EBookBackendSummary *summary, const cha
 
 /* the actual query mechanics */
 static ESExpResult *
-do_compare (EBookBackendSummary *summary, struct _ESExp *f, int argc,
+do_compare (EBookBackendSummary *summary, struct _ESExp *f, gint argc,
 	    struct _ESExpResult **argv,
-	    char *(*compare)(const char*, const char*))
+	    gchar *(*compare)(const gchar *, const gchar *))
 {
 	GPtrArray *result = g_ptr_array_new ();
 	ESExpResult *r;
-	int i;
+	gint i;
 
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
@@ -1037,9 +1037,9 @@ do_compare (EBookBackendSummary *summary, struct _ESExp *f, int argc,
 		for (i = 0; i < summary->priv->items->len; i ++) {
 			EBookBackendSummaryItem *item = g_ptr_array_index (summary->priv->items, i);
 			if (!strcmp (argv[0]->value.string, "full_name")) {
-				char *given = item->given_name;
-				char *surname = item->surname;
-				char *full_name = item->full_name;
+				gchar *given = item->given_name;
+				gchar *surname = item->surname;
+				gchar *full_name = item->full_name;
 
 				if ((given && compare (given, argv[1]->value.string))
 				    || (surname && compare (surname, argv[1]->value.string))
@@ -1047,10 +1047,10 @@ do_compare (EBookBackendSummary *summary, struct _ESExp *f, int argc,
 					g_ptr_array_add (result, item->id);
 			}
 			else if (!strcmp (argv[0]->value.string, "email")) {
-				char *email_1 = item->email_1;
-				char *email_2 = item->email_2;
-				char *email_3 = item->email_3;
-				char *email_4 = item->email_4;
+				gchar *email_1 = item->email_1;
+				gchar *email_2 = item->email_2;
+				gchar *email_3 = item->email_3;
+				gchar *email_4 = item->email_4;
 				if ((email_1 && compare (email_1, argv[1]->value.string))
 				    || (email_2 && compare (email_2, argv[1]->value.string))
 				    || (email_3 && compare (email_3, argv[1]->value.string))
@@ -1058,12 +1058,12 @@ do_compare (EBookBackendSummary *summary, struct _ESExp *f, int argc,
 					g_ptr_array_add (result, item->id);
 			}
 			else if (!strcmp (argv[0]->value.string, "file_as")) {
-				char *file_as = item->file_as;
+				gchar *file_as = item->file_as;
 				if (file_as && compare (file_as, argv[1]->value.string))
 					g_ptr_array_add (result, item->id);
 			}
 			else if (!strcmp (argv[0]->value.string, "nickname")) {
-				char *nickname = item->nickname;
+				gchar *nickname = item->nickname;
 				if (nickname && compare (nickname, argv[1]->value.string))
 					g_ptr_array_add (result, item->id);
 			}
@@ -1076,14 +1076,14 @@ do_compare (EBookBackendSummary *summary, struct _ESExp *f, int argc,
 	return r;
 }
 
-static char *
-contains_helper (const char *ps1, const char *ps2)
+static gchar *
+contains_helper (const gchar *ps1, const gchar *ps2)
 {
-	char *s1 = e_util_utf8_remove_accents (ps1);
-	char *s2 = e_util_utf8_remove_accents (ps2);
-	char *res;
+	gchar *s1 = e_util_utf8_remove_accents (ps1);
+	gchar *s2 = e_util_utf8_remove_accents (ps2);
+	gchar *res;
 
-	res = (char *) e_util_utf8_strstrcase (s1, s2);
+	res = (gchar *) e_util_utf8_strstrcase (s1, s2);
 
 	g_free (s1);
 	g_free (s2);
@@ -1092,22 +1092,22 @@ contains_helper (const char *ps1, const char *ps2)
 }
 
 static ESExpResult *
-func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendSummary *summary = data;
 
 	return do_compare (summary, f, argc, argv, contains_helper);
 }
 
-static char *
-is_helper (const char *ps1, const char *ps2)
+static gchar *
+is_helper (const gchar *ps1, const gchar *ps2)
 {
-	char *s1 = e_util_utf8_remove_accents (ps1);
-	char *s2 = e_util_utf8_remove_accents (ps2);
-	char *res;
+	gchar *s1 = e_util_utf8_remove_accents (ps1);
+	gchar *s2 = e_util_utf8_remove_accents (ps2);
+	gchar *res;
 
 	if (!e_util_utf8_strcasecmp (s1, s2))
-		res = (char*)ps1;
+		res = (gchar *)ps1;
 	else
 		res = NULL;
 
@@ -1118,26 +1118,26 @@ is_helper (const char *ps1, const char *ps2)
 }
 
 static ESExpResult *
-func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_is(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendSummary *summary = data;
 
 	return do_compare (summary, f, argc, argv, is_helper);
 }
 
-static char *
-endswith_helper (const char *ps1, const char *ps2)
+static gchar *
+endswith_helper (const gchar *ps1, const gchar *ps2)
 {
-	char *s1 = e_util_utf8_remove_accents (ps1);
-	char *s2 = e_util_utf8_remove_accents (ps2);
-	char *res;
+	gchar *s1 = e_util_utf8_remove_accents (ps1);
+	gchar *s2 = e_util_utf8_remove_accents (ps2);
+	gchar *res;
 	glong s1len = g_utf8_strlen (s1, -1);
 	glong s2len = g_utf8_strlen (s2, -1);
 
 	if (s1len < s2len)
 		res = NULL;
 	else
-		res = (char *)e_util_utf8_strstrcase (g_utf8_offset_to_pointer (s1, s1len - s2len), s2);
+		res = (gchar *)e_util_utf8_strstrcase (g_utf8_offset_to_pointer (s1, s1len - s2len), s2);
 
 	g_free (s1);
 	g_free (s2);
@@ -1146,23 +1146,23 @@ endswith_helper (const char *ps1, const char *ps2)
 }
 
 static ESExpResult *
-func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_endswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendSummary *summary = data;
 
 	return do_compare (summary, f, argc, argv, endswith_helper);
 }
 
-static char *
-beginswith_helper (const char *ps1, const char *ps2)
+static gchar *
+beginswith_helper (const gchar *ps1, const gchar *ps2)
 {
-	char *p, *res;
-	char *s1 = e_util_utf8_remove_accents (ps1);
-	char *s2 = e_util_utf8_remove_accents (ps2);
+	gchar *p, *res;
+	gchar *s1 = e_util_utf8_remove_accents (ps1);
+	gchar *s2 = e_util_utf8_remove_accents (ps2);
 
-	if ((p = (char*) e_util_utf8_strstrcase(s1, s2))
+	if ((p = (gchar *) e_util_utf8_strstrcase(s1, s2))
 	    && (p == s1))
-		res = (char *)ps1;
+		res = (gchar *)ps1;
 	else
 		res = NULL;
 
@@ -1173,7 +1173,7 @@ beginswith_helper (const char *ps1, const char *ps2)
 }
 
 static ESExpResult *
-func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+func_beginswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	EBookBackendSummary *summary = data;
 
@@ -1182,9 +1182,9 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
 
 /* 'builtin' functions */
 static const 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[] = {
 	{ "contains", func_contains, 0 },
@@ -1203,13 +1203,13 @@ static const struct {
  * Return value: A #GPtrArray of pointers to contact ID strings.
  **/
 GPtrArray*
-e_book_backend_summary_search (EBookBackendSummary *summary, const char *query)
+e_book_backend_summary_search (EBookBackendSummary *summary, const gchar *query)
 {
 	ESExp *sexp;
 	ESExpResult *r;
 	GPtrArray *retval;
-	int i;
-	int esexp_error;
+	gint i;
+	gint esexp_error;
 
 	g_return_val_if_fail (summary != NULL, NULL);
 
@@ -1237,7 +1237,7 @@ e_book_backend_summary_search (EBookBackendSummary *summary, const char *query)
 
 	if (r && r->type == ESEXP_RES_ARRAY_PTR && r->value.ptrarray) {
 		GPtrArray *ptrarray = r->value.ptrarray;
-		int i;
+		gint i;
 
 		for (i = 0; i < ptrarray->len; i ++)
 			g_ptr_array_add (retval, g_ptr_array_index (ptrarray, i));
@@ -1260,8 +1260,8 @@ e_book_backend_summary_search (EBookBackendSummary *summary, const char *query)
  *
  * Return value: A new VCard, or %NULL if the contact summary didn't exist.
  **/
-char*
-e_book_backend_summary_get_summary_vcard(EBookBackendSummary *summary, const char *id)
+gchar *
+e_book_backend_summary_get_summary_vcard(EBookBackendSummary *summary, const gchar *id)
 {
 	EBookBackendSummaryItem *item;
 
@@ -1271,7 +1271,7 @@ e_book_backend_summary_get_summary_vcard(EBookBackendSummary *summary, const cha
 
 	if (item) {
 		EContact *contact = e_contact_new ();
-		char *vcard;
+		gchar *vcard;
 
 		e_contact_set (contact, E_CONTACT_UID, item->id);
 		e_contact_set (contact, E_CONTACT_FILE_AS, item->file_as);
diff --git a/addressbook/libedata-book/e-book-backend-summary.h b/addressbook/libedata-book/e-book-backend-summary.h
index a807c26..591b11c 100644
--- a/addressbook/libedata-book/e-book-backend-summary.h
+++ b/addressbook/libedata-book/e-book-backend-summary.h
@@ -49,8 +49,8 @@ struct _EBookBackendSummaryClass{
 	GObjectClass parent_class;
 };
 
-EBookBackendSummary* e_book_backend_summary_new              (const char *summary_path,
-							 int flush_timeout_millis);
+EBookBackendSummary* e_book_backend_summary_new              (const gchar *summary_path,
+							 gint flush_timeout_millis);
 GType              e_book_backend_summary_get_type         (void);
 
 /* returns FALSE if the load fails for any reason (including that the
@@ -60,17 +60,17 @@ gboolean           e_book_backend_summary_load             (EBookBackendSummary
 gboolean           e_book_backend_summary_save              (EBookBackendSummary *summary);
 
 void               e_book_backend_summary_add_contact       (EBookBackendSummary *summary, EContact *contact);
-void               e_book_backend_summary_remove_contact    (EBookBackendSummary *summary, const char *id);
-gboolean           e_book_backend_summary_check_contact     (EBookBackendSummary *summary, const char *id);
+void               e_book_backend_summary_remove_contact    (EBookBackendSummary *summary, const gchar *id);
+gboolean           e_book_backend_summary_check_contact     (EBookBackendSummary *summary, const gchar *id);
 
 void               e_book_backend_summary_touch             (EBookBackendSummary *summary);
 
 /* returns TRUE if the summary's mtime is >= @t. */
 gboolean           e_book_backend_summary_is_up_to_date     (EBookBackendSummary *summary, time_t t);
 
-gboolean           e_book_backend_summary_is_summary_query  (EBookBackendSummary *summary, const char *query);
-GPtrArray*         e_book_backend_summary_search            (EBookBackendSummary *summary, const char *query);
-char*              e_book_backend_summary_get_summary_vcard (EBookBackendSummary *summary, const char *id);
+gboolean           e_book_backend_summary_is_summary_query  (EBookBackendSummary *summary, const gchar *query);
+GPtrArray*         e_book_backend_summary_search            (EBookBackendSummary *summary, const gchar *query);
+gchar *              e_book_backend_summary_get_summary_vcard (EBookBackendSummary *summary, const gchar *id);
 
 G_END_DECLS
 
diff --git a/addressbook/libedata-book/e-book-backend-sync.c b/addressbook/libedata-book/e-book-backend-sync.c
index 28441ff..3365a1c 100644
--- a/addressbook/libedata-book/e-book-backend-sync.c
+++ b/addressbook/libedata-book/e-book-backend-sync.c
@@ -13,7 +13,7 @@
 #include "e-book-backend-sync.h"
 
 struct _EBookBackendSyncPrivate {
-  int mumble;
+  gint mumble;
 };
 
 static GObjectClass *parent_class;
@@ -48,7 +48,7 @@ EBookBackendSyncStatus
 e_book_backend_sync_create_contact (EBookBackendSync *backend,
 				    EDataBook *book,
 				    guint32 opid,
-				    const char *vcard,
+				    const gchar *vcard,
 				    EContact **contact)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), GNOME_Evolution_Addressbook_OtherError);
@@ -133,7 +133,7 @@ EBookBackendSyncStatus
 e_book_backend_sync_modify_contact (EBookBackendSync *backend,
 				    EDataBook *book,
 				    guint32 opid,
-				    const char *vcard,
+				    const gchar *vcard,
 				    EContact **contact)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), GNOME_Evolution_Addressbook_OtherError);
@@ -162,8 +162,8 @@ EBookBackendSyncStatus
 e_book_backend_sync_get_contact (EBookBackendSync *backend,
 				 EDataBook *book,
 				 guint32 opid,
-				 const char *id,
-				 char **vcard)
+				 const gchar *id,
+				 gchar **vcard)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), GNOME_Evolution_Addressbook_OtherError);
 	g_return_val_if_fail (E_IS_DATA_BOOK (book), GNOME_Evolution_Addressbook_OtherError);
@@ -192,7 +192,7 @@ EBookBackendSyncStatus
 e_book_backend_sync_get_contact_list (EBookBackendSync *backend,
 				      EDataBook *book,
 				      guint32 opid,
-				      const char *query,
+				      const gchar *query,
 				      GList **contacts)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), GNOME_Evolution_Addressbook_OtherError);
@@ -223,7 +223,7 @@ EBookBackendSyncStatus
 e_book_backend_sync_get_changes (EBookBackendSync *backend,
 				 EDataBook *book,
 				 guint32 opid,
-				 const char *change_id,
+				 const gchar *change_id,
 				 GList **changes)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), GNOME_Evolution_Addressbook_OtherError);
@@ -253,9 +253,9 @@ EBookBackendSyncStatus
 e_book_backend_sync_authenticate_user (EBookBackendSync *backend,
 				       EDataBook *book,
 				       guint32 opid,
-				       const char *user,
-				       const char *passwd,
-				       const char *auth_method)
+				       const gchar *user,
+				       const gchar *passwd,
+				       const gchar *auth_method)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), GNOME_Evolution_Addressbook_OtherError);
 	g_return_val_if_fail (E_IS_DATA_BOOK (book), GNOME_Evolution_Addressbook_OtherError);
@@ -366,7 +366,7 @@ static void
 _e_book_backend_create_contact (EBookBackend *backend,
 				EDataBook    *book,
 				guint32       opid,
-				const char   *vcard)
+				const gchar   *vcard)
 {
 	EBookBackendSyncStatus status;
 	EContact *contact = NULL;
@@ -400,7 +400,7 @@ static void
 _e_book_backend_modify_contact (EBookBackend *backend,
 				EDataBook    *book,
 				guint32       opid,
-				const char   *vcard)
+				const gchar   *vcard)
 {
 	EBookBackendSyncStatus status;
 	EContact *contact = NULL;
@@ -417,10 +417,10 @@ static void
 _e_book_backend_get_contact (EBookBackend *backend,
 			     EDataBook    *book,
 			     guint32       opid,
-			     const char   *id)
+			     const gchar   *id)
 {
 	EBookBackendSyncStatus status;
-	char *vcard = NULL;
+	gchar *vcard = NULL;
 
 	status = e_book_backend_sync_get_contact (E_BOOK_BACKEND_SYNC (backend), book, opid, id, &vcard);
 
@@ -434,7 +434,7 @@ static void
 _e_book_backend_get_contact_list (EBookBackend *backend,
 				  EDataBook    *book,
 				  guint32       opid,
-				  const char   *query)
+				  const gchar   *query)
 {
 	EBookBackendSyncStatus status;
 	GList *cards = NULL;
@@ -448,7 +448,7 @@ static void
 _e_book_backend_get_changes (EBookBackend *backend,
 			     EDataBook    *book,
 			     guint32       opid,
-			     const char   *change_id)
+			     const gchar   *change_id)
 {
 	EBookBackendSyncStatus status;
 	GList *changes = NULL;
@@ -462,9 +462,9 @@ static void
 _e_book_backend_authenticate_user (EBookBackend *backend,
 				   EDataBook    *book,
 				   guint32       opid,
-				   const char   *user,
-				   const char   *passwd,
-				   const char   *auth_method)
+				   const gchar   *user,
+				   const gchar   *passwd,
+				   const gchar   *auth_method)
 {
 	EBookBackendSyncStatus status;
 
diff --git a/addressbook/libedata-book/e-book-backend-sync.h b/addressbook/libedata-book/e-book-backend-sync.h
index 6e59aa9..b51d461 100644
--- a/addressbook/libedata-book/e-book-backend-sync.h
+++ b/addressbook/libedata-book/e-book-backend-sync.h
@@ -35,27 +35,27 @@ struct _EBookBackendSyncClass {
 	EBookBackendSyncStatus (*remove_sync) (EBookBackendSync *backend, EDataBook *book, guint32 opid);
 	EBookBackendSyncStatus (*create_contact_sync)  (EBookBackendSync *backend, EDataBook *book,
 							guint32 opid,
-							const char *vcard, EContact **contact);
+							const gchar *vcard, EContact **contact);
 	EBookBackendSyncStatus (*remove_contacts_sync) (EBookBackendSync *backend, EDataBook *book,
 							guint32 opid,
 							GList *id_list, GList **removed_ids);
 	EBookBackendSyncStatus (*modify_contact_sync)  (EBookBackendSync *backend, EDataBook *book,
 							guint32 opid,
-							const char *vcard, EContact **contact);
+							const gchar *vcard, EContact **contact);
 	EBookBackendSyncStatus (*get_contact_sync) (EBookBackendSync *backend, EDataBook *book,
 						    guint32 opid,
-						    const char *id, char **vcard);
+						    const gchar *id, gchar **vcard);
 	EBookBackendSyncStatus (*get_contact_list_sync) (EBookBackendSync *backend, EDataBook *book,
 							 guint32 opid,
-							 const char *query, GList **contacts);
+							 const gchar *query, GList **contacts);
 	EBookBackendSyncStatus (*get_changes_sync) (EBookBackendSync *backend, EDataBook *book,
 						    guint32 opid,
-						    const char *change_id, GList **changes);
+						    const gchar *change_id, GList **changes);
 	EBookBackendSyncStatus (*authenticate_user_sync) (EBookBackendSync *backend, EDataBook *book,
 							  guint32 opid,
-							  const char *user,
-							  const char *passwd,
-							  const char *auth_method);
+							  const gchar *user,
+							  const gchar *passwd,
+							  const gchar *auth_method);
 
 	EBookBackendSyncStatus (*get_required_fields_sync) (EBookBackendSync *backend, EDataBook *book,
 							     guint32 opid,
@@ -82,13 +82,13 @@ gboolean    e_book_backend_sync_construct                (EBookBackendSync
 GType       e_book_backend_sync_get_type                 (void);
 
 EBookBackendSyncStatus e_book_backend_sync_remove  (EBookBackendSync *backend, EDataBook *book, guint32 opid);
-EBookBackendSyncStatus e_book_backend_sync_create_contact  (EBookBackendSync *backend, EDataBook *book, guint32 opid, const char *vcard, EContact **contact);
+EBookBackendSyncStatus e_book_backend_sync_create_contact  (EBookBackendSync *backend, EDataBook *book, guint32 opid, const gchar *vcard, EContact **contact);
 EBookBackendSyncStatus e_book_backend_sync_remove_contacts (EBookBackendSync *backend, EDataBook *book, guint32 opid, GList *id_list, GList **removed_ids);
-EBookBackendSyncStatus e_book_backend_sync_modify_contact  (EBookBackendSync *backend, EDataBook *book, guint32 opid, const char *vcard, EContact **contact);
-EBookBackendSyncStatus e_book_backend_sync_get_contact (EBookBackendSync *backend, EDataBook *book, guint32 opid, const char *id, char **vcard);
-EBookBackendSyncStatus e_book_backend_sync_get_contact_list (EBookBackendSync *backend, EDataBook *book, guint32 opid, const char *query, GList **contacts);
-EBookBackendSyncStatus e_book_backend_sync_get_changes (EBookBackendSync *backend, EDataBook *book, guint32 opid, const char *change_id, GList **changes);
-EBookBackendSyncStatus e_book_backend_sync_authenticate_user (EBookBackendSync *backend, EDataBook *book, guint32 opid, const char *user, const char *passwd, const char *auth_method);
+EBookBackendSyncStatus e_book_backend_sync_modify_contact  (EBookBackendSync *backend, EDataBook *book, guint32 opid, const gchar *vcard, EContact **contact);
+EBookBackendSyncStatus e_book_backend_sync_get_contact (EBookBackendSync *backend, EDataBook *book, guint32 opid, const gchar *id, gchar **vcard);
+EBookBackendSyncStatus e_book_backend_sync_get_contact_list (EBookBackendSync *backend, EDataBook *book, guint32 opid, const gchar *query, GList **contacts);
+EBookBackendSyncStatus e_book_backend_sync_get_changes (EBookBackendSync *backend, EDataBook *book, guint32 opid, const gchar *change_id, GList **changes);
+EBookBackendSyncStatus e_book_backend_sync_authenticate_user (EBookBackendSync *backend, EDataBook *book, guint32 opid, const gchar *user, const gchar *passwd, const gchar *auth_method);
 
 EBookBackendSyncStatus e_book_backend_sync_get_required_fields (EBookBackendSync *backend, EDataBook *book, guint32 opid, GList **fields);
 EBookBackendSyncStatus e_book_backend_sync_get_supported_fields (EBookBackendSync *backend, EDataBook *book, guint32 opid, GList **fields);
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 92d0af5..815eaa4 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -174,7 +174,7 @@ void
 e_book_backend_create_contact (EBookBackend *backend,
 			       EDataBook    *book,
 			       guint32       opid,
-			       const char   *vcard)
+			       const gchar   *vcard)
 {
 	g_return_if_fail (E_IS_BOOK_BACKEND (backend));
 	g_return_if_fail (E_IS_DATA_BOOK (book));
@@ -224,7 +224,7 @@ void
 e_book_backend_modify_contact (EBookBackend *backend,
 			       EDataBook    *book,
 			       guint32       opid,
-			       const char   *vcard)
+			       const gchar   *vcard)
 {
 	g_return_if_fail (E_IS_BOOK_BACKEND (backend));
 	g_return_if_fail (E_IS_DATA_BOOK (book));
@@ -249,7 +249,7 @@ void
 e_book_backend_get_contact (EBookBackend *backend,
 			    EDataBook    *book,
 			    guint32       opid,
-			    const char   *id)
+			    const gchar   *id)
 {
 	g_return_if_fail (E_IS_BOOK_BACKEND (backend));
 	g_return_if_fail (E_IS_DATA_BOOK (book));
@@ -274,7 +274,7 @@ void
 e_book_backend_get_contact_list (EBookBackend *backend,
 				 EDataBook    *book,
 				 guint32       opid,
-				 const char   *query)
+				 const gchar   *query)
 {
 	g_return_if_fail (E_IS_BOOK_BACKEND (backend));
 	g_return_if_fail (E_IS_DATA_BOOK (book));
@@ -339,7 +339,7 @@ void
 e_book_backend_get_changes (EBookBackend *backend,
 			    EDataBook    *book,
 			    guint32       opid,
-			    const char   *change_id)
+			    const gchar   *change_id)
 {
 	g_return_if_fail (E_IS_BOOK_BACKEND (backend));
 	g_return_if_fail (E_IS_DATA_BOOK (book));
@@ -366,9 +366,9 @@ void
 e_book_backend_authenticate_user (EBookBackend *backend,
 				  EDataBook    *book,
 				  guint32       opid,
-				  const char   *user,
-				  const char   *passwd,
-				  const char   *auth_method)
+				  const gchar   *user,
+				  const gchar   *passwd,
+				  const gchar   *auth_method)
 {
 	g_return_if_fail (E_IS_BOOK_BACKEND (backend));
 	g_return_if_fail (E_IS_DATA_BOOK (book));
@@ -662,7 +662,7 @@ e_book_backend_has_out_of_proc_clients (EBookBackend *backend)
  *
  * Return value: A string listing the capabilities.
  **/
-char *
+gchar *
 e_book_backend_get_static_capabilities (EBookBackend *backend)
 {
 	g_return_val_if_fail (E_IS_BOOK_BACKEND (backend), NULL);
@@ -816,7 +816,7 @@ e_book_backend_sync (EBookBackend *backend)
  * Return value: A new #GNOME_Evolution_Addressbook_BookChangeItem.
  **/
 GNOME_Evolution_Addressbook_BookChangeItem*
-e_book_backend_change_add_new     (const char *vcard)
+e_book_backend_change_add_new     (const gchar *vcard)
 {
 	GNOME_Evolution_Addressbook_BookChangeItem* new_change = GNOME_Evolution_Addressbook_BookChangeItem__alloc();
 
@@ -836,7 +836,7 @@ e_book_backend_change_add_new     (const char *vcard)
  * Return value: A new #GNOME_Evolution_Addressbook_BookChangeItem.
  **/
 GNOME_Evolution_Addressbook_BookChangeItem*
-e_book_backend_change_modify_new  (const char *vcard)
+e_book_backend_change_modify_new  (const gchar *vcard)
 {
 	GNOME_Evolution_Addressbook_BookChangeItem* new_change = GNOME_Evolution_Addressbook_BookChangeItem__alloc();
 
@@ -856,7 +856,7 @@ e_book_backend_change_modify_new  (const char *vcard)
  * Return value: A new #GNOME_Evolution_Addressbook_BookChangeItem.
  **/
 GNOME_Evolution_Addressbook_BookChangeItem*
-e_book_backend_change_delete_new  (const char *vcard)
+e_book_backend_change_delete_new  (const gchar *vcard)
 {
 	GNOME_Evolution_Addressbook_BookChangeItem* new_change = GNOME_Evolution_Addressbook_BookChangeItem__alloc();
 
@@ -939,7 +939,7 @@ view_notify_remove (EDataBookView *view, gpointer id)
  * another (non-PAS-using) client.
  **/
 void
-e_book_backend_notify_remove (EBookBackend *backend, const char *id)
+e_book_backend_notify_remove (EBookBackend *backend, const gchar *id)
 {
 	e_book_backend_foreach_view (backend, view_notify_remove, (gpointer)id);
 }
diff --git a/addressbook/libedata-book/e-book-backend.h b/addressbook/libedata-book/e-book-backend.h
index fa57cc4..3f4beee 100644
--- a/addressbook/libedata-book/e-book-backend.h
+++ b/addressbook/libedata-book/e-book-backend.h
@@ -51,17 +51,17 @@ struct _EBookBackendClass {
 	/* Virtual methods */
 	GNOME_Evolution_Addressbook_CallStatus (*load_source) (EBookBackend *backend, ESource *source, gboolean only_if_exists);
 	void (*remove) (EBookBackend *backend, EDataBook *book, guint32 opid);
-        char *(*get_static_capabilities) (EBookBackend *backend);
+        gchar *(*get_static_capabilities) (EBookBackend *backend);
 
-	void (*create_contact)  (EBookBackend *backend, EDataBook *book, guint32 opid, const char *vcard);
+	void (*create_contact)  (EBookBackend *backend, EDataBook *book, guint32 opid, const gchar *vcard);
 	void (*remove_contacts) (EBookBackend *backend, EDataBook *book, guint32 opid, GList *id_list);
-	void (*modify_contact)  (EBookBackend *backend, EDataBook *book, guint32 opid, const char *vcard);
-	void (*get_contact) (EBookBackend *backend, EDataBook *book, guint32 opid, const char *id);
-	void (*get_contact_list) (EBookBackend *backend, EDataBook *book, guint32 opid, const char *query);
+	void (*modify_contact)  (EBookBackend *backend, EDataBook *book, guint32 opid, const gchar *vcard);
+	void (*get_contact) (EBookBackend *backend, EDataBook *book, guint32 opid, const gchar *id);
+	void (*get_contact_list) (EBookBackend *backend, EDataBook *book, guint32 opid, const gchar *query);
 	void (*start_book_view) (EBookBackend *backend, EDataBookView *book_view);
 	void (*stop_book_view) (EBookBackend *backend, EDataBookView *book_view);
-	void (*get_changes) (EBookBackend *backend, EDataBook *book, guint32 opid, const char *change_id);
-	void (*authenticate_user) (EBookBackend *backend, EDataBook *book, guint32 opid, const char *user, const char *passwd, const char *auth_method);
+	void (*get_changes) (EBookBackend *backend, EDataBook *book, guint32 opid, const gchar *change_id);
+	void (*authenticate_user) (EBookBackend *backend, EDataBook *book, guint32 opid, const gchar *user, const gchar *passwd, const gchar *auth_method);
 	void (*get_required_fields) (EBookBackend *backend, EDataBook *bokk, guint32 opid);
 	void (*get_supported_fields) (EBookBackend *backend, EDataBook *book, guint32 opid);
 	void (*get_supported_auth_methods) (EBookBackend *backend, EDataBook *book, guint32 opid);
@@ -93,7 +93,7 @@ gboolean    e_book_backend_add_client               (EBookBackend             *b
 void        e_book_backend_remove_client            (EBookBackend             *backend,
 						     EDataBook                *book);
 gboolean    e_book_backend_has_out_of_proc_clients (EBookBackend *backend);
-char       *e_book_backend_get_static_capabilities  (EBookBackend             *backend);
+gchar       *e_book_backend_get_static_capabilities  (EBookBackend             *backend);
 
 gboolean    e_book_backend_is_loaded                (EBookBackend             *backend);
 
@@ -111,7 +111,7 @@ void        e_book_backend_remove                   (EBookBackend             *b
 void        e_book_backend_create_contact           (EBookBackend             *backend,
 						     EDataBook                *book,
 						     guint32                   opid,
-						     const char               *vcard);
+						     const gchar               *vcard);
 void        e_book_backend_remove_contacts          (EBookBackend             *backend,
 						     EDataBook                *book,
 						     guint32                   opid,
@@ -119,25 +119,25 @@ void        e_book_backend_remove_contacts          (EBookBackend             *b
 void        e_book_backend_modify_contact           (EBookBackend             *backend,
 						     EDataBook                *book,
 						     guint32                   opid,
-						     const char               *vcard);
+						     const gchar               *vcard);
 void        e_book_backend_get_contact              (EBookBackend             *backend,
 						     EDataBook                *book,
 						     guint32                   opid,
-						     const char               *id);
+						     const gchar               *id);
 void        e_book_backend_get_contact_list         (EBookBackend             *backend,
 						     EDataBook                *book,
 						     guint32                   opid,
-						     const char               *query);
+						     const gchar               *query);
 void        e_book_backend_get_changes              (EBookBackend             *backend,
 						     EDataBook                *book,
 						     guint32                   opid,
-						     const char               *change_id);
+						     const gchar               *change_id);
 void        e_book_backend_authenticate_user        (EBookBackend             *backend,
 						     EDataBook                *book,
 						     guint32                   opid,
-						     const char               *user,
-						     const char               *passwd,
-						     const char               *auth_method);
+						     const gchar               *user,
+						     const gchar               *passwd,
+						     const gchar               *auth_method);
 void        e_book_backend_get_supported_fields     (EBookBackend             *backend,
 						     EDataBook                *book,
 						     guint32                   opid);
@@ -170,7 +170,7 @@ EList      *e_book_backend_get_book_views             (EBookBackend           *b
 void        e_book_backend_notify_update              (EBookBackend           *backend,
 						       EContact               *contact);
 void        e_book_backend_notify_remove              (EBookBackend           *backend,
-						       const char             *id);
+						       const gchar             *id);
 void        e_book_backend_notify_complete            (EBookBackend           *backend);
 void        e_book_backend_notify_writable            (EBookBackend *backend, gboolean is_writable);
 void        e_book_backend_notify_connection_status   (EBookBackend *backend, gboolean is_online);
@@ -189,9 +189,9 @@ void        e_book_backend_set_is_removed           (EBookBackend             *b
 						     gboolean                  is_removed);
 
 /* useful for implementing _get_changes in backends */
-GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_add_new     (const char *vcard);
-GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_modify_new  (const char *vcard);
-GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_delete_new  (const char *id);
+GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_add_new     (const gchar *vcard);
+GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_modify_new  (const gchar *vcard);
+GNOME_Evolution_Addressbook_BookChangeItem* e_book_backend_change_delete_new  (const gchar *id);
 
 G_END_DECLS
 
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index f5890f8..21f2266 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -26,7 +26,7 @@
 static BonoboObjectClass          *e_data_book_factory_parent_class;
 
 typedef struct {
-	char                                     *uri;
+	gchar                                     *uri;
 	GNOME_Evolution_Addressbook_BookListener  listener;
 } EDataBookFactoryQueuedRequest;
 
@@ -37,12 +37,12 @@ struct _EDataBookFactoryPrivate {
 	GHashTable *active_server_map;
 
 	/* OAFIID of the factory */
-	char *iid;
+	gchar *iid;
 
 	/* Whether the factory has been registered with OAF yet */
 	guint       registered : 1;
 
-	int mode;
+	gint mode;
 };
 
 /* Signal IDs */
@@ -53,19 +53,19 @@ enum {
 
 static guint factory_signals[LAST_SIGNAL];
 
-static char *
-e_data_book_factory_canonicalize_uri (const char *uri)
+static gchar *
+e_data_book_factory_canonicalize_uri (const gchar *uri)
 {
 	/* FIXME: What do I do here? */
 
 	return g_strdup (uri);
 }
 
-static char *
-e_data_book_factory_extract_proto_from_uri (const char *uri)
+static gchar *
+e_data_book_factory_extract_proto_from_uri (const gchar *uri)
 {
-	char *proto;
-	char *p;
+	gchar *proto;
+	gchar *p;
 
 	p = strchr (uri, ':');
 
@@ -90,7 +90,7 @@ void
 e_data_book_factory_register_backend (EDataBookFactory      *book_factory,
 				      EBookBackendFactory   *backend_factory)
 {
-	const char *proto;
+	const gchar *proto;
 
 	g_return_if_fail (E_IS_DATA_BOOK_FACTORY (book_factory));
 	g_return_if_fail (E_IS_BOOK_BACKEND_FACTORY (backend_factory));
@@ -125,10 +125,10 @@ out_of_proc_check (gpointer key, gpointer value, gpointer data)
  *
  * Return value: Number of running backends.
  **/
-int
+gint
 e_data_book_factory_get_n_backends (EDataBookFactory *factory)
 {
-	int n_backends;
+	gint n_backends;
 	gboolean out_of_proc = FALSE;
 
 	g_return_val_if_fail (factory != NULL, -1);
@@ -171,7 +171,7 @@ e_data_book_factory_register_backends (EDataBookFactory *book_factory)
 static void
 dump_active_server_map_entry (gpointer key, gpointer value, gpointer data)
 {
-	char *uri;
+	gchar *uri;
 	EBookBackend *backend;
 
 	uri = key;
@@ -235,11 +235,11 @@ backend_last_client_gone_cb (EBookBackend *backend, gpointer data)
 
 static EBookBackendFactory*
 e_data_book_factory_lookup_backend_factory (EDataBookFactory *factory,
-					    const char     *uri)
+					    const gchar     *uri)
 {
 	EBookBackendFactory *backend_factory;
-	char                *proto;
-	char                *canonical_uri;
+	gchar                *proto;
+	gchar                *canonical_uri;
 
 	g_assert (factory != NULL);
 	g_assert (E_IS_DATA_BOOK_FACTORY (factory));
@@ -267,7 +267,7 @@ static EBookBackend *
 e_data_book_factory_launch_backend (EDataBookFactory      *book_factory,
 				    EBookBackendFactory   *backend_factory,
 				    GNOME_Evolution_Addressbook_BookListener listener,
-				    const char          *uri)
+				    const gchar          *uri)
 {
 	EBookBackend          *backend;
 
@@ -412,11 +412,11 @@ e_data_book_factory_new (void)
  * Return value: %TRUE for success, %FALSE otherwise.
  **/
 gboolean
-e_data_book_factory_activate (EDataBookFactory *factory, const char *iid)
+e_data_book_factory_activate (EDataBookFactory *factory, const gchar *iid)
 {
 	EDataBookFactoryPrivate *priv;
 	Bonobo_RegistrationResult result;
-	char *tmp_iid;
+	gchar *tmp_iid;
 
 	g_return_val_if_fail (factory != NULL, FALSE);
 	g_return_val_if_fail (E_IS_DATA_BOOK_FACTORY (factory), FALSE);
@@ -472,7 +472,7 @@ set_backend_online_status (gpointer key, gpointer value, gpointer data)
  * online.
  **/
 void
-e_data_book_factory_set_backend_mode (EDataBookFactory *factory, int mode)
+e_data_book_factory_set_backend_mode (EDataBookFactory *factory, gint mode)
 {
 	EDataBookFactoryPrivate *priv = factory->priv;
 
diff --git a/addressbook/libedata-book/e-data-book-factory.h b/addressbook/libedata-book/e-data-book-factory.h
index 1724cab..01048c6 100644
--- a/addressbook/libedata-book/e-data-book-factory.h
+++ b/addressbook/libedata-book/e-data-book-factory.h
@@ -40,14 +40,14 @@ EDataBookFactory *e_data_book_factory_new                  (void);
 void              e_data_book_factory_register_backend     (EDataBookFactory    *factory,
 							    EBookBackendFactory *backend_factory);
 
-int               e_data_book_factory_get_n_backends       (EDataBookFactory    *factory);
+gint               e_data_book_factory_get_n_backends       (EDataBookFactory    *factory);
 
 void		  e_data_book_factory_register_backends    (EDataBookFactory    *factory);
 
 void              e_data_book_factory_dump_active_backends (EDataBookFactory    *factory);
 
-gboolean          e_data_book_factory_activate             (EDataBookFactory    *factory, const char *iid);
-void              e_data_book_factory_set_backend_mode             (EDataBookFactory    *factory, int mode);
+gboolean          e_data_book_factory_activate             (EDataBookFactory    *factory, const gchar *iid);
+void              e_data_book_factory_set_backend_mode             (EDataBookFactory    *factory, gint mode);
 
 GType             e_data_book_factory_get_type             (void);
 
diff --git a/addressbook/libedata-book/e-data-book-view.c b/addressbook/libedata-book/e-data-book-view.c
index d31a333..94ef8a6 100644
--- a/addressbook/libedata-book/e-data-book-view.c
+++ b/addressbook/libedata-book/e-data-book-view.c
@@ -31,19 +31,19 @@ struct _EDataBookViewPrivate {
 	GMutex *pending_mutex;
 
 	CORBA_sequence_GNOME_Evolution_Addressbook_VCard adds;
-	int next_threshold;
-	int threshold_max;
-	int threshold_min;
+	gint next_threshold;
+	gint threshold_max;
+	gint threshold_min;
 
 	CORBA_sequence_GNOME_Evolution_Addressbook_VCard changes;
 	CORBA_sequence_GNOME_Evolution_Addressbook_ContactId removes;
 
 	EBookBackend *backend;
-	char *card_query;
+	gchar *card_query;
 	EBookBackendSExp *card_sexp;
 	GHashTable *ids;
 
-	int max_results;
+	gint max_results;
 };
 
 static void
@@ -147,7 +147,7 @@ CORBA_sequence_ ## type ## _realloc (CORBA_sequence_ ## type *seq,	\
 				     CORBA_unsigned_long      new_max)	\
 {									\
 	type *new_buf;							\
-	int i;								\
+	gint i;								\
 	new_buf = CORBA_sequence_ ## type ## _allocbuf (new_max);	\
 	for (i = 0; i < seq->_maximum; i ++)				\
 		new_buf[i] = CORBA_string_dup (seq->_buffer[i]);	\
@@ -160,7 +160,7 @@ MAKE_REALLOC (GNOME_Evolution_Addressbook_VCard)
 MAKE_REALLOC (GNOME_Evolution_Addressbook_ContactId)
 
 static void
-notify_change (EDataBookView *book_view, const char *vcard)
+notify_change (EDataBookView *book_view, const gchar *vcard)
 {
 	CORBA_sequence_GNOME_Evolution_Addressbook_VCard *changes;
 
@@ -178,7 +178,7 @@ notify_change (EDataBookView *book_view, const char *vcard)
 }
 
 static void
-notify_remove (EDataBookView *book_view, const char *id)
+notify_remove (EDataBookView *book_view, const gchar *id)
 {
 	CORBA_sequence_GNOME_Evolution_Addressbook_ContactId *removes;
 
@@ -197,7 +197,7 @@ notify_remove (EDataBookView *book_view, const char *id)
 }
 
 static void
-notify_add (EDataBookView *book_view, const char *id, const char *vcard)
+notify_add (EDataBookView *book_view, const gchar *id, const gchar *vcard)
 {
 	CORBA_sequence_GNOME_Evolution_Addressbook_VCard *adds;
 	EDataBookViewPrivate *priv = book_view->priv;
@@ -240,8 +240,8 @@ e_data_book_view_notify_update (EDataBookView *book_view,
 			     EContact    *contact)
 {
 	gboolean currently_in_view, want_in_view;
-	const char *id=NULL;
-	char *vcard;
+	const gchar *id=NULL;
+	gchar *vcard;
 
 	g_mutex_lock (book_view->priv->pending_mutex);
 
@@ -289,10 +289,10 @@ e_data_book_view_notify_update (EDataBookView *book_view,
  * representation of a contact is a vCard.
  **/
 void
-e_data_book_view_notify_update_vcard (EDataBookView *book_view, char *vcard)
+e_data_book_view_notify_update_vcard (EDataBookView *book_view, gchar *vcard)
 {
 	gboolean currently_in_view, want_in_view;
-	const char *id = NULL;
+	const gchar *id = NULL;
 	EContact *contact;
 
 	g_mutex_lock (book_view->priv->pending_mutex);
@@ -347,7 +347,7 @@ e_data_book_view_notify_update_vcard (EDataBookView *book_view, char *vcard)
  * known to exist in the view.
  **/
 void
-e_data_book_view_notify_update_prefiltered_vcard (EDataBookView *book_view, const char *id, char *vcard)
+e_data_book_view_notify_update_prefiltered_vcard (EDataBookView *book_view, const gchar *id, gchar *vcard)
 {
 	gboolean currently_in_view;
 
@@ -375,7 +375,7 @@ e_data_book_view_notify_update_prefiltered_vcard (EDataBookView *book_view, cons
  **/
 void
 e_data_book_view_notify_remove (EDataBookView *book_view,
-			     const char  *id)
+			     const gchar  *id)
 {
 	g_mutex_lock (book_view->priv->pending_mutex);
 
@@ -431,7 +431,7 @@ e_data_book_view_notify_complete (EDataBookView *book_view,
  **/
 void
 e_data_book_view_notify_status_message (EDataBookView *book_view,
-				     const char  *message)
+				     const gchar  *message)
 {
 	CORBA_Environment ev;
 
@@ -451,9 +451,9 @@ static void
 e_data_book_view_construct (EDataBookView                *book_view,
 			    EBookBackend                 *backend,
 			    GNOME_Evolution_Addressbook_BookViewListener  listener,
-			    const char                   *card_query,
+			    const gchar                   *card_query,
 			    EBookBackendSExp             *card_sexp,
-			    int                           max_results)
+			    gint                           max_results)
 {
 	EDataBookViewPrivate *priv;
 	CORBA_Environment ev;
@@ -521,7 +521,7 @@ impl_GNOME_Evolution_Addressbook_BookView_dispose (PortableServer_Servant servan
  *
  * Return value: The textual s-expression used.
  **/
-const char*
+const gchar *
 e_data_book_view_get_card_query (EDataBookView *book_view)
 {
 	g_return_val_if_fail (book_view, NULL);
@@ -555,7 +555,7 @@ e_data_book_view_get_card_sexp (EDataBookView *book_view)
  *
  * Return value: The maximum number of results returned.
  **/
-int
+gint
 e_data_book_view_get_max_results (EDataBookView *book_view)
 {
 	g_return_val_if_fail (E_IS_DATA_BOOK_VIEW (book_view), 0);
@@ -626,8 +626,8 @@ e_data_book_view_get_listener (EDataBookView  *book_view)
  **/
 void
 e_data_book_view_set_thresholds (EDataBookView *book_view,
-				 int minimum_grouping_threshold,
-				 int maximum_grouping_threshold)
+				 gint minimum_grouping_threshold,
+				 gint maximum_grouping_threshold)
 {
 	book_view->priv->threshold_min = minimum_grouping_threshold;
 	book_view->priv->threshold_max = maximum_grouping_threshold;
@@ -646,9 +646,9 @@ e_data_book_view_set_thresholds (EDataBookView *book_view,
 EDataBookView *
 e_data_book_view_new (EBookBackend *backend,
 		      GNOME_Evolution_Addressbook_BookViewListener  listener,
-		      const char *card_query,
+		      const gchar *card_query,
 		      EBookBackendSExp *card_sexp,
-		      int max_results)
+		      gint max_results)
 {
 	static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
 	static PortableServer_POA poa = NULL;
diff --git a/addressbook/libedata-book/e-data-book-view.h b/addressbook/libedata-book/e-data-book-view.h
index 3304945..b5cc864 100644
--- a/addressbook/libedata-book/e-data-book-view.h
+++ b/addressbook/libedata-book/e-data-book-view.h
@@ -44,17 +44,17 @@ struct _EDataBookViewClass {
 
 EDataBookView *e_data_book_view_new                  (EBookBackend                 *backend,
 						      GNOME_Evolution_Addressbook_BookViewListener  listener,
-						      const char                   *card_query,
+						      const gchar                   *card_query,
 						      EBookBackendSExp             *card_sexp,
-						      int                           max_results);
+						      gint                           max_results);
 
 void              e_data_book_view_set_thresholds    (EDataBookView *book_view,
-						      int minimum_grouping_threshold,
-						      int maximum_grouping_threshold);
+						      gint minimum_grouping_threshold,
+						      gint maximum_grouping_threshold);
 
-const char*       e_data_book_view_get_card_query    (EDataBookView                *book_view);
+const gchar *       e_data_book_view_get_card_query    (EDataBookView                *book_view);
 EBookBackendSExp* e_data_book_view_get_card_sexp     (EDataBookView                *book_view);
-int               e_data_book_view_get_max_results   (EDataBookView                *book_view);
+gint               e_data_book_view_get_max_results   (EDataBookView                *book_view);
 EBookBackend*     e_data_book_view_get_backend       (EDataBookView                *book_view);
 GNOME_Evolution_Addressbook_BookViewListener e_data_book_view_get_listener (EDataBookView  *book_view);
 GMutex*           e_data_book_view_get_mutex         (EDataBookView                *book_view);
@@ -63,17 +63,17 @@ void         e_data_book_view_notify_update          (EDataBookView
 						      EContact                     *contact);
 
 void         e_data_book_view_notify_update_vcard    (EDataBookView                *book_view,
-						      char                         *vcard);
+						      gchar                         *vcard);
 void         e_data_book_view_notify_update_prefiltered_vcard (EDataBookView       *book_view,
-                                                               const char          *id,
-                                                               char                *vcard);
+                                                               const gchar          *id,
+                                                               gchar                *vcard);
 
 void         e_data_book_view_notify_remove          (EDataBookView                *book_view,
-						      const char                   *id);
+						      const gchar                   *id);
 void         e_data_book_view_notify_complete        (EDataBookView                *book_view,
 						      GNOME_Evolution_Addressbook_CallStatus);
 void         e_data_book_view_notify_status_message  (EDataBookView                *book_view,
-						      const char                   *message);
+						      const gchar                   *message);
 void         e_data_book_view_ref                    (EDataBookView                *book_view);
 void         e_data_book_view_unref                  (EDataBookView                *book_view);
 
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index ba8aa28..48e0780 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -81,9 +81,9 @@ impl_GNOME_Evolution_Addressbook_Book_getContactList (PortableServer_Servant ser
 static void
 impl_GNOME_Evolution_Addressbook_Book_authenticateUser (PortableServer_Servant servant,
 							const CORBA_long opid,
-							const char* user,
-							const char* passwd,
-							const char* auth_method,
+							const gchar * user,
+							const gchar * passwd,
+							const gchar * auth_method,
 							CORBA_Environment *ev)
 {
 	EDataBook *book = E_DATA_BOOK (bonobo_object (servant));
@@ -110,7 +110,7 @@ impl_GNOME_Evolution_Addressbook_Book_removeContacts (PortableServer_Servant ser
 						      CORBA_Environment *ev)
 {
 	EDataBook *book = E_DATA_BOOK (bonobo_object (servant));
-	int i;
+	gint i;
 	GList *id_list = NULL;
 
 	for (i = 0; i < ids->_length; i ++)
@@ -184,13 +184,13 @@ impl_GNOME_Evolution_Addressbook_Book_getChanges (PortableServer_Servant servant
 	e_book_backend_get_changes (e_data_book_get_backend (book), book, opid, change_id);
 }
 
-static char *
+static gchar *
 impl_GNOME_Evolution_Addressbook_Book_getStaticCapabilities (PortableServer_Servant servant,
 							     CORBA_Environment *ev)
 {
 	EDataBook *book = E_DATA_BOOK (bonobo_object (servant));
-	char *temp;
-	char *ret_val;
+	gchar *temp;
+	gchar *ret_val;
 
 	temp = e_book_backend_get_static_capabilities (book->priv->backend);
 	ret_val = CORBA_string_dup(temp);
@@ -502,8 +502,8 @@ e_data_book_respond_get_required_fields (EDataBook
 
 	CORBA_Environment ev;
 	GNOME_Evolution_Addressbook_stringlist stringlist;
-	int num_fields;
-	int i;
+	gint num_fields;
+	gint i;
 	GList *iter;
 
 	CORBA_exception_init (&ev);
@@ -515,7 +515,7 @@ e_data_book_respond_get_required_fields (EDataBook
 	stringlist._length = num_fields;
 
 	for (i = 0, iter = fields; iter; iter = iter->next, i ++) {
-		stringlist._buffer[i] = CORBA_string_dup ((char*)iter->data);
+		stringlist._buffer[i] = CORBA_string_dup ((gchar *)iter->data);
 	}
 
 	printf ("calling GNOME_Evolution_Addressbook_BookListener_notifyRequiredFields\n");
@@ -548,8 +548,8 @@ e_data_book_respond_get_supported_fields (EDataBook
 {
 	CORBA_Environment ev;
 	GNOME_Evolution_Addressbook_stringlist stringlist;
-	int num_fields;
-	int i;
+	gint num_fields;
+	gint i;
 	GList *iter;
 
 	CORBA_exception_init (&ev);
@@ -561,7 +561,7 @@ e_data_book_respond_get_supported_fields (EDataBook
 	stringlist._length = num_fields;
 
 	for (i = 0, iter = fields; iter; iter = iter->next, i ++) {
-		stringlist._buffer[i] = CORBA_string_dup ((char*)iter->data);
+		stringlist._buffer[i] = CORBA_string_dup ((gchar *)iter->data);
 	}
 
 	printf ("calling GNOME_Evolution_Addressbook_BookListener_notifySupportedFields\n");
@@ -594,9 +594,9 @@ e_data_book_respond_get_supported_auth_methods (EDataBook
 {
 	CORBA_Environment ev;
 	GNOME_Evolution_Addressbook_stringlist stringlist;
-	int num_auth_methods;
+	gint num_auth_methods;
 	GList *iter;
-	int i;
+	gint i;
 
 	CORBA_exception_init (&ev);
 
@@ -607,7 +607,7 @@ e_data_book_respond_get_supported_auth_methods (EDataBook
 	stringlist._length = num_auth_methods;
 
 	for (i = 0, iter = auth_methods; iter; iter = iter->next, i ++) {
-		stringlist._buffer[i] = CORBA_string_dup ((char*)iter->data);
+		stringlist._buffer[i] = CORBA_string_dup ((gchar *)iter->data);
 	}
 
 	GNOME_Evolution_Addressbook_BookListener_notifySupportedAuthMethods (
@@ -681,7 +681,7 @@ void
 e_data_book_respond_get_contact (EDataBook                              *book,
 				 guint32                                 opid,
 				 GNOME_Evolution_Addressbook_CallStatus  status,
-				 char                                   *vcard)
+				 gchar                                   *vcard)
 {
 	CORBA_Environment ev;
 
@@ -717,8 +717,8 @@ e_data_book_respond_get_contact_list (EDataBook                              *bo
 {
 	CORBA_Environment ev;
 	GNOME_Evolution_Addressbook_stringlist stringlist;
-	int num_cards;
-	int i;
+	gint num_cards;
+	gint i;
 	GList *l;
 
 	CORBA_exception_init (&ev);
@@ -768,8 +768,8 @@ e_data_book_respond_get_changes (EDataBook                              *book,
 {
 	CORBA_Environment ev;
 	GNOME_Evolution_Addressbook_BookChangeList changelist;
-	int num_changes;
-	int i;
+	gint num_changes;
+	gint i;
 	GList *l;
 
 	CORBA_exception_init (&ev);
diff --git a/addressbook/libedata-book/e-data-book.h b/addressbook/libedata-book/e-data-book.h
index 3c86994..fa2cfbd 100644
--- a/addressbook/libedata-book/e-data-book.h
+++ b/addressbook/libedata-book/e-data-book.h
@@ -96,7 +96,7 @@ void                    e_data_book_respond_get_book_view  (EDataBook
 void                    e_data_book_respond_get_contact    (EDataBook                              *book,
 							    guint32                                 opid,
 							    GNOME_Evolution_Addressbook_CallStatus  status,
-							    char                              *vcard);
+							    gchar                              *vcard);
 void                    e_data_book_respond_get_contact_list (EDataBook                              *book,
 							      guint32                                 opid,
 							      GNOME_Evolution_Addressbook_CallStatus  status,
diff --git a/addressbook/tests/ebook/test-categories.c b/addressbook/tests/ebook/test-categories.c
index 55ee77f..62c514e 100644
--- a/addressbook/tests/ebook/test-categories.c
+++ b/addressbook/tests/ebook/test-categories.c
@@ -2,12 +2,12 @@
 #include <string.h>
 #include <libebook/e-book.h>
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EContact *contact;
 	GList *category_list;
-	char *categories;
+	gchar *categories;
 
 	g_type_init ();
 
@@ -45,9 +45,9 @@ main (int argc, char **argv)
 	if (g_list_length (category_list) != 3)
 	  printf ("failed conversion from string to list\n");
 	else {
-	  if (!strcmp ("Birthday", (char*)g_list_nth_data (category_list, 0)) &&
-	      !strcmp ("Business", (char*)g_list_nth_data (category_list, 1)) &&
-	      !strcmp ("Competition", (char*)g_list_nth_data (category_list, 2)))
+	  if (!strcmp ("Birthday", (gchar *)g_list_nth_data (category_list, 0)) &&
+	      !strcmp ("Business", (gchar *)g_list_nth_data (category_list, 1)) &&
+	      !strcmp ("Competition", (gchar *)g_list_nth_data (category_list, 2)))
 	    printf ("passed conversion from string to list\n");
 	  else
 	    printf ("failed conversion from string to list\n");
diff --git a/addressbook/tests/ebook/test-changes.c b/addressbook/tests/ebook/test-changes.c
index 4d2cd7b..742e8e0 100644
--- a/addressbook/tests/ebook/test-changes.c
+++ b/addressbook/tests/ebook/test-changes.c
@@ -10,8 +10,8 @@ EMAIL;INTERNET:toshok ximian com\n\
 ORG:Ximian, Inc.;\n\
 END:VCARD"
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EBook *book;
 	EContact *contact;
@@ -82,7 +82,7 @@ main (int argc, char **argv)
 		exit(0);
 	}
 
-	printf ("got changed vcard back: %s\n", (char*)e_contact_get_const (change->contact, E_CONTACT_UID));
+	printf ("got changed vcard back: %s\n", (gchar *)e_contact_get_const (change->contact, E_CONTACT_UID));
 
 	e_book_free_change_list (changes);
 
diff --git a/addressbook/tests/ebook/test-date.c b/addressbook/tests/ebook/test-date.c
index c016179..c2c6ad8 100644
--- a/addressbook/tests/ebook/test-date.c
+++ b/addressbook/tests/ebook/test-date.c
@@ -1,8 +1,8 @@
 #include <stdlib.h>
 #include <libebook/e-book.h>
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EContact *contact;
 	EContactDate date, *dp;
diff --git a/addressbook/tests/ebook/test-ebook-async.c b/addressbook/tests/ebook/test-ebook-async.c
index a34d96e..4df8c5f 100644
--- a/addressbook/tests/ebook/test-ebook-async.c
+++ b/addressbook/tests/ebook/test-ebook-async.c
@@ -8,8 +8,8 @@ static GMainLoop *loop;
 static void
 print_email (EContact *contact)
 {
-	const char *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
-	const char *name_or_org = e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG);
+	const gchar *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
+	const gchar *name_or_org = e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG);
 	GList *emails, *e;
 
 	printf ("Contact: %s\n", file_as);
@@ -17,7 +17,7 @@ print_email (EContact *contact)
 	printf ("Email addresses:\n");
 	emails = e_contact_get (contact, E_CONTACT_EMAIL);
 	for (e = emails; e; e = e->next) {
-		printf ("\t%s\n",  (char*)e->data);
+		printf ("\t%s\n",  (gchar *)e->data);
 	}
 	g_list_foreach (emails, (GFunc)g_free, NULL);
 	g_list_free (emails);
@@ -79,8 +79,8 @@ book_loaded_cb (EBook *book, EBookStatus status, gpointer data)
 	print_one_email (book);
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EBook *book;
 
diff --git a/addressbook/tests/ebook/test-ebook-view.c b/addressbook/tests/ebook/test-ebook-view.c
index 093d582..d511c63 100644
--- a/addressbook/tests/ebook/test-ebook-view.c
+++ b/addressbook/tests/ebook/test-ebook-view.c
@@ -10,13 +10,13 @@ print_contact (EContact *contact)
 {
 	GList *emails, *e;
 
-	printf ("Contact: %s\n", (char*)e_contact_get_const (contact, E_CONTACT_FILE_AS));
-	printf ("UID: %s\n", (char*)e_contact_get_const (contact, E_CONTACT_UID));
+	printf ("Contact: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+	printf ("UID: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_UID));
 	printf ("Email addresses:\n");
 
 	emails = e_contact_get (contact, E_CONTACT_EMAIL);
 	for (e = emails; e; e = e->next) {
-		printf ("\t%s\n",  (char*)e->data);
+		printf ("\t%s\n",  (gchar *)e->data);
 	}
 	g_list_foreach (emails, (GFunc)g_free, NULL);
 	g_list_free (emails);
@@ -40,7 +40,7 @@ contacts_removed (EBookView *book_view, const GList *ids)
   GList *l;
 
   for (l = (GList*)ids; l; l = l->next) {
-    printf ("Removed contact: %s\n", (char*)l->data);
+    printf ("Removed contact: %s\n", (gchar *)l->data);
   }
 }
 
@@ -52,8 +52,8 @@ sequence_complete (EBookView *book_view, EBookViewStatus status)
   g_main_loop_quit (loop);
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EBook *book;
 	gboolean status;
diff --git a/addressbook/tests/ebook/test-ebook.c b/addressbook/tests/ebook/test-ebook.c
index 17a35ee..532d17c 100644
--- a/addressbook/tests/ebook/test-ebook.c
+++ b/addressbook/tests/ebook/test-ebook.c
@@ -6,8 +6,8 @@
 static void
 print_email (EContact *contact)
 {
-	const char *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
-	const char *name_or_org = e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG);
+	const gchar *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
+	const gchar *name_or_org = e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG);
 	GList *emails, *e;
 
 	printf ("Contact: %s\n", file_as);
@@ -15,7 +15,7 @@ print_email (EContact *contact)
 	printf ("Email addresses:\n");
 	emails = e_contact_get (contact, E_CONTACT_EMAIL);
 	for (e = emails; e; e = e->next) {
-		printf ("\t%s\n",  (char*)e->data);
+		printf ("\t%s\n",  (gchar *)e->data);
 	}
 	g_list_foreach (emails, (GFunc)g_free, NULL);
 	g_list_free (emails);
@@ -68,8 +68,8 @@ print_one_email (EBook *book)
 	g_object_unref (contact);
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EBook *book;
 	gboolean status;
diff --git a/addressbook/tests/ebook/test-nonexistent-id.c b/addressbook/tests/ebook/test-nonexistent-id.c
index d440adf..9408a54 100644
--- a/addressbook/tests/ebook/test-nonexistent-id.c
+++ b/addressbook/tests/ebook/test-nonexistent-id.c
@@ -1,6 +1,6 @@
 #include <libebook/e-book.h>
 
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
 {
 	GError *err = NULL;
 	EBook *book = NULL;
diff --git a/addressbook/tests/ebook/test-photo.c b/addressbook/tests/ebook/test-photo.c
index c3c4cd5..8848b9b 100644
--- a/addressbook/tests/ebook/test-photo.c
+++ b/addressbook/tests/ebook/test-photo.c
@@ -2,7 +2,7 @@
 #include <string.h>
 #include <libebook/e-book.h>
 
-static const char *photo_data =
+static const gchar *photo_data =
 "/9j/4AAQSkZJRgABAQEARwBHAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAIBgYHB\
 gUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04Mjw\
 uMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyM\
@@ -23,8 +23,8 @@ eor7UoAje18FtmLe9eeQT3EXPcglkJRPbv71EWu7Dajp2o3MGmlRCkjKQ30jPUe1WlrlNW0Rpt\
 TleNB84DnjkD0P9VlxT4Nqck9pmn8JuFp2zo0cgCWFi2e7555/NSHXLadso2m3sU0NxlV65HM+\
 VdTW3rgwvsUpSvAFKUoAUxSlAClKUAKUpQB//2Q==";
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EContact *contact;
 	EContactPhoto *photo, *new_photo;
diff --git a/addressbook/tests/ebook/test-query.c b/addressbook/tests/ebook/test-query.c
index fa3af13..05169d1 100644
--- a/addressbook/tests/ebook/test-query.c
+++ b/addressbook/tests/ebook/test-query.c
@@ -4,22 +4,22 @@
 #define QUERY_STRING1
 #define QUERY_STRING2
 
-static char* queries[] = {
+static gchar * queries[] = {
 	"(exists \"full_name\")",
 	"(contains \"full_name\" \"Miguel\")"
 
 	/* XXX come on, add more here */
 };
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
-	int i;
+	gint i;
 	gboolean failure = FALSE;
 
 	for (i = 0; i < G_N_ELEMENTS (queries); i ++) {
 		EBookQuery *query = e_book_query_from_string (queries[i]);
-		char *str;
+		gchar *str;
 
 		str = e_book_query_to_string (query);
 
diff --git a/addressbook/tests/ebook/test-search.c b/addressbook/tests/ebook/test-search.c
index a2cb779..d96c2e0 100644
--- a/addressbook/tests/ebook/test-search.c
+++ b/addressbook/tests/ebook/test-search.c
@@ -3,8 +3,8 @@
 #include <stdlib.h>
 #include <libebook/e-book.h>
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EBook *book;
 	gboolean status;
diff --git a/addressbook/tests/ebook/test-self.c b/addressbook/tests/ebook/test-self.c
index 1f50ad8..a40dc50 100644
--- a/addressbook/tests/ebook/test-self.c
+++ b/addressbook/tests/ebook/test-self.c
@@ -3,13 +3,13 @@
 #include <stdlib.h>
 #include <libebook/e-book.h>
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EBook *book;
 	EContact *contact;
 	GError *error = NULL;
-	char *vcard;
+	gchar *vcard;
 
 	g_type_init ();
 
diff --git a/addressbook/tests/ebook/test-stress-bookviews.c b/addressbook/tests/ebook/test-stress-bookviews.c
index 93017f6..4aa0eb1 100644
--- a/addressbook/tests/ebook/test-stress-bookviews.c
+++ b/addressbook/tests/ebook/test-stress-bookviews.c
@@ -8,13 +8,13 @@ print_contact (EContact *contact)
 {
 	GList *emails, *e;
 
-	printf ("Contact: %s\n", (char*)e_contact_get_const (contact, E_CONTACT_FILE_AS));
-	printf ("UID: %s\n", (char*)e_contact_get_const (contact, E_CONTACT_UID));
+	printf ("Contact: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+	printf ("UID: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_UID));
 	printf ("Email addresses:\n");
 
 	emails = e_contact_get (contact, E_CONTACT_EMAIL);
 	for (e = emails; e; e = e->next) {
-		printf ("\t%s\n",  (char*)e->data);
+		printf ("\t%s\n",  (gchar *)e->data);
 	}
 	g_list_foreach (emails, (GFunc)g_free, NULL);
 	g_list_free (emails);
@@ -38,7 +38,7 @@ contacts_removed (EBookView *book_view, const GList *ids)
   GList *l;
 
   for (l = (GList*)ids; l; l = l->next) {
-    printf ("Removed contact: %s\n", (char*)l->data);
+    printf ("Removed contact: %s\n", (gchar *)l->data);
   }
 }
 
@@ -48,15 +48,15 @@ sequence_complete (EBookView *book_view, EBookViewStatus status)
   printf ("sequence_complete (status == %d)\n", status);
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EBook *book;
 	gboolean status;
 	EBookQuery *query;
 	EBookView *view = NULL;
 	EBookView *new_view;
-	int i;
+	gint i;
 
 	g_type_init ();
 
diff --git a/addressbook/tests/ebook/test-string.c b/addressbook/tests/ebook/test-string.c
index 7ac18be..953802e 100644
--- a/addressbook/tests/ebook/test-string.c
+++ b/addressbook/tests/ebook/test-string.c
@@ -4,8 +4,8 @@
 
 #define TEST_ID "test-uid"
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EContact *contact;
 
diff --git a/addressbook/tests/ebook/test-undefinedfield.c b/addressbook/tests/ebook/test-undefinedfield.c
index abfbe1d..75e1dc0 100644
--- a/addressbook/tests/ebook/test-undefinedfield.c
+++ b/addressbook/tests/ebook/test-undefinedfield.c
@@ -1,8 +1,8 @@
 #include <stdlib.h>
 #include <libebook/e-book.h>
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EContact *contact;
 	gpointer test;
diff --git a/addressbook/tests/ebook/test-untyped-phones.c b/addressbook/tests/ebook/test-untyped-phones.c
index 4d8cfea..565e65b 100644
--- a/addressbook/tests/ebook/test-untyped-phones.c
+++ b/addressbook/tests/ebook/test-untyped-phones.c
@@ -16,16 +16,16 @@ TEL;FAX:321-321-4321\r\n\
 END:vCard"
 
 static void
-check(gboolean test, char *msg)
+check(gboolean test, gchar *msg)
 {
 	printf ("%s - %s\n", test ? "passed" : "failed", msg);
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	EContact *contact;
-	const char *phone;
+	const gchar *phone;
 
 	g_type_init ();
 
diff --git a/addressbook/tests/vcard/dump-vcard.c b/addressbook/tests/vcard/dump-vcard.c
index 95851e5..22c2573 100644
--- a/addressbook/tests/vcard/dump-vcard.c
+++ b/addressbook/tests/vcard/dump-vcard.c
@@ -3,13 +3,13 @@
 #include <stdio.h>
 #include <libebook/e-vcard.h>
 
-int
-main(int argc, char **argv)
+gint
+main(gint argc, gchar **argv)
 {
 	FILE *fp;
 	EVCard *vcard;
 	GString *str = g_string_new ("");
-	char *parsed_vcard;
+	gchar *parsed_vcard;
 
 	if (argc < 2)
 	  return 0;
@@ -19,7 +19,7 @@ main(int argc, char **argv)
 	fp = fopen (argv[1], "r");
 
 	while (!feof (fp)) {
-		char buf[1024];
+		gchar buf[1024];
 		if (fgets (buf, sizeof(buf), fp))
 			str = g_string_append (str, buf);
 	}
diff --git a/calendar/backends/caldav/e-cal-backend-caldav-factory.c b/calendar/backends/caldav/e-cal-backend-caldav-factory.c
index 64f5063..8b21601 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav-factory.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav-factory.c
@@ -44,7 +44,7 @@ ecb_caldav_factory_instance_init (ECalBackendCalDAVFactory *factory)
 {
 }
 
-static const char *
+static const gchar *
 _get_protocol (ECalBackendFactory *factory)
 {
 	return "caldav";
@@ -126,7 +126,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = caldav_types;
 	*num_types = 3;
diff --git a/calendar/backends/caldav/e-cal-backend-caldav-factory.h b/calendar/backends/caldav/e-cal-backend-caldav-factory.h
index de8b684..4b0a1d2 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav-factory.h
+++ b/calendar/backends/caldav/e-cal-backend-caldav-factory.h
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 
 void                 eds_module_initialize (GTypeModule *module);
 void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, int *num_types);
+void                 eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index dae83be..347bca1 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -100,11 +100,11 @@ struct _ECalBackendCalDAVPrivate {
 	gboolean read_only;
 
 	/* clandar uri */
-	char *uri;
+	gchar *uri;
 
 	/* Authentication info */
-	char *username;
-	char *password;
+	gchar *username;
+	gchar *password;
 	gboolean need_auth;
 
 	/* object cleanup */
@@ -128,10 +128,10 @@ static gboolean caldav_debug_all = FALSE;
 static GHashTable *caldav_debug_table = NULL;
 
 static void
-add_debug_key (const char *start, const char *end)
+add_debug_key (const gchar *start, const gchar *end)
 {
-	char *debug_key;
-	char *debug_value;
+	gchar *debug_key;
+	gchar *debug_value;
 
 	if (start == end) {
 		return;
@@ -157,12 +157,12 @@ add_debug_key (const char *start, const char *end)
 static gpointer
 caldav_debug_init_once (gpointer data)
 {
-	const char *dbg;
+	const gchar *dbg;
 
 	dbg = g_getenv ("CALDAV_DEBUG");
 
 	if (dbg) {
-		const char *ptr;
+		const gchar *ptr;
 
 		d(g_debug ("Got debug env variable: [%s]", dbg));
 
@@ -209,7 +209,7 @@ caldav_debug_init (void)
 }
 
 static gboolean
-caldav_debug_show (const char *component)
+caldav_debug_show (const gchar *component)
 {
 	if (G_UNLIKELY (caldav_debug_all)) {
 		return TRUE;
@@ -244,17 +244,17 @@ caldav_debug_setup (SoupSession *session)
 static ECalBackendSyncClass *parent_class = NULL;
 
 static icaltimezone *caldav_internal_get_default_timezone (ECalBackend *backend);
-static icaltimezone *caldav_internal_get_timezone (ECalBackend *backend, const char *tzid);
+static icaltimezone *caldav_internal_get_timezone (ECalBackend *backend, const gchar *tzid);
 
-static gboolean remove_comp_from_cache (ECalBackendCalDAV *cbdav, const char *uid, const char *rid);
-static gboolean put_comp_to_cache (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp, const char *href, const char *etag);
+static gboolean remove_comp_from_cache (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *rid);
+static gboolean put_comp_to_cache (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp, const gchar *href, const gchar *etag);
 
 /* ************************************************************************* */
 /* Misc. utility functions */
 #define X_E_CALDAV "X-EVOLUTION-CALDAV-"
 
 static void
-icomp_x_prop_set (icalcomponent *comp, const char *key, const char *value)
+icomp_x_prop_set (icalcomponent *comp, const gchar *key, const gchar *value)
 {
 	icalproperty *xprop;
 
@@ -262,7 +262,7 @@ icomp_x_prop_set (icalcomponent *comp, const char *key, const char *value)
 	xprop = icalcomponent_get_first_property (comp, ICAL_X_PROPERTY);
 
 	while (xprop) {
-		const char *str = icalproperty_get_x_name (xprop);
+		const gchar *str = icalproperty_get_x_name (xprop);
 
 		if (!strcmp (str, key)) {
 			if (value) {
@@ -285,8 +285,8 @@ icomp_x_prop_set (icalcomponent *comp, const char *key, const char *value)
 }
 
 
-static char *
-icomp_x_prop_get (icalcomponent *comp, const char *key)
+static gchar *
+icomp_x_prop_get (icalcomponent *comp, const gchar *key)
 {
 	icalproperty *xprop;
 
@@ -294,7 +294,7 @@ icomp_x_prop_get (icalcomponent *comp, const char *key)
 	xprop = icalcomponent_get_first_property (comp, ICAL_X_PROPERTY);
 
 	while (xprop) {
-		const char *str = icalproperty_get_x_name (xprop);
+		const gchar *str = icalproperty_get_x_name (xprop);
 
 		if (!strcmp (str, key)) {
 			break;
@@ -312,7 +312,7 @@ icomp_x_prop_get (icalcomponent *comp, const char *key)
 
 /* passing NULL as 'href' removes the property */
 static void
-ecalcomp_set_href (ECalComponent *comp, const char *href)
+ecalcomp_set_href (ECalComponent *comp, const gchar *href)
 {
 	icalcomponent *icomp;
 
@@ -322,11 +322,11 @@ ecalcomp_set_href (ECalComponent *comp, const char *href)
 	icomp_x_prop_set (icomp, X_E_CALDAV "HREF", href);
 }
 
-static char *
+static gchar *
 ecalcomp_get_href (ECalComponent *comp)
 {
 	icalcomponent *icomp;
-	char          *str;
+	gchar          *str;
 
 	str = NULL;
 	icomp = e_cal_component_get_icalcomponent (comp);
@@ -339,7 +339,7 @@ ecalcomp_get_href (ECalComponent *comp)
 
 /* passing NULL as 'etag' removes the property */
 static void
-ecalcomp_set_etag (ECalComponent *comp, const char *etag)
+ecalcomp_set_etag (ECalComponent *comp, const gchar *etag)
 {
 	icalcomponent *icomp;
 
@@ -349,11 +349,11 @@ ecalcomp_set_etag (ECalComponent *comp, const char *etag)
 	icomp_x_prop_set (icomp, X_E_CALDAV "ETAG", etag);
 }
 
-static char *
+static gchar *
 ecalcomp_get_etag (ECalComponent *comp)
 {
 	icalcomponent *icomp;
-	char          *str;
+	gchar          *str;
 
 	str = NULL;
 	icomp = e_cal_component_get_icalcomponent (comp);
@@ -382,7 +382,7 @@ static void
 ecalcomp_set_synch_state (ECalComponent *comp, ECalCompSyncState state)
 {
 	icalcomponent *icomp;
-	char          *state_string;
+	gchar          *state_string;
 
 	icomp = e_cal_component_get_icalcomponent (comp);
 
@@ -397,10 +397,10 @@ ecalcomp_set_synch_state (ECalComponent *comp, ECalCompSyncState state)
 /* gen uid, set it internally and report it back so we can instantly
  * use it
  * and btw FIXME!!! */
-static char *
+static gchar *
 ecalcomp_gen_href (ECalComponent *comp)
 {
-	char *href, *iso;
+	gchar *href, *iso;
 
 	icalcomponent *icomp;
 
@@ -417,10 +417,10 @@ ecalcomp_gen_href (ECalComponent *comp)
 }
 
 /* ensure etag is quoted (to workaround potential server bugs) */
-static char *
-quote_etag (const char *etag)
+static gchar *
+quote_etag (const gchar *etag)
 {
-	char *ret;
+	gchar *ret;
 
 	if (etag && (strlen (etag) < 2 || etag[strlen (etag) - 1] != '\"')) {
 		ret = g_strdup_printf ("\"%s\"", etag);
@@ -498,11 +498,11 @@ check_state (ECalBackendCalDAV *cbdav, gboolean *online)
 /* XML Parsing code */
 
 static xmlXPathObjectPtr
-xpath_eval (xmlXPathContextPtr ctx, const char *format, ...)
+xpath_eval (xmlXPathContextPtr ctx, const gchar *format, ...)
 {
 	xmlXPathObjectPtr  result;
 	va_list            args;
-	char              *expr;
+	gchar              *expr;
 
 	if (ctx == NULL) {
 		return NULL;
@@ -540,7 +540,7 @@ parse_status_node (xmlNodePtr node, guint *status_code)
 
 	content = xmlNodeGetContent (node);
 
-	res = soup_headers_parse_status_line ((char *) content,
+	res = soup_headers_parse_status_line ((gchar *) content,
 					      NULL,
 					      status_code,
 					      NULL);
@@ -550,16 +550,16 @@ parse_status_node (xmlNodePtr node, guint *status_code)
 }
 #endif
 
-static char *
+static gchar *
 xp_object_get_string (xmlXPathObjectPtr result)
 {
-	char *ret = NULL;
+	gchar *ret = NULL;
 
 	if (result == NULL)
 		return ret;
 
 	if (result->type == XPATH_STRING) {
-		ret = g_strdup ((char *) result->stringval);
+		ret = g_strdup ((gchar *) result->stringval);
 	}
 
 	xmlXPathFreeObject (result);
@@ -568,17 +568,17 @@ xp_object_get_string (xmlXPathObjectPtr result)
 
 /* as get_string but will normailze it (i.e. only take
  * the last part of the href) */
-static char *
+static gchar *
 xp_object_get_href (xmlXPathObjectPtr result)
 {
-	char *ret = NULL;
-	char *val;
+	gchar *ret = NULL;
+	gchar *val;
 
 	if (result == NULL)
 		return ret;
 
 	if (result->type == XPATH_STRING) {
-		val = (char *) result->stringval;
+		val = (gchar *) result->stringval;
 
 		if ((ret = g_strrstr (val, "/")) == NULL) {
 			ret = val;
@@ -597,17 +597,17 @@ xp_object_get_href (xmlXPathObjectPtr result)
 }
 
 /* like get_string but will quote the etag if necessary */
-static char *
+static gchar *
 xp_object_get_etag (xmlXPathObjectPtr result)
 {
-	char *ret = NULL;
-	char *str;
+	gchar *ret = NULL;
+	gchar *str;
 
 	if (result == NULL)
 		return ret;
 
 	if (result->type == XPATH_STRING) {
-		str = (char *) result->stringval;
+		str = (gchar *) result->stringval;
 
 		ret = quote_etag (str);
 	}
@@ -626,7 +626,7 @@ xp_object_get_status (xmlXPathObjectPtr result)
 		return ret;
 
 	if (result->type == XPATH_STRING) {
-		res = soup_headers_parse_status_line ((char *) result->stringval,
+		res = soup_headers_parse_status_line ((gchar *) result->stringval,
 							NULL,
 							&ret,
 							NULL);
@@ -644,7 +644,7 @@ xp_object_get_status (xmlXPathObjectPtr result)
 static int
 xp_object_get_number (xmlXPathObjectPtr result)
 {
-	int ret = -1;
+	gint ret = -1;
 
 	if (result == NULL)
 		return ret;
@@ -671,12 +671,12 @@ typedef struct _CalDAVObject CalDAVObject;
 
 struct _CalDAVObject {
 
-	char *href;
-	char *etag;
+	gchar *href;
+	gchar *etag;
 
 	guint status;
 
-	char *cdata;
+	gchar *cdata;
 };
 
 static void
@@ -692,12 +692,12 @@ caldav_object_free (CalDAVObject *object, gboolean free_object_itself)
 }
 
 static gboolean
-parse_report_response (SoupMessage *soup_message, CalDAVObject **objs, int *len)
+parse_report_response (SoupMessage *soup_message, CalDAVObject **objs, gint *len)
 {
 	xmlXPathContextPtr xpctx;
 	xmlXPathObjectPtr  result;
 	xmlDocPtr          doc;
-	int                i, n;
+	gint                i, n;
 	gboolean           res;
 
 	g_return_val_if_fail (soup_message != NULL, FALSE);
@@ -804,7 +804,7 @@ redirect_handler (SoupMessage *msg, gpointer user_data)
 	if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) {
 		SoupSession *soup_session = user_data;
 		SoupURI *new_uri;
-		const char *new_loc;
+		const gchar *new_loc;
 
 		new_loc = soup_message_headers_get (msg->response_headers, "Location");
 		if (!new_loc)
@@ -826,7 +826,7 @@ redirect_handler (SoupMessage *msg, gpointer user_data)
 }
 
 static void
-send_and_handle_redirection (SoupSession *soup_session, SoupMessage *msg, char **new_location)
+send_and_handle_redirection (SoupSession *soup_session, SoupMessage *msg, gchar **new_location)
 {
 	gchar *old_uri = NULL;
 
@@ -849,11 +849,11 @@ send_and_handle_redirection (SoupSession *soup_session, SoupMessage *msg, char *
 	g_free (old_uri);
 }
 
-static char *
-caldav_generate_uri (ECalBackendCalDAV *cbdav, const char *target)
+static gchar *
+caldav_generate_uri (ECalBackendCalDAV *cbdav, const gchar *target)
 {
 	ECalBackendCalDAVPrivate  *priv;
-	char *uri;
+	gchar *uri;
 
 	priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -868,7 +868,7 @@ caldav_server_open_calendar (ECalBackendCalDAV *cbdav)
 {
 	ECalBackendCalDAVPrivate  *priv;
 	SoupMessage               *message;
-	const char                *header;
+	const gchar                *header;
 	gboolean                   calendar_access;
 	gboolean                   put_allowed;
 	gboolean                   delete_allowed;
@@ -947,10 +947,10 @@ parse_getctag_response (SoupMessage *message, gchar **new_ctag)
 	xmlXPathRegisterNs (xpctx, (xmlChar *) "CS", (xmlChar *) "http://calendarserver.org/ns/";);
 
 	if (xp_object_get_status (xpath_eval (xpctx, XPATH_GETCTAG_STATUS)) == 200) {
-		char *txt = xp_object_get_string (xpath_eval (xpctx, XPATH_GETCTAG));
+		gchar *txt = xp_object_get_string (xpath_eval (xpctx, XPATH_GETCTAG));
 
 		if (txt && *txt) {
-			int len = strlen (txt);
+			gint len = strlen (txt);
 
 			if (*txt == '\"' && len > 2 && txt [len - 1] == '\"') {
 				/* dequote */
@@ -1020,7 +1020,7 @@ check_calendar_changed_on_server (ECalBackendCalDAV *cbdav)
 	soup_message_set_request (message,
 				  "application/xml",
 				  SOUP_MEMORY_COPY,
-				  (char *) buf->buffer->content,
+				  (gchar *) buf->buffer->content,
 				  buf->buffer->use);
 
 	/* Send the request now */
@@ -1035,10 +1035,10 @@ check_calendar_changed_on_server (ECalBackendCalDAV *cbdav)
 		/* does not support it, but report calendar changed to update cache */
 		priv->ctag_supported = FALSE;
 	} else {
-		char *ctag = NULL;
+		gchar *ctag = NULL;
 
 		if (parse_getctag_response (message, &ctag)) {
-			const char *my_ctag = e_cal_backend_cache_get_key_value (priv->cache, CALDAV_CTAG_KEY);
+			const gchar *my_ctag = e_cal_backend_cache_get_key_value (priv->cache, CALDAV_CTAG_KEY);
 
 			if (ctag && my_ctag && g_str_equal (ctag, my_ctag)) {
 				/* ctag is same, no change in the calendar */
@@ -1059,7 +1059,7 @@ check_calendar_changed_on_server (ECalBackendCalDAV *cbdav)
 }
 
 static gboolean
-caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, int *len)
+caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, gint *len)
 {
 	ECalBackendCalDAVPrivate *priv;
 	xmlOutputBufferPtr   buf;
@@ -1124,7 +1124,7 @@ caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, int *
 	soup_message_set_request (message,
 				  "application/xml",
 				  SOUP_MEMORY_COPY,
-				  (char *) buf->buffer->content,
+				  (gchar *) buf->buffer->content,
 				  buf->buffer->use);
 
 	/* Send the request now */
@@ -1156,8 +1156,8 @@ caldav_server_get_object (ECalBackendCalDAV *cbdav, CalDAVObject *object)
 	ECalBackendCalDAVPrivate *priv;
 	ECalBackendSyncStatus     result;
 	SoupMessage              *message;
-	const char               *hdr;
-	char                     *uri;
+	const gchar               *hdr;
+	gchar                     *uri;
 
 	priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 	result = GNOME_Evolution_Calendar_Success;
@@ -1219,8 +1219,8 @@ caldav_server_put_object (ECalBackendCalDAV *cbdav, CalDAVObject *object, icalco
 	ECalBackendCalDAVPrivate *priv;
 	ECalBackendSyncStatus     result;
 	SoupMessage              *message;
-	const char               *hdr;
-	char                     *uri;
+	const gchar               *hdr;
+	gchar                     *uri;
 
 	priv   = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 	result = GNOME_Evolution_Calendar_Success;
@@ -1258,11 +1258,11 @@ caldav_server_put_object (ECalBackendCalDAV *cbdav, CalDAVObject *object, icalco
 	send_and_handle_redirection (priv->session, message, &uri);
 
 	if (uri) {
-		char *file = strrchr (uri, '/');
+		gchar *file = strrchr (uri, '/');
 
 		/* there was a redirect, update href properly */
 		if (file) {
-			char *decoded;
+			gchar *decoded;
 
 			g_free (object->href);
 
@@ -1289,10 +1289,10 @@ caldav_server_put_object (ECalBackendCalDAV *cbdav, CalDAVObject *object, icalco
 			hdr = soup_message_headers_get (message->response_headers, "Location");
 			if (hdr) {
 				/* reflect possible href change first */
-				char *file = strrchr (hdr, '/');
+				gchar *file = strrchr (hdr, '/');
 
 				if (file) {
-					char *decoded;
+					gchar *decoded;
 
 					g_free (object->href);
 
@@ -1335,7 +1335,7 @@ caldav_server_delete_object (ECalBackendCalDAV *cbdav, CalDAVObject *object)
 	ECalBackendCalDAVPrivate *priv;
 	ECalBackendSyncStatus     result;
 	SoupMessage              *message;
-	char                     *uri;
+	gchar                     *uri;
 
 	priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 	result = GNOME_Evolution_Calendar_Success;
@@ -1371,8 +1371,8 @@ caldav_server_delete_object (ECalBackendCalDAV *cbdav, CalDAVObject *object)
 struct put_to_cache_data
 {
 	icalcomponent *icomp;
-	char *href;
-	char *etag;
+	gchar *href;
+	gchar *etag;
 };
 
 static void
@@ -1483,7 +1483,7 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
 	GList                    *citer;
 	gboolean                  res;
 	int			  len;
-	int                       i;
+	gint                       i;
 
 	priv   = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 	bkend  = E_CAL_BACKEND (cbdav);
@@ -1507,7 +1507,7 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
 	/* build up a index for the href entry */
 	for (citer = cobjs; citer; citer = g_list_next (citer)) {
 		ECalComponent *ccomp = E_CAL_COMPONENT (citer->data);
-		char *href;
+		gchar *href;
 
 		href = ecalcomp_get_href (ccomp);
 
@@ -1528,7 +1528,7 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
 	/* see if we have to update or add some objects */
 	for (i = 0, object = sobjs; i < len; i++, object++) {
 		ECalComponent *ccomp;
-		char *etag = NULL;
+		gchar *etag = NULL;
 
 		if (object->status != 200) {
 			/* just continue here, so that the object
@@ -1564,12 +1564,12 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
 
 		/* keep detached instances in a cache, they will be removed with the master object */
 		if (!e_cal_component_is_instance (comp)) {
-			const char *uid = NULL;
+			const gchar *uid = NULL;
 
 			e_cal_component_get_uid (comp, &uid);
 
 			if (remove_comp_from_cache (cbdav, uid, NULL)) {
-				char *str = e_cal_component_get_as_string (comp);
+				gchar *str = e_cal_component_get_as_string (comp);
 				ECalComponentId *id = e_cal_component_get_id (comp);
 
 				e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbdav), id, str, NULL);
@@ -1587,7 +1587,7 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
 	/* ... then notify created ... */
 	for (citer = created; citer; citer = citer->next) {
 		ECalComponent *comp = citer->data;
-		char *comp_str = e_cal_component_get_as_string (comp);
+		gchar *comp_str = e_cal_component_get_as_string (comp);
 
 		e_cal_backend_notify_object_created (bkend, comp_str);
 
@@ -1598,7 +1598,7 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
 	/* ... and modified components */
 	for (citer = modified; citer; citer = citer->next) {
 		ECalComponent *comp, *old_comp;
-		char *new_str, *old_str;
+		gchar *new_str, *old_str;
 
 		/* always even number of items in the 'modified' list */
 		comp = citer->data;
@@ -1697,7 +1697,7 @@ caldav_is_read_only (ECalBackendSync *backend,
 static ECalBackendSyncStatus
 caldav_get_cal_address (ECalBackendSync  *backend,
 			EDataCal         *cal,
-			char            **address)
+			gchar            **address)
 {
 	*address = NULL;
 	return GNOME_Evolution_Calendar_Success;
@@ -1708,7 +1708,7 @@ caldav_get_cal_address (ECalBackendSync  *backend,
 static ECalBackendSyncStatus
 caldav_get_ldap_attribute (ECalBackendSync  *backend,
 			   EDataCal         *cal,
-			   char           **attribute)
+			   gchar           **attribute)
 {
 	*attribute = NULL;
 	return GNOME_Evolution_Calendar_Success;
@@ -1717,7 +1717,7 @@ caldav_get_ldap_attribute (ECalBackendSync  *backend,
 static ECalBackendSyncStatus
 caldav_get_alarm_email_address (ECalBackendSync  *backend,
 				EDataCal         *cal,
-				char            **address)
+				gchar            **address)
 {
 	*address = NULL;
 	return GNOME_Evolution_Calendar_Success;
@@ -1726,7 +1726,7 @@ caldav_get_alarm_email_address (ECalBackendSync  *backend,
 static ECalBackendSyncStatus
 caldav_get_static_capabilities (ECalBackendSync  *backend,
 				EDataCal         *cal,
-				char            **capabilities)
+				gchar            **capabilities)
 {
 	*capabilities = g_strdup (CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS ","
 				  CAL_STATIC_CAPABILITY_NO_THISANDFUTURE ","
@@ -1742,9 +1742,9 @@ initialize_backend (ECalBackendCalDAV *cbdav)
 	ECalBackendCalDAVPrivate *priv;
 	ESource                  *source;
 	const char		 *os_val;
-	const char               *uri;
+	const gchar               *uri;
 	gsize                     len;
-	const char               *refresh;
+	const gchar               *refresh;
 
 	priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -1766,7 +1766,7 @@ initialize_backend (ECalBackendCalDAV *cbdav)
 	g_free (priv->uri);
 	priv->uri = NULL;
 	if (g_str_has_prefix (uri, "caldav://")) {
-		const char *proto;
+		const gchar *proto;
 
 		if (os_val && os_val[0] == '1') {
 			proto = "https://";;
@@ -1784,8 +1784,8 @@ initialize_backend (ECalBackendCalDAV *cbdav)
 
 		/* properly encode uri */
 		if (suri && suri->path) {
-			char *tmp = soup_uri_encode (suri->path, NULL);
-			char *path = soup_uri_normalize (tmp, "/");
+			gchar *tmp = soup_uri_encode (suri->path, NULL);
+			gchar *path = soup_uri_normalize (tmp, "/");
 
 			soup_uri_set_path (suri, path);
 
@@ -1811,7 +1811,7 @@ initialize_backend (ECalBackendCalDAV *cbdav)
 
 	/* ...and append exactly one slash */
 	if (priv->uri && *priv->uri) {
-		char *tmp = priv->uri;
+		gchar *tmp = priv->uri;
 
 		priv->uri = g_strconcat (priv->uri, "/", NULL);
 
@@ -1884,8 +1884,8 @@ static ECalBackendSyncStatus
 caldav_do_open (ECalBackendSync *backend,
 		EDataCal        *cal,
 		gboolean         only_if_exists,
-		const char      *username,
-		const char      *password)
+		const gchar      *username,
+		const gchar      *password)
 {
 	ECalBackendCalDAV        *cbdav;
 	ECalBackendCalDAVPrivate *priv;
@@ -2008,7 +2008,7 @@ remove_comp_from_cache_cb (gpointer value, gpointer user_data)
 }
 
 static gboolean
-remove_comp_from_cache (ECalBackendCalDAV *cbdav, const char *uid, const char *rid)
+remove_comp_from_cache (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *rid)
 {
 	ECalBackendCalDAVPrivate *priv;
 	gboolean res = FALSE;
@@ -2068,7 +2068,7 @@ sort_master_first (gconstpointer a, gconstpointer b)
    The cache lock should be locked when called this function.
 */
 static icalcomponent *
-get_comp_from_cache (ECalBackendCalDAV *cbdav, const char *uid, const char *rid, char **href, char **etag)
+get_comp_from_cache (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *rid, gchar **href, gchar **etag)
 {
 	ECalBackendCalDAVPrivate *priv;
 	icalcomponent *icalcomp = NULL;
@@ -2125,7 +2125,7 @@ get_comp_from_cache (ECalBackendCalDAV *cbdav, const char *uid, const char *rid,
 }
 
 static gboolean
-put_comp_to_cache (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp, const char *href, const char *etag)
+put_comp_to_cache (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp, const gchar *href, const gchar *etag)
 {
 	ECalBackendCalDAVPrivate *priv;
 	icalcomponent_kind my_kind;
@@ -2222,10 +2222,10 @@ typedef struct {
 } ForeachTzidData;
 
 static void
-add_timezone_cb (icalparameter *param, void *data)
+add_timezone_cb (icalparameter *param, gpointer data)
 {
 	icaltimezone *tz;
-	const char *tzid;
+	const gchar *tzid;
 	icalcomponent *vtz_comp;
 	ForeachTzidData *f_data = (ForeachTzidData *) data;
 
@@ -2274,12 +2274,12 @@ add_timezones_from_component (ECalBackendCalDAV *cbdav, icalcomponent *vcal_comp
 }
 
 /* also removes X-EVOLUTION-CALDAV from all the components */
-static char *
+static gchar *
 pack_cobj (ECalBackendCalDAV *cbdav, icalcomponent *icomp)
 {
 	ECalBackendCalDAVPrivate *priv;
 	icalcomponent *calcomp;
-	char          *objstr;
+	gchar          *objstr;
 
 	priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -2328,7 +2328,7 @@ sanitize_component (ECalBackend *cb, ECalComponent *comp)
 		zone = caldav_internal_get_timezone (cb, dt.tzid);
 		if (!zone) {
 			default_zone = caldav_internal_get_default_timezone (cb);
-			g_free ((char *)dt.tzid);
+			g_free ((gchar *)dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_dtstart (comp, &dt);
 		}
@@ -2340,7 +2340,7 @@ sanitize_component (ECalBackend *cb, ECalComponent *comp)
 		zone = caldav_internal_get_timezone (cb, dt.tzid);
 		if (!zone) {
 			default_zone = caldav_internal_get_default_timezone (cb);
-			g_free ((char *)dt.tzid);
+			g_free ((gchar *)dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_dtend (comp, &dt);
 		}
@@ -2352,7 +2352,7 @@ sanitize_component (ECalBackend *cb, ECalComponent *comp)
 		zone = caldav_internal_get_timezone (cb, dt.tzid);
 		if (!zone) {
 			default_zone = caldav_internal_get_default_timezone (cb);
-			g_free ((char *)dt.tzid);
+			g_free ((gchar *)dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_due (comp, &dt);
 		}
@@ -2362,7 +2362,7 @@ sanitize_component (ECalBackend *cb, ECalComponent *comp)
 }
 
 static gboolean
-cache_contains (ECalBackendCalDAV *cbdav, const char *uid, const char *rid)
+cache_contains (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *rid)
 {
 	ECalBackendCalDAVPrivate *priv;
 	gboolean res;
@@ -2428,7 +2428,7 @@ remove_instance (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp, struct icalt
 	if (icalcomponent_isa (icalcomp) == ICAL_VCALENDAR_COMPONENT) {
 		icalcomponent *subcomp;
 		icalcomponent_kind my_kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbdav));
-		int left = 0;
+		gint left = 0;
 		gboolean start_first = FALSE;
 
 		master = NULL;
@@ -2497,7 +2497,7 @@ replace_master (ECalBackendCalDAV *cbdav, icalcomponent *old_comp, icalcomponent
 
 /* priv->lock is supposed to be locked already, when calling this function */
 static ECalBackendSyncStatus
-do_create_object (ECalBackendCalDAV *cbdav, char **calobj, char **uid)
+do_create_object (ECalBackendCalDAV *cbdav, gchar **calobj, gchar **uid)
 {
 	ECalBackendCalDAVPrivate *priv;
 	ECalBackendSyncStatus     status;
@@ -2505,7 +2505,7 @@ do_create_object (ECalBackendCalDAV *cbdav, char **calobj, char **uid)
 	gboolean                  online;
 	struct icaltimetype current;
 	icalcomponent *icalcomp;
-	const char *comp_uid;
+	const gchar *comp_uid;
 
 	priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -2529,7 +2529,7 @@ do_create_object (ECalBackendCalDAV *cbdav, char **calobj, char **uid)
 
 	comp_uid = icalcomponent_get_uid (icalcomp);
 	if (!comp_uid) {
-		char *new_uid;
+		gchar *new_uid;
 
 		new_uid = e_cal_component_gen_uid ();
 		if (!new_uid) {
@@ -2599,7 +2599,7 @@ do_create_object (ECalBackendCalDAV *cbdav, char **calobj, char **uid)
 
 /* priv->lock is supposed to be locked already, when calling this function */
 static ECalBackendSyncStatus
-do_modify_object (ECalBackendCalDAV *cbdav, const char *calobj, CalObjModType mod, char **old_object, char **new_object)
+do_modify_object (ECalBackendCalDAV *cbdav, const gchar *calobj, CalObjModType mod, gchar **old_object, gchar **new_object)
 {
 	ECalBackendCalDAVPrivate *priv;
 	ECalBackendSyncStatus     status;
@@ -2608,7 +2608,7 @@ do_modify_object (ECalBackendCalDAV *cbdav, const char *calobj, CalObjModType mo
 	gboolean                  online;
 	ECalComponentId		 *id;
 	struct icaltimetype current;
-	char *href = NULL, *etag = NULL;
+	gchar *href = NULL, *etag = NULL;
 
 	priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -2756,13 +2756,13 @@ do_modify_object (ECalBackendCalDAV *cbdav, const char *calobj, CalObjModType mo
 
 /* priv->lock is supposed to be locked already, when calling this function */
 static ECalBackendSyncStatus
-do_remove_object (ECalBackendCalDAV *cbdav, const char *uid, const char *rid, CalObjModType mod, char **old_object, char **object)
+do_remove_object (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *rid, CalObjModType mod, gchar **old_object, gchar **object)
 {
 	ECalBackendCalDAVPrivate *priv;
 	ECalBackendSyncStatus     status;
 	icalcomponent            *cache_comp;
 	gboolean                  online;
-	char *href = NULL, *etag = NULL;
+	gchar *href = NULL, *etag = NULL;
 
 	priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -2856,7 +2856,7 @@ do_remove_object (ECalBackendCalDAV *cbdav, const char *uid, const char *rid, Ca
 }
 
 static ECalBackendSyncStatus
-caldav_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
+caldav_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid)
 {
 	ECalBackendCalDAV        *cbdav;
 	ECalBackendCalDAVPrivate *priv;
@@ -2873,7 +2873,7 @@ caldav_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, ch
 }
 
 static ECalBackendSyncStatus
-caldav_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj, CalObjModType mod, char **old_object, char **new_object)
+caldav_modify_object (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod, gchar **old_object, gchar **new_object)
 {
 	ECalBackendCalDAV        *cbdav;
 	ECalBackendCalDAVPrivate *priv;
@@ -2890,7 +2890,7 @@ caldav_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calob
 }
 
 static ECalBackendSyncStatus
-caldav_remove_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, CalObjModType mod, char **old_object, char **object)
+caldav_remove_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, CalObjModType mod, gchar **old_object, gchar **object)
 {
 	ECalBackendCalDAV        *cbdav;
 	ECalBackendCalDAVPrivate *priv;
@@ -2909,8 +2909,8 @@ caldav_remove_object (ECalBackendSync *backend, EDataCal *cal, const char *uid,
 static ECalBackendSyncStatus
 caldav_discard_alarm (ECalBackendSync *backend,
 		      EDataCal        *cal,
-		      const char      *uid,
-		      const char      *auid)
+		      const gchar      *uid,
+		      const gchar      *auid)
 {
 	return GNOME_Evolution_Calendar_Success;
 }
@@ -2995,7 +2995,7 @@ process_object (ECalBackendCalDAV   *cbdav,
 	ECalBackendSyncStatus     status;
 	ECalBackend              *backend;
 	struct icaltimetype       now;
-	char *new_obj_str;
+	gchar *new_obj_str;
 	gboolean is_declined, is_in_cache;
 	CalObjModType mod;
 	ECalComponentId *id = e_cal_component_get_id (ecomp);
@@ -3024,7 +3024,7 @@ process_object (ECalBackendCalDAV   *cbdav,
 		is_declined = e_cal_backend_user_declined (e_cal_component_get_icalcomponent (ecomp));
 		if (is_in_cache) {
 			if (!is_declined) {
-				char *new_object = NULL, *old_object = NULL;
+				gchar *new_object = NULL, *old_object = NULL;
 
 				status = do_modify_object (cbdav, new_obj_str, mod, &old_object, &new_object);
 				if (status == GNOME_Evolution_Calendar_Success) {
@@ -3037,7 +3037,7 @@ process_object (ECalBackendCalDAV   *cbdav,
 				g_free (new_object);
 				g_free (old_object);
 			} else {
-				char *new_object = NULL, *old_object = NULL;
+				gchar *new_object = NULL, *old_object = NULL;
 
 				status = do_remove_object (cbdav, id->uid, id->rid, mod, &old_object, &new_object);
 				if (status == GNOME_Evolution_Calendar_Success) {
@@ -3052,7 +3052,7 @@ process_object (ECalBackendCalDAV   *cbdav,
 				g_free (old_object);
 			}
 		} else if (!is_declined) {
-			char *new_object = new_obj_str;
+			gchar *new_object = new_obj_str;
 
 			status = do_create_object (cbdav, &new_object, NULL);
 			if (status == GNOME_Evolution_Calendar_Success) {
@@ -3065,7 +3065,7 @@ process_object (ECalBackendCalDAV   *cbdav,
 		break;
 	case ICAL_METHOD_CANCEL:
 		if (is_in_cache) {
-			char *old_object = NULL, *new_object = NULL;
+			gchar *old_object = NULL, *new_object = NULL;
 
 			status = do_remove_object (cbdav, id->uid, id->rid, CALOBJ_MOD_THIS, &old_object, &new_object);
 			if (status == GNOME_Evolution_Calendar_Success) {
@@ -3097,7 +3097,7 @@ process_object (ECalBackendCalDAV   *cbdav,
 static ECalBackendSyncStatus
 caldav_receive_objects (ECalBackendSync *backend,
 			EDataCal        *cal,
-			const char      *calobj)
+			const gchar      *calobj)
 {
 	ECalBackendCalDAV        *cbdav;
 	ECalBackendCalDAVPrivate *priv;
@@ -3176,9 +3176,9 @@ caldav_receive_objects (ECalBackendSync *backend,
 static ECalBackendSyncStatus
 caldav_send_objects (ECalBackendSync  *backend,
 		     EDataCal         *cal,
-		     const char       *calobj,
+		     const gchar       *calobj,
 		     GList           **users,
-		     char            **modified_calobj)
+		     gchar            **modified_calobj)
 {
 	*users = NULL;
 	*modified_calobj = g_strdup (calobj);
@@ -3189,7 +3189,7 @@ caldav_send_objects (ECalBackendSync  *backend,
 static ECalBackendSyncStatus
 caldav_get_default_object (ECalBackendSync  *backend,
 			   EDataCal         *cal,
-			   char            **object)
+			   gchar            **object)
 {
 	ECalComponent *comp;
 
@@ -3219,9 +3219,9 @@ caldav_get_default_object (ECalBackendSync  *backend,
 static ECalBackendSyncStatus
 caldav_get_object (ECalBackendSync  *backend,
 		   EDataCal         *cal,
-		   const char       *uid,
-		   const char       *rid,
-		   char           **object)
+		   const gchar       *uid,
+		   const gchar       *rid,
+		   gchar           **object)
 {
 	ECalBackendCalDAV        *cbdav;
 	ECalBackendCalDAVPrivate *priv;
@@ -3250,8 +3250,8 @@ caldav_get_object (ECalBackendSync  *backend,
 static ECalBackendSyncStatus
 caldav_get_timezone (ECalBackendSync  *backend,
 		     EDataCal         *cal,
-		     const char       *tzid,
-		     char            **object)
+		     const gchar       *tzid,
+		     gchar            **object)
 {
 	ECalBackendCalDAV        *cbdav;
 	ECalBackendCalDAVPrivate *priv;
@@ -3289,7 +3289,7 @@ caldav_get_timezone (ECalBackendSync  *backend,
 static ECalBackendSyncStatus
 caldav_add_timezone (ECalBackendSync *backend,
 		     EDataCal        *cal,
-		     const char      *tzobj)
+		     const gchar      *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendCalDAV *cbdav;
@@ -3327,7 +3327,7 @@ caldav_add_timezone (ECalBackendSync *backend,
 static ECalBackendSyncStatus
 caldav_set_default_zone (ECalBackendSync *backend,
 			     EDataCal        *cal,
-			     const char      *tzobj)
+			     const gchar      *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendCalDAV *cbdav;
@@ -3359,7 +3359,7 @@ caldav_set_default_zone (ECalBackendSync *backend,
 static ECalBackendSyncStatus
 caldav_get_object_list (ECalBackendSync  *backend,
 			EDataCal         *cal,
-			const char       *sexp_string,
+			const gchar       *sexp_string,
 			GList           **objects)
 {
 	ECalBackendCalDAV        *cbdav;
@@ -3398,7 +3398,7 @@ caldav_get_object_list (ECalBackendSync  *backend,
 
 		if (!do_search ||
 		    e_cal_backend_sexp_match_comp (sexp, comp, bkend)) {
-			char *str = e_cal_component_get_as_string (comp);
+			gchar *str = e_cal_component_get_as_string (comp);
 			*objects = g_list_prepend (*objects, str);
 		}
 
@@ -3423,7 +3423,7 @@ caldav_start_query (ECalBackend  *backend,
 	ECalBackend              *bkend;
 	gboolean                  do_search;
 	GList			 *list, *iter;
-	const char               *sexp_string;
+	const gchar               *sexp_string;
 
 	cbdav = E_CAL_BACKEND_CALDAV (backend);
 	priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
@@ -3449,7 +3449,7 @@ caldav_start_query (ECalBackend  *backend,
 
 		if (!do_search ||
 		    e_cal_backend_sexp_match_comp (sexp, comp, bkend)) {
-			char *str = e_cal_component_get_as_string (comp);
+			gchar *str = e_cal_component_get_as_string (comp);
 			e_data_cal_view_notify_objects_added_1 (query, str);
 			g_free (str);
 		}
@@ -3482,7 +3482,7 @@ caldav_get_free_busy (ECalBackendSync  *backend,
 static ECalBackendSyncStatus
 caldav_get_changes (ECalBackendSync  *backend,
 		    EDataCal         *cal,
-		    const char       *change_id,
+		    const gchar       *change_id,
 		    GList           **adds,
 		    GList           **modifies,
 		    GList **deletes)
@@ -3583,7 +3583,7 @@ caldav_internal_get_default_timezone (ECalBackend *backend)
 
 static icaltimezone *
 caldav_internal_get_timezone (ECalBackend *backend,
-			      const char *tzid)
+			      const gchar *tzid)
 {
 	icaltimezone *zone;
 
diff --git a/calendar/backends/contacts/e-cal-backend-contacts-factory.c b/calendar/backends/contacts/e-cal-backend-contacts-factory.c
index bd32bc6..6c75b53 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts-factory.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts-factory.c
@@ -29,7 +29,7 @@ e_cal_backend_contacts_factory_instance_init (ECalBackendContactsFactory *factor
 {
 }
 
-static const char *
+static const gchar *
 _get_protocol (ECalBackendFactory *factory)
 {
 	return "contacts";
@@ -99,7 +99,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = contacts_types;
 	*num_types = 1;
diff --git a/calendar/backends/contacts/e-cal-backend-contacts-factory.h b/calendar/backends/contacts/e-cal-backend-contacts-factory.h
index 4351938..74f7669 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts-factory.h
+++ b/calendar/backends/contacts/e-cal-backend-contacts-factory.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 
 void                 eds_module_initialize (GTypeModule *module);
 void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, int *num_types);
+void                 eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index 8648c1a..842c735 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -74,7 +74,7 @@ struct _ECalBackendContactsPrivate {
 	guint notifyid3;
 	guint update_alarms_id;
 	gboolean alarm_enabled;
-	int alarm_interval;
+	gint alarm_interval;
 	CalUnits alarm_units;
 };
 
@@ -100,7 +100,7 @@ static ECalComponent * create_anniversary (ECalBackendContacts *cbc, EContact *c
 static void contacts_changed_cb (EBookView *book_view, const GList *contacts, gpointer user_data);
 static void contacts_added_cb   (EBookView *book_view, const GList *contacts, gpointer user_data);
 static void contacts_removed_cb (EBookView *book_view, const GList *contact_ids, gpointer user_data);
-static ECalBackendSyncStatus e_cal_backend_contacts_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
+static ECalBackendSyncStatus e_cal_backend_contacts_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj);
 static void setup_alarm (ECalBackendContacts *cbc, ECalComponent *comp);
 
 /* BookRecord methods */
@@ -125,9 +125,9 @@ book_record_new (ECalBackendContacts *cbc, ESource *source)
 	}
 
         /* Create book view */
-        fields = g_list_append (fields, (char*)e_contact_field_name (E_CONTACT_FILE_AS));
-        fields = g_list_append (fields, (char*)e_contact_field_name (E_CONTACT_BIRTH_DATE));
-        fields = g_list_append (fields, (char*)e_contact_field_name (E_CONTACT_ANNIVERSARY));
+        fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FILE_AS));
+        fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_BIRTH_DATE));
+        fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_ANNIVERSARY));
         query = e_book_query_any_field_contains ("");
 
         if (!e_book_get_book_view (book, query, fields, -1, &book_view, NULL)) {
@@ -169,7 +169,7 @@ static ContactRecord *
 contact_record_new (ECalBackendContacts *cbc, EContact *contact)
 {
         ContactRecord *cr = g_new0 (ContactRecord, 1);
-	char *comp_str;
+	gchar *comp_str;
 
         cr->cbc = cbc;
         cr->contact = contact;
@@ -199,7 +199,7 @@ contact_record_new (ECalBackendContacts *cbc, EContact *contact)
 static void
 contact_record_free (ContactRecord *cr)
 {
-        char *comp_str;
+        gchar *comp_str;
 	ECalComponentId *id;
 
         g_object_unref (G_OBJECT (cr->contact));
@@ -265,12 +265,12 @@ contact_record_cb (gpointer key, gpointer value, gpointer user_data)
         ContactRecord   *record = value;
 
         if (record->comp_birthday && e_cal_backend_sexp_match_comp (cb_data->sexp, record->comp_birthday, E_CAL_BACKEND (cb_data->cbc))) {
-                char * comp_str = e_cal_component_get_as_string (record->comp_birthday);
+                gchar * comp_str = e_cal_component_get_as_string (record->comp_birthday);
                 cb_data->result = g_list_append (cb_data->result, comp_str);
         }
 
         if (record->comp_anniversary && e_cal_backend_sexp_match_comp (cb_data->sexp, record->comp_anniversary, E_CAL_BACKEND (cb_data->cbc))) {
-                char * comp_str = e_cal_component_get_as_string (record->comp_anniversary);
+                gchar * comp_str = e_cal_component_get_as_string (record->comp_anniversary);
                 cb_data->result = g_list_append (cb_data->result, comp_str);
         }
 }
@@ -280,7 +280,7 @@ static void
 add_source (ECalBackendContacts *cbc, ESource *source)
 {
         BookRecord *br = book_record_new (cbc, source);
-        const char *uid = e_source_peek_uid (source);
+        const gchar *uid = e_source_peek_uid (source);
 
 	if (!br)
 		return;
@@ -302,7 +302,7 @@ static void
 source_removed_cb (ESourceGroup *group, ESource *source, gpointer user_data)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
-        const char          *uid = e_source_peek_uid (source);
+        const gchar          *uid = e_source_peek_uid (source);
 
         g_return_if_fail (cbc);
 
@@ -346,7 +346,7 @@ source_group_removed_cb (ESourceList *source_list, ESourceGroup *group, gpointer
         /* Unload all address books from this group */
         for (i = e_source_group_peek_sources (group); i; i = i->next) {
                 ESource *source = E_SOURCE (i->data);
-                const char *uid = e_source_peek_uid (source);
+                const gchar *uid = e_source_peek_uid (source);
 
                 g_hash_table_remove (cbc->priv->addressbooks, uid);
         }
@@ -362,12 +362,12 @@ contacts_changed_cb (EBookView *book_view, const GList *contacts, gpointer user_
 
         for (i = contacts; i; i = i->next) {
                 EContact *contact = E_CONTACT (i->data);
-                const char *uid = e_contact_get_const (contact, E_CONTACT_UID);
+                const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID);
 
                 /* Because this is a change of contact, then always remove old tracked data
 		   and if possible, add with (possibly) new values.
 		*/
-		g_hash_table_remove (cbc->priv->tracked_contacts, (char *)uid);
+		g_hash_table_remove (cbc->priv->tracked_contacts, (gchar *)uid);
 
                 if (e_contact_get (contact, E_CONTACT_BIRTH_DATE) ||
                     e_contact_get (contact, E_CONTACT_ANNIVERSARY)) {
@@ -394,7 +394,7 @@ contacts_added_cb (EBookView *book_view, const GList *contacts, gpointer user_da
 
                 if (birthday || anniversary) {
                         ContactRecord *cr = contact_record_new (cbc, contact);
-                        const char    *uid = e_contact_get_const (contact, E_CONTACT_UID);
+                        const gchar    *uid = e_contact_get_const (contact, E_CONTACT_UID);
 
                         g_hash_table_insert (cbc->priv->tracked_contacts, g_strdup (uid), cr);
                 }
@@ -437,7 +437,7 @@ cdate_to_icaltime (EContactDate *cdate)
 static void
 manage_comp_alarm_update (ECalBackendContacts *cbc, ECalComponent *comp)
 {
-	char *old_comp, *new_comp;
+	gchar *old_comp, *new_comp;
 
 	g_return_if_fail (cbc != NULL);
 	g_return_if_fail (comp != NULL);
@@ -507,7 +507,7 @@ setup_alarm (ECalBackendContacts *cbc, ECalComponent *comp)
 	g_return_if_fail (cbc != NULL);
 
 	if (!comp || cbc->priv->alarm_interval == -1) {
-		char *str;
+		gchar *str;
 
 		#define BA_CONF_DIR		"/apps/evolution/calendar/other"
 		#define BA_CONF_ENABLED		BA_CONF_DIR "/use_ba_reminder"
@@ -591,7 +591,7 @@ setup_alarm (ECalBackendContacts *cbc, ECalComponent *comp)
 
 /* Contact -> Event creator */
 static ECalComponent *
-create_component (ECalBackendContacts *cbc, const char *uid, EContactDate *cdate, const char *summary)
+create_component (ECalBackendContacts *cbc, const gchar *uid, EContactDate *cdate, const gchar *summary)
 {
         ECalComponent             *cal_comp;
 	ECalComponentText          comp_summary;
@@ -667,14 +667,14 @@ create_birthday (ECalBackendContacts *cbc, EContact *contact)
 {
         EContactDate  *cdate;
         ECalComponent *cal_comp;
-	char          *summary;
-        const char    *name;
-        char *uid;
+	gchar          *summary;
+        const gchar    *name;
+        gchar *uid;
 
         cdate = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
         name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
 
-	uid = g_strdup_printf ("%s%s", (char *) e_contact_get_const (contact, E_CONTACT_UID), BIRTHDAY_UID_EXT);
+	uid = g_strdup_printf ("%s%s", (gchar *) e_contact_get_const (contact, E_CONTACT_UID), BIRTHDAY_UID_EXT);
         summary = g_strdup_printf (_("Birthday: %s"), name);
 
         cal_comp = create_component (cbc, uid, cdate, summary);
@@ -691,14 +691,14 @@ create_anniversary (ECalBackendContacts *cbc, EContact *contact)
 {
         EContactDate  *cdate;
         ECalComponent *cal_comp;
-	char          *summary;
-        const char    *name;
-        char *uid;
+	gchar          *summary;
+        const gchar    *name;
+        gchar *uid;
 
         cdate = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
         name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
 
-	uid = g_strdup_printf ("%s%s", (char *) e_contact_get_const (contact, E_CONTACT_UID), ANNIVERSARY_UID_EXT);
+	uid = g_strdup_printf ("%s%s", (gchar *) e_contact_get_const (contact, E_CONTACT_UID), ANNIVERSARY_UID_EXT);
         summary = g_strdup_printf (_("Anniversary: %s"), name);
 
         cal_comp = create_component (cbc, uid, cdate, summary);
@@ -717,7 +717,7 @@ create_anniversary (ECalBackendContacts *cbc, EContact *contact)
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_get_cal_address (ECalBackendSync *backend, EDataCal *cal,
-					char **address)
+					gchar **address)
 {
 	/* A contact backend has no particular email address associated
 	 * with it (although that would be a useful feature some day).
@@ -729,7 +729,7 @@ e_cal_backend_contacts_get_cal_address (ECalBackendSync *backend, EDataCal *cal,
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal,
-					   char **attribute)
+					   gchar **attribute)
 {
 	*attribute = NULL;
 
@@ -738,7 +738,7 @@ e_cal_backend_contacts_get_ldap_attribute (ECalBackendSync *backend, EDataCal *c
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal,
-						char **address)
+						gchar **address)
 {
 	/* A contact backend has no particular email address associated
 	 * with it (although that would be a useful feature some day).
@@ -750,7 +750,7 @@ e_cal_backend_contacts_get_alarm_email_address (ECalBackendSync *backend, EDataC
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal,
-						char **capabilities)
+						gchar **capabilities)
 {
 	*capabilities = NULL;
 
@@ -766,20 +766,20 @@ e_cal_backend_contacts_remove (ECalBackendSync *backend, EDataCal *cal)
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_get_default_object (ECalBackendSync *backend, EDataCal *cal,
-					   char **object)
+					   gchar **object)
 {
 	return GNOME_Evolution_Calendar_UnsupportedMethod;
 }
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_get_object (ECalBackendSync *backend, EDataCal *cal,
-				   const char *uid, const char *rid,
-				   char **object)
+				   const gchar *uid, const gchar *rid,
+				   gchar **object)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
         ECalBackendContactsPrivate *priv = cbc->priv;
 	ContactRecord *record;
-	char *real_uid;
+	gchar *real_uid;
 
 	if (!uid)
 		return GNOME_Evolution_Calendar_ObjectNotFound;
@@ -824,7 +824,7 @@ e_cal_backend_contacts_get_free_busy (ECalBackendSync *backend, EDataCal *cal,
 
 	icalcomponent *vfb = icalcomponent_new_vfreebusy ();
 	icaltimezone *utc_zone = icaltimezone_get_utc_timezone ();
-	char *calobj;
+	gchar *calobj;
 
 #if 0
 	icalproperty *prop;
@@ -852,7 +852,7 @@ e_cal_backend_contacts_get_free_busy (ECalBackendSync *backend, EDataCal *cal,
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_get_changes (ECalBackendSync *backend, EDataCal *cal,
-				    const char *change_id,
+				    const gchar *change_id,
 				    GList **adds, GList **modifies, GList **deletes)
 {
 	/* WRITE ME */
@@ -861,7 +861,7 @@ e_cal_backend_contacts_get_changes (ECalBackendSync *backend, EDataCal *cal,
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_discard_alarm (ECalBackendSync *backend, EDataCal *cal,
-				      const char *uid, const char *auid)
+				      const gchar *uid, const gchar *auid)
 {
 	/* WRITE ME */
 	return GNOME_Evolution_Calendar_Success;
@@ -869,14 +869,14 @@ e_cal_backend_contacts_discard_alarm (ECalBackendSync *backend, EDataCal *cal,
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_receive_objects (ECalBackendSync *backend, EDataCal *cal,
-					const char *calobj)
+					const gchar *calobj)
 {
 	return GNOME_Evolution_Calendar_PermissionDenied;
 }
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_send_objects (ECalBackendSync *backend, EDataCal *cal,
-				     const char *calobj, GList **users, char **modified_calobj)
+				     const gchar *calobj, GList **users, gchar **modified_calobj)
 {
 	*users = NULL;
 	*modified_calobj = NULL;
@@ -939,7 +939,7 @@ init_sources_cb (ECalBackendContacts *cbc)
 static ECalBackendSyncStatus
 e_cal_backend_contacts_open (ECalBackendSync *backend, EDataCal *cal,
 			     gboolean only_if_exists,
-			     const char *username, const char *password)
+			     const gchar *username, const gchar *password)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
         ECalBackendContactsPrivate *priv = cbc->priv;
@@ -982,7 +982,7 @@ e_cal_backend_contacts_is_loaded (ECalBackend *backend)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_contacts_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
+e_cal_backend_contacts_get_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object)
 {
 	ECalBackendContacts *cbcontacts;
 	ECalBackendContactsPrivate *priv;
@@ -1009,13 +1009,13 @@ e_cal_backend_contacts_get_timezone (ECalBackendSync *backend, EDataCal *cal, co
 
 /* Add_timezone handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_contacts_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_contacts_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	ECalBackendContacts *cbcontacts;
 	ECalBackendContactsPrivate *priv;
 	icalcomponent *tz_comp;
 	icaltimezone *zone;
-	const char *tzid;
+	const gchar *tzid;
 
 	cbcontacts = (ECalBackendContacts *) backend;
 
@@ -1047,7 +1047,7 @@ e_cal_backend_contacts_add_timezone (ECalBackendSync *backend, EDataCal *cal, co
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_contacts_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_contacts_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendContacts *cbcontacts;
@@ -1079,7 +1079,7 @@ e_cal_backend_contacts_set_default_zone (ECalBackendSync *backend, EDataCal *cal
 
 static ECalBackendSyncStatus
 e_cal_backend_contacts_get_object_list (ECalBackendSync *backend, EDataCal *cal,
-					const char *sexp_string, GList **objects)
+					const gchar *sexp_string, GList **objects)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
         ECalBackendContactsPrivate *priv = cbc->priv;
@@ -1133,7 +1133,7 @@ e_cal_backend_contacts_internal_get_default_timezone (ECalBackend *backend)
 }
 
 static icaltimezone *
-e_cal_backend_contacts_internal_get_timezone (ECalBackend *backend, const char *tzid)
+e_cal_backend_contacts_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
 
@@ -1231,7 +1231,7 @@ e_cal_backend_contacts_init (ECalBackendContacts *cbc, ECalBackendContactsClass
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_contacts_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
+e_cal_backend_contacts_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid)
 {
         ECalBackendContacts *cbcontacts;
         ECalBackendContactsPrivate *priv;
diff --git a/calendar/backends/file/e-cal-backend-file-factory.c b/calendar/backends/file/e-cal-backend-file-factory.c
index 85769a5..5182340 100644
--- a/calendar/backends/file/e-cal-backend-file-factory.c
+++ b/calendar/backends/file/e-cal-backend-file-factory.c
@@ -31,7 +31,7 @@ e_cal_backend_file_factory_instance_init (ECalBackendFileFactory *factory)
 {
 }
 
-static const char *
+static const gchar *
 _get_protocol (ECalBackendFactory *factory)
 {
 	return "file";
@@ -199,7 +199,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = file_types;
 	*num_types = 3;
diff --git a/calendar/backends/file/e-cal-backend-file-factory.h b/calendar/backends/file/e-cal-backend-file-factory.h
index 19226b7..44aadfc 100644
--- a/calendar/backends/file/e-cal-backend-file-factory.h
+++ b/calendar/backends/file/e-cal-backend-file-factory.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 
 void                 eds_module_initialize (GTypeModule *module);
 void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, int *num_types);
+void                 eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index e3b3a91..c511b66 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -55,10 +55,10 @@ typedef struct {
 /* Private part of the ECalBackendFile structure */
 struct _ECalBackendFilePrivate {
 	/* path where the calendar data is stored */
-	char *path;
+	gchar *path;
 
 	/* Filename in the dir */
-	char *file_name;
+	gchar *file_name;
 	gboolean read_only;
 	gboolean is_dirty;
 	guint dirty_idle_id;
@@ -100,7 +100,7 @@ static void e_cal_backend_file_finalize (GObject *object);
 static ECalBackendSyncClass *parent_class;
 
 static ECalBackendSyncStatus
-e_cal_backend_file_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
+e_cal_backend_file_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj);
 
 /* g_hash_table_foreach() callback to destroy a ECalBackendFileObject */
 static void
@@ -125,7 +125,7 @@ save_file_when_idle (gpointer user_data)
 	GFile *file, *backup_file;
 	GFileOutputStream *stream;
 	gchar *tmp, *backup_uristr;
-	char *buf;
+	gchar *buf;
 	ECalBackendFile *cbfile = user_data;
 
 	priv = cbfile->priv;
@@ -216,7 +216,7 @@ save_file_when_idle (gpointer user_data)
 	g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
 
 	if (e) {
-		char *msg = g_strdup_printf ("%s: %s", _("Cannot save calendar data"), e->message);
+		gchar *msg = g_strdup_printf ("%s: %s", _("Cannot save calendar data"), e->message);
 
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbfile), msg);
 		g_free (msg);
@@ -335,7 +335,7 @@ e_cal_backend_file_finalize (GObject *object)
 
 /* Looks up a component by its UID on the backend's component hash table */
 static ECalComponent *
-lookup_component (ECalBackendFile *cbfile, const char *uid)
+lookup_component (ECalBackendFile *cbfile, const gchar *uid)
 {
 	ECalBackendFilePrivate *priv;
 	ECalBackendFileObject *obj_data;
@@ -363,7 +363,7 @@ e_cal_backend_file_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboole
 
 /* Get_email_address handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_file_get_cal_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_file_get_cal_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/* A file backend has no particular email address associated
 	 * with it (although that would be a useful feature some day).
@@ -374,7 +374,7 @@ e_cal_backend_file_get_cal_address (ECalBackendSync *backend, EDataCal *cal, cha
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
+e_cal_backend_file_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, gchar **attribute)
 {
 	*attribute = NULL;
 
@@ -382,7 +382,7 @@ e_cal_backend_file_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal,
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_file_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/* A file backend has no particular email address associated
 	 * with it (although that would be a useful feature some day).
@@ -393,7 +393,7 @@ e_cal_backend_file_get_alarm_email_address (ECalBackendSync *backend, EDataCal *
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
+e_cal_backend_file_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, gchar **capabilities)
 {
 	*capabilities = g_strdup (CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS ","
 				  CAL_STATIC_CAPABILITY_NO_THISANDFUTURE ","
@@ -405,7 +405,7 @@ e_cal_backend_file_get_static_capabilities (ECalBackendSync *backend, EDataCal *
 
 /* function to resolve timezones */
 static icaltimezone *
-resolve_tzid (const char *tzid, gpointer user_data)
+resolve_tzid (const gchar *tzid, gpointer user_data)
 {
 	icalcomponent *vcalendar_comp = user_data;
 
@@ -423,8 +423,8 @@ check_dup_uid (ECalBackendFile *cbfile, ECalComponent *comp)
 {
 	ECalBackendFilePrivate *priv;
 	ECalBackendFileObject *obj_data;
-	const char *uid = NULL;
-	char *new_uid;
+	const gchar *uid = NULL;
+	gchar *new_uid;
 
 	priv = cbfile->priv;
 
@@ -476,7 +476,7 @@ add_component (ECalBackendFile *cbfile, ECalComponent *comp, gboolean add_to_top
 {
 	ECalBackendFilePrivate *priv;
 	ECalBackendFileObject *obj_data;
-	const char *uid = NULL;
+	const gchar *uid = NULL;
 
 	priv = cbfile->priv;
 
@@ -489,7 +489,7 @@ add_component (ECalBackendFile *cbfile, ECalComponent *comp, gboolean add_to_top
 
 	obj_data = g_hash_table_lookup (priv->comp_uid_hash, uid);
 	if (e_cal_component_is_instance (comp)) {
-		char *rid;
+		gchar *rid;
 
 		rid = e_cal_component_get_recurid_as_string (comp);
 		if (obj_data) {
@@ -573,7 +573,7 @@ remove_recurrence_cb (gpointer key, gpointer value, gpointer data)
  * icalcomponent.
  */
 static void
-remove_component (ECalBackendFile *cbfile, const char *uid, ECalBackendFileObject *obj_data)
+remove_component (ECalBackendFile *cbfile, const gchar *uid, ECalBackendFileObject *obj_data)
 {
 	ECalBackendFilePrivate *priv;
 	icalcomponent *icalcomp;
@@ -638,13 +638,13 @@ scan_vcalendar (ECalBackendFile *cbfile)
 	}
 }
 
-static char *
+static gchar *
 uri_to_path (ECalBackend *backend)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
-	const char *master_uri;
-	char *full_uri, *str_uri;
+	const gchar *master_uri;
+	gchar *full_uri, *str_uri;
 	GFile *file;
 
 	cbfile = E_CAL_BACKEND_FILE (backend);
@@ -681,7 +681,7 @@ uri_to_path (ECalBackend *backend)
 
 /* Parses an open iCalendar file and loads it into the backend */
 static ECalBackendSyncStatus
-open_cal (ECalBackendFile *cbfile, const char *uristr)
+open_cal (ECalBackendFile *cbfile, const gchar *uristr)
 {
 	ECalBackendFilePrivate *priv;
 	icalcomponent *icalcomp;
@@ -814,7 +814,7 @@ notify_changes (ECalBackendFile *cbfile, GHashTable *old_uid_hash, GHashTable *n
 }
 
 static ECalBackendSyncStatus
-reload_cal (ECalBackendFile *cbfile, const char *uristr)
+reload_cal (ECalBackendFile *cbfile, const gchar *uristr)
 {
 	ECalBackendFilePrivate *priv;
 	icalcomponent *icalcomp, *icalcomp_old;
@@ -866,9 +866,9 @@ reload_cal (ECalBackendFile *cbfile, const char *uristr)
 }
 
 static ECalBackendSyncStatus
-create_cal (ECalBackendFile *cbfile, const char *uristr)
+create_cal (ECalBackendFile *cbfile, const gchar *uristr)
 {
-	char *dirname;
+	gchar *dirname;
 	ECalBackendFilePrivate *priv;
 
 	priv = cbfile->priv;
@@ -895,7 +895,7 @@ create_cal (ECalBackendFile *cbfile, const char *uristr)
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static char *
+static gchar *
 get_uri_string (ECalBackend *backend)
 {
 	gchar *str_uri, *full_uri;
@@ -914,8 +914,8 @@ add_timezone (icalcomponent *icalcomp, icaltimezone *tzone)
 	icalcomponent *subcomp;
 	icaltimezone *zone;
 	gboolean add = TRUE, have_same = FALSE;
-	const char *tzid;
-	char *cmp;
+	const gchar *tzid;
+	gchar *cmp;
 
 	g_return_val_if_fail (icalcomp != NULL, FALSE);
 
@@ -940,7 +940,7 @@ add_timezone (icalcomponent *icalcomp, icaltimezone *tzone)
 			if (have_same) {
 				to_remove = g_slist_prepend (to_remove, subcomp);
 			} else {
-				char *str = icalcomponent_as_ical_string_r (subcomp);
+				gchar *str = icalcomponent_as_ical_string_r (subcomp);
 
 				/* not the best way how to compare two components, but don't have better */
 				if (str && g_str_equal (cmp, str)) {
@@ -973,7 +973,7 @@ add_timezone (icalcomponent *icalcomp, icaltimezone *tzone)
 			if (!icaltimezone_set_component (zone, icalcomponent_new_clone (subcomp))) {
 				rem2 = g_slist_prepend (rem2, subcomp);
 			} else {
-				const char *tzid2 = icaltimezone_get_tzid (zone);
+				const gchar *tzid2 = icaltimezone_get_tzid (zone);
 
 				/* check all but not the one which was checked above */
 				if (tzid2 && !g_str_equal (tzid, tzid2)) {
@@ -1008,11 +1008,11 @@ add_timezone (icalcomponent *icalcomp, icaltimezone *tzone)
 /* Open handler for the file backend */
 static ECalBackendSyncStatus
 e_cal_backend_file_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,
-			 const char *username, const char *password)
+			 const gchar *username, const gchar *password)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
-	char *str_uri;
+	gchar *str_uri;
 	ECalBackendSyncStatus status;
 
 	cbfile = E_CAL_BACKEND_FILE (backend);
@@ -1060,9 +1060,9 @@ e_cal_backend_file_remove (ECalBackendSync *backend, EDataCal *cal)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
-	char *str_uri = NULL, *dirname = NULL;
-        char *full_path = NULL;
-	const char *fname;
+	gchar *str_uri = NULL, *dirname = NULL;
+        gchar *full_path = NULL;
+	const gchar *fname;
 	GDir *dir = NULL;
 	GError *error = NULL;
         ECalBackendSyncStatus status = GNOME_Evolution_Calendar_Success;
@@ -1160,7 +1160,7 @@ e_cal_backend_file_set_mode (ECalBackend *backend, CalMode mode)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
+e_cal_backend_file_get_default_object (ECalBackendSync *backend, EDataCal *cal, gchar **object)
 {
 	ECalComponent *comp;
 
@@ -1200,7 +1200,7 @@ add_detached_recur_to_vcalendar (gpointer key, gpointer value, gpointer user_dat
 
 /* Get_object_component handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_file_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
+e_cal_backend_file_get_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, gchar **object)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
@@ -1278,7 +1278,7 @@ e_cal_backend_file_get_object (ECalBackendSync *backend, EDataCal *cal, const ch
 
 /* Get_timezone_object handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_file_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
+e_cal_backend_file_get_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
@@ -1320,7 +1320,7 @@ e_cal_backend_file_get_timezone (ECalBackendSync *backend, EDataCal *cal, const
 
 /* Add_timezone handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_file_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_file_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendFile *cbfile;
@@ -1358,7 +1358,7 @@ e_cal_backend_file_add_timezone (ECalBackendSync *backend, EDataCal *cal, const
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_file_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendFile *cbfile;
@@ -1393,7 +1393,7 @@ e_cal_backend_file_set_default_zone (ECalBackendSync *backend, EDataCal *cal, co
 typedef struct {
 	GList *obj_list;
 	gboolean search_needed;
-	const char *query;
+	const gchar *query;
 	ECalBackendSExp *obj_sexp;
 	ECalBackend *backend;
 	icaltimezone *default_zone;
@@ -1434,7 +1434,7 @@ match_object_sexp (gpointer key, gpointer value, gpointer data)
 
 /* Get_objects_in_range handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_file_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects)
+e_cal_backend_file_get_object_list (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp, GList **objects)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
@@ -1471,7 +1471,7 @@ e_cal_backend_file_get_object_list (ECalBackendSync *backend, EDataCal *cal, con
 
 /* Gets the list of attachments */
 static ECalBackendSyncStatus
-e_cal_backend_file_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **list)
+e_cal_backend_file_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, GSList **list)
 {
 
 	/* TODO implement the function */
@@ -1555,7 +1555,7 @@ free_busy_instance (ECalComponent *comp,
 }
 
 static icalcomponent *
-create_user_free_busy (ECalBackendFile *cbfile, const char *address, const char *cn,
+create_user_free_busy (ECalBackendFile *cbfile, const gchar *address, const gchar *cn,
 		       time_t start, time_t end)
 {
 	ECalBackendFilePrivate *priv;
@@ -1563,7 +1563,7 @@ create_user_free_busy (ECalBackendFile *cbfile, const char *address, const char
 	icalcomponent *vfb;
 	icaltimezone *utc_zone;
 	ECalBackendSExp *obj_sexp;
-	char *query, *iso_start, *iso_end;
+	gchar *query, *iso_start, *iso_end;
 
 	priv = cbfile->priv;
 
@@ -1642,7 +1642,7 @@ e_cal_backend_file_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
 	ECalBackendFilePrivate *priv;
 	gchar *address, *name;
 	icalcomponent *vfb;
-	char *calobj;
+	gchar *calobj;
 	GList *l;
 
 	cbfile = E_CAL_BACKEND_FILE (backend);
@@ -1692,7 +1692,7 @@ typedef struct
 } ECalBackendFileComputeChangesData;
 
 static gboolean
-e_cal_backend_file_compute_changes_foreach_key (const char *key, gpointer value, gpointer data)
+e_cal_backend_file_compute_changes_foreach_key (const gchar *key, gpointer value, gpointer data)
 {
 	ECalBackendFileComputeChangesData *be_data = data;
 
@@ -1715,11 +1715,11 @@ e_cal_backend_file_compute_changes_foreach_key (const char *key, gpointer value,
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_compute_changes (ECalBackendFile *cbfile, const char *change_id,
+e_cal_backend_file_compute_changes (ECalBackendFile *cbfile, const gchar *change_id,
 				    GList **adds, GList **modifies, GList **deletes)
 {
 	ECalBackendFilePrivate *priv;
-	char    *filename;
+	gchar    *filename;
 	EXmlHash *ehash;
 	ECalBackendFileComputeChangesData be_data;
 	GList *i;
@@ -1743,8 +1743,8 @@ e_cal_backend_file_compute_changes (ECalBackendFile *cbfile, const char *change_
 
 	/* Calculate adds and modifies */
 	for (i = priv->comp; i != NULL; i = i->next) {
-		const char *uid;
-		char *calobj;
+		const gchar *uid;
+		gchar *calobj;
 
 		e_cal_component_get_uid (i->data, &uid);
 		calobj = e_cal_component_get_as_string (i->data);
@@ -1787,7 +1787,7 @@ e_cal_backend_file_compute_changes (ECalBackendFile *cbfile, const char *change_
 
 /* Get_changes handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_file_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id,
+e_cal_backend_file_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id,
 			      GList **adds, GList **modifies, GList **deletes)
 {
 	ECalBackendFile *cbfile;
@@ -1804,7 +1804,7 @@ e_cal_backend_file_get_changes (ECalBackendSync *backend, EDataCal *cal, const c
 
 /* Discard_alarm handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_file_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
+e_cal_backend_file_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 	/* we just do nothing with the alarm */
 	return GNOME_Evolution_Calendar_Success;
@@ -1825,7 +1825,7 @@ e_cal_backend_file_internal_get_default_timezone (ECalBackend *backend)
 }
 
 static icaltimezone *
-e_cal_backend_file_internal_get_timezone (ECalBackend *backend, const char *tzid)
+e_cal_backend_file_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
@@ -1867,7 +1867,7 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
 		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *)cbfile, dt.tzid);
 		if (!zone) {
 			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *)cbfile);
-			g_free ((char *)dt.tzid);
+			g_free ((gchar *)dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_dtstart (comp, &dt);
 		}
@@ -1879,7 +1879,7 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
 		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *)cbfile, dt.tzid);
 		if (!zone) {
 			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *)cbfile);
-			g_free ((char *)dt.tzid);
+			g_free ((gchar *)dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_dtend (comp, &dt);
 		}
@@ -1891,7 +1891,7 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
 		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *)cbfile, dt.tzid);
 		if (!zone) {
 			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *)cbfile);
-			g_free ((char *)dt.tzid);
+			g_free ((gchar *)dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_due (comp, &dt);
 		}
@@ -1902,13 +1902,13 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
+e_cal_backend_file_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
 	icalcomponent *icalcomp;
 	ECalComponent *comp;
-	const char *comp_uid;
+	const gchar *comp_uid;
 	struct icaltimetype current;
 
 	cbfile = E_CAL_BACKEND_FILE (backend);
@@ -1933,7 +1933,7 @@ e_cal_backend_file_create_object (ECalBackendSync *backend, EDataCal *cal, char
 	/* Get the UID */
 	comp_uid = icalcomponent_get_uid (icalcomp);
 	if (!comp_uid) {
-		char *new_uid;
+		gchar *new_uid;
 
 		new_uid = e_cal_component_gen_uid ();
 		if (!new_uid) {
@@ -1985,7 +1985,7 @@ e_cal_backend_file_create_object (ECalBackendSync *backend, EDataCal *cal, char
 typedef struct {
 	ECalBackendFile *cbfile;
 	ECalBackendFileObject *obj_data;
-	const char *rid;
+	const gchar *rid;
 	CalObjModType mod;
 } RemoveRecurrenceData;
 
@@ -2017,16 +2017,16 @@ remove_object_instance_cb (gpointer key, gpointer value, gpointer user_data)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj,
-				  CalObjModType mod, char **old_object, char **new_object)
+e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj,
+				  CalObjModType mod, gchar **old_object, gchar **new_object)
 {
 	RemoveRecurrenceData rrdata;
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
 	icalcomponent *icalcomp;
-	const char *comp_uid;
-	char *rid = NULL;
-	char *real_rid;
+	const gchar *comp_uid;
+	gchar *rid = NULL;
+	gchar *real_rid;
 	ECalComponent *comp, *recurrence;
 	ECalBackendFileObject *obj_data;
 	struct icaltimetype current;
@@ -2039,7 +2039,7 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 	g_return_val_if_fail (calobj != NULL, GNOME_Evolution_Calendar_ObjectNotFound);
 
 	/* Parse the icalendar text */
-	icalcomp = icalparser_parse_string ((char *) calobj);
+	icalcomp = icalparser_parse_string ((gchar *) calobj);
 	if (!icalcomp)
 		return GNOME_Evolution_Calendar_InvalidObject;
 
@@ -2106,7 +2106,7 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 			return GNOME_Evolution_Calendar_Success;
 		}
 
-		if (g_hash_table_lookup_extended (obj_data->recurrences, rid, (void **)&real_rid, (void **)&recurrence)) {
+		if (g_hash_table_lookup_extended (obj_data->recurrences, rid, (gpointer *)&real_rid, (gpointer *)&recurrence)) {
 			if (old_object)
 				*old_object = e_cal_component_get_as_string (recurrence);
 
@@ -2152,7 +2152,7 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 
 		/* now deal with the detached recurrence */
 		if (g_hash_table_lookup_extended (obj_data->recurrences, rid,
-						  (void **)&real_rid, (void **)&recurrence)) {
+						  (gpointer *)&real_rid, (gpointer *)&recurrence)) {
 			if (old_object)
 				*old_object = e_cal_component_get_as_string (recurrence);
 
@@ -2244,15 +2244,15 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 }
 
 static void
-remove_instance (ECalBackendFile *cbfile, ECalBackendFileObject *obj_data, const char *rid)
+remove_instance (ECalBackendFile *cbfile, ECalBackendFileObject *obj_data, const gchar *rid)
 {
-	char *hash_rid;
+	gchar *hash_rid;
 	ECalComponent *comp;
 
 	if (!rid || !*rid)
 		return;
 
-	if (g_hash_table_lookup_extended (obj_data->recurrences, rid, (void **)&hash_rid, (void **)&comp)) {
+	if (g_hash_table_lookup_extended (obj_data->recurrences, rid, (gpointer *)&hash_rid, (gpointer *)&comp)) {
 		/* remove the component from our data */
 		icalcomponent_remove_component (cbfile->priv->icalcomp,
 						e_cal_component_get_icalcomponent (comp));
@@ -2280,11 +2280,11 @@ remove_instance (ECalBackendFile *cbfile, ECalBackendFileObject *obj_data, const
 	cbfile->priv->comp = g_list_prepend (cbfile->priv->comp, obj_data->full_object);
 }
 
-static char *
-get_object_string_from_fileobject (ECalBackendFileObject *obj_data, const char *rid)
+static gchar *
+get_object_string_from_fileobject (ECalBackendFileObject *obj_data, const gchar *rid)
 {
 	ECalComponent *comp = obj_data->full_object;
-	char *real_rid;
+	gchar *real_rid;
 
 	if (!comp)
 		return NULL;
@@ -2292,7 +2292,7 @@ get_object_string_from_fileobject (ECalBackendFileObject *obj_data, const char *
 	if (!rid) {
 		return e_cal_component_get_as_string (comp);
 	} else {
-		if (g_hash_table_lookup_extended (obj_data->recurrences, rid, (void **)&real_rid, (void **)&comp))
+		if (g_hash_table_lookup_extended (obj_data->recurrences, rid, (gpointer *)&real_rid, (gpointer *)&comp))
 			return e_cal_component_get_as_string (comp);
 		else {
 			/* FIXME remove this once we delete an instance from master object through
@@ -2307,16 +2307,16 @@ get_object_string_from_fileobject (ECalBackendFileObject *obj_data, const char *
 /* Remove_object handler for the file backend */
 static ECalBackendSyncStatus
 e_cal_backend_file_remove_object (ECalBackendSync *backend, EDataCal *cal,
-				  const char *uid, const char *rid,
-				  CalObjModType mod, char **old_object,
-				  char **object)
+				  const gchar *uid, const gchar *rid,
+				  CalObjModType mod, gchar **old_object,
+				  gchar **object)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
 	ECalBackendFileObject *obj_data;
 	ECalComponent *comp;
 	RemoveRecurrenceData rrdata;
-	const char *recur_id = NULL;
+	const gchar *recur_id = NULL;
 
 	cbfile = E_CAL_BACKEND_FILE (backend);
 	priv = cbfile->priv;
@@ -2403,11 +2403,11 @@ e_cal_backend_file_remove_object (ECalBackendSync *backend, EDataCal *cal,
 }
 
 static gboolean
-cancel_received_object (ECalBackendFile *cbfile, icalcomponent *icalcomp, char **old_object, char **new_object)
+cancel_received_object (ECalBackendFile *cbfile, icalcomponent *icalcomp, gchar **old_object, gchar **new_object)
 {
 	ECalBackendFileObject *obj_data;
 	ECalBackendFilePrivate *priv;
-	char *rid;
+	gchar *rid;
 	ECalComponent *comp;
 
 	priv = cbfile->priv;
@@ -2451,10 +2451,10 @@ typedef struct {
 } ECalBackendFileTzidData;
 
 static void
-check_tzids (icalparameter *param, void *data)
+check_tzids (icalparameter *param, gpointer data)
 {
 	ECalBackendFileTzidData *tzdata = data;
-	const char *tzid;
+	const gchar *tzid;
 
 	tzid = icalparameter_get_tzid (param);
 	if (!tzid || g_hash_table_lookup (tzdata->zones, tzid))
@@ -2470,10 +2470,10 @@ fetch_attachments (ECalBackendSync *backend, ECalComponent *comp)
 {
 	GSList *attach_list = NULL, *new_attach_list = NULL;
 	GSList *l;
-	char  *attach_store;
-	char *dest_url, *dest_file;
-	int fd;
-	const char *uid;
+	gchar  *attach_store;
+	gchar *dest_url, *dest_file;
+	gint fd;
+	const gchar *uid;
 
 	e_cal_component_get_attachment_list (comp, &attach_list);
 	e_cal_component_get_uid (comp, &uid);
@@ -2482,8 +2482,8 @@ fetch_attachments (ECalBackendSync *backend, ECalComponent *comp)
 			".evolution/calendar/local/system", NULL);
 
 	for (l = attach_list; l ; l = l->next) {
-		char *sfname = (char *)l->data;
-		char *filename, *new_filename;
+		gchar *sfname = (gchar *)l->data;
+		gchar *filename, *new_filename;
 		GMappedFile *mapped_file;
 		GError *error = NULL;
 
@@ -2523,7 +2523,7 @@ fetch_attachments (ECalBackendSync *backend, ECalComponent *comp)
 
 /* Update_objects handler for the file backend. */
 static ECalBackendSyncStatus
-e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
@@ -2544,7 +2544,7 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 	g_return_val_if_fail (calobj != NULL, GNOME_Evolution_Calendar_InvalidObject);
 
 	/* Pull the component from the string and ensure that it is sane */
-	toplevel_comp = icalparser_parse_string ((char *) calobj);
+	toplevel_comp = icalparser_parse_string ((gchar *) calobj);
 	if (!toplevel_comp)
 		return GNOME_Evolution_Calendar_InvalidObject;
 
@@ -2609,7 +2609,7 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 		if (!icalcomponent_get_uid (subcomp)) {
 			if (toplevel_method == ICAL_METHOD_PUBLISH) {
 
-				char *new_uid = NULL;
+				gchar *new_uid = NULL;
 
 				new_uid = e_cal_component_gen_uid ();
 				icalcomponent_set_uid (subcomp, new_uid);
@@ -2627,8 +2627,8 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 
 	/* Now we manipulate the components we care about */
 	for (l = comps; l; l = l->next) {
-		const char *uid;
-		char *object, *old_object, *rid, *new_object;
+		const gchar *uid;
+		gchar *object, *old_object, *rid, *new_object;
 		ECalBackendFileObject *obj_data;
 		gboolean is_declined;
 
@@ -2786,8 +2786,8 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_send_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj, GList **users,
-				 char **modified_calobj)
+e_cal_backend_file_send_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, GList **users,
+				 gchar **modified_calobj)
 {
 	*users = NULL;
 	*modified_calobj = g_strdup (calobj);
@@ -2907,7 +2907,7 @@ e_cal_backend_file_get_type (void)
 }
 
 void
-e_cal_backend_file_set_file_name (ECalBackendFile *cbfile, const char *file_name)
+e_cal_backend_file_set_file_name (ECalBackendFile *cbfile, const gchar *file_name)
 {
 	ECalBackendFilePrivate *priv;
 
@@ -2926,7 +2926,7 @@ e_cal_backend_file_set_file_name (ECalBackendFile *cbfile, const char *file_name
         g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
 }
 
-const char *
+const gchar *
 e_cal_backend_file_get_file_name (ECalBackendFile *cbfile)
 {
 	ECalBackendFilePrivate *priv;
@@ -2943,7 +2943,7 @@ ECalBackendSyncStatus
 e_cal_backend_file_reload (ECalBackendFile *cbfile)
 {
 	ECalBackendFilePrivate *priv;
-	char *str_uri;
+	gchar *str_uri;
 	ECalBackendSyncStatus status;
 
 	priv = cbfile->priv;
diff --git a/calendar/backends/file/e-cal-backend-file.h b/calendar/backends/file/e-cal-backend-file.h
index 2f389cd..ded7f12 100644
--- a/calendar/backends/file/e-cal-backend-file.h
+++ b/calendar/backends/file/e-cal-backend-file.h
@@ -54,8 +54,8 @@ struct _ECalBackendFileClass {
 GType                  e_cal_backend_file_get_type      (void);
 
 void                   e_cal_backend_file_set_file_name (ECalBackendFile *cbfile,
-							 const char     *file_name);
-const char            *e_cal_backend_file_get_file_name (ECalBackendFile *cbfile);
+							 const gchar     *file_name);
+const gchar            *e_cal_backend_file_get_file_name (ECalBackendFile *cbfile);
 
 ECalBackendSyncStatus  e_cal_backend_file_reload        (ECalBackendFile *cbfile);
 
diff --git a/calendar/backends/google/e-cal-backend-google-factory.c b/calendar/backends/google/e-cal-backend-google-factory.c
index 384084c..87b4993 100644
--- a/calendar/backends/google/e-cal-backend-google-factory.c
+++ b/calendar/backends/google/e-cal-backend-google-factory.c
@@ -162,7 +162,7 @@ eds_module_shutdown (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = google_types;
 	*num_types = 2;
diff --git a/calendar/backends/google/e-cal-backend-google-factory.h b/calendar/backends/google/e-cal-backend-google-factory.h
index 805bd1c..61decbc 100644
--- a/calendar/backends/google/e-cal-backend-google-factory.h
+++ b/calendar/backends/google/e-cal-backend-google-factory.h
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
 
 void eds_module_initialize (GTypeModule *module);
 void eds_module_shutdown (void);
-void eds_module_list_types (const GType **types, int *num_types);
+void eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/calendar/backends/google/e-cal-backend-google-utils.c b/calendar/backends/google/e-cal-backend-google-utils.c
index 33b4bed..482feae 100644
--- a/calendar/backends/google/e-cal-backend-google-utils.c
+++ b/calendar/backends/google/e-cal-backend-google-utils.c
@@ -107,7 +107,7 @@ e_cal_backend_google_utils_populate_cache (ECalBackendGoogle *cbgo)
 			e_cal_component_commit_sequence (comp);
 			comp_str = e_cal_component_get_as_string (comp);
 
-			e_cal_backend_notify_object_created (E_CAL_BACKEND(cbgo), (const char *)comp_str);
+			e_cal_backend_notify_object_created (E_CAL_BACKEND(cbgo), (const gchar *)comp_str);
 			e_cal_backend_cache_put_component (cache, comp);
 			g_object_unref (comp);
 			g_free (comp_str);
@@ -129,7 +129,7 @@ static gpointer
 e_cal_backend_google_utils_create_cache (ECalBackendGoogle *cbgo)
 {
 	ESource *source;
-	int x;
+	gint x;
 	const gchar *refresh_interval = NULL;
 	ECalBackendCache *cache;
 
@@ -405,7 +405,7 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
 	ECalComponentDateTime dt;
 	ECalComponentOrganizer *org = NULL;
 	icaltimezone *default_zone;
-	const char *description, *uid, *temp;
+	const gchar *description, *uid, *temp;
 	struct icaltimetype itt;
 	GSList *category_ids;
 	GSList *go_attendee_list = NULL, *l = NULL, *attendee_list = NULL;
@@ -531,7 +531,7 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
 	e_cal_component_set_dtend (comp, &dt);
 
 	uid = gdata_entry_get_id (item->entry);
-	e_cal_component_set_uid (comp, (const char *)uid);
+	e_cal_component_set_uid (comp, (const gchar *)uid);
 	e_cal_component_commit_sequence (comp);
 
 	return comp;
@@ -556,8 +556,8 @@ e_go_item_from_cal_component (ECalBackendGoogle *cbgo, ECalComponent *comp)
 	gchar *temp, *term = NULL;
 	icaltimezone *default_zone;
 	icaltimetype itt;
-	const char *uid;
-	const char *location;
+	const gchar *uid;
+	const gchar *location;
 	GSList *list = NULL;
 	GDataEntry *entry;
 	ECalComponentText *t;
@@ -688,7 +688,7 @@ gdata_entry_get_entry_by_id (GSList *entries, const gchar *id)
 static gint
 utils_compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id)
 {
-	return strcmp ((char *)cache_id, (char *)modified_cache_id);
+	return strcmp ((gchar *)cache_id, (gchar *)modified_cache_id);
 }
 
 static gchar *
@@ -754,13 +754,13 @@ utils_update_deletion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, GSList
 
 	for (list = cache_keys; list; list = g_slist_next (list)) {
 		ECalComponentId *id = NULL;
-		char *comp_str = NULL;
-		comp = e_cal_backend_cache_get_component (cache, (const char *)list->data, NULL);
+		gchar *comp_str = NULL;
+		comp = e_cal_backend_cache_get_component (cache, (const gchar *)list->data, NULL);
 		comp_str = e_cal_component_get_as_string (comp);
 		id = e_cal_component_get_id (comp);
 
 		e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgo), id, comp_str, NULL);
-		e_cal_backend_cache_remove_component (cache, (const char *) id->uid, id->rid);
+		e_cal_backend_cache_remove_component (cache, (const gchar *) id->uid, id->rid);
 
 		e_cal_component_free_id (id);
 		g_object_unref (comp);
@@ -776,7 +776,7 @@ utils_update_deletion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, GSList
 gchar *
 get_date (ECalComponentDateTime dt)
 {
-	char *temp;
+	gchar *temp;
 	struct icaltimetype itt;
 	struct icaltimetype *itt_u;
 	gchar *month;
@@ -845,7 +845,7 @@ static gboolean
 gd_date_to_ical (EGoItem *item, const gchar *google_time_string, struct icaltimetype *itt, ECalComponentDateTime *dt, icaltimezone *default_zone)
 {
 	gchar *s, *string, *dup;
-	int count = 0;
+	gint count = 0;
 	gboolean is_utc = TRUE;
 
 	g_return_val_if_fail (itt != NULL, FALSE);
@@ -883,7 +883,7 @@ gd_date_to_ical (EGoItem *item, const gchar *google_time_string, struct icaltime
 	*itt = icaltime_from_string (dup);
 
 	if (!is_utc) {
-		const char *zone_name = item->feed ? gdata_feed_get_timezone (item->feed) : NULL;
+		const gchar *zone_name = item->feed ? gdata_feed_get_timezone (item->feed) : NULL;
 
 		if (zone_name) {
 			icaltimezone *zone = icaltimezone_get_builtin_timezone (zone_name);
diff --git a/calendar/backends/google/e-cal-backend-google.c b/calendar/backends/google/e-cal-backend-google.c
index df74615..f07f3cb 100644
--- a/calendar/backends/google/e-cal-backend-google.c
+++ b/calendar/backends/google/e-cal-backend-google.c
@@ -84,7 +84,7 @@ struct _ECalBackendGooglePrivate {
 };
 
 gint compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id);
-gchar * form_query (const char *query);
+gchar * form_query (const gchar *query);
 
 gint
 compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id)
@@ -95,7 +95,7 @@ compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id)
 /************************************************** Calendar Backend Methods **********************************/
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **list)
+e_cal_backend_google_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, GSList **list)
 {
 	/* TODO implement this function */
 	return GNOME_Evolution_Calendar_Success;
@@ -109,7 +109,7 @@ e_cal_backend_google_internal_get_default_timezone (ECalBackend *backend)
 }
 
 static icaltimezone *
-e_cal_backend_google_internal_get_timezone (ECalBackend *backend, const char *tzid)
+e_cal_backend_google_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
 	icaltimezone *zone;
 
@@ -174,7 +174,7 @@ e_cal_backend_google_is_loaded (ECalBackend *backend)
 
 
 static ECalBackendSyncStatus
-e_cal_backend_google_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_google_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
@@ -206,7 +206,7 @@ e_cal_backend_google_add_timezone (ECalBackendSync *backend, EDataCal *cal, cons
 }
 
 static ECalBackendSyncStatus
- e_cal_backend_google_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
+ e_cal_backend_google_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 	return GNOME_Evolution_Calendar_OtherError;
 }
@@ -224,7 +224,7 @@ e_cal_backend_google_get_mode (ECalBackend *backend)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
+e_cal_backend_google_get_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
@@ -255,7 +255,7 @@ e_cal_backend_google_get_timezone (ECalBackendSync *backend, EDataCal *cal, cons
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
+e_cal_backend_google_get_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, gchar **object)
 {
 	ECalComponent *comp;
 	ECalBackendGooglePrivate *priv;
@@ -290,7 +290,7 @@ e_cal_backend_google_get_object (ECalBackendSync *backend, EDataCal *cal, const
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects)
+e_cal_backend_google_get_object_list (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp, GList **objects)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
@@ -364,7 +364,7 @@ e_cal_backend_google_start_query (ECalBackend *backend, EDataCalView *query)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
+e_cal_backend_google_get_default_object (ECalBackendSync *backend, EDataCal *cal, gchar **object)
 {
 	ECalComponent *comp;
 
@@ -389,7 +389,7 @@ e_cal_backend_google_get_default_object (ECalBackendSync *backend, EDataCal *cal
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_google_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendGoogle *cbgo;
@@ -485,9 +485,9 @@ fetch_attachments (ECalBackendGoogle *cbgo, ECalComponent *comp)
 {
 	GSList *attach_list = NULL, *new_attach_list = NULL;
 	GSList *l = NULL;
-	const char *uid;
+	const gchar *uid;
 	gchar *attach_store, *dest_file, *dest_url;
-	int fd;
+	gint fd;
 
 	e_cal_component_get_attachment_list (comp, &attach_list);
 	e_cal_component_get_uid (comp, &uid);
@@ -495,8 +495,8 @@ fetch_attachments (ECalBackendGoogle *cbgo, ECalComponent *comp)
 	attach_store = g_strdup(e_cal_backend_google_get_local_attachments_store (cbgo));
 
 	for (l = attach_list; l; l = l->next) {
-		char *sfname = (char *)l->data;
-		char *filename, *new_filename;
+		gchar *sfname = (gchar *)l->data;
+		gchar *filename, *new_filename;
 		GMappedFile *mapped_file;
 		GError *error = NULL;
 
@@ -549,7 +549,7 @@ static receive_object (ECalBackendGoogle *cbgo, EDataCal *cal, icalcomponent *ic
 	priv = cbgo->priv;
 	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
 	while (icalprop) {
-		const char *x_name;
+		const gchar *x_name;
 		x_name	= icalproperty_get_x_name (icalprop);
 
 		/* FIXME Set the Property for Google */
@@ -589,7 +589,7 @@ static receive_object (ECalBackendGoogle *cbgo, EDataCal *cal, icalcomponent *ic
 
 	modif_comp = g_object_ref (comp);
 	if (instances) {
-		const char *uid;
+		const gchar *uid;
 		found = FALSE;
 
 		e_cal_component_get_uid (modif_comp, &uid);
@@ -630,7 +630,7 @@ static receive_object (ECalBackendGoogle *cbgo, EDataCal *cal, icalcomponent *ic
 
 		}
 		else {
-			char *comp_str = NULL;
+			gchar *comp_str = NULL;
 
 			/* change_status (component, pstatus, e_gw_connection_get_user_email (priv->cnc)); */
 			e_cal_backend_cache_put_component (priv->cache, component);
@@ -654,7 +654,7 @@ static receive_object (ECalBackendGoogle *cbgo, EDataCal *cal, icalcomponent *ic
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_google_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
@@ -702,13 +702,13 @@ send_object (ECalBackendGoogle *cbgo, EDataCal *cal, icalcomponent *icalcomp, ic
 	ECalComponent *comp, *found_comp = NULL;
 	ECalBackendGooglePrivate *priv;
 	ECalBackendSyncStatus status = GNOME_Evolution_Calendar_OtherError;
-	const char *uid;
+	const gchar *uid;
 
 	priv = cbgo->priv;
 	comp = e_cal_component_new ();
 	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
 
-	e_cal_component_get_uid (comp, (const char **)&uid);
+	e_cal_component_get_uid (comp, (const gchar **)&uid);
 	found_comp = e_cal_backend_cache_get_component (priv->cache, uid, NULL);
 
 	if (!found_comp) {
@@ -724,14 +724,14 @@ send_object (ECalBackendGoogle *cbgo, EDataCal *cal, icalcomponent *icalcomp, ic
 			if (method == ICAL_METHOD_CANCEL) {
 				gboolean instances = FALSE;
 				if (instances) {
-					char *old_object = NULL;
+					gchar *old_object = NULL;
 					GSList *l = NULL, *comp_list;
 					comp_list = e_cal_backend_cache_get_components_by_uid (priv->cache, uid);
 
 					for (l = comp_list; l; l = l->next) {
 						ECalComponent *component = E_CAL_COMPONENT (l->data);
 						ECalComponentId *cid = e_cal_component_get_id (component);
-						char *object = e_cal_component_get_as_string (component);
+						gchar *object = e_cal_component_get_as_string (component);
 
 						if (e_cal_backend_cache_remove_component (priv->cache, cid->uid,
 									cid->rid))
@@ -746,7 +746,7 @@ send_object (ECalBackendGoogle *cbgo, EDataCal *cal, icalcomponent *icalcomp, ic
 					g_free (old_object);
 				} else {
 					ECalComponentId *cid;
-					char * object;
+					gchar * object;
 
 					cid = e_cal_component_get_id (comp);
 					icalcomp = e_cal_component_get_icalcomponent (comp);
@@ -777,7 +777,7 @@ send_object (ECalBackendGoogle *cbgo, EDataCal *cal, icalcomponent *icalcomp, ic
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_send_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj, GList **users, char **modified_calobj)
+e_cal_backend_google_send_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, GList **users, gchar **modified_calobj)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
@@ -823,7 +823,7 @@ e_cal_backend_google_send_objects (ECalBackendSync *backend, EDataCal *cal, cons
 			e_cal_component_get_attendee_list (comp, &attendee_list);
 			/* convert this into GList */
 			for (tmp = attendee_list; tmp; tmp = g_slist_next (tmp)) {
-				const char *attendee = tmp->data;
+				const gchar *attendee = tmp->data;
 
 				if (attendee)
 					*users = g_list_append (*users, g_strdup (attendee));
@@ -840,7 +840,7 @@ e_cal_backend_google_send_objects (ECalBackendSync *backend, EDataCal *cal, cons
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id, GList **adds, GList **modifies, GList **deletes)
+e_cal_backend_google_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id, GList **adds, GList **modifies, GList **deletes)
 {
 	/* FIXME Not Implemented */
 	return GNOME_Evolution_Calendar_Success;
@@ -859,7 +859,7 @@ e_cal_backend_google_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboo
 
 /* Returns the email address of the person who opened the calendar */
 static ECalBackendSyncStatus
-e_cal_backend_google_get_cal_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_google_get_cal_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
@@ -873,7 +873,7 @@ e_cal_backend_google_get_cal_address (ECalBackendSync *backend, EDataCal *cal, c
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_google_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/* Support email based alarms ? */
 
@@ -883,14 +883,14 @@ e_cal_backend_google_get_alarm_email_address (ECalBackendSync *backend, EDataCal
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj, CalObjModType mod, char **old_object, char **new_object)
+e_cal_backend_google_modify_object (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod, gchar **old_object, gchar **new_object)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
 	icalcomponent *icalcomp;
 	ECalComponent *comp = NULL, *cache_comp = NULL;
 	EGoItem *item;
-	const char *uid=NULL, *rid=NULL;
+	const gchar *uid=NULL, *rid=NULL;
 	GDataEntry *entry, *entry_from_server=NULL, *updated_entry=NULL;
 	gchar *edit_link;
 	GSList *l;
@@ -973,15 +973,15 @@ e_cal_backend_google_modify_object (ECalBackendSync *backend, EDataCal *cal, con
 
 static ECalBackendSyncStatus
 e_cal_backend_google_remove_object (ECalBackendSync *backend, EDataCal *cal,
-				       const char *uid, const char *rid,
-				       CalObjModType mod, char **old_object,
-				       char **object)
+				       const gchar *uid, const gchar *rid,
+				       CalObjModType mod, gchar **old_object,
+				       gchar **object)
 {
 	ECalBackendGoogle *cbgo;
 	GDataEntry *entry;
 	ECalBackendGooglePrivate *priv;
 	ECalComponent *comp = NULL;
-	char *calobj = NULL;
+	gchar *calobj = NULL;
 	GSList *entries = NULL;
 	EGoItem *item;
 
@@ -999,7 +999,7 @@ e_cal_backend_google_remove_object (ECalBackendSync *backend, EDataCal *cal,
 		ECalBackendSyncStatus status;
 		icalcomponent *icalcomp;
 		ECalComponentId *id;
-		char *comp_str;
+		gchar *comp_str;
 
 		status = e_cal_backend_google_get_object (backend, cal, uid, rid, &calobj);
 
@@ -1050,7 +1050,7 @@ e_cal_backend_google_remove_object (ECalBackendSync *backend, EDataCal *cal,
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
+e_cal_backend_google_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
@@ -1119,7 +1119,7 @@ e_cal_backend_google_create_object (ECalBackendSync *backend, EDataCal *cal, cha
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
+e_cal_backend_google_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, gchar **attribute)
 {
 	/* ldap attribute is specific to Sun ONE connector to get free busy information*/
 	/* return NULL here as google backend know how to get free busy information */
@@ -1131,7 +1131,7 @@ e_cal_backend_google_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal
 
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
+e_cal_backend_google_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, gchar **capabilities)
 {
 	/* FIXME */
 	*capabilities = NULL;
@@ -1139,14 +1139,14 @@ e_cal_backend_google_get_static_capabilities (ECalBackendSync *backend, EDataCal
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,const char *username, const char *password)
+e_cal_backend_google_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,const gchar *username, const gchar *password)
 {
 	ECalBackendGoogle *cbgo;
 	ECalBackendGooglePrivate *priv;
 	ECalBackendSyncStatus status;
 	ECalSourceType source_type;
 	gchar *source = NULL, *mangled_uri = NULL, *filename = NULL;
-	int i;
+	gint i;
 
 	cbgo = E_CAL_BACKEND_GOOGLE(backend);
 	priv = cbgo->priv;
@@ -1173,7 +1173,7 @@ e_cal_backend_google_open (ECalBackendSync *backend, EDataCal *cal, gboolean onl
 	/* Not for remote */
 	if (priv->mode == CAL_MODE_LOCAL) {
 		ESource *esource;
-		const char *display_contents = NULL;
+		const gchar *display_contents = NULL;
 
 		cbgo->priv->read_only = TRUE;
 		esource = e_cal_backend_get_source (E_CAL_BACKEND(cbgo));
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise-factory.c b/calendar/backends/groupwise/e-cal-backend-groupwise-factory.c
index 77bea7b..49711a9 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise-factory.c
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise-factory.c
@@ -29,7 +29,7 @@ e_cal_backend_groupwise_factory_instance_init (ECalBackendGroupwiseFactory *fact
 {
 }
 
-static const char *
+static const gchar *
 _get_protocol (ECalBackendFactory *factory)
 {
 	return "groupwise";
@@ -196,7 +196,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = groupwise_types;
 	*num_types = 3;
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise-factory.h b/calendar/backends/groupwise/e-cal-backend-groupwise-factory.h
index 985c371..831ee8a 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise-factory.h
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise-factory.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 
 void                 eds_module_initialize (GTypeModule *module);
 void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, int *num_types);
+void                 eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
index 5016473..0559a88 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
@@ -50,7 +50,7 @@ static gboolean
 get_recur_instance (ECalComponent *comp, time_t instance_start, time_t instance_end, gpointer data)
 {
 	GSList **recur_dates = (GSList **) data;
-	char *rdate;
+	gchar *rdate;
 
 	rdate = isodate_from_time_t (instance_start);
 	/* convert this into a date */
@@ -62,7 +62,7 @@ get_recur_instance (ECalComponent *comp, time_t instance_start, time_t instance_
 static gboolean
 get_recur_count (ECalComponent *comp, time_t instance_start, time_t instance_end, gpointer data)
 {
-	int *count = (int *) data;
+	gint *count = (gint *) data;
 
 	*count = *count + 1;
 
@@ -70,13 +70,13 @@ get_recur_count (ECalComponent *comp, time_t instance_start, time_t instance_end
 }
 
 static icaltimezone *
-resolve_tzid_cb (const char *tzid, gpointer data)
+resolve_tzid_cb (const gchar *tzid, gpointer data)
 {
 	/* do nothing.. since we are interested only in the event date */
 	return NULL;
 }
 
-const char *
+const gchar *
 e_cal_component_get_gw_id (ECalComponent *comp)
 {
 	icalproperty *prop;
@@ -84,7 +84,7 @@ e_cal_component_get_gw_id (ECalComponent *comp)
 	prop = icalcomponent_get_first_property (e_cal_component_get_icalcomponent (comp),
 						 ICAL_X_PROPERTY);
 	while (prop) {
-		const char *x_name, *x_val;
+		const gchar *x_name, *x_val;
 
 		x_name = icalproperty_get_x_name (prop);
 		x_val = icalproperty_get_x (prop);
@@ -104,8 +104,8 @@ set_categories_for_gw_item (EGwItem *item, GSList *category_names, ECalBackendGr
 	GHashTable *categories_by_name, *categories_by_id;
 	EGwConnection *cnc;
 	GList *category_ids;
-	char *id;
-	int status;
+	gchar *id;
+	gint status;
 
 	category_ids = NULL;
 	id = NULL;
@@ -129,8 +129,8 @@ set_categories_for_gw_item (EGwItem *item, GSList *category_names, ECalBackendGr
                              e_gw_item_set_category_name (category_item, category_names->data);
                              status = e_gw_connection_create_item (cnc, category_item, &id);
                              if (status == E_GW_CONNECTION_STATUS_OK && id != NULL) {
-                                     char **components = g_strsplit (id, "@", -1);
-                                     char *temp_id = components[0];
+                                     gchar **components = g_strsplit (id, "@", -1);
+                                     gchar *temp_id = components[0];
 
                                      g_hash_table_insert (categories_by_name, g_strdup (category_names->data), g_strdup(temp_id));
                                      g_hash_table_insert (categories_by_id, g_strdup(temp_id), g_strdup (category_names->data));
@@ -147,8 +147,8 @@ set_categories_for_gw_item (EGwItem *item, GSList *category_names, ECalBackendGr
 static void
 add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone *default_zone)
 {
-	const char *x_val;
-	const char *x_name;
+	const gchar *x_val;
+	const gchar *x_name;
 	icalcomponent *icalcomp;
 	icalproperty *icalprop;
 	struct icaltimetype temp;
@@ -180,8 +180,8 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
 			e_gw_item_set_reply_request (item, TRUE);
 			x_val = icalproperty_get_x (icalprop);
 			if (strcmp (x_val, "convenient")) {
-				char *value;
-				int i = atoi (x_val);
+				gchar *value;
+				gint i = atoi (x_val);
 				temp = icaltime_current_time_with_zone (default_zone ? default_zone : utc);
 				icaltime_adjust (&temp, i, 0, 0, 0);
 				icaltime_set_timezone (&temp, default_zone);
@@ -191,7 +191,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
 				g_free (value);
 			}
 		} else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-EXPIRE")) {
-			char *expire = NULL;
+			gchar *expire = NULL;
 			x_val = icalproperty_get_x (icalprop);
 			temp = icaltime_current_time_with_zone (default_zone ? default_zone : utc);
 			icaltime_adjust (&temp, atoi (x_val), 0, 0, 0);
@@ -202,7 +202,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
 			g_free (expire);
 
 		} else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-DELAY")) {
-			char *delay = NULL;
+			gchar *delay = NULL;
 			x_val = icalproperty_get_x (icalprop);
 			temp = icaltime_from_string (x_val);
 			icaltime_set_timezone (&temp, default_zone);
@@ -225,7 +225,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
 					 break;
 			}
 		} else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-OPENED")) {
-			int i = 0;
+			gint i = 0;
 			x_val = icalproperty_get_x (icalprop);
 			i = atoi (x_val);
 			switch (i) {
@@ -235,7 +235,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
 			}
 
 		} else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-ACCEPTED")) {
-			int i = 0;
+			gint i = 0;
 			x_val = icalproperty_get_x (icalprop);
 			i = atoi (x_val);
 			switch (i) {
@@ -245,7 +245,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
 			}
 
 		} else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-DECLINED")) {
-			int i = 0;
+			gint i = 0;
 			x_val = icalproperty_get_x (icalprop);
 			i = atoi (x_val);
 			switch (i) {
@@ -255,7 +255,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
 			}
 
 		} else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-COMPLETED")) {
-			int i = 0;
+			gint i = 0;
 			x_val = icalproperty_get_x (icalprop);
 			i = atoi (x_val);
 			switch (i) {
@@ -272,12 +272,12 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
 
 }
 
-static char *
-get_mime_type (const char *uri)
+static gchar *
+get_mime_type (const gchar *uri)
 {
 	GFile *file;
 	GFileInfo *fi;
-	char *mime_type;
+	gchar *mime_type;
 
 	g_return_val_if_fail (uri != NULL, NULL);
 
@@ -311,12 +311,12 @@ e_cal_backend_groupwise_set_attachments_from_comp (ECalComponent *comp,
 	for (l = attach_file_list; l ; l = l->next) {
 
 		EGwItemAttachment *attach_item;
-		char *file_contents, *encoded_data;
+		gchar *file_contents, *encoded_data;
 		gsize file_len;
-		char *attach_filename_full, *filename;
-		const char *uid;
+		gchar *attach_filename_full, *filename;
+		const gchar *uid;
 
-		attach_filename_full = g_filename_from_uri ((char *)l->data, NULL, NULL);
+		attach_filename_full = g_filename_from_uri ((gchar *)l->data, NULL, NULL);
 		if (!g_file_get_contents (attach_filename_full, &file_contents, &file_len, NULL)) {
 			g_message ("DEBUG: could not read %s\n", attach_filename_full);
 			g_free (attach_filename_full);
@@ -339,7 +339,7 @@ e_cal_backend_groupwise_set_attachments_from_comp (ECalComponent *comp,
 		attach_item = g_new0 (EGwItemAttachment, 1);
 		/* FIXME the member does not follow the naming convention.
 		 * Should be fixed in e-gw-item*/
-		attach_item->contentType = get_mime_type ((char *)l->data);
+		attach_item->contentType = get_mime_type ((gchar *)l->data);
 
 		attach_item->name = g_strdup (filename + strlen(uid) + 1);
 		/* do a base64 encoding so it can be embedded in a soap
@@ -358,14 +358,14 @@ e_cal_backend_groupwise_set_attachments_from_comp (ECalComponent *comp,
 
 /* Returns the icalproperty for the Attendee associted with email id */
 static icalproperty *
-get_attendee_prop (icalcomponent *icalcomp, const char *attendee)
+get_attendee_prop (icalcomponent *icalcomp, const gchar *attendee)
 {
 	icalproperty *prop;
 
 	for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
 			prop;
 			prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) {
-		const char *att = icalproperty_get_attendee (prop);
+		const gchar *att = icalproperty_get_attendee (prop);
 
 		if (!g_ascii_strcasecmp (att, attendee)) {
 			return prop;
@@ -378,15 +378,15 @@ get_attendee_prop (icalcomponent *icalcomp, const char *attendee)
 /* get_attendee_list from cal comp and convert into
  * egwitemrecipient and set it on recipient_list*/
 static void
-set_attendees_to_item (EGwItem *item, ECalComponent *comp, icaltimezone *default_zone, gboolean delegate, const char *user_email)
+set_attendees_to_item (EGwItem *item, ECalComponent *comp, icaltimezone *default_zone, gboolean delegate, const gchar *user_email)
 {
 	if (e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_JOURNAL) {
 		if  (e_cal_component_has_organizer (comp)) {
 			icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
 			icalproperty *icalprop;
 			GSList *recipient_list = NULL;
-			const char *attendees = NULL;
-			char **emails, **iter;
+			const gchar *attendees = NULL;
+			gchar **emails, **iter;
 
 			for (icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY); icalprop;
 					icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) {
@@ -486,7 +486,7 @@ set_attendees_to_item (EGwItem *item, ECalComponent *comp, icaltimezone *default
 static int
 get_actual_count (ECalComponent *comp, ECalBackendGroupwise *cbgw)
 {
-	int count = 0;
+	gint count = 0;
 	icaltimezone *dzone, *utc;
 
 
@@ -508,7 +508,7 @@ set_rrule_from_comp (ECalComponent *comp, EGwItem *item, ECalBackendGroupwise *c
 	EGwItemRecurrenceRule *item_rrule;
 	struct icalrecurrencetype *ical_recur;
 	GSList *rrule_list = NULL, *exdate_list;
-	int i;
+	gint i;
 
 	item_rrule = g_new0 (EGwItemRecurrenceRule, 1);
 	e_cal_component_get_rrule_list (comp, &rrule_list);
@@ -586,13 +586,13 @@ set_rrule_from_comp (ECalComponent *comp, EGwItem *item, ECalBackendGroupwise *c
 static EGwItem *
 set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBackendGroupwise *cbgw)
 {
-	const char *uid, *location;
-	char *value;
+	const gchar *uid, *location;
+	gchar *value;
 	ECalComponentDateTime dt;
 	ECalComponentClassification classif;
 	ECalComponentTransparency transp;
 	ECalComponentText text;
-	int *priority;
+	gint *priority;
 	GSList *categories;
 	GSList *slist, *sl;
 	icaltimezone *default_zone, *utc;
@@ -626,7 +626,7 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
 		if (e_cal_component_has_alarms (comp)) {
 			ECalComponentAlarm *alarm;
 			ECalComponentAlarmTrigger trigger;
-			int duration;
+			gint duration;
 			GList *l = e_cal_component_get_alarm_uids (comp);
 
 			alarm = e_cal_component_get_alarm (comp, l->data);
@@ -727,7 +727,7 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
 				str = g_string_append (str, pt->value);
 		}
 
-		e_gw_item_set_message (item, (const char *) str->str);
+		e_gw_item_set_message (item, (const gchar *) str->str);
 
 		g_string_free (str, TRUE);
 		e_cal_component_free_text_list (slist);
@@ -825,7 +825,7 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
 }
 
 EGwItem *
-e_gw_item_new_from_cal_component (const char *container, ECalBackendGroupwise *cbgw, ECalComponent *comp)
+e_gw_item_new_from_cal_component (const gchar *container, ECalBackendGroupwise *cbgw, ECalComponent *comp)
 {
 	EGwItem *item;
 
@@ -842,7 +842,7 @@ e_gw_item_new_for_delegate_from_cal (ECalBackendGroupwise *cbgw, ECalComponent *
 {
 	EGwItem *item;
 	icaltimezone *default_zone;
-	const char *user_email;
+	const gchar *user_email;
 
 	g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), NULL);
 	default_zone = e_cal_backend_groupwise_get_default_zone (cbgw);
@@ -864,13 +864,13 @@ get_attach_data_from_server (EGwItemAttachment *attach_item, ECalBackendGroupwis
 {
 	EGwConnection *cnc;
 	EGwConnectionStatus status;
-	char *data = NULL;
-	int len;
+	gchar *data = NULL;
+	gint len;
 
 	cnc = e_cal_backend_groupwise_get_connection (cbgw);
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
 
-	status = e_gw_connection_get_attachment (cnc, attach_item->id, 0, -1, (const char **) &data, &len);
+	status = e_gw_connection_get_attachment (cnc, attach_item->id, 0, -1, (const gchar **) &data, &len);
 
 	if (status != E_GW_CONNECTION_STATUS_OK ) {
 		g_warning ("Failed to read the attachment from the server\n");
@@ -887,8 +887,8 @@ set_attachments_to_cal_component (EGwItem *item, ECalComponent *comp, ECalBacken
 {
 	GSList *fetch_list = NULL, *l;
 	GSList *comp_attachment_list = NULL;
-	const char *uid;
-	char *attach_file_url;
+	const gchar *uid;
+	gchar *attach_file_url;
 
 	fetch_list = e_gw_item_get_attach_id_list (item);
 	if (fetch_list == NULL)
@@ -896,11 +896,11 @@ set_attachments_to_cal_component (EGwItem *item, ECalComponent *comp, ECalBacken
 
 	e_cal_component_get_uid (comp, &uid);
 	for (l = fetch_list; l ; l = l->next) {
-		int fd;
+		gint fd;
 		EGwItemAttachment *attach_item;
-		char *attach_data = NULL;
+		gchar *attach_data = NULL;
 		struct stat st;
-		char *filename;
+		gchar *filename;
 
 		attach_item = (EGwItemAttachment *) l->data;
 		attach_file_url = g_strconcat (e_cal_backend_groupwise_get_local_attachments_store (cbgw),
@@ -945,8 +945,8 @@ set_default_alarms (ECalComponent *comp)
 	if (gconf_client_get_bool (gconf, CALENDAR_CONFIG_DEFAULT_REMINDER, NULL)) {
 
 			ECalComponentAlarm *acomp;
-			int interval;
-			char * units;
+			gint interval;
+			gchar * units;
 			enum {
 				DAYS,
 				HOURS,
@@ -1002,10 +1002,10 @@ set_default_alarms (ECalComponent *comp)
 }
 
 
-static char *
-get_cn_from_display_name (char *display_name)
+static gchar *
+get_cn_from_display_name (gchar *display_name)
 {
-	char *dn;
+	gchar *dn;
 
 	/* Strip the name part alone as the display name might contain email also*/
 	dn = g_strstr_len (display_name, strlen (display_name), " <");
@@ -1025,8 +1025,8 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
 	ECalComponent *comp;
 	ECalComponentText text;
 	ECalComponentDateTime dt;
-	const char *description, *uid;
-	char *t, *name;
+	const gchar *description, *uid;
+	gchar *t, *name;
 	GList *category_ids;
         GSList *categories;
 	GHashTable *categories_by_id;
@@ -1034,9 +1034,9 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
 	icaltimezone *default_zone;
 
 	struct icaltimetype itt, itt_utc;
-	int priority;
-	int percent;
-	int alarm_duration;
+	gint priority;
+	gint percent;
+	gint alarm_duration;
 	GSList *recipient_list, *rl, *attendee_list = NULL;
 	EGwItemOrganizer *organizer;
 	EGwItemType item_type;
@@ -1074,25 +1074,25 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
 
 
 	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);
 		}
 	}
@@ -1187,9 +1187,9 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
 	if (e_gw_item_get_recurrence_key (item) != 0) {
 
 		ECalComponentRange *recur_id;
-		char *recur_key = g_strdup_printf ("%d", e_gw_item_get_recurrence_key (item));
+		gchar *recur_key = g_strdup_printf ("%d", e_gw_item_get_recurrence_key (item));
 
-		e_cal_component_set_uid (comp, (const char *) recur_key);
+		e_cal_component_set_uid (comp, (const gchar *) recur_key);
 		g_free (recur_key);
 
 		/* set the recurrence id and the X-GW-RECORDID  too */
@@ -1243,7 +1243,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
 				attendee->cutype = ICAL_CUTYPE_INDIVIDUAL;
 
 				if (recipient->status == E_GW_ITEM_STAT_ACCEPTED) {
-					const char *accept_level = e_gw_item_get_accept_level (item);
+					const gchar *accept_level = e_gw_item_get_accept_level (item);
 
 					if(accept_level && !strcmp (e_gw_item_get_accept_level (item),"Tentative"))
 						attendee->status = ICAL_PARTSTAT_TENTATIVE;
@@ -1263,8 +1263,8 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
 
 			for (rl = attendee_list; rl != NULL; rl = rl->next) {
 				ECalComponentAttendee *att = rl->data;
-				g_free ((char *) att->cn);
-				g_free ((char *) att->value);
+				g_free ((gchar *) att->cn);
+				g_free ((gchar *) att->value);
 				g_free (att);
 			}
 			g_slist_free (attendee_list);
@@ -1281,8 +1281,8 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
 		cal_organizer->value = g_strconcat("MAILTO:", organizer->email, NULL);
 		e_cal_component_set_organizer (comp, cal_organizer);
 
-		g_free ((char *) cal_organizer->cn);
-		g_free ((char*) cal_organizer->value);
+		g_free ((gchar *) cal_organizer->cn);
+		g_free ((gchar *) cal_organizer->value);
 		g_free (cal_organizer);
 	}
 
@@ -1421,14 +1421,14 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
 }
 
 EGwConnectionStatus
-e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *container, ECalComponent *comp, icalproperty_method method, gboolean all_instances, ECalComponent **created_comp, icalparameter_partstat *pstatus)
+e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const gchar *container, ECalComponent *comp, icalproperty_method method, gboolean all_instances, ECalComponent **created_comp, icalparameter_partstat *pstatus)
 {
 	EGwConnection *cnc;
 	EGwConnectionStatus status;
 	icalparameter_partstat partstat;
-	char *item_id = NULL;
-	const char *gw_id;
-	const char *recurrence_key = NULL;
+	gchar *item_id = NULL;
+	const gchar *gw_id;
+	const gchar *recurrence_key = NULL;
 	gboolean need_to_get = FALSE, decline = FALSE;
 	ECalComponentVType type;
 
@@ -1479,7 +1479,7 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
 
 		icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
 		while (icalprop) {
-			const char *x_name;
+			const gchar *x_name;
 
 			x_name = icalproperty_get_x_name (icalprop);
 			if (!strcmp (x_name, "X-GW-DECLINED")) {
@@ -1496,7 +1496,7 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
 		/* get attendee here and add the list along. */
 		if (e_cal_component_has_attendees (comp)) {
 			GSList *attendee_list, *l;
-			const char *email_id;
+			const gchar *email_id;
 			ECalComponentAttendee  *attendee = NULL, *tmp;
 
 
@@ -1587,14 +1587,14 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
 }
 
 EGwConnectionStatus
-e_gw_connection_create_appointment (EGwConnection *cnc, const char *container, ECalBackendGroupwise *cbgw, ECalComponent *comp, GSList **id_list)
+e_gw_connection_create_appointment (EGwConnection *cnc, const gchar *container, ECalBackendGroupwise *cbgw, ECalComponent *comp, GSList **id_list)
 {
 	EGwItem *item;
 	EGwConnectionStatus status;
 	icalproperty *icalprop;
 	gboolean move_cal = FALSE;
 	icalcomponent *icalcomp;
-	char *id = NULL;
+	gchar *id = NULL;
 
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
 	g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
@@ -1603,7 +1603,7 @@ e_gw_connection_create_appointment (EGwConnection *cnc, const char *container, E
 
 	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
 	while (icalprop) {
-		const char *x_name;
+		const gchar *x_name;
 
 		x_name = icalproperty_get_x_name (icalprop);
 		if (!strcmp (x_name, "X-EVOLUTION-MOVE-CALENDAR")) {
@@ -1630,7 +1630,7 @@ e_gw_connection_create_appointment (EGwConnection *cnc, const char *container, E
 
 static EGwConnectionStatus
 start_freebusy_session (EGwConnection *cnc, GList *users,
-               time_t start, time_t end, char **session)
+               time_t start, time_t end, gchar **session)
 {
         SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -1639,7 +1639,7 @@ start_freebusy_session (EGwConnection *cnc, GList *users,
         GList *l;
         icaltimetype icaltime;
 	icaltimezone *utc;
-        char *start_date, *end_date;
+        gchar *start_date, *end_date;
 
 	if (users == NULL)
                 return E_GW_CONNECTION_STATUS_INVALID_OBJECT;
@@ -1707,7 +1707,7 @@ start_freebusy_session (EGwConnection *cnc, GList *users,
 }
 
 static EGwConnectionStatus
-close_freebusy_session (EGwConnection *cnc, const char *session)
+close_freebusy_session (EGwConnection *cnc, const gchar *session)
 {
         SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -1741,10 +1741,10 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
         SoupSoapResponse *response;
         EGwConnectionStatus status;
         SoupSoapParameter *param, *subparam, *param_outstanding;
-        char *session;
-	char *outstanding = NULL;
+        gchar *session;
+	gchar *outstanding = NULL;
 	gboolean resend_request = TRUE;
-	int request_iteration = 0;
+	gint request_iteration = 0;
 
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
 
@@ -1818,7 +1818,7 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
 	     subparam != NULL;
 	     subparam = soup_soap_parameter_get_next_child_by_name (subparam, "user")) {
 		SoupSoapParameter *param_blocks, *subparam_block, *tmp;
-		char *uuid = NULL, *email = NULL, *name = NULL;
+		gchar *uuid = NULL, *email = NULL, *name = NULL;
 		ECalComponent *comp;
 		ECalComponentAttendee attendee;
 		GSList *attendee_list = NULL;
@@ -1863,8 +1863,8 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
 
 		e_cal_component_set_attendee_list (comp, attendee_list);
 		g_slist_free (attendee_list);
-		g_free ((char *) name);
-		g_free ((char *) email);
+		g_free ((gchar *) name);
+		g_free ((gchar *) email);
 
 		param_blocks = soup_soap_parameter_get_first_child_by_name (subparam, "blocks");
 		if (!param_blocks) {
@@ -1900,7 +1900,7 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
 			icalproperty *icalprop;
 			icaltimetype itt;
 			time_t t;
-			char *start, *end, *accept_level;
+			gchar *start, *end, *accept_level;
 
 			memset (&ipt, 0, sizeof (struct icalperiodtype));
 			tmp = soup_soap_parameter_get_first_child_by_name (subparam_block, "startDate");
@@ -1975,7 +1975,7 @@ set_categories_changes (EGwItem *new_item, EGwItem *old_item)
 	GList *new_category_list;
 	GList *temp, *old_categories_copy, *added_categories = NULL;
 	gboolean categories_matched;
-	char *category1, *category2;
+	gchar *category1, *category2;
 	old_category_list = e_gw_item_get_categories (old_item);
 	new_category_list = e_gw_item_get_categories (new_item);
 	if (old_category_list && new_category_list) {
@@ -2012,16 +2012,16 @@ set_categories_changes (EGwItem *new_item, EGwItem *old_item)
 void
 e_gw_item_set_changes (EGwItem *item, EGwItem *cache_item)
 {
-	const char *subject, *cache_subject;
-	const char *message, *cache_message;
-	const char *classification, *cache_classification;
-	const char *accept_level, *cache_accept_level;
-	const char *place, *cache_place;
-	const char *task_priority, *cache_task_priority;
-	int trigger, cache_trigger;
-	char *due_date, *cache_due_date;
-	char *start_date, *cache_start_date;
-	char *end_date, *cache_end_date;
+	const gchar *subject, *cache_subject;
+	const gchar *message, *cache_message;
+	const gchar *classification, *cache_classification;
+	const gchar *accept_level, *cache_accept_level;
+	const gchar *place, *cache_place;
+	const gchar *task_priority, *cache_task_priority;
+	gint trigger, cache_trigger;
+	gchar *due_date, *cache_due_date;
+	gchar *start_date, *cache_start_date;
+	gchar *end_date, *cache_end_date;
 	gboolean is_allday, cache_is_allday;
 
 	/* TODO assert the types of the items are the same */
@@ -2064,9 +2064,9 @@ e_gw_item_set_changes (EGwItem *item, EGwItem *cache_item)
 
 
 static void
-add_return_value (EGwSendOptionsReturnNotify track, ESource *source, char *notify)
+add_return_value (EGwSendOptionsReturnNotify track, ESource *source, gchar *notify)
 {
-	char *value;
+	gchar *value;
 
 	switch (track) {
 		case E_GW_RETURN_NOTIFY_MAIL:
@@ -2092,8 +2092,8 @@ e_cal_backend_groupwise_store_settings (GwSettings *hold)
 	GConfClient *gconf = gconf_client_get_default ();
 	ESource *source;
 	ESourceList *source_list;
-	const char *uid;
-	char *value;
+	const gchar *uid;
+	gchar *value;
 
 	cbgw = hold->cbgw;
 	opts = hold->opts;
@@ -2146,7 +2146,7 @@ e_cal_backend_groupwise_store_settings (GwSettings *hold)
 
 		/* Delay delivery */
 		if (gopts->delay_enabled) {
-			char *value;
+			gchar *value;
 			tt = icaltime_today ();
 			icaltime_adjust (&tt, gopts->delay_until, 0, 0, 0);
 			value = icaltime_as_ical_string_r (tt);
@@ -2200,7 +2200,7 @@ e_cal_backend_groupwise_store_settings (GwSettings *hold)
 }
 
 gboolean
-e_cal_backend_groupwise_utils_check_delegate (ECalComponent *comp, const char *email)
+e_cal_backend_groupwise_utils_check_delegate (ECalComponent *comp, const gchar *email)
 {
 	icalproperty *prop;
 	icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
@@ -2209,7 +2209,7 @@ e_cal_backend_groupwise_utils_check_delegate (ECalComponent *comp, const char *e
 	prop = icalcomponent_get_first_property (icalcomp,
 						 ICAL_X_PROPERTY);
 	while (prop) {
-		const char *x_name, *x_val;
+		const gchar *x_name, *x_val;
 
 		x_name = icalproperty_get_x_name (prop);
 		x_val = icalproperty_get_x (prop);
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h
index 5e6584b..809494d 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h
@@ -43,7 +43,7 @@ G_BEGIN_DECLS
 /*
  * Items management
  */
-EGwItem       *e_gw_item_new_from_cal_component (const char *container, ECalBackendGroupwise *cbgw, ECalComponent *comp);
+EGwItem       *e_gw_item_new_from_cal_component (const gchar *container, ECalBackendGroupwise *cbgw, ECalComponent *comp);
 EGwItem  *e_gw_item_new_for_delegate_from_cal (ECalBackendGroupwise *cbgw, ECalComponent *comp);
 ECalComponent *e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw);
 void          e_gw_item_set_changes (EGwItem *item, EGwItem *cached_item);
@@ -51,19 +51,19 @@ void          e_gw_item_set_changes (EGwItem *item, EGwItem *cached_item);
 /*
  * Connection-related utility functions
  */
-EGwConnectionStatus e_gw_connection_create_appointment (EGwConnection *cnc, const char *container, ECalBackendGroupwise *cbgw, ECalComponent *comp, GSList **id_list);
-EGwConnectionStatus e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *container, ECalComponent *comp, icalproperty_method method, gboolean all_instances, ECalComponent **created_comp, icalparameter_partstat *pstatus);
+EGwConnectionStatus e_gw_connection_create_appointment (EGwConnection *cnc, const gchar *container, ECalBackendGroupwise *cbgw, ECalComponent *comp, GSList **id_list);
+EGwConnectionStatus e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const gchar *container, ECalComponent *comp, icalproperty_method method, gboolean all_instances, ECalComponent **created_comp, icalparameter_partstat *pstatus);
 EGwConnectionStatus e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t start, time_t end, GList **freebusy, icaltimezone *default_zone);
 gboolean e_cal_backend_groupwise_store_settings (GwSettings *hold);
 EGwItem * e_gw_item_new_for_delegate_from_cal (ECalBackendGroupwise *cbgw, ECalComponent *comp);
-gboolean e_cal_backend_groupwise_utils_check_delegate (ECalComponent *comp, const char *email);
+gboolean e_cal_backend_groupwise_utils_check_delegate (ECalComponent *comp, const gchar *email);
 
 
 /*
  * Component related utility functions
  */
 
-const char *e_cal_component_get_gw_id (ECalComponent *comp);
+const gchar *e_cal_component_get_gw_id (ECalComponent *comp);
 G_END_DECLS
 
 #endif
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise.c b/calendar/backends/groupwise/e-cal-backend-groupwise.c
index 3aa6ed9..26d4a4d 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise.c
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise.c
@@ -70,10 +70,10 @@ struct _ECalBackendGroupwisePrivate {
 	EGwConnection *cnc;
 	ECalBackendCache *cache;
 	gboolean read_only;
-	char *uri;
-	char *username;
-	char *password;
-	char *container_id;
+	gchar *uri;
+	gchar *username;
+	gchar *password;
+	gchar *container_id;
 	CalMode mode;
 	gboolean mode_changed;
 	icaltimezone *default_zone;
@@ -87,8 +87,8 @@ struct _ECalBackendGroupwisePrivate {
 	guint sendoptions_sync_timeout;
 
 	/* fields for storing info while offline */
-	char *user_email;
-	char *local_attachments_store;
+	gchar *user_email;
+	gchar *local_attachments_store;
 
 	guint timeout_id;
 	GThread *dthread;
@@ -97,12 +97,12 @@ struct _ECalBackendGroupwisePrivate {
 
 static void e_cal_backend_groupwise_dispose (GObject *object);
 static void e_cal_backend_groupwise_finalize (GObject *object);
-static void sanitize_component (ECalBackendSync *backend, ECalComponent *comp, char *server_uid);
+static void sanitize_component (ECalBackendSync *backend, ECalComponent *comp, gchar *server_uid);
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
-static const char * get_gw_item_id (icalcomponent *icalcomp);
-static void get_retract_data (ECalComponent *comp, const char **retract_comment, gboolean *all_instances);
-static const char * get_element_type (icalcomponent_kind kind);
+e_cal_backend_groupwise_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj);
+static const gchar * get_gw_item_id (icalcomponent *icalcomp);
+static void get_retract_data (ECalComponent *comp, const gchar **retract_comment, gboolean *all_instances);
+static const gchar * get_element_type (icalcomponent_kind kind);
 
 #define PARENT_TYPE E_TYPE_CAL_BACKEND_SYNC
 static ECalBackendClass *parent_class = NULL;
@@ -148,11 +148,11 @@ e_cal_backend_groupwise_get_default_zone (ECalBackendGroupwise *cbgw) {
 
 static GMutex *mutex = NULL;
 
-static const char *
+static const gchar *
 get_element_type (icalcomponent_kind kind)
 {
 
-	const char *type;
+	const gchar *type;
 
 	if (kind == ICAL_VEVENT_COMPONENT)
 		type = "Appointment";
@@ -174,15 +174,15 @@ populate_cache (ECalBackendGroupwise *cbgw)
         ECalComponent *comp;
         GList *list = NULL, *l;
 	gboolean done = FALSE,  forward = FALSE;
-	int cursor = 0;
+	gint cursor = 0;
 	guint32	total, num = 0;
-	int percent = 0, i;
-	const char *position = E_GW_CURSOR_POSITION_END;
+	gint percent = 0, i;
+	const gchar *position = E_GW_CURSOR_POSITION_END;
 	icalcomponent_kind kind;
-	const char *type;
+	const gchar *type;
 	EGwFilter* filter[3];
-	char l_str[26];
-	char h_str[26];
+	gchar l_str[26];
+	gchar h_str[26];
 	icaltimetype temp;
 	struct tm tm;
 	time_t h_time, l_time;
@@ -258,7 +258,7 @@ populate_cache (ECalBackendGroupwise *cbgw)
 			}
 			for (l = list; l != NULL; l = g_list_next(l)) {
 				EGwItem *item;
-				char *progress_string = NULL;
+				gchar *progress_string = NULL;
 
 				item = E_GW_ITEM (l->data);
 				comp = e_gw_item_to_cal_component (item, cbgw);
@@ -278,11 +278,11 @@ populate_cache (ECalBackendGroupwise *cbgw)
 				e_cal_backend_notify_view_progress (E_CAL_BACKEND (cbgw), progress_string, percent);
 
 				if (E_IS_CAL_COMPONENT (comp)) {
-					char *comp_str;
+					gchar *comp_str;
 
 					e_cal_component_commit_sequence (comp);
 					comp_str = e_cal_component_get_as_string (comp);
-					e_cal_backend_notify_object_created (E_CAL_BACKEND (cbgw), (const char *) comp_str);
+					e_cal_backend_notify_object_created (E_CAL_BACKEND (cbgw), (const gchar *) comp_str);
 					g_free (comp_str);
 					e_cal_backend_cache_put_component (priv->cache, comp);
 					g_object_unref (comp);
@@ -308,7 +308,7 @@ populate_cache (ECalBackendGroupwise *cbgw)
 static gboolean
 compare_prefix (gconstpointer a, gconstpointer b)
 {
-	return !(g_str_has_prefix ((const char *)a, (const char *)b));
+	return !(g_str_has_prefix ((const gchar *)a, (const gchar *)b));
 }
 
 static gboolean
@@ -323,20 +323,20 @@ get_deltas (gpointer handle)
 	GList *item_list, *total_list = NULL, *l;
 	GSList *cache_keys = NULL, *ls;
 	GPtrArray *uid_array = NULL;
-	char *time_string = NULL;
-	char t_str [26];
-	const char *serv_time;
+	gchar *time_string = NULL;
+	gchar t_str [26];
+	const gchar *serv_time;
 	static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
-	const char *key = "attempts";
-	const char *attempts;
-	const char *position ;
+	const gchar *key = "attempts";
+	const gchar *attempts;
+	const gchar *position ;
 
 
 	EGwFilter *filter;
-	int time_interval;
+	gint time_interval;
 	icaltimetype temp;
 	gboolean done = FALSE;
-	int cursor = 0;
+	gint cursor = 0;
 	struct tm tm;
 	time_t current_time;
 	gboolean needs_to_get = FALSE;
@@ -393,12 +393,12 @@ get_deltas (gpointer handle)
 
 	if (status != E_GW_CONNECTION_STATUS_OK) {
 
-		const char *msg = NULL;
+		const gchar *msg = NULL;
 
 		if (!attempts) {
 			e_cal_backend_cache_put_key_value (cache, key, "2");
 		} else {
-			int failures;
+			gint failures;
 			failures = g_ascii_strtod(attempts, NULL) + 1;
 			e_cal_backend_cache_put_key_value (cache, key, GINT_TO_POINTER (failures));
 		}
@@ -419,10 +419,10 @@ get_deltas (gpointer handle)
 	for (; item_list != NULL; item_list = g_list_next(item_list)) {
 		EGwItem *item = NULL;
 		ECalComponent *modified_comp = NULL, *cache_comp = NULL;
-		char *cache_comp_str = NULL, *modif_comp_str, *rid = NULL;
+		gchar *cache_comp_str = NULL, *modif_comp_str, *rid = NULL;
 		icaltimetype *tt = NULL, *c_tt = NULL;
-		const char *uid;
-		int r_key;
+		const gchar *uid;
+		gint r_key;
 
 		item = E_GW_ITEM(item_list->data);
 		modified_comp = e_gw_item_to_cal_component (item, cbgw);
@@ -557,12 +557,12 @@ get_deltas (gpointer handle)
 		EGwItemCalId *calid = (EGwItemCalId *)	l->data;
 		GCompareFunc func = NULL;
 		GSList *remove = NULL;
-		char *real_key = NULL;
-		const char *recur_key;
+		gchar *real_key = NULL;
+		const gchar *recur_key;
 
 		if (calid->recur_key && calid->ical_id) {
-			char *rid = NULL;
-			char *temp = NULL;
+			gchar *rid = NULL;
+			gchar *temp = NULL;
 			icaltimetype tt = icaltime_from_string (calid->ical_id);
 			if (!tt.is_date) {
 				tt = icaltime_convert_to_zone (tt, priv->default_zone);
@@ -599,19 +599,19 @@ get_deltas (gpointer handle)
 		icalcomponent *icalcomp = NULL;
 
 
-		comp = e_cal_backend_cache_get_component (cache, (const char *) ls->data, NULL);
+		comp = e_cal_backend_cache_get_component (cache, (const gchar *) ls->data, NULL);
 
 		if (!comp)
 			continue;
 		icalcomp = e_cal_component_get_icalcomponent (comp);
 		if (kind == icalcomponent_isa (icalcomp)) {
-			char *comp_str = NULL;
+			gchar *comp_str = NULL;
 			ECalComponentId *id = e_cal_component_get_id (comp);
 
 			comp_str = e_cal_component_get_as_string (comp);
 			e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw),
 					id, comp_str, NULL);
-			e_cal_backend_cache_remove_component (cache, (const char *) id->uid, id->rid);
+			e_cal_backend_cache_remove_component (cache, (const gchar *) id->uid, id->rid);
 
 			e_cal_component_free_id (id);
 			g_free (comp_str);
@@ -628,13 +628,13 @@ get_deltas (gpointer handle)
 		for (l = item_list; l != NULL; l = l->next) {
 			ECalComponent *comp = NULL;
 			EGwItem *item = NULL;
-			char *tmp = NULL;
+			gchar *tmp = NULL;
 
 			item = (EGwItem *) l->data;
 			comp = e_gw_item_to_cal_component (item, cbgw);
 			if (comp) {
 				e_cal_component_commit_sequence (comp);
-				sanitize_component (E_CAL_BACKEND_SYNC (cbgw), comp, (char *) e_gw_item_get_id (item));
+				sanitize_component (E_CAL_BACKEND_SYNC (cbgw), comp, (gchar *) e_gw_item_get_id (item));
 				e_cal_backend_cache_put_component (priv->cache, comp);
 
 
@@ -678,8 +678,8 @@ static guint
 get_cache_refresh_interval (ECalBackendGroupwise *cbgw)
 {
 	guint time_interval;
-	const char *time_interval_string = NULL;
-	char *temp = NULL;
+	const gchar *time_interval_string = NULL;
+	gchar *temp = NULL;
 	ECalBackend *backend = E_CAL_BACKEND (cbgw);
 	ESource *source;
 
@@ -793,13 +793,13 @@ e_cal_backend_groupwise_refresh_calendar (ECalBackendGroupwise *cbgw)
 }
 #endif
 
-static char*
+static gchar *
 form_uri (ESource *source)
 {
-	char *uri;
-	const char *port;
-	char *formed_uri;
-	const char *use_ssl;
+	gchar *uri;
+	const gchar *port;
+	gchar *formed_uri;
+	const gchar *use_ssl;
 
 	EUri *parsed_uri;
 
@@ -870,11 +870,11 @@ cache_init (ECalBackendGroupwise *cbgw)
 			/*FIXME  why dont we do a notify here */
 			return NULL;
 		} else {
-			int time_interval;
-			char *utc_str;
+			gint time_interval;
+			gchar *utc_str;
 
 			time_interval = get_cache_refresh_interval (cbgw);
-			utc_str = (char *) e_gw_connection_get_server_time (priv->cnc);
+			utc_str = (gchar *) e_gw_connection_get_server_time (priv->cnc);
 			e_cal_backend_cache_set_marker (priv->cache);
 			e_cal_backend_cache_put_server_utc_time (priv->cache, utc_str);
 
@@ -945,16 +945,16 @@ set_container_id_with_count (ECalBackendGroupwise *cbgw)
 static ECalBackendSyncStatus
 connect_to_server (ECalBackendGroupwise *cbgw)
 {
-	char *real_uri;
+	gchar *real_uri;
 	ECalBackendGroupwisePrivate *priv;
 	ESource *source;
 	ECalSourceType source_type;
-	const char *use_ssl;
-	char *http_uri;
-	int permissions;
+	const gchar *use_ssl;
+	gchar *http_uri;
+	gint permissions;
 	GThread *thread;
 	GError *error = NULL;
-	char *parent_user = NULL;
+	gchar *parent_user = NULL;
 	icalcomponent_kind kind;
 	EGwConnectionErrors errors;
 	priv = cbgw->priv;
@@ -972,7 +972,7 @@ connect_to_server (ECalBackendGroupwise *cbgw)
 
 	kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgw));
 
-	parent_user = (char *) e_source_get_property (source, "parent_id_name");
+	parent_user = (gchar *) e_source_get_property (source, "parent_id_name");
 	/* create connection to server */
 	if (parent_user) {
 		EGwConnection *cnc;
@@ -1219,7 +1219,7 @@ e_cal_backend_groupwise_is_read_only (ECalBackendSync *backend, EDataCal *cal, g
 
 /* return email address of the person who opened the calender */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_cal_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_groupwise_get_cal_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	ECalBackendGroupwise *cbgw;
 	ECalBackendGroupwisePrivate *priv;
@@ -1240,7 +1240,7 @@ e_cal_backend_groupwise_get_cal_address (ECalBackendSync *backend, EDataCal *cal
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
+e_cal_backend_groupwise_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, gchar **attribute)
 {
 	/* ldap attribute is specific to Sun ONE connector to get free busy information*/
 	/* retun NULL here as group wise backend know how to get free busy information */
@@ -1251,7 +1251,7 @@ e_cal_backend_groupwise_get_ldap_attribute (ECalBackendSync *backend, EDataCal *
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_groupwise_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/*group wise does not support email based alarms */
 
@@ -1261,7 +1261,7 @@ e_cal_backend_groupwise_get_alarm_email_address (ECalBackendSync *backend, EData
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
+e_cal_backend_groupwise_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, gchar **capabilities)
 {
 	*capabilities = g_strdup (CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS ","
 				  CAL_STATIC_CAPABILITY_ONE_ALARM_ONLY ","
@@ -1315,16 +1315,16 @@ in_offline (ECalBackendGroupwise *cbgw) {
 /* Open handler for the file backend */
 static ECalBackendSyncStatus
 e_cal_backend_groupwise_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,
-			      const char *username, const char *password)
+			      const gchar *username, const gchar *password)
 {
 	ECalBackendGroupwise *cbgw;
 	ECalBackendGroupwisePrivate *priv;
 	ECalBackendSyncStatus status;
 	ECalSourceType source_type;
-	char *source = NULL;
-	char *filename;
-	char *mangled_uri;
-	int i;
+	gchar *source = NULL;
+	gchar *filename;
+	gchar *mangled_uri;
+	gint i;
 
 	cbgw = E_CAL_BACKEND_GROUPWISE (backend);
 	priv = cbgw->priv;
@@ -1352,7 +1352,7 @@ e_cal_backend_groupwise_open (ECalBackendSync *backend, EDataCal *cal, gboolean
 
 	if (priv->mode == CAL_MODE_LOCAL) {
 		ESource *esource;
-		const char *display_contents = NULL;
+		const gchar *display_contents = NULL;
 
 		cbgw->priv->read_only = TRUE;
 		esource = e_cal_backend_get_source (E_CAL_BACKEND (cbgw));
@@ -1506,7 +1506,7 @@ e_cal_backend_groupwise_set_mode (ECalBackend *backend, CalMode mode)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
+e_cal_backend_groupwise_get_default_object (ECalBackendSync *backend, EDataCal *cal, gchar **object)
 {
 
 	ECalComponent *comp;
@@ -1533,7 +1533,7 @@ e_cal_backend_groupwise_get_default_object (ECalBackendSync *backend, EDataCal *
 
 /* Get_object_component handler for the groupwise backend */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
+e_cal_backend_groupwise_get_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, gchar **object)
 {
 	ECalComponent *comp;
 	ECalBackendGroupwisePrivate *priv;
@@ -1568,7 +1568,7 @@ e_cal_backend_groupwise_get_object (ECalBackendSync *backend, EDataCal *cal, con
 
 /* Get_timezone_object handler for the groupwise backend */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
+e_cal_backend_groupwise_get_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object)
 {
 	ECalBackendGroupwise *cbgw;
         ECalBackendGroupwisePrivate *priv;
@@ -1599,7 +1599,7 @@ e_cal_backend_groupwise_get_timezone (ECalBackendSync *backend, EDataCal *cal, c
 
 /* Add_timezone handler for the groupwise backend */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_groupwise_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendGroupwise *cbgw;
@@ -1631,7 +1631,7 @@ e_cal_backend_groupwise_add_timezone (ECalBackendSync *backend, EDataCal *cal, c
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_groupwise_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendGroupwise *cbgw;
@@ -1663,7 +1663,7 @@ e_cal_backend_groupwise_set_default_zone (ECalBackendSync *backend, EDataCal *ca
 
 /* Gets the list of attachments */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **list)
+e_cal_backend_groupwise_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, GSList **list)
 {
 	/* TODO implement the function */
 	return GNOME_Evolution_Calendar_Success;
@@ -1671,7 +1671,7 @@ e_cal_backend_groupwise_get_attachment_list (ECalBackendSync *backend, EDataCal
 
 /* Get_objects_in_range handler for the groupwise backend */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects)
+e_cal_backend_groupwise_get_object_list (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp, GList **objects)
 {
 	ECalBackendGroupwise *cbgw;
 	ECalBackendGroupwisePrivate *priv;
@@ -1786,7 +1786,7 @@ typedef struct {
 } ECalBackendGroupwiseComputeChangesData;
 
 static void
-e_cal_backend_groupwise_compute_changes_foreach_key (const char *key, const char *value, gpointer data)
+e_cal_backend_groupwise_compute_changes_foreach_key (const gchar *key, const gchar *value, gpointer data)
 {
 	ECalBackendGroupwiseComputeChangesData *be_data = data;
 
@@ -1808,12 +1808,12 @@ e_cal_backend_groupwise_compute_changes_foreach_key (const char *key, const char
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_compute_changes (ECalBackendGroupwise *cbgw, const char *change_id,
+e_cal_backend_groupwise_compute_changes (ECalBackendGroupwise *cbgw, const gchar *change_id,
 					 GList **adds, GList **modifies, GList **deletes)
 {
         ECalBackendSyncStatus status;
 	ECalBackendCache *cache;
-	char    *filename;
+	gchar    *filename;
 	EXmlHash *ehash;
 	ECalBackendGroupwiseComputeChangesData be_data;
 	GList *i, *list = NULL;
@@ -1834,8 +1834,8 @@ e_cal_backend_groupwise_compute_changes (ECalBackendGroupwise *cbgw, const char
 
         /* Calculate adds and modifies */
 	for (i = list; i != NULL; i = g_list_next (i)) {
-		const char *uid;
-		char *calobj;
+		const gchar *uid;
+		gchar *calobj;
 		ECalComponent *comp;
 
 		comp = e_cal_component_new_from_string (i->data);
@@ -1880,7 +1880,7 @@ e_cal_backend_groupwise_compute_changes (ECalBackendGroupwise *cbgw, const char
 
 /* Get_changes handler for the groupwise backend */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id,
+e_cal_backend_groupwise_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id,
 				     GList **adds, GList **modifies, GList **deletes)
 {
         ECalBackendGroupwise *cbgw;
@@ -1895,7 +1895,7 @@ e_cal_backend_groupwise_get_changes (ECalBackendSync *backend, EDataCal *cal, co
 
 /* Discard_alarm handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
+e_cal_backend_groupwise_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 	return GNOME_Evolution_Calendar_OtherError;
 }
@@ -1909,7 +1909,7 @@ e_cal_backend_groupwise_internal_get_default_timezone (ECalBackend *backend)
 }
 
 static icaltimezone *
-e_cal_backend_groupwise_internal_get_timezone (ECalBackend *backend, const char *tzid)
+e_cal_backend_groupwise_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
 	icaltimezone *zone;
 
@@ -1925,11 +1925,11 @@ e_cal_backend_groupwise_internal_get_timezone (ECalBackend *backend, const char
 }
 
 static void
-sanitize_component (ECalBackendSync *backend, ECalComponent *comp, char *server_uid)
+sanitize_component (ECalBackendSync *backend, ECalComponent *comp, gchar *server_uid)
 {
 	ECalBackendGroupwise *cbgw;
 	icalproperty *icalprop;
-	int i;
+	gint i;
 	GString *str = g_string_new ("");;
 
 	cbgw = E_CAL_BACKEND_GROUPWISE (backend);
@@ -1955,7 +1955,7 @@ sanitize_component (ECalBackendSync *backend, ECalComponent *comp, char *server_
 }
 
 static EGwConnectionStatus
-update_from_server (ECalBackendGroupwise *cbgw, GSList *uid_list, char **calobj, ECalComponent *comp)
+update_from_server (ECalBackendGroupwise *cbgw, GSList *uid_list, gchar **calobj, ECalComponent *comp)
 {
 	EGwConnectionStatus stat;
 	ECalBackendGroupwisePrivate *priv;
@@ -1963,7 +1963,7 @@ update_from_server (ECalBackendGroupwise *cbgw, GSList *uid_list, char **calobj,
 	GList *list = NULL, *tmp;
 	GSList *l;
 	GPtrArray *uid_array = g_ptr_array_new ();
-	int i;
+	gint i;
 
 	priv = cbgw->priv;
 	backend = E_CAL_BACKEND_SYNC (cbgw);
@@ -2000,7 +2000,7 @@ update_from_server (ECalBackendGroupwise *cbgw, GSList *uid_list, char **calobj,
 		}
 
 		if (i != 0) {
-			char *temp;
+			gchar *temp;
 			temp = e_cal_component_get_as_string (e_cal_comp);
 			e_cal_backend_notify_object_created (E_CAL_BACKEND (cbgw), temp);
 			g_free (temp);
@@ -2014,7 +2014,7 @@ update_from_server (ECalBackendGroupwise *cbgw, GSList *uid_list, char **calobj,
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
+e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid)
 {
 	ECalBackendGroupwise *cbgw;
         ECalBackendGroupwisePrivate *priv;
@@ -2089,18 +2089,18 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal,
 }
 
 static void
-get_retract_data (ECalComponent *comp, const char **retract_comment, gboolean *all_instances)
+get_retract_data (ECalComponent *comp, const gchar **retract_comment, gboolean *all_instances)
 {
 	icalcomponent *icalcomp = NULL;
 	icalproperty *icalprop = NULL;
 	gboolean is_instance = FALSE;
-	const char *x_ret = NULL, *x_recur = NULL;
+	const gchar *x_ret = NULL, *x_recur = NULL;
 
 	is_instance = e_cal_component_is_instance (comp);
 	icalcomp = e_cal_component_get_icalcomponent (comp);
 	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
 	while (icalprop) {
-		const char *x_name;
+		const gchar *x_name;
 
 		x_name = icalproperty_get_x_name (icalprop);
 		/* This property will be set only if the user is an organizer */
@@ -2127,8 +2127,8 @@ get_retract_data (ECalComponent *comp, const char **retract_comment, gboolean *a
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj,
-				       CalObjModType mod, char **old_object, char **new_object)
+e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj,
+				       CalObjModType mod, gchar **old_object, gchar **new_object)
 {
 	ECalBackendGroupwise *cbgw;
         ECalBackendGroupwisePrivate *priv;
@@ -2136,8 +2136,8 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
 	ECalComponent *comp, *cache_comp = NULL;
 	EGwConnectionStatus status;
 	EGwItem *item, *cache_item;
-	const char *uid = NULL;
-	char *rid = NULL;
+	const gchar *uid = NULL;
+	gchar *rid = NULL;
 
 	*old_object = NULL;
 	cbgw = E_CAL_BACKEND_GROUPWISE (backend);
@@ -2174,7 +2174,7 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
 
 		if (e_cal_component_has_attendees (comp) &&
 				e_cal_backend_groupwise_utils_check_delegate (comp, e_gw_connection_get_user_email (priv->cnc))) {
-			const char *id = NULL, *recur_key = NULL;
+			const gchar *id = NULL, *recur_key = NULL;
 
 			item = e_gw_item_new_for_delegate_from_cal (cbgw, comp);
 
@@ -2256,7 +2256,7 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static const char *
+static const gchar *
 get_gw_item_id (icalcomponent *icalcomp)
 {
 	icalproperty *icalprop;
@@ -2264,7 +2264,7 @@ get_gw_item_id (icalcomponent *icalcomp)
 	/* search the component for the X-GWRECORDID property */
 	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
 	while (icalprop) {
-		const char *x_name, *x_val;
+		const gchar *x_name, *x_val;
 
 		x_name = icalproperty_get_x_name (icalprop);
 		x_val = icalproperty_get_x (icalprop);
@@ -2280,13 +2280,13 @@ get_gw_item_id (icalcomponent *icalcomp)
 /* Remove_object handler for the file backend */
 static ECalBackendSyncStatus
 e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
-				       const char *uid, const char *rid,
-				       CalObjModType mod, char **old_object,
-				       char **object)
+				       const gchar *uid, const gchar *rid,
+				       CalObjModType mod, gchar **old_object,
+				       gchar **object)
 {
 	ECalBackendGroupwise *cbgw;
         ECalBackendGroupwisePrivate *priv;
-	char *calobj = NULL;
+	gchar *calobj = NULL;
 
 	cbgw = E_CAL_BACKEND_GROUPWISE (backend);
 	priv = cbgw->priv;
@@ -2296,7 +2296,7 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
 	/* if online, remove the item from the server */
 	if (priv->mode == CAL_MODE_REMOTE) {
 		ECalBackendSyncStatus status;
-		const char *id_to_remove = NULL;
+		const gchar *id_to_remove = NULL;
 		icalcomponent *icalcomp;
 
 		status = e_cal_backend_groupwise_get_object (backend, cal, uid, rid, &calobj);
@@ -2355,7 +2355,7 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
 					ECalComponent *comp = E_CAL_COMPONENT (l->data);
 
 					id_to_remove = get_gw_item_id (e_cal_component_get_icalcomponent (comp));
-					item_ids = g_list_append (item_ids, (char *) id_to_remove);
+					item_ids = g_list_append (item_ids, (gchar *) id_to_remove);
 				}
 				status = e_gw_connection_remove_items (priv->cnc, priv->container_id, item_ids);
 
@@ -2372,7 +2372,7 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
 					e_cal_backend_cache_remove_component (priv->cache, id->uid,
 							id->rid);
 					if (!id->rid || !g_str_equal (id->rid, rid)) {
-						char *comp_str = e_cal_component_get_as_string (comp);
+						gchar *comp_str = e_cal_component_get_as_string (comp);
 						e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), id, comp_str, NULL);
 						g_free (comp_str);
 					}
@@ -2410,10 +2410,10 @@ fetch_attachments (ECalBackendGroupwise *cbgw, ECalComponent *comp)
 {
 	GSList *attach_list = NULL, *new_attach_list = NULL;
 	GSList *l;
-	char  *attach_store;
-	char *dest_url, *dest_file;
-	int fd;
-	const char *uid;
+	gchar  *attach_store;
+	gchar *dest_url, *dest_file;
+	gint fd;
+	const gchar *uid;
 
 	e_cal_component_get_attachment_list (comp, &attach_list);
 	e_cal_component_get_uid (comp, &uid);
@@ -2421,8 +2421,8 @@ fetch_attachments (ECalBackendGroupwise *cbgw, ECalComponent *comp)
 	attach_store = g_strdup (e_cal_backend_groupwise_get_local_attachments_store (cbgw));
 
 	for (l = attach_list; l ; l = l->next) {
-		char *sfname = (char *)l->data;
-		char *filename, *new_filename;
+		gchar *sfname = (gchar *)l->data;
+		gchar *filename, *new_filename;
 		GMappedFile *mapped_file;
 		GError *error = NULL;
 
@@ -2466,7 +2466,7 @@ fetch_attachments (ECalBackendGroupwise *cbgw, ECalComponent *comp)
 }
 
 static void
-change_status (ECalComponent *comp, icalparameter_partstat status, const char *email)
+change_status (ECalComponent *comp, icalparameter_partstat status, const gchar *email)
 {
 	icalproperty *prop;
 	icalparameter *param;
@@ -2477,7 +2477,7 @@ change_status (ECalComponent *comp, icalparameter_partstat status, const char *e
 	for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
 			prop;
 			prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) {
-		const char *attendee = icalproperty_get_attendee (prop);
+		const gchar *attendee = icalproperty_get_attendee (prop);
 
 		if (!g_ascii_strncasecmp (attendee, "mailto:";, 7))
 			attendee += 7;
@@ -2492,9 +2492,9 @@ change_status (ECalComponent *comp, icalparameter_partstat status, const char *e
 
 	/* We couldn find the attendee in the component, so add a new attendee */
 	if (!found) {
-		char *temp = g_strdup_printf ("MAILTO:%s", email);
+		gchar *temp = g_strdup_printf ("MAILTO:%s", email);
 
-		prop = icalproperty_new_attendee ((const char *) temp);
+		prop = icalproperty_new_attendee ((const gchar *) temp);
 		icalcomponent_add_property (icalcomp, prop);
 
 		param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED);
@@ -2531,7 +2531,7 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
 	 * added to the xgwrecordid inorder to obtain the item id. */
 	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
 	while (icalprop) {
-		const char *x_name;
+		const gchar *x_name;
 
 		x_name = icalproperty_get_x_name (icalprop);
 		if (!strcmp (x_name, "X-GW-RECUR-INSTANCES-MOD-TYPE")) {
@@ -2567,9 +2567,9 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
 		gboolean found = FALSE;
 
 		if (all_instances) {
-			const char *uid;
+			const gchar *uid;
 
-			e_cal_component_get_uid (modif_comp, (const char **) &uid);
+			e_cal_component_get_uid (modif_comp, (const gchar **) &uid);
 			comps = e_cal_backend_cache_get_components_by_uid (priv->cache, uid);
 
 			if (!comps)
@@ -2599,14 +2599,14 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
 				ECalComponentId *id = e_cal_component_get_id (component);
 
 				if (e_cal_backend_cache_remove_component (priv->cache, id->uid, id->rid)) {
-					char *comp_str = e_cal_component_get_as_string (component);
+					gchar *comp_str = e_cal_component_get_as_string (component);
 					e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), id, comp_str, NULL);
 					g_free (comp_str);
 				}
 
 				e_cal_component_free_id (id);
 			} else {
-				char *comp_str = NULL;
+				gchar *comp_str = NULL;
 				ECalComponentTransparency transp;
 
 				change_status (component, pstatus, e_gw_connection_get_user_email (priv->cnc));
@@ -2642,7 +2642,7 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
 
 /* Update_objects handler for the file backend. */
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_groupwise_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendGroupwise *cbgw;
         ECalBackendGroupwisePrivate *priv;
@@ -2690,8 +2690,8 @@ send_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp,
 	ECalComponent *comp, *found_comp = NULL;
 	ECalBackendGroupwisePrivate *priv;
 	ECalBackendSyncStatus status = GNOME_Evolution_Calendar_OtherError;
-	const char *uid = NULL;
-	char *rid = NULL;
+	const gchar *uid = NULL;
+	gchar *rid = NULL;
 
 	priv = cbgw->priv;
 
@@ -2699,7 +2699,7 @@ send_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp,
 	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
 	rid = e_cal_component_get_recurid_as_string (comp);
 
-	e_cal_component_get_uid (comp, (const char **) &uid);
+	e_cal_component_get_uid (comp, (const gchar **) &uid);
 	found_comp = e_cal_backend_cache_get_component (priv->cache, uid, rid);
 	g_free (rid);
 	rid = NULL;
@@ -2714,9 +2714,9 @@ send_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp,
 	case CAL_MODE_ANY :
 	case CAL_MODE_REMOTE :
 		if (method == ICAL_METHOD_CANCEL) {
-			const char *retract_comment = NULL;
+			const gchar *retract_comment = NULL;
 			gboolean all_instances = FALSE;
-			const char *id = NULL;
+			const gchar *id = NULL;
 
 			get_retract_data (comp, &retract_comment, &all_instances);
 			id = get_gw_item_id (icalcomp);
@@ -2743,8 +2743,8 @@ send_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp,
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_send_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj, GList **users,
-				      char **modified_calobj)
+e_cal_backend_groupwise_send_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, GList **users,
+				      gchar **modified_calobj)
 {
 	ECalBackendSyncStatus status = GNOME_Evolution_Calendar_OtherError;
 	icalcomponent *icalcomp, *subcomp;
@@ -2796,7 +2796,7 @@ e_cal_backend_groupwise_send_objects (ECalBackendSync *backend, EDataCal *cal, c
 			e_cal_component_get_attendee_list (comp, &attendee_list);
 			/* convert this into GList */
 			for (tmp = attendee_list; tmp; tmp = g_slist_next (tmp)) {
-				const char *attendee = tmp->data;
+				const gchar *attendee = tmp->data;
 
 				if (attendee)
 					*users = g_list_append (*users, g_strdup (attendee));
@@ -2915,7 +2915,7 @@ e_cal_backend_groupwise_get_type (void)
 void
 e_cal_backend_groupwise_notify_error_code (ECalBackendGroupwise *cbgw, EGwConnectionStatus status)
 {
-	const char *msg;
+	const gchar *msg;
 
 	g_return_if_fail (E_IS_CAL_BACKEND_GROUPWISE (cbgw));
 
@@ -2924,7 +2924,7 @@ e_cal_backend_groupwise_notify_error_code (ECalBackendGroupwise *cbgw, EGwConnec
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbgw), msg);
 }
 
-const char *
+const gchar *
 e_cal_backend_groupwise_get_local_attachments_store (ECalBackendGroupwise *cbgw)
 {
 	g_return_val_if_fail (E_IS_CAL_BACKEND_GROUPWISE (cbgw), NULL);
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise.h b/calendar/backends/groupwise/e-cal-backend-groupwise.h
index 1887b3f..2b74b78 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise.h
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise.h
@@ -62,7 +62,7 @@ GHashTable* e_cal_backend_groupwise_get_categories_by_id (ECalBackendGroupwise *
 GHashTable* e_cal_backend_groupwise_get_categories_by_name (ECalBackendGroupwise *cbgw);
 icaltimezone* e_cal_backend_groupwise_get_default_zone (ECalBackendGroupwise *cbgw);
 void    e_cal_backend_groupwise_notify_error_code (ECalBackendGroupwise *cbgw, EGwConnectionStatus status);
-const char * e_cal_backend_groupwise_get_local_attachments_store (ECalBackendGroupwise *cbgw);
+const gchar * e_cal_backend_groupwise_get_local_attachments_store (ECalBackendGroupwise *cbgw);
 G_END_DECLS
 
 #endif
diff --git a/calendar/backends/http/e-cal-backend-http-factory.c b/calendar/backends/http/e-cal-backend-http-factory.c
index 46a411f..840762f 100644
--- a/calendar/backends/http/e-cal-backend-http-factory.c
+++ b/calendar/backends/http/e-cal-backend-http-factory.c
@@ -29,7 +29,7 @@ e_cal_backend_http_factory_instance_init (ECalBackendHttpFactory *factory)
 {
 }
 
-static const char *
+static const gchar *
 _get_protocol (ECalBackendFactory *factory)
 {
 	return "webcal";
@@ -197,7 +197,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = http_types;
 	*num_types = 3;
diff --git a/calendar/backends/http/e-cal-backend-http-factory.h b/calendar/backends/http/e-cal-backend-http-factory.h
index 1500341..e3a6614 100644
--- a/calendar/backends/http/e-cal-backend-http-factory.h
+++ b/calendar/backends/http/e-cal-backend-http-factory.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 
 void                 eds_module_initialize (GTypeModule *module);
 void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, int *num_types);
+void                 eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index 8b16d86..61d0e57 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -42,7 +42,7 @@
 /* Private part of the ECalBackendHttp structure */
 struct _ECalBackendHttpPrivate {
 	/* URI to get remote calendar data from */
-	char *uri;
+	gchar *uri;
 
 	/* Local/remote mode */
 	CalMode mode;
@@ -67,8 +67,8 @@ struct _ECalBackendHttpPrivate {
 	/* Flags */
 	gboolean opened;
 
-	char *username;
-	char *password;
+	gchar *username;
+	gchar *password;
 };
 
 
@@ -79,7 +79,7 @@ static void e_cal_backend_http_dispose (GObject *object);
 static void e_cal_backend_http_finalize (GObject *object);
 static gboolean begin_retrieval_cb (ECalBackendHttp *cbhttp);
 static ECalBackendSyncStatus
-e_cal_backend_http_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
+e_cal_backend_http_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj);
 
 static ECalBackendSyncClass *parent_class;
 
@@ -166,7 +166,7 @@ e_cal_backend_http_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboole
 
 /* Get_email_address handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_http_get_cal_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_http_get_cal_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/* A HTTP backend has no particular email address associated
 	 * with it (although that would be a useful feature some day).
@@ -177,7 +177,7 @@ e_cal_backend_http_get_cal_address (ECalBackendSync *backend, EDataCal *cal, cha
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
+e_cal_backend_http_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, gchar **attribute)
 {
 	*attribute = NULL;
 
@@ -185,7 +185,7 @@ e_cal_backend_http_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal,
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_http_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/* A HTTP backend has no particular email address associated
 	 * with it (although that would be a useful feature some day).
@@ -196,7 +196,7 @@ e_cal_backend_http_get_alarm_email_address (ECalBackendSync *backend, EDataCal *
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
+e_cal_backend_http_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, gchar **capabilities)
 {
 	*capabilities = g_strdup (CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS);
 
@@ -221,7 +221,7 @@ webcal_to_http_method (const gchar *webcal_str, gboolean secure)
 static gboolean
 notify_and_remove_from_cache (gpointer key, gpointer value, gpointer user_data)
 {
-	const char *calobj = value;
+	const gchar *calobj = value;
 	ECalBackendHttp *cbhttp = E_CAL_BACKEND_HTTP (user_data);
 	ECalComponent *comp = e_cal_component_new_from_string (calobj);
 	ECalComponentId *id = e_cal_component_get_id (comp);
@@ -241,7 +241,7 @@ retrieval_done (SoupSession *session, SoupMessage *msg, ECalBackendHttp *cbhttp)
 	ECalBackendHttpPrivate *priv;
 	icalcomponent *icalcomp, *subcomp;
 	icalcomponent_kind kind;
-	const char *newuri;
+	const gchar *newuri;
 	GHashTable *old_cache;
 	GList *comps_in_cache;
 
@@ -302,7 +302,7 @@ retrieval_done (SoupSession *session, SoupMessage *msg, ECalBackendHttp *cbhttp)
 
 	comps_in_cache = e_cal_backend_cache_get_components (priv->cache);
 	while (comps_in_cache != NULL) {
-		const char *uid;
+		const gchar *uid;
 		ECalComponent *comp = comps_in_cache->data;
 
 		e_cal_component_get_uid (comp, &uid);
@@ -331,14 +331,14 @@ retrieval_done (SoupSession *session, SoupMessage *msg, ECalBackendHttp *cbhttp)
 		if (subcomp_kind == kind) {
 			comp = e_cal_component_new ();
 			if (e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (subcomp))) {
-				const char *uid, *orig_key, *orig_value;
-				char *obj;
+				const gchar *uid, *orig_key, *orig_value;
+				gchar *obj;
 
 				e_cal_backend_cache_put_component (priv->cache, comp);
 
 				e_cal_component_get_uid (comp, &uid);
-				/* middle (void*) cast only because of 'dereferencing type-punned pointer will break strict-aliasing rules' */
-				if (g_hash_table_lookup_extended (old_cache, uid, (void **)(void*)&orig_key, (void **)(void*)&orig_value)) {
+				/* middle (gpointer) cast only because of 'dereferencing type-punned pointer will break strict-aliasing rules' */
+				if (g_hash_table_lookup_extended (old_cache, uid, (gpointer *)(gpointer)&orig_key, (gpointer *)(gpointer)&orig_value)) {
 					obj = icalcomponent_as_ical_string_r (subcomp);
 					e_cal_backend_notify_object_modified (E_CAL_BACKEND (cbhttp),
 									      orig_value,
@@ -427,7 +427,7 @@ begin_retrieval_cb (ECalBackendHttp *cbhttp)
 
 	if (priv->uri == NULL) {
 		ESource *source = e_cal_backend_get_source (E_CAL_BACKEND (cbhttp));
-		const char *secure_prop = e_source_get_property (source, "use_ssl");
+		const gchar *secure_prop = e_source_get_property (source, "use_ssl");
 
 		priv->uri = webcal_to_http_method (e_cal_backend_get_uri (E_CAL_BACKEND (cbhttp)),
 						   (secure_prop && g_str_equal(secure_prop, "1")));
@@ -520,7 +520,7 @@ maybe_start_reload_timeout (ECalBackendHttp *cbhttp)
 /* Open handler for the file backend */
 static ECalBackendSyncStatus
 e_cal_backend_http_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,
-			 const char *username, const char *password)
+			 const gchar *username, const gchar *password)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -673,7 +673,7 @@ e_cal_backend_http_set_mode (ECalBackend *backend, CalMode mode)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
+e_cal_backend_http_get_default_object (ECalBackendSync *backend, EDataCal *cal, gchar **object)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -693,7 +693,7 @@ e_cal_backend_http_get_default_object (ECalBackendSync *backend, EDataCal *cal,
 
 /* Get_object_component handler for the http backend */
 static ECalBackendSyncStatus
-e_cal_backend_http_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
+e_cal_backend_http_get_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, gchar **object)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -719,7 +719,7 @@ e_cal_backend_http_get_object (ECalBackendSync *backend, EDataCal *cal, const ch
 
 /* Get_timezone_object handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_http_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
+e_cal_backend_http_get_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -750,7 +750,7 @@ e_cal_backend_http_get_timezone (ECalBackendSync *backend, EDataCal *cal, const
 
 /* Add_timezone handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_http_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_http_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -781,7 +781,7 @@ e_cal_backend_http_add_timezone (ECalBackendSync *backend, EDataCal *cal, const
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_http_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendHttp *cbhttp;
@@ -814,7 +814,7 @@ e_cal_backend_http_set_default_zone (ECalBackendSync *backend, EDataCal *cal, co
 
 /* Get_objects_in_range handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_http_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects)
+e_cal_backend_http_get_object_list (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp, GList **objects)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -888,7 +888,7 @@ e_cal_backend_http_start_query (ECalBackend *backend, EDataCalView *query)
 
 
 static icaltimezone *
-resolve_tzid (const char *tzid, gpointer user_data)
+resolve_tzid (const gchar *tzid, gpointer user_data)
 {
         icalcomponent *vcalendar_comp = user_data;
 
@@ -932,7 +932,7 @@ free_busy_instance (ECalComponent *comp,
 }
 
 static icalcomponent *
-create_user_free_busy (ECalBackendHttp *cbhttp, const char *address, const char *cn,
+create_user_free_busy (ECalBackendHttp *cbhttp, const gchar *address, const gchar *cn,
                        time_t start, time_t end)
 {
         GList *list = NULL, *l;
@@ -941,7 +941,7 @@ create_user_free_busy (ECalBackendHttp *cbhttp, const char *address, const char
         ECalBackendSExp *obj_sexp;
         ECalBackendHttpPrivate *priv;
         ECalBackendCache *cache;
-        char *query, *iso_start, *iso_end;
+        gchar *query, *iso_start, *iso_end;
 
         priv = cbhttp->priv;
         cache = priv->cache;
@@ -1029,7 +1029,7 @@ e_cal_backend_http_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
 	ECalBackendHttpPrivate *priv;
 	gchar *address, *name;
 	icalcomponent *vfb;
-	char *calobj;
+	gchar *calobj;
 
 
 	cbhttp = E_CAL_BACKEND_HTTP (backend);
@@ -1069,7 +1069,7 @@ e_cal_backend_http_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
 
 /* Get_changes handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_http_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id,
+e_cal_backend_http_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id,
 				GList **adds, GList **modifies, GList **deletes)
 {
 	ECalBackendHttp *cbhttp;
@@ -1086,7 +1086,7 @@ e_cal_backend_http_get_changes (ECalBackendSync *backend, EDataCal *cal, const c
 
 /* Discard_alarm handler for the file backend */
 static ECalBackendSyncStatus
-e_cal_backend_http_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
+e_cal_backend_http_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -1099,7 +1099,7 @@ e_cal_backend_http_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
+e_cal_backend_http_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -1111,8 +1111,8 @@ e_cal_backend_http_create_object (ECalBackendSync *backend, EDataCal *cal, char
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj,
-				CalObjModType mod, char **old_object, char **new_object)
+e_cal_backend_http_modify_object (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj,
+				CalObjModType mod, gchar **old_object, gchar **new_object)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -1128,9 +1128,9 @@ e_cal_backend_http_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 /* Remove_object handler for the file backend */
 static ECalBackendSyncStatus
 e_cal_backend_http_remove_object (ECalBackendSync *backend, EDataCal *cal,
-				const char *uid, const char *rid,
-				CalObjModType mod, char **old_object,
-				char **object)
+				const gchar *uid, const gchar *rid,
+				CalObjModType mod, gchar **old_object,
+				gchar **object)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -1147,7 +1147,7 @@ e_cal_backend_http_remove_object (ECalBackendSync *backend, EDataCal *cal,
 
 /* Update_objects handler for the file backend. */
 static ECalBackendSyncStatus
-e_cal_backend_http_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_http_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -1161,8 +1161,8 @@ e_cal_backend_http_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_send_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj, GList **users,
-				 char **modified_calobj)
+e_cal_backend_http_send_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, GList **users,
+				 gchar **modified_calobj)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
@@ -1192,7 +1192,7 @@ e_cal_backend_http_internal_get_default_timezone (ECalBackend *backend)
 }
 
 static icaltimezone *
-e_cal_backend_http_internal_get_timezone (ECalBackend *backend, const char *tzid)
+e_cal_backend_http_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
 	ECalBackendHttp *cbhttp;
 	ECalBackendHttpPrivate *priv;
diff --git a/calendar/backends/weather/e-cal-backend-weather-factory.c b/calendar/backends/weather/e-cal-backend-weather-factory.c
index b259fa1..6059375 100644
--- a/calendar/backends/weather/e-cal-backend-weather-factory.c
+++ b/calendar/backends/weather/e-cal-backend-weather-factory.c
@@ -40,7 +40,7 @@ e_cal_backend_weather_factory_instance_init (ECalBackendWeatherFactory *factory)
 {
 }
 
-static const char *
+static const gchar *
 _get_protocol (ECalBackendFactory *factory)
 {
 	return "weather";
@@ -106,7 +106,7 @@ eds_module_shutdown (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = weather_type;
 	*num_types = 1;
diff --git a/calendar/backends/weather/e-cal-backend-weather-factory.h b/calendar/backends/weather/e-cal-backend-weather-factory.h
index 706f465..88674d9 100644
--- a/calendar/backends/weather/e-cal-backend-weather-factory.h
+++ b/calendar/backends/weather/e-cal-backend-weather-factory.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
 
 void eds_module_initialize (GTypeModule *module);
 void eds_module_shutdown   (void);
-void eds_module_list_types (const GType **types, int *num_types);
+void eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/calendar/backends/weather/e-cal-backend-weather.c b/calendar/backends/weather/e-cal-backend-weather.c
index b98a244..f7ec0e2 100644
--- a/calendar/backends/weather/e-cal-backend-weather.c
+++ b/calendar/backends/weather/e-cal-backend-weather.c
@@ -37,12 +37,12 @@ static gboolean reload_cb (ECalBackendWeather *cbw);
 static gboolean begin_retrieval_cb (ECalBackendWeather *cbw);
 static ECalComponent* create_weather (ECalBackendWeather *cbw, WeatherInfo *report, gboolean is_forecast);
 static ECalBackendSyncStatus
-e_cal_backend_weather_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
+e_cal_backend_weather_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj);
 
 /* Private part of the ECalBackendWeather structure */
 struct _ECalBackendWeatherPrivate {
 	/* URI to get remote weather data from */
-	char *uri;
+	gchar *uri;
 
 	/* Local/remote mode */
 	CalMode mode;
@@ -141,7 +141,7 @@ finished_retrieval_cb (WeatherInfo *info, ECalBackendWeather *cbw)
 	ECalComponent *comp;
 	icalcomponent *icomp;
 	GList *l;
-	char *obj;
+	gchar *obj;
 
 	priv = cbw->priv;
 
@@ -154,7 +154,7 @@ finished_retrieval_cb (WeatherInfo *info, ECalBackendWeather *cbw)
 	l = e_cal_backend_cache_get_components (priv->cache);
 	for (; l != NULL; l = g_list_next (l)) {
 		ECalComponentId *id;
-		char *obj;
+		gchar *obj;
 
 		icomp = e_cal_component_get_icalcomponent (E_CAL_COMPONENT (l->data));
 		id = e_cal_component_get_id (E_CAL_COMPONENT (l->data));
@@ -236,12 +236,12 @@ begin_retrieval_cb (ECalBackendWeather *cbw)
 	return FALSE;
 }
 
-static const char*
+static const gchar *
 getCategory (WeatherInfo *report)
 {
 	struct {
-		const char *description;
-		const char *icon_name;
+		const gchar *description;
+		const gchar *icon_name;
 	} categories[] = {
 		{ N_("Weather: Fog"),		"weather-fog" },
 		{ N_("Weather: Cloudy"),	"weather-few-clouds" },
@@ -255,8 +255,8 @@ getCategory (WeatherInfo *report)
 		{ NULL,				NULL }
 	};
 
-	int i;
-	const char *icon_name = weather_info_get_icon_name (report);
+	gint i;
+	const gchar *icon_name = weather_info_get_icon_name (report);
 
 	if (!icon_name)
 		return NULL;
@@ -283,7 +283,7 @@ create_weather (ECalBackendWeather *cbw, WeatherInfo *report, gboolean is_foreca
 	ECalComponentText         *description;
 	ESource                   *source;
 	gboolean                   metric;
-	const char                *tmp;
+	const gchar                *tmp;
 	time_t			   update_time;
 	icaltimezone		  *update_zone = NULL;
 	const WeatherLocation     *location;
@@ -390,7 +390,7 @@ create_weather (ECalBackendWeather *cbw, WeatherInfo *report, gboolean is_foreca
 	}
 	comp_summary.altrep = NULL;
 	e_cal_component_set_summary (cal_comp, &comp_summary);
-	g_free ((char *)comp_summary.value);
+	g_free ((gchar *)comp_summary.value);
 
 	tmp = weather_info_get_forecast (report);
 	comp_summary.value = weather_info_get_weather_summary (report);
@@ -400,7 +400,7 @@ create_weather (ECalBackendWeather *cbw, WeatherInfo *report, gboolean is_foreca
 	description->altrep = "";
 	text_list = g_slist_append (text_list, description);
 	e_cal_component_set_description_list (cal_comp, text_list);
-	g_free ((char *)comp_summary.value);
+	g_free ((gchar *)comp_summary.value);
 
 	/* Set category and visibility */
 	e_cal_component_set_categories (cal_comp, getCategory (report));
@@ -423,7 +423,7 @@ e_cal_backend_weather_is_read_only (ECalBackendSync *backend, EDataCal *cal, gbo
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_cal_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_weather_get_cal_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/* Weather has no particular email addresses associated with it */
 	*address = NULL;
@@ -432,7 +432,7 @@ e_cal_backend_weather_get_cal_address (ECalBackendSync *backend, EDataCal *cal,
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_weather_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/* Weather has no particular email addresses associated with it */
 	*address = NULL;
@@ -441,7 +441,7 @@ e_cal_backend_weather_get_alarm_email_address (ECalBackendSync *backend, EDataCa
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
+e_cal_backend_weather_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, gchar **attribute)
 {
 	*attribute = NULL;
 
@@ -449,7 +449,7 @@ e_cal_backend_weather_get_ldap_attribute (ECalBackendSync *backend, EDataCal *ca
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
+e_cal_backend_weather_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, gchar **capabilities)
 {
 	*capabilities = g_strdup (CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT ","
 				  CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS  ","
@@ -463,11 +463,11 @@ e_cal_backend_weather_get_static_capabilities (ECalBackendSync *backend, EDataCa
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists, const char *username, const char *password)
+e_cal_backend_weather_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists, const gchar *username, const gchar *password)
 {
 	ECalBackendWeather *cbw;
 	ECalBackendWeatherPrivate *priv;
-	const char *uri;
+	const gchar *uri;
 
 	cbw = E_CAL_BACKEND_WEATHER (backend);
 	priv = cbw->priv;
@@ -524,25 +524,25 @@ e_cal_backend_weather_remove (ECalBackendSync *backend, EDataCal *cal)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
+e_cal_backend_weather_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 	return GNOME_Evolution_Calendar_Success;
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_weather_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj)
 {
 	return GNOME_Evolution_Calendar_PermissionDenied;
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
+e_cal_backend_weather_get_default_object (ECalBackendSync *backend, EDataCal *cal, gchar **object)
 {
 	return GNOME_Evolution_Calendar_UnsupportedMethod;
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
+e_cal_backend_weather_get_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, gchar **object)
 {
 	ECalBackendWeather *cbw = E_CAL_BACKEND_WEATHER (backend);
 	ECalBackendWeatherPrivate *priv = cbw->priv;
@@ -561,7 +561,7 @@ e_cal_backend_weather_get_object (ECalBackendSync *backend, EDataCal *cal, const
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp_string, GList **objects)
+e_cal_backend_weather_get_object_list (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp_string, GList **objects)
 {
 	ECalBackendWeather *cbw = E_CAL_BACKEND_WEATHER (backend);
 	ECalBackendWeatherPrivate *priv = cbw->priv;
@@ -586,7 +586,7 @@ e_cal_backend_weather_get_object_list (ECalBackendSync *backend, EDataCal *cal,
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
+e_cal_backend_weather_get_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object)
 {
 	ECalBackendWeather *cbw;
 	ECalBackendWeatherPrivate *priv;
@@ -612,13 +612,13 @@ e_cal_backend_weather_get_timezone (ECalBackendSync *backend, EDataCal *cal, con
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_weather_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	ECalBackendWeather *cbw;
 	ECalBackendWeatherPrivate *priv;
 	icalcomponent *tz_comp;
 	icaltimezone *zone;
-	char *tzid;
+	gchar *tzid;
 
 	cbw = (ECalBackendWeather*) backend;
 
@@ -647,7 +647,7 @@ e_cal_backend_weather_add_timezone (ECalBackendSync *backend, EDataCal *cal, con
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_weather_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendWeather *cbw;
@@ -683,7 +683,7 @@ e_cal_backend_weather_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GL
 	/* Weather doesn't count as busy time */
 	icalcomponent *vfb = icalcomponent_new_vfreebusy ();
 	icaltimezone *utc_zone = icaltimezone_get_utc_timezone ();
-	char *calobj;
+	gchar *calobj;
 
 	icalcomponent_set_dtstart (vfb, icaltime_from_timet_with_zone (start, FALSE, utc_zone));
 	icalcomponent_set_dtend (vfb, icaltime_from_timet_with_zone (end, FALSE, utc_zone));
@@ -696,7 +696,7 @@ e_cal_backend_weather_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GL
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_weather_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id, GList **adds, GList **modifies, GList **deletes)
+e_cal_backend_weather_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id, GList **adds, GList **modifies, GList **deletes)
 {
 	return GNOME_Evolution_Calendar_Success;
 }
@@ -823,7 +823,7 @@ e_cal_backend_weather_internal_get_default_timezone (ECalBackend *backend)
 }
 
 static icaltimezone *
-e_cal_backend_weather_internal_get_timezone (ECalBackend *backend, const char *tzid)
+e_cal_backend_weather_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
 	icaltimezone *zone;
 	if (!strcmp (tzid, "UTC"))
diff --git a/calendar/backends/weather/e-weather-source-ccf.c b/calendar/backends/weather/e-weather-source-ccf.c
index f107219..b66d2d2 100644
--- a/calendar/backends/weather/e-weather-source-ccf.c
+++ b/calendar/backends/weather/e-weather-source-ccf.c
@@ -56,8 +56,8 @@
 
 struct search_struct
 {
-	const char *code;
-	const char *name;
+	const gchar *code;
+	const gchar *name;
 	gboolean is_old;
 	WeatherLocation *location;
 };
@@ -114,7 +114,7 @@ done:
 }
 
 EWeatherSource*
-e_weather_source_ccf_new (const char *uri)
+e_weather_source_ccf_new (const gchar *uri)
 {
 	/* Old URI is formatted as weather://ccf/AAA[/BBB] - AAA is the 3-letter station
 	 * code for identifying the providing station (subdirectory within the crh data
@@ -147,10 +147,10 @@ e_weather_source_ccf_new (const char *uri)
 
 #if 0
 static GSList*
-tokenize (char *buffer)
+tokenize (gchar *buffer)
 {
-	char *token;
-	char *tokbuf;
+	gchar *token;
+	gchar *tokbuf;
 	GSList *ret;
 
 	token = strtok_r (buffer, " \n", &tokbuf);
@@ -161,9 +161,9 @@ tokenize (char *buffer)
 }
 
 static void
-date2tm (char *date, struct tm *times)
+date2tm (gchar *date, struct tm *times)
 {
-	char tmp[3];
+	gchar tmp[3];
 	time_t curtime = time(NULL);
 	tmp[2] = '\0';
 
@@ -178,7 +178,7 @@ date2tm (char *date, struct tm *times)
 }
 
 static WeatherConditions
-decodeConditions (char code)
+decodeConditions (gchar code)
 {
 	switch (code) {
 		case 'A': return WEATHER_FAIR;
@@ -213,9 +213,9 @@ decodeConditions (char code)
 }
 
 static int
-decodePOP (char data)
+decodePOP (gchar data)
 {
-	int ret;
+	gint ret;
 
 	switch (data) {
 		case '-':
@@ -234,9 +234,9 @@ decodePOP (char data)
 }
 
 static void
-decodeSnowfall (char *data, float *low, float *high)
+decodeSnowfall (gchar *data, float *low, float *high)
 {
-	char num[3];
+	gchar num[3];
 	num[2] = '\0';
 
 	num[0] = data[0]; num[1] = data[1];
@@ -246,16 +246,16 @@ decodeSnowfall (char *data, float *low, float *high)
 }
 
 static float
-ftoc (char *data)
+ftoc (gchar *data)
 {
-	int fahrenheit = atoi(data);
+	gint fahrenheit = atoi(data);
 	if (fahrenheit >= 900)
 		fahrenheit = (fahrenheit - 900) * -1;
 	return ((float)(fahrenheit-32)) * 5.0f / 9.0f;
 }
 
 static void
-e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
+e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, gchar *buffer)
 {
 	/* CCF gives us either 2 or 7 days of forecast data. IFPS WFO's
 	 * will produce 7 day forecasts, whereas pre-IFPS WFO's are only
@@ -273,7 +273,7 @@ e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
 	GSList *current = tokens;
 	GList *fc = NULL;
 	struct tm tms;
-	int i;
+	gint i;
 	time_t base;
 	gint n;
 
@@ -286,8 +286,8 @@ e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
 		current = g_slist_next (current);
 	current = g_slist_next (current);
 	/* pick up the first two conditions reports */
-	forecasts[0].conditions = decodeConditions (((char*)(current->data))[0]);
-	forecasts[1].conditions = decodeConditions (((char*)(current->data))[1]);
+	forecasts[0].conditions = decodeConditions (((gchar *)(current->data))[0]);
+	forecasts[1].conditions = decodeConditions (((gchar *)(current->data))[1]);
 
 	current = g_slist_next (current);
 	if (tms.tm_hour < 12) {
@@ -299,8 +299,8 @@ e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
 		}
 		forecasts[2].high = ftoc (current->data);
 		current = g_slist_next (current);
-		forecasts[0].pop = decodePOP (((char*)(current->data))[2]);
-		forecasts[1].pop = decodePOP (((char*)(current->data))[4]);
+		forecasts[0].pop = decodePOP (((gchar *)(current->data))[2]);
+		forecasts[1].pop = decodePOP (((gchar *)(current->data))[4]);
 	} else {
 		for (i = 0; i < 2; i++) {
 			current = g_slist_next (current);
@@ -309,8 +309,8 @@ e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
 			forecasts[i].low  = ftoc (current->data);
 		}
 		current = g_slist_next (current);
-		forecasts[0].pop = decodePOP (((char*)(current->data))[1]);
-		forecasts[1].pop = decodePOP (((char*)(current->data))[3]);
+		forecasts[0].pop = decodePOP (((gchar *)(current->data))[1]);
+		forecasts[1].pop = decodePOP (((gchar *)(current->data))[3]);
 	}
 
 	current = g_slist_next (current);
@@ -344,11 +344,11 @@ e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
 	}
 
 	/* Grab the conditions for the next 5 days */
-	forecasts[2].conditions = decodeConditions (((char*)(current->data))[0]);
-	forecasts[3].conditions = decodeConditions (((char*)(current->data))[1]);
-	forecasts[4].conditions = decodeConditions (((char*)(current->data))[2]);
-	forecasts[5].conditions = decodeConditions (((char*)(current->data))[3]);
-	forecasts[6].conditions = decodeConditions (((char*)(current->data))[4]);
+	forecasts[2].conditions = decodeConditions (((gchar *)(current->data))[0]);
+	forecasts[3].conditions = decodeConditions (((gchar *)(current->data))[1]);
+	forecasts[4].conditions = decodeConditions (((gchar *)(current->data))[2]);
+	forecasts[5].conditions = decodeConditions (((gchar *)(current->data))[3]);
+	forecasts[6].conditions = decodeConditions (((gchar *)(current->data))[4]);
 
 	/* Temperature forecasts */
 	current = g_slist_next (current);
@@ -364,11 +364,11 @@ e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
 		forecasts[6].high = ftoc (current->data);
 		forecasts[6].low  = forecasts[6].high;
 		current = g_slist_next (current);
-		forecasts[2].pop = decodePOP (((char*)(current->data))[1]);
-		forecasts[3].pop = decodePOP (((char*)(current->data))[3]);
-		forecasts[4].pop = decodePOP (((char*)(current->data))[5]);
-		forecasts[5].pop = decodePOP (((char*)(current->data))[7]);
-		forecasts[6].pop = decodePOP (((char*)(current->data))[9]);
+		forecasts[2].pop = decodePOP (((gchar *)(current->data))[1]);
+		forecasts[3].pop = decodePOP (((gchar *)(current->data))[3]);
+		forecasts[4].pop = decodePOP (((gchar *)(current->data))[5]);
+		forecasts[5].pop = decodePOP (((gchar *)(current->data))[7]);
+		forecasts[6].pop = decodePOP (((gchar *)(current->data))[9]);
 		n = 7;
 	} else {
 		for (i = 2; i < 6; i++) {
@@ -381,11 +381,11 @@ e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
 		/* hack for people who put out bad data, like Pueblo, CO. Yes, PUB, that means you */
 		if (strlen (current->data) == 3)
 			current = g_slist_next (current);
-		forecasts[1].pop = decodePOP (((char*)(current->data))[0]);
-		forecasts[2].pop = decodePOP (((char*)(current->data))[2]);
-		forecasts[3].pop = decodePOP (((char*)(current->data))[4]);
-		forecasts[4].pop = decodePOP (((char*)(current->data))[6]);
-		forecasts[5].pop = decodePOP (((char*)(current->data))[8]);
+		forecasts[1].pop = decodePOP (((gchar *)(current->data))[0]);
+		forecasts[2].pop = decodePOP (((gchar *)(current->data))[2]);
+		forecasts[3].pop = decodePOP (((gchar *)(current->data))[4]);
+		forecasts[4].pop = decodePOP (((gchar *)(current->data))[6]);
+		forecasts[5].pop = decodePOP (((gchar *)(current->data))[8]);
 	}
 
 	for (i = 0; i < n; i++) {
diff --git a/calendar/backends/weather/e-weather-source-ccf.h b/calendar/backends/weather/e-weather-source-ccf.h
index 8e479b9..ad697f8 100644
--- a/calendar/backends/weather/e-weather-source-ccf.h
+++ b/calendar/backends/weather/e-weather-source-ccf.h
@@ -55,7 +55,7 @@ struct _EWeatherSourceCCFClass {
 	EWeatherSourceClass parent_class;
 };
 
-EWeatherSource*	e_weather_source_ccf_new (const char *uri);
+EWeatherSource*	e_weather_source_ccf_new (const gchar *uri);
 GType		e_weather_source_ccf_get_type (void);
 
 G_END_DECLS
diff --git a/calendar/backends/weather/e-weather-source.c b/calendar/backends/weather/e-weather-source.c
index 39637c1..6ab8bc9 100644
--- a/calendar/backends/weather/e-weather-source.c
+++ b/calendar/backends/weather/e-weather-source.c
@@ -66,9 +66,9 @@ e_weather_source_get_type (void)
 	return e_weather_source_type;
 }
 
-EWeatherSource*	e_weather_source_new (const char *uri)
+EWeatherSource*	e_weather_source_new (const gchar *uri)
 {
-	const char *base = uri + 10; /* skip weather:// */
+	const gchar *base = uri + 10; /* skip weather:// */
 
 	return e_weather_source_ccf_new (base);
 }
diff --git a/calendar/backends/weather/e-weather-source.h b/calendar/backends/weather/e-weather-source.h
index bc4b234..175d9fa 100644
--- a/calendar/backends/weather/e-weather-source.h
+++ b/calendar/backends/weather/e-weather-source.h
@@ -84,7 +84,7 @@ struct _EWeatherSourceClass {
 	void (*parse)	(EWeatherSource *source, EWeatherSourceFinished done, gpointer data);
 };
 
-EWeatherSource*	e_weather_source_new (const char *uri);
+EWeatherSource*	e_weather_source_new (const gchar *uri);
 GType	e_weather_source_get_type (void);
 void	e_weather_source_parse (EWeatherSource *source, EWeatherSourceFinished done, gpointer data);
 
diff --git a/calendar/libecal/e-cal-check-timezones.c b/calendar/libecal/e-cal-check-timezones.c
index ee14b8e..2ce1467 100644
--- a/calendar/libecal/e-cal-check-timezones.c
+++ b/calendar/libecal/e-cal-check-timezones.c
@@ -31,12 +31,12 @@
  * Currently simply strips a suffix introduced by a hyphen,
  * as in "America/Denver-(Standard)".
  */
-static const char *e_cal_match_location(const char *location)
+static const gchar *e_cal_match_location(const gchar *location)
 {
     icaltimezone *icomp;
-    const char *tail;
+    const gchar *tail;
     size_t len;
-    char *buffer;
+    gchar *buffer;
 
     icomp = icaltimezone_get_builtin_timezone (location);
     if (icomp) {
@@ -66,10 +66,10 @@ static const char *e_cal_match_location(const char *location)
  * matches a TZID against the system timezone definitions
  * and returns the matching TZID, or NULL if none found
  */
-const char *e_cal_match_tzid(const char *tzid)
+const gchar *e_cal_match_tzid(const gchar *tzid)
 {
-    const char *location;
-    const char *systzid;
+    const gchar *location;
+    const gchar *systzid;
     size_t len = strlen(tzid);
     ssize_t eostr;
 
@@ -90,7 +90,7 @@ const char *e_cal_match_tzid(const char *tzid)
         eostr--;
     }
     if (eostr + 1 < len) {
-        char *strippedtzid = g_strndup(tzid, eostr + 1);
+        gchar *strippedtzid = g_strndup(tzid, eostr + 1);
         if (strippedtzid) {
             systzid = e_cal_match_tzid(strippedtzid);
             g_free(strippedtzid);
@@ -125,7 +125,7 @@ const char *e_cal_match_tzid(const char *tzid)
 static void patch_tzids(icalcomponent *subcomp,
                         GHashTable *mapping)
 {
-    char *tzid = NULL;
+    gchar *tzid = NULL;
 
     if (icalcomponent_isa(subcomp) != ICAL_VTIMEZONE_COMPONENT) {
         icalproperty *prop = icalcomponent_get_first_property(subcomp,
@@ -134,8 +134,8 @@ static void patch_tzids(icalcomponent *subcomp,
             icalparameter *param = icalproperty_get_first_parameter(prop,
                                                                     ICAL_TZID_PARAMETER);
             while (param) {
-                const char *oldtzid;
-                const char *newtzid;
+                const gchar *oldtzid;
+                const gchar *newtzid;
 
                 g_free(tzid);
                 tzid = g_strdup(icalparameter_get_tzid(param));
@@ -165,7 +165,7 @@ static void addsystemtz(gpointer key,
                         gpointer value,
                         gpointer user_data)
 {
-    const char *tzid = key;
+    const gchar *tzid = key;
     icalcomponent *comp = user_data;
     icaltimezone *zone;
 
@@ -230,19 +230,19 @@ static void addsystemtz(gpointer key,
  */
 gboolean e_cal_check_timezones(icalcomponent *comp,
                                GList *comps,
-                               icaltimezone *(*tzlookup)(const char *tzid,
-                                                         const void *custom,
+                               icaltimezone *(*tzlookup)(const gchar *tzid,
+                                                         gconstpointer custom,
                                                          GError **error),
-                               const void *custom,
+                               gconstpointer custom,
                                GError **error)
 {
     gboolean success = TRUE;
     icalcomponent *subcomp = NULL;
     icaltimezone *zone = icaltimezone_new();
-    char *key = NULL, *value = NULL;
-    char *buffer = NULL;
-    char *zonestr = NULL;
-    char *tzid = NULL;
+    gchar *key = NULL, *value = NULL;
+    gchar *buffer = NULL;
+    gchar *zonestr = NULL;
+    gchar *tzid = NULL;
     GList *l;
 
     /** a hash from old to new tzid; strings dynamically allocated */
@@ -265,7 +265,7 @@ gboolean e_cal_check_timezones(icalcomponent *comp,
             g_free(tzid);
             tzid = g_strdup(icaltimezone_get_tzid(zone));
             if (tzid) {
-                const char *newtzid = e_cal_match_tzid(tzid);
+                const gchar *newtzid = e_cal_match_tzid(tzid);
                 if (newtzid) {
                     /* matched against system time zone */
                     g_free(key);
@@ -285,7 +285,7 @@ gboolean e_cal_check_timezones(icalcomponent *comp,
                     key =
                         value = NULL;
                 } else {
-                    int counter;
+                    gint counter;
 
                     zonestr = icalcomponent_as_ical_string_r(subcomp);
 
@@ -313,10 +313,10 @@ gboolean e_cal_check_timezones(icalcomponent *comp,
                         buffer = icalcomponent_as_ical_string_r(icaltimezone_get_component(existing_zone));
 
                         if (counter) {
-                            char *fulltzid = g_strdup_printf("TZID:%s", value);
+                            gchar *fulltzid = g_strdup_printf("TZID:%s", value);
                             size_t baselen = strlen("TZID:") + strlen(tzid);
                             size_t fulllen = strlen(fulltzid);
-                            char *tzidprop;
+                            gchar *tzidprop;
                             /*
                              * Map TZID with counter suffix back to basename.
                              */
@@ -436,8 +436,8 @@ gboolean e_cal_check_timezones(icalcomponent *comp,
  * An implementation of the tzlookup callback which clients
  * can use. Calls #e_cal_get_timezone.
  */
-icaltimezone *e_cal_tzlookup_ecal(const char *tzid,
-                                  const void *custom,
+icaltimezone *e_cal_tzlookup_ecal(const gchar *tzid,
+                                  gconstpointer custom,
                                   GError **error)
 {
     ECal *ecal = (ECal *)custom;
@@ -470,11 +470,11 @@ icaltimezone *e_cal_tzlookup_ecal(const char *tzid,
  * like the file backend can use. Searches for the timezone
  * in the component list.
  */
-icaltimezone *e_cal_tzlookup_icomp(const char *tzid,
-                                   const void *custom,
+icaltimezone *e_cal_tzlookup_icomp(const gchar *tzid,
+                                   gconstpointer custom,
                                    GError **error)
 {
     icalcomponent *icomp = (icalcomponent *)custom;
 
-    return icalcomponent_get_timezone(icomp, (char *)tzid);
+    return icalcomponent_get_timezone(icomp, (gchar *)tzid);
 }
diff --git a/calendar/libecal/e-cal-check-timezones.h b/calendar/libecal/e-cal-check-timezones.h
index a19f644..f2b8bfc 100644
--- a/calendar/libecal/e-cal-check-timezones.h
+++ b/calendar/libecal/e-cal-check-timezones.h
@@ -27,21 +27,21 @@ G_BEGIN_DECLS
 
 gboolean e_cal_check_timezones(icalcomponent *comp,
                                GList *comps,
-                               icaltimezone *(*tzlookup)(const char *tzid,
-                                                         const void *custom,
+                               icaltimezone *(*tzlookup)(const gchar *tzid,
+                                                         gconstpointer custom,
                                                          GError **error),
-                               const void *custom,
+                               gconstpointer custom,
                                GError **error);
 
-icaltimezone *e_cal_tzlookup_ecal(const char *tzid,
-                                  const void *custom,
+icaltimezone *e_cal_tzlookup_ecal(const gchar *tzid,
+                                  gconstpointer custom,
                                   GError **error);
 
-icaltimezone *e_cal_tzlookup_icomp(const char *tzid,
-                                   const void *custom,
+icaltimezone *e_cal_tzlookup_icomp(const gchar *tzid,
+                                   gconstpointer custom,
                                    GError **error);
 
-const char *e_cal_match_tzid(const char *tzid);
+const gchar *e_cal_match_tzid(const gchar *tzid);
 
 G_END_DECLS
 
diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c
index c8addbc..e62a5b8 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -413,17 +413,17 @@ e_cal_component_finalize (GObject *object)
  * Return value: A unique identifier string.  Every time this function is called
  * a different string is returned.
  **/
-char *
+gchar *
 e_cal_component_gen_uid (void)
 {
-        char *iso, *ret;
-	static char *hostname;
+        gchar *iso, *ret;
+	static gchar *hostname;
 	time_t t = time (NULL);
-	static int serial;
+	static gint serial;
 
 	if (!hostname) {
 #ifndef G_OS_WIN32
-		static char buffer [512];
+		static gchar buffer [512];
 
 		if ((gethostname (buffer, sizeof (buffer) - 1) == 0) &&
 		    (buffer [0] != 0))
@@ -473,7 +473,7 @@ e_cal_component_new (void)
  * success, NULL if there was an error.
  **/
 ECalComponent *
-e_cal_component_new_from_string (const char *calobj)
+e_cal_component_new_from_string (const gchar *calobj)
 {
 	ECalComponent *comp;
 	icalcomponent *icalcomp;
@@ -802,10 +802,10 @@ scan_property (ECalComponent *comp, icalproperty *prop)
 }
 
 /* Gets our alarm UID string from a property that is known to contain it */
-static const char *
+static const gchar *
 alarm_uid_from_prop (icalproperty *prop)
 {
-	const char *xstr;
+	const gchar *xstr;
 
 	g_assert (icalproperty_isa (prop) == ICAL_X_PROPERTY);
 
@@ -818,15 +818,15 @@ alarm_uid_from_prop (icalproperty *prop)
 /* Sets our alarm UID extension property on an alarm component.  Returns a
  * pointer to the UID string inside the property itself.
  */
-static const char *
-set_alarm_uid (icalcomponent *alarm, const char *auid)
+static const gchar *
+set_alarm_uid (icalcomponent *alarm, const gchar *auid)
 {
 	icalproperty *prop;
-	const char *inprop_auid;
+	const gchar *inprop_auid;
 
 	/* Create the new property */
 
-	prop = icalproperty_new_x ((char *) auid);
+	prop = icalproperty_new_x ((gchar *) auid);
 	icalproperty_set_x_name (prop, EVOLUTION_ALARM_UID_PROPERTY);
 
 	icalcomponent_add_property (alarm, prop);
@@ -847,7 +847,7 @@ remove_alarm_uid (icalcomponent *alarm)
 	for (prop = icalcomponent_get_first_property (alarm, ICAL_X_PROPERTY);
 	     prop;
 	     prop = icalcomponent_get_next_property (alarm, ICAL_X_PROPERTY)) {
-		const char *xname;
+		const gchar *xname;
 
 		xname = icalproperty_get_x_name (prop);
 		g_assert (xname != NULL);
@@ -870,8 +870,8 @@ remove_alarm_uid (icalcomponent *alarm)
  * this function will change it if the table already had an alarm subcomponent
  * with the specified UID.  Returns the actual UID used.
  */
-static const char *
-add_alarm (ECalComponent *comp, icalcomponent *alarm, const char *auid)
+static const gchar *
+add_alarm (ECalComponent *comp, icalcomponent *alarm, const gchar *auid)
 {
 	ECalComponentPrivate *priv;
 	icalcomponent *old_alarm;
@@ -885,7 +885,7 @@ add_alarm (ECalComponent *comp, icalcomponent *alarm, const char *auid)
 
 	old_alarm = g_hash_table_lookup (priv->alarm_uid_hash, auid);
 	if (old_alarm != NULL) {
-		char *new_auid;
+		gchar *new_auid;
 
 		g_message ("add_alarm(): Got alarm with duplicated UID `%s', changing it...", auid);
 
@@ -896,7 +896,7 @@ add_alarm (ECalComponent *comp, icalcomponent *alarm, const char *auid)
 		g_free (new_auid);
 	}
 
-	g_hash_table_insert (priv->alarm_uid_hash, (char *) auid, alarm);
+	g_hash_table_insert (priv->alarm_uid_hash, (gchar *) auid, alarm);
 	return auid;
 }
 
@@ -907,15 +907,15 @@ scan_alarm (ECalComponent *comp, icalcomponent *alarm)
 {
 	ECalComponentPrivate *priv;
 	icalproperty *prop;
-	const char *auid;
-	char *new_auid;
+	const gchar *auid;
+	gchar *new_auid;
 
 	priv = comp->priv;
 
 	for (prop = icalcomponent_get_first_property (alarm, ICAL_X_PROPERTY);
 	     prop;
 	     prop = icalcomponent_get_next_property (alarm, ICAL_X_PROPERTY)) {
-		const char *xname;
+		const gchar *xname;
 
 		xname = icalproperty_get_x_name (prop);
 		g_assert (xname != NULL);
@@ -982,7 +982,7 @@ ensure_mandatory_properties (ECalComponent *comp)
 	g_assert (priv->icalcomp != NULL);
 
 	if (!priv->uid) {
-		char *uid;
+		gchar *uid;
 
 		uid = e_cal_component_gen_uid ();
 		priv->uid = icalproperty_new_uid (uid);
@@ -1248,11 +1248,11 @@ e_cal_component_get_vtype (ECalComponent *comp)
  * Return value: String representation of the calendar component according to
  * RFC 2445.
  **/
-char *
+gchar *
 e_cal_component_get_as_string (ECalComponent *comp)
 {
 	ECalComponentPrivate *priv;
-	char *str;
+	gchar *str;
 
 	g_return_val_if_fail (comp != NULL, NULL);
 	g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), NULL);
@@ -1279,7 +1279,7 @@ ensure_alarm_properties_cb (gpointer key, gpointer value, gpointer data)
 	icalcomponent *alarm;
 	icalproperty *prop;
 	enum icalproperty_action action;
-	const char *str;
+	const gchar *str;
 
 	alarm = value;
 
@@ -1380,7 +1380,7 @@ e_cal_component_commit_sequence (ECalComponent *comp)
 		return;
 
 	if (priv->sequence) {
-		int seq;
+		gint seq;
 
 		seq = icalproperty_get_sequence (priv->sequence);
 		icalproperty_set_sequence (priv->sequence, seq + 1);
@@ -1453,7 +1453,7 @@ e_cal_component_get_id (ECalComponent *comp)
  * Queries the unique identifier of a calendar component object.
  **/
 void
-e_cal_component_get_uid (ECalComponent *comp, const char **uid)
+e_cal_component_get_uid (ECalComponent *comp, const gchar **uid)
 {
 	ECalComponentPrivate *priv;
 
@@ -1478,7 +1478,7 @@ e_cal_component_get_uid (ECalComponent *comp, const char **uid)
  * Sets the unique identifier string of a calendar component object.
  **/
 void
-e_cal_component_set_uid (ECalComponent *comp, const char *uid)
+e_cal_component_set_uid (ECalComponent *comp, const gchar *uid)
 {
 	ECalComponentPrivate *priv;
 
@@ -1492,7 +1492,7 @@ e_cal_component_set_uid (ECalComponent *comp, const char *uid)
 	/* This MUST exist, since we ensured that it did */
 	g_assert (priv->uid != NULL);
 
-	icalproperty_set_uid (priv->uid, (char *) uid);
+	icalproperty_set_uid (priv->uid, (gchar *) uid);
 }
 
 /* Gets a text list value */
@@ -1508,9 +1508,9 @@ get_attachment_list (GSList *attachment_list, GSList **al)
 
 	for (l = attachment_list; l; l = l->next) {
 		struct attachment *attachment;
-		const char *data;
+		const gchar *data;
 		size_t buf_size;
-		char *buf = NULL;
+		gchar *buf = NULL;
 
 		attachment = l->data;
 		g_assert (attachment->attach != NULL);
@@ -1527,7 +1527,7 @@ get_attachment_list (GSList *attachment_list, GSList **al)
 		}
 		else
 			data = NULL;
-		*al = g_slist_prepend (*al, (char *)buf);
+		*al = g_slist_prepend (*al, (gchar *)buf);
 	}
 
 	*al = g_slist_reverse (*al);
@@ -1565,13 +1565,13 @@ set_attachment_list (icalcomponent *icalcomp,
 	for (l = al; l; l = l->next) {
 		struct attachment *attachment;
 		size_t buf_size;
-		char *buf;
+		gchar *buf;
 
 		attachment = g_new0 (struct attachment, 1);
-		buf_size = 2 * strlen ((char *)l->data);
+		buf_size = 2 * strlen ((gchar *)l->data);
 		buf = g_malloc0 (buf_size);
 		icalvalue_encode_ical_string (l->data, buf, buf_size);
-		attachment->attach = icalattach_new_from_url ((char *) buf);
+		attachment->attach = icalattach_new_from_url ((gchar *) buf);
 		attachment->prop = icalproperty_new_attach (attachment->attach);
 		icalcomponent_add_property (icalcomp, attachment->prop);
 		g_free (buf);
@@ -1661,7 +1661,7 @@ e_cal_component_has_attachments (ECalComponent *comp)
  *
  * Return value: the number of attachments.
  */
-int
+gint
 e_cal_component_get_num_attachments (ECalComponent *comp)
 {
 	ECalComponentPrivate *priv;
@@ -1685,7 +1685,7 @@ e_cal_component_get_num_attachments (ECalComponent *comp)
  * a comma-separated list of all categories set in the component.
  **/
 void
-e_cal_component_get_categories (ECalComponent *comp, const char **categories)
+e_cal_component_get_categories (ECalComponent *comp, const gchar **categories)
 {
 	ECalComponentPrivate *priv;
 
@@ -1710,7 +1710,7 @@ e_cal_component_get_categories (ECalComponent *comp, const char **categories)
  * Sets the list of categories for a calendar component.
  **/
 void
-e_cal_component_set_categories (ECalComponent *comp, const char *categories)
+e_cal_component_set_categories (ECalComponent *comp, const gchar *categories)
 {
 	ECalComponentPrivate *priv;
 
@@ -1731,9 +1731,9 @@ e_cal_component_set_categories (ECalComponent *comp, const char *categories)
 	}
 
 	if (priv->categories)
-		icalproperty_set_categories (priv->categories, (char *) categories);
+		icalproperty_set_categories (priv->categories, (gchar *) categories);
 	else {
-		priv->categories = icalproperty_new_categories ((char *) categories);
+		priv->categories = icalproperty_new_categories ((gchar *) categories);
 		icalcomponent_add_property (priv->icalcomp, priv->categories);
 	}
 }
@@ -1752,10 +1752,10 @@ void
 e_cal_component_get_categories_list (ECalComponent *comp, GSList **categ_list)
 {
 	ECalComponentPrivate *priv;
-	const char *categories;
-	const char *p;
-	const char *cat_start;
-	char *str;
+	const gchar *categories;
+	const gchar *p;
+	const gchar *cat_start;
+	gchar *str;
 
 	g_return_if_fail (comp != NULL);
 	g_return_if_fail (E_IS_CAL_COMPONENT (comp));
@@ -1790,12 +1790,12 @@ e_cal_component_get_categories_list (ECalComponent *comp, GSList **categ_list)
 }
 
 /* Creates a comma-delimited string of categories */
-static char *
+static gchar *
 stringify_categories (GSList *categ_list)
 {
 	GString *s;
 	GSList *l;
-	char *str;
+	gchar *str;
 
 	s = g_string_new (NULL);
 
@@ -1823,7 +1823,7 @@ void
 e_cal_component_set_categories_list (ECalComponent *comp, GSList *categ_list)
 {
 	ECalComponentPrivate *priv;
-	char *categories_str;
+	gchar *categories_str;
 
 	g_return_if_fail (comp != NULL);
 	g_return_if_fail (E_IS_CAL_COMPONENT (comp));
@@ -1956,7 +1956,7 @@ e_cal_component_set_classification (ECalComponent *comp, ECalComponentClassifica
 /* Gets a text list value */
 static void
 get_text_list (GSList *text_list,
-	       const char *(* get_prop_func) (const icalproperty *prop),
+	       const gchar *(* get_prop_func) (const icalproperty *prop),
 	       GSList **tl)
 {
 	GSList *l;
@@ -1990,7 +1990,7 @@ get_text_list (GSList *text_list,
 /* Sets a text list value */
 static void
 set_text_list (ECalComponent *comp,
-	       icalproperty *(* new_prop_func) (const char *value),
+	       icalproperty *(* new_prop_func) (const gchar *value),
 	       GSList **text_list,
 	       GSList *tl)
 {
@@ -2026,11 +2026,11 @@ set_text_list (ECalComponent *comp,
 
 		text = g_new (struct text, 1);
 
-		text->prop = (* new_prop_func) ((char *) t->value);
+		text->prop = (* new_prop_func) ((gchar *) t->value);
 		icalcomponent_add_property (priv->icalcomp, text->prop);
 
 		if (t->altrep) {
-			text->altrep_param = icalparameter_new_altrep ((char *) t->altrep);
+			text->altrep_param = icalparameter_new_altrep ((gchar *) t->altrep);
 			icalproperty_add_parameter (text->prop, text->altrep_param);
 		} else
 			text->altrep_param = NULL;
@@ -2399,9 +2399,9 @@ set_datetime (ECalComponent *comp, struct datetime *datetime,
 		g_assert (datetime->prop != NULL);
 
 		if (datetime->tzid_param) {
-			icalparameter_set_tzid (datetime->tzid_param, (char *) dt->tzid);
+			icalparameter_set_tzid (datetime->tzid_param, (gchar *) dt->tzid);
 		} else {
-			datetime->tzid_param = icalparameter_new_tzid ((char *) dt->tzid);
+			datetime->tzid_param = icalparameter_new_tzid ((gchar *) dt->tzid);
 			icalproperty_add_parameter (datetime->prop, datetime->tzid_param);
 		}
 	} else if (datetime->tzid_param) {
@@ -2925,7 +2925,7 @@ e_cal_component_set_exdate_list (ECalComponent *comp, GSList *exdate_list)
 		dt->prop = icalproperty_new_exdate (*cdt->value);
 
 		if (cdt->tzid) {
-			dt->tzid_param = icalparameter_new_tzid ((char *) cdt->tzid);
+			dt->tzid_param = icalparameter_new_tzid ((gchar *) cdt->tzid);
 			icalproperty_add_parameter (dt->prop, dt->tzid_param);
 		} else
 			dt->tzid_param = NULL;
@@ -3325,9 +3325,9 @@ e_cal_component_set_organizer (ECalComponent *comp, ECalComponentOrganizer *orga
 	g_return_if_fail (organizer->value != NULL);
 
 	if (priv->organizer.prop)
-		icalproperty_set_organizer (priv->organizer.prop, (char *) organizer->value);
+		icalproperty_set_organizer (priv->organizer.prop, (gchar *) organizer->value);
 	else {
-		priv->organizer.prop = icalproperty_new_organizer ((char *) organizer->value);
+		priv->organizer.prop = icalproperty_new_organizer ((gchar *) organizer->value);
 		icalcomponent_add_property (priv->icalcomp, priv->organizer.prop);
 	}
 
@@ -3336,10 +3336,10 @@ e_cal_component_set_organizer (ECalComponent *comp, ECalComponentOrganizer *orga
 
 		if (priv->organizer.sentby_param)
 			icalparameter_set_sentby (priv->organizer.sentby_param,
-						  (char *) organizer->sentby);
+						  (gchar *) organizer->sentby);
 		else {
 			priv->organizer.sentby_param = icalparameter_new_sentby (
-				(char *) organizer->sentby);
+				(gchar *) organizer->sentby);
 			icalproperty_add_parameter (priv->organizer.prop,
 						    priv->organizer.sentby_param);
 		}
@@ -3353,10 +3353,10 @@ e_cal_component_set_organizer (ECalComponent *comp, ECalComponentOrganizer *orga
 
 		if (priv->organizer.cn_param)
 			icalparameter_set_cn (priv->organizer.cn_param,
-						  (char *) organizer->cn);
+						  (gchar *) organizer->cn);
 		else {
 			priv->organizer.cn_param = icalparameter_new_cn (
-				(char *) organizer->cn);
+				(gchar *) organizer->cn);
 			icalproperty_add_parameter (priv->organizer.prop,
 						    priv->organizer.cn_param);
 		}
@@ -3370,10 +3370,10 @@ e_cal_component_set_organizer (ECalComponent *comp, ECalComponentOrganizer *orga
 
 		if (priv->organizer.language_param)
 			icalparameter_set_language (priv->organizer.language_param,
-						  (char *) organizer->language);
+						  (gchar *) organizer->language);
 		else {
 			priv->organizer.language_param = icalparameter_new_language (
-				(char *) organizer->language);
+				(gchar *) organizer->language);
 			icalproperty_add_parameter (priv->organizer.prop,
 						    priv->organizer.language_param);
 		}
@@ -3416,7 +3416,7 @@ e_cal_component_has_organizer (ECalComponent *comp)
  * Queries the percent-complete property of a calendar component object.
  **/
 void
-e_cal_component_get_percent (ECalComponent *comp, int **percent)
+e_cal_component_get_percent (ECalComponent *comp, gint **percent)
 {
 	ECalComponentPrivate *priv;
 
@@ -3435,7 +3435,7 @@ e_cal_component_get_percent (ECalComponent *comp, int **percent)
 }
 
 void
-e_cal_component_set_percent_as_int (ECalComponent *comp, int percent)
+e_cal_component_set_percent_as_int (ECalComponent *comp, gint percent)
 {
 	ECalComponentPrivate *priv;
 
@@ -3467,11 +3467,11 @@ e_cal_component_set_percent_as_int (ECalComponent *comp, int percent)
 
 }
 
-int
+gint
 e_cal_component_get_percent_as_int (ECalComponent *comp)
 {
 	ECalComponentPrivate *priv;
-	int percent;
+	gint percent;
 
 	priv = comp->priv;
 	g_return_val_if_fail (priv->icalcomp != NULL, -1);
@@ -3492,7 +3492,7 @@ e_cal_component_get_percent_as_int (ECalComponent *comp)
  * Sets the percent-complete property of a calendar component object.
  **/
 void
-e_cal_component_set_percent (ECalComponent *comp, int *percent)
+e_cal_component_set_percent (ECalComponent *comp, gint *percent)
 {
 	ECalComponentPrivate *priv;
 
@@ -3531,7 +3531,7 @@ e_cal_component_set_percent (ECalComponent *comp, int *percent)
  * Queries the priority property of a calendar component object.
  **/
 void
-e_cal_component_get_priority (ECalComponent *comp, int **priority)
+e_cal_component_get_priority (ECalComponent *comp, gint **priority)
 {
 	ECalComponentPrivate *priv;
 
@@ -3557,7 +3557,7 @@ e_cal_component_get_priority (ECalComponent *comp, int **priority)
  * Sets the priority property of a calendar component object.
  **/
 void
-e_cal_component_set_priority (ECalComponent *comp, int *priority)
+e_cal_component_set_priority (ECalComponent *comp, gint *priority)
 {
 	ECalComponentPrivate *priv;
 
@@ -3619,7 +3619,7 @@ e_cal_component_get_recurid (ECalComponent *comp, ECalComponentRange *recur_id)
  *
  * Return value: the recurrence ID as a string.
  */
-char *
+gchar *
 e_cal_component_get_recurid_as_string (ECalComponent *comp)
 {
         ECalComponentRange range;
@@ -3846,9 +3846,9 @@ e_cal_component_has_recurrences (ECalComponent *comp)
 
 /* Counts the elements in the by_xxx fields of an icalrecurrencetype */
 static int
-count_by_xxx (short *field, int max_elements)
+count_by_xxx (short *field, gint max_elements)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < max_elements; i++)
 		if (field[i] == ICAL_RECURRENCE_ARRAY_MAX)
@@ -3871,10 +3871,10 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
 {
 	GSList *rrule_list;
 	struct icalrecurrencetype *r;
-	int n_by_second, n_by_minute, n_by_hour;
-	int n_by_day, n_by_month_day, n_by_year_day;
-	int n_by_week_no, n_by_month, n_by_set_pos;
-	int len, i;
+	gint n_by_second, n_by_minute, n_by_hour;
+	gint n_by_day, n_by_month_day, n_by_year_day;
+	gint n_by_week_no, n_by_month, n_by_set_pos;
+	gint len, i;
 	gboolean simple = FALSE;
 
 	if (!e_cal_component_has_recurrences (comp))
@@ -3936,7 +3936,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
 			goto cleanup;
 
 		for (i = 0; i < 8 && r->by_day[i] != ICAL_RECURRENCE_ARRAY_MAX; i++) {
-			int pos;
+			gint pos;
 			pos = icalrecurrencetype_day_position (r->by_day[i]);
 
 			if (pos != 0)
@@ -3954,7 +3954,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
 			goto cleanup;
 
 		if (n_by_month_day == 1) {
-			int nth;
+			gint nth;
 
 			if (n_by_set_pos != 0)
 				goto cleanup;
@@ -3967,7 +3967,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
 
 		} else if (n_by_day == 1) {
 			enum icalrecurrencetype_weekday weekday;
-			int pos;
+			gint pos;
 
 			/* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not
 			   accept BYDAY=2TU. So we now use the same as Outlook
@@ -4057,7 +4057,7 @@ e_cal_component_is_instance (ECalComponent *comp)
  * Queries the sequence number of a calendar component object.
  **/
 void
-e_cal_component_get_sequence (ECalComponent *comp, int **sequence)
+e_cal_component_get_sequence (ECalComponent *comp, gint **sequence)
 {
 	ECalComponentPrivate *priv;
 
@@ -4087,7 +4087,7 @@ e_cal_component_get_sequence (ECalComponent *comp, int **sequence)
  * automatically at the proper times.
  **/
 void
-e_cal_component_set_sequence (ECalComponent *comp, int *sequence)
+e_cal_component_set_sequence (ECalComponent *comp, gint *sequence)
 {
 	ECalComponentPrivate *priv;
 
@@ -4215,8 +4215,8 @@ e_cal_component_get_summary (ECalComponent *comp, ECalComponentText *summary)
 }
 
 typedef struct {
-	const char *old_summary;
-	const char *new_summary;
+	const gchar *old_summary;
+	const gchar *new_summary;
 } SetAlarmDescriptionData;
 
 static void
@@ -4226,7 +4226,7 @@ set_alarm_description_cb (gpointer key, gpointer value, gpointer user_data)
 	icalproperty *icalprop, *desc_prop;
 	SetAlarmDescriptionData *sadd;
 	gboolean changed = FALSE;
-	const char *old_summary = NULL;
+	const gchar *old_summary = NULL;
 
 	alarm = value;
 	sadd = user_data;
@@ -4241,7 +4241,7 @@ set_alarm_description_cb (gpointer key, gpointer value, gpointer user_data)
 	/* remove the X-EVOLUTION-NEEDS_DESCRIPTION property */
 	icalprop = icalcomponent_get_first_property (alarm, ICAL_X_PROPERTY);
 	while (icalprop) {
-		const char *x_name;
+		const gchar *x_name;
 
 		x_name = icalproperty_get_x_name (icalprop);
 		if (!strcmp (x_name, "X-EVOLUTION-NEEDS-DESCRIPTION")) {
@@ -4298,10 +4298,10 @@ e_cal_component_set_summary (ECalComponent *comp, ECalComponentText *summary)
 
 	if (priv->summary.prop) {
 		sadd.old_summary = icalproperty_get_summary (priv->summary.prop);
-		icalproperty_set_summary (priv->summary.prop, (char *) summary->value);
+		icalproperty_set_summary (priv->summary.prop, (gchar *) summary->value);
 	} else {
 		sadd.old_summary = NULL;
-		priv->summary.prop = icalproperty_new_summary ((char *) summary->value);
+		priv->summary.prop = icalproperty_new_summary ((gchar *) summary->value);
 		icalcomponent_add_property (priv->icalcomp, priv->summary.prop);
 	}
 
@@ -4310,10 +4310,10 @@ e_cal_component_set_summary (ECalComponent *comp, ECalComponentText *summary)
 
 		if (priv->summary.altrep_param)
 			icalparameter_set_altrep (priv->summary.altrep_param,
-						  (char *) summary->altrep);
+						  (gchar *) summary->altrep);
 		else {
 			priv->summary.altrep_param = icalparameter_new_altrep (
-				(char *) summary->altrep);
+				(gchar *) summary->altrep);
 			icalproperty_add_parameter (priv->summary.prop,
 						    priv->summary.altrep_param);
 		}
@@ -4433,7 +4433,7 @@ e_cal_component_set_transparency (ECalComponent *comp, ECalComponentTransparency
  * Queries the uniform resource locator property of a calendar component object.
  **/
 void
-e_cal_component_get_url (ECalComponent *comp, const char **url)
+e_cal_component_get_url (ECalComponent *comp, const gchar **url)
 {
 	ECalComponentPrivate *priv;
 
@@ -4458,7 +4458,7 @@ e_cal_component_get_url (ECalComponent *comp, const char **url)
  * Sets the uniform resource locator property of a calendar component object.
  **/
 void
-e_cal_component_set_url (ECalComponent *comp, const char *url)
+e_cal_component_set_url (ECalComponent *comp, const gchar *url)
 {
 	ECalComponentPrivate *priv;
 
@@ -4479,9 +4479,9 @@ e_cal_component_set_url (ECalComponent *comp, const char *url)
 	}
 
 	if (priv->url)
-		icalproperty_set_url (priv->url, (char *) url);
+		icalproperty_set_url (priv->url, (gchar *) url);
 	else {
-		priv->url = icalproperty_new_url ((char *) url);
+		priv->url = icalproperty_new_url ((gchar *) url);
 		icalcomponent_add_property (priv->icalcomp, priv->url);
 	}
 }
@@ -4705,7 +4705,7 @@ e_cal_component_has_attendees (ECalComponent *comp)
  * Queries the location property of a calendar component object.
  **/
 void
-e_cal_component_get_location (ECalComponent *comp, const char **location)
+e_cal_component_get_location (ECalComponent *comp, const gchar **location)
 {
 	ECalComponentPrivate *priv;
 
@@ -4730,7 +4730,7 @@ e_cal_component_get_location (ECalComponent *comp, const char **location)
  * Sets the location property of a calendar component object.
  **/
 void
-e_cal_component_set_location (ECalComponent *comp, const char *location)
+e_cal_component_set_location (ECalComponent *comp, const gchar *location)
 {
 	ECalComponentPrivate *priv;
 
@@ -4751,9 +4751,9 @@ e_cal_component_set_location (ECalComponent *comp, const char *location)
 	}
 
 	if (priv->location)
-		icalproperty_set_location (priv->location, (char *) location);
+		icalproperty_set_location (priv->location, (gchar *) location);
 	else {
-		priv->location = icalproperty_new_location ((char *) location);
+		priv->location = icalproperty_new_location ((gchar *) location);
 		icalcomponent_add_property (priv->icalcomp, priv->location);
 	}
 }
@@ -4789,7 +4789,7 @@ e_cal_component_free_datetime (ECalComponentDateTime *dt)
 	g_return_if_fail (dt != NULL);
 
 	g_free (dt->value);
-	g_free ((char*)dt->tzid);
+	g_free ((gchar *)dt->tzid);
 
 	dt->value = NULL;
 	dt->tzid = NULL;
@@ -4829,7 +4829,7 @@ e_cal_component_free_exdate_list (GSList *exdate_list)
 
 		g_assert (cdt->value != NULL);
 		g_free (cdt->value);
-		g_free ((char*)cdt->tzid);
+		g_free ((gchar *)cdt->tzid);
 
 		g_free (cdt);
 	}
@@ -4875,7 +4875,7 @@ e_cal_component_free_icaltimetype (struct icaltimetype *t)
  * function.
  **/
 void
-e_cal_component_free_percent (int *percent)
+e_cal_component_free_percent (gint *percent)
 {
 	g_return_if_fail (percent != NULL);
 
@@ -4890,7 +4890,7 @@ e_cal_component_free_percent (int *percent)
  * function.
  **/
 void
-e_cal_component_free_priority (int *priority)
+e_cal_component_free_priority (gint *priority)
 {
 	g_return_if_fail (priority != NULL);
 
@@ -4950,7 +4950,7 @@ e_cal_component_free_recur_list (GSList *recur_list)
  * Frees a sequence number value.
  **/
 void
-e_cal_component_free_sequence (int *sequence)
+e_cal_component_free_sequence (gint *sequence)
 {
 	g_return_if_fail (sequence != NULL);
 
@@ -5095,7 +5095,7 @@ e_cal_component_add_alarm (ECalComponent *comp, ECalComponentAlarm *alarm)
  * function.
  **/
 void
-e_cal_component_remove_alarm (ECalComponent *comp, const char *auid)
+e_cal_component_remove_alarm (ECalComponent *comp, const gchar *auid)
 {
 	ECalComponentPrivate *priv;
 	icalcomponent *alarm;
@@ -5159,7 +5159,7 @@ static void
 scan_alarm_property (ECalComponentAlarm *alarm, icalproperty *prop)
 {
 	icalproperty_kind kind;
-	const char *xname;
+	const gchar *xname;
 
 	kind = icalproperty_isa (prop);
 
@@ -5274,13 +5274,13 @@ e_cal_component_get_alarm_uids (ECalComponent *comp)
 		for (prop = icalcomponent_get_first_property (subcomp, ICAL_X_PROPERTY);
 		     prop;
 		     prop = icalcomponent_get_next_property (subcomp, ICAL_X_PROPERTY)) {
-			const char *xname;
+			const gchar *xname;
 
 			xname = icalproperty_get_x_name (prop);
 			g_assert (xname != NULL);
 
 			if (strcmp (xname, EVOLUTION_ALARM_UID_PROPERTY) == 0) {
-				const char *auid;
+				const gchar *auid;
 
 				auid = alarm_uid_from_prop (prop);
 				l = g_list_append (l, g_strdup (auid));
@@ -5303,7 +5303,7 @@ e_cal_component_get_alarm_uids (ECalComponent *comp)
  * e_cal_component_alarm_free().
  **/
 ECalComponentAlarm *
-e_cal_component_get_alarm (ECalComponent *comp, const char *auid)
+e_cal_component_get_alarm (ECalComponent *comp, const gchar *auid)
 {
 	ECalComponentPrivate *priv;
 	icalcomponent *alarm;
@@ -5364,7 +5364,7 @@ ECalComponentAlarm *
 e_cal_component_alarm_new (void)
 {
 	ECalComponentAlarm *alarm;
-	char *new_auid ;
+	gchar *new_auid ;
 
 	alarm = g_new (ECalComponentAlarm, 1);
 
@@ -5452,7 +5452,7 @@ e_cal_component_alarm_free (ECalComponentAlarm *alarm)
  *
  * Return value: UID of the alarm.
  **/
-const char *
+const gchar *
 e_cal_component_alarm_get_uid (ECalComponentAlarm *alarm)
 {
 	g_return_val_if_fail (alarm != NULL, NULL);
@@ -5664,7 +5664,7 @@ e_cal_component_alarm_set_description (ECalComponentAlarm *alarm, ECalComponentT
 
 	if (description->altrep) {
 		alarm->description.altrep_param = icalparameter_new_altrep (
-			(char *) description->altrep);
+			(gchar *) description->altrep);
 		icalproperty_add_parameter (alarm->description.prop,
 					    alarm->description.altrep_param);
 	}
diff --git a/calendar/libecal/e-cal-component.h b/calendar/libecal/e-cal-component.h
index 4bf5c7f..2d2ad22 100644
--- a/calendar/libecal/e-cal-component.h
+++ b/calendar/libecal/e-cal-component.h
@@ -37,8 +37,8 @@ G_BEGIN_DECLS
 #define E_IS_CAL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_COMPONENT))
 
 typedef struct {
-	char *uid;
-	char *rid;
+	gchar *uid;
+	gchar *rid;
 } ECalComponentId;
 
 /* Types of calendar components to be stored by a ECalComponent, as per RFC 2445.
@@ -102,7 +102,7 @@ typedef struct {
 	struct icaltimetype *value;
 
 	/* Timezone ID */
-	const char *tzid;
+	const gchar *tzid;
 } ECalComponentDateTime;
 
 /* Way in which a period of time is specified */
@@ -139,10 +139,10 @@ typedef struct {
 /* Text properties */
 typedef struct {
 	/* Description string */
-	const char *value;
+	const gchar *value;
 
 	/* Alternate representation URI */
-	const char *altrep;
+	const gchar *altrep;
 } ECalComponentText;
 
 /* Time transparency */
@@ -155,26 +155,26 @@ typedef enum {
 
 /* Organizer & Attendee */
 typedef struct {
-	const char *value;
+	const gchar *value;
 
-	const char *member;
+	const gchar *member;
 	icalparameter_cutype cutype;
 	icalparameter_role role;
 	icalparameter_partstat status;
 	gboolean rsvp;
 
-	const char *delto;
-	const char *delfrom;
-	const char *sentby;
-	const char *cn;
-	const char *language;
+	const gchar *delto;
+	const gchar *delfrom;
+	const gchar *sentby;
+	const gchar *cn;
+	const gchar *language;
 } ECalComponentAttendee;
 
 typedef struct {
-	const char *value;
-	const char *sentby;
-	const char *cn;
-	const char *language;
+	const gchar *value;
+	const gchar *sentby;
+	const gchar *cn;
+	const gchar *language;
 } ECalComponentOrganizer;
 
 /* Main calendar component object */
@@ -199,11 +199,11 @@ struct _ECalComponentClass {
 
 GType e_cal_component_get_type (void);
 
-char *e_cal_component_gen_uid (void);
+gchar *e_cal_component_gen_uid (void);
 
 ECalComponent *e_cal_component_new (void);
 
-ECalComponent *e_cal_component_new_from_string (const char *calobj);
+ECalComponent *e_cal_component_new_from_string (const gchar *calobj);
 
 ECalComponent *e_cal_component_clone (ECalComponent *comp);
 
@@ -216,19 +216,19 @@ void e_cal_component_strip_errors (ECalComponent *comp);
 
 ECalComponentVType e_cal_component_get_vtype (ECalComponent *comp);
 
-char *e_cal_component_get_as_string (ECalComponent *comp);
+gchar *e_cal_component_get_as_string (ECalComponent *comp);
 
 void e_cal_component_commit_sequence (ECalComponent *comp);
 void e_cal_component_abort_sequence (ECalComponent *comp);
 
-void e_cal_component_get_uid (ECalComponent *comp, const char **uid);
-void e_cal_component_set_uid (ECalComponent *comp, const char *uid);
+void e_cal_component_get_uid (ECalComponent *comp, const gchar **uid);
+void e_cal_component_set_uid (ECalComponent *comp, const gchar *uid);
 
 ECalComponentId *e_cal_component_get_id (ECalComponent *comp);
 void e_cal_component_free_id (ECalComponentId *id);
 
-void e_cal_component_get_categories (ECalComponent *comp, const char **categories);
-void e_cal_component_set_categories (ECalComponent *comp, const char *categories);
+void e_cal_component_get_categories (ECalComponent *comp, const gchar **categories);
+void e_cal_component_set_categories (ECalComponent *comp, const gchar *categories);
 void e_cal_component_get_categories_list (ECalComponent *comp, GSList **categ_list);
 void e_cal_component_set_categories_list (ECalComponent *comp, GSList *categ_list);
 
@@ -283,17 +283,17 @@ void e_cal_component_get_organizer (ECalComponent *comp, ECalComponentOrganizer
 void e_cal_component_set_organizer (ECalComponent *comp, ECalComponentOrganizer *organizer);
 gboolean e_cal_component_has_organizer (ECalComponent *comp);
 
-int  e_cal_component_get_percent_as_int (ECalComponent *comp);
-void e_cal_component_set_percent_as_int (ECalComponent *comp, int percent);
+gint  e_cal_component_get_percent_as_int (ECalComponent *comp);
+void e_cal_component_set_percent_as_int (ECalComponent *comp, gint percent);
 
-void e_cal_component_get_percent (ECalComponent *comp, int **percent);
-void e_cal_component_set_percent (ECalComponent *comp, int *percent);
+void e_cal_component_get_percent (ECalComponent *comp, gint **percent);
+void e_cal_component_set_percent (ECalComponent *comp, gint *percent);
 
-void e_cal_component_get_priority (ECalComponent *comp, int **priority);
-void e_cal_component_set_priority (ECalComponent *comp, int *priority);
+void e_cal_component_get_priority (ECalComponent *comp, gint **priority);
+void e_cal_component_set_priority (ECalComponent *comp, gint *priority);
 
 void e_cal_component_get_recurid (ECalComponent *comp, ECalComponentRange *recur_id);
-char *e_cal_component_get_recurid_as_string (ECalComponent *comp);
+gchar *e_cal_component_get_recurid_as_string (ECalComponent *comp);
 void e_cal_component_set_recurid (ECalComponent *comp, ECalComponentRange *recur_id);
 
 void e_cal_component_get_rdate_list (ECalComponent *comp, GSList **period_list);
@@ -309,8 +309,8 @@ gboolean e_cal_component_has_recurrences (ECalComponent *comp);
 gboolean e_cal_component_has_simple_recurrence (ECalComponent *comp);
 gboolean e_cal_component_is_instance (ECalComponent *comp);
 
-void e_cal_component_get_sequence (ECalComponent *comp, int **sequence);
-void e_cal_component_set_sequence (ECalComponent *comp, int *sequence);
+void e_cal_component_get_sequence (ECalComponent *comp, gint **sequence);
+void e_cal_component_set_sequence (ECalComponent *comp, gint *sequence);
 
 void e_cal_component_get_status (ECalComponent *comp, icalproperty_status *status);
 void e_cal_component_set_status (ECalComponent *comp, icalproperty_status status);
@@ -321,21 +321,21 @@ void e_cal_component_set_summary (ECalComponent *comp, ECalComponentText *summar
 void e_cal_component_get_transparency (ECalComponent *comp, ECalComponentTransparency *transp);
 void e_cal_component_set_transparency (ECalComponent *comp, ECalComponentTransparency transp);
 
-void e_cal_component_get_url (ECalComponent *comp, const char **url);
-void e_cal_component_set_url (ECalComponent *comp, const char *url);
+void e_cal_component_get_url (ECalComponent *comp, const gchar **url);
+void e_cal_component_set_url (ECalComponent *comp, const gchar *url);
 
 void e_cal_component_get_attendee_list (ECalComponent *comp, GSList **attendee_list);
 void e_cal_component_set_attendee_list (ECalComponent *comp, GSList *attendee_list);
 gboolean e_cal_component_has_attendees (ECalComponent *comp);
 
-void e_cal_component_get_location (ECalComponent *comp, const char **location);
-void e_cal_component_set_location (ECalComponent *comp, const char *location);
+void e_cal_component_get_location (ECalComponent *comp, const gchar **location);
+void e_cal_component_set_location (ECalComponent *comp, const gchar *location);
 
 /* Attachment handling */
 void e_cal_component_get_attachment_list (ECalComponent *comp, GSList **attachment_list);
 void e_cal_component_set_attachment_list (ECalComponent *comp, GSList *attachment_list);
 gboolean e_cal_component_has_attachments (ECalComponent *comp);
-int e_cal_component_get_num_attachments (ECalComponent *comp);
+gint e_cal_component_get_num_attachments (ECalComponent *comp);
 
 
 gboolean e_cal_component_event_dates_match (ECalComponent *comp1, ECalComponent *comp2);
@@ -349,11 +349,11 @@ void e_cal_component_free_range (ECalComponentRange *range);
 void e_cal_component_free_exdate_list (GSList *exdate_list);
 void e_cal_component_free_geo (struct icalgeotype *geo);
 void e_cal_component_free_icaltimetype (struct icaltimetype *t);
-void e_cal_component_free_percent (int *percent);
-void e_cal_component_free_priority (int *priority);
+void e_cal_component_free_percent (gint *percent);
+void e_cal_component_free_priority (gint *priority);
 void e_cal_component_free_period_list (GSList *period_list);
 void e_cal_component_free_recur_list (GSList *recur_list);
-void e_cal_component_free_sequence (int *sequence);
+void e_cal_component_free_sequence (gint *sequence);
 void e_cal_component_free_text_list (GSList *text_list);
 void e_cal_component_free_attendee_list (GSList *attendee_list);
 
@@ -365,7 +365,7 @@ typedef struct _ECalComponentAlarm ECalComponentAlarm;
 /* An alarm occurrence, i.e. a trigger instance */
 typedef struct {
 	/* UID of the alarm that triggered */
-	char *auid;
+	gchar *auid;
 
 	/* Trigger time, i.e. "5 minutes before the appointment" */
 	time_t trigger;
@@ -415,7 +415,7 @@ typedef struct {
 
 typedef struct {
 	/* Number of extra repetitions, zero for none */
-	int repetitions;
+	gint repetitions;
 
 	/* Interval between repetitions */
 	struct icaldurationtype duration;
@@ -423,11 +423,11 @@ typedef struct {
 
 gboolean e_cal_component_has_alarms (ECalComponent *comp);
 void e_cal_component_add_alarm (ECalComponent *comp, ECalComponentAlarm *alarm);
-void e_cal_component_remove_alarm (ECalComponent *comp, const char *auid);
+void e_cal_component_remove_alarm (ECalComponent *comp, const gchar *auid);
 void e_cal_component_remove_all_alarms (ECalComponent *comp);
 
 GList *e_cal_component_get_alarm_uids (ECalComponent *comp);
-ECalComponentAlarm *e_cal_component_get_alarm (ECalComponent *comp, const char *auid);
+ECalComponentAlarm *e_cal_component_get_alarm (ECalComponent *comp, const gchar *auid);
 
 void e_cal_component_alarms_free (ECalComponentAlarms *alarms);
 
@@ -436,7 +436,7 @@ ECalComponentAlarm *e_cal_component_alarm_new (void);
 ECalComponentAlarm *e_cal_component_alarm_clone (ECalComponentAlarm *alarm);
 void e_cal_component_alarm_free (ECalComponentAlarm *alarm);
 
-const char *e_cal_component_alarm_get_uid (ECalComponentAlarm *alarm);
+const gchar *e_cal_component_alarm_get_uid (ECalComponentAlarm *alarm);
 
 void e_cal_component_alarm_get_action (ECalComponentAlarm *alarm, ECalComponentAlarmAction *action);
 void e_cal_component_alarm_set_action (ECalComponentAlarm *alarm, ECalComponentAlarmAction action);
diff --git a/calendar/libecal/e-cal-listener.c b/calendar/libecal/e-cal-listener.c
index a201f1a..cbaaa8a 100644
--- a/calendar/libecal/e-cal-listener.c
+++ b/calendar/libecal/e-cal-listener.c
@@ -325,7 +325,7 @@ impl_notifyObjectsSent (PortableServer_Servant servant,
 	ECalListener *listener;
 	ECalListenerPrivate *priv;
 	GList *users = NULL;
-	int i;
+	gint i;
 
 	listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
 	priv = listener->priv;
@@ -382,7 +382,7 @@ static GList *
 build_object_list (const GNOME_Evolution_Calendar_stringlist *seq)
 {
 	GList *list;
-	int i;
+	gint i;
 
 	list = NULL;
 	for (i = 0; i < seq->_length; i++) {
@@ -432,7 +432,7 @@ impl_notifyAttachmentListRequested (PortableServer_Servant servant,
 	ECalListener *listener;
 	ECalListenerPrivate *priv;
 	GSList *a_list = NULL;
-	int i;
+	gint i;
 
 	listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
 	priv = listener->priv;
@@ -508,7 +508,7 @@ build_change_list (const GNOME_Evolution_Calendar_CalObjChangeSeq *seq)
 {
 	GList *list = NULL;
 	icalcomponent *icalcomp;
-	int i;
+	gint i;
 
 	/* Create the list in reverse order */
 	for (i = 0; i < seq->_length; i++) {
@@ -567,7 +567,7 @@ static GList *
 build_free_busy_list (const GNOME_Evolution_Calendar_CalObjSeq *seq)
 {
 	GList *list = NULL;
-	int i;
+	gint i;
 
 	/* Create the list in reverse order */
 	for (i = 0; i < seq->_length; i++) {
diff --git a/calendar/libecal/e-cal-listener.h b/calendar/libecal/e-cal-listener.h
index 23c8ec8..7bd6721 100644
--- a/calendar/libecal/e-cal-listener.h
+++ b/calendar/libecal/e-cal-listener.h
@@ -53,32 +53,32 @@ typedef struct {
 
 	/* Signals */
 	void (*read_only) (ECalListener *listener, ECalendarStatus status, gboolean read_only);
-	void (*cal_address) (ECalListener *listener, ECalendarStatus status, const char *address);
-	void (*alarm_address) (ECalListener *listener, ECalendarStatus status, const char *address);
-	void (*ldap_attribute) (ECalListener *listener, ECalendarStatus status, const char *ldap_attribute);
-	void (*static_capabilities) (ECalListener *listener, ECalendarStatus status, const char *capabilities);
+	void (*cal_address) (ECalListener *listener, ECalendarStatus status, const gchar *address);
+	void (*alarm_address) (ECalListener *listener, ECalendarStatus status, const gchar *address);
+	void (*ldap_attribute) (ECalListener *listener, ECalendarStatus status, const gchar *ldap_attribute);
+	void (*static_capabilities) (ECalListener *listener, ECalendarStatus status, const gchar *capabilities);
 
 	void (*open) (ECalListener *listener, ECalendarStatus status);
 	void (*remove) (ECalListener *listener, ECalendarStatus status);
 
-	void (*create_object) (ECalListener *listener, ECalendarStatus status, const char *id);
+	void (*create_object) (ECalListener *listener, ECalendarStatus status, const gchar *id);
 	void (*modify_object) (ECalListener *listener, ECalendarStatus status);
 	void (*remove_object) (ECalListener *listener, ECalendarStatus status);
 
 	void (*discard_alarm) (ECalListener *listener, ECalendarStatus status);
 
 	void (*receive_objects) (ECalListener *listener, ECalendarStatus status);
-	void (*send_objects) (ECalListener *listener, ECalendarStatus status, GList *users, const char *object);
+	void (*send_objects) (ECalListener *listener, ECalendarStatus status, GList *users, const gchar *object);
 
-	void (*default_object) (ECalListener *listener, ECalendarStatus status, const char *object);
-	void (*object) (ECalListener *listener, ECalendarStatus status, const char *object);
+	void (*default_object) (ECalListener *listener, ECalendarStatus status, const gchar *object);
+	void (*object) (ECalListener *listener, ECalendarStatus status, const gchar *object);
 	void (*object_list) (ECalListener *listener, ECalendarStatus status, GList **objects);
 
 	void (*attachment_list) (ECalListener *listener, ECalendarStatus status, GSList **objects);
 
-	void (*get_timezone) (ECalListener *listener, ECalendarStatus status, const char *object);
-	void (*add_timezone) (ECalListener *listener, ECalendarStatus status, const char *tzid);
-	void (*set_default_timezone) (ECalListener *listener, ECalendarStatus status, const char *tzid);
+	void (*get_timezone) (ECalListener *listener, ECalendarStatus status, const gchar *object);
+	void (*add_timezone) (ECalListener *listener, ECalendarStatus status, const gchar *tzid);
+	void (*set_default_timezone) (ECalListener *listener, ECalendarStatus status, const gchar *tzid);
 
 	void (*get_changes) (ECalListener *listener, ECalendarStatus status, GList *changes);
 	void (*get_free_busy) (ECalListener *listener, ECalendarStatus status, GList *freebusy);
@@ -86,7 +86,7 @@ typedef struct {
 	void (*query) (ECalListener *listener, ECalendarStatus status, GNOME_Evolution_Calendar_CalView query);
 
 	void (*auth_required)      (ECalListener *listener);
-	void (*backend_error) (ECalListener *listener, ECalendarStatus status, const char *message);
+	void (*backend_error) (ECalListener *listener, ECalendarStatus status, const gchar *message);
 } ECalListenerClass;
 
 /* Notification functions */
diff --git a/calendar/libecal/e-cal-recur.c b/calendar/libecal/e-cal-recur.c
index bfb326d..1785fb0 100644
--- a/calendar/libecal/e-cal-recur.c
+++ b/calendar/libecal/e-cal-recur.c
@@ -122,7 +122,7 @@
 typedef struct {
 	icalrecurrencetype_frequency freq;
 
-	int            interval;
+	gint            interval;
 
 	/* Specifies the end of the recurrence, inclusive. No occurrences are
 	   generated after this date. If it is 0, the event recurs forever. */
@@ -481,8 +481,8 @@ static void cal_obj_time_find_first_week	(CalObjTime *cotime,
 static void cal_object_time_from_time		(CalObjTime *cotime,
 						 time_t      t,
 						 icaltimezone *zone);
-static gint cal_obj_date_only_compare_func	(const void *arg1,
-						 const void *arg2);
+static gint cal_obj_date_only_compare_func	(gconstpointer arg1,
+						 gconstpointer arg2);
 
 
 
@@ -507,7 +507,7 @@ static void e_cal_recur_set_rule_end_date		(icalproperty	*prop,
 
 
 #ifdef CAL_OBJ_DEBUG
-static char* cal_obj_time_to_string		(CalObjTime	*cotime);
+static gchar * cal_obj_time_to_string		(CalObjTime	*cotime);
 #endif
 
 
@@ -906,10 +906,10 @@ e_cal_recur_generate_instances_of_rule (ECalComponent	 *comp,
  * struct icalrecurrencetype.
  */
 static GList *
-array_to_list (short *array, int max_elements)
+array_to_list (short *array, gint max_elements)
 {
 	GList *l;
-	int i;
+	gint i;
 
 	l = NULL;
 
@@ -995,7 +995,7 @@ e_cal_recur_from_icalproperty (icalproperty *prop, gboolean exception,
 				    sizeof (ir.by_month) / sizeof (ir.by_month[0]));
 	for (elem = r->bymonth; elem; elem = elem->next) {
 		/* We need to convert from 1-12 to 0-11, i.e. subtract 1. */
-		int month = GPOINTER_TO_INT (elem->data) - 1;
+		gint month = GPOINTER_TO_INT (elem->data) - 1;
 		elem->data = GINT_TO_POINTER (month);
 	}
 
@@ -1939,7 +1939,7 @@ cal_obj_sort_occurrences (GArray *occs)
 static void
 cal_obj_remove_duplicates_and_invalid_dates (GArray *occs)
 {
-	static const int days_in_month[12] = {
+	static const gint days_in_month[12] = {
 		31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
 	};
 
@@ -3618,8 +3618,8 @@ cal_obj_time_compare		(CalObjTime *cotime1,
 /* This is the same as the above function, but without the comparison type.
    It is used for qsort(). */
 static gint
-cal_obj_time_compare_func (const void *arg1,
-			   const void *arg2)
+cal_obj_time_compare_func (gconstpointer arg1,
+			   gconstpointer arg2)
 {
 	CalObjTime *cotime1, *cotime2;
 	gint retval;
@@ -3670,8 +3670,8 @@ cal_obj_time_compare_func (const void *arg1,
 
 
 static gint
-cal_obj_date_only_compare_func (const void *arg1,
-				const void *arg2)
+cal_obj_date_only_compare_func (gconstpointer arg1,
+				gconstpointer arg2)
 {
 	CalObjTime *cotime1, *cotime2;
 
@@ -3817,11 +3817,11 @@ cal_object_time_from_time	(CalObjTime	*cotime,
 /* Debugging function to convert a CalObjTime to a string. It uses a static
    buffer so beware. */
 #ifdef CAL_OBJ_DEBUG
-static char*
+static gchar *
 cal_obj_time_to_string		(CalObjTime	*cotime)
 {
-	static char buffer[20];
-	char *weekdays[] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
+	static gchar buffer[20];
+	gchar *weekdays[] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
 			     "   " };
 	gint weekday;
 
@@ -3958,7 +3958,7 @@ e_cal_recur_get_rule_end_date	(icalproperty	*prop,
 				 icaltimezone	*default_timezone)
 {
 	icalparameter *param;
-	const char *xname, *xvalue;
+	const gchar *xname, *xvalue;
 	icalvalue *value;
 	struct icaltimetype icaltime;
 	icaltimezone *zone;
@@ -3997,8 +3997,8 @@ e_cal_recur_set_rule_end_date	(icalproperty	*prop,
 	icalvalue *value;
 	icaltimezone *utc_zone;
 	struct icaltimetype icaltime;
-	const char *xname;
-	char *end_date_string;
+	const gchar *xname;
+	gchar *end_date_string;
 
 	/* We save the value as a UTC DATE-TIME. */
 	utc_zone = icaltimezone_get_utc_timezone ();
@@ -4037,7 +4037,7 @@ static
  * An array of 31 translated strings for each day of the month (i.e. "1st",
  * "2nd", and so on).
  */
-const char *e_cal_recur_nth[31] = {
+const gchar *e_cal_recur_nth[31] = {
 	N_("1st"),
 	N_("2nd"),
 	N_("3rd"),
@@ -4081,7 +4081,7 @@ const char *e_cal_recur_nth[31] = {
  *
  * Returns: a pointer to an array of strings.  This array is static, do not free it.
  */
-const char **
+const gchar **
 e_cal_get_recur_nth (void)
 {
 	return e_cal_recur_nth;
diff --git a/calendar/libecal/e-cal-recur.h b/calendar/libecal/e-cal-recur.h
index 2ec3254..f80d3c2 100644
--- a/calendar/libecal/e-cal-recur.h
+++ b/calendar/libecal/e-cal-recur.h
@@ -33,7 +33,7 @@ typedef gboolean (* ECalRecurInstanceFn) (ECalComponent *comp,
 					 time_t        instance_end,
 					 gpointer      data);
 
-typedef icaltimezone* (* ECalRecurResolveTimezoneFn)	(const char   *tzid,
+typedef icaltimezone* (* ECalRecurResolveTimezoneFn)	(const gchar   *tzid,
 							 gpointer      data);
 
 void	e_cal_recur_generate_instances	(ECalComponent		*comp,
@@ -47,10 +47,10 @@ void	e_cal_recur_generate_instances	(ECalComponent		*comp,
 
 /* Localized nth-day-of-month strings. (Use with _() ) */
 #ifdef G_OS_WIN32
-extern const char **e_cal_get_recur_nth (void);
+extern const gchar **e_cal_get_recur_nth (void);
 #define e_cal_recur_nth (e_cal_get_recur_nth ())
 #else
-extern const char *e_cal_recur_nth[31];
+extern const gchar *e_cal_recur_nth[31];
 #endif
 
 G_END_DECLS
diff --git a/calendar/libecal/e-cal-system-timezone.c b/calendar/libecal/e-cal-system-timezone.c
index cfee41f..c0eb2e2 100644
--- a/calendar/libecal/e-cal-system-timezone.c
+++ b/calendar/libecal/e-cal-system-timezone.c
@@ -38,10 +38,10 @@
 
 #define TZ_MAGIC "TZif"
 
-static char *
-system_timezone_strip_path_if_valid (const char *filename)
+static gchar *
+system_timezone_strip_path_if_valid (const gchar *filename)
 {
-	int skip;
+	gint skip;
 
 	if (!filename || !g_str_has_prefix (filename, SYSTEM_ZONEINFODIR"/"))
 		return NULL;
@@ -61,11 +61,11 @@ system_timezone_strip_path_if_valid (const char *filename)
 }
 
 /* Read the soft symlink from /etc/localtime */
-static char *
+static gchar *
 system_timezone_read_etc_localtime_softlink (void)
 {
-	char *file;
-	char *tz;
+	gchar *file;
+	gchar *tz;
 
 	if (!g_file_test (ETC_LOCALTIME, G_FILE_TEST_IS_SYMLINK))
 		return NULL;
@@ -77,12 +77,12 @@ system_timezone_read_etc_localtime_softlink (void)
 	return tz;
 }
 
-static char *
+static gchar *
 system_timezone_read_etc_timezone (void)
 {
         FILE    *etc_timezone;
         GString *reading;
-        int      c;
+        gint      c;
 
         etc_timezone = g_fopen (ETC_TIMEZONE, "r");
         if (!etc_timezone)
@@ -109,14 +109,14 @@ system_timezone_read_etc_timezone (void)
 
 /* Read a file that looks like a key-file (but there's no need for groups)
  * and get the last value for a specific key */
-static char *
-system_timezone_read_key_file (const char *filename,
-                               const char *key)
+static gchar *
+system_timezone_read_key_file (const gchar *filename,
+                               const gchar *key)
 {
         GIOChannel *channel;
-        char       *key_eq;
-        char       *line;
-        char       *retval;
+        gchar       *key_eq;
+        gchar       *line;
+        gchar       *retval;
 
         if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR))
                 return NULL;
@@ -131,8 +131,8 @@ system_timezone_read_key_file (const char *filename,
         while (g_io_channel_read_line (channel, &line, NULL,
                                        NULL, NULL) == G_IO_STATUS_NORMAL) {
                 if (g_str_has_prefix (line, key_eq)) {
-                        char *value;
-                        int   len;
+                        gchar *value;
+                        gint   len;
 
                         value = line + strlen (key_eq);
                         g_strstrip (value);
@@ -167,7 +167,7 @@ system_timezone_read_key_file (const char *filename,
 }
 
 /* This works for Fedora and Mandriva */
-static char *
+static gchar *
 system_timezone_read_etc_sysconfig_clock (void)
 {
         return system_timezone_read_key_file (ETC_SYSCONFIG_CLOCK,
@@ -175,7 +175,7 @@ system_timezone_read_etc_sysconfig_clock (void)
 }
 
 /* This works for openSUSE */
-static char *
+static gchar *
 system_timezone_read_etc_sysconfig_clock_alt (void)
 {
         return system_timezone_read_key_file (ETC_SYSCONFIG_CLOCK,
@@ -183,7 +183,7 @@ system_timezone_read_etc_sysconfig_clock_alt (void)
 }
 
 /* This works for Solaris/OpenSolaris */
-static char *
+static gchar *
 system_timezone_read_etc_TIMEZONE (void)
 {
         return system_timezone_read_key_file (ETC_TIMEZONE_MAJ,
@@ -191,7 +191,7 @@ system_timezone_read_etc_TIMEZONE (void)
 }
 
 /* This works for Arch Linux */
-static char *
+static gchar *
 system_timezone_read_etc_rc_conf (void)
 {
         return system_timezone_read_key_file (ETC_RC_CONF,
@@ -199,7 +199,7 @@ system_timezone_read_etc_rc_conf (void)
 }
 
 /* This works for old Gentoo */
-static char *
+static gchar *
 system_timezone_read_etc_conf_d_clock (void)
 {
         return system_timezone_read_key_file (ETC_CONF_D_CLOCK,
@@ -208,13 +208,13 @@ system_timezone_read_etc_conf_d_clock (void)
 
 typedef gboolean (*CompareFiles) (struct stat *a_stat,
 				  struct stat *b_stat,
-				  const char  *a_content,
+				  const gchar  *a_content,
 				  gsize	a_content_len,
-				  const char  *b_filename);
+				  const gchar  *b_filename);
 
-static char *
+static gchar *
 recursive_compare (struct stat  *localtime_stat,
-		   const char   *localtime_content,
+		   const gchar   *localtime_content,
 		   gsize	 localtime_content_len,
 		   char	 *file,
 		   CompareFiles  compare_func)
@@ -235,9 +235,9 @@ recursive_compare (struct stat  *localtime_stat,
 			return NULL;
 	} else if (S_ISDIR (file_stat.st_mode)) {
 		GDir       *dir = NULL;
-		char       *ret = NULL;
-		const char *subfile = NULL;
-		char       *subpath = NULL;
+		gchar       *ret = NULL;
+		const gchar *subfile = NULL;
+		gchar       *subpath = NULL;
 
 		dir = g_dir_open (file, 0, NULL);
 		if (dir == NULL)
@@ -270,9 +270,9 @@ recursive_compare (struct stat  *localtime_stat,
 static gboolean
 files_are_identical_inode (struct stat *a_stat,
 			   struct stat *b_stat,
-			   const char  *a_content,
+			   const gchar  *a_content,
 			   gsize	a_content_len,
-			   const char  *b_filename)
+			   const gchar  *b_filename)
 {
 	return (a_stat->st_ino == b_stat->st_ino);
 }
@@ -280,7 +280,7 @@ files_are_identical_inode (struct stat *a_stat,
 
 /* Determine if /etc/localtime is a hard link to some file, by looking at
  * the inodes */
-static char *
+static gchar *
 system_timezone_read_etc_localtime_hardlink (void)
 {
 	struct stat stat_localtime;
@@ -301,13 +301,13 @@ system_timezone_read_etc_localtime_hardlink (void)
 static gboolean
 files_are_identical_content (struct stat *a_stat,
 			     struct stat *b_stat,
-			     const char  *a_content,
+			     const gchar  *a_content,
 			     gsize        a_content_len,
-			     const char  *b_filename)
+			     const gchar  *b_filename)
 {
-	char  *b_content = NULL;
+	gchar  *b_content = NULL;
 	gsize  b_content_len = -1;
-	int    cmp;
+	gint    cmp;
 
 	if (a_stat->st_size != b_stat->st_size)
 		return FALSE;
@@ -328,7 +328,7 @@ files_are_identical_content (struct stat *a_stat,
 }
 
 /* Determine if /etc/localtime is a copy of a timezone file */
-static char *
+static gchar *
 system_timezone_read_etc_localtime_content (void)
 {
 	struct stat  stat_localtime;
@@ -359,7 +359,7 @@ system_timezone_read_etc_localtime_content (void)
 	return retval;
 }
 
-typedef char * (*GetSystemTimezone) (void);
+typedef gchar * (*GetSystemTimezone) (void);
 /* The order of the functions here define the priority of the methods used
  * to find the timezone. First method has higher priority. */
 static GetSystemTimezone get_system_timezone_methods[] = {
@@ -381,9 +381,9 @@ static GetSystemTimezone get_system_timezone_methods[] = {
 };
 
 static gboolean
-system_timezone_is_valid (const char *tz)
+system_timezone_is_valid (const gchar *tz)
 {
-	const char *c;
+	const gchar *c;
 
 	if (!tz)
 		return FALSE;
@@ -397,11 +397,11 @@ system_timezone_is_valid (const char *tz)
 	return TRUE;
 }
 
-static char *
+static gchar *
 system_timezone_find (void)
 {
-	char *tz;
-	int   i;
+	gchar *tz;
+	gint   i;
 
 	for (i = 0; get_system_timezone_methods[i] != NULL; i++) {
 		tz = get_system_timezone_methods[i] ();
@@ -421,7 +421,7 @@ system_timezone_find (void)
  * Returns system timezone location string, NULL on an error.
  * Returned pointer should be freed with g_free().
  **/
-char *
+gchar *
 e_cal_system_timezone_get_location (void)
 {
 	return system_timezone_find ();
diff --git a/calendar/libecal/e-cal-system-timezone.h b/calendar/libecal/e-cal-system-timezone.h
index ea286a9..73b0772 100644
--- a/calendar/libecal/e-cal-system-timezone.h
+++ b/calendar/libecal/e-cal-system-timezone.h
@@ -22,6 +22,6 @@
 
 #include <libical/ical.h>
 
-char *e_cal_system_timezone_get_location (void);
+gchar *e_cal_system_timezone_get_location (void);
 
 #endif
diff --git a/calendar/libecal/e-cal-time-util.c b/calendar/libecal/e-cal-time-util.c
index 7249d1b..1120620 100644
--- a/calendar/libecal/e-cal-time-util.c
+++ b/calendar/libecal/e-cal-time-util.c
@@ -31,7 +31,7 @@
 
 /* Number of days in a month, using 0 (Jan) to 11 (Dec). For leap years,
    add 1 to February (month 1). */
-static const int days_in_month[12] = {
+static const gint days_in_month[12] = {
 	31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
 };
 
@@ -61,7 +61,7 @@ static const int days_in_month[12] = {
  * Return value: a time_t value containing @time plus the days added.
  */
 time_t
-time_add_day (time_t time, int days)
+time_add_day (time_t time, gint days)
 {
 	struct tm *tm;
 
@@ -82,7 +82,7 @@ time_add_day (time_t time, int days)
  * Return value: a time_t value containing @time plus the weeks added.
  */
 time_t
-time_add_week (time_t time, int weeks)
+time_add_week (time_t time, gint weeks)
 {
 	return time_add_day (time, weeks * 7);
 }
@@ -153,7 +153,7 @@ time_day_end (time_t t)
  * Return value: a time_t value containing @time plus the days added.
  */
 time_t
-time_add_day_with_zone (time_t time, int days, icaltimezone *zone)
+time_add_day_with_zone (time_t time, gint days, icaltimezone *zone)
 {
 	struct icaltimetype tt;
 
@@ -183,7 +183,7 @@ time_add_day_with_zone (time_t time, int days, icaltimezone *zone)
  * Return value: a time_t value containing @time plus the weeks added.
  */
 time_t
-time_add_week_with_zone (time_t time, int weeks, icaltimezone *zone)
+time_add_week_with_zone (time_t time, gint weeks, icaltimezone *zone)
 {
 	return time_add_day_with_zone (time, weeks * 7, zone);
 }
@@ -209,10 +209,10 @@ time_add_week_with_zone (time_t time, int weeks, icaltimezone *zone)
  * Return value: a time_t value containing @time plus the months added.
  */
 time_t
-time_add_month_with_zone (time_t time, int months, icaltimezone *zone)
+time_add_month_with_zone (time_t time, gint months, icaltimezone *zone)
 {
 	struct icaltimetype tt;
-	int day, days_in_month;
+	gint day, days_in_month;
 
 	/* Convert to an icaltimetype. */
 	tt = icaltime_from_timet_with_zone (time, FALSE, zone);
@@ -321,10 +321,10 @@ time_month_begin_with_zone (time_t time, icaltimezone *zone)
  * Return value: the beginning of the week.
  */
 time_t
-time_week_begin_with_zone (time_t time, int week_start_day, icaltimezone *zone)
+time_week_begin_with_zone (time_t time, gint week_start_day, icaltimezone *zone)
 {
 	struct icaltimetype tt;
-	int weekday, offset;
+	gint weekday, offset;
 
 	/* Convert to an icaltimetype. */
 	tt = icaltime_from_timet_with_zone (time, FALSE, zone);
@@ -454,10 +454,10 @@ time_to_gdate_with_zone (GDate *date, time_t time, icaltimezone *zone)
  *
  * Return value: number of days in the given month/year.
  */
-int
-time_days_in_month (int year, int month)
+gint
+time_days_in_month (gint year, gint month)
 {
-	int days;
+	gint days;
 
 	g_return_val_if_fail (year >= 1900, 0);
 	g_return_val_if_fail ((month >= 0) && (month < 12), 0);
@@ -481,10 +481,10 @@ time_days_in_month (int year, int month)
  *
  * Return value: the day of the year.
  */
-int
-time_day_of_year (int day, int month, int year)
+gint
+time_day_of_year (gint day, gint month, gint year)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < month; i++) {
 		day += days_in_month[i];
@@ -509,10 +509,10 @@ time_day_of_year (int day, int month, int year)
  *
  * Return value: the day of the week for the given date.
  */
-int
-time_day_of_week (int day, int month, int year)
+gint
+time_day_of_week (gint day, gint month, gint year)
 {
-	int n;
+	gint n;
 
 	n = (year - 1) * 365 + time_leap_years_up_to (year - 1)
 	  + time_day_of_year (day, month, year);
@@ -537,7 +537,7 @@ time_day_of_week (int day, int month, int year)
  * Return value: TRUE if the year is leap, FALSE if not.
  */
 gboolean
-time_is_leap_year (int year)
+time_is_leap_year (gint year)
 {
 	if (year <= 1752)
 		return !(year % 4);
@@ -555,8 +555,8 @@ time_is_leap_year (int year)
  *
  * Return value: number of leap years.
  */
-int
-time_leap_years_up_to (int year)
+gint
+time_leap_years_up_to (gint year)
 {
 	/* There is normally a leap year every 4 years, except at the turn of
 	   centuries since 1700. But there is a leap year on centuries since 1700
@@ -575,12 +575,12 @@ time_leap_years_up_to (int year)
  *
  * Return value: String with the ISO 8601 representation of the UTC time.
  **/
-char *
+gchar *
 isodate_from_time_t (time_t t)
 {
 	gchar *ret;
 	struct tm stm;
-	const char fmt[] = "%04d%02d%02dT%02d%02d%02dZ";
+	const gchar fmt[] = "%04d%02d%02dT%02d%02d%02dZ";
 
 	gmtime_r (&t, &stm);
 	ret = g_malloc (ISODATE_LENGTH);
@@ -599,11 +599,11 @@ isodate_from_time_t (time_t t)
  * Note that we only allow UTC times at present.
  **/
 time_t
-time_from_isodate (const char *str)
+time_from_isodate (const gchar *str)
 {
 	struct icaltimetype tt = icaltime_null_time ();
 	icaltimezone *utc_zone;
-	int len, i;
+	gint len, i;
 
 	g_return_val_if_fail (str != NULL, -1);
 
diff --git a/calendar/libecal/e-cal-time-util.h b/calendar/libecal/e-cal-time-util.h
index 31691e7..42e387f 100644
--- a/calendar/libecal/e-cal-time-util.h
+++ b/calendar/libecal/e-cal-time-util.h
@@ -24,29 +24,29 @@ G_BEGIN_DECLS
 
 /* Returns the number of days in the month. Year is the normal year, e.g. 2001.
    Month is 0 (Jan) to 11 (Dec). */
-int	time_days_in_month	(int year, int month);
+int	time_days_in_month	(gint year, gint month);
 
 /* Returns the 1-based day number within the year of the specified date.
    Year is the normal year, e.g. 2001. Month is 0 to 11. */
-int	time_day_of_year	(int day, int month, int year);
+int	time_day_of_year	(gint day, gint month, gint year);
 
 /* Returns the day of the week for the specified date, 0 (Sun) to 6 (Sat).
    For the days that were removed on the Gregorian reformation, it returns
    Thursday. Year is the normal year, e.g. 2001. Month is 0 to 11. */
-int	time_day_of_week	(int day, int month, int year);
+int	time_day_of_week	(gint day, gint month, gint year);
 
 /* Returns whether the specified year is a leap year. Year is the normal year,
    e.g. 2001. */
-gboolean time_is_leap_year	(int year);
+gboolean time_is_leap_year	(gint year);
 
 /* Returns the number of leap years since year 1 up to (but not including) the
    specified year. Year is the normal year, e.g. 2001. */
-int	time_leap_years_up_to	(int year);
+int	time_leap_years_up_to	(gint year);
 
 /* Convert to or from an ISO 8601 representation of a time, in UTC,
    e.g. "20010708T183000Z". */
-char   *isodate_from_time_t     (time_t t);
-time_t	time_from_isodate	(const char *str);
+gchar   *isodate_from_time_t     (time_t t);
+time_t	time_from_isodate	(const gchar *str);
 
 
 /**************************************************************************
@@ -58,8 +58,8 @@ time_t	time_from_isodate	(const char *str);
  **************************************************************************/
 
 /* Add or subtract a number of days, weeks or months. */
-time_t	time_add_day		(time_t time, int days);
-time_t	time_add_week		(time_t time, int weeks);
+time_t	time_add_day		(time_t time, gint days);
+time_t	time_add_week		(time_t time, gint weeks);
 
 /* Returns the beginning or end of the day. */
 time_t	time_day_begin		(time_t t);
@@ -76,15 +76,15 @@ time_t	time_day_end		(time_t t);
 
 /* Adds or subtracts a number of days to/from the given time_t value, using
    the given timezone. */
-time_t	time_add_day_with_zone (time_t time, int days, icaltimezone *zone);
+time_t	time_add_day_with_zone (time_t time, gint days, icaltimezone *zone);
 
 /* Adds or subtracts a number of weeks to/from the given time_t value, using
    the given timezone. */
-time_t	time_add_week_with_zone (time_t time, int weeks, icaltimezone *zone);
+time_t	time_add_week_with_zone (time_t time, gint weeks, icaltimezone *zone);
 
 /* Adds or subtracts a number of months to/from the given time_t value, using
    the given timezone. */
-time_t	time_add_month_with_zone (time_t time, int months, icaltimezone *zone);
+time_t	time_add_month_with_zone (time_t time, gint months, icaltimezone *zone);
 
 /* Returns the start of the year containing the given time_t, using the given
    timezone. */
@@ -97,7 +97,7 @@ time_t	time_month_begin_with_zone (time_t time, icaltimezone *zone);
 /* Returns the start of the week containing the given time_t, using the given
    timezone. week_start_day should use the same values as mktime(),
    i.e. 0 (Sun) to 6 (Sat). */
-time_t	time_week_begin_with_zone (time_t time, int week_start_day,
+time_t	time_week_begin_with_zone (time_t time, gint week_start_day,
 				   icaltimezone *zone);
 
 /* Returns the start of the day containing the given time_t, using the given
diff --git a/calendar/libecal/e-cal-util.c b/calendar/libecal/e-cal-util.c
index b7b6f32..271a0a5 100644
--- a/calendar/libecal/e-cal-util.c
+++ b/calendar/libecal/e-cal-util.c
@@ -67,7 +67,7 @@ cal_obj_uid_list_free (GList *list)
 	GList *l;
 
 	for (l = list; l; l = l->next) {
-		char *uid;
+		gchar *uid;
 
 		uid = l->data;
 
@@ -132,10 +132,10 @@ e_cal_util_new_component (icalcomponent_kind kind)
 	return comp;
 }
 
-static char *
-read_line (const char *string)
+static gchar *
+read_line (const gchar *string)
 {
-	char *line;
+	gchar *line;
 	GString *line_str = NULL;
 
 	for (; *string; string++) {
@@ -166,9 +166,9 @@ read_line (const char *string)
  * valid iCalendar string.
  */
 icalcomponent *
-e_cal_util_parse_ics_string (const char *string)
+e_cal_util_parse_ics_string (const gchar *string)
 {
-	char *s;
+	gchar *s;
 	icalcomponent *icalcomp = NULL;
 
 	g_return_val_if_fail (string != NULL, NULL);
@@ -178,7 +178,7 @@ e_cal_util_parse_ics_string (const char *string)
 		GString *comp_str = NULL;
 
 		while (*s) {
-			char *line = read_line (s);
+			gchar *line = read_line (s);
 			if (line) {
 				if (!comp_str)
 					comp_str = g_string_new (line);
@@ -212,8 +212,8 @@ e_cal_util_parse_ics_string (const char *string)
 	return icalcomp;
 }
 
-static char *
-get_line_fn (char *buf, size_t size, void *file)
+static gchar *
+get_line_fn (gchar *buf, size_t size, gpointer file)
 {
 	return fgets (buf, size, file);
 }
@@ -229,7 +229,7 @@ get_line_fn (char *buf, size_t size, void *file)
  * contain a valid iCalendar object.
  */
 icalcomponent *
-e_cal_util_parse_ics_file (const char *filename)
+e_cal_util_parse_ics_file (const gchar *filename)
 {
 	icalparser *parser;
 	icalcomponent *icalcomp;
@@ -265,7 +265,7 @@ compute_alarm_range (ECalComponent *comp, GList *alarm_uids, time_t start, time_
 	repeat_time = 0;
 
 	for (l = alarm_uids; l; l = l->next) {
-		const char *auid;
+		const gchar *auid;
 		ECalComponentAlarm *alarm;
 		ECalComponentAlarmTrigger trigger;
 		struct icaldurationtype *dur;
@@ -291,7 +291,7 @@ compute_alarm_range (ECalComponent *comp, GList *alarm_uids, time_t start, time_
 			dur_time = icaldurationtype_as_int (*dur);
 
 			if (repeat.repetitions != 0) {
-				int rdur;
+				gint rdur;
 
 				rdur = repeat.repetitions * icaldurationtype_as_int (repeat.duration);
 				repeat_time = MAX (repeat_time, rdur);
@@ -328,11 +328,11 @@ struct alarm_occurrence_data {
 
 	/* This is what we compute */
 	GSList *triggers;
-	int n_triggers;
+	gint n_triggers;
 };
 
 static void
-add_trigger (struct alarm_occurrence_data *aod, const char *auid, time_t trigger,
+add_trigger (struct alarm_occurrence_data *aod, const gchar *auid, time_t trigger,
 	     time_t occur_start, time_t occur_end)
 {
 	ECalComponentAlarmInstance *instance;
@@ -359,7 +359,7 @@ add_alarm_occurrences_cb (ECalComponent *comp, time_t start, time_t end, gpointe
 	aod = data;
 
 	for (l = aod->alarm_uids; l; l = l->next) {
-		const char *auid;
+		const gchar *auid;
 		ECalComponentAlarm *alarm;
 		ECalComponentAlarmAction action;
 		ECalComponentAlarmTrigger trigger;
@@ -367,7 +367,7 @@ add_alarm_occurrences_cb (ECalComponent *comp, time_t start, time_t end, gpointe
 		struct icaldurationtype *dur;
 		time_t dur_time;
 		time_t occur_time, trigger_time;
-		int i;
+		gint i;
 
 		auid = l->data;
 		alarm = e_cal_component_get_alarm (comp, auid);
@@ -408,7 +408,7 @@ add_alarm_occurrences_cb (ECalComponent *comp, time_t start, time_t end, gpointe
 		/* Add repeating alarms */
 
 		if (repeat.repetitions != 0) {
-			int i;
+			gint i;
 			time_t repeat_time;
 
 			repeat_time = icaldurationtype_as_int (repeat.duration);
@@ -446,7 +446,7 @@ generate_absolute_triggers (ECalComponent *comp, struct alarm_occurrence_data *a
 	e_cal_component_get_dtend (comp, &dt_end);
 
 	for (l = aod->alarm_uids; l; l = l->next) {
-		const char *auid;
+		const gchar *auid;
 		ECalComponentAlarm *alarm;
 		ECalComponentAlarmAction action;
 		ECalComponentAlarmRepeat repeat;
@@ -454,7 +454,7 @@ generate_absolute_triggers (ECalComponent *comp, struct alarm_occurrence_data *a
 		time_t abs_time;
 		time_t occur_start, occur_end;
 		icaltimezone *zone;
-		int i;
+		gint i;
 
 		auid = l->data;
 		alarm = e_cal_component_get_alarm (comp, auid);
@@ -505,7 +505,7 @@ generate_absolute_triggers (ECalComponent *comp, struct alarm_occurrence_data *a
 		/* Add repeating alarms */
 
 		if (repeat.repetitions != 0) {
-			int i;
+			gint i;
 			time_t repeat_time;
 
 			repeat_time = icaldurationtype_as_int (repeat.duration);
@@ -633,7 +633,7 @@ e_cal_util_generate_alarms_for_comp (ECalComponent *comp,
  *
  * Return value: the number of elements it added to the list.
  */
-int
+gint
 e_cal_util_generate_alarms_for_list (GList *comps,
 				     time_t start,
 				     time_t end,
@@ -644,7 +644,7 @@ e_cal_util_generate_alarms_for_list (GList *comps,
 				     icaltimezone *default_timezone)
 {
 	GList *l;
-	int n;
+	gint n;
 
 	n = 0;
 
@@ -675,10 +675,10 @@ e_cal_util_generate_alarms_for_list (GList *comps,
  * Return value: a string representing the PRIORITY value. This value is a
  * constant, so it should never be freed.
  */
-char *
-e_cal_util_priority_to_string (int priority)
+gchar *
+e_cal_util_priority_to_string (gint priority)
 {
-	char *retval;
+	gchar *retval;
 
 	if (priority <= 0)
 		retval = "";
@@ -703,10 +703,10 @@ e_cal_util_priority_to_string (int priority)
  *
  * Return value: the priority (0-9) or -1 if the priority string is not valid.
 */
-int
-e_cal_util_priority_from_string (const char *string)
+gint
+e_cal_util_priority_from_string (const gchar *string)
 {
-	int priority;
+	gint priority;
 
 	/* An empty string is the same as 'None'. */
 	if (!string || !string[0] || !e_util_utf8_strcasecmp (string, _("Undefined")))
@@ -730,10 +730,10 @@ typedef struct {
 } ForeachTzidData;
 
 static void
-add_timezone_cb (icalparameter *param, void *data)
+add_timezone_cb (icalparameter *param, gpointer data)
 {
 	icaltimezone *tz;
-	const char *tzid;
+	const gchar *tzid;
 	icalcomponent *vtz_comp;
 	ForeachTzidData *f_data = (ForeachTzidData *) data;
 
@@ -978,7 +978,7 @@ struct instance_data {
 };
 
 static void
-check_instance (icalcomponent *comp, struct icaltime_span *span, void *data)
+check_instance (icalcomponent *comp, struct icaltime_span *span, gpointer data)
 {
 	struct instance_data *instance = data;
 
@@ -1032,7 +1032,7 @@ e_cal_util_construct_instance (icalcomponent *icalcomp,
 static inline gboolean
 time_matches_rid (struct icaltimetype itt, struct icaltimetype rid, CalObjModType mod)
 {
-	int compare;
+	gint compare;
 
 	compare = icaltime_compare (itt, rid);
 	if (compare == 0)
@@ -1147,7 +1147,7 @@ e_cal_util_remove_instances (icalcomponent *icalcomp,
  * Returns system timezone location string, NULL on an error.
  * Returned pointer should be freed with g_free().
  **/
-char *
+gchar *
 e_cal_util_get_system_timezone_location (void)
 {
 	return e_cal_system_timezone_get_location ();
@@ -1162,7 +1162,7 @@ e_cal_util_get_system_timezone_location (void)
 icaltimezone *
 e_cal_util_get_system_timezone (void)
 {
-	char *location;
+	gchar *location;
 	icaltimezone *zone;
 
 	location = e_cal_system_timezone_get_location ();
diff --git a/calendar/libecal/e-cal-util.h b/calendar/libecal/e-cal-util.h
index 8bd5ee1..ce05993 100644
--- a/calendar/libecal/e-cal-util.h
+++ b/calendar/libecal/e-cal-util.h
@@ -35,7 +35,7 @@ G_BEGIN_DECLS
  * recurrence, or an alarm trigger of a `real' calendar object.
  */
 typedef struct {
-	char *uid;			/* UID of the object */
+	gchar *uid;			/* UID of the object */
 	time_t start;			/* Start time of instance */
 	time_t end;			/* End time of instance */
 } CalObjInstance;
@@ -68,8 +68,8 @@ void cal_obj_uid_list_free (GList *list);
 icalcomponent *e_cal_util_new_top_level (void);
 icalcomponent *e_cal_util_new_component (icalcomponent_kind kind);
 
-icalcomponent *e_cal_util_parse_ics_string (const char *string);
-icalcomponent *e_cal_util_parse_ics_file (const char *filename);
+icalcomponent *e_cal_util_parse_ics_string (const gchar *string);
+icalcomponent *e_cal_util_parse_ics_file (const gchar *filename);
 
 ECalComponentAlarms *e_cal_util_generate_alarms_for_comp (ECalComponent *comp,
 						       time_t start,
@@ -78,7 +78,7 @@ ECalComponentAlarms *e_cal_util_generate_alarms_for_comp (ECalComponent *comp,
 						       ECalRecurResolveTimezoneFn resolve_tzid,
 						       gpointer user_data,
 						       icaltimezone *default_timezone);
-int e_cal_util_generate_alarms_for_list (GList *comps,
+gint e_cal_util_generate_alarms_for_list (GList *comps,
 				       time_t start,
 				       time_t end,
 				       ECalComponentAlarmAction *omit,
@@ -87,8 +87,8 @@ int e_cal_util_generate_alarms_for_list (GList *comps,
 				       gpointer user_data,
 				       icaltimezone *default_timezone);
 
-char *e_cal_util_priority_to_string (int priority);
-int e_cal_util_priority_from_string (const char *string);
+gchar *e_cal_util_priority_to_string (gint priority);
+gint e_cal_util_priority_from_string (const gchar *string);
 
 void e_cal_util_add_timezones_from_component (icalcomponent *vcal_comp,
 					    icalcomponent *icalcomp);
@@ -135,7 +135,7 @@ void           e_cal_util_remove_instances (icalcomponent *icalcomp,
 					  struct icaltimetype rid,
 					  CalObjModType mod);
 
-char *e_cal_util_get_system_timezone_location (void);
+gchar *e_cal_util_get_system_timezone_location (void);
 icaltimezone *e_cal_util_get_system_timezone (void);
 
 G_END_DECLS
diff --git a/calendar/libecal/e-cal-view-listener.c b/calendar/libecal/e-cal-view-listener.c
index a671d0a..9658602 100644
--- a/calendar/libecal/e-cal-view-listener.c
+++ b/calendar/libecal/e-cal-view-listener.c
@@ -30,7 +30,7 @@
 /* Private part of the CalViewListener structure */
 
 struct _ECalViewListenerPrivate {
-	int dummy;
+	gint dummy;
 };
 
 /* Signal IDs */
@@ -80,7 +80,7 @@ static GList *
 build_object_list (const GNOME_Evolution_Calendar_stringlist *seq)
 {
 	GList *list;
-	int i;
+	gint i;
 
 	list = NULL;
 	for (i = 0; i < seq->_length; i++) {
@@ -100,7 +100,7 @@ static GList *
 build_id_list (const GNOME_Evolution_Calendar_CalObjIDSeq *seq)
 {
 	GList *list;
-	int i;
+	gint i;
 
 	list = NULL;
 	for (i = 0; i < seq->_length; i++) {
diff --git a/calendar/libecal/e-cal-view-listener.h b/calendar/libecal/e-cal-view-listener.h
index 1f150b2..2ea1558 100644
--- a/calendar/libecal/e-cal-view-listener.h
+++ b/calendar/libecal/e-cal-view-listener.h
@@ -54,7 +54,7 @@ struct _ECalViewListenerClass {
 	void (*objects_added) (ECalViewListener *listener, GList *objects);
 	void (*objects_modified) (ECalViewListener *listener, GList *objects);
 	void (*objects_removed) (ECalViewListener *listener, GList *uids);
-	void (*view_progress) (ECalViewListener *listener, const char *message, int percent);
+	void (*view_progress) (ECalViewListener *listener, const gchar *message, gint percent);
 	void (*view_done) (ECalViewListener *listener, ECalendarStatus status);
 };
 
diff --git a/calendar/libecal/e-cal-view.c b/calendar/libecal/e-cal-view.c
index 207a634..23fbc96 100644
--- a/calendar/libecal/e-cal-view.c
+++ b/calendar/libecal/e-cal-view.c
@@ -105,7 +105,7 @@ objects_removed_cb (ECalViewListener *listener, GList *ids, gpointer data)
 }
 
 static void
-view_progress_cb (ECalViewListener *listener, const char *message, int percent, gpointer data)
+view_progress_cb (ECalViewListener *listener, const gchar *message, gint percent, gpointer data)
 {
 	ECalView *view;
 
diff --git a/calendar/libecal/e-cal-view.h b/calendar/libecal/e-cal-view.h
index 49ed9ea..4077401 100644
--- a/calendar/libecal/e-cal-view.h
+++ b/calendar/libecal/e-cal-view.h
@@ -51,7 +51,7 @@ struct _ECalViewClass {
 	void (* objects_added) (ECalView *view, GList *objects);
 	void (* objects_modified) (ECalView *view, GList *objects);
 	void (* objects_removed) (ECalView *view, GList *uids);
-	void (* view_progress) (ECalView *view, char *message, int percent);
+	void (* view_progress) (ECalView *view, gchar *message, gint percent);
 	void (* view_done) (ECalView *view, ECalendarStatus status);
 };
 
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index 6ddb75a..6e1c24d 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -54,13 +54,13 @@ typedef struct {
 	EFlag *done;
 	ECalendarStatus status;
 
-	char *uid;
+	gchar *uid;
 	GList *list;
 	GSList *slist;
 	gboolean bool;
-	char *string;
+	gchar *string;
 
-	char *op_str;
+	gchar *op_str;
 	ECalView *query;
 	ECalViewListener *listener;
 } ECalendarOp;
@@ -74,7 +74,7 @@ struct _ECalPrivate {
 	 * NULL if we are not loaded.
 	 */
 	ESource *source;
-	char *uri;
+	gchar *uri;
 	ECalSourceType type;
 
 	ECalendarOp *current_op;
@@ -82,14 +82,14 @@ struct _ECalPrivate {
 	GMutex *mutex;
 
 	/* Email address associated with this calendar, or NULL */
-	char *cal_address;
-	char *alarm_email_address;
-	char *ldap_attribute;
+	gchar *cal_address;
+	gchar *alarm_email_address;
+	gchar *ldap_attribute;
 
 	/* Scheduling info */
-	char *capabilities;
+	gchar *capabilities;
 
-	int mode;
+	gint mode;
 
 	gboolean read_only;
 
@@ -117,7 +117,7 @@ struct _ECalPrivate {
 	/* The component listener to keep track of the lifetime of backends */
 	EComponentListener *comp_listener;
 
-	char *local_attachment_store;
+	gchar *local_attachment_store;
 };
 
 
@@ -178,7 +178,7 @@ static GObjectClass *parent_class;
 		return TRUE;						\
 	}								\
 	else {                                                          \
-                const char *msg;                                        \
+                const gchar *msg;                                        \
                 msg = e_cal_get_error_message ((status));          \
 		g_set_error ((error), E_CALENDAR_ERROR, (status), "%s", msg);	\
 		return FALSE;						\
@@ -301,7 +301,7 @@ convert_type (ECalSourceType type)
 /* EBookOp calls */
 
 static ECalendarOp*
-e_calendar_new_op (ECal *ecal, const char *str)
+e_calendar_new_op (ECal *ecal, const gchar *str)
 {
 	ECalendarOp *op = g_new0 (ECalendarOp, 1);
 
@@ -349,7 +349,7 @@ destroy_factories (ECal *ecal)
 	ECalPrivate *priv;
 	CORBA_Object factory;
 	CORBA_Environment ev;
-	int result;
+	gint result;
 	GList *f;
 
 	priv = ecal->priv;
@@ -387,7 +387,7 @@ destroy_cal (ECal *ecal)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
-	int result;
+	gint result;
 
 	priv = ecal->priv;
 
@@ -454,7 +454,7 @@ cal_read_only_cb (ECalListener *listener, ECalendarStatus status, gboolean read_
 }
 
 static void
-cal_cal_address_cb (ECalListener *listener, ECalendarStatus status, const char *address, gpointer data)
+cal_cal_address_cb (ECalListener *listener, ECalendarStatus status, const gchar *address, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -479,7 +479,7 @@ cal_cal_address_cb (ECalListener *listener, ECalendarStatus status, const char *
 }
 
 static void
-cal_alarm_address_cb (ECalListener *listener, ECalendarStatus status, const char *address, gpointer data)
+cal_alarm_address_cb (ECalListener *listener, ECalendarStatus status, const gchar *address, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -498,7 +498,7 @@ cal_alarm_address_cb (ECalListener *listener, ECalendarStatus status, const char
 }
 
 static void
-cal_ldap_attribute_cb (ECalListener *listener, ECalendarStatus status, const char *attribute, gpointer data)
+cal_ldap_attribute_cb (ECalListener *listener, ECalendarStatus status, const gchar *attribute, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -517,7 +517,7 @@ cal_ldap_attribute_cb (ECalListener *listener, ECalendarStatus status, const cha
 }
 
 static void
-cal_static_capabilities_cb (ECalListener *listener, ECalendarStatus status, const char *capabilities, gpointer data)
+cal_static_capabilities_cb (ECalListener *listener, ECalendarStatus status, const gchar *capabilities, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -572,7 +572,7 @@ cal_removed_cb (ECalListener *listener, ECalendarStatus status, gpointer data)
 }
 
 static void
-cal_object_created_cb (ECalListener *listener, ECalendarStatus status, const char *uid, gpointer data)
+cal_object_created_cb (ECalListener *listener, ECalendarStatus status, const gchar *uid, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -663,7 +663,7 @@ cal_objects_received_cb (ECalListener *listener, ECalendarStatus status, gpointe
 }
 
 static void
-cal_objects_sent_cb (ECalListener *listener, ECalendarStatus status, GList *users, const char *object, gpointer data)
+cal_objects_sent_cb (ECalListener *listener, ECalendarStatus status, GList *users, const gchar *object, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -687,7 +687,7 @@ cal_objects_sent_cb (ECalListener *listener, ECalendarStatus status, GList *user
 }
 
 static void
-cal_default_object_requested_cb (ECalListener *listener, ECalendarStatus status, const char *object, gpointer data)
+cal_default_object_requested_cb (ECalListener *listener, ECalendarStatus status, const gchar *object, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -706,7 +706,7 @@ cal_default_object_requested_cb (ECalListener *listener, ECalendarStatus status,
 }
 
 static void
-cal_object_requested_cb (ECalListener *listener, ECalendarStatus status, const char *object, gpointer data)
+cal_object_requested_cb (ECalListener *listener, ECalendarStatus status, const gchar *object, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -767,7 +767,7 @@ cal_attachment_list_cb (ECalListener *listener, ECalendarStatus status, GSList *
 }
 
 static void
-cal_get_timezone_cb (ECalListener *listener, ECalendarStatus status, const char *object, gpointer data)
+cal_get_timezone_cb (ECalListener *listener, ECalendarStatus status, const gchar *object, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -786,7 +786,7 @@ cal_get_timezone_cb (ECalListener *listener, ECalendarStatus status, const char
 }
 
 static void
-cal_add_timezone_cb (ECalListener *listener, ECalendarStatus status, const char *tzid, gpointer data)
+cal_add_timezone_cb (ECalListener *listener, ECalendarStatus status, const gchar *tzid, gpointer data)
 {
 	ECal *ecal = data;
 	ECalendarOp *op;
@@ -972,7 +972,7 @@ cal_set_mode_cb (ECalListener *listener,
 typedef struct
 {
 	ECal *ecal;
-	char *message;
+	gchar *message;
 }  ECalErrorData;
 
 static gboolean
@@ -991,7 +991,7 @@ backend_error_idle_cb (gpointer data)
 
 /* Handle the error_occurred signal from the listener */
 static void
-backend_error_cb (ECalListener *listener, const char *message, gpointer data)
+backend_error_cb (ECalListener *listener, const gchar *message, gpointer data)
 {
 	ECalErrorData *error_data;
 
@@ -1006,13 +1006,13 @@ backend_error_cb (ECalListener *listener, const char *message, gpointer data)
 
 
 static gboolean
-get_factories (const char *str_uri, GList **factories)
+get_factories (const gchar *str_uri, GList **factories)
 {
 	GNOME_Evolution_Calendar_CalFactory factory;
 	Bonobo_ServerInfoList *servers;
 	EUri *uri;
-	char *query;
-	int i;
+	gchar *query;
+	gint i;
 
 
 	/* Determine the protocol and query for factory supporting that */
@@ -1353,8 +1353,8 @@ static void
 set_local_attachment_store (ECal *ecal)
 {
 	ECalPrivate *priv;
-	char *mangled_uri;
-	int i;
+	gchar *mangled_uri;
+	gint i;
 
 	priv = ecal->priv;
 	mangled_uri = g_strdup (priv->uri);
@@ -1493,8 +1493,8 @@ ECal *
 e_cal_new_system_calendar (void)
 {
 	ECal *ecal;
-	char *filename;
-	char *uri;
+	gchar *filename;
+	gchar *uri;
 
 	filename = g_build_filename (g_get_home_dir (),
 				     ".evolution/calendar/local/system",
@@ -1521,8 +1521,8 @@ ECal *
 e_cal_new_system_tasks (void)
 {
 	ECal *ecal;
-	char *filename;
-	char *uri;
+	gchar *filename;
+	gchar *uri;
 
 	filename = g_build_filename (g_get_home_dir (),
 				     ".evolution/tasks/local/system",
@@ -1549,8 +1549,8 @@ ECal *
 e_cal_new_system_memos (void)
 {
 	ECal *ecal;
-	char *uri;
-	char *filename;
+	gchar *uri;
+	gchar *filename;
 
 	filename = g_build_filename (g_get_home_dir (),
 				     ".evolution/memos/local/system",
@@ -1584,7 +1584,7 @@ e_cal_new_system_memos (void)
  *
  * The authentication function has the following signature
  * (ECalAuthFunc):
- *	char * auth_func (ECal *ecal,
+ *	gchar * auth_func (ECal *ecal,
  *			  const gchar *prompt,
  *			  const gchar *key,
  *			  gpointer user_data)
@@ -1599,11 +1599,11 @@ e_cal_set_auth_func (ECal *ecal, ECalAuthFunc func, gpointer data)
 	ecal->priv->auth_user_data = data;
 }
 
-static char *
-build_proxy_pass_key (ECal *ecal, const char* parent_user)
+static gchar *
+build_proxy_pass_key (ECal *ecal, const gchar * parent_user)
 {
-	char *euri_str;
-	const char *uri;
+	gchar *euri_str;
+	const gchar *uri;
 	EUri *euri;
 
 	uri = e_cal_get_uri (ecal);
@@ -1618,11 +1618,11 @@ build_proxy_pass_key (ECal *ecal, const char* parent_user)
 	return euri_str;
 }
 
-static char *
+static gchar *
 build_pass_key (ECal *ecal)
 {
-	char *euri_str;
-	const char *uri;
+	gchar *euri_str;
+	const gchar *uri;
 	EUri *euri;
 
 	uri = e_cal_get_uri (ecal);
@@ -1640,7 +1640,7 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta
 	ECalPrivate *priv;
 	CORBA_Environment ev;
 	ECalendarOp *our_op;
-	char *username = NULL, *auth_type = NULL, *password = NULL;
+	gchar *username = NULL, *auth_type = NULL, *password = NULL;
 	gboolean read_only = FALSE;
 
 	e_return_error_if_fail (ecal != NULL, E_CALENDAR_STATUS_INVALID_ARG);
@@ -1667,8 +1667,8 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta
 
 	/* see if the backend needs authentication */
 	if ( (priv->mode !=  CAL_MODE_LOCAL) && e_source_get_property (priv->source, "auth")) {
-		char *prompt, *key;
-		char *parent_user;
+		gchar *prompt, *key;
+		gchar *parent_user;
 
 		priv->load_state = E_CAL_LOAD_AUTHENTICATING;
 
@@ -1806,9 +1806,9 @@ typedef struct {
 	ECal *ecal;
 	gboolean exists;
 	ECalendarStatus status;
-	const char *auth_prompt;
-	const char *auth_key;
-	char *password;
+	const gchar *auth_prompt;
+	const gchar *auth_key;
+	gchar *password;
 } ECalAsyncData;
 
 static gboolean
@@ -1953,7 +1953,7 @@ static GList *
 build_uri_list (GNOME_Evolution_Calendar_StringSeq *seq)
 {
 	GList *uris = NULL;
-	int i;
+	gint i;
 
 	for (i = 0; i < seq->_length; i++)
 		uris = g_list_prepend (uris, g_strdup (seq->_buffer[i]));
@@ -2087,7 +2087,7 @@ e_cal_get_source (ECal *ecal)
  * Return value: The URI of the calendar that is already loaded or is being
  * loaded, or NULL if the client has not started a load request yet.
  **/
-const char *
+const gchar *
 e_cal_get_uri (ECal *ecal)
 {
 	ECalPrivate *priv;
@@ -2112,7 +2112,7 @@ e_cal_get_uri (ECal *ecal)
  * Return value: The URL where the attachments are serialized in the
  * local filesystem.
  **/
-const char *
+const gchar *
 e_cal_get_local_attachment_store (ECal *ecal)
 {
 	ECalPrivate *priv;
@@ -2121,7 +2121,7 @@ e_cal_get_local_attachment_store (ECal *ecal)
 	g_return_val_if_fail (E_IS_CAL (ecal), NULL);
 
 	priv = ecal->priv;
-	return (const char *)priv->local_attachment_store;
+	return (const gchar *)priv->local_attachment_store;
 }
 
 /**
@@ -2220,7 +2220,7 @@ get_read_only (ECal *ecal, gboolean *read_only, GError **error)
  * was an error.
  **/
 gboolean
-e_cal_get_cal_address (ECal *ecal, char **cal_address, GError **error)
+e_cal_get_cal_address (ECal *ecal, gchar **cal_address, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
@@ -2292,7 +2292,7 @@ e_cal_get_cal_address (ECal *ecal, char **cal_address, GError **error)
  * an error while contacting the backend.
  */
 gboolean
-e_cal_get_alarm_email_address (ECal *ecal, char **alarm_address, GError **error)
+e_cal_get_alarm_email_address (ECal *ecal, gchar **alarm_address, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
@@ -2359,7 +2359,7 @@ e_cal_get_alarm_email_address (ECal *ecal, char **alarm_address, GError **error)
  * error contacting the backend.
  */
 gboolean
-e_cal_get_ldap_attribute (ECal *ecal, char **ldap_attribute, GError **error)
+e_cal_get_ldap_attribute (ECal *ecal, gchar **ldap_attribute, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
@@ -2472,7 +2472,7 @@ load_static_capabilities (ECal *ecal, GError **error)
 }
 
 static gboolean
-check_capability (ECal *ecal, const char *cap)
+check_capability (ECal *ecal, const gchar *cap)
 {
 	ECalPrivate *priv;
 
@@ -2549,7 +2549,7 @@ e_cal_get_recurrences_no_master (ECal *ecal)
  * Return value: TRUE if the capability is supported, FALSE otherwise.
  */
 gboolean
-e_cal_get_static_capability (ECal *ecal, const char *cap)
+e_cal_get_static_capability (ECal *ecal, const gchar *cap)
 {
 	g_return_val_if_fail (ecal != NULL, FALSE);
 	g_return_val_if_fail (E_IS_CAL (ecal), FALSE);
@@ -2724,7 +2724,7 @@ e_cal_get_default_object (ECal *ecal, icalcomponent **icalcomp, GError **error)
  * Return value: TRUE if the call was successful, FALSE otherwise.
  **/
 gboolean
-e_cal_get_attachments_for_comp (ECal *ecal, const char *uid, const char *rid, GSList **list, GError **error)
+e_cal_get_attachments_for_comp (ECal *ecal, const gchar *uid, const gchar *rid, GSList **list, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
@@ -2795,7 +2795,7 @@ e_cal_get_attachments_for_comp (ECal *ecal, const char *uid, const char *rid, GS
  * Return value: TRUE if the call was successful, FALSE otherwise.
  **/
 gboolean
-e_cal_get_object (ECal *ecal, const char *uid, const char *rid, icalcomponent **icalcomp, GError **error)
+e_cal_get_object (ECal *ecal, const gchar *uid, const gchar *rid, icalcomponent **icalcomp, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
@@ -2905,7 +2905,7 @@ e_cal_get_object (ECal *ecal, const char *uid, const char *rid, icalcomponent **
  * Return value: TRUE if the call was successful, FALSE otherwise.
  **/
 gboolean
-e_cal_get_objects_for_uid (ECal *ecal, const char *uid, GList **objects, GError **error)
+e_cal_get_objects_for_uid (ECal *ecal, const gchar *uid, GList **objects, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
@@ -3021,7 +3021,7 @@ e_cal_get_objects_for_uid (ECal *ecal, const char *uid, GList **objects, GError
  * it could not be found.
  */
 icaltimezone*
-e_cal_resolve_tzid_cb (const char *tzid, gpointer data)
+e_cal_resolve_tzid_cb (const gchar *tzid, gpointer data)
 {
 	ECal *ecal;
 	icaltimezone *zone = NULL;
@@ -3051,7 +3051,7 @@ e_cal_resolve_tzid_cb (const char *tzid, gpointer data)
  * Return value: TRUE if the call was successful, FALSE otherwise.
  */
 gboolean
-e_cal_get_changes (ECal *ecal, const char *change_id, GList **changes, GError **error)
+e_cal_get_changes (ECal *ecal, const gchar *change_id, GList **changes, GError **error)
 {
 	CORBA_Environment ev;
 	ECalendarOp *our_op;
@@ -3144,7 +3144,7 @@ e_cal_free_change_list (GList *list)
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  **/
 gboolean
-e_cal_get_object_list (ECal *ecal, const char *query, GList **objects, GError **error)
+e_cal_get_object_list (ECal *ecal, const gchar *query, GList **objects, GError **error)
 {
 	CORBA_Environment ev;
 	ECalendarOp *our_op;
@@ -3212,7 +3212,7 @@ e_cal_get_object_list (ECal *ecal, const char *query, GList **objects, GError **
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  */
 gboolean
-e_cal_get_object_list_as_comp (ECal *ecal, const char *query, GList **objects, GError **error)
+e_cal_get_object_list_as_comp (ECal *ecal, const gchar *query, GList **objects, GError **error)
 {
 	GList *ical_objects = NULL;
 	GList *l;
@@ -3277,7 +3277,7 @@ e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end,
 	ECalendarStatus status;
 	GNOME_Evolution_Calendar_UserList corba_users;
 	GList *l;
-	int i, len;
+	gint i, len;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
@@ -3382,7 +3382,7 @@ add_instance (ECalComponent *comp, time_t start, time_t end, gpointer data)
 				itt = icaltime_from_timet (start, datetime.value->is_date);
 
 				if (datetime.tzid) {
-					g_free ((char *) datetime.tzid);
+					g_free ((gchar *) datetime.tzid);
 					datetime.tzid = NULL;
 				}
 			}
@@ -3397,7 +3397,7 @@ add_instance (ECalComponent *comp, time_t start, time_t end, gpointer data)
 			e_cal_component_set_recurid (ci->comp, range);
 
 			if (datetime.tzid)
-				g_free ((char *) datetime.tzid);
+				g_free ((gchar *) datetime.tzid);
 			g_free (range);
 		}
 	}
@@ -3432,7 +3432,7 @@ process_detached_instances (GList *instances, GList *detached_instances)
 
 	for (dl = detached_instances; dl != NULL; dl = dl->next) {
 		GList *il;
-		const char *uid;
+		const gchar *uid;
 		gboolean processed;
 		ECalComponentRange recur_id, instance_recur_id;
 
@@ -3444,14 +3444,14 @@ process_detached_instances (GList *instances, GList *detached_instances)
 
 		/* search for coincident instances already expanded */
 		for (il = instances; il != NULL; il = il->next) {
-			const char *instance_uid;
-			int cmp;
+			const gchar *instance_uid;
+			gint cmp;
 
 			ci = il->data;
 			e_cal_component_get_uid (ci->comp, &instance_uid);
 			e_cal_component_get_recurid (ci->comp, &instance_recur_id);
 			if (strcmp (uid, instance_uid) == 0) {
-				char *i_rid = NULL, *d_rid = NULL;
+				gchar *i_rid = NULL, *d_rid = NULL;
 
 				i_rid = e_cal_component_get_recurid_as_string (ci->comp);
 				d_rid = e_cal_component_get_recurid_as_string (cid->comp);
@@ -3528,14 +3528,14 @@ process_detached_instances (GList *instances, GList *detached_instances)
 }
 
 static void
-generate_instances (ECal *ecal, time_t start, time_t end, const char *uid,
+generate_instances (ECal *ecal, time_t start, time_t end, const gchar *uid,
 		    ECalRecurInstanceFn cb, gpointer cb_data)
 {
 	GList *objects = NULL;
 	GList *instances, *detached_instances = NULL;
 	GList *l;
-	char *query;
-	char *iso_start, *iso_end;
+	gchar *query;
+	gchar *iso_start, *iso_end;
 	ECalPrivate *priv;
 
 	priv = ecal->priv;
@@ -3770,8 +3770,8 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
 {
 	ECalPrivate *priv;
 	ECalComponent *comp;
-	const char *uid;
-	char *rid;
+	const gchar *uid;
+	gchar *rid;
 	gboolean result;
 	GList *instances = NULL;
 	ECalComponentDateTime datetime;
@@ -3823,7 +3823,7 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
 	result = TRUE;
 	while (instances != NULL) {
 		struct comp_instance *ci;
-		char *instance_rid = NULL;
+		gchar *instance_rid = NULL;
 
 		ci = instances->data;
 
@@ -3898,7 +3898,7 @@ e_cal_get_alarms_in_range (ECal *ecal, time_t start, time_t end)
 {
 	ECalPrivate *priv;
 	GSList *alarms;
-	char *sexp, *iso_start, *iso_end;
+	gchar *sexp, *iso_start, *iso_end;
 	GList *object_list = NULL;
 
 	g_return_val_if_fail (ecal != NULL, NULL);
@@ -4036,13 +4036,13 @@ e_cal_get_alarms_for_object (ECal *ecal, const ECalComponentId *id,
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  */
 gboolean
-e_cal_discard_alarm (ECal *ecal, ECalComponent *comp, const char *auid, GError **error)
+e_cal_discard_alarm (ECal *ecal, ECalComponent *comp, const gchar *auid, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
 	ECalendarStatus status;
 	ECalendarOp *our_op;
-	const char *uid;
+	const gchar *uid;
 
 	g_return_val_if_fail (ecal != NULL, FALSE);
 	g_return_val_if_fail (E_IS_CAL (ecal), FALSE);
@@ -4104,14 +4104,14 @@ struct _ForeachTZIDCallbackData {
 /* This adds the VTIMEZONE given by the TZID parameter to the GHashTable in
    data. */
 static void
-foreach_tzid_callback (icalparameter *param, void *cbdata)
+foreach_tzid_callback (icalparameter *param, gpointer cbdata)
 {
 	ForeachTZIDCallbackData *data = cbdata;
 	ECalPrivate *priv;
-	const char *tzid;
+	const gchar *tzid;
 	icaltimezone *zone;
 	icalcomponent *vtimezone_comp;
-	char *vtimezone_as_string;
+	gchar *vtimezone_as_string;
 
 	priv = data->ecal->priv;
 
@@ -4148,7 +4148,7 @@ foreach_tzid_callback (icalparameter *param, void *cbdata)
 
 	vtimezone_as_string = icalcomponent_as_ical_string_r (vtimezone_comp);
 
-	g_hash_table_insert (data->timezone_hash, (char*) tzid,
+	g_hash_table_insert (data->timezone_hash, (gchar *) tzid,
 			     vtimezone_as_string);
 }
 
@@ -4182,16 +4182,16 @@ free_timezone_string (gpointer key, gpointer value, gpointer data)
    If we need to send any timezones to the server, then we have to create a
    complete VCALENDAR object, otherwise we can just send a single VEVENT/VTODO
    as before. */
-static char*
+static gchar *
 e_cal_get_component_as_string_internal (ECal *ecal,
 					icalcomponent *icalcomp,
 					gboolean include_all_timezones)
 {
 	GHashTable *timezone_hash;
 	GString *vcal_string;
-	int initial_vcal_string_len;
+	gint initial_vcal_string_len;
 	ForeachTZIDCallbackData cbdata;
-	char *obj_string;
+	gchar *obj_string;
 	ECalPrivate *priv;
 
 	priv = ecal->priv;
@@ -4258,7 +4258,7 @@ e_cal_get_component_as_string_internal (ECal *ecal,
  * Return value: the component as a complete iCalendar string, or NULL on
  * failure. The string should be freed after use.
  **/
-char*
+gchar *
 e_cal_get_component_as_string (ECal *ecal, icalcomponent *icalcomp)
 {
 	return e_cal_get_component_as_string_internal (ecal, icalcomp, TRUE);
@@ -4278,13 +4278,13 @@ e_cal_get_component_as_string (ECal *ecal, icalcomponent *icalcomp)
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  */
 gboolean
-e_cal_create_object (ECal *ecal, icalcomponent *icalcomp, char **uid, GError **error)
+e_cal_create_object (ECal *ecal, icalcomponent *icalcomp, gchar **uid, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
 	ECalendarStatus status;
 	ECalendarOp *our_op;
-	char *obj;
+	gchar *obj;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
@@ -4364,7 +4364,7 @@ e_cal_modify_object (ECal *ecal, icalcomponent *icalcomp, CalObjModType mod, GEr
 	CORBA_Environment ev;
 	ECalendarStatus status;
 	ECalendarOp *our_op;
-	char *obj;
+	gchar *obj;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 	e_return_error_if_fail (icalcomp, E_CALENDAR_STATUS_INVALID_ARG);
@@ -4436,8 +4436,8 @@ e_cal_modify_object (ECal *ecal, icalcomponent *icalcomp, CalObjModType mod, GEr
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  */
 gboolean
-e_cal_remove_object_with_mod (ECal *ecal, const char *uid,
-			      const char *rid, CalObjModType mod, GError **error)
+e_cal_remove_object_with_mod (ECal *ecal, const gchar *uid,
+			      const gchar *rid, CalObjModType mod, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
@@ -4505,7 +4505,7 @@ e_cal_remove_object_with_mod (ECal *ecal, const char *uid,
  * Return value: %TRUE if successful, %FALSE otherwise.
  **/
 gboolean
-e_cal_remove_object (ECal *ecal, const char *uid, GError **error)
+e_cal_remove_object (ECal *ecal, const gchar *uid, GError **error)
 {
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 	e_return_error_if_fail (uid, E_CALENDAR_STATUS_INVALID_ARG);
@@ -4532,7 +4532,7 @@ e_cal_receive_objects (ECal *ecal, icalcomponent *icalcomp, GError **error)
 	CORBA_Environment ev;
 	ECalendarStatus status;
 	ECalendarOp *our_op;
-	char *obj;
+	gchar *obj;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
@@ -4604,7 +4604,7 @@ e_cal_send_objects (ECal *ecal, icalcomponent *icalcomp, GList **users, icalcomp
 	CORBA_Environment ev;
 	ECalendarStatus status;
 	ECalendarOp *our_op;
-	char *obj;
+	gchar *obj;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
@@ -4683,14 +4683,14 @@ e_cal_send_objects (ECal *ecal, icalcomponent *icalcomp, GList **users, icalcomp
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  */
 gboolean
-e_cal_get_timezone (ECal *ecal, const char *tzid, icaltimezone **zone, GError **error)
+e_cal_get_timezone (ECal *ecal, const gchar *tzid, icaltimezone **zone, GError **error)
 {
 	ECalPrivate *priv;
 	CORBA_Environment ev;
 	ECalendarStatus status = E_CALENDAR_STATUS_OK;
 	ECalendarOp *our_op;
 	icalcomponent *icalcomp;
-	const char *systzid;
+	const gchar *systzid;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 	e_return_error_if_fail (zone, E_CALENDAR_STATUS_INVALID_ARG);
@@ -4853,7 +4853,7 @@ e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error)
 	CORBA_Environment ev;
 	ECalendarStatus status;
 	ECalendarOp *our_op;
-	char *tzobj;
+	gchar *tzobj;
 	icalcomponent *icalcomp;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
@@ -4939,7 +4939,7 @@ e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error)
  * components are added and removed from the query in the server.
  **/
 gboolean
-e_cal_get_query (ECal *ecal, const char *sexp, ECalView **query, GError **error)
+e_cal_get_query (ECal *ecal, const gchar *sexp, ECalView **query, GError **error)
 {
 	CORBA_Environment ev;
 	ECalendarOp *our_op;
@@ -5014,7 +5014,7 @@ e_cal_set_default_timezone (ECal *ecal, icaltimezone *zone, GError **error)
 	ECalendarStatus status;
 	ECalendarOp *our_op;
 	icalcomponent *icalcomp = NULL;
-	char *tzobj;
+	gchar *tzobj;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 	e_return_error_if_fail (zone, E_CALENDAR_STATUS_INVALID_ARG);
@@ -5092,7 +5092,7 @@ e_cal_set_default_timezone (ECal *ecal, icaltimezone *zone, GError **error)
  *
  * Returns: the error message.
  */
-const char *
+const gchar *
 e_cal_get_error_message (ECalendarStatus status)
 {
 	switch (status) {
@@ -5273,7 +5273,7 @@ e_cal_set_default (ECal *ecal, GError **error)
 static gboolean
 set_default_source (ESourceList *sources, ESource *source, GError **error)
 {
-	const char *uid;
+	const gchar *uid;
 	GError *err = NULL;
 	GSList *g;
 
@@ -5334,7 +5334,7 @@ e_cal_set_default_source (ESource *source, ECalSourceType type, GError **error)
 }
 
 static gboolean
-get_sources (ESourceList **sources, const char *key, GError **error)
+get_sources (ESourceList **sources, const gchar *key, GError **error)
 {
 	GConfClient *gconf = gconf_client_get_default();
 
diff --git a/calendar/libecal/e-cal.h b/calendar/libecal/e-cal.h
index 383d767..73f1dce 100644
--- a/calendar/libecal/e-cal.h
+++ b/calendar/libecal/e-cal.h
@@ -84,13 +84,13 @@ struct _ECalClass {
 	void (* cal_opened) (ECal *ecal, ECalendarStatus status);
 	void (* cal_set_mode) (ECal *ecal, ECalSetModeStatus status, CalMode mode);
 
-	void (* backend_error) (ECal *ecal, const char *message);
+	void (* backend_error) (ECal *ecal, const gchar *message);
 	void (* backend_died) (ECal *ecal);
 };
 
-typedef char * (* ECalAuthFunc) (ECal *ecal,
-				 const char *prompt,
-				 const char *key,
+typedef gchar * (* ECalAuthFunc) (ECal *ecal,
+				 const gchar *prompt,
+				 const gchar *key,
 				 gpointer user_data);
 
 GType e_cal_get_type (void);
@@ -118,17 +118,17 @@ ECalSourceType e_cal_get_source_type (ECal *ecal);
 ECalLoadState e_cal_get_load_state (ECal *ecal);
 
 ESource *e_cal_get_source (ECal *ecal);
-const char *e_cal_get_uri (ECal *ecal);
+const gchar *e_cal_get_uri (ECal *ecal);
 
 gboolean e_cal_is_read_only (ECal *ecal, gboolean *read_only, GError **error);
-gboolean e_cal_get_cal_address (ECal *ecal, char **cal_address, GError **error);
-gboolean e_cal_get_alarm_email_address (ECal *ecal, char **alarm_address, GError **error);
-gboolean e_cal_get_ldap_attribute (ECal *ecal, char **ldap_attribute, GError **error);
+gboolean e_cal_get_cal_address (ECal *ecal, gchar **cal_address, GError **error);
+gboolean e_cal_get_alarm_email_address (ECal *ecal, gchar **alarm_address, GError **error);
+gboolean e_cal_get_ldap_attribute (ECal *ecal, gchar **ldap_attribute, GError **error);
 
 gboolean e_cal_get_one_alarm_only (ECal *ecal);
 gboolean e_cal_get_organizer_must_attend (ECal *ecal);
 gboolean e_cal_get_save_schedules (ECal *ecal);
-gboolean e_cal_get_static_capability (ECal *ecal, const char *cap);
+gboolean e_cal_get_static_capability (ECal *ecal, const gchar *cap);
 gboolean e_cal_get_organizer_must_accept (ECal *ecal);
 
 gboolean e_cal_set_mode (ECal *ecal, CalMode mode);
@@ -137,20 +137,20 @@ gboolean e_cal_get_default_object (ECal *ecal,
 				   icalcomponent **icalcomp, GError **error);
 
 gboolean e_cal_get_object (ECal *ecal,
-			   const char *uid,
-			   const char *rid,
+			   const gchar *uid,
+			   const gchar *rid,
 			   icalcomponent **icalcomp,
 			   GError **error);
 gboolean e_cal_get_objects_for_uid (ECal *ecal,
-				    const char *uid,
+				    const gchar *uid,
 				    GList **objects,
 				    GError **error);
 
-gboolean e_cal_get_changes (ECal *ecal, const char *change_id, GList **changes, GError **error);
+gboolean e_cal_get_changes (ECal *ecal, const gchar *change_id, GList **changes, GError **error);
 void e_cal_free_change_list (GList *list);
 
-gboolean e_cal_get_object_list (ECal *ecal, const char *query, GList **objects, GError **error);
-gboolean e_cal_get_object_list_as_comp (ECal *ecal, const char *query, GList **objects, GError **error);
+gboolean e_cal_get_object_list (ECal *ecal, const gchar *query, GList **objects, GError **error);
+gboolean e_cal_get_object_list_as_comp (ECal *ecal, const gchar *query, GList **objects, GError **error);
 void e_cal_free_object_list (GList *objects);
 
 gboolean e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end,
@@ -170,17 +170,17 @@ gboolean e_cal_get_alarms_for_object (ECal *ecal, const ECalComponentId *id,
 				      time_t start, time_t end,
 				      ECalComponentAlarms **alarms);
 
-gboolean e_cal_create_object (ECal *ecal, icalcomponent *icalcomp, char **uid, GError **error);
+gboolean e_cal_create_object (ECal *ecal, icalcomponent *icalcomp, gchar **uid, GError **error);
 gboolean e_cal_modify_object (ECal *ecal, icalcomponent *icalcomp, CalObjModType mod, GError **error);
-gboolean e_cal_remove_object (ECal *ecal, const char *uid, GError **error);
-gboolean e_cal_remove_object_with_mod (ECal *ecal, const char *uid, const char *rid, CalObjModType mod, GError **error);
+gboolean e_cal_remove_object (ECal *ecal, const gchar *uid, GError **error);
+gboolean e_cal_remove_object_with_mod (ECal *ecal, const gchar *uid, const gchar *rid, CalObjModType mod, GError **error);
 
-gboolean e_cal_discard_alarm (ECal *ecal, ECalComponent *comp, const char *auid, GError **error);
+gboolean e_cal_discard_alarm (ECal *ecal, ECalComponent *comp, const gchar *auid, GError **error);
 
 gboolean e_cal_receive_objects (ECal *ecal, icalcomponent *icalcomp, GError **error);
 gboolean e_cal_send_objects (ECal *ecal, icalcomponent *icalcomp, GList **users, icalcomponent **modified_icalcomp, GError **error);
 
-gboolean e_cal_get_timezone (ECal *ecal, const char *tzid, icaltimezone **zone, GError **error);
+gboolean e_cal_get_timezone (ECal *ecal, const gchar *tzid, icaltimezone **zone, GError **error);
 gboolean e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error);
 /* Sets the default timezone to use to resolve DATE and floating DATE-TIME
    values. This will typically be from the user's timezone setting. Call this
@@ -188,25 +188,25 @@ gboolean e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error);
    the server. Returns TRUE on success. */
 gboolean e_cal_set_default_timezone (ECal *ecal, icaltimezone *zone, GError **error);
 
-gboolean e_cal_get_query (ECal *ecal, const char *sexp, ECalView **query, GError **error);
+gboolean e_cal_get_query (ECal *ecal, const gchar *sexp, ECalView **query, GError **error);
 
 /* Resolves TZIDs for the recurrence generator. */
-icaltimezone *e_cal_resolve_tzid_cb (const char *tzid, gpointer data);
+icaltimezone *e_cal_resolve_tzid_cb (const gchar *tzid, gpointer data);
 
 /* Returns a complete VCALENDAR for a VEVENT/VTODO including all VTIMEZONEs
    used by the component. It also includes a 'METHOD:PUBLISH' property. */
-char* e_cal_get_component_as_string (ECal *ecal, icalcomponent *icalcomp);
+gchar * e_cal_get_component_as_string (ECal *ecal, icalcomponent *icalcomp);
 
-const char * e_cal_get_error_message (ECalendarStatus status);
+const gchar * e_cal_get_error_message (ECalendarStatus status);
 
 /* Calendar/Tasks Discovery */
 gboolean    e_cal_open_default (ECal **ecal, ECalSourceType type, ECalAuthFunc func, gpointer data, GError **error);
 gboolean    e_cal_set_default (ECal  *ecal, GError **error);
 gboolean    e_cal_set_default_source (ESource *source, ECalSourceType type, GError **error);
 gboolean    e_cal_get_sources (ESourceList **sources, ECalSourceType type, GError **error);
-const char * e_cal_get_local_attachment_store (ECal *ecal);
+const gchar * e_cal_get_local_attachment_store (ECal *ecal);
 gboolean e_cal_get_recurrences_no_master (ECal *ecal);
-gboolean e_cal_get_attachments_for_comp (ECal *ecal, const char *uid, const char *rid, GSList **list, GError **error);
+gboolean e_cal_get_attachments_for_comp (ECal *ecal, const gchar *uid, const gchar *rid, GSList **list, GError **error);
 
 G_END_DECLS
 
diff --git a/calendar/libedata-cal/e-cal-backend-cache.c b/calendar/libedata-cal/e-cal-backend-cache.c
index e26fe61..aa7fed9 100644
--- a/calendar/libedata-cal/e-cal-backend-cache.c
+++ b/calendar/libedata-cal/e-cal-backend-cache.c
@@ -28,7 +28,7 @@
 #include "e-cal-backend-cache.h"
 
 struct _ECalBackendCachePrivate {
-	char *uri;
+	gchar *uri;
 	ECalSourceType source_type;
 	GHashTable *timezones;
 };
@@ -42,12 +42,12 @@ enum {
 
 static GObjectClass *parent_class = NULL;
 
-static char *
-get_filename_from_uri (const char *uri, ECalSourceType source_type)
+static gchar *
+get_filename_from_uri (const gchar *uri, ECalSourceType source_type)
 {
-	char *mangled_uri, *filename;
-	const char *source = NULL;
-	int i;
+	gchar *mangled_uri, *filename;
+	const gchar *source = NULL;
+	gint i;
 
 	switch (source_type) {
 		case E_CAL_SOURCE_TYPE_EVENT :
@@ -89,7 +89,7 @@ e_cal_backend_cache_set_property (GObject *object, guint property_id, const GVal
 {
 	ECalBackendCache *cache;
 	ECalBackendCachePrivate *priv;
-	char *cache_file;
+	gchar *cache_file;
 	ECalSourceType source_type;
 
 	cache = E_CAL_BACKEND_CACHE (object);
@@ -170,7 +170,7 @@ e_cal_backend_cache_constructor (GType type,
                                  GObjectConstructParam *construct_properties)
 {
 	GObject *obj;
-	const char *uri;
+	const gchar *uri;
 	ECalSourceType source_type = E_CAL_SOURCE_TYPE_EVENT;
 	ECalBackendCacheClass *klass;
 	GObjectClass *parent_class;
@@ -186,7 +186,7 @@ e_cal_backend_cache_constructor (GType type,
 		source_type = g_value_get_enum (construct_properties->value);
 	/* extract uid */
 	if (!g_ascii_strcasecmp ( g_param_spec_get_name (construct_properties->pspec), "uri")) {
-		char *cache_file;
+		gchar *cache_file;
 
 		uri = g_value_get_string (construct_properties->value);
 		cache_file = get_filename_from_uri (uri, source_type);
@@ -290,7 +290,7 @@ e_cal_backend_cache_get_type (void)
  * Return value: The newly created object.
  */
 ECalBackendCache *
-e_cal_backend_cache_new (const char *uri, ECalSourceType source_type)
+e_cal_backend_cache_new (const gchar *uri, ECalSourceType source_type)
 {
 	ECalBackendCache *cache;
 
@@ -299,11 +299,11 @@ e_cal_backend_cache_new (const char *uri, ECalSourceType source_type)
         return cache;
 }
 
-static char *
-get_key (const char *uid, const char *rid)
+static gchar *
+get_key (const gchar *uid, const gchar *rid)
 {
 	GString *real_key;
-	char *retval;
+	gchar *retval;
 
 	real_key = g_string_new (uid);
 	if (rid && *rid) {
@@ -330,10 +330,10 @@ get_key (const char *uid, const char *rid)
  * or %NULL if it was not found in the cache.
  */
 ECalComponent *
-e_cal_backend_cache_get_component (ECalBackendCache *cache, const char *uid, const char *rid)
+e_cal_backend_cache_get_component (ECalBackendCache *cache, const gchar *uid, const gchar *rid)
 {
-	char *real_key;
-	const char *comp_str;
+	gchar *real_key;
+	const gchar *comp_str;
 	icalcomponent *icalcomp;
 	ECalComponent *comp = NULL;
 
@@ -376,8 +376,8 @@ gboolean
 e_cal_backend_cache_put_component (ECalBackendCache *cache,
 				   ECalComponent *comp)
 {
-	char *real_key, *uid, *comp_str;
-	char *rid;
+	gchar *real_key, *uid, *comp_str;
+	gchar *rid;
 	gboolean retval;
 	ECalBackendCachePrivate *priv;
 
@@ -386,7 +386,7 @@ e_cal_backend_cache_put_component (ECalBackendCache *cache,
 
 	priv = cache->priv;
 
-	e_cal_component_get_uid (comp, (const char **) &uid);
+	e_cal_component_get_uid (comp, (const gchar **) &uid);
 	if (e_cal_component_is_instance (comp)) {
 		rid = e_cal_component_get_recurid_as_string (comp);
 	} else
@@ -420,10 +420,10 @@ e_cal_backend_cache_put_component (ECalBackendCache *cache,
  */
 gboolean
 e_cal_backend_cache_remove_component (ECalBackendCache *cache,
-				      const char *uid,
-				      const char *rid)
+				      const gchar *uid,
+				      const gchar *rid)
 {
-	char *real_key;
+	gchar *real_key;
 	gboolean retval;
 	ECalBackendCachePrivate *priv;
 
@@ -456,7 +456,7 @@ e_cal_backend_cache_remove_component (ECalBackendCache *cache,
 GList *
 e_cal_backend_cache_get_components (ECalBackendCache *cache)
 {
-        char *comp_str;
+        gchar *comp_str;
         GSList *l;
 	GList *list = NULL;
 	icalcomponent *icalcomp;
@@ -503,9 +503,9 @@ e_cal_backend_cache_get_components (ECalBackendCache *cache)
  * Return value: The list of calendar components if found, or NULL otherwise.
  */
 GSList *
-e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const char *uid)
+e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const gchar *uid)
 {
-        char *comp_str;
+        gchar *comp_str;
         GSList *l;
 	GSList *list = NULL;
 	icalcomponent *icalcomp;
@@ -552,10 +552,10 @@ e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const char *
  * Return value: The timezone if found, or NULL otherwise.
  */
 const icaltimezone *
-e_cal_backend_cache_get_timezone (ECalBackendCache *cache, const char *tzid)
+e_cal_backend_cache_get_timezone (ECalBackendCache *cache, const gchar *tzid)
 {
 	icaltimezone *zone;
-	const char *comp_str;
+	const gchar *comp_str;
 	ECalBackendCachePrivate *priv;
 
 	g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
@@ -606,7 +606,7 @@ e_cal_backend_cache_put_timezone (ECalBackendCache *cache, const icaltimezone *z
 	icaltimezone *new_zone;
 	icalcomponent *icalcomp;
 	gboolean retval;
-	char *obj;
+	gchar *obj;
 
 	g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), FALSE);
 	g_return_val_if_fail (zone != NULL, FALSE);
@@ -656,7 +656,7 @@ e_cal_backend_cache_put_default_timezone (ECalBackendCache *cache, icaltimezone
 	ECalBackendCachePrivate *priv;
 	icalcomponent *icalcomp;
 	gboolean retval;
-	char *obj;
+	gchar *obj;
 
 	g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), FALSE);
 
@@ -698,7 +698,7 @@ icaltimezone *
 e_cal_backend_cache_get_default_timezone (ECalBackendCache *cache)
 {
 	icaltimezone *zone;
-	const char *comp_str;
+	const gchar *comp_str;
 	ECalBackendCachePrivate *priv;
 
 	g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
@@ -735,7 +735,7 @@ e_cal_backend_cache_get_default_timezone (ECalBackendCache *cache)
  * Return value: TRUE if the timezone was removed, FALSE otherwise.
  */
 gboolean
-e_cal_backend_cache_remove_timezone (ECalBackendCache *cache, const char *tzid)
+e_cal_backend_cache_remove_timezone (ECalBackendCache *cache, const gchar *tzid)
 {
 	ECalBackendCachePrivate *priv;
 
@@ -788,7 +788,7 @@ e_cal_backend_cache_set_marker (ECalBackendCache *cache)
  *
  * Return value: The value of the marker or NULL if the cache is still empty.
  */
-const char *
+const gchar *
 e_cal_backend_cache_get_marker (ECalBackendCache *cache)
 {
 	g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
@@ -805,7 +805,7 @@ e_cal_backend_cache_get_marker (ECalBackendCache *cache)
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  */
 gboolean
-e_cal_backend_cache_put_server_utc_time (ECalBackendCache *cache, const char *utc_str)
+e_cal_backend_cache_put_server_utc_time (ECalBackendCache *cache, const gchar *utc_str)
 {
 	gboolean ret_val = FALSE;
 
@@ -823,7 +823,7 @@ e_cal_backend_cache_put_server_utc_time (ECalBackendCache *cache, const char *ut
  *
  * Return value: The server's UTC string.
  */
-const char *
+const gchar *
 e_cal_backend_cache_get_server_utc_time (ECalBackendCache *cache)
 {
 
@@ -832,8 +832,8 @@ e_cal_backend_cache_get_server_utc_time (ECalBackendCache *cache)
 	return	e_file_cache_get_object (E_FILE_CACHE (cache), "server_utc_time");
 }
 
-static char *
-get_keys_key (const char *key)
+static gchar *
+get_keys_key (const gchar *key)
 {
 	g_return_val_if_fail (key != NULL, NULL);
 
@@ -849,9 +849,9 @@ get_keys_key (const char *key)
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  */
 gboolean
-e_cal_backend_cache_put_key_value (ECalBackendCache *cache, const char *key, const char *value)
+e_cal_backend_cache_put_key_value (ECalBackendCache *cache, const gchar *key, const gchar *value)
 {
-	char *real_key;
+	gchar *real_key;
 	gboolean ret_val = FALSE;
 
 	g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), FALSE);
@@ -877,11 +877,11 @@ e_cal_backend_cache_put_key_value (ECalBackendCache *cache, const char *key, con
  *
  * Return value: The value.
  */
-const char *
-e_cal_backend_cache_get_key_value (ECalBackendCache *cache, const char *key)
+const gchar *
+e_cal_backend_cache_get_key_value (ECalBackendCache *cache, const gchar *key)
 {
-	char *real_key;
-	const char *value;
+	gchar *real_key;
+	const gchar *value;
 
 	g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
 
diff --git a/calendar/libedata-cal/e-cal-backend-cache.h b/calendar/libedata-cal/e-cal-backend-cache.h
index c1b7543..725a22e 100644
--- a/calendar/libedata-cal/e-cal-backend-cache.h
+++ b/calendar/libedata-cal/e-cal-backend-cache.h
@@ -47,36 +47,36 @@ typedef struct {
 
 GType               e_cal_backend_cache_get_type (void);
 
-ECalBackendCache   *e_cal_backend_cache_new (const char *uri, ECalSourceType source_type);
+ECalBackendCache   *e_cal_backend_cache_new (const gchar *uri, ECalSourceType source_type);
 ECalComponent      *e_cal_backend_cache_get_component (ECalBackendCache *cache,
-						       const char *uid,
-						       const char *rid);
+						       const gchar *uid,
+						       const gchar *rid);
 gboolean            e_cal_backend_cache_put_component (ECalBackendCache *cache, ECalComponent *comp);
 gboolean            e_cal_backend_cache_remove_component (ECalBackendCache *cache,
-							  const char *uid,
-							  const char *rid);
+							  const gchar *uid,
+							  const gchar *rid);
 GList              *e_cal_backend_cache_get_components (ECalBackendCache *cache);
-GSList             *e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const char *uid);
+GSList             *e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const gchar *uid);
 
 
 
-const icaltimezone *e_cal_backend_cache_get_timezone (ECalBackendCache *cache, const char *tzid);
+const icaltimezone *e_cal_backend_cache_get_timezone (ECalBackendCache *cache, const gchar *tzid);
 gboolean            e_cal_backend_cache_put_timezone (ECalBackendCache *cache, const icaltimezone *zone);
-gboolean            e_cal_backend_cache_remove_timezone (ECalBackendCache *cache, const char *tzid);
+gboolean            e_cal_backend_cache_remove_timezone (ECalBackendCache *cache, const gchar *tzid);
 
 gboolean            e_cal_backend_cache_put_default_timezone (ECalBackendCache *cache, icaltimezone *default_zone);
 icaltimezone       *e_cal_backend_cache_get_default_timezone (ECalBackendCache *cache);
 
 GSList             *e_cal_backend_cache_get_keys (ECalBackendCache *cache);
 
-const char         *e_cal_backend_cache_get_marker (ECalBackendCache *cache);
+const gchar         *e_cal_backend_cache_get_marker (ECalBackendCache *cache);
 void                e_cal_backend_cache_set_marker (ECalBackendCache *cache);
 
-gboolean e_cal_backend_cache_put_server_utc_time (ECalBackendCache *cache, const char *utc_str);
-const char * e_cal_backend_cache_get_server_utc_time (ECalBackendCache *cache);
+gboolean e_cal_backend_cache_put_server_utc_time (ECalBackendCache *cache, const gchar *utc_str);
+const gchar * e_cal_backend_cache_get_server_utc_time (ECalBackendCache *cache);
 
-gboolean e_cal_backend_cache_put_key_value (ECalBackendCache *cache, const char *key, const char *value);
-const char * e_cal_backend_cache_get_key_value (ECalBackendCache *cache, const char *key);
+gboolean e_cal_backend_cache_put_key_value (ECalBackendCache *cache, const gchar *key, const gchar *value);
+const gchar * e_cal_backend_cache_get_key_value (ECalBackendCache *cache, const gchar *key);
 
 G_END_DECLS
 
diff --git a/calendar/libedata-cal/e-cal-backend-factory.c b/calendar/libedata-cal/e-cal-backend-factory.c
index 64d2808..2bb1aaf 100644
--- a/calendar/libedata-cal/e-cal-backend-factory.c
+++ b/calendar/libedata-cal/e-cal-backend-factory.c
@@ -73,7 +73,7 @@ e_cal_backend_factory_get_kind (ECalBackendFactory *factory)
  *
  * Return value: The protocol.
  */
-const char*
+const gchar *
 e_cal_backend_factory_get_protocol (ECalBackendFactory *factory)
 {
 	g_return_val_if_fail (E_IS_CAL_BACKEND_FACTORY (factory), NULL);
diff --git a/calendar/libedata-cal/e-cal-backend-factory.h b/calendar/libedata-cal/e-cal-backend-factory.h
index ce32399..c572750 100644
--- a/calendar/libedata-cal/e-cal-backend-factory.h
+++ b/calendar/libedata-cal/e-cal-backend-factory.h
@@ -45,14 +45,14 @@ typedef struct {
 	GObjectClass parent_class;
 
 	icalcomponent_kind (*get_kind)     (ECalBackendFactory *factory);
-	const char*        (*get_protocol) (ECalBackendFactory *factory);
+	const gchar *        (*get_protocol) (ECalBackendFactory *factory);
 	ECalBackend*       (*new_backend)  (ECalBackendFactory *factory, ESource *source);
 } ECalBackendFactoryClass;
 
 GType               e_cal_backend_factory_get_type              (void);
 
 icalcomponent_kind  e_cal_backend_factory_get_kind              (ECalBackendFactory *factory);
-const char*         e_cal_backend_factory_get_protocol          (ECalBackendFactory *factory);
+const gchar *         e_cal_backend_factory_get_protocol          (ECalBackendFactory *factory);
 ECalBackend*        e_cal_backend_factory_new_backend           (ECalBackendFactory *factory, ESource *source);
 
 G_END_DECLS
diff --git a/calendar/libedata-cal/e-cal-backend-loader-factory.h b/calendar/libedata-cal/e-cal-backend-loader-factory.h
index fd97f74..bf13e59 100644
--- a/calendar/libedata-cal/e-cal-backend-loader-factory.h
+++ b/calendar/libedata-cal/e-cal-backend-loader-factory.h
@@ -45,7 +45,7 @@ typedef struct {
 	ECalBackendFactoryClass parent_class;
 
 	GSList*	   (*get_protocol_list) (ECalBackendLoaderFactory *factory);
-	ECalBackend*	   (*new_backend_with_protocol) (ECalBackendLoaderFactory *factory, ESource *source, const char *protocol);
+	ECalBackend*	   (*new_backend_with_protocol) (ECalBackendLoaderFactory *factory, ESource *source, const gchar *protocol);
 } ECalBackendLoaderFactoryClass;
 
 GType               e_cal_backend_loader_factory_get_type              (void);
diff --git a/calendar/libedata-cal/e-cal-backend-sexp.c b/calendar/libedata-cal/e-cal-backend-sexp.c
index 5ae5a9b..fef2356 100644
--- a/calendar/libedata-cal/e-cal-backend-sexp.c
+++ b/calendar/libedata-cal/e-cal-backend-sexp.c
@@ -35,7 +35,7 @@ typedef struct _SearchContext SearchContext;
 
 struct _ECalBackendSExpPrivate {
 	ESExp *search_sexp;
-	char *text;
+	gchar *text;
 	SearchContext *search_context;
 };
 
@@ -45,7 +45,7 @@ struct _SearchContext {
 	gboolean occurs;
 };
 
-static ESExpResult *func_is_completed (ESExp *esexp, int argc, ESExpResult **argv, void *data);
+static ESExpResult *func_is_completed (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data);
 
 /**
  * e_cal_backend_sexp_func_time_now:
@@ -59,7 +59,7 @@ static ESExpResult *func_is_completed (ESExp *esexp, int argc, ESExpResult **arg
  * Return value: The result of the function.
  */
 ESExpResult *
-e_cal_backend_sexp_func_time_now (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+e_cal_backend_sexp_func_time_now (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	ESExpResult *result;
 
@@ -90,9 +90,9 @@ e_cal_backend_sexp_func_time_now (ESExp *esexp, int argc, ESExpResult **argv, vo
  * Return value: The result of the function.
  */
 ESExpResult *
-e_cal_backend_sexp_func_make_time (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+e_cal_backend_sexp_func_make_time (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
-	const char *str;
+	const gchar *str;
 	time_t t;
 	ESExpResult *result;
 
@@ -150,11 +150,11 @@ e_cal_backend_sexp_func_make_time (ESExp *esexp, int argc, ESExpResult **argv, v
  * Return value: The result of the function.
  */
 ESExpResult *
-e_cal_backend_sexp_func_time_add_day (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+e_cal_backend_sexp_func_time_add_day (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	ESExpResult *result;
 	time_t t;
-	int n;
+	gint n;
 
 	if (argc != 2) {
 		e_sexp_fatal_error (esexp, _("\"%s\" expects two arguments"),
@@ -201,7 +201,7 @@ e_cal_backend_sexp_func_time_add_day (ESExp *esexp, int argc, ESExpResult **argv
  * Return value: The result of the function.
  */
 ESExpResult *
-e_cal_backend_sexp_func_time_day_begin (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+e_cal_backend_sexp_func_time_day_begin (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	time_t t;
 	ESExpResult *result;
@@ -243,7 +243,7 @@ e_cal_backend_sexp_func_time_day_begin (ESExp *esexp, int argc, ESExpResult **ar
  * Return value: The result of the function.
  */
 ESExpResult *
-e_cal_backend_sexp_func_time_day_end (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+e_cal_backend_sexp_func_time_day_end (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	time_t t;
 	ESExpResult *result;
@@ -275,10 +275,10 @@ e_cal_backend_sexp_func_time_day_end (ESExp *esexp, int argc, ESExpResult **argv
  * Returns a boolean indicating whether the component has the given UID
  */
 static ESExpResult *
-func_uid (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_uid (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
-	const char *uid = NULL, *arg_uid;
+	const gchar *uid = NULL, *arg_uid;
 	gboolean equal;
 	ESExpResult *result;
 
@@ -327,7 +327,7 @@ check_instance_time_range_cb (ECalComponent *comp, time_t instance_start, time_t
 }
 
 static icaltimezone *
-resolve_tzid (const char *tzid, gpointer user_data)
+resolve_tzid (const gchar *tzid, gpointer user_data)
 {
 	SearchContext *ctx = user_data;
 
@@ -348,7 +348,7 @@ resolve_tzid (const char *tzid, gpointer user_data)
  * specified time range.
  */
 static ESExpResult *
-func_occur_in_time_range (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_occur_in_time_range (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	time_t start, end;
@@ -397,7 +397,7 @@ func_occur_in_time_range (ESExp *esexp, int argc, ESExpResult **argv, void *data
 }
 
 static ESExpResult *
-func_due_in_time_range (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_due_in_time_range (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	time_t start, end;
@@ -458,7 +458,7 @@ func_due_in_time_range (ESExp *esexp, int argc, ESExpResult **argv, void *data)
 
 /* Returns whether a list of ECalComponentText items matches the specified string */
 static gboolean
-matches_text_list (GSList *text_list, const char *str)
+matches_text_list (GSList *text_list, const gchar *str)
 {
 	GSList *l;
 	gboolean matches;
@@ -482,7 +482,7 @@ matches_text_list (GSList *text_list, const char *str)
 
 /* Returns whether the comments in a component matches the specified string */
 static gboolean
-matches_comment (ECalComponent *comp, const char *str)
+matches_comment (ECalComponent *comp, const gchar *str)
 {
 	GSList *list;
 	gboolean matches;
@@ -496,7 +496,7 @@ matches_comment (ECalComponent *comp, const char *str)
 
 /* Returns whether the description in a component matches the specified string */
 static gboolean
-matches_description (ECalComponent *comp, const char *str)
+matches_description (ECalComponent *comp, const gchar *str)
 {
 	GSList *list;
 	gboolean matches;
@@ -509,7 +509,7 @@ matches_description (ECalComponent *comp, const char *str)
 }
 
 static gboolean
-matches_attendee (ECalComponent *comp, const char *str)
+matches_attendee (ECalComponent *comp, const gchar *str)
 {
 	GSList *a_list = NULL, *l;
 	gboolean matches = FALSE;
@@ -533,7 +533,7 @@ matches_attendee (ECalComponent *comp, const char *str)
 }
 
 static gboolean
-matches_organizer (ECalComponent *comp, const char *str)
+matches_organizer (ECalComponent *comp, const gchar *str)
 {
 
 	ECalComponentOrganizer org;
@@ -550,7 +550,7 @@ matches_organizer (ECalComponent *comp, const char *str)
 }
 
 static gboolean
-matches_classification (ECalComponent *comp, const char *str)
+matches_classification (ECalComponent *comp, const gchar *str)
 {
 	ECalComponentClassification classification;
 	ECalComponentClassification classification1;
@@ -574,7 +574,7 @@ matches_classification (ECalComponent *comp, const char *str)
 
 /* Returns whether the summary in a component matches the specified string */
 static gboolean
-matches_summary (ECalComponent *comp, const char *str)
+matches_summary (ECalComponent *comp, const gchar *str)
 {
 	ECalComponentText text;
 
@@ -591,9 +591,9 @@ matches_summary (ECalComponent *comp, const char *str)
 
 /* Returns whether the location in a component matches the specified string */
 static gboolean
-matches_location (ECalComponent *comp, const char *str)
+matches_location (ECalComponent *comp, const gchar *str)
 {
-	const char *location = NULL;
+	const gchar *location = NULL;
 
 	e_cal_component_get_location (comp, &location);
 
@@ -605,7 +605,7 @@ matches_location (ECalComponent *comp, const char *str)
 
 /* Returns whether any text field in a component matches the specified string */
 static gboolean
-matches_any (ECalComponent *comp, const char *str)
+matches_any (ECalComponent *comp, const gchar *str)
 {
 	/* As an optimization, and to make life easier for the individual
 	 * predicate functions, see if we are looking for the empty string right
@@ -621,9 +621,9 @@ matches_any (ECalComponent *comp, const char *str)
 }
 
 static gboolean
-matches_priority (ECalComponent *comp ,const char *pr)
+matches_priority (ECalComponent *comp ,const gchar *pr)
 {
-	int *priority = NULL;
+	gint *priority = NULL;
 
 	e_cal_component_get_priority (comp, &priority);
 
@@ -643,7 +643,7 @@ matches_priority (ECalComponent *comp ,const char *pr)
 }
 
 static gboolean
-matches_status (ECalComponent *comp ,const char *str)
+matches_status (ECalComponent *comp ,const gchar *str)
 {
 	icalproperty_status status ;
 
@@ -665,7 +665,7 @@ matches_status (ECalComponent *comp ,const char *str)
 }
 
 static ESExpResult *
-func_has_attachment (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_has_attachment (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *result;
@@ -683,11 +683,11 @@ func_has_attachment (ESExp *esexp, int argc, ESExpResult **argv, void *data)
 }
 
 static ESExpResult *
-func_percent_complete (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_percent_complete (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *result = NULL;
-	int *percent;
+	gint *percent;
 
 	if (argc != 0) {
 		e_sexp_fatal_error (esexp, _("\"%s\" expects no arguments"),
@@ -715,11 +715,11 @@ func_percent_complete (ESExp *esexp, int argc, ESExpResult **argv, void *data)
  * specified string.
  */
 static ESExpResult *
-func_contains (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_contains (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
-	const char *field;
-	const char *str;
+	const gchar *field;
+	const gchar *str;
 	gboolean matches;
 	ESExpResult *result;
 
@@ -790,7 +790,7 @@ func_contains (ESExp *esexp, int argc, ESExpResult **argv, void *data)
  * Returns: a boolean indicating whether the component has start date/time filled or not.
  */
 static ESExpResult *
-func_has_start (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_has_start (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *result;
@@ -819,7 +819,7 @@ func_has_start (ESExp *esexp, int argc, ESExpResult **argv, void *data)
  * Returns: a boolean indicating whether the component has alarms or not.
  */
 static ESExpResult *
-func_has_alarms (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_has_alarms (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *result;
@@ -847,7 +847,7 @@ func_has_alarms (ESExp *esexp, int argc, ESExpResult **argv, void *data)
  * time range or not.
  */
 static ESExpResult *
-func_has_alarms_in_range (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_has_alarms_in_range (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	time_t start, end;
 	ESExpResult *result;
@@ -910,11 +910,11 @@ func_has_alarms_in_range (ESExp *esexp, int argc, ESExpResult **argv, void *data
  * categories.
  */
 static ESExpResult *
-func_has_categories (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_has_categories (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	gboolean unfiled;
-	int i;
+	gint i;
 	GSList *categories;
 	gboolean matches;
 	ESExpResult *result;
@@ -972,7 +972,7 @@ func_has_categories (ESExp *esexp, int argc, ESExpResult **argv, void *data)
 	matches = TRUE;
 
 	for (i = 0; i < argc; i++) {
-		const char *sought;
+		const gchar *sought;
 		GSList *l;
 		gboolean has_category;
 
@@ -981,7 +981,7 @@ func_has_categories (ESExp *esexp, int argc, ESExpResult **argv, void *data)
 		has_category = FALSE;
 
 		for (l = categories; l; l = l->next) {
-			const char *category;
+			const gchar *category;
 
 			category = l->data;
 
@@ -1012,7 +1012,7 @@ func_has_categories (ESExp *esexp, int argc, ESExpResult **argv, void *data)
  * Returns: a boolean indicating whether the component has recurrences or not.
  */
 static ESExpResult *
-func_has_recurrences (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_has_recurrences (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *result;
@@ -1037,7 +1037,7 @@ func_has_recurrences (ESExp *esexp, int argc, ESExpResult **argv, void *data)
  * a COMPLETED property. This is really only useful for TODO components.
  */
 static ESExpResult *
-func_is_completed (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_is_completed (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *result;
@@ -1073,7 +1073,7 @@ func_is_completed (ESExp *esexp, int argc, ESExpResult **argv, void *data)
  * This is really only useful for TODO components.
  */
 static ESExpResult *
-func_completed_before (ESExp *esexp, int argc, ESExpResult **argv, void *data)
+func_completed_before (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
 {
 	SearchContext *ctx = data;
 	ESExpResult *result;
@@ -1130,15 +1130,15 @@ func_completed_before (ESExp *esexp, int argc, ESExpResult **argv, void *data)
 #if 0
 static struct prop_info {
 	ECardSimpleField field_id;
-	const char *query_prop;
-	const char *ecard_prop;
+	const gchar *query_prop;
+	const gchar *ecard_prop;
 #define PROP_TYPE_NORMAL   0x01
 #define PROP_TYPE_LIST     0x02
 #define PROP_TYPE_LISTITEM 0x03
 #define PROP_TYPE_ID 0x04
-	int prop_type;
-	gboolean (*list_compare)(ECardSimple *ecard, const char *str,
-				 char *(*compare)(const char*, const char*));
+	gint prop_type;
+	gboolean (*list_compare)(ECardSimple *ecard, const gchar *str,
+				 gchar *(*compare)(const gchar *, const gchar *));
 
 } prop_info_table[] = {
 #define NORMAL_PROP(f,q,e) {f, q, e, PROP_TYPE_NORMAL, NULL}
@@ -1167,22 +1167,22 @@ static struct prop_info {
 	LIST_PROP ( "category", "category", compare_category ),
 	LIST_PROP ( "arbitrary", "arbitrary", compare_arbitrary )
 };
-static int num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]);
+static gint num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]);
 
 static ESExpResult *
 entry_compare(SearchContext *ctx, struct _ESExp *f,
-	      int argc, struct _ESExpResult **argv,
-	      char *(*compare)(const char*, const char*))
+	      gint argc, struct _ESExpResult **argv,
+	      gchar *(*compare)(const gchar *, const gchar *))
 {
 	ESExpResult *r;
-	int truth = FALSE;
+	gint truth = FALSE;
 
 	if (argc == 2
 	    && argv[0]->type == ESEXP_RES_STRING
 	    && argv[1]->type == ESEXP_RES_STRING) {
-		char *propname;
+		gchar *propname;
 		struct prop_info *info = NULL;
-		int i;
+		gint i;
 		gboolean any_field;
 
 		propname = argv[0]->value.string;
@@ -1194,7 +1194,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
 				info = &prop_info_table[i];
 
 				if (info->prop_type == PROP_TYPE_NORMAL) {
-					char *prop = NULL;
+					gchar *prop = NULL;
 					/* searches where the query's property
 					   maps directly to an ecard property */
 
@@ -1211,7 +1211,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
 				/* the special searches that match any of the list elements */
 					truth = info->list_compare (ctx->card, argv[1]->value.string, compare);
 				} else if (info->prop_type == PROP_TYPE_ID) {
-					const char *prop = NULL;
+					const gchar *prop = NULL;
 					/* searches where the query's property
 					   maps directly to an ecard property */
 
@@ -1244,9 +1244,9 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
 
 /* '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[] = {
 	/* Time-related functions */
@@ -1322,13 +1322,13 @@ e_cal_backend_sexp_match_comp (ECalBackendSExp *sexp, ECalComponent *comp, ECalB
  * Return value: TRUE if the object matches the expression, FALSE if not.
  */
 gboolean
-e_cal_backend_sexp_match_object (ECalBackendSExp *sexp, const char *object, ECalBackend *backend)
+e_cal_backend_sexp_match_object (ECalBackendSExp *sexp, const gchar *object, ECalBackend *backend)
 {
 	ECalComponent *comp;
 	icalcomponent *icalcomp;
 	gboolean retval;
 
-	icalcomp = icalcomponent_new_from_string ((char *) object);
+	icalcomp = icalcomponent_new_from_string ((gchar *) object);
 	if (!icalcomp)
 		return FALSE;
 
@@ -1353,11 +1353,11 @@ e_cal_backend_sexp_match_object (ECalBackendSExp *sexp, const char *object, ECal
  * Return value: The newly created ECalBackendSExp object.
  */
 ECalBackendSExp *
-e_cal_backend_sexp_new (const char *text)
+e_cal_backend_sexp_new (const gchar *text)
 {
 	ECalBackendSExp *sexp = g_object_new (E_TYPE_CAL_BACKEND_SEXP, NULL);
-	int esexp_error;
-	int i;
+	gint esexp_error;
+	gint i;
 
 	sexp->priv->search_sexp = e_sexp_new();
 	sexp->priv->text = g_strdup (text);
@@ -1391,7 +1391,7 @@ e_cal_backend_sexp_new (const char *text)
  *
  * Return value: The text expression.
  */
-const char *
+const gchar *
 e_cal_backend_sexp_text (ECalBackendSExp *sexp)
 {
 	ECalBackendSExpPrivate *priv;
diff --git a/calendar/libedata-cal/e-cal-backend-sexp.h b/calendar/libedata-cal/e-cal-backend-sexp.h
index 28f0eb3..f49f888 100644
--- a/calendar/libedata-cal/e-cal-backend-sexp.h
+++ b/calendar/libedata-cal/e-cal-backend-sexp.h
@@ -53,11 +53,11 @@ struct _ECalBackendSExpClass {
 
 GType            e_cal_backend_sexp_get_type     (void);
 
-ECalBackendSExp *e_cal_backend_sexp_new          (const char      *text);
-const char      *e_cal_backend_sexp_text         (ECalBackendSExp *sexp);
+ECalBackendSExp *e_cal_backend_sexp_new          (const gchar      *text);
+const gchar      *e_cal_backend_sexp_text         (ECalBackendSExp *sexp);
 
 gboolean         e_cal_backend_sexp_match_object (ECalBackendSExp *sexp,
-						  const char      *object,
+						  const gchar      *object,
 						  ECalBackend     *backend);
 gboolean         e_cal_backend_sexp_match_comp   (ECalBackendSExp *sexp,
 						  ECalComponent   *comp,
@@ -66,11 +66,11 @@ gboolean         e_cal_backend_sexp_match_comp   (ECalBackendSExp *sexp,
 
 /* Default implementations of time functions for use by subclasses */
 
-ESExpResult *e_cal_backend_sexp_func_time_now       (ESExp *esexp, int argc, ESExpResult **argv, void *data);
-ESExpResult *e_cal_backend_sexp_func_make_time      (ESExp *esexp, int argc, ESExpResult **argv, void *data);
-ESExpResult *e_cal_backend_sexp_func_time_add_day   (ESExp *esexp, int argc, ESExpResult **argv, void *data);
-ESExpResult *e_cal_backend_sexp_func_time_day_begin (ESExp *esexp, int argc, ESExpResult **argv, void *data);
-ESExpResult *e_cal_backend_sexp_func_time_day_end   (ESExp *esexp, int argc, ESExpResult **argv, void *data);
+ESExpResult *e_cal_backend_sexp_func_time_now       (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data);
+ESExpResult *e_cal_backend_sexp_func_make_time      (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data);
+ESExpResult *e_cal_backend_sexp_func_time_add_day   (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data);
+ESExpResult *e_cal_backend_sexp_func_time_day_begin (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data);
+ESExpResult *e_cal_backend_sexp_func_time_day_end   (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data);
 
 
 G_END_DECLS
diff --git a/calendar/libedata-cal/e-cal-backend-sync.c b/calendar/libedata-cal/e-cal-backend-sync.c
index dd69aa2..10fdf8a 100644
--- a/calendar/libedata-cal/e-cal-backend-sync.c
+++ b/calendar/libedata-cal/e-cal-backend-sync.c
@@ -82,7 +82,7 @@ e_cal_backend_sync_is_read_only  (ECalBackendSync *backend, EDataCal *cal, gbool
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_cal_address  (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_sync_get_cal_address  (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	ECalBackendSyncStatus status;
 
@@ -105,7 +105,7 @@ e_cal_backend_sync_get_cal_address  (ECalBackendSync *backend, EDataCal *cal, ch
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_alarm_email_address  (ECalBackendSync *backend, EDataCal *cal, char **address)
+e_cal_backend_sync_get_alarm_email_address  (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	ECalBackendSyncStatus status;
 
@@ -128,7 +128,7 @@ e_cal_backend_sync_get_alarm_email_address  (ECalBackendSync *backend, EDataCal
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_ldap_attribute  (ECalBackendSync *backend, EDataCal *cal, char **attribute)
+e_cal_backend_sync_get_ldap_attribute  (ECalBackendSync *backend, EDataCal *cal, gchar **attribute)
 {
 	ECalBackendSyncStatus status;
 
@@ -151,7 +151,7 @@ e_cal_backend_sync_get_ldap_attribute  (ECalBackendSync *backend, EDataCal *cal,
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_static_capabilities  (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
+e_cal_backend_sync_get_static_capabilities  (ECalBackendSync *backend, EDataCal *cal, gchar **capabilities)
 {
 	ECalBackendSyncStatus status;
 
@@ -178,7 +178,7 @@ e_cal_backend_sync_get_static_capabilities  (ECalBackendSync *backend, EDataCal
  */
 ECalBackendSyncStatus
 e_cal_backend_sync_open  (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,
-			  const char *username, const char *password)
+			  const gchar *username, const gchar *password)
 {
 	ECalBackendSyncStatus status;
 
@@ -222,7 +222,7 @@ e_cal_backend_sync_remove  (ECalBackendSync *backend, EDataCal *cal)
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
+e_cal_backend_sync_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid)
 {
 	ECalBackendSyncStatus status;
 
@@ -251,8 +251,8 @@ e_cal_backend_sync_create_object (ECalBackendSync *backend, EDataCal *cal, char
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj,
-				  CalObjModType mod, char **old_object, char **new_object)
+e_cal_backend_sync_modify_object (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj,
+				  CalObjModType mod, gchar **old_object, gchar **new_object)
 {
 	ECalBackendSyncStatus status;
 
@@ -284,8 +284,8 @@ e_cal_backend_sync_modify_object (ECalBackendSync *backend, EDataCal *cal, const
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_remove_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid,
-				  CalObjModType mod, char **old_object, char **object)
+e_cal_backend_sync_remove_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid,
+				  CalObjModType mod, gchar **old_object, gchar **object)
 {
 	ECalBackendSyncStatus status;
 
@@ -310,7 +310,7 @@ e_cal_backend_sync_remove_object (ECalBackendSync *backend, EDataCal *cal, const
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
+e_cal_backend_sync_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 	ECalBackendSyncStatus status;
 
@@ -334,7 +334,7 @@ e_cal_backend_sync_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_sync_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendSyncStatus status;
 
@@ -360,8 +360,8 @@ e_cal_backend_sync_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_send_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj, GList **users,
-				 char **modified_calobj)
+e_cal_backend_sync_send_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, GList **users,
+				 gchar **modified_calobj)
 {
 	ECalBackendSyncStatus status;
 
@@ -385,7 +385,7 @@ e_cal_backend_sync_send_objects (ECalBackendSync *backend, EDataCal *cal, const
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
+e_cal_backend_sync_get_default_object (ECalBackendSync *backend, EDataCal *cal, gchar **object)
 {
 	ECalBackendSyncStatus status;
 
@@ -411,7 +411,7 @@ e_cal_backend_sync_get_default_object (ECalBackendSync *backend, EDataCal *cal,
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
+e_cal_backend_sync_get_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, gchar **object)
 {
 	ECalBackendSyncStatus status;
 
@@ -435,7 +435,7 @@ e_cal_backend_sync_get_object (ECalBackendSync *backend, EDataCal *cal, const ch
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects)
+e_cal_backend_sync_get_object_list (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp, GList **objects)
 {
 	ECalBackendSyncStatus status;
 
@@ -460,7 +460,7 @@ e_cal_backend_sync_get_object_list (ECalBackendSync *backend, EDataCal *cal, con
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **attachments)
+e_cal_backend_sync_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, GSList **attachments)
 {
 	ECalBackendSyncStatus status;
 
@@ -484,7 +484,7 @@ e_cal_backend_sync_get_attachment_list (ECalBackendSync *backend, EDataCal *cal,
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
+e_cal_backend_sync_get_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object)
 {
 	ECalBackendSyncStatus status;
 
@@ -506,7 +506,7 @@ e_cal_backend_sync_get_timezone (ECalBackendSync *backend, EDataCal *cal, const
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_sync_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	ECalBackendSyncStatus status;
 
@@ -528,7 +528,7 @@ e_cal_backend_sync_add_timezone (ECalBackendSync *backend, EDataCal *cal, const
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tz)
+e_cal_backend_sync_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tz)
 {
 	ECalBackendSyncStatus status;
 
@@ -537,7 +537,7 @@ e_cal_backend_sync_set_default_zone (ECalBackendSync *backend, EDataCal *cal, co
 	/* Old backends might be using the set_default_timezone */
 	if (!E_CAL_BACKEND_SYNC_GET_CLASS (backend)->set_default_zone_sync) {
 		icalcomponent *icalcomp = icalparser_parse_string (tz);
-		const char *tzid = NULL;
+		const gchar *tzid = NULL;
 		icaltimezone *zone = icaltimezone_new ();
 
 		if (icalcomp) {
@@ -572,7 +572,7 @@ e_cal_backend_sync_set_default_zone (ECalBackendSync *backend, EDataCal *cal, co
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_set_default_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid)
+e_cal_backend_sync_set_default_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid)
 {
 	ECalBackendSyncStatus status;
 
@@ -597,7 +597,7 @@ e_cal_backend_sync_set_default_timezone (ECalBackendSync *backend, EDataCal *cal
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id,
+e_cal_backend_sync_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id,
 				GList **adds, GList **modifies, GList **deletes)
 {
 	ECalBackendSyncStatus status;
@@ -650,7 +650,7 @@ static void
 _e_cal_backend_get_cal_address (ECalBackend *backend, EDataCal *cal)
 {
 	ECalBackendSyncStatus status;
-	char *address = NULL;
+	gchar *address = NULL;
 
 	status = e_cal_backend_sync_get_cal_address (E_CAL_BACKEND_SYNC (backend), cal, &address);
 
@@ -663,7 +663,7 @@ static void
 _e_cal_backend_get_alarm_email_address (ECalBackend *backend, EDataCal *cal)
 {
 	ECalBackendSyncStatus status;
-	char *address = NULL;
+	gchar *address = NULL;
 
 	status = e_cal_backend_sync_get_alarm_email_address (E_CAL_BACKEND_SYNC (backend), cal, &address);
 
@@ -676,7 +676,7 @@ static void
 _e_cal_backend_get_ldap_attribute (ECalBackend *backend, EDataCal *cal)
 {
 	ECalBackendSyncStatus status;
-	char *attribute = NULL;
+	gchar *attribute = NULL;
 
 	status = e_cal_backend_sync_get_ldap_attribute (E_CAL_BACKEND_SYNC (backend), cal, &attribute);
 
@@ -689,7 +689,7 @@ static void
 _e_cal_backend_get_static_capabilities (ECalBackend *backend, EDataCal *cal)
 {
 	ECalBackendSyncStatus status;
-	char *capabilities = NULL;
+	gchar *capabilities = NULL;
 
 	status = e_cal_backend_sync_get_static_capabilities (E_CAL_BACKEND_SYNC (backend), cal, &capabilities);
 
@@ -700,7 +700,7 @@ _e_cal_backend_get_static_capabilities (ECalBackend *backend, EDataCal *cal)
 
 static void
 _e_cal_backend_open (ECalBackend *backend, EDataCal *cal, gboolean only_if_exists,
-		     const char *username, const char *password)
+		     const gchar *username, const gchar *password)
 {
 	ECalBackendSyncStatus status;
 
@@ -720,10 +720,10 @@ _e_cal_backend_remove (ECalBackend *backend, EDataCal *cal)
 }
 
 static void
-_e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const char *calobj)
+_e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendSyncStatus status;
-	char *uid = NULL, *modified_calobj = (char *) calobj;
+	gchar *uid = NULL, *modified_calobj = (gchar *) calobj;
 
 	status = e_cal_backend_sync_create_object (E_CAL_BACKEND_SYNC (backend), cal, &modified_calobj, &uid);
 
@@ -738,11 +738,11 @@ _e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const char *c
 }
 
 static void
-_e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const char *calobj, CalObjModType mod)
+_e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod)
 {
 	ECalBackendSyncStatus status;
-	char *old_object = NULL;
-	char *new_object = NULL;
+	gchar *old_object = NULL;
+	gchar *new_object = NULL;
 
 	status = e_cal_backend_sync_modify_object (E_CAL_BACKEND_SYNC (backend), cal,
 						   calobj, mod, &old_object, &new_object);
@@ -757,10 +757,10 @@ _e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const char *c
 }
 
 static void
-_e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid, CalObjModType mod)
+_e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid, CalObjModType mod)
 {
 	ECalBackendSyncStatus status;
-	char *object = NULL, *old_object = NULL;
+	gchar *object = NULL, *old_object = NULL;
 
 	status = e_cal_backend_sync_remove_object (E_CAL_BACKEND_SYNC (backend), cal, uid, rid, mod, &old_object, &object);
 
@@ -786,7 +786,7 @@ _e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const char *u
 }
 
 static void
-_e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const char *uid, const char *auid)
+_e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 	ECalBackendSyncStatus status;
 
@@ -796,7 +796,7 @@ _e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const char *u
 }
 
 static void
-_e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const char *calobj)
+_e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendSyncStatus status;
 
@@ -806,11 +806,11 @@ _e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const char
 }
 
 static void
-_e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const char *calobj)
+_e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendSyncStatus status;
 	GList *users = NULL;
-	char *modified_calobj = NULL;
+	gchar *modified_calobj = NULL;
 
 	status = e_cal_backend_sync_send_objects (E_CAL_BACKEND_SYNC (backend), cal, calobj, &users, &modified_calobj);
 	e_data_cal_notify_objects_sent (cal, status, users, modified_calobj);
@@ -824,7 +824,7 @@ static void
 _e_cal_backend_get_default_object (ECalBackend *backend, EDataCal *cal)
 {
 	ECalBackendSyncStatus status;
-	char *object = NULL;
+	gchar *object = NULL;
 
 	status = e_cal_backend_sync_get_default_object (E_CAL_BACKEND_SYNC (backend), cal, &object);
 
@@ -834,10 +834,10 @@ _e_cal_backend_get_default_object (ECalBackend *backend, EDataCal *cal)
 }
 
 static void
-_e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid)
+_e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid)
 {
 	ECalBackendSyncStatus status;
-	char *object = NULL;
+	gchar *object = NULL;
 
 	status = e_cal_backend_sync_get_object (E_CAL_BACKEND_SYNC (backend), cal, uid, rid, &object);
 
@@ -847,7 +847,7 @@ _e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const char *uid,
 }
 
 static void
-_e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid)
+_e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid)
 {
 	ECalBackendSyncStatus status;
 	GSList *list = NULL;
@@ -861,7 +861,7 @@ _e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const c
 }
 
 static void
-_e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const char *sexp)
+_e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const gchar *sexp)
 {
 	ECalBackendSyncStatus status;
 	GList *objects = NULL, *l;
@@ -876,16 +876,16 @@ _e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const char
 }
 
 static void
-_e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const char *tzid)
+_e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzid)
 {
 	ECalBackendSyncStatus status;
-	char *object = NULL;
+	gchar *object = NULL;
 
 	status = e_cal_backend_sync_get_timezone (E_CAL_BACKEND_SYNC (backend), cal, tzid, &object);
 
 	if (!object && tzid) {
 		/* fallback if tzid contains only the location of timezone */
-		int i, slashes = 0;
+		gint i, slashes = 0;
 
 		for (i = 0; tzid [i]; i++) {
 			if (tzid [i] == '/')
@@ -935,7 +935,7 @@ _e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const char *tz
 }
 
 static void
-_e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, const char *tzobj)
+_e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzobj)
 {
 	ECalBackendSyncStatus status;
 
@@ -945,9 +945,9 @@ _e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, const char *tz
 }
 
 static icaltimezone *
-_e_cal_backend_internal_get_timezone (ECalBackend *backend, const char *tzid)
+_e_cal_backend_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
-	int i, slashes = 0;
+	gint i, slashes = 0;
 
 	if (!tzid || !*tzid)
 		return NULL;
@@ -962,7 +962,7 @@ _e_cal_backend_internal_get_timezone (ECalBackend *backend, const char *tzid)
 }
 
 static void
-_e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const char *tz)
+_e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const gchar *tz)
 {
 	ECalBackendSyncStatus status;
 
@@ -972,7 +972,7 @@ _e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const char
 }
 
 static void
-_e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const char *tzid)
+_e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzid)
 {
 	ECalBackendSyncStatus status;
 
@@ -982,7 +982,7 @@ _e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const
 }
 
 static void
-_e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const char *change_id)
+_e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const gchar *change_id)
 {
 	ECalBackendSyncStatus status;
 	GList *adds = NULL, *modifies = NULL, *deletes = NULL, *l;
diff --git a/calendar/libedata-cal/e-cal-backend-sync.h b/calendar/libedata-cal/e-cal-backend-sync.h
index a82db4f..56b1117 100644
--- a/calendar/libedata-cal/e-cal-backend-sync.h
+++ b/calendar/libedata-cal/e-cal-backend-sync.h
@@ -34,37 +34,37 @@ struct _ECalBackendSyncClass {
 
 	/* Virtual methods */
 	ECalBackendSyncStatus (*is_read_only_sync)  (ECalBackendSync *backend, EDataCal *cal, gboolean *read_only);
-	ECalBackendSyncStatus (*get_cal_address_sync)  (ECalBackendSync *backend, EDataCal *cal, char **address);
-	ECalBackendSyncStatus (*get_alarm_email_address_sync)  (ECalBackendSync *backend, EDataCal *cal, char **address);
-	ECalBackendSyncStatus (*get_ldap_attribute_sync)  (ECalBackendSync *backend, EDataCal *cal, char **attribute);
-	ECalBackendSyncStatus (*get_static_capabilities_sync)  (ECalBackendSync *backend, EDataCal *cal, char **capabilities);
+	ECalBackendSyncStatus (*get_cal_address_sync)  (ECalBackendSync *backend, EDataCal *cal, gchar **address);
+	ECalBackendSyncStatus (*get_alarm_email_address_sync)  (ECalBackendSync *backend, EDataCal *cal, gchar **address);
+	ECalBackendSyncStatus (*get_ldap_attribute_sync)  (ECalBackendSync *backend, EDataCal *cal, gchar **attribute);
+	ECalBackendSyncStatus (*get_static_capabilities_sync)  (ECalBackendSync *backend, EDataCal *cal, gchar **capabilities);
 
-	ECalBackendSyncStatus (*open_sync)  (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists, const char *username, const char *password);
+	ECalBackendSyncStatus (*open_sync)  (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists, const gchar *username, const gchar *password);
 	ECalBackendSyncStatus (*remove_sync)  (ECalBackendSync *backend, EDataCal *cal);
 
-	ECalBackendSyncStatus (*create_object_sync)  (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid);
-	ECalBackendSyncStatus (*modify_object_sync)  (ECalBackendSync *backend, EDataCal *cal, const char *calobj, CalObjModType mod, char **old_object, char **new_object);
-	ECalBackendSyncStatus (*remove_object_sync)  (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, CalObjModType mod, char **old_object, char **object);
+	ECalBackendSyncStatus (*create_object_sync)  (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid);
+	ECalBackendSyncStatus (*modify_object_sync)  (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod, gchar **old_object, gchar **new_object);
+	ECalBackendSyncStatus (*remove_object_sync)  (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, CalObjModType mod, gchar **old_object, gchar **object);
 
-	ECalBackendSyncStatus (*discard_alarm_sync)  (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid);
+	ECalBackendSyncStatus (*discard_alarm_sync)  (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid);
 
-	ECalBackendSyncStatus (*receive_objects_sync)  (ECalBackendSync *backend, EDataCal *cal, const char *calobj);
-	ECalBackendSyncStatus (*send_objects_sync)  (ECalBackendSync *backend, EDataCal *cal, const char *calobj, GList **users,
-						     char **modified_calobj);
+	ECalBackendSyncStatus (*receive_objects_sync)  (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj);
+	ECalBackendSyncStatus (*send_objects_sync)  (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, GList **users,
+						     gchar **modified_calobj);
 
-	ECalBackendSyncStatus (*get_default_object_sync)  (ECalBackendSync *backend, EDataCal *cal, char **object);
-	ECalBackendSyncStatus (*get_object_sync)  (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object);
-	ECalBackendSyncStatus (*get_object_list_sync)  (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects);
+	ECalBackendSyncStatus (*get_default_object_sync)  (ECalBackendSync *backend, EDataCal *cal, gchar **object);
+	ECalBackendSyncStatus (*get_object_sync)  (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, gchar **object);
+	ECalBackendSyncStatus (*get_object_list_sync)  (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp, GList **objects);
 
-	ECalBackendSyncStatus (*get_attachment_list_sync)  (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **attachments);
+	ECalBackendSyncStatus (*get_attachment_list_sync)  (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, GSList **attachments);
 
 
-	ECalBackendSyncStatus (*get_timezone_sync) (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object);
-	ECalBackendSyncStatus (*add_timezone_sync) (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
-	ECalBackendSyncStatus (*set_default_timezone_sync) (ECalBackendSync *backend, EDataCal *cal, const char *tzid);
-	ECalBackendSyncStatus (*set_default_zone_sync) (ECalBackendSync *backend, EDataCal *cal, const char *tz);
+	ECalBackendSyncStatus (*get_timezone_sync) (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object);
+	ECalBackendSyncStatus (*add_timezone_sync) (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj);
+	ECalBackendSyncStatus (*set_default_timezone_sync) (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid);
+	ECalBackendSyncStatus (*set_default_zone_sync) (ECalBackendSync *backend, EDataCal *cal, const gchar *tz);
 
-	ECalBackendSyncStatus (*get_changes_sync) (ECalBackendSync *backend, EDataCal *cal, const char *change_id, GList **adds, GList **modifies, GList **deletes);
+	ECalBackendSyncStatus (*get_changes_sync) (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id, GList **adds, GList **modifies, GList **deletes);
 	ECalBackendSyncStatus (*get_freebusy_sync) (ECalBackendSync *backend, EDataCal *cal, GList *users, time_t start, time_t end, GList **freebusy);
 
 	/* Padding for future expansion */
@@ -85,77 +85,77 @@ ECalBackendSyncStatus e_cal_backend_sync_is_read_only            (ECalBackendSyn
 							       gboolean        *read_only);
 ECalBackendSyncStatus e_cal_backend_sync_get_cal_address         (ECalBackendSync  *backend,
 							       EDataCal             *cal,
-							       char           **address);
+							       gchar           **address);
 ECalBackendSyncStatus e_cal_backend_sync_get_alarm_email_address (ECalBackendSync  *backend,
 							       EDataCal             *cal,
-							       char           **address);
+							       gchar           **address);
 ECalBackendSyncStatus e_cal_backend_sync_get_ldap_attribute      (ECalBackendSync  *backend,
 							       EDataCal             *cal,
-							       char           **attribute);
+							       gchar           **attribute);
 ECalBackendSyncStatus e_cal_backend_sync_get_static_capabilities (ECalBackendSync  *backend,
 							       EDataCal             *cal,
-							       char           **capabiliites);
+							       gchar           **capabiliites);
 ECalBackendSyncStatus e_cal_backend_sync_open                    (ECalBackendSync  *backend,
 								  EDataCal             *cal,
 								  gboolean         only_if_exists,
-								  const char *username,
-								  const char *password);
+								  const gchar *username,
+								  const gchar *password);
 ECalBackendSyncStatus e_cal_backend_sync_remove                  (ECalBackendSync  *backend,
 							       EDataCal             *cal);
 ECalBackendSyncStatus e_cal_backend_sync_create_object           (ECalBackendSync  *backend,
 								  EDataCal             *cal,
-								  char           **calobj,
-								  char           **uid);
+								  gchar           **calobj,
+								  gchar           **uid);
 ECalBackendSyncStatus e_cal_backend_sync_modify_object           (ECalBackendSync  *backend,
 							       EDataCal             *cal,
-							       const char      *calobj,
+							       const gchar      *calobj,
 							       CalObjModType    mod,
-							       char           **old_object,
-							       char           **new_object);
+							       gchar           **old_object,
+							       gchar           **new_object);
 ECalBackendSyncStatus e_cal_backend_sync_remove_object           (ECalBackendSync  *backend,
 							       EDataCal             *cal,
-							       const char      *uid,
-							       const char      *rid,
+							       const gchar      *uid,
+							       const gchar      *rid,
 							       CalObjModType    mod,
-							       char **old_object,
-							       char **object);
+							       gchar **old_object,
+							       gchar **object);
 ECalBackendSyncStatus	e_cal_backend_sync_get_attachment_list (ECalBackendSync *backend,
 								EDataCal *cal,
-								const char *uid,
-								const char *rid,
+								const gchar *uid,
+								const gchar *rid,
 								GSList **attachments);
 
-ECalBackendSyncStatus e_cal_backend_sync_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid);
+ECalBackendSyncStatus e_cal_backend_sync_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid);
 
 ECalBackendSyncStatus e_cal_backend_sync_receive_objects         (ECalBackendSync  *backend,
 								  EDataCal         *cal,
-								  const char       *calobj);
+								  const gchar       *calobj);
 ECalBackendSyncStatus e_cal_backend_sync_send_objects            (ECalBackendSync  *backend,
 								  EDataCal         *cal,
-								  const char       *calobj,
+								  const gchar       *calobj,
 								  GList **users,
-								  char **modified_calobj);
+								  gchar **modified_calobj);
 ECalBackendSyncStatus e_cal_backend_sync_get_default_object         (ECalBackendSync  *backend,
 								     EDataCal         *cal,
-								     char            **object);
+								     gchar            **object);
 
 ECalBackendSyncStatus e_cal_backend_sync_get_object         (ECalBackendSync  *backend,
 							     EDataCal             *cal,
-							     const char *uid,
-							     const char *rid,
-							     char           **object);
+							     const gchar *uid,
+							     const gchar *rid,
+							     gchar           **object);
 
 ECalBackendSyncStatus e_cal_backend_sync_get_object_list         (ECalBackendSync  *backend,
 								  EDataCal             *cal,
-								  const char      *sexp,
+								  const gchar      *sexp,
 								  GList          **objects);
 
-ECalBackendSyncStatus e_cal_backend_sync_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object);
-ECalBackendSyncStatus e_cal_backend_sync_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
-ECalBackendSyncStatus e_cal_backend_sync_set_default_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid);
-ECalBackendSyncStatus e_cal_backend_sync_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
+ECalBackendSyncStatus e_cal_backend_sync_get_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid, gchar **object);
+ECalBackendSyncStatus e_cal_backend_sync_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj);
+ECalBackendSyncStatus e_cal_backend_sync_set_default_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzid);
+ECalBackendSyncStatus e_cal_backend_sync_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj);
 
-ECalBackendSyncStatus e_cal_backend_sync_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id, GList **adds, GList **modifies, GList **deletes);
+ECalBackendSyncStatus e_cal_backend_sync_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id, GList **adds, GList **modifies, GList **deletes);
 ECalBackendSyncStatus e_cal_backend_sync_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList *users, time_t start, time_t end, GList **freebusy);
 
 G_END_DECLS
diff --git a/calendar/libedata-cal/e-cal-backend-util.c b/calendar/libedata-cal/e-cal-backend-util.c
index cd38812..11aba99 100644
--- a/calendar/libedata-cal/e-cal-backend-util.c
+++ b/calendar/libedata-cal/e-cal-backend-util.c
@@ -40,7 +40,7 @@ static EAccountList *accounts;
  * Return value: TRUE if there is a default account, FALSE otherwise.
  */
 gboolean
-e_cal_backend_mail_account_get_default (char **address, char **name)
+e_cal_backend_mail_account_get_default (gchar **address, gchar **name)
 {
 	const EAccount *account;
 
@@ -71,7 +71,7 @@ e_cal_backend_mail_account_get_default (char **address, char **name)
  * Return value: TRUE if the account is valid, FALSE if not.
  */
 gboolean
-e_cal_backend_mail_account_is_valid (char *user, char **name)
+e_cal_backend_mail_account_is_valid (gchar *user, gchar **name)
 {
 	const EAccount *account;
 
@@ -95,7 +95,7 @@ e_cal_backend_mail_account_is_valid (char *user, char **name)
  *
  * Converts status code to string.
  **/
-const char *
+const gchar *
 e_cal_backend_status_to_string (GNOME_Evolution_Calendar_CallStatus status)
 {
 	switch (status) {
@@ -159,7 +159,7 @@ e_cal_backend_status_to_string (GNOME_Evolution_Calendar_CallStatus status)
  *         It's not necessary to have this attendee in the list.
  **/
 static gboolean
-is_attendee_declined (icalcomponent *icalcomp, const char *email)
+is_attendee_declined (icalcomponent *icalcomp, const gchar *email)
 {
 	icalproperty *prop;
 	icalparameter *param;
@@ -170,8 +170,8 @@ is_attendee_declined (icalcomponent *icalcomp, const char *email)
 	for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
 	     prop != NULL;
 	     prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) {
-		char *attendee;
-		char *text = NULL;
+		gchar *attendee;
+		gchar *text = NULL;
 
 		attendee = icalproperty_get_value_as_string_r (prop);
 		if (!attendee)
diff --git a/calendar/libedata-cal/e-cal-backend-util.h b/calendar/libedata-cal/e-cal-backend-util.h
index f009177..d0d16a2 100644
--- a/calendar/libedata-cal/e-cal-backend-util.h
+++ b/calendar/libedata-cal/e-cal-backend-util.h
@@ -30,10 +30,10 @@ G_BEGIN_DECLS
  * Functions for accessing mail configuration
  */
 
-gboolean e_cal_backend_mail_account_get_default (char **address, char **name);
-gboolean e_cal_backend_mail_account_is_valid (char *user, char **name);
+gboolean e_cal_backend_mail_account_get_default (gchar **address, gchar **name);
+gboolean e_cal_backend_mail_account_is_valid (gchar *user, gchar **name);
 
-const char *e_cal_backend_status_to_string (GNOME_Evolution_Calendar_CallStatus status);
+const gchar *e_cal_backend_status_to_string (GNOME_Evolution_Calendar_CallStatus status);
 
 gboolean e_cal_backend_user_declined (icalcomponent *icalcomp);
 
diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
index d24eea6..7bc19c0 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -38,7 +38,7 @@ struct _ECalBackendPrivate {
 	ESource *source;
 
 	/* URI, from source. This is cached, since we return const. */
-	char *uri;
+	gchar *uri;
 
 	/* The kind of components for this backend */
 	icalcomponent_kind kind;
@@ -56,7 +56,7 @@ struct _ECalBackendPrivate {
 	/* used when notifying clients about progress of some operation,
 	 * we do not send multiple notifications with the same percent
 	 * value */
-	int last_percent_notified;
+	gint last_percent_notified;
 };
 
 #define E_CAL_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_CAL_BACKEND, ECalBackendPrivate))
@@ -312,7 +312,7 @@ e_cal_backend_get_source (ECalBackend *backend)
  *
  * Return value: The URI where the calendar is stored.
  **/
-const char *
+const gchar *
 e_cal_backend_get_uri (ECalBackend *backend)
 {
 	ECalBackendPrivate *priv;
@@ -527,7 +527,7 @@ e_cal_backend_notify_readonly (ECalBackend *backend, gboolean read_only)
 }
 
 void
-e_cal_backend_notify_cal_address (ECalBackend *backend, char *address)
+e_cal_backend_notify_cal_address (ECalBackend *backend, gchar *address)
 {
 	ECalBackendPrivate *priv;
 	GList *l;
@@ -604,7 +604,7 @@ e_cal_backend_get_static_capabilities (ECalBackend *backend, EDataCal *cal)
  */
 void
 e_cal_backend_open (ECalBackend *backend, EDataCal *cal, gboolean only_if_exists,
-		    const char *username, const char *password)
+		    const gchar *username, const gchar *password)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -756,7 +756,7 @@ e_cal_backend_get_default_object (ECalBackend *backend, EDataCal *cal)
  * identifier and its recurrence ID (if a recurrent appointment).
  */
 void
-e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid)
+e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -775,7 +775,7 @@ e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const char *uid,
  * Calls the get_object_list method on the given backend.
  */
 void
-e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const char *sexp)
+e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const gchar *sexp)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -795,7 +795,7 @@ e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const char *
  * on its unique identifier and its recurrence ID (if a recurrent appointment).
  */
 void
-e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid)
+e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -837,7 +837,7 @@ e_cal_backend_get_free_busy (ECalBackend *backend, EDataCal *cal, GList *users,
  * the last time the give change_id was seen
  */
 void
-e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const char *change_id)
+e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const gchar *change_id)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -858,7 +858,7 @@ e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const char *chan
  * to do whatever is needed to really discard the alarm.
  */
 void
-e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const char *uid, const char *auid)
+e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -878,7 +878,7 @@ e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const char *ui
  * Calls the create_object method on the given backend.
  */
 void
-e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -900,7 +900,7 @@ e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const char *ca
  * Calls the modify_object method on the given backend.
  */
 void
-e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const char *calobj, CalObjModType mod)
+e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -924,7 +924,7 @@ e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const char *ca
  * clients about the change.
  */
 void
-e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid, CalObjModType mod)
+e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid, CalObjModType mod)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -943,7 +943,7 @@ e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const char *ui
  * Calls the receive_objects method on the given backend.
  */
 void
-e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -962,7 +962,7 @@ e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const char *
  * Calls the send_objects method on the given backend.
  */
 void
-e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const char *calobj)
+e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -983,7 +983,7 @@ e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const char *cal
  * can't be found.
  */
 void
-e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const char *tzid)
+e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzid)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -1003,7 +1003,7 @@ e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const char *tzi
  * DATE and floating DATE-TIME values.
  */
 void
-e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const gchar *tzobj)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -1027,7 +1027,7 @@ e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const char
  *
  */
 void
-e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const char *tzid)
+e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzid)
 {
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -1045,7 +1045,7 @@ e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const c
  * Add a timezone object to the given backend.
  */
 void
-e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, const char *tzobj)
+e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzobj)
 {
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
 	g_return_if_fail (tzobj != NULL);
@@ -1077,7 +1077,7 @@ e_cal_backend_internal_get_default_timezone (ECalBackend *backend)
  * Calls the internal_get_timezone method on the given backend.
  */
 icaltimezone *
-e_cal_backend_internal_get_timezone (ECalBackend *backend, const char *tzid)
+e_cal_backend_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
 	g_return_val_if_fail (E_IS_CAL_BACKEND (backend), NULL);
 	g_return_val_if_fail (tzid != NULL, NULL);
@@ -1117,7 +1117,7 @@ e_cal_backend_set_notification_proxy (ECalBackend *backend, ECalBackend *proxy)
  * created by non-EDS clients.
  **/
 void
-e_cal_backend_notify_object_created (ECalBackend *backend, const char *calobj)
+e_cal_backend_notify_object_created (ECalBackend *backend, const gchar *calobj)
 {
 	ECalBackendPrivate *priv;
 	EList *queries;
@@ -1148,7 +1148,7 @@ e_cal_backend_notify_object_created (ECalBackend *backend, const char *calobj)
 }
 
 static void
-match_query_and_notify (EDataCalView *query, const char *old_object, const char *object)
+match_query_and_notify (EDataCalView *query, const gchar *old_object, const gchar *object)
 {
 	gboolean old_match = FALSE, new_match = FALSE;
 
@@ -1201,7 +1201,7 @@ e_cal_backend_notify_view_progress_start (ECalBackend *backend)
  * Notifies each of the backend's listeners about the view_progress in downloading the items.
  **/
 void
-e_cal_backend_notify_view_progress (ECalBackend *backend, const char *message, int percent)
+e_cal_backend_notify_view_progress (ECalBackend *backend, const gchar *message, gint percent)
 {
 	ECalBackendPrivate *priv;
 	EList *queries;
@@ -1290,7 +1290,7 @@ e_cal_backend_notify_view_done (ECalBackend *backend, GNOME_Evolution_Calendar_C
  **/
 void
 e_cal_backend_notify_object_modified (ECalBackend *backend,
-				      const char *old_object, const char *object)
+				      const gchar *old_object, const gchar *object)
 {
 	ECalBackendPrivate *priv;
 	EList *queries;
@@ -1336,7 +1336,7 @@ e_cal_backend_notify_object_modified (ECalBackend *backend,
  **/
 void
 e_cal_backend_notify_object_removed (ECalBackend *backend, const ECalComponentId *id,
-				     const char *old_object, const char *object)
+				     const gchar *old_object, const gchar *object)
 {
 	ECalBackendPrivate *priv;
 	EList *queries;
@@ -1443,7 +1443,7 @@ e_cal_backend_notify_auth_required (ECalBackend *backend)
  * Notifies each of the backend's listeners about an error
  **/
 void
-e_cal_backend_notify_error (ECalBackend *backend, const char *message)
+e_cal_backend_notify_error (ECalBackend *backend, const gchar *message)
 {
 	ECalBackendPrivate *priv = backend->priv;
 	GList *l;
diff --git a/calendar/libedata-cal/e-cal-backend.h b/calendar/libedata-cal/e-cal-backend.h
index 87a4d92..dd5c857 100644
--- a/calendar/libedata-cal/e-cal-backend.h
+++ b/calendar/libedata-cal/e-cal-backend.h
@@ -62,9 +62,9 @@ struct _ECalBackendClass {
 	gboolean (* is_loaded) (ECalBackend *backend);
 
 	/* FIXME What to pass back here */
-	void (* opened) (ECalBackend *backend, int status);
-	void (* removed) (ECalBackend *backend, int status);
-	void (* obj_updated) (ECalBackend *backend, const char *uid);
+	void (* opened) (ECalBackend *backend, gint status);
+	void (* removed) (ECalBackend *backend, gint status);
+	void (* obj_updated) (ECalBackend *backend, const gchar *uid);
 
 	/* Virtual methods */
 	void (* is_read_only) (ECalBackend *backend, EDataCal *cal);
@@ -73,30 +73,30 @@ struct _ECalBackendClass {
 	void (* get_ldap_attribute) (ECalBackend *backend, EDataCal *cal);
 	void (* get_static_capabilities) (ECalBackend *backend, EDataCal *cal);
 
-	void (* open) (ECalBackend *backend, EDataCal *cal, gboolean only_if_exists, const char *username, const char *password);
+	void (* open) (ECalBackend *backend, EDataCal *cal, gboolean only_if_exists, const gchar *username, const gchar *password);
 	void (* remove) (ECalBackend *backend, EDataCal *cal);
 
 	/* Object related virtual methods */
-	void (* create_object) (ECalBackend *backend, EDataCal *cal, const char *calobj);
-	void (* modify_object) (ECalBackend *backend, EDataCal *cal, const char *calobj, CalObjModType mod);
-	void (* remove_object) (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid, CalObjModType mod);
+	void (* create_object) (ECalBackend *backend, EDataCal *cal, const gchar *calobj);
+	void (* modify_object) (ECalBackend *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod);
+	void (* remove_object) (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid, CalObjModType mod);
 
-	void (* discard_alarm) (ECalBackend *backend, EDataCal *cal, const char *uid, const char *auid);
+	void (* discard_alarm) (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *auid);
 
-	void (* receive_objects) (ECalBackend *backend, EDataCal *cal, const char *calobj);
-	void (* send_objects) (ECalBackend *backend, EDataCal *cal, const char *calobj);
+	void (* receive_objects) (ECalBackend *backend, EDataCal *cal, const gchar *calobj);
+	void (* send_objects) (ECalBackend *backend, EDataCal *cal, const gchar *calobj);
 
 	void (* get_default_object) (ECalBackend *backend, EDataCal *cal);
-	void (* get_object) (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid);
-	void (* get_object_list) (ECalBackend *backend, EDataCal *cal, const char *sexp);
+	void (* get_object) (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid);
+	void (* get_object_list) (ECalBackend *backend, EDataCal *cal, const gchar *sexp);
 
-	void (* get_attachment_list) (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid);
+	void (* get_attachment_list) (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid);
 
 	/* Timezone related virtual methods */
-	void (* get_timezone) (ECalBackend *backend, EDataCal *cal, const char *tzid);
-	void (* add_timezone) (ECalBackend *backend, EDataCal *cal, const char *object);
-	void (* set_default_zone) (ECalBackend *backend, EDataCal *cal, const char *tzobj);
-	void (* set_default_timezone) (ECalBackend *backend, EDataCal *cal, const char *tzid);
+	void (* get_timezone) (ECalBackend *backend, EDataCal *cal, const gchar *tzid);
+	void (* add_timezone) (ECalBackend *backend, EDataCal *cal, const gchar *object);
+	void (* set_default_zone) (ECalBackend *backend, EDataCal *cal, const gchar *tzobj);
+	void (* set_default_timezone) (ECalBackend *backend, EDataCal *cal, const gchar *tzid);
 
 	void (* start_query) (ECalBackend *backend, EDataCalView *query);
 
@@ -105,17 +105,17 @@ struct _ECalBackendClass {
 	void    (* set_mode) (ECalBackend *backend, CalMode mode);
 
 	void (* get_free_busy) (ECalBackend *backend, EDataCal *cal, GList *users, time_t start, time_t end);
-	void (* get_changes) (ECalBackend *backend, EDataCal *cal, const char *change_id);
+	void (* get_changes) (ECalBackend *backend, EDataCal *cal, const gchar *change_id);
 
 	/* Internal methods for use only in the pcs */
 	icaltimezone *(* internal_get_default_timezone) (ECalBackend *backend);
-	icaltimezone *(* internal_get_timezone) (ECalBackend *backend, const char *tzid);
+	icaltimezone *(* internal_get_timezone) (ECalBackend *backend, const gchar *tzid);
 };
 
 GType e_cal_backend_get_type (void);
 
 ESource *e_cal_backend_get_source (ECalBackend *backend);
-const char *e_cal_backend_get_uri (ECalBackend *backend);
+const gchar *e_cal_backend_get_uri (ECalBackend *backend);
 icalcomponent_kind e_cal_backend_get_kind (ECalBackend *backend);
 
 void e_cal_backend_add_client (ECalBackend *backend, EDataCal *cal);
@@ -131,23 +131,23 @@ void e_cal_backend_get_alarm_email_address (ECalBackend *backend, EDataCal *cal)
 void e_cal_backend_get_ldap_attribute (ECalBackend *backend, EDataCal *cal);
 void e_cal_backend_get_static_capabilities (ECalBackend *backend, EDataCal *cal);
 
-void e_cal_backend_open (ECalBackend *backend, EDataCal *cal, gboolean only_if_exists, const char *username, const char *password);
+void e_cal_backend_open (ECalBackend *backend, EDataCal *cal, gboolean only_if_exists, const gchar *username, const gchar *password);
 void e_cal_backend_remove (ECalBackend *backend, EDataCal *cal);
 
-void e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const char *calobj);
-void e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const char *calobj, CalObjModType mod);
-void e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid, CalObjModType mod);
+void e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const gchar *calobj);
+void e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod);
+void e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid, CalObjModType mod);
 
-void e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const char *uid, const char *auid);
+void e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *auid);
 
-void e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const char *calobj);
-void e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const char *calobj);
+void e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const gchar *calobj);
+void e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const gchar *calobj);
 
 void e_cal_backend_get_default_object (ECalBackend *backend, EDataCal *cal);
-void e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid);
-void e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const char *sexp);
+void e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid);
+void e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const gchar *sexp);
 
-void e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid);
+void e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid);
 
 gboolean e_cal_backend_is_loaded (ECalBackend *backend);
 
@@ -156,33 +156,33 @@ void e_cal_backend_start_query (ECalBackend *backend, EDataCalView *query);
 CalMode e_cal_backend_get_mode (ECalBackend *backend);
 void e_cal_backend_set_mode (ECalBackend *backend, CalMode mode);
 
-void e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const char *tzid);
-void e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, const char *object);
-void e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const char *tzid);
-void e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const char *tzobj);
+void e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzid);
+void e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, const gchar *object);
+void e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzid);
+void e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const gchar *tzobj);
 
-void e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const char *change_id);
+void e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const gchar *change_id);
 void e_cal_backend_get_free_busy (ECalBackend *backend, EDataCal *cal, GList *users, time_t start, time_t end);
 
 icaltimezone* e_cal_backend_internal_get_default_timezone (ECalBackend *backend);
-icaltimezone* e_cal_backend_internal_get_timezone (ECalBackend *backend, const char *tzid);
+icaltimezone* e_cal_backend_internal_get_timezone (ECalBackend *backend, const gchar *tzid);
 
 void e_cal_backend_set_notification_proxy (ECalBackend *backend, ECalBackend *proxy);
-void e_cal_backend_notify_object_created  (ECalBackend *backend, const char *calobj);
-void e_cal_backend_notify_object_modified (ECalBackend *backend, const char *old_object, const char *object);
-void e_cal_backend_notify_object_removed  (ECalBackend *backend, const ECalComponentId *id, const char *old_object, const char *object);
+void e_cal_backend_notify_object_created  (ECalBackend *backend, const gchar *calobj);
+void e_cal_backend_notify_object_modified (ECalBackend *backend, const gchar *old_object, const gchar *object);
+void e_cal_backend_notify_object_removed  (ECalBackend *backend, const ECalComponentId *id, const gchar *old_object, const gchar *object);
 
 void e_cal_backend_notify_mode      (ECalBackend *backend,
 				     GNOME_Evolution_Calendar_CalListener_SetModeStatus status,
 				     GNOME_Evolution_Calendar_CalMode mode);
 void e_cal_backend_notify_auth_required (ECalBackend *backend);
-void e_cal_backend_notify_error     (ECalBackend *backend, const char *message);
+void e_cal_backend_notify_error     (ECalBackend *backend, const gchar *message);
 
 void e_cal_backend_notify_view_done (ECalBackend *backend, GNOME_Evolution_Calendar_CallStatus status);
 void e_cal_backend_notify_view_progress_start (ECalBackend *backend);
-void e_cal_backend_notify_view_progress (ECalBackend *backend, const char *message, int percent);
+void e_cal_backend_notify_view_progress (ECalBackend *backend, const gchar *message, gint percent);
 void e_cal_backend_notify_readonly (ECalBackend *backend, gboolean read_only);
-void e_cal_backend_notify_cal_address (ECalBackend *backend, char *address);
+void e_cal_backend_notify_cal_address (ECalBackend *backend, gchar *address);
 
 void e_cal_backend_notify_objects_added (ECalBackend *backend, EDataCalView *query, const GList *objects);
 void e_cal_backend_notify_objects_removed (ECalBackend *backend, EDataCalView *query, const GList *ids);
diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index 18c7c24..25c8ccf 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -46,12 +46,12 @@ struct _EDataCalFactoryPrivate {
 	GMutex *backends_mutex;
 
 	/* OAFIID of the factory */
-	char *iid;
+	gchar *iid;
 
 	/* Whether we have been registered with OAF yet */
 	guint registered : 1;
 
-        int mode;
+        gint mode;
 };
 
 /* Signal IDs */
@@ -80,7 +80,7 @@ calobjtype_to_icalkind (const GNOME_Evolution_Calendar_CalObjType type)
 }
 
 static ECalBackendFactory*
-get_backend_factory (GHashTable *methods, const char *method, icalcomponent_kind kind)
+get_backend_factory (GHashTable *methods, const gchar *method, icalcomponent_kind kind)
 {
 	GHashTable *kinds;
 	ECalBackendFactory *factory;
@@ -103,8 +103,8 @@ backend_last_client_gone_cb (ECalBackend *backend, gpointer data)
 	EDataCalFactory *factory;
 	EDataCalFactoryPrivate *priv;
 	ECalBackend *ret_backend;
-	const char *uristr;
-	char *uri;
+	const gchar *uristr;
+	gchar *uri;
 	gboolean last_calendar;
 
 	fprintf (stderr, "backend_last_client_gone_cb() called!\n");
@@ -155,9 +155,9 @@ impl_CalFactory_getCal (PortableServer_Servant servant,
 	ECalBackend *backend;
 	ECalBackendFactory *backend_factory;
 	ESource *source;
-	char *str_uri;
+	gchar *str_uri;
 	EUri *uri;
-	char *uri_type_string;
+	gchar *uri_type_string;
 
 	factory = E_DATA_CAL_FACTORY (bonobo_object_from_servant (servant));
 	priv = factory->priv;
@@ -345,7 +345,7 @@ set_backend_online_status (gpointer key, gpointer value, gpointer data)
  * Sets the online mode for all backends created by the given factory.
  */
 void
-e_data_cal_factory_set_backend_mode (EDataCalFactory *factory, int mode)
+e_data_cal_factory_set_backend_mode (EDataCalFactory *factory, gint mode)
 {
 	EDataCalFactoryPrivate *priv = factory->priv;
 
@@ -389,11 +389,11 @@ BONOBO_TYPE_FUNC_FULL (EDataCalFactory,
  * Return value: TRUE on success, FALSE otherwise.
  **/
 gboolean
-e_data_cal_factory_register_storage (EDataCalFactory *factory, const char *iid)
+e_data_cal_factory_register_storage (EDataCalFactory *factory, const gchar *iid)
 {
 	EDataCalFactoryPrivate *priv;
 	Bonobo_RegistrationResult result;
-	char *tmp_iid;
+	gchar *tmp_iid;
 
 	g_return_val_if_fail (factory != NULL, FALSE);
 	g_return_val_if_fail (E_IS_DATA_CAL_FACTORY (factory), FALSE);
@@ -449,7 +449,7 @@ void
 e_data_cal_factory_register_backend (EDataCalFactory *factory, ECalBackendFactory *backend_factory)
 {
 	EDataCalFactoryPrivate *priv;
-	const char *method;
+	const gchar *method;
 	GHashTable *kinds;
 	GType type;
 	icalcomponent_kind kind;
@@ -474,7 +474,7 @@ e_data_cal_factory_register_backend (EDataCalFactory *factory, ECalBackendFactor
 	kind = E_CAL_BACKEND_FACTORY_GET_CLASS (backend_factory)->get_kind (backend_factory);
 
 	for (l= methods; l != NULL; l = g_slist_next (l)) {
-		char *method_str;
+		gchar *method_str;
 
 		method = l->data;
 
@@ -531,11 +531,11 @@ e_data_cal_factory_register_backends (EDataCalFactory *cal_factory)
  *
  * Returns: the number of backends.
  */
-int
+gint
 e_data_cal_factory_get_n_backends (EDataCalFactory *factory)
 {
 	EDataCalFactoryPrivate *priv;
-	int sz;
+	gint sz;
 
 	g_return_val_if_fail (E_IS_DATA_CAL_FACTORY (factory), 0);
 
@@ -551,7 +551,7 @@ e_data_cal_factory_get_n_backends (EDataCalFactory *factory)
 static void
 dump_backend (gpointer key, gpointer value, gpointer data)
 {
-	char *uri;
+	gchar *uri;
 	ECalBackend *backend;
 
 	uri = key;
diff --git a/calendar/libedata-cal/e-data-cal-factory.h b/calendar/libedata-cal/e-data-cal-factory.h
index a8eae5d..19641a5 100644
--- a/calendar/libedata-cal/e-data-cal-factory.h
+++ b/calendar/libedata-cal/e-data-cal-factory.h
@@ -60,15 +60,15 @@ struct _EDataCalFactoryClass {
 GType       e_data_cal_factory_get_type        (void);
 EDataCalFactory *e_data_cal_factory_new             (void);
 
-gboolean    e_data_cal_factory_register_storage (EDataCalFactory *factory, const char *iid);
+gboolean    e_data_cal_factory_register_storage (EDataCalFactory *factory, const gchar *iid);
 void        e_data_cal_factory_register_backend  (EDataCalFactory *factory,
 						  ECalBackendFactory *backend_factory);
 
 void	    e_data_cal_factory_register_backends    (EDataCalFactory    *factory);
 
-int         e_data_cal_factory_get_n_backends       (EDataCalFactory *factory);
+gint         e_data_cal_factory_get_n_backends       (EDataCalFactory *factory);
 void        e_data_cal_factory_dump_active_backends (EDataCalFactory *factory);
-void        e_data_cal_factory_set_backend_mode (EDataCalFactory *factory, int mode);
+void        e_data_cal_factory_set_backend_mode (EDataCalFactory *factory, gint mode);
 
 G_END_DECLS
 
diff --git a/calendar/libedata-cal/e-data-cal-view.c b/calendar/libedata-cal/e-data-cal-view.c
index c669f1e..303fab1 100644
--- a/calendar/libedata-cal/e-data-cal-view.c
+++ b/calendar/libedata-cal/e-data-cal-view.c
@@ -90,11 +90,11 @@ enum {
 static guint signals[LAST_SIGNAL];
 
 static void
-add_object_to_cache (EDataCalView *query, const char *calobj)
+add_object_to_cache (EDataCalView *query, const gchar *calobj)
 {
 	ECalComponent *comp;
-	char *real_uid;
-	const char *uid;
+	gchar *real_uid;
+	const gchar *uid;
 	EDataCalViewPrivate *priv;
 
 	priv = query->priv;
@@ -110,7 +110,7 @@ add_object_to_cache (EDataCalView *query, const char *calobj)
 	}
 
 	if (e_cal_component_is_instance (comp)) {
-		char *str;
+		gchar *str;
 		str = e_cal_component_get_recurid_as_string (comp)	;
 		real_uid = g_strdup_printf ("%s %s", uid, str);
 		g_free (str);
@@ -131,8 +131,8 @@ uncache_with_id_cb (gpointer key, gpointer value, gpointer user_data)
 {
 	ECalComponent *comp;
 	ECalComponentId *id;
-	const char *this_uid;
-	char *object;
+	const gchar *this_uid;
+	gchar *object;
 	gboolean remove = FALSE;
 
 	id = user_data;
@@ -143,7 +143,7 @@ uncache_with_id_cb (gpointer key, gpointer value, gpointer user_data)
 		e_cal_component_get_uid (comp, &this_uid);
 		if (this_uid && !strcmp (id->uid, this_uid)) {
 			if (id->rid && *id->rid) {
-				char *rid = e_cal_component_get_recurid_as_string (comp);
+				gchar *rid = e_cal_component_get_recurid_as_string (comp);
 
 				if (rid && !strcmp (id->rid, rid))
 					remove = TRUE;
@@ -203,7 +203,7 @@ listener_died_cb (EComponentListener *cl, gpointer data)
 static void
 notify_matched_object_cb (gpointer key, gpointer value, gpointer user_data)
 {
-	char *uid, *object;
+	gchar *uid, *object;
 	EDataCalView *query;
 	EDataCalViewPrivate *priv;
 	GList *l;
@@ -494,7 +494,7 @@ e_data_cal_view_add_listener (EDataCalView *query, GNOME_Evolution_Calendar_CalV
  *
  * Return value: the query expression used to search.
  */
-const char *
+const gchar *
 e_data_cal_view_get_text (EDataCalView *query)
 {
 	g_return_val_if_fail (IS_QUERY (query), NULL);
@@ -529,7 +529,7 @@ e_data_cal_view_get_object_sexp (EDataCalView *query)
  * Return value: TRUE if the object matches the expression, FALSE if not.
  */
 gboolean
-e_data_cal_view_object_matches (EDataCalView *query, const char *object)
+e_data_cal_view_object_matches (EDataCalView *query, const gchar *object)
 {
 	EDataCalViewPrivate *priv;
 
@@ -654,7 +654,7 @@ e_data_cal_view_notify_objects_added (EDataCalView *query, const GList *objects)
 	GNOME_Evolution_Calendar_stringlist obj_list;
 	CORBA_Environment ev;
 	const GList *l;
-	int num_objs, i;
+	gint num_objs, i;
 
 	g_return_if_fail (query != NULL);
 	g_return_if_fail (IS_QUERY (query));
@@ -700,7 +700,7 @@ e_data_cal_view_notify_objects_added (EDataCalView *query, const GList *objects)
  * Notifies all the query listeners of the addition of a single object.
  */
 void
-e_data_cal_view_notify_objects_added_1 (EDataCalView *query, const char *object)
+e_data_cal_view_notify_objects_added_1 (EDataCalView *query, const gchar *object)
 {
 	EDataCalViewPrivate *priv;
 	GList objects;
@@ -732,7 +732,7 @@ e_data_cal_view_notify_objects_modified (EDataCalView *query, const GList *objec
 	GNOME_Evolution_Calendar_CalObjUIDSeq obj_list;
 	CORBA_Environment ev;
 	const GList *l;
-	int num_objs, i;
+	gint num_objs, i;
 
 	g_return_if_fail (query != NULL);
 	g_return_if_fail (IS_QUERY (query));
@@ -778,7 +778,7 @@ e_data_cal_view_notify_objects_modified (EDataCalView *query, const GList *objec
  * Notifies all query listeners of the modification of a single object.
  */
 void
-e_data_cal_view_notify_objects_modified_1 (EDataCalView *query, const char *object)
+e_data_cal_view_notify_objects_modified_1 (EDataCalView *query, const gchar *object)
 {
 	EDataCalViewPrivate *priv;
 	GList objects;
@@ -810,7 +810,7 @@ e_data_cal_view_notify_objects_removed (EDataCalView *query, const GList *ids)
 	GNOME_Evolution_Calendar_CalObjIDSeq id_list;
 	CORBA_Environment ev;
 	const GList *l;
-	int num_ids, i;
+	gint num_ids, i;
 
 	g_return_if_fail (query != NULL);
 	g_return_if_fail (IS_QUERY (query));
@@ -892,7 +892,7 @@ e_data_cal_view_notify_objects_removed_1 (EDataCalView *query, const ECalCompone
  * Notifies all query listeners of progress messages.
  */
 void
-e_data_cal_view_notify_progress (EDataCalView *query, const char *message, int percent)
+e_data_cal_view_notify_progress (EDataCalView *query, const gchar *message, gint percent)
 {
 	EDataCalViewPrivate *priv;
 	CORBA_Environment ev;
diff --git a/calendar/libedata-cal/e-data-cal-view.h b/calendar/libedata-cal/e-data-cal-view.h
index 10d251f..e1d0259 100644
--- a/calendar/libedata-cal/e-data-cal-view.h
+++ b/calendar/libedata-cal/e-data-cal-view.h
@@ -59,9 +59,9 @@ EDataCalView         *e_data_cal_view_new (ECalBackend
 					   GNOME_Evolution_Calendar_CalViewListener  ql,
 					   ECalBackendSExp                   *sexp);
 void                  e_data_cal_view_add_listener (EDataCalView *query, GNOME_Evolution_Calendar_CalViewListener ql);
-const char           *e_data_cal_view_get_text (EDataCalView *query);
+const gchar           *e_data_cal_view_get_text (EDataCalView *query);
 ECalBackendSExp      *e_data_cal_view_get_object_sexp (EDataCalView *query);
-gboolean              e_data_cal_view_object_matches (EDataCalView *query, const char *object);
+gboolean              e_data_cal_view_object_matches (EDataCalView *query, const gchar *object);
 
 GList                *e_data_cal_view_get_matched_objects (EDataCalView *query);
 gboolean              e_data_cal_view_is_started (EDataCalView *query);
@@ -71,18 +71,18 @@ GNOME_Evolution_Calendar_CallStatus e_data_cal_view_get_done_status (EDataCalVie
 void                  e_data_cal_view_notify_objects_added (EDataCalView       *query,
 							    const GList *objects);
 void                  e_data_cal_view_notify_objects_added_1 (EDataCalView       *query,
-							      const char *object);
+							      const gchar *object);
 void                  e_data_cal_view_notify_objects_modified (EDataCalView       *query,
 							       const GList *objects);
 void                  e_data_cal_view_notify_objects_modified_1 (EDataCalView       *query,
-								 const char *object);
+								 const gchar *object);
 void                  e_data_cal_view_notify_objects_removed (EDataCalView       *query,
 							      const GList *ids);
 void                  e_data_cal_view_notify_objects_removed_1 (EDataCalView       *query,
 								const ECalComponentId *id);
 void                  e_data_cal_view_notify_progress (EDataCalView      *query,
-						       const char *message,
-						       int         percent);
+						       const gchar *message,
+						       gint         percent);
 void                  e_data_cal_view_notify_done (EDataCalView                               *query,
 						   GNOME_Evolution_Calendar_CallStatus status);
 
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index aba7a7e..f01422d 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -52,7 +52,7 @@ impl_Cal_get_uri (PortableServer_Servant servant,
 {
 	EDataCal *cal;
 	EDataCalPrivate *priv;
-	const char *str_uri;
+	const gchar *str_uri;
 	CORBA_char *str_uri_copy;
 
 	cal = E_DATA_CAL (bonobo_object_from_servant (servant));
@@ -283,7 +283,7 @@ impl_Cal_getFreeBusy (PortableServer_Servant servant,
 
 	/* convert the CORBA user list to a GList */
 	if (user_list) {
-		int i;
+		gint i;
 
 		for (i = 0; i < user_list->_length; i++)
 			users = g_list_append (users, user_list->_buffer[i]);
@@ -742,7 +742,7 @@ e_data_cal_notify_read_only (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus
  * Notifies listeners of the completion of the get_cal_address method call.
  */
 void
-e_data_cal_notify_cal_address (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *address)
+e_data_cal_notify_cal_address (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const gchar *address)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -771,7 +771,7 @@ e_data_cal_notify_cal_address (EDataCal *cal, GNOME_Evolution_Calendar_CallStatu
  * Notifies listeners of the completion of the get_alarm_email_address method call.
  */
 void
-e_data_cal_notify_alarm_email_address (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *address)
+e_data_cal_notify_alarm_email_address (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const gchar *address)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -800,7 +800,7 @@ e_data_cal_notify_alarm_email_address (EDataCal *cal, GNOME_Evolution_Calendar_C
  * Notifies listeners of the completion of the get_ldap_attribute method call.
  */
 void
-e_data_cal_notify_ldap_attribute (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *attribute)
+e_data_cal_notify_ldap_attribute (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const gchar *attribute)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -829,7 +829,7 @@ e_data_cal_notify_ldap_attribute (EDataCal *cal, GNOME_Evolution_Calendar_CallSt
  * Notifies listeners of the completion of the get_static_capabilities method call.
  */
 void
-e_data_cal_notify_static_capabilities (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *capabilities)
+e_data_cal_notify_static_capabilities (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const gchar *capabilities)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -917,7 +917,7 @@ e_data_cal_notify_remove (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus sta
  */
 void
 e_data_cal_notify_object_created (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-				  const char *uid, const char *object)
+				  const gchar *uid, const gchar *object)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -953,7 +953,7 @@ e_data_cal_notify_object_created (EDataCal *cal, GNOME_Evolution_Calendar_CallSt
  */
 void
 e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-				   const char *old_object, const char *object)
+				   const gchar *old_object, const gchar *object)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -989,7 +989,7 @@ e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallS
  */
 void
 e_data_cal_notify_object_removed (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-				  const ECalComponentId *id, const char *old_object, const char *object)
+				  const ECalComponentId *id, const gchar *old_object, const gchar *object)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -1078,7 +1078,7 @@ e_data_cal_notify_alarm_discarded (EDataCal *cal, GNOME_Evolution_Calendar_CallS
  * Notifies listeners of the completion of the send_objects method call.
  */
 void
-e_data_cal_notify_objects_sent (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, GList *users, const char *calobj)
+e_data_cal_notify_objects_sent (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, GList *users, const gchar *calobj)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -1094,7 +1094,7 @@ e_data_cal_notify_objects_sent (EDataCal *cal, GNOME_Evolution_Calendar_CallStat
 	corba_users->_length = g_list_length (users);
 	if (users) {
 		GList *l;
-		int n;
+		gint n;
 
 		corba_users->_buffer = CORBA_sequence_GNOME_Evolution_Calendar_User_allocbuf (corba_users->_length);
 		for (l = users, n = 0; l != NULL; l = l->next, n++)
@@ -1121,7 +1121,7 @@ e_data_cal_notify_objects_sent (EDataCal *cal, GNOME_Evolution_Calendar_CallStat
  * Notifies listeners of the completion of the get_default_object method call.
  */
 void
-e_data_cal_notify_default_object (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *object)
+e_data_cal_notify_default_object (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const gchar *object)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -1152,7 +1152,7 @@ e_data_cal_notify_default_object (EDataCal *cal, GNOME_Evolution_Calendar_CallSt
  * Notifies listeners of the completion of the get_object method call.
  */
 void
-e_data_cal_notify_object (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *object)
+e_data_cal_notify_object (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const gchar *object)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -1189,7 +1189,7 @@ e_data_cal_notify_object_list (EDataCal *cal, GNOME_Evolution_Calendar_CallStatu
 	CORBA_Environment ev;
 	GNOME_Evolution_Calendar_stringlist seq;
 	GList *l;
-	int i;
+	gint i;
 
 	g_return_if_fail (cal != NULL);
 	g_return_if_fail (E_IS_DATA_CAL (cal));
@@ -1233,7 +1233,7 @@ e_data_cal_notify_attachment_list (EDataCal *cal, GNOME_Evolution_Calendar_CallS
 	CORBA_Environment ev;
 	GNOME_Evolution_Calendar_stringlist seq;
 	GSList *l;
-	int i;
+	gint i;
 
 	g_return_if_fail (cal != NULL);
 	g_return_if_fail (E_IS_DATA_CAL (cal));
@@ -1300,7 +1300,7 @@ e_data_cal_notify_query (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus stat
  * Notifies listeners of the completion of the get_timezone method call.
  */
 void
-e_data_cal_notify_timezone_requested (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *object)
+e_data_cal_notify_timezone_requested (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const gchar *object)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -1328,7 +1328,7 @@ e_data_cal_notify_timezone_requested (EDataCal *cal, GNOME_Evolution_Calendar_Ca
  * Notifies listeners of the completion of the add_timezone method call.
  */
 void
-e_data_cal_notify_timezone_added (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *tzid)
+e_data_cal_notify_timezone_added (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const gchar *tzid)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -1392,7 +1392,7 @@ e_data_cal_notify_changes (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus st
 	CORBA_Environment ev;
 	GNOME_Evolution_Calendar_CalObjChangeSeq seq;
 	GList *l;
-	int n, i;
+	gint n, i;
 
 	g_return_if_fail (E_IS_DATA_CAL (cal));
 
@@ -1452,7 +1452,7 @@ e_data_cal_notify_free_busy (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus
 	CORBA_Environment ev;
 	GNOME_Evolution_Calendar_CalObjSeq seq;
 	GList *l;
-	int n, i;
+	gint n, i;
 
 	g_return_if_fail (E_IS_DATA_CAL (cal));
 
@@ -1545,7 +1545,7 @@ e_data_cal_notify_auth_required (EDataCal *cal)
  * Notify a calendar client of an error occurred in the backend.
  */
 void
-e_data_cal_notify_error (EDataCal *cal, const char *message)
+e_data_cal_notify_error (EDataCal *cal, const gchar *message)
 {
 	EDataCalPrivate *priv;
 	CORBA_Environment ev;
@@ -1558,7 +1558,7 @@ e_data_cal_notify_error (EDataCal *cal, const char *message)
 	g_return_if_fail (priv->listener != CORBA_OBJECT_NIL);
 
 	CORBA_exception_init (&ev);
-	GNOME_Evolution_Calendar_CalListener_notifyErrorOccurred (priv->listener, (char *) message, &ev);
+	GNOME_Evolution_Calendar_CalListener_notifyErrorOccurred (priv->listener, (gchar *) message, &ev);
 
 	if (BONOBO_EX (&ev))
 		g_message ("e_data_cal_notify_remove(): could not notify the listener "
diff --git a/calendar/libedata-cal/e-data-cal.h b/calendar/libedata-cal/e-data-cal.h
index 9c65fb8..4d2af00 100644
--- a/calendar/libedata-cal/e-data-cal.h
+++ b/calendar/libedata-cal/e-data-cal.h
@@ -66,33 +66,33 @@ GNOME_Evolution_Calendar_CalListener e_data_cal_get_listener (EDataCal *cal);
 void e_data_cal_notify_read_only           (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
 					    gboolean read_only);
 void e_data_cal_notify_cal_address         (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					    const char *address);
+					    const gchar *address);
 void e_data_cal_notify_alarm_email_address (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					    const char *address);
+					    const gchar *address);
 void e_data_cal_notify_ldap_attribute      (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					    const char *attribute);
+					    const gchar *attribute);
 void e_data_cal_notify_static_capabilities (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					    const char *capabilities);
+					    const gchar *capabilities);
 
 void e_data_cal_notify_open   (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status);
 void e_data_cal_notify_remove (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status);
 
 void e_data_cal_notify_object_created  (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					const char *uid, const char *object);
+					const gchar *uid, const gchar *object);
 void e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					const char *old_object, const char *object);
+					const gchar *old_object, const gchar *object);
 void e_data_cal_notify_object_removed  (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					const ECalComponentId *id, const char *old_object, const char *object);
+					const ECalComponentId *id, const gchar *old_object, const gchar *object);
 void e_data_cal_notify_alarm_discarded (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status);
 
 void e_data_cal_notify_objects_received (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status);
 void e_data_cal_notify_objects_sent     (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, GList *users,
-					 const char *calobj);
+					 const gchar *calobj);
 
 void e_data_cal_notify_default_object (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-				       const char *object);
+				       const gchar *object);
 void e_data_cal_notify_object         (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-				       const char *object);
+				       const gchar *object);
 void e_data_cal_notify_object_list    (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
 				       GList *objects);
 
@@ -100,9 +100,9 @@ void e_data_cal_notify_query (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus
 			      EDataCalView *query);
 
 void e_data_cal_notify_timezone_requested   (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					     const char *object);
+					     const gchar *object);
 void e_data_cal_notify_timezone_added       (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
-					     const char *tzid);
+					     const gchar *tzid);
 void e_data_cal_notify_default_timezone_set (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status);
 
 void e_data_cal_notify_changes   (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
@@ -116,7 +116,7 @@ void e_data_cal_notify_mode  (EDataCal *cal,
 
 void e_data_cal_notify_auth_required (EDataCal *cal);
 
-void e_data_cal_notify_error (EDataCal *cal, const char *message);
+void e_data_cal_notify_error (EDataCal *cal, const gchar *message);
 
 void e_data_cal_notify_attachment_list (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, GSList *objects);
 
diff --git a/calendar/tests/ecal/test-ecal.c b/calendar/tests/ecal/test-ecal.c
index b108cfb..796b186 100644
--- a/calendar/tests/ecal/test-ecal.c
+++ b/calendar/tests/ecal/test-ecal.c
@@ -31,11 +31,11 @@
 
 /* start_testing_scaffold */
 #define mu_assert(message, test) do { if (!(test)) return message; else { tests_passed++; return NULL;}} while (0)
-#define mu_run_test(test) do { const char *message = test; tests_run++; \
+#define mu_run_test(test) do { const gchar *message = test; tests_run++; \
                                 if (message) { cl_printf (client, "***Error***\n%s\n", message); break;} } while (0)
 
-static int tests_run = 0;
-static int tests_passed = 0;
+static gint tests_run = 0;
+static gint tests_passed = 0;
 /* end_testing_scaffold */
 
 static ECal *client1;
@@ -45,7 +45,7 @@ static GMainLoop *loop;
 
 /* Prints a message with a client identifier */
 static void
-cl_printf (ECal *client, const char *format, ...)
+cl_printf (ECal *client, const gchar *format, ...)
 {
 	va_list args;
 
@@ -106,7 +106,7 @@ list_uids (ECal *client)
 		printf ("none\n");
 	else {
 		for (l = objects; l; l = l->next) {
-			const char *uid;
+			const gchar *uid;
 
 			uid = icalcomponent_get_uid (l->data);
 			printf ("`%s' ", uid);
@@ -115,7 +115,7 @@ list_uids (ECal *client)
 		printf ("\n");
 
 		for (l = objects; l; l = l->next) {
-			char *obj = icalcomponent_as_ical_string_r (l->data);
+			gchar *obj = icalcomponent_as_ical_string_r (l->data);
 			printf ("------------------------------\n");
 			printf ("%s", obj);
 			printf ("------------------------------\n");
@@ -141,8 +141,8 @@ client_destroy_cb (gpointer data, GObject *object)
 		g_main_loop_quit (loop);
 }
 
-static const char *
-test_object_creation (ECal *client,  char **uid)
+static const gchar *
+test_object_creation (ECal *client,  gchar **uid)
 {
 	ECalComponent *comp, *comp_retrieved;
 	icalcomponent *icalcomp, *icalcomp_retrieved;
@@ -217,10 +217,10 @@ test_object_creation (ECal *client,  char **uid)
 	return NULL;
 }
 
-static const char *
-test_object_modification (ECal *client, char *uid)
+static const gchar *
+test_object_modification (ECal *client, gchar *uid)
 {
-	const char *summary = "This summary was modified";
+	const gchar *summary = "This summary was modified";
 	icalcomponent *icalcomp, *icalcomp_modified;
 	gboolean compare;
 	GError *error = NULL;
@@ -259,11 +259,11 @@ test_object_modification (ECal *client, char *uid)
 }
 
 #if 0
-static char *
+static gchar *
 test_object_removal (ECal *client)
 {
 
-	char *uid;
+	gchar *uid;
 	ECalComponent *comp;
 	icalcomponent *icalcomp;
 	gboolean compare = 1;
@@ -299,7 +299,7 @@ test_object_removal (ECal *client)
 }
 #endif
 
-static const char *
+static const gchar *
 test_get_alarms_in_range (ECal *client)
 {
 	GSList *alarms;
@@ -320,13 +320,13 @@ test_get_alarms_in_range (ECal *client)
 	return NULL;
 }
 
-static const char *
+static const gchar *
 test_set_uri (ECal *client, const gchar *uri)
 {
 	/* The uri is set as part of create_client call. This method merely
 	 * verifies it was done correctly.
 	 */
-	char *cal_uri;
+	gchar *cal_uri;
 	gboolean compare = 0;
 	cal_uri = g_strconcat ("file://", uri, NULL);
 	compare = !strcmp (e_cal_get_uri (client), cal_uri);
@@ -337,7 +337,7 @@ test_set_uri (ECal *client, const gchar *uri)
 	return NULL;
 }
 
-static const char *
+static const gchar *
 test_cal_loaded (ECal *client)
 {
 	/* Test one loaded calendar and another that is not loaded. */
@@ -348,12 +348,12 @@ test_cal_loaded (ECal *client)
 	return NULL;
 }
 
-static const char *
+static const gchar *
 test_get_source (ECal *client, const gchar *expected)
 {
 	ESource *source;
-	char *uri;
-	char *cal_uri;
+	gchar *uri;
+	gchar *cal_uri;
 	gboolean compare = 0;
 
 	source = e_cal_get_source (client);
@@ -367,13 +367,13 @@ test_get_source (ECal *client, const gchar *expected)
 	return NULL;
 }
 
-static const char *
-test_query (ECal *client, const char *query, int expected)
+static const gchar *
+test_query (ECal *client, const gchar *query, gint expected)
 {
 	/* This uses pre-loaded data. Hence its results are valid only
 	 * when called before any write operation is performed.
 	 */
-	int i = 0;
+	gint i = 0;
 	GList *objects = NULL;
 
 	if (!e_cal_get_object_list (client, query, &objects, NULL))
@@ -387,11 +387,11 @@ test_query (ECal *client, const char *query, int expected)
 }
 
 #if 0
-static char *
-test_e_cal_new (ECal **cal, const char *uri)
+static gchar *
+test_e_cal_new (ECal **cal, const gchar *uri)
 {
 	GError *error = NULL;
-	char *cal_uri, *cal_file;
+	gchar *cal_uri, *cal_file;
 	gboolean created = 0;
 
 	cal_uri = g_strconcat ("file://", uri, NULL);
@@ -422,10 +422,10 @@ test_e_cal_new (ECal **cal, const char *uri)
 	return NULL;
 }
 
-static char *
-test_e_cal_remove (ECal *ecal, const char *uri)
+static gchar *
+test_e_cal_remove (ECal *ecal, const gchar *uri)
 {
-	char *cal_uri;
+	gchar *cal_uri;
 	GError *error = NULL;
 	gboolean removed = 0;
 
@@ -443,11 +443,11 @@ test_e_cal_remove (ECal *ecal, const char *uri)
 }
 #endif
 
-static const char *
+static const gchar *
 test_new_system_calendar(void)
 {
 	ECal *cal;
-	char *uri;
+	gchar *uri;
 	gboolean created;
 
 	cal = e_cal_new_system_calendar ();
@@ -460,11 +460,11 @@ test_new_system_calendar(void)
 	return NULL;
 }
 
-static const char *
+static const gchar *
 test_new_system_tasks(void)
 {
 	ECal *cal;
-	char *uri;
+	gchar *uri;
 	gboolean created;
 
 	cal = e_cal_new_system_tasks ();
@@ -477,11 +477,11 @@ test_new_system_tasks(void)
 	return NULL;
 }
 
-static const char *
+static const gchar *
 test_new_system_memos(void)
 {
 	ECal *cal;
-	char *uri;
+	gchar *uri;
 	gboolean created;
 
 	cal = e_cal_new_system_memos ();
@@ -494,7 +494,7 @@ test_new_system_memos(void)
 	return NULL;
 }
 
-static char *
+static gchar *
 test_get_free_busy (ECal *client)
 {
 	/* TODO uses NULL for users and currently specific to file backend. */
@@ -514,7 +514,7 @@ test_get_free_busy (ECal *client)
 	if (freebusy) {
 		cl_printf (client, "Printing free busy information\n");
 		for (l = freebusy; l; l = l->next) {
-			char *comp_string;
+			gchar *comp_string;
 			ECalComponent *comp = E_CAL_COMPONENT (l->data);
 
 			comp_string = e_cal_component_get_as_string (comp);
@@ -530,12 +530,12 @@ test_get_free_busy (ECal *client)
 }
 
 
-static char *
+static gchar *
 test_get_default_object (ECal *client)
 {
 	icalcomponent *icalcomp;
 	GError *error = NULL;
-	char *ical_string;
+	gchar *ical_string;
 	if (e_cal_get_default_object (client, &icalcomp, &error)) {
 		ical_string = icalcomponent_as_ical_string_r (icalcomp);
 		cl_printf (client, "Obtained default object: %s\n", ical_string);
@@ -580,11 +580,11 @@ ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=OPT-PARTICIPANT;PARTSTAT=NEEDS-ACTION;\
 LAST-MODIFIED:20040213T055647Z\
 END:VEVENT"
 
-static const char *
+static const gchar *
 test_get_object (ECal *client)
 {
-	const char *uid = "20040213T055519Z-15802-500-1-3 testcal";
-	char *actual;
+	const gchar *uid = "20040213T055519Z-15802-500-1-3 testcal";
+	gchar *actual;
 	icalcomponent *icalcomp;
 	gboolean compare;
 	GError *error = NULL;
@@ -603,7 +603,7 @@ test_get_object (ECal *client)
 	return NULL;
 }
 
-static char *
+static gchar *
 test_timezones (ECal *client)
 {
 	icaltimezone *zone;
@@ -620,10 +620,10 @@ test_timezones (ECal *client)
 	return NULL;
 }
 
-static const char *
+static const gchar *
 all_tests(ECal *client, const gchar *uri)
 {
-	char *uid;
+	gchar *uid;
 
 	mu_run_test (test_new_system_calendar ());
 	mu_run_test (test_new_system_tasks ());
@@ -663,9 +663,9 @@ all_tests(ECal *client, const gchar *uri)
 static void
 create_client (ECal **client, const gchar *uri, ECalSourceType type, gboolean only_if_exists)
 {
-	const char *results;
+	const gchar *results;
 	ECalView *query;
-	char *cal_uri;
+	gchar *cal_uri;
 	GError *error = NULL;
 
 	cal_uri = g_strconcat ("file://", uri, NULL);
@@ -714,10 +714,10 @@ create_client (ECal **client, const gchar *uri, ECalSourceType type, gboolean on
 
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
-	char *uri;
+	gchar *uri;
 	bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
 	textdomain (GETTEXT_PACKAGE);
 
diff --git a/calendar/tests/ecal/test-recur.c b/calendar/tests/ecal/test-recur.c
index 3ebe614..6dc7902 100644
--- a/calendar/tests/ecal/test-recur.c
+++ b/calendar/tests/ecal/test-recur.c
@@ -3,8 +3,8 @@
 #include <stdlib.h>
 #include <libecal/e-cal.h>
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	ECal *ecal;
 
diff --git a/calendar/tests/ecal/test-search.c b/calendar/tests/ecal/test-search.c
index caab5c8..bc2e734 100644
--- a/calendar/tests/ecal/test-search.c
+++ b/calendar/tests/ecal/test-search.c
@@ -3,8 +3,8 @@
 #include <stdlib.h>
 #include <libecal/e-cal.h>
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	ECal *ecal;
 	GList *l, *objects;
@@ -31,7 +31,7 @@ main (int argc, char **argv)
 	printf ("Received %d objects\n", g_list_length (objects));
 	for (l = objects; l; l = l->next) {
 		ECalComponent *comp = E_CAL_COMPONENT (l->data);
-		char *str;
+		gchar *str;
 
 		str = e_cal_component_get_as_string (comp);
 		printf ("%s\n", str);
diff --git a/camel/camel-address.c b/camel/camel-address.c
index bc9c0fd..30fa365 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 b4824d1..23e1968 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 81aa19c..4c0af6c 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 09a129f..5bc1b4c 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 b2ffaca..3939570 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 aa64d91..244e808 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 e2a9179..7a571de 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 831bbff..8acd8e4 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 72a728f..80fd9fc 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 dc22d07..51f802a 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 290c480..bdc8084 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 3f6b273..d0884d1 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 033f7b1..251e6f4 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 6e5abce..02831d0 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 f3aa867..dec0cc9 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 a743365..927fe6e 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 fd421ee..993a789 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 86fd43d..72ec538 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 eba87d4..c73b6f4 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 32d688c..5b377e7 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 aa84816..ef1c202 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 a6e0d0f..94f8f22 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 68d23b4..2a893ba 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 0850b48..562c8ef 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 84c2faa..b3fdb07 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 ca3ada7..622d186 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 a9bbb11..61f29ff 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 782c646..c73e378 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 903fa97..0673c31 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 bd83f63..1a58a48 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 64265df..1c0c2c8 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 597985e..e305f7c 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 6107991..2c78eb1 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 60c5e1d..243e1c5 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 188c483..d84746d 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 3d3d5c6..c361f9c 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 28d941d..aebfcf4 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 8f1b3b2..c786d0a 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 8a1df4b..edadf62 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 2fd8c4c..18f6c25 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 0501def..25af5c0 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 0cc74c9..f36cf2f 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 4cc76db..6f6fd15 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 922a974..1479648 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 0699c91..f106339 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 13ef1e0..9c0b699 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 79dca62..951e130 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 ca97078..2265446 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 7cad99a..2649656 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 6419741..ff11441 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 0a7fc4b..890d7aa 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 95ec361..4cbf02f 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 96391e0..e09711b 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 ea4b052..afcf497 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 7e38ac3..7707ecb 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 fafe22b..10329ce 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 50ad5a5..3e4bb19 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 3ae9489..86d7376 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 6f0f54e..82924f1 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 fef835f..bf9489b 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 5ce5a35..e75ef23 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 54c8dc1..8b480d8 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 732a318..a343326 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 9146db9..81153a5 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 2e2a76c..7ebd3cc 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 3e2da63..1fa23a1 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 0202ed6..3ab9925 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 c0d9de5..527f5f8 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 16a8ebc..e6a93f2 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 7e4a083..1a77993 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 b4d7fce..498359d 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 1ee3ed0..c883e74 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 8e372d2..7c0f866 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 e76e9a2..f7742e9 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 a89bcdb..1948d07 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 7184b80..7b08fdd 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 aea7adf..f543b66 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 aafa4be..900f95c 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 3e62cf1..8cdc929 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 2434a6c..6d0d356 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 1712901..b1ee68e 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 df49757..41ef84d 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 98592bc..774a403 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 95de648..63df3ce 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 ced3a8f..60ffcbe 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 ee2fbf3..cd15d82 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 15fd2d4..949a126 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 5ed155b..852d15c 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 4771d81..35794b4 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 d12421c..1550ebf 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 8996b4e..acbdda0 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 f585901..0f1f15f 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 473eac0..6647ebd 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 beadb79..9c74c8f 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 9e1445e..88afefe 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 0d49f84..6db62ba 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 acfe2a5..c027100 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 b6730d5..70fd8cb 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 f0c61be..7fcdd0e 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 04160d5..84bd8eb 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 9e5abe3..4956340 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 19c3e6a..c688ce5 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 facfc3b..2276763 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 5c16bcb..c67dfbf 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 8d0eda5..5bbed27 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 fc01e78..df81611 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 c9e967b..4bfbe30 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 f8773e3..a713959 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 1b9acc1..6f1df0c 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 848b98e..96cdf15 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 9e29197..866f4e1 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 00b672f..ec590f6 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 b90e5d6..99419b9 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 5b843eb..8e673dc 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 a58711f..3ed7d7b 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 810574b..4af66e8 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 8d4a8f4..208e2b2 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 363571c..8e02069 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 9478670..366d202 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 8e41034..e6b022b 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 1d085a7..c14264d 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 d3177d1..1c8d58a 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 c995048..c1cffd5 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 b254923..78fb080 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 a7c9270..be4b117 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 098ae3c..4a42b13 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 264979b..9bc9bf4 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 acfe1b3..458c9c8 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 3dda5e2..d64abfe 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 940f10d..5fff2af 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 2f9d1c6..1215323 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 df2eb4c..92c4419 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 9738ef0..1a3caba 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 b94c818..019ccd7 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 1c08ef0..4e6b0d7 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 ecdc07b..4e96c95 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 4a27fa3..67f17d7 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 fbc2851..0fa138a 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 fea2dd6..6ddc423 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 58fd3e1..d8113c9 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 25b2179..cdd22a6 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 e311782..3af757c 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 798b9a5..2995248 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 52530a1..a89e052 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 6aaa993..060da3e 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 7214c32..aca41d5 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 d72a12c..aeefbec 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 0780487..0f4ea31 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 524d431..7b60f30 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 6a4807c..3ab4fd2 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 bd5005c..d50a48a 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 1bcced0..acce35c 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 e9e7451..a818d49 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 845e0d1..f7421d3 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 8e93cea..f788391 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 04148c9..c5af679 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 2e02b29..a56e1d3 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 c1505fc..25e449a 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 63d6309..bac314f 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 943d209..5ffbe8c 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 b7449c9..b7b3f70 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 b7f14ae..a672406 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 ba704a6..2275a64 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 a9bd2ec..9d7270f 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 7c3a0a0..f28f8e7 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 9a4a3bc..c4b002b 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 457b7e7..e4a19ee 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 36146aa..dd87644 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 b7d1205..a0200de 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 121d1ee..8dd86f1 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 48d709d..cbb8e86 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 7321d85..8d3ac83 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 db07599..883c241 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 f61ad01..d75c48c 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 adb352f..298d2f1 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 167ab02..da71c0f 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 100d1de..651cd88 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 898b615..c996ecf 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 e957a33..2b65d3f 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 4226735..d5915be 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 da6c0ee..a9685c9 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 b8a323c..41081f0 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 d9a070c..7044e71 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 3423386..97e268e 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 4012deb..1d59849 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 8a8ec0d..93e2268 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 929676c..ab24d5e 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 33ef722..65918d0 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 8681ab6..6cd7da1 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 62c7423..38dbfc5 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 8102a58..f310a0e 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 b1034c3..e13bdd7 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 be9c298..01b0078 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 4d631cb..c14ceec 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 14e4b81..55d3643 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 808a8ba..e91e172 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 7368b6a..742bbbc 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 b49c6d5..36da666 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 7456454..fc8cc74 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 669c963..6bb2abe 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 f7e539f..4b4cc9b 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 f0d5da1..9443783 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 a67ff85..24c7221 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 9b004c4..4ffb104 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 44fa458..6564e04 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 9b1d281..9d2e7ae 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 1dfaf4d..a17d452 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 3889b1f..4718727 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 6a8a230..261608b 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 c080688..e665fa6 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 aaef8ad..644c878 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 4293a06..9c80a36 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 5569c00..1aaccb8 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 356bf4c..cec0aab 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 4be6fb1..95d30a5 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 0d1f6d5..023ad48 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 8a02e2d..f95382b 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 3f3efe9..a3ce5b7 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 25422ec..985d5fe 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 5df3bce..4d6bd0a 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 34baa69..da4ba98 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 386510f..0fc3f29 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 2da8338..3b605b1 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 040516b..2edddd0 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 759c916..75a386e 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 fb784c2..494b159 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 b851cc6..8340784 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 3615e2a..7da65d5 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 0b229fe..c4ec30a 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 f039219..d6b8195 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 9b8e9ed..cc4945e 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 a2e37af..246bc34 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 2e48e41..36bcce2 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 c0825fd..8419859 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 0aebbf0..effe9c0 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 eae0807..d4ad488 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 a637712..7771257 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 58facb0..5afd569 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 e9be55e..afe4e2b 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 0deb6bf..a7dd04a 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 bc1ed51..e5cc6d3 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 83a098f..bde63ae 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 757b17f..27bd056 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 c4c5b2e..f1dbd65 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 5e36f3b..4145435 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 175e11e..9eb6dca 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 0636e28..8d7f150 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 a12ecc2..40f8cc5 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 2eeba04..b0fa350 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 4baec84..f957b40 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 e171b7a..733a6e9 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 55f0a6c..39c43c1 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 e80bf04..e62dcd1 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 f43c8d1..b98fc83 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 e65393c..13ebcd7 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 d2c207d..6d6c94a 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 2f10c66..f858609 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 fec9281..70686e6 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 a0751af..6567e72 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 9f70c8a..59580ab 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 05486ca..db94a38 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 b8a13a9..b045674 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 5eee607..da852d8 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 cc703b1..6335259 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 4183795..9caaefd 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 f706877..5ef6449 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 cc75130..7e51906 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 6ad7f3f..18a9479 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 e294d3f..64804a6 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 567d945..59862a7 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 bcc07d9..90b9e1d 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 d534b95..c08411e 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 59f91b8..198b2a9 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 ef028cf..a2fe866 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 afa83f7..e9157df 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 6bfc93c..37f2a40 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 65af322..f658b6f 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 3f7734d..7d6e01a 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 a230f4c..42cb016 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 b9f98cc..bd81593 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 708c27e..d9c93b2 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 79c8b25..57317ff 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 bf8a173..13e2d69 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 676f575..1cf195f 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 10d508a..67971a7 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 4411c51..2ba1db0 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 4af986f..44570bd 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 e784e10..ab84a2d 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 e66afad..2260ad3 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 e7f84f6..7549788 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 bdf1754..4fe9328 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 a401038..b4b8b8d 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 d8b9b21..8e93b8a 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 731aaa3..134969a 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 210bdd6..275cd0a 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 aaf5240..f98cdf4 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 6408ebe..0983c2a 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 1ef01b3..b6d81a8 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 dff4a7d..f9cdcd1 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 638a277..d3c1e7f 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 8e21dc9..86aa707 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 fd6b8fc..b6e2bca 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 62ffefe..dc8494b 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 3ecbfeb..223769e 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 a06c6d3..15e95ae 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 91aa772..e442133 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 5459acd..ea219fc 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 45319a1..f9ed01f 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 3eb83ee..1e5644f 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 a115573..d3aa951 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 abc6556..08f8f2c 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 426ae55..7d2a6b1 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 346edf0..55bed7e 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 28de15a..81d43a8 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 2ba964b..18b9867 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 5317e27..ce057b8 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 c605816..3d3cb05 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 f8c44da..7e41ca7 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 081948e..f2137f1 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 ea94595..f015f09 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 8f6b4f7..7aaba83 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 2fbbf44..e25f984 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 3c832c7..67184a9 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 a54fab1..7e4eccb 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 7f66aa8..036b135 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 5f8cb91..52e7e5c 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 9feee1f..fd6507a 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 81d3e02..87bad82 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 8ca318b..be8e29e 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 39d3dbb..d1df63d 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 730b4c9..cc35974 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 594a91a..1ed56d8 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 9197ae2..8336d4b 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 3211292..541d82a 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 676bd11..b024bfb 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 d06a56b..7ee1ef3 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 9fc9e58..3a112d2 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 7c6342a..0e5623c 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 c4b985e..6f997b6 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 002faeb..4885876 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 06a3e48..d7df9f4 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 65cad8b..ded30b9 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 ff703b1..16fde5c 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 4333714..379ae52 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 7ec1b28..b4efac5 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 e57999d..d709666 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 7e1e6bd..6fcd530 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 bf90cee..104f643 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 2f6a013..0e4075c 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 d130f8b..8140eb5 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 f3e680f..e70f7ca 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 1f2d33b..639b1c0 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 29af44c..493adab 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 46088d8..39ba815 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 78b755f..dd265dc 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 99b1f79..e3bc7aa 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 94f1fd8..11072a5 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 da09947..16b786a 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 8dd1b19..84c8b48 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 dc45bc1..cd88517 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 b2bc105..a42cbac 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 d1e2d6d..f945e30 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 acecac5..33d27ab 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 0ccae32..6c2594b 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 7f166ff..03e13f6 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 08606cf..4958ef6 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 8693592..e6157a9 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 986a943..8ee6b9b 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 6413838..2c7a89c 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 ae98161..de2fb10 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 98f8113..000ebdc 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 24e0407..6b4d560 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 29fa0e4..a3d3d2b 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 fdc5b47..d2943b1 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 d62db50..19a787d 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 df52e28..aac9a80 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 12b585a..e21f7c0 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 556cd97..3b43fb4 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 eeac76a..92f512d 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 2d4eba1..0fc2eea 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 3a023a3..00dc1dd 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 a37876f..82a90ba 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 9df1433..2495a95 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 94a7575..4e67ef9 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 7c77ba5..feabc52 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 4fa8d18..a612c76 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 0aae4fc..c23a730 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 f142dbb..af22c63 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 e0c79de..bb821a1 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 c2db806..062b8d4 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 9bccb2b..0aea68b 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 d95dfba..b1cb711 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 8f9d88b..fcd0436 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 9445dcf..384c559 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 0ca68c8..f48d16f 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 02ad88e..04961a9 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 de829cc..864b64c 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);
diff --git a/iconv-detect.c b/iconv-detect.c
index 7ca1339..8840962 100644
--- a/iconv-detect.c
+++ b/iconv-detect.c
@@ -52,9 +52,9 @@ enum {
 
 
 typedef struct {
-	char *charset;
-	char *format;
-	int id;
+	gchar *charset;
+	gchar *format;
+	gint id;
 } CharInfo;
 
 
@@ -67,7 +67,7 @@ static CharInfo iso8859_tests[] = {
 	{ "8859-1",      "%d-%d",     NO_ISO_D_DASH_D },
 };
 
-static int num_iso8859_tests = sizeof (iso8859_tests) / sizeof (CharInfo);
+static gint num_iso8859_tests = sizeof (iso8859_tests) / sizeof (CharInfo);
 
 static CharInfo iso2022_tests[] = {
 	{ "iso-2022-jp", "iso-%d-%s", ISO_DASH_D_DASH_S_LOWER },
@@ -75,7 +75,7 @@ static CharInfo iso2022_tests[] = {
 	{ "ISO2022-JP",  "ISO%d-%s",  ISO_D_DASH_S },
 };
 
-static int num_iso2022_tests = sizeof (iso2022_tests) / sizeof (CharInfo);
+static gint num_iso2022_tests = sizeof (iso2022_tests) / sizeof (CharInfo);
 
 static CharInfo iso10646_tests[] = {
 	{ "iso-10646-1", "iso-%d-%d",  ISO_DASH_D_DASH_D_LOWER },
@@ -87,16 +87,16 @@ static CharInfo iso10646_tests[] = {
 	{ "UCS-4BE",     "UCS-4BE",    UCS4 },
 };
 
-static int num_iso10646_tests = sizeof (iso10646_tests) / sizeof (CharInfo);
+static gint num_iso10646_tests = sizeof (iso10646_tests) / sizeof (CharInfo);
 
 
-int main (int argc, char **argv)
+gint main (gint argc, gchar **argv)
 {
-	unsigned int iso8859, iso2022, iso10646;
+	guint iso8859, iso2022, iso10646;
 	CharInfo *info;
 	iconv_t cd;
 	FILE *fp;
-	int i;
+	gint i;
 
 	fp = fopen ("iconv-detect.h", "w");
 	if (fp == NULL)
diff --git a/libdb/btree/bt_compare.c b/libdb/btree/bt_compare.c
index 4530a4e..db911b5 100644
--- a/libdb/btree/bt_compare.c
+++ b/libdb/btree/bt_compare.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -58,17 +58,17 @@ static const char revid[] = "$Id$";
  * __bam_cmp --
  *	Compare a key to a given record.
  *
- * PUBLIC: int __bam_cmp __P((DB *, const DBT *, PAGE *,
- * PUBLIC:    u_int32_t, int (*)(DB *, const DBT *, const DBT *), int *));
+ * PUBLIC: gint __bam_cmp __P((DB *, const DBT *, PAGE *,
+ * PUBLIC:    u_int32_t, gint (*)(DB *, const DBT *, const DBT *), gint *));
  */
-int
+gint
 __bam_cmp(dbp, dbt, h, indx, func, cmpp)
 	DB *dbp;
 	const DBT *dbt;
 	PAGE *h;
 	u_int32_t indx;
-	int (*func)__P((DB *, const DBT *, const DBT *));
-	int *cmpp;
+	gint (*func)__P((DB *, const DBT *, const DBT *));
+	gint *cmpp;
 {
 	BINTERNAL *bi;
 	BKEYDATA *bk;
@@ -150,9 +150,9 @@ __bam_cmp(dbp, dbt, h, indx, func, cmpp)
  * __bam_defcmp --
  *	Default comparison routine.
  *
- * PUBLIC: int __bam_defcmp __P((DB *, const DBT *, const DBT *));
+ * PUBLIC: gint __bam_defcmp __P((DB *, const DBT *, const DBT *));
  */
-int
+gint
 __bam_defcmp(dbp, a, b)
 	DB *dbp;
 	const DBT *a, *b;
diff --git a/libdb/btree/bt_conv.c b/libdb/btree/bt_conv.c
index a928973..d3f638c 100644
--- a/libdb/btree/bt_conv.c
+++ b/libdb/btree/bt_conv.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,14 +25,14 @@ static const char revid[] = "$Id$";
  *	Convert host-specific page layout from the host-independent format
  *	stored on disk.
  *
- * PUBLIC: int __bam_pgin __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
+ * PUBLIC: gint __bam_pgin __P((DB_ENV *, DB *, db_pgno_t, gpointer , DBT *));
  */
-int
+gint
 __bam_pgin(dbenv, dummydbp, pg, pp, cookie)
 	DB_ENV *dbenv;
 	DB *dummydbp;
 	db_pgno_t pg;
-	void *pp;
+	gpointer pp;
 	DBT *cookie;
 {
 	DB_PGINFO *pginfo;
@@ -52,14 +52,14 @@ __bam_pgin(dbenv, dummydbp, pg, pp, cookie)
  *	Convert host-specific page layout to the host-independent format
  *	stored on disk.
  *
- * PUBLIC: int __bam_pgout __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
+ * PUBLIC: gint __bam_pgout __P((DB_ENV *, DB *, db_pgno_t, gpointer , DBT *));
  */
-int
+gint
 __bam_pgout(dbenv, dummydbp, pg, pp, cookie)
 	DB_ENV *dbenv;
 	DB *dummydbp;
 	db_pgno_t pg;
-	void *pp;
+	gpointer pp;
 	DBT *cookie;
 {
 	DB_PGINFO *pginfo;
@@ -78,9 +78,9 @@ __bam_pgout(dbenv, dummydbp, pg, pp, cookie)
  * __bam_mswap --
  *	Swap the bytes on the btree metadata page.
  *
- * PUBLIC: int __bam_mswap __P((PAGE *));
+ * PUBLIC: gint __bam_mswap __P((PAGE *));
  */
-int
+gint
 __bam_mswap(pg)
 	PAGE *pg;
 {
diff --git a/libdb/btree/bt_curadj.c b/libdb/btree/bt_curadj.c
index 413b686..ba646c0 100644
--- a/libdb/btree/bt_curadj.c
+++ b/libdb/btree/bt_curadj.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -19,7 +19,7 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_page.h"
 #include "dbinc/btree.h"
 
-static int __bam_opd_cursor __P((DB *, DBC *, db_pgno_t, u_int32_t, u_int32_t));
+static gint __bam_opd_cursor __P((DB *, DBC *, db_pgno_t, u_int32_t, u_int32_t));
 
 #ifdef DEBUG
 /*
@@ -61,20 +61,20 @@ __bam_cprint(dbc)
  *	Update the cursors when items are deleted and when already deleted
  *	items are overwritten.  Return the number of relevant cursors found.
  *
- * PUBLIC: int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int));
+ * PUBLIC: gint __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int));
  */
-int
+gint
 __bam_ca_delete(dbp, pgno, indx, delete)
 	DB *dbp;
 	db_pgno_t pgno;
 	u_int32_t indx;
-	int delete;
+	gint delete;
 {
 	BTREE_CURSOR *cp;
 	DB *ldbp;
 	DB_ENV *dbenv;
 	DBC *dbc;
-	int count;		/* !!!: Has to contain max number of cursors. */
+	gint count;		/* !!!: Has to contain max number of cursors. */
 
 	dbenv = dbp->dbenv;
 
@@ -116,9 +116,9 @@ __bam_ca_delete(dbp, pgno, indx, delete)
  * __ram_ca_delete --
  *	Return the number of relevant cursors.
  *
- * PUBLIC: int __ram_ca_delete __P((DB *, db_pgno_t));
+ * PUBLIC: gint __ram_ca_delete __P((DB *, db_pgno_t));
  */
-int
+gint
 __ram_ca_delete(dbp, root_pgno)
 	DB *dbp;
 	db_pgno_t root_pgno;
@@ -126,7 +126,7 @@ __ram_ca_delete(dbp, root_pgno)
 	DB *ldbp;
 	DBC *dbc;
 	DB_ENV *dbenv;
-	int found;
+	gint found;
 
 	found = 0;
 	dbenv = dbp->dbenv;
@@ -153,14 +153,14 @@ __ram_ca_delete(dbp, root_pgno)
  * __bam_ca_di --
  *	Adjust the cursors during a delete or insert.
  *
- * PUBLIC: int __bam_ca_di __P((DBC *, db_pgno_t, u_int32_t, int));
+ * PUBLIC: gint __bam_ca_di __P((DBC *, db_pgno_t, u_int32_t, int));
  */
-int
+gint
 __bam_ca_di(my_dbc, pgno, indx, adjust)
 	DBC *my_dbc;
 	db_pgno_t pgno;
 	u_int32_t indx;
-	int adjust;
+	gint adjust;
 {
 	DB *dbp, *ldbp;
 	DB_ENV *dbenv;
@@ -168,7 +168,7 @@ __bam_ca_di(my_dbc, pgno, indx, adjust)
 	DB_TXN *my_txn;
 	DBC *dbc;
 	DBC_INTERNAL *cp;
-	int found, ret;
+	gint found, ret;
 
 	dbp = my_dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -223,7 +223,7 @@ __bam_opd_cursor(dbp, dbc, first, tpgno, ti)
 {
 	BTREE_CURSOR *cp, *orig_cp;
 	DBC *dbc_nopd;
-	int ret;
+	gint ret;
 
 	orig_cp = (BTREE_CURSOR *)dbc->internal;
 	dbc_nopd = NULL;
@@ -274,10 +274,10 @@ __bam_opd_cursor(dbp, dbc, first, tpgno, ti)
  *	Adjust the cursors when moving items from a leaf page to a duplicates
  *	page.
  *
- * PUBLIC: int __bam_ca_dup __P((DBC *,
+ * PUBLIC: gint __bam_ca_dup __P((DBC *,
  * PUBLIC:    u_int32_t, db_pgno_t, u_int32_t, db_pgno_t, u_int32_t));
  */
-int
+gint
 __bam_ca_dup(my_dbc, first, fpgno, fi, tpgno, ti)
 	DBC *my_dbc;
 	db_pgno_t fpgno, tpgno;
@@ -289,7 +289,7 @@ __bam_ca_dup(my_dbc, first, fpgno, fi, tpgno, ti)
 	DB_ENV *dbenv;
 	DB_LSN lsn;
 	DB_TXN *my_txn;
-	int found, ret;
+	gint found, ret;
 
 	dbp = my_dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -345,10 +345,10 @@ loop:		MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
  *	from a duplicate page.
  *	Called only during undo processing.
  *
- * PUBLIC: int __bam_ca_undodup __P((DB *,
+ * PUBLIC: gint __bam_ca_undodup __P((DB *,
  * PUBLIC:    u_int32_t, db_pgno_t, u_int32_t, u_int32_t));
  */
-int
+gint
 __bam_ca_undodup(dbp, first, fpgno, fi, ti)
 	DB *dbp;
 	db_pgno_t fpgno;
@@ -358,7 +358,7 @@ __bam_ca_undodup(dbp, first, fpgno, fi, ti)
 	DB *ldbp;
 	DBC *dbc;
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -409,9 +409,9 @@ loop:		MUTEX_THREAD_LOCK(dbenv, dbp->mutexp);
  * __bam_ca_rsplit --
  *	Adjust the cursors when doing reverse splits.
  *
- * PUBLIC: int __bam_ca_rsplit __P((DBC *, db_pgno_t, db_pgno_t));
+ * PUBLIC: gint __bam_ca_rsplit __P((DBC *, db_pgno_t, db_pgno_t));
  */
-int
+gint
 __bam_ca_rsplit(my_dbc, fpgno, tpgno)
 	DBC* my_dbc;
 	db_pgno_t fpgno, tpgno;
@@ -421,7 +421,7 @@ __bam_ca_rsplit(my_dbc, fpgno, tpgno)
 	DB_ENV *dbenv;
 	DB_LSN lsn;
 	DB_TXN *my_txn;
-	int found, ret;
+	gint found, ret;
 
 	dbp = my_dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -462,15 +462,15 @@ __bam_ca_rsplit(my_dbc, fpgno, tpgno)
  * __bam_ca_split --
  *	Adjust the cursors when splitting a page.
  *
- * PUBLIC: int __bam_ca_split __P((DBC *,
+ * PUBLIC: gint __bam_ca_split __P((DBC *,
  * PUBLIC:    db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, int));
  */
-int
+gint
 __bam_ca_split(my_dbc, ppgno, lpgno, rpgno, split_indx, cleft)
 	DBC *my_dbc;
 	db_pgno_t ppgno, lpgno, rpgno;
 	u_int32_t split_indx;
-	int cleft;
+	gint cleft;
 {
 	DB *dbp, *ldbp;
 	DBC *dbc;
@@ -478,7 +478,7 @@ __bam_ca_split(my_dbc, ppgno, lpgno, rpgno, split_indx, cleft)
 	DB_ENV *dbenv;
 	DB_LSN lsn;
 	DB_TXN *my_txn;
-	int found, ret;
+	gint found, ret;
 
 	dbp = my_dbc->dbp;
 	dbenv = dbp->dbenv;
diff --git a/libdb/btree/bt_cursor.c b/libdb/btree/bt_cursor.c
index 911ebc7..0891b77 100644
--- a/libdb/btree/bt_cursor.c
+++ b/libdb/btree/bt_cursor.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,25 +23,25 @@ static const char revid[] = "$Id$";
 #include "dbinc/btree.h"
 #include "dbinc/lock.h"
 
-static int  __bam_bulk __P((DBC *, DBT *, u_int32_t));
-static int  __bam_c_close __P((DBC *, db_pgno_t, int *));
-static int  __bam_c_del __P((DBC *));
-static int  __bam_c_destroy __P((DBC *));
-static int  __bam_c_first __P((DBC *));
-static int  __bam_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-static int  __bam_c_getstack __P((DBC *));
-static int  __bam_c_last __P((DBC *));
-static int  __bam_c_next __P((DBC *, int, int));
-static int  __bam_c_physdel __P((DBC *));
-static int  __bam_c_prev __P((DBC *));
-static int  __bam_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-static int  __bam_c_search __P((DBC *,
-		db_pgno_t, const DBT *, u_int32_t, int *));
-static int  __bam_c_writelock __P((DBC *));
-static int  __bam_getboth_finddatum __P((DBC *, DBT *, u_int32_t));
-static int  __bam_getbothc __P((DBC *, DBT *));
-static int  __bam_get_prev __P((DBC *));
-static int  __bam_isopd __P((DBC *, db_pgno_t *));
+static gint  __bam_bulk __P((DBC *, DBT *, u_int32_t));
+static gint  __bam_c_close __P((DBC *, db_pgno_t, gint *));
+static gint  __bam_c_del __P((DBC *));
+static gint  __bam_c_destroy __P((DBC *));
+static gint  __bam_c_first __P((DBC *));
+static gint  __bam_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+static gint  __bam_c_getstack __P((DBC *));
+static gint  __bam_c_last __P((DBC *));
+static gint  __bam_c_next __P((DBC *, int, int));
+static gint  __bam_c_physdel __P((DBC *));
+static gint  __bam_c_prev __P((DBC *));
+static gint  __bam_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+static gint  __bam_c_search __P((DBC *,
+		db_pgno_t, const DBT *, u_int32_t, gint *));
+static gint  __bam_c_writelock __P((DBC *));
+static gint  __bam_getboth_finddatum __P((DBC *, DBT *, u_int32_t));
+static gint  __bam_getbothc __P((DBC *, DBT *));
+static gint  __bam_get_prev __P((DBC *));
+static gint  __bam_isopd __P((DBC *, db_pgno_t *));
 
 /*
  * Acquire a new page/lock.  If we hold a page/lock, discard the page, and
@@ -132,7 +132,7 @@ static int  __bam_isopd __P((DBC *, db_pgno_t *));
 #undef	DISCARD
 #define	DISCARD(dbc, ldiscard, lock, pagep, ret) {			\
 	DB_MPOOLFILE *__mpf = (dbc)->dbp->mpf;				\
-	int __t_ret;							\
+	gint __t_ret;							\
 	if ((pagep) != NULL) {						\
 		ret = __mpf->put(__mpf, pagep, 0);			\
 		pagep = NULL;						\
@@ -186,15 +186,15 @@ static int  __bam_isopd __P((DBC *, db_pgno_t *));
  * __bam_c_init --
  *	Initialize the access private portion of a cursor
  *
- * PUBLIC: int __bam_c_init __P((DBC *, DBTYPE));
+ * PUBLIC: gint __bam_c_init __P((DBC *, DBTYPE));
  */
-int
+gint
 __bam_c_init(dbc, dbtype)
 	DBC *dbc;
 	DBTYPE dbtype;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	dbenv = dbc->dbp->dbenv;
 
@@ -236,9 +236,9 @@ __bam_c_init(dbc, dbtype)
  * __bam_c_refresh
  *	Set things up properly for cursor re-use.
  *
- * PUBLIC: int __bam_c_refresh __P((DBC *));
+ * PUBLIC: gint __bam_c_refresh __P((DBC *));
  */
-int
+gint
 __bam_c_refresh(dbc)
 	DBC *dbc;
 {
@@ -305,14 +305,14 @@ static int
 __bam_c_close(dbc, root_pgno, rmroot)
 	DBC *dbc;
 	db_pgno_t root_pgno;
-	int *rmroot;
+	gint *rmroot;
 {
 	BTREE_CURSOR *cp, *cp_opd, *cp_c;
 	DB *dbp;
 	DBC *dbc_opd, *dbc_c;
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
-	int cdb_lock, ret, t_ret;
+	gint cdb_lock, ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -604,9 +604,9 @@ __bam_c_destroy(dbc)
  * __bam_c_count --
  *	Return a count of on and off-page duplicates.
  *
- * PUBLIC: int __bam_c_count __P((DBC *, db_recno_t *));
+ * PUBLIC: gint __bam_c_count __P((DBC *, db_recno_t *));
  */
-int
+gint
 __bam_c_count(dbc, recnop)
 	DBC *dbc;
 	db_recno_t *recnop;
@@ -616,7 +616,7 @@ __bam_c_count(dbc, recnop)
 	DB_MPOOLFILE *mpf;
 	db_indx_t indx, top;
 	db_recno_t recno;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -671,7 +671,7 @@ __bam_c_del(dbc)
 	BTREE_CURSOR *cp;
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -750,14 +750,14 @@ err:	/*
  *	Duplicate a btree cursor, such that the new one holds appropriate
  *	locks for the position of the original.
  *
- * PUBLIC: int __bam_c_dup __P((DBC *, DBC *));
+ * PUBLIC: gint __bam_c_dup __P((DBC *, DBC *));
  */
-int
+gint
 __bam_c_dup(orig_dbc, new_dbc)
 	DBC *orig_dbc, *new_dbc;
 {
 	BTREE_CURSOR *orig, *new;
-	int ret;
+	gint ret;
 
 	orig = (BTREE_CURSOR *)orig_dbc->internal;
 	new = (BTREE_CURSOR *)new_dbc->internal;
@@ -796,7 +796,7 @@ __bam_c_get(dbc, key, data, flags, pgnop)
 	DB_MPOOLFILE *mpf;
 	db_pgno_t orig_pgno;
 	db_indx_t orig_indx;
-	int exact, newopd, ret;
+	gint exact, newopd, ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1004,7 +1004,7 @@ __bam_get_prev(dbc)
 	BTREE_CURSOR *cp;
 	DBT key, data;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	if ((ret = __bam_c_prev(dbc)) != 0)
 		return (ret);
@@ -1038,8 +1038,8 @@ __bam_bulk(dbc, data, flags)
 	int32_t  *endp, key_off, *offp, *saveoffp;
 	u_int8_t *dbuf, *dp, *np;
 	u_int32_t key_size, size, space;
-	int adj, is_key, need_pg, next_key, no_dup;
-	int pagesize, rec_key, ret;
+	gint adj, is_key, need_pg, next_key, no_dup;
+	gint pagesize, rec_key, ret;
 
 	ret = 0;
 	key_off = 0;
@@ -1373,10 +1373,10 @@ get_space:
  * __bam_bulk_overflow --
  *	Dump overflow record into the buffer.
  *	The space requirements have already been checked.
- * PUBLIC: int __bam_bulk_overflow
+ * PUBLIC: gint __bam_bulk_overflow
  * PUBLIC:    __P((DBC *, u_int32_t, db_pgno_t, u_int8_t *));
  */
-int
+gint
 __bam_bulk_overflow(dbc, len, pgno, dp)
 	DBC *dbc;
 	u_int32_t len;
@@ -1388,7 +1388,7 @@ __bam_bulk_overflow(dbc, len, pgno, dp)
 	memset(&dbt, 0, sizeof(dbt));
 	F_SET(&dbt, DB_DBT_USERMEM);
 	dbt.ulen = len;
-	dbt.data = (void *)dp;
+	dbt.data = (gpointer)dp;
 	return (__db_goff(dbc->dbp, &dbt, len, pgno, NULL, NULL));
 }
 
@@ -1397,11 +1397,11 @@ __bam_bulk_overflow(dbc, len, pgno, dp)
  *	Put as many off page duplicates as will fit into the buffer.
  * This routine will adjust the cursor to reflect the position in
  * the overflow tree.
- * PUBLIC: int __bam_bulk_duplicates __P((DBC *,
+ * PUBLIC: gint __bam_bulk_duplicates __P((DBC *,
  * PUBLIC:       db_pgno_t, u_int8_t *, int32_t *,
  * PUBLIC:	 int32_t **, u_int8_t **, u_int32_t *, int));
  */
-int
+gint
 __bam_bulk_duplicates(dbc, pgno, dbuf, keyoff, offpp, dpp, spacep, no_dup)
 	DBC *dbc;
 	db_pgno_t pgno;
@@ -1409,7 +1409,7 @@ __bam_bulk_duplicates(dbc, pgno, dbuf, keyoff, offpp, dpp, spacep, no_dup)
 	int32_t *keyoff, **offpp;
 	u_int8_t **dpp;
 	u_int32_t *spacep;
-	int no_dup;
+	gint no_dup;
 {
 	DB *dbp;
 	BKEYDATA *bk;
@@ -1422,7 +1422,7 @@ __bam_bulk_duplicates(dbc, pgno, dbuf, keyoff, offpp, dpp, spacep, no_dup)
 	int32_t *offp;
 	u_int32_t size, space;
 	u_int8_t *dp, *np;
-	int first, need_pg, pagesize, ret, t_ret;
+	gint first, need_pg, pagesize, ret, t_ret;
 
 	ret = 0;
 
@@ -1592,7 +1592,7 @@ __bam_getbothc(dbc, data)
 	BTREE_CURSOR *cp;
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
-	int cmp, exact, ret;
+	gint cmp, exact, ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1664,7 +1664,7 @@ __bam_getboth_finddatum(dbc, data, flags)
 	BTREE_CURSOR *cp;
 	DB *dbp;
 	db_indx_t base, lim, top;
-	int cmp, ret;
+	gint cmp, ret;
 
 	dbp = dbc->dbp;
 	cp = (BTREE_CURSOR *)dbc->internal;
@@ -1768,8 +1768,8 @@ __bam_c_put(dbc, key, data, flags, pgnop)
 	DB_MPOOLFILE *mpf;
 	db_pgno_t root_pgno;
 	u_int32_t iiop;
-	int cmp, exact, ret, stack;
-	void *arg;
+	gint cmp, exact, ret, stack;
+	gpointer arg;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -2009,9 +2009,9 @@ done:	/*
  * __bam_c_rget --
  *	Return the record number for a cursor.
  *
- * PUBLIC: int __bam_c_rget __P((DBC *, DBT *));
+ * PUBLIC: gint __bam_c_rget __P((DBC *, DBT *));
  */
-int
+gint
 __bam_c_rget(dbc, data)
 	DBC *dbc;
 	DBT *data;
@@ -2021,7 +2021,7 @@ __bam_c_rget(dbc, data)
 	DBT dbt;
 	DB_MPOOLFILE *mpf;
 	db_recno_t recno;
-	int exact, ret;
+	gint exact, ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -2066,7 +2066,7 @@ __bam_c_writelock(dbc)
 	DBC *dbc;
 {
 	BTREE_CURSOR *cp;
-	int ret;
+	gint ret;
 
 	cp = (BTREE_CURSOR *)dbc->internal;
 
@@ -2093,7 +2093,7 @@ __bam_c_first(dbc)
 {
 	BTREE_CURSOR *cp;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	cp = (BTREE_CURSOR *)dbc->internal;
 	ret = 0;
@@ -2138,7 +2138,7 @@ __bam_c_last(dbc)
 {
 	BTREE_CURSOR *cp;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	cp = (BTREE_CURSOR *)dbc->internal;
 	ret = 0;
@@ -2183,13 +2183,13 @@ __bam_c_last(dbc)
 static int
 __bam_c_next(dbc, initial_move, deleted_okay)
 	DBC *dbc;
-	int initial_move, deleted_okay;
+	gint initial_move, deleted_okay;
 {
 	BTREE_CURSOR *cp;
 	db_indx_t adjust;
 	db_lockmode_t lock_mode;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	cp = (BTREE_CURSOR *)dbc->internal;
 	ret = 0;
@@ -2258,7 +2258,7 @@ __bam_c_prev(dbc)
 	db_indx_t adjust;
 	db_lockmode_t lock_mode;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	cp = (BTREE_CURSOR *)dbc->internal;
 	ret = 0;
@@ -2319,7 +2319,7 @@ __bam_c_search(dbc, root_pgno, key, flags, exactp)
 	db_pgno_t root_pgno;
 	const DBT *key;
 	u_int32_t flags;
-	int *exactp;
+	gint *exactp;
 {
 	BTREE *t;
 	BTREE_CURSOR *cp;
@@ -2329,7 +2329,7 @@ __bam_c_search(dbc, root_pgno, key, flags, exactp)
 	db_pgno_t bt_lpgno;
 	db_recno_t recno;
 	u_int32_t sflags;
-	int cmp, ret;
+	gint cmp, ret;
 
 	dbp = dbc->dbp;
 	cp = (BTREE_CURSOR *)dbc->internal;
@@ -2547,7 +2547,7 @@ __bam_c_physdel(dbc)
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_pgno_t pgno;
-	int delete_page, empty_page, exact, level, ret;
+	gint delete_page, empty_page, exact, level, ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -2737,7 +2737,7 @@ __bam_c_getstack(dbc)
 	DBT dbt;
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
-	int exact, ret, t_ret;
+	gint exact, ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
diff --git a/libdb/btree/bt_delete.c b/libdb/btree/bt_delete.c
index ec989ed..05ca9fb 100644
--- a/libdb/btree/bt_delete.c
+++ b/libdb/btree/bt_delete.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -62,9 +62,9 @@ static const char revid[] = "$Id$";
  * __bam_ditem --
  *	Delete one or more entries from a page.
  *
- * PUBLIC: int __bam_ditem __P((DBC *, PAGE *, u_int32_t));
+ * PUBLIC: gint __bam_ditem __P((DBC *, PAGE *, u_int32_t));
  */
-int
+gint
 __bam_ditem(dbc, h, indx)
 	DBC *dbc;
 	PAGE *h;
@@ -75,7 +75,7 @@ __bam_ditem(dbc, h, indx)
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
 	u_int32_t nbytes;
-	int ret;
+	gint ret;
 	db_indx_t *inp;
 
 	dbp = dbc->dbp;
@@ -171,19 +171,19 @@ __bam_ditem(dbc, h, indx)
  * __bam_adjindx --
  *	Adjust an index on the page.
  *
- * PUBLIC: int __bam_adjindx __P((DBC *, PAGE *, u_int32_t, u_int32_t, int));
+ * PUBLIC: gint __bam_adjindx __P((DBC *, PAGE *, u_int32_t, u_int32_t, int));
  */
-int
+gint
 __bam_adjindx(dbc, h, indx, indx_copy, is_insert)
 	DBC *dbc;
 	PAGE *h;
 	u_int32_t indx, indx_copy;
-	int is_insert;
+	gint is_insert;
 {
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
 	db_indx_t copy, *inp;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -221,9 +221,9 @@ __bam_adjindx(dbc, h, indx, indx_copy, is_insert)
  * __bam_dpages --
  *	Delete a set of locked pages.
  *
- * PUBLIC: int __bam_dpages __P((DBC *, EPG *));
+ * PUBLIC: gint __bam_dpages __P((DBC *, EPG *));
  */
-int
+gint
 __bam_dpages(dbc, stack_epg)
 	DBC *dbc;
 	EPG *stack_epg;
@@ -239,7 +239,7 @@ __bam_dpages(dbc, stack_epg)
 	db_indx_t nitems;
 	db_pgno_t pgno, root_pgno;
 	db_recno_t rcnt;
-	int done, ret, t_ret;
+	gint done, ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
diff --git a/libdb/btree/bt_method.c b/libdb/btree/bt_method.c
index e19c2bd..8b1116e 100644
--- a/libdb/btree/bt_method.c
+++ b/libdb/btree/bt_method.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -20,29 +20,29 @@ static const char revid[] = "$Id$";
 #include "dbinc/btree.h"
 #include "dbinc/qam.h"
 
-static int __bam_set_bt_compare
-	       __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
-static int __bam_set_bt_maxkey __P((DB *, u_int32_t));
-static int __bam_set_bt_minkey __P((DB *, u_int32_t));
-static int __bam_set_bt_prefix
+static gint __bam_set_bt_compare
+	       __P((DB *, gint (*)(DB *, const DBT *, const DBT *)));
+static gint __bam_set_bt_maxkey __P((DB *, u_int32_t));
+static gint __bam_set_bt_minkey __P((DB *, u_int32_t));
+static gint __bam_set_bt_prefix
 	       __P((DB *, size_t(*)(DB *, const DBT *, const DBT *)));
-static int __ram_set_re_delim __P((DB *, int));
-static int __ram_set_re_len __P((DB *, u_int32_t));
-static int __ram_set_re_pad __P((DB *, int));
-static int __ram_set_re_source __P((DB *, const char *));
+static gint __ram_set_re_delim __P((DB *, int));
+static gint __ram_set_re_len __P((DB *, u_int32_t));
+static gint __ram_set_re_pad __P((DB *, int));
+static gint __ram_set_re_source __P((DB *, const gchar *));
 
 /*
  * __bam_db_create --
  *	Btree specific initialization of the DB structure.
  *
- * PUBLIC: int __bam_db_create __P((DB *));
+ * PUBLIC: gint __bam_db_create __P((DB *));
  */
-int
+gint
 __bam_db_create(dbp)
 	DB *dbp;
 {
 	BTREE *t;
-	int ret;
+	gint ret;
 
 	/* Allocate and initialize the private btree structure. */
 	if ((ret = __os_calloc(dbp->dbenv, 1, sizeof(BTREE), &t)) != 0)
@@ -74,9 +74,9 @@ __bam_db_create(dbp)
  * __bam_db_close --
  *	Btree specific discard of the DB structure.
  *
- * PUBLIC: int __bam_db_close __P((DB *));
+ * PUBLIC: gint __bam_db_close __P((DB *));
  */
-int
+gint
 __bam_db_close(dbp)
 	DB *dbp;
 {
@@ -103,9 +103,9 @@ __bam_db_close(dbp)
  * __bam_set_flags --
  *	Set Btree specific flags.
  *
- * PUBLIC: int __bam_set_flags __P((DB *, u_int32_t *flagsp));
+ * PUBLIC: gint __bam_set_flags __P((DB *, u_int32_t *flagsp));
  */
-int
+gint
 __bam_set_flags(dbp, flagsp)
 	DB *dbp;
 	u_int32_t *flagsp;
@@ -170,7 +170,7 @@ incompat:
 static int
 __bam_set_bt_compare(dbp, func)
 	DB *dbp;
-	int (*func) __P((DB *, const DBT *, const DBT *));
+	gint (*func) __P((DB *, const DBT *, const DBT *));
 {
 	BTREE *t;
 
@@ -264,9 +264,9 @@ __bam_set_bt_prefix(dbp, func)
  * __ram_set_flags --
  *	Set Recno specific flags.
  *
- * PUBLIC: int __ram_set_flags __P((DB *, u_int32_t *flagsp));
+ * PUBLIC: gint __ram_set_flags __P((DB *, u_int32_t *flagsp));
  */
-int
+gint
 __ram_set_flags(dbp, flagsp)
 	DB *dbp;
 	u_int32_t *flagsp;
@@ -301,7 +301,7 @@ __ram_set_flags(dbp, flagsp)
 static int
 __ram_set_re_delim(dbp, re_delim)
 	DB *dbp;
-	int re_delim;
+	gint re_delim;
 {
 	BTREE *t;
 
@@ -349,7 +349,7 @@ __ram_set_re_len(dbp, re_len)
 static int
 __ram_set_re_pad(dbp, re_pad)
 	DB *dbp;
-	int re_pad;
+	gint re_pad;
 {
 	BTREE *t;
 	QUEUE *q;
@@ -375,7 +375,7 @@ __ram_set_re_pad(dbp, re_pad)
 static int
 __ram_set_re_source(dbp, re_source)
 	DB *dbp;
-	const char *re_source;
+	const gchar *re_source;
 {
 	BTREE *t;
 
diff --git a/libdb/btree/bt_open.c b/libdb/btree/bt_open.c
index 95f779a..d5f39a9 100644
--- a/libdb/btree/bt_open.c
+++ b/libdb/btree/bt_open.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -69,14 +69,14 @@ static void __bam_init_meta __P((DB *, BTMETA *, db_pgno_t, DB_LSN *));
  * __bam_open --
  *	Open a btree.
  *
- * PUBLIC: int __bam_open __P((DB *,
- * PUBLIC:      DB_TXN *, const char *, db_pgno_t, u_int32_t));
+ * PUBLIC: gint __bam_open __P((DB *,
+ * PUBLIC:      DB_TXN *, const gchar *, db_pgno_t, u_int32_t));
  */
-int
+gint
 __bam_open(dbp, txn, name, base_pgno, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	db_pgno_t base_pgno;
 	u_int32_t flags;
 {
@@ -119,17 +119,17 @@ __bam_open(dbp, txn, name, base_pgno, flags)
 /*
  * __bam_metachk --
  *
- * PUBLIC: int __bam_metachk __P((DB *, const char *, BTMETA *));
+ * PUBLIC: gint __bam_metachk __P((DB *, const gchar *, BTMETA *));
  */
-int
+gint
 __bam_metachk(dbp, name, btm)
 	DB *dbp;
-	const char *name;
+	const gchar *name;
 	BTMETA *btm;
 {
 	DB_ENV *dbenv;
 	u_int32_t vers;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -274,9 +274,9 @@ wrong_type:
  * __bam_read_root --
  *	Read the root page and check a tree.
  *
- * PUBLIC: int __bam_read_root __P((DB *, DB_TXN *, db_pgno_t, u_int32_t));
+ * PUBLIC: gint __bam_read_root __P((DB *, DB_TXN *, db_pgno_t, u_int32_t));
  */
-int
+gint
 __bam_read_root(dbp, txn, base_pgno, flags)
 	DB *dbp;
 	DB_TXN *txn;
@@ -288,7 +288,7 @@ __bam_read_root(dbp, txn, base_pgno, flags)
 	DBC *dbc;
 	DB_LOCK metalock;
 	DB_MPOOLFILE *mpf;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	meta = NULL;
 	t = dbp->bt_internal;
@@ -421,14 +421,14 @@ __bam_init_meta(dbp, meta, pgno, lsnp)
  * memory or calls mpf->get), 2) the initialization, and 3) the "put page"
  * chunk which either does a fop write or an mpf->put.
  *
- * PUBLIC: int __bam_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
+ * PUBLIC: gint __bam_new_file __P((DB *, DB_TXN *, DB_FH *, const gchar *));
  */
-int
+gint
 __bam_new_file(dbp, txn, fhp, name)
 	DB *dbp;
 	DB_TXN *txn;
 	DB_FH *fhp;
-	const char *name;
+	const gchar *name;
 {
 	BTMETA *meta;
 	DB_ENV *dbenv;
@@ -438,8 +438,8 @@ __bam_new_file(dbp, txn, fhp, name)
 	DBT pdbt;
 	PAGE *root;
 	db_pgno_t pgno;
-	int ret;
-	void *buf;
+	gint ret;
+	gpointer buf;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -525,9 +525,9 @@ err:	if (name != NULL)
  * __bam_new_subdb --
  *	Create a metadata page and a root page for a new btree.
  *
- * PUBLIC: int __bam_new_subdb __P((DB *, DB *, DB_TXN *));
+ * PUBLIC: gint __bam_new_subdb __P((DB *, DB *, DB_TXN *));
  */
-int
+gint
 __bam_new_subdb(mdbp, dbp, txn)
 	DB *mdbp, *dbp;
 	DB_TXN *txn;
@@ -539,7 +539,7 @@ __bam_new_subdb(mdbp, dbp, txn)
 	DB_LSN lsn;
 	DB_MPOOLFILE *mpf;
 	PAGE *root;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbenv = mdbp->dbenv;
 	mpf = mdbp->mpf;
diff --git a/libdb/btree/bt_put.c b/libdb/btree/bt_put.c
index 0d5097c..82f7ab7 100644
--- a/libdb/btree/bt_put.c
+++ b/libdb/btree/bt_put.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -56,10 +56,10 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_page.h"
 #include "dbinc/btree.h"
 
-static int __bam_build
+static gint __bam_build
 	       __P((DBC *, u_int32_t, DBT *, PAGE *, u_int32_t, u_int32_t));
-static int __bam_dup_convert __P((DBC *, PAGE *, u_int32_t));
-static int __bam_ovput
+static gint __bam_dup_convert __P((DBC *, PAGE *, u_int32_t));
+static gint __bam_ovput
 	       __P((DBC *, u_int32_t, db_pgno_t, PAGE *, u_int32_t, DBT *));
 static u_int32_t
 	   __bam_partsize __P((DB *, u_int32_t, DBT *, PAGE *, u_int32_t));
@@ -68,9 +68,9 @@ static u_int32_t
  * __bam_iitem --
  *	Insert an item into the tree.
  *
- * PUBLIC: int __bam_iitem __P((DBC *, DBT *, DBT *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __bam_iitem __P((DBC *, DBT *, DBT *, u_int32_t, u_int32_t));
  */
-int
+gint
 __bam_iitem(dbc, key, data, op, flags)
 	DBC *dbc;
 	DBT *key, *data;
@@ -85,7 +85,7 @@ __bam_iitem(dbc, key, data, op, flags)
 	PAGE *h;
 	db_indx_t indx;
 	u_int32_t data_size, have_bytes, need_bytes, needed;
-	int cmp, bigkey, bigdata, dupadjust, padrec, replace, ret, was_deleted;
+	gint cmp, bigkey, bigdata, dupadjust, padrec, replace, ret, was_deleted;
 
 	COMPQUIET(bk, NULL);
 
@@ -450,7 +450,7 @@ __bam_build(dbc, op, dbt, h, indx, nbytes)
 	DBT copy, *rdata;
 	u_int32_t len, tlen;
 	u_int8_t *p;
-	int ret;
+	gint ret;
 
 	COMPQUIET(bo, NULL);
 
@@ -568,9 +568,9 @@ user_copy:
  * __bam_ritem --
  *	Replace an item on a page.
  *
- * PUBLIC: int __bam_ritem __P((DBC *, PAGE *, u_int32_t, DBT *));
+ * PUBLIC: gint __bam_ritem __P((DBC *, PAGE *, u_int32_t, DBT *));
  */
-int
+gint
 __bam_ritem(dbc, h, indx, data)
 	DBC *dbc;
 	PAGE *h;
@@ -582,7 +582,7 @@ __bam_ritem(dbc, h, indx, data)
 	DBT orig, repl;
 	db_indx_t cnt, lo, ln, min, off, prefix, suffix;
 	int32_t nbytes;
-	int ret;
+	gint ret;
 	db_indx_t *inp;
 	u_int8_t *p, *t;
 
@@ -688,7 +688,7 @@ __bam_dup_convert(dbc, h, indx)
 	DB_MPOOLFILE *mpf;
 	PAGE *dp;
 	db_indx_t cnt, cpindx, dindx, first, *inp, sz;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -826,7 +826,7 @@ __bam_ovput(dbc, type, pgno, h, indx, item)
 {
 	BOVERFLOW bo;
 	DBT hdr;
-	int ret;
+	gint ret;
 
 	UMRW_SET(bo.unused1);
 	B_TSET(bo.type, type, 0);
diff --git a/libdb/btree/bt_rec.c b/libdb/btree/bt_rec.c
index aeb4aef..2070a6d 100644
--- a/libdb/btree/bt_rec.c
+++ b/libdb/btree/bt_rec.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -32,16 +32,16 @@ static const char revid[] = "$Id$";
  * __bam_split_recover --
  *	Recovery function for split.
  *
- * PUBLIC: int __bam_split_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_split_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_split_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_split_args *argp;
 	DB *file_dbp;
@@ -50,7 +50,7 @@ __bam_split_recover(dbenv, dbtp, lsnp, op, info)
 	PAGE *_lp, *lp, *np, *pp, *_rp, *rp, *sp;
 	db_pgno_t pgno, root_pgno;
 	u_int32_t ptype;
-	int cmp, l_update, p_update, r_update, rc, ret, ret_l, rootsplit, t_ret;
+	gint cmp, l_update, p_update, r_update, rc, ret, ret_l, rootsplit, t_ret;
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__bam_split_print);
@@ -335,16 +335,16 @@ out:	/* Free any pages that weren't dirtied. */
  * __bam_rsplit_recover --
  *	Recovery function for a reverse split.
  *
- * PUBLIC: int __bam_rsplit_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_rsplit_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_rsplit_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_rsplit_args *argp;
 	DB *file_dbp;
@@ -353,7 +353,7 @@ __bam_rsplit_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	db_pgno_t pgno, root_pgno;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -440,23 +440,23 @@ out:	if (pagep != NULL)
  * __bam_adj_recover --
  *	Recovery function for adj.
  *
- * PUBLIC: int __bam_adj_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_adj_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_adj_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_adj_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -509,23 +509,23 @@ out:	if (pagep != NULL)
  *	Recovery function for the adjust of a count change in an internal
  *	page.
  *
- * PUBLIC: int __bam_cadjust_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_cadjust_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_cadjust_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_cadjust_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -592,16 +592,16 @@ out:	if (pagep != NULL)
  * __bam_cdel_recover --
  *	Recovery function for the intent-to-delete of a cursor record.
  *
- * PUBLIC: int __bam_cdel_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_cdel_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_cdel_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_cdel_args *argp;
 	DB *file_dbp;
@@ -609,7 +609,7 @@ __bam_cdel_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	u_int32_t indx;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -661,16 +661,16 @@ out:	if (pagep != NULL)
  * __bam_repl_recover --
  *	Recovery function for page item replacement.
  *
- * PUBLIC: int __bam_repl_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_repl_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_repl_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_repl_args *argp;
 	BKEYDATA *bk;
@@ -679,7 +679,7 @@ __bam_repl_recover(dbenv, dbtp, lsnp, op, info)
 	DBT dbt;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 	u_int8_t *p;
 
 	pagep = NULL;
@@ -769,23 +769,23 @@ out:	if (pagep != NULL)
  * __bam_root_recover --
  *	Recovery function for setting the root page on the meta-data page.
  *
- * PUBLIC: int __bam_root_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_root_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_root_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_root_args *argp;
 	BTMETA *meta;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	meta = NULL;
 	COMPQUIET(info, NULL);
@@ -833,22 +833,22 @@ out:	if (meta != NULL)
  *	Transaction abort function to undo cursor adjustments.
  *	This should only be triggered by subtransaction aborts.
  *
- * PUBLIC: int __bam_curadj_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_curadj_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_curadj_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_curadj_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
-	int ret;
+	gint ret;
 
 	COMPQUIET(info, NULL);
 
@@ -892,23 +892,23 @@ out:	REC_CLOSE;
  *	Transaction abort function to undo cursor adjustments in rrecno.
  *	This should only be triggered by subtransaction aborts.
  *
- * PUBLIC: int __bam_rcuradj_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __bam_rcuradj_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__bam_rcuradj_args *argp;
 	BTREE_CURSOR *cp;
 	DB *file_dbp;
 	DBC *dbc, *rdbc;
 	DB_MPOOLFILE *mpf;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	COMPQUIET(info, NULL);
 	rdbc = NULL;
diff --git a/libdb/btree/bt_reclaim.c b/libdb/btree/bt_reclaim.c
index a55d16f..fcbd0e4 100644
--- a/libdb/btree/bt_reclaim.c
+++ b/libdb/btree/bt_reclaim.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,15 +25,15 @@ static const char revid[] = "$Id$";
  * __bam_reclaim --
  *	Free a database.
  *
- * PUBLIC: int __bam_reclaim __P((DB *, DB_TXN *));
+ * PUBLIC: gint __bam_reclaim __P((DB *, DB_TXN *));
  */
-int
+gint
 __bam_reclaim(dbp, txn)
 	DB *dbp;
 	DB_TXN *txn;
 {
 	DBC *dbc;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	/* Acquire a cursor. */
 	if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0)
@@ -54,9 +54,9 @@ __bam_reclaim(dbp, txn)
  * __bam_truncate --
  *	Truncate a database.
  *
- * PUBLIC: int __bam_truncate __P((DB *, DB_TXN *, u_int32_t *));
+ * PUBLIC: gint __bam_truncate __P((DB *, DB_TXN *, u_int32_t *));
  */
-int
+gint
 __bam_truncate(dbp, txn, countp)
 	DB *dbp;
 	DB_TXN *txn;
@@ -64,7 +64,7 @@ __bam_truncate(dbp, txn, countp)
 {
 	DBC *dbc;
 	db_trunc_param trunc;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	/* Acquire a cursor. */
 	if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0)
diff --git a/libdb/btree/bt_recno.c b/libdb/btree/bt_recno.c
index b51d00a..142c377 100644
--- a/libdb/btree/bt_recno.c
+++ b/libdb/btree/bt_recno.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,10 +25,10 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_shash.h"
 #include "dbinc/lock.h"
 
-static int  __ram_add __P((DBC *, db_recno_t *, DBT *, u_int32_t, u_int32_t));
-static int  __ram_source __P((DB *));
-static int  __ram_sread __P((DBC *, db_recno_t));
-static int  __ram_update __P((DBC *, db_recno_t, int));
+static gint  __ram_add __P((DBC *, db_recno_t *, DBT *, u_int32_t, u_int32_t));
+static gint  __ram_source __P((DB *));
+static gint  __ram_sread __P((DBC *, db_recno_t));
+static gint  __ram_update __P((DBC *, db_recno_t, int));
 
 /*
  * In recno, there are two meanings to the on-page "deleted" flag.  If we're
@@ -104,20 +104,20 @@ static int  __ram_update __P((DBC *, db_recno_t, int));
  * __ram_open --
  *	Recno open function.
  *
- * PUBLIC: int __ram_open __P((DB *,
- * PUBLIC:      DB_TXN *, const char *, db_pgno_t, u_int32_t));
+ * PUBLIC: gint __ram_open __P((DB *,
+ * PUBLIC:      DB_TXN *, const gchar *, db_pgno_t, u_int32_t));
  */
-int
+gint
 __ram_open(dbp, txn, name, base_pgno, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	db_pgno_t base_pgno;
 	u_int32_t flags;
 {
 	BTREE *t;
 	DBC *dbc;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	COMPQUIET(name, NULL);
 	t = dbp->bt_internal;
@@ -163,15 +163,15 @@ __ram_open(dbp, txn, name, base_pgno, flags)
  * __ram_append --
  *	Recno append function.
  *
- * PUBLIC: int __ram_append __P((DBC *, DBT *, DBT *));
+ * PUBLIC: gint __ram_append __P((DBC *, DBT *, DBT *));
  */
-int
+gint
 __ram_append(dbc, key, data)
 	DBC *dbc;
 	DBT *key, *data;
 {
 	BTREE_CURSOR *cp;
-	int ret;
+	gint ret;
 
 	cp = (BTREE_CURSOR *)dbc->internal;
 
@@ -196,9 +196,9 @@ __ram_append(dbc, key, data)
  * __ram_c_del --
  *	Recno cursor->c_del function.
  *
- * PUBLIC: int __ram_c_del __P((DBC *));
+ * PUBLIC: gint __ram_c_del __P((DBC *));
  */
-int
+gint
 __ram_c_del(dbc)
 	DBC *dbc;
 {
@@ -209,7 +209,7 @@ __ram_c_del(dbc)
 	DB_LSN lsn;
 	DBT hdr, data;
 	EPG *epg;
-	int exact, ret, stack;
+	gint exact, ret, stack;
 
 	dbp = dbc->dbp;
 	cp = (BTREE_CURSOR *)dbc->internal;
@@ -316,7 +316,7 @@ __ram_c_del(dbc)
 		hdr.data = &bk;
 		hdr.size = SSZA(BKEYDATA, data);
 		memset(&data, 0, sizeof(data));
-		data.data = (void *)"";
+		data.data = (gpointer)"";
 		data.size = 0;
 		if ((ret = __db_pitem(dbc,
 		    cp->page, cp->indx, BKEYDATA_SIZE(0), &hdr, &data)) != 0)
@@ -335,10 +335,10 @@ err:	if (stack)
  * __ram_c_get --
  *	Recno cursor->c_get function.
  *
- * PUBLIC: int __ram_c_get
+ * PUBLIC: gint __ram_c_get
  * PUBLIC:     __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
  */
-int
+gint
 __ram_c_get(dbc, key, data, flags, pgnop)
 	DBC *dbc;
 	DBT *key, *data;
@@ -347,7 +347,7 @@ __ram_c_get(dbc, key, data, flags, pgnop)
 {
 	BTREE_CURSOR *cp;
 	DB *dbp;
-	int cmp, exact, ret;
+	gint cmp, exact, ret;
 
 	COMPQUIET(pgnop, NULL);
 
@@ -567,9 +567,9 @@ err:	CD_CLR(cp);
  * __ram_c_put --
  *	Recno cursor->c_put function.
  *
- * PUBLIC: int __ram_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+ * PUBLIC: gint __ram_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
  */
-int
+gint
 __ram_c_put(dbc, key, data, flags, pgnop)
 	DBC *dbc;
 	DBT *key, *data;
@@ -579,9 +579,9 @@ __ram_c_put(dbc, key, data, flags, pgnop)
 	BTREE_CURSOR *cp;
 	DB *dbp;
 	DB_LSN lsn;
-	int exact, nc, ret, t_ret;
+	gint exact, nc, ret, t_ret;
 	u_int32_t iiflags;
-	void *arg;
+	gpointer arg;
 
 	COMPQUIET(pgnop, NULL);
 
@@ -725,9 +725,9 @@ err:	CD_CLR(cp);
  * __ram_ca --
  *	Adjust cursors.  Returns the number of relevant cursors.
  *
- * PUBLIC: int __ram_ca __P((DBC *, ca_recno_arg));
+ * PUBLIC: gint __ram_ca __P((DBC *, ca_recno_arg));
  */
-int
+gint
 __ram_ca(dbc_arg, op)
 	DBC *dbc_arg;
 	ca_recno_arg op;
@@ -737,7 +737,7 @@ __ram_ca(dbc_arg, op)
 	DB_ENV *dbenv;
 	DBC *dbc;
 	db_recno_t recno;
-	int adjusted, found;
+	gint adjusted, found;
 	u_int32_t order;
 
 	dbp = dbc_arg->dbp;
@@ -868,14 +868,14 @@ iafter:				if (!adjusted && C_LESSTHAN(cp_arg, cp)) {
  * __ram_getno --
  *	Check the user's record number, and make sure we've seen it.
  *
- * PUBLIC: int __ram_getno __P((DBC *, const DBT *, db_recno_t *, int));
+ * PUBLIC: gint __ram_getno __P((DBC *, const DBT *, db_recno_t *, int));
  */
-int
+gint
 __ram_getno(dbc, key, rep, can_create)
 	DBC *dbc;
 	const DBT *key;
 	db_recno_t *rep;
-	int can_create;
+	gint can_create;
 {
 	DB *dbp;
 	db_recno_t recno;
@@ -906,13 +906,13 @@ static int
 __ram_update(dbc, recno, can_create)
 	DBC *dbc;
 	db_recno_t recno;
-	int can_create;
+	gint can_create;
 {
 	BTREE *t;
 	DB *dbp;
 	DBT *rdata;
 	db_recno_t nrecs;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	t = dbp->bt_internal;
@@ -964,8 +964,8 @@ __ram_source(dbp)
 	DB *dbp;
 {
 	BTREE *t;
-	char *source;
-	int ret;
+	gchar *source;
+	gint ret;
 
 	t = dbp->bt_internal;
 
@@ -996,9 +996,9 @@ __ram_source(dbp)
  * __ram_writeback --
  *	Rewrite the backing file.
  *
- * PUBLIC: int __ram_writeback __P((DB *));
+ * PUBLIC: gint __ram_writeback __P((DB *));
  */
-int
+gint
 __ram_writeback(dbp)
 	DB *dbp;
 {
@@ -1008,7 +1008,7 @@ __ram_writeback(dbp)
 	DBT key, data;
 	FILE *fp;
 	db_recno_t keyno;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int8_t delim, *pad;
 
 	t = dbp->bt_internal;
@@ -1160,7 +1160,7 @@ __ram_sread(dbc, top)
 	DBT data, *rdata;
 	db_recno_t recno;
 	size_t len;
-	int ch, ret, was_modified;
+	gint ch, ret, was_modified;
 
 	t = dbc->dbp->bt_internal;
 	dbp = dbc->dbp;
@@ -1259,7 +1259,7 @@ __ram_add(dbc, recnop, data, flags, bi_flags)
 	u_int32_t flags, bi_flags;
 {
 	BTREE_CURSOR *cp;
-	int exact, ret, stack;
+	gint exact, ret, stack;
 
 	cp = (BTREE_CURSOR *)dbc->internal;
 
diff --git a/libdb/btree/bt_rsearch.c b/libdb/btree/bt_rsearch.c
index 486584d..9f9023b 100644
--- a/libdb/btree/bt_rsearch.c
+++ b/libdb/btree/bt_rsearch.c
@@ -40,7 +40,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -57,14 +57,14 @@ static const char revid[] = "$Id$";
  * __bam_rsearch --
  *	Search a btree for a record number.
  *
- * PUBLIC: int __bam_rsearch __P((DBC *, db_recno_t *, u_int32_t, int, int *));
+ * PUBLIC: gint __bam_rsearch __P((DBC *, db_recno_t *, u_int32_t, int, gint *));
  */
-int
+gint
 __bam_rsearch(dbc, recnop, flags, stop, exactp)
 	DBC *dbc;
 	db_recno_t *recnop;
 	u_int32_t flags;
-	int stop, *exactp;
+	gint stop, *exactp;
 {
 	BINTERNAL *bi;
 	BTREE_CURSOR *cp;
@@ -77,7 +77,7 @@ __bam_rsearch(dbc, recnop, flags, stop, exactp)
 	db_lockmode_t lock_mode;
 	db_pgno_t pg;
 	db_recno_t recno, t_recno, total;
-	int ret, stack;
+	gint ret, stack;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -308,9 +308,9 @@ err:	BT_STK_POP(cp);
  * __bam_adjust --
  *	Adjust the tree after adding or deleting a record.
  *
- * PUBLIC: int __bam_adjust __P((DBC *, int32_t));
+ * PUBLIC: gint __bam_adjust __P((DBC *, int32_t));
  */
-int
+gint
 __bam_adjust(dbc, adjust)
 	DBC *dbc;
 	int32_t adjust;
@@ -321,7 +321,7 @@ __bam_adjust(dbc, adjust)
 	EPG *epg;
 	PAGE *h;
 	db_pgno_t root_pgno;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -363,9 +363,9 @@ __bam_adjust(dbc, adjust)
  * __bam_nrecs --
  *	Return the number of records in the tree.
  *
- * PUBLIC: int __bam_nrecs __P((DBC *, db_recno_t *));
+ * PUBLIC: gint __bam_nrecs __P((DBC *, db_recno_t *));
  */
-int
+gint
 __bam_nrecs(dbc, rep)
 	DBC *dbc;
 	db_recno_t *rep;
@@ -375,7 +375,7 @@ __bam_nrecs(dbc, rep)
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
diff --git a/libdb/btree/bt_search.c b/libdb/btree/bt_search.c
index 70f7568..f03c670 100644
--- a/libdb/btree/bt_search.c
+++ b/libdb/btree/bt_search.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -62,16 +62,16 @@ static const char revid[] = "$Id$";
  * __bam_search --
  *	Search a btree for a key.
  *
- * PUBLIC: int __bam_search __P((DBC *, db_pgno_t,
- * PUBLIC:     const DBT *, u_int32_t, int, db_recno_t *, int *));
+ * PUBLIC: gint __bam_search __P((DBC *, db_pgno_t,
+ * PUBLIC:     const DBT *, u_int32_t, int, db_recno_t *, gint *));
  */
-int
+gint
 __bam_search(dbc, root_pgno, key, flags, stop, recnop, exactp)
 	DBC *dbc;
 	db_pgno_t root_pgno;
 	const DBT *key;
 	u_int32_t flags;
-	int stop, *exactp;
+	gint stop, *exactp;
 	db_recno_t *recnop;
 {
 	BTREE *t;
@@ -84,8 +84,8 @@ __bam_search(dbc, root_pgno, key, flags, stop, recnop, exactp)
 	db_lockmode_t lock_mode;
 	db_pgno_t pg;
 	db_recno_t recno;
-	int adjust, cmp, deloffset, ret, stack;
-	int (*func) __P((DB *, const DBT *, const DBT *));
+	gint adjust, cmp, deloffset, ret, stack;
+	gint (*func) __P((DB *, const DBT *, const DBT *));
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -393,9 +393,9 @@ err:	BT_STK_POP(cp);
  * __bam_stkrel --
  *	Release all pages currently held in the stack.
  *
- * PUBLIC: int __bam_stkrel __P((DBC *, u_int32_t));
+ * PUBLIC: gint __bam_stkrel __P((DBC *, u_int32_t));
  */
-int
+gint
 __bam_stkrel(dbc, flags)
 	DBC *dbc;
 	u_int32_t flags;
@@ -404,7 +404,7 @@ __bam_stkrel(dbc, flags)
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
 	EPG *epg;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -450,16 +450,16 @@ __bam_stkrel(dbc, flags)
  * __bam_stkgrow --
  *	Grow the stack.
  *
- * PUBLIC: int __bam_stkgrow __P((DB_ENV *, BTREE_CURSOR *));
+ * PUBLIC: gint __bam_stkgrow __P((DB_ENV *, BTREE_CURSOR *));
  */
-int
+gint
 __bam_stkgrow(dbenv, cp)
 	DB_ENV *dbenv;
 	BTREE_CURSOR *cp;
 {
 	EPG *p;
 	size_t entries;
-	int ret;
+	gint ret;
 
 	entries = cp->esp - cp->sp;
 
diff --git a/libdb/btree/bt_split.c b/libdb/btree/bt_split.c
index 8112ae3..8ecb861 100644
--- a/libdb/btree/bt_split.c
+++ b/libdb/btree/bt_split.c
@@ -40,7 +40,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -56,29 +56,29 @@ static const char revid[] = "$Id$";
 #include "dbinc/lock.h"
 #include "dbinc/btree.h"
 
-static int __bam_broot __P((DBC *, PAGE *, PAGE *, PAGE *));
-static int __bam_page __P((DBC *, EPG *, EPG *));
-static int __bam_pinsert __P((DBC *, EPG *, PAGE *, PAGE *, int));
-static int __bam_psplit __P((DBC *, EPG *, PAGE *, PAGE *, db_indx_t *));
-static int __bam_root __P((DBC *, EPG *));
-static int __ram_root __P((DBC *, PAGE *, PAGE *, PAGE *));
+static gint __bam_broot __P((DBC *, PAGE *, PAGE *, PAGE *));
+static gint __bam_page __P((DBC *, EPG *, EPG *));
+static gint __bam_pinsert __P((DBC *, EPG *, PAGE *, PAGE *, int));
+static gint __bam_psplit __P((DBC *, EPG *, PAGE *, PAGE *, db_indx_t *));
+static gint __bam_root __P((DBC *, EPG *));
+static gint __ram_root __P((DBC *, PAGE *, PAGE *, PAGE *));
 
 /*
  * __bam_split --
  *	Split a page.
  *
- * PUBLIC: int __bam_split __P((DBC *, void *, db_pgno_t *));
+ * PUBLIC: gint __bam_split __P((DBC *, gpointer , db_pgno_t *));
  */
-int
+gint
 __bam_split(dbc, arg, root_pgnop)
 	DBC *dbc;
-	void *arg;
+	gpointer arg;
 	db_pgno_t *root_pgnop;
 {
 	BTREE_CURSOR *cp;
 	enum { UP, DOWN } dir;
 	db_pgno_t root_pgno;
-	int exact, level, ret;
+	gint exact, level, ret;
 
 	cp = (BTREE_CURSOR *)dbc->internal;
 	root_pgno = cp->root;
@@ -183,7 +183,7 @@ __bam_root(dbc, cp)
 	PAGE *lp, *rp;
 	db_indx_t split;
 	u_int32_t opflags;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -277,7 +277,7 @@ __bam_page(dbc, pp, cp)
 	PAGE *lp, *rp, *alloc_rp, *tp;
 	db_indx_t split;
 	u_int32_t opflags;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -516,7 +516,7 @@ __bam_broot(dbc, rootp, lp, rp)
 	DB *dbp;
 	DBT hdr, data;
 	db_pgno_t root_pgno;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	cp = (BTREE_CURSOR *)dbc->internal;
@@ -645,7 +645,7 @@ __ram_root(dbc, rootp, lp, rp)
 	DBT hdr;
 	RINTERNAL ri;
 	db_pgno_t root_pgno;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	root_pgno = dbc->internal->root;
@@ -682,7 +682,7 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check)
 	DBC *dbc;
 	EPG *parent;
 	PAGE *lchild, *rchild;
-	int space_check;
+	gint space_check;
 {
 	BINTERNAL bi, *child_bi;
 	BKEYDATA *child_bk, *tmp_bk;
@@ -696,7 +696,7 @@ __bam_pinsert(dbc, parent, lchild, rchild, space_check)
 	db_recno_t nrecs;
 	size_t (*func) __P((DB *, const DBT *, const DBT *));
 	u_int32_t n, nbytes, nksize;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	cp = (BTREE_CURSOR *)dbc->internal;
@@ -929,7 +929,7 @@ __bam_psplit(dbc, cp, lp, rp, splitret)
 	DB *dbp;
 	PAGE *pp;
 	db_indx_t half, *inp, nbytes, off, splitp, top;
-	int adjust, cnt, iflag, isbigkey, ret;
+	gint adjust, cnt, iflag, isbigkey, ret;
 
 	dbp = dbc->dbp;
 	pp = cp->page;
@@ -1119,9 +1119,9 @@ sort:	splitp = off;
  * __bam_copy --
  *	Copy a set of records from one page to another.
  *
- * PUBLIC: int __bam_copy __P((DB *, PAGE *, PAGE *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __bam_copy __P((DB *, PAGE *, PAGE *, u_int32_t, u_int32_t));
  */
-int
+gint
 __bam_copy(dbp, pp, cp, nxt, stop)
 	DB *dbp;
 	PAGE *pp, *cp;
diff --git a/libdb/btree/bt_stat.c b/libdb/btree/bt_stat.c
index e48616f..f343a9d 100644
--- a/libdb/btree/bt_stat.c
+++ b/libdb/btree/bt_stat.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -28,12 +28,12 @@ static const char revid[] = "$Id$";
  * __bam_stat --
  *	Gather/print the btree statistics
  *
- * PUBLIC: int __bam_stat __P((DB *, void *, u_int32_t));
+ * PUBLIC: gint __bam_stat __P((DB *, gpointer , u_int32_t));
  */
-int
+gint
 __bam_stat(dbp, spp, flags)
 	DB *dbp;
-	void *spp;
+	gpointer spp;
 	u_int32_t flags;
 {
 	BTMETA *meta;
@@ -45,7 +45,7 @@ __bam_stat(dbp, spp, flags)
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_pgno_t pgno;
-	int ret, t_ret, write_meta;
+	gint ret, t_ret, write_meta;
 
 	PANIC_CHECK(dbp->dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->stat");
@@ -200,16 +200,16 @@ err:	/* Discard the second page. */
  * __bam_traverse --
  *	Walk a Btree database.
  *
- * PUBLIC: int __bam_traverse __P((DBC *, db_lockmode_t,
- * PUBLIC:     db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *));
+ * PUBLIC: gint __bam_traverse __P((DBC *, db_lockmode_t,
+ * PUBLIC:     db_pgno_t, gint (*)(DB *, PAGE *, gpointer , gint *), gpointer ));
  */
-int
+gint
 __bam_traverse(dbc, mode, root_pgno, callback, cookie)
 	DBC *dbc;
 	db_lockmode_t mode;
 	db_pgno_t root_pgno;
-	int (*callback)__P((DB *, PAGE *, void *, int *));
-	void *cookie;
+	gint (*callback)__P((DB *, PAGE *, gpointer , gint *));
+	gpointer cookie;
 {
 	BINTERNAL *bi;
 	BKEYDATA *bk;
@@ -219,7 +219,7 @@ __bam_traverse(dbc, mode, root_pgno, callback, cookie)
 	PAGE *h;
 	RINTERNAL *ri;
 	db_indx_t indx;
-	int already_put, ret, t_ret;
+	gint already_put, ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -301,14 +301,14 @@ err:	if (!already_put && (t_ret = mpf->put(mpf, h, 0)) != 0 && ret != 0)
  * __bam_stat_callback --
  *	Statistics callback.
  *
- * PUBLIC: int __bam_stat_callback __P((DB *, PAGE *, void *, int *));
+ * PUBLIC: gint __bam_stat_callback __P((DB *, PAGE *, gpointer , gint *));
  */
-int
+gint
 __bam_stat_callback(dbp, h, cookie, putp)
 	DB *dbp;
 	PAGE *h;
-	void *cookie;
-	int *putp;
+	gpointer cookie;
+	gint *putp;
 {
 	DB_BTREE_STAT *sp;
 	db_indx_t indx, *inp, top;
@@ -394,10 +394,10 @@ __bam_stat_callback(dbp, h, cookie, putp)
  *	Return proportion of keys relative to given key.  The numbers are
  *	slightly skewed due to on page duplicates.
  *
- * PUBLIC: int __bam_key_range __P((DB *,
+ * PUBLIC: gint __bam_key_range __P((DB *,
  * PUBLIC:     DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
  */
-int
+gint
 __bam_key_range(dbp, txn, dbt, kp, flags)
 	DB *dbp;
 	DB_TXN *txn;
@@ -409,7 +409,7 @@ __bam_key_range(dbp, txn, dbt, kp, flags)
 	DBC *dbc;
 	EPG *sp;
 	double factor;
-	int exact, ret, t_ret;
+	gint exact, ret, t_ret;
 
 	PANIC_CHECK(dbp->dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->key_range");
diff --git a/libdb/btree/bt_upgrade.c b/libdb/btree/bt_upgrade.c
index 1fc2fa5..b39c301 100644
--- a/libdb/btree/bt_upgrade.c
+++ b/libdb/btree/bt_upgrade.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,18 +26,18 @@ static const char revid[] = "$Id$";
  * __bam_30_btreemeta --
  *	Upgrade the metadata pages from version 6 to version 7.
  *
- * PUBLIC: int __bam_30_btreemeta __P((DB *, char *, u_int8_t *));
+ * PUBLIC: gint __bam_30_btreemeta __P((DB *, gchar *, u_int8_t *));
  */
-int
+gint
 __bam_30_btreemeta(dbp, real_name, buf)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int8_t *buf;
 {
 	BTMETA30 *newmeta;
 	BTMETA2X *oldmeta;
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -72,17 +72,17 @@ __bam_30_btreemeta(dbp, real_name, buf)
  * __bam_31_btreemeta --
  *	Upgrade the database from version 7 to version 8.
  *
- * PUBLIC: int __bam_31_btreemeta
- * PUBLIC:      __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
+ * PUBLIC: gint __bam_31_btreemeta
+ * PUBLIC:      __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
  */
-int
+gint
 __bam_31_btreemeta(dbp, real_name, flags, fhp, h, dirtyp)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int32_t flags;
 	DB_FH *fhp;
 	PAGE *h;
-	int *dirtyp;
+	gint *dirtyp;
 {
 	BTMETA31 *newmeta;
 	BTMETA30 *oldmeta;
@@ -126,22 +126,22 @@ __bam_31_btreemeta(dbp, real_name, flags, fhp, h, dirtyp)
  * __bam_31_lbtree --
  *	Upgrade the database btree leaf pages.
  *
- * PUBLIC: int __bam_31_lbtree
- * PUBLIC:      __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
+ * PUBLIC: gint __bam_31_lbtree
+ * PUBLIC:      __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
  */
-int
+gint
 __bam_31_lbtree(dbp, real_name, flags, fhp, h, dirtyp)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int32_t flags;
 	DB_FH *fhp;
 	PAGE *h;
-	int *dirtyp;
+	gint *dirtyp;
 {
 	BKEYDATA *bk;
 	db_pgno_t pgno;
 	db_indx_t indx;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	for (indx = O_INDX; indx < NUM_ENT(h); indx += P_INDX) {
diff --git a/libdb/btree/bt_verify.c b/libdb/btree/bt_verify.c
index 6977e7e..6147ed0 100644
--- a/libdb/btree/bt_verify.c
+++ b/libdb/btree/bt_verify.c
@@ -10,7 +10,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,12 +24,12 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_verify.h"
 #include "dbinc/btree.h"
 
-static int __bam_safe_getdata __P((DB *, PAGE *, u_int32_t, int, DBT *, int *));
-static int __bam_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
+static gint __bam_safe_getdata __P((DB *, PAGE *, u_int32_t, int, DBT *, gint *));
+static gint __bam_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
     db_indx_t *, u_int32_t));
-static int __bam_vrfy_treeorder __P((DB *, db_pgno_t, PAGE *, BINTERNAL *,
-    BINTERNAL *, int (*)(DB *, const DBT *, const DBT *), u_int32_t));
-static int __ram_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
+static gint __bam_vrfy_treeorder __P((DB *, db_pgno_t, PAGE *, BINTERNAL *,
+    BINTERNAL *, gint (*)(DB *, const DBT *, const DBT *), u_int32_t));
+static gint __ram_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
     db_indx_t *, u_int32_t));
 
 #define	OKFLAGS	(DB_AGGRESSIVE | DB_NOORDERCHK | DB_SALVAGE)
@@ -38,10 +38,10 @@ static int __ram_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
  * __bam_vrfy_meta --
  *	Verify the btree-specific part of a metadata page.
  *
- * PUBLIC: int __bam_vrfy_meta __P((DB *, VRFY_DBINFO *, BTMETA *,
+ * PUBLIC: gint __bam_vrfy_meta __P((DB *, VRFY_DBINFO *, BTMETA *,
  * PUBLIC:     db_pgno_t, u_int32_t));
  */
-int
+gint
 __bam_vrfy_meta(dbp, vdp, meta, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -50,7 +50,7 @@ __bam_vrfy_meta(dbp, vdp, meta, pgno, flags)
 	u_int32_t flags;
 {
 	VRFY_PAGEINFO *pip;
-	int isbad, t_ret, ret;
+	gint isbad, t_ret, ret;
 	db_indx_t ovflsize;
 
 	if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
@@ -189,10 +189,10 @@ err:	if ((t_ret =
  * __ram_vrfy_leaf --
  *	Verify a recno leaf page.
  *
- * PUBLIC: int __ram_vrfy_leaf __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
+ * PUBLIC: gint __ram_vrfy_leaf __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __ram_vrfy_leaf(dbp, vdp, h, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -203,7 +203,7 @@ __ram_vrfy_leaf(dbp, vdp, h, pgno, flags)
 	BKEYDATA *bk;
 	VRFY_PAGEINFO *pip;
 	db_indx_t i;
-	int ret, t_ret, isbad;
+	gint ret, t_ret, isbad;
 	u_int32_t re_len_guess, len;
 
 	isbad = 0;
@@ -299,10 +299,10 @@ err:	if ((t_ret =
  * __bam_vrfy --
  *	Verify a btree leaf or internal page.
  *
- * PUBLIC: int __bam_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
+ * PUBLIC: gint __bam_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __bam_vrfy(dbp, vdp, h, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -311,7 +311,7 @@ __bam_vrfy(dbp, vdp, h, pgno, flags)
 	u_int32_t flags;
 {
 	VRFY_PAGEINFO *pip;
-	int ret, t_ret, isbad;
+	gint ret, t_ret, isbad;
 
 	isbad = 0;
 	if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
@@ -404,7 +404,7 @@ __ram_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags)
 	RINTERNAL *ri;
 	VRFY_CHILDINFO child;
 	VRFY_PAGEINFO *pip;
-	int ret, t_ret, isbad;
+	gint ret, t_ret, isbad;
 	u_int32_t himark, i, offset, nentries;
 	db_indx_t *inp;
 	u_int8_t *pagelayout, *p;
@@ -522,7 +522,7 @@ __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags)
 	BOVERFLOW *bo;
 	VRFY_CHILDINFO child;
 	VRFY_PAGEINFO *pip;
-	int isbad, initem, isdupitem, ret, t_ret;
+	gint isbad, initem, isdupitem, ret, t_ret;
 	u_int32_t himark, offset; /* These would be db_indx_ts but for algnmt.*/
 	u_int32_t i, endoff, nentries;
 	u_int8_t *pagelayout;
@@ -863,17 +863,17 @@ err:	if (nentriesp != NULL)
  *	and we run into an overflow page, carp and return DB_VERIFY_BAD;
  *	we shouldn't be called if any exist.
  *
- * PUBLIC: int __bam_vrfy_itemorder __P((DB *, VRFY_DBINFO *, PAGE *,
+ * PUBLIC: gint __bam_vrfy_itemorder __P((DB *, VRFY_DBINFO *, PAGE *,
  * PUBLIC:     db_pgno_t, u_int32_t, int, int, u_int32_t));
  */
-int
+gint
 __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	PAGE *h;
 	db_pgno_t pgno;
 	u_int32_t nentries;
-	int ovflok, hasdups;
+	gint ovflok, hasdups;
 	u_int32_t flags;
 {
 	DBT dbta, dbtb, dup_1, dup_2, *p1, *p2, *tmp;
@@ -883,10 +883,10 @@ __bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags)
 	BOVERFLOW *bo;
 	VRFY_PAGEINFO *pip;
 	db_indx_t i;
-	int cmp, freedup_1, freedup_2, isbad, ret, t_ret;
-	int (*dupfunc) __P((DB *, const DBT *, const DBT *));
-	int (*func) __P((DB *, const DBT *, const DBT *));
-	void *buf1, *buf2, *tmpbuf;
+	gint cmp, freedup_1, freedup_2, isbad, ret, t_ret;
+	gint (*dupfunc) __P((DB *, const DBT *, const DBT *));
+	gint (*func) __P((DB *, const DBT *, const DBT *));
+	gpointer buf1, *buf2, *tmpbuf;
 
 	/*
 	 * We need to work in the ORDERCHKONLY environment where we might
@@ -1160,10 +1160,10 @@ err:	if (pip != NULL && ((t_ret =
  *	Verify the tree structure of a btree database (including the master
  *	database containing subdbs).
  *
- * PUBLIC: int __bam_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t,
+ * PUBLIC: gint __bam_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __bam_vrfy_structure(dbp, vdp, meta_pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -1173,7 +1173,7 @@ __bam_vrfy_structure(dbp, vdp, meta_pgno, flags)
 	DB *pgset;
 	VRFY_PAGEINFO *mip, *rip;
 	db_pgno_t root, p;
-	int t_ret, ret;
+	gint t_ret, ret;
 	u_int32_t nrecs, level, relen, stflags;
 
 	mip = rip = 0;
@@ -1182,7 +1182,7 @@ __bam_vrfy_structure(dbp, vdp, meta_pgno, flags)
 	if ((ret = __db_vrfy_getpageinfo(vdp, meta_pgno, &mip)) != 0)
 		return (ret);
 
-	if ((ret = __db_vrfy_pgset_get(pgset, meta_pgno, (int *)&p)) != 0)
+	if ((ret = __db_vrfy_pgset_get(pgset, meta_pgno, (gint *)&p)) != 0)
 		goto err;
 	if (p != 0) {
 		EPRINT((dbp->dbenv,
@@ -1273,16 +1273,16 @@ err:	if (mip != NULL && ((t_ret =
  *	Note that this is public because it must be called to verify
  *	offpage dup trees, including from hash.
  *
- * PUBLIC: int __bam_vrfy_subtree __P((DB *, VRFY_DBINFO *, db_pgno_t, void *,
- * PUBLIC:     void *, u_int32_t, u_int32_t *, u_int32_t *, u_int32_t *));
+ * PUBLIC: gint __bam_vrfy_subtree __P((DB *, VRFY_DBINFO *, db_pgno_t, gpointer ,
+ * PUBLIC:     gpointer , u_int32_t, u_int32_t *, u_int32_t *, u_int32_t *));
  */
-int
+gint
 __bam_vrfy_subtree(dbp,
     vdp, pgno, l, r, flags, levelp, nrecsp, relenp)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
-	void *l, *r;
+	gpointer l, *r;
 	u_int32_t flags, *levelp, *nrecsp, *relenp;
 {
 	BINTERNAL *li, *ri, *lp, *rp;
@@ -1297,8 +1297,8 @@ __bam_vrfy_subtree(dbp,
 	db_recno_t child_nrecs, nrecs;
 	u_int32_t child_level, child_relen, level, relen, stflags;
 	u_int8_t leaf_type;
-	int (*func) __P((DB *, const DBT *, const DBT *));
-	int isbad, p, ret, t_ret, toplevel;
+	gint (*func) __P((DB *, const DBT *, const DBT *));
+	gint isbad, p, ret, t_ret, toplevel;
 
 	mpf = dbp->mpf;
 	ret = isbad = 0;
@@ -1844,13 +1844,13 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags)
 	db_pgno_t pgno;
 	PAGE *h;
 	BINTERNAL *lp, *rp;
-	int (*func) __P((DB *, const DBT *, const DBT *));
+	gint (*func) __P((DB *, const DBT *, const DBT *));
 	u_int32_t flags;
 {
 	BOVERFLOW *bo;
 	DBT dbt;
 	db_indx_t last;
-	int ret, cmp;
+	gint ret, cmp;
 
 	memset(&dbt, 0, sizeof(DBT));
 	F_SET(&dbt, DB_DBT_MALLOC);
@@ -1970,19 +1970,19 @@ __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, func, flags)
  *	Safely dump out anything that looks like a key on an alleged
  *	btree leaf page.
  *
- * PUBLIC: int __bam_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t,
- * PUBLIC:     PAGE *, void *, int (*)(void *, const void *), DBT *,
+ * PUBLIC: gint __bam_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t,
+ * PUBLIC:     PAGE *, gpointer , gint (*)(gpointer , gconstpointer ), DBT *,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
 	u_int32_t pgtype;
 	PAGE *h;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	DBT *key;
 	u_int32_t flags;
 {
@@ -1992,8 +1992,8 @@ __bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags)
 	db_indx_t i, beg, end, *inp;
 	u_int32_t himark;
 	u_int8_t *pgmap;
-	void *ovflbuf;
-	int t_ret, ret, err_ret;
+	gpointer ovflbuf;
+	gint t_ret, ret, err_ret;
 
 	/* Shut up lint. */
 	COMPQUIET(end, 0);
@@ -2187,22 +2187,22 @@ err:	if (pgmap != NULL)
  *	Walk a known-good btree or recno internal page which is part of
  *	a dup tree, calling __db_salvage_duptree on each child page.
  *
- * PUBLIC: int __bam_salvage_walkdupint __P((DB *, VRFY_DBINFO *, PAGE *,
- * PUBLIC:     DBT *, void *, int (*)(void *, const void *), u_int32_t));
+ * PUBLIC: gint __bam_salvage_walkdupint __P((DB *, VRFY_DBINFO *, PAGE *,
+ * PUBLIC:     DBT *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
  */
-int
+gint
 __bam_salvage_walkdupint(dbp, vdp, h, key, handle, callback, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	PAGE *h;
 	DBT *key;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
 {
 	RINTERNAL *ri;
 	BINTERNAL *bi;
-	int ret, t_ret;
+	gint ret, t_ret;
 	db_indx_t i;
 
 	ret = 0;
@@ -2247,10 +2247,10 @@ __bam_salvage_walkdupint(dbp, vdp, h, key, handle, callback, flags)
  *	trouble of walking internal pages--they just don't matter, except
  *	for the left branch.
  *
- * PUBLIC: int __bam_meta2pgset __P((DB *, VRFY_DBINFO *, BTMETA *,
+ * PUBLIC: gint __bam_meta2pgset __P((DB *, VRFY_DBINFO *, BTMETA *,
  * PUBLIC:     u_int32_t, DB *));
  */
-int
+gint
 __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -2263,7 +2263,7 @@ __bam_meta2pgset(dbp, vdp, btmeta, flags, pgset)
 	PAGE *h;
 	RINTERNAL *ri;
 	db_pgno_t current, p;
-	int err_ret, ret;
+	gint err_ret, ret;
 
 	mpf = dbp->mpf;
 	h = NULL;
@@ -2319,7 +2319,7 @@ traverse:
 			break;
 		}
 
-		if ((ret = __db_vrfy_pgset_get(pgset, current, (int *)&p)) != 0)
+		if ((ret = __db_vrfy_pgset_get(pgset, current, (gint *)&p)) != 0)
 			goto err;
 
 		if (p != 0) {
@@ -2358,9 +2358,9 @@ __bam_safe_getdata(dbp, h, i, ovflok, dbt, freedbtp)
 	DB *dbp;
 	PAGE *h;
 	u_int32_t i;
-	int ovflok;
+	gint ovflok;
 	DBT *dbt;
-	int *freedbtp;
+	gint *freedbtp;
 {
 	BKEYDATA *bk;
 	BOVERFLOW *bo;
diff --git a/libdb/btree/btree_auto.c b/libdb/btree/btree_auto.c
index e94aca2..82d3698 100644
--- a/libdb/btree/btree_auto.c
+++ b/libdb/btree/btree_auto.c
@@ -19,11 +19,11 @@
 #include "dbinc/txn.h"
 
 /*
- * PUBLIC: int __bam_split_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_split_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t,
  * PUBLIC:     db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, u_int32_t));
  */
-int
+gint
 __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx,
     npgno, nlsn, root_pgno, pg, opflags)
 	DB *dbp;
@@ -47,7 +47,7 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -180,16 +180,16 @@ __bam_split_log(dbp, txnid, ret_lsnp, flags, left, llsn, right, rlsn, indx,
 }
 
 /*
- * PUBLIC: int __bam_split_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_split_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_split_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -244,21 +244,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __bam_split_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_split_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_split_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_split_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -298,18 +298,18 @@ __bam_split_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_split_read __P((DB_ENV *, void *, __bam_split_args **));
+ * PUBLIC: gint __bam_split_read __P((DB_ENV *, gpointer , __bam_split_args **));
  */
-int
+gint
 __bam_split_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_split_args **argpp;
 {
 	__bam_split_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_split_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -375,11 +375,11 @@ __bam_split_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_rsplit_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_rsplit_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t,
  * PUBLIC:     const DBT *, DB_LSN *));
  */
-int
+gint
 __bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, rootent,
     rootlsn)
 	DB *dbp;
@@ -399,7 +399,7 @@ __bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, root
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -515,16 +515,16 @@ __bam_rsplit_log(dbp, txnid, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, root
 }
 
 /*
- * PUBLIC: int __bam_rsplit_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_rsplit_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_rsplit_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -569,21 +569,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_rsplit_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_rsplit_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -622,18 +622,18 @@ __bam_rsplit_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_rsplit_read __P((DB_ENV *, void *, __bam_rsplit_args **));
+ * PUBLIC: gint __bam_rsplit_read __P((DB_ENV *, gpointer , __bam_rsplit_args **));
  */
-int
+gint
 __bam_rsplit_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_rsplit_args **argpp;
 {
 	__bam_rsplit_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_rsplit_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -687,11 +687,11 @@ __bam_rsplit_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_adj_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_adj_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -708,7 +708,7 @@ __bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -805,16 +805,16 @@ __bam_adj_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert
 }
 
 /*
- * PUBLIC: int __bam_adj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_adj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_adj_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -851,19 +851,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __bam_adj_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_adj_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_adj_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_adj_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -891,18 +891,18 @@ __bam_adj_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_adj_read __P((DB_ENV *, void *, __bam_adj_args **));
+ * PUBLIC: gint __bam_adj_read __P((DB_ENV *, gpointer , __bam_adj_args **));
  */
-int
+gint
 __bam_adj_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_adj_args **argpp;
 {
 	__bam_adj_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_adj_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -948,10 +948,10 @@ __bam_adj_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_cadjust_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_cadjust_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, u_int32_t));
  */
-int
+gint
 __bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -968,7 +968,7 @@ __bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags)
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1065,16 +1065,16 @@ __bam_cadjust_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags)
 }
 
 /*
- * PUBLIC: int __bam_cadjust_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_cadjust_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_cadjust_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1111,19 +1111,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __bam_cadjust_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_cadjust_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_cadjust_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_cadjust_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1151,19 +1151,19 @@ __bam_cadjust_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_cadjust_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __bam_cadjust_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __bam_cadjust_args **));
  */
-int
+gint
 __bam_cadjust_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_cadjust_args **argpp;
 {
 	__bam_cadjust_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_cadjust_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1209,10 +1209,10 @@ __bam_cadjust_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_cdel_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_cdel_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t));
  */
-int
+gint
 __bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -1227,7 +1227,7 @@ __bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx)
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1314,16 +1314,16 @@ __bam_cdel_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx)
 }
 
 /*
- * PUBLIC: int __bam_cdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_cdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_cdel_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1360,19 +1360,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __bam_cdel_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_cdel_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_cdel_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_cdel_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1398,18 +1398,18 @@ __bam_cdel_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_cdel_read __P((DB_ENV *, void *, __bam_cdel_args **));
+ * PUBLIC: gint __bam_cdel_read __P((DB_ENV *, gpointer , __bam_cdel_args **));
  */
-int
+gint
 __bam_cdel_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_cdel_args **argpp;
 {
 	__bam_cdel_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_cdel_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1447,11 +1447,11 @@ __bam_cdel_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_repl_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_repl_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t,
  * PUBLIC:     const DBT *, const DBT *, u_int32_t, u_int32_t));
  */
-int
+gint
 __bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig,
     repl, prefix, suffix)
 	DB *dbp;
@@ -1473,7 +1473,7 @@ __bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1599,16 +1599,16 @@ __bam_repl_log(dbp, txnid, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig,
 }
 
 /*
- * PUBLIC: int __bam_repl_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_repl_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_repl_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1645,21 +1645,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_repl_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_repl_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1700,18 +1700,18 @@ __bam_repl_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_repl_read __P((DB_ENV *, void *, __bam_repl_args **));
+ * PUBLIC: gint __bam_repl_read __P((DB_ENV *, gpointer , __bam_repl_args **));
  */
-int
+gint
 __bam_repl_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_repl_args **argpp;
 {
 	__bam_repl_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_repl_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1773,10 +1773,10 @@ __bam_repl_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_root_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_root_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, db_pgno_t, DB_LSN *));
  */
-int
+gint
 __bam_root_log(dbp, txnid, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -1791,7 +1791,7 @@ __bam_root_log(dbp, txnid, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn)
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1878,16 +1878,16 @@ __bam_root_log(dbp, txnid, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn)
 }
 
 /*
- * PUBLIC: int __bam_root_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_root_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_root_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1932,19 +1932,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __bam_root_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_root_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_root_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_root_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1970,18 +1970,18 @@ __bam_root_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_root_read __P((DB_ENV *, void *, __bam_root_args **));
+ * PUBLIC: gint __bam_root_read __P((DB_ENV *, gpointer , __bam_root_args **));
  */
-int
+gint
 __bam_root_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_root_args **argpp;
 {
 	__bam_root_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_root_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2019,11 +2019,11 @@ __bam_root_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_curadj_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_curadj_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_ca_mode, db_pgno_t, db_pgno_t, db_pgno_t,
  * PUBLIC:     u_int32_t, u_int32_t, u_int32_t));
  */
-int
+gint
 __bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgno, first_indx,
     from_indx, to_indx)
 	DB *dbp;
@@ -2043,7 +2043,7 @@ __bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgn
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -2148,19 +2148,19 @@ __bam_curadj_log(dbp, txnid, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgn
 }
 
 /*
- * PUBLIC: int __bam_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_curadj_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -2181,19 +2181,19 @@ __bam_curadj_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __bam_curadj_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_curadj_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_curadj_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_curadj_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -2222,18 +2222,18 @@ __bam_curadj_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_curadj_read __P((DB_ENV *, void *, __bam_curadj_args **));
+ * PUBLIC: gint __bam_curadj_read __P((DB_ENV *, gpointer , __bam_curadj_args **));
  */
-int
+gint
 __bam_curadj_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_curadj_args **argpp;
 {
 	__bam_curadj_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_curadj_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2288,10 +2288,10 @@ __bam_curadj_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_rcuradj_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __bam_rcuradj_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, ca_recno_arg, db_pgno_t, db_recno_t, u_int32_t));
  */
-int
+gint
 __bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mode, root, recno, order)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -2307,7 +2307,7 @@ __bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mode, root, recno, order)
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -2397,19 +2397,19 @@ __bam_rcuradj_log(dbp, txnid, ret_lsnp, flags, mode, root, recno, order)
 }
 
 /*
- * PUBLIC: int __bam_rcuradj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_rcuradj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_rcuradj_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -2430,19 +2430,19 @@ __bam_rcuradj_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __bam_rcuradj_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __bam_rcuradj_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __bam_rcuradj_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__bam_rcuradj_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -2468,19 +2468,19 @@ __bam_rcuradj_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __bam_rcuradj_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __bam_rcuradj_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __bam_rcuradj_args **));
  */
-int
+gint
 __bam_rcuradj_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__bam_rcuradj_args **argpp;
 {
 	__bam_rcuradj_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__bam_rcuradj_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2523,16 +2523,16 @@ __bam_rcuradj_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __bam_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __bam_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __bam_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __bam_split_print, DB___bam_split)) != 0)
@@ -2565,16 +2565,16 @@ __bam_init_print(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __bam_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __bam_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __bam_init_getpgnos(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __bam_split_getpgnos, DB___bam_split)) != 0)
@@ -2607,16 +2607,16 @@ __bam_init_getpgnos(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __bam_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __bam_init_recover __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __bam_init_recover(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __bam_split_recover, DB___bam_split)) != 0)
diff --git a/libdb/build_vxworks/db.h b/libdb/build_vxworks/db.h
index fabbd1d..aa421d5 100644
--- a/libdb/build_vxworks/db.h
+++ b/libdb/build_vxworks/db.h
@@ -79,9 +79,9 @@ extern "C" {
  */
 #ifndef	__BIT_TYPES_DEFINED__
 #define	__BIT_TYPES_DEFINED__
-typedef unsigned char u_int8_t;
+typedef guchar u_int8_t;
 typedef unsigned short u_int16_t;
-typedef unsigned int u_int32_t;
+typedef guint u_int32_t;
 #endif
 
 
@@ -505,8 +505,8 @@ struct __db_log_cursor {
 	u_int32_t bp_maxrec;		/* Max record length in the log file. */
 
 					/* Methods. */
-	int (*close) __P((DB_LOGC *, u_int32_t));
-	int (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
+	gint (*close) __P((DB_LOGC *, u_int32_t));
+	gint (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
 
 #define	DB_LOG_DISK		0x01	/* Log record came from disk. */
 #define	DB_LOG_LOCKED		0x02	/* Log region already locked */
@@ -518,7 +518,7 @@ struct __db_log_cursor {
 struct __db_log_stat {
 	u_int32_t st_magic;		/* Log file magic number. */
 	u_int32_t st_version;		/* Log file version number. */
-	int st_mode;			/* Log file mode. */
+	gint st_mode;			/* Log file mode. */
 	u_int32_t st_lg_bsize;		/* Log buffer size. */
 	u_int32_t st_lg_size;		/* Log file size. */
 	u_int32_t st_w_bytes;		/* Bytes to log. */
@@ -607,22 +607,22 @@ struct __db_mpoolfile {
 	size_t	   len;			/* Length of mmap'd region. */
 
 					/* Methods. */
-	int  (*close) __P((DB_MPOOLFILE *, u_int32_t));
-	int  (*get) __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *));
+	gint  (*close) __P((DB_MPOOLFILE *, u_int32_t));
+	gint  (*get) __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, gpointer ));
 	void (*get_fileid) __P((DB_MPOOLFILE *, u_int8_t *));
 	void (*last_pgno) __P((DB_MPOOLFILE *, db_pgno_t *));
-	int  (*open)__P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t));
-	int  (*put) __P((DB_MPOOLFILE *, void *, u_int32_t));
+	gint  (*open)__P((DB_MPOOLFILE *, const gchar *, u_int32_t, int, size_t));
+	gint  (*put) __P((DB_MPOOLFILE *, gpointer , u_int32_t));
 	void (*refcnt) __P((DB_MPOOLFILE *, db_pgno_t *));
-	int  (*set) __P((DB_MPOOLFILE *, void *, u_int32_t));
-	int  (*set_clear_len) __P((DB_MPOOLFILE *, u_int32_t));
-	int  (*set_fileid) __P((DB_MPOOLFILE *, u_int8_t *));
-	int  (*set_ftype) __P((DB_MPOOLFILE *, int));
-	int  (*set_lsn_offset) __P((DB_MPOOLFILE *, int32_t));
-	int  (*set_pgcookie) __P((DB_MPOOLFILE *, DBT *));
-	int  (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
+	gint  (*set) __P((DB_MPOOLFILE *, gpointer , u_int32_t));
+	gint  (*set_clear_len) __P((DB_MPOOLFILE *, u_int32_t));
+	gint  (*set_fileid) __P((DB_MPOOLFILE *, u_int8_t *));
+	gint  (*set_ftype) __P((DB_MPOOLFILE *, int));
+	gint  (*set_lsn_offset) __P((DB_MPOOLFILE *, int32_t));
+	gint  (*set_pgcookie) __P((DB_MPOOLFILE *, DBT *));
+	gint  (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
 	void (*set_unlink) __P((DB_MPOOLFILE *, int));
-	int  (*sync) __P((DB_MPOOLFILE *));
+	gint  (*sync) __P((DB_MPOOLFILE *));
 
 	/*
 	 * MP_OPEN_CALLED and MP_READONLY do not need to be thread protected
@@ -678,7 +678,7 @@ struct __db_mpool_stat {
 
 /* Mpool file statistics structure. */
 struct __db_mpool_fstat {
-	char *file_name;		/* File name. */
+	gchar *file_name;		/* File name. */
 	size_t st_pagesize;		/* Page size. */
 	u_int32_t st_map;		/* Pages from mapped files. */
 	u_int32_t st_cache_hit;		/* Pages found in the cache. */
@@ -855,8 +855,8 @@ struct __db_rep_stat {
 
 	u_int32_t st_dupmasters;	/* # of times a duplicate master
 					   condition was detected.+ */
-	int st_env_id;			/* Current environment ID. */
-	int st_env_priority;		/* Current environment priority. */
+	gint st_env_id;			/* Current environment ID. */
+	gint st_env_priority;		/* Current environment priority. */
 	u_int32_t st_gen;		/* Current generation number. */
 	u_int32_t st_log_duplicated;	/* Log records received multiply.+ */
 	u_int32_t st_log_queued;	/* Log records currently queued.+ */
@@ -864,7 +864,7 @@ struct __db_rep_stat {
 	u_int32_t st_log_queued_total;	/* Total # of log recs. ever queued.+ */
 	u_int32_t st_log_records;	/* Log records received and put.+ */
 	u_int32_t st_log_requested;	/* Log recs. missed and requested.+ */
-	int st_master;			/* Env. ID of the current master. */
+	gint st_master;			/* Env. ID of the current master. */
 	u_int32_t st_master_changes;	/* # of times we've switched masters. */
 	u_int32_t st_msgs_badgen;	/* Messages with a bad generation #.+ */
 	u_int32_t st_msgs_processed;	/* Messages received and processed.+ */
@@ -873,7 +873,7 @@ struct __db_rep_stat {
 	u_int32_t st_msgs_send_failures;/* # of failed message sends.+ */
 	u_int32_t st_msgs_sent;		/* # of successful message sends.+ */
 	u_int32_t st_newsites;		/* # of NEWSITE msgs. received.+ */
-	int st_nsites;			/* Current number of sites we will
+	gint st_nsites;			/* Current number of sites we will
 					   assume during elections. */
 	u_int32_t st_nthrottles;	/* # of times we were throttled. */
 	u_int32_t st_outdated;		/* # of times we detected and returned
@@ -885,14 +885,14 @@ struct __db_rep_stat {
 	u_int32_t st_elections_won;	/* # of elections won by this site.+ */
 
 	/* Statistics about an in-progress election. */
-	int st_election_cur_winner;	/* Current front-runner. */
+	gint st_election_cur_winner;	/* Current front-runner. */
 	u_int32_t st_election_gen;	/* Election generation number. */
 	DB_LSN st_election_lsn;		/* Max. LSN of current winner. */
-	int st_election_nsites;		/* # of "registered voters". */
-	int st_election_priority;	/* Current election priority. */
-	int st_election_status;		/* Current election status. */
-	int st_election_tiebreaker;	/* Election tiebreaker value. */
-	int st_election_votes;		/* Votes received in this round. */
+	gint st_election_nsites;		/* # of "registered voters". */
+	gint st_election_priority;	/* Current election priority. */
+	gint st_election_status;		/* Current election status. */
+	gint st_election_tiebreaker;	/* Election tiebreaker value. */
+	gint st_election_votes;		/* Votes received in this round. */
 };
 
 /*******************************************************
@@ -1031,9 +1031,9 @@ struct __db {
 	u_int32_t pgsize;		/* Database logical page size. */
 
 					/* Callbacks. */
-	int (*db_append_recno) __P((DB *, DBT *, db_recno_t));
+	gint (*db_append_recno) __P((DB *, DBT *, db_recno_t));
 	void (*db_feedback) __P((DB *, int, int));
-	int (*dup_compare) __P((DB *, const DBT *, const DBT *));
+	gint (*dup_compare) __P((DB *, const DBT *, const DBT *));
 
 	void	*app_private;		/* Application-private handle. */
 
@@ -1168,79 +1168,79 @@ struct __db {
 	void	*xa_internal;		/* XA. */
 
 					/* Methods. */
-	int  (*associate) __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *,
+	gint  (*associate) __P((DB *, DB_TXN *, DB *, gint (*)(DB *, const DBT *,
 		const DBT *, DBT *), u_int32_t));
-	int  (*close) __P((DB *, u_int32_t));
-	int  (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
-	int  (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
-	void (*err) __P((DB *, int, const char *, ...));
-	void (*errx) __P((DB *, const char *, ...));
-	int  (*fd) __P((DB *, int *));
-	int  (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
-	int  (*get_byteswapped) __P((DB *, int *));
-	int  (*get_type) __P((DB *, DBTYPE *));
-	int  (*join) __P((DB *, DBC **, DBC **, u_int32_t));
-	int  (*key_range) __P((DB *,
+	gint  (*close) __P((DB *, u_int32_t));
+	gint  (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
+	gint  (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
+	void (*err) __P((DB *, int, const gchar *, ...));
+	void (*errx) __P((DB *, const gchar *, ...));
+	gint  (*fd) __P((DB *, gint *));
+	gint  (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+	gint  (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
+	gint  (*get_byteswapped) __P((DB *, gint *));
+	gint  (*get_type) __P((DB *, DBTYPE *));
+	gint  (*join) __P((DB *, DBC **, DBC **, u_int32_t));
+	gint  (*key_range) __P((DB *,
 		DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
-	int  (*open) __P((DB *, DB_TXN *,
-		const char *, const char *, DBTYPE, u_int32_t, int));
-	int  (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*remove) __P((DB *, const char *, const char *, u_int32_t));
-	int  (*rename) __P((DB *,
-	    const char *, const char *, const char *, u_int32_t));
-	int  (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
-	int  (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
-	int  (*set_alloc) __P((DB *, void *(*)(size_t),
-		void *(*)(void *, size_t), void (*)(void *)));
-	int  (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
-	int  (*set_cache_priority) __P((DB *, DB_CACHE_PRIORITY));
-	int  (*set_dup_compare) __P((DB *,
-	    int (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_encrypt) __P((DB *, const char *, u_int32_t));
-	void (*set_errcall) __P((DB *, void (*)(const char *, char *)));
+	gint  (*open) __P((DB *, DB_TXN *,
+		const gchar *, const gchar *, DBTYPE, u_int32_t, int));
+	gint  (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+	gint  (*remove) __P((DB *, const gchar *, const gchar *, u_int32_t));
+	gint  (*rename) __P((DB *,
+	    const gchar *, const gchar *, const gchar *, u_int32_t));
+	gint  (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
+	gint  (*set_append_recno) __P((DB *, gint (*)(DB *, DBT *, db_recno_t)));
+	gint  (*set_alloc) __P((DB *, gpointer (*)(size_t),
+		gpointer (*)(gpointer , size_t), void (*)(gpointer)));
+	gint  (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
+	gint  (*set_cache_priority) __P((DB *, DB_CACHE_PRIORITY));
+	gint  (*set_dup_compare) __P((DB *,
+	    gint (*)(DB *, const DBT *, const DBT *)));
+	gint  (*set_encrypt) __P((DB *, const gchar *, u_int32_t));
+	void (*set_errcall) __P((DB *, void (*)(const gchar *, gchar *)));
 	void (*set_errfile) __P((DB *, FILE *));
-	void (*set_errpfx) __P((DB *, const char *));
-	int  (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
-	int  (*set_flags) __P((DB *, u_int32_t));
-	int  (*set_lorder) __P((DB *, int));
-	int  (*set_pagesize) __P((DB *, u_int32_t));
-	int  (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int)));
-	int  (*stat) __P((DB *, void *, u_int32_t));
-	int  (*sync) __P((DB *, u_int32_t));
-	int  (*upgrade) __P((DB *, const char *, u_int32_t));
-	int  (*verify) __P((DB *,
-	    const char *, const char *, FILE *, u_int32_t));
-
-	int  (*set_bt_compare) __P((DB *,
-	    int (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_bt_maxkey) __P((DB *, u_int32_t));
-	int  (*set_bt_minkey) __P((DB *, u_int32_t));
-	int  (*set_bt_prefix) __P((DB *,
+	void (*set_errpfx) __P((DB *, const gchar *));
+	gint  (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
+	gint  (*set_flags) __P((DB *, u_int32_t));
+	gint  (*set_lorder) __P((DB *, int));
+	gint  (*set_pagesize) __P((DB *, u_int32_t));
+	gint  (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int)));
+	gint  (*stat) __P((DB *, gpointer , u_int32_t));
+	gint  (*sync) __P((DB *, u_int32_t));
+	gint  (*upgrade) __P((DB *, const gchar *, u_int32_t));
+	gint  (*verify) __P((DB *,
+	    const gchar *, const gchar *, FILE *, u_int32_t));
+
+	gint  (*set_bt_compare) __P((DB *,
+	    gint (*)(DB *, const DBT *, const DBT *)));
+	gint  (*set_bt_maxkey) __P((DB *, u_int32_t));
+	gint  (*set_bt_minkey) __P((DB *, u_int32_t));
+	gint  (*set_bt_prefix) __P((DB *,
 	    size_t (*)(DB *, const DBT *, const DBT *)));
 
-	int  (*set_h_ffactor) __P((DB *, u_int32_t));
-	int  (*set_h_hash) __P((DB *,
-	    u_int32_t (*)(DB *, const void *, u_int32_t)));
-	int  (*set_h_nelem) __P((DB *, u_int32_t));
+	gint  (*set_h_ffactor) __P((DB *, u_int32_t));
+	gint  (*set_h_hash) __P((DB *,
+	    u_int32_t (*)(DB *, gconstpointer , u_int32_t)));
+	gint  (*set_h_nelem) __P((DB *, u_int32_t));
 
-	int  (*set_re_delim) __P((DB *, int));
-	int  (*set_re_len) __P((DB *, u_int32_t));
-	int  (*set_re_pad) __P((DB *, int));
-	int  (*set_re_source) __P((DB *, const char *));
-	int  (*set_q_extentsize) __P((DB *, u_int32_t));
+	gint  (*set_re_delim) __P((DB *, int));
+	gint  (*set_re_len) __P((DB *, u_int32_t));
+	gint  (*set_re_pad) __P((DB *, int));
+	gint  (*set_re_source) __P((DB *, const gchar *));
+	gint  (*set_q_extentsize) __P((DB *, u_int32_t));
 
-	int  (*db_am_remove) __P((DB *,
-	    DB_TXN *, const char *, const char *, DB_LSN *));
-	int  (*db_am_rename) __P((DB *, DB_TXN *,
-	    const char *, const char *, const char *));
+	gint  (*db_am_remove) __P((DB *,
+	    DB_TXN *, const gchar *, const gchar *, DB_LSN *));
+	gint  (*db_am_rename) __P((DB *, DB_TXN *,
+	    const gchar *, const gchar *, const gchar *));
 
 	/*
 	 * Never called; these are a place to save function pointers
 	 * so that we can undo an associate.
 	 */
-	int  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*stored_close) __P((DB *, u_int32_t));
+	gint  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+	gint  (*stored_close) __P((DB *, u_int32_t));
 
 #define	DB_OK_BTREE	0x01
 #define	DB_OK_HASH	0x02
@@ -1391,25 +1391,25 @@ struct __dbc {
 
 	DBC_INTERNAL *internal;		/* Access method private. */
 
-	int (*c_close) __P((DBC *));	/* Methods: public. */
-	int (*c_count) __P((DBC *, db_recno_t *, u_int32_t));
-	int (*c_del) __P((DBC *, u_int32_t));
-	int (*c_dup) __P((DBC *, DBC **, u_int32_t));
-	int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t));
-	int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
-	int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t));
+	gint (*c_close) __P((DBC *));	/* Methods: public. */
+	gint (*c_count) __P((DBC *, db_recno_t *, u_int32_t));
+	gint (*c_del) __P((DBC *, u_int32_t));
+	gint (*c_dup) __P((DBC *, DBC **, u_int32_t));
+	gint (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t));
+	gint (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
+	gint (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t));
 
 					/* Methods: private. */
-	int (*c_am_bulk) __P((DBC *, DBT *, u_int32_t));
-	int (*c_am_close) __P((DBC *, db_pgno_t, int *));
-	int (*c_am_del) __P((DBC *));
-	int (*c_am_destroy) __P((DBC *));
-	int (*c_am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-	int (*c_am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-	int (*c_am_writelock) __P((DBC *));
+	gint (*c_am_bulk) __P((DBC *, DBT *, u_int32_t));
+	gint (*c_am_close) __P((DBC *, db_pgno_t, gint *));
+	gint (*c_am_del) __P((DBC *));
+	gint (*c_am_destroy) __P((DBC *));
+	gint (*c_am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+	gint (*c_am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+	gint (*c_am_writelock) __P((DBC *));
 
 	/* Private: for secondary indices. */
-	int (*c_real_get) __P((DBC *, DBT *, DBT *, u_int32_t));
+	gint (*c_real_get) __P((DBC *, DBT *, DBT *, u_int32_t));
 
 #define	DBC_ACTIVE	 0x0001		/* Cursor in use. */
 #define	DBC_COMPENSATE	 0x0002		/* Cursor compensating, don't lock. */
@@ -1508,14 +1508,14 @@ struct __db_env {
 	FILE		*db_errfile;	/* Error message file stream. */
 	const char	*db_errpfx;	/* Error message prefix. */
 					/* Callbacks. */
-	void (*db_errcall) __P((const char *, char *));
+	void (*db_errcall) __P((const gchar *, gchar *));
 	void (*db_feedback) __P((DB_ENV *, int, int));
 	void (*db_paniccall) __P((DB_ENV *, int));
 
 					/* App-specified alloc functions. */
-	void *(*db_malloc) __P((size_t));
-	void *(*db_realloc) __P((void *, size_t));
-	void (*db_free) __P((void *));
+	gpointer (*db_malloc) __P((size_t));
+	gpointer (*db_realloc) __P((gpointer , size_t));
+	void (*db_free) __P((gpointer));
 
 	/*
 	 * Currently, the verbose list is a bit field with room for 32
@@ -1531,7 +1531,7 @@ struct __db_env {
 
 	void		*app_private;	/* Application-private handle. */
 
-	int (*app_dispatch)		/* User-specified recovery dispatch. */
+	gint (*app_dispatch)		/* User-specified recovery dispatch. */
 	    __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
 
 	/* Locking. */
@@ -1582,7 +1582,7 @@ struct __db_env {
 	DB_FH		*lockfhp;	/* fcntl(2) locking file handle. */
 
 	int	      (**recover_dtab)	/* Dispatch table for recover funcs. */
-			    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+			    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t		 recover_dtab_size;
 					/* Slots in the dispatch table. */
 
@@ -1638,106 +1638,106 @@ struct __db_env {
 	u_long		*mt;		/* Mersenne Twister state vector. */
 
 					/* DB_ENV Methods. */
-	int  (*close) __P((DB_ENV *, u_int32_t));
-	int  (*dbremove) __P((DB_ENV *,
-	    DB_TXN *, const char *, const char *, u_int32_t));
-	int  (*dbrename) __P((DB_ENV *, DB_TXN *,
-	    const char *, const char *, const char *, u_int32_t));
-	void (*err) __P((const DB_ENV *, int, const char *, ...));
-	void (*errx) __P((const DB_ENV *, const char *, ...));
-	int  (*open) __P((DB_ENV *, const char *, u_int32_t, int));
-	int  (*remove) __P((DB_ENV *, const char *, u_int32_t));
-	int  (*set_data_dir) __P((DB_ENV *, const char *));
-	int  (*set_alloc) __P((DB_ENV *, void *(*)(size_t),
-		void *(*)(void *, size_t), void (*)(void *)));
-	int  (*set_app_dispatch) __P((DB_ENV *,
-		int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
-	int  (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t));
-	void (*set_errcall) __P((DB_ENV *, void (*)(const char *, char *)));
+	gint  (*close) __P((DB_ENV *, u_int32_t));
+	gint  (*dbremove) __P((DB_ENV *,
+	    DB_TXN *, const gchar *, const gchar *, u_int32_t));
+	gint  (*dbrename) __P((DB_ENV *, DB_TXN *,
+	    const gchar *, const gchar *, const gchar *, u_int32_t));
+	void (*err) __P((const DB_ENV *, int, const gchar *, ...));
+	void (*errx) __P((const DB_ENV *, const gchar *, ...));
+	gint  (*open) __P((DB_ENV *, const gchar *, u_int32_t, int));
+	gint  (*remove) __P((DB_ENV *, const gchar *, u_int32_t));
+	gint  (*set_data_dir) __P((DB_ENV *, const gchar *));
+	gint  (*set_alloc) __P((DB_ENV *, gpointer (*)(size_t),
+		gpointer (*)(gpointer , size_t), void (*)(gpointer)));
+	gint  (*set_app_dispatch) __P((DB_ENV *,
+		gint (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
+	gint  (*set_encrypt) __P((DB_ENV *, const gchar *, u_int32_t));
+	void (*set_errcall) __P((DB_ENV *, void (*)(const gchar *, gchar *)));
 	void (*set_errfile) __P((DB_ENV *, FILE *));
-	void (*set_errpfx) __P((DB_ENV *, const char *));
-	int  (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
-	int  (*set_flags) __P((DB_ENV *, u_int32_t, int));
-	int  (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int)));
-	int  (*set_rpc_server) __P((DB_ENV *,
-		void *, const char *, long, long, u_int32_t));
-	int  (*set_shm_key) __P((DB_ENV *, long));
-	int  (*set_tas_spins) __P((DB_ENV *, u_int32_t));
-	int  (*set_tmp_dir) __P((DB_ENV *, const char *));
-	int  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
-
-	void *lg_handle;		/* Log handle and methods. */
-	int  (*set_lg_bsize) __P((DB_ENV *, u_int32_t));
-	int  (*set_lg_dir) __P((DB_ENV *, const char *));
-	int  (*set_lg_max) __P((DB_ENV *, u_int32_t));
-	int  (*set_lg_regionmax) __P((DB_ENV *, u_int32_t));
-	int  (*log_archive) __P((DB_ENV *, char **[], u_int32_t));
-	int  (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t));
-	int  (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t));
-	int  (*log_flush) __P((DB_ENV *, const DB_LSN *));
-	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
-	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
-
-	void *lk_handle;		/* Lock handle and methods. */
-	int  (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int));
-	int  (*set_lk_detect) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
-	int  (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *));
-	int  (*lock_dump_region) __P((DB_ENV *, char *, FILE *));
-	int  (*lock_get) __P((DB_ENV *,
+	void (*set_errpfx) __P((DB_ENV *, const gchar *));
+	gint  (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
+	gint  (*set_flags) __P((DB_ENV *, u_int32_t, int));
+	gint  (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int)));
+	gint  (*set_rpc_server) __P((DB_ENV *,
+		gpointer , const gchar *, long, long, u_int32_t));
+	gint  (*set_shm_key) __P((DB_ENV *, long));
+	gint  (*set_tas_spins) __P((DB_ENV *, u_int32_t));
+	gint  (*set_tmp_dir) __P((DB_ENV *, const gchar *));
+	gint  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
+
+	gpointer lg_handle;		/* Log handle and methods. */
+	gint  (*set_lg_bsize) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lg_dir) __P((DB_ENV *, const gchar *));
+	gint  (*set_lg_max) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lg_regionmax) __P((DB_ENV *, u_int32_t));
+	gint  (*log_archive) __P((DB_ENV *, gchar **[], u_int32_t));
+	gint  (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t));
+	gint  (*log_file) __P((DB_ENV *, const DB_LSN *, gchar *, size_t));
+	gint  (*log_flush) __P((DB_ENV *, const DB_LSN *));
+	gint  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
+	gint  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
+
+	gpointer lk_handle;		/* Lock handle and methods. */
+	gint  (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int));
+	gint  (*set_lk_detect) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lk_max) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
+	gint  (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, gint *));
+	gint  (*lock_dump_region) __P((DB_ENV *, gchar *, FILE *));
+	gint  (*lock_get) __P((DB_ENV *,
 		u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
-	int  (*lock_put) __P((DB_ENV *, DB_LOCK *));
-	int  (*lock_id) __P((DB_ENV *, u_int32_t *));
-	int  (*lock_id_free) __P((DB_ENV *, u_int32_t));
-	int  (*lock_id_set) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
-	int  (*lock_vec) __P((DB_ENV *,
+	gint  (*lock_put) __P((DB_ENV *, DB_LOCK *));
+	gint  (*lock_id) __P((DB_ENV *, u_int32_t *));
+	gint  (*lock_id_free) __P((DB_ENV *, u_int32_t));
+	gint  (*lock_id_set) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
+	gint  (*lock_vec) __P((DB_ENV *,
 		u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
-	int  (*lock_downgrade) __P((DB_ENV *,
+	gint  (*lock_downgrade) __P((DB_ENV *,
 		DB_LOCK *, db_lockmode_t, u_int32_t));
 
-	void *mp_handle;		/* Mpool handle and methods. */
-	int  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
-	int  (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
-	int  (*memp_dump_region) __P((DB_ENV *, char *, FILE *));
-	int  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
-	int  (*memp_nameop) __P((DB_ENV *,
-		u_int8_t *, const char *, const char *, const char *));
-	int  (*memp_register) __P((DB_ENV *, int,
-		int (*)(DB_ENV *, db_pgno_t, void *, DBT *),
-		int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
-	int  (*memp_stat) __P((DB_ENV *,
+	gpointer mp_handle;		/* Mpool handle and methods. */
+	gint  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
+	gint  (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
+	gint  (*memp_dump_region) __P((DB_ENV *, gchar *, FILE *));
+	gint  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
+	gint  (*memp_nameop) __P((DB_ENV *,
+		u_int8_t *, const gchar *, const gchar *, const gchar *));
+	gint  (*memp_register) __P((DB_ENV *, int,
+		gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *),
+		gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *)));
+	gint  (*memp_stat) __P((DB_ENV *,
 		DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
-	int  (*memp_sync) __P((DB_ENV *, DB_LSN *));
-	int  (*memp_trickle) __P((DB_ENV *, int, int *));
-
-	void *rep_handle;		/* Replication handle and methods. */
-	int  (*rep_elect) __P((DB_ENV *, int, int, u_int32_t, int *));
-	int  (*rep_flush) __P((DB_ENV *));
-	int  (*rep_process_message) __P((DB_ENV *, DBT *, DBT *, int *));
-	int  (*rep_start) __P((DB_ENV *, DBT *, u_int32_t));
-	int  (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
-	int  (*set_rep_election) __P((DB_ENV *,
+	gint  (*memp_sync) __P((DB_ENV *, DB_LSN *));
+	gint  (*memp_trickle) __P((DB_ENV *, int, gint *));
+
+	gpointer rep_handle;		/* Replication handle and methods. */
+	gint  (*rep_elect) __P((DB_ENV *, int, int, u_int32_t, gint *));
+	gint  (*rep_flush) __P((DB_ENV *));
+	gint  (*rep_process_message) __P((DB_ENV *, DBT *, DBT *, gint *));
+	gint  (*rep_start) __P((DB_ENV *, DBT *, u_int32_t));
+	gint  (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
+	gint  (*set_rep_election) __P((DB_ENV *,
 		u_int32_t, u_int32_t, u_int32_t, u_int32_t));
-	int  (*set_rep_limit) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*set_rep_timeout) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*set_rep_transport) __P((DB_ENV *, int,
-		int (*) (DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
-
-	void *tx_handle;		/* Txn handle and methods. */
-	int  (*set_tx_max) __P((DB_ENV *, u_int32_t));
-	int  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
-	int  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
-	int  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
-	int  (*txn_id_set) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*txn_recover) __P((DB_ENV *,
+	gint  (*set_rep_limit) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*set_rep_timeout) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*set_rep_transport) __P((DB_ENV *, int,
+		gint (*) (DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
+
+	gpointer tx_handle;		/* Txn handle and methods. */
+	gint  (*set_tx_max) __P((DB_ENV *, u_int32_t));
+	gint  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
+	gint  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+	gint  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
+	gint  (*txn_id_set) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*txn_recover) __P((DB_ENV *,
 		DB_PREPLIST *, long, long *, u_int32_t));
-	int  (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
-	int  (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t));
+	gint  (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
+	gint  (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t));
 
 #define	DB_TEST_ELECTINIT	 1	/* after __rep_elect_init */
 #define	DB_TEST_ELECTSEND	 2	/* after REP_ELECT msgnit */
@@ -1805,13 +1805,13 @@ typedef struct __db DBM;
 
 #if defined(_XPG4_2)
 typedef struct {
-	char *dptr;
+	gchar *dptr;
 	size_t dsize;
 } datum;
 #else
 typedef struct {
-	char *dptr;
-	int dsize;
+	gchar *dptr;
+	gint dsize;
 } datum;
 #endif
 
@@ -1858,8 +1858,8 @@ typedef enum {
 } ACTION;
 
 typedef struct entry {
-	char *key;
-	char *data;
+	gchar *key;
+	gchar *data;
 } ENTRY;
 
 #define	hcreate(a)	__db_hcreate(a)
@@ -1885,33 +1885,33 @@ typedef struct entry {
 extern "C" {
 #endif
 
-int db_create __P((DB **, DB_ENV *, u_int32_t));
-char *db_strerror __P((int));
-int db_env_create __P((DB_ENV **, u_int32_t));
-char *db_version __P((int *, int *, int *));
-int log_compare __P((const DB_LSN *, const DB_LSN *));
-int db_env_set_func_close __P((int (*)(int)));
-int db_env_set_func_dirfree __P((void (*)(char **, int)));
-int db_env_set_func_dirlist __P((int (*)(const char *, char ***, int *)));
-int db_env_set_func_exists __P((int (*)(const char *, int *)));
-int db_env_set_func_free __P((void (*)(void *)));
-int db_env_set_func_fsync __P((int (*)(int)));
-int db_env_set_func_ioinfo __P((int (*)(const char *, int, u_int32_t *, u_int32_t *, u_int32_t *)));
-int db_env_set_func_malloc __P((void *(*)(size_t)));
-int db_env_set_func_map __P((int (*)(char *, size_t, int, int, void **)));
-int db_env_set_func_open __P((int (*)(const char *, int, ...)));
-int db_env_set_func_read __P((ssize_t (*)(int, void *, size_t)));
-int db_env_set_func_realloc __P((void *(*)(void *, size_t)));
-int db_env_set_func_rename __P((int (*)(const char *, const char *)));
-int db_env_set_func_seek __P((int (*)(int, size_t, db_pgno_t, u_int32_t, int, int)));
-int db_env_set_func_sleep __P((int (*)(u_long, u_long)));
-int db_env_set_func_unlink __P((int (*)(const char *)));
-int db_env_set_func_unmap __P((int (*)(void *, size_t)));
-int db_env_set_func_write __P((ssize_t (*)(int, const void *, size_t)));
-int db_env_set_func_yield __P((int (*)(void)));
-int txn_abort __P((DB_TXN *));
-int txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
-int txn_commit __P((DB_TXN *, u_int32_t));
+gint db_create __P((DB **, DB_ENV *, u_int32_t));
+gchar *db_strerror __P((int));
+gint db_env_create __P((DB_ENV **, u_int32_t));
+gchar *db_version __P((gint *, gint *, gint *));
+gint log_compare __P((const DB_LSN *, const DB_LSN *));
+gint db_env_set_func_close __P((gint (*)(int)));
+gint db_env_set_func_dirfree __P((void (*)(gchar **, int)));
+gint db_env_set_func_dirlist __P((gint (*)(const gchar *, gchar ***, gint *)));
+gint db_env_set_func_exists __P((gint (*)(const gchar *, gint *)));
+gint db_env_set_func_free __P((void (*)(gpointer)));
+gint db_env_set_func_fsync __P((gint (*)(int)));
+gint db_env_set_func_ioinfo __P((gint (*)(const gchar *, int, u_int32_t *, u_int32_t *, u_int32_t *)));
+gint db_env_set_func_malloc __P((gpointer (*)(size_t)));
+gint db_env_set_func_map __P((gint (*)(gchar *, size_t, int, int, gpointer *)));
+gint db_env_set_func_open __P((gint (*)(const gchar *, int, ...)));
+gint db_env_set_func_read __P((ssize_t (*)(int, gpointer , size_t)));
+gint db_env_set_func_realloc __P((gpointer (*)(gpointer , size_t)));
+gint db_env_set_func_rename __P((gint (*)(const gchar *, const gchar *)));
+gint db_env_set_func_seek __P((gint (*)(int, size_t, db_pgno_t, u_int32_t, int, int)));
+gint db_env_set_func_sleep __P((gint (*)(u_long, u_long)));
+gint db_env_set_func_unlink __P((gint (*)(const gchar *)));
+gint db_env_set_func_unmap __P((gint (*)(gpointer , size_t)));
+gint db_env_set_func_write __P((ssize_t (*)(int, gconstpointer , size_t)));
+gint db_env_set_func_yield __P((gint (*)(void)));
+gint txn_abort __P((DB_TXN *));
+gint txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+gint txn_commit __P((DB_TXN *, u_int32_t));
 #if DB_DBM_HSEARCH != 0
 int	 __db_ndbm_clearerr __P((DBM *));
 void	 __db_ndbm_close __P((DBM *));
@@ -1921,7 +1921,7 @@ int	 __db_ndbm_error __P((DBM *));
 datum __db_ndbm_fetch __P((DBM *, datum));
 datum __db_ndbm_firstkey __P((DBM *));
 datum __db_ndbm_nextkey __P((DBM *));
-DBM	*__db_ndbm_open __P((const char *, int, int));
+DBM	*__db_ndbm_open __P((const gchar *, int, int));
 int	 __db_ndbm_pagfno __P((DBM *));
 int	 __db_ndbm_rdonly __P((DBM *));
 int	 __db_ndbm_store __P((DBM *, datum, datum, int));
@@ -1931,13 +1931,13 @@ int	 __db_dbm_delete __P((datum));
 int	 __db_dbm_dirf __P((void));
 datum __db_dbm_fetch __P((datum));
 datum __db_dbm_firstkey __P((void));
-int	 __db_dbm_init __P((char *));
+int	 __db_dbm_init __P((gchar *));
 datum __db_dbm_nextkey __P((datum));
 int	 __db_dbm_pagf __P((void));
 int	 __db_dbm_store __P((datum, datum));
 #endif
 #if DB_DBM_HSEARCH != 0
-int __db_hcreate __P((size_t));
+gint __db_hcreate __P((size_t));
 ENTRY *__db_hsearch __P((ENTRY, ACTION));
 void __db_hdestroy __P((void));
 #endif
diff --git a/libdb/build_vxworks/db_archive/db_archive.c b/libdb/build_vxworks/db_archive/db_archive.c
index b0c5a4a..adb09fb 100644
--- a/libdb/build_vxworks/db_archive/db_archive.c
+++ b/libdb/build_vxworks/db_archive/db_archive.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -25,16 +25,16 @@ static const char revid[] =
 
 #include "db_int.h"
 
-int db_archive_main __P((int, char *[]));
-int db_archive_usage __P((void));
-int db_archive_version_check __P((const char *));
+gint db_archive_main __P((int, gchar *[]));
+gint db_archive_usage __P((void));
+gint db_archive_version_check __P((const gchar *));
 
-int
+gint
 db_archive(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_archive", args, &argc, &argv);
 	return (db_archive_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -43,18 +43,18 @@ db_archive(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_archive_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
-	const char *progname = "db_archive";
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
+	const gchar *progname = "db_archive";
 	DB_ENV	*dbenv;
 	u_int32_t flags;
-	int ch, e_close, exitval, ret, verbose;
-	char **file, *home, **list, *passwd;
+	gint ch, e_close, exitval, ret, verbose;
+	gchar **file, *home, **list, *passwd;
 
 	if ((ret = db_archive_version_check(progname)) != 0)
 		return (ret);
@@ -167,7 +167,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 db_archive_usage()
 {
 	(void)fprintf(stderr,
@@ -175,11 +175,11 @@ db_archive_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_archive_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/build_vxworks/db_checkpoint/db_checkpoint.c b/libdb/build_vxworks/db_checkpoint/db_checkpoint.c
index 5ccd949..b1bd299 100644
--- a/libdb/build_vxworks/db_checkpoint/db_checkpoint.c
+++ b/libdb/build_vxworks/db_checkpoint/db_checkpoint.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -39,16 +39,16 @@ static const char revid[] =
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
 
-int	 db_checkpoint_main __P((int, char *[]));
+int	 db_checkpoint_main __P((int, gchar *[]));
 int	 db_checkpoint_usage __P((void));
-int	 db_checkpoint_version_check __P((const char *));
+int	 db_checkpoint_version_check __P((const gchar *));
 
-int
+gint
 db_checkpoint(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_checkpoint", args, &argc, &argv);
 	return (db_checkpoint_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -57,20 +57,20 @@ db_checkpoint(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_checkpoint_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
 	DB_ENV	*dbenv;
-	const char *progname = "db_checkpoint";
+	const gchar *progname = "db_checkpoint";
 	time_t now;
 	long argval;
 	u_int32_t flags, kbytes, minutes, seconds;
-	int ch, e_close, exitval, once, ret, verbose;
-	char *home, *logfile, *passwd;
+	gint ch, e_close, exitval, once, ret, verbose;
+	gchar *home, *logfile, *passwd;
 
 	if ((ret = db_checkpoint_version_check(progname)) != 0)
 		return (ret);
@@ -229,7 +229,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 db_checkpoint_usage()
 {
 	(void)fprintf(stderr, "%s\n\t%s\n",
@@ -238,11 +238,11 @@ db_checkpoint_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_checkpoint_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/build_vxworks/db_deadlock/db_deadlock.c b/libdb/build_vxworks/db_deadlock/db_deadlock.c
index 509c885..5d7f7e0 100644
--- a/libdb/build_vxworks/db_deadlock/db_deadlock.c
+++ b/libdb/build_vxworks/db_deadlock/db_deadlock.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -37,16 +37,16 @@ static const char revid[] =
 
 #include "db_int.h"
 
-int db_deadlock_main __P((int, char *[]));
-int db_deadlock_usage __P((void));
-int db_deadlock_version_check __P((const char *));
+gint db_deadlock_main __P((int, gchar *[]));
+gint db_deadlock_usage __P((void));
+gint db_deadlock_version_check __P((const gchar *));
 
-int
+gint
 db_deadlock(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_deadlock", args, &argc, &argv);
 	return (db_deadlock_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -55,20 +55,20 @@ db_deadlock(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_deadlock_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
-	const char *progname = "db_deadlock";
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
+	const gchar *progname = "db_deadlock";
 	DB_ENV  *dbenv;
 	u_int32_t atype;
 	time_t now;
 	long secs, usecs;
-	int ch, e_close, exitval, ret, verbose;
-	char *home, *logfile, *str;
+	gint ch, e_close, exitval, ret, verbose;
+	gchar *home, *logfile, *str;
 
 	if ((ret = db_deadlock_version_check(progname)) != 0)
 		return (ret);
@@ -220,7 +220,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 db_deadlock_usage()
 {
 	(void)fprintf(stderr, "%s\n\t%s\n",
@@ -229,11 +229,11 @@ db_deadlock_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_deadlock_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/build_vxworks/db_dump/db_dump.c b/libdb/build_vxworks/db_dump/db_dump.c
index 152760c..77993ac 100644
--- a/libdb/build_vxworks/db_dump/db_dump.c
+++ b/libdb/build_vxworks/db_dump/db_dump.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -27,21 +27,21 @@ static const char revid[] =
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
 
-int	 db_dump_db_init __P((DB_ENV *, char *, int, u_int32_t, int *));
+int	 db_dump_db_init __P((DB_ENV *, gchar *, int, u_int32_t, gint *));
 int	 db_dump_dump __P((DB *, int, int));
-int	 db_dump_dump_sub __P((DB_ENV *, DB *, char *, int, int));
-int	 db_dump_is_sub __P((DB *, int *));
-int	 db_dump_main __P((int, char *[]));
+int	 db_dump_dump_sub __P((DB_ENV *, DB *, gchar *, int, int));
+int	 db_dump_is_sub __P((DB *, gint *));
+int	 db_dump_main __P((int, gchar *[]));
 int	 db_dump_show_subs __P((DB *));
 int	 db_dump_usage __P((void));
-int	 db_dump_version_check __P((const char *));
+int	 db_dump_version_check __P((const gchar *));
 
-int
+gint
 db_dump(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_dump", args, &argc, &argv);
 	return (db_dump_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -50,21 +50,21 @@ db_dump(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_dump_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
-	const char *progname = "db_dump";
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
+	const gchar *progname = "db_dump";
 	DB_ENV	*dbenv;
 	DB *dbp;
 	u_int32_t cache;
-	int ch, d_close;
-	int e_close, exitval, keyflag, lflag, nflag, pflag, private;
-	int ret, Rflag, rflag, resize, subs;
-	char *dopt, *home, *passwd, *subname;
+	gint ch, d_close;
+	gint e_close, exitval, keyflag, lflag, nflag, pflag, private;
+	gint ret, Rflag, rflag, resize, subs;
+	gchar *dopt, *home, *passwd, *subname;
 
 	if ((ret = db_dump_version_check(progname)) != 0)
 		return (ret);
@@ -289,15 +289,15 @@ done:	if (d_close && (ret = dbp->close(dbp, 0)) != 0) {
  * db_init --
  *	Initialize the environment.
  */
-int
+gint
 db_dump_db_init(dbenv, home, is_salvage, cache, is_privatep)
 	DB_ENV *dbenv;
-	char *home;
-	int is_salvage;
+	gchar *home;
+	gint is_salvage;
 	u_int32_t cache;
-	int *is_privatep;
+	gint *is_privatep;
 {
-	int ret;
+	gint ret;
 
 	/*
 	 * Try and use the underlying environment when opening a database.
@@ -347,14 +347,14 @@ db_dump_db_init(dbenv, home, is_salvage, cache, is_privatep)
  * is_sub --
  *	Return if the database contains subdatabases.
  */
-int
+gint
 db_dump_is_sub(dbp, yesno)
 	DB *dbp;
-	int *yesno;
+	gint *yesno;
 {
 	DB_BTREE_STAT *btsp;
 	DB_HASH_STAT *hsp;
-	int ret;
+	gint ret;
 
 	switch (dbp->type) {
 	case DB_BTREE:
@@ -387,18 +387,18 @@ db_dump_is_sub(dbp, yesno)
  * dump_sub --
  *	Dump out the records for a DB containing subdatabases.
  */
-int
+gint
 db_dump_dump_sub(dbenv, parent_dbp, parent_name, pflag, keyflag)
 	DB_ENV *dbenv;
 	DB *parent_dbp;
-	char *parent_name;
-	int pflag, keyflag;
+	gchar *parent_name;
+	gint pflag, keyflag;
 {
 	DB *dbp;
 	DBC *dbcp;
 	DBT key, data;
-	int ret;
-	char *subdb;
+	gint ret;
+	gchar *subdb;
 
 	/*
 	 * Get a cursor and step through the database, dumping out each
@@ -457,13 +457,13 @@ db_dump_dump_sub(dbenv, parent_dbp, parent_name, pflag, keyflag)
  * show_subs --
  *	Display the subdatabases for a database.
  */
-int
+gint
 db_dump_show_subs(dbp)
 	DB *dbp;
 {
 	DBC *dbcp;
 	DBT key, data;
-	int ret;
+	gint ret;
 
 	/*
 	 * Get a cursor and step through the database, printing out the key
@@ -499,17 +499,17 @@ db_dump_show_subs(dbp)
  * dump --
  *	Dump out the records for a DB.
  */
-int
+gint
 db_dump_dump(dbp, pflag, keyflag)
 	DB *dbp;
-	int pflag, keyflag;
+	gint pflag, keyflag;
 {
 	DBC *dbcp;
 	DBT key, data;
 	DBT keyret, dataret;
 	db_recno_t recno;
-	int is_recno, failed, ret;
-	void *pointer;
+	gint is_recno, failed, ret;
+	gpointer pointer;
 
 	/*
 	 * Get a cursor and step through the database, printing out each
@@ -597,7 +597,7 @@ err:	if (data.data != NULL)
  * usage --
  *	Display the usage message.
  */
-int
+gint
 db_dump_usage()
 {
 	(void)fprintf(stderr, "%s\n\t%s\n",
@@ -606,11 +606,11 @@ db_dump_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_dump_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/build_vxworks/db_int.h b/libdb/build_vxworks/db_int.h
index eb6a8ea..f5565f1 100644
--- a/libdb/build_vxworks/db_int.h
+++ b/libdb/build_vxworks/db_int.h
@@ -132,7 +132,7 @@ typedef unsigned long db_alignp_t;
 /* Structure used to print flag values. */
 typedef struct __fn {
 	u_int32_t mask;			/* Flag value. */
-	const char *name;		/* Flag name. */
+	const gchar *name;		/* Flag name. */
 } FN;
 
 /* Set, clear and test flags. */
@@ -291,7 +291,7 @@ typedef enum {
 	if (!F_ISSET((dbp)->dbenv, DB_ENV_DBLOCAL))			\
 		return (__db_mi_env((dbp)->dbenv, name));
 #define	DB_ILLEGAL_METHOD(dbp, flags) {					\
-	int __ret;							\
+	gint __ret;							\
 	if ((__ret = __dbh_am_chk(dbp, flags)) != 0)			\
 		return (__ret);						\
 }
diff --git a/libdb/build_vxworks/db_load/db_load.c b/libdb/build_vxworks/db_load/db_load.c
index 05b4bcd..4d2915b 100644
--- a/libdb/build_vxworks/db_load/db_load.c
+++ b/libdb/build_vxworks/db_load/db_load.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -29,7 +29,7 @@ static const char revid[] =
 #include "dbinc/db_am.h"
 
 typedef struct {			/* XXX: Globals. */
-	const char *progname;		/* Program name. */
+	const gchar *progname;		/* Program name. */
 	char	*hdrbuf;		/* Input file header. */
 	u_long	lineno;			/* Input file line number. */
 	u_long	origline;		/* Original file line number. */
@@ -44,19 +44,19 @@ typedef struct {			/* XXX: Globals. */
 
 void	db_load_badend __P((DB_ENV *));
 void	db_load_badnum __P((DB_ENV *));
-int	db_load_configure __P((DB_ENV *, DB *, char **, char **, int *));
-int	db_load_convprintable __P((DB_ENV *, char *, char **));
-int	db_load_db_init __P((DB_ENV *, char *, u_int32_t, int *));
+int	db_load_configure __P((DB_ENV *, DB *, gchar **, gchar **, gint *));
+int	db_load_convprintable __P((DB_ENV *, gchar *, gchar **));
+int	db_load_db_init __P((DB_ENV *, gchar *, u_int32_t, gint *));
 int	db_load_dbt_rdump __P((DB_ENV *, DBT *));
 int	db_load_dbt_rprint __P((DB_ENV *, DBT *));
 int	db_load_dbt_rrecno __P((DB_ENV *, DBT *, int));
-int	db_load_digitize __P((DB_ENV *, int, int *));
+int	db_load_digitize __P((DB_ENV *, int, gint *));
 int	db_load_env_create __P((DB_ENV **, LDG *));
-int	db_load_load __P((DB_ENV *, char *, DBTYPE, char **, u_int, LDG *, int *));
-int	db_load_main __P((int, char *[]));
-int	db_load_rheader __P((DB_ENV *, DB *, DBTYPE *, char **, int *, int *));
+int	db_load_load __P((DB_ENV *, gchar *, DBTYPE, gchar **, u_int, LDG *, gint *));
+int	db_load_main __P((int, gchar *[]));
+int	db_load_rheader __P((DB_ENV *, DB *, DBTYPE *, gchar **, gint *, gint *));
 int	db_load_usage __P((void));
-int	db_load_version_check __P((const char *));
+int	db_load_version_check __P((const gchar *));
 
 #define	G(f)	((LDG *)dbenv->app_private)->f
 
@@ -65,12 +65,12 @@ int	db_load_version_check __P((const char *));
 #define	LDF_NOOVERWRITE	0x02		/* Don't overwrite existing rows. */
 #define	LDF_PASSWORD	0x04		/* Encrypt created databases. */
 
-int
+gint
 db_load(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_load", args, &argc, &argv);
 	return (db_load_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -79,19 +79,19 @@ db_load(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_load_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
 	DBTYPE dbtype;
 	DB_ENV	*dbenv;
 	LDG ldg;
 	u_int32_t ldf;
-	int ch, existed, exitval, ret;
-	char **clist, **clp;
+	gint ch, existed, exitval, ret;
+	gchar **clist, **clp;
 
 	ldg.progname = "db_load";
 	ldg.lineno = 0;
@@ -110,7 +110,7 @@ db_load_main(argc, argv)
 	dbtype = DB_UNKNOWN;
 
 	/* Allocate enough room for configuration arguments. */
-	if ((clp = clist = (char **)calloc(argc + 1, sizeof(char *))) == NULL) {
+	if ((clp = clist = (gchar **)calloc(argc + 1, sizeof(gchar *))) == NULL) {
 		fprintf(stderr, "%s: %s\n", ldg.progname, strerror(ENOMEM));
 		return (EXIT_FAILURE);
 	}
@@ -220,14 +220,14 @@ shutdown:	exitval = 1;
  * load --
  *	Load a database.
  */
-int
+gint
 db_load_load(dbenv, name, argtype, clist, flags, ldg, existedp)
 	DB_ENV *dbenv;
-	char *name, **clist;
+	gchar *name, **clist;
 	DBTYPE argtype;
 	u_int flags;
 	LDG *ldg;
-	int *existedp;
+	gint *existedp;
 {
 	DB *dbp;
 	DBT key, rkey, data, *readp, *writep;
@@ -235,8 +235,8 @@ db_load_load(dbenv, name, argtype, clist, flags, ldg, existedp)
 	DB_TXN *ctxn, *txn;
 	db_recno_t recno, datarecno;
 	u_int32_t put_flags;
-	int ascii_recno, checkprint, hexkeys, keyflag, keys, resize, ret, rval;
-	char *subdb;
+	gint ascii_recno, checkprint, hexkeys, keyflag, keys, resize, ret, rval;
+	gchar *subdb;
 
 	*existedp = 0;
 
@@ -380,11 +380,11 @@ retry_db:
 			key.data = &recno;
 	} else
 key_data:	if ((readp->data =
-		    (void *)malloc(readp->ulen = 1024)) == NULL) {
+		    (gpointer)malloc(readp->ulen = 1024)) == NULL) {
 			dbenv->err(dbenv, ENOMEM, NULL);
 			goto err;
 		}
-	if ((data.data = (void *)malloc(data.ulen = 1024)) == NULL) {
+	if ((data.data = (gpointer)malloc(data.ulen = 1024)) == NULL) {
 		dbenv->err(dbenv, ENOMEM, NULL);
 		goto err;
 	}
@@ -518,15 +518,15 @@ err:		rval = 1;
  * db_init --
  *	Initialize the environment.
  */
-int
+gint
 db_load_db_init(dbenv, home, cache, is_private)
 	DB_ENV *dbenv;
-	char *home;
+	gchar *home;
 	u_int32_t cache;
-	int *is_private;
+	gint *is_private;
 {
 	u_int32_t flags;
-	int ret;
+	gint ret;
 
 	*is_private = 0;
 	/* We may be loading into a live environment.  Try and join. */
@@ -600,16 +600,16 @@ db_load_db_init(dbenv, home, cache, is_private)
  * configure --
  *	Handle command-line configuration options.
  */
-int
+gint
 db_load_configure(dbenv, dbp, clp, subdbp, keysp)
 	DB_ENV *dbenv;
 	DB *dbp;
-	char **clp, **subdbp;
-	int *keysp;
+	gchar **clp, **subdbp;
+	gint *keysp;
 {
 	long val;
-	int ret, savech;
-	char *name, *value;
+	gint ret, savech;
+	gchar *name, *value;
 
 	for (; (name = *clp) != NULL; *--value = savech, ++clp) {
 		if ((value = strchr(name, '=')) == NULL) {
@@ -673,17 +673,17 @@ nameerr:
  * rheader --
  *	Read the header message.
  */
-int
+gint
 db_load_rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp)
 	DB_ENV *dbenv;
 	DB *dbp;
 	DBTYPE *dbtypep;
-	char **subdbp;
-	int *checkprintp, *keysp;
+	gchar **subdbp;
+	gint *checkprintp, *keysp;
 {
 	long val;
-	int ch, first, hdr, linelen, buflen, ret, start;
-	char *buf, *name, *p, *value;
+	gint ch, first, hdr, linelen, buflen, ret, start;
+	gchar *buf, *name, *p, *value;
 
 	*dbtypep = DB_UNKNOWN;
 	*checkprintp = 0;
@@ -696,7 +696,7 @@ db_load_rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp)
 	buflen = 4096;
 	if (G(hdrbuf) == NULL) {
 		hdr = 0;
-		if ((buf = (char *)malloc(buflen)) == NULL) {
+		if ((buf = (gchar *)malloc(buflen)) == NULL) {
 memerr:			dbp->errx(dbp, "could not allocate buffer %d", buflen);
 			return (1);
 		}
@@ -731,7 +731,7 @@ memerr:			dbp->errx(dbp, "could not allocate buffer %d", buflen);
 
 				/* If the buffer is too small, double it. */
 				if (linelen + start == buflen) {
-					G(hdrbuf) = (char *)realloc(G(hdrbuf),
+					G(hdrbuf) = (gchar *)realloc(G(hdrbuf),
 					    buflen *= 2);
 					if (G(hdrbuf) == NULL)
 						goto memerr;
@@ -881,23 +881,23 @@ badfmt:
  * allocations that aren't likely to be a problem here), and this has fewer
  * special cases to deal with.
  *
- * Note that despite the printable encoding, the char * interface to this
+ * Note that despite the printable encoding, the gchar * interface to this
  * function (which is, not coincidentally, also used for database naming)
  * means that outstr cannot contain any nuls.
  */
-int
+gint
 db_load_convprintable(dbenv, instr, outstrp)
 	DB_ENV *dbenv;
-	char *instr, **outstrp;
+	gchar *instr, **outstrp;
 {
-	char c, *outstr;
-	int e1, e2;
+	gchar c, *outstr;
+	gint e1, e2;
 
 	/*
 	 * Just malloc a string big enough for the whole input string;
 	 * the output string will be smaller (or of equal length).
 	 */
-	if ((outstr = (char *)malloc(strlen(instr))) == NULL)
+	if ((outstr = (gchar *)malloc(strlen(instr))) == NULL)
 		return (ENOMEM);
 
 	*outstrp = outstr;
@@ -929,15 +929,15 @@ db_load_convprintable(dbenv, instr, outstrp)
  * dbt_rprint --
  *	Read a printable line into a DBT structure.
  */
-int
+gint
 db_load_dbt_rprint(dbenv, dbtp)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 {
 	u_int32_t len;
 	u_int8_t *p;
-	int c1, c2, e, escape, first;
-	char buf[32];
+	gint c1, c2, e, escape, first;
+	gchar buf[32];
 
 	++G(lineno);
 
@@ -989,7 +989,7 @@ db_load_dbt_rprint(dbenv, dbtp)
 		if (len >= dbtp->ulen - 10) {
 			dbtp->ulen *= 2;
 			if ((dbtp->data =
-			    (void *)realloc(dbtp->data, dbtp->ulen)) == NULL) {
+			    (gpointer)realloc(dbtp->data, dbtp->ulen)) == NULL) {
 				dbenv->err(dbenv, ENOMEM, NULL);
 				return (1);
 			}
@@ -1007,15 +1007,15 @@ db_load_dbt_rprint(dbenv, dbtp)
  * dbt_rdump --
  *	Read a byte dump line into a DBT structure.
  */
-int
+gint
 db_load_dbt_rdump(dbenv, dbtp)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 {
 	u_int32_t len;
 	u_int8_t *p;
-	int c1, c2, e, first;
-	char buf[32];
+	gint c1, c2, e, first;
+	gchar buf[32];
 
 	++G(lineno);
 
@@ -1054,7 +1054,7 @@ db_load_dbt_rdump(dbenv, dbtp)
 		if (len >= dbtp->ulen - 10) {
 			dbtp->ulen *= 2;
 			if ((dbtp->data =
-			    (void *)realloc(dbtp->data, dbtp->ulen)) == NULL) {
+			    (gpointer)realloc(dbtp->data, dbtp->ulen)) == NULL) {
 				dbenv->err(dbenv, ENOMEM, NULL);
 				return (1);
 			}
@@ -1074,13 +1074,13 @@ db_load_dbt_rdump(dbenv, dbtp)
  * dbt_rrecno --
  *	Read a record number dump line into a DBT structure.
  */
-int
+gint
 db_load_dbt_rrecno(dbenv, dbtp, ishex)
 	DB_ENV *dbenv;
 	DBT *dbtp;
-	int ishex;
+	gint ishex;
 {
-	char buf[32], *p, *q;
+	gchar buf[32], *p, *q;
 
 	++G(lineno);
 
@@ -1133,10 +1133,10 @@ bad:		db_load_badend(dbenv);
  * digitize --
  *	Convert a character to an integer.
  */
-int
+gint
 db_load_digitize(dbenv, c, errorp)
 	DB_ENV *dbenv;
-	int c, *errorp;
+	gint c, *errorp;
 {
 	switch (c) {			/* Don't depend on ASCII ordering. */
 	case '0': return (0);
@@ -1190,7 +1190,7 @@ db_load_badend(dbenv)
  * usage --
  *	Display the usage message.
  */
-int
+gint
 db_load_usage()
 {
 	(void)fprintf(stderr, "%s\n\t%s\n",
@@ -1199,11 +1199,11 @@ db_load_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_load_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
@@ -1218,13 +1218,13 @@ db_load_version_check(progname)
 	return (0);
 }
 
-int
+gint
 db_load_env_create(dbenvp, ldg)
 	DB_ENV **dbenvp;
 	LDG *ldg;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	if ((ret = db_env_create(dbenvp, 0)) != 0) {
 		fprintf(stderr,
diff --git a/libdb/build_vxworks/db_printlog/db_printlog.c b/libdb/build_vxworks/db_printlog/db_printlog.c
index 18e2886..2a60fb3 100644
--- a/libdb/build_vxworks/db_printlog/db_printlog.c
+++ b/libdb/build_vxworks/db_printlog/db_printlog.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -34,18 +34,18 @@ static const char revid[] =
 #include "dbinc/rep.h"
 #include "dbinc/txn.h"
 
-int db_printlog_main __P((int, char *[]));
-int db_printlog_usage __P((void));
-int db_printlog_version_check __P((const char *));
-int db_printlog_print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
-int db_printlog_open_rep_db __P((DB_ENV *, DB **, DBC **));
+gint db_printlog_main __P((int, gchar *[]));
+gint db_printlog_usage __P((void));
+gint db_printlog_version_check __P((const gchar *));
+gint db_printlog_print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
+gint db_printlog_open_rep_db __P((DB_ENV *, DB **, DBC **));
 
-int
+gint
 db_printlog(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_printlog", args, &argc, &argv);
 	return (db_printlog_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -54,24 +54,24 @@ db_printlog(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_printlog_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
-	const char *progname = "db_printlog";
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
+	const gchar *progname = "db_printlog";
 	DB *dbp;
 	DBC *dbc;
 	DB_ENV	*dbenv;
 	DB_LOGC *logc;
-	int (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t dtabsize;
 	DBT data, keydbt;
 	DB_LSN key;
-	int ch, e_close, exitval, nflag, rflag, ret, repflag;
-	char *home, *passwd;
+	gint ch, e_close, exitval, nflag, rflag, ret, repflag;
+	gchar *home, *passwd;
 
 	if ((ret = db_printlog_version_check(progname)) != 0)
 		return (ret);
@@ -274,7 +274,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 db_printlog_usage()
 {
 	fprintf(stderr, "%s\n",
@@ -282,11 +282,11 @@ db_printlog_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_printlog_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
@@ -302,14 +302,14 @@ db_printlog_version_check(progname)
 }
 
 /* Print an unknown, application-specific log record as best we can. */
-int
+gint
 db_printlog_print_app_record(dbenv, dbt, lsnp, op)
 	DB_ENV *dbenv;
 	DBT *dbt;
 	DB_LSN *lsnp;
 	db_recops op;
 {
-	int ch;
+	gint ch;
 	u_int32_t i, rectype;
 
 	DB_ASSERT(op == DB_TXN_PRINT);
@@ -338,13 +338,13 @@ db_printlog_print_app_record(dbenv, dbt, lsnp, op)
 	return (0);
 }
 
-int
+gint
 db_printlog_open_rep_db(dbenv, dbpp, dbcp)
 	DB_ENV *dbenv;
 	DB **dbpp;
 	DBC **dbcp;
 {
-	int ret;
+	gint ret;
 
 	DB *dbp;
 	*dbpp = NULL;
diff --git a/libdb/build_vxworks/db_recover/db_recover.c b/libdb/build_vxworks/db_recover/db_recover.c
index 9dd9ca7..dd31d7c 100644
--- a/libdb/build_vxworks/db_recover/db_recover.c
+++ b/libdb/build_vxworks/db_recover/db_recover.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -36,17 +36,17 @@ static const char revid[] =
 #include "db_int.h"
 #include "dbinc/txn.h"
 
-int db_recover_main __P((int, char *[]));
-int db_recover_read_timestamp __P((const char *, char *, time_t *));
-int db_recover_usage __P((void));
-int db_recover_version_check __P((const char *));
+gint db_recover_main __P((int, gchar *[]));
+gint db_recover_read_timestamp __P((const gchar *, gchar *, time_t *));
+gint db_recover_usage __P((void));
+gint db_recover_version_check __P((const gchar *));
 
-int
+gint
 db_recover(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_recover", args, &argc, &argv);
 	return (db_recover_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -55,20 +55,20 @@ db_recover(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_recover_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
-	const char *progname = "db_recover";
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
+	const gchar *progname = "db_recover";
 	DB_ENV	*dbenv;
 	DB_TXNREGION *region;
 	time_t now, timestamp;
 	u_int32_t flags;
-	int ch, exitval, fatal_recover, ret, retain_env, verbose;
-	char *home, *passwd;
+	gint ch, exitval, fatal_recover, ret, retain_env, verbose;
+	gchar *home, *passwd;
 
 	if ((ret = db_recover_version_check(progname)) != 0)
 		return (ret);
@@ -230,16 +230,16 @@ shutdown:	exitval = 1;
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-int
+gint
 db_recover_read_timestamp(progname, arg, timep)
-	const char *progname;
-	char *arg;
+	const gchar *progname;
+	gchar *arg;
 	time_t *timep;
 {
 	struct tm *t;
 	time_t now;
-	int yearset;
-	char *p;
+	gint yearset;
+	gchar *p;
 					/* Start with the current time. */
 	(void)time(&now);
 	if ((t = localtime(&now)) == NULL) {
@@ -300,7 +300,7 @@ terr:		fprintf(stderr,
 	return (0);
 }
 
-int
+gint
 db_recover_usage()
 {
 	(void)fprintf(stderr, "%s\n",
@@ -308,11 +308,11 @@ db_recover_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_recover_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/build_vxworks/db_stat/db_stat.c b/libdb/build_vxworks/db_stat/db_stat.c
index 4cea8a9..935b3a0 100644
--- a/libdb/build_vxworks/db_stat/db_stat.c
+++ b/libdb/build_vxworks/db_stat/db_stat.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -44,31 +44,31 @@ static const char revid[] =
 typedef enum { T_NOTSET,
     T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_REP, T_TXN } test_t;
 
-int	 db_stat_argcheck __P((char *, const char *));
+int	 db_stat_argcheck __P((gchar *, const gchar *));
 int	 db_stat_btree_stats __P((DB_ENV *, DB *, DB_BTREE_STAT *, int));
-int	 db_stat_db_init __P((DB_ENV *, char *, test_t, u_int32_t, int *));
-void	 db_stat_dl __P((const char *, u_long));
-void	 db_stat_dl_bytes __P((const char *, u_long, u_long, u_long));
+int	 db_stat_db_init __P((DB_ENV *, gchar *, test_t, u_int32_t, gint *));
+void	 db_stat_dl __P((const gchar *, u_long));
+void	 db_stat_dl_bytes __P((const gchar *, u_long, u_long, u_long));
 int	 db_stat_env_stats __P((DB_ENV *, u_int32_t));
 int	 db_stat_hash_stats __P((DB_ENV *, DB *, int));
-int	 db_stat_lock_stats __P((DB_ENV *, char *, u_int32_t));
+int	 db_stat_lock_stats __P((DB_ENV *, gchar *, u_int32_t));
 int	 db_stat_log_stats __P((DB_ENV *, u_int32_t));
-int	 db_stat_main __P((int, char *[]));
-int	 db_stat_mpool_stats __P((DB_ENV *, char *, u_int32_t));
+int	 db_stat_main __P((int, gchar *[]));
+int	 db_stat_mpool_stats __P((DB_ENV *, gchar *, u_int32_t));
 void	 db_stat_prflags __P((u_int32_t, const FN *));
 int	 db_stat_queue_stats __P((DB_ENV *, DB *, int));
 int	 db_stat_rep_stats __P((DB_ENV *, u_int32_t));
-int	 db_stat_txn_compare __P((const void *, const void *));
+int	 db_stat_txn_compare __P((gconstpointer , gconstpointer ));
 int	 db_stat_txn_stats __P((DB_ENV *, u_int32_t));
 int	 db_stat_usage __P((void));
-int	 db_stat_version_check __P((const char *));
+int	 db_stat_version_check __P((const gchar *));
 
-int
+gint
 db_stat(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_stat", args, &argc, &argv);
 	return (db_stat_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -77,22 +77,22 @@ db_stat(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_stat_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
-	const char *progname = "db_stat";
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
+	const gchar *progname = "db_stat";
 	DB_ENV	*dbenv;
 	DB_BTREE_STAT *sp;
 	DB *alt_dbp, *dbp;
 	test_t ttype;
 	u_int32_t cache;
-	int ch, checked, d_close, e_close, exitval, fast, flags;
-	int nflag, private, resize, ret;
-	char *db, *home, *internal, *passwd, *subdb;
+	gint ch, checked, d_close, e_close, exitval, fast, flags;
+	gint nflag, private, resize, ret;
+	gchar *db, *home, *internal, *passwd, *subdb;
 
 	if ((ret = db_stat_version_check(progname)) != 0)
 		return (ret);
@@ -389,15 +389,15 @@ shutdown:	exitval = 1;
  * env_stats --
  *	Display environment statistics.
  */
-int
+gint
 db_stat_env_stats(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	REGENV renv;
 	REGION *rp, regs[1024];
-	int n, ret;
-	const char *lable;
+	gint n, ret;
+	const gchar *lable;
 
 	n = sizeof(regs) / sizeof(regs[0]);
 	if ((ret = __db_e_stat(dbenv, &renv, regs, &n, flags)) != 0)  {
@@ -461,12 +461,12 @@ db_stat_env_stats(dbenv, flags)
  * btree_stats --
  *	Display btree/recno statistics.
  */
-int
+gint
 db_stat_btree_stats(dbenv, dbp, msp, fast)
 	DB_ENV *dbenv;
 	DB *dbp;
 	DB_BTREE_STAT *msp;
-	int fast;
+	gint fast;
 {
 	static const FN fn[] = {
 		{ BTM_DUP,	"duplicates" },
@@ -478,7 +478,7 @@ db_stat_btree_stats(dbenv, dbp, msp, fast)
 		{ 0,		NULL }
 	};
 	DB_BTREE_STAT *sp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbenv, NULL);
 
@@ -549,11 +549,11 @@ db_stat_btree_stats(dbenv, dbp, msp, fast)
  * hash_stats --
  *	Display hash statistics.
  */
-int
+gint
 db_stat_hash_stats(dbenv, dbp, fast)
 	DB_ENV *dbenv;
 	DB *dbp;
-	int fast;
+	gint fast;
 {
 	static const FN fn[] = {
 		{ DB_HASH_DUP,	"duplicates" },
@@ -561,7 +561,7 @@ db_stat_hash_stats(dbenv, dbp, fast)
 		{ 0,		NULL }
 	};
 	DB_HASH_STAT *sp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbenv, NULL);
 
@@ -612,14 +612,14 @@ db_stat_hash_stats(dbenv, dbp, fast)
  * queue_stats --
  *	Display queue statistics.
  */
-int
+gint
 db_stat_queue_stats(dbenv, dbp, fast)
 	DB_ENV *dbenv;
 	DB *dbp;
-	int fast;
+	gint fast;
 {
 	DB_QUEUE_STAT *sp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbenv, NULL);
 
@@ -657,14 +657,14 @@ db_stat_queue_stats(dbenv, dbp, fast)
  * lock_stats --
  *	Display lock statistics.
  */
-int
+gint
 db_stat_lock_stats(dbenv, internal, flags)
 	DB_ENV *dbenv;
-	char *internal;
+	gchar *internal;
 	u_int32_t flags;
 {
 	DB_LOCK_STAT *sp;
-	int ret;
+	gint ret;
 
 	if (internal != NULL) {
 		if ((ret =
@@ -728,13 +728,13 @@ db_stat_lock_stats(dbenv, internal, flags)
  * log_stats --
  *	Display log statistics.
  */
-int
+gint
 db_stat_log_stats(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	DB_LOG_STAT *sp;
-	int ret;
+	gint ret;
 
 	if ((ret = dbenv->log_stat(dbenv, &sp, flags)) != 0) {
 		dbenv->err(dbenv, ret, NULL);
@@ -787,15 +787,15 @@ db_stat_log_stats(dbenv, flags)
  * mpool_stats --
  *	Display mpool statistics.
  */
-int
+gint
 db_stat_mpool_stats(dbenv, internal, flags)
 	DB_ENV *dbenv;
-	char *internal;
+	gchar *internal;
 	u_int32_t flags;
 {
 	DB_MPOOL_FSTAT **fsp;
 	DB_MPOOL_STAT *gsp;
-	int ret;
+	gint ret;
 
 	if (internal != NULL) {
 		if ((ret =
@@ -902,14 +902,14 @@ db_stat_mpool_stats(dbenv, internal, flags)
  * rep_stats --
  *	Display replication statistics.
  */
-int
+gint
 db_stat_rep_stats(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	DB_REP_STAT *sp;
-	int is_client, ret;
-	const char *p;
+	gint is_client, ret;
+	const gchar *p;
 
 	if ((ret = dbenv->rep_stat(dbenv, &sp, flags)) != 0) {
 		dbenv->err(dbenv, ret, NULL);
@@ -1017,15 +1017,15 @@ db_stat_rep_stats(dbenv, flags)
  * txn_stats --
  *	Display transaction statistics.
  */
-int
+gint
 db_stat_txn_stats(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	DB_TXN_STAT *sp;
 	u_int32_t i;
-	int ret;
-	const char *p;
+	gint ret;
+	const gchar *p;
 
 	if ((ret = dbenv->txn_stat(dbenv, &sp, flags)) != 0) {
 		dbenv->err(dbenv, ret, NULL);
@@ -1078,9 +1078,9 @@ db_stat_txn_stats(dbenv, flags)
 	return (0);
 }
 
-int
+gint
 db_stat_txn_compare(a1, b1)
-	const void *a1, *b1;
+	gconstpointer a1, *b1;
 {
 	const DB_TXN_ACTIVE *a, *b;
 
@@ -1100,7 +1100,7 @@ db_stat_txn_compare(a1, b1)
  */
 void
 db_stat_dl(msg, value)
-	const char *msg;
+	const gchar *msg;
 	u_long value;
 {
 	/*
@@ -1119,10 +1119,10 @@ db_stat_dl(msg, value)
  */
 void
 db_stat_dl_bytes(msg, gbytes, mbytes, bytes)
-	const char *msg;
+	const gchar *msg;
 	u_long gbytes, mbytes, bytes;
 {
-	const char *sep;
+	const gchar *sep;
 
 	/* Normalize the values. */
 	while (bytes >= MEGABYTE) {
@@ -1163,7 +1163,7 @@ db_stat_prflags(flags, fnp)
 	u_int32_t flags;
 	const FN *fnp;
 {
-	const char *sep;
+	const gchar *sep;
 
 	sep = "\t";
 	printf("Flags:");
@@ -1179,16 +1179,16 @@ db_stat_prflags(flags, fnp)
  * db_init --
  *	Initialize the environment.
  */
-int
+gint
 db_stat_db_init(dbenv, home, ttype, cache, is_private)
 	DB_ENV *dbenv;
-	char *home;
+	gchar *home;
 	test_t ttype;
 	u_int32_t cache;
-	int *is_private;
+	gint *is_private;
 {
 	u_int32_t oflags;
-	int ret;
+	gint ret;
 
 	/*
 	 * If our environment open fails, and we're trying to look at a
@@ -1242,10 +1242,10 @@ db_stat_db_init(dbenv, home, ttype, cache, is_private)
  * argcheck --
  *	Return if argument flags are okay.
  */
-int
+gint
 db_stat_argcheck(arg, ok_args)
-	char *arg;
-	const char *ok_args;
+	gchar *arg;
+	const gchar *ok_args;
 {
 	for (; *arg != '\0'; ++arg)
 		if (strchr(ok_args, *arg) == NULL)
@@ -1253,7 +1253,7 @@ db_stat_argcheck(arg, ok_args)
 	return (1);
 }
 
-int
+gint
 db_stat_usage()
 {
 	fprintf(stderr, "%s\n\t%s\n",
@@ -1262,11 +1262,11 @@ db_stat_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_stat_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/build_vxworks/db_upgrade/db_upgrade.c b/libdb/build_vxworks/db_upgrade/db_upgrade.c
index b3fc3cc..1040a26 100644
--- a/libdb/build_vxworks/db_upgrade/db_upgrade.c
+++ b/libdb/build_vxworks/db_upgrade/db_upgrade.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -25,16 +25,16 @@ static const char revid[] =
 
 #include "db_int.h"
 
-int db_upgrade_main __P((int, char *[]));
-int db_upgrade_usage __P((void));
-int db_upgrade_version_check __P((const char *));
+gint db_upgrade_main __P((int, gchar *[]));
+gint db_upgrade_usage __P((void));
+gint db_upgrade_version_check __P((const gchar *));
 
-int
+gint
 db_upgrade(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_upgrade", args, &argc, &argv);
 	return (db_upgrade_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -43,19 +43,19 @@ db_upgrade(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_upgrade_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
-	const char *progname = "db_upgrade";
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
+	const gchar *progname = "db_upgrade";
 	DB *dbp;
 	DB_ENV *dbenv;
 	u_int32_t flags;
-	int ch, e_close, exitval, nflag, ret, t_ret;
-	char *home, *passwd;
+	gint ch, e_close, exitval, nflag, ret, t_ret;
+	gchar *home, *passwd;
 
 	if ((ret = db_upgrade_version_check(progname)) != 0)
 		return (ret);
@@ -177,7 +177,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 db_upgrade_usage()
 {
 	fprintf(stderr, "%s\n",
@@ -185,11 +185,11 @@ db_upgrade_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_upgrade_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/build_vxworks/db_verify/db_verify.c b/libdb/build_vxworks/db_verify/db_verify.c
index 3f2fe4e..862ab37 100644
--- a/libdb/build_vxworks/db_verify/db_verify.c
+++ b/libdb/build_vxworks/db_verify/db_verify.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -25,16 +25,16 @@ static const char revid[] =
 
 #include "db_int.h"
 
-int db_verify_main __P((int, char *[]));
-int db_verify_usage __P((void));
-int db_verify_version_check __P((const char *));
+gint db_verify_main __P((int, gchar *[]));
+gint db_verify_usage __P((void));
+gint db_verify_version_check __P((const gchar *));
 
-int
+gint
 db_verify(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("db_verify", args, &argc, &argv);
 	return (db_verify_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -43,20 +43,20 @@ db_verify(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 db_verify_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind, __db_getopt_reset;
-	const char *progname = "db_verify";
+	extern gchar *optarg;
+	extern gint optind, __db_getopt_reset;
+	const gchar *progname = "db_verify";
 	DB *dbp, *dbp1;
 	DB_ENV *dbenv;
 	u_int32_t cache;
-	int ch, d_close, e_close, exitval, nflag, oflag, private;
-	int quiet, resize, ret, t_ret;
-	char *home, *passwd;
+	gint ch, d_close, e_close, exitval, nflag, oflag, private;
+	gint quiet, resize, ret, t_ret;
+	gchar *home, *passwd;
 
 	if ((ret = db_verify_version_check(progname)) != 0)
 		return (ret);
@@ -235,7 +235,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 db_verify_usage()
 {
 	fprintf(stderr, "%s\n",
@@ -243,11 +243,11 @@ db_verify_usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 db_verify_version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/build_vxworks/dbdemo/dbdemo.c b/libdb/build_vxworks/dbdemo/dbdemo.c
index 887f71c..e658248 100644
--- a/libdb/build_vxworks/dbdemo/dbdemo.c
+++ b/libdb/build_vxworks/dbdemo/dbdemo.c
@@ -14,7 +14,7 @@
 #include <string.h>
 
 #ifdef _WIN32
-extern int getopt(int, char * const *, const char *);
+extern gint getopt(int, gchar * const *, const gchar *);
 #else
 #include <unistd.h>
 #endif
@@ -23,15 +23,15 @@ extern int getopt(int, char * const *, const char *);
 #include <db_int.h>
 
 #define	DATABASE	"access.db"
-int dbdemo_main __P((int, char *[]));
-int dbdemo_usage __P((void));
+gint dbdemo_main __P((int, gchar *[]));
+gint dbdemo_usage __P((void));
 
-int
+gint
 dbdemo(args)
-	char *args;
+	gchar *args;
 {
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 
 	__db_util_arg("dbdemo", args, &argc, &argv);
 	return (dbdemo_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -40,19 +40,19 @@ dbdemo(args)
 #include <stdio.h>
 #define	ERROR_RETURN	ERROR
 
-int
+gint
 dbdemo_main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern int optind, __db_getopt_reset;
+	extern gint optind, __db_getopt_reset;
 	DB *dbp;
 	DBC *dbcp;
 	DBT key, data;
 	u_int32_t len;
-	int ch, ret, rflag;
-	char *database, *p, *t, buf[1024], rbuf[1024];
-	const char *progname = "dbdemo";		/* Program name. */
+	gint ch, ret, rflag;
+	gchar *database, *p, *t, buf[1024], rbuf[1024];
+	const gchar *progname = "dbdemo";		/* Program name. */
 
 	rflag = 0;
 	__db_getopt_reset = 1;
@@ -146,8 +146,8 @@ dbdemo_main(argc, argv)
 	/* Walk through the database and print out the key/data pairs. */
 	while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0)
 		printf("%.*s : %.*s\n",
-		    (int)key.size, (char *)key.data,
-		    (int)data.size, (char *)data.data);
+		    (int)key.size, (gchar *)key.data,
+		    (int)data.size, (gchar *)data.data);
 	if (ret != DB_NOTFOUND) {
 		dbp->err(dbp, ret, "DBcursor->get");
 		goto err2;
@@ -170,7 +170,7 @@ err1:	(void)dbp->close(dbp, 0);
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 dbdemo_usage()
 {
 	(void)fprintf(stderr, "usage: ex_access [-r] [database]\n");
diff --git a/libdb/build_win32/db.h b/libdb/build_win32/db.h
index 5531f2e..13cfa06 100644
--- a/libdb/build_win32/db.h
+++ b/libdb/build_win32/db.h
@@ -74,23 +74,23 @@ extern "C" {
  */
 #ifndef	__BIT_TYPES_DEFINED__
 #define	__BIT_TYPES_DEFINED__
-typedef unsigned char u_int8_t;
+typedef guchar u_int8_t;
 typedef short int16_t;
 typedef unsigned short u_int16_t;
-typedef int int32_t;
-typedef unsigned int u_int32_t;
+typedef gint int32_t;
+typedef guint u_int32_t;
 #endif
 
 #if !defined(_WINSOCKAPI_)
-typedef unsigned char u_char;
+typedef guchar u_char;
 typedef unsigned short u_short;
-typedef unsigned int u_int;
+typedef guint u_int;
 typedef unsigned long u_long;
 #endif
 #if defined(_WIN64)
 typedef __int64 ssize_t;
 #else
-typedef int ssize_t;
+typedef gint ssize_t;
 #endif
 
 /* Basic types that are exported or quasi-exported. */
@@ -513,8 +513,8 @@ struct __db_log_cursor {
 	u_int32_t bp_maxrec;		/* Max record length in the log file. */
 
 					/* Methods. */
-	int (*close) __P((DB_LOGC *, u_int32_t));
-	int (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
+	gint (*close) __P((DB_LOGC *, u_int32_t));
+	gint (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
 
 #define	DB_LOG_DISK		0x01	/* Log record came from disk. */
 #define	DB_LOG_LOCKED		0x02	/* Log region already locked */
@@ -526,7 +526,7 @@ struct __db_log_cursor {
 struct __db_log_stat {
 	u_int32_t st_magic;		/* Log file magic number. */
 	u_int32_t st_version;		/* Log file version number. */
-	int st_mode;			/* Log file mode. */
+	gint st_mode;			/* Log file mode. */
 	u_int32_t st_lg_bsize;		/* Log buffer size. */
 	u_int32_t st_lg_size;		/* Log file size. */
 	u_int32_t st_w_bytes;		/* Bytes to log. */
@@ -615,22 +615,22 @@ struct __db_mpoolfile {
 	size_t	   len;			/* Length of mmap'd region. */
 
 					/* Methods. */
-	int  (*close) __P((DB_MPOOLFILE *, u_int32_t));
-	int  (*get) __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *));
+	gint  (*close) __P((DB_MPOOLFILE *, u_int32_t));
+	gint  (*get) __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, gpointer ));
 	void (*get_fileid) __P((DB_MPOOLFILE *, u_int8_t *));
 	void (*last_pgno) __P((DB_MPOOLFILE *, db_pgno_t *));
-	int  (*open)__P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t));
-	int  (*put) __P((DB_MPOOLFILE *, void *, u_int32_t));
+	gint  (*open)__P((DB_MPOOLFILE *, const gchar *, u_int32_t, int, size_t));
+	gint  (*put) __P((DB_MPOOLFILE *, gpointer , u_int32_t));
 	void (*refcnt) __P((DB_MPOOLFILE *, db_pgno_t *));
-	int  (*set) __P((DB_MPOOLFILE *, void *, u_int32_t));
-	int  (*set_clear_len) __P((DB_MPOOLFILE *, u_int32_t));
-	int  (*set_fileid) __P((DB_MPOOLFILE *, u_int8_t *));
-	int  (*set_ftype) __P((DB_MPOOLFILE *, int));
-	int  (*set_lsn_offset) __P((DB_MPOOLFILE *, int32_t));
-	int  (*set_pgcookie) __P((DB_MPOOLFILE *, DBT *));
-	int  (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
+	gint  (*set) __P((DB_MPOOLFILE *, gpointer , u_int32_t));
+	gint  (*set_clear_len) __P((DB_MPOOLFILE *, u_int32_t));
+	gint  (*set_fileid) __P((DB_MPOOLFILE *, u_int8_t *));
+	gint  (*set_ftype) __P((DB_MPOOLFILE *, int));
+	gint  (*set_lsn_offset) __P((DB_MPOOLFILE *, int32_t));
+	gint  (*set_pgcookie) __P((DB_MPOOLFILE *, DBT *));
+	gint  (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
 	void (*set_unlink) __P((DB_MPOOLFILE *, int));
-	int  (*sync) __P((DB_MPOOLFILE *));
+	gint  (*sync) __P((DB_MPOOLFILE *));
 
 	/*
 	 * MP_OPEN_CALLED and MP_READONLY do not need to be thread protected
@@ -686,7 +686,7 @@ struct __db_mpool_stat {
 
 /* Mpool file statistics structure. */
 struct __db_mpool_fstat {
-	char *file_name;		/* File name. */
+	gchar *file_name;		/* File name. */
 	size_t st_pagesize;		/* Page size. */
 	u_int32_t st_map;		/* Pages from mapped files. */
 	u_int32_t st_cache_hit;		/* Pages found in the cache. */
@@ -863,8 +863,8 @@ struct __db_rep_stat {
 
 	u_int32_t st_dupmasters;	/* # of times a duplicate master
 					   condition was detected.+ */
-	int st_env_id;			/* Current environment ID. */
-	int st_env_priority;		/* Current environment priority. */
+	gint st_env_id;			/* Current environment ID. */
+	gint st_env_priority;		/* Current environment priority. */
 	u_int32_t st_gen;		/* Current generation number. */
 	u_int32_t st_log_duplicated;	/* Log records received multiply.+ */
 	u_int32_t st_log_queued;	/* Log records currently queued.+ */
@@ -872,7 +872,7 @@ struct __db_rep_stat {
 	u_int32_t st_log_queued_total;	/* Total # of log recs. ever queued.+ */
 	u_int32_t st_log_records;	/* Log records received and put.+ */
 	u_int32_t st_log_requested;	/* Log recs. missed and requested.+ */
-	int st_master;			/* Env. ID of the current master. */
+	gint st_master;			/* Env. ID of the current master. */
 	u_int32_t st_master_changes;	/* # of times we've switched masters. */
 	u_int32_t st_msgs_badgen;	/* Messages with a bad generation #.+ */
 	u_int32_t st_msgs_processed;	/* Messages received and processed.+ */
@@ -881,7 +881,7 @@ struct __db_rep_stat {
 	u_int32_t st_msgs_send_failures;/* # of failed message sends.+ */
 	u_int32_t st_msgs_sent;		/* # of successful message sends.+ */
 	u_int32_t st_newsites;		/* # of NEWSITE msgs. received.+ */
-	int st_nsites;			/* Current number of sites we will
+	gint st_nsites;			/* Current number of sites we will
 					   assume during elections. */
 	u_int32_t st_nthrottles;	/* # of times we were throttled. */
 	u_int32_t st_outdated;		/* # of times we detected and returned
@@ -893,14 +893,14 @@ struct __db_rep_stat {
 	u_int32_t st_elections_won;	/* # of elections won by this site.+ */
 
 	/* Statistics about an in-progress election. */
-	int st_election_cur_winner;	/* Current front-runner. */
+	gint st_election_cur_winner;	/* Current front-runner. */
 	u_int32_t st_election_gen;	/* Election generation number. */
 	DB_LSN st_election_lsn;		/* Max. LSN of current winner. */
-	int st_election_nsites;		/* # of "registered voters". */
-	int st_election_priority;	/* Current election priority. */
-	int st_election_status;		/* Current election status. */
-	int st_election_tiebreaker;	/* Election tiebreaker value. */
-	int st_election_votes;		/* Votes received in this round. */
+	gint st_election_nsites;		/* # of "registered voters". */
+	gint st_election_priority;	/* Current election priority. */
+	gint st_election_status;		/* Current election status. */
+	gint st_election_tiebreaker;	/* Election tiebreaker value. */
+	gint st_election_votes;		/* Votes received in this round. */
 };
 
 /*******************************************************
@@ -1039,9 +1039,9 @@ struct __db {
 	u_int32_t pgsize;		/* Database logical page size. */
 
 					/* Callbacks. */
-	int (*db_append_recno) __P((DB *, DBT *, db_recno_t));
+	gint (*db_append_recno) __P((DB *, DBT *, db_recno_t));
 	void (*db_feedback) __P((DB *, int, int));
-	int (*dup_compare) __P((DB *, const DBT *, const DBT *));
+	gint (*dup_compare) __P((DB *, const DBT *, const DBT *));
 
 	void	*app_private;		/* Application-private handle. */
 
@@ -1176,79 +1176,79 @@ struct __db {
 	void	*xa_internal;		/* XA. */
 
 					/* Methods. */
-	int  (*associate) __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *,
+	gint  (*associate) __P((DB *, DB_TXN *, DB *, gint (*)(DB *, const DBT *,
 		const DBT *, DBT *), u_int32_t));
-	int  (*close) __P((DB *, u_int32_t));
-	int  (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
-	int  (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
-	void (*err) __P((DB *, int, const char *, ...));
-	void (*errx) __P((DB *, const char *, ...));
-	int  (*fd) __P((DB *, int *));
-	int  (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
-	int  (*get_byteswapped) __P((DB *, int *));
-	int  (*get_type) __P((DB *, DBTYPE *));
-	int  (*join) __P((DB *, DBC **, DBC **, u_int32_t));
-	int  (*key_range) __P((DB *,
+	gint  (*close) __P((DB *, u_int32_t));
+	gint  (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
+	gint  (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
+	void (*err) __P((DB *, int, const gchar *, ...));
+	void (*errx) __P((DB *, const gchar *, ...));
+	gint  (*fd) __P((DB *, gint *));
+	gint  (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+	gint  (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
+	gint  (*get_byteswapped) __P((DB *, gint *));
+	gint  (*get_type) __P((DB *, DBTYPE *));
+	gint  (*join) __P((DB *, DBC **, DBC **, u_int32_t));
+	gint  (*key_range) __P((DB *,
 		DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
-	int  (*open) __P((DB *, DB_TXN *,
-		const char *, const char *, DBTYPE, u_int32_t, int));
-	int  (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*remove) __P((DB *, const char *, const char *, u_int32_t));
-	int  (*rename) __P((DB *,
-	    const char *, const char *, const char *, u_int32_t));
-	int  (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
-	int  (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
-	int  (*set_alloc) __P((DB *, void *(*)(size_t),
-		void *(*)(void *, size_t), void (*)(void *)));
-	int  (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
-	int  (*set_cache_priority) __P((DB *, DB_CACHE_PRIORITY));
-	int  (*set_dup_compare) __P((DB *,
-	    int (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_encrypt) __P((DB *, const char *, u_int32_t));
-	void (*set_errcall) __P((DB *, void (*)(const char *, char *)));
+	gint  (*open) __P((DB *, DB_TXN *,
+		const gchar *, const gchar *, DBTYPE, u_int32_t, int));
+	gint  (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+	gint  (*remove) __P((DB *, const gchar *, const gchar *, u_int32_t));
+	gint  (*rename) __P((DB *,
+	    const gchar *, const gchar *, const gchar *, u_int32_t));
+	gint  (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
+	gint  (*set_append_recno) __P((DB *, gint (*)(DB *, DBT *, db_recno_t)));
+	gint  (*set_alloc) __P((DB *, gpointer (*)(size_t),
+		gpointer (*)(gpointer , size_t), void (*)(gpointer)));
+	gint  (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
+	gint  (*set_cache_priority) __P((DB *, DB_CACHE_PRIORITY));
+	gint  (*set_dup_compare) __P((DB *,
+	    gint (*)(DB *, const DBT *, const DBT *)));
+	gint  (*set_encrypt) __P((DB *, const gchar *, u_int32_t));
+	void (*set_errcall) __P((DB *, void (*)(const gchar *, gchar *)));
 	void (*set_errfile) __P((DB *, FILE *));
-	void (*set_errpfx) __P((DB *, const char *));
-	int  (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
-	int  (*set_flags) __P((DB *, u_int32_t));
-	int  (*set_lorder) __P((DB *, int));
-	int  (*set_pagesize) __P((DB *, u_int32_t));
-	int  (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int)));
-	int  (*stat) __P((DB *, void *, u_int32_t));
-	int  (*sync) __P((DB *, u_int32_t));
-	int  (*upgrade) __P((DB *, const char *, u_int32_t));
-	int  (*verify) __P((DB *,
-	    const char *, const char *, FILE *, u_int32_t));
-
-	int  (*set_bt_compare) __P((DB *,
-	    int (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_bt_maxkey) __P((DB *, u_int32_t));
-	int  (*set_bt_minkey) __P((DB *, u_int32_t));
-	int  (*set_bt_prefix) __P((DB *,
+	void (*set_errpfx) __P((DB *, const gchar *));
+	gint  (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
+	gint  (*set_flags) __P((DB *, u_int32_t));
+	gint  (*set_lorder) __P((DB *, int));
+	gint  (*set_pagesize) __P((DB *, u_int32_t));
+	gint  (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int)));
+	gint  (*stat) __P((DB *, gpointer , u_int32_t));
+	gint  (*sync) __P((DB *, u_int32_t));
+	gint  (*upgrade) __P((DB *, const gchar *, u_int32_t));
+	gint  (*verify) __P((DB *,
+	    const gchar *, const gchar *, FILE *, u_int32_t));
+
+	gint  (*set_bt_compare) __P((DB *,
+	    gint (*)(DB *, const DBT *, const DBT *)));
+	gint  (*set_bt_maxkey) __P((DB *, u_int32_t));
+	gint  (*set_bt_minkey) __P((DB *, u_int32_t));
+	gint  (*set_bt_prefix) __P((DB *,
 	    size_t (*)(DB *, const DBT *, const DBT *)));
 
-	int  (*set_h_ffactor) __P((DB *, u_int32_t));
-	int  (*set_h_hash) __P((DB *,
-	    u_int32_t (*)(DB *, const void *, u_int32_t)));
-	int  (*set_h_nelem) __P((DB *, u_int32_t));
+	gint  (*set_h_ffactor) __P((DB *, u_int32_t));
+	gint  (*set_h_hash) __P((DB *,
+	    u_int32_t (*)(DB *, gconstpointer , u_int32_t)));
+	gint  (*set_h_nelem) __P((DB *, u_int32_t));
 
-	int  (*set_re_delim) __P((DB *, int));
-	int  (*set_re_len) __P((DB *, u_int32_t));
-	int  (*set_re_pad) __P((DB *, int));
-	int  (*set_re_source) __P((DB *, const char *));
-	int  (*set_q_extentsize) __P((DB *, u_int32_t));
+	gint  (*set_re_delim) __P((DB *, int));
+	gint  (*set_re_len) __P((DB *, u_int32_t));
+	gint  (*set_re_pad) __P((DB *, int));
+	gint  (*set_re_source) __P((DB *, const gchar *));
+	gint  (*set_q_extentsize) __P((DB *, u_int32_t));
 
-	int  (*db_am_remove) __P((DB *,
-	    DB_TXN *, const char *, const char *, DB_LSN *));
-	int  (*db_am_rename) __P((DB *, DB_TXN *,
-	    const char *, const char *, const char *));
+	gint  (*db_am_remove) __P((DB *,
+	    DB_TXN *, const gchar *, const gchar *, DB_LSN *));
+	gint  (*db_am_rename) __P((DB *, DB_TXN *,
+	    const gchar *, const gchar *, const gchar *));
 
 	/*
 	 * Never called; these are a place to save function pointers
 	 * so that we can undo an associate.
 	 */
-	int  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*stored_close) __P((DB *, u_int32_t));
+	gint  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+	gint  (*stored_close) __P((DB *, u_int32_t));
 
 #define	DB_OK_BTREE	0x01
 #define	DB_OK_HASH	0x02
@@ -1399,25 +1399,25 @@ struct __dbc {
 
 	DBC_INTERNAL *internal;		/* Access method private. */
 
-	int (*c_close) __P((DBC *));	/* Methods: public. */
-	int (*c_count) __P((DBC *, db_recno_t *, u_int32_t));
-	int (*c_del) __P((DBC *, u_int32_t));
-	int (*c_dup) __P((DBC *, DBC **, u_int32_t));
-	int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t));
-	int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
-	int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t));
+	gint (*c_close) __P((DBC *));	/* Methods: public. */
+	gint (*c_count) __P((DBC *, db_recno_t *, u_int32_t));
+	gint (*c_del) __P((DBC *, u_int32_t));
+	gint (*c_dup) __P((DBC *, DBC **, u_int32_t));
+	gint (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t));
+	gint (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
+	gint (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t));
 
 					/* Methods: private. */
-	int (*c_am_bulk) __P((DBC *, DBT *, u_int32_t));
-	int (*c_am_close) __P((DBC *, db_pgno_t, int *));
-	int (*c_am_del) __P((DBC *));
-	int (*c_am_destroy) __P((DBC *));
-	int (*c_am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-	int (*c_am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-	int (*c_am_writelock) __P((DBC *));
+	gint (*c_am_bulk) __P((DBC *, DBT *, u_int32_t));
+	gint (*c_am_close) __P((DBC *, db_pgno_t, gint *));
+	gint (*c_am_del) __P((DBC *));
+	gint (*c_am_destroy) __P((DBC *));
+	gint (*c_am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+	gint (*c_am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+	gint (*c_am_writelock) __P((DBC *));
 
 	/* Private: for secondary indices. */
-	int (*c_real_get) __P((DBC *, DBT *, DBT *, u_int32_t));
+	gint (*c_real_get) __P((DBC *, DBT *, DBT *, u_int32_t));
 
 #define	DBC_ACTIVE	 0x0001		/* Cursor in use. */
 #define	DBC_COMPENSATE	 0x0002		/* Cursor compensating, don't lock. */
@@ -1516,14 +1516,14 @@ struct __db_env {
 	FILE		*db_errfile;	/* Error message file stream. */
 	const char	*db_errpfx;	/* Error message prefix. */
 					/* Callbacks. */
-	void (*db_errcall) __P((const char *, char *));
+	void (*db_errcall) __P((const gchar *, gchar *));
 	void (*db_feedback) __P((DB_ENV *, int, int));
 	void (*db_paniccall) __P((DB_ENV *, int));
 
 					/* App-specified alloc functions. */
-	void *(*db_malloc) __P((size_t));
-	void *(*db_realloc) __P((void *, size_t));
-	void (*db_free) __P((void *));
+	gpointer (*db_malloc) __P((size_t));
+	gpointer (*db_realloc) __P((gpointer , size_t));
+	void (*db_free) __P((gpointer));
 
 	/*
 	 * Currently, the verbose list is a bit field with room for 32
@@ -1539,7 +1539,7 @@ struct __db_env {
 
 	void		*app_private;	/* Application-private handle. */
 
-	int (*app_dispatch)		/* User-specified recovery dispatch. */
+	gint (*app_dispatch)		/* User-specified recovery dispatch. */
 	    __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
 
 	/* Locking. */
@@ -1590,7 +1590,7 @@ struct __db_env {
 	DB_FH		*lockfhp;	/* fcntl(2) locking file handle. */
 
 	int	      (**recover_dtab)	/* Dispatch table for recover funcs. */
-			    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+			    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t		 recover_dtab_size;
 					/* Slots in the dispatch table. */
 
@@ -1646,106 +1646,106 @@ struct __db_env {
 	u_long		*mt;		/* Mersenne Twister state vector. */
 
 					/* DB_ENV Methods. */
-	int  (*close) __P((DB_ENV *, u_int32_t));
-	int  (*dbremove) __P((DB_ENV *,
-	    DB_TXN *, const char *, const char *, u_int32_t));
-	int  (*dbrename) __P((DB_ENV *, DB_TXN *,
-	    const char *, const char *, const char *, u_int32_t));
-	void (*err) __P((const DB_ENV *, int, const char *, ...));
-	void (*errx) __P((const DB_ENV *, const char *, ...));
-	int  (*open) __P((DB_ENV *, const char *, u_int32_t, int));
-	int  (*remove) __P((DB_ENV *, const char *, u_int32_t));
-	int  (*set_data_dir) __P((DB_ENV *, const char *));
-	int  (*set_alloc) __P((DB_ENV *, void *(*)(size_t),
-		void *(*)(void *, size_t), void (*)(void *)));
-	int  (*set_app_dispatch) __P((DB_ENV *,
-		int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
-	int  (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t));
-	void (*set_errcall) __P((DB_ENV *, void (*)(const char *, char *)));
+	gint  (*close) __P((DB_ENV *, u_int32_t));
+	gint  (*dbremove) __P((DB_ENV *,
+	    DB_TXN *, const gchar *, const gchar *, u_int32_t));
+	gint  (*dbrename) __P((DB_ENV *, DB_TXN *,
+	    const gchar *, const gchar *, const gchar *, u_int32_t));
+	void (*err) __P((const DB_ENV *, int, const gchar *, ...));
+	void (*errx) __P((const DB_ENV *, const gchar *, ...));
+	gint  (*open) __P((DB_ENV *, const gchar *, u_int32_t, int));
+	gint  (*remove) __P((DB_ENV *, const gchar *, u_int32_t));
+	gint  (*set_data_dir) __P((DB_ENV *, const gchar *));
+	gint  (*set_alloc) __P((DB_ENV *, gpointer (*)(size_t),
+		gpointer (*)(gpointer , size_t), void (*)(gpointer)));
+	gint  (*set_app_dispatch) __P((DB_ENV *,
+		gint (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
+	gint  (*set_encrypt) __P((DB_ENV *, const gchar *, u_int32_t));
+	void (*set_errcall) __P((DB_ENV *, void (*)(const gchar *, gchar *)));
 	void (*set_errfile) __P((DB_ENV *, FILE *));
-	void (*set_errpfx) __P((DB_ENV *, const char *));
-	int  (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
-	int  (*set_flags) __P((DB_ENV *, u_int32_t, int));
-	int  (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int)));
-	int  (*set_rpc_server) __P((DB_ENV *,
-		void *, const char *, long, long, u_int32_t));
-	int  (*set_shm_key) __P((DB_ENV *, long));
-	int  (*set_tas_spins) __P((DB_ENV *, u_int32_t));
-	int  (*set_tmp_dir) __P((DB_ENV *, const char *));
-	int  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
-
-	void *lg_handle;		/* Log handle and methods. */
-	int  (*set_lg_bsize) __P((DB_ENV *, u_int32_t));
-	int  (*set_lg_dir) __P((DB_ENV *, const char *));
-	int  (*set_lg_max) __P((DB_ENV *, u_int32_t));
-	int  (*set_lg_regionmax) __P((DB_ENV *, u_int32_t));
-	int  (*log_archive) __P((DB_ENV *, char **[], u_int32_t));
-	int  (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t));
-	int  (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t));
-	int  (*log_flush) __P((DB_ENV *, const DB_LSN *));
-	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
-	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
-
-	void *lk_handle;		/* Lock handle and methods. */
-	int  (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int));
-	int  (*set_lk_detect) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
-	int  (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *));
-	int  (*lock_dump_region) __P((DB_ENV *, char *, FILE *));
-	int  (*lock_get) __P((DB_ENV *,
+	void (*set_errpfx) __P((DB_ENV *, const gchar *));
+	gint  (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
+	gint  (*set_flags) __P((DB_ENV *, u_int32_t, int));
+	gint  (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int)));
+	gint  (*set_rpc_server) __P((DB_ENV *,
+		gpointer , const gchar *, long, long, u_int32_t));
+	gint  (*set_shm_key) __P((DB_ENV *, long));
+	gint  (*set_tas_spins) __P((DB_ENV *, u_int32_t));
+	gint  (*set_tmp_dir) __P((DB_ENV *, const gchar *));
+	gint  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
+
+	gpointer lg_handle;		/* Log handle and methods. */
+	gint  (*set_lg_bsize) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lg_dir) __P((DB_ENV *, const gchar *));
+	gint  (*set_lg_max) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lg_regionmax) __P((DB_ENV *, u_int32_t));
+	gint  (*log_archive) __P((DB_ENV *, gchar **[], u_int32_t));
+	gint  (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t));
+	gint  (*log_file) __P((DB_ENV *, const DB_LSN *, gchar *, size_t));
+	gint  (*log_flush) __P((DB_ENV *, const DB_LSN *));
+	gint  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
+	gint  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
+
+	gpointer lk_handle;		/* Lock handle and methods. */
+	gint  (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int));
+	gint  (*set_lk_detect) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lk_max) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t));
+	gint  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
+	gint  (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, gint *));
+	gint  (*lock_dump_region) __P((DB_ENV *, gchar *, FILE *));
+	gint  (*lock_get) __P((DB_ENV *,
 		u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
-	int  (*lock_put) __P((DB_ENV *, DB_LOCK *));
-	int  (*lock_id) __P((DB_ENV *, u_int32_t *));
-	int  (*lock_id_free) __P((DB_ENV *, u_int32_t));
-	int  (*lock_id_set) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
-	int  (*lock_vec) __P((DB_ENV *,
+	gint  (*lock_put) __P((DB_ENV *, DB_LOCK *));
+	gint  (*lock_id) __P((DB_ENV *, u_int32_t *));
+	gint  (*lock_id_free) __P((DB_ENV *, u_int32_t));
+	gint  (*lock_id_set) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
+	gint  (*lock_vec) __P((DB_ENV *,
 		u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
-	int  (*lock_downgrade) __P((DB_ENV *,
+	gint  (*lock_downgrade) __P((DB_ENV *,
 		DB_LOCK *, db_lockmode_t, u_int32_t));
 
-	void *mp_handle;		/* Mpool handle and methods. */
-	int  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
-	int  (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
-	int  (*memp_dump_region) __P((DB_ENV *, char *, FILE *));
-	int  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
-	int  (*memp_nameop) __P((DB_ENV *,
-		u_int8_t *, const char *, const char *, const char *));
-	int  (*memp_register) __P((DB_ENV *, int,
-		int (*)(DB_ENV *, db_pgno_t, void *, DBT *),
-		int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
-	int  (*memp_stat) __P((DB_ENV *,
+	gpointer mp_handle;		/* Mpool handle and methods. */
+	gint  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
+	gint  (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
+	gint  (*memp_dump_region) __P((DB_ENV *, gchar *, FILE *));
+	gint  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
+	gint  (*memp_nameop) __P((DB_ENV *,
+		u_int8_t *, const gchar *, const gchar *, const gchar *));
+	gint  (*memp_register) __P((DB_ENV *, int,
+		gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *),
+		gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *)));
+	gint  (*memp_stat) __P((DB_ENV *,
 		DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
-	int  (*memp_sync) __P((DB_ENV *, DB_LSN *));
-	int  (*memp_trickle) __P((DB_ENV *, int, int *));
-
-	void *rep_handle;		/* Replication handle and methods. */
-	int  (*rep_elect) __P((DB_ENV *, int, int, u_int32_t, int *));
-	int  (*rep_flush) __P((DB_ENV *));
-	int  (*rep_process_message) __P((DB_ENV *, DBT *, DBT *, int *));
-	int  (*rep_start) __P((DB_ENV *, DBT *, u_int32_t));
-	int  (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
-	int  (*set_rep_election) __P((DB_ENV *,
+	gint  (*memp_sync) __P((DB_ENV *, DB_LSN *));
+	gint  (*memp_trickle) __P((DB_ENV *, int, gint *));
+
+	gpointer rep_handle;		/* Replication handle and methods. */
+	gint  (*rep_elect) __P((DB_ENV *, int, int, u_int32_t, gint *));
+	gint  (*rep_flush) __P((DB_ENV *));
+	gint  (*rep_process_message) __P((DB_ENV *, DBT *, DBT *, gint *));
+	gint  (*rep_start) __P((DB_ENV *, DBT *, u_int32_t));
+	gint  (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
+	gint  (*set_rep_election) __P((DB_ENV *,
 		u_int32_t, u_int32_t, u_int32_t, u_int32_t));
-	int  (*set_rep_limit) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*set_rep_timeout) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*set_rep_transport) __P((DB_ENV *, int,
-		int (*) (DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
-
-	void *tx_handle;		/* Txn handle and methods. */
-	int  (*set_tx_max) __P((DB_ENV *, u_int32_t));
-	int  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
-	int  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
-	int  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
-	int  (*txn_id_set) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*txn_recover) __P((DB_ENV *,
+	gint  (*set_rep_limit) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*set_rep_timeout) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*set_rep_transport) __P((DB_ENV *, int,
+		gint (*) (DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
+
+	gpointer tx_handle;		/* Txn handle and methods. */
+	gint  (*set_tx_max) __P((DB_ENV *, u_int32_t));
+	gint  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
+	gint  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+	gint  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
+	gint  (*txn_id_set) __P((DB_ENV *, u_int32_t, u_int32_t));
+	gint  (*txn_recover) __P((DB_ENV *,
 		DB_PREPLIST *, long, long *, u_int32_t));
-	int  (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
-	int  (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t));
+	gint  (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
+	gint  (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t));
 
 #define	DB_TEST_ELECTINIT	 1	/* after __rep_elect_init */
 #define	DB_TEST_ELECTSEND	 2	/* after REP_ELECT msgnit */
@@ -1813,13 +1813,13 @@ typedef struct __db DBM;
 
 #if defined(_XPG4_2)
 typedef struct {
-	char *dptr;
+	gchar *dptr;
 	size_t dsize;
 } datum;
 #else
 typedef struct {
-	char *dptr;
-	int dsize;
+	gchar *dptr;
+	gint dsize;
 } datum;
 #endif
 
@@ -1866,8 +1866,8 @@ typedef enum {
 } ACTION;
 
 typedef struct entry {
-	char *key;
-	char *data;
+	gchar *key;
+	gchar *data;
 } ENTRY;
 
 #define	hcreate(a)	__db_hcreate(a)
@@ -1893,33 +1893,33 @@ typedef struct entry {
 extern "C" {
 #endif
 
-int db_create __P((DB **, DB_ENV *, u_int32_t));
-char *db_strerror __P((int));
-int db_env_create __P((DB_ENV **, u_int32_t));
-char *db_version __P((int *, int *, int *));
-int log_compare __P((const DB_LSN *, const DB_LSN *));
-int db_env_set_func_close __P((int (*)(int)));
-int db_env_set_func_dirfree __P((void (*)(char **, int)));
-int db_env_set_func_dirlist __P((int (*)(const char *, char ***, int *)));
-int db_env_set_func_exists __P((int (*)(const char *, int *)));
-int db_env_set_func_free __P((void (*)(void *)));
-int db_env_set_func_fsync __P((int (*)(int)));
-int db_env_set_func_ioinfo __P((int (*)(const char *, int, u_int32_t *, u_int32_t *, u_int32_t *)));
-int db_env_set_func_malloc __P((void *(*)(size_t)));
-int db_env_set_func_map __P((int (*)(char *, size_t, int, int, void **)));
-int db_env_set_func_open __P((int (*)(const char *, int, ...)));
-int db_env_set_func_read __P((ssize_t (*)(int, void *, size_t)));
-int db_env_set_func_realloc __P((void *(*)(void *, size_t)));
-int db_env_set_func_rename __P((int (*)(const char *, const char *)));
-int db_env_set_func_seek __P((int (*)(int, size_t, db_pgno_t, u_int32_t, int, int)));
-int db_env_set_func_sleep __P((int (*)(u_long, u_long)));
-int db_env_set_func_unlink __P((int (*)(const char *)));
-int db_env_set_func_unmap __P((int (*)(void *, size_t)));
-int db_env_set_func_write __P((ssize_t (*)(int, const void *, size_t)));
-int db_env_set_func_yield __P((int (*)(void)));
-int txn_abort __P((DB_TXN *));
-int txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
-int txn_commit __P((DB_TXN *, u_int32_t));
+gint db_create __P((DB **, DB_ENV *, u_int32_t));
+gchar *db_strerror __P((int));
+gint db_env_create __P((DB_ENV **, u_int32_t));
+gchar *db_version __P((gint *, gint *, gint *));
+gint log_compare __P((const DB_LSN *, const DB_LSN *));
+gint db_env_set_func_close __P((gint (*)(int)));
+gint db_env_set_func_dirfree __P((void (*)(gchar **, int)));
+gint db_env_set_func_dirlist __P((gint (*)(const gchar *, gchar ***, gint *)));
+gint db_env_set_func_exists __P((gint (*)(const gchar *, gint *)));
+gint db_env_set_func_free __P((void (*)(gpointer)));
+gint db_env_set_func_fsync __P((gint (*)(int)));
+gint db_env_set_func_ioinfo __P((gint (*)(const gchar *, int, u_int32_t *, u_int32_t *, u_int32_t *)));
+gint db_env_set_func_malloc __P((gpointer (*)(size_t)));
+gint db_env_set_func_map __P((gint (*)(gchar *, size_t, int, int, gpointer *)));
+gint db_env_set_func_open __P((gint (*)(const gchar *, int, ...)));
+gint db_env_set_func_read __P((ssize_t (*)(int, gpointer , size_t)));
+gint db_env_set_func_realloc __P((gpointer (*)(gpointer , size_t)));
+gint db_env_set_func_rename __P((gint (*)(const gchar *, const gchar *)));
+gint db_env_set_func_seek __P((gint (*)(int, size_t, db_pgno_t, u_int32_t, int, int)));
+gint db_env_set_func_sleep __P((gint (*)(u_long, u_long)));
+gint db_env_set_func_unlink __P((gint (*)(const gchar *)));
+gint db_env_set_func_unmap __P((gint (*)(gpointer , size_t)));
+gint db_env_set_func_write __P((ssize_t (*)(int, gconstpointer , size_t)));
+gint db_env_set_func_yield __P((gint (*)(void)));
+gint txn_abort __P((DB_TXN *));
+gint txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+gint txn_commit __P((DB_TXN *, u_int32_t));
 #if DB_DBM_HSEARCH != 0
 int	 __db_ndbm_clearerr __P((DBM *));
 void	 __db_ndbm_close __P((DBM *));
@@ -1929,7 +1929,7 @@ int	 __db_ndbm_error __P((DBM *));
 datum __db_ndbm_fetch __P((DBM *, datum));
 datum __db_ndbm_firstkey __P((DBM *));
 datum __db_ndbm_nextkey __P((DBM *));
-DBM	*__db_ndbm_open __P((const char *, int, int));
+DBM	*__db_ndbm_open __P((const gchar *, int, int));
 int	 __db_ndbm_pagfno __P((DBM *));
 int	 __db_ndbm_rdonly __P((DBM *));
 int	 __db_ndbm_store __P((DBM *, datum, datum, int));
@@ -1939,13 +1939,13 @@ int	 __db_dbm_delete __P((datum));
 int	 __db_dbm_dirf __P((void));
 datum __db_dbm_fetch __P((datum));
 datum __db_dbm_firstkey __P((void));
-int	 __db_dbm_init __P((char *));
+int	 __db_dbm_init __P((gchar *));
 datum __db_dbm_nextkey __P((datum));
 int	 __db_dbm_pagf __P((void));
 int	 __db_dbm_store __P((datum, datum));
 #endif
 #if DB_DBM_HSEARCH != 0
-int __db_hcreate __P((size_t));
+gint __db_hcreate __P((size_t));
 ENTRY *__db_hsearch __P((ENTRY, ACTION));
 void __db_hdestroy __P((void));
 #endif
diff --git a/libdb/build_win32/db_config.h b/libdb/build_win32/db_config.h
index 497bf37..544fad1 100644
--- a/libdb/build_win32/db_config.h
+++ b/libdb/build_win32/db_config.h
@@ -411,9 +411,9 @@
 #if defined(__cplusplus)
 extern "C" {
 #endif
-extern int optind;
-extern char *optarg;
-extern int getopt(int, char * const *, const char *);
+extern gint optind;
+extern gchar *optarg;
+extern gint getopt(int, gchar * const *, const gchar *);
 #if defined(__cplusplus)
 }
 #endif
diff --git a/libdb/build_win32/db_cxx.h b/libdb/build_win32/db_cxx.h
index 4929362..28d4348 100644
--- a/libdb/build_win32/db_cxx.h
+++ b/libdb/build_win32/db_cxx.h
@@ -131,24 +131,24 @@ class DbTxnImp;
 // the choices.
 //
 extern "C" {
-	typedef void * (*db_malloc_fcn_type)
+	typedef gpointer  (*db_malloc_fcn_type)
 		(size_t);
-	typedef void * (*db_realloc_fcn_type)
-		(void *, size_t);
+	typedef gpointer  (*db_realloc_fcn_type)
+		(gpointer , size_t);
 	typedef void (*db_free_fcn_type)
-		(void *);
-	typedef int (*bt_compare_fcn_type)          /*C++ version available*/
+		(gpointer);
+	typedef gint (*bt_compare_fcn_type)          /*C++ version available*/
 		(DB *, const DBT *, const DBT *);
 	typedef size_t (*bt_prefix_fcn_type)        /*C++ version available*/
 		(DB *, const DBT *, const DBT *);
-	typedef int (*dup_compare_fcn_type)         /*C++ version available*/
+	typedef gint (*dup_compare_fcn_type)         /*C++ version available*/
 		(DB *, const DBT *, const DBT *);
 	typedef u_int32_t (*h_hash_fcn_type)        /*C++ version available*/
-		(DB *, const void *, u_int32_t);
-	typedef int (*pgin_fcn_type)
-		(DB_ENV *dbenv, db_pgno_t pgno, void *pgaddr, DBT *pgcookie);
-	typedef int (*pgout_fcn_type)
-		(DB_ENV *dbenv, db_pgno_t pgno, void *pgaddr, DBT *pgcookie);
+		(DB *, gconstpointer , u_int32_t);
+	typedef gint (*pgin_fcn_type)
+		(DB_ENV *dbenv, db_pgno_t pgno, gpointer pgaddr, DBT *pgcookie);
+	typedef gint (*pgout_fcn_type)
+		(DB_ENV *dbenv, db_pgno_t pgno, gpointer pgaddr, DBT *pgcookie);
 };
 
 ////////////////////////////////////////////////////////////////
@@ -202,20 +202,20 @@ private:
 	DEFINE_DB_CLASS(DbMpoolFile);
 
 public:
-	int close(u_int32_t flags);
-	int get(db_pgno_t *pgnoaddr, u_int32_t flags, void *pagep);
+	gint close(u_int32_t flags);
+	gint get(db_pgno_t *pgnoaddr, u_int32_t flags, gpointer pagep);
 	void last_pgno(db_pgno_t *pgnoaddr);
-	int open(const char *file, u_int32_t flags, int mode, size_t pagesize);
-	int put(void *pgaddr, u_int32_t flags);
+	gint open(const gchar *file, u_int32_t flags, gint mode, size_t pagesize);
+	gint put(gpointer pgaddr, u_int32_t flags);
 	void refcnt(db_pgno_t *pgnoaddr);
-	int set(void *pgaddr, u_int32_t flags);
-	int set_clear_len(u_int32_t len);
-	int set_fileid(u_int8_t *fileid);
-	int set_ftype(int ftype);
-	int set_lsn_offset(int32_t offset);
-	int set_pgcookie(DBT *dbt);
+	gint set(gpointer pgaddr, u_int32_t flags);
+	gint set_clear_len(u_int32_t len);
+	gint set_fileid(u_int8_t *fileid);
+	gint set_ftype(gint ftype);
+	gint set_lsn_offset(int32_t offset);
+	gint set_pgcookie(DBT *dbt);
 	void set_unlink(int);
-	int sync();
+	gint sync();
 
 	virtual DB_MPOOLFILE *get_DB_MPOOLFILE()
 	{
@@ -275,12 +275,12 @@ private:
 	DEFINE_DB_CLASS(DbTxn);
 
 public:
-	int abort();
-	int commit(u_int32_t flags);
-	int discard(u_int32_t flags);
+	gint abort();
+	gint commit(u_int32_t flags);
+	gint discard(u_int32_t flags);
 	u_int32_t id();
-	int prepare(u_int8_t *gid);
-	int set_timeout(db_timeout_t timeout, u_int32_t flags);
+	gint prepare(u_int8_t *gid);
+	gint set_timeout(db_timeout_t timeout, u_int32_t flags);
 
 	virtual DB_TXN *get_DB_TXN()
 	{
@@ -355,56 +355,56 @@ public:
 
 	// These methods match those in the C interface.
 	//
-	virtual int close(u_int32_t);
-	virtual int dbremove(DbTxn *txn, const char *name, const char *subdb,
+	virtual gint close(u_int32_t);
+	virtual gint dbremove(DbTxn *txn, const gchar *name, const gchar *subdb,
 	    u_int32_t flags);
-	virtual int dbrename(DbTxn *txn, const char *name, const char *subdb,
-	    const char *newname, u_int32_t flags);
-	virtual void err(int, const char *, ...);
-	virtual void errx(const char *, ...);
-	virtual void *get_app_private() const;
-	virtual int open(const char *, u_int32_t, int);
-	virtual int remove(const char *, u_int32_t);
-	virtual int set_alloc(db_malloc_fcn_type, db_realloc_fcn_type,
+	virtual gint dbrename(DbTxn *txn, const gchar *name, const gchar *subdb,
+	    const gchar *newname, u_int32_t flags);
+	virtual void err(int, const gchar *, ...);
+	virtual void errx(const gchar *, ...);
+	virtual gpointer get_app_private() const;
+	virtual gint open(const gchar *, u_int32_t, int);
+	virtual gint remove(const gchar *, u_int32_t);
+	virtual gint set_alloc(db_malloc_fcn_type, db_realloc_fcn_type,
 		      db_free_fcn_type);
-	virtual void set_app_private(void *);
-	virtual int set_cachesize(u_int32_t, u_int32_t, int);
-	virtual int set_data_dir(const char *);
-	virtual int set_encrypt(const char *, int);
-	virtual void set_errcall(void (*)(const char *, char *));
+	virtual void set_app_private(gpointer);
+	virtual gint set_cachesize(u_int32_t, u_int32_t, int);
+	virtual gint set_data_dir(const gchar *);
+	virtual gint set_encrypt(const gchar *, int);
+	virtual void set_errcall(void (*)(const gchar *, gchar *));
 	virtual void set_errfile(FILE *);
-	virtual void set_errpfx(const char *);
-	virtual int set_flags(u_int32_t, int);
-	virtual int set_feedback(void (*)(DbEnv *, int, int));
-	virtual int set_lg_bsize(u_int32_t);
-	virtual int set_lg_dir(const char *);
-	virtual int set_lg_max(u_int32_t);
-	virtual int set_lg_regionmax(u_int32_t);
-	virtual int set_lk_conflicts(u_int8_t *, int);
-	virtual int set_lk_detect(u_int32_t);
-	virtual int set_lk_max(u_int32_t);
-	virtual int set_lk_max_lockers(u_int32_t);
-	virtual int set_lk_max_locks(u_int32_t);
-	virtual int set_lk_max_objects(u_int32_t);
-	virtual int set_mp_mmapsize(size_t);
-	virtual int set_paniccall(void (*)(DbEnv *, int));
-	virtual int set_rpc_server(void *, char *, long, long, u_int32_t);
-	virtual int set_shm_key(long);
-	virtual int set_timeout(db_timeout_t timeout, u_int32_t flags);
-	virtual int set_tmp_dir(const char *);
-	virtual int set_tas_spins(u_int32_t);
-	virtual int set_tx_max(u_int32_t);
-	virtual int set_app_dispatch(int (*)(DbEnv *,
+	virtual void set_errpfx(const gchar *);
+	virtual gint set_flags(u_int32_t, int);
+	virtual gint set_feedback(void (*)(DbEnv *, int, int));
+	virtual gint set_lg_bsize(u_int32_t);
+	virtual gint set_lg_dir(const gchar *);
+	virtual gint set_lg_max(u_int32_t);
+	virtual gint set_lg_regionmax(u_int32_t);
+	virtual gint set_lk_conflicts(u_int8_t *, int);
+	virtual gint set_lk_detect(u_int32_t);
+	virtual gint set_lk_max(u_int32_t);
+	virtual gint set_lk_max_lockers(u_int32_t);
+	virtual gint set_lk_max_locks(u_int32_t);
+	virtual gint set_lk_max_objects(u_int32_t);
+	virtual gint set_mp_mmapsize(size_t);
+	virtual gint set_paniccall(void (*)(DbEnv *, int));
+	virtual gint set_rpc_server(gpointer , gchar *, long, long, u_int32_t);
+	virtual gint set_shm_key(long);
+	virtual gint set_timeout(db_timeout_t timeout, u_int32_t flags);
+	virtual gint set_tmp_dir(const gchar *);
+	virtual gint set_tas_spins(u_int32_t);
+	virtual gint set_tx_max(u_int32_t);
+	virtual gint set_app_dispatch(gint (*)(DbEnv *,
 	    Dbt *, DbLsn *, db_recops));
-	virtual int set_tx_timestamp(time_t *);
-	virtual int set_verbose(u_int32_t which, int onoff);
+	virtual gint set_tx_timestamp(time_t *);
+	virtual gint set_verbose(u_int32_t which, gint onoff);
 
 	// Version information.  A static method so it can be obtained anytime.
 	//
-	static char *version(int *major, int *minor, int *patch);
+	static gchar *version(gint *major, gint *minor, gint *patch);
 
 	// Convert DB errors to strings
-	static char *strerror(int);
+	static gchar *strerror(int);
 
 	// If an error is detected and the error call function
 	// or stream is set, a message is dispatched or printed.
@@ -418,66 +418,66 @@ public:
 	virtual void set_error_stream(__DB_OSTREAMCLASS *);
 
 	// used internally
-	static void runtime_error(const char *caller, int err,
-				  int error_policy);
-	static void runtime_error_dbt(const char *caller, Dbt *dbt,
-				  int error_policy);
-	static void runtime_error_lock_get(const char *caller, int err,
+	static void runtime_error(const gchar *caller, gint err,
+				  gint error_policy);
+	static void runtime_error_dbt(const gchar *caller, Dbt *dbt,
+				  gint error_policy);
+	static void runtime_error_lock_get(const gchar *caller, gint err,
 				  db_lockop_t op, db_lockmode_t mode,
-				  const Dbt *obj, DbLock lock, int index,
-				  int error_policy);
+				  const Dbt *obj, DbLock lock, gint index,
+				  gint error_policy);
 
 	// Lock functions
 	//
-	virtual int lock_detect(u_int32_t flags, u_int32_t atype, int *aborted);
-	virtual int lock_get(u_int32_t locker, u_int32_t flags, const Dbt *obj,
+	virtual gint lock_detect(u_int32_t flags, u_int32_t atype, gint *aborted);
+	virtual gint lock_get(u_int32_t locker, u_int32_t flags, const Dbt *obj,
 		     db_lockmode_t lock_mode, DbLock *lock);
-	virtual int lock_id(u_int32_t *idp);
-	virtual int lock_id_free(u_int32_t id);
-	virtual int lock_put(DbLock *lock);
-	virtual int lock_stat(DB_LOCK_STAT **statp, u_int32_t flags);
-	virtual int lock_vec(u_int32_t locker, u_int32_t flags, DB_LOCKREQ list[],
-		     int nlist, DB_LOCKREQ **elistp);
+	virtual gint lock_id(u_int32_t *idp);
+	virtual gint lock_id_free(u_int32_t id);
+	virtual gint lock_put(DbLock *lock);
+	virtual gint lock_stat(DB_LOCK_STAT **statp, u_int32_t flags);
+	virtual gint lock_vec(u_int32_t locker, u_int32_t flags, DB_LOCKREQ list[],
+		     gint nlist, DB_LOCKREQ **elistp);
 
 	// Log functions
 	//
-	virtual int log_archive(char **list[], u_int32_t flags);
-	static int log_compare(const DbLsn *lsn0, const DbLsn *lsn1);
-	virtual int log_cursor(DbLogc **cursorp, u_int32_t flags);
-	virtual int log_file(DbLsn *lsn, char *namep, size_t len);
-	virtual int log_flush(const DbLsn *lsn);
-	virtual int log_put(DbLsn *lsn, const Dbt *data, u_int32_t flags);
+	virtual gint log_archive(gchar **list[], u_int32_t flags);
+	static gint log_compare(const DbLsn *lsn0, const DbLsn *lsn1);
+	virtual gint log_cursor(DbLogc **cursorp, u_int32_t flags);
+	virtual gint log_file(DbLsn *lsn, gchar *namep, size_t len);
+	virtual gint log_flush(const DbLsn *lsn);
+	virtual gint log_put(DbLsn *lsn, const Dbt *data, u_int32_t flags);
 
-	virtual int log_stat(DB_LOG_STAT **spp, u_int32_t flags);
+	virtual gint log_stat(DB_LOG_STAT **spp, u_int32_t flags);
 
 	// Mpool functions
 	//
-	virtual int memp_fcreate(DbMpoolFile **dbmfp, u_int32_t flags);
-	virtual int memp_register(int ftype,
+	virtual gint memp_fcreate(DbMpoolFile **dbmfp, u_int32_t flags);
+	virtual gint memp_register(gint ftype,
 			  pgin_fcn_type pgin_fcn,
 			  pgout_fcn_type pgout_fcn);
-	virtual int memp_stat(DB_MPOOL_STAT
+	virtual gint memp_stat(DB_MPOOL_STAT
 		      **gsp, DB_MPOOL_FSTAT ***fsp, u_int32_t flags);
-	virtual int memp_sync(DbLsn *lsn);
-	virtual int memp_trickle(int pct, int *nwrotep);
+	virtual gint memp_sync(DbLsn *lsn);
+	virtual gint memp_trickle(gint pct, gint *nwrotep);
 
 	// Transaction functions
 	//
-	virtual int txn_begin(DbTxn *pid, DbTxn **tid, u_int32_t flags);
-	virtual int txn_checkpoint(u_int32_t kbyte, u_int32_t min, u_int32_t flags);
-	virtual int txn_recover(DbPreplist *preplist, long count,
+	virtual gint txn_begin(DbTxn *pid, DbTxn **tid, u_int32_t flags);
+	virtual gint txn_checkpoint(u_int32_t kbyte, u_int32_t min, u_int32_t flags);
+	virtual gint txn_recover(DbPreplist *preplist, long count,
 			long *retp, u_int32_t flags);
-	virtual int txn_stat(DB_TXN_STAT **statp, u_int32_t flags);
+	virtual gint txn_stat(DB_TXN_STAT **statp, u_int32_t flags);
 
 	// Replication functions
 	//
-	virtual int rep_elect(int, int, u_int32_t, int *);
-	virtual int rep_process_message(Dbt *, Dbt *, int *);
-	virtual int rep_start(Dbt *, u_int32_t);
-	virtual int rep_stat(DB_REP_STAT **statp, u_int32_t flags);
-	virtual int set_rep_limit(u_int32_t, u_int32_t);
-	virtual int set_rep_transport(u_int32_t,
-	    int (*)(DbEnv *, const Dbt *, const Dbt *, int, u_int32_t));
+	virtual gint rep_elect(int, int, u_int32_t, gint *);
+	virtual gint rep_process_message(Dbt *, Dbt *, gint *);
+	virtual gint rep_start(Dbt *, u_int32_t);
+	virtual gint rep_stat(DB_REP_STAT **statp, u_int32_t flags);
+	virtual gint set_rep_limit(u_int32_t, u_int32_t);
+	virtual gint set_rep_transport(u_int32_t,
+	    gint (*)(DbEnv *, const Dbt *, const Dbt *, int, u_int32_t));
 
 	// Conversion functions
 	//
@@ -508,19 +508,19 @@ public:
 	// via C functions.  They should never be called by users
 	// of this class.
 	//
-	static void _stream_error_function(const char *, char *);
-	static int _app_dispatch_intercept(DB_ENV *env, DBT *dbt, DB_LSN *lsn,
+	static void _stream_error_function(const gchar *, gchar *);
+	static gint _app_dispatch_intercept(DB_ENV *env, DBT *dbt, DB_LSN *lsn,
 					db_recops op);
-	static void _paniccall_intercept(DB_ENV *env, int errval);
-	static void _feedback_intercept(DB_ENV *env, int opcode, int pct);
-	static int _rep_send_intercept(DB_ENV *env,
+	static void _paniccall_intercept(DB_ENV *env, gint errval);
+	static void _feedback_intercept(DB_ENV *env, gint opcode, gint pct);
+	static gint _rep_send_intercept(DB_ENV *env,
 				       const DBT *cntrl, const DBT *data,
-				       int id, u_int32_t flags);
+				       gint id, u_int32_t flags);
 
 private:
 	void cleanup();
-	int initialize(DB_ENV *env);
-	int error_policy();
+	gint initialize(DB_ENV *env);
+	gint error_policy();
 
 	// For internal use only.
 	DbEnv(DB_ENV *, u_int32_t flags);
@@ -530,16 +530,16 @@ private:
 	void operator = (const DbEnv &);
 
 	// instance data
-	int construct_error_;
+	gint construct_error_;
 	u_int32_t construct_flags_;
-	int (*app_dispatch_callback_)(DbEnv *, Dbt *, DbLsn *, db_recops);
+	gint (*app_dispatch_callback_)(DbEnv *, Dbt *, DbLsn *, db_recops);
 	void (*feedback_callback_)(DbEnv *, int, int);
 	void (*paniccall_callback_)(DbEnv *, int);
-	int (*pgin_callback_)(DbEnv *dbenv, db_pgno_t pgno,
-			      void *pgaddr, Dbt *pgcookie);
-	int (*pgout_callback_)(DbEnv *dbenv, db_pgno_t pgno,
-			       void *pgaddr, Dbt *pgcookie);
-	int (*rep_send_callback_)(DbEnv *,
+	gint (*pgin_callback_)(DbEnv *dbenv, db_pgno_t pgno,
+			      gpointer pgaddr, Dbt *pgcookie);
+	gint (*pgout_callback_)(DbEnv *dbenv, db_pgno_t pgno,
+			       gpointer pgaddr, Dbt *pgcookie);
+	gint (*rep_send_callback_)(DbEnv *,
 	    const Dbt *, const Dbt *, int, u_int32_t);
 
 	// class data
@@ -569,65 +569,65 @@ public:
 
 	// These methods exactly match those in the C interface.
 	//
-	virtual int associate(DbTxn *txn, Db *secondary,
-	    int (*callback)(Db *, const Dbt *, const Dbt *, Dbt *),
+	virtual gint associate(DbTxn *txn, Db *secondary,
+	    gint (*callback)(Db *, const Dbt *, const Dbt *, Dbt *),
 	    u_int32_t flags);
-	virtual int close(u_int32_t flags);
-        virtual int cursor(DbTxn *txnid, Dbc **cursorp, u_int32_t flags);
-	virtual int del(DbTxn *txnid, Dbt *key, u_int32_t flags);
-	virtual void err(int, const char *, ...);
-	virtual void errx(const char *, ...);
-	virtual int fd(int *fdp);
-	virtual int get(DbTxn *txnid, Dbt *key, Dbt *data, u_int32_t flags);
-	virtual void *get_app_private() const;
-	virtual int get_byteswapped(int *);
-	virtual int get_type(DBTYPE *);
-	virtual int join(Dbc **curslist, Dbc **dbcp, u_int32_t flags);
-	virtual int key_range(DbTxn *, Dbt *, DB_KEY_RANGE *, u_int32_t);
-	virtual int open(DbTxn *txnid,
-	    const char *, const char *subname, DBTYPE, u_int32_t, int);
-	virtual int pget(DbTxn *txnid, Dbt *key, Dbt *pkey, Dbt *data,
+	virtual gint close(u_int32_t flags);
+        virtual gint cursor(DbTxn *txnid, Dbc **cursorp, u_int32_t flags);
+	virtual gint del(DbTxn *txnid, Dbt *key, u_int32_t flags);
+	virtual void err(int, const gchar *, ...);
+	virtual void errx(const gchar *, ...);
+	virtual gint fd(gint *fdp);
+	virtual gint get(DbTxn *txnid, Dbt *key, Dbt *data, u_int32_t flags);
+	virtual gpointer get_app_private() const;
+	virtual gint get_byteswapped(gint *);
+	virtual gint get_type(DBTYPE *);
+	virtual gint join(Dbc **curslist, Dbc **dbcp, u_int32_t flags);
+	virtual gint key_range(DbTxn *, Dbt *, DB_KEY_RANGE *, u_int32_t);
+	virtual gint open(DbTxn *txnid,
+	    const gchar *, const gchar *subname, DBTYPE, u_int32_t, int);
+	virtual gint pget(DbTxn *txnid, Dbt *key, Dbt *pkey, Dbt *data,
 		 u_int32_t flags);
-	virtual int put(DbTxn *, Dbt *, Dbt *, u_int32_t);
-	virtual int remove(const char *, const char *, u_int32_t);
-	virtual int rename(const char *, const char *, const char *, u_int32_t);
-	virtual int set_alloc(db_malloc_fcn_type, db_realloc_fcn_type,
+	virtual gint put(DbTxn *, Dbt *, Dbt *, u_int32_t);
+	virtual gint remove(const gchar *, const gchar *, u_int32_t);
+	virtual gint rename(const gchar *, const gchar *, const gchar *, u_int32_t);
+	virtual gint set_alloc(db_malloc_fcn_type, db_realloc_fcn_type,
 		      db_free_fcn_type);
-	virtual void set_app_private(void *);
-	virtual int set_append_recno(int (*)(Db *, Dbt *, db_recno_t));
-	virtual int set_bt_compare(bt_compare_fcn_type); /*deprecated*/
-	virtual int set_bt_compare(int (*)(Db *, const Dbt *, const Dbt *));
-	virtual int set_bt_maxkey(u_int32_t);
-	virtual int set_bt_minkey(u_int32_t);
-	virtual int set_bt_prefix(bt_prefix_fcn_type); /*deprecated*/
-	virtual int set_bt_prefix(size_t (*)(Db *, const Dbt *, const Dbt *));
-	virtual int set_cachesize(u_int32_t, u_int32_t, int);
-	virtual int set_cache_priority(DB_CACHE_PRIORITY);
-	virtual int set_dup_compare(dup_compare_fcn_type); /*deprecated*/
-	virtual int set_dup_compare(int (*)(Db *, const Dbt *, const Dbt *));
-	virtual int set_encrypt(const char *, int);
-	virtual void set_errcall(void (*)(const char *, char *));
+	virtual void set_app_private(gpointer);
+	virtual gint set_append_recno(gint (*)(Db *, Dbt *, db_recno_t));
+	virtual gint set_bt_compare(bt_compare_fcn_type); /*deprecated*/
+	virtual gint set_bt_compare(gint (*)(Db *, const Dbt *, const Dbt *));
+	virtual gint set_bt_maxkey(u_int32_t);
+	virtual gint set_bt_minkey(u_int32_t);
+	virtual gint set_bt_prefix(bt_prefix_fcn_type); /*deprecated*/
+	virtual gint set_bt_prefix(size_t (*)(Db *, const Dbt *, const Dbt *));
+	virtual gint set_cachesize(u_int32_t, u_int32_t, int);
+	virtual gint set_cache_priority(DB_CACHE_PRIORITY);
+	virtual gint set_dup_compare(dup_compare_fcn_type); /*deprecated*/
+	virtual gint set_dup_compare(gint (*)(Db *, const Dbt *, const Dbt *));
+	virtual gint set_encrypt(const gchar *, int);
+	virtual void set_errcall(void (*)(const gchar *, gchar *));
 	virtual void set_errfile(FILE *);
-	virtual void set_errpfx(const char *);
-	virtual int set_feedback(void (*)(Db *, int, int));
-	virtual int set_flags(u_int32_t);
-	virtual int set_h_ffactor(u_int32_t);
-	virtual int set_h_hash(h_hash_fcn_type); /*deprecated*/
-	virtual int set_h_hash(u_int32_t (*)(Db *, const void *, u_int32_t));
-	virtual int set_h_nelem(u_int32_t);
-	virtual int set_lorder(int);
-	virtual int set_pagesize(u_int32_t);
-	virtual int set_paniccall(void (*)(DbEnv *, int));
-	virtual int set_re_delim(int);
-	virtual int set_re_len(u_int32_t);
-	virtual int set_re_pad(int);
-	virtual int set_re_source(char *);
-	virtual int set_q_extentsize(u_int32_t);
-	virtual int stat(void *sp, u_int32_t flags);
-	virtual int sync(u_int32_t flags);
-	virtual int truncate(DbTxn *, u_int32_t *, u_int32_t);
-	virtual int upgrade(const char *name, u_int32_t flags);
-	virtual int verify(const char *, const char *, __DB_OSTREAMCLASS *, u_int32_t);
+	virtual void set_errpfx(const gchar *);
+	virtual gint set_feedback(void (*)(Db *, int, int));
+	virtual gint set_flags(u_int32_t);
+	virtual gint set_h_ffactor(u_int32_t);
+	virtual gint set_h_hash(h_hash_fcn_type); /*deprecated*/
+	virtual gint set_h_hash(u_int32_t (*)(Db *, gconstpointer , u_int32_t));
+	virtual gint set_h_nelem(u_int32_t);
+	virtual gint set_lorder(int);
+	virtual gint set_pagesize(u_int32_t);
+	virtual gint set_paniccall(void (*)(DbEnv *, int));
+	virtual gint set_re_delim(int);
+	virtual gint set_re_len(u_int32_t);
+	virtual gint set_re_pad(int);
+	virtual gint set_re_source(gchar *);
+	virtual gint set_q_extentsize(u_int32_t);
+	virtual gint stat(gpointer sp, u_int32_t flags);
+	virtual gint sync(u_int32_t flags);
+	virtual gint truncate(DbTxn *, u_int32_t *, u_int32_t);
+	virtual gint upgrade(const gchar *name, u_int32_t flags);
+	virtual gint verify(const gchar *, const gchar *, __DB_OSTREAMCLASS *, u_int32_t);
 
 	// These additional methods are not in the C interface, and
 	// are only available for C++.
@@ -660,12 +660,12 @@ private:
 	Db &operator = (const Db &);
 
 	void cleanup();
-	int initialize();
-	int error_policy();
+	gint initialize();
+	gint error_policy();
 
 	// instance data
 	DbEnv *env_;
-	int construct_error_;
+	gint construct_error_;
 	u_int32_t flags_;
 	u_int32_t construct_flags_;
 
@@ -674,13 +674,13 @@ public:
 	// via C callback functions.  They should never be used by
 	// external users of this class.
 	//
-	int (*append_recno_callback_)(Db *, Dbt *, db_recno_t);
-	int (*associate_callback_)(Db *, const Dbt *, const Dbt *, Dbt *);
-	int (*bt_compare_callback_)(Db *, const Dbt *, const Dbt *);
+	gint (*append_recno_callback_)(Db *, Dbt *, db_recno_t);
+	gint (*associate_callback_)(Db *, const Dbt *, const Dbt *, Dbt *);
+	gint (*bt_compare_callback_)(Db *, const Dbt *, const Dbt *);
 	size_t (*bt_prefix_callback_)(Db *, const Dbt *, const Dbt *);
-	int (*dup_compare_callback_)(Db *, const Dbt *, const Dbt *);
+	gint (*dup_compare_callback_)(Db *, const Dbt *, const Dbt *);
 	void (*feedback_callback_)(Db *, int, int);
-	u_int32_t (*h_hash_callback_)(Db *, const void *, u_int32_t);
+	u_int32_t (*h_hash_callback_)(Db *, gconstpointer , u_int32_t);
 };
 
 //
@@ -696,8 +696,8 @@ class _exported Dbt : private DBT
 public:
 
 	// key/data
-	void *get_data() const                 { return data; }
-	void set_data(void *value)             { data = value; }
+	gpointer get_data() const                 { return data; }
+	void set_data(gpointer value)             { data = value; }
 
 	// key/data length
 	u_int32_t get_size() const             { return size; }
@@ -727,7 +727,7 @@ public:
 	static const Dbt* get_const_Dbt(const DBT *dbt)
 					       { return (const Dbt *)dbt; }
 
-	Dbt(void *data, u_int32_t size);
+	Dbt(gpointer data, u_int32_t size);
 	Dbt();
 	~Dbt();
 	Dbt(const Dbt &);
@@ -750,13 +750,13 @@ class _exported Dbc : protected DBC
 	friend class Db;
 
 public:
-	int close();
-	int count(db_recno_t *countp, u_int32_t flags);
-	int del(u_int32_t flags);
-	int dup(Dbc** cursorp, u_int32_t flags);
-	int get(Dbt* key, Dbt *data, u_int32_t flags);
-	int pget(Dbt* key, Dbt* pkey, Dbt *data, u_int32_t flags);
-	int put(Dbt* key, Dbt *data, u_int32_t flags);
+	gint close();
+	gint count(db_recno_t *countp, u_int32_t flags);
+	gint del(u_int32_t flags);
+	gint dup(Dbc** cursorp, u_int32_t flags);
+	gint get(Dbt* key, Dbt *data, u_int32_t flags);
+	gint pget(Dbt* key, Dbt* pkey, Dbt *data, u_int32_t flags);
+	gint put(Dbt* key, Dbt *data, u_int32_t flags);
 
 private:
 	// No data is permitted in this class (see comment at top)
@@ -777,8 +777,8 @@ class _exported DbLogc : protected DB_LOGC
 	friend class DbEnv;
 
 public:
-	int close(u_int32_t _flags);
-	int get(DbLsn *lsn, Dbt *data, u_int32_t _flags);
+	gint close(u_int32_t _flags);
+	gint get(DbLsn *lsn, Dbt *data, u_int32_t _flags);
 
 private:
 	// No data is permitted in this class (see comment at top)
diff --git a/libdb/build_win32/db_int.h b/libdb/build_win32/db_int.h
index c775a12..9ebdd65 100644
--- a/libdb/build_win32/db_int.h
+++ b/libdb/build_win32/db_int.h
@@ -132,7 +132,7 @@ typedef unsigned long db_alignp_t;
 /* Structure used to print flag values. */
 typedef struct __fn {
 	u_int32_t mask;			/* Flag value. */
-	const char *name;		/* Flag name. */
+	const gchar *name;		/* Flag name. */
 } FN;
 
 /* Set, clear and test flags. */
@@ -291,7 +291,7 @@ typedef enum {
 	if (!F_ISSET((dbp)->dbenv, DB_ENV_DBLOCAL))			\
 		return (__db_mi_env((dbp)->dbenv, name));
 #define	DB_ILLEGAL_METHOD(dbp, flags) {					\
-	int __ret;							\
+	gint __ret;							\
 	if ((__ret = __dbh_am_chk(dbp, flags)) != 0)			\
 		return (__ret);						\
 }
diff --git a/libdb/clib/getcwd.c b/libdb/clib/getcwd.c
index d2e7410..d428ab6 100644
--- a/libdb/clib/getcwd.c
+++ b/libdb/clib/getcwd.c
@@ -36,7 +36,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -81,26 +81,26 @@ static const char revid[] = "$Id$";
  *	Get the current working directory.
  *
  * PUBLIC: #ifndef HAVE_GETCWD
- * PUBLIC: char *getcwd __P((char *, size_t));
+ * PUBLIC: gchar *getcwd __P((gchar *, size_t));
  * PUBLIC: #endif
  */
-char *
+gchar *
 getcwd(pt, size)
-	char *pt;
+	gchar *pt;
 	size_t size;
 {
 	register struct dirent *dp;
 	register DIR *dir;
 	register dev_t dev;
 	register ino_t ino;
-	register int first;
-	register char *bpt, *bup;
+	register gint first;
+	register gchar *bpt, *bup;
 	struct stat s;
 	dev_t root_dev;
 	ino_t root_ino;
 	size_t ptsize, upsize;
-	int ret, save_errno;
-	char *ept, *eup, *up;
+	gint ret, save_errno;
+	gchar *ept, *eup, *up;
 
 	/*
 	 * If no buffer specified by the user, allocate one as necessary.
diff --git a/libdb/clib/getopt.c b/libdb/clib/getopt.c
index 4ecbbaa..6c105ec 100644
--- a/libdb/clib/getopt.c
+++ b/libdb/clib/getopt.c
@@ -36,7 +36,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -67,18 +67,18 @@ char	*optarg;		/* argument associated with option */
  *	Parse argc/argv argument vector.
  *
  * PUBLIC: #ifndef HAVE_GETOPT
- * PUBLIC: int getopt __P((int, char * const *, const char *));
+ * PUBLIC: gint getopt __P((int, gchar * const *, const gchar *));
  * PUBLIC: #endif
  */
-int
+gint
 getopt(nargc, nargv, ostr)
-	int nargc;
-	char * const *nargv;
-	const char *ostr;
+	gint nargc;
+	gchar * const *nargv;
+	const gchar *ostr;
 {
-	static char *progname;
-	static char *place = EMSG;		/* option letter processing */
-	char *oli;				/* option letter list index */
+	static gchar *progname;
+	static gchar *place = EMSG;		/* option letter processing */
+	gchar *oli;				/* option letter list index */
 
 	/*
 	 * VxWorks needs to be able to repeatedly call getopt from multiple
diff --git a/libdb/clib/memcmp.c b/libdb/clib/memcmp.c
index f3c1337..571c05f 100644
--- a/libdb/clib/memcmp.c
+++ b/libdb/clib/memcmp.c
@@ -36,7 +36,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -47,17 +47,17 @@ static const char revid[] = "$Id$";
  * memcmp --
  *
  * PUBLIC: #ifndef HAVE_MEMCMP
- * PUBLIC: int memcmp __P((const void *, const void *, size_t));
+ * PUBLIC: gint memcmp __P((gconstpointer , gconstpointer , size_t));
  * PUBLIC: #endif
  */
-int
+gint
 memcmp(s1, s2, n)
-	char *s1, *s2;
+	gchar *s1, *s2;
 	size_t n;
 {
 	if (n != 0) {
-		unsigned char *p1 = (unsigned char *)s1,
-			      *p2 = (unsigned char *)s2;
+		guchar *p1 = (guchar *)s1,
+			      *p2 = (guchar *)s2;
 		do {
 			if (*p1++ != *p2++)
 				return (*--p1 - *--p2);
diff --git a/libdb/clib/memmove.c b/libdb/clib/memmove.c
index 8cf3c3e..8fe3bd5 100644
--- a/libdb/clib/memmove.c
+++ b/libdb/clib/memmove.c
@@ -36,7 +36,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -47,7 +47,7 @@ static const char revid[] = "$Id$";
  * sizeof(word) MUST BE A POWER OF TWO
  * SO THAT wmask BELOW IS ALL ONES
  */
-typedef	int word;		/* "word" used for optimal copy speed */
+typedef	gint word;		/* "word" used for optimal copy speed */
 
 #undef	wsize
 #define	wsize	sizeof(word)
@@ -62,31 +62,31 @@ typedef	int word;		/* "word" used for optimal copy speed */
 #ifdef MEMCOPY
 /*
  * PUBLIC: #ifndef HAVE_MEMCPY
- * PUBLIC: void *memcpy __P((void *, const void *, size_t));
+ * PUBLIC: gpointer memcpy __P((gpointer , gconstpointer , size_t));
  * PUBLIC: #endif
  */
-void *
+gpointer
 memcpy(dst0, src0, length)
 #else
 #ifdef MEMMOVE
 /*
  * PUBLIC: #ifndef HAVE_MEMMOVE
- * PUBLIC: void *memmove __P((void *, const void *, size_t));
+ * PUBLIC: gpointer memmove __P((gpointer , gconstpointer , size_t));
  * PUBLIC: #endif
  */
-void *
+gpointer
 memmove(dst0, src0, length)
 #else
 void
 bcopy(src0, dst0, length)
 #endif
 #endif
-	void *dst0;
-	const void *src0;
+	gpointer dst0;
+	gconstpointer src0;
 	register size_t length;
 {
-	register char *dst = dst0;
-	register const char *src = src0;
+	register gchar *dst = dst0;
+	register const gchar *src = src0;
 	register size_t t;
 
 	if (length == 0 || dst == src)		/* nothing to do */
diff --git a/libdb/clib/raise.c b/libdb/clib/raise.c
index 810c0f8..7b13a5c 100644
--- a/libdb/clib/raise.c
+++ b/libdb/clib/raise.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,12 +21,12 @@ static const char revid[] = "$Id$";
  *	Send a signal to the current process.
  *
  * PUBLIC: #ifndef HAVE_RAISE
- * PUBLIC: int raise __P((int));
+ * PUBLIC: gint raise __P((int));
  * PUBLIC: #endif
  */
-int
+gint
 raise(s)
-	int s;
+	gint s;
 {
 	/*
 	 * Do not use __os_id(), as it may not return the process ID -- any
diff --git a/libdb/clib/snprintf.c b/libdb/clib/snprintf.c
index f269c05..7e5f312 100644
--- a/libdb/clib/snprintf.c
+++ b/libdb/clib/snprintf.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,24 +24,24 @@ static const char revid[] = "$Id$";
  *	Bounded version of sprintf.
  *
  * PUBLIC: #ifndef HAVE_SNPRINTF
- * PUBLIC: int snprintf __P((char *, size_t, const char *, ...));
+ * PUBLIC: gint snprintf __P((gchar *, size_t, const gchar *, ...));
  * PUBLIC: #endif
  */
 #ifndef HAVE_SNPRINTF
-int
+gint
 #ifdef __STDC__
-snprintf(char *str, size_t n, const char *fmt, ...)
+snprintf(gchar *str, size_t n, const gchar *fmt, ...)
 #else
 snprintf(str, n, fmt, va_alist)
-	char *str;
+	gchar *str;
 	size_t n;
-	const char *fmt;
+	const gchar *fmt;
 	va_dcl
 #endif
 {
-	static int ret_charpnt = -1;
+	static gint ret_charpnt = -1;
 	va_list ap;
-	int len;
+	gint len;
 
 	COMPQUIET(n, 0);
 
@@ -54,7 +54,7 @@ snprintf(str, n, fmt, va_alist)
 	 * cross-compilation environment.
 	 */
 	if (ret_charpnt == -1) {
-		char buf[10];
+		gchar buf[10];
 
 		ret_charpnt =
 		    sprintf(buf, "123") != 3 ||
diff --git a/libdb/clib/strcasecmp.c b/libdb/clib/strcasecmp.c
index de8f0e7..4731177 100644
--- a/libdb/clib/strcasecmp.c
+++ b/libdb/clib/strcasecmp.c
@@ -34,7 +34,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -46,7 +46,7 @@ static const char revid[] = "$Id$";
  * together for a case independent comparison.  The mappings are
  * based upon ascii character sequences.
  */
-static const unsigned char charmap[] = {
+static const guchar charmap[] = {
 	'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
 	'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
 	'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
@@ -86,16 +86,16 @@ static const unsigned char charmap[] = {
  *	Do strcmp(3) in a case-insensitive manner.
  *
  * PUBLIC: #ifndef HAVE_STRCASECMP
- * PUBLIC: int strcasecmp __P((const char *, const char *));
+ * PUBLIC: gint strcasecmp __P((const gchar *, const gchar *));
  * PUBLIC: #endif
  */
-int
+gint
 strcasecmp(s1, s2)
-	const char *s1, *s2;
+	const gchar *s1, *s2;
 {
-	register const unsigned char *cm = charmap,
-			*us1 = (const unsigned char *)s1,
-			*us2 = (const unsigned char *)s2;
+	register const guchar *cm = charmap,
+			*us1 = (const guchar *)s1,
+			*us2 = (const guchar *)s2;
 
 	while (cm[*us1] == cm[*us2++])
 		if (*us1++ == '\0')
@@ -108,18 +108,18 @@ strcasecmp(s1, s2)
  *	Do strncmp(3) in a case-insensitive manner.
  *
  * PUBLIC: #ifndef HAVE_STRCASECMP
- * PUBLIC: int strncasecmp __P((const char *, const char *, size_t));
+ * PUBLIC: gint strncasecmp __P((const gchar *, const gchar *, size_t));
  * PUBLIC: #endif
  */
-int
+gint
 strncasecmp(s1, s2, n)
-	const char *s1, *s2;
+	const gchar *s1, *s2;
 	register size_t n;
 {
 	if (n != 0) {
-		register const unsigned char *cm = charmap,
-				*us1 = (const unsigned char *)s1,
-				*us2 = (const unsigned char *)s2;
+		register const guchar *cm = charmap,
+				*us1 = (const guchar *)s1,
+				*us2 = (const guchar *)s2;
 
 		do {
 			if (cm[*us1] != cm[*us2++])
diff --git a/libdb/clib/strdup.c b/libdb/clib/strdup.c
index 3593195..935e283 100644
--- a/libdb/clib/strdup.c
+++ b/libdb/clib/strdup.c
@@ -34,7 +34,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -49,15 +49,15 @@ static const char revid[] = "$Id$";
  * strdup --
  *
  * PUBLIC: #ifndef HAVE_STRDUP
- * PUBLIC: char *strdup __P((const char *));
+ * PUBLIC: gchar *strdup __P((const gchar *));
  * PUBLIC: #endif
  */
-char *
+gchar *
 strdup(str)
-	const char *str;
+	const gchar *str;
 {
 	size_t len;
-	char *copy;
+	gchar *copy;
 
 	len = strlen(str) + 1;
 	if (!(copy = malloc((u_int)len)))
diff --git a/libdb/clib/strerror.c b/libdb/clib/strerror.c
index c61a787..6c0a0b5 100644
--- a/libdb/clib/strerror.c
+++ b/libdb/clib/strerror.c
@@ -36,7 +36,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 /*
@@ -44,20 +44,20 @@ static const char revid[] = "$Id$";
  *	Return the string associated with an errno.
  *
  * PUBLIC: #ifndef HAVE_STRERROR
- * PUBLIC: char *strerror __P((int));
+ * PUBLIC: gchar *strerror __P((int));
  * PUBLIC: #endif
  */
-char *
+gchar *
 strerror(num)
-	int num;
+	gint num;
 {
-	extern int sys_nerr;
-	extern char *sys_errlist[];
+	extern gint sys_nerr;
+	extern gchar *sys_errlist[];
 #undef	UPREFIX
 #define	UPREFIX	"Unknown error: "
-	static char ebuf[40] = UPREFIX;		/* 64-bit number + slop */
-	int errnum;
-	char *p, *t, tmp[40];
+	static gchar ebuf[40] = UPREFIX;		/* 64-bit number + slop */
+	gint errnum;
+	gchar *p, *t, tmp[40];
 
 	errnum = num;				/* convert to unsigned */
 	if (errnum < sys_nerr)
diff --git a/libdb/clib/vsnprintf.c b/libdb/clib/vsnprintf.c
index 272e92e..d621171 100644
--- a/libdb/clib/vsnprintf.c
+++ b/libdb/clib/vsnprintf.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,15 +24,15 @@ static const char revid[] = "$Id$";
  *	Bounded version of vsprintf.
  *
  * PUBLIC: #ifndef HAVE_VSNPRINTF
- * PUBLIC: int vsnprintf __P((char *, size_t, const char *, va_list));
+ * PUBLIC: gint vsnprintf __P((gchar *, size_t, const gchar *, va_list));
  * PUBLIC: #endif
  */
 #ifndef HAVE_VSNPRINTF
-int
+gint
 vsnprintf(str, n, fmt, ap)
-	char *str;
+	gchar *str;
 	size_t n;
-	const char *fmt;
+	const gchar *fmt;
 	va_list ap;
 {
 	COMPQUIET(n, 0);
diff --git a/libdb/common/db_byteorder.c b/libdb/common/db_byteorder.c
index e2f8ab5..ed7b464 100644
--- a/libdb/common/db_byteorder.c
+++ b/libdb/common/db_byteorder.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,14 +24,14 @@ static const char revid[] = "$Id$";
  *	configuration time so cross-compilation and general embedded
  *	system support is simpler.
  *
- * PUBLIC: int __db_isbigendian __P((void));
+ * PUBLIC: gint __db_isbigendian __P((void));
  */
-int
+gint
 __db_isbigendian()
 {
 	union {					/* From Harbison & Steele.  */
 		long l;
-		char c[sizeof(long)];
+		gchar c[sizeof(long)];
 	} u;
 
 	u.l = 1;
@@ -43,14 +43,14 @@ __db_isbigendian()
  *	Return if we need to do byte swapping, checking for illegal
  *	values.
  *
- * PUBLIC: int __db_byteorder __P((DB_ENV *, int));
+ * PUBLIC: gint __db_byteorder __P((DB_ENV *, int));
  */
-int
+gint
 __db_byteorder(dbenv, lorder)
 	DB_ENV *dbenv;
-	int lorder;
+	gint lorder;
 {
-	int is_bigendian;
+	gint is_bigendian;
 
 	is_bigendian = __db_isbigendian();
 
diff --git a/libdb/common/db_err.c b/libdb/common/db_err.c
index afe10a7..27a78ec 100644
--- a/libdb/common/db_err.c
+++ b/libdb/common/db_err.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -31,12 +31,12 @@ static const char revid[] = "$Id$";
  * __db_fchk --
  *	General flags checking routine.
  *
- * PUBLIC: int __db_fchk __P((DB_ENV *, const char *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __db_fchk __P((DB_ENV *, const gchar *, u_int32_t, u_int32_t));
  */
-int
+gint
 __db_fchk(dbenv, name, flags, ok_flags)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 	u_int32_t flags, ok_flags;
 {
 	return (LF_ISSET(~ok_flags) ? __db_ferr(dbenv, name, 0) : 0);
@@ -46,13 +46,13 @@ __db_fchk(dbenv, name, flags, ok_flags)
  * __db_fcchk --
  *	General combination flags checking routine.
  *
- * PUBLIC: int __db_fcchk
- * PUBLIC:    __P((DB_ENV *, const char *, u_int32_t, u_int32_t, u_int32_t));
+ * PUBLIC: gint __db_fcchk
+ * PUBLIC:    __P((DB_ENV *, const gchar *, u_int32_t, u_int32_t, u_int32_t));
  */
-int
+gint
 __db_fcchk(dbenv, name, flags, flag1, flag2)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 	u_int32_t flags, flag1, flag2;
 {
 	return (LF_ISSET(flag1) &&
@@ -63,13 +63,13 @@ __db_fcchk(dbenv, name, flags, flag1, flag2)
  * __db_ferr --
  *	Common flag errors.
  *
- * PUBLIC: int __db_ferr __P((const DB_ENV *, const char *, int));
+ * PUBLIC: gint __db_ferr __P((const DB_ENV *, const gchar *, int));
  */
-int
+gint
 __db_ferr(dbenv, name, iscombo)
 	const DB_ENV *dbenv;
-	const char *name;
-	int iscombo;
+	const gchar *name;
+	gint iscombo;
 {
 	__db_err(dbenv, "illegal flag %sspecified to %s",
 	    iscombo ? "combination " : "", name);
@@ -86,7 +86,7 @@ void
 __db_pgerr(dbp, pgno, errval)
 	DB *dbp;
 	db_pgno_t pgno;
-	int errval;
+	gint errval;
 {
 	/*
 	 * Three things are certain:
@@ -102,9 +102,9 @@ __db_pgerr(dbp, pgno, errval)
  * __db_pgfmt --
  *	Error when a page has the wrong format.
  *
- * PUBLIC: int __db_pgfmt __P((DB_ENV *, db_pgno_t));
+ * PUBLIC: gint __db_pgfmt __P((DB_ENV *, db_pgno_t));
  */
-int
+gint
 __db_pgfmt(dbenv, pgno)
 	DB_ENV *dbenv;
 	db_pgno_t pgno;
@@ -117,9 +117,9 @@ __db_pgfmt(dbenv, pgno)
  * __db_eopnotsup --
  *	Common operation not supported message.
  *
- * PUBLIC: int __db_eopnotsup __P((const DB_ENV *));
+ * PUBLIC: gint __db_eopnotsup __P((const DB_ENV *));
  */
-int
+gint
 __db_eopnotsup(dbenv)
 	const DB_ENV *dbenv;
 {
@@ -137,13 +137,13 @@ __db_eopnotsup(dbenv)
  *	Error when an assertion fails.  Only checked if #DIAGNOSTIC defined.
  *
  * PUBLIC: #ifdef DIAGNOSTIC
- * PUBLIC: void __db_assert __P((const char *, const char *, int));
+ * PUBLIC: void __db_assert __P((const gchar *, const gchar *, int));
  * PUBLIC: #endif
  */
 void
 __db_assert(failedexpr, file, line)
-	const char *failedexpr, *file;
-	int line;
+	const gchar *failedexpr, *file;
+	gint line;
 {
 	(void)fprintf(stderr,
 	    "__db_assert: \"%s\" failed: file \"%s\", line %d\n",
@@ -161,9 +161,9 @@ __db_assert(failedexpr, file, line)
  * __db_panic_msg --
  *	Just report that someone else paniced.
  *
- * PUBLIC: int __db_panic_msg __P((DB_ENV *));
+ * PUBLIC: gint __db_panic_msg __P((DB_ENV *));
  */
-int
+gint
 __db_panic_msg(dbenv)
 	DB_ENV *dbenv;
 {
@@ -175,12 +175,12 @@ __db_panic_msg(dbenv)
  * __db_panic --
  *	Lock out the tree due to unrecoverable error.
  *
- * PUBLIC: int __db_panic __P((DB_ENV *, int));
+ * PUBLIC: gint __db_panic __P((DB_ENV *, int));
  */
-int
+gint
 __db_panic(dbenv, errval)
 	DB_ENV *dbenv;
-	int errval;
+	gint errval;
 {
 	if (dbenv != NULL) {
 		PANIC_SET(dbenv, 1);
@@ -216,11 +216,11 @@ __db_panic(dbenv, errval)
  * db_strerror --
  *	ANSI C strerror(3) for DB.
  *
- * EXTERN: char *db_strerror __P((int));
+ * EXTERN: gchar *db_strerror __P((int));
  */
-char *
+gchar *
 db_strerror(error)
-	int error;
+	gint error;
 {
 	if (error == 0)
 		return ("Successful return: 0");
@@ -285,7 +285,7 @@ db_strerror(error)
 		 * if we're given an unknown error, which should never happen.
 		 * Note, however, we're no longer thread-safe if it does.
 		 */
-		static char ebuf[40];
+		static gchar ebuf[40];
 
 		(void)snprintf(ebuf, sizeof(ebuf), "Unknown error: %d", error);
 		return (ebuf);
@@ -298,15 +298,15 @@ db_strerror(error)
  *	Standard DB error routine.  The same as errx, except we don't write
  *	to stderr if no output mechanism was specified.
  *
- * PUBLIC: void __db_err __P((const DB_ENV *, const char *, ...));
+ * PUBLIC: void __db_err __P((const DB_ENV *, const gchar *, ...));
  */
 void
 #ifdef __STDC__
-__db_err(const DB_ENV *dbenv, const char *fmt, ...)
+__db_err(const DB_ENV *dbenv, const gchar *fmt, ...)
 #else
 __db_err(dbenv, fmt, va_alist)
 	const DB_ENV *dbenv;
-	const char *fmt;
+	const gchar *fmt;
 	va_dcl
 #endif
 {
@@ -318,17 +318,17 @@ __db_err(dbenv, fmt, va_alist)
  *	Do the error message work for callback functions.
  *
  * PUBLIC: void __db_errcall
- * PUBLIC:          __P((const DB_ENV *, int, int, const char *, va_list));
+ * PUBLIC:          __P((const DB_ENV *, int, int, const gchar *, va_list));
  */
 void
 __db_errcall(dbenv, error, error_set, fmt, ap)
 	const DB_ENV *dbenv;
-	int error, error_set;
-	const char *fmt;
+	gint error, error_set;
+	const gchar *fmt;
 	va_list ap;
 {
-	char *p;
-	char errbuf[2048];	/* !!!: END OF THE STACK DON'T TRUST SPRINTF. */
+	gchar *p;
+	gchar errbuf[2048];	/* !!!: END OF THE STACK DON'T TRUST SPRINTF. */
 
 	p = errbuf;
 	if (fmt != NULL)
@@ -363,13 +363,13 @@ __db_errcall(dbenv, error, error_set, fmt, ap)
  *	Do the error message work for FILE *s.
  *
  * PUBLIC: void __db_errfile
- * PUBLIC:          __P((const DB_ENV *, int, int, const char *, va_list));
+ * PUBLIC:          __P((const DB_ENV *, int, int, const gchar *, va_list));
  */
 void
 __db_errfile(dbenv, error, error_set, fmt, ap)
 	const DB_ENV *dbenv;
-	int error, error_set;
-	const char *fmt;
+	gint error, error_set;
+	const gchar *fmt;
 	va_list ap;
 {
 	FILE *fp;
@@ -395,17 +395,17 @@ __db_errfile(dbenv, error, error_set, fmt, ap)
  *	Write information into the DB log.
  *
  * PUBLIC: void __db_logmsg __P((const DB_ENV *,
- * PUBLIC:     DB_TXN *, const char *, u_int32_t, const char *, ...));
+ * PUBLIC:     DB_TXN *, const gchar *, u_int32_t, const gchar *, ...));
  */
 void
 #ifdef __STDC__
 __db_logmsg(const DB_ENV *dbenv,
-    DB_TXN *txnid, const char *opname, u_int32_t flags, const char *fmt, ...)
+    DB_TXN *txnid, const gchar *opname, u_int32_t flags, const gchar *fmt, ...)
 #else
 __db_logmsg(dbenv, txnid, opname, flags, fmt, va_alist)
 	const DB_ENV *dbenv;
 	DB_TXN *txnid;
-	const char *opname, *fmt;
+	const gchar *opname, *fmt;
 	u_int32_t flags;
 	va_dcl
 #endif
@@ -413,7 +413,7 @@ __db_logmsg(dbenv, txnid, opname, flags, fmt, va_alist)
 	DBT opdbt, msgdbt;
 	DB_LSN lsn;
 	va_list ap;
-	char __logbuf[2048];	/* !!!: END OF THE STACK DON'T TRUST SPRINTF. */
+	gchar __logbuf[2048];	/* !!!: END OF THE STACK DON'T TRUST SPRINTF. */
 
 	if (!LOGGING_ON(dbenv))
 		return;
@@ -424,7 +424,7 @@ __db_logmsg(dbenv, txnid, opname, flags, fmt, va_alist)
 	va_start(ap);
 #endif
 	memset(&opdbt, 0, sizeof(opdbt));
-	opdbt.data = (void *)opname;
+	opdbt.data = (gpointer)opname;
 	opdbt.size = (u_int32_t)(strlen(opname) + 1);
 
 	memset(&msgdbt, 0, sizeof(msgdbt));
@@ -445,12 +445,12 @@ __db_logmsg(dbenv, txnid, opname, flags, fmt, va_alist)
 /*
  * __db_unknown_flag -- report internal error
  *
- * PUBLIC: int __db_unknown_flag __P((DB_ENV *, char *, u_int32_t));
+ * PUBLIC: gint __db_unknown_flag __P((DB_ENV *, gchar *, u_int32_t));
  */
-int
+gint
 __db_unknown_flag(dbenv, routine, flag)
 	DB_ENV *dbenv;
-	char *routine;
+	gchar *routine;
 	u_int32_t flag;
 {
 	__db_err(dbenv, "%s: Unknown flag: 0x%x", routine, flag);
@@ -461,12 +461,12 @@ __db_unknown_flag(dbenv, routine, flag)
 /*
  * __db_unknown_type -- report internal error
  *
- * PUBLIC: int __db_unknown_type __P((DB_ENV *, char *, DBTYPE));
+ * PUBLIC: gint __db_unknown_type __P((DB_ENV *, gchar *, DBTYPE));
  */
-int
+gint
 __db_unknown_type(dbenv, routine, type)
 	DB_ENV *dbenv;
-	char *routine;
+	gchar *routine;
 	DBTYPE type;
 {
 	__db_err(dbenv, "%s: Unknown db type: 0x%x", routine, type);
@@ -478,14 +478,14 @@ __db_unknown_type(dbenv, routine, type)
  * __db_check_txn --
  *	Check for common transaction errors.
  *
- * PUBLIC: int __db_check_txn __P((DB *, DB_TXN *, u_int32_t, int));
+ * PUBLIC: gint __db_check_txn __P((DB *, DB_TXN *, u_int32_t, int));
  */
-int
+gint
 __db_check_txn(dbp, txn, assoc_lid, read_op)
 	DB *dbp;
 	DB_TXN *txn;
 	u_int32_t assoc_lid;
-	int read_op;
+	gint read_op;
 {
 	DB_ENV *dbenv;
 
@@ -568,9 +568,9 @@ open_err:
  * __db_not_txn_env --
  *	DB handle must be in an environment that supports transactions.
  *
- * PUBLIC: int __db_not_txn_env __P((DB_ENV *));
+ * PUBLIC: gint __db_not_txn_env __P((DB_ENV *));
  */
-int
+gint
 __db_not_txn_env(dbenv)
 	DB_ENV *dbenv;
 {
diff --git a/libdb/common/db_getlong.c b/libdb/common/db_getlong.c
index b298ecb..6c87f80 100644
--- a/libdb/common/db_getlong.c
+++ b/libdb/common/db_getlong.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,18 +25,18 @@ static const char revid[] = "$Id$";
  * __db_getlong --
  *	Return a long value inside of basic parameters.
  *
- * PUBLIC: int __db_getlong
- * PUBLIC:     __P((DB *, const char *, char *, long, long, long *));
+ * PUBLIC: gint __db_getlong
+ * PUBLIC:     __P((DB *, const gchar *, gchar *, long, long, long *));
  */
-int
+gint
 __db_getlong(dbp, progname, p, min, max, storep)
 	DB *dbp;
-	const char *progname;
-	char *p;
+	const gchar *progname;
+	gchar *p;
 	long min, max, *storep;
 {
 	long val;
-	char *end;
+	gchar *end;
 
 	__os_set_errno(0);
 	val = strtol(p, &end, 10);
@@ -85,14 +85,14 @@ __db_getlong(dbp, progname, p, min, max, storep)
  * __db_getulong --
  *	Return an unsigned long value inside of basic parameters.
  *
- * PUBLIC: int __db_getulong
- * PUBLIC:     __P((DB *, const char *, char *, u_long, u_long, u_long *));
+ * PUBLIC: gint __db_getulong
+ * PUBLIC:     __P((DB *, const gchar *, gchar *, u_long, u_long, u_long *));
  */
-int
+gint
 __db_getulong(dbp, progname, p, min, max, storep)
 	DB *dbp;
-	const char *progname;
-	char *p;
+	const gchar *progname;
+	gchar *p;
 	u_long min, max, *storep;
 {
 #if !defined(HAVE_STRTOUL)
@@ -101,7 +101,7 @@ __db_getulong(dbp, progname, p, min, max, storep)
 	return (__db_getlong(dbp, progname, p, 0, max, (long *)storep));
 #else
 	u_long val;
-	char *end;
+	gchar *end;
 
 	__os_set_errno(0);
 	val = strtoul(p, &end, 10);
diff --git a/libdb/common/db_idspace.c b/libdb/common/db_idspace.c
index 1d60fee..04e29d6 100644
--- a/libdb/common/db_idspace.c
+++ b/libdb/common/db_idspace.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -19,12 +19,12 @@ static const char revid[] = "$Id$";
 
 #include "db_int.h"
 
-static int __db_idcmp __P((const void *, const void *));
+static gint __db_idcmp __P((gconstpointer , gconstpointer ));
 
 static int
 __db_idcmp(a, b)
-	const void *a;
-	const void *b;
+	gconstpointer a;
+	gconstpointer b;
 {
 	u_int32_t i, j;
 
@@ -51,10 +51,10 @@ __db_idcmp(a, b)
 void
 __db_idspace(inuse, n, minp, maxp)
 	u_int32_t *inuse;
-	int n;
+	gint n;
 	u_int32_t *minp, *maxp;
 {
-	int i, low;
+	gint i, low;
 	u_int32_t gap, t;
 
 	/* A single locker ID is a special case. */
diff --git a/libdb/common/db_log2.c b/libdb/common/db_log2.c
index fd43cad..28fb74d 100644
--- a/libdb/common/db_log2.c
+++ b/libdb/common/db_log2.c
@@ -39,7 +39,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
diff --git a/libdb/common/util_arg.c b/libdb/common/util_arg.c
index c0a24ee..7a64880 100644
--- a/libdb/common/util_arg.c
+++ b/libdb/common/util_arg.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -17,25 +17,25 @@ static const char revid[] = "$Id$";
 
 #include "db_int.h"
 
-static char *__db_strsep __P((char **, const char *));
+static gchar *__db_strsep __P((gchar **, const gchar *));
 
 /*
  * __db_util_arg --
  *	Convert a string into an argc/argv pair.
  *
- * PUBLIC: int __db_util_arg __P((char *, char *, int *, char ***));
+ * PUBLIC: gint __db_util_arg __P((gchar *, gchar *, gint *, gchar ***));
  */
-int
+gint
 __db_util_arg(arg0, str, argcp, argvp)
-	char *arg0, *str, ***argvp;
-	int *argcp;
+	gchar *arg0, *str, ***argvp;
+	gint *argcp;
 {
-	int n, ret;
-	char **ap, **argv;
+	gint n, ret;
+	gchar **ap, **argv;
 
 #define	MAXARGS	25
 	if ((ret =
-	    __os_malloc(NULL, (MAXARGS + 1) * sizeof(char **), &argv)) != 0)
+	    __os_malloc(NULL, (MAXARGS + 1) * sizeof(gchar **), &argv)) != 0)
 		return (ret);
 
 	ap = argv;
@@ -97,14 +97,14 @@ __db_util_arg(arg0, str, argcp, argvp)
  *
  * If *stringp is NULL, strsep returns NULL.
  */
-static char *
+static gchar *
 __db_strsep(stringp, delim)
-	char **stringp;
-	const char *delim;
+	gchar **stringp;
+	const gchar *delim;
 {
-	const char *spanp;
-	int c, sc;
-	char *s, *tok;
+	const gchar *spanp;
+	gint c, sc;
+	gchar *s, *tok;
 
 	if ((s = *stringp) == NULL)
 		return (NULL);
diff --git a/libdb/common/util_cache.c b/libdb/common/util_cache.c
index b7954fc..6264da2 100644
--- a/libdb/common/util_cache.c
+++ b/libdb/common/util_cache.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,22 +26,22 @@ static const char revid[] = "$Id$";
  * __db_util_cache --
  *	Compute if we have enough cache.
  *
- * PUBLIC: int __db_util_cache __P((DB_ENV *, DB *, u_int32_t *, int *));
+ * PUBLIC: gint __db_util_cache __P((DB_ENV *, DB *, u_int32_t *, gint *));
  */
-int
+gint
 __db_util_cache(dbenv, dbp, cachep, resizep)
 	DB_ENV *dbenv;
 	DB *dbp;
 	u_int32_t *cachep;
-	int *resizep;
+	gint *resizep;
 {
 	DBTYPE type;
 	DB_BTREE_STAT *bsp;
 	DB_HASH_STAT *hsp;
 	DB_QUEUE_STAT *qsp;
 	u_int32_t pgsize;
-	int ret;
-	void *sp;
+	gint ret;
+	gpointer sp;
 
 	/*
 	 * The current cache size is in cachep.  If it's insufficient, set the
diff --git a/libdb/common/util_log.c b/libdb/common/util_log.c
index 457505c..078e7ad 100644
--- a/libdb/common/util_log.c
+++ b/libdb/common/util_log.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -36,12 +36,12 @@ static const char revid[] = "$Id$";
  * __db_util_logset --
  *	Log that we're running.
  *
- * PUBLIC: int __db_util_logset __P((const char *, char *));
+ * PUBLIC: gint __db_util_logset __P((const gchar *, gchar *));
  */
-int
+gint
 __db_util_logset(progname, fname)
-	const char *progname;
-	char *fname;
+	const gchar *progname;
+	gchar *fname;
 {
 	FILE *fp;
 	time_t now;
diff --git a/libdb/common/util_sig.c b/libdb/common/util_sig.c
index b286cdc..7779954 100644
--- a/libdb/common/util_sig.c
+++ b/libdb/common/util_sig.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -28,7 +28,7 @@ static void	onint __P((int));
  */
 static void
 onint(signo)
-	int signo;
+	gint signo;
 {
 	if ((interrupt = signo) == 0)
 		interrupt = SIGINT;
@@ -61,9 +61,9 @@ __db_util_siginit()
  * __db_util_interrupted --
  *	Return if interrupted.
  *
- * PUBLIC: int __db_util_interrupted __P((void));
+ * PUBLIC: gint __db_util_interrupted __P((void));
  */
-int
+gint
 __db_util_interrupted()
 {
 	return (interrupt != 0);
diff --git a/libdb/db/crdel_auto.c b/libdb/db/crdel_auto.c
index ba2e95d..cee8e9f 100644
--- a/libdb/db/crdel_auto.c
+++ b/libdb/db/crdel_auto.c
@@ -18,10 +18,10 @@
 #include "dbinc/txn.h"
 
 /*
- * PUBLIC: int __crdel_metasub_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __crdel_metasub_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
  */
-int
+gint
 __crdel_metasub_log(dbp, txnid, ret_lsnp, flags, pgno, page, lsn)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -37,7 +37,7 @@ __crdel_metasub_log(dbp, txnid, ret_lsnp, flags, pgno, page, lsn)
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -131,16 +131,16 @@ __crdel_metasub_log(dbp, txnid, ret_lsnp, flags, pgno, page, lsn)
 }
 
 /*
- * PUBLIC: int __crdel_metasub_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __crdel_metasub_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __crdel_metasub_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -177,21 +177,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __crdel_metasub_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__crdel_metasub_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -222,19 +222,19 @@ __crdel_metasub_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __crdel_metasub_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __crdel_metasub_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __crdel_metasub_args **));
  */
-int
+gint
 __crdel_metasub_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__crdel_metasub_args **argpp;
 {
 	__crdel_metasub_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__crdel_metasub_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -274,16 +274,16 @@ __crdel_metasub_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __crdel_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __crdel_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __crdel_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __crdel_metasub_print, DB___crdel_metasub)) != 0)
@@ -292,17 +292,17 @@ __crdel_init_print(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __crdel_init_getpgnos __P((DB_ENV *,
- * PUBLIC:     int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *),
+ * PUBLIC: gint __crdel_init_getpgnos __P((DB_ENV *,
+ * PUBLIC:     gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ),
  * PUBLIC:     size_t *));
  */
-int
+gint
 __crdel_init_getpgnos(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __crdel_metasub_getpgnos, DB___crdel_metasub)) != 0)
@@ -311,16 +311,16 @@ __crdel_init_getpgnos(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __crdel_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __crdel_init_recover __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __crdel_init_recover(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __crdel_metasub_recover, DB___crdel_metasub)) != 0)
diff --git a/libdb/db/crdel_rec.c b/libdb/db/crdel_rec.c
index e17e9a2..7a63265 100644
--- a/libdb/db/crdel_rec.c
+++ b/libdb/db/crdel_rec.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,23 +26,23 @@ static const char revid[] = "$Id$";
  * __crdel_metasub_recover --
  *	Recovery function for metasub.
  *
- * PUBLIC: int __crdel_metasub_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __crdel_metasub_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __crdel_metasub_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__crdel_metasub_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp_p, modified, ret;
+	gint cmp_p, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
diff --git a/libdb/db/db.c b/libdb/db/db.c
index a76f660..3a4bef0 100644
--- a/libdb/db/db.c
+++ b/libdb/db/db.c
@@ -40,7 +40,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -64,11 +64,11 @@ static const char revid[] = "$Id$";
 #include "dbinc/qam.h"
 #include "dbinc/txn.h"
 
-static int __db_disassociate __P((DB *));
+static gint __db_disassociate __P((DB *));
 #if CONFIG_TEST
-static void __db_makecopy __P((const char *, const char *));
-static int  __db_testdocopy __P((DB_ENV *, const char *));
-static int  __qam_testdocopy __P((DB *, const char *));
+static void __db_makecopy __P((const gchar *, const gchar *));
+static gint  __db_testdocopy __P((DB_ENV *, const gchar *));
+static gint  __qam_testdocopy __P((DB *, const gchar *));
 #endif
 
 /*
@@ -80,20 +80,20 @@ static int  __qam_testdocopy __P((DB *, const char *));
  * __db_master_open --
  *	Open up a handle on a master database.
  *
- * PUBLIC: int __db_master_open __P((DB *,
- * PUBLIC:     DB_TXN *, const char *, u_int32_t, int, DB **));
+ * PUBLIC: gint __db_master_open __P((DB *,
+ * PUBLIC:     DB_TXN *, const gchar *, u_int32_t, int, DB **));
  */
-int
+gint
 __db_master_open(subdbp, txn, name, flags, mode, dbpp)
 	DB *subdbp;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 	DB **dbpp;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 
 	/* Open up a handle on the main database. */
 	if ((ret = db_create(&dbp, subdbp->dbenv, 0)) != 0)
@@ -153,17 +153,17 @@ err:
  * __db_master_update --
  *	Add/Open/Remove a subdatabase from a master database.
  *
- * PUBLIC: int __db_master_update __P((DB *, DB *, DB_TXN *, const char *,
- * PUBLIC:     DBTYPE, mu_action, const char *, u_int32_t));
+ * PUBLIC: gint __db_master_update __P((DB *, DB *, DB_TXN *, const gchar *,
+ * PUBLIC:     DBTYPE, mu_action, const gchar *, u_int32_t));
  */
-int
+gint
 __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 	DB *mdbp, *sdbp;
 	DB_TXN *txn;
-	const char *subdb;
+	const gchar *subdb;
 	DBTYPE type;
 	mu_action action;
-	const char *newname;
+	const gchar *newname;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
@@ -171,7 +171,7 @@ __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 	DBT key, data, ndata;
 	PAGE *p;
 	db_pgno_t t_pgno;
-	int modify, ret, t_ret;
+	gint modify, ret, t_ret;
 
 	dbenv = mdbp->dbenv;
 	dbc = ndbc = NULL;
@@ -204,7 +204,7 @@ __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 	 * !!!
 	 * We don't include the name's nul termination in the database.
 	 */
-	key.data = (void *)subdb;
+	key.data = (gpointer)subdb;
 	key.size = (u_int32_t)strlen(subdb);
 	F_SET(&data, DB_DBT_MALLOC);
 
@@ -267,7 +267,7 @@ __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
 		if ((ret = mdbp->cursor(mdbp, txn, &ndbc, 0)) != 0)
 			goto err;
 		DB_ASSERT(newname != NULL);
-		key.data = (void *)newname;
+		key.data = (gpointer)newname;
 		key.size = (u_int32_t)strlen(newname);
 
 		/*
@@ -400,14 +400,14 @@ done:	/*
  * __db_dbenv_setup --
  *	Set up the underlying environment during a db_open.
  *
- * PUBLIC: int __db_dbenv_setup __P((DB *,
- * PUBLIC:     DB_TXN *, const char *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __db_dbenv_setup __P((DB *,
+ * PUBLIC:     DB_TXN *, const gchar *, u_int32_t, u_int32_t));
  */
-int
+gint
 __db_dbenv_setup(dbp, txn, name, id, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	u_int32_t id;
 	u_int32_t flags;
 {
@@ -418,7 +418,7 @@ __db_dbenv_setup(dbp, txn, name, id, flags)
 	DB_MPOOLFILE *mpf;
 	DB_PGINFO pginfo;
 	u_int32_t maxid;
-	int ftype, ret;
+	gint ftype, ret;
 
 	dbenv = dbp->dbenv;
 
@@ -601,9 +601,9 @@ __db_dbenv_setup(dbp, txn, name, id, flags)
  * __db_close --
  *	DB destructor.
  *
- * PUBLIC: int __db_close __P((DB *, u_int32_t));
+ * PUBLIC: gint __db_close __P((DB *, u_int32_t));
  */
-int
+gint
 __db_close(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
@@ -625,16 +625,16 @@ __db_close(dbp, flags)
  * __db_close_i --
  *	Internal DB destructor.
  *
- * PUBLIC: int __db_close_i __P((DB *, DB_TXN *, u_int32_t));
+ * PUBLIC: gint __db_close_i __P((DB *, DB_TXN *, u_int32_t));
  */
-int
+gint
 __db_close_i(dbp, txn, flags)
 	DB *dbp;
 	DB_TXN *txn;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbenv = dbp->dbenv;
 	ret = 0;
@@ -689,9 +689,9 @@ __db_close_i(dbp, txn, flags)
  * the actual handle) and during abort processing, we may have a
  * fully opened handle.
  *
- * PUBLIC: int __db_refresh __P((DB *, DB_TXN *, u_int32_t));
+ * PUBLIC: gint __db_refresh __P((DB *, DB_TXN *, u_int32_t));
  */
-int
+gint
 __db_refresh(dbp, txn, flags)
 	DB *dbp;
 	DB_TXN *txn;
@@ -702,7 +702,7 @@ __db_refresh(dbp, txn, flags)
 	DB_ENV *dbenv;
 	DB_LOCKREQ lreq;
 	DB_MPOOL *dbmp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 
@@ -913,9 +913,9 @@ never_opened:
  * __db_log_page
  *	Log a meta-data or root page during a subdatabase create operation.
  *
- * PUBLIC: int __db_log_page __P((DB *, DB_TXN *, DB_LSN *, db_pgno_t, PAGE *));
+ * PUBLIC: gint __db_log_page __P((DB *, DB_TXN *, DB_LSN *, db_pgno_t, PAGE *));
  */
-int
+gint
 __db_log_page(dbp, txn, lsn, pgno, page)
 	DB *dbp;
 	DB_TXN *txn;
@@ -925,7 +925,7 @@ __db_log_page(dbp, txn, lsn, pgno, page)
 {
 	DBT page_dbt;
 	DB_LSN new_lsn;
-	int ret;
+	gint ret;
 
 	if (!LOGGING_ON(dbp->dbenv) || txn == NULL)
 		return (0);
@@ -945,8 +945,8 @@ __db_log_page(dbp, txn, lsn, pgno, page)
  * __db_backup_name
  *	Create the backup file name for a given file.
  *
- * PUBLIC: int __db_backup_name __P((DB_ENV *,
- * PUBLIC:     const char *, DB_TXN *, char **));
+ * PUBLIC: gint __db_backup_name __P((DB_ENV *,
+ * PUBLIC:     const gchar *, DB_TXN *, gchar **));
  */
 #undef	BACKUP_PREFIX
 #define	BACKUP_PREFIX	"__db."
@@ -954,17 +954,17 @@ __db_log_page(dbp, txn, lsn, pgno, page)
 #undef	MAX_LSN_TO_TEXT
 #define	MAX_LSN_TO_TEXT	17
 
-int
+gint
 __db_backup_name(dbenv, name, txn, backup)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 	DB_TXN *txn;
-	char **backup;
+	gchar **backup;
 {
 	DB_LSN lsn;
 	size_t len;
-	int plen, ret;
-	char *p, *retp;
+	gint plen, ret;
+	gchar *p, *retp;
 
 	/*
 	 * Create the name.  Backup file names are in one of two forms:
@@ -1066,7 +1066,7 @@ __db_disassociate(sdbp)
 	DB *sdbp;
 {
 	DBC *dbc;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 
@@ -1102,14 +1102,14 @@ __db_disassociate(sdbp)
  *	Create a copy of all backup files and our "main" DB.
  *
  * PUBLIC: #if CONFIG_TEST
- * PUBLIC: int __db_testcopy __P((DB_ENV *, DB *, const char *));
+ * PUBLIC: gint __db_testcopy __P((DB_ENV *, DB *, const gchar *));
  * PUBLIC: #endif
  */
-int
+gint
 __db_testcopy(dbenv, dbp, name)
 	DB_ENV *dbenv;
 	DB *dbp;
-	const char *name;
+	const gchar *name;
 {
 	DB_MPOOLFILE *mpf;
 
@@ -1129,11 +1129,11 @@ __db_testcopy(dbenv, dbp, name)
 static int
 __qam_testdocopy(dbp, name)
 	DB *dbp;
-	const char *name;
+	const gchar *name;
 {
 	QUEUE_FILELIST *filelist, *fp;
-	char buf[256], *dir;
-	int ret;
+	gchar buf[256], *dir;
+	gint ret;
 
 	filelist = NULL;
 	if ((ret = __db_testdocopy(dbp->dbenv, name)) != 0)
@@ -1164,11 +1164,11 @@ __qam_testdocopy(dbp, name)
 static int
 __db_testdocopy(dbenv, name)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 {
 	size_t len;
-	int dircnt, i, ret;
-	char **namesp, *backup, *copy, *dir, *p, *real_name;
+	gint dircnt, i, ret;
+	gchar **namesp, *backup, *copy, *dir, *p, *real_name;
 	real_name = NULL;
 	/* Get the real backing file name. */
 	if ((ret = __db_appname(dbenv,
@@ -1275,11 +1275,11 @@ out:
 
 static void
 __db_makecopy(src, dest)
-	const char *src, *dest;
+	const gchar *src, *dest;
 {
 	DB_FH rfh, wfh;
 	size_t rcnt, wcnt;
-	char *buf;
+	gchar *buf;
 
 	memset(&rfh, 0, sizeof(rfh));
 	memset(&wfh, 0, sizeof(wfh));
diff --git a/libdb/db/db_am.c b/libdb/db/db_am.c
index 3f74ff1..b385cea 100644
--- a/libdb/db/db_am.c
+++ b/libdb/db/db_am.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,21 +27,21 @@ static const char revid[] = "$Id$";
 #include "dbinc/mp.h"
 #include "dbinc/qam.h"
 
-static int __db_append_primary __P((DBC *, DBT *, DBT *));
-static int __db_secondary_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-static int __db_secondary_close __P((DB *, u_int32_t));
+static gint __db_append_primary __P((DBC *, DBT *, DBT *));
+static gint __db_secondary_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+static gint __db_secondary_close __P((DB *, u_int32_t));
 
 #ifdef DEBUG
-static int __db_cprint_item __P((DBC *));
+static gint __db_cprint_item __P((DBC *));
 #endif
 
 /*
  * __db_cursor --
  *	Allocate and return a cursor.
  *
- * PUBLIC: int __db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
+ * PUBLIC: gint __db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
  */
-int
+gint
 __db_cursor(dbp, txn, dbcp, flags)
 	DB *dbp;
 	DB_TXN *txn;
@@ -52,7 +52,7 @@ __db_cursor(dbp, txn, dbcp, flags)
 	DBC *dbc;
 	db_lockmode_t mode;
 	u_int32_t op;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -109,23 +109,23 @@ __db_cursor(dbp, txn, dbcp, flags)
  *	non-NULL it is assumed to point to an area to
  *	initialize as a cursor.
  *
- * PUBLIC: int __db_icursor
+ * PUBLIC: gint __db_icursor
  * PUBLIC:     __P((DB *, DB_TXN *, DBTYPE, db_pgno_t, int, u_int32_t, DBC **));
  */
-int
+gint
 __db_icursor(dbp, txn, dbtype, root, is_opd, lockerid, dbcp)
 	DB *dbp;
 	DB_TXN *txn;
 	DBTYPE dbtype;
 	db_pgno_t root;
-	int is_opd;
+	gint is_opd;
 	u_int32_t lockerid;
 	DBC **dbcp;
 {
 	DBC *dbc, *adbc;
 	DBC_INTERNAL *cp;
 	DB_ENV *dbenv;
-	int allocated, ret;
+	gint allocated, ret;
 
 	dbenv = dbp->dbenv;
 	allocated = 0;
@@ -333,14 +333,14 @@ err:	if (allocated)
  * __db_cprint --
  *	Display the cursor active and free queues.
  *
- * PUBLIC: int __db_cprint __P((DB *));
+ * PUBLIC: gint __db_cprint __P((DB *));
  */
-int
+gint
 __db_cprint(dbp)
 	DB *dbp;
 {
 	DBC *dbc;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 	MUTEX_THREAD_LOCK(dbp->dbenv, dbp->mutexp);
@@ -360,7 +360,7 @@ __db_cprint(dbp)
 }
 
 static
-int __db_cprint_item(dbc)
+gint __db_cprint_item(dbc)
 	DBC *dbc;
 {
 	static const FN fn[] = {
@@ -377,7 +377,7 @@ int __db_cprint_item(dbc)
 	};
 	DB *dbp;
 	DBC_INTERNAL *cp;
-	const char *s;
+	const gchar *s;
 
 	dbp = dbc->dbp;
 	cp = dbc->internal;
@@ -417,15 +417,15 @@ int __db_cprint_item(dbc)
  * db_fd --
  *	Return a file descriptor for flock'ing.
  *
- * PUBLIC: int __db_fd __P((DB *, int *));
+ * PUBLIC: gint __db_fd __P((DB *, gint *));
  */
-int
+gint
 __db_fd(dbp, fdp)
 	DB *dbp;
-	int *fdp;
+	gint *fdp;
 {
 	DB_FH *fhp;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbp->dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->fd");
@@ -451,9 +451,9 @@ __db_fd(dbp, fdp)
  * __db_get --
  *	Return a key/data pair.
  *
- * PUBLIC: int __db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __db_get(dbp, txn, key, data, flags)
 	DB *dbp;
 	DB_TXN *txn;
@@ -461,7 +461,7 @@ __db_get(dbp, txn, key, data, flags)
 	u_int32_t flags;
 {
 	DBC *dbc;
-	int mode, ret, t_ret;
+	gint mode, ret, t_ret;
 
 	PANIC_CHECK(dbp->dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->get");
@@ -514,9 +514,9 @@ __db_get(dbp, txn, key, data, flags)
  * __db_put --
  *	Store a key/data pair.
  *
- * PUBLIC: int __db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __db_put(dbp, txn, key, data, flags)
 	DB *dbp;
 	DB_TXN *txn;
@@ -526,7 +526,7 @@ __db_put(dbp, txn, key, data, flags)
 	DBC *dbc;
 	DBT tdata;
 	DB_ENV *dbenv;
-	int ret, t_ret, txn_local;
+	gint ret, t_ret, txn_local;
 
 	dbc = NULL;
 	dbenv = dbp->dbenv;
@@ -670,9 +670,9 @@ err:	/* Close the cursor. */
  * __db_delete --
  *	Delete the items referenced by a key.
  *
- * PUBLIC: int __db_delete __P((DB *, DB_TXN *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_delete __P((DB *, DB_TXN *, DBT *, u_int32_t));
  */
-int
+gint
 __db_delete(dbp, txn, key, flags)
 	DB *dbp;
 	DB_TXN *txn;
@@ -683,7 +683,7 @@ __db_delete(dbp, txn, key, flags)
 	DBT data, lkey;
 	DB_ENV *dbenv;
 	u_int32_t f_init, f_next;
-	int ret, t_ret, txn_local;
+	gint ret, t_ret, txn_local;
 
 	dbc = NULL;
 	dbenv = dbp->dbenv;
@@ -801,14 +801,14 @@ err:	/* Discard the cursor. */
  * __db_sync --
  *	Flush the database cache.
  *
- * PUBLIC: int __db_sync __P((DB *, u_int32_t));
+ * PUBLIC: gint __db_sync __P((DB *, u_int32_t));
  */
-int
+gint
 __db_sync(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
 {
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	PANIC_CHECK(dbp->dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->sync");
@@ -838,20 +838,20 @@ __db_sync(dbp, flags)
  * __db_associate --
  *	Associate another database as a secondary index to this one.
  *
- * PUBLIC: int __db_associate __P((DB *, DB_TXN *, DB *,
- * PUBLIC:     int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
+ * PUBLIC: gint __db_associate __P((DB *, DB_TXN *, DB *,
+ * PUBLIC:     gint (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
  */
-int
+gint
 __db_associate(dbp, txn, sdbp, callback, flags)
 	DB *dbp, *sdbp;
 	DB_TXN *txn;
-	int (*callback) __P((DB *, const DBT *, const DBT *, DBT *));
+	gint (*callback) __P((DB *, const DBT *, const DBT *, DBT *));
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
 	DBC *pdbc, *sdbc;
 	DBT skey, key, data;
-	int build, ret, t_ret, txn_local;
+	gint build, ret, t_ret, txn_local;
 
 	dbenv = dbp->dbenv;
 
@@ -1031,9 +1031,9 @@ err:	if (pdbc != NULL && (t_ret = pdbc->c_close(pdbc)) != 0 && ret == 0)
  * __db_pget --
  *	Return a primary key/data pair given a secondary key.
  *
- * PUBLIC: int __db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __db_pget(dbp, txn, skey, pkey, data, flags)
 	DB *dbp;
 	DB_TXN *txn;
@@ -1041,7 +1041,7 @@ __db_pget(dbp, txn, skey, pkey, data, flags)
 	u_int32_t flags;
 {
 	DBC *dbc;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	PANIC_CHECK(dbp->dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->pget");
@@ -1111,7 +1111,7 @@ __db_secondary_close(sdbp, flags)
 	u_int32_t flags;
 {
 	DB *primary;
-	int doclose;
+	gint doclose;
 
 	doclose = 0;
 	primary = sdbp->s_primary;
@@ -1154,7 +1154,7 @@ __db_append_primary(dbc, key, data)
 	DB *dbp, *sdbp;
 	DBC *sdbc, *pdbc;
 	DBT oldpkey, pkey, pdata, skey;
-	int cmp, ret, t_ret;
+	gint cmp, ret, t_ret;
 
 	dbp = dbc->dbp;
 	sdbp = NULL;
diff --git a/libdb/db/db_auto.c b/libdb/db/db_auto.c
index 6b43b9c..d9c4cc0 100644
--- a/libdb/db/db_auto.c
+++ b/libdb/db/db_auto.c
@@ -18,11 +18,11 @@
 #include "dbinc/txn.h"
 
 /*
- * PUBLIC: int __db_addrem_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __db_addrem_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, u_int32_t, u_int32_t,
  * PUBLIC:     const DBT *, const DBT *, DB_LSN *));
  */
-int
+gint
 __db_addrem_log(dbp, txnid, ret_lsnp, flags,
     opcode, pgno, indx, nbytes, hdr,
     dbt, pagelsn)
@@ -44,7 +44,7 @@ __db_addrem_log(dbp, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -165,16 +165,16 @@ __db_addrem_log(dbp, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __db_addrem_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_addrem_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_addrem_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -211,21 +211,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_addrem_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_addrem_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -265,18 +265,18 @@ __db_addrem_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_addrem_read __P((DB_ENV *, void *, __db_addrem_args **));
+ * PUBLIC: gint __db_addrem_read __P((DB_ENV *, gpointer , __db_addrem_args **));
  */
-int
+gint
 __db_addrem_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_addrem_args **argpp;
 {
 	__db_addrem_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_addrem_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -334,11 +334,11 @@ __db_addrem_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_big_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __db_big_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, db_pgno_t, db_pgno_t,
  * PUBLIC:     const DBT *, DB_LSN *, DB_LSN *, DB_LSN *));
  */
-int
+gint
 __db_big_log(dbp, txnid, ret_lsnp, flags,
     opcode, pgno, prev_pgno, next_pgno, dbt,
     pagelsn, prevlsn, nextlsn)
@@ -361,7 +361,7 @@ __db_big_log(dbp, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -484,16 +484,16 @@ __db_big_log(dbp, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __db_big_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_big_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_big_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -550,21 +550,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __db_big_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_big_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_big_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_big_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -602,18 +602,18 @@ __db_big_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_big_read __P((DB_ENV *, void *, __db_big_args **));
+ * PUBLIC: gint __db_big_read __P((DB_ENV *, gpointer , __db_big_args **));
  */
-int
+gint
 __db_big_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_big_args **argpp;
 {
 	__db_big_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_big_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -671,10 +671,10 @@ __db_big_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_ovref_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __db_ovref_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, int32_t, DB_LSN *));
  */
-int
+gint
 __db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, adjust, lsn)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -689,7 +689,7 @@ __db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, adjust, lsn)
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -776,16 +776,16 @@ __db_ovref_log(dbp, txnid, ret_lsnp, flags, pgno, adjust, lsn)
 }
 
 /*
- * PUBLIC: int __db_ovref_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_ovref_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_ovref_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -822,19 +822,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_ovref_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_ovref_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -860,18 +860,18 @@ __db_ovref_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_ovref_read __P((DB_ENV *, void *, __db_ovref_args **));
+ * PUBLIC: gint __db_ovref_read __P((DB_ENV *, gpointer , __db_ovref_args **));
  */
-int
+gint
 __db_ovref_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_ovref_args **argpp;
 {
 	__db_ovref_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_ovref_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -909,11 +909,11 @@ __db_ovref_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_relink_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __db_relink_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *,
  * PUBLIC:     db_pgno_t, DB_LSN *));
  */
-int
+gint
 __db_relink_log(dbp, txnid, ret_lsnp, flags,
     opcode, pgno, lsn, prev, lsn_prev,
     next, lsn_next)
@@ -934,7 +934,7 @@ __db_relink_log(dbp, txnid, ret_lsnp, flags,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1045,16 +1045,16 @@ __db_relink_log(dbp, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __db_relink_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_relink_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_relink_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1111,19 +1111,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __db_relink_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_relink_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_relink_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_relink_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1155,18 +1155,18 @@ __db_relink_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_relink_read __P((DB_ENV *, void *, __db_relink_args **));
+ * PUBLIC: gint __db_relink_read __P((DB_ENV *, gpointer , __db_relink_args **));
  */
-int
+gint
 __db_relink_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_relink_args **argpp;
 {
 	__db_relink_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_relink_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1218,11 +1218,11 @@ __db_relink_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, const DBT *, int32_t, const DBT *, const DBT *,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __db_debug_log(dbenv, txnid, ret_lsnp, flags,
     op, fileid, key, data, arg_flags)
 	DB_ENV *dbenv;
@@ -1240,7 +1240,7 @@ __db_debug_log(dbenv, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___db_debug;
@@ -1342,19 +1342,19 @@ __db_debug_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __db_debug_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_debug_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_debug_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -1375,21 +1375,21 @@ __db_debug_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_debug_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_debug_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1430,18 +1430,18 @@ __db_debug_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_debug_read __P((DB_ENV *, void *, __db_debug_args **));
+ * PUBLIC: gint __db_debug_read __P((DB_ENV *, gpointer , __db_debug_args **));
  */
-int
+gint
 __db_debug_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_debug_args **argpp;
 {
 	__db_debug_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_debug_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1490,10 +1490,10 @@ __db_debug_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_noop_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __db_noop_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *));
  */
-int
+gint
 __db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, prevlsn)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -1507,7 +1507,7 @@ __db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, prevlsn)
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1589,16 +1589,16 @@ __db_noop_log(dbp, txnid, ret_lsnp, flags, pgno, prevlsn)
 }
 
 /*
- * PUBLIC: int __db_noop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_noop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_noop_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1635,19 +1635,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __db_noop_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_noop_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_noop_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_noop_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1672,18 +1672,18 @@ __db_noop_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_noop_read __P((DB_ENV *, void *, __db_noop_args **));
+ * PUBLIC: gint __db_noop_read __P((DB_ENV *, gpointer , __db_noop_args **));
  */
-int
+gint
 __db_noop_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_noop_args **argpp;
 {
 	__db_noop_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_noop_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1717,11 +1717,11 @@ __db_noop_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_pg_alloc_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __db_pg_alloc_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, u_int32_t,
  * PUBLIC:     db_pgno_t));
  */
-int
+gint
 __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pgno, ptype,
     next)
 	DB *dbp;
@@ -1740,7 +1740,7 @@ __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pg
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1844,16 +1844,16 @@ __db_pg_alloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pg
 }
 
 /*
- * PUBLIC: int __db_pg_alloc_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_pg_alloc_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_pg_alloc_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1898,19 +1898,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __db_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_pg_alloc_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_pg_alloc_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1940,19 +1940,19 @@ __db_pg_alloc_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_pg_alloc_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __db_pg_alloc_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __db_pg_alloc_args **));
  */
-int
+gint
 __db_pg_alloc_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_pg_alloc_args **argpp;
 {
 	__db_pg_alloc_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_pg_alloc_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2001,11 +2001,11 @@ __db_pg_alloc_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_pg_free_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __db_pg_free_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *,
  * PUBLIC:     db_pgno_t));
  */
-int
+gint
 __db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -2023,7 +2023,7 @@ __db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -2127,16 +2127,16 @@ __db_pg_free_log(dbp, txnid, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header,
 }
 
 /*
- * PUBLIC: int __db_pg_free_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_pg_free_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_pg_free_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -2181,21 +2181,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __db_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_pg_free_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_pg_free_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -2228,18 +2228,18 @@ __db_pg_free_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_pg_free_read __P((DB_ENV *, void *, __db_pg_free_args **));
+ * PUBLIC: gint __db_pg_free_read __P((DB_ENV *, gpointer , __db_pg_free_args **));
  */
-int
+gint
 __db_pg_free_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_pg_free_args **argpp;
 {
 	__db_pg_free_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_pg_free_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2287,9 +2287,9 @@ __db_pg_free_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_cksum_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t));
+ * PUBLIC: gint __db_cksum_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t));
  */
-int
+gint
 __db_cksum_log(dbenv, txnid, ret_lsnp, flags)
 	DB_ENV *dbenv;
 	DB_TXN *txnid;
@@ -2299,7 +2299,7 @@ __db_cksum_log(dbenv, txnid, ret_lsnp, flags)
 	DBT logrec;
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___db_cksum;
@@ -2358,19 +2358,19 @@ __db_cksum_log(dbenv, txnid, ret_lsnp, flags)
 }
 
 /*
- * PUBLIC: int __db_cksum_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_cksum_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_cksum_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -2391,19 +2391,19 @@ __db_cksum_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __db_cksum_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __db_cksum_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __db_cksum_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__db_cksum_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -2424,17 +2424,17 @@ __db_cksum_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __db_cksum_read __P((DB_ENV *, void *, __db_cksum_args **));
+ * PUBLIC: gint __db_cksum_read __P((DB_ENV *, gpointer , __db_cksum_args **));
  */
-int
+gint
 __db_cksum_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__db_cksum_args **argpp;
 {
 	__db_cksum_args *argp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__db_cksum_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2457,16 +2457,16 @@ __db_cksum_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __db_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __db_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __db_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __db_addrem_print, DB___db_addrem)) != 0)
@@ -2499,16 +2499,16 @@ __db_init_print(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __db_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __db_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __db_init_getpgnos(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __db_addrem_getpgnos, DB___db_addrem)) != 0)
@@ -2541,16 +2541,16 @@ __db_init_getpgnos(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __db_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __db_init_recover __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __db_init_recover(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __db_addrem_recover, DB___db_addrem)) != 0)
diff --git a/libdb/db/db_cam.c b/libdb/db/db_cam.c
index 9807b9d..ecf103b 100644
--- a/libdb/db/db_cam.c
+++ b/libdb/db/db_cam.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,11 +26,11 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/qam.h"
 
-static int __db_buildpartial __P((DB *, DBT *, DBT *, DBT *));
-static int __db_c_cleanup __P((DBC *, DBC *, int));
-static int __db_c_del_secondary __P((DBC *));
-static int __db_c_pget_recno __P((DBC *, DBT *, DBT *, u_int32_t));
-static int __db_wrlock_err __P((DB_ENV *));
+static gint __db_buildpartial __P((DB *, DBT *, DBT *, DBT *));
+static gint __db_c_cleanup __P((DBC *, DBC *, int));
+static gint __db_c_del_secondary __P((DBC *));
+static gint __db_c_pget_recno __P((DBC *, DBT *, DBT *, u_int32_t));
+static gint __db_wrlock_err __P((DB_ENV *));
 
 #define	CDB_LOCKING_INIT(dbp, dbc)					\
 	/*								\
@@ -72,9 +72,9 @@ static int __db_wrlock_err __P((DB_ENV *));
  * __db_c_close --
  *	Close the cursor.
  *
- * PUBLIC: int __db_c_close __P((DBC *));
+ * PUBLIC: gint __db_c_close __P((DBC *));
  */
-int
+gint
 __db_c_close(dbc)
 	DBC *dbc;
 {
@@ -82,7 +82,7 @@ __db_c_close(dbc)
 	DBC *opd;
 	DBC_INTERNAL *cp;
 	DB_ENV *dbenv;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -179,15 +179,15 @@ __db_c_close(dbc)
  * __db_c_destroy --
  *	Destroy the cursor, called after DBC->c_close.
  *
- * PUBLIC: int __db_c_destroy __P((DBC *));
+ * PUBLIC: gint __db_c_destroy __P((DBC *));
  */
-int
+gint
 __db_c_destroy(dbc)
 	DBC *dbc;
 {
 	DB *dbp;
 	DB_ENV *dbenv;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -225,16 +225,16 @@ __db_c_destroy(dbc)
  * __db_c_count --
  *	Return a count of duplicate data items.
  *
- * PUBLIC: int __db_c_count __P((DBC *, db_recno_t *, u_int32_t));
+ * PUBLIC: gint __db_c_count __P((DBC *, db_recno_t *, u_int32_t));
  */
-int
+gint
 __db_c_count(dbc, recnop, flags)
 	DBC *dbc;
 	db_recno_t *recnop;
 	u_int32_t flags;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 
 	/*
 	 * Cursor Cleanup Note:
@@ -278,16 +278,16 @@ __db_c_count(dbc, recnop, flags)
  * __db_c_del --
  *	Delete using a cursor.
  *
- * PUBLIC: int __db_c_del __P((DBC *, u_int32_t));
+ * PUBLIC: gint __db_c_del __P((DBC *, u_int32_t));
  */
-int
+gint
 __db_c_del(dbc, flags)
 	DBC *dbc;
 	u_int32_t flags;
 {
 	DB *dbp;
 	DBC *opd;
-	int ret;
+	gint ret;
 
 	/*
 	 * Cursor Cleanup Note:
@@ -355,9 +355,9 @@ done:	CDB_LOCKING_DONE(dbp, dbc);
  * __db_c_dup --
  *	Duplicate a cursor
  *
- * PUBLIC: int __db_c_dup __P((DBC *, DBC **, u_int32_t));
+ * PUBLIC: gint __db_c_dup __P((DBC *, DBC **, u_int32_t));
  */
-int
+gint
 __db_c_dup(dbc_orig, dbcp, flags)
 	DBC *dbc_orig;
 	DBC **dbcp;
@@ -366,7 +366,7 @@ __db_c_dup(dbc_orig, dbcp, flags)
 	DB_ENV *dbenv;
 	DB *dbp;
 	DBC *dbc_n, *dbc_nopd;
-	int ret;
+	gint ret;
 
 	dbp = dbc_orig->dbp;
 	dbenv = dbp->dbenv;
@@ -432,9 +432,9 @@ err:	if (dbc_n != NULL)
  * __db_c_idup --
  *	Internal version of __db_c_dup.
  *
- * PUBLIC: int __db_c_idup __P((DBC *, DBC **, u_int32_t));
+ * PUBLIC: gint __db_c_idup __P((DBC *, DBC **, u_int32_t));
  */
-int
+gint
 __db_c_idup(dbc_orig, dbcp, flags)
 	DBC *dbc_orig, **dbcp;
 	u_int32_t flags;
@@ -442,7 +442,7 @@ __db_c_idup(dbc_orig, dbcp, flags)
 	DB *dbp;
 	DBC *dbc_n;
 	DBC_INTERNAL *int_n, *int_orig;
-	int ret;
+	gint ret;
 
 	dbp = dbc_orig->dbp;
 	dbc_n = *dbcp;
@@ -502,9 +502,9 @@ err:	(void)dbc_n->c_close(dbc_n);
  * __db_c_newopd --
  *	Create a new off-page duplicate cursor.
  *
- * PUBLIC: int __db_c_newopd __P((DBC *, db_pgno_t, DBC *, DBC **));
+ * PUBLIC: gint __db_c_newopd __P((DBC *, db_pgno_t, DBC *, DBC **));
  */
-int
+gint
 __db_c_newopd(dbc_parent, root, oldopd, dbcp)
 	DBC *dbc_parent;
 	db_pgno_t root;
@@ -514,7 +514,7 @@ __db_c_newopd(dbc_parent, root, oldopd, dbcp)
 	DB *dbp;
 	DBC *opd;
 	DBTYPE dbtype;
-	int ret;
+	gint ret;
 
 	dbp = dbc_parent->dbp;
 	dbtype = (dbp->dup_compare == NULL) ? DB_RECNO : DB_BTREE;
@@ -564,9 +564,9 @@ __db_c_newopd(dbc_parent, root, oldopd, dbcp)
  * __db_c_get --
  *	Get using a cursor.
  *
- * PUBLIC: int __db_c_get __P((DBC *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_c_get __P((DBC *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __db_c_get(dbc_arg, key, data, flags)
 	DBC *dbc_arg;
 	DBT *key, *data;
@@ -579,7 +579,7 @@ __db_c_get(dbc_arg, key, data, flags)
 	db_pgno_t pgno;
 	u_int32_t multi, tmp_dirty, tmp_flags, tmp_rmw;
 	u_int8_t type;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	/*
 	 * Cursor Cleanup Note:
@@ -885,9 +885,9 @@ err:	/* Don't pass DB_DBT_ISSET back to application level, error or no. */
  * __db_c_put --
  *	Put using a cursor.
  *
- * PUBLIC: int __db_c_put __P((DBC *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_c_put __P((DBC *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __db_c_put(dbc_arg, key, data, flags)
 	DBC *dbc_arg;
 	DBT *key, *data;
@@ -897,7 +897,7 @@ __db_c_put(dbc_arg, key, data, flags)
 	DBC *dbc_n, *oldopd, *opd, *sdbc, *pdbc;
 	DBT olddata, oldpkey, oldskey, newdata, pkey, save_skey, skey, temp;
 	db_pgno_t pgno;
-	int cmp, have_oldrec, ispartial, nodel, re_pad, ret, rmw, t_ret;
+	gint cmp, have_oldrec, ispartial, nodel, re_pad, ret, rmw, t_ret;
 	u_int32_t re_len, size, tmp_flags;
 
 	/*
@@ -1472,9 +1472,9 @@ err:	/* Cleanup and cursor resolution. */
 /*
  * __db_duperr()
  *	Error message: we don't currently support sorted duplicate duplicates.
- * PUBLIC: int __db_duperr __P((DB *, u_int32_t));
+ * PUBLIC: gint __db_duperr __P((DB *, u_int32_t));
  */
-int
+gint
 __db_duperr(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
@@ -1505,13 +1505,13 @@ __db_duperr(dbp, flags)
 static int
 __db_c_cleanup(dbc, dbc_n, failed)
 	DBC *dbc, *dbc_n;
-	int failed;
+	gint failed;
 {
 	DB *dbp;
 	DBC *opd;
 	DBC_INTERNAL *internal;
 	DB_MPOOLFILE *mpf;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1599,9 +1599,9 @@ __db_c_cleanup(dbc, dbc_n, failed)
  *	This wrapper function for DBC->c_pget() is the DBC->c_get() function
  *	for a secondary index cursor.
  *
- * PUBLIC: int __db_c_secondary_get __P((DBC *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_c_secondary_get __P((DBC *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __db_c_secondary_get(dbc, skey, data, flags)
 	DBC *dbc;
 	DBT *skey, *data;
@@ -1616,9 +1616,9 @@ __db_c_secondary_get(dbc, skey, data, flags)
  * __db_c_pget --
  *	Get a primary key/data pair through a secondary index.
  *
- * PUBLIC: int __db_c_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_c_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __db_c_pget(dbc, skey, pkey, data, flags)
 	DBC *dbc;
 	DBT *skey, *pkey, *data;
@@ -1627,7 +1627,7 @@ __db_c_pget(dbc, skey, pkey, data, flags)
 	DB *pdbp, *sdbp;
 	DBC *pdbc;
 	DBT *save_rdata, nullpkey;
-	int pkeymalloc, ret, save_pkey_flags, t_ret;
+	gint pkeymalloc, ret, save_pkey_flags, t_ret;
 
 	sdbp = dbc->dbp;
 	pdbp = sdbp->s_primary;
@@ -1830,7 +1830,7 @@ __db_c_pget_recno(sdbc, pkey, data, flags)
 	DBT discardme, primary_key;
 	db_recno_t oob;
 	u_int32_t rmw;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	sdbp = sdbc->dbp;
 	pdbp = sdbp->s_primary;
@@ -1933,7 +1933,7 @@ __db_c_del_secondary(dbc)
 	DB *pdbp;
 	DBC *pdbc;
 	DBT skey, pkey;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	memset(&skey, 0, sizeof(DBT));
 	memset(&pkey, 0, sizeof(DBT));
@@ -2002,16 +2002,16 @@ __db_c_del_secondary(dbc)
  *	database, and delete any secondary keys that point at the current
  *	record.
  *
- * PUBLIC: int __db_c_del_primary __P((DBC *));
+ * PUBLIC: gint __db_c_del_primary __P((DBC *));
  */
-int
+gint
 __db_c_del_primary(dbc)
 	DBC *dbc;
 {
 	DB *dbp, *sdbp;
 	DBC *sdbc;
 	DBT data, pkey, skey, temp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 
@@ -2115,14 +2115,14 @@ __db_s_first(pdbp)
  * __db_s_next --
  *	Get the next secondary in the list.
  *
- * PUBLIC: int __db_s_next __P((DB **));
+ * PUBLIC: gint __db_s_next __P((DB **));
  */
-int
+gint
 __db_s_next(sdbpp)
 	DB **sdbpp;
 {
 	DB *sdbp, *pdbp, *closeme;
-	int ret;
+	gint ret;
 
 	/*
 	 * Secondary indices are kept in a linked list, s_secondaries,
@@ -2176,14 +2176,14 @@ __db_s_next(sdbpp)
  *	Properly decrement the refcount on a secondary database handle we're
  *	using, without calling __db_s_next.
  *
- * PUBLIC: int __db_s_done __P((DB *));
+ * PUBLIC: gint __db_s_done __P((DB *));
  */
-int
+gint
 __db_s_done(sdbp)
 	DB *sdbp;
 {
 	DB *pdbp;
-	int doclose;
+	gint doclose;
 
 	pdbp = sdbp->s_primary;
 	doclose = 0;
@@ -2213,7 +2213,7 @@ __db_buildpartial(dbp, oldrec, partial, newrec)
 	DB *dbp;
 	DBT *oldrec, *partial, *newrec;
 {
-	int ret;
+	gint ret;
 	u_int8_t *buf;
 	u_int32_t len, nbytes;
 
diff --git a/libdb/db/db_conv.c b/libdb/db/db_conv.c
index de2710d..c95d373 100644
--- a/libdb/db/db_conv.c
+++ b/libdb/db/db_conv.c
@@ -40,7 +40,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -63,13 +63,13 @@ static const char revid[] = "$Id$";
  * __db_pgin --
  *	Primary page-swap routine.
  *
- * PUBLIC: int __db_pgin __P((DB_ENV *, db_pgno_t, void *, DBT *));
+ * PUBLIC: gint __db_pgin __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
  */
-int
+gint
 __db_pgin(dbenv, pg, pp, cookie)
 	DB_ENV *dbenv;
 	db_pgno_t pg;
-	void *pp;
+	gpointer pp;
 	DBT *cookie;
 {
 	DB dummydb, *dbp;
@@ -78,7 +78,7 @@ __db_pgin(dbenv, pg, pp, cookie)
 	DB_LSN not_used;
 	PAGE *pagep;
 	size_t pg_off, pg_len, sum_len;
-	int is_hmac, ret;
+	gint is_hmac, ret;
 	u_int8_t *chksum, *iv;
 
 	pginfo = (DB_PGINFO *)cookie->data;
@@ -222,13 +222,13 @@ __db_pgin(dbenv, pg, pp, cookie)
  * __db_pgout --
  *	Primary page-swap routine.
  *
- * PUBLIC: int __db_pgout __P((DB_ENV *, db_pgno_t, void *, DBT *));
+ * PUBLIC: gint __db_pgout __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
  */
-int
+gint
 __db_pgout(dbenv, pg, pp, cookie)
 	DB_ENV *dbenv;
 	db_pgno_t pg;
-	void *pp;
+	gpointer pp;
 	DBT *cookie;
 {
 	DB dummydb, *dbp;
@@ -236,7 +236,7 @@ __db_pgout(dbenv, pg, pp, cookie)
 	DB_PGINFO *pginfo;
 	PAGE *pagep;
 	size_t pg_off, pg_len, sum_len;
-	int ret;
+	gint ret;
 	u_int8_t *chksum, *iv, *key;
 
 	pginfo = (DB_PGINFO *)cookie->data;
@@ -368,17 +368,17 @@ __db_metaswap(pg)
  * __db_byteswap --
  *	Byteswap a page.
  *
- * PUBLIC: int __db_byteswap
+ * PUBLIC: gint __db_byteswap
  * PUBLIC:         __P((DB_ENV *, DB *, db_pgno_t, PAGE *, size_t, int));
  */
-int
+gint
 __db_byteswap(dbenv, dbp, pg, h, pagesize, pgin)
 	DB_ENV *dbenv;
 	DB *dbp;
 	db_pgno_t pg;
 	PAGE *h;
 	size_t pagesize;
-	int pgin;
+	gint pgin;
 {
 	BINTERNAL *bi;
 	BKEYDATA *bk;
diff --git a/libdb/db/db_dispatch.c b/libdb/db/db_dispatch.c
index 37d4b1d..40cbebd 100644
--- a/libdb/db/db_dispatch.c
+++ b/libdb/db/db_dispatch.c
@@ -39,7 +39,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -58,17 +58,17 @@ static const char revid[] = "$Id$";
 #include "dbinc/rep.h"
 #include "dbinc/txn.h"
 
-static int __db_limbo_fix __P((DB *,
+static gint __db_limbo_fix __P((DB *,
     DB_TXN *, DB_TXNLIST *, db_pgno_t *, DBMETA *));
-static int __db_limbo_bucket __P((DB_ENV *, DB_TXN *, DB_TXNLIST *));
-static int __db_limbo_move __P((DB_ENV *, DB_TXN *, DB_TXN *, DB_TXNLIST *));
-static int __db_lock_move __P((DB_ENV *,
+static gint __db_limbo_bucket __P((DB_ENV *, DB_TXN *, DB_TXNLIST *));
+static gint __db_limbo_move __P((DB_ENV *, DB_TXN *, DB_TXN *, DB_TXNLIST *));
+static gint __db_lock_move __P((DB_ENV *,
 		u_int8_t *, db_pgno_t, db_lockmode_t, DB_TXN *, DB_TXN *));
-static int __db_default_getpgnos __P((DB_ENV *, DB_LSN *lsnp, void *));
-static int __db_txnlist_find_internal __P((DB_ENV *, void *, db_txnlist_type,
+static gint __db_default_getpgnos __P((DB_ENV *, DB_LSN *lsnp, gpointer ));
+static gint __db_txnlist_find_internal __P((DB_ENV *, gpointer , db_txnlist_type,
 		u_int32_t, u_int8_t [DB_FILE_ID_LEN], DB_TXNLIST **, int));
-static int __db_txnlist_pgnoadd __P((DB_ENV *, DB_TXNHEAD *,
-		int32_t, u_int8_t [DB_FILE_ID_LEN], char *, db_pgno_t));
+static gint __db_txnlist_pgnoadd __P((DB_ENV *, DB_TXNHEAD *,
+		int32_t, u_int8_t [DB_FILE_ID_LEN], gchar *, db_pgno_t));
 
 /*
  * __db_dispatch --
@@ -79,23 +79,23 @@ static int __db_txnlist_pgnoadd __P((DB_ENV *, DB_TXNHEAD *,
  * scripts in the tools directory).  An application using a different
  * recovery paradigm will supply a different dispatch function to txn_open.
  *
- * PUBLIC: int __db_dispatch __P((DB_ENV *,
- * PUBLIC:     int (**)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)),
- * PUBLIC:     size_t, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_dispatch __P((DB_ENV *,
+ * PUBLIC:     gint (**)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer )),
+ * PUBLIC:     size_t, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_dispatch(dbenv, dtab, dtabsize, db, lsnp, redo, info)
 	DB_ENV *dbenv;		/* The environment. */
-	int (**dtab)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (**dtab)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t dtabsize;	/* Size of the dtab. */
 	DBT *db;		/* The log record upon which to dispatch. */
 	DB_LSN *lsnp;		/* The lsn of the record being dispatched. */
 	db_recops redo;		/* Redo this op (or undo it). */
-	void *info;
+	gpointer info;
 {
 	DB_LSN prev_lsn;
 	u_int32_t rectype, txnid;
-	int make_call, ret;
+	gint make_call, ret;
 
 	memcpy(&rectype, db->data, sizeof(rectype));
 	memcpy(&txnid, (u_int8_t *)db->data + sizeof(rectype), sizeof(txnid));
@@ -293,20 +293,20 @@ __db_dispatch(dbenv, dtab, dtabsize, db, lsnp, redo, info)
 /*
  * __db_add_recovery --
  *
- * PUBLIC: int __db_add_recovery __P((DB_ENV *,
- * PUBLIC:   int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *,
- * PUBLIC:   int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), u_int32_t));
+ * PUBLIC: gint __db_add_recovery __P((DB_ENV *,
+ * PUBLIC:   gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *,
+ * PUBLIC:   gint (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), u_int32_t));
  */
-int
+gint
 __db_add_recovery(dbenv, dtab, dtabsize, func, ndx)
 	DB_ENV *dbenv;
-	int (***dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsize;
-	int (*func) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (*func) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	u_int32_t ndx;
 {
 	size_t i, nsize;
-	int ret;
+	gint ret;
 
 	/* Check if we have to grow the table. */
 	if (ndx >= *dtabsize) {
@@ -327,19 +327,19 @@ __db_add_recovery(dbenv, dtab, dtabsize, func, ndx)
  * __db_txnlist_init --
  *	Initialize transaction linked list.
  *
- * PUBLIC: int __db_txnlist_init __P((DB_ENV *,
- * PUBLIC:     u_int32_t, u_int32_t, DB_LSN *, void *));
+ * PUBLIC: gint __db_txnlist_init __P((DB_ENV *,
+ * PUBLIC:     u_int32_t, u_int32_t, DB_LSN *, gpointer ));
  */
-int
+gint
 __db_txnlist_init(dbenv, low_txn, hi_txn, trunc_lsn, retp)
 	DB_ENV *dbenv;
 	u_int32_t low_txn, hi_txn;
 	DB_LSN *trunc_lsn;
-	void *retp;
+	gpointer retp;
 {
 	DB_TXNHEAD *headp;
 	u_int32_t tmp;
-	int ret, size;
+	gint ret, size;
 
 	/*
 	 * Size a hash table.
@@ -389,7 +389,7 @@ __db_txnlist_init(dbenv, low_txn, hi_txn, trunc_lsn, retp)
 	ZERO_LSN(headp->maxlsn);
 	ZERO_LSN(headp->ckplsn);
 
-	*(void **)retp = headp;
+	*(gpointer *)retp = headp;
 	return (0);
 }
 
@@ -397,20 +397,20 @@ __db_txnlist_init(dbenv, low_txn, hi_txn, trunc_lsn, retp)
  * __db_txnlist_add --
  *	Add an element to our transaction linked list.
  *
- * PUBLIC: int __db_txnlist_add __P((DB_ENV *,
- * PUBLIC:     void *, u_int32_t, int32_t, DB_LSN *));
+ * PUBLIC: gint __db_txnlist_add __P((DB_ENV *,
+ * PUBLIC:     gpointer , u_int32_t, int32_t, DB_LSN *));
  */
-int
+gint
 __db_txnlist_add(dbenv, listp, txnid, status, lsn)
 	DB_ENV *dbenv;
-	void *listp;
+	gpointer listp;
 	u_int32_t txnid;
 	int32_t status;
 	DB_LSN *lsn;
 {
 	DB_TXNHEAD *hp;
 	DB_TXNLIST *elp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv, sizeof(DB_TXNLIST), &elp)) != 0)
 		return (ret);
@@ -437,12 +437,12 @@ __db_txnlist_add(dbenv, listp, txnid, status, lsn)
  * __db_txnlist_remove --
  *	Remove an element from our transaction linked list.
  *
- * PUBLIC: int __db_txnlist_remove __P((DB_ENV *, void *, u_int32_t));
+ * PUBLIC: gint __db_txnlist_remove __P((DB_ENV *, gpointer , u_int32_t));
  */
-int
+gint
 __db_txnlist_remove(dbenv, listp, txnid)
 	DB_ENV *dbenv;
-	void *listp;
+	gpointer listp;
 	u_int32_t txnid;
 {
 	DB_TXNLIST *entry;
@@ -460,12 +460,12 @@ __db_txnlist_remove(dbenv, listp, txnid)
  * recovery, we are going to virtually truncate the log and we need
  * to retain the last checkpoint before the truncation point.
  *
- * PUBLIC: void __db_txnlist_ckp __P((DB_ENV *, void *, DB_LSN *));
+ * PUBLIC: void __db_txnlist_ckp __P((DB_ENV *, gpointer , DB_LSN *));
  */
 void
 __db_txnlist_ckp(dbenv, listp, ckp_lsn)
 	DB_ENV *dbenv;
-	void *listp;
+	gpointer listp;
 	DB_LSN *ckp_lsn;
 {
 	DB_TXNHEAD *hp;
@@ -484,16 +484,16 @@ __db_txnlist_ckp(dbenv, listp, ckp_lsn)
  *	Discard transaction linked list. Print out any error messages
  * for deleted files.
  *
- * PUBLIC: void __db_txnlist_end __P((DB_ENV *, void *));
+ * PUBLIC: void __db_txnlist_end __P((DB_ENV *, gpointer ));
  */
 void
 __db_txnlist_end(dbenv, listp)
 	DB_ENV *dbenv;
-	void *listp;
+	gpointer listp;
 {
 	DB_TXNHEAD *hp;
 	DB_TXNLIST *p;
-	int i;
+	gint i;
 
 	if ((hp = (DB_TXNHEAD *)listp) == NULL)
 		return;
@@ -528,12 +528,12 @@ __db_txnlist_end(dbenv, listp)
  *	the status of the transaction.  A txnid of 0 means the record
  *	was generated while not in a transaction.
  *
- * PUBLIC: int __db_txnlist_find __P((DB_ENV *, void *, u_int32_t));
+ * PUBLIC: gint __db_txnlist_find __P((DB_ENV *, gpointer , u_int32_t));
  */
-int
+gint
 __db_txnlist_find(dbenv, listp, txnid)
 	DB_ENV *dbenv;
-	void *listp;
+	gpointer listp;
 	u_int32_t txnid;
 {
 	DB_TXNLIST *entry;
@@ -549,20 +549,20 @@ __db_txnlist_find(dbenv, listp, txnid)
  *	Change the status of an existing transaction entry.
  *	Returns TXN_NOTFOUND if no such entry exists.
  *
- * PUBLIC: int __db_txnlist_update __P((DB_ENV *,
- * PUBLIC:     void *, u_int32_t, u_int32_t, DB_LSN *));
+ * PUBLIC: gint __db_txnlist_update __P((DB_ENV *,
+ * PUBLIC:     gpointer , u_int32_t, u_int32_t, DB_LSN *));
  */
-int
+gint
 __db_txnlist_update(dbenv, listp, txnid, status, lsn)
 	DB_ENV *dbenv;
-	void *listp;
+	gpointer listp;
 	u_int32_t txnid;
 	u_int32_t status;
 	DB_LSN *lsn;
 {
 	DB_TXNHEAD *hp;
 	DB_TXNLIST *elp;
-	int ret;
+	gint ret;
 
 	if (txnid == 0)
 		return (TXN_NOTFOUND);
@@ -590,19 +590,19 @@ __db_txnlist_update(dbenv, listp, txnid, status, lsn)
 static int
 __db_txnlist_find_internal(dbenv, listp, type, txnid, uid, txnlistp, delete)
 	DB_ENV *dbenv;
-	void *listp;
+	gpointer listp;
 	db_txnlist_type type;
 	u_int32_t  txnid;
 	u_int8_t uid[DB_FILE_ID_LEN];
 	DB_TXNLIST **txnlistp;
-	int delete;
+	gint delete;
 {
 	DB_TXNHEAD *hp;
 	DB_TXNLIST *p;
 	int32_t generation;
 	u_int32_t hash;
 	struct __db_headlink *head;
-	int i, ret;
+	gint i, ret;
 
 	if ((hp = (DB_TXNHEAD *)listp) == NULL)
 		return (TXN_NOTFOUND);
@@ -674,18 +674,18 @@ __db_txnlist_find_internal(dbenv, listp, type, txnid, uid, txnlistp, delete)
  * __db_txnlist_gen --
  *	Change the current generation number.
  *
- * PUBLIC: int __db_txnlist_gen __P((DB_ENV *,
- * PUBLIC:       void *, int, u_int32_t, u_int32_t));
+ * PUBLIC: gint __db_txnlist_gen __P((DB_ENV *,
+ * PUBLIC:       gpointer , int, u_int32_t, u_int32_t));
  */
-int
+gint
 __db_txnlist_gen(dbenv, listp, incr, min, max)
 	DB_ENV *dbenv;
-	void *listp;
-	int incr;
+	gpointer listp;
+	gint incr;
 	u_int32_t min, max;
 {
 	DB_TXNHEAD *hp;
-	int ret;
+	gint ret;
 
 	/*
 	 * During recovery generation numbers keep track of "restart"
@@ -721,7 +721,7 @@ __db_txnlist_gen(dbenv, listp, incr, min, max)
 }
 
 #define	TXN_BUBBLE(AP, MAX) {						\
-	int __j;							\
+	gint __j;							\
 	DB_LSN __tmp;							\
 									\
 	for (__j = 0; __j < MAX - 1; __j++)				\
@@ -739,18 +739,18 @@ __db_txnlist_gen(dbenv, listp, incr, min, max)
  *	subsystem explicitly, and there is only a single TXNLIST_LSN entry on
  *	the list.
  *
- * PUBLIC: int __db_txnlist_lsnadd __P((DB_ENV *, void *, DB_LSN *, u_int32_t));
+ * PUBLIC: gint __db_txnlist_lsnadd __P((DB_ENV *, gpointer , DB_LSN *, u_int32_t));
  */
-int
+gint
 __db_txnlist_lsnadd(dbenv, listp, lsnp, flags)
 	DB_ENV *dbenv;
-	void *listp;
+	gpointer listp;
 	DB_LSN *lsnp;
 	u_int32_t flags;
 {
 	DB_TXNHEAD *hp;
 	DB_TXNLIST *elp;
-	int i, ret;
+	gint i, ret;
 
 	hp = (DB_TXNHEAD *)listp;
 
@@ -792,16 +792,16 @@ __db_txnlist_lsnadd(dbenv, listp, lsnp, flags)
  * __db_txnlist_lsninit --
  *	Initialize a transaction list with an lsn array entry.
  *
- * PUBLIC: int __db_txnlist_lsninit __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
+ * PUBLIC: gint __db_txnlist_lsninit __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
  */
-int
+gint
 __db_txnlist_lsninit(dbenv, hp, lsnp)
 	DB_ENV *dbenv;
 	DB_TXNHEAD *hp;
 	DB_LSN *lsnp;
 {
 	DB_TXNLIST *elp;
-	int ret;
+	gint ret;
 
 	elp = NULL;
 
@@ -827,20 +827,20 @@ err:	__db_txnlist_end(dbenv, hp);
  * __db_add_limbo -- add pages to the limbo list.
  *	Get the file information and call pgnoadd for each page.
  *
- * PUBLIC: int __db_add_limbo __P((DB_ENV *,
- * PUBLIC:      void *, int32_t, db_pgno_t, int32_t));
+ * PUBLIC: gint __db_add_limbo __P((DB_ENV *,
+ * PUBLIC:      gpointer , int32_t, db_pgno_t, int32_t));
  */
-int
+gint
 __db_add_limbo(dbenv, info, fileid, pgno, count)
 	DB_ENV *dbenv;
-	void *info;
+	gpointer info;
 	int32_t fileid;
 	db_pgno_t pgno;
 	int32_t count;
 {
 	DB_LOG *dblp;
 	FNAME *fnp;
-	int ret;
+	gint ret;
 
 	dblp = dbenv->lg_handle;
 	if ((ret = __dbreg_id_to_fname(dblp, fileid, 0, &fnp)) != 0)
@@ -889,17 +889,17 @@ __db_add_limbo(dbenv, info, fileid, pgno, count)
  * "create list and write meta-data page" algorithm.  Otherwise, we're in
  * an abort and doing the "use compensating transaction" algorithm.
  *
- * PUBLIC: int __db_do_the_limbo __P((DB_ENV *,
+ * PUBLIC: gint __db_do_the_limbo __P((DB_ENV *,
  * PUBLIC:     DB_TXN *, DB_TXN *, DB_TXNHEAD *));
  */
-int
+gint
 __db_do_the_limbo(dbenv, ptxn, txn, hp)
 	DB_ENV *dbenv;
 	DB_TXN *ptxn, *txn;
 	DB_TXNHEAD *hp;
 {
 	DB_TXNLIST *elp;
-	int h, ret;
+	gint h, ret;
 
 	ret = 0;
 	/*
@@ -944,7 +944,7 @@ __db_lock_move(dbenv, fileid, pgno, mode, ptxn, txn)
 	DB_LOCK lock;
 	DB_LOCK_ILOCK lock_obj;
 	DB_LOCKREQ req;
-	int ret;
+	gint ret;
 
 	lock_obj.pgno = pgno;
 	memcpy(lock_obj.fileid, fileid, DB_FILE_ID_LEN);
@@ -975,7 +975,7 @@ __db_limbo_move(dbenv, ptxn, txn, elp)
 	DB_TXN *ptxn, *txn;
 	DB_TXNLIST *elp;
 {
-	int ret;
+	gint ret;
 
 	for (; elp != NULL; elp = LIST_NEXT(elp, links)) {
 		if (elp->type != TXNLIST_PGNO || elp->u.p.locked == 1)
@@ -1007,7 +1007,7 @@ __db_limbo_bucket(dbenv, txn, elp)
 	DBMETA *meta;
 	DB_TXN *ctxn, *t;
 	db_pgno_t last_pgno, pgno;
-	int dbp_created, in_retry, ret, t_ret;
+	gint dbp_created, in_retry, ret, t_ret;
 
 	ctxn = NULL;
 	in_retry = 0;
@@ -1182,7 +1182,7 @@ __db_limbo_fix(dbp, ctxn, elp, lastp, meta)
 	DB_MPOOLFILE *mpf;
 	PAGE *freep, *pagep;
 	db_pgno_t next, pgno;
-	int i, put_page, ret, t_ret;
+	gint i, put_page, ret, t_ret;
 
 	/*
 	 * Loop through the entries for this txnlist element and
@@ -1288,12 +1288,12 @@ __db_txnlist_pgnoadd(dbenv, hp, fileid, uid, fname, pgno)
 	DB_TXNHEAD *hp;
 	int32_t fileid;
 	u_int8_t uid[DB_FILE_ID_LEN];
-	char *fname;
+	gchar *fname;
 	db_pgno_t pgno;
 {
 	DB_TXNLIST *elp;
 	u_int32_t hash;
-	int len, ret;
+	gint len, ret;
 
 	elp = NULL;
 
@@ -1345,10 +1345,10 @@ static int
 __db_default_getpgnos(dbenv, lsnp, summary)
 	DB_ENV *dbenv;
 	DB_LSN *lsnp;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 
 	t = (TXN_RECS *)summary;
 
@@ -1371,16 +1371,16 @@ __db_default_getpgnos(dbenv, lsnp, summary)
  * __db_txnlist_print --
  *	Print out the transaction list.
  *
- * PUBLIC: void __db_txnlist_print __P((void *));
+ * PUBLIC: void __db_txnlist_print __P((gpointer));
  */
 void
 __db_txnlist_print(listp)
-	void *listp;
+	gpointer listp;
 {
 	DB_TXNHEAD *hp;
 	DB_TXNLIST *p;
-	int i;
-	char *stats[] = { "ok", "commit", "prepare", "abort", "notfound",
+	gint i;
+	gchar *stats[] = { "ok", "commit", "prepare", "abort", "notfound",
 	    "ignore", "expected", "unexpected" };
 
 	hp = (DB_TXNHEAD *)listp;
diff --git a/libdb/db/db_dup.c b/libdb/db/db_dup.c
index 5e12154..aa34fe8 100644
--- a/libdb/db/db_dup.c
+++ b/libdb/db/db_dup.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,9 +27,9 @@ static const char revid[] = "$Id$";
  * __db_ditem --
  *	Remove an item from a page.
  *
- * PUBLIC:  int __db_ditem __P((DBC *, PAGE *, u_int32_t, u_int32_t));
+ * PUBLIC:  gint __db_ditem __P((DBC *, PAGE *, u_int32_t, u_int32_t));
  */
-int
+gint
 __db_ditem(dbc, pagep, indx, nbytes)
 	DBC *dbc;
 	PAGE *pagep;
@@ -38,7 +38,7 @@ __db_ditem(dbc, pagep, indx, nbytes)
 	DB *dbp;
 	DBT ldbt;
 	db_indx_t cnt, *inp, offset;
-	int ret;
+	gint ret;
 	u_int8_t *from;
 
 	dbp = dbc->dbp;
@@ -91,10 +91,10 @@ __db_ditem(dbc, pagep, indx, nbytes)
  * __db_pitem --
  *	Put an item on a page.
  *
- * PUBLIC: int __db_pitem
+ * PUBLIC: gint __db_pitem
  * PUBLIC:     __P((DBC *, PAGE *, u_int32_t, u_int32_t, DBT *, DBT *));
  */
-int
+gint
 __db_pitem(dbc, pagep, indx, nbytes, hdr, data)
 	DBC *dbc;
 	PAGE *pagep;
@@ -106,7 +106,7 @@ __db_pitem(dbc, pagep, indx, nbytes, hdr, data)
 	BKEYDATA bk;
 	DBT thdr;
 	db_indx_t *inp;
-	int ret;
+	gint ret;
 	u_int8_t *p;
 
 	dbp = dbc->dbp;
@@ -169,21 +169,21 @@ __db_pitem(dbc, pagep, indx, nbytes, hdr, data)
  * __db_relink --
  *	Relink around a deleted page.
  *
- * PUBLIC: int __db_relink __P((DBC *, u_int32_t, PAGE *, PAGE **, int));
+ * PUBLIC: gint __db_relink __P((DBC *, u_int32_t, PAGE *, PAGE **, int));
  */
-int
+gint
 __db_relink(dbc, add_rem, pagep, new_next, needlock)
 	DBC *dbc;
 	u_int32_t add_rem;
 	PAGE *pagep, **new_next;
-	int needlock;
+	gint needlock;
 {
 	DB *dbp;
 	PAGE *np, *pp;
 	DB_LOCK npl, ppl;
 	DB_LSN *nlsnp, *plsnp, ret_lsn;
 	DB_MPOOLFILE *mpf;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	np = pp = NULL;
diff --git a/libdb/db/db_iface.c b/libdb/db/db_iface.c
index 3185e00..f86289f 100644
--- a/libdb/db/db_iface.c
+++ b/libdb/db/db_iface.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -19,10 +19,10 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
 
-static int __db_curinval __P((const DB_ENV *));
-static int __db_fnl __P((const DB_ENV *, const char *));
-static int __db_rdonly __P((const DB_ENV *, const char *));
-static int __dbt_ferr __P((const DB *, const char *, const DBT *, int));
+static gint __db_curinval __P((const DB_ENV *));
+static gint __db_fnl __P((const DB_ENV *, const gchar *));
+static gint __db_rdonly __P((const DB_ENV *, const gchar *));
+static gint __dbt_ferr __P((const DB *, const gchar *, const DBT *, int));
 
 /*
  * A database should be required to be readonly if it's been explicitly
@@ -38,9 +38,9 @@ static int __dbt_ferr __P((const DB *, const char *, const DBT *, int));
  * __db_cursorchk --
  *	Common cursor argument checking routine.
  *
- * PUBLIC: int __db_cursorchk __P((const DB *, u_int32_t));
+ * PUBLIC: gint __db_cursorchk __P((const DB *, u_int32_t));
  */
-int
+gint
 __db_cursorchk(dbp, flags)
 	const DB *dbp;
 	u_int32_t flags;
@@ -77,13 +77,13 @@ __db_cursorchk(dbp, flags)
  * __db_ccountchk --
  *	Common cursor count argument checking routine.
  *
- * PUBLIC: int __db_ccountchk __P((const DB *, u_int32_t, int));
+ * PUBLIC: gint __db_ccountchk __P((const DB *, u_int32_t, int));
  */
-int
+gint
 __db_ccountchk(dbp, flags, isvalid)
 	const DB *dbp;
 	u_int32_t flags;
-	int isvalid;
+	gint isvalid;
 {
 	/* Check for invalid function flags. */
 	switch (flags) {
@@ -104,13 +104,13 @@ __db_ccountchk(dbp, flags, isvalid)
  * __db_cdelchk --
  *	Common cursor delete argument checking routine.
  *
- * PUBLIC: int __db_cdelchk __P((const DB *, u_int32_t, int));
+ * PUBLIC: gint __db_cdelchk __P((const DB *, u_int32_t, int));
  */
-int
+gint
 __db_cdelchk(dbp, flags, isvalid)
 	const DB *dbp;
 	u_int32_t flags;
-	int isvalid;
+	gint isvalid;
 {
 	/* Check for changes to a read-only tree. */
 	if (IS_READONLY(dbp))
@@ -138,16 +138,16 @@ __db_cdelchk(dbp, flags, isvalid)
  * __db_cgetchk --
  *	Common cursor get argument checking routine.
  *
- * PUBLIC: int __db_cgetchk __P((const DB *, DBT *, DBT *, u_int32_t, int));
+ * PUBLIC: gint __db_cgetchk __P((const DB *, DBT *, DBT *, u_int32_t, int));
  */
-int
+gint
 __db_cgetchk(dbp, key, data, flags, isvalid)
 	const DB *dbp;
 	DBT *key, *data;
 	u_int32_t flags;
-	int isvalid;
+	gint isvalid;
 {
-	int dirty, multi, ret;
+	gint dirty, multi, ret;
 
 	/*
 	 * Check for read-modify-write validity.  DB_RMW doesn't make sense
@@ -258,18 +258,18 @@ err:		return (__db_ferr(dbp->dbenv, "DBcursor->c_get", 0));
  * __db_cputchk --
  *	Common cursor put argument checking routine.
  *
- * PUBLIC: int __db_cputchk __P((const DB *,
+ * PUBLIC: gint __db_cputchk __P((const DB *,
  * PUBLIC:    const DBT *, DBT *, u_int32_t, int));
  */
-int
+gint
 __db_cputchk(dbp, key, data, flags, isvalid)
 	const DB *dbp;
 	const DBT *key;
 	DBT *data;
 	u_int32_t flags;
-	int isvalid;
+	gint isvalid;
 {
-	int key_flags, ret;
+	gint key_flags, ret;
 
 	key_flags = 0;
 
@@ -351,17 +351,17 @@ err:		return (__db_ferr(dbp->dbenv, "DBcursor->c_put", 0));
  * __db_pgetchk --
  *	DB->pget flag check.
  *
- * PUBLIC: int __db_pgetchk __P((const DB *, const DBT *, DBT *, DBT *,
+ * PUBLIC: gint __db_pgetchk __P((const DB *, const DBT *, DBT *, DBT *,
  * PUBLIC:	u_int32_t));
  */
-int
+gint
 __db_pgetchk(dbp, skey, pkey, data, flags)
 	const DB *dbp;
 	const DBT *skey;
 	DBT *pkey, *data;
 	u_int32_t flags;
 {
-	int ret;
+	gint ret;
 	u_int32_t save_flags;
 
 	save_flags = flags;
@@ -411,17 +411,17 @@ __db_pgetchk(dbp, skey, pkey, data, flags)
  * __db_cpgetchk --
  *	Secondary-index cursor get argument checking routine.
  *
- * PUBLIC: int __db_cpgetchk __P((const DB *,
+ * PUBLIC: gint __db_cpgetchk __P((const DB *,
  * PUBLIC:     DBT *, DBT *, DBT *, u_int32_t, int));
  */
-int
+gint
 __db_cpgetchk(dbp, skey, pkey, data, flags, isvalid)
 	const DB *dbp;
 	DBT *skey, *pkey, *data;
 	u_int32_t flags;
-	int isvalid;
+	gint isvalid;
 {
-	int ret;
+	gint ret;
 	u_int32_t save_flags;
 
 	save_flags = flags;
@@ -479,9 +479,9 @@ __db_cpgetchk(dbp, skey, pkey, data, flags, isvalid)
  * __db_delchk --
  *	Common delete argument checking routine.
  *
- * PUBLIC: int __db_delchk __P((const DB *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_delchk __P((const DB *, DBT *, u_int32_t));
  */
-int
+gint
 __db_delchk(dbp, key, flags)
 	const DB *dbp;
 	DBT *key;
@@ -509,16 +509,16 @@ __db_delchk(dbp, key, flags)
  * __db_getchk --
  *	Common get argument checking routine.
  *
- * PUBLIC: int __db_getchk __P((const DB *, const DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_getchk __P((const DB *, const DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __db_getchk(dbp, key, data, flags)
 	const DB *dbp;
 	const DBT *key;
 	DBT *data;
 	u_int32_t flags;
 {
-	int dirty, multi, ret;
+	gint dirty, multi, ret;
 
 	/*
 	 * Check for read-modify-write validity.  DB_RMW doesn't make sense
@@ -600,16 +600,16 @@ err:		return (__db_ferr(dbp->dbenv, "DB->get", 0));
  * __db_joinchk --
  *	Common join argument checking routine.
  *
- * PUBLIC: int __db_joinchk __P((const DB *, DBC * const *, u_int32_t));
+ * PUBLIC: gint __db_joinchk __P((const DB *, DBC * const *, u_int32_t));
  */
-int
+gint
 __db_joinchk(dbp, curslist, flags)
 	const DB *dbp;
 	DBC * const *curslist;
 	u_int32_t flags;
 {
 	DB_TXN *txn;
-	int i;
+	gint i;
 
 	switch (flags) {
 	case 0:
@@ -640,9 +640,9 @@ __db_joinchk(dbp, curslist, flags)
  * __db_joingetchk --
  *	Common join_get argument checking routine.
  *
- * PUBLIC: int __db_joingetchk __P((const DB *, DBT *, u_int32_t));
+ * PUBLIC: gint __db_joingetchk __P((const DB *, DBT *, u_int32_t));
  */
-int
+gint
 __db_joingetchk(dbp, key, flags)
 	const DB *dbp;
 	DBT *key;
@@ -688,18 +688,18 @@ __db_joingetchk(dbp, key, flags)
  * __db_putchk --
  *	Common put argument checking routine.
  *
- * PUBLIC: int __db_putchk
+ * PUBLIC: gint __db_putchk
  * PUBLIC:    __P((const DB *, DBT *, const DBT *, u_int32_t, int));
  */
-int
+gint
 __db_putchk(dbp, key, data, flags, isdup)
 	const DB *dbp;
 	DBT *key;
 	const DBT *data;
 	u_int32_t flags;
-	int isdup;
+	gint isdup;
 {
-	int ret, returnkey;
+	gint ret, returnkey;
 
 	returnkey = 0;
 
@@ -752,9 +752,9 @@ err:		return (__db_ferr(dbp->dbenv, "DB->put", 0));
  * __db_statchk --
  *	Common stat argument checking routine.
  *
- * PUBLIC: int __db_statchk __P((const DB *, u_int32_t));
+ * PUBLIC: gint __db_statchk __P((const DB *, u_int32_t));
  */
-int
+gint
 __db_statchk(dbp, flags)
 	const DB *dbp;
 	u_int32_t flags;
@@ -782,9 +782,9 @@ err:		return (__db_ferr(dbp->dbenv, "DB->stat", 0));
  * __db_syncchk --
  *	Common sync argument checking routine.
  *
- * PUBLIC: int __db_syncchk __P((const DB *, u_int32_t));
+ * PUBLIC: gint __db_syncchk __P((const DB *, u_int32_t));
  */
-int
+gint
 __db_syncchk(dbp, flags)
 	const DB *dbp;
 	u_int32_t flags;
@@ -807,12 +807,12 @@ __db_syncchk(dbp, flags)
 static int
 __dbt_ferr(dbp, name, dbt, check_thread)
 	const DB *dbp;
-	const char *name;
+	const gchar *name;
 	const DBT *dbt;
-	int check_thread;
+	gint check_thread;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -854,7 +854,7 @@ __dbt_ferr(dbp, name, dbt, check_thread)
 static int
 __db_rdonly(dbenv, name)
 	const DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 {
 	__db_err(dbenv, "%s: attempt to modify a read-only tree", name);
 	return (EACCES);
@@ -867,7 +867,7 @@ __db_rdonly(dbenv, name)
 static int
 __db_fnl(dbenv, name)
 	const DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 {
 	__db_err(dbenv,
 	    "%s: the DB_DIRTY_READ and DB_RMW flags require locking", name);
@@ -892,9 +892,9 @@ __db_curinval(dbenv)
  *	Report that a secondary index appears corrupt, as it has a record
  * that does not correspond to a record in the primary.
  *
- * PUBLIC: int __db_secondary_corrupt __P((DB *));
+ * PUBLIC: gint __db_secondary_corrupt __P((DB *));
  */
-int
+gint
 __db_secondary_corrupt(dbp)
 	DB *dbp;
 {
@@ -908,13 +908,13 @@ __db_secondary_corrupt(dbp)
  * __db_associatechk --
  *	Argument checking routine for DB->associate().
  *
- * PUBLIC: int __db_associatechk __P((DB *, DB *,
- * PUBLIC:     int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
+ * PUBLIC: gint __db_associatechk __P((DB *, DB *,
+ * PUBLIC:     gint (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
  */
-int
+gint
 __db_associatechk(dbp, sdbp, callback, flags)
 	DB *dbp, *sdbp;
-	int (*callback) __P((DB *, const DBT *, const DBT *, DBT *));
+	gint (*callback) __P((DB *, const DBT *, const DBT *, DBT *));
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
@@ -956,9 +956,9 @@ __db_associatechk(dbp, sdbp, callback, flags)
  * __db_txn_auto --
  *	Handle DB_AUTO_COMMIT initialization.
  *
- * PUBLIC: int __db_txn_auto __P((DB *, DB_TXN **));
+ * PUBLIC: gint __db_txn_auto __P((DB *, DB_TXN **));
  */
-int
+gint
 __db_txn_auto(dbp, txnidp)
 	DB *dbp;
 	DB_TXN **txnidp;
diff --git a/libdb/db/db_join.c b/libdb/db/db_join.c
index c5274e4..cb24b1c 100644
--- a/libdb/db/db_join.c
+++ b/libdb/db/db_join.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,14 +23,14 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_join.h"
 #include "dbinc/btree.h"
 
-static int __db_join_close __P((DBC *));
-static int __db_join_cmp __P((const void *, const void *));
-static int __db_join_del __P((DBC *, u_int32_t));
-static int __db_join_get __P((DBC *, DBT *, DBT *, u_int32_t));
-static int __db_join_getnext __P((DBC *, DBT *, DBT *, u_int32_t, u_int32_t));
-static int __db_join_primget __P((DB *,
+static gint __db_join_close __P((DBC *));
+static gint __db_join_cmp __P((gconstpointer , gconstpointer ));
+static gint __db_join_del __P((DBC *, u_int32_t));
+static gint __db_join_get __P((DBC *, DBT *, DBT *, u_int32_t));
+static gint __db_join_getnext __P((DBC *, DBT *, DBT *, u_int32_t, u_int32_t));
+static gint __db_join_primget __P((DB *,
     DB_TXN *, u_int32_t, DBT *, DBT *, u_int32_t));
-static int __db_join_put __P((DBC *, DBT *, DBT *, u_int32_t));
+static gint __db_join_put __P((DBC *, DBT *, DBT *, u_int32_t));
 
 /*
  * Check to see if the Nth secondary cursor of join cursor jc is pointing
@@ -73,9 +73,9 @@ static int __db_join_put __P((DBC *, DBT *, DBT *, u_int32_t));
  * key and data are returned.  When no more items are left in the join
  * set, the  c_next operation off the join cursor will return DB_NOTFOUND.
  *
- * PUBLIC: int __db_join __P((DB *, DBC **, DBC **, u_int32_t));
+ * PUBLIC: gint __db_join __P((DB *, DBC **, DBC **, u_int32_t));
  */
-int
+gint
 __db_join(primary, curslist, dbcp, flags)
 	DB *primary;
 	DBC **curslist, **dbcp;
@@ -84,7 +84,7 @@ __db_join(primary, curslist, dbcp, flags)
 	DB_ENV *dbenv;
 	DBC *dbc;
 	JOIN_CURSOR *jc;
-	int ret;
+	gint ret;
 	u_int32_t i;
 	size_t ncurs, nslots;
 
@@ -283,7 +283,7 @@ __db_join_get(dbc, key_arg, data_arg, flags)
 	DB *dbp;
 	DBC *cp;
 	JOIN_CURSOR *jc;
-	int db_manage_data, ret;
+	gint db_manage_data, ret;
 	u_int32_t i, j, operation, opmods;
 
 	dbp = dbc->dbp;
@@ -622,7 +622,7 @@ __db_join_close(dbc)
 	DB *dbp;
 	DB_ENV *dbenv;
 	JOIN_CURSOR *jc;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int32_t i;
 
 	jc = (JOIN_CURSOR *)dbc->internal;
@@ -695,10 +695,10 @@ __db_join_getnext(dbc, key, data, exhausted, opmods)
 	DBT *key, *data;
 	u_int32_t exhausted, opmods;
 {
-	int ret, cmp;
+	gint ret, cmp;
 	DB *dbp;
 	DBT ldata;
-	int (*func) __P((DB *, const DBT *, const DBT *));
+	gint (*func) __P((DB *, const DBT *, const DBT *));
 
 	dbp = dbc->dbp;
 	func = (dbp->dup_compare == NULL) ? __bam_defcmp : dbp->dup_compare;
@@ -752,7 +752,7 @@ __db_join_getnext(dbc, key, data, exhausted, opmods)
  */
 static int
 __db_join_cmp(a, b)
-	const void *a, *b;
+	gconstpointer a, *b;
 {
 	DBC *dbca, *dbcb;
 	db_recno_t counta, countb;
@@ -784,7 +784,7 @@ __db_join_primget(dbp, txn, lockerid, key, data, flags)
 	u_int32_t flags;
 {
 	DBC *dbc;
-	int dirty, ret, rmw, t_ret;
+	gint dirty, ret, rmw, t_ret;
 
 	/*
 	 * The only allowable flags here are the two flags copied into
diff --git a/libdb/db/db_meta.c b/libdb/db/db_meta.c
index 9c895ce..c463019 100644
--- a/libdb/db/db_meta.c
+++ b/libdb/db/db_meta.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -58,7 +58,7 @@ static const char revid[] = "$Id$";
 #include "dbinc/lock.h"
 #include "dbinc/db_am.h"
 
-static void __db_init_meta __P((void *, u_int32_t, db_pgno_t, u_int32_t));
+static void __db_init_meta __P((gpointer , u_int32_t, db_pgno_t, u_int32_t));
 
 /*
  * __db_init_meta --
@@ -68,7 +68,7 @@ static void __db_init_meta __P((void *, u_int32_t, db_pgno_t, u_int32_t));
  */
 static void
 __db_init_meta(p, pgsize, pgno, pgtype)
-	void *p;
+	gpointer p;
 	u_int32_t pgsize;
 	db_pgno_t pgno;
 	u_int32_t pgtype;
@@ -89,9 +89,9 @@ __db_init_meta(p, pgsize, pgno, pgtype)
  * __db_new --
  *	Get a new page, preferably from the freelist.
  *
- * PUBLIC: int __db_new __P((DBC *, u_int32_t, PAGE **));
+ * PUBLIC: gint __db_new __P((DBC *, u_int32_t, PAGE **));
  */
-int
+gint
 __db_new(dbc, type, pagepp)
 	DBC *dbc;
 	u_int32_t type;
@@ -104,7 +104,7 @@ __db_new(dbc, type, pagepp)
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_pgno_t pgno, newnext;
-	int meta_flags, extend, ret;
+	gint meta_flags, extend, ret;
 
 	meta = NULL;
 	meta_flags = 0;
@@ -212,9 +212,9 @@ err:	if (h != NULL)
  * __db_free --
  *	Add a page to the head of the freelist.
  *
- * PUBLIC: int __db_free __P((DBC *, PAGE *));
+ * PUBLIC: gint __db_free __P((DBC *, PAGE *));
  */
-int
+gint
 __db_free(dbc, h)
 	DBC *dbc;
 	PAGE *h;
@@ -226,7 +226,7 @@ __db_free(dbc, h)
 	DB_MPOOLFILE *mpf;
 	db_pgno_t pgno;
 	u_int32_t dirty_flag;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -292,9 +292,9 @@ err:	if ((t_ret = mpf->put(mpf, h, dirty_flag)) != 0 && ret == 0)
  * __db_lprint --
  *	Print out the list of locks currently held by a cursor.
  *
- * PUBLIC: int __db_lprint __P((DBC *));
+ * PUBLIC: gint __db_lprint __P((DBC *));
  */
-int
+gint
 __db_lprint(dbc)
 	DBC *dbc;
 {
@@ -330,13 +330,13 @@ __db_lprint(dbc)
  * __db_lget --
  *	The standard lock get call.
  *
- * PUBLIC: int __db_lget __P((DBC *,
+ * PUBLIC: gint __db_lget __P((DBC *,
  * PUBLIC:     int, db_pgno_t, db_lockmode_t, u_int32_t, DB_LOCK *));
  */
-int
+gint
 __db_lget(dbc, action, pgno, mode, lkflags, lockp)
 	DBC *dbc;
-	int action;
+	gint action;
 	db_pgno_t pgno;
 	db_lockmode_t mode;
 	u_int32_t lkflags;
@@ -346,7 +346,7 @@ __db_lget(dbc, action, pgno, mode, lkflags, lockp)
 	DB_ENV *dbenv;
 	DB_LOCKREQ couple[2], *reqp;
 	DB_TXN *txn;
-	int has_timeout, ret;
+	gint has_timeout, ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -424,15 +424,15 @@ lck_couple:	couple[0].op = has_timeout? DB_LOCK_GET_TIMEOUT : DB_LOCK_GET;
  * __db_lput --
  *	The standard lock put call.
  *
- * PUBLIC: int __db_lput __P((DBC *, DB_LOCK *));
+ * PUBLIC: gint __db_lput __P((DBC *, DB_LOCK *));
  */
-int
+gint
 __db_lput(dbc, lockp)
 	DBC *dbc;
 	DB_LOCK *lockp;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	dbenv = dbc->dbp->dbenv;
 
diff --git a/libdb/db/db_method.c b/libdb/db/db_method.c
index 2cd9003..5cba21e 100644
--- a/libdb/db/db_method.c
+++ b/libdb/db/db_method.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -38,48 +38,48 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_client_ext.h"
 #endif
 
-static int  __db_get_byteswapped __P((DB *, int *));
-static int  __db_get_type __P((DB *, DBTYPE *dbtype));
-static int  __db_init __P((DB *, u_int32_t));
-static int  __db_key_range
+static gint  __db_get_byteswapped __P((DB *, gint *));
+static gint  __db_get_type __P((DB *, DBTYPE *dbtype));
+static gint  __db_init __P((DB *, u_int32_t));
+static gint  __db_key_range
 		__P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
-static int  __db_set_alloc __P((DB *, void *(*)(size_t),
-		void *(*)(void *, size_t), void (*)(void *)));
-static int  __db_set_append_recno __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
-static int  __db_set_cachesize __P((DB *, u_int32_t, u_int32_t, int));
-static int  __db_set_cache_priority __P((DB *, DB_CACHE_PRIORITY));
-static int  __db_set_dup_compare
-		__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
-static int  __db_set_encrypt __P((DB *, const char *, u_int32_t));
-static int  __db_set_feedback __P((DB *, void (*)(DB *, int, int)));
-static int  __db_set_flags __P((DB *, u_int32_t));
-static int  __db_set_pagesize __P((DB *, u_int32_t));
-static int  __db_set_paniccall __P((DB *, void (*)(DB_ENV *, int)));
-static void __db_set_errcall __P((DB *, void (*)(const char *, char *)));
+static gint  __db_set_alloc __P((DB *, gpointer (*)(size_t),
+		gpointer (*)(gpointer , size_t), void (*)(gpointer)));
+static gint  __db_set_append_recno __P((DB *, gint (*)(DB *, DBT *, db_recno_t)));
+static gint  __db_set_cachesize __P((DB *, u_int32_t, u_int32_t, int));
+static gint  __db_set_cache_priority __P((DB *, DB_CACHE_PRIORITY));
+static gint  __db_set_dup_compare
+		__P((DB *, gint (*)(DB *, const DBT *, const DBT *)));
+static gint  __db_set_encrypt __P((DB *, const gchar *, u_int32_t));
+static gint  __db_set_feedback __P((DB *, void (*)(DB *, int, int)));
+static gint  __db_set_flags __P((DB *, u_int32_t));
+static gint  __db_set_pagesize __P((DB *, u_int32_t));
+static gint  __db_set_paniccall __P((DB *, void (*)(DB_ENV *, int)));
+static void __db_set_errcall __P((DB *, void (*)(const gchar *, gchar *)));
 static void __db_set_errfile __P((DB *, FILE *));
-static void __db_set_errpfx __P((DB *, const char *));
-static int  __db_stat_fail __P((DB *, void *, u_int32_t));
-static void __dbh_err __P((DB *, int, const char *, ...));
-static void __dbh_errx __P((DB *, const char *, ...));
+static void __db_set_errpfx __P((DB *, const gchar *));
+static gint  __db_stat_fail __P((DB *, gpointer , u_int32_t));
+static void __dbh_err __P((DB *, int, const gchar *, ...));
+static void __dbh_errx __P((DB *, const gchar *, ...));
 
 #ifdef HAVE_RPC
-static int  __dbcl_init __P((DB *, DB_ENV *, u_int32_t));
+static gint  __dbcl_init __P((DB *, DB_ENV *, u_int32_t));
 #endif
 
 /*
  * db_create --
  *	DB constructor.
  *
- * EXTERN: int db_create __P((DB **, DB_ENV *, u_int32_t));
+ * EXTERN: gint db_create __P((DB **, DB_ENV *, u_int32_t));
  */
-int
+gint
 db_create(dbpp, dbenv, flags)
 	DB **dbpp;
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 
 	/* Check for invalid function flags. */
 	switch (flags) {
@@ -143,7 +143,7 @@ __db_init(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
 {
-	int ret;
+	gint ret;
 
 	dbp->lid = DB_LOCK_INVALIDID;
 	LOCK_INIT(dbp->handle_lock);
@@ -215,9 +215,9 @@ __db_init(dbp, flags)
  * __dbh_am_chk --
  *	Error if an unreasonable method is called.
  *
- * PUBLIC: int __dbh_am_chk __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbh_am_chk __P((DB *, u_int32_t));
  */
-int
+gint
 __dbh_am_chk(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
@@ -246,12 +246,12 @@ __dbh_am_chk(dbp, flags)
  */
 static void
 #ifdef __STDC__
-__dbh_err(DB *dbp, int error, const char *fmt, ...)
+__dbh_err(DB *dbp, gint error, const gchar *fmt, ...)
 #else
 __dbh_err(dbp, error, fmt, va_alist)
 	DB *dbp;
-	int error;
-	const char *fmt;
+	gint error;
+	const gchar *fmt;
 	va_dcl
 #endif
 {
@@ -264,11 +264,11 @@ __dbh_err(dbp, error, fmt, va_alist)
  */
 static void
 #ifdef __STDC__
-__dbh_errx(DB *dbp, const char *fmt, ...)
+__dbh_errx(DB *dbp, const gchar *fmt, ...)
 #else
 __dbh_errx(dbp, fmt, va_alist)
 	DB *dbp;
-	const char *fmt;
+	const gchar *fmt;
 	va_dcl
 #endif
 {
@@ -282,7 +282,7 @@ __dbh_errx(dbp, fmt, va_alist)
 static int
 __db_get_byteswapped(dbp, isswapped)
 	DB *dbp;
-	int *isswapped;
+	gint *isswapped;
 {
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "get_byteswapped");
 
@@ -335,7 +335,7 @@ __db_key_range(dbp, txn, key, kr, flags)
 static int
 __db_set_append_recno(dbp, func)
 	DB *dbp;
-	int (*func) __P((DB *, DBT *, db_recno_t));
+	gint (*func) __P((DB *, DBT *, db_recno_t));
 {
 	DB_ILLEGAL_AFTER_OPEN(dbp, "set_append_recno");
 	DB_ILLEGAL_METHOD(dbp, DB_OK_QUEUE | DB_OK_RECNO);
@@ -353,7 +353,7 @@ static int
 __db_set_cachesize(dbp, cache_gbytes, cache_bytes, ncache)
 	DB *dbp;
 	u_int32_t cache_gbytes, cache_bytes;
-	int ncache;
+	gint ncache;
 {
 	DB_ILLEGAL_IN_ENV(dbp, "set_cachesize");
 	DB_ILLEGAL_AFTER_OPEN(dbp, "set_cachesize");
@@ -389,9 +389,9 @@ __db_set_cache_priority(dbp, priority)
 static int
 __db_set_dup_compare(dbp, func)
 	DB *dbp;
-	int (*func) __P((DB *, const DBT *, const DBT *));
+	gint (*func) __P((DB *, const DBT *, const DBT *));
 {
-	int ret;
+	gint ret;
 
 	DB_ILLEGAL_AFTER_OPEN(dbp, "dup_compare");
 	DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE | DB_OK_HASH);
@@ -411,11 +411,11 @@ __db_set_dup_compare(dbp, func)
 static int
 __db_set_encrypt(dbp, passwd, flags)
 	DB *dbp;
-	const char *passwd;
+	const gchar *passwd;
 	u_int32_t flags;
 {
 	DB_CIPHER *db_cipher;
-	int ret;
+	gint ret;
 
 	DB_ILLEGAL_IN_ENV(dbp, "set_encrypt");
 	DB_ILLEGAL_AFTER_OPEN(dbp, "set_encrypt");
@@ -438,7 +438,7 @@ __db_set_encrypt(dbp, passwd, flags)
 static void
 __db_set_errcall(dbp, errcall)
 	DB *dbp;
-	void (*errcall) __P((const char *, char *));
+	void (*errcall) __P((const gchar *, gchar *));
 {
 	dbp->dbenv->set_errcall(dbp->dbenv, errcall);
 }
@@ -454,7 +454,7 @@ __db_set_errfile(dbp, errfile)
 static void
 __db_set_errpfx(dbp, errpfx)
 	DB *dbp;
-	const char *errpfx;
+	const gchar *errpfx;
 {
 	dbp->dbenv->set_errpfx(dbp->dbenv, errpfx);
 }
@@ -473,7 +473,7 @@ __db_set_flags(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
 {
-	int ret;
+	gint ret;
 
 	/*
 	 * !!!
@@ -510,14 +510,14 @@ __db_set_flags(dbp, flags)
  * __db_set_lorder --
  *	Set whether lorder is swapped or not.
  *
- * PUBLIC: int  __db_set_lorder __P((DB *, int));
+ * PUBLIC: gint  __db_set_lorder __P((DB *, int));
  */
-int
+gint
 __db_set_lorder(dbp, db_lorder)
 	DB *dbp;
-	int db_lorder;
+	gint db_lorder;
 {
-	int ret;
+	gint ret;
 
 	DB_ILLEGAL_AFTER_OPEN(dbp, "set_lorder");
 
@@ -539,9 +539,9 @@ __db_set_lorder(dbp, db_lorder)
 static int
 __db_set_alloc(dbp, mal_func, real_func, free_func)
 	DB *dbp;
-	void *(*mal_func) __P((size_t));
-	void *(*real_func) __P((void *, size_t));
-	void (*free_func) __P((void *));
+	gpointer (*mal_func) __P((size_t));
+	gpointer (*real_func) __P((gpointer , size_t));
+	void (*free_func) __P((gpointer));
 {
 	DB_ILLEGAL_IN_ENV(dbp, "set_alloc");
 	DB_ILLEGAL_AFTER_OPEN(dbp, "set_alloc");
@@ -598,7 +598,7 @@ __db_set_paniccall(dbp, paniccall)
 static int
 __db_stat_fail(dbp, sp, flags)
 	DB *dbp;
-	void *sp;
+	gpointer sp;
 	u_int32_t flags;
 {
 	COMPQUIET(sp, NULL);
diff --git a/libdb/db/db_open.c b/libdb/db/db_open.c
index cf3509f..1ad083c 100644
--- a/libdb/db/db_open.c
+++ b/libdb/db/db_open.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -33,27 +33,27 @@ static const char revid[] = "$Id$";
 #include "dbinc/qam.h"
 #include "dbinc/txn.h"
 
-static int __db_openchk __P((DB *,
-    DB_TXN *, const char *, const char *, DBTYPE, u_int32_t));
+static gint __db_openchk __P((DB *,
+    DB_TXN *, const gchar *, const gchar *, DBTYPE, u_int32_t));
 
 /*
  * __db_open --
  *	Main library interface to the DB access methods.
  *
- * PUBLIC: int __db_open __P((DB *, DB_TXN *,
- * PUBLIC:     const char *, const char *, DBTYPE, u_int32_t, int));
+ * PUBLIC: gint __db_open __P((DB *, DB_TXN *,
+ * PUBLIC:     const gchar *, const gchar *, DBTYPE, u_int32_t, int));
  */
-int
+gint
 __db_open(dbp, txn, name, subdb, type, flags, mode)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	DBTYPE type;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 {
 	DB_ENV *dbenv;
-	int remove_master, remove_me, ret, t_ret, txn_local;
+	gint remove_master, remove_me, ret, t_ret, txn_local;
 
 	dbenv = dbp->dbenv;
 	remove_me = remove_master = txn_local = 0;
@@ -178,20 +178,20 @@ err:	/* If we were successful, don't discard the file on close. */
  *    name will be non-NULL, subname mqy be NULL and meta-pgno will be
  *    a valid pgno (i.e., not PGNO_BASE_MD).
  *
- * PUBLIC: int __db_dbopen __P((DB *, DB_TXN *,
- * PUBLIC:     const char *, const char *, u_int32_t, int, db_pgno_t));
+ * PUBLIC: gint __db_dbopen __P((DB *, DB_TXN *,
+ * PUBLIC:     const gchar *, const gchar *, u_int32_t, int, db_pgno_t));
  */
-int
+gint
 __db_dbopen(dbp, txn, name, subdb, flags, mode, meta_pgno)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 	db_pgno_t meta_pgno;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 	u_int32_t id;
 
 	dbenv = dbp->dbenv;
@@ -331,16 +331,16 @@ err:
  * __db_new_file --
  *	Create a new database file.
  *
- * PUBLIC: int __db_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
+ * PUBLIC: gint __db_new_file __P((DB *, DB_TXN *, DB_FH *, const gchar *));
  */
-int
+gint
 __db_new_file(dbp, txn, fhp, name)
 	DB *dbp;
 	DB_TXN *txn;
 	DB_FH *fhp;
-	const char *name;
+	const gchar *name;
 {
-	int ret;
+	gint ret;
 
 	switch (dbp->type) {
 	case DB_BTREE:
@@ -375,17 +375,17 @@ DB_TEST_RECOVERY_LABEL
  * __db_init_subdb --
  *	Initialize the dbp for a subdb.
  *
- * PUBLIC: int __db_init_subdb __P((DB *, DB *, const char *, DB_TXN *));
+ * PUBLIC: gint __db_init_subdb __P((DB *, DB *, const gchar *, DB_TXN *));
  */
-int
+gint
 __db_init_subdb(mdbp, dbp, name, txn)
 	DB *mdbp, *dbp;
-	const char *name;
+	const gchar *name;
 	DB_TXN *txn;
 {
 	DBMETA *meta;
 	DB_MPOOLFILE *mpf;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 	if (!F_ISSET(dbp, DB_AM_CREATED)) {
@@ -433,16 +433,16 @@ err:	return (ret);
  *
  *	Return 0 on success, >0 (errno) on error, -1 on checksum mismatch.
  *
- * PUBLIC: int __db_chk_meta __P((DB_ENV *, DB *, DBMETA *, int));
+ * PUBLIC: gint __db_chk_meta __P((DB_ENV *, DB *, DBMETA *, int));
  */
-int
+gint
 __db_chk_meta(dbenv, dbp, meta, do_metachk)
 	DB_ENV *dbenv;
 	DB *dbp;
 	DBMETA *meta;
-	int do_metachk;
+	gint do_metachk;
 {
-	int is_hmac, ret;
+	gint is_hmac, ret;
 	u_int8_t *chksum;
 
 	ret = 0;
@@ -471,20 +471,20 @@ __db_chk_meta(dbenv, dbp, meta, do_metachk)
  * Take a buffer containing a meta-data page and figure out if it's
  * valid, and if so, initialize the dbp from the meta-data page.
  *
- * PUBLIC: int __db_meta_setup __P((DB_ENV *,
- * PUBLIC:     DB *, const char *, DBMETA *, u_int32_t, int));
+ * PUBLIC: gint __db_meta_setup __P((DB_ENV *,
+ * PUBLIC:     DB *, const gchar *, DBMETA *, u_int32_t, int));
  */
-int
+gint
 __db_meta_setup(dbenv, dbp, name, meta, oflags, do_metachk)
 	DB_ENV *dbenv;
 	DB *dbp;
-	const char *name;
+	const gchar *name;
 	DBMETA *meta;
 	u_int32_t oflags;
-	int do_metachk;
+	gint do_metachk;
 {
 	u_int32_t flags, magic;
-	int ret;
+	gint ret;
 
 	ret = 0;
 
@@ -586,12 +586,12 @@ static int
 __db_openchk(dbp, txn, name, subdb, type, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	DBTYPE type;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 	u_int32_t ok_flags;
 
 	dbenv = dbp->dbenv;
diff --git a/libdb/db/db_overflow.c b/libdb/db/db_overflow.c
index 36b959a..d4c8bc5 100644
--- a/libdb/db/db_overflow.c
+++ b/libdb/db/db_overflow.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -70,16 +70,16 @@ static const char revid[] = "$Id$";
  * __db_goff --
  *	Get an offpage item.
  *
- * PUBLIC: int __db_goff __P((DB *, DBT *,
- * PUBLIC:     u_int32_t, db_pgno_t, void **, u_int32_t *));
+ * PUBLIC: gint __db_goff __P((DB *, DBT *,
+ * PUBLIC:     u_int32_t, db_pgno_t, gpointer *, u_int32_t *));
  */
-int
+gint
 __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz)
 	DB *dbp;
 	DBT *dbt;
 	u_int32_t tlen;
 	db_pgno_t pgno;
-	void **bpp;
+	gpointer *bpp;
 	u_int32_t *bpsz;
 {
 	DB_ENV *dbenv;
@@ -88,7 +88,7 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz)
 	db_indx_t bytes;
 	u_int32_t curoff, needed, start;
 	u_int8_t *p, *src;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -166,9 +166,9 @@ __db_goff(dbp, dbt, tlen, pgno, bpp, bpsz)
  * __db_poff --
  *	Put an offpage item.
  *
- * PUBLIC: int __db_poff __P((DBC *, const DBT *, db_pgno_t *));
+ * PUBLIC: gint __db_poff __P((DBC *, const DBT *, db_pgno_t *));
  */
-int
+gint
 __db_poff(dbc, dbt, pgnop)
 	DBC *dbc;
 	const DBT *dbt;
@@ -182,7 +182,7 @@ __db_poff(dbc, dbt, pgnop)
 	db_indx_t pagespace;
 	u_int32_t sz;
 	u_int8_t *p;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	/*
 	 * Allocate pages and copy the key/data item into them.  Calculate the
@@ -265,9 +265,9 @@ __db_poff(dbc, dbt, pgnop)
  * __db_ovref --
  *	Increment/decrement the reference count on an overflow page.
  *
- * PUBLIC: int __db_ovref __P((DBC *, db_pgno_t, int32_t));
+ * PUBLIC: gint __db_ovref __P((DBC *, db_pgno_t, int32_t));
  */
-int
+gint
 __db_ovref(dbc, pgno, adjust)
 	DBC *dbc;
 	db_pgno_t pgno;
@@ -276,7 +276,7 @@ __db_ovref(dbc, pgno, adjust)
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -304,9 +304,9 @@ __db_ovref(dbc, pgno, adjust)
  * __db_doff --
  *	Delete an offpage chain of overflow pages.
  *
- * PUBLIC: int __db_doff __P((DBC *, db_pgno_t));
+ * PUBLIC: gint __db_doff __P((DBC *, db_pgno_t));
  */
-int
+gint
 __db_doff(dbc, pgno)
 	DBC *dbc;
 	db_pgno_t pgno;
@@ -316,7 +316,7 @@ __db_doff(dbc, pgno)
 	DB_LSN null_lsn;
 	DB_MPOOLFILE *mpf;
 	DBT tmp_dbt;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -369,24 +369,24 @@ __db_doff(dbc, pgno)
  * specified a comparison function.  In this case, we need to materialize
  * the entire object and call their comparison routine.
  *
- * PUBLIC: int __db_moff __P((DB *, const DBT *, db_pgno_t, u_int32_t,
- * PUBLIC:     int (*)(DB *, const DBT *, const DBT *), int *));
+ * PUBLIC: gint __db_moff __P((DB *, const DBT *, db_pgno_t, u_int32_t,
+ * PUBLIC:     gint (*)(DB *, const DBT *, const DBT *), gint *));
  */
-int
+gint
 __db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp)
 	DB *dbp;
 	const DBT *dbt;
 	db_pgno_t pgno;
 	u_int32_t tlen;
-	int (*cmpfunc) __P((DB *, const DBT *, const DBT *)), *cmpp;
+	gint (*cmpfunc) __P((DB *, const DBT *, const DBT *)), *cmpp;
 {
 	DBT local_dbt;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	void *buf;
+	gpointer buf;
 	u_int32_t bufsize, cmp_bytes, key_left;
 	u_int8_t *p1, *p2;
-	int ret;
+	gint ret;
 
 	mpf = dbp->mpf;
 
@@ -443,10 +443,10 @@ __db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp)
  * __db_vrfy_overflow --
  *	Verify overflow page.
  *
- * PUBLIC: int __db_vrfy_overflow __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
+ * PUBLIC: gint __db_vrfy_overflow __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __db_vrfy_overflow(dbp, vdp, h, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -455,7 +455,7 @@ __db_vrfy_overflow(dbp, vdp, h, pgno, flags)
 	u_int32_t flags;
 {
 	VRFY_PAGEINFO *pip;
-	int isbad, ret, t_ret;
+	gint isbad, ret, t_ret;
 
 	isbad = 0;
 	if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
@@ -489,10 +489,10 @@ err:	if ((t_ret = __db_vrfy_putpageinfo(dbp->dbenv, vdp, pip)) != 0)
  *	Walk a list of overflow pages, avoiding cycles and marking
  *	pages seen.
  *
- * PUBLIC: int __db_vrfy_ovfl_structure
+ * PUBLIC: gint __db_vrfy_ovfl_structure
  * PUBLIC:     __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, u_int32_t));
  */
-int
+gint
 __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -503,7 +503,7 @@ __db_vrfy_ovfl_structure(dbp, vdp, pgno, tlen, flags)
 	DB *pgset;
 	VRFY_PAGEINFO *pip;
 	db_pgno_t next, prev;
-	int isbad, p, ret, t_ret;
+	gint isbad, p, ret, t_ret;
 	u_int32_t refcount;
 
 	pgset = vdp->pgset;
@@ -644,21 +644,21 @@ err:	if ((t_ret =
  *	Get an overflow item, very carefully, from an untrusted database,
  *	in the context of the salvager.
  *
- * PUBLIC: int __db_safe_goff __P((DB *, VRFY_DBINFO *, db_pgno_t,
- * PUBLIC:     DBT *, void **, u_int32_t));
+ * PUBLIC: gint __db_safe_goff __P((DB *, VRFY_DBINFO *, db_pgno_t,
+ * PUBLIC:     DBT *, gpointer *, u_int32_t));
  */
-int
+gint
 __db_safe_goff(dbp, vdp, pgno, dbt, buf, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
 	DBT *dbt;
-	void **buf;
+	gpointer *buf;
 	u_int32_t flags;
 {
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int32_t bytesgot, bytes;
 	u_int8_t *src, *dest;
 
diff --git a/libdb/db/db_pr.c b/libdb/db/db_pr.c
index 4e91dc1..4d1a275 100644
--- a/libdb/db/db_pr.c
+++ b/libdb/db/db_pr.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -32,9 +32,9 @@ static const char revid[] = "$Id$";
 static int	 __db_bmeta __P((DB *, FILE *, BTMETA *, u_int32_t));
 static int	 __db_hmeta __P((DB *, FILE *, HMETA *, u_int32_t));
 static void	 __db_meta __P((DB *, DBMETA *, FILE *, FN const *, u_int32_t));
-static const char *__db_pagetype_to_string __P((u_int32_t));
+static const gchar *__db_pagetype_to_string __P((u_int32_t));
 static void	 __db_prdb __P((DB *, FILE *));
-static void	 __db_proff __P((void *, FILE *));
+static void	 __db_proff __P((gpointer , FILE *));
 static int	 __db_prtree __P((DB *, FILE *, u_int32_t));
 static int	 __db_qmeta __P((DB *, FILE *, QMETA *, u_int32_t));
 
@@ -56,16 +56,16 @@ __db_loadme()
  * __db_dump --
  *	Dump the tree to a file.
  *
- * PUBLIC: int __db_dump __P((DB *, char *, char *));
+ * PUBLIC: gint __db_dump __P((DB *, gchar *, gchar *));
  */
-int
+gint
 __db_dump(dbp, op, name)
 	DB *dbp;
-	char *op, *name;
+	gchar *op, *name;
 {
 	FILE *fp;
 	u_int32_t flags;
-	int ret;
+	gint ret;
 
 	for (flags = 0; *op != '\0'; ++op)
 		switch (*op) {
@@ -106,14 +106,14 @@ __db_dump(dbp, op, name)
  *	Call a callback for printing or other handling of strings associated
  * with whatever in-memory DB structure flags are set.
  *
- * PUBLIC: void __db_inmemdbflags __P((u_int32_t, void *,
- * PUBLIC:     void (*)(u_int32_t, const FN *, void *)));
+ * PUBLIC: void __db_inmemdbflags __P((u_int32_t, gpointer ,
+ * PUBLIC:     void (*)(u_int32_t, const FN *, gpointer )));
  */
 void
 __db_inmemdbflags(flags, cookie, callback)
 	u_int32_t flags;
-	void *cookie;
-	void (*callback) __P((u_int32_t, const FN *, void *));
+	gpointer cookie;
+	void (*callback) __P((u_int32_t, const FN *, gpointer ));
 {
 	static const FN fn[] = {
 		{ DB_AM_CHKSUM,		"checksumming" },
@@ -225,7 +225,7 @@ __db_prtree(dbp, fp, flags)
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_pgno_t i, last;
-	int ret;
+	gint ret;
 
 	mpf = dbp->mpf;
 
@@ -264,8 +264,8 @@ __db_meta(dbp, dbmeta, fp, fn, flags)
 	PAGE *h;
 	db_pgno_t pgno;
 	u_int8_t *p;
-	int cnt, ret;
-	const char *sep;
+	gint cnt, ret;
+	const gchar *sep;
 
 	mpf = dbp->mpf;
 
@@ -370,7 +370,7 @@ __db_hmeta(dbp, fp, h, flags)
 		{ DB_HASH_SUBDB, "multiple-databases" },
 		{ 0,		 NULL }
 	};
-	int i;
+	gint i;
 
 	__db_meta(dbp, (DBMETA *)h, fp, mfn, flags);
 
@@ -415,9 +415,9 @@ __db_qmeta(dbp, fp, h, flags)
  * __db_prnpage
  *	-- Print out a specific page.
  *
- * PUBLIC: int __db_prnpage __P((DB *, db_pgno_t, FILE *));
+ * PUBLIC: gint __db_prnpage __P((DB *, db_pgno_t, FILE *));
  */
-int
+gint
 __db_prnpage(dbp, pgno, fp)
 	DB *dbp;
 	db_pgno_t pgno;
@@ -425,7 +425,7 @@ __db_prnpage(dbp, pgno, fp)
 {
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	mpf = dbp->mpf;
 
@@ -444,9 +444,9 @@ __db_prnpage(dbp, pgno, fp)
  * __db_prpage
  *	-- Print out a page.
  *
- * PUBLIC: int __db_prpage __P((DB *, PAGE *, FILE *, u_int32_t));
+ * PUBLIC: gint __db_prpage __P((DB *, PAGE *, FILE *, u_int32_t));
  */
-int
+gint
 __db_prpage(dbp, h, fp, flags)
 	DB *dbp;
 	PAGE *h;
@@ -463,9 +463,9 @@ __db_prpage(dbp, h, fp, flags)
 	db_recno_t recno;
 	u_int32_t pagesize, qlen;
 	u_int8_t *ep, *hk, *p;
-	int deleted, ret;
-	const char *s;
-	void *sp;
+	gint deleted, ret;
+	const gchar *s;
+	gpointer sp;
 
 	/*
 	 * If we're doing recovery testing and this page is P_INVALID,
@@ -701,7 +701,7 @@ __db_pr(p, len, fp)
 	FILE *fp;
 {
 	u_int lastch;
-	int i;
+	gint i;
 
 	fprintf(fp, "len: %3lu", (u_long)len);
 	lastch = '.';
@@ -727,25 +727,25 @@ __db_pr(p, len, fp)
  * __db_prdbt --
  *	Print out a DBT data element.
  *
- * PUBLIC: int __db_prdbt __P((DBT *, int, const char *, void *,
- * PUBLIC:     int (*)(void *, const void *), int, VRFY_DBINFO *));
+ * PUBLIC: gint __db_prdbt __P((DBT *, int, const gchar *, gpointer ,
+ * PUBLIC:     gint (*)(gpointer , gconstpointer ), int, VRFY_DBINFO *));
  */
-int
+gint
 __db_prdbt(dbtp, checkprint, prefix, handle, callback, is_recno, vdp)
 	DBT *dbtp;
-	int checkprint;
-	const char *prefix;
-	void *handle;
-	int (*callback) __P((void *, const void *));
-	int is_recno;
+	gint checkprint;
+	const gchar *prefix;
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
+	gint is_recno;
 	VRFY_DBINFO *vdp;
 {
-	static const char hex[] = "0123456789abcdef";
+	static const gchar hex[] = "0123456789abcdef";
 	db_recno_t recno;
 	u_int32_t len;
-	int ret;
+	gint ret;
 #define	DBTBUFLEN	100
-	char *p, *hp, buf[DBTBUFLEN], hbuf[DBTBUFLEN];
+	gchar *p, *hp, buf[DBTBUFLEN], hbuf[DBTBUFLEN];
 
 	if (vdp != NULL) {
 		/*
@@ -835,7 +835,7 @@ __db_prdbt(dbtp, checkprint, prefix, handle, callback, is_recno, vdp)
  */
 static void
 __db_proff(vp, fp)
-	void *vp;
+	gpointer vp;
 	FILE *fp;
 {
 	BOVERFLOW *bo;
@@ -856,21 +856,21 @@ __db_proff(vp, fp)
  * __db_prflags --
  *	Print out flags values.
  *
- * PUBLIC: void __db_prflags __P((u_int32_t, const FN *, void *));
+ * PUBLIC: void __db_prflags __P((u_int32_t, const FN *, gpointer ));
  */
 void
 __db_prflags(flags, fn, vfp)
 	u_int32_t flags;
 	FN const *fn;
-	void *vfp;
+	gpointer vfp;
 {
 	FILE *fp;
 	const FN *fnp;
-	int found;
-	const char *sep;
+	gint found;
+	const gchar *sep;
 
 	/*
-	 * We pass the FILE * through a void * so that we can use
+	 * We pass the FILE * through a gpointer  so that we can use
 	 * this function as as a callback.
 	 */
 	fp = (FILE *)vfp;
@@ -889,9 +889,9 @@ __db_prflags(flags, fn, vfp)
 /*
  * __db_dbtype_to_string --
  *	Return the name of the database type.
- * PUBLIC: const char * __db_dbtype_to_string __P((DBTYPE));
+ * PUBLIC: const gchar * __db_dbtype_to_string __P((DBTYPE));
  */
-const char *
+const gchar *
 __db_dbtype_to_string(type)
 	DBTYPE type;
 {
@@ -914,11 +914,11 @@ __db_dbtype_to_string(type)
  * __db_pagetype_to_string --
  *	Return the name of the specified page type.
  */
-static const char *
+static const gchar *
 __db_pagetype_to_string(type)
 	u_int32_t type;
 {
-	char *s;
+	gchar *s;
 
 	s = NULL;
 	switch (type) {
@@ -969,16 +969,16 @@ __db_pagetype_to_string(type)
  * __db_prheader --
  *	Write out header information in the format expected by db_load.
  *
- * PUBLIC: int	__db_prheader __P((DB *, char *, int, int, void *,
- * PUBLIC:     int (*)(void *, const void *), VRFY_DBINFO *, db_pgno_t));
+ * PUBLIC: int	__db_prheader __P((DB *, gchar *, int, int, gpointer ,
+ * PUBLIC:     gint (*)(gpointer , gconstpointer ), VRFY_DBINFO *, db_pgno_t));
  */
-int
+gint
 __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 	DB *dbp;
-	char *subname;
-	int pflag, keyflag;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gchar *subname;
+	gint pflag, keyflag;
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	VRFY_DBINFO *vdp;
 	db_pgno_t meta_pgno;
 {
@@ -988,8 +988,8 @@ __db_prheader(dbp, subname, pflag, keyflag, handle, callback, vdp, meta_pgno)
 	DB_QUEUE_STAT *qsp;
 	DBT dbt;
 	VRFY_PAGEINFO *pip;
-	char *buf;
-	int buflen, ret, t_ret;
+	gchar *buf;
+	gint buflen, ret, t_ret;
 	u_int32_t dbtype;
 
 	btsp = NULL;
@@ -1283,12 +1283,12 @@ err:	if (pip != NULL &&
  *	but for consistency's sake we don't want to put its literal contents
  *	in multiple places.
  *
- * PUBLIC: int __db_prfooter __P((void *, int (*)(void *, const void *)));
+ * PUBLIC: gint __db_prfooter __P((gpointer , gint (*)(gpointer , gconstpointer )));
  */
-int
+gint
 __db_prfooter(handle, callback)
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 {
 	return (callback(handle, "DATA=END\n"));
 }
diff --git a/libdb/db/db_rec.c b/libdb/db/db_rec.c
index 470df0f..e4226d6 100644
--- a/libdb/db/db_rec.c
+++ b/libdb/db/db_rec.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,19 +23,19 @@ static const char revid[] = "$Id$";
 #include "dbinc/hash.h"
 
 /*
- * PUBLIC: int __db_addrem_recover
- * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_addrem_recover
+ * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  *
  * This log message is generated whenever we add or remove a duplicate
  * to/from a duplicate page.  On recover, we just do the opposite.
  */
-int
+gint
 __db_addrem_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_addrem_args *argp;
 	DB *file_dbp;
@@ -43,7 +43,7 @@ __db_addrem_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	u_int32_t change;
-	int cmp_n, cmp_p, ret;
+	gint cmp_n, cmp_p, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -109,16 +109,16 @@ out:	if (pagep != NULL)
 }
 
 /*
- * PUBLIC: int __db_big_recover
- * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_big_recover
+ * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_big_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_big_args *argp;
 	DB *file_dbp;
@@ -126,7 +126,7 @@ __db_big_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	u_int32_t change;
-	int cmp_n, cmp_p, ret;
+	gint cmp_n, cmp_p, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -281,23 +281,23 @@ out:	if (pagep != NULL)
  * __db_ovref_recover --
  *	Recovery function for __db_ovref().
  *
- * PUBLIC: int __db_ovref_recover
- * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_ovref_recover
+ * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_ovref_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_ovref_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp, modified, ret;
+	gint cmp, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -343,23 +343,23 @@ out:	if (pagep != NULL)
  * __db_relink_recover --
  *	Recovery function for relink.
  *
- * PUBLIC: int __db_relink_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_relink_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_relink_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_relink_args *argp;
 	DB *file_dbp;
 	DBC *dbc;
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -480,19 +480,19 @@ out:	if (pagep != NULL)
  * __db_debug_recover --
  *	Recovery function for debug.
  *
- * PUBLIC: int __db_debug_recover __P((DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_debug_recover __P((DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_debug_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_debug_args *argp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbenv, NULL);
 	COMPQUIET(op, DB_TXN_ABORT);
@@ -511,16 +511,16 @@ __db_debug_recover(dbenv, dbtp, lsnp, op, info)
  * __db_noop_recover --
  *	Recovery function for noop.
  *
- * PUBLIC: int __db_noop_recover __P((DB_ENV *,
- * PUBLIC:      DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_noop_recover __P((DB_ENV *,
+ * PUBLIC:      DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_noop_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_noop_args *argp;
 	DB *file_dbp;
@@ -528,7 +528,7 @@ __db_noop_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	u_int32_t change;
-	int cmp_n, cmp_p, ret;
+	gint cmp_n, cmp_p, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -562,16 +562,16 @@ out:	if (pagep != NULL)
  * __db_pg_alloc_recover --
  *	Recovery function for pg_alloc.
  *
- * PUBLIC: int __db_pg_alloc_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_pg_alloc_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_pg_alloc_args *argp;
 	DB *file_dbp;
@@ -580,7 +580,7 @@ __db_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	db_pgno_t pgno;
-	int cmp_n, cmp_p, created, level, modified, ret;
+	gint cmp_n, cmp_p, created, level, modified, ret;
 
 	meta = NULL;
 	pagep = NULL;
@@ -751,16 +751,16 @@ out:	if (pagep != NULL)
  * __db_pg_free_recover --
  *	Recovery function for pg_free.
  *
- * PUBLIC: int __db_pg_free_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_pg_free_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_pg_free_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_pg_free_args *argp;
 	DB *file_dbp;
@@ -770,7 +770,7 @@ __db_pg_free_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	db_pgno_t pgno;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	COMPQUIET(info, NULL);
 	meta = NULL;
@@ -856,20 +856,20 @@ out:	if (pagep != NULL)
  * __db_cksum_recover --
  *	Recovery function for checksum failure log record.
  *
- * PUBLIC: int __db_cksum_recover __P((DB_ENV *,
- * PUBLIC:      DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __db_cksum_recover __P((DB_ENV *,
+ * PUBLIC:      DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __db_cksum_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__db_cksum_args *argp;
 
-	int ret;
+	gint ret;
 
 	COMPQUIET(info, NULL);
 	COMPQUIET(lsnp, NULL);
diff --git a/libdb/db/db_reclaim.c b/libdb/db/db_reclaim.c
index ef055cd..817fad5 100644
--- a/libdb/db/db_reclaim.c
+++ b/libdb/db/db_reclaim.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -30,19 +30,19 @@ static const char revid[] = "$Id$";
  * where did_put is a return value indicating if the page in question has
  * already been returned to the mpool.
  *
- * PUBLIC: int __db_traverse_big __P((DB *,
- * PUBLIC:     db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *));
+ * PUBLIC: gint __db_traverse_big __P((DB *,
+ * PUBLIC:     db_pgno_t, gint (*)(DB *, PAGE *, gpointer , gint *), gpointer ));
  */
-int
+gint
 __db_traverse_big(dbp, pgno, callback, cookie)
 	DB *dbp;
 	db_pgno_t pgno;
-	int (*callback) __P((DB *, PAGE *, void *, int *));
-	void *cookie;
+	gint (*callback) __P((DB *, PAGE *, gpointer , gint *));
+	gpointer cookie;
 {
 	DB_MPOOLFILE *mpf;
 	PAGE *p;
-	int did_put, ret;
+	gint did_put, ret;
 
 	mpf = dbp->mpf;
 
@@ -68,16 +68,16 @@ __db_traverse_big(dbp, pgno, callback, cookie)
  * actual free.  The reason that this is callback is because hash uses
  * the same traversal code for statistics gathering.
  *
- * PUBLIC: int __db_reclaim_callback __P((DB *, PAGE *, void *, int *));
+ * PUBLIC: gint __db_reclaim_callback __P((DB *, PAGE *, gpointer , gint *));
  */
-int
+gint
 __db_reclaim_callback(dbp, p, cookie, putp)
 	DB *dbp;
 	PAGE *p;
-	void *cookie;
-	int *putp;
+	gpointer cookie;
+	gint *putp;
 {
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbp, NULL);
 
@@ -94,14 +94,14 @@ __db_reclaim_callback(dbp, p, cookie, putp)
  * we are traversing a btree or hash table and trying to free all the
  * pages.
  *
- * PUBLIC: int __db_truncate_callback __P((DB *, PAGE *, void *, int *));
+ * PUBLIC: gint __db_truncate_callback __P((DB *, PAGE *, gpointer , gint *));
  */
-int
+gint
 __db_truncate_callback(dbp, p, cookie, putp)
 	DB *dbp;
 	PAGE *p;
-	void *cookie;
-	int *putp;
+	gpointer cookie;
+	gint *putp;
 {
 	DBMETA *meta;
 	DBT ldbt;
@@ -111,7 +111,7 @@ __db_truncate_callback(dbp, p, cookie, putp)
 	db_pgno_t pgno;
 	db_trunc_param *param;
 	u_int8_t *hk, type;
-	int ret;
+	gint ret;
 
 	top = NUM_ENT(p);
 	mpf = dbp->mpf;
diff --git a/libdb/db/db_remove.c b/libdb/db/db_remove.c
index 739571e..74b77e5 100644
--- a/libdb/db/db_remove.c
+++ b/libdb/db/db_remove.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,25 +23,25 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_shash.h"
 #include "dbinc/lock.h"
 
-static int __db_subdb_remove __P((DB *, DB_TXN *, const char *, const char *));
-static int __db_dbtxn_remove __P((DB *, DB_TXN *, const char *));
+static gint __db_subdb_remove __P((DB *, DB_TXN *, const gchar *, const gchar *));
+static gint __db_dbtxn_remove __P((DB *, DB_TXN *, const gchar *));
 
 /*
  * __dbenv_dbremove
  *	Remove method for DB_ENV.
  *
- * PUBLIC: int __dbenv_dbremove __P((DB_ENV *,
- * PUBLIC:     DB_TXN *, const char *, const char *, u_int32_t));
+ * PUBLIC: gint __dbenv_dbremove __P((DB_ENV *,
+ * PUBLIC:     DB_TXN *, const gchar *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbenv_dbremove(dbenv, txn, name, subdb, flags)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	u_int32_t flags;
 {
 	DB *dbp;
-	int ret, t_ret, txn_local;
+	gint ret, t_ret, txn_local;
 
 	txn_local = 0;
 
@@ -99,16 +99,16 @@ __dbenv_dbremove(dbenv, txn, name, subdb, flags)
  * __db_remove
  *	Remove method for DB.
  *
- * PUBLIC: int __db_remove __P((DB *, const char *, const char *, u_int32_t));
+ * PUBLIC: gint __db_remove __P((DB *, const gchar *, const gchar *, u_int32_t));
  */
-int
+gint
 __db_remove(dbp, name, subdb, flags)
 	DB *dbp;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
@@ -154,18 +154,18 @@ err:	if ((t_ret = dbp->close(dbp, DB_NOSYNC)) != 0 && ret == 0)
  * __db_remove_i
  *	Internal remove method for DB.
  *
- * PUBLIC: int __db_remove_i __P((DB *, DB_TXN *, const char *, const char *));
+ * PUBLIC: gint __db_remove_i __P((DB *, DB_TXN *, const gchar *, const gchar *));
  */
-int
+gint
 __db_remove_i(dbp, txn, name, subdb)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 {
 	DB_ENV *dbenv;
 	DB_LSN newlsn;
-	int ret;
-	char *real_name;
+	gint ret;
+	gchar *real_name;
 
 	dbenv = dbp->dbenv;
 	real_name = NULL;
@@ -211,10 +211,10 @@ static int
 __db_subdb_remove(dbp, txn, name, subdb)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 {
 	DB *mdbp, *sdbp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	mdbp = sdbp = NULL;
 
@@ -274,12 +274,12 @@ static int
 __db_dbtxn_remove(dbp, txn, name)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 {
 	DB_ENV *dbenv;
 	DB_LSN newlsn;
-	int ret;
-	char *tmpname;
+	gint ret;
+	gchar *tmpname;
 
 	dbenv = dbp->dbenv;
 	tmpname = NULL;
diff --git a/libdb/db/db_rename.c b/libdb/db/db_rename.c
index ee03938..acc9469 100644
--- a/libdb/db/db_rename.c
+++ b/libdb/db/db_rename.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,25 +24,25 @@ static const char revid[] = "$Id$";
 #include "dbinc/lock.h"
 #include "dbinc/log.h"
 
-static int __db_subdb_rename __P(( DB *, DB_TXN *,
-		const char *, const char *, const char *));
+static gint __db_subdb_rename __P(( DB *, DB_TXN *,
+		const gchar *, const gchar *, const gchar *));
 
 /*
  * __dbenv_dbrename
  *	Rename method for DB_ENV.
  *
- * PUBLIC: int __dbenv_dbrename __P((DB_ENV *, DB_TXN *,
- * PUBLIC:     const char *, const char *, const char *, u_int32_t));
+ * PUBLIC: gint __dbenv_dbrename __P((DB_ENV *, DB_TXN *,
+ * PUBLIC:     const gchar *, const gchar *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbenv_dbrename(dbenv, txn, name, subdb, newname, flags)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	const char *name, *subdb, *newname;
+	const gchar *name, *subdb, *newname;
 	u_int32_t flags;
 {
 	DB *dbp;
-	int ret, t_ret, txn_local;
+	gint ret, t_ret, txn_local;
 
 	txn_local = 0;
 
@@ -101,17 +101,17 @@ __dbenv_dbrename(dbenv, txn, name, subdb, newname, flags)
  * __db_rename
  *	Rename method for DB.
  *
- * PUBLIC: int __db_rename __P((DB *,
- * PUBLIC:     const char *, const char *, const char *, u_int32_t));
+ * PUBLIC: gint __db_rename __P((DB *,
+ * PUBLIC:     const gchar *, const gchar *, const gchar *, u_int32_t));
  */
-int
+gint
 __db_rename(dbp, name, subdb, newname, flags)
 	DB *dbp;
-	const char *name, *subdb, *newname;
+	const gchar *name, *subdb, *newname;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
@@ -157,18 +157,18 @@ err:	if ((t_ret = dbp->close(dbp, DB_NOSYNC)) != 0 && ret == 0)
  * __db_rename_i
  *	Internal rename method for DB.
  *
- * PUBLIC: int __db_rename_i __P((DB *,
- * PUBLIC:      DB_TXN *, const char *, const char *, const char *));
+ * PUBLIC: gint __db_rename_i __P((DB *,
+ * PUBLIC:      DB_TXN *, const gchar *, const gchar *, const gchar *));
  */
-int
+gint
 __db_rename_i(dbp, txn, name, subdb, newname)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb, *newname;
+	const gchar *name, *subdb, *newname;
 {
 	DB_ENV *dbenv;
-	int ret;
-	char *real_name;
+	gint ret;
+	gchar *real_name;
 
 	dbenv = dbp->dbenv;
 	real_name = NULL;
@@ -235,12 +235,12 @@ static int
 __db_subdb_rename(dbp, txn, name, subdb, newname)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb, *newname;
+	const gchar *name, *subdb, *newname;
 {
 	DB *mdbp;
 	DB_ENV *dbenv;
 	PAGE *meta;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	mdbp = NULL;
 	meta = NULL;
diff --git a/libdb/db/db_ret.c b/libdb/db/db_ret.c
index 2e4466e..50bb658 100644
--- a/libdb/db/db_ret.c
+++ b/libdb/db/db_ret.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,16 +25,16 @@ static const char revid[] = "$Id$";
  * __db_ret --
  *	Build return DBT.
  *
- * PUBLIC: int __db_ret __P((DB *,
- * PUBLIC:    PAGE *, u_int32_t, DBT *, void **, u_int32_t *));
+ * PUBLIC: gint __db_ret __P((DB *,
+ * PUBLIC:    PAGE *, u_int32_t, DBT *, gpointer *, u_int32_t *));
  */
-int
+gint
 __db_ret(dbp, h, indx, dbt, memp, memsize)
 	DB *dbp;
 	PAGE *h;
 	u_int32_t indx;
 	DBT *dbt;
-	void **memp;
+	gpointer *memp;
 	u_int32_t *memsize;
 {
 	BKEYDATA *bk;
@@ -42,7 +42,7 @@ __db_ret(dbp, h, indx, dbt, memp, memsize)
 	BOVERFLOW *bo;
 	u_int32_t len;
 	u_int8_t *hk;
-	void *data;
+	gpointer data;
 
 	switch (TYPE(h)) {
 	case P_HASH:
@@ -78,19 +78,19 @@ __db_ret(dbp, h, indx, dbt, memp, memsize)
  * __db_retcopy --
  *	Copy the returned data into the user's DBT, handling special flags.
  *
- * PUBLIC: int __db_retcopy __P((DB_ENV *, DBT *,
- * PUBLIC:    void *, u_int32_t, void **, u_int32_t *));
+ * PUBLIC: gint __db_retcopy __P((DB_ENV *, DBT *,
+ * PUBLIC:    gpointer , u_int32_t, gpointer *, u_int32_t *));
  */
-int
+gint
 __db_retcopy(dbenv, dbt, data, len, memp, memsize)
 	DB_ENV *dbenv;
 	DBT *dbt;
-	void *data;
+	gpointer data;
 	u_int32_t len;
-	void **memp;
+	gpointer *memp;
 	u_int32_t *memsize;
 {
-	int ret;
+	gint ret;
 
 	/* If returning a partial record, reset the length. */
 	if (F_ISSET(dbt, DB_DBT_PARTIAL)) {
diff --git a/libdb/db/db_truncate.c b/libdb/db/db_truncate.c
index c71d431..4b58f38 100644
--- a/libdb/db/db_truncate.c
+++ b/libdb/db/db_truncate.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,16 +25,16 @@ static const char revid[] = "$Id$";
  * __db_truncate
  *	truncate method for DB.
  *
- * PUBLIC: int __db_truncate __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
+ * PUBLIC: gint __db_truncate __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
  */
-int
+gint
 __db_truncate(dbp, txn, countp, flags)
 	DB *dbp;
 	DB_TXN *txn;
 	u_int32_t *countp, flags;
 {
 	DB_ENV *dbenv;
-	int ret, t_ret, txn_local;
+	gint ret, t_ret, txn_local;
 
 	dbenv = dbp->dbenv;
 	ret = txn_local = 0;
diff --git a/libdb/db/db_upg.c b/libdb/db/db_upg.c
index 463e67c..751b42e 100644
--- a/libdb/db/db_upg.c
+++ b/libdb/db/db_upg.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,8 +24,8 @@ static const char revid[] = "$Id$";
 #include "dbinc/hash.h"
 #include "dbinc/qam.h"
 
-static int (* const func_31_list[P_PAGETYPE_MAX])
-    __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)) = {
+static gint (* const func_31_list[P_PAGETYPE_MAX])
+    __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *)) = {
 	NULL,			/* P_INVALID */
 	NULL,			/* __P_DUPLICATE */
 	__ham_31_hash,		/* P_HASH */
@@ -38,27 +38,27 @@ static int (* const func_31_list[P_PAGETYPE_MAX])
 	__bam_31_btreemeta,	/* P_BTREEMETA */
 };
 
-static int __db_page_pass __P((DB *, char *, u_int32_t, int (* const [])
-	       (DB *, char *, u_int32_t, DB_FH *, PAGE *, int *), DB_FH *));
+static gint __db_page_pass __P((DB *, gchar *, u_int32_t, gint (* const [])
+	       (DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *), DB_FH *));
 
 /*
  * __db_upgrade --
  *	Upgrade an existing database.
  *
- * PUBLIC: int __db_upgrade __P((DB *, const char *, u_int32_t));
+ * PUBLIC: gint __db_upgrade __P((DB *, const gchar *, u_int32_t));
  */
-int
+gint
 __db_upgrade(dbp, fname, flags)
 	DB *dbp;
-	const char *fname;
+	const gchar *fname;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
 	DB_FH fh;
 	size_t n;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int8_t mbuf[256];
-	char *real_name;
+	gchar *real_name;
 
 	dbenv = dbp->dbenv;
 
@@ -252,17 +252,17 @@ err:	if ((t_ret = __os_closehandle(dbenv, &fh)) != 0 && ret == 0)
 static int
 __db_page_pass(dbp, real_name, flags, fl, fhp)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int32_t flags;
-	int (* const fl[P_PAGETYPE_MAX])
-	    __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
+	gint (* const fl[P_PAGETYPE_MAX])
+	    __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
 	DB_FH *fhp;
 {
 	DB_ENV *dbenv;
 	PAGE *page;
 	db_pgno_t i, pgno_last;
 	size_t n;
-	int dirty, ret;
+	gint dirty, ret;
 
 	dbenv = dbp->dbenv;
 
@@ -305,19 +305,19 @@ __db_page_pass(dbp, real_name, flags, fl, fhp)
  * __db_lastpgno --
  *	Return the current last page number of the file.
  *
- * PUBLIC: int __db_lastpgno __P((DB *, char *, DB_FH *, db_pgno_t *));
+ * PUBLIC: gint __db_lastpgno __P((DB *, gchar *, DB_FH *, db_pgno_t *));
  */
-int
+gint
 __db_lastpgno(dbp, real_name, fhp, pgno_lastp)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	DB_FH *fhp;
 	db_pgno_t *pgno_lastp;
 {
 	DB_ENV *dbenv;
 	db_pgno_t pgno_last;
 	u_int32_t mbytes, bytes;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
diff --git a/libdb/db/db_upg_opd.c b/libdb/db/db_upg_opd.c
index aba2028..536aa6f 100644
--- a/libdb/db/db_upg_opd.c
+++ b/libdb/db/db_upg_opd.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,9 +21,9 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_page.h"
 #include "dbinc/btree.h"
 
-static int __db_build_bi __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, int *));
-static int __db_build_ri __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, int *));
-static int __db_up_ovref __P((DB *, DB_FH *, db_pgno_t));
+static gint __db_build_bi __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, gint *));
+static gint __db_build_ri __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, gint *));
+static gint __db_up_ovref __P((DB *, DB_FH *, db_pgno_t));
 
 #define	GET_PAGE(dbp, fhp, pgno, page) {				\
 	if ((ret = __os_seek(dbp->dbenv,				\
@@ -46,14 +46,14 @@ static int __db_up_ovref __P((DB *, DB_FH *, db_pgno_t));
  * __db_31_offdup --
  *	Convert 3.0 off-page duplicates to 3.1 off-page duplicates.
  *
- * PUBLIC: int __db_31_offdup __P((DB *, char *, DB_FH *, int, db_pgno_t *));
+ * PUBLIC: gint __db_31_offdup __P((DB *, gchar *, DB_FH *, int, db_pgno_t *));
  */
-int
+gint
 __db_31_offdup(dbp, real_name, fhp, sorted, pgnop)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	DB_FH *fhp;
-	int sorted;
+	gint sorted;
 	db_pgno_t *pgnop;
 {
 	PAGE *ipage, *page;
@@ -62,7 +62,7 @@ __db_31_offdup(dbp, real_name, fhp, sorted, pgnop)
 	db_pgno_t *pgno_next, pgno_max, *tmp;
 	db_recno_t nrecs;
 	size_t n;
-	int level, nomem, ret;
+	gint level, nomem, ret;
 
 	ipage = page = NULL;
 	pgno_cur = pgno_next = NULL;
@@ -205,12 +205,12 @@ __db_build_bi(dbp, fhp, ipage, page, indx, nomemp)
 	DB_FH *fhp;
 	PAGE *ipage, *page;
 	u_int32_t indx;
-	int *nomemp;
+	gint *nomemp;
 {
 	BINTERNAL bi, *child_bi;
 	BKEYDATA *child_bk;
 	u_int8_t *p;
-	int ret;
+	gint ret;
 	db_indx_t *inp;
 
 	inp = P_INP(dbp, ipage);
@@ -304,7 +304,7 @@ __db_build_ri(dbp, fhp, ipage, page, indx, nomemp)
 	DB_FH *fhp;
 	PAGE *ipage, *page;
 	u_int32_t indx;
-	int *nomemp;
+	gint *nomemp;
 {
 	RINTERNAL ri;
 	db_indx_t *inp;
@@ -336,7 +336,7 @@ __db_up_ovref(dbp, fhp, pgno)
 {
 	PAGE *page;
 	size_t n;
-	int ret;
+	gint ret;
 
 	/* Allocate room to hold a page. */
 	if ((ret = __os_malloc(dbp->dbenv, dbp->pgsize, &page)) != 0)
diff --git a/libdb/db/db_vrfy.c b/libdb/db/db_vrfy.c
index d05556b..1529475 100644
--- a/libdb/db/db_vrfy.c
+++ b/libdb/db/db_vrfy.c
@@ -10,7 +10,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -30,35 +30,35 @@ static const char revid[] = "$Id$";
 #include "dbinc/qam.h"
 #include "dbinc/txn.h"
 
-static int  __db_guesspgsize __P((DB_ENV *, DB_FH *));
-static int  __db_is_valid_magicno __P((u_int32_t, DBTYPE *));
-static int  __db_is_valid_pagetype __P((u_int32_t));
-static int  __db_meta2pgset
+static gint  __db_guesspgsize __P((DB_ENV *, DB_FH *));
+static gint  __db_is_valid_magicno __P((u_int32_t, DBTYPE *));
+static gint  __db_is_valid_pagetype __P((u_int32_t));
+static gint  __db_meta2pgset
 		__P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, DB *));
-static int __db_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t,
-		PAGE *, void *, int (*)(void *, const void *), u_int32_t));
-static int __db_salvage_subdbpg __P((DB *, VRFY_DBINFO *,
-		PAGE *, void *, int (*)(void *, const void *), u_int32_t));
-static int  __db_salvage_subdbs
-		__P((DB *, VRFY_DBINFO *, void *,
-		int(*)(void *, const void *), u_int32_t, int *));
-static int  __db_salvage_unknowns
-		__P((DB *, VRFY_DBINFO *, void *,
-		int (*)(void *, const void *), u_int32_t));
-static int  __db_vrfy_common
+static gint __db_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t,
+		PAGE *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
+static gint __db_salvage_subdbpg __P((DB *, VRFY_DBINFO *,
+		PAGE *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
+static gint  __db_salvage_subdbs
+		__P((DB *, VRFY_DBINFO *, gpointer ,
+		int(*)(gpointer , gconstpointer ), u_int32_t, gint *));
+static gint  __db_salvage_unknowns
+		__P((DB *, VRFY_DBINFO *, gpointer ,
+		gint (*)(gpointer , gconstpointer ), u_int32_t));
+static gint  __db_vrfy_common
 		__P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
-static int  __db_vrfy_freelist __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
-static int  __db_vrfy_invalid
+static gint  __db_vrfy_freelist __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
+static gint  __db_vrfy_invalid
 		__P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
-static int  __db_vrfy_orderchkonly __P((DB *,
-		VRFY_DBINFO *, const char *, const char *, u_int32_t));
-static int  __db_vrfy_pagezero __P((DB *, VRFY_DBINFO *, DB_FH *, u_int32_t));
-static int  __db_vrfy_subdbs
-		__P((DB *, VRFY_DBINFO *, const char *, u_int32_t));
-static int  __db_vrfy_structure
-		__P((DB *, VRFY_DBINFO *, const char *, db_pgno_t, u_int32_t));
-static int  __db_vrfy_walkpages
-		__P((DB *, VRFY_DBINFO *, void *, int (*)(void *, const void *),
+static gint  __db_vrfy_orderchkonly __P((DB *,
+		VRFY_DBINFO *, const gchar *, const gchar *, u_int32_t));
+static gint  __db_vrfy_pagezero __P((DB *, VRFY_DBINFO *, DB_FH *, u_int32_t));
+static gint  __db_vrfy_subdbs
+		__P((DB *, VRFY_DBINFO *, const gchar *, u_int32_t));
+static gint  __db_vrfy_structure
+		__P((DB *, VRFY_DBINFO *, const gchar *, db_pgno_t, u_int32_t));
+static gint  __db_vrfy_walkpages
+		__P((DB *, VRFY_DBINFO *, gpointer , gint (*)(gpointer , gconstpointer ),
 		u_int32_t));
 
 /*
@@ -86,13 +86,13 @@ static int  __db_vrfy_walkpages
  *	which lets us pass appropriate equivalents to FILE * in from the
  *	non-C APIs.
  *
- * PUBLIC: int __db_verify
- * PUBLIC:     __P((DB *, const char *, const char *, FILE *, u_int32_t));
+ * PUBLIC: gint __db_verify
+ * PUBLIC:     __P((DB *, const gchar *, const gchar *, FILE *, u_int32_t));
  */
-int
+gint
 __db_verify(dbp, file, database, outfile, flags)
 	DB *dbp;
-	const char *file, *database;
+	const gchar *file, *database;
 	FILE *outfile;
 	u_int32_t flags;
 {
@@ -105,17 +105,17 @@ __db_verify(dbp, file, database, outfile, flags)
  * __db_verify_callback --
  *	Callback function for using pr_* functions from C.
  *
- * PUBLIC: int  __db_verify_callback __P((void *, const void *));
+ * PUBLIC: gint  __db_verify_callback __P((gpointer , gconstpointer ));
  */
-int
+gint
 __db_verify_callback(handle, str_arg)
-	void *handle;
-	const void *str_arg;
+	gpointer handle;
+	gconstpointer str_arg;
 {
-	char *str;
+	gchar *str;
 	FILE *f;
 
-	str = (char *)str_arg;
+	str = (gchar *)str_arg;
 	f = (FILE *)handle;
 
 	if (fprintf(f, "%s", str) != (int)strlen(str))
@@ -128,23 +128,23 @@ __db_verify_callback(handle, str_arg)
  * __db_verify_internal --
  *	Inner meat of __db_verify.
  *
- * PUBLIC: int __db_verify_internal __P((DB *, const char *,
- * PUBLIC:     const char *, void *, int (*)(void *, const void *), u_int32_t));
+ * PUBLIC: gint __db_verify_internal __P((DB *, const gchar *,
+ * PUBLIC:     const gchar *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
  */
-int
+gint
 __db_verify_internal(dbp_orig, name, subdb, handle, callback, flags)
 	DB *dbp_orig;
-	const char *name, *subdb;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	const gchar *name, *subdb;
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
 {
 	DB *dbp;
 	DB_ENV *dbenv;
 	DB_FH fh, *fhp;
 	VRFY_DBINFO *vdp;
-	int has, ret, isbad;
-	char *real_name;
+	gint has, ret, isbad;
+	gchar *real_name;
 
 	dbenv = dbp_orig->dbenv;
 	vdp = NULL;
@@ -429,7 +429,7 @@ __db_vrfy_pagezero(dbp, vdp, fhp, flags)
 	VRFY_PAGEINFO *pip;
 	db_pgno_t freelist;
 	size_t nr;
-	int isbad, ret, swapped;
+	gint isbad, ret, swapped;
 	u_int8_t mbuf[DBMETASIZE];
 
 	isbad = ret = swapped = 0;
@@ -603,15 +603,15 @@ static int
 __db_vrfy_walkpages(dbp, vdp, handle, callback, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_pgno_t i;
-	int ret, t_ret, isbad;
+	gint ret, t_ret, isbad;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -782,7 +782,7 @@ static int
 __db_vrfy_structure(dbp, vdp, dbname, meta_pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
-	const char *dbname;
+	const gchar *dbname;
 	db_pgno_t meta_pgno;
 	u_int32_t flags;
 {
@@ -790,7 +790,7 @@ __db_vrfy_structure(dbp, vdp, dbname, meta_pgno, flags)
 	DB_ENV *dbenv;
 	VRFY_PAGEINFO *pip;
 	db_pgno_t i;
-	int ret, isbad, hassubs, p;
+	gint ret, isbad, hassubs, p;
 
 	isbad = 0;
 	pip = NULL;
@@ -993,7 +993,7 @@ __db_vrfy_common(dbp, vdp, h, pgno, flags)
 {
 	DB_ENV *dbenv;
 	VRFY_PAGEINFO *pip;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int8_t *p;
 
 	dbenv = dbp->dbenv;
@@ -1067,7 +1067,7 @@ __db_vrfy_invalid(dbp, vdp, h, pgno, flags)
 {
 	DB_ENV *dbenv;
 	VRFY_PAGEINFO *pip;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
@@ -1097,10 +1097,10 @@ __db_vrfy_invalid(dbp, vdp, h, pgno, flags)
  *	all-page-type-common elements of pip have been verified and filled
  *	in.
  *
- * PUBLIC: int __db_vrfy_datapage
+ * PUBLIC: gint __db_vrfy_datapage
  * PUBLIC:     __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
  */
-int
+gint
 __db_vrfy_datapage(dbp, vdp, h, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -1110,7 +1110,7 @@ __db_vrfy_datapage(dbp, vdp, h, pgno, flags)
 {
 	DB_ENV *dbenv;
 	VRFY_PAGEINFO *pip;
-	int isbad, ret, t_ret;
+	gint isbad, ret, t_ret;
 
 	dbenv = dbp->dbenv;
 
@@ -1212,10 +1212,10 @@ __db_vrfy_datapage(dbp, vdp, h, pgno, flags)
  *	Verify the access-method common parts of a meta page, using
  *	normal mpool routines.
  *
- * PUBLIC: int __db_vrfy_meta
+ * PUBLIC: gint __db_vrfy_meta
  * PUBLIC:     __P((DB *, VRFY_DBINFO *, DBMETA *, db_pgno_t, u_int32_t));
  */
-int
+gint
 __db_vrfy_meta(dbp, vdp, meta, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -1226,7 +1226,7 @@ __db_vrfy_meta(dbp, vdp, meta, pgno, flags)
 	DB_ENV *dbenv;
 	DBTYPE dbtype, magtype;
 	VRFY_PAGEINFO *pip;
-	int isbad, ret, t_ret;
+	gint isbad, ret, t_ret;
 
 	isbad = 0;
 	dbenv = dbp->dbenv;
@@ -1338,7 +1338,7 @@ __db_vrfy_freelist(dbp, vdp, meta, flags)
 	DB_ENV *dbenv;
 	VRFY_PAGEINFO *pip;
 	db_pgno_t cur_pgno, next_pgno;
-	int p, ret, t_ret;
+	gint p, ret, t_ret;
 
 	pgset = vdp->pgset;
 	DB_ASSERT(pgset != NULL);
@@ -1398,7 +1398,7 @@ static int
 __db_vrfy_subdbs(dbp, vdp, dbname, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
-	const char *dbname;
+	const gchar *dbname;
 	u_int32_t flags;
 {
 	DB *mdbp;
@@ -1407,7 +1407,7 @@ __db_vrfy_subdbs(dbp, vdp, dbname, flags)
 	DB_ENV *dbenv;
 	VRFY_PAGEINFO *pip;
 	db_pgno_t meta_pgno;
-	int ret, t_ret, isbad;
+	gint ret, t_ret, isbad;
 	u_int8_t type;
 
 	isbad = 0;
@@ -1503,7 +1503,7 @@ __db_vrfy_struct_feedback(dbp, vdp)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 {
-	int progress;
+	gint progress;
 
 	if (dbp->db_feedback == NULL)
 		return;
@@ -1524,7 +1524,7 @@ static int
 __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	u_int32_t flags;
 {
 	BTMETA *btmeta;
@@ -1538,7 +1538,7 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags)
 	PAGE *h, *currpg;
 	db_pgno_t meta_pgno, p, pgno;
 	u_int32_t bucket;
-	int t_ret, ret;
+	gint t_ret, ret;
 
 	pgset = NULL;
 	pgsc = NULL;
@@ -1555,7 +1555,7 @@ __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags)
 		goto err;
 
 	memset(&key, 0, sizeof(key));
-	key.data = (void *)subdb;
+	key.data = (gpointer)subdb;
 	key.size = (u_int32_t)strlen(subdb);
 	memset(&data, 0, sizeof(data));
 	if ((ret = mdbp->get(mdbp, NULL, &key, &data, 0)) != 0)
@@ -1692,8 +1692,8 @@ __db_salvage(dbp, vdp, pgno, h, handle, callback, flags)
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
 	PAGE *h;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
 {
 	DB_ASSERT(LF_ISSET(DB_SALVAGE));
@@ -1752,8 +1752,8 @@ static int
 __db_salvage_unknowns(dbp, vdp, handle, callback, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
 {
 	DBT unkdbt, key, *dbt;
@@ -1762,8 +1762,8 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags)
 	PAGE *h;
 	db_pgno_t pgno;
 	u_int32_t pgtype;
-	int ret, err_ret;
-	void *ovflbuf;
+	gint ret, err_ret;
+	gpointer ovflbuf;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -1854,16 +1854,16 @@ __db_salvage_unknowns(dbp, vdp, handle, callback, flags)
  *	since verification can't continue from there;  returns DB_VERIFY_BAD
  *	if anything else is wrong.
  *
- * PUBLIC: int __db_vrfy_inpitem __P((DB *, PAGE *,
+ * PUBLIC: gint __db_vrfy_inpitem __P((DB *, PAGE *,
  * PUBLIC:     db_pgno_t, u_int32_t, int, u_int32_t, u_int32_t *, u_int32_t *));
  */
-int
+gint
 __db_vrfy_inpitem(dbp, h, pgno, i, is_btree, flags, himarkp, offsetp)
 	DB *dbp;
 	PAGE *h;
 	db_pgno_t pgno;
 	u_int32_t i;
-	int is_btree;
+	gint is_btree;
 	u_int32_t flags, *himarkp, *offsetp;
 {
 	BKEYDATA *bk;
@@ -1950,10 +1950,10 @@ __db_vrfy_inpitem(dbp, h, pgno, i, is_btree, flags, himarkp, offsetp)
  *	verify that the dup tree type is correct--i.e., it's a recno
  *	if DUPSORT is not set and a btree if it is.
  *
- * PUBLIC: int __db_vrfy_duptype
+ * PUBLIC: gint __db_vrfy_duptype
  * PUBLIC:     __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
  */
-int
+gint
 __db_vrfy_duptype(dbp, vdp, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -1962,7 +1962,7 @@ __db_vrfy_duptype(dbp, vdp, pgno, flags)
 {
 	DB_ENV *dbenv;
 	VRFY_PAGEINFO *pip;
-	int ret, isbad;
+	gint ret, isbad;
 
 	dbenv = dbp->dbenv;
 	isbad = 0;
@@ -2030,22 +2030,22 @@ __db_vrfy_duptype(dbp, vdp, pgno, flags)
  *	done, so each page gets printed exactly once and we don't get caught
  *	in any cycles.
  *
- * PUBLIC: int __db_salvage_duptree __P((DB *, VRFY_DBINFO *, db_pgno_t,
- * PUBLIC:     DBT *, void *, int (*)(void *, const void *), u_int32_t));
+ * PUBLIC: gint __db_salvage_duptree __P((DB *, VRFY_DBINFO *, db_pgno_t,
+ * PUBLIC:     DBT *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
  */
-int
+gint
 __db_salvage_duptree(dbp, vdp, pgno, key, handle, callback, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
 	DBT *key;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
 {
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	mpf = dbp->mpf;
 
@@ -2098,10 +2098,10 @@ static int
 __db_salvage_subdbs(dbp, vdp, handle, callback, flags, hassubsp)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
-	int *hassubsp;
+	gint *hassubsp;
 {
 	BTMETA *btmeta;
 	DB *pgset;
@@ -2109,7 +2109,7 @@ __db_salvage_subdbs(dbp, vdp, handle, callback, flags, hassubsp)
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_pgno_t p, meta_pgno;
-	int ret, err_ret;
+	gint ret, err_ret;
 
 	pgset = NULL;
 	pgsc = NULL;
@@ -2207,8 +2207,8 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	PAGE *master;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
 {
 	BKEYDATA *bkkey, *bkdata;
@@ -2221,8 +2221,8 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags)
 	PAGE *subpg;
 	db_indx_t i;
 	db_pgno_t meta_pgno, p;
-	int ret, err_ret, t_ret;
-	char *subdbname;
+	gint ret, err_ret, t_ret;
+	gchar *subdbname;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -2248,7 +2248,7 @@ __db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags)
 			 */
 			bo = (BOVERFLOW *)bkkey;
 			if ((ret = __db_safe_goff(dbp, vdp, bo->pgno, &key,
-			    (void **)&subdbname, flags)) != 0) {
+			    (gpointer *)&subdbname, flags)) != 0) {
 				err_ret = DB_VERIFY_BAD;
 				continue;
 			}
@@ -2390,7 +2390,7 @@ __db_meta2pgset(dbp, vdp, pgno, flags, pgset)
 {
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	mpf = dbp->mpf;
 
diff --git a/libdb/db/db_vrfyutil.c b/libdb/db/db_vrfyutil.c
index e7fc70a..fdb7d3e 100644
--- a/libdb/db/db_vrfyutil.c
+++ b/libdb/db/db_vrfyutil.c
@@ -10,7 +10,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,17 +24,17 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_verify.h"
 #include "dbinc/db_am.h"
 
-static int __db_vrfy_pageinfo_create __P((DB_ENV *, VRFY_PAGEINFO **));
-static int __db_vrfy_pgset_iinc __P((DB *, db_pgno_t, int));
+static gint __db_vrfy_pageinfo_create __P((DB_ENV *, VRFY_PAGEINFO **));
+static gint __db_vrfy_pgset_iinc __P((DB *, db_pgno_t, int));
 
 /*
  * __db_vrfy_dbinfo_create --
  *	Allocate and initialize a VRFY_DBINFO structure.
  *
- * PUBLIC: int __db_vrfy_dbinfo_create
+ * PUBLIC: gint __db_vrfy_dbinfo_create
  * PUBLIC:     __P((DB_ENV *, u_int32_t, VRFY_DBINFO **));
  */
-int
+gint
 __db_vrfy_dbinfo_create(dbenv, pgsize, vdpp)
 	DB_ENV *dbenv;
 	u_int32_t pgsize;
@@ -42,13 +42,13 @@ __db_vrfy_dbinfo_create(dbenv, pgsize, vdpp)
 {
 	DB *cdbp, *pgdbp, *pgset;
 	VRFY_DBINFO *vdp;
-	int ret;
+	gint ret;
 
 	vdp = NULL;
 	cdbp = pgdbp = pgset = NULL;
 
 	if ((ret = __os_calloc(NULL,
-	    1, sizeof(VRFY_DBINFO), (void **)&vdp)) != 0)
+	    1, sizeof(VRFY_DBINFO), (gpointer *)&vdp)) != 0)
 		goto err;
 
 	if ((ret = db_create(&cdbp, dbenv, 0)) != 0)
@@ -100,15 +100,15 @@ err:	if (cdbp != NULL)
  *	Destructor for VRFY_DBINFO.  Destroys VRFY_PAGEINFOs and deallocates
  *	structure.
  *
- * PUBLIC: int __db_vrfy_dbinfo_destroy __P((DB_ENV *, VRFY_DBINFO *));
+ * PUBLIC: gint __db_vrfy_dbinfo_destroy __P((DB_ENV *, VRFY_DBINFO *));
  */
-int
+gint
 __db_vrfy_dbinfo_destroy(dbenv, vdp)
 	DB_ENV *dbenv;
 	VRFY_DBINFO *vdp;
 {
 	VRFY_CHILDINFO *c, *d;
-	int t_ret, ret;
+	gint t_ret, ret;
 
 	ret = 0;
 
@@ -136,10 +136,10 @@ __db_vrfy_dbinfo_destroy(dbenv, vdp)
  * __db_vrfy_getpageinfo --
  *	Get a PAGEINFO structure for a given page, creating it if necessary.
  *
- * PUBLIC: int __db_vrfy_getpageinfo
+ * PUBLIC: gint __db_vrfy_getpageinfo
  * PUBLIC:     __P((VRFY_DBINFO *, db_pgno_t, VRFY_PAGEINFO **));
  */
-int
+gint
 __db_vrfy_getpageinfo(vdp, pgno, pipp)
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
@@ -148,7 +148,7 @@ __db_vrfy_getpageinfo(vdp, pgno, pipp)
 	DBT key, data;
 	DB *pgdbp;
 	VRFY_PAGEINFO *pip;
-	int ret;
+	gint ret;
 
 	/*
 	 * We want a page info struct.  There are three places to get it from,
@@ -210,10 +210,10 @@ found:	pip->pi_refcount++;
  * __db_vrfy_putpageinfo --
  *	Put back a VRFY_PAGEINFO that we're done with.
  *
- * PUBLIC: int __db_vrfy_putpageinfo __P((DB_ENV *,
+ * PUBLIC: gint __db_vrfy_putpageinfo __P((DB_ENV *,
  * PUBLIC:     VRFY_DBINFO *, VRFY_PAGEINFO *));
  */
-int
+gint
 __db_vrfy_putpageinfo(dbenv, vdp, pip)
 	DB_ENV *dbenv;
 	VRFY_DBINFO *vdp;
@@ -222,9 +222,9 @@ __db_vrfy_putpageinfo(dbenv, vdp, pip)
 	DBT key, data;
 	DB *pgdbp;
 	VRFY_PAGEINFO *p;
-	int ret;
+	gint ret;
 #ifdef DIAGNOSTIC
-	int found;
+	gint found;
 
 	found = 0;
 #endif
@@ -269,16 +269,16 @@ __db_vrfy_putpageinfo(dbenv, vdp, pip)
  *	(A mapping from page number to int, used by the *_meta2pgset functions,
  *	as well as for keeping track of which pages the verifier has seen.)
  *
- * PUBLIC: int __db_vrfy_pgset __P((DB_ENV *, u_int32_t, DB **));
+ * PUBLIC: gint __db_vrfy_pgset __P((DB_ENV *, u_int32_t, DB **));
  */
-int
+gint
 __db_vrfy_pgset(dbenv, pgsize, dbpp)
 	DB_ENV *dbenv;
 	u_int32_t pgsize;
 	DB **dbpp;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 
 	if ((ret = db_create(&dbp, dbenv, 0)) != 0)
 		return (ret);
@@ -298,16 +298,16 @@ err:		(void)dbp->close(dbp, 0);
  *	Get the value associated in a page set with a given pgno.  Return
  *	a 0 value (and succeed) if we've never heard of this page.
  *
- * PUBLIC: int __db_vrfy_pgset_get __P((DB *, db_pgno_t, int *));
+ * PUBLIC: gint __db_vrfy_pgset_get __P((DB *, db_pgno_t, gint *));
  */
-int
+gint
 __db_vrfy_pgset_get(dbp, pgno, valp)
 	DB *dbp;
 	db_pgno_t pgno;
-	int *valp;
+	gint *valp;
 {
 	DBT key, data;
-	int ret, val;
+	gint ret, val;
 
 	memset(&key, 0, sizeof(DBT));
 	memset(&data, 0, sizeof(DBT));
@@ -334,9 +334,9 @@ __db_vrfy_pgset_get(dbp, pgno, valp)
  * __db_vrfy_pgset_inc --
  *	Increment the value associated with a pgno by 1.
  *
- * PUBLIC: int __db_vrfy_pgset_inc __P((DB *, db_pgno_t));
+ * PUBLIC: gint __db_vrfy_pgset_inc __P((DB *, db_pgno_t));
  */
-int
+gint
 __db_vrfy_pgset_inc(dbp, pgno)
 	DB *dbp;
 	db_pgno_t pgno;
@@ -349,9 +349,9 @@ __db_vrfy_pgset_inc(dbp, pgno)
  * __db_vrfy_pgset_dec --
  *	Increment the value associated with a pgno by 1.
  *
- * PUBLIC: int __db_vrfy_pgset_dec __P((DB *, db_pgno_t));
+ * PUBLIC: gint __db_vrfy_pgset_dec __P((DB *, db_pgno_t));
  */
-int
+gint
 __db_vrfy_pgset_dec(dbp, pgno)
 	DB *dbp;
 	db_pgno_t pgno;
@@ -369,11 +369,11 @@ static int
 __db_vrfy_pgset_iinc(dbp, pgno, i)
 	DB *dbp;
 	db_pgno_t pgno;
-	int i;
+	gint i;
 {
 	DBT key, data;
-	int ret;
-	int val;
+	gint ret;
+	gint val;
 
 	memset(&key, 0, sizeof(DBT));
 	memset(&data, 0, sizeof(DBT));
@@ -403,16 +403,16 @@ __db_vrfy_pgset_iinc(dbp, pgno, i)
  *	Given a cursor open in a pgset database, get the next page in the
  *	set.
  *
- * PUBLIC: int __db_vrfy_pgset_next __P((DBC *, db_pgno_t *));
+ * PUBLIC: gint __db_vrfy_pgset_next __P((DBC *, db_pgno_t *));
  */
-int
+gint
 __db_vrfy_pgset_next(dbc, pgnop)
 	DBC *dbc;
 	db_pgno_t *pgnop;
 {
 	DBT key, data;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	memset(&key, 0, sizeof(DBT));
 	memset(&data, 0, sizeof(DBT));
@@ -436,16 +436,16 @@ __db_vrfy_pgset_next(dbc, pgnop)
  *	Create a cursor to walk the child list with.  Returns with a nonzero
  *	final argument if the specified page has no children.
  *
- * PUBLIC: int __db_vrfy_childcursor __P((VRFY_DBINFO *, DBC **));
+ * PUBLIC: gint __db_vrfy_childcursor __P((VRFY_DBINFO *, DBC **));
  */
-int
+gint
 __db_vrfy_childcursor(vdp, dbcp)
 	VRFY_DBINFO *vdp;
 	DBC **dbcp;
 {
 	DB *cdbp;
 	DBC *dbc;
-	int ret;
+	gint ret;
 
 	cdbp = vdp->cdbp;
 
@@ -459,10 +459,10 @@ __db_vrfy_childcursor(vdp, dbcp)
  * __db_vrfy_childput --
  *	Add a child structure to the set for a given page.
  *
- * PUBLIC: int __db_vrfy_childput
+ * PUBLIC: gint __db_vrfy_childput
  * PUBLIC:     __P((VRFY_DBINFO *, db_pgno_t, VRFY_CHILDINFO *));
  */
-int
+gint
 __db_vrfy_childput(vdp, pgno, cip)
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
@@ -472,7 +472,7 @@ __db_vrfy_childput(vdp, pgno, cip)
 	DBC *cc;
 	DBT key, data;
 	VRFY_CHILDINFO *oldcip;
-	int ret;
+	gint ret;
 
 	cdbp = vdp->cdbp;
 	memset(&key, 0, sizeof(DBT));
@@ -526,16 +526,16 @@ __db_vrfy_childput(vdp, pgno, cip)
  *	Sets a cursor created with __db_vrfy_childcursor to the first
  *	child of the given pgno, and returns it in the third arg.
  *
- * PUBLIC: int __db_vrfy_ccset __P((DBC *, db_pgno_t, VRFY_CHILDINFO **));
+ * PUBLIC: gint __db_vrfy_ccset __P((DBC *, db_pgno_t, VRFY_CHILDINFO **));
  */
-int
+gint
 __db_vrfy_ccset(dbc, pgno, cipp)
 	DBC *dbc;
 	db_pgno_t pgno;
 	VRFY_CHILDINFO **cipp;
 {
 	DBT key, data;
-	int ret;
+	gint ret;
 
 	memset(&key, 0, sizeof(DBT));
 	memset(&data, 0, sizeof(DBT));
@@ -558,15 +558,15 @@ __db_vrfy_ccset(dbc, pgno, cipp)
  *	__db_vrfy_childcursor, and returns it in the memory provided in the
  *	second arg.
  *
- * PUBLIC: int __db_vrfy_ccnext __P((DBC *, VRFY_CHILDINFO **));
+ * PUBLIC: gint __db_vrfy_ccnext __P((DBC *, VRFY_CHILDINFO **));
  */
-int
+gint
 __db_vrfy_ccnext(dbc, cipp)
 	DBC *dbc;
 	VRFY_CHILDINFO **cipp;
 {
 	DBT key, data;
-	int ret;
+	gint ret;
 
 	memset(&key, 0, sizeof(DBT));
 	memset(&data, 0, sizeof(DBT));
@@ -589,9 +589,9 @@ __db_vrfy_ccnext(dbc, cipp)
  *	and keep the interfaces the same, and a function call here or there
  *	seldom hurts anyone.
  *
- * PUBLIC: int __db_vrfy_ccclose __P((DBC *));
+ * PUBLIC: gint __db_vrfy_ccclose __P((DBC *));
  */
-int
+gint
 __db_vrfy_ccclose(dbc)
 	DBC *dbc;
 {
@@ -609,7 +609,7 @@ __db_vrfy_pageinfo_create(dbenv, pgipp)
 	VRFY_PAGEINFO **pgipp;
 {
 	VRFY_PAGEINFO *pgip;
-	int ret;
+	gint ret;
 
 	/*
 	 * pageinfo structs are sometimes allocated here and sometimes
@@ -619,7 +619,7 @@ __db_vrfy_pageinfo_create(dbenv, pgipp)
 	 * with __os_ufree.
 	 */
 	if ((ret = __os_umalloc(dbenv,
-	    sizeof(VRFY_PAGEINFO), (void **)&pgip)) != 0)
+	    sizeof(VRFY_PAGEINFO), (gpointer *)&pgip)) != 0)
 		return (ret);
 	memset(pgip, 0, sizeof(VRFY_PAGEINFO));
 
@@ -633,14 +633,14 @@ __db_vrfy_pageinfo_create(dbenv, pgipp)
  * __db_salvage_init --
  *	Set up salvager database.
  *
- * PUBLIC: int  __db_salvage_init __P((VRFY_DBINFO *));
+ * PUBLIC: gint  __db_salvage_init __P((VRFY_DBINFO *));
  */
-int
+gint
 __db_salvage_init(vdp)
 	VRFY_DBINFO *vdp;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 
 	if ((ret = db_create(&dbp, NULL, 0)) != 0)
 		return (ret);
@@ -677,10 +677,10 @@ __db_salvage_destroy(vdp)
  *	print still.  Delete entries for any already-printed pages we encounter
  *	in this search, as well as the page we're returning.
  *
- * PUBLIC: int __db_salvage_getnext
+ * PUBLIC: gint __db_salvage_getnext
  * PUBLIC:     __P((VRFY_DBINFO *, db_pgno_t *, u_int32_t *));
  */
-int
+gint
 __db_salvage_getnext(vdp, pgnop, pgtypep)
 	VRFY_DBINFO *vdp;
 	db_pgno_t *pgnop;
@@ -689,7 +689,7 @@ __db_salvage_getnext(vdp, pgnop, pgtypep)
 	DB *dbp;
 	DBC *dbc;
 	DBT key, data;
-	int ret;
+	gint ret;
 	u_int32_t pgtype;
 
 	dbp = vdp->salvage_pages;
@@ -732,16 +732,16 @@ err:	(void)dbc->c_close(dbc);
  *	Returns DB_KEYEXIST if it is marked, 0 if not, or another error on
  *	error.
  *
- * PUBLIC: int __db_salvage_isdone __P((VRFY_DBINFO *, db_pgno_t));
+ * PUBLIC: gint __db_salvage_isdone __P((VRFY_DBINFO *, db_pgno_t));
  */
-int
+gint
 __db_salvage_isdone(vdp, pgno)
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
 {
 	DBT key, data;
 	DB *dbp;
-	int ret;
+	gint ret;
 	u_int32_t currtype;
 
 	dbp = vdp->salvage_pages;
@@ -785,16 +785,16 @@ __db_salvage_isdone(vdp, pgno)
  * __db_salvage_markdone --
  *	Mark as done a given page.
  *
- * PUBLIC: int __db_salvage_markdone __P((VRFY_DBINFO *, db_pgno_t));
+ * PUBLIC: gint __db_salvage_markdone __P((VRFY_DBINFO *, db_pgno_t));
  */
-int
+gint
 __db_salvage_markdone(vdp, pgno)
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
 {
 	DBT key, data;
 	DB *dbp;
-	int pgtype, ret;
+	gint pgtype, ret;
 	u_int32_t currtype;
 
 	pgtype = SALVAGE_IGNORE;
@@ -838,10 +838,10 @@ __db_salvage_markdone(vdp, pgno)
  *	If it has not yet been printed, make note of the fact that a page
  *	must be dealt with later.
  *
- * PUBLIC: int __db_salvage_markneeded
+ * PUBLIC: gint __db_salvage_markneeded
  * PUBLIC:     __P((VRFY_DBINFO *, db_pgno_t, u_int32_t));
  */
-int
+gint
 __db_salvage_markneeded(vdp, pgno, pgtype)
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
@@ -849,7 +849,7 @@ __db_salvage_markneeded(vdp, pgno, pgtype)
 {
 	DB *dbp;
 	DBT key, data;
-	int ret;
+	gint ret;
 
 	dbp = vdp->salvage_pages;
 
diff --git a/libdb/db185/db185.c b/libdb/db185/db185.c
index 90358d3..231a27d 100644
--- a/libdb/db185/db185.c
+++ b/libdb/db185/db185.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -31,7 +31,7 @@ static int	db185_del __P((const DB185 *, const DBT185 *, u_int));
 static int	db185_fd __P((const DB185 *));
 static int	db185_get __P((const DB185 *, const DBT185 *, DBT185 *, u_int));
 static u_int32_t
-		db185_hash __P((DB *, const void *, u_int32_t));
+		db185_hash __P((DB *, gconstpointer , u_int32_t));
 static void	db185_openstderr __P((DB_FH *));
 static size_t	db185_prefix __P((DB *, const DBT *, const DBT *));
 static int	db185_put __P((const DB185 *, DBT185 *, const DBT185 *, u_int));
@@ -41,18 +41,18 @@ static int	db185_sync __P((const DB185 *, u_int));
 /*
  * EXTERN: #ifdef _DB185_INT_H_
  * EXTERN: DB185 *__db185_open
- * EXTERN:     __P((const char *, int, int, DBTYPE, const void *));
+ * EXTERN:     __P((const gchar *, int, int, DBTYPE, gconstpointer ));
  * EXTERN: #else
  * EXTERN: DB *__db185_open
- * EXTERN:     __P((const char *, int, int, DBTYPE, const void *));
+ * EXTERN:     __P((const gchar *, int, int, DBTYPE, gconstpointer ));
  * EXTERN: #endif
  */
 DB185 *
 __db185_open(file, oflags, mode, type, openinfo)
-	const char *file;
-	int oflags, mode;
+	const gchar *file;
+	gint oflags, mode;
 	DBTYPE type;
-	const void *openinfo;
+	gconstpointer openinfo;
 {
 	const BTREEINFO *bi;
 	const HASHINFO *hi;
@@ -61,7 +61,7 @@ __db185_open(file, oflags, mode, type, openinfo)
 	DB185 *db185p;
 	DB_FH fh;
 	size_t nw;
-	int ret;
+	gint ret;
 
 	dbp = NULL;
 	db185p = NULL;
@@ -260,7 +260,7 @@ db185_close(db185p)
 	DB185 *db185p;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 
 	dbp = db185p->dbp;
 
@@ -285,7 +285,7 @@ db185_del(db185p, key185, flags)
 {
 	DB *dbp;
 	DBT key;
-	int ret;
+	gint ret;
 
 	dbp = db185p->dbp;
 
@@ -318,7 +318,7 @@ db185_fd(db185p)
 	const DB185 *db185p;
 {
 	DB *dbp;
-	int fd, ret;
+	gint fd, ret;
 
 	dbp = db185p->dbp;
 
@@ -340,7 +340,7 @@ db185_get(db185p, key185, data185, flags)
 {
 	DB *dbp;
 	DBT key, data;
-	int ret;
+	gint ret;
 
 	dbp = db185p->dbp;
 
@@ -379,7 +379,7 @@ db185_put(db185p, key185, data185, flags)
 	DB *dbp;
 	DBC *dbcp_put;
 	DBT key, data;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = db185p->dbp;
 
@@ -454,7 +454,7 @@ db185_seq(db185p, key185, data185, flags)
 {
 	DB *dbp;
 	DBT key, data;
-	int ret;
+	gint ret;
 
 	dbp = db185p->dbp;
 
@@ -513,7 +513,7 @@ db185_sync(db185p, flags)
 	DB *dbp;
 	DB_FH fh;
 	size_t nw;
-	int ret;
+	gint ret;
 
 	dbp = db185p->dbp;
 
@@ -587,7 +587,7 @@ db185_prefix(dbp, a, b)
 static u_int32_t
 db185_hash(dbp, key, len)
 	DB *dbp;
-	const void *key;
+	gconstpointer key;
 	u_int32_t len;
 {
 	return (((DB185 *)dbp->api_internal)->hash(key, (size_t)len));
diff --git a/libdb/db_archive/db_archive.c b/libdb/db_archive/db_archive.c
index 6ef6ccf..51938c9 100644
--- a/libdb/db_archive/db_archive.c
+++ b/libdb/db_archive/db_archive.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -25,22 +25,22 @@ static const char revid[] =
 
 #include "db_int.h"
 
-int main __P((int, char *[]));
-int usage __P((void));
-int version_check __P((const char *));
+gint main __P((int, gchar *[]));
+gint usage __P((void));
+gint version_check __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	const char *progname = "db_archive";
+	extern gchar *optarg;
+	extern gint optind;
+	const gchar *progname = "db_archive";
 	DB_ENV	*dbenv;
 	u_int32_t flags;
-	int ch, e_close, exitval, ret, verbose;
-	char **file, *home, **list, *passwd;
+	gint ch, e_close, exitval, ret, verbose;
+	gchar **file, *home, **list, *passwd;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -152,7 +152,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 usage()
 {
 	(void)fprintf(stderr,
@@ -160,11 +160,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/db_checkpoint/db_checkpoint.c b/libdb/db_checkpoint/db_checkpoint.c
index 7ae7d7e..706d1ea 100644
--- a/libdb/db_checkpoint/db_checkpoint.c
+++ b/libdb/db_checkpoint/db_checkpoint.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -39,24 +39,24 @@ static const char revid[] =
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
 
-int	 main __P((int, char *[]));
+int	 main __P((int, gchar *[]));
 int	 usage __P((void));
-int	 version_check __P((const char *));
+int	 version_check __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
+	extern gchar *optarg;
+	extern gint optind;
 	DB_ENV	*dbenv;
-	const char *progname = "db_checkpoint";
+	const gchar *progname = "db_checkpoint";
 	time_t now;
 	long argval;
 	u_int32_t flags, kbytes, minutes, seconds;
-	int ch, e_close, exitval, once, ret, verbose;
-	char *home, *logfile, *passwd;
+	gint ch, e_close, exitval, once, ret, verbose;
+	gchar *home, *logfile, *passwd;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -214,7 +214,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 usage()
 {
 	(void)fprintf(stderr, "%s\n\t%s\n",
@@ -223,11 +223,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/db_deadlock/db_deadlock.c b/libdb/db_deadlock/db_deadlock.c
index 71faf14..1fb1a67 100644
--- a/libdb/db_deadlock/db_deadlock.c
+++ b/libdb/db_deadlock/db_deadlock.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -37,24 +37,24 @@ static const char revid[] =
 
 #include "db_int.h"
 
-int main __P((int, char *[]));
-int usage __P((void));
-int version_check __P((const char *));
+gint main __P((int, gchar *[]));
+gint usage __P((void));
+gint version_check __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	const char *progname = "db_deadlock";
+	extern gchar *optarg;
+	extern gint optind;
+	const gchar *progname = "db_deadlock";
 	DB_ENV  *dbenv;
 	u_int32_t atype;
 	time_t now;
 	long secs, usecs;
-	int ch, e_close, exitval, ret, verbose;
-	char *home, *logfile, *str;
+	gint ch, e_close, exitval, ret, verbose;
+	gchar *home, *logfile, *str;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -205,7 +205,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 usage()
 {
 	(void)fprintf(stderr, "%s\n\t%s\n",
@@ -214,11 +214,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/db_dump/db_dump.c b/libdb/db_dump/db_dump.c
index 7f0d783..bbafa92 100644
--- a/libdb/db_dump/db_dump.c
+++ b/libdb/db_dump/db_dump.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -27,30 +27,30 @@ static const char revid[] =
 #include "dbinc/db_page.h"
 #include "dbinc/db_am.h"
 
-int	 db_init __P((DB_ENV *, char *, int, u_int32_t, int *));
+int	 db_init __P((DB_ENV *, gchar *, int, u_int32_t, gint *));
 int	 dump __P((DB *, int, int));
-int	 dump_sub __P((DB_ENV *, DB *, char *, int, int));
-int	 is_sub __P((DB *, int *));
-int	 main __P((int, char *[]));
+int	 dump_sub __P((DB_ENV *, DB *, gchar *, int, int));
+int	 is_sub __P((DB *, gint *));
+int	 main __P((int, gchar *[]));
 int	 show_subs __P((DB *));
 int	 usage __P((void));
-int	 version_check __P((const char *));
+int	 version_check __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	const char *progname = "db_dump";
+	extern gchar *optarg;
+	extern gint optind;
+	const gchar *progname = "db_dump";
 	DB_ENV	*dbenv;
 	DB *dbp;
 	u_int32_t cache;
-	int ch, d_close;
-	int e_close, exitval, keyflag, lflag, nflag, pflag, private;
-	int ret, Rflag, rflag, resize, subs;
-	char *dopt, *home, *passwd, *subname;
+	gint ch, d_close;
+	gint e_close, exitval, keyflag, lflag, nflag, pflag, private;
+	gint ret, Rflag, rflag, resize, subs;
+	gchar *dopt, *home, *passwd, *subname;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -274,15 +274,15 @@ done:	if (d_close && (ret = dbp->close(dbp, 0)) != 0) {
  * db_init --
  *	Initialize the environment.
  */
-int
+gint
 db_init(dbenv, home, is_salvage, cache, is_privatep)
 	DB_ENV *dbenv;
-	char *home;
-	int is_salvage;
+	gchar *home;
+	gint is_salvage;
 	u_int32_t cache;
-	int *is_privatep;
+	gint *is_privatep;
 {
-	int ret;
+	gint ret;
 
 	/*
 	 * Try and use the underlying environment when opening a database.
@@ -332,14 +332,14 @@ db_init(dbenv, home, is_salvage, cache, is_privatep)
  * is_sub --
  *	Return if the database contains subdatabases.
  */
-int
+gint
 is_sub(dbp, yesno)
 	DB *dbp;
-	int *yesno;
+	gint *yesno;
 {
 	DB_BTREE_STAT *btsp;
 	DB_HASH_STAT *hsp;
-	int ret;
+	gint ret;
 
 	switch (dbp->type) {
 	case DB_BTREE:
@@ -372,18 +372,18 @@ is_sub(dbp, yesno)
  * dump_sub --
  *	Dump out the records for a DB containing subdatabases.
  */
-int
+gint
 dump_sub(dbenv, parent_dbp, parent_name, pflag, keyflag)
 	DB_ENV *dbenv;
 	DB *parent_dbp;
-	char *parent_name;
-	int pflag, keyflag;
+	gchar *parent_name;
+	gint pflag, keyflag;
 {
 	DB *dbp;
 	DBC *dbcp;
 	DBT key, data;
-	int ret;
-	char *subdb;
+	gint ret;
+	gchar *subdb;
 
 	/*
 	 * Get a cursor and step through the database, dumping out each
@@ -442,13 +442,13 @@ dump_sub(dbenv, parent_dbp, parent_name, pflag, keyflag)
  * show_subs --
  *	Display the subdatabases for a database.
  */
-int
+gint
 show_subs(dbp)
 	DB *dbp;
 {
 	DBC *dbcp;
 	DBT key, data;
-	int ret;
+	gint ret;
 
 	/*
 	 * Get a cursor and step through the database, printing out the key
@@ -484,17 +484,17 @@ show_subs(dbp)
  * dump --
  *	Dump out the records for a DB.
  */
-int
+gint
 dump(dbp, pflag, keyflag)
 	DB *dbp;
-	int pflag, keyflag;
+	gint pflag, keyflag;
 {
 	DBC *dbcp;
 	DBT key, data;
 	DBT keyret, dataret;
 	db_recno_t recno;
-	int is_recno, failed, ret;
-	void *pointer;
+	gint is_recno, failed, ret;
+	gpointer pointer;
 
 	/*
 	 * Get a cursor and step through the database, printing out each
@@ -582,7 +582,7 @@ err:	if (data.data != NULL)
  * usage --
  *	Display the usage message.
  */
-int
+gint
 usage()
 {
 	(void)fprintf(stderr, "%s\n\t%s\n",
@@ -591,11 +591,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/db_dump185/db_dump185.c b/libdb/db_dump185/db_dump185.c
index 7ae3288..fb19861 100644
--- a/libdb/db_dump185/db_dump185.c
+++ b/libdb/db_dump185/db_dump185.c
@@ -6,9 +6,9 @@
  */
 
 #ifndef lint
-static char copyright[] =
+static gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static char revid[] =
+static gchar revid[] =
     "$Id$";
 #endif
 
@@ -69,7 +69,7 @@ typedef struct hashhdr186 {	/* Disk resident portion */
 	u_int16_t bitmaps[NCACHED];
 } HASHHDR186;
 typedef struct htab186	 {		/* Memory resident data structure */
-	void *unused[2];
+	gpointer unused[2];
 	HASHHDR186	hdr;		/* Header */
 } HTAB186;
 
@@ -172,19 +172,19 @@ void	db_btree __P((DB *, int));
 void	db_hash __P((DB *, int));
 void	dbt_dump __P((DBT *));
 void	dbt_print __P((DBT *));
-int	main __P((int, char *[]));
+int	main __P((int, gchar *[]));
 int	usage __P((void));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
+	extern gchar *optarg;
+	extern gint optind;
 	DB *dbp;
 	DBT key, data;
-	int ch, pflag, rval;
+	gint ch, pflag, rval;
 
 	pflag = 0;
 	while ((ch = getopt(argc, argv, "f:p")) != EOF)
@@ -250,7 +250,7 @@ main(argc, argv)
 void
 db_hash(dbp, pflag)
 	DB *dbp;
-	int pflag;
+	gint pflag;
 {
 	HTAB185 *hash185p;
 	HTAB186 *hash186p;
@@ -282,7 +282,7 @@ db_hash(dbp, pflag)
 void
 db_btree(dbp, pflag)
 	DB *dbp;
-	int pflag;
+	gint pflag;
 {
 	BTREE *btp;
 
@@ -302,7 +302,7 @@ db_btree(dbp, pflag)
 	printf("HEADER=END\n");
 }
 
-static char hex[] = "0123456789abcdef";
+static gchar hex[] = "0123456789abcdef";
 
 /*
  * dbt_dump --
@@ -347,7 +347,7 @@ dbt_print(dbtp)
  * usage --
  *	Display the usage message.
  */
-int
+gint
 usage()
 {
 	(void)fprintf(stderr, "usage: db_dump185 [-p] [-f file] db_file\n");
diff --git a/libdb/db_load/db_load.c b/libdb/db_load/db_load.c
index eaa8845..28b4c2c 100644
--- a/libdb/db_load/db_load.c
+++ b/libdb/db_load/db_load.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -29,7 +29,7 @@ static const char revid[] =
 #include "dbinc/db_am.h"
 
 typedef struct {			/* XXX: Globals. */
-	const char *progname;		/* Program name. */
+	const gchar *progname;		/* Program name. */
 	char	*hdrbuf;		/* Input file header. */
 	u_long	lineno;			/* Input file line number. */
 	u_long	origline;		/* Original file line number. */
@@ -44,19 +44,19 @@ typedef struct {			/* XXX: Globals. */
 
 void	badend __P((DB_ENV *));
 void	badnum __P((DB_ENV *));
-int	configure __P((DB_ENV *, DB *, char **, char **, int *));
-int	convprintable __P((DB_ENV *, char *, char **));
-int	db_init __P((DB_ENV *, char *, u_int32_t, int *));
+int	configure __P((DB_ENV *, DB *, gchar **, gchar **, gint *));
+int	convprintable __P((DB_ENV *, gchar *, gchar **));
+int	db_init __P((DB_ENV *, gchar *, u_int32_t, gint *));
 int	dbt_rdump __P((DB_ENV *, DBT *));
 int	dbt_rprint __P((DB_ENV *, DBT *));
 int	dbt_rrecno __P((DB_ENV *, DBT *, int));
-int	digitize __P((DB_ENV *, int, int *));
+int	digitize __P((DB_ENV *, int, gint *));
 int	env_create __P((DB_ENV **, LDG *));
-int	load __P((DB_ENV *, char *, DBTYPE, char **, u_int, LDG *, int *));
-int	main __P((int, char *[]));
-int	rheader __P((DB_ENV *, DB *, DBTYPE *, char **, int *, int *));
+int	load __P((DB_ENV *, gchar *, DBTYPE, gchar **, u_int, LDG *, gint *));
+int	main __P((int, gchar *[]));
+int	rheader __P((DB_ENV *, DB *, DBTYPE *, gchar **, gint *, gint *));
 int	usage __P((void));
-int	version_check __P((const char *));
+int	version_check __P((const gchar *));
 
 #define	G(f)	((LDG *)dbenv->app_private)->f
 
@@ -65,19 +65,19 @@ int	version_check __P((const char *));
 #define	LDF_NOOVERWRITE	0x02		/* Don't overwrite existing rows. */
 #define	LDF_PASSWORD	0x04		/* Encrypt created databases. */
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
+	extern gchar *optarg;
+	extern gint optind;
 	DBTYPE dbtype;
 	DB_ENV	*dbenv;
 	LDG ldg;
 	u_int32_t ldf;
-	int ch, existed, exitval, ret;
-	char **clist, **clp;
+	gint ch, existed, exitval, ret;
+	gchar **clist, **clp;
 
 	ldg.progname = "db_load";
 	ldg.lineno = 0;
@@ -96,7 +96,7 @@ main(argc, argv)
 	dbtype = DB_UNKNOWN;
 
 	/* Allocate enough room for configuration arguments. */
-	if ((clp = clist = (char **)calloc(argc + 1, sizeof(char *))) == NULL) {
+	if ((clp = clist = (gchar **)calloc(argc + 1, sizeof(gchar *))) == NULL) {
 		fprintf(stderr, "%s: %s\n", ldg.progname, strerror(ENOMEM));
 		return (EXIT_FAILURE);
 	}
@@ -205,14 +205,14 @@ shutdown:	exitval = 1;
  * load --
  *	Load a database.
  */
-int
+gint
 load(dbenv, name, argtype, clist, flags, ldg, existedp)
 	DB_ENV *dbenv;
-	char *name, **clist;
+	gchar *name, **clist;
 	DBTYPE argtype;
 	u_int flags;
 	LDG *ldg;
-	int *existedp;
+	gint *existedp;
 {
 	DB *dbp;
 	DBT key, rkey, data, *readp, *writep;
@@ -220,8 +220,8 @@ load(dbenv, name, argtype, clist, flags, ldg, existedp)
 	DB_TXN *ctxn, *txn;
 	db_recno_t recno, datarecno;
 	u_int32_t put_flags;
-	int ascii_recno, checkprint, hexkeys, keyflag, keys, resize, ret, rval;
-	char *subdb;
+	gint ascii_recno, checkprint, hexkeys, keyflag, keys, resize, ret, rval;
+	gchar *subdb;
 
 	*existedp = 0;
 
@@ -365,11 +365,11 @@ retry_db:
 			key.data = &recno;
 	} else
 key_data:	if ((readp->data =
-		    (void *)malloc(readp->ulen = 1024)) == NULL) {
+		    (gpointer)malloc(readp->ulen = 1024)) == NULL) {
 			dbenv->err(dbenv, ENOMEM, NULL);
 			goto err;
 		}
-	if ((data.data = (void *)malloc(data.ulen = 1024)) == NULL) {
+	if ((data.data = (gpointer)malloc(data.ulen = 1024)) == NULL) {
 		dbenv->err(dbenv, ENOMEM, NULL);
 		goto err;
 	}
@@ -503,15 +503,15 @@ err:		rval = 1;
  * db_init --
  *	Initialize the environment.
  */
-int
+gint
 db_init(dbenv, home, cache, is_private)
 	DB_ENV *dbenv;
-	char *home;
+	gchar *home;
 	u_int32_t cache;
-	int *is_private;
+	gint *is_private;
 {
 	u_int32_t flags;
-	int ret;
+	gint ret;
 
 	*is_private = 0;
 	/* We may be loading into a live environment.  Try and join. */
@@ -585,16 +585,16 @@ db_init(dbenv, home, cache, is_private)
  * configure --
  *	Handle command-line configuration options.
  */
-int
+gint
 configure(dbenv, dbp, clp, subdbp, keysp)
 	DB_ENV *dbenv;
 	DB *dbp;
-	char **clp, **subdbp;
-	int *keysp;
+	gchar **clp, **subdbp;
+	gint *keysp;
 {
 	long val;
-	int ret, savech;
-	char *name, *value;
+	gint ret, savech;
+	gchar *name, *value;
 
 	for (; (name = *clp) != NULL; *--value = savech, ++clp) {
 		if ((value = strchr(name, '=')) == NULL) {
@@ -658,17 +658,17 @@ nameerr:
  * rheader --
  *	Read the header message.
  */
-int
+gint
 rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp)
 	DB_ENV *dbenv;
 	DB *dbp;
 	DBTYPE *dbtypep;
-	char **subdbp;
-	int *checkprintp, *keysp;
+	gchar **subdbp;
+	gint *checkprintp, *keysp;
 {
 	long val;
-	int ch, first, hdr, linelen, buflen, ret, start;
-	char *buf, *name, *p, *value;
+	gint ch, first, hdr, linelen, buflen, ret, start;
+	gchar *buf, *name, *p, *value;
 
 	*dbtypep = DB_UNKNOWN;
 	*checkprintp = 0;
@@ -681,7 +681,7 @@ rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp)
 	buflen = 4096;
 	if (G(hdrbuf) == NULL) {
 		hdr = 0;
-		if ((buf = (char *)malloc(buflen)) == NULL) {
+		if ((buf = (gchar *)malloc(buflen)) == NULL) {
 memerr:			dbp->errx(dbp, "could not allocate buffer %d", buflen);
 			return (1);
 		}
@@ -716,7 +716,7 @@ memerr:			dbp->errx(dbp, "could not allocate buffer %d", buflen);
 
 				/* If the buffer is too small, double it. */
 				if (linelen + start == buflen) {
-					G(hdrbuf) = (char *)realloc(G(hdrbuf),
+					G(hdrbuf) = (gchar *)realloc(G(hdrbuf),
 					    buflen *= 2);
 					if (G(hdrbuf) == NULL)
 						goto memerr;
@@ -866,23 +866,23 @@ badfmt:
  * allocations that aren't likely to be a problem here), and this has fewer
  * special cases to deal with.
  *
- * Note that despite the printable encoding, the char * interface to this
+ * Note that despite the printable encoding, the gchar * interface to this
  * function (which is, not coincidentally, also used for database naming)
  * means that outstr cannot contain any nuls.
  */
-int
+gint
 convprintable(dbenv, instr, outstrp)
 	DB_ENV *dbenv;
-	char *instr, **outstrp;
+	gchar *instr, **outstrp;
 {
-	char c, *outstr;
-	int e1, e2;
+	gchar c, *outstr;
+	gint e1, e2;
 
 	/*
 	 * Just malloc a string big enough for the whole input string;
 	 * the output string will be smaller (or of equal length).
 	 */
-	if ((outstr = (char *)malloc(strlen(instr))) == NULL)
+	if ((outstr = (gchar *)malloc(strlen(instr))) == NULL)
 		return (ENOMEM);
 
 	*outstrp = outstr;
@@ -914,15 +914,15 @@ convprintable(dbenv, instr, outstrp)
  * dbt_rprint --
  *	Read a printable line into a DBT structure.
  */
-int
+gint
 dbt_rprint(dbenv, dbtp)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 {
 	u_int32_t len;
 	u_int8_t *p;
-	int c1, c2, e, escape, first;
-	char buf[32];
+	gint c1, c2, e, escape, first;
+	gchar buf[32];
 
 	++G(lineno);
 
@@ -974,7 +974,7 @@ dbt_rprint(dbenv, dbtp)
 		if (len >= dbtp->ulen - 10) {
 			dbtp->ulen *= 2;
 			if ((dbtp->data =
-			    (void *)realloc(dbtp->data, dbtp->ulen)) == NULL) {
+			    (gpointer)realloc(dbtp->data, dbtp->ulen)) == NULL) {
 				dbenv->err(dbenv, ENOMEM, NULL);
 				return (1);
 			}
@@ -992,15 +992,15 @@ dbt_rprint(dbenv, dbtp)
  * dbt_rdump --
  *	Read a byte dump line into a DBT structure.
  */
-int
+gint
 dbt_rdump(dbenv, dbtp)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 {
 	u_int32_t len;
 	u_int8_t *p;
-	int c1, c2, e, first;
-	char buf[32];
+	gint c1, c2, e, first;
+	gchar buf[32];
 
 	++G(lineno);
 
@@ -1039,7 +1039,7 @@ dbt_rdump(dbenv, dbtp)
 		if (len >= dbtp->ulen - 10) {
 			dbtp->ulen *= 2;
 			if ((dbtp->data =
-			    (void *)realloc(dbtp->data, dbtp->ulen)) == NULL) {
+			    (gpointer)realloc(dbtp->data, dbtp->ulen)) == NULL) {
 				dbenv->err(dbenv, ENOMEM, NULL);
 				return (1);
 			}
@@ -1059,13 +1059,13 @@ dbt_rdump(dbenv, dbtp)
  * dbt_rrecno --
  *	Read a record number dump line into a DBT structure.
  */
-int
+gint
 dbt_rrecno(dbenv, dbtp, ishex)
 	DB_ENV *dbenv;
 	DBT *dbtp;
-	int ishex;
+	gint ishex;
 {
-	char buf[32], *p, *q;
+	gchar buf[32], *p, *q;
 
 	++G(lineno);
 
@@ -1118,10 +1118,10 @@ bad:		badend(dbenv);
  * digitize --
  *	Convert a character to an integer.
  */
-int
+gint
 digitize(dbenv, c, errorp)
 	DB_ENV *dbenv;
-	int c, *errorp;
+	gint c, *errorp;
 {
 	switch (c) {			/* Don't depend on ASCII ordering. */
 	case '0': return (0);
@@ -1175,7 +1175,7 @@ badend(dbenv)
  * usage --
  *	Display the usage message.
  */
-int
+gint
 usage()
 {
 	(void)fprintf(stderr, "%s\n\t%s\n",
@@ -1184,11 +1184,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
@@ -1203,13 +1203,13 @@ version_check(progname)
 	return (0);
 }
 
-int
+gint
 env_create(dbenvp, ldg)
 	DB_ENV **dbenvp;
 	LDG *ldg;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	if ((ret = db_env_create(dbenvp, 0)) != 0) {
 		fprintf(stderr,
diff --git a/libdb/db_printlog/db_printlog.c b/libdb/db_printlog/db_printlog.c
index 23d7d38..6ca5bdd 100644
--- a/libdb/db_printlog/db_printlog.c
+++ b/libdb/db_printlog/db_printlog.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -34,30 +34,30 @@ static const char revid[] =
 #include "dbinc/rep.h"
 #include "dbinc/txn.h"
 
-int main __P((int, char *[]));
-int usage __P((void));
-int version_check __P((const char *));
-int print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
-int open_rep_db __P((DB_ENV *, DB **, DBC **));
+gint main __P((int, gchar *[]));
+gint usage __P((void));
+gint version_check __P((const gchar *));
+gint print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
+gint open_rep_db __P((DB_ENV *, DB **, DBC **));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	const char *progname = "db_printlog";
+	extern gchar *optarg;
+	extern gint optind;
+	const gchar *progname = "db_printlog";
 	DB *dbp;
 	DBC *dbc;
 	DB_ENV	*dbenv;
 	DB_LOGC *logc;
-	int (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t dtabsize;
 	DBT data, keydbt;
 	DB_LSN key;
-	int ch, e_close, exitval, nflag, rflag, ret, repflag;
-	char *home, *passwd;
+	gint ch, e_close, exitval, nflag, rflag, ret, repflag;
+	gchar *home, *passwd;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -259,7 +259,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 usage()
 {
 	fprintf(stderr, "%s\n",
@@ -267,11 +267,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
@@ -287,14 +287,14 @@ version_check(progname)
 }
 
 /* Print an unknown, application-specific log record as best we can. */
-int
+gint
 print_app_record(dbenv, dbt, lsnp, op)
 	DB_ENV *dbenv;
 	DBT *dbt;
 	DB_LSN *lsnp;
 	db_recops op;
 {
-	int ch;
+	gint ch;
 	u_int32_t i, rectype;
 
 	DB_ASSERT(op == DB_TXN_PRINT);
@@ -323,13 +323,13 @@ print_app_record(dbenv, dbt, lsnp, op)
 	return (0);
 }
 
-int
+gint
 open_rep_db(dbenv, dbpp, dbcp)
 	DB_ENV *dbenv;
 	DB **dbpp;
 	DBC **dbcp;
 {
-	int ret;
+	gint ret;
 
 	DB *dbp;
 	*dbpp = NULL;
diff --git a/libdb/db_recover/db_recover.c b/libdb/db_recover/db_recover.c
index 6432f4e..dfa6cd6 100644
--- a/libdb/db_recover/db_recover.c
+++ b/libdb/db_recover/db_recover.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -36,25 +36,25 @@ static const char revid[] =
 #include "db_int.h"
 #include "dbinc/txn.h"
 
-int main __P((int, char *[]));
-int read_timestamp __P((const char *, char *, time_t *));
-int usage __P((void));
-int version_check __P((const char *));
+gint main __P((int, gchar *[]));
+gint read_timestamp __P((const gchar *, gchar *, time_t *));
+gint usage __P((void));
+gint version_check __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	const char *progname = "db_recover";
+	extern gchar *optarg;
+	extern gint optind;
+	const gchar *progname = "db_recover";
 	DB_ENV	*dbenv;
 	DB_TXNREGION *region;
 	time_t now, timestamp;
 	u_int32_t flags;
-	int ch, exitval, fatal_recover, ret, retain_env, verbose;
-	char *home, *passwd;
+	gint ch, exitval, fatal_recover, ret, retain_env, verbose;
+	gchar *home, *passwd;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -215,16 +215,16 @@ shutdown:	exitval = 1;
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-int
+gint
 read_timestamp(progname, arg, timep)
-	const char *progname;
-	char *arg;
+	const gchar *progname;
+	gchar *arg;
 	time_t *timep;
 {
 	struct tm *t;
 	time_t now;
-	int yearset;
-	char *p;
+	gint yearset;
+	gchar *p;
 					/* Start with the current time. */
 	(void)time(&now);
 	if ((t = localtime(&now)) == NULL) {
@@ -285,7 +285,7 @@ terr:		fprintf(stderr,
 	return (0);
 }
 
-int
+gint
 usage()
 {
 	(void)fprintf(stderr, "%s\n",
@@ -293,11 +293,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/db_stat/db_stat.c b/libdb/db_stat/db_stat.c
index 4676e8a..e01da8c 100644
--- a/libdb/db_stat/db_stat.c
+++ b/libdb/db_stat/db_stat.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -44,41 +44,41 @@ static const char revid[] =
 typedef enum { T_NOTSET,
     T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_REP, T_TXN } test_t;
 
-int	 argcheck __P((char *, const char *));
+int	 argcheck __P((gchar *, const gchar *));
 int	 btree_stats __P((DB_ENV *, DB *, DB_BTREE_STAT *, int));
-int	 db_init __P((DB_ENV *, char *, test_t, u_int32_t, int *));
-void	 dl __P((const char *, u_long));
-void	 dl_bytes __P((const char *, u_long, u_long, u_long));
+int	 db_init __P((DB_ENV *, gchar *, test_t, u_int32_t, gint *));
+void	 dl __P((const gchar *, u_long));
+void	 dl_bytes __P((const gchar *, u_long, u_long, u_long));
 int	 env_stats __P((DB_ENV *, u_int32_t));
 int	 hash_stats __P((DB_ENV *, DB *, int));
-int	 lock_stats __P((DB_ENV *, char *, u_int32_t));
+int	 lock_stats __P((DB_ENV *, gchar *, u_int32_t));
 int	 log_stats __P((DB_ENV *, u_int32_t));
-int	 main __P((int, char *[]));
-int	 mpool_stats __P((DB_ENV *, char *, u_int32_t));
+int	 main __P((int, gchar *[]));
+int	 mpool_stats __P((DB_ENV *, gchar *, u_int32_t));
 void	 prflags __P((u_int32_t, const FN *));
 int	 queue_stats __P((DB_ENV *, DB *, int));
 int	 rep_stats __P((DB_ENV *, u_int32_t));
-int	 txn_compare __P((const void *, const void *));
+int	 txn_compare __P((gconstpointer , gconstpointer ));
 int	 txn_stats __P((DB_ENV *, u_int32_t));
 int	 usage __P((void));
-int	 version_check __P((const char *));
+int	 version_check __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	const char *progname = "db_stat";
+	extern gchar *optarg;
+	extern gint optind;
+	const gchar *progname = "db_stat";
 	DB_ENV	*dbenv;
 	DB_BTREE_STAT *sp;
 	DB *alt_dbp, *dbp;
 	test_t ttype;
 	u_int32_t cache;
-	int ch, checked, d_close, e_close, exitval, fast, flags;
-	int nflag, private, resize, ret;
-	char *db, *home, *internal, *passwd, *subdb;
+	gint ch, checked, d_close, e_close, exitval, fast, flags;
+	gint nflag, private, resize, ret;
+	gchar *db, *home, *internal, *passwd, *subdb;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -374,15 +374,15 @@ shutdown:	exitval = 1;
  * env_stats --
  *	Display environment statistics.
  */
-int
+gint
 env_stats(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	REGENV renv;
 	REGION *rp, regs[1024];
-	int n, ret;
-	const char *lable;
+	gint n, ret;
+	const gchar *lable;
 
 	n = sizeof(regs) / sizeof(regs[0]);
 	if ((ret = __db_e_stat(dbenv, &renv, regs, &n, flags)) != 0)  {
@@ -446,12 +446,12 @@ env_stats(dbenv, flags)
  * btree_stats --
  *	Display btree/recno statistics.
  */
-int
+gint
 btree_stats(dbenv, dbp, msp, fast)
 	DB_ENV *dbenv;
 	DB *dbp;
 	DB_BTREE_STAT *msp;
-	int fast;
+	gint fast;
 {
 	static const FN fn[] = {
 		{ BTM_DUP,	"duplicates" },
@@ -463,7 +463,7 @@ btree_stats(dbenv, dbp, msp, fast)
 		{ 0,		NULL }
 	};
 	DB_BTREE_STAT *sp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbenv, NULL);
 
@@ -534,11 +534,11 @@ btree_stats(dbenv, dbp, msp, fast)
  * hash_stats --
  *	Display hash statistics.
  */
-int
+gint
 hash_stats(dbenv, dbp, fast)
 	DB_ENV *dbenv;
 	DB *dbp;
-	int fast;
+	gint fast;
 {
 	static const FN fn[] = {
 		{ DB_HASH_DUP,	"duplicates" },
@@ -546,7 +546,7 @@ hash_stats(dbenv, dbp, fast)
 		{ 0,		NULL }
 	};
 	DB_HASH_STAT *sp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbenv, NULL);
 
@@ -597,14 +597,14 @@ hash_stats(dbenv, dbp, fast)
  * queue_stats --
  *	Display queue statistics.
  */
-int
+gint
 queue_stats(dbenv, dbp, fast)
 	DB_ENV *dbenv;
 	DB *dbp;
-	int fast;
+	gint fast;
 {
 	DB_QUEUE_STAT *sp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbenv, NULL);
 
@@ -642,14 +642,14 @@ queue_stats(dbenv, dbp, fast)
  * lock_stats --
  *	Display lock statistics.
  */
-int
+gint
 lock_stats(dbenv, internal, flags)
 	DB_ENV *dbenv;
-	char *internal;
+	gchar *internal;
 	u_int32_t flags;
 {
 	DB_LOCK_STAT *sp;
-	int ret;
+	gint ret;
 
 	if (internal != NULL) {
 		if ((ret =
@@ -713,13 +713,13 @@ lock_stats(dbenv, internal, flags)
  * log_stats --
  *	Display log statistics.
  */
-int
+gint
 log_stats(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	DB_LOG_STAT *sp;
-	int ret;
+	gint ret;
 
 	if ((ret = dbenv->log_stat(dbenv, &sp, flags)) != 0) {
 		dbenv->err(dbenv, ret, NULL);
@@ -772,15 +772,15 @@ log_stats(dbenv, flags)
  * mpool_stats --
  *	Display mpool statistics.
  */
-int
+gint
 mpool_stats(dbenv, internal, flags)
 	DB_ENV *dbenv;
-	char *internal;
+	gchar *internal;
 	u_int32_t flags;
 {
 	DB_MPOOL_FSTAT **fsp;
 	DB_MPOOL_STAT *gsp;
-	int ret;
+	gint ret;
 
 	if (internal != NULL) {
 		if ((ret =
@@ -887,14 +887,14 @@ mpool_stats(dbenv, internal, flags)
  * rep_stats --
  *	Display replication statistics.
  */
-int
+gint
 rep_stats(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	DB_REP_STAT *sp;
-	int is_client, ret;
-	const char *p;
+	gint is_client, ret;
+	const gchar *p;
 
 	if ((ret = dbenv->rep_stat(dbenv, &sp, flags)) != 0) {
 		dbenv->err(dbenv, ret, NULL);
@@ -1002,15 +1002,15 @@ rep_stats(dbenv, flags)
  * txn_stats --
  *	Display transaction statistics.
  */
-int
+gint
 txn_stats(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
 	DB_TXN_STAT *sp;
 	u_int32_t i;
-	int ret;
-	const char *p;
+	gint ret;
+	const gchar *p;
 
 	if ((ret = dbenv->txn_stat(dbenv, &sp, flags)) != 0) {
 		dbenv->err(dbenv, ret, NULL);
@@ -1063,9 +1063,9 @@ txn_stats(dbenv, flags)
 	return (0);
 }
 
-int
+gint
 txn_compare(a1, b1)
-	const void *a1, *b1;
+	gconstpointer a1, *b1;
 {
 	const DB_TXN_ACTIVE *a, *b;
 
@@ -1085,7 +1085,7 @@ txn_compare(a1, b1)
  */
 void
 dl(msg, value)
-	const char *msg;
+	const gchar *msg;
 	u_long value;
 {
 	/*
@@ -1104,10 +1104,10 @@ dl(msg, value)
  */
 void
 dl_bytes(msg, gbytes, mbytes, bytes)
-	const char *msg;
+	const gchar *msg;
 	u_long gbytes, mbytes, bytes;
 {
-	const char *sep;
+	const gchar *sep;
 
 	/* Normalize the values. */
 	while (bytes >= MEGABYTE) {
@@ -1148,7 +1148,7 @@ prflags(flags, fnp)
 	u_int32_t flags;
 	const FN *fnp;
 {
-	const char *sep;
+	const gchar *sep;
 
 	sep = "\t";
 	printf("Flags:");
@@ -1164,16 +1164,16 @@ prflags(flags, fnp)
  * db_init --
  *	Initialize the environment.
  */
-int
+gint
 db_init(dbenv, home, ttype, cache, is_private)
 	DB_ENV *dbenv;
-	char *home;
+	gchar *home;
 	test_t ttype;
 	u_int32_t cache;
-	int *is_private;
+	gint *is_private;
 {
 	u_int32_t oflags;
-	int ret;
+	gint ret;
 
 	/*
 	 * If our environment open fails, and we're trying to look at a
@@ -1227,10 +1227,10 @@ db_init(dbenv, home, ttype, cache, is_private)
  * argcheck --
  *	Return if argument flags are okay.
  */
-int
+gint
 argcheck(arg, ok_args)
-	char *arg;
-	const char *ok_args;
+	gchar *arg;
+	const gchar *ok_args;
 {
 	for (; *arg != '\0'; ++arg)
 		if (strchr(ok_args, *arg) == NULL)
@@ -1238,7 +1238,7 @@ argcheck(arg, ok_args)
 	return (1);
 }
 
-int
+gint
 usage()
 {
 	fprintf(stderr, "%s\n\t%s\n",
@@ -1247,11 +1247,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/db_upgrade/db_upgrade.c b/libdb/db_upgrade/db_upgrade.c
index c29584f..86e6864 100644
--- a/libdb/db_upgrade/db_upgrade.c
+++ b/libdb/db_upgrade/db_upgrade.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -25,23 +25,23 @@ static const char revid[] =
 
 #include "db_int.h"
 
-int main __P((int, char *[]));
-int usage __P((void));
-int version_check __P((const char *));
+gint main __P((int, gchar *[]));
+gint usage __P((void));
+gint version_check __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	const char *progname = "db_upgrade";
+	extern gchar *optarg;
+	extern gint optind;
+	const gchar *progname = "db_upgrade";
 	DB *dbp;
 	DB_ENV *dbenv;
 	u_int32_t flags;
-	int ch, e_close, exitval, nflag, ret, t_ret;
-	char *home, *passwd;
+	gint ch, e_close, exitval, nflag, ret, t_ret;
+	gchar *home, *passwd;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -162,7 +162,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 usage()
 {
 	fprintf(stderr, "%s\n",
@@ -170,11 +170,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/db_verify/db_verify.c b/libdb/db_verify/db_verify.c
index bfe56ba..6871135 100644
--- a/libdb/db_verify/db_verify.c
+++ b/libdb/db_verify/db_verify.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -25,24 +25,24 @@ static const char revid[] =
 
 #include "db_int.h"
 
-int main __P((int, char *[]));
-int usage __P((void));
-int version_check __P((const char *));
+gint main __P((int, gchar *[]));
+gint usage __P((void));
+gint version_check __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	const char *progname = "db_verify";
+	extern gchar *optarg;
+	extern gint optind;
+	const gchar *progname = "db_verify";
 	DB *dbp, *dbp1;
 	DB_ENV *dbenv;
 	u_int32_t cache;
-	int ch, d_close, e_close, exitval, nflag, oflag, private;
-	int quiet, resize, ret, t_ret;
-	char *home, *passwd;
+	gint ch, d_close, e_close, exitval, nflag, oflag, private;
+	gint quiet, resize, ret, t_ret;
+	gchar *home, *passwd;
 
 	if ((ret = version_check(progname)) != 0)
 		return (ret);
@@ -220,7 +220,7 @@ shutdown:	exitval = 1;
 	return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 usage()
 {
 	fprintf(stderr, "%s\n",
@@ -228,11 +228,11 @@ usage()
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 version_check(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
diff --git a/libdb/dbinc/btree.h b/libdb/dbinc/btree.h
index 47b9a88..17f8d6f 100644
--- a/libdb/dbinc/btree.h
+++ b/libdb/dbinc/btree.h
@@ -263,7 +263,7 @@ struct __btree {			/* Btree access method. */
 	u_int32_t bt_minkey;		/* Minimum keys per page. */
 
 					/* Btree comparison function. */
-	int (*bt_compare) __P((DB *, const DBT *, const DBT *));
+	gint (*bt_compare) __P((DB *, const DBT *, const DBT *));
 					/* Btree prefix function. */
 	size_t (*bt_prefix) __P((DB *, const DBT *, const DBT *));
 
diff --git a/libdb/dbinc/crypto.h b/libdb/dbinc/crypto.h
index 108ac75..26d53b2 100644
--- a/libdb/dbinc/crypto.h
+++ b/libdb/dbinc/crypto.h
@@ -34,9 +34,9 @@
  */
 struct __db_cipher {
 	int	(*adj_size) __P((size_t));
-	int	(*close) __P((DB_ENV *, void *));
-	int	(*decrypt) __P((DB_ENV *, void *, void *, u_int8_t *, size_t));
-	int	(*encrypt) __P((DB_ENV *, void *, void *, u_int8_t *, size_t));
+	int	(*close) __P((DB_ENV *, gpointer ));
+	int	(*decrypt) __P((DB_ENV *, gpointer , gpointer , u_int8_t *, size_t));
+	int	(*encrypt) __P((DB_ENV *, gpointer , gpointer , u_int8_t *, size_t));
 	int	(*init) __P((DB_ENV *, DB_CIPHER *));
 
 	u_int8_t mac_key[DB_MAC_KEY];	/* MAC key. */
diff --git a/libdb/dbinc/cxx_except.h b/libdb/dbinc/cxx_except.h
index ee65df4..fa1f48e 100644
--- a/libdb/dbinc/cxx_except.h
+++ b/libdb/dbinc/cxx_except.h
@@ -44,19 +44,19 @@ class _exported DbException
 {
 public:
 	virtual ~DbException();
-	DbException(int err);
-	DbException(const char *description);
-	DbException(const char *prefix, int err);
-	DbException(const char *prefix1, const char *prefix2, int err);
-	int get_errno() const;
-	virtual const char *what() const;
+	DbException(gint err);
+	DbException(const gchar *description);
+	DbException(const gchar *prefix, gint err);
+	DbException(const gchar *prefix1, const gchar *prefix2, gint err);
+	gint get_errno() const;
+	virtual const gchar *what() const;
 
 	DbException(const DbException &);
 	DbException &operator = (const DbException &);
 
 private:
-	char *what_;
-	int err_;                   // errno
+	gchar *what_;
+	gint err_;                   // errno
 };
 
 //
@@ -67,7 +67,7 @@ class _exported DbDeadlockException : public DbException
 {
 public:
 	virtual ~DbDeadlockException();
-	DbDeadlockException(const char *description);
+	DbDeadlockException(const gchar *description);
 
 	DbDeadlockException(const DbDeadlockException &);
 	DbDeadlockException &operator = (const DbDeadlockException &);
@@ -83,8 +83,8 @@ class _exported DbLockNotGrantedException : public DbException
 {
 public:
 	virtual ~DbLockNotGrantedException();
-	DbLockNotGrantedException(const char *prefix, db_lockop_t op,
-	    db_lockmode_t mode, const Dbt *obj, const DbLock lock, int index);
+	DbLockNotGrantedException(const gchar *prefix, db_lockop_t op,
+	    db_lockmode_t mode, const Dbt *obj, const DbLock lock, gint index);
 	DbLockNotGrantedException(const DbLockNotGrantedException &);
 	DbLockNotGrantedException &operator =
 	    (const DbLockNotGrantedException &);
@@ -93,14 +93,14 @@ public:
 	db_lockmode_t get_mode() const;
 	const Dbt* get_obj() const;
 	DbLock *get_lock() const;
-	int get_index() const;
+	gint get_index() const;
 
 private:
 	db_lockop_t op_;
 	db_lockmode_t mode_;
 	const Dbt *obj_;
 	DbLock *lock_;
-	int index_;
+	gint index_;
 };
 
 //
@@ -112,9 +112,9 @@ class _exported DbMemoryException : public DbException
 public:
 	virtual ~DbMemoryException();
 	DbMemoryException(Dbt *dbt);
-	DbMemoryException(const char *description);
-	DbMemoryException(const char *prefix, Dbt *dbt);
-	DbMemoryException(const char *prefix1, const char *prefix2, Dbt *dbt);
+	DbMemoryException(const gchar *description);
+	DbMemoryException(const gchar *prefix, Dbt *dbt);
+	DbMemoryException(const gchar *prefix1, const gchar *prefix2, Dbt *dbt);
 	Dbt *get_dbt() const;
 
 	DbMemoryException(const DbMemoryException &);
@@ -132,7 +132,7 @@ class _exported DbRunRecoveryException : public DbException
 {
 public:
 	virtual ~DbRunRecoveryException();
-	DbRunRecoveryException(const char *description);
+	DbRunRecoveryException(const gchar *description);
 
 	DbRunRecoveryException(const DbRunRecoveryException &);
 	DbRunRecoveryException &operator = (const DbRunRecoveryException &);
diff --git a/libdb/dbinc/cxx_int.h b/libdb/dbinc/cxx_int.h
index f8169f7..40143b8 100644
--- a/libdb/dbinc/cxx_int.h
+++ b/libdb/dbinc/cxx_int.h
@@ -15,9 +15,9 @@
 //
 // Using FooImp classes will allow the implementation to change in the
 // future without any modification to user code or even to header files
-// that the user includes. FooImp * is just like void * except that it
+// that the user includes. FooImp * is just like gpointer  except that it
 // provides a little extra protection, since you cannot randomly assign
-// any old pointer to a FooImp* as you can with void *.  Currently, a
+// any old pointer to a FooImp* as you can with gpointer .  Currently, a
 // pointer to such an opaque class is always just a pointer to the
 // appropriate underlying implementation struct.  These are converted
 // back and forth using the various overloaded wrap()/unwrap() methods.
@@ -33,18 +33,18 @@
 	inline _WRAPPED_TYPE unwrap(_WRAPPER_CLASS *val)                   \
 	{                                                                  \
 		if (!val) return (0);                                      \
-		return ((_WRAPPED_TYPE)((void *)(val->imp())));            \
+		return ((_WRAPPED_TYPE)((gpointer)(val->imp())));            \
 	}                                                                  \
 									   \
 	inline const _WRAPPED_TYPE unwrapConst(const _WRAPPER_CLASS *val)  \
 	{                                                                  \
 		if (!val) return (0);                                      \
-		return ((const _WRAPPED_TYPE)((void *)(val->constimp()))); \
+		return ((const _WRAPPED_TYPE)((gpointer)(val->constimp()))); \
 	}                                                                  \
 									   \
 	inline _IMP_CLASS *wrap(_WRAPPED_TYPE val)                         \
 	{                                                                  \
-		return ((_IMP_CLASS*)((void *)val));                       \
+		return ((_IMP_CLASS*)((gpointer)val));                       \
 	}
 
 WRAPPED_CLASS(DbMpoolFile, DbMpoolFileImp, DB_MPOOLFILE*)
@@ -55,7 +55,7 @@ WRAPPED_CLASS(DbTxn, DbTxnImp, DB_TXN*)
 // A tristate integer value used by the DB_ERROR macro below.
 // We chose not to make this an enumerated type so it can
 // be kept private, even though methods that return the
-// tristate int can be declared in db_cxx.h .
+// tristate gint can be declared in db_cxx.h .
 //
 #define	ON_ERROR_THROW     1
 #define	ON_ERROR_RETURN    0
diff --git a/libdb/dbinc/db_am.h b/libdb/dbinc/db_am.h
index 12d191d..ad8e5df 100644
--- a/libdb/dbinc/db_am.h
+++ b/libdb/dbinc/db_am.h
@@ -51,7 +51,7 @@
 }
 
 #define	REC_CLOSE {							\
-	int __t_ret;							\
+	gint __t_ret;							\
 	if (argp != NULL)						\
 		__os_free(dbenv, argp);					\
 	if (dbc != NULL &&						\
@@ -117,7 +117,7 @@
 
 typedef struct {
 	DBC *dbc;
-	int count;
+	gint count;
 } db_trunc_param;
 
 #include "dbinc/db_dispatch.h"
diff --git a/libdb/dbinc/db_dispatch.h b/libdb/dbinc/db_dispatch.h
index d01b607..d33c8d2 100644
--- a/libdb/dbinc/db_dispatch.h
+++ b/libdb/dbinc/db_dispatch.h
@@ -64,7 +64,7 @@ struct __db_txnhead {
 		u_int32_t txn_min;
 		u_int32_t txn_max;
 	} *gen_array;		/* Array of txnids associted with a gen. */
-	int nslots;
+	gint nslots;
 	LIST_HEAD(__db_headlink, __db_txnlist) head[1];
 };
 
@@ -86,7 +86,7 @@ struct __db_txnlist {
 			int32_t nentries;
 			int32_t maxentry;
 			int32_t locked;
-			char *fname;
+			gchar *fname;
 			int32_t fileid;
 			db_pgno_t *pgno_array;
 			u_int8_t uid[DB_FILE_ID_LEN];
diff --git a/libdb/dbinc/db_server_int.h b/libdb/dbinc/db_server_int.h
index 022a60f..078687f 100644
--- a/libdb/dbinc/db_server_int.h
+++ b/libdb/dbinc/db_server_int.h
@@ -40,10 +40,10 @@ DB_SYSTEM_MEM | DB_USE_ENVIRON | DB_USE_ENVIRON_ROOT)
 typedef struct home_entry home_entry;
 struct home_entry {
 	LIST_ENTRY(home_entry) entries;
-	char *home;
-	char *dir;
-	char *name;
-	char *passwd;
+	gchar *home;
+	gchar *dir;
+	gchar *name;
+	gchar *passwd;
 };
 
 /*
@@ -101,7 +101,7 @@ struct ct_entry {
 		DB *dbp;			/* H_DB */
 		DBC *dbc;			/* H_CURSOR */
 #endif
-		void *anyp;
+		gpointer anyp;
 	} handle_u;
 	union {					/* Private data per type */
 		ct_envdata	envdp;		/* Env info */
@@ -128,7 +128,7 @@ struct ct_entry {
 #define	ct_envdp private_u.envdp
 #define	ct_dbdp private_u.dbdp
 
-extern int __dbsrv_verbose;
+extern gint __dbsrv_verbose;
 
 /*
  * Get ctp and activate it.
diff --git a/libdb/dbinc/debug.h b/libdb/dbinc/debug.h
index 55a5c5d..d7e9540 100644
--- a/libdb/dbinc/debug.h
+++ b/libdb/dbinc/debug.h
@@ -148,7 +148,7 @@ do {									\
 
 #define	DB_ENV_TEST_RECOVERY(env, val, ret, name)			\
 do {									\
-	int __ret;							\
+	gint __ret;							\
 	PANIC_CHECK((env));						\
 	if ((env)->test_copy == (val)) {				\
 		/* COPY the FILE */					\
@@ -165,7 +165,7 @@ do {									\
 
 #define	DB_TEST_RECOVERY(dbp, val, ret, name)				\
 do {									\
-	int __ret;							\
+	gint __ret;							\
 	PANIC_CHECK((dbp)->dbenv);					\
 	if ((dbp)->dbenv->test_copy == (val)) {				\
 		/* Copy the file. */					\
diff --git a/libdb/dbinc/globals.h b/libdb/dbinc/globals.h
index 4454cab..445d529 100644
--- a/libdb/dbinc/globals.h
+++ b/libdb/dbinc/globals.h
@@ -26,24 +26,24 @@ typedef struct __db_globals {
 	TAILQ_HEAD(__db_envq, __db_env) db_envq;
 
 	int	(*j_close) __P((int));	/* Underlying OS interface jump table.*/
-	void	(*j_dirfree) __P((char **, int));
-	int	(*j_dirlist) __P((const char *, char ***, int *));
-	int	(*j_exists) __P((const char *, int *));
-	void	(*j_free) __P((void *));
+	void	(*j_dirfree) __P((gchar **, int));
+	int	(*j_dirlist) __P((const gchar *, gchar ***, gint *));
+	int	(*j_exists) __P((const gchar *, gint *));
+	void	(*j_free) __P((gpointer));
 	int	(*j_fsync) __P((int));
-	int	(*j_ioinfo) __P((const char *,
+	int	(*j_ioinfo) __P((const gchar *,
 		    int, u_int32_t *, u_int32_t *, u_int32_t *));
 	void   *(*j_malloc) __P((size_t));
-	int	(*j_map) __P((char *, size_t, int, int, void **));
-	int	(*j_open) __P((const char *, int, ...));
-	ssize_t	(*j_read) __P((int, void *, size_t));
-	void   *(*j_realloc) __P((void *, size_t));
-	int	(*j_rename) __P((const char *, const char *));
+	int	(*j_map) __P((gchar *, size_t, int, int, gpointer *));
+	int	(*j_open) __P((const gchar *, int, ...));
+	ssize_t	(*j_read) __P((int, gpointer , size_t));
+	void   *(*j_realloc) __P((gpointer , size_t));
+	int	(*j_rename) __P((const gchar *, const gchar *));
 	int	(*j_seek) __P((int, size_t, db_pgno_t, u_int32_t, int, int));
 	int	(*j_sleep) __P((u_long, u_long));
-	int	(*j_unlink) __P((const char *));
-	int	(*j_unmap) __P((void *, size_t));
-	ssize_t	(*j_write) __P((int, const void *, size_t));
+	int	(*j_unlink) __P((const gchar *));
+	int	(*j_unmap) __P((gpointer , size_t));
+	ssize_t	(*j_write) __P((int, gconstpointer , size_t));
 	int	(*j_yield) __P((void));
 } DB_GLOBALS;
 
diff --git a/libdb/dbinc/hash.h b/libdb/dbinc/hash.h
index 218ad13..b60122a 100644
--- a/libdb/dbinc/hash.h
+++ b/libdb/dbinc/hash.h
@@ -51,7 +51,7 @@ typedef struct hash_t {
 	u_int32_t h_ffactor;	/* Fill factor. */
 	u_int32_t h_nelem;	/* Number of elements. */
 				/* Hash function. */
-	u_int32_t (*h_hash) __P((DB *, const void *, u_int32_t));
+	u_int32_t (*h_hash) __P((DB *, gconstpointer , u_int32_t));
 } HASH;
 
 /* Cursor structure definitions. */
diff --git a/libdb/dbinc/lock.h b/libdb/dbinc/lock.h
index 0027faf..131c003 100644
--- a/libdb/dbinc/lock.h
+++ b/libdb/dbinc/lock.h
@@ -92,7 +92,7 @@ typedef struct __sh_dbt {
 	ssize_t   off;			/* Region offset. */
 } SH_DBT;
 
-#define	SH_DBT_PTR(p)	((void *)(((u_int8_t *)(p)) + (p)->off))
+#define	SH_DBT_PTR(p)	((gpointer)(((u_int8_t *)(p)) + (p)->off))
 
 /*
  * Object structures;  these live in the object hash table.
diff --git a/libdb/dbinc/mp.h b/libdb/dbinc/mp.h
index f99f735..0c199b8 100644
--- a/libdb/dbinc/mp.h
+++ b/libdb/dbinc/mp.h
@@ -59,8 +59,8 @@ struct __db_mpreg {
 
 	int32_t ftype;			/* File type. */
 					/* Pgin, pgout routines. */
-	int (*pgin) __P((DB_ENV *, db_pgno_t, void *, DBT *));
-	int (*pgout) __P((DB_ENV *, db_pgno_t, void *, DBT *));
+	gint (*pgin) __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
+	gint (*pgout) __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
 };
 
 /*
diff --git a/libdb/dbinc/mutex.h b/libdb/dbinc/mutex.h
index 9d594bb..1d88c91 100644
--- a/libdb/dbinc/mutex.h
+++ b/libdb/dbinc/mutex.h
@@ -76,7 +76,7 @@
  *********************************************************************/
 #ifdef HAVE_MUTEX_AIX_CHECK_LOCK
 #include <sys/atomic_op.h>
-typedef int tsl_t;
+typedef gint tsl_t;
 #define	MUTEX_ALIGN	sizeof(int)
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
@@ -209,7 +209,7 @@ typedef lock_t tsl_t;
 #ifdef HAVE_MUTEX_VMS
 #include <sys/mman.h>;
 #include <builtins.h>
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 #define	MUTEX_ALIGN		sizeof(unsigned int)
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
@@ -282,7 +282,7 @@ do {									\
  * when we initialize the mutex.
  *********************************************************************/
 #ifdef HAVE_MUTEX_WIN16
-typedef unsigned int tsl_t;
+typedef guint tsl_t;
 #define	MUTEX_ALIGN		sizeof(unsigned int)
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
@@ -312,7 +312,7 @@ typedef unsigned int tsl_t;
  * 68K/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_68K_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
@@ -320,7 +320,7 @@ typedef unsigned char tsl_t;
  */
 #define	MUTEX_SET(tsl) ({						\
 	register tsl_t *__l = (tsl);					\
-	int __r;							\
+	gint __r;							\
 	    asm volatile("tas  %1; \n					\
 			  seq  %0"					\
 		: "=dm" (__r), "=m" (*__l)				\
@@ -390,14 +390,14 @@ MUTEX_UNSET(tsl_t *tsl) {
  * ARM/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_ARM_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
  * For arm/gcc, 0 is clear, 1 is set.
  */
 #define	MUTEX_SET(tsl) ({						\
-	int __r;							\
+	gint __r;							\
 	asm volatile("swpb %0, %1, [%2]"				\
 	    : "=r" (__r)						\
 	    : "0" (1), "r" (tsl)					\
@@ -426,7 +426,7 @@ typedef u_int32_t tsl_t;
  */
 #define	MUTEX_SET(tsl) ({						\
 	register tsl_t *__l = (tsl);					\
-	int __r;							\
+	gint __r;							\
 	asm volatile("ldcws 0(%1),%0" : "=r" (__r) : "r" (__l));	\
 	__r & 1;							\
 })
@@ -440,7 +440,7 @@ typedef u_int32_t tsl_t;
  * IA64/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_IA64_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
@@ -457,7 +457,7 @@ typedef unsigned char tsl_t;
  * Store through a "volatile" pointer so we get a store with "release"
  * semantics.
  */
-#define	MUTEX_UNSET(tsl)	(*(volatile unsigned char *)(tsl) = 0)
+#define	MUTEX_UNSET(tsl)	(*(volatile guchar *)(tsl) = 0)
 #define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
 #endif
 #endif
@@ -508,7 +508,7 @@ typedef u_int32_t tsl_t;
  * ___db_mutex_set label is used as a function name.
  */
 #ifdef HAVE_MUTEX_PPC_APPLE_GCC_ASSEMBLY
-extern int __db_mutex_set __P((volatile tsl_t *));
+extern gint __db_mutex_set __P((volatile tsl_t *));
 void
 __db_mutex_tas_dummy()
 {
@@ -532,8 +532,8 @@ success:				\n\
 #endif
 #ifdef HAVE_MUTEX_PPC_GENERIC_GCC_ASSEMBLY
 #define	MUTEX_SET(tsl)	({		\
-	int __one = 1;			\
-	int __r;			\
+	gint __one = 1;			\
+	gint __r;			\
 	tsl_t *__l = (tsl);		\
 	asm volatile ("			\
 0:					\
@@ -561,7 +561,7 @@ success:				\n\
  * S/390 32-bit assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_S390_GCC_ASSEMBLY
-typedef int tsl_t;
+typedef gint tsl_t;
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
@@ -570,7 +570,7 @@ typedef int tsl_t;
 static inline int
 MUTEX_SET(tsl_t *tsl) {							\
 	register tsl_t *__l = (tsl);					\
-	int __r;							\
+	gint __r;							\
   asm volatile(								\
        "    la    1,%1\n"						\
        "    lhi   0,1\n"						\
@@ -591,7 +591,7 @@ MUTEX_SET(tsl_t *tsl) {							\
  * SCO/cc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
@@ -602,7 +602,7 @@ typedef unsigned char tsl_t;
 
 #if defined(__USLC__)
 asm int
-_tsl_set(void *tsl)
+_tsl_set(gpointer tsl)
 {
 %mem tsl
 	movl	tsl, %ecx
@@ -623,7 +623,7 @@ _tsl_set(void *tsl)
  * Sparc/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_SPARC_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
@@ -659,7 +659,7 @@ typedef unsigned char tsl_t;
  * UTS/cc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_UTS_CC_ASSEMBLY
-typedef int tsl_t;
+typedef gint tsl_t;
 
 #define	MUTEX_ALIGN	sizeof(int)
 #ifdef LOAD_ACTUAL_MUTEX_CODE
@@ -673,7 +673,7 @@ typedef int tsl_t;
  * MIPS/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_MIPS_GCC_ASSEMBLY
-typedef unsigned int tsl_t;
+typedef guint tsl_t;
 #define MUTEX_ALIGN     sizeof(unsigned int)
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
@@ -707,7 +707,7 @@ typedef unsigned int tsl_t;
  * x86/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_X86_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
@@ -715,7 +715,7 @@ typedef unsigned char tsl_t;
  */
 #define	MUTEX_SET(tsl) ({						\
 	register tsl_t *__l = (tsl);					\
-	int __r;							\
+	gint __r;							\
 	asm volatile("movl $1,%%eax; lock; xchgb %1,%%al; xorl $1,%%eax"\
 	    : "=&a" (__r), "=m" (*__l)					\
 	    : "1" (*__l)						\
@@ -732,7 +732,7 @@ typedef unsigned char tsl_t;
  * x86_64/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 
 #ifdef LOAD_ACTUAL_MUTEX_CODE
 /*
@@ -740,7 +740,7 @@ typedef unsigned char tsl_t;
  */
 #define	MUTEX_SET(tsl) ({						\
 	register tsl_t *__l = (tsl);					\
-	int __r;							\
+	gint __r;							\
 	asm volatile("movq $1,%%rax; lock; xchgb %1,%%al; xorq $1,%%rax"\
 	    : "=&a" (__r), "=m" (*__l)					\
 	    : "1" (*__l)						\
@@ -757,7 +757,7 @@ typedef unsigned char tsl_t;
  * alphalinux/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_ALPHA_LINUX_ASSEMBLY
-typedef unsigned long int tsl_t;
+typedef unsigned long gint tsl_t;
 
 #define	MUTEX_ALIGN	8
 #endif
@@ -766,21 +766,21 @@ typedef unsigned long int tsl_t;
  * sparc32linux/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_SPARC32_LINUX_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 #endif
 
 /*********************************************************************
  * sparc64linux/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_SPARC64_LINUX_ASSEMBLY
-typedef unsigned char tsl_t;
+typedef guchar tsl_t;
 #endif
 
 /*********************************************************************
  * s390linux/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_S390_LINUX_ASSEMBLY
-typedef volatile int tsl_t;
+typedef volatile gint tsl_t;
 #endif
 
 /*
diff --git a/libdb/dbinc/qam.h b/libdb/dbinc/qam.h
index a16fffc..945ba16 100644
--- a/libdb/dbinc/qam.h
+++ b/libdb/dbinc/qam.h
@@ -40,7 +40,7 @@ typedef struct __mpfarray {
 	u_int32_t low_extent;		/* First extent open. */
 	u_int32_t hi_extent;		/* Last extent open. */
 	struct __qmpf {
-		int pinref;
+		gint pinref;
 		DB_MPOOLFILE *mpf;
 	} *mpfarray;			 /* Array of open extents. */
 } MPFARRAY;
@@ -62,10 +62,10 @@ struct __queue {
 	DBT pgcookie;			/* Initialized pgcookie. */
 	DB_PGINFO pginfo;		/* Initialized pginfo struct. */
 
-	char *path;			/* Space allocated to file pathname. */
-	char *name;			/* The name of the file. */
-	char *dir;			/* The dir of the file. */
-	int mode;			/* Mode to open extents. */
+	gchar *path;			/* Space allocated to file pathname. */
+	gchar *name;			/* The name of the file. */
+	gchar *dir;			/* The dir of the file. */
+	gint mode;			/* Mode to open extents. */
 };
 
 /* Format for queue extent names. */
diff --git a/libdb/dbinc/queue.h b/libdb/dbinc/queue.h
index 8d4a771..3b7451d 100644
--- a/libdb/dbinc/queue.h
+++ b/libdb/dbinc/queue.h
@@ -257,14 +257,14 @@ struct {								\
  * Circular queue functions.
  */
 #define	CIRCLEQ_INIT(head) do {						\
-	(head)->cqh_first = (void *)(head);				\
-	(head)->cqh_last = (void *)(head);				\
+	(head)->cqh_first = (gpointer)(head);				\
+	(head)->cqh_last = (gpointer)(head);				\
 } while (0)
 
 #define	CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
 	(elm)->field.cqe_next = (listelm)->field.cqe_next;		\
 	(elm)->field.cqe_prev = (listelm);				\
-	if ((listelm)->field.cqe_next == (void *)(head))		\
+	if ((listelm)->field.cqe_next == (gpointer)(head))		\
 		(head)->cqh_last = (elm);				\
 	else								\
 		(listelm)->field.cqe_next->field.cqe_prev = (elm);	\
@@ -274,7 +274,7 @@ struct {								\
 #define	CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {		\
 	(elm)->field.cqe_next = (listelm);				\
 	(elm)->field.cqe_prev = (listelm)->field.cqe_prev;		\
-	if ((listelm)->field.cqe_prev == (void *)(head))		\
+	if ((listelm)->field.cqe_prev == (gpointer)(head))		\
 		(head)->cqh_first = (elm);				\
 	else								\
 		(listelm)->field.cqe_prev->field.cqe_next = (elm);	\
@@ -283,8 +283,8 @@ struct {								\
 
 #define	CIRCLEQ_INSERT_HEAD(head, elm, field) do {			\
 	(elm)->field.cqe_next = (head)->cqh_first;			\
-	(elm)->field.cqe_prev = (void *)(head);				\
-	if ((head)->cqh_last == (void *)(head))				\
+	(elm)->field.cqe_prev = (gpointer)(head);				\
+	if ((head)->cqh_last == (gpointer)(head))				\
 		(head)->cqh_last = (elm);				\
 	else								\
 		(head)->cqh_first->field.cqe_prev = (elm);		\
@@ -292,9 +292,9 @@ struct {								\
 } while (0)
 
 #define	CIRCLEQ_INSERT_TAIL(head, elm, field) do {			\
-	(elm)->field.cqe_next = (void *)(head);				\
+	(elm)->field.cqe_next = (gpointer)(head);				\
 	(elm)->field.cqe_prev = (head)->cqh_last;			\
-	if ((head)->cqh_first == (void *)(head))			\
+	if ((head)->cqh_first == (gpointer)(head))			\
 		(head)->cqh_first = (elm);				\
 	else								\
 		(head)->cqh_last->field.cqe_next = (elm);		\
@@ -302,12 +302,12 @@ struct {								\
 } while (0)
 
 #define	CIRCLEQ_REMOVE(head, elm, field) do {				\
-	if ((elm)->field.cqe_next == (void *)(head))			\
+	if ((elm)->field.cqe_next == (gpointer)(head))			\
 		(head)->cqh_last = (elm)->field.cqe_prev;		\
 	else								\
 		(elm)->field.cqe_next->field.cqe_prev =			\
 		    (elm)->field.cqe_prev;				\
-	if ((elm)->field.cqe_prev == (void *)(head))			\
+	if ((elm)->field.cqe_prev == (gpointer)(head))			\
 		(head)->cqh_first = (elm)->field.cqe_next;		\
 	else								\
 		(elm)->field.cqe_prev->field.cqe_next =			\
diff --git a/libdb/dbinc/region.h b/libdb/dbinc/region.h
index 1b76e2d..7403e9d 100644
--- a/libdb/dbinc/region.h
+++ b/libdb/dbinc/region.h
@@ -262,7 +262,7 @@ typedef struct __db_regmaint_t {
  * portable.  We use u_int32_t, which restricts regions to 4Gb in size.
  */
 #define	R_ADDR(base, offset)						\
-	((void *)((u_int8_t *)((base)->addr) + offset))
+	((gpointer)((u_int8_t *)((base)->addr) + offset))
 #define	R_OFFSET(base, p)						\
 	((u_int32_t)((u_int8_t *)(p) - (u_int8_t *)(base)->addr))
 
diff --git a/libdb/dbinc/rep.h b/libdb/dbinc/rep.h
index 1e31549..0f1ee7e 100644
--- a/libdb/dbinc/rep.h
+++ b/libdb/dbinc/rep.h
@@ -164,8 +164,8 @@ typedef struct __txn_recs {
 } TXN_RECS;
 
 typedef struct __lsn_collection {
-	int nlsns;
-	int nalloc;
+	gint nlsns;
+	gint nalloc;
 	DB_LSN *array;
 } LSN_COLLECTION;
 
diff --git a/libdb/dbinc/shqueue.h b/libdb/dbinc/shqueue.h
index af69025..d1db32c 100644
--- a/libdb/dbinc/shqueue.h
+++ b/libdb/dbinc/shqueue.h
@@ -239,27 +239,27 @@ struct {								\
 
 #define	SH_CIRCLEQ_FIRST(head, type)					\
 	((head)->scqh_first == -1 ?					\
-	(void *)head : SH_CIRCLEQ_FIRSTP(head, type))
+	(gpointer)head : SH_CIRCLEQ_FIRSTP(head, type))
 
 #define	SH_CIRCLEQ_LASTP(head, type)					\
 	((struct type *)(((u_int8_t *)(head)) + (head)->scqh_last))
 
 #define	SH_CIRCLEQ_LAST(head, type)					\
-	((head)->scqh_last == -1 ? (void *)head : SH_CIRCLEQ_LASTP(head, type))
+	((head)->scqh_last == -1 ? (gpointer)head : SH_CIRCLEQ_LASTP(head, type))
 
 #define	SH_CIRCLEQ_NEXTP(elm, field, type)				\
 	((struct type *)(((u_int8_t *)(elm)) + (elm)->field.scqe_next))
 
 #define	SH_CIRCLEQ_NEXT(head, elm, field, type)				\
 	((elm)->field.scqe_next == SH_PTR_TO_OFF(elm, head) ?		\
-	    (void *)head : SH_CIRCLEQ_NEXTP(elm, field, type))
+	    (gpointer)head : SH_CIRCLEQ_NEXTP(elm, field, type))
 
 #define	SH_CIRCLEQ_PREVP(elm, field, type)				\
 	((struct type *)(((u_int8_t *)(elm)) + (elm)->field.scqe_prev))
 
 #define	SH_CIRCLEQ_PREV(head, elm, field, type)				\
 	((elm)->field.scqe_prev == SH_PTR_TO_OFF(elm, head) ?		\
-	    (void *)head : SH_CIRCLEQ_PREVP(elm, field, type))
+	    (gpointer)head : SH_CIRCLEQ_PREVP(elm, field, type))
 
 #define	SH_CIRCLEQ_INIT(head) {						\
 	(head)->scqh_first = 0;						\
@@ -270,7 +270,7 @@ struct {								\
 	(elm)->field.scqe_prev = SH_PTR_TO_OFF(elm, listelm);		\
 	(elm)->field.scqe_next = (listelm)->field.scqe_next +		\
 	    (elm)->field.scqe_prev;					\
-	if (SH_CIRCLEQ_NEXTP(listelm, field, type) == (void *)head)	\
+	if (SH_CIRCLEQ_NEXTP(listelm, field, type) == (gpointer)head)	\
 		(head)->scqh_last = SH_PTR_TO_OFF(head, elm);		\
 	else								\
 		SH_CIRCLEQ_NEXTP(listelm,				\
@@ -284,7 +284,7 @@ struct {								\
 	(elm)->field.scqe_next = SH_PTR_TO_OFF(elm, listelm);		\
 	(elm)->field.scqe_prev = (elm)->field.scqe_next -		\
 		SH_CIRCLEQ_PREVP(listelm, field, type)->field.scqe_next;\
-	if (SH_CIRCLEQ_PREVP(listelm, field, type) == (void *)(head))	\
+	if (SH_CIRCLEQ_PREVP(listelm, field, type) == (gpointer)(head))	\
 		(head)->scqh_first = SH_PTR_TO_OFF(head, elm);		\
 	else								\
 		SH_CIRCLEQ_PREVP(listelm,				\
@@ -319,12 +319,12 @@ struct {								\
 } while (0)
 
 #define	SH_CIRCLEQ_REMOVE(head, elm, field, type) do {			\
-	if (SH_CIRCLEQ_NEXTP(elm, field, type) == (void *)(head))	\
+	if (SH_CIRCLEQ_NEXTP(elm, field, type) == (gpointer)(head))	\
 		(head)->scqh_last += (elm)->field.scqe_prev;		\
 	else								\
 		SH_CIRCLEQ_NEXTP(elm, field, type)->field.scqe_prev +=	\
 		    (elm)->field.scqe_prev;				\
-	if (SH_CIRCLEQ_PREVP(elm, field, type) == (void *)(head))	\
+	if (SH_CIRCLEQ_PREVP(elm, field, type) == (gpointer)(head))	\
 		(head)->scqh_first += (elm)->field.scqe_next;		\
 	else								\
 		SH_CIRCLEQ_PREVP(elm, field, type)->field.scqe_next +=	\
diff --git a/libdb/dbinc/tcl_db.h b/libdb/dbinc/tcl_db.h
index 2ec368b..42d0086 100644
--- a/libdb/dbinc/tcl_db.h
+++ b/libdb/dbinc/tcl_db.h
@@ -34,7 +34,7 @@ typedef struct _mutex_entry {
 		 * real_val might push it over the 32 byte boundary.  The best
 		 * we can do is use a 48 byte boundary.
 		 */
-		char c[48];
+		gchar c[48];
 	} u;
 } _MUTEX_ENTRY;
 
@@ -80,11 +80,11 @@ typedef struct _mutex_data {
 typedef struct dbtcl_info {
 	LIST_ENTRY(dbtcl_info) entries;
 	Tcl_Interp *i_interp;
-	char *i_name;
+	gchar *i_name;
 	enum INFOTYPE i_type;
 	union infop {
 		DB_ENV *envp;
-		void *anyp;
+		gpointer anyp;
 		DB *dbp;
 		DBC *dbcp;
 		DB_TXN *txnp;
@@ -94,17 +94,17 @@ typedef struct dbtcl_info {
 		DB_LOGC *logc;
 	} un;
 	union data {
-		int anydata;
+		gint anydata;
 		db_pgno_t pgno;
 		u_int32_t lockid;
 	} und;
 	union data2 {
-		int anydata;
+		gint anydata;
 		size_t pagesz;
 	} und2;
 	DBT i_lockobj;
 	FILE *i_err;
-	char *i_errpfx;
+	gchar *i_errpfx;
 
 	/* Callbacks--Tcl_Objs containing proc names */
 	Tcl_Obj *i_btcompare;
@@ -147,7 +147,7 @@ typedef struct dbtcl_info {
 
 #define	i_dbdbcid i_otherid[0]
 
-extern int __debug_on, __debug_print, __debug_stop, __debug_test;
+extern gint __debug_on, __debug_print, __debug_stop, __debug_test;
 
 typedef struct dbtcl_global {
 	LIST_HEAD(infohead, dbtcl_info) g_infohead;
diff --git a/libdb/dbinc/xa.h b/libdb/dbinc/xa.h
index 9786e29..a8e1b1c 100644
--- a/libdb/dbinc/xa.h
+++ b/libdb/dbinc/xa.h
@@ -25,7 +25,7 @@ struct xid_t {
 	long formatID;			/* format identifier */
 	long gtrid_length;		/* value from 1 through 64 */
 	long bqual_length;		/* value from 1 through 64 */
-	char data[XIDDATASIZE];
+	gchar data[XIDDATASIZE];
 };
 typedef	struct xid_t XID;
 /*
@@ -35,8 +35,8 @@ typedef	struct xid_t XID;
 /*
  * Declarations of routines by which RMs call TMs:
  */
-extern int ax_reg __P((int, XID *, long));
-extern int ax_unreg __P((int, long));
+extern gint ax_reg __P((int, XID *, long));
+extern gint ax_unreg __P((int, long));
 
 /*
  * XA Switch Data Structure
@@ -47,29 +47,29 @@ extern int ax_unreg __P((int, long));
 					/* strings, including the null
 					terminator */
 struct xa_switch_t {
-	char name[RMNAMESZ];		/* name of resource manager */
+	gchar name[RMNAMESZ];		/* name of resource manager */
 	long flags;			/* resource manager specific options */
 	long version;			/* must be 0 */
-	int (*xa_open_entry)		/* xa_open function pointer */
-	    __P((char *, int, long));
-	int (*xa_close_entry)		/* xa_close function pointer */
-	    __P((char *, int, long));
-	int (*xa_start_entry)		/* xa_start function pointer */
+	gint (*xa_open_entry)		/* xa_open function pointer */
+	    __P((gchar *, int, long));
+	gint (*xa_close_entry)		/* xa_close function pointer */
+	    __P((gchar *, int, long));
+	gint (*xa_start_entry)		/* xa_start function pointer */
 	    __P((XID *, int, long));
-	int (*xa_end_entry)		/* xa_end function pointer */
+	gint (*xa_end_entry)		/* xa_end function pointer */
 	    __P((XID *, int, long));
-	int (*xa_rollback_entry)	/* xa_rollback function pointer */
+	gint (*xa_rollback_entry)	/* xa_rollback function pointer */
 	    __P((XID *, int, long));
-	int (*xa_prepare_entry)		/* xa_prepare function pointer */
+	gint (*xa_prepare_entry)		/* xa_prepare function pointer */
 	    __P((XID *, int, long));
-	int (*xa_commit_entry)		/* xa_commit function pointer */
+	gint (*xa_commit_entry)		/* xa_commit function pointer */
 	    __P((XID *, int, long));
-	int (*xa_recover_entry)		/* xa_recover function pointer */
+	gint (*xa_recover_entry)		/* xa_recover function pointer */
 	    __P((XID *, long, int, long));
-	int (*xa_forget_entry)		/* xa_forget function pointer */
+	gint (*xa_forget_entry)		/* xa_forget function pointer */
 	    __P((XID *, int, long));
-	int (*xa_complete_entry)	/* xa_complete function pointer */
-	    __P((int *, int *, int, long));
+	gint (*xa_complete_entry)	/* xa_complete function pointer */
+	    __P((gint *, gint *, int, long));
 };
 
 /*
diff --git a/libdb/dbinc_auto/btree_ext.h b/libdb/dbinc_auto/btree_ext.h
index ec5468a..46d4302 100644
--- a/libdb/dbinc_auto/btree_ext.h
+++ b/libdb/dbinc_auto/btree_ext.h
@@ -6,125 +6,125 @@
 extern "C" {
 #endif
 
-int __bam_cmp __P((DB *, const DBT *, PAGE *, u_int32_t, int (*)(DB *, const DBT *, const DBT *), int *));
-int __bam_defcmp __P((DB *, const DBT *, const DBT *));
+gint __bam_cmp __P((DB *, const DBT *, PAGE *, u_int32_t, gint (*)(DB *, const DBT *, const DBT *), gint *));
+gint __bam_defcmp __P((DB *, const DBT *, const DBT *));
 size_t __bam_defpfx __P((DB *, const DBT *, const DBT *));
-int __bam_pgin __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
-int __bam_pgout __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
-int __bam_mswap __P((PAGE *));
+gint __bam_pgin __P((DB_ENV *, DB *, db_pgno_t, gpointer , DBT *));
+gint __bam_pgout __P((DB_ENV *, DB *, db_pgno_t, gpointer , DBT *));
+gint __bam_mswap __P((PAGE *));
 void __bam_cprint __P((DBC *));
-int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int));
-int __ram_ca_delete __P((DB *, db_pgno_t));
-int __bam_ca_di __P((DBC *, db_pgno_t, u_int32_t, int));
-int __bam_ca_dup __P((DBC *, u_int32_t, db_pgno_t, u_int32_t, db_pgno_t, u_int32_t));
-int __bam_ca_undodup __P((DB *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t));
-int __bam_ca_rsplit __P((DBC *, db_pgno_t, db_pgno_t));
-int __bam_ca_split __P((DBC *, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, int));
+gint __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int));
+gint __ram_ca_delete __P((DB *, db_pgno_t));
+gint __bam_ca_di __P((DBC *, db_pgno_t, u_int32_t, int));
+gint __bam_ca_dup __P((DBC *, u_int32_t, db_pgno_t, u_int32_t, db_pgno_t, u_int32_t));
+gint __bam_ca_undodup __P((DB *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t));
+gint __bam_ca_rsplit __P((DBC *, db_pgno_t, db_pgno_t));
+gint __bam_ca_split __P((DBC *, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, int));
 void __bam_ca_undosplit __P((DB *, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t));
-int __bam_c_init __P((DBC *, DBTYPE));
-int __bam_c_refresh __P((DBC *));
-int __bam_c_count __P((DBC *, db_recno_t *));
-int __bam_c_dup __P((DBC *, DBC *));
-int __bam_bulk_overflow __P((DBC *, u_int32_t, db_pgno_t, u_int8_t *));
-int __bam_bulk_duplicates __P((DBC *, db_pgno_t, u_int8_t *, int32_t *, int32_t **, u_int8_t **, u_int32_t *, int));
-int __bam_c_rget __P((DBC *, DBT *));
-int __bam_ditem __P((DBC *, PAGE *, u_int32_t));
-int __bam_adjindx __P((DBC *, PAGE *, u_int32_t, u_int32_t, int));
-int __bam_dpages __P((DBC *, EPG *));
-int __bam_db_create __P((DB *));
-int __bam_db_close __P((DB *));
-int __bam_set_flags __P((DB *, u_int32_t *flagsp));
-int __ram_set_flags __P((DB *, u_int32_t *flagsp));
-int __bam_open __P((DB *, DB_TXN *, const char *, db_pgno_t, u_int32_t));
-int __bam_metachk __P((DB *, const char *, BTMETA *));
-int __bam_read_root __P((DB *, DB_TXN *, db_pgno_t, u_int32_t));
-int __bam_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
-int __bam_new_subdb __P((DB *, DB *, DB_TXN *));
-int __bam_iitem __P((DBC *, DBT *, DBT *, u_int32_t, u_int32_t));
-int __bam_ritem __P((DBC *, PAGE *, u_int32_t, DBT *));
-int __bam_split_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_rsplit_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_adj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_cadjust_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_cdel_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_repl_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_root_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_curadj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_rcuradj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_reclaim __P((DB *, DB_TXN *));
-int __bam_truncate __P((DB *, DB_TXN *, u_int32_t *));
-int __ram_open __P((DB *, DB_TXN *, const char *, db_pgno_t, u_int32_t));
-int __ram_append __P((DBC *, DBT *, DBT *));
-int __ram_c_del __P((DBC *));
-int __ram_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-int __ram_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-int __ram_ca __P((DBC *, ca_recno_arg));
-int __ram_getno __P((DBC *, const DBT *, db_recno_t *, int));
-int __ram_writeback __P((DB *));
-int __bam_rsearch __P((DBC *, db_recno_t *, u_int32_t, int, int *));
-int __bam_adjust __P((DBC *, int32_t));
-int __bam_nrecs __P((DBC *, db_recno_t *));
+gint __bam_c_init __P((DBC *, DBTYPE));
+gint __bam_c_refresh __P((DBC *));
+gint __bam_c_count __P((DBC *, db_recno_t *));
+gint __bam_c_dup __P((DBC *, DBC *));
+gint __bam_bulk_overflow __P((DBC *, u_int32_t, db_pgno_t, u_int8_t *));
+gint __bam_bulk_duplicates __P((DBC *, db_pgno_t, u_int8_t *, int32_t *, int32_t **, u_int8_t **, u_int32_t *, int));
+gint __bam_c_rget __P((DBC *, DBT *));
+gint __bam_ditem __P((DBC *, PAGE *, u_int32_t));
+gint __bam_adjindx __P((DBC *, PAGE *, u_int32_t, u_int32_t, int));
+gint __bam_dpages __P((DBC *, EPG *));
+gint __bam_db_create __P((DB *));
+gint __bam_db_close __P((DB *));
+gint __bam_set_flags __P((DB *, u_int32_t *flagsp));
+gint __ram_set_flags __P((DB *, u_int32_t *flagsp));
+gint __bam_open __P((DB *, DB_TXN *, const gchar *, db_pgno_t, u_int32_t));
+gint __bam_metachk __P((DB *, const gchar *, BTMETA *));
+gint __bam_read_root __P((DB *, DB_TXN *, db_pgno_t, u_int32_t));
+gint __bam_new_file __P((DB *, DB_TXN *, DB_FH *, const gchar *));
+gint __bam_new_subdb __P((DB *, DB *, DB_TXN *));
+gint __bam_iitem __P((DBC *, DBT *, DBT *, u_int32_t, u_int32_t));
+gint __bam_ritem __P((DBC *, PAGE *, u_int32_t, DBT *));
+gint __bam_split_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_rsplit_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_adj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_cadjust_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_cdel_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_repl_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_root_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_curadj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_rcuradj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_reclaim __P((DB *, DB_TXN *));
+gint __bam_truncate __P((DB *, DB_TXN *, u_int32_t *));
+gint __ram_open __P((DB *, DB_TXN *, const gchar *, db_pgno_t, u_int32_t));
+gint __ram_append __P((DBC *, DBT *, DBT *));
+gint __ram_c_del __P((DBC *));
+gint __ram_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+gint __ram_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+gint __ram_ca __P((DBC *, ca_recno_arg));
+gint __ram_getno __P((DBC *, const DBT *, db_recno_t *, int));
+gint __ram_writeback __P((DB *));
+gint __bam_rsearch __P((DBC *, db_recno_t *, u_int32_t, int, gint *));
+gint __bam_adjust __P((DBC *, int32_t));
+gint __bam_nrecs __P((DBC *, db_recno_t *));
 db_recno_t __bam_total __P((DB *, PAGE *));
-int __bam_search __P((DBC *, db_pgno_t, const DBT *, u_int32_t, int, db_recno_t *, int *));
-int __bam_stkrel __P((DBC *, u_int32_t));
-int __bam_stkgrow __P((DB_ENV *, BTREE_CURSOR *));
-int __bam_split __P((DBC *, void *, db_pgno_t *));
-int __bam_copy __P((DB *, PAGE *, PAGE *, u_int32_t, u_int32_t));
-int __bam_stat __P((DB *, void *, u_int32_t));
-int __bam_traverse __P((DBC *, db_lockmode_t, db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *));
-int __bam_stat_callback __P((DB *, PAGE *, void *, int *));
-int __bam_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
-int __bam_30_btreemeta __P((DB *, char *, u_int8_t *));
-int __bam_31_btreemeta __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
-int __bam_31_lbtree __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
-int __bam_vrfy_meta __P((DB *, VRFY_DBINFO *, BTMETA *, db_pgno_t, u_int32_t));
-int __ram_vrfy_leaf __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
-int __bam_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
-int __bam_vrfy_itemorder __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t, int, int, u_int32_t));
-int __bam_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
-int __bam_vrfy_subtree __P((DB *, VRFY_DBINFO *, db_pgno_t, void *, void *, u_int32_t, u_int32_t *, u_int32_t *, u_int32_t *));
-int __bam_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, PAGE *, void *, int (*)(void *, const void *), DBT *, u_int32_t));
-int __bam_salvage_walkdupint __P((DB *, VRFY_DBINFO *, PAGE *, DBT *, void *, int (*)(void *, const void *), u_int32_t));
-int __bam_meta2pgset __P((DB *, VRFY_DBINFO *, BTMETA *, u_int32_t, DB *));
-int __bam_split_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, u_int32_t));
-int __bam_split_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_split_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_split_read __P((DB_ENV *, void *, __bam_split_args **));
-int __bam_rsplit_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *));
-int __bam_rsplit_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_rsplit_read __P((DB_ENV *, void *, __bam_rsplit_args **));
-int __bam_adj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, u_int32_t));
-int __bam_adj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_adj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_adj_read __P((DB_ENV *, void *, __bam_adj_args **));
-int __bam_cadjust_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, u_int32_t));
-int __bam_cadjust_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_cadjust_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_cadjust_read __P((DB_ENV *, void *, __bam_cadjust_args **));
-int __bam_cdel_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t));
-int __bam_cdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_cdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_cdel_read __P((DB_ENV *, void *, __bam_cdel_args **));
-int __bam_repl_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, u_int32_t, u_int32_t));
-int __bam_repl_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_repl_read __P((DB_ENV *, void *, __bam_repl_args **));
-int __bam_root_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, db_pgno_t, DB_LSN *));
-int __bam_root_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_root_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_root_read __P((DB_ENV *, void *, __bam_root_args **));
-int __bam_curadj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_ca_mode, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t));
-int __bam_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_curadj_read __P((DB_ENV *, void *, __bam_curadj_args **));
-int __bam_rcuradj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, ca_recno_arg, db_pgno_t, db_recno_t, u_int32_t));
-int __bam_rcuradj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_rcuradj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __bam_rcuradj_read __P((DB_ENV *, void *, __bam_rcuradj_args **));
-int __bam_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __bam_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __bam_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
+gint __bam_search __P((DBC *, db_pgno_t, const DBT *, u_int32_t, int, db_recno_t *, gint *));
+gint __bam_stkrel __P((DBC *, u_int32_t));
+gint __bam_stkgrow __P((DB_ENV *, BTREE_CURSOR *));
+gint __bam_split __P((DBC *, gpointer , db_pgno_t *));
+gint __bam_copy __P((DB *, PAGE *, PAGE *, u_int32_t, u_int32_t));
+gint __bam_stat __P((DB *, gpointer , u_int32_t));
+gint __bam_traverse __P((DBC *, db_lockmode_t, db_pgno_t, gint (*)(DB *, PAGE *, gpointer , gint *), gpointer ));
+gint __bam_stat_callback __P((DB *, PAGE *, gpointer , gint *));
+gint __bam_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
+gint __bam_30_btreemeta __P((DB *, gchar *, u_int8_t *));
+gint __bam_31_btreemeta __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
+gint __bam_31_lbtree __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
+gint __bam_vrfy_meta __P((DB *, VRFY_DBINFO *, BTMETA *, db_pgno_t, u_int32_t));
+gint __ram_vrfy_leaf __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
+gint __bam_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
+gint __bam_vrfy_itemorder __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t, int, int, u_int32_t));
+gint __bam_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
+gint __bam_vrfy_subtree __P((DB *, VRFY_DBINFO *, db_pgno_t, gpointer , gpointer , u_int32_t, u_int32_t *, u_int32_t *, u_int32_t *));
+gint __bam_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, PAGE *, gpointer , gint (*)(gpointer , gconstpointer ), DBT *, u_int32_t));
+gint __bam_salvage_walkdupint __P((DB *, VRFY_DBINFO *, PAGE *, DBT *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
+gint __bam_meta2pgset __P((DB *, VRFY_DBINFO *, BTMETA *, u_int32_t, DB *));
+gint __bam_split_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, u_int32_t));
+gint __bam_split_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_split_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_split_read __P((DB_ENV *, gpointer , __bam_split_args **));
+gint __bam_rsplit_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *));
+gint __bam_rsplit_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_rsplit_read __P((DB_ENV *, gpointer , __bam_rsplit_args **));
+gint __bam_adj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, u_int32_t));
+gint __bam_adj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_adj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_adj_read __P((DB_ENV *, gpointer , __bam_adj_args **));
+gint __bam_cadjust_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, u_int32_t));
+gint __bam_cadjust_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_cadjust_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_cadjust_read __P((DB_ENV *, gpointer , __bam_cadjust_args **));
+gint __bam_cdel_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t));
+gint __bam_cdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_cdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_cdel_read __P((DB_ENV *, gpointer , __bam_cdel_args **));
+gint __bam_repl_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, u_int32_t, u_int32_t));
+gint __bam_repl_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_repl_read __P((DB_ENV *, gpointer , __bam_repl_args **));
+gint __bam_root_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, db_pgno_t, DB_LSN *));
+gint __bam_root_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_root_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_root_read __P((DB_ENV *, gpointer , __bam_root_args **));
+gint __bam_curadj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_ca_mode, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t));
+gint __bam_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_curadj_read __P((DB_ENV *, gpointer , __bam_curadj_args **));
+gint __bam_rcuradj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, ca_recno_arg, db_pgno_t, db_recno_t, u_int32_t));
+gint __bam_rcuradj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_rcuradj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __bam_rcuradj_read __P((DB_ENV *, gpointer , __bam_rcuradj_args **));
+gint __bam_init_print __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __bam_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __bam_init_recover __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/clib_ext.h b/libdb/dbinc_auto/clib_ext.h
index 7e2817d..7e2b42d 100644
--- a/libdb/dbinc_auto/clib_ext.h
+++ b/libdb/dbinc_auto/clib_ext.h
@@ -7,40 +7,40 @@ extern "C" {
 #endif
 
 #ifndef HAVE_GETCWD
-char *getcwd __P((char *, size_t));
+gchar *getcwd __P((gchar *, size_t));
 #endif
 #ifndef HAVE_GETOPT
-int getopt __P((int, char * const *, const char *));
+gint getopt __P((int, gchar * const *, const gchar *));
 #endif
 #ifndef HAVE_MEMCMP
-int memcmp __P((const void *, const void *, size_t));
+gint memcmp __P((gconstpointer , gconstpointer , size_t));
 #endif
 #ifndef HAVE_MEMCPY
-void *memcpy __P((void *, const void *, size_t));
+gpointer memcpy __P((gpointer , gconstpointer , size_t));
 #endif
 #ifndef HAVE_MEMMOVE
-void *memmove __P((void *, const void *, size_t));
+gpointer memmove __P((gpointer , gconstpointer , size_t));
 #endif
 #ifndef HAVE_RAISE
-int raise __P((int));
+gint raise __P((int));
 #endif
 #ifndef HAVE_SNPRINTF
-int snprintf __P((char *, size_t, const char *, ...));
+gint snprintf __P((gchar *, size_t, const gchar *, ...));
 #endif
 #ifndef HAVE_STRCASECMP
-int strcasecmp __P((const char *, const char *));
+gint strcasecmp __P((const gchar *, const gchar *));
 #endif
 #ifndef HAVE_STRCASECMP
-int strncasecmp __P((const char *, const char *, size_t));
+gint strncasecmp __P((const gchar *, const gchar *, size_t));
 #endif
 #ifndef HAVE_STRDUP
-char *strdup __P((const char *));
+gchar *strdup __P((const gchar *));
 #endif
 #ifndef HAVE_STRERROR
-char *strerror __P((int));
+gchar *strerror __P((int));
 #endif
 #ifndef HAVE_VSNPRINTF
-int vsnprintf __P((char *, size_t, const char *, va_list));
+gint vsnprintf __P((gchar *, size_t, const gchar *, va_list));
 #endif
 
 #if defined(__cplusplus)
diff --git a/libdb/dbinc_auto/common_ext.h b/libdb/dbinc_auto/common_ext.h
index 7744982..a7e9604 100644
--- a/libdb/dbinc_auto/common_ext.h
+++ b/libdb/dbinc_auto/common_ext.h
@@ -6,36 +6,36 @@
 extern "C" {
 #endif
 
-int __db_isbigendian __P((void));
-int __db_byteorder __P((DB_ENV *, int));
-int __db_fchk __P((DB_ENV *, const char *, u_int32_t, u_int32_t));
-int __db_fcchk __P((DB_ENV *, const char *, u_int32_t, u_int32_t, u_int32_t));
-int __db_ferr __P((const DB_ENV *, const char *, int));
+gint __db_isbigendian __P((void));
+gint __db_byteorder __P((DB_ENV *, int));
+gint __db_fchk __P((DB_ENV *, const gchar *, u_int32_t, u_int32_t));
+gint __db_fcchk __P((DB_ENV *, const gchar *, u_int32_t, u_int32_t, u_int32_t));
+gint __db_ferr __P((const DB_ENV *, const gchar *, int));
 void __db_pgerr __P((DB *, db_pgno_t, int));
-int __db_pgfmt __P((DB_ENV *, db_pgno_t));
-int __db_eopnotsup __P((const DB_ENV *));
+gint __db_pgfmt __P((DB_ENV *, db_pgno_t));
+gint __db_eopnotsup __P((const DB_ENV *));
 #ifdef DIAGNOSTIC
-void __db_assert __P((const char *, const char *, int));
+void __db_assert __P((const gchar *, const gchar *, int));
 #endif
-int __db_panic_msg __P((DB_ENV *));
-int __db_panic __P((DB_ENV *, int));
-void __db_err __P((const DB_ENV *, const char *, ...));
-void __db_errcall __P((const DB_ENV *, int, int, const char *, va_list));
-void __db_errfile __P((const DB_ENV *, int, int, const char *, va_list));
-void __db_logmsg __P((const DB_ENV *, DB_TXN *, const char *, u_int32_t, const char *, ...));
-int __db_unknown_flag __P((DB_ENV *, char *, u_int32_t));
-int __db_unknown_type __P((DB_ENV *, char *, DBTYPE));
-int __db_check_txn __P((DB *, DB_TXN *, u_int32_t, int));
-int __db_not_txn_env __P((DB_ENV *));
-int __db_getlong __P((DB *, const char *, char *, long, long, long *));
-int __db_getulong __P((DB *, const char *, char *, u_long, u_long, u_long *));
+gint __db_panic_msg __P((DB_ENV *));
+gint __db_panic __P((DB_ENV *, int));
+void __db_err __P((const DB_ENV *, const gchar *, ...));
+void __db_errcall __P((const DB_ENV *, int, int, const gchar *, va_list));
+void __db_errfile __P((const DB_ENV *, int, int, const gchar *, va_list));
+void __db_logmsg __P((const DB_ENV *, DB_TXN *, const gchar *, u_int32_t, const gchar *, ...));
+gint __db_unknown_flag __P((DB_ENV *, gchar *, u_int32_t));
+gint __db_unknown_type __P((DB_ENV *, gchar *, DBTYPE));
+gint __db_check_txn __P((DB *, DB_TXN *, u_int32_t, int));
+gint __db_not_txn_env __P((DB_ENV *));
+gint __db_getlong __P((DB *, const gchar *, gchar *, long, long, long *));
+gint __db_getulong __P((DB *, const gchar *, gchar *, u_long, u_long, u_long *));
 void __db_idspace __P((u_int32_t *, int, u_int32_t *, u_int32_t *));
 u_int32_t __db_log2 __P((u_int32_t));
-int __db_util_arg __P((char *, char *, int *, char ***));
-int __db_util_cache __P((DB_ENV *, DB *, u_int32_t *, int *));
-int __db_util_logset __P((const char *, char *));
+gint __db_util_arg __P((gchar *, gchar *, gint *, gchar ***));
+gint __db_util_cache __P((DB_ENV *, DB *, u_int32_t *, gint *));
+gint __db_util_logset __P((const gchar *, gchar *));
 void __db_util_siginit __P((void));
-int __db_util_interrupted __P((void));
+gint __db_util_interrupted __P((void));
 void __db_util_sigresend __P((void));
 
 #if defined(__cplusplus)
diff --git a/libdb/dbinc_auto/crypto_ext.h b/libdb/dbinc_auto/crypto_ext.h
index e37a895..7f06f53 100644
--- a/libdb/dbinc_auto/crypto_ext.h
+++ b/libdb/dbinc_auto/crypto_ext.h
@@ -6,30 +6,30 @@
 extern "C" {
 #endif
 
-int __aes_setup __P((DB_ENV *, DB_CIPHER *));
-int __aes_adj_size __P((size_t));
-int __aes_close __P((DB_ENV *, void *));
-int __aes_decrypt __P((DB_ENV *, void *, void *, u_int8_t *, size_t));
-int __aes_encrypt __P((DB_ENV *, void *, void *, u_int8_t *, size_t));
-int __aes_init __P((DB_ENV *, DB_CIPHER *));
-int __crypto_region_init __P((DB_ENV *));
-int __crypto_dbenv_close __P((DB_ENV *));
-int __crypto_algsetup __P((DB_ENV *, DB_CIPHER *, u_int32_t, int));
-int __crypto_decrypt_meta __P((DB_ENV *, DB *, u_int8_t *, int));
-int __db_generate_iv __P((DB_ENV *, u_int32_t *));
-int __db_rijndaelKeySetupEnc __P((u32 *, const u8 *, int));
-int __db_rijndaelKeySetupDec __P((u32 *, const u8 *, int));
+gint __aes_setup __P((DB_ENV *, DB_CIPHER *));
+gint __aes_adj_size __P((size_t));
+gint __aes_close __P((DB_ENV *, gpointer ));
+gint __aes_decrypt __P((DB_ENV *, gpointer , gpointer , u_int8_t *, size_t));
+gint __aes_encrypt __P((DB_ENV *, gpointer , gpointer , u_int8_t *, size_t));
+gint __aes_init __P((DB_ENV *, DB_CIPHER *));
+gint __crypto_region_init __P((DB_ENV *));
+gint __crypto_dbenv_close __P((DB_ENV *));
+gint __crypto_algsetup __P((DB_ENV *, DB_CIPHER *, u_int32_t, int));
+gint __crypto_decrypt_meta __P((DB_ENV *, DB *, u_int8_t *, int));
+gint __db_generate_iv __P((DB_ENV *, u_int32_t *));
+gint __db_rijndaelKeySetupEnc __P((u32 *, const u8 *, int));
+gint __db_rijndaelKeySetupDec __P((u32 *, const u8 *, int));
 void __db_rijndaelEncrypt __P((u32 *, int, const u8 *, u8 *));
 void __db_rijndaelDecrypt __P((u32 *, int, const u8 *, u8 *));
 void __db_rijndaelEncryptRound __P((const u32 *, int, u8 *, int));
 void __db_rijndaelDecryptRound __P((const u32 *, int, u8 *, int));
-int __db_makeKey __P((keyInstance *, int, int, char *));
-int __db_cipherInit __P((cipherInstance *, int, char *));
-int __db_blockEncrypt __P((cipherInstance *, keyInstance *, BYTE *, size_t, BYTE *));
-int __db_padEncrypt __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *));
-int __db_blockDecrypt __P((cipherInstance *, keyInstance *, BYTE *, size_t, BYTE *));
-int __db_padDecrypt __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *));
-int __db_cipherUpdateRounds __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *, int));
+gint __db_makeKey __P((keyInstance *, int, int, gchar *));
+gint __db_cipherInit __P((cipherInstance *, int, gchar *));
+gint __db_blockEncrypt __P((cipherInstance *, keyInstance *, BYTE *, size_t, BYTE *));
+gint __db_padEncrypt __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *));
+gint __db_blockDecrypt __P((cipherInstance *, keyInstance *, BYTE *, size_t, BYTE *));
+gint __db_padDecrypt __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *));
+gint __db_cipherUpdateRounds __P((cipherInstance *, keyInstance *, BYTE *, int, BYTE *, int));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/db_ext.h b/libdb/dbinc_auto/db_ext.h
index 24a1397..a6e0a80 100644
--- a/libdb/dbinc_auto/db_ext.h
+++ b/libdb/dbinc_auto/db_ext.h
@@ -6,217 +6,217 @@
 extern "C" {
 #endif
 
-int __crdel_metasub_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
-int __crdel_metasub_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __crdel_metasub_read __P((DB_ENV *, void *, __crdel_metasub_args **));
-int __crdel_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __crdel_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __crdel_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __crdel_metasub_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_master_open __P((DB *, DB_TXN *, const char *, u_int32_t, int, DB **));
-int __db_master_update __P((DB *, DB *, DB_TXN *, const char *, DBTYPE, mu_action, const char *, u_int32_t));
-int __db_dbenv_setup __P((DB *, DB_TXN *, const char *, u_int32_t, u_int32_t));
-int __db_close __P((DB *, u_int32_t));
-int __db_close_i __P((DB *, DB_TXN *, u_int32_t));
-int __db_refresh __P((DB *, DB_TXN *, u_int32_t));
-int __db_log_page __P((DB *, DB_TXN *, DB_LSN *, db_pgno_t, PAGE *));
-int __db_backup_name __P((DB_ENV *, const char *, DB_TXN *, char **));
+gint __crdel_metasub_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
+gint __crdel_metasub_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __crdel_metasub_read __P((DB_ENV *, gpointer , __crdel_metasub_args **));
+gint __crdel_init_print __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __crdel_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __crdel_init_recover __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __crdel_metasub_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_master_open __P((DB *, DB_TXN *, const gchar *, u_int32_t, int, DB **));
+gint __db_master_update __P((DB *, DB *, DB_TXN *, const gchar *, DBTYPE, mu_action, const gchar *, u_int32_t));
+gint __db_dbenv_setup __P((DB *, DB_TXN *, const gchar *, u_int32_t, u_int32_t));
+gint __db_close __P((DB *, u_int32_t));
+gint __db_close_i __P((DB *, DB_TXN *, u_int32_t));
+gint __db_refresh __P((DB *, DB_TXN *, u_int32_t));
+gint __db_log_page __P((DB *, DB_TXN *, DB_LSN *, db_pgno_t, PAGE *));
+gint __db_backup_name __P((DB_ENV *, const gchar *, DB_TXN *, gchar **));
 DB *__dblist_get __P((DB_ENV *, u_int32_t));
 #if CONFIG_TEST
-int __db_testcopy __P((DB_ENV *, DB *, const char *));
+gint __db_testcopy __P((DB_ENV *, DB *, const gchar *));
 #endif
-int __db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
-int __db_icursor __P((DB *, DB_TXN *, DBTYPE, db_pgno_t, int, u_int32_t, DBC **));
-int __db_cprint __P((DB *));
-int __db_fd __P((DB *, int *));
-int __db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-int __db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-int __db_delete __P((DB *, DB_TXN *, DBT *, u_int32_t));
-int __db_sync __P((DB *, u_int32_t));
-int __db_associate __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
-int __db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
-int __db_addrem_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, u_int32_t, u_int32_t, const DBT *, const DBT *, DB_LSN *));
-int __db_addrem_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_addrem_read __P((DB_ENV *, void *, __db_addrem_args **));
-int __db_big_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *, DB_LSN *, DB_LSN *));
-int __db_big_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_big_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_big_read __P((DB_ENV *, void *, __db_big_args **));
-int __db_ovref_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, int32_t, DB_LSN *));
-int __db_ovref_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_ovref_read __P((DB_ENV *, void *, __db_ovref_args **));
-int __db_relink_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *));
-int __db_relink_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_relink_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_relink_read __P((DB_ENV *, void *, __db_relink_args **));
-int __db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, int32_t, const DBT *, const DBT *, u_int32_t));
-int __db_debug_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_debug_read __P((DB_ENV *, void *, __db_debug_args **));
-int __db_noop_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *));
-int __db_noop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_noop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_noop_read __P((DB_ENV *, void *, __db_noop_args **));
-int __db_pg_alloc_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t));
-int __db_pg_alloc_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_pg_alloc_read __P((DB_ENV *, void *, __db_pg_alloc_args **));
-int __db_pg_free_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, db_pgno_t));
-int __db_pg_free_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_pg_free_read __P((DB_ENV *, void *, __db_pg_free_args **));
-int __db_cksum_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t));
-int __db_cksum_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_cksum_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_cksum_read __P((DB_ENV *, void *, __db_cksum_args **));
-int __db_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __db_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __db_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __db_c_close __P((DBC *));
-int __db_c_destroy __P((DBC *));
-int __db_c_count __P((DBC *, db_recno_t *, u_int32_t));
-int __db_c_del __P((DBC *, u_int32_t));
-int __db_c_dup __P((DBC *, DBC **, u_int32_t));
-int __db_c_idup __P((DBC *, DBC **, u_int32_t));
-int __db_c_newopd __P((DBC *, db_pgno_t, DBC *, DBC **));
-int __db_c_get __P((DBC *, DBT *, DBT *, u_int32_t));
-int __db_c_put __P((DBC *, DBT *, DBT *, u_int32_t));
-int __db_duperr __P((DB *, u_int32_t));
-int __db_c_secondary_get __P((DBC *, DBT *, DBT *, u_int32_t));
-int __db_c_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
-int __db_c_del_primary __P((DBC *));
+gint __db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
+gint __db_icursor __P((DB *, DB_TXN *, DBTYPE, db_pgno_t, int, u_int32_t, DBC **));
+gint __db_cprint __P((DB *));
+gint __db_fd __P((DB *, gint *));
+gint __db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+gint __db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+gint __db_delete __P((DB *, DB_TXN *, DBT *, u_int32_t));
+gint __db_sync __P((DB *, u_int32_t));
+gint __db_associate __P((DB *, DB_TXN *, DB *, gint (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
+gint __db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
+gint __db_addrem_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, u_int32_t, u_int32_t, const DBT *, const DBT *, DB_LSN *));
+gint __db_addrem_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_addrem_read __P((DB_ENV *, gpointer , __db_addrem_args **));
+gint __db_big_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *, DB_LSN *, DB_LSN *));
+gint __db_big_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_big_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_big_read __P((DB_ENV *, gpointer , __db_big_args **));
+gint __db_ovref_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, int32_t, DB_LSN *));
+gint __db_ovref_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_ovref_read __P((DB_ENV *, gpointer , __db_ovref_args **));
+gint __db_relink_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *));
+gint __db_relink_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_relink_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_relink_read __P((DB_ENV *, gpointer , __db_relink_args **));
+gint __db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, int32_t, const DBT *, const DBT *, u_int32_t));
+gint __db_debug_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_debug_read __P((DB_ENV *, gpointer , __db_debug_args **));
+gint __db_noop_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *));
+gint __db_noop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_noop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_noop_read __P((DB_ENV *, gpointer , __db_noop_args **));
+gint __db_pg_alloc_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t));
+gint __db_pg_alloc_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_pg_alloc_read __P((DB_ENV *, gpointer , __db_pg_alloc_args **));
+gint __db_pg_free_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, db_pgno_t));
+gint __db_pg_free_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_pg_free_read __P((DB_ENV *, gpointer , __db_pg_free_args **));
+gint __db_cksum_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t));
+gint __db_cksum_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_cksum_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_cksum_read __P((DB_ENV *, gpointer , __db_cksum_args **));
+gint __db_init_print __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __db_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __db_init_recover __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __db_c_close __P((DBC *));
+gint __db_c_destroy __P((DBC *));
+gint __db_c_count __P((DBC *, db_recno_t *, u_int32_t));
+gint __db_c_del __P((DBC *, u_int32_t));
+gint __db_c_dup __P((DBC *, DBC **, u_int32_t));
+gint __db_c_idup __P((DBC *, DBC **, u_int32_t));
+gint __db_c_newopd __P((DBC *, db_pgno_t, DBC *, DBC **));
+gint __db_c_get __P((DBC *, DBT *, DBT *, u_int32_t));
+gint __db_c_put __P((DBC *, DBT *, DBT *, u_int32_t));
+gint __db_duperr __P((DB *, u_int32_t));
+gint __db_c_secondary_get __P((DBC *, DBT *, DBT *, u_int32_t));
+gint __db_c_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
+gint __db_c_del_primary __P((DBC *));
 DB *__db_s_first __P((DB *));
-int __db_s_next __P((DB **));
-int __db_s_done __P((DB *));
+gint __db_s_next __P((DB **));
+gint __db_s_done __P((DB *));
 u_int32_t __db_partsize __P((u_int32_t, DBT *));
-int __db_pgin __P((DB_ENV *, db_pgno_t, void *, DBT *));
-int __db_pgout __P((DB_ENV *, db_pgno_t, void *, DBT *));
+gint __db_pgin __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
+gint __db_pgout __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
 void __db_metaswap __P((PAGE *));
-int __db_byteswap __P((DB_ENV *, DB *, db_pgno_t, PAGE *, size_t, int));
-int __db_dispatch __P((DB_ENV *, int (**)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)), size_t, DBT *, DB_LSN *, db_recops, void *));
-int __db_add_recovery __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), u_int32_t));
-int __db_txnlist_init __P((DB_ENV *, u_int32_t, u_int32_t, DB_LSN *, void *));
-int __db_txnlist_add __P((DB_ENV *, void *, u_int32_t, int32_t, DB_LSN *));
-int __db_txnlist_remove __P((DB_ENV *, void *, u_int32_t));
-void __db_txnlist_ckp __P((DB_ENV *, void *, DB_LSN *));
-void __db_txnlist_end __P((DB_ENV *, void *));
-int __db_txnlist_find __P((DB_ENV *, void *, u_int32_t));
-int __db_txnlist_update __P((DB_ENV *, void *, u_int32_t, u_int32_t, DB_LSN *));
-int __db_txnlist_gen __P((DB_ENV *, void *, int, u_int32_t, u_int32_t));
-int __db_txnlist_lsnadd __P((DB_ENV *, void *, DB_LSN *, u_int32_t));
-int __db_txnlist_lsninit __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
-int __db_add_limbo __P((DB_ENV *, void *, int32_t, db_pgno_t, int32_t));
-int __db_do_the_limbo __P((DB_ENV *, DB_TXN *, DB_TXN *, DB_TXNHEAD *));
-void __db_txnlist_print __P((void *));
-int __db_ditem __P((DBC *, PAGE *, u_int32_t, u_int32_t));
-int __db_pitem __P((DBC *, PAGE *, u_int32_t, u_int32_t, DBT *, DBT *));
-int __db_relink __P((DBC *, u_int32_t, PAGE *, PAGE **, int));
-int __db_cursorchk __P((const DB *, u_int32_t));
-int __db_ccountchk __P((const DB *, u_int32_t, int));
-int __db_cdelchk __P((const DB *, u_int32_t, int));
-int __db_cgetchk __P((const DB *, DBT *, DBT *, u_int32_t, int));
-int __db_cputchk __P((const DB *, const DBT *, DBT *, u_int32_t, int));
-int __db_pgetchk __P((const DB *, const DBT *, DBT *, DBT *, u_int32_t));
-int __db_cpgetchk __P((const DB *, DBT *, DBT *, DBT *, u_int32_t, int));
-int __db_delchk __P((const DB *, DBT *, u_int32_t));
-int __db_getchk __P((const DB *, const DBT *, DBT *, u_int32_t));
-int __db_joinchk __P((const DB *, DBC * const *, u_int32_t));
-int __db_joingetchk __P((const DB *, DBT *, u_int32_t));
-int __db_putchk __P((const DB *, DBT *, const DBT *, u_int32_t, int));
-int __db_statchk __P((const DB *, u_int32_t));
-int __db_syncchk __P((const DB *, u_int32_t));
-int __db_secondary_corrupt __P((DB *));
-int __db_associatechk __P((DB *, DB *, int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
-int __db_txn_auto __P((DB *, DB_TXN **));
-int __db_join __P((DB *, DBC **, DBC **, u_int32_t));
-int __db_new __P((DBC *, u_int32_t, PAGE **));
-int __db_free __P((DBC *, PAGE *));
-int __db_lprint __P((DBC *));
-int __db_lget __P((DBC *, int, db_pgno_t, db_lockmode_t, u_int32_t, DB_LOCK *));
-int __db_lput __P((DBC *, DB_LOCK *));
-int __dbh_am_chk __P((DB *, u_int32_t));
-int  __db_set_lorder __P((DB *, int));
-int __db_open __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
-int __db_dbopen __P((DB *, DB_TXN *, const char *, const char *, u_int32_t, int, db_pgno_t));
-int __db_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
-int __db_init_subdb __P((DB *, DB *, const char *, DB_TXN *));
-int __db_chk_meta __P((DB_ENV *, DB *, DBMETA *, int));
-int __db_meta_setup __P((DB_ENV *, DB *, const char *, DBMETA *, u_int32_t, int));
-int __db_goff __P((DB *, DBT *, u_int32_t, db_pgno_t, void **, u_int32_t *));
-int __db_poff __P((DBC *, const DBT *, db_pgno_t *));
-int __db_ovref __P((DBC *, db_pgno_t, int32_t));
-int __db_doff __P((DBC *, db_pgno_t));
-int __db_moff __P((DB *, const DBT *, db_pgno_t, u_int32_t, int (*)(DB *, const DBT *, const DBT *), int *));
-int __db_vrfy_overflow __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
-int __db_vrfy_ovfl_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, u_int32_t));
-int __db_safe_goff __P((DB *, VRFY_DBINFO *, db_pgno_t, DBT *, void **, u_int32_t));
+gint __db_byteswap __P((DB_ENV *, DB *, db_pgno_t, PAGE *, size_t, int));
+gint __db_dispatch __P((DB_ENV *, gint (**)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer )), size_t, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_add_recovery __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *, gint (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), u_int32_t));
+gint __db_txnlist_init __P((DB_ENV *, u_int32_t, u_int32_t, DB_LSN *, gpointer ));
+gint __db_txnlist_add __P((DB_ENV *, gpointer , u_int32_t, int32_t, DB_LSN *));
+gint __db_txnlist_remove __P((DB_ENV *, gpointer , u_int32_t));
+void __db_txnlist_ckp __P((DB_ENV *, gpointer , DB_LSN *));
+void __db_txnlist_end __P((DB_ENV *, gpointer ));
+gint __db_txnlist_find __P((DB_ENV *, gpointer , u_int32_t));
+gint __db_txnlist_update __P((DB_ENV *, gpointer , u_int32_t, u_int32_t, DB_LSN *));
+gint __db_txnlist_gen __P((DB_ENV *, gpointer , int, u_int32_t, u_int32_t));
+gint __db_txnlist_lsnadd __P((DB_ENV *, gpointer , DB_LSN *, u_int32_t));
+gint __db_txnlist_lsninit __P((DB_ENV *, DB_TXNHEAD *, DB_LSN *));
+gint __db_add_limbo __P((DB_ENV *, gpointer , int32_t, db_pgno_t, int32_t));
+gint __db_do_the_limbo __P((DB_ENV *, DB_TXN *, DB_TXN *, DB_TXNHEAD *));
+void __db_txnlist_print __P((gpointer));
+gint __db_ditem __P((DBC *, PAGE *, u_int32_t, u_int32_t));
+gint __db_pitem __P((DBC *, PAGE *, u_int32_t, u_int32_t, DBT *, DBT *));
+gint __db_relink __P((DBC *, u_int32_t, PAGE *, PAGE **, int));
+gint __db_cursorchk __P((const DB *, u_int32_t));
+gint __db_ccountchk __P((const DB *, u_int32_t, int));
+gint __db_cdelchk __P((const DB *, u_int32_t, int));
+gint __db_cgetchk __P((const DB *, DBT *, DBT *, u_int32_t, int));
+gint __db_cputchk __P((const DB *, const DBT *, DBT *, u_int32_t, int));
+gint __db_pgetchk __P((const DB *, const DBT *, DBT *, DBT *, u_int32_t));
+gint __db_cpgetchk __P((const DB *, DBT *, DBT *, DBT *, u_int32_t, int));
+gint __db_delchk __P((const DB *, DBT *, u_int32_t));
+gint __db_getchk __P((const DB *, const DBT *, DBT *, u_int32_t));
+gint __db_joinchk __P((const DB *, DBC * const *, u_int32_t));
+gint __db_joingetchk __P((const DB *, DBT *, u_int32_t));
+gint __db_putchk __P((const DB *, DBT *, const DBT *, u_int32_t, int));
+gint __db_statchk __P((const DB *, u_int32_t));
+gint __db_syncchk __P((const DB *, u_int32_t));
+gint __db_secondary_corrupt __P((DB *));
+gint __db_associatechk __P((DB *, DB *, gint (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
+gint __db_txn_auto __P((DB *, DB_TXN **));
+gint __db_join __P((DB *, DBC **, DBC **, u_int32_t));
+gint __db_new __P((DBC *, u_int32_t, PAGE **));
+gint __db_free __P((DBC *, PAGE *));
+gint __db_lprint __P((DBC *));
+gint __db_lget __P((DBC *, int, db_pgno_t, db_lockmode_t, u_int32_t, DB_LOCK *));
+gint __db_lput __P((DBC *, DB_LOCK *));
+gint __dbh_am_chk __P((DB *, u_int32_t));
+gint  __db_set_lorder __P((DB *, int));
+gint __db_open __P((DB *, DB_TXN *, const gchar *, const gchar *, DBTYPE, u_int32_t, int));
+gint __db_dbopen __P((DB *, DB_TXN *, const gchar *, const gchar *, u_int32_t, int, db_pgno_t));
+gint __db_new_file __P((DB *, DB_TXN *, DB_FH *, const gchar *));
+gint __db_init_subdb __P((DB *, DB *, const gchar *, DB_TXN *));
+gint __db_chk_meta __P((DB_ENV *, DB *, DBMETA *, int));
+gint __db_meta_setup __P((DB_ENV *, DB *, const gchar *, DBMETA *, u_int32_t, int));
+gint __db_goff __P((DB *, DBT *, u_int32_t, db_pgno_t, gpointer *, u_int32_t *));
+gint __db_poff __P((DBC *, const DBT *, db_pgno_t *));
+gint __db_ovref __P((DBC *, db_pgno_t, int32_t));
+gint __db_doff __P((DBC *, db_pgno_t));
+gint __db_moff __P((DB *, const DBT *, db_pgno_t, u_int32_t, gint (*)(DB *, const DBT *, const DBT *), gint *));
+gint __db_vrfy_overflow __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
+gint __db_vrfy_ovfl_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, u_int32_t));
+gint __db_safe_goff __P((DB *, VRFY_DBINFO *, db_pgno_t, DBT *, gpointer *, u_int32_t));
 void __db_loadme __P((void));
-int __db_dump __P((DB *, char *, char *));
-void __db_inmemdbflags __P((u_int32_t, void *, void (*)(u_int32_t, const FN *, void *)));
-int __db_prnpage __P((DB *, db_pgno_t, FILE *));
-int __db_prpage __P((DB *, PAGE *, FILE *, u_int32_t));
+gint __db_dump __P((DB *, gchar *, gchar *));
+void __db_inmemdbflags __P((u_int32_t, gpointer , void (*)(u_int32_t, const FN *, gpointer )));
+gint __db_prnpage __P((DB *, db_pgno_t, FILE *));
+gint __db_prpage __P((DB *, PAGE *, FILE *, u_int32_t));
 void __db_pr __P((u_int8_t *, u_int32_t, FILE *));
-int __db_prdbt __P((DBT *, int, const char *, void *, int (*)(void *, const void *), int, VRFY_DBINFO *));
-void __db_prflags __P((u_int32_t, const FN *, void *));
-const char * __db_dbtype_to_string __P((DBTYPE));
-int	__db_prheader __P((DB *, char *, int, int, void *, int (*)(void *, const void *), VRFY_DBINFO *, db_pgno_t));
-int __db_prfooter __P((void *, int (*)(void *, const void *)));
-int __db_addrem_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_big_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_ovref_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_relink_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_debug_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_noop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_pg_alloc_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_pg_free_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_cksum_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __db_traverse_big __P((DB *, db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *));
-int __db_reclaim_callback __P((DB *, PAGE *, void *, int *));
-int __db_truncate_callback __P((DB *, PAGE *, void *, int *));
-int __dbenv_dbremove __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t));
-int __db_remove __P((DB *, const char *, const char *, u_int32_t));
-int __db_remove_i __P((DB *, DB_TXN *, const char *, const char *));
-int __dbenv_dbrename __P((DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t));
-int __db_rename __P((DB *, const char *, const char *, const char *, u_int32_t));
-int __db_rename_i __P((DB *, DB_TXN *, const char *, const char *, const char *));
-int __db_ret __P((DB *, PAGE *, u_int32_t, DBT *, void **, u_int32_t *));
-int __db_retcopy __P((DB_ENV *, DBT *, void *, u_int32_t, void **, u_int32_t *));
-int __db_truncate __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
-int __db_upgrade __P((DB *, const char *, u_int32_t));
-int __db_lastpgno __P((DB *, char *, DB_FH *, db_pgno_t *));
-int __db_31_offdup __P((DB *, char *, DB_FH *, int, db_pgno_t *));
-int __db_verify __P((DB *, const char *, const char *, FILE *, u_int32_t));
-int  __db_verify_callback __P((void *, const void *));
-int __db_verify_internal __P((DB *, const char *, const char *, void *, int (*)(void *, const void *), u_int32_t));
-int __db_vrfy_datapage __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
-int __db_vrfy_meta __P((DB *, VRFY_DBINFO *, DBMETA *, db_pgno_t, u_int32_t));
+gint __db_prdbt __P((DBT *, int, const gchar *, gpointer , gint (*)(gpointer , gconstpointer ), int, VRFY_DBINFO *));
+void __db_prflags __P((u_int32_t, const FN *, gpointer ));
+const gchar * __db_dbtype_to_string __P((DBTYPE));
+int	__db_prheader __P((DB *, gchar *, int, int, gpointer , gint (*)(gpointer , gconstpointer ), VRFY_DBINFO *, db_pgno_t));
+gint __db_prfooter __P((gpointer , gint (*)(gpointer , gconstpointer )));
+gint __db_addrem_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_big_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_ovref_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_relink_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_debug_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_noop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_pg_alloc_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_pg_free_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_cksum_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __db_traverse_big __P((DB *, db_pgno_t, gint (*)(DB *, PAGE *, gpointer , gint *), gpointer ));
+gint __db_reclaim_callback __P((DB *, PAGE *, gpointer , gint *));
+gint __db_truncate_callback __P((DB *, PAGE *, gpointer , gint *));
+gint __dbenv_dbremove __P((DB_ENV *, DB_TXN *, const gchar *, const gchar *, u_int32_t));
+gint __db_remove __P((DB *, const gchar *, const gchar *, u_int32_t));
+gint __db_remove_i __P((DB *, DB_TXN *, const gchar *, const gchar *));
+gint __dbenv_dbrename __P((DB_ENV *, DB_TXN *, const gchar *, const gchar *, const gchar *, u_int32_t));
+gint __db_rename __P((DB *, const gchar *, const gchar *, const gchar *, u_int32_t));
+gint __db_rename_i __P((DB *, DB_TXN *, const gchar *, const gchar *, const gchar *));
+gint __db_ret __P((DB *, PAGE *, u_int32_t, DBT *, gpointer *, u_int32_t *));
+gint __db_retcopy __P((DB_ENV *, DBT *, gpointer , u_int32_t, gpointer *, u_int32_t *));
+gint __db_truncate __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
+gint __db_upgrade __P((DB *, const gchar *, u_int32_t));
+gint __db_lastpgno __P((DB *, gchar *, DB_FH *, db_pgno_t *));
+gint __db_31_offdup __P((DB *, gchar *, DB_FH *, int, db_pgno_t *));
+gint __db_verify __P((DB *, const gchar *, const gchar *, FILE *, u_int32_t));
+gint  __db_verify_callback __P((gpointer , gconstpointer ));
+gint __db_verify_internal __P((DB *, const gchar *, const gchar *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
+gint __db_vrfy_datapage __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
+gint __db_vrfy_meta __P((DB *, VRFY_DBINFO *, DBMETA *, db_pgno_t, u_int32_t));
 void __db_vrfy_struct_feedback __P((DB *, VRFY_DBINFO *));
-int __db_vrfy_inpitem __P((DB *, PAGE *, db_pgno_t, u_int32_t, int, u_int32_t, u_int32_t *, u_int32_t *));
-int __db_vrfy_duptype __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
-int __db_salvage_duptree __P((DB *, VRFY_DBINFO *, db_pgno_t, DBT *, void *, int (*)(void *, const void *), u_int32_t));
-int __db_vrfy_dbinfo_create __P((DB_ENV *, u_int32_t, VRFY_DBINFO **));
-int __db_vrfy_dbinfo_destroy __P((DB_ENV *, VRFY_DBINFO *));
-int __db_vrfy_getpageinfo __P((VRFY_DBINFO *, db_pgno_t, VRFY_PAGEINFO **));
-int __db_vrfy_putpageinfo __P((DB_ENV *, VRFY_DBINFO *, VRFY_PAGEINFO *));
-int __db_vrfy_pgset __P((DB_ENV *, u_int32_t, DB **));
-int __db_vrfy_pgset_get __P((DB *, db_pgno_t, int *));
-int __db_vrfy_pgset_inc __P((DB *, db_pgno_t));
-int __db_vrfy_pgset_dec __P((DB *, db_pgno_t));
-int __db_vrfy_pgset_next __P((DBC *, db_pgno_t *));
-int __db_vrfy_childcursor __P((VRFY_DBINFO *, DBC **));
-int __db_vrfy_childput __P((VRFY_DBINFO *, db_pgno_t, VRFY_CHILDINFO *));
-int __db_vrfy_ccset __P((DBC *, db_pgno_t, VRFY_CHILDINFO **));
-int __db_vrfy_ccnext __P((DBC *, VRFY_CHILDINFO **));
-int __db_vrfy_ccclose __P((DBC *));
-int  __db_salvage_init __P((VRFY_DBINFO *));
+gint __db_vrfy_inpitem __P((DB *, PAGE *, db_pgno_t, u_int32_t, int, u_int32_t, u_int32_t *, u_int32_t *));
+gint __db_vrfy_duptype __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
+gint __db_salvage_duptree __P((DB *, VRFY_DBINFO *, db_pgno_t, DBT *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
+gint __db_vrfy_dbinfo_create __P((DB_ENV *, u_int32_t, VRFY_DBINFO **));
+gint __db_vrfy_dbinfo_destroy __P((DB_ENV *, VRFY_DBINFO *));
+gint __db_vrfy_getpageinfo __P((VRFY_DBINFO *, db_pgno_t, VRFY_PAGEINFO **));
+gint __db_vrfy_putpageinfo __P((DB_ENV *, VRFY_DBINFO *, VRFY_PAGEINFO *));
+gint __db_vrfy_pgset __P((DB_ENV *, u_int32_t, DB **));
+gint __db_vrfy_pgset_get __P((DB *, db_pgno_t, gint *));
+gint __db_vrfy_pgset_inc __P((DB *, db_pgno_t));
+gint __db_vrfy_pgset_dec __P((DB *, db_pgno_t));
+gint __db_vrfy_pgset_next __P((DBC *, db_pgno_t *));
+gint __db_vrfy_childcursor __P((VRFY_DBINFO *, DBC **));
+gint __db_vrfy_childput __P((VRFY_DBINFO *, db_pgno_t, VRFY_CHILDINFO *));
+gint __db_vrfy_ccset __P((DBC *, db_pgno_t, VRFY_CHILDINFO **));
+gint __db_vrfy_ccnext __P((DBC *, VRFY_CHILDINFO **));
+gint __db_vrfy_ccclose __P((DBC *));
+gint  __db_salvage_init __P((VRFY_DBINFO *));
 void  __db_salvage_destroy __P((VRFY_DBINFO *));
-int __db_salvage_getnext __P((VRFY_DBINFO *, db_pgno_t *, u_int32_t *));
-int __db_salvage_isdone __P((VRFY_DBINFO *, db_pgno_t));
-int __db_salvage_markdone __P((VRFY_DBINFO *, db_pgno_t));
-int __db_salvage_markneeded __P((VRFY_DBINFO *, db_pgno_t, u_int32_t));
+gint __db_salvage_getnext __P((VRFY_DBINFO *, db_pgno_t *, u_int32_t *));
+gint __db_salvage_isdone __P((VRFY_DBINFO *, db_pgno_t));
+gint __db_salvage_markdone __P((VRFY_DBINFO *, db_pgno_t));
+gint __db_salvage_markneeded __P((VRFY_DBINFO *, db_pgno_t, u_int32_t));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/db_server.h b/libdb/dbinc_auto/db_server.h
index 3409eed..45f6e6d 100644
--- a/libdb/dbinc_auto/db_server.h
+++ b/libdb/dbinc_auto/db_server.h
@@ -16,7 +16,7 @@ struct __env_cachesize_msg {
 typedef struct __env_cachesize_msg __env_cachesize_msg;
 
 struct __env_cachesize_reply {
-	int status;
+	gint status;
 };
 typedef struct __env_cachesize_reply __env_cachesize_reply;
 
@@ -27,7 +27,7 @@ struct __env_close_msg {
 typedef struct __env_close_msg __env_close_msg;
 
 struct __env_close_reply {
-	int status;
+	gint status;
 };
 typedef struct __env_close_reply __env_close_reply;
 
@@ -37,7 +37,7 @@ struct __env_create_msg {
 typedef struct __env_create_msg __env_create_msg;
 
 struct __env_create_reply {
-	int status;
+	gint status;
 	u_int envcl_id;
 };
 typedef struct __env_create_reply __env_create_reply;
@@ -45,41 +45,41 @@ typedef struct __env_create_reply __env_create_reply;
 struct __env_dbremove_msg {
 	u_int dbenvcl_id;
 	u_int txnpcl_id;
-	char *name;
-	char *subdb;
+	gchar *name;
+	gchar *subdb;
 	u_int flags;
 };
 typedef struct __env_dbremove_msg __env_dbremove_msg;
 
 struct __env_dbremove_reply {
-	int status;
+	gint status;
 };
 typedef struct __env_dbremove_reply __env_dbremove_reply;
 
 struct __env_dbrename_msg {
 	u_int dbenvcl_id;
 	u_int txnpcl_id;
-	char *name;
-	char *subdb;
-	char *newname;
+	gchar *name;
+	gchar *subdb;
+	gchar *newname;
 	u_int flags;
 };
 typedef struct __env_dbrename_msg __env_dbrename_msg;
 
 struct __env_dbrename_reply {
-	int status;
+	gint status;
 };
 typedef struct __env_dbrename_reply __env_dbrename_reply;
 
 struct __env_encrypt_msg {
 	u_int dbenvcl_id;
-	char *passwd;
+	gchar *passwd;
 	u_int flags;
 };
 typedef struct __env_encrypt_msg __env_encrypt_msg;
 
 struct __env_encrypt_reply {
-	int status;
+	gint status;
 };
 typedef struct __env_encrypt_reply __env_encrypt_reply;
 
@@ -91,33 +91,33 @@ struct __env_flags_msg {
 typedef struct __env_flags_msg __env_flags_msg;
 
 struct __env_flags_reply {
-	int status;
+	gint status;
 };
 typedef struct __env_flags_reply __env_flags_reply;
 
 struct __env_open_msg {
 	u_int dbenvcl_id;
-	char *home;
+	gchar *home;
 	u_int flags;
 	u_int mode;
 };
 typedef struct __env_open_msg __env_open_msg;
 
 struct __env_open_reply {
-	int status;
+	gint status;
 	u_int envcl_id;
 };
 typedef struct __env_open_reply __env_open_reply;
 
 struct __env_remove_msg {
 	u_int dbenvcl_id;
-	char *home;
+	gchar *home;
 	u_int flags;
 };
 typedef struct __env_remove_msg __env_remove_msg;
 
 struct __env_remove_reply {
-	int status;
+	gint status;
 };
 typedef struct __env_remove_reply __env_remove_reply;
 
@@ -127,7 +127,7 @@ struct __txn_abort_msg {
 typedef struct __txn_abort_msg __txn_abort_msg;
 
 struct __txn_abort_reply {
-	int status;
+	gint status;
 };
 typedef struct __txn_abort_reply __txn_abort_reply;
 
@@ -139,7 +139,7 @@ struct __txn_begin_msg {
 typedef struct __txn_begin_msg __txn_begin_msg;
 
 struct __txn_begin_reply {
-	int status;
+	gint status;
 	u_int txnidcl_id;
 };
 typedef struct __txn_begin_reply __txn_begin_reply;
@@ -151,7 +151,7 @@ struct __txn_commit_msg {
 typedef struct __txn_commit_msg __txn_commit_msg;
 
 struct __txn_commit_reply {
-	int status;
+	gint status;
 };
 typedef struct __txn_commit_reply __txn_commit_reply;
 
@@ -162,18 +162,18 @@ struct __txn_discard_msg {
 typedef struct __txn_discard_msg __txn_discard_msg;
 
 struct __txn_discard_reply {
-	int status;
+	gint status;
 };
 typedef struct __txn_discard_reply __txn_discard_reply;
 
 struct __txn_prepare_msg {
 	u_int txnpcl_id;
-	char gid[128];
+	gchar gid[128];
 };
 typedef struct __txn_prepare_msg __txn_prepare_msg;
 
 struct __txn_prepare_reply {
-	int status;
+	gint status;
 };
 typedef struct __txn_prepare_reply __txn_prepare_reply;
 
@@ -185,14 +185,14 @@ struct __txn_recover_msg {
 typedef struct __txn_recover_msg __txn_recover_msg;
 
 struct __txn_recover_reply {
-	int status;
+	gint status;
 	struct {
 		u_int txn_len;
 		u_int *txn_val;
 	} txn;
 	struct {
 		u_int gid_len;
-		char *gid_val;
+		gchar *gid_val;
 	} gid;
 	u_int retcount;
 };
@@ -207,7 +207,7 @@ struct __db_associate_msg {
 typedef struct __db_associate_msg __db_associate_msg;
 
 struct __db_associate_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_associate_reply __db_associate_reply;
 
@@ -218,7 +218,7 @@ struct __db_bt_maxkey_msg {
 typedef struct __db_bt_maxkey_msg __db_bt_maxkey_msg;
 
 struct __db_bt_maxkey_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_bt_maxkey_reply __db_bt_maxkey_reply;
 
@@ -229,7 +229,7 @@ struct __db_bt_minkey_msg {
 typedef struct __db_bt_minkey_msg __db_bt_minkey_msg;
 
 struct __db_bt_minkey_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_bt_minkey_reply __db_bt_minkey_reply;
 
@@ -240,7 +240,7 @@ struct __db_close_msg {
 typedef struct __db_close_msg __db_close_msg;
 
 struct __db_close_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_close_reply __db_close_reply;
 
@@ -251,7 +251,7 @@ struct __db_create_msg {
 typedef struct __db_create_msg __db_create_msg;
 
 struct __db_create_reply {
-	int status;
+	gint status;
 	u_int dbcl_id;
 };
 typedef struct __db_create_reply __db_create_reply;
@@ -265,26 +265,26 @@ struct __db_del_msg {
 	u_int keyflags;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 	u_int flags;
 };
 typedef struct __db_del_msg __db_del_msg;
 
 struct __db_del_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_del_reply __db_del_reply;
 
 struct __db_encrypt_msg {
 	u_int dbpcl_id;
-	char *passwd;
+	gchar *passwd;
 	u_int flags;
 };
 typedef struct __db_encrypt_msg __db_encrypt_msg;
 
 struct __db_encrypt_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_encrypt_reply __db_encrypt_reply;
 
@@ -295,7 +295,7 @@ struct __db_extentsize_msg {
 typedef struct __db_extentsize_msg __db_extentsize_msg;
 
 struct __db_extentsize_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_extentsize_reply __db_extentsize_reply;
 
@@ -306,7 +306,7 @@ struct __db_flags_msg {
 typedef struct __db_flags_msg __db_flags_msg;
 
 struct __db_flags_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_flags_reply __db_flags_reply;
 
@@ -319,7 +319,7 @@ struct __db_get_msg {
 	u_int keyflags;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 	u_int datadlen;
 	u_int datadoff;
@@ -327,21 +327,21 @@ struct __db_get_msg {
 	u_int dataflags;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 	u_int flags;
 };
 typedef struct __db_get_msg __db_get_msg;
 
 struct __db_get_reply {
-	int status;
+	gint status;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 };
 typedef struct __db_get_reply __db_get_reply;
@@ -353,7 +353,7 @@ struct __db_h_ffactor_msg {
 typedef struct __db_h_ffactor_msg __db_h_ffactor_msg;
 
 struct __db_h_ffactor_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_h_ffactor_reply __db_h_ffactor_reply;
 
@@ -364,7 +364,7 @@ struct __db_h_nelem_msg {
 typedef struct __db_h_nelem_msg __db_h_nelem_msg;
 
 struct __db_h_nelem_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_h_nelem_reply __db_h_nelem_reply;
 
@@ -377,14 +377,14 @@ struct __db_key_range_msg {
 	u_int keyflags;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 	u_int flags;
 };
 typedef struct __db_key_range_msg __db_key_range_msg;
 
 struct __db_key_range_reply {
-	int status;
+	gint status;
 	double less;
 	double equal;
 	double greater;
@@ -398,15 +398,15 @@ struct __db_lorder_msg {
 typedef struct __db_lorder_msg __db_lorder_msg;
 
 struct __db_lorder_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_lorder_reply __db_lorder_reply;
 
 struct __db_open_msg {
 	u_int dbpcl_id;
 	u_int txnpcl_id;
-	char *name;
-	char *subdb;
+	gchar *name;
+	gchar *subdb;
 	u_int type;
 	u_int flags;
 	u_int mode;
@@ -414,7 +414,7 @@ struct __db_open_msg {
 typedef struct __db_open_msg __db_open_msg;
 
 struct __db_open_reply {
-	int status;
+	gint status;
 	u_int dbcl_id;
 	u_int type;
 	u_int dbflags;
@@ -429,7 +429,7 @@ struct __db_pagesize_msg {
 typedef struct __db_pagesize_msg __db_pagesize_msg;
 
 struct __db_pagesize_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_pagesize_reply __db_pagesize_reply;
 
@@ -442,7 +442,7 @@ struct __db_pget_msg {
 	u_int skeyflags;
 	struct {
 		u_int skeydata_len;
-		char *skeydata_val;
+		gchar *skeydata_val;
 	} skeydata;
 	u_int pkeydlen;
 	u_int pkeydoff;
@@ -450,7 +450,7 @@ struct __db_pget_msg {
 	u_int pkeyflags;
 	struct {
 		u_int pkeydata_len;
-		char *pkeydata_val;
+		gchar *pkeydata_val;
 	} pkeydata;
 	u_int datadlen;
 	u_int datadoff;
@@ -458,25 +458,25 @@ struct __db_pget_msg {
 	u_int dataflags;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 	u_int flags;
 };
 typedef struct __db_pget_msg __db_pget_msg;
 
 struct __db_pget_reply {
-	int status;
+	gint status;
 	struct {
 		u_int skeydata_len;
-		char *skeydata_val;
+		gchar *skeydata_val;
 	} skeydata;
 	struct {
 		u_int pkeydata_len;
-		char *pkeydata_val;
+		gchar *pkeydata_val;
 	} pkeydata;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 };
 typedef struct __db_pget_reply __db_pget_reply;
@@ -490,7 +490,7 @@ struct __db_put_msg {
 	u_int keyflags;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 	u_int datadlen;
 	u_int datadoff;
@@ -498,17 +498,17 @@ struct __db_put_msg {
 	u_int dataflags;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 	u_int flags;
 };
 typedef struct __db_put_msg __db_put_msg;
 
 struct __db_put_reply {
-	int status;
+	gint status;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 };
 typedef struct __db_put_reply __db_put_reply;
@@ -520,7 +520,7 @@ struct __db_re_delim_msg {
 typedef struct __db_re_delim_msg __db_re_delim_msg;
 
 struct __db_re_delim_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_re_delim_reply __db_re_delim_reply;
 
@@ -531,7 +531,7 @@ struct __db_re_len_msg {
 typedef struct __db_re_len_msg __db_re_len_msg;
 
 struct __db_re_len_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_re_len_reply __db_re_len_reply;
 
@@ -542,34 +542,34 @@ struct __db_re_pad_msg {
 typedef struct __db_re_pad_msg __db_re_pad_msg;
 
 struct __db_re_pad_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_re_pad_reply __db_re_pad_reply;
 
 struct __db_remove_msg {
 	u_int dbpcl_id;
-	char *name;
-	char *subdb;
+	gchar *name;
+	gchar *subdb;
 	u_int flags;
 };
 typedef struct __db_remove_msg __db_remove_msg;
 
 struct __db_remove_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_remove_reply __db_remove_reply;
 
 struct __db_rename_msg {
 	u_int dbpcl_id;
-	char *name;
-	char *subdb;
-	char *newname;
+	gchar *name;
+	gchar *subdb;
+	gchar *newname;
 	u_int flags;
 };
 typedef struct __db_rename_msg __db_rename_msg;
 
 struct __db_rename_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_rename_reply __db_rename_reply;
 
@@ -580,7 +580,7 @@ struct __db_stat_msg {
 typedef struct __db_stat_msg __db_stat_msg;
 
 struct __db_stat_reply {
-	int status;
+	gint status;
 	struct {
 		u_int stats_len;
 		u_int *stats_val;
@@ -595,7 +595,7 @@ struct __db_sync_msg {
 typedef struct __db_sync_msg __db_sync_msg;
 
 struct __db_sync_reply {
-	int status;
+	gint status;
 };
 typedef struct __db_sync_reply __db_sync_reply;
 
@@ -607,7 +607,7 @@ struct __db_truncate_msg {
 typedef struct __db_truncate_msg __db_truncate_msg;
 
 struct __db_truncate_reply {
-	int status;
+	gint status;
 	u_int count;
 };
 typedef struct __db_truncate_reply __db_truncate_reply;
@@ -620,7 +620,7 @@ struct __db_cursor_msg {
 typedef struct __db_cursor_msg __db_cursor_msg;
 
 struct __db_cursor_reply {
-	int status;
+	gint status;
 	u_int dbcidcl_id;
 };
 typedef struct __db_cursor_reply __db_cursor_reply;
@@ -636,7 +636,7 @@ struct __db_join_msg {
 typedef struct __db_join_msg __db_join_msg;
 
 struct __db_join_reply {
-	int status;
+	gint status;
 	u_int dbcidcl_id;
 };
 typedef struct __db_join_reply __db_join_reply;
@@ -647,7 +647,7 @@ struct __dbc_close_msg {
 typedef struct __dbc_close_msg __dbc_close_msg;
 
 struct __dbc_close_reply {
-	int status;
+	gint status;
 };
 typedef struct __dbc_close_reply __dbc_close_reply;
 
@@ -658,7 +658,7 @@ struct __dbc_count_msg {
 typedef struct __dbc_count_msg __dbc_count_msg;
 
 struct __dbc_count_reply {
-	int status;
+	gint status;
 	u_int dupcount;
 };
 typedef struct __dbc_count_reply __dbc_count_reply;
@@ -670,7 +670,7 @@ struct __dbc_del_msg {
 typedef struct __dbc_del_msg __dbc_del_msg;
 
 struct __dbc_del_reply {
-	int status;
+	gint status;
 };
 typedef struct __dbc_del_reply __dbc_del_reply;
 
@@ -681,7 +681,7 @@ struct __dbc_dup_msg {
 typedef struct __dbc_dup_msg __dbc_dup_msg;
 
 struct __dbc_dup_reply {
-	int status;
+	gint status;
 	u_int dbcidcl_id;
 };
 typedef struct __dbc_dup_reply __dbc_dup_reply;
@@ -694,7 +694,7 @@ struct __dbc_get_msg {
 	u_int keyflags;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 	u_int datadlen;
 	u_int datadoff;
@@ -702,21 +702,21 @@ struct __dbc_get_msg {
 	u_int dataflags;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 	u_int flags;
 };
 typedef struct __dbc_get_msg __dbc_get_msg;
 
 struct __dbc_get_reply {
-	int status;
+	gint status;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 };
 typedef struct __dbc_get_reply __dbc_get_reply;
@@ -729,7 +729,7 @@ struct __dbc_pget_msg {
 	u_int skeyflags;
 	struct {
 		u_int skeydata_len;
-		char *skeydata_val;
+		gchar *skeydata_val;
 	} skeydata;
 	u_int pkeydlen;
 	u_int pkeydoff;
@@ -737,7 +737,7 @@ struct __dbc_pget_msg {
 	u_int pkeyflags;
 	struct {
 		u_int pkeydata_len;
-		char *pkeydata_val;
+		gchar *pkeydata_val;
 	} pkeydata;
 	u_int datadlen;
 	u_int datadoff;
@@ -745,25 +745,25 @@ struct __dbc_pget_msg {
 	u_int dataflags;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 	u_int flags;
 };
 typedef struct __dbc_pget_msg __dbc_pget_msg;
 
 struct __dbc_pget_reply {
-	int status;
+	gint status;
 	struct {
 		u_int skeydata_len;
-		char *skeydata_val;
+		gchar *skeydata_val;
 	} skeydata;
 	struct {
 		u_int pkeydata_len;
-		char *pkeydata_val;
+		gchar *pkeydata_val;
 	} pkeydata;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 };
 typedef struct __dbc_pget_reply __dbc_pget_reply;
@@ -776,7 +776,7 @@ struct __dbc_put_msg {
 	u_int keyflags;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 	u_int datadlen;
 	u_int datadoff;
@@ -784,17 +784,17 @@ struct __dbc_put_msg {
 	u_int dataflags;
 	struct {
 		u_int datadata_len;
-		char *datadata_val;
+		gchar *datadata_val;
 	} datadata;
 	u_int flags;
 };
 typedef struct __dbc_put_msg __dbc_put_msg;
 
 struct __dbc_put_reply {
-	int status;
+	gint status;
 	struct {
 		u_int keydata_len;
-		char *keydata_val;
+		gchar *keydata_val;
 	} keydata;
 };
 typedef struct __dbc_put_reply __dbc_put_reply;
@@ -899,7 +899,7 @@ extern  __dbc_get_reply * __db_dbc_get_4001();
 extern  __dbc_pget_reply * __db_dbc_pget_4001();
 #define	__DB_dbc_put ((unsigned long)(50))
 extern  __dbc_put_reply * __db_dbc_put_4001();
-extern int db_rpc_serverprog_4001_freeresult();
+extern gint db_rpc_serverprog_4001_freeresult();
 
 /* the xdr functions */
 extern bool_t xdr___env_cachesize_msg();
diff --git a/libdb/dbinc_auto/dbreg_ext.h b/libdb/dbinc_auto/dbreg_ext.h
index eda2620..118e1d0 100644
--- a/libdb/dbinc_auto/dbreg_ext.h
+++ b/libdb/dbinc_auto/dbreg_ext.h
@@ -6,35 +6,35 @@
 extern "C" {
 #endif
 
-int __dbreg_setup __P((DB *, const char *, u_int32_t));
-int __dbreg_teardown __P((DB *));
-int __dbreg_new_id __P((DB *, DB_TXN *));
-int __dbreg_assign_id __P((DB *, int32_t));
-int __dbreg_revoke_id __P((DB *, int));
-int __dbreg_close_id __P((DB *, DB_TXN *));
-int __dbreg_register_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, int32_t, DBTYPE, db_pgno_t, u_int32_t));
-int __dbreg_register_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __dbreg_register_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __dbreg_register_read __P((DB_ENV *, void *, __dbreg_register_args **));
-int __dbreg_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __dbreg_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __dbreg_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __dbreg_register_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __dbreg_add_dbentry __P((DB_ENV *, DB_LOG *, DB *, int32_t));
+gint __dbreg_setup __P((DB *, const gchar *, u_int32_t));
+gint __dbreg_teardown __P((DB *));
+gint __dbreg_new_id __P((DB *, DB_TXN *));
+gint __dbreg_assign_id __P((DB *, int32_t));
+gint __dbreg_revoke_id __P((DB *, int));
+gint __dbreg_close_id __P((DB *, DB_TXN *));
+gint __dbreg_register_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, int32_t, DBTYPE, db_pgno_t, u_int32_t));
+gint __dbreg_register_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __dbreg_register_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __dbreg_register_read __P((DB_ENV *, gpointer , __dbreg_register_args **));
+gint __dbreg_init_print __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __dbreg_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __dbreg_init_recover __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __dbreg_register_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __dbreg_add_dbentry __P((DB_ENV *, DB_LOG *, DB *, int32_t));
 void __dbreg_rem_dbentry __P((DB_LOG *, int32_t));
-int __dbreg_open_files __P((DB_ENV *));
-int __dbreg_close_files __P((DB_ENV *));
-int __dbreg_nofiles __P((DB_ENV *));
-int __dbreg_id_to_db __P((DB_ENV *, DB_TXN *, DB **, int32_t, int));
-int __dbreg_id_to_db_int __P((DB_ENV *, DB_TXN *, DB **, int32_t, int, int));
-int __dbreg_id_to_fname __P((DB_LOG *, int32_t, int, FNAME **));
-int __dbreg_fid_to_fname __P((DB_LOG *, u_int8_t *, int, FNAME **));
-int __dbreg_get_name __P((DB_ENV *, u_int8_t *, char **));
-int __dbreg_do_open __P((DB_ENV *, DB_TXN *, DB_LOG *, u_int8_t *, char *, DBTYPE, int32_t, db_pgno_t, void *, u_int32_t));
-int __dbreg_lazy_id __P((DB *));
-int __dbreg_push_id __P((DB_ENV *, int32_t));
-int __dbreg_pop_id __P((DB_ENV *, int32_t *));
-int __dbreg_pluck_id __P((DB_ENV *, int32_t));
+gint __dbreg_open_files __P((DB_ENV *));
+gint __dbreg_close_files __P((DB_ENV *));
+gint __dbreg_nofiles __P((DB_ENV *));
+gint __dbreg_id_to_db __P((DB_ENV *, DB_TXN *, DB **, int32_t, int));
+gint __dbreg_id_to_db_int __P((DB_ENV *, DB_TXN *, DB **, int32_t, int, int));
+gint __dbreg_id_to_fname __P((DB_LOG *, int32_t, int, FNAME **));
+gint __dbreg_fid_to_fname __P((DB_LOG *, u_int8_t *, int, FNAME **));
+gint __dbreg_get_name __P((DB_ENV *, u_int8_t *, gchar **));
+gint __dbreg_do_open __P((DB_ENV *, DB_TXN *, DB_LOG *, u_int8_t *, gchar *, DBTYPE, int32_t, db_pgno_t, gpointer , u_int32_t));
+gint __dbreg_lazy_id __P((DB *));
+gint __dbreg_push_id __P((DB_ENV *, int32_t));
+gint __dbreg_pop_id __P((DB_ENV *, int32_t *));
+gint __dbreg_pluck_id __P((DB_ENV *, int32_t));
 void __dbreg_print_dblist __P((DB_ENV *));
 
 #if defined(__cplusplus)
diff --git a/libdb/dbinc_auto/env_ext.h b/libdb/dbinc_auto/env_ext.h
index 4bd0eee..23ece0d 100644
--- a/libdb/dbinc_auto/env_ext.h
+++ b/libdb/dbinc_auto/env_ext.h
@@ -6,32 +6,32 @@
 extern "C" {
 #endif
 
-void __db_shalloc_init __P((void *, size_t));
-int __db_shalloc_size __P((size_t, size_t));
-int __db_shalloc __P((void *, size_t, size_t, void *));
-void __db_shalloc_free __P((void *, void *));
-size_t __db_shsizeof __P((void *));
-void __db_shalloc_dump __P((void *, FILE *));
-int __db_tablesize __P((u_int32_t));
-void __db_hashinit __P((void *, u_int32_t));
-int __db_fileinit __P((DB_ENV *, DB_FH *, size_t, int));
-int __db_overwrite __P((DB_ENV *, const char *));
-int __db_mi_env __P((DB_ENV *, const char *));
-int __db_mi_open __P((DB_ENV *, const char *, int));
-int __db_env_config __P((DB_ENV *, char *, u_int32_t));
-int __dbenv_open __P((DB_ENV *, const char *, u_int32_t, int));
-int __dbenv_remove __P((DB_ENV *, const char *, u_int32_t));
-int __dbenv_close __P((DB_ENV *, u_int32_t));
-int __db_appname __P((DB_ENV *, APPNAME, const char *, u_int32_t, DB_FH *, char **));
-int __db_home __P((DB_ENV *, const char *, u_int32_t));
-int __db_apprec __P((DB_ENV *, DB_LSN *, u_int32_t));
-int __env_openfiles __P((DB_ENV *, DB_LOGC *, void *, DBT *, DB_LSN *, DB_LSN *, double, int));
-int __db_e_attach __P((DB_ENV *, u_int32_t *));
-int __db_e_detach __P((DB_ENV *, int));
-int __db_e_remove __P((DB_ENV *, u_int32_t));
-int __db_e_stat __P((DB_ENV *, REGENV *, REGION *, int *, u_int32_t));
-int __db_r_attach __P((DB_ENV *, REGINFO *, size_t));
-int __db_r_detach __P((DB_ENV *, REGINFO *, int));
+void __db_shalloc_init __P((gpointer , size_t));
+gint __db_shalloc_size __P((size_t, size_t));
+gint __db_shalloc __P((gpointer , size_t, size_t, gpointer ));
+void __db_shalloc_free __P((gpointer , gpointer ));
+size_t __db_shsizeof __P((gpointer));
+void __db_shalloc_dump __P((gpointer , FILE *));
+gint __db_tablesize __P((u_int32_t));
+void __db_hashinit __P((gpointer , u_int32_t));
+gint __db_fileinit __P((DB_ENV *, DB_FH *, size_t, int));
+gint __db_overwrite __P((DB_ENV *, const gchar *));
+gint __db_mi_env __P((DB_ENV *, const gchar *));
+gint __db_mi_open __P((DB_ENV *, const gchar *, int));
+gint __db_env_config __P((DB_ENV *, gchar *, u_int32_t));
+gint __dbenv_open __P((DB_ENV *, const gchar *, u_int32_t, int));
+gint __dbenv_remove __P((DB_ENV *, const gchar *, u_int32_t));
+gint __dbenv_close __P((DB_ENV *, u_int32_t));
+gint __db_appname __P((DB_ENV *, APPNAME, const gchar *, u_int32_t, DB_FH *, gchar **));
+gint __db_home __P((DB_ENV *, const gchar *, u_int32_t));
+gint __db_apprec __P((DB_ENV *, DB_LSN *, u_int32_t));
+gint __env_openfiles __P((DB_ENV *, DB_LOGC *, gpointer , DBT *, DB_LSN *, DB_LSN *, double, int));
+gint __db_e_attach __P((DB_ENV *, u_int32_t *));
+gint __db_e_detach __P((DB_ENV *, int));
+gint __db_e_remove __P((DB_ENV *, u_int32_t));
+gint __db_e_stat __P((DB_ENV *, REGENV *, REGION *, gint *, u_int32_t));
+gint __db_r_attach __P((DB_ENV *, REGINFO *, size_t));
+gint __db_r_detach __P((DB_ENV *, REGINFO *, int));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/fileops_ext.h b/libdb/dbinc_auto/fileops_ext.h
index 5edf7bd..66b03e0 100644
--- a/libdb/dbinc_auto/fileops_ext.h
+++ b/libdb/dbinc_auto/fileops_ext.h
@@ -6,45 +6,45 @@
 extern "C" {
 #endif
 
-int __fop_create_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t, u_int32_t));
-int __fop_create_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_create_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_create_read __P((DB_ENV *, void *, __fop_create_args **));
-int __fop_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, u_int32_t));
-int __fop_remove_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_remove_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_remove_read __P((DB_ENV *, void *, __fop_remove_args **));
-int __fop_write_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t, u_int32_t, const DBT *, u_int32_t));
-int __fop_write_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_write_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_write_read __P((DB_ENV *, void *, __fop_write_args **));
-int __fop_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *, u_int32_t));
-int __fop_rename_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_rename_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_rename_read __P((DB_ENV *, void *, __fop_rename_args **));
-int __fop_file_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *, u_int32_t, u_int32_t));
-int __fop_file_remove_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_file_remove_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_file_remove_read __P((DB_ENV *, void *, __fop_file_remove_args **));
-int __fop_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __fop_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __fop_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __fop_create __P((DB_ENV *, DB_TXN *, DB_FH *, const char *, APPNAME, int));
-int __fop_remove __P((DB_ENV *, DB_TXN *, u_int8_t *, const char *, APPNAME));
-int __fop_write __P((DB_ENV *, DB_TXN *, const char *, APPNAME, DB_FH *, u_int32_t, u_int8_t *, u_int32_t, u_int32_t));
-int __fop_rename __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int8_t *, APPNAME));
-int __fop_create_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_remove_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_write_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_rename_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_file_remove_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __fop_lock_handle __P((DB_ENV *, DB *, u_int32_t, db_lockmode_t, DB_LOCK *, u_int32_t));
-int __fop_file_setup __P((DB *, DB_TXN *, const char *, int, u_int32_t, u_int32_t *));
-int __fop_subdb_setup __P((DB *, DB_TXN *, const char *, const char *, int, u_int32_t));
-int __fop_remove_setup __P((DB *, DB_TXN *, const char *, u_int32_t));
-int __fop_read_meta __P((DB_ENV *, const char *, u_int8_t *, size_t, DB_FH *, int, size_t *, u_int32_t));
-int __fop_dummy __P((DB *, DB_TXN *, const char *, const char *, u_int32_t));
-int __fop_dbrename __P((DB *, const char *, const char *));
+gint __fop_create_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t, u_int32_t));
+gint __fop_create_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_create_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_create_read __P((DB_ENV *, gpointer , __fop_create_args **));
+gint __fop_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, u_int32_t));
+gint __fop_remove_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_remove_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_remove_read __P((DB_ENV *, gpointer , __fop_remove_args **));
+gint __fop_write_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t, u_int32_t, const DBT *, u_int32_t));
+gint __fop_write_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_write_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_write_read __P((DB_ENV *, gpointer , __fop_write_args **));
+gint __fop_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *, u_int32_t));
+gint __fop_rename_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_rename_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_rename_read __P((DB_ENV *, gpointer , __fop_rename_args **));
+gint __fop_file_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *, u_int32_t, u_int32_t));
+gint __fop_file_remove_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_file_remove_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_file_remove_read __P((DB_ENV *, gpointer , __fop_file_remove_args **));
+gint __fop_init_print __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __fop_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __fop_init_recover __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __fop_create __P((DB_ENV *, DB_TXN *, DB_FH *, const gchar *, APPNAME, int));
+gint __fop_remove __P((DB_ENV *, DB_TXN *, u_int8_t *, const gchar *, APPNAME));
+gint __fop_write __P((DB_ENV *, DB_TXN *, const gchar *, APPNAME, DB_FH *, u_int32_t, u_int8_t *, u_int32_t, u_int32_t));
+gint __fop_rename __P((DB_ENV *, DB_TXN *, const gchar *, const gchar *, u_int8_t *, APPNAME));
+gint __fop_create_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_remove_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_write_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_rename_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_file_remove_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __fop_lock_handle __P((DB_ENV *, DB *, u_int32_t, db_lockmode_t, DB_LOCK *, u_int32_t));
+gint __fop_file_setup __P((DB *, DB_TXN *, const gchar *, int, u_int32_t, u_int32_t *));
+gint __fop_subdb_setup __P((DB *, DB_TXN *, const gchar *, const gchar *, int, u_int32_t));
+gint __fop_remove_setup __P((DB *, DB_TXN *, const gchar *, u_int32_t));
+gint __fop_read_meta __P((DB_ENV *, const gchar *, u_int8_t *, size_t, DB_FH *, int, size_t *, u_int32_t));
+gint __fop_dummy __P((DB *, DB_TXN *, const gchar *, const gchar *, u_int32_t));
+gint __fop_dbrename __P((DB *, const gchar *, const gchar *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/hash_ext.h b/libdb/dbinc_auto/hash_ext.h
index 1ee2398..7c80e53 100644
--- a/libdb/dbinc_auto/hash_ext.h
+++ b/libdb/dbinc_auto/hash_ext.h
@@ -6,118 +6,118 @@
 extern "C" {
 #endif
 
-int __ham_quick_delete __P((DBC *));
-int __ham_c_init __P((DBC *));
-int __ham_c_count __P((DBC *, db_recno_t *));
-int __ham_c_dup __P((DBC *, DBC *));
+gint __ham_quick_delete __P((DBC *));
+gint __ham_c_init __P((DBC *));
+gint __ham_c_count __P((DBC *, db_recno_t *));
+gint __ham_c_dup __P((DBC *, DBC *));
 u_int32_t __ham_call_hash __P((DBC *, u_int8_t *, int32_t));
-int __ham_init_dbt __P((DB_ENV *, DBT *, u_int32_t, void **, u_int32_t *));
-int __ham_c_update __P((DBC *, u_int32_t, int, int));
-int __ham_get_clist __P((DB *, db_pgno_t, u_int32_t, DBC ***));
-int __ham_insdel_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *, const DBT *, const DBT *));
-int __ham_insdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_insdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_insdel_read __P((DB_ENV *, void *, __ham_insdel_args **));
-int __ham_newpage_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *));
-int __ham_newpage_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_newpage_read __P((DB_ENV *, void *, __ham_newpage_args **));
-int __ham_splitdata_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
-int __ham_splitdata_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_splitdata_read __P((DB_ENV *, void *, __ham_splitdata_args **));
-int __ham_replace_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *, int32_t, const DBT *, const DBT *, u_int32_t));
-int __ham_replace_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_replace_read __P((DB_ENV *, void *, __ham_replace_args **));
-int __ham_copypage_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *));
-int __ham_copypage_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_copypage_read __P((DB_ENV *, void *, __ham_copypage_args **));
-int __ham_metagroup_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t));
-int __ham_metagroup_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_metagroup_read __P((DB_ENV *, void *, __ham_metagroup_args **));
-int __ham_groupalloc_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t));
-int __ham_groupalloc_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_groupalloc_read __P((DB_ENV *, void *, __ham_groupalloc_args **));
-int __ham_curadj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t, int, int, u_int32_t));
-int __ham_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_curadj_read __P((DB_ENV *, void *, __ham_curadj_args **));
-int __ham_chgpg_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_ham_mode, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t));
-int __ham_chgpg_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_chgpg_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_chgpg_read __P((DB_ENV *, void *, __ham_chgpg_args **));
-int __ham_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __ham_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __ham_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __ham_pgin __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
-int __ham_pgout __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
-int __ham_mswap __P((void *));
-int __ham_add_dup __P((DBC *, DBT *, u_int32_t, db_pgno_t *));
-int __ham_dup_convert __P((DBC *));
-int __ham_make_dup __P((DB_ENV *, const DBT *, DBT *d, void **, u_int32_t *));
-void __ham_dsearch __P((DBC *, DBT *, u_int32_t *, int *, u_int32_t));
+gint __ham_init_dbt __P((DB_ENV *, DBT *, u_int32_t, gpointer *, u_int32_t *));
+gint __ham_c_update __P((DBC *, u_int32_t, int, int));
+gint __ham_get_clist __P((DB *, db_pgno_t, u_int32_t, DBC ***));
+gint __ham_insdel_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *, const DBT *, const DBT *));
+gint __ham_insdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_insdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_insdel_read __P((DB_ENV *, gpointer , __ham_insdel_args **));
+gint __ham_newpage_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *));
+gint __ham_newpage_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_newpage_read __P((DB_ENV *, gpointer , __ham_newpage_args **));
+gint __ham_splitdata_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
+gint __ham_splitdata_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_splitdata_read __P((DB_ENV *, gpointer , __ham_splitdata_args **));
+gint __ham_replace_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *, int32_t, const DBT *, const DBT *, u_int32_t));
+gint __ham_replace_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_replace_read __P((DB_ENV *, gpointer , __ham_replace_args **));
+gint __ham_copypage_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *));
+gint __ham_copypage_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_copypage_read __P((DB_ENV *, gpointer , __ham_copypage_args **));
+gint __ham_metagroup_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t));
+gint __ham_metagroup_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_metagroup_read __P((DB_ENV *, gpointer , __ham_metagroup_args **));
+gint __ham_groupalloc_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t));
+gint __ham_groupalloc_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_groupalloc_read __P((DB_ENV *, gpointer , __ham_groupalloc_args **));
+gint __ham_curadj_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t, int, int, u_int32_t));
+gint __ham_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_curadj_read __P((DB_ENV *, gpointer , __ham_curadj_args **));
+gint __ham_chgpg_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_ham_mode, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t));
+gint __ham_chgpg_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_chgpg_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_chgpg_read __P((DB_ENV *, gpointer , __ham_chgpg_args **));
+gint __ham_init_print __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __ham_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __ham_init_recover __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __ham_pgin __P((DB_ENV *, DB *, db_pgno_t, gpointer , DBT *));
+gint __ham_pgout __P((DB_ENV *, DB *, db_pgno_t, gpointer , DBT *));
+gint __ham_mswap __P((gpointer));
+gint __ham_add_dup __P((DBC *, DBT *, u_int32_t, db_pgno_t *));
+gint __ham_dup_convert __P((DBC *));
+gint __ham_make_dup __P((DB_ENV *, const DBT *, DBT *d, gpointer *, u_int32_t *));
+void __ham_dsearch __P((DBC *, DBT *, u_int32_t *, gint *, u_int32_t));
 void __ham_cprint __P((DBC *));
-u_int32_t __ham_func2 __P((DB *, const void *, u_int32_t));
-u_int32_t __ham_func3 __P((DB *, const void *, u_int32_t));
-u_int32_t __ham_func4 __P((DB *, const void *, u_int32_t));
-u_int32_t __ham_func5 __P((DB *, const void *, u_int32_t));
-u_int32_t __ham_test __P((DB *, const void *, u_int32_t));
-int __ham_get_meta __P((DBC *));
-int __ham_release_meta __P((DBC *));
-int __ham_dirty_meta __P((DBC *));
-int __ham_db_create __P((DB *));
-int __ham_db_close __P((DB *));
-int __ham_open __P((DB *, DB_TXN *, const char * name, db_pgno_t, u_int32_t));
-int __ham_metachk __P((DB *, const char *, HMETA *));
-int __ham_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
-int __ham_new_subdb __P((DB *, DB *, DB_TXN *));
-int __ham_item __P((DBC *, db_lockmode_t, db_pgno_t *));
-int __ham_item_reset __P((DBC *));
+u_int32_t __ham_func2 __P((DB *, gconstpointer , u_int32_t));
+u_int32_t __ham_func3 __P((DB *, gconstpointer , u_int32_t));
+u_int32_t __ham_func4 __P((DB *, gconstpointer , u_int32_t));
+u_int32_t __ham_func5 __P((DB *, gconstpointer , u_int32_t));
+u_int32_t __ham_test __P((DB *, gconstpointer , u_int32_t));
+gint __ham_get_meta __P((DBC *));
+gint __ham_release_meta __P((DBC *));
+gint __ham_dirty_meta __P((DBC *));
+gint __ham_db_create __P((DB *));
+gint __ham_db_close __P((DB *));
+gint __ham_open __P((DB *, DB_TXN *, const gchar * name, db_pgno_t, u_int32_t));
+gint __ham_metachk __P((DB *, const gchar *, HMETA *));
+gint __ham_new_file __P((DB *, DB_TXN *, DB_FH *, const gchar *));
+gint __ham_new_subdb __P((DB *, DB *, DB_TXN *));
+gint __ham_item __P((DBC *, db_lockmode_t, db_pgno_t *));
+gint __ham_item_reset __P((DBC *));
 void __ham_item_init __P((DBC *));
-int __ham_item_last __P((DBC *, db_lockmode_t, db_pgno_t *));
-int __ham_item_first __P((DBC *, db_lockmode_t, db_pgno_t *));
-int __ham_item_prev __P((DBC *, db_lockmode_t, db_pgno_t *));
-int __ham_item_next __P((DBC *, db_lockmode_t, db_pgno_t *));
+gint __ham_item_last __P((DBC *, db_lockmode_t, db_pgno_t *));
+gint __ham_item_first __P((DBC *, db_lockmode_t, db_pgno_t *));
+gint __ham_item_prev __P((DBC *, db_lockmode_t, db_pgno_t *));
+gint __ham_item_next __P((DBC *, db_lockmode_t, db_pgno_t *));
 void __ham_putitem __P((DB *, PAGE *p, const DBT *, int));
 void __ham_reputpair  __P((DB *, PAGE *, u_int32_t, const DBT *, const DBT *));
-int __ham_del_pair __P((DBC *, int));
-int __ham_replpair __P((DBC *, DBT *, u_int32_t));
+gint __ham_del_pair __P((DBC *, int));
+gint __ham_replpair __P((DBC *, DBT *, u_int32_t));
 void __ham_onpage_replace __P((DB *, PAGE *, u_int32_t, int32_t, int32_t,  DBT *));
-int __ham_split_page __P((DBC *, u_int32_t, u_int32_t));
-int __ham_add_el __P((DBC *, const DBT *, const DBT *, int));
+gint __ham_split_page __P((DBC *, u_int32_t, u_int32_t));
+gint __ham_add_el __P((DBC *, const DBT *, const DBT *, int));
 void __ham_copy_item __P((DB *, PAGE *, u_int32_t, PAGE *));
-int __ham_add_ovflpage __P((DBC *, PAGE *, int, PAGE **));
-int __ham_get_cpage __P((DBC *, db_lockmode_t));
-int __ham_next_cpage __P((DBC *, db_pgno_t, int));
-int __ham_lock_bucket __P((DBC *, db_lockmode_t));
+gint __ham_add_ovflpage __P((DBC *, PAGE *, int, PAGE **));
+gint __ham_get_cpage __P((DBC *, db_lockmode_t));
+gint __ham_next_cpage __P((DBC *, db_pgno_t, int));
+gint __ham_lock_bucket __P((DBC *, db_lockmode_t));
 void __ham_dpair __P((DB *, PAGE *, u_int32_t));
-int __ham_insdel_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_newpage_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_replace_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_splitdata_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_copypage_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_metagroup_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_groupalloc_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_curadj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_chgpg_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __ham_reclaim __P((DB *, DB_TXN *txn));
-int __ham_truncate __P((DB *, DB_TXN *txn, u_int32_t *));
-int __ham_stat __P((DB *, void *, u_int32_t));
-int __ham_traverse __P((DBC *, db_lockmode_t, int (*)(DB *, PAGE *, void *, int *), void *, int));
-int __ham_30_hashmeta __P((DB *, char *, u_int8_t *));
-int __ham_30_sizefix __P((DB *, DB_FH *, char *, u_int8_t *));
-int __ham_31_hashmeta __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
-int __ham_31_hash __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
-int __ham_vrfy_meta __P((DB *, VRFY_DBINFO *, HMETA *, db_pgno_t, u_int32_t));
-int __ham_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
-int __ham_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
-int __ham_vrfy_hashing __P((DB *, u_int32_t, HMETA *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t (*) __P((DB *, const void *, u_int32_t))));
-int __ham_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *, void *, int (*)(void *, const void *), u_int32_t));
-int __ham_meta2pgset __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t, DB *));
+gint __ham_insdel_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_newpage_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_replace_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_splitdata_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_copypage_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_metagroup_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_groupalloc_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_curadj_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_chgpg_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __ham_reclaim __P((DB *, DB_TXN *txn));
+gint __ham_truncate __P((DB *, DB_TXN *txn, u_int32_t *));
+gint __ham_stat __P((DB *, gpointer , u_int32_t));
+gint __ham_traverse __P((DBC *, db_lockmode_t, gint (*)(DB *, PAGE *, gpointer , gint *), gpointer , int));
+gint __ham_30_hashmeta __P((DB *, gchar *, u_int8_t *));
+gint __ham_30_sizefix __P((DB *, DB_FH *, gchar *, u_int8_t *));
+gint __ham_31_hashmeta __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
+gint __ham_31_hash __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
+gint __ham_vrfy_meta __P((DB *, VRFY_DBINFO *, HMETA *, db_pgno_t, u_int32_t));
+gint __ham_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t));
+gint __ham_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t));
+gint __ham_vrfy_hashing __P((DB *, u_int32_t, HMETA *, u_int32_t, db_pgno_t, u_int32_t, u_int32_t (*) __P((DB *, gconstpointer , u_int32_t))));
+gint __ham_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *, gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
+gint __ham_meta2pgset __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t, DB *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/hmac_ext.h b/libdb/dbinc_auto/hmac_ext.h
index d161a72..31470a9 100644
--- a/libdb/dbinc_auto/hmac_ext.h
+++ b/libdb/dbinc_auto/hmac_ext.h
@@ -8,11 +8,11 @@ extern "C" {
 
 void __db_chksum __P((u_int8_t *, size_t, u_int8_t *, u_int8_t *));
 void __db_derive_mac __P((u_int8_t *, size_t, u_int8_t *));
-int __db_check_chksum __P((DB_ENV *, DB_CIPHER *, u_int8_t *, void *, size_t, int));
-void __db_SHA1Transform __P((u_int32_t *, unsigned char *));
+gint __db_check_chksum __P((DB_ENV *, DB_CIPHER *, u_int8_t *, gpointer , size_t, int));
+void __db_SHA1Transform __P((u_int32_t *, guchar *));
 void __db_SHA1Init __P((SHA1_CTX *));
-void __db_SHA1Update __P((SHA1_CTX *, unsigned char *, size_t));
-void __db_SHA1Final __P((unsigned char *, SHA1_CTX *));
+void __db_SHA1Update __P((SHA1_CTX *, guchar *, size_t));
+void __db_SHA1Final __P((guchar *, SHA1_CTX *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/lock_ext.h b/libdb/dbinc_auto/lock_ext.h
index be6b1d0..62a66e7 100644
--- a/libdb/dbinc_auto/lock_ext.h
+++ b/libdb/dbinc_auto/lock_ext.h
@@ -6,31 +6,31 @@
 extern "C" {
 #endif
 
-int __lock_id __P((DB_ENV *, u_int32_t *));
-int __lock_id_free __P((DB_ENV *, u_int32_t));
-int __lock_vec __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
-int __lock_get __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
-int  __lock_put __P((DB_ENV *, DB_LOCK *));
-int __lock_downgrade __P((DB_ENV *, DB_LOCK *, db_lockmode_t, u_int32_t));
-int __lock_addfamilylocker __P((DB_ENV *, u_int32_t, u_int32_t));
-int __lock_freefamilylocker  __P((DB_LOCKTAB *, u_int32_t));
-int __lock_set_timeout __P(( DB_ENV *, u_int32_t, db_timeout_t, u_int32_t));
-int __lock_inherit_timeout __P(( DB_ENV *, u_int32_t, u_int32_t));
-int __lock_getlocker __P((DB_LOCKTAB *, u_int32_t, u_int32_t, int, DB_LOCKER **));
-int __lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *, u_int32_t));
-int __lock_expired __P((DB_ENV *, db_timeval_t *, db_timeval_t *));
-int __lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, int *));
+gint __lock_id __P((DB_ENV *, u_int32_t *));
+gint __lock_id_free __P((DB_ENV *, u_int32_t));
+gint __lock_vec __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
+gint __lock_get __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
+gint  __lock_put __P((DB_ENV *, DB_LOCK *));
+gint __lock_downgrade __P((DB_ENV *, DB_LOCK *, db_lockmode_t, u_int32_t));
+gint __lock_addfamilylocker __P((DB_ENV *, u_int32_t, u_int32_t));
+gint __lock_freefamilylocker  __P((DB_LOCKTAB *, u_int32_t));
+gint __lock_set_timeout __P(( DB_ENV *, u_int32_t, db_timeout_t, u_int32_t));
+gint __lock_inherit_timeout __P(( DB_ENV *, u_int32_t, u_int32_t));
+gint __lock_getlocker __P((DB_LOCKTAB *, u_int32_t, u_int32_t, int, DB_LOCKER **));
+gint __lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *, u_int32_t));
+gint __lock_expired __P((DB_ENV *, db_timeval_t *, db_timeval_t *));
+gint __lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, gint *));
 void __lock_dbenv_create __P((DB_ENV *));
 void __lock_dbenv_close __P((DB_ENV *));
-int __lock_open __P((DB_ENV *));
-int __lock_dbenv_refresh __P((DB_ENV *));
+gint __lock_open __P((DB_ENV *));
+gint __lock_dbenv_refresh __P((DB_ENV *));
 void __lock_region_destroy __P((DB_ENV *, REGINFO *));
-int __lock_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
-int __lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
-int __lock_dump_region __P((DB_ENV *, char *, FILE *));
+gint __lock_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
+gint __lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
+gint __lock_dump_region __P((DB_ENV *, gchar *, FILE *));
 void __lock_printlock __P((DB_LOCKTAB *, struct __db_lock *, int));
-int __lock_cmp __P((const DBT *, DB_LOCKOBJ *));
-int __lock_locker_cmp __P((u_int32_t, DB_LOCKER *));
+gint __lock_cmp __P((const DBT *, DB_LOCKOBJ *));
+gint __lock_locker_cmp __P((u_int32_t, DB_LOCKER *));
 u_int32_t __lock_ohash __P((const DBT *));
 u_int32_t __lock_lhash __P((DB_LOCKOBJ *));
 u_int32_t __lock_locker_hash __P((u_int32_t));
diff --git a/libdb/dbinc_auto/log_ext.h b/libdb/dbinc_auto/log_ext.h
index 6fc69af..64ef81b 100644
--- a/libdb/dbinc_auto/log_ext.h
+++ b/libdb/dbinc_auto/log_ext.h
@@ -6,25 +6,25 @@
 extern "C" {
 #endif
 
-int __log_open __P((DB_ENV *));
-int __log_find __P((DB_LOG *, int, u_int32_t *, logfile_validity *));
-int __log_valid __P((DB_LOG *, u_int32_t, int, logfile_validity *));
-int __log_dbenv_refresh __P((DB_ENV *));
-int __log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
+gint __log_open __P((DB_ENV *));
+gint __log_find __P((DB_LOG *, int, u_int32_t *, logfile_validity *));
+gint __log_valid __P((DB_LOG *, u_int32_t, int, logfile_validity *));
+gint __log_dbenv_refresh __P((DB_ENV *));
+gint __log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
 void __log_get_cached_ckp_lsn __P((DB_ENV *, DB_LSN *));
 void __log_region_destroy __P((DB_ENV *, REGINFO *));
-int __log_vtruncate __P((DB_ENV *, DB_LSN *, DB_LSN *));
-int __log_is_outdated __P((DB_ENV *dbenv, u_int32_t fnum, int *outdatedp));
-int __log_archive __P((DB_ENV *, char **[], u_int32_t));
-int __log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
+gint __log_vtruncate __P((DB_ENV *, DB_LSN *, DB_LSN *));
+gint __log_is_outdated __P((DB_ENV *dbenv, u_int32_t fnum, gint *outdatedp));
+gint __log_archive __P((DB_ENV *, gchar **[], u_int32_t));
+gint __log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
 void __log_dbenv_create __P((DB_ENV *));
-int __log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
+gint __log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
 void __log_txn_lsn __P((DB_ENV *, DB_LSN *, u_int32_t *, u_int32_t *));
-int __log_newfile __P((DB_LOG *, DB_LSN *));
-int __log_flush __P((DB_ENV *, const DB_LSN *));
-int __log_file __P((DB_ENV *, const DB_LSN *, char *, size_t));
-int __log_name __P((DB_LOG *, u_int32_t, char **, DB_FH *, u_int32_t));
-int __log_rep_put __P((DB_ENV *, DB_LSN *, const DBT *));
+gint __log_newfile __P((DB_LOG *, DB_LSN *));
+gint __log_flush __P((DB_ENV *, const DB_LSN *));
+gint __log_file __P((DB_ENV *, const DB_LSN *, gchar *, size_t));
+gint __log_name __P((DB_LOG *, u_int32_t, gchar **, DB_FH *, u_int32_t));
+gint __log_rep_put __P((DB_ENV *, DB_LSN *, const DBT *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/mp_ext.h b/libdb/dbinc_auto/mp_ext.h
index ceadb3d..eedd9e0 100644
--- a/libdb/dbinc_auto/mp_ext.h
+++ b/libdb/dbinc_auto/mp_ext.h
@@ -6,37 +6,37 @@
 extern "C" {
 #endif
 
-int __memp_alloc __P((DB_MPOOL *, REGINFO *, MPOOLFILE *, size_t, roff_t *, void *));
+gint __memp_alloc __P((DB_MPOOL *, REGINFO *, MPOOLFILE *, size_t, roff_t *, gpointer ));
 #ifdef DIAGNOSTIC
 void __memp_check_order __P((DB_MPOOL_HASH *));
 #endif
-int __memp_bhwrite __P((DB_MPOOL *, DB_MPOOL_HASH *, MPOOLFILE *, BH *, int));
-int __memp_pgread __P((DB_MPOOLFILE *, DB_MUTEX *, BH *, int));
-int __memp_pg __P((DB_MPOOLFILE *, BH *, int));
+gint __memp_bhwrite __P((DB_MPOOL *, DB_MPOOL_HASH *, MPOOLFILE *, BH *, int));
+gint __memp_pgread __P((DB_MPOOLFILE *, DB_MUTEX *, BH *, int));
+gint __memp_pg __P((DB_MPOOLFILE *, BH *, int));
 void __memp_bhfree __P((DB_MPOOL *, DB_MPOOL_HASH *, BH *, int));
-int __memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *));
-int __memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
-int __memp_fopen_int __P((DB_MPOOLFILE *, MPOOLFILE *, const char *, u_int32_t, int, size_t));
-int __memp_fclose_int __P((DB_MPOOLFILE *, u_int32_t));
-int __memp_mf_discard __P((DB_MPOOL *, MPOOLFILE *));
-char * __memp_fn __P((DB_MPOOLFILE *));
-char * __memp_fns __P((DB_MPOOL *, MPOOLFILE *));
-int __memp_fput __P((DB_MPOOLFILE *, void *, u_int32_t));
-int __memp_fset __P((DB_MPOOLFILE *, void *, u_int32_t));
+gint __memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, gpointer ));
+gint __memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
+gint __memp_fopen_int __P((DB_MPOOLFILE *, MPOOLFILE *, const gchar *, u_int32_t, int, size_t));
+gint __memp_fclose_int __P((DB_MPOOLFILE *, u_int32_t));
+gint __memp_mf_discard __P((DB_MPOOL *, MPOOLFILE *));
+gchar * __memp_fn __P((DB_MPOOLFILE *));
+gchar * __memp_fns __P((DB_MPOOL *, MPOOLFILE *));
+gint __memp_fput __P((DB_MPOOLFILE *, gpointer , u_int32_t));
+gint __memp_fset __P((DB_MPOOLFILE *, gpointer , u_int32_t));
 void __memp_dbenv_create __P((DB_ENV *));
-int __memp_open __P((DB_ENV *));
-int __memp_dbenv_refresh __P((DB_ENV *));
+gint __memp_open __P((DB_ENV *));
+gint __memp_dbenv_refresh __P((DB_ENV *));
 void __mpool_region_destroy __P((DB_ENV *, REGINFO *));
-int  __memp_nameop __P((DB_ENV *, u_int8_t *, const char *, const char *, const char *));
-int __memp_register __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t, void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
-int __memp_stat __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
-int __memp_dump_region __P((DB_ENV *, char *, FILE *));
+gint  __memp_nameop __P((DB_ENV *, u_int8_t *, const gchar *, const gchar *, const gchar *));
+gint __memp_register __P((DB_ENV *, int, gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *), gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *)));
+gint __memp_stat __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
+gint __memp_dump_region __P((DB_ENV *, gchar *, FILE *));
 void __memp_stat_hash __P((REGINFO *, MPOOL *, u_int32_t *));
-int __memp_sync __P((DB_ENV *, DB_LSN *));
-int __memp_fsync __P((DB_MPOOLFILE *));
-int __mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **));
-int __memp_sync_int __P((DB_ENV *, DB_MPOOLFILE *, int, db_sync_op, int *));
-int __memp_trickle __P((DB_ENV *, int, int *));
+gint __memp_sync __P((DB_ENV *, DB_LSN *));
+gint __memp_fsync __P((DB_MPOOLFILE *));
+gint __mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **));
+gint __memp_sync_int __P((DB_ENV *, DB_MPOOLFILE *, int, db_sync_op, gint *));
+gint __memp_trickle __P((DB_ENV *, int, gint *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/mutex_ext.h b/libdb/dbinc_auto/mutex_ext.h
index a40f04d..f16ffab 100644
--- a/libdb/dbinc_auto/mutex_ext.h
+++ b/libdb/dbinc_auto/mutex_ext.h
@@ -6,28 +6,28 @@
 extern "C" {
 #endif
 
-int __db_fcntl_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
-int __db_fcntl_mutex_lock __P((DB_ENV *, DB_MUTEX *));
-int __db_fcntl_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
-int __db_fcntl_mutex_destroy __P((DB_MUTEX *));
-int __db_pthread_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
-int __db_pthread_mutex_lock __P((DB_ENV *, DB_MUTEX *));
-int __db_pthread_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
-int __db_pthread_mutex_destroy __P((DB_MUTEX *));
-int __db_tas_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
-int __db_tas_mutex_lock __P((DB_ENV *, DB_MUTEX *));
-int __db_tas_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
-int __db_tas_mutex_destroy __P((DB_MUTEX *));
-int __db_win32_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
-int __db_win32_mutex_lock __P((DB_ENV *, DB_MUTEX *));
-int __db_win32_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
-int __db_win32_mutex_destroy __P((DB_MUTEX *));
-int __db_mutex_setup __P((DB_ENV *, REGINFO *, void *, u_int32_t));
+gint __db_fcntl_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
+gint __db_fcntl_mutex_lock __P((DB_ENV *, DB_MUTEX *));
+gint __db_fcntl_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
+gint __db_fcntl_mutex_destroy __P((DB_MUTEX *));
+gint __db_pthread_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
+gint __db_pthread_mutex_lock __P((DB_ENV *, DB_MUTEX *));
+gint __db_pthread_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
+gint __db_pthread_mutex_destroy __P((DB_MUTEX *));
+gint __db_tas_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
+gint __db_tas_mutex_lock __P((DB_ENV *, DB_MUTEX *));
+gint __db_tas_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
+gint __db_tas_mutex_destroy __P((DB_MUTEX *));
+gint __db_win32_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
+gint __db_win32_mutex_lock __P((DB_ENV *, DB_MUTEX *));
+gint __db_win32_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
+gint __db_win32_mutex_destroy __P((DB_MUTEX *));
+gint __db_mutex_setup __P((DB_ENV *, REGINFO *, gpointer , u_int32_t));
 void __db_mutex_free __P((DB_ENV *, REGINFO *, DB_MUTEX *));
 void __db_shreg_locks_clear __P((DB_MUTEX *, REGINFO *, REGMAINT *));
 void __db_shreg_locks_destroy __P((REGINFO *, REGMAINT *));
-int __db_shreg_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t, u_int32_t, REGINFO *, REGMAINT *));
-void __db_shreg_maintinit __P((REGINFO *, void *addr, size_t));
+gint __db_shreg_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t, u_int32_t, REGINFO *, REGMAINT *));
+void __db_shreg_maintinit __P((REGINFO *, gpointer addr, size_t));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/os_ext.h b/libdb/dbinc_auto/os_ext.h
index 0a2e5ab..77bcd16 100644
--- a/libdb/dbinc_auto/os_ext.h
+++ b/libdb/dbinc_auto/os_ext.h
@@ -6,67 +6,67 @@
 extern "C" {
 #endif
 
-int __os_abspath __P((const char *));
-int __os_umalloc __P((DB_ENV *, size_t, void *));
-int __os_urealloc __P((DB_ENV *, size_t, void *));
-int __os_ufree __P((DB_ENV *, void *));
-int __os_strdup __P((DB_ENV *, const char *, void *));
-int __os_calloc __P((DB_ENV *, size_t, size_t, void *));
-int __os_malloc __P((DB_ENV *, size_t, void *));
-int __os_realloc __P((DB_ENV *, size_t, void *));
-void __os_free __P((DB_ENV *, void *));
-void *__ua_memcpy __P((void *, const void *, size_t));
-int __os_clock __P((DB_ENV *, u_int32_t *, u_int32_t *));
-int __os_fs_notzero __P((void));
-int __os_dirlist __P((DB_ENV *, const char *, char ***, int *));
-void __os_dirfree __P((DB_ENV *, char **, int));
-int __os_get_errno_ret_zero __P((void));
-int __os_get_errno __P((void));
+gint __os_abspath __P((const gchar *));
+gint __os_umalloc __P((DB_ENV *, size_t, gpointer ));
+gint __os_urealloc __P((DB_ENV *, size_t, gpointer ));
+gint __os_ufree __P((DB_ENV *, gpointer ));
+gint __os_strdup __P((DB_ENV *, const gchar *, gpointer ));
+gint __os_calloc __P((DB_ENV *, size_t, size_t, gpointer ));
+gint __os_malloc __P((DB_ENV *, size_t, gpointer ));
+gint __os_realloc __P((DB_ENV *, size_t, gpointer ));
+void __os_free __P((DB_ENV *, gpointer ));
+gpointer __ua_memcpy __P((gpointer , gconstpointer , size_t));
+gint __os_clock __P((DB_ENV *, u_int32_t *, u_int32_t *));
+gint __os_fs_notzero __P((void));
+gint __os_dirlist __P((DB_ENV *, const gchar *, gchar ***, gint *));
+void __os_dirfree __P((DB_ENV *, gchar **, int));
+gint __os_get_errno_ret_zero __P((void));
+gint __os_get_errno __P((void));
 void __os_set_errno __P((int));
-int __os_fileid __P((DB_ENV *, const char *, int, u_int8_t *));
-int __os_fsync __P((DB_ENV *, DB_FH *));
-int __os_openhandle __P((DB_ENV *, const char *, int, int, DB_FH *));
-int __os_closehandle __P((DB_ENV *, DB_FH *));
+gint __os_fileid __P((DB_ENV *, const gchar *, int, u_int8_t *));
+gint __os_fsync __P((DB_ENV *, DB_FH *));
+gint __os_openhandle __P((DB_ENV *, const gchar *, int, int, DB_FH *));
+gint __os_closehandle __P((DB_ENV *, DB_FH *));
 void __os_id __P((u_int32_t *));
-int __os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *));
-int __os_r_sysdetach __P((DB_ENV *, REGINFO *, int));
-int __os_mapfile __P((DB_ENV *, char *, DB_FH *, size_t, int, void **));
-int __os_unmapfile __P((DB_ENV *, void *, size_t));
+gint __os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *));
+gint __os_r_sysdetach __P((DB_ENV *, REGINFO *, int));
+gint __os_mapfile __P((DB_ENV *, gchar *, DB_FH *, size_t, int, gpointer *));
+gint __os_unmapfile __P((DB_ENV *, gpointer , size_t));
 u_int32_t __db_oflags __P((int));
-int __db_omode __P((const char *));
-int __os_open __P((DB_ENV *, const char *, u_int32_t, int, DB_FH *));
+gint __db_omode __P((const gchar *));
+gint __os_open __P((DB_ENV *, const gchar *, u_int32_t, int, DB_FH *));
 #ifdef HAVE_QNX
-int __os_shmname __P((DB_ENV *, const char *, char **));
+gint __os_shmname __P((DB_ENV *, const gchar *, gchar **));
 #endif
-int __os_r_attach __P((DB_ENV *, REGINFO *, REGION *));
-int __os_r_detach __P((DB_ENV *, REGINFO *, int));
-int __os_rename __P((DB_ENV *, const char *, const char *, u_int32_t));
-int __os_isroot __P((void));
-char *__db_rpath __P((const char *));
-int __os_io __P((DB_ENV *, DB_IO *, int, size_t *));
-int __os_read __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
-int __os_write __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
-int __os_seek __P((DB_ENV *, DB_FH *, size_t, db_pgno_t, u_int32_t, int, DB_OS_SEEK));
-int __os_sleep __P((DB_ENV *, u_long, u_long));
-int __os_spin __P((DB_ENV *));
+gint __os_r_attach __P((DB_ENV *, REGINFO *, REGION *));
+gint __os_r_detach __P((DB_ENV *, REGINFO *, int));
+gint __os_rename __P((DB_ENV *, const gchar *, const gchar *, u_int32_t));
+gint __os_isroot __P((void));
+gchar *__db_rpath __P((const gchar *));
+gint __os_io __P((DB_ENV *, DB_IO *, int, size_t *));
+gint __os_read __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
+gint __os_write __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
+gint __os_seek __P((DB_ENV *, DB_FH *, size_t, db_pgno_t, u_int32_t, int, DB_OS_SEEK));
+gint __os_sleep __P((DB_ENV *, u_long, u_long));
+gint __os_spin __P((DB_ENV *));
 void __os_yield __P((DB_ENV*, u_long));
-int __os_exists __P((const char *, int *));
-int __os_ioinfo __P((DB_ENV *, const char *, DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *));
-int __os_tmpdir __P((DB_ENV *, u_int32_t));
-int __os_region_unlink __P((DB_ENV *, const char *));
-int __os_unlink __P((DB_ENV *, const char *));
+gint __os_exists __P((const gchar *, gint *));
+gint __os_ioinfo __P((DB_ENV *, const gchar *, DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *));
+gint __os_tmpdir __P((DB_ENV *, u_int32_t));
+gint __os_region_unlink __P((DB_ENV *, const gchar *));
+gint __os_unlink __P((DB_ENV *, const gchar *));
 #if defined(DB_WIN32)
-int __os_win32_errno __P((void));
+gint __os_win32_errno __P((void));
 #endif
-int __os_fsync __P((DB_ENV *, DB_FH *));
-int __os_openhandle __P((DB_ENV *, const char *, int, int, DB_FH *));
-int __os_closehandle __P((DB_ENV *, DB_FH *));
-int __os_io __P((DB_ENV *, DB_IO *, int, size_t *));
-int __os_read __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
-int __os_write __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
-int __os_exists __P((const char *, int *));
-int __os_ioinfo __P((DB_ENV *, const char *, DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *));
-int __os_is_winnt __P((void));
+gint __os_fsync __P((DB_ENV *, DB_FH *));
+gint __os_openhandle __P((DB_ENV *, const gchar *, int, int, DB_FH *));
+gint __os_closehandle __P((DB_ENV *, DB_FH *));
+gint __os_io __P((DB_ENV *, DB_IO *, int, size_t *));
+gint __os_read __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
+gint __os_write __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
+gint __os_exists __P((const gchar *, gint *));
+gint __os_ioinfo __P((DB_ENV *, const gchar *, DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *));
+gint __os_is_winnt __P((void));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/qam_ext.h b/libdb/dbinc_auto/qam_ext.h
index 16dbea7..56e4282 100644
--- a/libdb/dbinc_auto/qam_ext.h
+++ b/libdb/dbinc_auto/qam_ext.h
@@ -6,63 +6,63 @@
 extern "C" {
 #endif
 
-int __qam_position __P((DBC *, db_recno_t *, qam_position_mode, int *));
-int __qam_pitem __P((DBC *,  QPAGE *, u_int32_t, db_recno_t, DBT *));
-int __qam_append __P((DBC *, DBT *, DBT *));
-int __qam_c_dup __P((DBC *, DBC *));
-int __qam_c_init __P((DBC *));
-int __qam_truncate __P((DB *, DB_TXN *, u_int32_t *));
-int __qam_incfirst_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_recno_t, db_pgno_t));
-int __qam_incfirst_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_incfirst_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_incfirst_read __P((DB_ENV *, void *, __qam_incfirst_args **));
-int __qam_mvptr_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_recno_t, db_recno_t, db_recno_t, db_recno_t, DB_LSN *, db_pgno_t));
-int __qam_mvptr_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_mvptr_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_mvptr_read __P((DB_ENV *, void *, __qam_mvptr_args **));
-int __qam_del_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t));
-int __qam_del_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_del_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_del_read __P((DB_ENV *, void *, __qam_del_args **));
-int __qam_add_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *, u_int32_t, const DBT *));
-int __qam_add_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_add_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_add_read __P((DB_ENV *, void *, __qam_add_args **));
-int __qam_delext_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *));
-int __qam_delext_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_delext_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_delext_read __P((DB_ENV *, void *, __qam_delext_args **));
-int __qam_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __qam_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __qam_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __qam_mswap __P((PAGE *));
-int __qam_pgin_out __P((DB_ENV *, db_pgno_t, void *, DBT *));
-int __qam_fprobe __P((DB *, db_pgno_t, void *, qam_probe_mode, u_int32_t));
-int __qam_fclose __P((DB *, db_pgno_t));
-int __qam_fremove __P((DB *, db_pgno_t));
-int __qam_sync __P((DB *, u_int32_t));
-int __qam_gen_filelist __P(( DB *, QUEUE_FILELIST **));
-int __qam_extent_names __P((DB_ENV *, char *, char ***));
+gint __qam_position __P((DBC *, db_recno_t *, qam_position_mode, gint *));
+gint __qam_pitem __P((DBC *,  QPAGE *, u_int32_t, db_recno_t, DBT *));
+gint __qam_append __P((DBC *, DBT *, DBT *));
+gint __qam_c_dup __P((DBC *, DBC *));
+gint __qam_c_init __P((DBC *));
+gint __qam_truncate __P((DB *, DB_TXN *, u_int32_t *));
+gint __qam_incfirst_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, db_recno_t, db_pgno_t));
+gint __qam_incfirst_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_incfirst_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_incfirst_read __P((DB_ENV *, gpointer , __qam_incfirst_args **));
+gint __qam_mvptr_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_recno_t, db_recno_t, db_recno_t, db_recno_t, DB_LSN *, db_pgno_t));
+gint __qam_mvptr_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_mvptr_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_mvptr_read __P((DB_ENV *, gpointer , __qam_mvptr_args **));
+gint __qam_del_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t));
+gint __qam_del_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_del_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_del_read __P((DB_ENV *, gpointer , __qam_del_args **));
+gint __qam_add_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *, u_int32_t, const DBT *));
+gint __qam_add_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_add_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_add_read __P((DB_ENV *, gpointer , __qam_add_args **));
+gint __qam_delext_log __P((DB *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *));
+gint __qam_delext_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_delext_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_delext_read __P((DB_ENV *, gpointer , __qam_delext_args **));
+gint __qam_init_print __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __qam_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __qam_init_recover __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __qam_mswap __P((PAGE *));
+gint __qam_pgin_out __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
+gint __qam_fprobe __P((DB *, db_pgno_t, gpointer , qam_probe_mode, u_int32_t));
+gint __qam_fclose __P((DB *, db_pgno_t));
+gint __qam_fremove __P((DB *, db_pgno_t));
+gint __qam_sync __P((DB *, u_int32_t));
+gint __qam_gen_filelist __P(( DB *, QUEUE_FILELIST **));
+gint __qam_extent_names __P((DB_ENV *, gchar *, gchar ***));
 void __qam_exid __P((DB *, u_int8_t *, u_int32_t));
-int __qam_db_create __P((DB *));
-int __qam_db_close __P((DB *));
-int __db_prqueue __P((DB *, FILE *, u_int32_t));
-int __qam_remove __P((DB *, DB_TXN *, const char *, const char *, DB_LSN *));
-int __qam_rename __P((DB *, DB_TXN *, const char *, const char *, const char *));
-int __qam_open __P((DB *, DB_TXN *, const char *, db_pgno_t, int, u_int32_t));
-int __qam_metachk __P((DB *, const char *, QMETA *));
-int __qam_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
-int __qam_incfirst_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_mvptr_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_del_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_delext_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_add_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __qam_stat __P((DB *, void *, u_int32_t));
-int __qam_31_qammeta __P((DB *, char *, u_int8_t *));
-int __qam_32_qammeta __P((DB *, char *, u_int8_t *));
-int __qam_vrfy_meta __P((DB *, VRFY_DBINFO *, QMETA *, db_pgno_t, u_int32_t));
-int __qam_vrfy_data __P((DB *, VRFY_DBINFO *, QPAGE *, db_pgno_t, u_int32_t));
-int __qam_vrfy_structure __P((DB *, VRFY_DBINFO *, u_int32_t));
+gint __qam_db_create __P((DB *));
+gint __qam_db_close __P((DB *));
+gint __db_prqueue __P((DB *, FILE *, u_int32_t));
+gint __qam_remove __P((DB *, DB_TXN *, const gchar *, const gchar *, DB_LSN *));
+gint __qam_rename __P((DB *, DB_TXN *, const gchar *, const gchar *, const gchar *));
+gint __qam_open __P((DB *, DB_TXN *, const gchar *, db_pgno_t, int, u_int32_t));
+gint __qam_metachk __P((DB *, const gchar *, QMETA *));
+gint __qam_new_file __P((DB *, DB_TXN *, DB_FH *, const gchar *));
+gint __qam_incfirst_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_mvptr_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_del_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_delext_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_add_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __qam_stat __P((DB *, gpointer , u_int32_t));
+gint __qam_31_qammeta __P((DB *, gchar *, u_int8_t *));
+gint __qam_32_qammeta __P((DB *, gchar *, u_int8_t *));
+gint __qam_vrfy_meta __P((DB *, VRFY_DBINFO *, QMETA *, db_pgno_t, u_int32_t));
+gint __qam_vrfy_data __P((DB *, VRFY_DBINFO *, QPAGE *, db_pgno_t, u_int32_t));
+gint __qam_vrfy_structure __P((DB *, VRFY_DBINFO *, u_int32_t));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/rep_ext.h b/libdb/dbinc_auto/rep_ext.h
index 22e2d25..fda5414 100644
--- a/libdb/dbinc_auto/rep_ext.h
+++ b/libdb/dbinc_auto/rep_ext.h
@@ -6,23 +6,23 @@
 extern "C" {
 #endif
 
-int __rep_dbenv_create __P((DB_ENV *));
-int __rep_process_message __P((DB_ENV *, DBT *, DBT *, int *));
-int __rep_process_txn __P((DB_ENV *, DBT *));
-int __rep_region_init __P((DB_ENV *));
-int __rep_region_destroy __P((DB_ENV *));
-int __rep_dbenv_close __P((DB_ENV *));
-int __rep_preclose __P((DB_ENV *, int));
-int __rep_check_alloc __P((DB_ENV *, TXN_RECS *, int));
-int __rep_send_message __P((DB_ENV *, int, u_int32_t, DB_LSN *, const DBT *, u_int32_t));
-int __rep_new_master __P((DB_ENV *, REP_CONTROL *, int));
-int __rep_lockpgno_init __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __rep_unlockpages __P((DB_ENV *, u_int32_t));
-int __rep_lockpages __P((DB_ENV *, int (**)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t, DB_LSN *, DB_LSN *, TXN_RECS *, u_int32_t));
-int __rep_is_client __P((DB_ENV *));
-int __rep_send_vote __P((DB_ENV *, DB_LSN *, int, int, int));
-int __rep_grow_sites __P((DB_ENV *dbenv, int nsites));
-void __rep_print_message __P((DB_ENV *, int, REP_CONTROL *, char *));
+gint __rep_dbenv_create __P((DB_ENV *));
+gint __rep_process_message __P((DB_ENV *, DBT *, DBT *, gint *));
+gint __rep_process_txn __P((DB_ENV *, DBT *));
+gint __rep_region_init __P((DB_ENV *));
+gint __rep_region_destroy __P((DB_ENV *));
+gint __rep_dbenv_close __P((DB_ENV *));
+gint __rep_preclose __P((DB_ENV *, int));
+gint __rep_check_alloc __P((DB_ENV *, TXN_RECS *, int));
+gint __rep_send_message __P((DB_ENV *, int, u_int32_t, DB_LSN *, const DBT *, u_int32_t));
+gint __rep_new_master __P((DB_ENV *, REP_CONTROL *, int));
+gint __rep_lockpgno_init __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __rep_unlockpages __P((DB_ENV *, u_int32_t));
+gint __rep_lockpages __P((DB_ENV *, gint (**)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t, DB_LSN *, DB_LSN *, TXN_RECS *, u_int32_t));
+gint __rep_is_client __P((DB_ENV *));
+gint __rep_send_vote __P((DB_ENV *, DB_LSN *, int, int, int));
+gint __rep_grow_sites __P((DB_ENV *dbenv, gint nsites));
+void __rep_print_message __P((DB_ENV *, int, REP_CONTROL *, gchar *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/rpc_client_ext.h b/libdb/dbinc_auto/rpc_client_ext.h
index 9634b34..ec79295 100644
--- a/libdb/dbinc_auto/rpc_client_ext.h
+++ b/libdb/dbinc_auto/rpc_client_ext.h
@@ -6,160 +6,160 @@
 extern "C" {
 #endif
 
-int __dbcl_envrpcserver __P((DB_ENV *, void *, const char *, long, long, u_int32_t));
-int __dbcl_env_open_wrap __P((DB_ENV *, const char *, u_int32_t, int));
-int __dbcl_db_open_wrap __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
-int __dbcl_refresh __P((DB_ENV *));
-int __dbcl_retcopy __P((DB_ENV *, DBT *, void *, u_int32_t, void **, u_int32_t *));
+gint __dbcl_envrpcserver __P((DB_ENV *, gpointer , const gchar *, long, long, u_int32_t));
+gint __dbcl_env_open_wrap __P((DB_ENV *, const gchar *, u_int32_t, int));
+gint __dbcl_db_open_wrap __P((DB *, DB_TXN *, const gchar *, const gchar *, DBTYPE, u_int32_t, int));
+gint __dbcl_refresh __P((DB_ENV *));
+gint __dbcl_retcopy __P((DB_ENV *, DBT *, gpointer , u_int32_t, gpointer *, u_int32_t *));
 void __dbcl_txn_end __P((DB_TXN *));
 void __dbcl_txn_setup __P((DB_ENV *, DB_TXN *, DB_TXN *, u_int32_t));
 void __dbcl_c_refresh __P((DBC *));
-int __dbcl_c_setup __P((long, DB *, DBC **));
-int __dbcl_dbclose_common __P((DB *));
-int __dbcl_env_alloc __P((DB_ENV *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *)));
-int __dbcl_set_app_dispatch __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
-int __dbcl_env_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
-int __dbcl_env_close __P((DB_ENV *, u_int32_t));
-int __dbcl_env_create __P((DB_ENV *, long));
-int __dbcl_set_data_dir __P((DB_ENV *, const char *));
-int __dbcl_env_dbremove __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t));
-int __dbcl_env_dbrename __P((DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t));
-int __dbcl_env_encrypt __P((DB_ENV *, const char *, u_int32_t));
-int __dbcl_env_set_feedback __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
-int __dbcl_env_flags __P((DB_ENV *, u_int32_t, int));
-int __dbcl_set_lg_bsize __P((DB_ENV *, u_int32_t));
-int __dbcl_set_lg_dir __P((DB_ENV *, const char *));
-int __dbcl_set_lg_max __P((DB_ENV *, u_int32_t));
-int __dbcl_set_lg_regionmax __P((DB_ENV *, u_int32_t));
-int __dbcl_set_lk_conflict __P((DB_ENV *, u_int8_t *, int));
-int __dbcl_set_lk_detect __P((DB_ENV *, u_int32_t));
-int __dbcl_set_lk_max __P((DB_ENV *, u_int32_t));
-int __dbcl_set_lk_max_locks __P((DB_ENV *, u_int32_t));
-int __dbcl_set_lk_max_lockers __P((DB_ENV *, u_int32_t));
-int __dbcl_set_lk_max_objects __P((DB_ENV *, u_int32_t));
-int __dbcl_set_mp_mmapsize __P((DB_ENV *, size_t));
-int __dbcl_env_open __P((DB_ENV *, const char *, u_int32_t, int));
-int __dbcl_env_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
-int __dbcl_env_remove __P((DB_ENV *, const char *, u_int32_t));
-int __dbcl_set_shm_key __P((DB_ENV *, long));
-int __dbcl_set_tas_spins __P((DB_ENV *, u_int32_t));
-int __dbcl_set_timeout __P((DB_ENV *, u_int32_t, u_int32_t));
-int __dbcl_set_tmp_dir __P((DB_ENV *, const char *));
-int __dbcl_set_tx_max __P((DB_ENV *, u_int32_t));
-int __dbcl_set_tx_timestamp __P((DB_ENV *, time_t *));
-int __dbcl_set_verbose __P((DB_ENV *, u_int32_t, int));
-int __dbcl_txn_abort __P((DB_TXN *));
-int __dbcl_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
-int __dbcl_txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
-int __dbcl_txn_commit __P((DB_TXN *, u_int32_t));
-int __dbcl_txn_discard __P((DB_TXN *, u_int32_t));
-int __dbcl_txn_prepare __P((DB_TXN *, u_int8_t *));
-int __dbcl_txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
-int __dbcl_txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
-int __dbcl_txn_timeout __P((DB_TXN *, u_int32_t, u_int32_t));
-int __dbcl_rep_elect __P((DB_ENV *, int, int, u_int32_t, int *));
-int __dbcl_rep_flush __P((DB_ENV *));
-int __dbcl_rep_process_message __P((DB_ENV *, DBT *, DBT *, int *));
-int __dbcl_rep_set_limit __P((DB_ENV *, u_int32_t, u_int32_t));
-int __dbcl_rep_set_request __P((DB_ENV *, u_int32_t, u_int32_t));
-int __dbcl_rep_set_rep_transport __P((DB_ENV *, int, int (*)(DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
-int __dbcl_rep_start __P((DB_ENV *, DBT *, u_int32_t));
-int __dbcl_rep_stat __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
-int __dbcl_db_alloc __P((DB *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *)));
-int __dbcl_db_associate __P((DB *, DB_TXN *, DB *, int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
-int __dbcl_db_bt_compare __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
-int __dbcl_db_bt_maxkey __P((DB *, u_int32_t));
-int __dbcl_db_bt_minkey __P((DB *, u_int32_t));
-int __dbcl_db_bt_prefix __P((DB *, size_t(*)(DB *, const DBT *, const DBT *)));
-int __dbcl_db_set_append_recno __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
-int __dbcl_db_cache_priority __P((DB *, DB_CACHE_PRIORITY));
-int __dbcl_db_cachesize __P((DB *, u_int32_t, u_int32_t, int));
-int __dbcl_db_close __P((DB *, u_int32_t));
-int __dbcl_db_create __P((DB *, DB_ENV *, u_int32_t));
-int __dbcl_db_del __P((DB *, DB_TXN *, DBT *, u_int32_t));
-int __dbcl_db_dup_compare __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
-int __dbcl_db_encrypt __P((DB *, const char *, u_int32_t));
-int __dbcl_db_extentsize __P((DB *, u_int32_t));
-int __dbcl_db_fd __P((DB *, int *));
-int __dbcl_db_feedback __P((DB *, void (*)(DB *, int, int)));
-int __dbcl_db_flags __P((DB *, u_int32_t));
-int __dbcl_db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-int __dbcl_db_h_ffactor __P((DB *, u_int32_t));
-int __dbcl_db_h_hash __P((DB *, u_int32_t(*)(DB *, const void *, u_int32_t)));
-int __dbcl_db_h_nelem __P((DB *, u_int32_t));
-int __dbcl_db_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
-int __dbcl_db_lorder __P((DB *, int));
-int __dbcl_db_open __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
-int __dbcl_db_pagesize __P((DB *, u_int32_t));
-int __dbcl_db_panic __P((DB *, void (*)(DB_ENV *, int)));
-int __dbcl_db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
-int __dbcl_db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-int __dbcl_db_re_delim __P((DB *, int));
-int __dbcl_db_re_len __P((DB *, u_int32_t));
-int __dbcl_db_re_pad __P((DB *, int));
-int __dbcl_db_re_source __P((DB *, const char *));
-int __dbcl_db_remove __P((DB *, const char *, const char *, u_int32_t));
-int __dbcl_db_rename __P((DB *, const char *, const char *, const char *, u_int32_t));
-int __dbcl_db_stat __P((DB *, void *, u_int32_t));
-int __dbcl_db_sync __P((DB *, u_int32_t));
-int __dbcl_db_truncate __P((DB *, DB_TXN *, u_int32_t  *, u_int32_t));
-int __dbcl_db_upgrade __P((DB *, const char *, u_int32_t));
-int __dbcl_db_verify __P((DB *, const char *, const char *, FILE *, u_int32_t));
-int __dbcl_db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
-int __dbcl_db_join __P((DB *, DBC **, DBC **, u_int32_t));
-int __dbcl_dbc_close __P((DBC *));
-int __dbcl_dbc_count __P((DBC *, db_recno_t *, u_int32_t));
-int __dbcl_dbc_del __P((DBC *, u_int32_t));
-int __dbcl_dbc_dup __P((DBC *, DBC **, u_int32_t));
-int __dbcl_dbc_get __P((DBC *, DBT *, DBT *, u_int32_t));
-int __dbcl_dbc_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
-int __dbcl_dbc_put __P((DBC *, DBT *, DBT *, u_int32_t));
-int __dbcl_lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, int *));
-int __dbcl_lock_get __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
-int __dbcl_lock_id __P((DB_ENV *, u_int32_t *));
-int __dbcl_lock_id_free __P((DB_ENV *, u_int32_t));
-int __dbcl_lock_put __P((DB_ENV *, DB_LOCK *));
-int __dbcl_lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
-int __dbcl_lock_vec __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
-int __dbcl_log_archive __P((DB_ENV *, char ***, u_int32_t));
-int __dbcl_log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
-int __dbcl_log_file __P((DB_ENV *, const DB_LSN *, char *, size_t));
-int __dbcl_log_flush __P((DB_ENV *, const DB_LSN *));
-int __dbcl_log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
-int __dbcl_log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
-int __dbcl_memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
-int __dbcl_memp_register __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t, void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
-int __dbcl_memp_stat __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
-int __dbcl_memp_sync __P((DB_ENV *, DB_LSN *));
-int __dbcl_memp_trickle __P((DB_ENV *, int, int *));
-int __dbcl_env_close_ret __P((DB_ENV *, u_int32_t, __env_close_reply *));
-int __dbcl_env_create_ret __P((DB_ENV *, long, __env_create_reply *));
-int __dbcl_env_open_ret __P((DB_ENV *, const char *, u_int32_t, int, __env_open_reply *));
-int __dbcl_env_remove_ret __P((DB_ENV *, const char *, u_int32_t, __env_remove_reply *));
-int __dbcl_txn_abort_ret __P((DB_TXN *, __txn_abort_reply *));
-int __dbcl_txn_begin_ret __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t, __txn_begin_reply *));
-int __dbcl_txn_commit_ret __P((DB_TXN *, u_int32_t, __txn_commit_reply *));
-int __dbcl_txn_discard_ret __P((DB_TXN *, u_int32_t, __txn_discard_reply *));
-int __dbcl_txn_recover_ret __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t, __txn_recover_reply *));
-int __dbcl_db_close_ret __P((DB *, u_int32_t, __db_close_reply *));
-int __dbcl_db_create_ret __P((DB *, DB_ENV *, u_int32_t, __db_create_reply *));
-int __dbcl_db_get_ret __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t, __db_get_reply *));
-int __dbcl_db_key_range_ret __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t, __db_key_range_reply *));
-int __dbcl_db_open_ret __P((DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int, __db_open_reply *));
-int __dbcl_db_pget_ret __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t, __db_pget_reply *));
-int __dbcl_db_put_ret __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t, __db_put_reply *));
-int __dbcl_db_remove_ret __P((DB *, const char *, const char *, u_int32_t, __db_remove_reply *));
-int __dbcl_db_rename_ret __P((DB *, const char *, const char *, const char *, u_int32_t, __db_rename_reply *));
-int __dbcl_db_stat_ret __P((DB *, void *, u_int32_t, __db_stat_reply *));
-int __dbcl_db_truncate_ret __P((DB *, DB_TXN *, u_int32_t  *, u_int32_t, __db_truncate_reply *));
-int __dbcl_db_cursor_ret __P((DB *, DB_TXN *, DBC **, u_int32_t, __db_cursor_reply *));
-int __dbcl_db_join_ret __P((DB *, DBC **, DBC **, u_int32_t, __db_join_reply *));
-int __dbcl_dbc_close_ret __P((DBC *, __dbc_close_reply *));
-int __dbcl_dbc_count_ret __P((DBC *, db_recno_t *, u_int32_t, __dbc_count_reply *));
-int __dbcl_dbc_dup_ret __P((DBC *, DBC **, u_int32_t, __dbc_dup_reply *));
-int __dbcl_dbc_get_ret __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_get_reply *));
-int __dbcl_dbc_pget_ret __P((DBC *, DBT *, DBT *, DBT *, u_int32_t, __dbc_pget_reply *));
-int __dbcl_dbc_put_ret __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_put_reply *));
+gint __dbcl_c_setup __P((long, DB *, DBC **));
+gint __dbcl_dbclose_common __P((DB *));
+gint __dbcl_env_alloc __P((DB_ENV *, gpointer (*)(size_t), gpointer (*)(gpointer , size_t), void (*)(gpointer)));
+gint __dbcl_set_app_dispatch __P((DB_ENV *, gint (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
+gint __dbcl_env_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
+gint __dbcl_env_close __P((DB_ENV *, u_int32_t));
+gint __dbcl_env_create __P((DB_ENV *, long));
+gint __dbcl_set_data_dir __P((DB_ENV *, const gchar *));
+gint __dbcl_env_dbremove __P((DB_ENV *, DB_TXN *, const gchar *, const gchar *, u_int32_t));
+gint __dbcl_env_dbrename __P((DB_ENV *, DB_TXN *, const gchar *, const gchar *, const gchar *, u_int32_t));
+gint __dbcl_env_encrypt __P((DB_ENV *, const gchar *, u_int32_t));
+gint __dbcl_env_set_feedback __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
+gint __dbcl_env_flags __P((DB_ENV *, u_int32_t, int));
+gint __dbcl_set_lg_bsize __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_lg_dir __P((DB_ENV *, const gchar *));
+gint __dbcl_set_lg_max __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_lg_regionmax __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_lk_conflict __P((DB_ENV *, u_int8_t *, int));
+gint __dbcl_set_lk_detect __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_lk_max __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_lk_max_locks __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_lk_max_lockers __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_lk_max_objects __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_mp_mmapsize __P((DB_ENV *, size_t));
+gint __dbcl_env_open __P((DB_ENV *, const gchar *, u_int32_t, int));
+gint __dbcl_env_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
+gint __dbcl_env_remove __P((DB_ENV *, const gchar *, u_int32_t));
+gint __dbcl_set_shm_key __P((DB_ENV *, long));
+gint __dbcl_set_tas_spins __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_timeout __P((DB_ENV *, u_int32_t, u_int32_t));
+gint __dbcl_set_tmp_dir __P((DB_ENV *, const gchar *));
+gint __dbcl_set_tx_max __P((DB_ENV *, u_int32_t));
+gint __dbcl_set_tx_timestamp __P((DB_ENV *, time_t *));
+gint __dbcl_set_verbose __P((DB_ENV *, u_int32_t, int));
+gint __dbcl_txn_abort __P((DB_TXN *));
+gint __dbcl_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+gint __dbcl_txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
+gint __dbcl_txn_commit __P((DB_TXN *, u_int32_t));
+gint __dbcl_txn_discard __P((DB_TXN *, u_int32_t));
+gint __dbcl_txn_prepare __P((DB_TXN *, u_int8_t *));
+gint __dbcl_txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
+gint __dbcl_txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
+gint __dbcl_txn_timeout __P((DB_TXN *, u_int32_t, u_int32_t));
+gint __dbcl_rep_elect __P((DB_ENV *, int, int, u_int32_t, gint *));
+gint __dbcl_rep_flush __P((DB_ENV *));
+gint __dbcl_rep_process_message __P((DB_ENV *, DBT *, DBT *, gint *));
+gint __dbcl_rep_set_limit __P((DB_ENV *, u_int32_t, u_int32_t));
+gint __dbcl_rep_set_request __P((DB_ENV *, u_int32_t, u_int32_t));
+gint __dbcl_rep_set_rep_transport __P((DB_ENV *, int, gint (*)(DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
+gint __dbcl_rep_start __P((DB_ENV *, DBT *, u_int32_t));
+gint __dbcl_rep_stat __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
+gint __dbcl_db_alloc __P((DB *, gpointer (*)(size_t), gpointer (*)(gpointer , size_t), void (*)(gpointer)));
+gint __dbcl_db_associate __P((DB *, DB_TXN *, DB *, gint (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
+gint __dbcl_db_bt_compare __P((DB *, gint (*)(DB *, const DBT *, const DBT *)));
+gint __dbcl_db_bt_maxkey __P((DB *, u_int32_t));
+gint __dbcl_db_bt_minkey __P((DB *, u_int32_t));
+gint __dbcl_db_bt_prefix __P((DB *, size_t(*)(DB *, const DBT *, const DBT *)));
+gint __dbcl_db_set_append_recno __P((DB *, gint (*)(DB *, DBT *, db_recno_t)));
+gint __dbcl_db_cache_priority __P((DB *, DB_CACHE_PRIORITY));
+gint __dbcl_db_cachesize __P((DB *, u_int32_t, u_int32_t, int));
+gint __dbcl_db_close __P((DB *, u_int32_t));
+gint __dbcl_db_create __P((DB *, DB_ENV *, u_int32_t));
+gint __dbcl_db_del __P((DB *, DB_TXN *, DBT *, u_int32_t));
+gint __dbcl_db_dup_compare __P((DB *, gint (*)(DB *, const DBT *, const DBT *)));
+gint __dbcl_db_encrypt __P((DB *, const gchar *, u_int32_t));
+gint __dbcl_db_extentsize __P((DB *, u_int32_t));
+gint __dbcl_db_fd __P((DB *, gint *));
+gint __dbcl_db_feedback __P((DB *, void (*)(DB *, int, int)));
+gint __dbcl_db_flags __P((DB *, u_int32_t));
+gint __dbcl_db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+gint __dbcl_db_h_ffactor __P((DB *, u_int32_t));
+gint __dbcl_db_h_hash __P((DB *, u_int32_t(*)(DB *, gconstpointer , u_int32_t)));
+gint __dbcl_db_h_nelem __P((DB *, u_int32_t));
+gint __dbcl_db_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
+gint __dbcl_db_lorder __P((DB *, int));
+gint __dbcl_db_open __P((DB *, DB_TXN *, const gchar *, const gchar *, DBTYPE, u_int32_t, int));
+gint __dbcl_db_pagesize __P((DB *, u_int32_t));
+gint __dbcl_db_panic __P((DB *, void (*)(DB_ENV *, int)));
+gint __dbcl_db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
+gint __dbcl_db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+gint __dbcl_db_re_delim __P((DB *, int));
+gint __dbcl_db_re_len __P((DB *, u_int32_t));
+gint __dbcl_db_re_pad __P((DB *, int));
+gint __dbcl_db_re_source __P((DB *, const gchar *));
+gint __dbcl_db_remove __P((DB *, const gchar *, const gchar *, u_int32_t));
+gint __dbcl_db_rename __P((DB *, const gchar *, const gchar *, const gchar *, u_int32_t));
+gint __dbcl_db_stat __P((DB *, gpointer , u_int32_t));
+gint __dbcl_db_sync __P((DB *, u_int32_t));
+gint __dbcl_db_truncate __P((DB *, DB_TXN *, u_int32_t  *, u_int32_t));
+gint __dbcl_db_upgrade __P((DB *, const gchar *, u_int32_t));
+gint __dbcl_db_verify __P((DB *, const gchar *, const gchar *, FILE *, u_int32_t));
+gint __dbcl_db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
+gint __dbcl_db_join __P((DB *, DBC **, DBC **, u_int32_t));
+gint __dbcl_dbc_close __P((DBC *));
+gint __dbcl_dbc_count __P((DBC *, db_recno_t *, u_int32_t));
+gint __dbcl_dbc_del __P((DBC *, u_int32_t));
+gint __dbcl_dbc_dup __P((DBC *, DBC **, u_int32_t));
+gint __dbcl_dbc_get __P((DBC *, DBT *, DBT *, u_int32_t));
+gint __dbcl_dbc_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
+gint __dbcl_dbc_put __P((DBC *, DBT *, DBT *, u_int32_t));
+gint __dbcl_lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, gint *));
+gint __dbcl_lock_get __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
+gint __dbcl_lock_id __P((DB_ENV *, u_int32_t *));
+gint __dbcl_lock_id_free __P((DB_ENV *, u_int32_t));
+gint __dbcl_lock_put __P((DB_ENV *, DB_LOCK *));
+gint __dbcl_lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
+gint __dbcl_lock_vec __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
+gint __dbcl_log_archive __P((DB_ENV *, gchar ***, u_int32_t));
+gint __dbcl_log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
+gint __dbcl_log_file __P((DB_ENV *, const DB_LSN *, gchar *, size_t));
+gint __dbcl_log_flush __P((DB_ENV *, const DB_LSN *));
+gint __dbcl_log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
+gint __dbcl_log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
+gint __dbcl_memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
+gint __dbcl_memp_register __P((DB_ENV *, int, gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *), gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *)));
+gint __dbcl_memp_stat __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
+gint __dbcl_memp_sync __P((DB_ENV *, DB_LSN *));
+gint __dbcl_memp_trickle __P((DB_ENV *, int, gint *));
+gint __dbcl_env_close_ret __P((DB_ENV *, u_int32_t, __env_close_reply *));
+gint __dbcl_env_create_ret __P((DB_ENV *, long, __env_create_reply *));
+gint __dbcl_env_open_ret __P((DB_ENV *, const gchar *, u_int32_t, int, __env_open_reply *));
+gint __dbcl_env_remove_ret __P((DB_ENV *, const gchar *, u_int32_t, __env_remove_reply *));
+gint __dbcl_txn_abort_ret __P((DB_TXN *, __txn_abort_reply *));
+gint __dbcl_txn_begin_ret __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t, __txn_begin_reply *));
+gint __dbcl_txn_commit_ret __P((DB_TXN *, u_int32_t, __txn_commit_reply *));
+gint __dbcl_txn_discard_ret __P((DB_TXN *, u_int32_t, __txn_discard_reply *));
+gint __dbcl_txn_recover_ret __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t, __txn_recover_reply *));
+gint __dbcl_db_close_ret __P((DB *, u_int32_t, __db_close_reply *));
+gint __dbcl_db_create_ret __P((DB *, DB_ENV *, u_int32_t, __db_create_reply *));
+gint __dbcl_db_get_ret __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t, __db_get_reply *));
+gint __dbcl_db_key_range_ret __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t, __db_key_range_reply *));
+gint __dbcl_db_open_ret __P((DB *, DB_TXN *, const gchar *, const gchar *, DBTYPE, u_int32_t, int, __db_open_reply *));
+gint __dbcl_db_pget_ret __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t, __db_pget_reply *));
+gint __dbcl_db_put_ret __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t, __db_put_reply *));
+gint __dbcl_db_remove_ret __P((DB *, const gchar *, const gchar *, u_int32_t, __db_remove_reply *));
+gint __dbcl_db_rename_ret __P((DB *, const gchar *, const gchar *, const gchar *, u_int32_t, __db_rename_reply *));
+gint __dbcl_db_stat_ret __P((DB *, gpointer , u_int32_t, __db_stat_reply *));
+gint __dbcl_db_truncate_ret __P((DB *, DB_TXN *, u_int32_t  *, u_int32_t, __db_truncate_reply *));
+gint __dbcl_db_cursor_ret __P((DB *, DB_TXN *, DBC **, u_int32_t, __db_cursor_reply *));
+gint __dbcl_db_join_ret __P((DB *, DBC **, DBC **, u_int32_t, __db_join_reply *));
+gint __dbcl_dbc_close_ret __P((DBC *, __dbc_close_reply *));
+gint __dbcl_dbc_count_ret __P((DBC *, db_recno_t *, u_int32_t, __dbc_count_reply *));
+gint __dbcl_dbc_dup_ret __P((DBC *, DBC **, u_int32_t, __dbc_dup_reply *));
+gint __dbcl_dbc_get_ret __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_get_reply *));
+gint __dbcl_dbc_pget_ret __P((DBC *, DBT *, DBT *, DBT *, u_int32_t, __dbc_pget_reply *));
+gint __dbcl_dbc_put_ret __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_put_reply *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/rpc_server_ext.h b/libdb/dbinc_auto/rpc_server_ext.h
index c0c7068..74b029c 100644
--- a/libdb/dbinc_auto/rpc_server_ext.h
+++ b/libdb/dbinc_auto/rpc_server_ext.h
@@ -9,42 +9,42 @@ extern "C" {
 void __env_cachesize_proc __P((long, u_int32_t, u_int32_t, u_int32_t, __env_cachesize_reply *));
 void __env_close_proc __P((long, u_int32_t, __env_close_reply *));
 void __env_create_proc __P((u_int32_t, __env_create_reply *));
-void __env_dbremove_proc __P((long, long, char *, char *, u_int32_t, __env_dbremove_reply *));
-void __env_dbrename_proc __P((long, long, char *, char *, char *, u_int32_t, __env_dbrename_reply *));
-void __env_encrypt_proc __P((long, char *, u_int32_t, __env_encrypt_reply *));
+void __env_dbremove_proc __P((long, long, gchar *, gchar *, u_int32_t, __env_dbremove_reply *));
+void __env_dbrename_proc __P((long, long, gchar *, gchar *, gchar *, u_int32_t, __env_dbrename_reply *));
+void __env_encrypt_proc __P((long, gchar *, u_int32_t, __env_encrypt_reply *));
 void __env_flags_proc __P((long, u_int32_t, u_int32_t, __env_flags_reply *));
-void __env_open_proc __P((long, char *, u_int32_t, u_int32_t, __env_open_reply *));
-void __env_remove_proc __P((long, char *, u_int32_t, __env_remove_reply *));
+void __env_open_proc __P((long, gchar *, u_int32_t, u_int32_t, __env_open_reply *));
+void __env_remove_proc __P((long, gchar *, u_int32_t, __env_remove_reply *));
 void __txn_abort_proc __P((long, __txn_abort_reply *));
 void __txn_begin_proc __P((long, long, u_int32_t, __txn_begin_reply *));
 void __txn_commit_proc __P((long, u_int32_t, __txn_commit_reply *));
 void __txn_discard_proc __P((long, u_int32_t, __txn_discard_reply *));
 void __txn_prepare_proc __P((long, u_int8_t *, __txn_prepare_reply *));
-void __txn_recover_proc __P((long, u_int32_t, u_int32_t, __txn_recover_reply *, int *));
+void __txn_recover_proc __P((long, u_int32_t, u_int32_t, __txn_recover_reply *, gint *));
 void __db_bt_maxkey_proc __P((long, u_int32_t, __db_bt_maxkey_reply *));
 void __db_associate_proc __P((long, long, long, u_int32_t, __db_associate_reply *));
 void __db_bt_minkey_proc __P((long, u_int32_t, __db_bt_minkey_reply *));
 void __db_close_proc __P((long, u_int32_t, __db_close_reply *));
 void __db_create_proc __P((long, u_int32_t, __db_create_reply *));
-void __db_del_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_del_reply *));
-void __db_encrypt_proc __P((long, char *, u_int32_t, __db_encrypt_reply *));
+void __db_del_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __db_del_reply *));
+void __db_encrypt_proc __P((long, gchar *, u_int32_t, __db_encrypt_reply *));
 void __db_extentsize_proc __P((long, u_int32_t, __db_extentsize_reply *));
 void __db_flags_proc __P((long, u_int32_t, __db_flags_reply *));
-void __db_get_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_get_reply *, int *));
+void __db_get_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __db_get_reply *, gint *));
 void __db_h_ffactor_proc __P((long, u_int32_t, __db_h_ffactor_reply *));
 void __db_h_nelem_proc __P((long, u_int32_t, __db_h_nelem_reply *));
-void __db_key_range_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_key_range_reply *));
+void __db_key_range_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __db_key_range_reply *));
 void __db_lorder_proc __P((long, u_int32_t, __db_lorder_reply *));
-void __db_open_proc __P((long, long, char *, char *, u_int32_t, u_int32_t, u_int32_t, __db_open_reply *));
+void __db_open_proc __P((long, long, gchar *, gchar *, u_int32_t, u_int32_t, u_int32_t, __db_open_reply *));
 void __db_pagesize_proc __P((long, u_int32_t, __db_pagesize_reply *));
-void __db_pget_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_pget_reply *, int *));
-void __db_put_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_put_reply *, int *));
+void __db_pget_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __db_pget_reply *, gint *));
+void __db_put_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __db_put_reply *, gint *));
 void __db_re_delim_proc __P((long, u_int32_t, __db_re_delim_reply *));
 void __db_re_len_proc __P((long, u_int32_t, __db_re_len_reply *));
 void __db_re_pad_proc __P((long, u_int32_t, __db_re_pad_reply *));
-void __db_remove_proc __P((long, char *, char *, u_int32_t, __db_remove_reply *));
-void __db_rename_proc __P((long, char *, char *, char *, u_int32_t, __db_rename_reply *));
-void __db_stat_proc __P((long, u_int32_t, __db_stat_reply *, int *));
+void __db_remove_proc __P((long, gchar *, gchar *, u_int32_t, __db_remove_reply *));
+void __db_rename_proc __P((long, gchar *, gchar *, gchar *, u_int32_t, __db_rename_reply *));
+void __db_stat_proc __P((long, u_int32_t, __db_stat_reply *, gint *));
 void __db_sync_proc __P((long, u_int32_t, __db_sync_reply *));
 void __db_truncate_proc __P((long, long, u_int32_t, __db_truncate_reply *));
 void __db_cursor_proc __P((long, long, u_int32_t, __db_cursor_reply *));
@@ -53,22 +53,22 @@ void __dbc_close_proc __P((long, __dbc_close_reply *));
 void __dbc_count_proc __P((long, u_int32_t, __dbc_count_reply *));
 void __dbc_del_proc __P((long, u_int32_t, __dbc_del_reply *));
 void __dbc_dup_proc __P((long, u_int32_t, __dbc_dup_reply *));
-void __dbc_get_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_get_reply *, int *));
-void __dbc_pget_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_pget_reply *, int *));
-void __dbc_put_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __dbc_put_reply *, int *));
+void __dbc_get_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __dbc_get_reply *, gint *));
+void __dbc_pget_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __dbc_pget_reply *, gint *));
+void __dbc_put_proc __P((long, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __dbc_put_reply *, gint *));
 void __dbsrv_settimeout __P((ct_entry *, u_int32_t));
 void __dbsrv_timeout __P((int));
 void __dbclear_ctp __P((ct_entry *));
 void __dbdel_ctp __P((ct_entry *));
-ct_entry *new_ct_ent __P((int *));
+ct_entry *new_ct_ent __P((gint *));
 ct_entry *get_tableent __P((long));
-ct_entry *__dbsrv_sharedb __P((ct_entry *, const char *, const char *, DBTYPE, u_int32_t));
+ct_entry *__dbsrv_sharedb __P((ct_entry *, const gchar *, const gchar *, DBTYPE, u_int32_t));
 ct_entry *__dbsrv_shareenv __P((ct_entry *, home_entry *, u_int32_t));
 void __dbsrv_active __P((ct_entry *));
-int __db_close_int __P((long, u_int32_t));
-int __dbc_close_int __P((ct_entry *));
-int __dbenv_close_int __P((long, u_int32_t, int));
-home_entry *get_home __P((char *));
+gint __db_close_int __P((long, u_int32_t));
+gint __dbc_close_int __P((ct_entry *));
+gint __dbenv_close_int __P((long, u_int32_t, int));
+home_entry *get_home __P((gchar *));
 __env_cachesize_reply *__db_env_cachesize_4001  __P((__env_cachesize_msg *, struct svc_req *));
 __env_close_reply *__db_env_close_4001 __P((__env_close_msg *, struct svc_req *));
 __env_create_reply *__db_env_create_4001 __P((__env_create_msg *, struct svc_req *));
diff --git a/libdb/dbinc_auto/tcl_ext.h b/libdb/dbinc_auto/tcl_ext.h
index 619ea4a..5f17c0c 100644
--- a/libdb/dbinc_auto/tcl_ext.h
+++ b/libdb/dbinc_auto/tcl_ext.h
@@ -6,75 +6,75 @@
 extern "C" {
 #endif
 
-int bdb_HCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
+gint bdb_HCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
 #if DB_DBM_HSEARCH != 0
-int bdb_NdbmOpen __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBM **));
+gint bdb_NdbmOpen __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBM **));
 #endif
 #if DB_DBM_HSEARCH != 0
-int bdb_DbmCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*, int, DBM *));
+gint bdb_DbmCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*, int, DBM *));
 #endif
-int ndbm_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+gint ndbm_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
 void _DbInfoDelete __P((Tcl_Interp *, DBTCL_INFO *));
-int db_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
-int dbc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
-int env_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
-int tcl_EnvRemove __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
-int tcl_EnvVerbose __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *, Tcl_Obj *));
-int tcl_EnvAttr __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_EnvTest __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-DBTCL_INFO *_NewInfo __P((Tcl_Interp *, void *, char *, enum INFOTYPE));
-void *_NameToPtr __P((CONST char *));
-DBTCL_INFO *_PtrToInfo __P((CONST void *));
-DBTCL_INFO *_NameToInfo __P((CONST char *));
-void  _SetInfoData __P((DBTCL_INFO *, void *));
+gint db_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+gint dbc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+gint env_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+gint tcl_EnvRemove __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
+gint tcl_EnvVerbose __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *, Tcl_Obj *));
+gint tcl_EnvAttr __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_EnvTest __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+DBTCL_INFO *_NewInfo __P((Tcl_Interp *, gpointer , gchar *, enum INFOTYPE));
+gpointer _NameToPtr __P((CONST gchar *));
+DBTCL_INFO *_PtrToInfo __P((CONST gpointer ));
+DBTCL_INFO *_NameToInfo __P((CONST gchar *));
+void  _SetInfoData __P((DBTCL_INFO *, gpointer ));
 void  _DeleteInfo __P((DBTCL_INFO *));
-int _SetListElem __P((Tcl_Interp *, Tcl_Obj *, void *, int, void *, int));
-int _SetListElemInt __P((Tcl_Interp *, Tcl_Obj *, void *, int));
-int _SetListRecnoElem __P((Tcl_Interp *, Tcl_Obj *, db_recno_t, u_char *, int));
-int _Set3DBTList __P((Tcl_Interp *, Tcl_Obj *, DBT *, int, DBT *, int, DBT *));
-int _SetMultiList __P((Tcl_Interp *, Tcl_Obj *, DBT *, DBT*, int, int));
-int _GetGlobPrefix __P((char *, char **));
-int _ReturnSetup __P((Tcl_Interp *, int, int, char *));
-int _ErrorSetup __P((Tcl_Interp *, int, char *));
-void _ErrorFunc __P((CONST char *, char *));
-int _GetLsn __P((Tcl_Interp *, Tcl_Obj *, DB_LSN *));
-int _GetUInt32 __P((Tcl_Interp *, Tcl_Obj *, u_int32_t *));
-Tcl_Obj *_GetFlagsList __P((Tcl_Interp *, u_int32_t, void (*)(u_int32_t, void *, void (*)(u_int32_t, const FN *, void *))));
+gint _SetListElem __P((Tcl_Interp *, Tcl_Obj *, gpointer , int, gpointer , int));
+gint _SetListElemInt __P((Tcl_Interp *, Tcl_Obj *, gpointer , int));
+gint _SetListRecnoElem __P((Tcl_Interp *, Tcl_Obj *, db_recno_t, u_char *, int));
+gint _Set3DBTList __P((Tcl_Interp *, Tcl_Obj *, DBT *, int, DBT *, int, DBT *));
+gint _SetMultiList __P((Tcl_Interp *, Tcl_Obj *, DBT *, DBT*, int, int));
+gint _GetGlobPrefix __P((gchar *, gchar **));
+gint _ReturnSetup __P((Tcl_Interp *, int, int, gchar *));
+gint _ErrorSetup __P((Tcl_Interp *, int, gchar *));
+void _ErrorFunc __P((CONST gchar *, gchar *));
+gint _GetLsn __P((Tcl_Interp *, Tcl_Obj *, DB_LSN *));
+gint _GetUInt32 __P((Tcl_Interp *, Tcl_Obj *, u_int32_t *));
+Tcl_Obj *_GetFlagsList __P((Tcl_Interp *, u_int32_t, void (*)(u_int32_t, gpointer , void (*)(u_int32_t, const FN *, gpointer ))));
 void _debug_check  __P((void));
-int _CopyObjBytes  __P((Tcl_Interp *, Tcl_Obj *obj, void **, u_int32_t *, int *));
-int tcl_LockDetect __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LockGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LockStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LockTimeout __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LockVec __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LogArchive __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LogCompare __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
-int tcl_LogFile __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LogFlush __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LogGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LogPut __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_LogStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int logc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+gint _CopyObjBytes  __P((Tcl_Interp *, Tcl_Obj *obj, gpointer *, u_int32_t *, gint *));
+gint tcl_LockDetect __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LockGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LockStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LockTimeout __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LockVec __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LogArchive __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LogCompare __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
+gint tcl_LogFile __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LogFlush __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LogGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LogPut __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_LogStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint logc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
 void _MpInfoDelete __P((Tcl_Interp *, DBTCL_INFO *));
-int tcl_MpSync __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_MpTrickle __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_Mp __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
-int tcl_MpStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_RepElect __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
-int tcl_RepFlush __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
-int tcl_RepLimit __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
-int tcl_RepRequest __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
-int tcl_RepStart __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
-int tcl_RepProcessMessage __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
-int tcl_RepStat __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+gint tcl_MpSync __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_MpTrickle __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_Mp __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
+gint tcl_MpStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_RepElect __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+gint tcl_RepFlush __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+gint tcl_RepLimit __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+gint tcl_RepRequest __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+gint tcl_RepStart __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+gint tcl_RepProcessMessage __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
+gint tcl_RepStat __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
 void _TxnInfoDelete __P((Tcl_Interp *, DBTCL_INFO *));
-int tcl_TxnCheckpoint __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_Txn __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
-int tcl_TxnStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_TxnTimeout __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-int tcl_TxnRecover __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
-int bdb_RandCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
-int tcl_Mutex __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
+gint tcl_TxnCheckpoint __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_Txn __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
+gint tcl_TxnStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_TxnTimeout __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+gint tcl_TxnRecover __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
+gint bdb_RandCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
+gint tcl_Mutex __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/txn_ext.h b/libdb/dbinc_auto/txn_ext.h
index a53338d..704d9e4 100644
--- a/libdb/dbinc_auto/txn_ext.h
+++ b/libdb/dbinc_auto/txn_ext.h
@@ -6,64 +6,64 @@
 extern "C" {
 #endif
 
-int __txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
-int __txn_xa_begin __P((DB_ENV *, DB_TXN *));
-int __txn_compensate_begin __P((DB_ENV *, DB_TXN **txnp));
-int __txn_commit __P((DB_TXN *, u_int32_t));
-int __txn_abort __P((DB_TXN *));
-int __txn_discard __P((DB_TXN *, u_int32_t flags));
-int __txn_prepare __P((DB_TXN *, u_int8_t *));
+gint __txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+gint __txn_xa_begin __P((DB_ENV *, DB_TXN *));
+gint __txn_compensate_begin __P((DB_ENV *, DB_TXN **txnp));
+gint __txn_commit __P((DB_TXN *, u_int32_t));
+gint __txn_abort __P((DB_TXN *));
+gint __txn_discard __P((DB_TXN *, u_int32_t flags));
+gint __txn_prepare __P((DB_TXN *, u_int8_t *));
 u_int32_t __txn_id __P((DB_TXN *));
-int __txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
-int __txn_getckp __P((DB_ENV *, DB_LSN *));
-int __txn_activekids __P((DB_ENV *, u_int32_t, DB_TXN *));
-int __txn_force_abort __P((DB_ENV *, u_int8_t *));
-int __txn_preclose __P((DB_ENV *));
-int __txn_reset __P((DB_ENV *));
+gint __txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
+gint __txn_getckp __P((DB_ENV *, DB_LSN *));
+gint __txn_activekids __P((DB_ENV *, u_int32_t, DB_TXN *));
+gint __txn_force_abort __P((DB_ENV *, u_int8_t *));
+gint __txn_preclose __P((DB_ENV *));
+gint __txn_reset __P((DB_ENV *));
 void __txn_updateckp __P((DB_ENV *, DB_LSN *));
-int __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t));
-int __txn_regop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_regop_read __P((DB_ENV *, void *, __txn_regop_args **));
-int __txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, DB_LSN *, int32_t));
-int __txn_ckp_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_ckp_read __P((DB_ENV *, void *, __txn_ckp_args **));
-int __txn_child_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, DB_LSN *));
-int __txn_child_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_child_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_child_read __P((DB_ENV *, void *, __txn_child_args **));
-int __txn_xa_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, int32_t, u_int32_t, u_int32_t, DB_LSN *));
-int __txn_xa_regop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_xa_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_xa_regop_read __P((DB_ENV *, void *, __txn_xa_regop_args **));
-int __txn_recycle_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, u_int32_t));
-int __txn_recycle_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_recycle_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_recycle_read __P((DB_ENV *, void *, __txn_recycle_args **));
-int __txn_init_print __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __txn_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
-int __txn_init_recover __P((DB_ENV *, int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), size_t *));
+gint __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t));
+gint __txn_regop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_regop_read __P((DB_ENV *, gpointer , __txn_regop_args **));
+gint __txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, DB_LSN *, int32_t));
+gint __txn_ckp_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_ckp_read __P((DB_ENV *, gpointer , __txn_ckp_args **));
+gint __txn_child_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, DB_LSN *));
+gint __txn_child_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_child_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_child_read __P((DB_ENV *, gpointer , __txn_child_args **));
+gint __txn_xa_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, int32_t, u_int32_t, u_int32_t, DB_LSN *));
+gint __txn_xa_regop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_xa_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_xa_regop_read __P((DB_ENV *, gpointer , __txn_xa_regop_args **));
+gint __txn_recycle_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, u_int32_t));
+gint __txn_recycle_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_recycle_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_recycle_read __P((DB_ENV *, gpointer , __txn_recycle_args **));
+gint __txn_init_print __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __txn_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
+gint __txn_init_recover __P((DB_ENV *, gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
 void __txn_dbenv_create __P((DB_ENV *));
-int __txn_regop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_xa_regop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_ckp_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_child_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int __txn_restore_txn __P((DB_ENV *, DB_LSN *, __txn_xa_regop_args *));
-int __txn_recycle_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+gint __txn_regop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_xa_regop_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_ckp_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_child_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint __txn_restore_txn __P((DB_ENV *, DB_LSN *, __txn_xa_regop_args *));
+gint __txn_recycle_recover __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 void __txn_continue __P((DB_ENV *, DB_TXN *, TXN_DETAIL *, size_t));
-int __txn_map_gid __P((DB_ENV *, u_int8_t *, TXN_DETAIL **, size_t *));
-int __txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
-int __txn_get_prepared __P((DB_ENV *, XID *, DB_PREPLIST *, long, long *, u_int32_t));
-int __txn_open __P((DB_ENV *));
-int __txn_dbenv_refresh __P((DB_ENV *));
+gint __txn_map_gid __P((DB_ENV *, u_int8_t *, TXN_DETAIL **, size_t *));
+gint __txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
+gint __txn_get_prepared __P((DB_ENV *, XID *, DB_PREPLIST *, long, long *, u_int32_t));
+gint __txn_open __P((DB_ENV *));
+gint __txn_dbenv_refresh __P((DB_ENV *));
 void __txn_region_destroy __P((DB_ENV *, REGINFO *));
-int __txn_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
-int __txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
-int __txn_remevent __P((DB_ENV *, DB_TXN *, const char *, u_int8_t*));
-int __txn_lockevent __P((DB_ENV *, DB_TXN *, DB *, DB_LOCK *, u_int32_t));
+gint __txn_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
+gint __txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
+gint __txn_remevent __P((DB_ENV *, DB_TXN *, const gchar *, u_int8_t*));
+gint __txn_lockevent __P((DB_ENV *, DB_TXN *, DB *, DB_LOCK *, u_int32_t));
 void __txn_remlock __P((DB_ENV *, DB_TXN *, DB_LOCK *, u_int32_t));
-int __txn_doevents __P((DB_ENV *, DB_TXN *, int, int));
+gint __txn_doevents __P((DB_ENV *, DB_TXN *, int, int));
 
 #if defined(__cplusplus)
 }
diff --git a/libdb/dbinc_auto/xa_ext.h b/libdb/dbinc_auto/xa_ext.h
index e4fc989..17d59a3 100644
--- a/libdb/dbinc_auto/xa_ext.h
+++ b/libdb/dbinc_auto/xa_ext.h
@@ -6,12 +6,12 @@
 extern "C" {
 #endif
 
-int __db_xa_create __P((DB *));
-int __db_rmid_to_env __P((int rmid, DB_ENV **envp));
-int __db_xid_to_txn __P((DB_ENV *, XID *, size_t *));
-int __db_map_rmid __P((int, DB_ENV *));
-int __db_unmap_rmid __P((int));
-int __db_map_xid __P((DB_ENV *, XID *, size_t));
+gint __db_xa_create __P((DB *));
+gint __db_rmid_to_env __P((gint rmid, DB_ENV **envp));
+gint __db_xid_to_txn __P((DB_ENV *, XID *, size_t *));
+gint __db_map_rmid __P((int, DB_ENV *));
+gint __db_unmap_rmid __P((int));
+gint __db_map_xid __P((DB_ENV *, XID *, size_t));
 void __db_unmap_xid __P((DB_ENV *, XID *, size_t));
 
 #if defined(__cplusplus)
diff --git a/libdb/dbm/dbm.c b/libdb/dbm/dbm.c
index 98ba086..d891f5d 100644
--- a/libdb/dbm/dbm.c
+++ b/libdb/dbm/dbm.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -70,7 +70,7 @@ static const char revid[] = "$Id$";
  * EXTERN: datum __db_ndbm_fetch __P((DBM *, datum));
  * EXTERN: datum __db_ndbm_firstkey __P((DBM *));
  * EXTERN: datum __db_ndbm_nextkey __P((DBM *));
- * EXTERN: DBM	*__db_ndbm_open __P((const char *, int, int));
+ * EXTERN: DBM	*__db_ndbm_open __P((const gchar *, int, int));
  * EXTERN: int	 __db_ndbm_pagfno __P((DBM *));
  * EXTERN: int	 __db_ndbm_rdonly __P((DBM *));
  * EXTERN: int	 __db_ndbm_store __P((DBM *, datum, datum, int));
@@ -81,7 +81,7 @@ static const char revid[] = "$Id$";
  * EXTERN: int	 __db_dbm_dirf __P((void));
  * EXTERN: datum __db_dbm_fetch __P((datum));
  * EXTERN: datum __db_dbm_firstkey __P((void));
- * EXTERN: int	 __db_dbm_init __P((char *));
+ * EXTERN: int	 __db_dbm_init __P((gchar *));
  * EXTERN: datum __db_dbm_nextkey __P((datum));
  * EXTERN: int	 __db_dbm_pagf __P((void));
  * EXTERN: int	 __db_dbm_store __P((datum, datum));
@@ -96,9 +96,9 @@ static DBM *__cur_db;
 
 static void __db_no_open __P((void));
 
-int
+gint
 __db_dbm_init(file)
-	char *file;
+	gchar *file;
 {
 	if (__cur_db != NULL)
 		(void)dbm_close(__cur_db);
@@ -110,7 +110,7 @@ __db_dbm_init(file)
 	return (-1);
 }
 
-int
+gint
 __db_dbm_close()
 {
 	if (__cur_db != NULL) {
@@ -166,7 +166,7 @@ __db_dbm_nextkey(key)
 	return (dbm_nextkey(__cur_db));
 }
 
-int
+gint
 __db_dbm_delete(key)
 	datum key;
 {
@@ -177,7 +177,7 @@ __db_dbm_delete(key)
 	return (dbm_delete(__cur_db, key));
 }
 
-int
+gint
 __db_dbm_store(key, dat)
 	datum key, dat;
 {
@@ -206,13 +206,13 @@ __db_no_open()
  */
 DBM *
 __db_ndbm_open(file, oflags, mode)
-	const char *file;
-	int oflags, mode;
+	const gchar *file;
+	gint oflags, mode;
 {
 	DB *dbp;
 	DBC *dbc;
-	int ret;
-	char path[MAXPATHLEN];
+	gint ret;
+	gchar path[MAXPATHLEN];
 
 	/*
 	 * !!!
@@ -286,7 +286,7 @@ __db_ndbm_fetch(dbm, key)
 	DBC *dbc;
 	DBT _key, _data;
 	datum data;
-	int ret;
+	gint ret;
 
 	dbc = (DBC *)dbm;
 
@@ -328,7 +328,7 @@ __db_ndbm_firstkey(dbm)
 	DBC *dbc;
 	DBT _key, _data;
 	datum key;
-	int ret;
+	gint ret;
 
 	dbc = (DBC *)dbm;
 
@@ -363,7 +363,7 @@ __db_ndbm_nextkey(dbm)
 	DBC *dbc;
 	DBT _key, _data;
 	datum key;
-	int ret;
+	gint ret;
 
 	dbc = (DBC *)dbm;
 
@@ -391,14 +391,14 @@ __db_ndbm_nextkey(dbm)
  *	 0 on success
  *	<0 failure
  */
-int
+gint
 __db_ndbm_delete(dbm, key)
 	DBM *dbm;
 	datum key;
 {
 	DBC *dbc;
 	DBT _key;
-	int ret;
+	gint ret;
 
 	dbc = (DBC *)dbm;
 
@@ -424,15 +424,15 @@ __db_ndbm_delete(dbm, key)
  *	<0 failure
  *	 1 if DBM_INSERT and entry exists
  */
-int
+gint
 __db_ndbm_store(dbm, key, data, flags)
 	DBM *dbm;
 	datum key, data;
-	int flags;
+	gint flags;
 {
 	DBC *dbc;
 	DBT _key, _data;
-	int ret;
+	gint ret;
 
 	dbc = (DBC *)dbm;
 
@@ -456,7 +456,7 @@ __db_ndbm_store(dbm, key, data, flags)
 	return (-1);
 }
 
-int
+gint
 __db_ndbm_error(dbm)
 	DBM *dbm;
 {
@@ -467,7 +467,7 @@ __db_ndbm_error(dbm)
 	return (F_ISSET(dbc->dbp, DB_AM_DBM_ERROR));
 }
 
-int
+gint
 __db_ndbm_clearerr(dbm)
 	DBM *dbm;
 {
@@ -484,7 +484,7 @@ __db_ndbm_clearerr(dbm)
  *	1 if read-only
  *	0 if not read-only
  */
-int
+gint
 __db_ndbm_rdonly(dbm)
 	DBM *dbm;
 {
@@ -501,19 +501,19 @@ __db_ndbm_rdonly(dbm)
  * the same one for both files.  Hopefully, the user is using it for locking
  * and picked one to use at random.
  */
-int
+gint
 __db_ndbm_dirfno(dbm)
 	DBM *dbm;
 {
 	return (dbm_pagfno(dbm));
 }
 
-int
+gint
 __db_ndbm_pagfno(dbm)
 	DBM *dbm;
 {
 	DBC *dbc;
-	int fd;
+	gint fd;
 
 	dbc = (DBC *)dbm;
 
diff --git a/libdb/dbreg/dbreg.c b/libdb/dbreg/dbreg.c
index 4346b61..5281cdb 100644
--- a/libdb/dbreg/dbreg.c
+++ b/libdb/dbreg/dbreg.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -85,20 +85,20 @@ static const char revid[] = "$Id$";
  * allocate a id for it later.  (This happens when the handle is on a
  * replication client that later becomes a master.)
  *
- * PUBLIC: int __dbreg_setup __P((DB *, const char *, u_int32_t));
+ * PUBLIC: gint __dbreg_setup __P((DB *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbreg_setup(dbp, name, create_txnid)
 	DB *dbp;
-	const char *name;
+	const gchar *name;
 	u_int32_t create_txnid;
 {
 	DB_ENV *dbenv;
 	DB_LOG *dblp;
 	FNAME *fnp;
-	int ret;
+	gint ret;
 	size_t len;
-	void *namep;
+	gpointer namep;
 
 	dbenv = dbp->dbenv;
 	dblp = dbenv->lg_handle;
@@ -147,9 +147,9 @@ __dbreg_setup(dbp, name, create_txnid)
  * __dbreg_teardown --
  *	Destroy a DB handle's FNAME struct.
  *
- * PUBLIC: int __dbreg_teardown __P((DB *));
+ * PUBLIC: gint __dbreg_teardown __P((DB *));
  */
-int
+gint
 __dbreg_teardown(dbp)
 	DB *dbp;
 {
@@ -186,9 +186,9 @@ __dbreg_teardown(dbp)
  * __dbreg_new_id --
  *	Assign an unused dbreg id to this database handle.
  *
- * PUBLIC: int __dbreg_new_id __P((DB *, DB_TXN *));
+ * PUBLIC: gint __dbreg_new_id __P((DB *, DB_TXN *));
  */
-int
+gint
 __dbreg_new_id(dbp, txn)
 	DB *dbp;
 	DB_TXN *txn;
@@ -200,7 +200,7 @@ __dbreg_new_id(dbp, txn)
 	FNAME *fnp;
 	LOG *lp;
 	int32_t id;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 	dblp = dbenv->lg_handle;
@@ -243,7 +243,7 @@ __dbreg_new_id(dbp, txn)
 	memset(&r_name, 0, sizeof(r_name));
 	if (fnp->name_off != INVALID_ROFF) {
 		r_name.data = R_ADDR(&dblp->reginfo, fnp->name_off);
-		r_name.size = (u_int32_t)strlen((char *)r_name.data) + 1;
+		r_name.size = (u_int32_t)strlen((gchar *)r_name.data) + 1;
 	}
 	fid_dbt.data = dbp->fileid;
 	fid_dbt.size = DB_FILE_ID_LEN;
@@ -266,9 +266,9 @@ err:	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
  * __dbreg_assign_id --
  *	Assign a particular dbreg id to this database handle.
  *
- * PUBLIC: int __dbreg_assign_id __P((DB *, int32_t));
+ * PUBLIC: gint __dbreg_assign_id __P((DB *, int32_t));
  */
-int
+gint
 __dbreg_assign_id(dbp, id)
 	DB *dbp;
 	int32_t id;
@@ -278,7 +278,7 @@ __dbreg_assign_id(dbp, id)
 	DB_LOG *dblp;
 	FNAME *close_fnp, *fnp;
 	LOG *lp;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 	dblp = dbenv->lg_handle;
@@ -352,19 +352,19 @@ err:	MUTEX_UNLOCK(dbenv, &lp->fq_mutex);
  *	Take a log id away from a dbp, in preparation for closing it,
  *	but without logging the close.
  *
- * PUBLIC: int __dbreg_revoke_id __P((DB *, int));
+ * PUBLIC: gint __dbreg_revoke_id __P((DB *, int));
  */
-int
+gint
 __dbreg_revoke_id(dbp, have_lock)
 	DB *dbp;
-	int have_lock;
+	gint have_lock;
 {
 	DB_ENV *dbenv;
 	DB_LOG *dblp;
 	FNAME *fnp;
 	LOG *lp;
 	int32_t id;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 	dblp = dbenv->lg_handle;
@@ -400,9 +400,9 @@ __dbreg_revoke_id(dbp, have_lock)
  *	Take a dbreg id away from a dbp that we're closing, and log
  * the unregistry.
  *
- * PUBLIC: int __dbreg_close_id __P((DB *, DB_TXN *));
+ * PUBLIC: gint __dbreg_close_id __P((DB *, DB_TXN *));
  */
-int
+gint
 __dbreg_close_id(dbp, txn)
 	DB *dbp;
 	DB_TXN *txn;
@@ -413,7 +413,7 @@ __dbreg_close_id(dbp, txn)
 	DB_LSN r_unused;
 	FNAME *fnp;
 	LOG *lp;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 	dblp = dbenv->lg_handle;
@@ -432,7 +432,7 @@ __dbreg_close_id(dbp, txn)
 		memset(&r_name, 0, sizeof(r_name));
 		r_name.data = R_ADDR(&dblp->reginfo, fnp->name_off);
 		r_name.size =
-		    (u_int32_t)strlen((char *)r_name.data) + 1;
+		    (u_int32_t)strlen((gchar *)r_name.data) + 1;
 		dbtp = &r_name;
 	}
 	memset(&fid_dbt, 0, sizeof(fid_dbt));
diff --git a/libdb/dbreg/dbreg_auto.c b/libdb/dbreg/dbreg_auto.c
index 91eace3..3577610 100644
--- a/libdb/dbreg/dbreg_auto.c
+++ b/libdb/dbreg/dbreg_auto.c
@@ -18,11 +18,11 @@
 #include "dbinc/txn.h"
 
 /*
- * PUBLIC: int __dbreg_register_log __P((DB_ENV *, DB_TXN *,
+ * PUBLIC: gint __dbreg_register_log __P((DB_ENV *, DB_TXN *,
  * PUBLIC:     DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *,
  * PUBLIC:     int32_t, DBTYPE, db_pgno_t, u_int32_t));
  */
-int
+gint
 __dbreg_register_log(dbenv, txnid, ret_lsnp, flags,
     opcode, name, uid, fileid, ftype, meta_pgno,
     id)
@@ -43,7 +43,7 @@ __dbreg_register_log(dbenv, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___dbreg_register;
@@ -151,19 +151,19 @@ __dbreg_register_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __dbreg_register_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __dbreg_register_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __dbreg_register_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -184,21 +184,21 @@ __dbreg_register_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __dbreg_register_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __dbreg_register_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __dbreg_register_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__dbreg_register_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -236,19 +236,19 @@ __dbreg_register_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __dbreg_register_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __dbreg_register_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __dbreg_register_args **));
  */
-int
+gint
 __dbreg_register_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__dbreg_register_args **argpp;
 {
 	__dbreg_register_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__dbreg_register_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -303,16 +303,16 @@ __dbreg_register_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __dbreg_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __dbreg_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __dbreg_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __dbreg_register_print, DB___dbreg_register)) != 0)
@@ -321,17 +321,17 @@ __dbreg_init_print(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __dbreg_init_getpgnos __P((DB_ENV *,
- * PUBLIC:     int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *),
+ * PUBLIC: gint __dbreg_init_getpgnos __P((DB_ENV *,
+ * PUBLIC:     gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ),
  * PUBLIC:     size_t *));
  */
-int
+gint
 __dbreg_init_getpgnos(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __dbreg_register_getpgnos, DB___dbreg_register)) != 0)
@@ -340,16 +340,16 @@ __dbreg_init_getpgnos(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __dbreg_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __dbreg_init_recover __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __dbreg_init_recover(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __dbreg_register_recover, DB___dbreg_register)) != 0)
diff --git a/libdb/dbreg/dbreg_rec.c b/libdb/dbreg/dbreg_rec.c
index 5f19a9e..968ae11 100644
--- a/libdb/dbreg/dbreg_rec.c
+++ b/libdb/dbreg/dbreg_rec.c
@@ -36,7 +36,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -51,26 +51,26 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/txn.h"
 
-static int __dbreg_open_file __P((DB_ENV *,
-    DB_TXN *, __dbreg_register_args *, void *));
+static gint __dbreg_open_file __P((DB_ENV *,
+    DB_TXN *, __dbreg_register_args *, gpointer ));
 
 /*
- * PUBLIC: int __dbreg_register_recover
- * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __dbreg_register_recover
+ * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __dbreg_register_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	DB_ENTRY *dbe;
 	DB_LOG *dblp;
 	DB *dbp;
 	__dbreg_register_args *argp;
-	int do_close, do_open, do_rem, ret, t_ret;
+	gint do_close, do_open, do_rem, ret, t_ret;
 
 	dblp = dbenv->lg_handle;
 	dbp = NULL;
@@ -274,7 +274,7 @@ __dbreg_open_file(dbenv, txn, argp, info)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	__dbreg_register_args *argp;
-	void *info;
+	gpointer info;
 {
 	DB_ENTRY *dbe;
 	DB_LOG *lp;
diff --git a/libdb/dbreg/dbreg_util.c b/libdb/dbreg/dbreg_util.c
index 810c3dd..904cc4b 100644
--- a/libdb/dbreg/dbreg_util.c
+++ b/libdb/dbreg/dbreg_util.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -22,15 +22,15 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/txn.h"
 
-static int __dbreg_check_master __P((DB_ENV *, u_int8_t *, char *));
+static gint __dbreg_check_master __P((DB_ENV *, u_int8_t *, gchar *));
 
 /*
  * __dbreg_add_dbentry --
  *	Adds a DB entry to the dbreg DB entry table.
  *
- * PUBLIC: int __dbreg_add_dbentry __P((DB_ENV *, DB_LOG *, DB *, int32_t));
+ * PUBLIC: gint __dbreg_add_dbentry __P((DB_ENV *, DB_LOG *, DB *, int32_t));
  */
-int
+gint
 __dbreg_add_dbentry(dbenv, dblp, dbp, ndx)
 	DB_ENV *dbenv;
 	DB_LOG *dblp;
@@ -38,7 +38,7 @@ __dbreg_add_dbentry(dbenv, dblp, dbp, ndx)
 	int32_t ndx;
 {
 	int32_t i;
-	int ret;
+	gint ret;
 
 	ret = 0;
 
@@ -92,9 +92,9 @@ __dbreg_rem_dbentry(dblp, ndx)
  * __dbreg_open_files --
  *	Put a LOG_CHECKPOINT log record for each open database.
  *
- * PUBLIC: int __dbreg_open_files __P((DB_ENV *));
+ * PUBLIC: gint __dbreg_open_files __P((DB_ENV *));
  */
-int
+gint
 __dbreg_open_files(dbenv)
 	DB_ENV *dbenv;
 {
@@ -103,7 +103,7 @@ __dbreg_open_files(dbenv)
 	DBT *dbtp, fid_dbt, t;
 	FNAME *fnp;
 	LOG *lp;
-	int ret;
+	gint ret;
 
 	dblp = dbenv->lg_handle;
 	lp = dblp->reginfo.primary;
@@ -155,15 +155,15 @@ __dbreg_open_files(dbenv)
  *	db_rename.  We may not have flushed the log_register record that
  *	closes the file.
  *
- * PUBLIC: int __dbreg_close_files __P((DB_ENV *));
+ * PUBLIC: gint __dbreg_close_files __P((DB_ENV *));
  */
-int
+gint
 __dbreg_close_files(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_LOG *dblp;
 	DB *dbp;
-	int ret, t_ret;
+	gint ret, t_ret;
 	int32_t i;
 
 	/* If we haven't initialized logging, we have nothing to do. */
@@ -206,15 +206,15 @@ __dbreg_close_files(dbenv)
  *	Check that there are no open files in the process local table.
  *	Returns 0 if there are no files and EINVAL if there are any.
  *
- * PUBLIC: int __dbreg_nofiles __P((DB_ENV *));
+ * PUBLIC: gint __dbreg_nofiles __P((DB_ENV *));
  */
-int
+gint
 __dbreg_nofiles(dbenv)
 	DB_ENV *dbenv;
 {
 	DB *dbp;
 	DB_LOG *dblp;
-	int ret;
+	gint ret;
 	int32_t i;
 
 	/* If we haven't initialized logging, we have nothing to do. */
@@ -239,15 +239,15 @@ __dbreg_nofiles(dbenv)
  * __dbreg_id_to_db --
  *	Return the DB corresponding to the specified dbreg id.
  *
- * PUBLIC: int __dbreg_id_to_db __P((DB_ENV *, DB_TXN *, DB **, int32_t, int));
+ * PUBLIC: gint __dbreg_id_to_db __P((DB_ENV *, DB_TXN *, DB **, int32_t, int));
  */
-int
+gint
 __dbreg_id_to_db(dbenv, txn, dbpp, ndx, inc)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	DB **dbpp;
 	int32_t ndx;
-	int inc;
+	gint inc;
 {
 	return (__dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, 1));
 }
@@ -262,21 +262,21 @@ __dbreg_id_to_db(dbenv, txn, dbpp, ndx, inc)
  * some processes may not have the files open (e.g., XA), then we also get
  * called from __dbreg_assign_id and it's OK if there is no mapping.
  *
- * PUBLIC: int __dbreg_id_to_db_int __P((DB_ENV *,
+ * PUBLIC: gint __dbreg_id_to_db_int __P((DB_ENV *,
  * PUBLIC:     DB_TXN *, DB **, int32_t, int, int));
  */
-int
+gint
 __dbreg_id_to_db_int(dbenv, txn, dbpp, ndx, inc, tryopen)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	DB **dbpp;
 	int32_t ndx;
-	int inc, tryopen;
+	gint inc, tryopen;
 {
 	DB_LOG *dblp;
 	FNAME *fname;
-	int ret;
-	char *name;
+	gint ret;
+	gchar *name;
 
 	ret = 0;
 	dblp = dbenv->lg_handle;
@@ -362,19 +362,19 @@ err:	MUTEX_THREAD_UNLOCK(dbenv, dblp->mutexp);
  *	Traverse the shared-memory region looking for the entry that
  *	matches the passed dbreg id.  Returns 0 on success; -1 on error.
  *
- * PUBLIC: int __dbreg_id_to_fname __P((DB_LOG *, int32_t, int, FNAME **));
+ * PUBLIC: gint __dbreg_id_to_fname __P((DB_LOG *, int32_t, int, FNAME **));
  */
-int
+gint
 __dbreg_id_to_fname(dblp, lid, have_lock, fnamep)
 	DB_LOG *dblp;
 	int32_t lid;
-	int have_lock;
+	gint have_lock;
 	FNAME **fnamep;
 {
 	DB_ENV *dbenv;
 	FNAME *fnp;
 	LOG *lp;
-	int ret;
+	gint ret;
 
 	dbenv = dblp->dbenv;
 	lp = dblp->reginfo.primary;
@@ -401,19 +401,19 @@ __dbreg_id_to_fname(dblp, lid, have_lock, fnamep)
  *	Traverse the shared-memory region looking for the entry that
  *	matches the passed file unique id.  Returns 0 on success; -1 on error.
  *
- * PUBLIC: int __dbreg_fid_to_fname __P((DB_LOG *, u_int8_t *, int, FNAME **));
+ * PUBLIC: gint __dbreg_fid_to_fname __P((DB_LOG *, u_int8_t *, int, FNAME **));
  */
-int
+gint
 __dbreg_fid_to_fname(dblp, fid, have_lock, fnamep)
 	DB_LOG *dblp;
 	u_int8_t *fid;
-	int have_lock;
+	gint have_lock;
 	FNAME **fnamep;
 {
 	DB_ENV *dbenv;
 	FNAME *fnp;
 	LOG *lp;
-	int ret;
+	gint ret;
 
 	dbenv = dblp->dbenv;
 	lp = dblp->reginfo.primary;
@@ -443,13 +443,13 @@ __dbreg_fid_to_fname(dblp, fid, have_lock, fnamep)
  * and the name passed could be transient unless there is something
  * ensuring that the file cannot be closed.
  *
- * PUBLIC: int __dbreg_get_name __P((DB_ENV *, u_int8_t *, char **));
+ * PUBLIC: gint __dbreg_get_name __P((DB_ENV *, u_int8_t *, gchar **));
  */
-int
+gint
 __dbreg_get_name(dbenv, fid, namep)
 	DB_ENV *dbenv;
 	u_int8_t *fid;
-	char **namep;
+	gchar **namep;
 {
 	DB_LOG *dblp;
 	FNAME *fname;
@@ -468,25 +468,25 @@ __dbreg_get_name(dbenv, fid, namep)
  * __dbreg_do_open --
  *	Open files referenced in the log.  This is the part of the open that
  * is not protected by the thread mutex.
- * PUBLIC: int __dbreg_do_open __P((DB_ENV *, DB_TXN *, DB_LOG *, u_int8_t *,
- * PUBLIC:     char *, DBTYPE, int32_t, db_pgno_t, void *, u_int32_t));
+ * PUBLIC: gint __dbreg_do_open __P((DB_ENV *, DB_TXN *, DB_LOG *, u_int8_t *,
+ * PUBLIC:     gchar *, DBTYPE, int32_t, db_pgno_t, gpointer , u_int32_t));
  */
-int
+gint
 __dbreg_do_open(dbenv,
     txn, lp, uid, name, ftype, ndx, meta_pgno, info, id)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	DB_LOG *lp;
 	u_int8_t *uid;
-	char *name;
+	gchar *name;
 	DBTYPE ftype;
 	int32_t ndx;
 	db_pgno_t meta_pgno;
-	void *info;
+	gpointer info;
 	u_int32_t id;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 	u_int32_t cstat;
 
 	if ((ret = db_create(&dbp, lp->dbenv, 0)) != 0)
@@ -565,10 +565,10 @@ static int
 __dbreg_check_master(dbenv, uid, name)
 	DB_ENV *dbenv;
 	u_int8_t *uid;
-	char *name;
+	gchar *name;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if ((ret = db_create(&dbp, dbenv, 0)) != 0)
@@ -597,15 +597,15 @@ __dbreg_check_master(dbenv, uid, name)
  * at this point we have no way of knowing whether the log record that incited
  * us to call this will be part of a committed transaction.
  *
- * PUBLIC: int __dbreg_lazy_id __P((DB *));
+ * PUBLIC: gint __dbreg_lazy_id __P((DB *));
  */
-int
+gint
 __dbreg_lazy_id(dbp)
 	DB *dbp;
 {
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -632,10 +632,10 @@ __dbreg_lazy_id(dbp)
  * The stack is protected by the fq_mutex, and in both functions we assume
  * that this is already locked.
  *
- * PUBLIC: int __dbreg_push_id __P((DB_ENV *, int32_t));
- * PUBLIC: int __dbreg_pop_id __P((DB_ENV *, int32_t *));
+ * PUBLIC: gint __dbreg_push_id __P((DB_ENV *, int32_t));
+ * PUBLIC: gint __dbreg_pop_id __P((DB_ENV *, int32_t *));
  */
-int
+gint
 __dbreg_push_id(dbenv, id)
 	DB_ENV *dbenv;
 	int32_t id;
@@ -643,7 +643,7 @@ __dbreg_push_id(dbenv, id)
 	DB_LOG *dblp;
 	LOG *lp;
 	int32_t *stack, *newstack;
-	int ret;
+	gint ret;
 
 	dblp = dbenv->lg_handle;
 	lp = dblp->reginfo.primary;
@@ -680,7 +680,7 @@ __dbreg_push_id(dbenv, id)
 	return (0);
 }
 
-int
+gint
 __dbreg_pop_id(dbenv, id)
 	DB_ENV *dbenv;
 	int32_t *id;
@@ -711,9 +711,9 @@ __dbreg_pop_id(dbenv, id)
  * Returns success whether or not the particular id was found, and like
  * push and pop, assumes that the fq_mutex is locked.
  *
- * PUBLIC: int __dbreg_pluck_id __P((DB_ENV *, int32_t));
+ * PUBLIC: gint __dbreg_pluck_id __P((DB_ENV *, int32_t));
  */
-int
+gint
 __dbreg_pluck_id(dbenv, id)
 	DB_ENV *dbenv;
 	int32_t id;
@@ -721,7 +721,7 @@ __dbreg_pluck_id(dbenv, id)
 	DB_LOG *dblp;
 	LOG *lp;
 	int32_t *stack;
-	int i;
+	gint i;
 
 	dblp = dbenv->lg_handle;
 	lp = dblp->reginfo.primary;
@@ -760,8 +760,8 @@ __dbreg_print_dblist(dbenv)
 	DB_LOG *dblp;
 	FNAME *fnp;
 	LOG *lp;
-	int del, first;
-	char *name;
+	gint del, first;
+	gchar *name;
 
 	dblp = dbenv->lg_handle;
 	lp = dblp->reginfo.primary;
diff --git a/libdb/env/db_salloc.c b/libdb/env/db_salloc.c
index 32499d7..91712da 100644
--- a/libdb/env/db_salloc.c
+++ b/libdb/env/db_salloc.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -40,11 +40,11 @@ struct __data {
  * __db_shalloc_init --
  *	Initialize the area as one large chunk.
  *
- * PUBLIC: void __db_shalloc_init __P((void *, size_t));
+ * PUBLIC: void __db_shalloc_init __P((gpointer , size_t));
  */
 void
 __db_shalloc_init(area, size)
-	void *area;
+	gpointer area;
 	size_t size;
 {
 	struct __data *elp;
@@ -62,9 +62,9 @@ __db_shalloc_init(area, size)
  * __db_shalloc_size --
  *	Return the space needed for an allocation, including alignment.
  *
- * PUBLIC: int __db_shalloc_size __P((size_t, size_t));
+ * PUBLIC: gint __db_shalloc_size __P((size_t, size_t));
  */
-int
+gint
 __db_shalloc_size(len, align)
 	size_t len, align;
 {
@@ -88,16 +88,16 @@ __db_shalloc_size(len, align)
  * __db_shalloc --
  *	Allocate some space from the shared region.
  *
- * PUBLIC: int __db_shalloc __P((void *, size_t, size_t, void *));
+ * PUBLIC: gint __db_shalloc __P((gpointer , size_t, size_t, gpointer ));
  */
-int
+gint
 __db_shalloc(p, len, align, retp)
-	void *p, *retp;
+	gpointer p, *retp;
 	size_t len, align;
 {
 	struct __data *elp;
 	size_t *sp;
-	void *rp;
+	gpointer rp;
 
 	/* Never allocate less than the size of a struct __data. */
 	if (len < sizeof(struct __data))
@@ -134,7 +134,7 @@ __db_shalloc(p, len, align, retp)
 		if ((u_int8_t *)rp < (u_int8_t *)&elp->links)
 			continue;
 
-		*(void **)retp = rp;
+		*(gpointer *)retp = rp;
 #ifdef DIAGNOSTIC
 		/*
 		 * At this point, whether or not we still need to split up a
@@ -182,16 +182,16 @@ __db_shalloc(p, len, align, retp)
  * __db_shalloc_free --
  *	Free a shared memory allocation.
  *
- * PUBLIC: void __db_shalloc_free __P((void *, void *));
+ * PUBLIC: void __db_shalloc_free __P((gpointer , gpointer ));
  */
 void
 __db_shalloc_free(regionp, ptr)
-	void *regionp, *ptr;
+	gpointer regionp, *ptr;
 {
 	struct __data *elp, *lastp, *newp;
 	struct __head *hp;
 	size_t free_size, *sp;
-	int merged;
+	gint merged;
 
 	/*
 	 * Step back over flagged length fields to find the beginning of
@@ -237,7 +237,7 @@ __db_shalloc_free(regionp, ptr)
 	 */
 	hp = (struct __head *)regionp;
 	for (elp = SH_LIST_FIRST(hp, __data), lastp = NULL;
-	    elp != NULL && (void *)elp < (void *)ptr;
+	    elp != NULL && (gpointer)elp < (gpointer)ptr;
 	    lastp = elp, elp = SH_LIST_NEXT(elp, links, __data))
 		;
 
@@ -292,11 +292,11 @@ __db_shalloc_free(regionp, ptr)
  * the size of the memory being used, but also the extra alignment bytes
  * in front and, #ifdef DIAGNOSTIC, the guard byte at the end.
  *
- * PUBLIC: size_t __db_shsizeof __P((void *));
+ * PUBLIC: size_t __db_shsizeof __P((gpointer));
  */
 size_t
 __db_shsizeof(ptr)
-	void *ptr;
+	gpointer ptr;
 {
 	struct __data *elp;
 	size_t *sp;
@@ -315,11 +315,11 @@ __db_shsizeof(ptr)
 /*
  * __db_shalloc_dump --
  *
- * PUBLIC: void __db_shalloc_dump __P((void *, FILE *));
+ * PUBLIC: void __db_shalloc_dump __P((gpointer , FILE *));
  */
 void
 __db_shalloc_dump(addr, fp)
-	void *addr;
+	gpointer addr;
 	FILE *fp;
 {
 	struct __data *elp;
diff --git a/libdb/env/db_shash.c b/libdb/env/db_shash.c
index 93f2b23..3330eb8 100644
--- a/libdb/env/db_shash.c
+++ b/libdb/env/db_shash.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -75,13 +75,13 @@ static const struct {
  * __db_tablesize --
  *	Choose a size for the hash table.
  *
- * PUBLIC: int __db_tablesize __P((u_int32_t));
+ * PUBLIC: gint __db_tablesize __P((u_int32_t));
  */
-int
+gint
 __db_tablesize(n_buckets)
 	u_int32_t n_buckets;
 {
-	int i;
+	gint i;
 
 	/*
 	 * We try to be clever about how big we make the hash tables.  Use a
@@ -108,11 +108,11 @@ __db_tablesize(n_buckets)
  * __db_hashinit --
  *	Initialize a hash table that resides in shared memory.
  *
- * PUBLIC: void __db_hashinit __P((void *, u_int32_t));
+ * PUBLIC: void __db_hashinit __P((gpointer , u_int32_t));
  */
 void
 __db_hashinit(begin, nelements)
-	void *begin;
+	gpointer begin;
 	u_int32_t nelements;
 {
 	u_int32_t i;
diff --git a/libdb/env/env_file.c b/libdb/env/env_file.c
index bc5a080..3c3528f 100644
--- a/libdb/env/env_file.c
+++ b/libdb/env/env_file.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -19,28 +19,28 @@ static const char revid[] = "$Id$";
 
 #include "db_int.h"
 
-static int __db_overwrite_pass __P((DB_ENV *,
-	       const char *, DB_FH *, u_int32_t, u_int32_t, u_int32_t));
+static gint __db_overwrite_pass __P((DB_ENV *,
+	       const gchar *, DB_FH *, u_int32_t, u_int32_t, u_int32_t));
 
 /*
  * __db_fileinit --
  *	Initialize a regular file, optionally zero-filling it as well.
  *
- * PUBLIC: int __db_fileinit __P((DB_ENV *, DB_FH *, size_t, int));
+ * PUBLIC: gint __db_fileinit __P((DB_ENV *, DB_FH *, size_t, int));
  */
-int
+gint
 __db_fileinit(dbenv, fhp, size, zerofill)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 	size_t size;
-	int zerofill;
+	gint zerofill;
 {
 	db_pgno_t pages;
 	size_t i;
 	size_t nw;
 	u_int32_t relative;
-	int ret;
-	char buf[OS_VMPAGESIZE];
+	gint ret;
+	gchar buf[OS_VMPAGESIZE];
 
 	/* Write nuls to the new bytes. */
 	memset(buf, 0, sizeof(buf));
@@ -91,16 +91,16 @@ __db_fileinit(dbenv, fhp, size, zerofill)
  * __db_overwrite  --
  *	Overwrite a file.
  *
- * PUBLIC: int __db_overwrite __P((DB_ENV *, const char *));
+ * PUBLIC: gint __db_overwrite __P((DB_ENV *, const gchar *));
  */
-int
+gint
 __db_overwrite(dbenv, path)
 	DB_ENV *dbenv;
-	const char *path;
+	const gchar *path;
 {
 	DB_FH fh, *fhp;
 	u_int32_t mbytes, bytes;
-	int ret;
+	gint ret;
 
 	fhp = &fh;
 	if ((ret = __os_open(dbenv, path, DB_OSO_REGION, 0, fhp)) == 0 &&
@@ -135,13 +135,13 @@ err:	if (F_ISSET(fhp, DB_FH_VALID))
 static int
 __db_overwrite_pass(dbenv, path, fhp, mbytes, bytes, pattern)
 	DB_ENV *dbenv;
-	const char *path;
+	const gchar *path;
 	DB_FH *fhp;
 	u_int32_t mbytes, bytes, pattern;
 {
 	size_t len, nw;
-	int i, ret;
-	char buf[8 * 1024];
+	gint i, ret;
+	gchar buf[8 * 1024];
 
 	if ((ret = __os_seek(dbenv, fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0)
 		goto err;
diff --git a/libdb/env/env_method.c b/libdb/env/env_method.c
index d98748a..9b4ae8b 100644
--- a/libdb/env/env_method.c
+++ b/libdb/env/env_method.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -45,41 +45,41 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_client_ext.h"
 #endif
 
-static void __dbenv_err __P((const DB_ENV *, int, const char *, ...));
-static void __dbenv_errx __P((const DB_ENV *, const char *, ...));
-static int  __dbenv_init __P((DB_ENV *));
-static int  __dbenv_set_alloc __P((DB_ENV *, void *(*)(size_t),
-    void *(*)(void *, size_t), void (*)(void *)));
-static int  __dbenv_set_app_dispatch __P((DB_ENV *,
-    int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
-static int  __dbenv_set_data_dir __P((DB_ENV *, const char *));
-static int  __dbenv_set_encrypt __P((DB_ENV *, const char *, u_int32_t));
-static void __dbenv_set_errcall __P((DB_ENV *, void (*)(const char *, char *)));
+static void __dbenv_err __P((const DB_ENV *, int, const gchar *, ...));
+static void __dbenv_errx __P((const DB_ENV *, const gchar *, ...));
+static gint  __dbenv_init __P((DB_ENV *));
+static gint  __dbenv_set_alloc __P((DB_ENV *, gpointer (*)(size_t),
+    gpointer (*)(gpointer , size_t), void (*)(gpointer)));
+static gint  __dbenv_set_app_dispatch __P((DB_ENV *,
+    gint (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
+static gint  __dbenv_set_data_dir __P((DB_ENV *, const gchar *));
+static gint  __dbenv_set_encrypt __P((DB_ENV *, const gchar *, u_int32_t));
+static void __dbenv_set_errcall __P((DB_ENV *, void (*)(const gchar *, gchar *)));
 static void __dbenv_set_errfile __P((DB_ENV *, FILE *));
-static void __dbenv_set_errpfx __P((DB_ENV *, const char *));
-static int  __dbenv_set_feedback __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
-static int  __dbenv_set_flags __P((DB_ENV *, u_int32_t, int));
-static int  __dbenv_set_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
-static int  __dbenv_set_rpc_server_noclnt
-    __P((DB_ENV *, void *, const char *, long, long, u_int32_t));
-static int  __dbenv_set_shm_key __P((DB_ENV *, long));
-static int  __dbenv_set_tas_spins __P((DB_ENV *, u_int32_t));
-static int  __dbenv_set_tmp_dir __P((DB_ENV *, const char *));
-static int  __dbenv_set_verbose __P((DB_ENV *, u_int32_t, int));
+static void __dbenv_set_errpfx __P((DB_ENV *, const gchar *));
+static gint  __dbenv_set_feedback __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
+static gint  __dbenv_set_flags __P((DB_ENV *, u_int32_t, int));
+static gint  __dbenv_set_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
+static gint  __dbenv_set_rpc_server_noclnt
+    __P((DB_ENV *, gpointer , const gchar *, long, long, u_int32_t));
+static gint  __dbenv_set_shm_key __P((DB_ENV *, long));
+static gint  __dbenv_set_tas_spins __P((DB_ENV *, u_int32_t));
+static gint  __dbenv_set_tmp_dir __P((DB_ENV *, const gchar *));
+static gint  __dbenv_set_verbose __P((DB_ENV *, u_int32_t, int));
 
 /*
  * db_env_create --
  *	DB_ENV constructor.
  *
- * EXTERN: int db_env_create __P((DB_ENV **, u_int32_t));
+ * EXTERN: gint db_env_create __P((DB_ENV **, u_int32_t));
  */
-int
+gint
 db_env_create(dbenvpp, flags)
 	DB_ENV **dbenvpp;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	/*
 	 * !!!
@@ -194,12 +194,12 @@ __dbenv_init(dbenv)
  */
 static void
 #ifdef __STDC__
-__dbenv_err(const DB_ENV *dbenv, int error, const char *fmt, ...)
+__dbenv_err(const DB_ENV *dbenv, gint error, const gchar *fmt, ...)
 #else
 __dbenv_err(dbenv, error, fmt, va_alist)
 	const DB_ENV *dbenv;
-	int error;
-	const char *fmt;
+	gint error;
+	const gchar *fmt;
 	va_dcl
 #endif
 {
@@ -212,11 +212,11 @@ __dbenv_err(dbenv, error, fmt, va_alist)
  */
 static void
 #ifdef __STDC__
-__dbenv_errx(const DB_ENV *dbenv, const char *fmt, ...)
+__dbenv_errx(const DB_ENV *dbenv, const gchar *fmt, ...)
 #else
 __dbenv_errx(dbenv, fmt, va_alist)
 	const DB_ENV *dbenv;
-	const char *fmt;
+	const gchar *fmt;
 	va_dcl
 #endif
 {
@@ -226,9 +226,9 @@ __dbenv_errx(dbenv, fmt, va_alist)
 static int
 __dbenv_set_alloc(dbenv, mal_func, real_func, free_func)
 	DB_ENV *dbenv;
-	void *(*mal_func) __P((size_t));
-	void *(*real_func) __P((void *, size_t));
-	void (*free_func) __P((void *));
+	gpointer (*mal_func) __P((size_t));
+	gpointer (*real_func) __P((gpointer , size_t));
+	void (*free_func) __P((gpointer));
 {
 	ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_alloc");
 
@@ -245,7 +245,7 @@ __dbenv_set_alloc(dbenv, mal_func, real_func, free_func)
 static int
 __dbenv_set_app_dispatch(dbenv, app_dispatch)
 	DB_ENV *dbenv;
-	int (*app_dispatch) __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
+	gint (*app_dispatch) __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
 {
 	ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_app_dispatch");
 
@@ -256,12 +256,12 @@ __dbenv_set_app_dispatch(dbenv, app_dispatch)
 static int
 __dbenv_set_encrypt(dbenv, passwd, flags)
 	DB_ENV *dbenv;
-	const char *passwd;
+	const gchar *passwd;
 	u_int32_t flags;
 {
 #ifdef HAVE_CRYPTO
 	DB_CIPHER *db_cipher;
-	int ret;
+	gint ret;
 
 	ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_encrypt");
 #define	OK_CRYPTO_FLAGS	(DB_ENCRYPT_AES)
@@ -329,7 +329,7 @@ static int
 __dbenv_set_flags(dbenv, flags, onoff)
 	DB_ENV *dbenv;
 	u_int32_t flags;
-	int onoff;
+	gint onoff;
 {
 #define	OK_FLAGS							\
 	(DB_AUTO_COMMIT | DB_CDB_ALLDB | DB_DIRECT_DB | DB_DIRECT_LOG |	\
@@ -427,20 +427,20 @@ __dbenv_set_flags(dbenv, flags, onoff)
 static int
 __dbenv_set_data_dir(dbenv, dir)
 	DB_ENV *dbenv;
-	const char *dir;
+	const gchar *dir;
 {
-	int ret;
+	gint ret;
 
 #define	DATA_INIT_CNT	20			/* Start with 20 data slots. */
 	if (dbenv->db_data_dir == NULL) {
 		if ((ret = __os_calloc(dbenv, DATA_INIT_CNT,
-		    sizeof(char **), &dbenv->db_data_dir)) != 0)
+		    sizeof(gchar **), &dbenv->db_data_dir)) != 0)
 			return (ret);
 		dbenv->data_cnt = DATA_INIT_CNT;
 	} else if (dbenv->data_next == dbenv->data_cnt - 1) {
 		dbenv->data_cnt *= 2;
 		if ((ret = __os_realloc(dbenv,
-		    dbenv->data_cnt * sizeof(char **),
+		    dbenv->data_cnt * sizeof(gchar **),
 		    &dbenv->db_data_dir)) != 0)
 			return (ret);
 	}
@@ -451,7 +451,7 @@ __dbenv_set_data_dir(dbenv, dir)
 static void
 __dbenv_set_errcall(dbenv, errcall)
 	DB_ENV *dbenv;
-	void (*errcall) __P((const char *, char *));
+	void (*errcall) __P((const gchar *, gchar *));
 {
 	dbenv->db_errcall = errcall;
 }
@@ -467,7 +467,7 @@ __dbenv_set_errfile(dbenv, errfile)
 static void
 __dbenv_set_errpfx(dbenv, errpfx)
 	DB_ENV *dbenv;
-	const char *errpfx;
+	const gchar *errpfx;
 {
 	dbenv->db_errpfx = errpfx;
 }
@@ -513,7 +513,7 @@ __dbenv_set_tas_spins(dbenv, tas_spins)
 static int
 __dbenv_set_tmp_dir(dbenv, dir)
 	DB_ENV *dbenv;
-	const char *dir;
+	const gchar *dir;
 {
 	if (dbenv->db_tmp_dir != NULL)
 		__os_free(dbenv, dbenv->db_tmp_dir);
@@ -524,7 +524,7 @@ static int
 __dbenv_set_verbose(dbenv, which, onoff)
 	DB_ENV *dbenv;
 	u_int32_t which;
-	int onoff;
+	gint onoff;
 {
 	switch (which) {
 	case DB_VERB_CHKPOINT:
@@ -547,12 +547,12 @@ __dbenv_set_verbose(dbenv, which, onoff)
  * __db_mi_env --
  *	Method illegally called with public environment.
  *
- * PUBLIC: int __db_mi_env __P((DB_ENV *, const char *));
+ * PUBLIC: gint __db_mi_env __P((DB_ENV *, const gchar *));
  */
-int
+gint
 __db_mi_env(dbenv, name)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 {
 	__db_err(dbenv, "%s: method not permitted in shared environment", name);
 	return (EINVAL);
@@ -562,13 +562,13 @@ __db_mi_env(dbenv, name)
  * __db_mi_open --
  *	Method illegally called after open.
  *
- * PUBLIC: int __db_mi_open __P((DB_ENV *, const char *, int));
+ * PUBLIC: gint __db_mi_open __P((DB_ENV *, const gchar *, int));
  */
-int
+gint
 __db_mi_open(dbenv, name, after)
 	DB_ENV *dbenv;
-	const char *name;
-	int after;
+	const gchar *name;
+	gint after;
 {
 	__db_err(dbenv, "%s: method not permitted %s open",
 	    name, after ? "after" : "before");
@@ -579,15 +579,15 @@ __db_mi_open(dbenv, name, after)
  * __db_env_config --
  *	Method or function called without required configuration.
  *
- * PUBLIC: int __db_env_config __P((DB_ENV *, char *, u_int32_t));
+ * PUBLIC: gint __db_env_config __P((DB_ENV *, gchar *, u_int32_t));
  */
-int
+gint
 __db_env_config(dbenv, i, flags)
 	DB_ENV *dbenv;
-	char *i;
+	gchar *i;
 	u_int32_t flags;
 {
-	char *sub;
+	gchar *sub;
 
 	switch (flags) {
 	case DB_INIT_LOCK:
@@ -615,8 +615,8 @@ __db_env_config(dbenv, i, flags)
 static int
 __dbenv_set_rpc_server_noclnt(dbenv, cl, host, tsec, ssec, flags)
 	DB_ENV *dbenv;
-	void *cl;
-	const char *host;
+	gpointer cl;
+	const gchar *host;
 	long tsec, ssec;
 	u_int32_t flags;
 {
diff --git a/libdb/env/env_open.c b/libdb/env/env_open.c
index a1c4bbb..b28f998 100644
--- a/libdb/env/env_open.c
+++ b/libdb/env/env_open.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -38,21 +38,21 @@ static const char revid[] = "$Id$";
 #define strcasecmp _stricmp
 #endif
 
-static int __db_parse __P((DB_ENV *, char *));
-static int __db_tmp_open __P((DB_ENV *, u_int32_t, char *, DB_FH *));
-static int __dbenv_config __P((DB_ENV *, const char *, u_int32_t));
-static int __dbenv_iremove __P((DB_ENV *, const char *, u_int32_t));
-static int __dbenv_refresh __P((DB_ENV *, u_int32_t));
+static gint __db_parse __P((DB_ENV *, gchar *));
+static gint __db_tmp_open __P((DB_ENV *, u_int32_t, gchar *, DB_FH *));
+static gint __dbenv_config __P((DB_ENV *, const gchar *, u_int32_t));
+static gint __dbenv_iremove __P((DB_ENV *, const gchar *, u_int32_t));
+static gint __dbenv_refresh __P((DB_ENV *, u_int32_t));
 
 /*
  * db_version --
  *	Return version information.
  *
- * EXTERN: char *db_version __P((int *, int *, int *));
+ * EXTERN: gchar *db_version __P((gint *, gint *, gint *));
  */
-char *
+gchar *
 db_version(majverp, minverp, patchp)
-	int *majverp, *minverp, *patchp;
+	gint *majverp, *minverp, *patchp;
 {
 	if (majverp != NULL)
 		*majverp = DB_VERSION_MAJOR;
@@ -60,24 +60,24 @@ db_version(majverp, minverp, patchp)
 		*minverp = DB_VERSION_MINOR;
 	if (patchp != NULL)
 		*patchp = DB_VERSION_PATCH;
-	return ((char *)DB_VERSION_STRING);
+	return ((gchar *)DB_VERSION_STRING);
 }
 
 /*
  * __dbenv_open --
  *	Initialize an environment.
  *
- * PUBLIC: int __dbenv_open __P((DB_ENV *, const char *, u_int32_t, int));
+ * PUBLIC: gint __dbenv_open __P((DB_ENV *, const gchar *, u_int32_t, int));
  */
-int
+gint
 __dbenv_open(dbenv, db_home, flags, mode)
 	DB_ENV *dbenv;
-	const char *db_home;
+	const gchar *db_home;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 {
 	DB_MPOOL *dbmp;
-	int ret;
+	gint ret;
 	u_int32_t init_flags, orig_flags;
 
 	orig_flags = dbenv->flags;
@@ -358,15 +358,15 @@ err:	/* If we fail after creating the regions, remove them. */
  * __dbenv_remove --
  *	Discard an environment.
  *
- * PUBLIC: int __dbenv_remove __P((DB_ENV *, const char *, u_int32_t));
+ * PUBLIC: gint __dbenv_remove __P((DB_ENV *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbenv_remove(dbenv, db_home, flags)
 	DB_ENV *dbenv;
-	const char *db_home;
+	const gchar *db_home;
 	u_int32_t flags;
 {
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = __dbenv_iremove(dbenv, db_home, flags);
 
@@ -383,10 +383,10 @@ __dbenv_remove(dbenv, db_home, flags)
 static int
 __dbenv_iremove(dbenv, db_home, flags)
 	DB_ENV *dbenv;
-	const char *db_home;
+	const gchar *db_home;
 	u_int32_t flags;
 {
-	int ret;
+	gint ret;
 
 #undef	OKFLAGS
 #define	OKFLAGS								\
@@ -413,12 +413,12 @@ __dbenv_iremove(dbenv, db_home, flags)
 static int
 __dbenv_config(dbenv, db_home, flags)
 	DB_ENV *dbenv;
-	const char *db_home;
+	const gchar *db_home;
 	u_int32_t flags;
 {
 	FILE *fp;
-	int ret;
-	char *p, buf[256];
+	gint ret;
+	gchar *p, buf[256];
 
 	/*
 	 * Set the database home.  Do this before calling __db_appname,
@@ -482,15 +482,15 @@ __dbenv_config(dbenv, db_home, flags)
  * __dbenv_close --
  *	DB_ENV destructor.
  *
- * PUBLIC: int __dbenv_close __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbenv_close __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbenv_close(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
-	char **p;
-	int ret, t_ret;
+	gchar **p;
+	gint ret, t_ret;
 
 	COMPQUIET(flags, 0);
 
@@ -524,7 +524,7 @@ __dbenv_close(dbenv, flags)
 		ret = t_ret;
 
 	/* Do per-subsystem destruction. */
-	__lock_dbenv_close(dbenv); /* void */
+	__lock_dbenv_close(dbenv); /* gpointer /
 	if ((t_ret = __rep_dbenv_close(dbenv)) != 0 && ret == 0)
 		ret = t_ret;
 
@@ -564,7 +564,7 @@ __dbenv_refresh(dbenv, orig_flags)
 	u_int32_t orig_flags;
 {
 	DB_MPOOL *dbmp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 
@@ -690,22 +690,22 @@ __dbenv_refresh(dbenv, orig_flags)
  *	of call, build a path based on the DB_ENV->open rules, and return
  *	it in allocated space.
  *
- * PUBLIC: int __db_appname __P((DB_ENV *, APPNAME,
- * PUBLIC:    const char *, u_int32_t, DB_FH *, char **));
+ * PUBLIC: gint __db_appname __P((DB_ENV *, APPNAME,
+ * PUBLIC:    const gchar *, u_int32_t, DB_FH *, gchar **));
  */
-int
+gint
 __db_appname(dbenv, appname, file, tmp_oflags, fhp, namep)
 	DB_ENV *dbenv;
 	APPNAME appname;
-	const char *file;
+	const gchar *file;
 	u_int32_t tmp_oflags;
 	DB_FH *fhp;
-	char **namep;
+	gchar **namep;
 {
 	size_t len, str_len;
-	int data_entry, ret, slash, tmp_create;
-	const char *a, *b;
-	char *p, *str;
+	gint data_entry, ret, slash, tmp_create;
+	const gchar *a, *b;
+	gchar *p, *str;
 
 	a = b = NULL;
 	data_entry = -1;
@@ -812,15 +812,15 @@ retry:	/*
  * __db_home --
  *	Find the database home.
  *
- * PUBLIC:	int __db_home __P((DB_ENV *, const char *, u_int32_t));
+ * PUBLIC:	gint __db_home __P((DB_ENV *, const gchar *, u_int32_t));
  */
-int
+gint
 __db_home(dbenv, db_home, flags)
 	DB_ENV *dbenv;
-	const char *db_home;
+	const gchar *db_home;
 	u_int32_t flags;
 {
-	const char *p;
+	const gchar *p;
 
 	/*
 	 * Use db_home by default, this allows utilities to reasonably
@@ -853,18 +853,18 @@ __db_home(dbenv, db_home, flags)
 static int
 __db_parse(dbenv, s)
 	DB_ENV *dbenv;
-	char *s;
+	gchar *s;
 {
 	u_long __max, __v, v1, v2, v3;
 	u_int32_t flags;
-	char *name, *p, *value, v4;
+	gchar *name, *p, *value, v4;
 
 	/*
 	 * !!!
 	 * The value of 40 is hard-coded into format arguments to sscanf
 	 * below, it can't be changed here without changing it there, too.
 	 */
-	char arg[40];
+	gchar arg[40];
 
 	/*
 	 * Name/value pairs are parsed as two white-space separated strings.
@@ -1106,13 +1106,13 @@ static int
 __db_tmp_open(dbenv, tmp_oflags, path, fhp)
 	DB_ENV *dbenv;
 	u_int32_t tmp_oflags;
-	char *path;
+	gchar *path;
 	DB_FH *fhp;
 {
 	u_int32_t id;
-	int mode, isdir, ret;
-	const char *p;
-	char *trv;
+	gint mode, isdir, ret;
+	const gchar *p;
+	gchar *trv;
 
 	/*
 	 * Check the target directory; if you have six X's and it doesn't
diff --git a/libdb/env/env_recover.c b/libdb/env/env_recover.c
index afe7353..1bf6327 100644
--- a/libdb/env/env_recover.c
+++ b/libdb/env/env_recover.c
@@ -8,9 +8,9 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char copyright[] =
+static const gchar copyright[] =
     "Copyright (c) 1996-2002\nSleepycat Software Inc.  All rights reserved.\n";
-static const char revid[] =
+static const gchar revid[] =
     "$Id$";
 #endif
 
@@ -40,8 +40,8 @@ static const char revid[] =
 #include "dbinc/txn.h"
 #include "dbinc/db_am.h"
 
-static int    __log_backup __P((DB_ENV *, DB_LOGC *, DB_LSN *, DB_LSN *));
-static int    __log_earliest __P((DB_ENV *, DB_LOGC *, int32_t *, DB_LSN *));
+static gint    __log_backup __P((DB_ENV *, DB_LOGC *, DB_LSN *, DB_LSN *));
+static gint    __log_earliest __P((DB_ENV *, DB_LOGC *, int32_t *, DB_LSN *));
 static double __lsn_diff __P((DB_LSN *, DB_LSN *, DB_LSN *, u_int32_t, int));
 
 /*
@@ -51,9 +51,9 @@ static double __lsn_diff __P((DB_LSN *, DB_LSN *, DB_LSN *, u_int32_t, int));
  * LSN of max_lsn, so we need to roll back sufficiently far for that
  * to work.  See __log_backup for details.
  *
- * PUBLIC: int __db_apprec __P((DB_ENV *, DB_LSN *, u_int32_t));
+ * PUBLIC: gint __db_apprec __P((DB_ENV *, DB_LSN *, u_int32_t));
  */
-int
+gint
 __db_apprec(dbenv, max_lsn, flags)
 	DB_ENV *dbenv;
 	DB_LSN *max_lsn;
@@ -67,12 +67,12 @@ __db_apprec(dbenv, max_lsn, flags)
 	time_t now, tlow;
 	int32_t log_size, low;
 	double nfiles;
-	int have_rec, is_thread, progress, ret, t_ret;
-	int (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint have_rec, is_thread, progress, ret, t_ret;
+	gint (**dtab) __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t dtabsize;
 	u_int32_t hi_txn, lockid, txnid;
-	char *p, *pass, t1[60], t2[60];
-	void *txninfo;
+	gchar *p, *pass, t1[60], t2[60];
+	gpointer txninfo;
 
 	COMPQUIET(nfiles, (double)0);
 
@@ -593,7 +593,7 @@ static double
 __lsn_diff(low, high, current, max, is_forward)
 	DB_LSN *low, *high, *current;
 	u_int32_t max;
-	int is_forward;
+	gint is_forward;
 {
 	double nf;
 
@@ -645,7 +645,7 @@ __log_backup(dbenv, logc, max_lsn, start_lsn)
 	DB_LSN lsn;
 	DBT data;
 	__txn_ckp_args *ckp_args;
-	int ret;
+	gint ret;
 
 	memset(&data, 0, sizeof(data));
 	ckp_args = NULL;
@@ -695,7 +695,7 @@ __log_earliest(dbenv, logc, lowtime, lowlsn)
 	DBT data;
 	__txn_ckp_args *ckpargs;
 	u_int32_t rectype;
-	int cmp, ret;
+	gint cmp, ret;
 
 	memset(&data, 0, sizeof(data));
 	/*
@@ -735,23 +735,23 @@ __log_earliest(dbenv, logc, lowtime, lowlsn)
  * If we are not doing feedback processing (i.e., we are doing txn_recover
  * processing and in_recovery is zero), then last_lsn can be NULL.
  *
- * PUBLIC: int __env_openfiles __P((DB_ENV *, DB_LOGC *,
- * PUBLIC:     void *, DBT *, DB_LSN *, DB_LSN *, double, int));
+ * PUBLIC: gint __env_openfiles __P((DB_ENV *, DB_LOGC *,
+ * PUBLIC:     gpointer , DBT *, DB_LSN *, DB_LSN *, double, int));
  */
-int
+gint
 __env_openfiles(dbenv, logc, txninfo,
     data, open_lsn, last_lsn, nfiles, in_recovery)
 	DB_ENV *dbenv;
 	DB_LOGC *logc;
-	void *txninfo;
+	gpointer txninfo;
 	DBT *data;
 	DB_LSN *open_lsn, *last_lsn;
-	int in_recovery;
+	gint in_recovery;
 	double nfiles;
 {
 	DB_LSN lsn;
 	u_int32_t log_size;
-	int progress, ret;
+	gint progress, ret;
 
 	/*
 	 * XXX
diff --git a/libdb/env/env_region.c b/libdb/env/env_region.c
index e641e25..ce1a95b 100644
--- a/libdb/env/env_region.c
+++ b/libdb/env/env_region.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,19 +27,19 @@ static const char revid[] = "$Id$";
 #include "dbinc/rep.h"
 #include "dbinc/txn.h"
 
-static int  __db_des_destroy __P((DB_ENV *, REGION *));
-static int  __db_des_get __P((DB_ENV *, REGINFO *, REGINFO *, REGION **));
-static int  __db_e_remfile __P((DB_ENV *));
-static int  __db_faultmem __P((DB_ENV *, void *, size_t, int));
+static gint  __db_des_destroy __P((DB_ENV *, REGION *));
+static gint  __db_des_get __P((DB_ENV *, REGINFO *, REGINFO *, REGION **));
+static gint  __db_e_remfile __P((DB_ENV *));
+static gint  __db_faultmem __P((DB_ENV *, gpointer , size_t, int));
 static void __db_region_destroy __P((DB_ENV *, REGINFO *));
 
 /*
  * __db_e_attach
  *	Join/create the environment
  *
- * PUBLIC: int __db_e_attach __P((DB_ENV *, u_int32_t *));
+ * PUBLIC: gint __db_e_attach __P((DB_ENV *, u_int32_t *));
  */
-int
+gint
 __db_e_attach(dbenv, init_flagsp)
 	DB_ENV *dbenv;
 	u_int32_t *init_flagsp;
@@ -51,8 +51,8 @@ __db_e_attach(dbenv, init_flagsp)
 	size_t size;
 	size_t nrw;
 	u_int32_t mbytes, bytes;
-	int retry_cnt, ret, segid;
-	char buf[sizeof(DB_REGION_FMT) + 20];
+	gint retry_cnt, ret, segid;
+	gchar buf[sizeof(DB_REGION_FMT) + 20];
 
 #if !defined(HAVE_MUTEX_THREADS)
 	/*
@@ -540,12 +540,12 @@ retry:	/* Close any open file handle. */
  * __db_e_detach --
  *	Detach from the environment.
  *
- * PUBLIC: int __db_e_detach __P((DB_ENV *, int));
+ * PUBLIC: gint __db_e_detach __P((DB_ENV *, int));
  */
-int
+gint
 __db_e_detach(dbenv, destroy)
 	DB_ENV *dbenv;
-	int destroy;
+	gint destroy;
 {
 	REGENV *renv;
 	REGINFO *infop;
@@ -613,9 +613,9 @@ __db_e_detach(dbenv, destroy)
  * __db_e_remove --
  *	Discard an environment if it's not in use.
  *
- * PUBLIC: int __db_e_remove __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __db_e_remove __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __db_e_remove(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
@@ -624,7 +624,7 @@ __db_e_remove(dbenv, flags)
 	REGINFO *infop, reginfo;
 	REGION *rp;
 	u_int32_t db_env_reset;
-	int force, ret;
+	gint force, ret;
 
 	force = LF_ISSET(DB_FORCE) ? 1 : 0;
 	/*
@@ -761,17 +761,17 @@ static int
 __db_e_remfile(dbenv)
 	DB_ENV *dbenv;
 {
-	static char *old_region_names[] = {
+	static gchar *old_region_names[] = {
 		"__db_lock.share",
 		"__db_log.share",
 		"__db_mpool.share",
 		"__db_txn.share",
 		NULL
 	};
-	int cnt, fcnt, lastrm, ret;
+	gint cnt, fcnt, lastrm, ret;
 	u_int8_t saved_byte;
-	const char *dir;
-	char *p, **names, *path, buf[sizeof(DB_REGION_FMT) + 20];
+	const gchar *dir;
+	gchar *p, **names, *path, buf[sizeof(DB_REGION_FMT) + 20];
 
 	/* Get the full path of a file in the environment. */
 	(void)snprintf(buf, sizeof(buf), "%s", DB_REGION_ENV);
@@ -844,7 +844,7 @@ __db_e_remfile(dbenv)
 	 * Backward compatibility -- remove region files from releases
 	 * before 2.8.XX.
 	 */
-	for (names = (char **)old_region_names; *names != NULL; ++names)
+	for (names = (gchar **)old_region_names; *names != NULL; ++names)
 		if (__db_appname(dbenv,
 		    DB_APP_NONE, *names, 0, NULL, &path) == 0) {
 			(void)__os_unlink(dbenv, path);
@@ -858,21 +858,21 @@ __db_e_remfile(dbenv)
  * __db_e_stat
  *	Statistics for the environment.
  *
- * PUBLIC: int __db_e_stat __P((DB_ENV *,
- * PUBLIC:       REGENV *, REGION *, int *, u_int32_t));
+ * PUBLIC: gint __db_e_stat __P((DB_ENV *,
+ * PUBLIC:       REGENV *, REGION *, gint *, u_int32_t));
  */
-int
+gint
 __db_e_stat(dbenv, arg_renv, arg_regions, arg_regions_cnt, flags)
 	DB_ENV *dbenv;
 	REGENV *arg_renv;
 	REGION *arg_regions;
-	int *arg_regions_cnt;
+	gint *arg_regions_cnt;
 	u_int32_t flags;
 {
 	REGENV *renv;
 	REGINFO *infop;
 	REGION *rp;
-	int n, ret;
+	gint n, ret;
 
 	infop = dbenv->reginfo;
 	renv = infop->primary;
@@ -913,9 +913,9 @@ __db_e_stat(dbenv, arg_renv, arg_regions, arg_regions_cnt, flags)
  * __db_r_attach
  *	Join/create a region.
  *
- * PUBLIC: int __db_r_attach __P((DB_ENV *, REGINFO *, size_t));
+ * PUBLIC: gint __db_r_attach __P((DB_ENV *, REGINFO *, size_t));
  */
-int
+gint
 __db_r_attach(dbenv, infop, size)
 	DB_ENV *dbenv;
 	REGINFO *infop;
@@ -923,8 +923,8 @@ __db_r_attach(dbenv, infop, size)
 {
 	REGENV *renv;
 	REGION *rp;
-	int ret;
-	char buf[sizeof(DB_REGION_FMT) + 20];
+	gint ret;
+	gchar buf[sizeof(DB_REGION_FMT) + 20];
 
 	renv = ((REGINFO *)dbenv->reginfo)->primary;
 
@@ -1012,17 +1012,17 @@ err:	if (infop->addr != NULL)
  * __db_r_detach --
  *	Detach from a region.
  *
- * PUBLIC: int __db_r_detach __P((DB_ENV *, REGINFO *, int));
+ * PUBLIC: gint __db_r_detach __P((DB_ENV *, REGINFO *, int));
  */
-int
+gint
 __db_r_detach(dbenv, infop, destroy)
 	DB_ENV *dbenv;
 	REGINFO *infop;
-	int destroy;
+	gint destroy;
 {
 	REGENV *renv;
 	REGION *rp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	renv = ((REGINFO *)dbenv->reginfo)->primary;
 	rp = infop->rp;
@@ -1077,7 +1077,7 @@ __db_des_get(dbenv, env_infop, infop, rpp)
 	REGENV *renv;
 	REGION *rp, *first_type;
 	u_int32_t maxid;
-	int ret;
+	gint ret;
 
 	/*
 	 * !!!
@@ -1189,11 +1189,11 @@ __db_des_destroy(dbenv, rp)
 static int
 __db_faultmem(dbenv, addr, size, created)
 	DB_ENV *dbenv;
-	void *addr;
+	gpointer addr;
 	size_t size;
-	int created;
+	gint created;
 {
-	int ret;
+	gint ret;
 	u_int8_t *p, *t;
 
 	/*
diff --git a/libdb/examples_c/bench_001.c b/libdb/examples_c/bench_001.c
index 7ef4442..530a83f 100644
--- a/libdb/examples_c/bench_001.c
+++ b/libdb/examples_c/bench_001.c
@@ -39,7 +39,7 @@
 
 #define	DATABASE	"bench_001.db"
 
-int	main(int, char *[]);
+int	main(int, gchar *[]);
 void	usage(void);
 
 const char
@@ -50,11 +50,11 @@ const char
  */
 DB_ENV *
 db_init(home, prefix, cachesize, txn)
-	char *home, *prefix;
-	int cachesize, txn;
+	gchar *home, *prefix;
+	gint cachesize, txn;
 {
 	DB_ENV *dbenv;
-	int flags, ret;
+	gint flags, ret;
 
 	if ((ret = db_env_create(&dbenv, 0)) != 0) {
 		dbenv->err(dbenv, ret, "db_env_create");
@@ -80,17 +80,17 @@ db_init(home, prefix, cachesize, txn)
  * get -- loop getting batches of records.
  *
  */
-int
+gint
 get(dbp, txn, datalen, num, dups, iter, countp)
 	DB *dbp;
-	int txn, datalen, num, dups, iter, *countp;
+	gint txn, datalen, num, dups, iter, *countp;
 {
 	DBC *dbcp;
 	DBT key, data;
 	DB_TXN *txnp;
 	u_int32_t len, klen;
-	int count, flags, i, j, ret;
-	void *pointer, *dp, *kp;
+	gint count, flags, i, j, ret;
+	gpointer pointer, *dp, *kp;
 
 	memset(&key, 0, sizeof(key));
 	key.data = &j;
@@ -149,19 +149,19 @@ get(dbp, txn, datalen, num, dups, iter, countp)
  * 10 to a transaction.
  */
 #define	PUTS_PER_TXN	10
-int
+gint
 fill(dbenv, dbp, txn, datalen, num, dups)
 	DB_ENV *dbenv;
 	DB *dbp;
-	int txn, datalen, num, dups;
+	gint txn, datalen, num, dups;
 {
 	DBT key, data;
 	DB_TXN *txnp;
 	struct data {
-		int id;
-		char str[1];
+		gint id;
+		gchar str[1];
 	} *data_val;
-	int count, i, ret;
+	gint count, i, ret;
 	/*
 	 * Insert records into the database, where the key is the user
 	 * input and the data is the user input in reverse order.
@@ -215,20 +215,20 @@ err:	if (txnp != NULL)
 	return (ret);
 }
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
+	extern gchar *optarg;
+	extern gint optind;
 	DB *dbp;
 	DB_ENV *dbenv;
 	DB_TXN *txnp;
 	struct timeval start_time, end_time;
 	double secs;
-	int cache, ch, count, datalen, dups, env, init, iter, num, pagesize;
-	int ret, rflag, txn;
+	gint cache, ch, count, datalen, dups, env, init, iter, num, pagesize;
+	gint ret, rflag, txn;
 
 	txnp = NULL;
 	datalen = 20;
diff --git a/libdb/examples_c/ex_access.c b/libdb/examples_c/ex_access.c
index c993145..83ff550 100644
--- a/libdb/examples_c/ex_access.c
+++ b/libdb/examples_c/ex_access.c
@@ -14,7 +14,7 @@
 #include <string.h>
 
 #ifdef _WIN32
-extern int getopt(int, char * const *, const char *);
+extern gint getopt(int, gchar * const *, const gchar *);
 #else
 #include <unistd.h>
 #endif
@@ -22,22 +22,22 @@ extern int getopt(int, char * const *, const char *);
 #include <db.h>
 
 #define	DATABASE	"access.db"
-int main __P((int, char *[]));
-int usage __P((void));
+gint main __P((int, gchar *[]));
+gint usage __P((void));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern int optind;
+	extern gint optind;
 	DB *dbp;
 	DBC *dbcp;
 	DBT key, data;
 	u_int32_t len;
-	int ch, ret, rflag;
-	char *database, *p, *t, buf[1024], rbuf[1024];
-	const char *progname = "ex_access";		/* Program name. */
+	gint ch, ret, rflag;
+	gchar *database, *p, *t, buf[1024], rbuf[1024];
+	const gchar *progname = "ex_access";		/* Program name. */
 
 	rflag = 0;
 	while ((ch = getopt(argc, argv, "r")) != EOF)
@@ -130,8 +130,8 @@ main(argc, argv)
 	/* Walk through the database and print out the key/data pairs. */
 	while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0)
 		printf("%.*s : %.*s\n",
-		    (int)key.size, (char *)key.data,
-		    (int)data.size, (char *)data.data);
+		    (int)key.size, (gchar *)key.data,
+		    (int)data.size, (gchar *)data.data);
 	if (ret != DB_NOTFOUND) {
 		dbp->err(dbp, ret, "DBcursor->get");
 		goto err2;
@@ -154,7 +154,7 @@ err1:	(void)dbp->close(dbp, 0);
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 usage()
 {
 	(void)fprintf(stderr, "usage: ex_access [-r] [database]\n");
diff --git a/libdb/examples_c/ex_apprec/ex_apprec.c b/libdb/examples_c/ex_apprec/ex_apprec.c
index 52dca61..fbef1ad 100644
--- a/libdb/examples_c/ex_apprec/ex_apprec.c
+++ b/libdb/examples_c/ex_apprec/ex_apprec.c
@@ -22,25 +22,25 @@
 #include "ex_apprec.h"
 
 int	apprec_dispatch __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
-int	open_env __P((const char *, FILE *, const char *, DB_ENV **));
-int	verify_absence __P((DB_ENV *, const char *));
-int	verify_presence __P((DB_ENV *, const char *));
+int	open_env __P((const gchar *, FILE *, const gchar *, DB_ENV **));
+int	verify_absence __P((DB_ENV *, const gchar *));
+int	verify_presence __P((DB_ENV *, const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
+	extern gchar *optarg;
+	extern gint optind;
 	DB_ENV *dbenv;
 	DB_LSN lsn;
 	DB_TXN *txn;
 	DBT dirnamedbt;
-	int ret;
-	const char *home;
-	char ch, dirname[256];
-	const char *progname = "ex_apprec";		/* Program name. */
+	gint ret;
+	const gchar *home;
+	gchar ch, dirname[256];
+	const gchar *progname = "ex_apprec";		/* Program name. */
 
 	/* Default home. */
 	home = "TESTDIR";
@@ -167,14 +167,14 @@ main(argc, argv)
 	return (EXIT_SUCCESS);
 }
 
-int
+gint
 open_env(home, errfp, progname, dbenvp)
-	const char *home, *progname;
+	const gchar *home, *progname;
 	FILE *errfp;
 	DB_ENV **dbenvp;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	/*
 	 * Create an environment object and initialize it for error
@@ -213,7 +213,7 @@ open_env(home, errfp, progname, dbenvp)
  * Sample application dispatch function to handle user-specified log record
  * types.
  */
-int
+gint
 apprec_dispatch(dbenv, dbt, lsn, op)
 	DB_ENV *dbenv;
 	DBT *dbt;
@@ -238,10 +238,10 @@ apprec_dispatch(dbenv, dbt, lsn, op)
 	}
 }
 
-int
+gint
 verify_absence(dbenv, dirname)
 	DB_ENV *dbenv;
-	const char *dirname;
+	const gchar *dirname;
 {
 
 	if (access(dirname, F_OK) == 0) {
@@ -252,10 +252,10 @@ verify_absence(dbenv, dirname)
 	return (0);
 }
 
-int
+gint
 verify_presence(dbenv, dirname)
 	DB_ENV *dbenv;
-	const char *dirname;
+	const gchar *dirname;
 {
 
 	if (access(dirname, F_OK) != 0) {
diff --git a/libdb/examples_c/ex_apprec/ex_apprec.h b/libdb/examples_c/ex_apprec/ex_apprec.h
index 852107a..1cd5fd0 100644
--- a/libdb/examples_c/ex_apprec/ex_apprec.h
+++ b/libdb/examples_c/ex_apprec/ex_apprec.h
@@ -12,13 +12,13 @@
 
 #include "ex_apprec_auto.h"
 
-int ex_apprec_mkdir_log
+gint ex_apprec_mkdir_log
     __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *));
-int ex_apprec_mkdir_print
-    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
-int ex_apprec_mkdir_read
-    __P((DB_ENV *, void *, ex_apprec_mkdir_args **));
-int ex_apprec_mkdir_recover
-    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+gint ex_apprec_mkdir_print
+    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
+gint ex_apprec_mkdir_read
+    __P((DB_ENV *, gpointer , ex_apprec_mkdir_args **));
+gint ex_apprec_mkdir_recover
+    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 
 #endif /* !_EX_APPREC_H_ */
diff --git a/libdb/examples_c/ex_apprec/ex_apprec_auto.c b/libdb/examples_c/ex_apprec/ex_apprec_auto.c
index d8c27e7..5c4884e 100644
--- a/libdb/examples_c/ex_apprec/ex_apprec_auto.c
+++ b/libdb/examples_c/ex_apprec/ex_apprec_auto.c
@@ -8,10 +8,10 @@
 
 #include "ex_apprec.h"
 /*
- * PUBLIC: int ex_apprec_mkdir_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint ex_apprec_mkdir_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, const DBT *));
  */
-int
+gint
 ex_apprec_mkdir_log(dbenv, txnid, ret_lsnp, flags,
     dirname)
 	DB_ENV *dbenv;
@@ -24,7 +24,7 @@ ex_apprec_mkdir_log(dbenv, txnid, ret_lsnp, flags,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t zero;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB_ex_apprec_mkdir;
@@ -84,21 +84,21 @@ ex_apprec_mkdir_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int ex_apprec_mkdir_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint ex_apprec_mkdir_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 ex_apprec_mkdir_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	ex_apprec_mkdir_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -125,13 +125,13 @@ ex_apprec_mkdir_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int ex_apprec_mkdir_read __P((DB_ENV *, void *,
+ * PUBLIC: gint ex_apprec_mkdir_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     ex_apprec_mkdir_args **));
  */
-int
+gint
 ex_apprec_mkdir_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	ex_apprec_mkdir_args **argpp;
 {
 	ex_apprec_mkdir_args *argp;
@@ -165,20 +165,20 @@ ex_apprec_mkdir_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int ex_apprec_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint ex_apprec_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 ex_apprec_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int __db_add_recovery __P((DB_ENV *,
-	    int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *),
+	gint __db_add_recovery __P((DB_ENV *,
+	    gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ),
 	    size_t *,
-	    int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *), u_int32_t));
-	int ret;
+	    gint (*)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ), u_int32_t));
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    ex_apprec_mkdir_print, DB_ex_apprec_mkdir)) != 0)
diff --git a/libdb/examples_c/ex_apprec/ex_apprec_rec.c b/libdb/examples_c/ex_apprec/ex_apprec_rec.c
index 983ecbe..70bb8cf 100644
--- a/libdb/examples_c/ex_apprec/ex_apprec_rec.c
+++ b/libdb/examples_c/ex_apprec/ex_apprec_rec.c
@@ -28,19 +28,19 @@
  * ex_apprec_mkdir_recover --
  *	Recovery function for mkdir.
  *
- * PUBLIC: int ex_apprec_mkdir_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint ex_apprec_mkdir_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 ex_apprec_mkdir_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	ex_apprec_mkdir_args *argp;
-	int ret;
+	gint ret;
 
 	argp = NULL;
 
@@ -62,7 +62,7 @@ ex_apprec_mkdir_recover(dbenv, dbtp, lsnp, op, info)
 		 * exists.  We log the trailing zero in pathnames, so we can
 		 * simply pass the data part of the DBT into rmdir as a string.
 		 * (Note that we don't have any alignment guarantees, but for
-		 * a char * this doesn't matter.)
+		 * a gchar * this doesn't matter.)
 		 *
 		 * Ignore all errors other than ENOENT;  DB may attempt to undo
 		 * or redo operations without knowing whether they have already
diff --git a/libdb/examples_c/ex_btrec.c b/libdb/examples_c/ex_btrec.c
index c003aa3..a125220 100644
--- a/libdb/examples_c/ex_btrec.c
+++ b/libdb/examples_c/ex_btrec.c
@@ -20,15 +20,15 @@
 int	main __P((void));
 
 int	ex_btrec __P((void));
-void	show __P((const char *, DBT *, DBT *));
+void	show __P((const gchar *, DBT *, DBT *));
 
-int
+gint
 main()
 {
 	return (ex_btrec() == 1 ? EXIT_FAILURE : EXIT_SUCCESS);
 }
 
-int
+gint
 ex_btrec()
 {
 	DB *dbp;
@@ -38,9 +38,9 @@ ex_btrec()
 	FILE *fp;
 	db_recno_t recno;
 	u_int32_t len;
-	int cnt, ret;
-	char *p, *t, buf[1024], rbuf[1024];
-	const char *progname = "ex_btrec";		/* Program name. */
+	gint cnt, ret;
+	gchar *p, *t, buf[1024], rbuf[1024];
+	const gchar *progname = "ex_btrec";		/* Program name. */
 
 	/* Open the word database. */
 	if ((fp = fopen(WORDLIST, "r")) == NULL) {
@@ -194,10 +194,10 @@ err1:	(void)dbp->close(dbp, 0);
  */
 void
 show(msg, key, data)
-	const char *msg;
+	const gchar *msg;
 	DBT *key, *data;
 {
 	printf("%s%.*s : %.*s\n", msg,
-	    (int)key->size, (char *)key->data,
-	    (int)data->size, (char *)data->data);
+	    (int)key->size, (gchar *)key->data,
+	    (int)data->size, (gchar *)data->data);
 }
diff --git a/libdb/examples_c/ex_dbclient.c b/libdb/examples_c/ex_dbclient.c
index 5f199b9..aaecba8 100644
--- a/libdb/examples_c/ex_dbclient.c
+++ b/libdb/examples_c/ex_dbclient.c
@@ -20,19 +20,19 @@
 
 #define	DATABASE	"access.db"
 
-int	db_clientrun __P((DB_ENV *, const char *));
-int	ex_dbclient_run __P((const char *, FILE *, const char *, const char *));
-int	main __P((int, char *[]));
+int	db_clientrun __P((DB_ENV *, const gchar *));
+int	ex_dbclient_run __P((const gchar *, FILE *, const gchar *, const gchar *));
+int	main __P((int, gchar *[]));
 
 /*
  * An example of a program creating/configuring a Berkeley DB environment.
  */
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	const char *home;
+	const gchar *home;
 
 	if (argc != 2) {
 		fprintf(stderr, "Usage: %s hostname\n", argv[0]);
@@ -48,13 +48,13 @@ main(argc, argv)
 	    stderr, argv[1], argv[0]) == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 ex_dbclient(host)
-	const char *host;
+	const gchar *host;
 {
-	const char *home;
-	const char *progname = "ex_dbclient";		/* Program name. */
-	int ret;
+	const gchar *home;
+	const gchar *progname = "ex_dbclient";		/* Program name. */
+	gint ret;
 
 	/*
 	 * All of the shared database files live in DATABASE_HOME, but
@@ -68,13 +68,13 @@ ex_dbclient(host)
 	return (0);
 }
 
-int
+gint
 ex_dbclient_run(home, errfp, host, progname)
-	const char *home, *host, *progname;
+	const gchar *home, *host, *progname;
 	FILE *errfp;
 {
 	DB_ENV *dbenv;
-	int ret, retry;
+	gint ret, retry;
 
 	/*
 	 * Create an environment object and initialize it for error
@@ -142,16 +142,16 @@ retry:
 	return (0);
 }
 
-int
+gint
 db_clientrun(dbenv, progname)
 	DB_ENV *dbenv;
-	const char *progname;
+	const gchar *progname;
 {
 	DB *dbp;
 	DBT key, data;
 	u_int32_t len;
-	int ret;
-	char *p, *t, buf[1024], rbuf[1024];
+	gint ret;
+	gchar *p, *t, buf[1024], rbuf[1024];
 
 	/* Remove the previous database. */
 
@@ -206,8 +206,8 @@ db_clientrun(dbenv, progname)
 		switch (ret = dbp->get(dbp, NULL, &key, &data, 0)) {
 		case 0:
 			printf("%.*s : %.*s\n",
-			    (int)key.size, (char *)key.data,
-			    (int)data.size, (char *)data.data);
+			    (int)key.size, (gchar *)key.data,
+			    (int)data.size, (gchar *)data.data);
 			break;
 		default:
 			dbp->err(dbp, ret, "DB->get");
diff --git a/libdb/examples_c/ex_env.c b/libdb/examples_c/ex_env.c
index 68e4e3b..9ddbf6a 100644
--- a/libdb/examples_c/ex_env.c
+++ b/libdb/examples_c/ex_env.c
@@ -28,18 +28,18 @@
 #endif
 #endif
 
-int	db_setup __P((const char *, const char *, FILE *, const char *));
-int	db_teardown __P((const char *, const char *, FILE *, const char *));
+int	db_setup __P((const gchar *, const gchar *, FILE *, const gchar *));
+int	db_teardown __P((const gchar *, const gchar *, FILE *, const gchar *));
 int	main __P((void));
 
 /*
  * An example of a program creating/configuring a Berkeley DB environment.
  */
-int
+gint
 main()
 {
-	const char *data_dir, *home;
-	const char *progname = "ex_env";		/* Program name. */
+	const gchar *data_dir, *home;
+	const gchar *progname = "ex_env";		/* Program name. */
 
 	/*
 	 * All of the shared database files live in DATABASE_HOME, but
@@ -59,13 +59,13 @@ main()
 	return (EXIT_SUCCESS);
 }
 
-int
+gint
 db_setup(home, data_dir, errfp, progname)
-	const char *home, *data_dir, *progname;
+	const gchar *home, *data_dir, *progname;
 	FILE *errfp;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	/*
 	 * Create an environment object and initialize it for error
@@ -110,13 +110,13 @@ db_setup(home, data_dir, errfp, progname)
 	return (0);
 }
 
-int
+gint
 db_teardown(home, data_dir, errfp, progname)
-	const char *home, *data_dir, *progname;
+	const gchar *home, *data_dir, *progname;
 	FILE *errfp;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	/* Remove the shared database regions. */
 	if ((ret = db_env_create(&dbenv, 0)) != 0) {
diff --git a/libdb/examples_c/ex_lock.c b/libdb/examples_c/ex_lock.c
index fe70fe0..ac2c7da 100644
--- a/libdb/examples_c/ex_lock.c
+++ b/libdb/examples_c/ex_lock.c
@@ -13,37 +13,37 @@
 #include <string.h>
 
 #ifdef _WIN32
-extern int getopt(int, char * const *, const char *);
+extern gint getopt(int, gchar * const *, const gchar *);
 #else
 #include <unistd.h>
 #endif
 
 #include <db.h>
 
-int db_init __P((const char *, u_int32_t, int));
-int main __P((int, char *[]));
-int usage __P((void));
+gint db_init __P((const gchar *, u_int32_t, int));
+gint main __P((int, gchar *[]));
+gint usage __P((void));
 
 DB_ENV	 *dbenv;
 const char
 	*progname = "ex_lock";				/* Program name. */
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
+	extern gchar *optarg;
+	extern gint optind;
 	DBT lock_dbt;
 	DB_LOCK lock;
 	DB_LOCK *locks;
 	db_lockmode_t lock_type;
 	long held;
 	u_int32_t len, locker, maxlocks;
-	int ch, do_unlink, did_get, i, lockid, lockcount, ret;
-	const char *home;
-	char opbuf[16], objbuf[1024], lockbuf[16];
+	gint ch, do_unlink, did_get, i, lockid, lockcount, ret;
+	const gchar *home;
+	gchar opbuf[16], objbuf[1024], lockbuf[16];
 
 	home = "TESTDIR";
 	maxlocks = 0;
@@ -189,13 +189,13 @@ main(argc, argv)
  * db_init --
  *	Initialize the environment.
  */
-int
+gint
 db_init(home, maxlocks, do_unlink)
-	const char *home;
+	const gchar *home;
 	u_int32_t maxlocks;
-	int do_unlink;
+	gint do_unlink;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = db_env_create(&dbenv, 0)) != 0) {
 		fprintf(stderr, "%s: db_env_create: %s\n",
@@ -230,7 +230,7 @@ db_init(home, maxlocks, do_unlink)
 	return (0);
 }
 
-int
+gint
 usage()
 {
 	(void)fprintf(stderr,
diff --git a/libdb/examples_c/ex_mpool.c b/libdb/examples_c/ex_mpool.c
index 4ce6969..ab385fd 100644
--- a/libdb/examples_c/ex_mpool.c
+++ b/libdb/examples_c/ex_mpool.c
@@ -16,29 +16,29 @@
 #include <time.h>
 
 #ifdef _WIN32
-extern int getopt(int, char * const *, const char *);
+extern gint getopt(int, gchar * const *, const gchar *);
 #else
 #include <unistd.h>
 #endif
 
 #include <db.h>
 
-int	init __P((const char *, int, int, const char *));
-int	run __P((int, int, int, int, const char *));
-int	run_mpool __P((int, int, int, int, const char *));
-int	main __P((int, char *[]));
-int	usage __P((const char *));
+int	init __P((const gchar *, int, int, const gchar *));
+int	run __P((int, int, int, int, const gchar *));
+int	run_mpool __P((int, int, int, int, const gchar *));
+int	main __P((int, gchar *[]));
+int	usage __P((const gchar *));
 #define	MPOOL	"mpool"					/* File. */
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
-	int cachesize, ch, hits, npages, pagesize;
-	char *progname;
+	extern gchar *optarg;
+	extern gint optind;
+	gint cachesize, ch, hits, npages, pagesize;
+	gchar *progname;
 
 	cachesize = 20 * 1024;
 	hits = 1000;
@@ -74,9 +74,9 @@ main(argc, argv)
 	    hits, npages, progname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-int
+gint
 usage(progname)
-	const char *progname;
+	const gchar *progname;
 {
 	(void)fprintf(stderr,
 	    "usage: %s [-c cachesize] [-h hits] [-n npages] [-p pagesize]\n",
@@ -84,12 +84,12 @@ usage(progname)
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 run_mpool(pagesize, cachesize, hits, npages, progname)
-	int pagesize, cachesize, hits, npages;
-	const char *progname;
+	gint pagesize, cachesize, hits, npages;
+	const gchar *progname;
 {
-	int ret;
+	gint ret;
 
 	/* Initialize the file. */
 	if ((ret = init(MPOOL, pagesize, npages, progname)) != 0)
@@ -106,14 +106,14 @@ run_mpool(pagesize, cachesize, hits, npages, progname)
  * init --
  *	Create a backing file.
  */
-int
+gint
 init(file, pagesize, npages, progname)
-	const char *file, *progname;
-	int pagesize, npages;
+	const gchar *file, *progname;
+	gint pagesize, npages;
 {
 	FILE *fp;
-	int cnt;
-	char *p;
+	gint cnt;
+	gchar *p;
 
 	/*
 	 * Create a file with the right number of pages, and store a page
@@ -124,14 +124,14 @@ init(file, pagesize, npages, progname)
 		    "%s: %s: %s\n", progname, file, strerror(errno));
 		return (1);
 	}
-	if ((p = (char *)malloc(pagesize)) == NULL) {
+	if ((p = (gchar *)malloc(pagesize)) == NULL) {
 		fprintf(stderr, "%s: %s\n", progname, strerror(ENOMEM));
 		return (1);
 	}
 
 	/* The pages are numbered from 0. */
 	for (cnt = 0; cnt <= npages; ++cnt) {
-		*(int *)p = cnt;
+		*(gint *)p = cnt;
 		if (fwrite(p, pagesize, 1, fp) != 1) {
 			fprintf(stderr,
 			    "%s: %s: %s\n", progname, file, strerror(errno));
@@ -148,16 +148,16 @@ init(file, pagesize, npages, progname)
  * run --
  *	Get a set of pages.
  */
-int
+gint
 run(hits, cachesize, pagesize, npages, progname)
-	int hits, cachesize, pagesize, npages;
-	const char *progname;
+	gint hits, cachesize, pagesize, npages;
+	const gchar *progname;
 {
 	DB_ENV *dbenv;
 	DB_MPOOLFILE *mfp;
 	db_pgno_t pageno;
-	int cnt, ret;
-	void *p;
+	gint cnt, ret;
+	gpointer p;
 
 	dbenv = NULL;
 	mfp = NULL;
@@ -219,7 +219,7 @@ run(hits, cachesize, pagesize, npages, progname)
 		if (*(db_pgno_t *)p != pageno) {
 			dbenv->errx(dbenv,
 			    "wrong page retrieved (%lu != %d)",
-			    (u_long)pageno, *(int *)p);
+			    (u_long)pageno, *(gint *)p);
 			goto err;
 		}
 		if ((ret = mfp->put(mfp, p, 0)) != 0) {
diff --git a/libdb/examples_c/ex_repquote/ex_repquote.h b/libdb/examples_c/ex_repquote/ex_repquote.h
index 5dbf6c9..93c16e4 100644
--- a/libdb/examples_c/ex_repquote/ex_repquote.h
+++ b/libdb/examples_c/ex_repquote/ex_repquote.h
@@ -13,13 +13,13 @@
 #define	SELF_EID	1
 
 typedef struct {
-	char *host;		/* Host name. */
+	gchar *host;		/* Host name. */
 	u_int32_t port;		/* Port on which to connect to this site. */
 } repsite_t;
 
 /* Globals */
-extern int master_eid;
-extern char *myaddr;
+extern gint master_eid;
+extern gchar *myaddr;
 
 struct __member;	typedef struct __member member_t;
 struct __machtab;	typedef struct __machtab machtab_t;
@@ -27,40 +27,40 @@ struct __machtab;	typedef struct __machtab machtab_t;
 /* Arguments for the connect_all thread. */
 typedef struct {
 	DB_ENV *dbenv;
-	const char *progname;
-	const char *home;
+	const gchar *progname;
+	const gchar *home;
 	machtab_t *machtab;
 	repsite_t *sites;
-	int nsites;
+	gint nsites;
 } all_args;
 
 /* Arguments for the connect_loop thread. */
 typedef struct {
 	DB_ENV *dbenv;
-	const char * home;
-	const char * progname;
+	const gchar * home;
+	const gchar * progname;
 	machtab_t *machtab;
-	int port;
+	gint port;
 } connect_args;
 
 #define	CACHESIZE	(10 * 1024 * 1024)
 #define	DATABASE	"quote.db"
 #define	SLEEPTIME	3
 
-void *connect_all __P((void *args));
-void *connect_thread __P((void *args));
-int doclient __P((DB_ENV *, const char *, machtab_t *));
-int domaster __P((DB_ENV *, const char *));
-int get_accepted_socket __P((const char *, int));
-int get_connected_socket __P((machtab_t *, const char *, const char *, int, int *, int *));
-int get_next_message __P((int, DBT *, DBT *));
-int listen_socket_init __P((const char *, int));
-int listen_socket_accept __P((machtab_t *, const char *, int, int *));
-int machtab_getinfo __P((machtab_t *, int, u_int32_t *, int *));
-int machtab_init __P((machtab_t **, int, int));
-void machtab_parm __P((machtab_t *, int *, int *, u_int32_t *));
-int machtab_rem __P((machtab_t *, int, int));
-int quote_send __P((DB_ENV *, const DBT *, const DBT *, int, u_int32_t));
+gpointer connect_all __P((gpointer args));
+gpointer connect_thread __P((gpointer args));
+gint doclient __P((DB_ENV *, const gchar *, machtab_t *));
+gint domaster __P((DB_ENV *, const gchar *));
+gint get_accepted_socket __P((const gchar *, int));
+gint get_connected_socket __P((machtab_t *, const gchar *, const gchar *, int, gint *, gint *));
+gint get_next_message __P((int, DBT *, DBT *));
+gint listen_socket_init __P((const gchar *, int));
+gint listen_socket_accept __P((machtab_t *, const gchar *, int, gint *));
+gint machtab_getinfo __P((machtab_t *, int, u_int32_t *, gint *));
+gint machtab_init __P((machtab_t **, int, int));
+void machtab_parm __P((machtab_t *, gint *, gint *, u_int32_t *));
+gint machtab_rem __P((machtab_t *, int, int));
+gint quote_send __P((DB_ENV *, const DBT *, const DBT *, int, u_int32_t));
 
 #ifndef COMPQUIET
 #define	COMPQUIET(x,y)	x = (y)
diff --git a/libdb/examples_c/ex_repquote/ex_rq_client.c b/libdb/examples_c/ex_repquote/ex_rq_client.c
index 6662872..537571e 100644
--- a/libdb/examples_c/ex_repquote/ex_rq_client.c
+++ b/libdb/examples_c/ex_repquote/ex_rq_client.c
@@ -22,12 +22,12 @@
 
 #include "ex_repquote.h"
 
-static void *check_loop __P((void *));
-static void *display_loop __P((void *));
-static int print_stocks __P((DBC *));
+static gpointer check_loop __P((gpointer));
+static gpointer display_loop __P((gpointer));
+static gint print_stocks __P((DBC *));
 
 typedef struct {
-	const char *progname;
+	const gchar *progname;
 	DB_ENV *dbenv;
 } disploop_args;
 
@@ -36,34 +36,34 @@ typedef struct {
 	machtab_t *machtab;
 } checkloop_args;
 
-int
+gint
 doclient(dbenv, progname, machtab)
 	DB_ENV *dbenv;
-	const char *progname;
+	const gchar *progname;
 	machtab_t *machtab;
 {
 	checkloop_args cargs;
 	disploop_args dargs;
 	pthread_t check_thr, disp_thr;
-	void *cstatus, *dstatus;
-	int rval, s;
+	gpointer cstatus, *dstatus;
+	gint rval, s;
 
 	rval = EXIT_SUCCESS;
 	s = -1;
 
 	memset(&dargs, 0, sizeof(dargs));
-	dstatus = (void *)EXIT_FAILURE;
+	dstatus = (gpointer)EXIT_FAILURE;
 
 	dargs.progname = progname;
 	dargs.dbenv = dbenv;
-	if (pthread_create(&disp_thr, NULL, display_loop, (void *)&dargs)) {
+	if (pthread_create(&disp_thr, NULL, display_loop, (gpointer)&dargs)) {
 		dbenv->err(dbenv, errno, "display_loop pthread_create failed");
 		goto err;
 	}
 
 	cargs.dbenv = dbenv;
 	cargs.machtab = machtab;
-	if (pthread_create(&check_thr, NULL, check_loop, (void *)&cargs)) {
+	if (pthread_create(&check_thr, NULL, check_loop, (gpointer)&cargs)) {
 		dbenv->err(dbenv, errno, "check_thread pthread_create failed");
 		goto err;
 	}
@@ -86,14 +86,14 @@ err:		rval = EXIT_FAILURE;
  * to identify itself (that would be a call to rep_start).  If that fails,
  * we trigger an election.
  */
-static void *
+static gpointer
 check_loop(args)
-	void *args;
+	gpointer args;
 {
 	DB_ENV *dbenv;
 	DBT dbt;
 	checkloop_args *cargs;
-	int count, n, pri;
+	gint count, n, pri;
 	machtab_t *machtab;
 	u_int32_t timeout;
 
@@ -125,19 +125,19 @@ check_loop(args)
 		sleep(IDLE_INTERVAL);
 	}
 
-	return ((void *)EXIT_SUCCESS);
+	return ((gpointer)EXIT_SUCCESS);
 }
 
-static void *
+static gpointer
 display_loop(args)
-	void *args;
+	gpointer args;
 {
 	DB *dbp;
 	DB_ENV *dbenv;
 	DBC *dbc;
-	const char *progname;
+	const gchar *progname;
 	disploop_args *dargs;
-	int ret, rval;
+	gint ret, rval;
 
 	dargs = (disploop_args *)args;
 	progname = dargs->progname;
@@ -154,7 +154,7 @@ display_loop(args)
 		if (dbp == NULL) {
 			if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
 				dbenv->err(dbenv, ret, "db_create");
-				return ((void *)EXIT_FAILURE);
+				return ((gpointer)EXIT_FAILURE);
 			}
 
 			if ((ret = dbp->open(dbp, NULL,
@@ -209,10 +209,10 @@ err:		rval = EXIT_FAILURE;
 
 	if (dbp != NULL && (ret = dbp->close(dbp, 0)) != 0) {
 		dbenv->err(dbenv, ret, "DB->close");
-		return ((void *)EXIT_FAILURE);
+		return ((gpointer)EXIT_FAILURE);
 	}
 
-	return ((void *)rval);
+	return ((gpointer)rval);
 }
 
 static int
@@ -222,8 +222,8 @@ print_stocks(dbc)
 	DBT key, data;
 #define	MAXKEYSIZE	10
 #define	MAXDATASIZE	20
-	char keybuf[MAXKEYSIZE + 1], databuf[MAXDATASIZE + 1];
-	int ret;
+	gchar keybuf[MAXKEYSIZE + 1], databuf[MAXDATASIZE + 1];
+	gint ret;
 	u_int32_t keysize, datasize;
 
 	memset(&key, 0, sizeof(key));
diff --git a/libdb/examples_c/ex_repquote/ex_rq_main.c b/libdb/examples_c/ex_repquote/ex_rq_main.c
index 3980361..d7dbbb0 100644
--- a/libdb/examples_c/ex_repquote/ex_rq_main.c
+++ b/libdb/examples_c/ex_repquote/ex_rq_main.c
@@ -23,20 +23,20 @@
 /*
  * Process globals (we could put these in the machtab I suppose.
  */
-int master_eid;
-char *myaddr;
+gint master_eid;
+gchar *myaddr;
 
-static int env_init __P((const char *, const char *, DB_ENV **, machtab_t *,
+static gint env_init __P((const gchar *, const gchar *, DB_ENV **, machtab_t *,
     u_int32_t));
-static void usage __P((const char *));
+static void usage __P((const gchar *));
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
+	extern gchar *optarg;
+	extern gint optind;
 	DB_ENV *dbenv;
 	DBT local;
 	enum { MASTER, CLIENT, UNKNOWN } whoami;
@@ -46,10 +46,10 @@ main(argc, argv)
 	pthread_t all_thr, conn_thr;
 	repsite_t site, *sitep, self, *selfp;
 	struct sigaction sigact;
-	int maxsites, nsites, ret, priority, totalsites;
-	char *c, ch;
-	const char *home, *progname;
-	void *astatus, *cstatus;
+	gint maxsites, nsites, ret, priority, totalsites;
+	gchar *c, ch;
+	const gchar *home, *progname;
+	gpointer astatus, *cstatus;
 
 	master_eid = DB_EID_INVALID;
 
@@ -252,7 +252,7 @@ err:	if (machtab != NULL)
  */
 static void
 usage(progname)
-	const char *progname;
+	const gchar *progname;
 {
 	fprintf(stderr, "usage: %s ", progname);
 	fprintf(stderr, "[-CM][-h home][-o host:port][-m host:port]%s",
@@ -261,16 +261,16 @@ usage(progname)
 }
 
 /* Open and configure an environment.  */
-int
+gint
 env_init(progname, home, dbenvp, machtab, flags)
-	const char *progname, *home;
+	const gchar *progname, *home;
 	DB_ENV **dbenvp;
 	machtab_t *machtab;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int ret;
-	char *prefix;
+	gint ret;
+	gchar *prefix;
 
 	if ((prefix = malloc(strlen(progname) + 2)) == NULL) {
 		fprintf(stderr,
diff --git a/libdb/examples_c/ex_repquote/ex_rq_master.c b/libdb/examples_c/ex_repquote/ex_rq_master.c
index 080e372..2533446 100644
--- a/libdb/examples_c/ex_repquote/ex_rq_master.c
+++ b/libdb/examples_c/ex_repquote/ex_rq_master.c
@@ -21,16 +21,16 @@
 
 #include "ex_repquote.h"
 
-static void *master_loop __P((void *));
+static gpointer master_loop __P((gpointer));
 
 #define	BUFSIZE 1024
 
-int
+gint
 domaster(dbenv, progname)
 	DB_ENV *dbenv;
-	const char *progname;
+	const gchar *progname;
 {
-	int ret, t_ret;
+	gint ret, t_ret;
 	pthread_t interface_thr;
 	pthread_attr_t attr;
 
@@ -43,7 +43,7 @@ domaster(dbenv, progname)
 		goto err;
 
 	if ((ret = pthread_create(&interface_thr,
-	    &attr, master_loop, (void *)dbenv)) != 0)
+	    &attr, master_loop, (gpointer)dbenv)) != 0)
 		goto err;
 
 err:	if ((t_ret = pthread_attr_destroy(&attr)) != 0 && ret == 0)
@@ -52,16 +52,16 @@ err:	if ((t_ret = pthread_attr_destroy(&attr)) != 0 && ret == 0)
 	return (ret);
 }
 
-static void *
+static gpointer
 master_loop(dbenvv)
-	void *dbenvv;
+	gpointer dbenvv;
 {
 	DB *dbp;
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	DBT key, data;
-	char buf[BUFSIZE], *rbuf;
-	int ret;
+	gchar buf[BUFSIZE], *rbuf;
+	gint ret;
 
 	dbp = NULL;
 	txn = NULL;
@@ -81,7 +81,7 @@ master_loop(dbenvv)
 			return (ret);
 #endif
 		if ((ret = db_create(&dbp, dbenv, 0)) != 0)
-			return ((void *)ret);
+			return ((gpointer)ret);
 
 		if ((ret = dbenv->txn_begin(dbenv, NULL, &txn, 0)) != 0)
 			goto err;
@@ -161,5 +161,5 @@ err:	if (txn != NULL)
 	if (dbp != NULL)
 		(void)dbp->close(dbp, DB_NOSYNC);
 
-	return ((void *)ret);
+	return ((gpointer)ret);
 }
diff --git a/libdb/examples_c/ex_repquote/ex_rq_net.c b/libdb/examples_c/ex_repquote/ex_rq_net.c
index bfadf0c..046a30f 100644
--- a/libdb/examples_c/ex_repquote/ex_rq_net.c
+++ b/libdb/examples_c/ex_repquote/ex_rq_net.c
@@ -28,8 +28,8 @@
 
 #include "ex_repquote.h"
 
-int machtab_add __P((machtab_t *, int, u_int32_t, int, int *));
-ssize_t readn __P((int, void *, size_t));
+gint machtab_add __P((machtab_t *, int, u_int32_t, int, gint *));
+ssize_t readn __P((int, gpointer , size_t));
 
 /*
  * This file defines the communication infrastructure for the ex_repquote
@@ -66,28 +66,28 @@ ssize_t readn __P((int, void *, size_t));
 
 struct __machtab {
 	LIST_HEAD(__machlist, __member) machlist;
-	int nextid;
+	gint nextid;
 	pthread_mutex_t mtmutex;
 	u_int32_t timeout_time;
-	int current;
-	int max;
-	int nsites;
-	int priority;
+	gint current;
+	gint max;
+	gint nsites;
+	gint priority;
 };
 
 /* Data structure that describes each entry in the machtab. */
 struct __member {
 	u_int32_t hostaddr;	/* Host IP address. */
-	int port;		/* Port number. */
-	int eid;		/* Application-specific machine id. */
-	int fd;			/* File descriptor for the socket. */
+	gint port;		/* Port number. */
+	gint eid;		/* Application-specific machine id. */
+	gint fd;			/* File descriptor for the socket. */
 	LIST_ENTRY(__member) links;
 				/* For linked list of all members we know of. */
 };
 
-static int quote_send_broadcast __P((machtab_t *,
+static gint quote_send_broadcast __P((machtab_t *,
     const DBT *, const DBT *, u_int32_t));
-static int quote_send_one __P((const DBT *, const DBT *, int, u_int32_t));
+static gint quote_send_one __P((const DBT *, const DBT *, int, u_int32_t));
 
 /*
  * machtab_init --
@@ -96,12 +96,12 @@ static int quote_send_one __P((const DBT *, const DBT *, int, u_int32_t));
  * number we've ever had on the list at one time.  We probably
  * want to make that smarter.
  */
-int
+gint
 machtab_init(machtabp, pri, nsites)
 	machtab_t **machtabp;
-	int pri, nsites;
+	gint pri, nsites;
 {
-	int ret;
+	gint ret;
 	machtab_t *machtab;
 
 	if ((machtab = malloc(sizeof(machtab_t))) == NULL)
@@ -128,14 +128,14 @@ machtab_init(machtabp, pri, nsites)
  *	Add a file descriptor to the table of machines, returning
  *  a new machine ID.
  */
-int
+gint
 machtab_add(machtab, fd, hostaddr, port, idp)
 	machtab_t *machtab;
-	int fd;
+	gint fd;
 	u_int32_t hostaddr;
-	int port, *idp;
+	gint port, *idp;
 {
-	int ret;
+	gint ret;
 	member_t *m, *member;
 
 	if ((member = malloc(sizeof(member_t))) == NULL)
@@ -178,14 +178,14 @@ machtab_add(machtab, fd, hostaddr, port, idp)
  * machtab_getinfo --
  *	Return host and port information for a particular machine id.
  */
-int
+gint
 machtab_getinfo(machtab, eid, hostp, portp)
 	machtab_t *machtab;
-	int eid;
+	gint eid;
 	u_int32_t *hostp;
-	int *portp;
+	gint *portp;
 {
-	int ret;
+	gint ret;
 	member_t *member;
 
 	if ((ret = pthread_mutex_lock(&machtab->mtmutex)) != 0)
@@ -212,13 +212,13 @@ machtab_getinfo(machtab, eid, hostp, portp)
  * whether we need to lock the machtab or not (0 indicates we do not
  * need to lock; non-zero indicates that we do need to lock).
  */
-int
+gint
 machtab_rem(machtab, eid, lock)
 	machtab_t *machtab;
-	int eid;
-	int lock;
+	gint eid;
+	gint lock;
 {
-	int found, ret;
+	gint found, ret;
 	member_t *member;
 
 	ret = 0;
@@ -249,7 +249,7 @@ machtab_rem(machtab, eid, lock)
 void
 machtab_parm(machtab, nump, prip, timeoutp)
 	machtab_t *machtab;
-	int *nump, *prip;
+	gint *nump, *prip;
 	u_int32_t *timeoutp;
 {
 	if (machtab->nsites == 0)
@@ -266,12 +266,12 @@ machtab_parm(machtab, nump, prip, timeoutp)
  *	a file descriptor for the socket, ready for an accept() call
  *	in a thread that we're happy to let block.
  */
-int
+gint
 listen_socket_init(progname, port)
-	const char *progname;
-	int port;
+	const gchar *progname;
+	gint port;
 {
-	int s;
+	gint s;
 	struct protoent *proto;
 	struct sockaddr_in si;
 
@@ -304,15 +304,15 @@ err:	fprintf(stderr, "%s: %s", progname, strerror(errno));
  *	Accept a connection on a socket.  This is essentially just a wrapper
  *	for accept(3).
  */
-int
+gint
 listen_socket_accept(machtab, progname, s, eidp)
 	machtab_t *machtab;
-	const char *progname;
-	int s, *eidp;
+	const gchar *progname;
+	gint s, *eidp;
 {
 	struct sockaddr_in si;
-	int si_len;
-	int host, ns, port, ret;
+	gint si_len;
+	gint host, ns, port, ret;
 
 	COMPQUIET(progname, NULL);
 
@@ -339,15 +339,15 @@ err:	close(ns);
  *	Listen on the specified port, and return a file descriptor
  *	when we have accepted a connection on it.
  */
-int
+gint
 get_accepted_socket(progname, port)
-	const char *progname;
-	int port;
+	const gchar *progname;
+	gint port;
 {
 	struct protoent *proto;
 	struct sockaddr_in si;
-	int si_len;
-	int s, ns;
+	gint si_len;
+	gint s, ns;
 
 	if ((proto = getprotobyname("tcp")) == NULL)
 		return (-1);
@@ -385,13 +385,13 @@ err:	fprintf(stderr, "%s: %s", progname, strerror(errno));
  *	open to this machine, then don't create another one, return the eid
  *	of the connection (in *eidp) and set is_open to 1.  Return 0.
  */
-int
+gint
 get_connected_socket(machtab, progname, remotehost, port, is_open, eidp)
 	machtab_t *machtab;
-	const char *progname, *remotehost;
-	int port, *is_open, *eidp;
+	const gchar *progname, *remotehost;
+	gint port, *is_open, *eidp;
 {
-	int ret, s;
+	gint ret, s;
 	struct hostent *hp;
 	struct protoent *proto;
 	struct sockaddr_in si;
@@ -411,7 +411,7 @@ get_connected_socket(machtab, progname, remotehost, port, is_open, eidp)
 	if ((s = socket(AF_INET, SOCK_STREAM, proto->p_proto)) < 0)
 		return (-1);
 	memset(&si, 0, sizeof(si));
-	memcpy((char *)&si.sin_addr, hp->h_addr, hp->h_length);
+	memcpy((gchar *)&si.sin_addr, hp->h_addr, hp->h_length);
 	addr = ntohl(si.sin_addr.s_addr);
 	ret = machtab_add(machtab, s, addr, port, eidp);
 	if (ret == EEXIST) {
@@ -443,9 +443,9 @@ get_connected_socket(machtab, progname, remotehost, port, is_open, eidp)
  * This function is called in a loop by both clients and masters, and
  * the resulting DBTs are manually dispatched to DB_ENV->rep_process_message().
  */
-int
+gint
 get_next_message(fd, rec, control)
-	int fd;
+	gint fd;
 	DBT *rec, *control;
 {
 	size_t nr;
@@ -510,13 +510,13 @@ get_next_message(fd, rec, control)
  */
 ssize_t
 readn(fd, vptr, n)
-	int fd;
-	void *vptr;
+	gint fd;
+	gpointer vptr;
 	size_t n;
 {
 	size_t nleft;
 	ssize_t nread;
-	char *ptr;
+	gchar *ptr;
 
 	ptr = vptr;
 	nleft = n;
@@ -544,14 +544,14 @@ readn(fd, vptr, n)
  * quote_send --
  * The f_send function for DB_ENV->set_rep_transport.
  */
-int
+gint
 quote_send(dbenv, control, rec, eid, flags)
 	DB_ENV *dbenv;
 	const DBT *control, *rec;
-	int eid;
+	gint eid;
 	u_int32_t flags;
 {
-	int fd, n, ret, t_ret;
+	gint fd, n, ret, t_ret;
 	machtab_t *machtab;
 	member_t *m;
 
@@ -608,7 +608,7 @@ quote_send_broadcast(machtab, rec, control, flags)
 	const DBT *rec, *control;
 	u_int32_t flags;
 {
-	int ret, sent;
+	gint ret, sent;
 	member_t *m, *next;
 
 	if ((ret = pthread_mutex_lock(&machtab->mtmutex)) != 0)
@@ -642,11 +642,11 @@ quote_send_broadcast(machtab, rec, control, flags)
 static int
 quote_send_one(rec, control, fd, flags)
 	const DBT *rec, *control;
-	int fd;
+	gint fd;
 	u_int32_t flags;
 
 {
-	int retry;
+	gint retry;
 	ssize_t bytes_left, nw;
 	u_int8_t *wp;
 
diff --git a/libdb/examples_c/ex_repquote/ex_rq_util.c b/libdb/examples_c/ex_repquote/ex_rq_util.c
index 40ef235..b026ef7 100644
--- a/libdb/examples_c/ex_repquote/ex_rq_util.c
+++ b/libdb/examples_c/ex_repquote/ex_rq_util.c
@@ -20,9 +20,9 @@
 
 #include "ex_repquote.h"
 
-static int connect_site __P((DB_ENV *, machtab_t *, const char *,
-   repsite_t *, int *, int *));
-void * elect_thread __P((void *));
+static gint connect_site __P((DB_ENV *, machtab_t *, const gchar *,
+   repsite_t *, gint *, gint *));
+gpointer  elect_thread __P((gpointer));
 
 typedef struct {
 	DB_ENV *dbenv;
@@ -31,9 +31,9 @@ typedef struct {
 
 typedef struct {
 	DB_ENV *dbenv;
-	const char *progname;
-	const char *home;
-	int fd;
+	const gchar *progname;
+	const gchar *home;
+	gint fd;
 	u_int32_t eid;
 	machtab_t *tab;
 } hm_loop_args;
@@ -43,22 +43,22 @@ typedef struct {
  * master to accept messages from a client as well as by clients
  * to communicate with other clients.
  */
-void *
+gpointer
 hm_loop(args)
-	void *args;
+	gpointer args;
 {
 	DB_ENV *dbenv;
 	DBT rec, control;
-	const char *c, *home, *progname;
-	int fd, eid, n, newm;
-	int open, pri, r, ret, t_ret, tmpid;
+	const gchar *c, *home, *progname;
+	gint fd, eid, n, newm;
+	gint open, pri, r, ret, t_ret, tmpid;
 	elect_args *ea;
 	hm_loop_args *ha;
 	machtab_t *tab;
 	pthread_t elect_thr;
 	repsite_t self;
 	u_int32_t timeout;
-	void *status;
+	gpointer status;
 
 	ea = NULL;
 
@@ -134,7 +134,7 @@ hm_loop(args)
 			if (strncmp(myaddr, rec.data, rec.size) == 0)
 				break;
 
-			self.host = (char *)rec.data;
+			self.host = (gchar *)rec.data;
 			self.host = strtok(self.host, ":");
 			if ((c = strtok(NULL, ":")) == NULL) {
 				dbenv->errx(dbenv, "Bad host specification");
@@ -167,7 +167,7 @@ hm_loop(args)
 			ea->dbenv = dbenv;
 			ea->machtab = tab;
 			ret = pthread_create(&elect_thr,
-			    NULL, elect_thread, (void *)ea);
+			    NULL, elect_thread, (gpointer)ea);
 			break;
 		case DB_REP_NEWMASTER:
 			/* Check if it's us. */
@@ -194,7 +194,7 @@ out:	if ((t_ret = machtab_rem(tab, eid, 1)) != 0 && ret == 0)
 	if (ea != NULL)
 		(void)pthread_join(elect_thr, &status);
 
-	return ((void *)ret);
+	return ((gpointer)ret);
 }
 
 /*
@@ -202,13 +202,13 @@ out:	if ((t_ret = machtab_rem(tab, eid, 1)) != 0 && ret == 0)
  * on a socket and then spawns off child threads to handle each new
  * connection.
  */
-void *
+gpointer
 connect_thread(args)
-	void *args;
+	gpointer args;
 {
 	DB_ENV *dbenv;
-	const char *home, *progname;
-	int fd, i, eid, ns, port, ret;
+	const gchar *home, *progname;
+	gint fd, i, eid, ns, port, ret;
 	hm_loop_args *ha;
 	connect_args *cargs;
 	machtab_t *machtab;
@@ -225,7 +225,7 @@ connect_thread(args)
 	port = cargs->port;
 
 	if ((ret = pthread_attr_init(&attr)) != 0)
-		return ((void *)EXIT_FAILURE);
+		return ((gpointer)EXIT_FAILURE);
 
 	if ((ret =
 	    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)) != 0)
@@ -255,7 +255,7 @@ connect_thread(args)
 		ha->tab = machtab;
 		ha->dbenv = dbenv;
 		if ((ret = pthread_create(&hm_thrs[i++], &attr,
-		    hm_loop, (void *)ha)) != 0)
+		    hm_loop, (gpointer)ha)) != 0)
 			goto err;
 		ha = NULL;
 	}
@@ -265,22 +265,22 @@ connect_thread(args)
 	ret = ENOMEM;
 
 err:	pthread_attr_destroy(&attr);
-	return (ret == 0 ? (void *)EXIT_SUCCESS : (void *)EXIT_FAILURE);
+	return (ret == 0 ? (gpointer)EXIT_SUCCESS : (gpointer)EXIT_FAILURE);
 }
 
 /*
  * Open a connection to everyone that we've been told about.  If we
  * cannot open some connections, keep trying.
  */
-void *
+gpointer
 connect_all(args)
-	void *args;
+	gpointer args;
 {
 	DB_ENV *dbenv;
 	all_args *aa;
-	const char *home, *progname;
+	const gchar *home, *progname;
 	hm_loop_args *ha;
-	int failed, i, eid, nsites, open, ret, *success;
+	gint failed, i, eid, nsites, open, ret, *success;
 	machtab_t *machtab;
 	repsite_t *sites;
 
@@ -333,19 +333,19 @@ connect_all(args)
 	}
 
 err:	free(success);
-	return (ret ? (void *)EXIT_FAILURE : (void *)EXIT_SUCCESS);
+	return (ret ? (gpointer)EXIT_FAILURE : (gpointer)EXIT_SUCCESS);
 }
 
-int
+gint
 connect_site(dbenv, machtab, progname, site, is_open, eidp)
 	DB_ENV *dbenv;
 	machtab_t *machtab;
-	const char *progname;
+	const gchar *progname;
 	repsite_t *site;
-	int *is_open;
-	int *eidp;
+	gint *is_open;
+	gint *eidp;
 {
-	int ret, s;
+	gint ret, s;
 	hm_loop_args *ha;
 	pthread_t hm_thr;
 
@@ -368,7 +368,7 @@ connect_site(dbenv, machtab, progname, site, is_open, eidp)
 	ha->dbenv = dbenv;
 
 	if ((ret = pthread_create(&hm_thr, NULL,
-	    hm_loop, (void *)ha)) != 0) {
+	    hm_loop, (gpointer)ha)) != 0) {
 		dbenv->err(dbenv, ret, "connect site");
 		goto err1;
 	}
@@ -384,13 +384,13 @@ err:
  * We need to spawn off a new thread in which to hold an election in
  * case we are the only thread listening on for messages.
  */
-void *
+gpointer
 elect_thread(args)
-	void *args;
+	gpointer args;
 {
 	DB_ENV *dbenv;
 	elect_args *eargs;
-	int n, ret, pri;
+	gint n, ret, pri;
 	machtab_t *machtab;
 	u_int32_t timeout;
 
@@ -408,5 +408,5 @@ elect_thread(args)
 	if (master_eid == SELF_EID)
 		ret = dbenv->rep_start(dbenv, NULL, DB_REP_MASTER);
 
-	return ((void *)(ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE));
+	return ((gpointer)(ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE));
 }
diff --git a/libdb/examples_c/ex_thread.c b/libdb/examples_c/ex_thread.c
index 191d593..d0a15e9 100644
--- a/libdb/examples_c/ex_thread.c
+++ b/libdb/examples_c/ex_thread.c
@@ -19,7 +19,7 @@
 #include <time.h>
 
 #ifdef _WIN32
-extern int getopt(int, char * const *, const char *);
+extern gint getopt(int, gchar * const *, const gchar *);
 #else
 #include <unistd.h>
 #endif
@@ -30,17 +30,17 @@ extern int getopt(int, char * const *, const char *);
  * NB: This application is written using POSIX 1003.1b-1993 pthreads
  * interfaces, which may not be portable to your system.
  */
-extern int sched_yield __P((void));		/* Pthread yield function. */
+extern gint sched_yield __P((void));		/* Pthread yield function. */
 
-int	db_init __P((const char *));
-void   *deadlock __P((void *));
-void	fatal __P((const char *, int, int));
+int	db_init __P((const gchar *));
+void   *deadlock __P((gpointer));
+void	fatal __P((const gchar *, int, int));
 void	onint __P((int));
-int	main __P((int, char *[]));
+int	main __P((int, gchar *[]));
 int	reader __P((int));
 void	stats __P((void));
-void   *trickle __P((void *));
-void   *tstart __P((void *));
+void   *trickle __P((gpointer));
+void   *tstart __P((gpointer));
 int	usage __P((void));
 void	word __P((void));
 int	writer __P((int));
@@ -48,13 +48,13 @@ int	writer __P((int));
 int	quit;					/* Interrupt handling flag. */
 
 struct _statistics {
-	int aborted;				/* Write. */
-	int aborts;				/* Read/write. */
-	int adds;				/* Write. */
-	int deletes;				/* Write. */
-	int txns;				/* Write. */
-	int found;				/* Read. */
-	int notfound;				/* Read. */
+	gint aborted;				/* Write. */
+	gint aborts;				/* Read/write. */
+	gint adds;				/* Write. */
+	gint deletes;				/* Write. */
+	gint txns;				/* Write. */
+	gint found;				/* Read. */
+	gint notfound;				/* Read. */
 } *perf;
 
 const char
@@ -77,7 +77,7 @@ int	nwriters;				/* -w */
 DB     *dbp;					/* Database handle. */
 DB_ENV *dbenv;					/* Database environment. */
 int	nthreads;				/* Total threads. */
-char  **list;					/* Word list. */
+gchar  **list;					/* Word list. */
 
 /*
  * ex_thread --
@@ -89,18 +89,18 @@ char  **list;					/* Word list. */
  *	% mkdir TESTDIR
  *	% ex_thread -h TESTDIR
  */
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int errno, optind;
+	extern gchar *optarg;
+	extern gint errno, optind;
 	DB_TXN *txnp;
 	pthread_t *tids;
-	int ch, i, ret;
-	const char *home;
-	void *retp;
+	gint ch, i, ret;
+	const gchar *home;
+	gpointer retp;
 
 	txnp = NULL;
 	nlist = 1000;
@@ -188,7 +188,7 @@ main(argc, argv)
 	/* Create reader/writer threads. */
 	for (i = 0; i < nreaders + nwriters; ++i)
 		if ((ret =
-		    pthread_create(&tids[i], NULL, tstart, (void *)i)) != 0)
+		    pthread_create(&tids[i], NULL, tstart, (gpointer)i)) != 0)
 			fatal("pthread_create", ret > 0 ? ret : errno, 1);
 
 	/* Create buffer pool trickle thread. */
@@ -215,13 +215,13 @@ err:	if (txnp != NULL)
 	return (EXIT_SUCCESS);
 }
 
-int
+gint
 reader(id)
-	int id;
+	gint id;
 {
 	DBT key, data;
-	int n, ret;
-	char buf[64];
+	gint n, ret;
+	gchar buf[64];
 
 	/*
 	 * DBT's must use local memory or malloc'd memory if the DB handle
@@ -259,22 +259,22 @@ reader(id)
 			break;
 		default:
 			sprintf(buf,
-			    "reader %d: dbp->get: %s", id, (char *)key.data);
+			    "reader %d: dbp->get: %s", id, (gchar *)key.data);
 			fatal(buf, ret, 0);
 		}
 	}
 	return (0);
 }
 
-int
+gint
 writer(id)
-	int id;
+	gint id;
 {
 	DBT key, data;
 	DB_TXN *tid;
 	time_t now, then;
-	int n, ret;
-	char buf[256], dbuf[10000];
+	gint n, ret;
+	gchar buf[256], dbuf[10000];
 
 	time(&now);
 	then = now;
@@ -407,8 +407,8 @@ commit:		/* The transaction finished, commit it. */
 void
 stats()
 {
-	int id;
-	char *p, buf[8192];
+	gint id;
+	gchar *p, buf[8192];
 
 	p = buf + sprintf(buf, "-------------\n");
 	for (id = 0; id < nreaders + nwriters;)
@@ -431,11 +431,11 @@ stats()
  * db_init --
  *	Initialize the environment.
  */
-int
+gint
 db_init(home)
-	const char *home;
+	const gchar *home;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = db_env_create(&dbenv, 0)) != 0) {
 		fprintf(stderr,
@@ -467,9 +467,9 @@ db_init(home)
  * tstart --
  *	Thread start function for readers and writers.
  */
-void *
+gpointer
 tstart(arg)
-	void *arg;
+	gpointer arg;
 {
 	pthread_t tid;
 	u_int id;
@@ -496,9 +496,9 @@ tstart(arg)
  * deadlock --
  *	Thread start function for DB_ENV->lock_detect.
  */
-void *
+gpointer
 deadlock(arg)
-	void *arg;
+	gpointer arg;
 {
 	struct timeval t;
 	pthread_t tid;
@@ -525,13 +525,13 @@ deadlock(arg)
  * trickle --
  *	Thread start function for memp_trickle.
  */
-void *
+gpointer
 trickle(arg)
-	void *arg;
+	gpointer arg;
 {
 	pthread_t tid;
-	int wrote;
-	char buf[64];
+	gint wrote;
+	gchar buf[64];
 
 	arg = arg;				/* XXX: shut the compiler up. */
 	tid = pthread_self();
@@ -562,13 +562,13 @@ void
 word()
 {
 	FILE *fp;
-	int cnt;
-	char buf[256];
+	gint cnt;
+	gchar buf[256];
 
 	if ((fp = fopen(WORDLIST, "r")) == NULL)
 		fatal(WORDLIST, errno, 1);
 
-	if ((list = malloc(nlist * sizeof(char *))) == NULL)
+	if ((list = malloc(nlist * sizeof(gchar *))) == NULL)
 		fatal(NULL, errno, 1);
 
 	for (cnt = 0; cnt < nlist; ++cnt) {
@@ -586,8 +586,8 @@ word()
  */
 void
 fatal(msg, err, syserr)
-	const char *msg;
-	int err, syserr;
+	const gchar *msg;
+	gint err, syserr;
 {
 	fprintf(stderr, "%s: ", progname);
 	if (msg != NULL) {
@@ -607,7 +607,7 @@ fatal(msg, err, syserr)
  * usage --
  *	Usage message.
  */
-int
+gint
 usage()
 {
 	(void)fprintf(stderr,
@@ -622,7 +622,7 @@ usage()
  */
 void
 onint(signo)
-	int signo;
+	gint signo;
 {
 	signo = 0;		/* Quiet compiler. */
 	quit = 1;
diff --git a/libdb/examples_c/ex_tpcb.c b/libdb/examples_c/ex_tpcb.c
index 6667c2c..6513af0 100644
--- a/libdb/examples_c/ex_tpcb.c
+++ b/libdb/examples_c/ex_tpcb.c
@@ -15,7 +15,7 @@
 #include <time.h>
 
 #ifdef _WIN32
-extern int getopt(int, char * const *, const char *);
+extern gint getopt(int, gchar * const *, const gchar *);
 #else
 #include <unistd.h>
 #endif
@@ -24,18 +24,18 @@ extern int getopt(int, char * const *, const char *);
 
 typedef enum { ACCOUNT, BRANCH, TELLER } FTYPE;
 
-DB_ENV	 *db_init __P((const char *, const char *, int, int, u_int32_t));
+DB_ENV	 *db_init __P((const gchar *, const gchar *, int, int, u_int32_t));
 int	  hpopulate __P((DB *, int, int, int, int));
-int	  populate __P((DB *, u_int32_t, u_int32_t, int, const char *));
+int	  populate __P((DB *, u_int32_t, u_int32_t, int, const gchar *));
 u_int32_t random_id __P((FTYPE, int, int, int));
 u_int32_t random_int __P((u_int32_t, u_int32_t));
 int	  tp_populate __P((DB_ENV *, int, int, int, int, int));
 int	  tp_run __P((DB_ENV *, int, int, int, int, int));
 int	  tp_txn __P((DB_ENV *, DB *, DB *, DB *, DB *, int, int, int, int));
 
-int	  invarg __P((const char *, int, const char *));
-int	  main __P((int, char *[]));
-int	  usage __P((const char *));
+int	  invarg __P((const gchar *, int, const gchar *));
+int	  main __P((int, gchar *[]));
+int	  usage __P((const gchar *));
 
 /*
  * This program implements a basic TPC/B driver program.  To create the
@@ -102,17 +102,17 @@ typedef struct _histrec {
 	u_int8_t	pad[RECLEN - 4 * sizeof(u_int32_t)];
 } histrec;
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern char *optarg;
-	extern int optind;
+	extern gchar *optarg;
+	extern gint optind;
 	DB_ENV *dbenv;
-	int accounts, branches, seed, tellers, history;
-	int ch, iflag, mpool, ntxns, ret, txn_no_sync, verbose;
-	const char *home, *progname;
+	gint accounts, branches, seed, tellers, history;
+	gint ch, iflag, mpool, ntxns, ret, txn_no_sync, verbose;
+	const gchar *home, *progname;
 
 	home = "TESTDIR";
 	progname = "ex_tpcb";
@@ -206,22 +206,22 @@ main(argc, argv)
 	return (EXIT_SUCCESS);
 }
 
-int
+gint
 invarg(progname, arg, str)
-	const char *progname;
-	int arg;
-	const char *str;
+	const gchar *progname;
+	gint arg;
+	const gchar *str;
 {
 	(void)fprintf(stderr,
 	    "%s: invalid argument for -%c: %s\n", progname, arg, str);
 	return (EXIT_FAILURE);
 }
 
-int
+gint
 usage(progname)
-	const char *progname;
+	const gchar *progname;
 {
-	const char *a1, *a2;
+	const gchar *a1, *a2;
 
 	a1 = "[-fv] [-a accounts] [-b branches]\n";
 	a2 = "\t[-c cache_size] [-h home] [-S seed] [-s history] [-t tellers]";
@@ -237,13 +237,13 @@ usage(progname)
  */
 DB_ENV *
 db_init(home, prefix, cachesize, initializing, flags)
-	const char *home, *prefix;
-	int cachesize, initializing;
+	const gchar *home, *prefix;
+	gint cachesize, initializing;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
 	u_int32_t local_flags;
-	int ret;
+	gint ret;
 
 	if ((ret = db_env_create(&dbenv, 0)) != 0) {
 		dbenv->err(dbenv, ret, "db_env_create");
@@ -272,16 +272,16 @@ db_init(home, prefix, cachesize, initializing, flags)
  * Initialize the database to the specified number of accounts, branches,
  * history records, and tellers.
  */
-int
+gint
 tp_populate(env, accounts, branches, history, tellers, verbose)
 	DB_ENV *env;
-	int accounts, branches, history, tellers, verbose;
+	gint accounts, branches, history, tellers, verbose;
 {
 	DB *dbp;
 	u_int32_t balance, idnum, oflags;
 	u_int32_t end_anum, end_bnum, end_tnum;
 	u_int32_t start_anum, start_bnum, start_tnum;
-	int ret;
+	gint ret;
 
 	idnum = BEGID;
 	balance = 500000;
@@ -388,16 +388,16 @@ tp_populate(env, accounts, branches, history, tellers, verbose)
 	return (0);
 }
 
-int
+gint
 populate(dbp, start_id, balance, nrecs, msg)
 	DB *dbp;
 	u_int32_t start_id, balance;
-	int nrecs;
-	const char *msg;
+	gint nrecs;
+	const gchar *msg;
 {
 	DBT kdbt, ddbt;
 	defrec drec;
-	int i, ret;
+	gint i, ret;
 
 	kdbt.flags = 0;
 	kdbt.data = &drec.id;
@@ -420,15 +420,15 @@ populate(dbp, start_id, balance, nrecs, msg)
 	return (0);
 }
 
-int
+gint
 hpopulate(dbp, history, accounts, branches, tellers)
 	DB *dbp;
-	int history, accounts, branches, tellers;
+	gint history, accounts, branches, tellers;
 {
 	DBT kdbt, ddbt;
 	histrec hrec;
 	db_recno_t key;
-	int i, ret;
+	gint i, ret;
 
 	memset(&kdbt, 0, sizeof(kdbt));
 	memset(&ddbt, 0, sizeof(ddbt));
@@ -456,7 +456,7 @@ random_int(lo, hi)
 	u_int32_t lo, hi;
 {
 	u_int32_t ret;
-	int t;
+	gint t;
 
 #ifndef RAND_MAX
 #define	RAND_MAX	0x7fffffff
@@ -471,7 +471,7 @@ random_int(lo, hi)
 u_int32_t
 random_id(type, accounts, branches, tellers)
 	FTYPE type;
-	int accounts, branches, tellers;
+	gint accounts, branches, tellers;
 {
 	u_int32_t min, max, num;
 
@@ -493,14 +493,14 @@ random_id(type, accounts, branches, tellers)
 	return (random_int(min, max));
 }
 
-int
+gint
 tp_run(dbenv, n, accounts, branches, tellers, verbose)
 	DB_ENV *dbenv;
-	int n, accounts, branches, tellers, verbose;
+	gint n, accounts, branches, tellers, verbose;
 {
 	DB *adb, *bdb, *hdb, *tdb;
 	double gtps, itps;
-	int failed, ifailed, ret, txns;
+	gint failed, ifailed, ret, txns;
 	time_t starttime, curtime, lasttime;
 
 	adb = bdb = hdb = tdb = NULL;
@@ -584,11 +584,11 @@ err:	if (adb != NULL)
 /*
  * XXX Figure out the appropriate way to pick out IDs.
  */
-int
+gint
 tp_txn(dbenv, adb, bdb, tdb, hdb, accounts, branches, tellers, verbose)
 	DB_ENV *dbenv;
 	DB *adb, *bdb, *tdb, *hdb;
-	int accounts, branches, tellers, verbose;
+	gint accounts, branches, tellers, verbose;
 {
 	DBC *acurs, *bcurs, *tcurs;
 	DBT d_dbt, d_histdbt, k_dbt, k_histdbt;
@@ -596,7 +596,7 @@ tp_txn(dbenv, adb, bdb, tdb, hdb, accounts, branches, tellers, verbose)
 	db_recno_t key;
 	defrec rec;
 	histrec hrec;
-	int account, branch, teller, ret;
+	gint account, branch, teller, ret;
 
 	t = NULL;
 	acurs = bcurs = tcurs = NULL;
diff --git a/libdb/fileops/fileops_auto.c b/libdb/fileops/fileops_auto.c
index f38640b..74d9dfc 100644
--- a/libdb/fileops/fileops_auto.c
+++ b/libdb/fileops/fileops_auto.c
@@ -19,10 +19,10 @@
 #include "dbinc/fop.h"
 
 /*
- * PUBLIC: int __fop_create_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __fop_create_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, const DBT *, u_int32_t, u_int32_t));
  */
-int
+gint
 __fop_create_log(dbenv, txnid, ret_lsnp, flags,
     name, appname, mode)
 	DB_ENV *dbenv;
@@ -38,7 +38,7 @@ __fop_create_log(dbenv, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___fop_create;
@@ -119,19 +119,19 @@ __fop_create_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __fop_create_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __fop_create_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __fop_create_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -152,21 +152,21 @@ __fop_create_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __fop_create_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __fop_create_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __fop_create_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__fop_create_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -195,18 +195,18 @@ __fop_create_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __fop_create_read __P((DB_ENV *, void *, __fop_create_args **));
+ * PUBLIC: gint __fop_create_read __P((DB_ENV *, gpointer , __fop_create_args **));
  */
-int
+gint
 __fop_create_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__fop_create_args **argpp;
 {
 	__fop_create_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__fop_create_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -243,10 +243,10 @@ __fop_create_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __fop_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __fop_remove_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, const DBT *, const DBT *, u_int32_t));
  */
-int
+gint
 __fop_remove_log(dbenv, txnid, ret_lsnp, flags,
     name, fid, appname)
 	DB_ENV *dbenv;
@@ -262,7 +262,7 @@ __fop_remove_log(dbenv, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___fop_remove;
@@ -350,19 +350,19 @@ __fop_remove_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __fop_remove_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __fop_remove_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __fop_remove_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -383,21 +383,21 @@ __fop_remove_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __fop_remove_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __fop_remove_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __fop_remove_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__fop_remove_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -431,18 +431,18 @@ __fop_remove_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __fop_remove_read __P((DB_ENV *, void *, __fop_remove_args **));
+ * PUBLIC: gint __fop_remove_read __P((DB_ENV *, gpointer , __fop_remove_args **));
  */
-int
+gint
 __fop_remove_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__fop_remove_args **argpp;
 {
 	__fop_remove_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__fop_remove_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -481,11 +481,11 @@ __fop_remove_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __fop_write_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __fop_write_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, const DBT *, u_int32_t, u_int32_t, const DBT *,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __fop_write_log(dbenv, txnid, ret_lsnp, flags,
     name, appname, offset, page, flag)
 	DB_ENV *dbenv;
@@ -503,7 +503,7 @@ __fop_write_log(dbenv, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___fop_write;
@@ -601,19 +601,19 @@ __fop_write_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __fop_write_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __fop_write_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __fop_write_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -634,21 +634,21 @@ __fop_write_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __fop_write_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __fop_write_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __fop_write_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__fop_write_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -684,18 +684,18 @@ __fop_write_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __fop_write_read __P((DB_ENV *, void *, __fop_write_args **));
+ * PUBLIC: gint __fop_write_read __P((DB_ENV *, gpointer , __fop_write_args **));
  */
-int
+gint
 __fop_write_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__fop_write_args **argpp;
 {
 	__fop_write_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__fop_write_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -742,10 +742,10 @@ __fop_write_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __fop_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __fop_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, const DBT *, const DBT *, const DBT *, u_int32_t));
  */
-int
+gint
 __fop_rename_log(dbenv, txnid, ret_lsnp, flags,
     oldname, newname, fileid, appname)
 	DB_ENV *dbenv;
@@ -762,7 +762,7 @@ __fop_rename_log(dbenv, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___fop_rename;
@@ -862,19 +862,19 @@ __fop_rename_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __fop_rename_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __fop_rename_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __fop_rename_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -895,21 +895,21 @@ __fop_rename_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __fop_rename_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __fop_rename_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __fop_rename_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__fop_rename_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -949,18 +949,18 @@ __fop_rename_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __fop_rename_read __P((DB_ENV *, void *, __fop_rename_args **));
+ * PUBLIC: gint __fop_rename_read __P((DB_ENV *, gpointer , __fop_rename_args **));
  */
-int
+gint
 __fop_rename_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__fop_rename_args **argpp;
 {
 	__fop_rename_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__fop_rename_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1005,11 +1005,11 @@ __fop_rename_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __fop_file_remove_log __P((DB_ENV *, DB_TXN *,
+ * PUBLIC: gint __fop_file_remove_log __P((DB_ENV *, DB_TXN *,
  * PUBLIC:     DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *,
  * PUBLIC:     u_int32_t, u_int32_t));
  */
-int
+gint
 __fop_file_remove_log(dbenv, txnid, ret_lsnp, flags,
     real_fid, tmp_fid, name, appname, child)
 	DB_ENV *dbenv;
@@ -1027,7 +1027,7 @@ __fop_file_remove_log(dbenv, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___fop_file_remove;
@@ -1132,19 +1132,19 @@ __fop_file_remove_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __fop_file_remove_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __fop_file_remove_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __fop_file_remove_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -1165,21 +1165,21 @@ __fop_file_remove_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __fop_file_remove_print __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __fop_file_remove_print __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __fop_file_remove_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__fop_file_remove_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1220,19 +1220,19 @@ __fop_file_remove_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __fop_file_remove_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __fop_file_remove_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __fop_file_remove_args **));
  */
-int
+gint
 __fop_file_remove_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__fop_file_remove_args **argpp;
 {
 	__fop_file_remove_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__fop_file_remove_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1281,16 +1281,16 @@ __fop_file_remove_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __fop_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __fop_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __fop_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __fop_create_print, DB___fop_create)) != 0)
@@ -1311,16 +1311,16 @@ __fop_init_print(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __fop_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __fop_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __fop_init_getpgnos(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __fop_create_getpgnos, DB___fop_create)) != 0)
@@ -1341,16 +1341,16 @@ __fop_init_getpgnos(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __fop_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __fop_init_recover __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __fop_init_recover(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __fop_create_recover, DB___fop_create)) != 0)
diff --git a/libdb/fileops/fop_basic.c b/libdb/fileops/fop_basic.c
index c039518..4bbd556 100644
--- a/libdb/fileops/fop_basic.c
+++ b/libdb/fileops/fop_basic.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -35,23 +35,23 @@ static const char revid[] = "$Id$";
  * to create DB files now, potentially blobs, queue extents and anything
  * else you wish to store in a file system object.
  *
- * PUBLIC: int __fop_create __P((DB_ENV *,
- * PUBLIC:     DB_TXN *, DB_FH *, const char *, APPNAME, int));
+ * PUBLIC: gint __fop_create __P((DB_ENV *,
+ * PUBLIC:     DB_TXN *, DB_FH *, const gchar *, APPNAME, int));
  */
-int
+gint
 __fop_create(dbenv, txn, fhp, name, appname, mode)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	DB_FH *fhp;
-	const char *name;
+	const gchar *name;
 	APPNAME appname;
-	int mode;
+	gint mode;
 {
 	DB_FH fh;
 	DB_LSN lsn;
 	DBT data;
-	char *real_name;
-	int do_close, ret;
+	gchar *real_name;
+	gint do_close, ret;
 
 	ret = 0;
 	real_name = NULL;
@@ -73,7 +73,7 @@ __fop_create(dbenv, txn, fhp, name, appname, mode)
 
 	if (DBENV_LOGGING(dbenv)) {
 		memset(&data, 0, sizeof(data));
-		data.data = (void *)name;
+		data.data = (gpointer)name;
 		data.size = (u_int32_t)strlen(name) + 1;
 		if ((ret = __fop_create_log(dbenv,
 		    txn, &lsn, DB_FLUSH, &data, (u_int32_t)appname, mode)) != 0)
@@ -98,21 +98,21 @@ DB_TEST_RECOVERY_LABEL
  * __fop_remove --
  *	Remove a file system object.
  *
- * PUBLIC: int __fop_remove __P((DB_ENV *,
- * PUBLIC:     DB_TXN *, u_int8_t *, const char *, APPNAME));
+ * PUBLIC: gint __fop_remove __P((DB_ENV *,
+ * PUBLIC:     DB_TXN *, u_int8_t *, const gchar *, APPNAME));
  */
-int
+gint
 __fop_remove(dbenv, txn, fileid, name, appname)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
 	u_int8_t *fileid;
-	const char *name;
+	const gchar *name;
 	APPNAME appname;
 {
 	DB_LSN lsn;
 	DBT fdbt, ndbt;
-	char *real_name;
-	int ret;
+	gchar *real_name;
+	gint ret;
 
 	real_name = NULL;
 
@@ -130,7 +130,7 @@ __fop_remove(dbenv, txn, fileid, name, appname)
 			fdbt.data = fileid;
 			fdbt.size = fileid == NULL ? 0 : DB_FILE_ID_LEN;
 			memset(&ndbt, 0, sizeof(ndbt));
-			ndbt.data = (void *)name;
+			ndbt.data = (gpointer)name;
 			ndbt.size = (u_int32_t)strlen(name) + 1;
 			if ((ret = __fop_remove_log(dbenv,
 			    txn, &lsn, 0, &ndbt, &fdbt, appname)) != 0)
@@ -157,14 +157,14 @@ err:	if (real_name != NULL)
  * handling, then we'll have to zero out regions on abort (and possibly
  * log the before image of the data in the log record).
  *
- * PUBLIC: int __fop_write __P((DB_ENV *, DB_TXN *, const char *, APPNAME,
+ * PUBLIC: gint __fop_write __P((DB_ENV *, DB_TXN *, const gchar *, APPNAME,
  * PUBLIC:     DB_FH *, u_int32_t, u_int8_t *, u_int32_t, u_int32_t));
  */
-int
+gint
 __fop_write(dbenv, txn, name, appname, fhp, off, buf, size, istmp)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	APPNAME appname;
 	DB_FH *fhp;
 	u_int32_t off;
@@ -174,8 +174,8 @@ __fop_write(dbenv, txn, name, appname, fhp, off, buf, size, istmp)
 	DB_FH fh;
 	DB_LSN lsn;
 	DBT data, namedbt;
-	char *real_name;
-	int ret, t_ret, we_opened;
+	gchar *real_name;
+	gint ret, t_ret, we_opened;
 	size_t nbytes;
 
 	ret = 0;
@@ -191,7 +191,7 @@ __fop_write(dbenv, txn, name, appname, fhp, off, buf, size, istmp)
 		data.data = buf;
 		data.size = size;
 		memset(&namedbt, 0, sizeof(namedbt));
-		namedbt.data = (void *)name;
+		namedbt.data = (gpointer)name;
 		namedbt.size = (u_int32_t)strlen(name) + 1;
 		if ((ret = __fop_write_log(dbenv,
 		    txn, &lsn, 0, &namedbt, appname, off, &data, istmp)) != 0)
@@ -228,22 +228,22 @@ err:	if (we_opened)
  * __fop_rename --
  *	Change a file's name.
  *
- * PUBLIC: int __fop_rename __P((DB_ENV *,
- * PUBLIC:      DB_TXN *, const char *, const char *, u_int8_t *, APPNAME));
+ * PUBLIC: gint __fop_rename __P((DB_ENV *,
+ * PUBLIC:      DB_TXN *, const gchar *, const gchar *, u_int8_t *, APPNAME));
  */
-int
+gint
 __fop_rename(dbenv, txn, oldname, newname, fid, appname)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	const char *oldname;
-	const char *newname;
+	const gchar *oldname;
+	const gchar *newname;
 	u_int8_t *fid;
 	APPNAME appname;
 {
 	DB_LSN lsn;
 	DBT fiddbt, new, old;
-	int ret;
-	char *n, *o;
+	gint ret;
+	gchar *n, *o;
 
 	if ((ret = __db_appname(dbenv, appname, oldname, 0, NULL, &o)) != 0)
 		goto err;
@@ -254,9 +254,9 @@ __fop_rename(dbenv, txn, oldname, newname, fid, appname)
 		memset(&old, 0, sizeof(old));
 		memset(&new, 0, sizeof(new));
 		memset(&fiddbt, 0, sizeof(fiddbt));
-		old.data = (void *)oldname;
+		old.data = (gpointer)oldname;
 		old.size = (u_int32_t)strlen(oldname) + 1;
-		new.data = (void *)newname;
+		new.data = (gpointer)newname;
 		new.size = (u_int32_t)strlen(newname) + 1;
 		fiddbt.data = fid;
 		fiddbt.size = DB_FILE_ID_LEN;
diff --git a/libdb/fileops/fop_rec.c b/libdb/fileops/fop_rec.c
index 1b08fb6..989cbd7 100644
--- a/libdb/fileops/fop_rec.c
+++ b/libdb/fileops/fop_rec.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,21 +27,21 @@ static const char revid[] = "$Id$";
  * __fop_create_recover --
  *	Recovery function for create.
  *
- * PUBLIC: int __fop_create_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __fop_create_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __fop_create_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	DB_FH fh;
 	__fop_create_args *argp;
-	char *real_name;
-	int ret;
+	gchar *real_name;
+	gint ret;
 
 	real_name = NULL;
 	COMPQUIET(info, NULL);
@@ -49,7 +49,7 @@ __fop_create_recover(dbenv, dbtp, lsnp, op, info)
 	REC_NOOP_INTRO(__fop_create_read);
 
 	if ((ret = __db_appname(dbenv, (APPNAME)argp->appname,
-	    (const char *)argp->name.data, 0, NULL, &real_name)) != 0)
+	    (const gchar *)argp->name.data, 0, NULL, &real_name)) != 0)
 		goto out;
 
 	if (DB_UNDO(op))
@@ -71,20 +71,20 @@ out: if (real_name != NULL)
  * __fop_remove_recover --
  *	Recovery function for remove.
  *
- * PUBLIC: int __fop_remove_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __fop_remove_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __fop_remove_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__fop_remove_args *argp;
-	char *real_name;
-	int ret;
+	gchar *real_name;
+	gint ret;
 
 	real_name = NULL;
 	COMPQUIET(info, NULL);
@@ -92,7 +92,7 @@ __fop_remove_recover(dbenv, dbtp, lsnp, op, info)
 	REC_NOOP_INTRO(__fop_remove_read);
 
 	if ((ret = __db_appname(dbenv, (APPNAME)argp->appname,
-	    (const char *)argp->name.data, 0, NULL, &real_name)) != 0)
+	    (const gchar *)argp->name.data, 0, NULL, &real_name)) != 0)
 		goto out;
 
 	if (DB_REDO(op) && (ret = dbenv->memp_nameop(dbenv,
@@ -109,19 +109,19 @@ out:	if (real_name != NULL)
  * __fop_write_recover --
  *	Recovery function for writechunk.
  *
- * PUBLIC: int __fop_write_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __fop_write_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __fop_write_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__fop_write_args *argp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__fop_write_print);
@@ -142,21 +142,21 @@ __fop_write_recover(dbenv, dbtp, lsnp, op, info)
  * __fop_rename_recover --
  *	Recovery function for rename.
  *
- * PUBLIC: int __fop_rename_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __fop_rename_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __fop_rename_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__fop_rename_args *argp;
 	DBMETA *meta;
-	char *real_new, *real_old, *src;
-	int ret;
+	gchar *real_new, *real_old, *src;
+	gint ret;
 	u_int8_t *fileid, mbuf[DBMETASIZE];
 
 	real_new = NULL;
@@ -170,10 +170,10 @@ __fop_rename_recover(dbenv, dbtp, lsnp, op, info)
 	fileid = argp->fileid.data;
 
 	if ((ret = __db_appname(dbenv, (APPNAME)argp->appname,
-	    (const char *)argp->newname.data, 0, NULL, &real_new)) != 0)
+	    (const gchar *)argp->newname.data, 0, NULL, &real_new)) != 0)
 		goto out;
 	if ((ret = __db_appname(dbenv, (APPNAME)argp->appname,
-	    (const char *)argp->oldname.data, 0, NULL, &real_old)) != 0)
+	    (const gchar *)argp->oldname.data, 0, NULL, &real_old)) != 0)
 		goto out;
 
 	/*
@@ -200,10 +200,10 @@ __fop_rename_recover(dbenv, dbtp, lsnp, op, info)
 
 	if (DB_UNDO(op))
 		(void)dbenv->memp_nameop(dbenv, fileid,
-		    (const char *)argp->oldname.data, real_new, real_old);
+		    (const gchar *)argp->oldname.data, real_new, real_old);
 	if (DB_REDO(op))
 		(void)dbenv->memp_nameop(dbenv, fileid,
-		    (const char *)argp->newname.data, real_old, real_new);
+		    (const gchar *)argp->newname.data, real_old, real_new);
 
 done:	*lsnp = argp->prev_lsn;
 out:	if (real_new != NULL)
@@ -222,21 +222,21 @@ out:	if (real_new != NULL)
  * exists and then set the status of the child transaction depending on
  * what we find out.
  *
- * PUBLIC: int __fop_file_remove_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __fop_file_remove_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __fop_file_remove_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__fop_file_remove_args *argp;
 	DBMETA *meta;
-	char *real_name;
-	int is_real, is_tmp, ret;
+	gchar *real_name;
+	gint is_real, is_tmp, ret;
 	size_t len;
 	u_int8_t mbuf[DBMETASIZE];
 	u_int32_t cstat;
diff --git a/libdb/fileops/fop_util.c b/libdb/fileops/fop_util.c
index 4c651bd..c3ea708 100644
--- a/libdb/fileops/fop_util.c
+++ b/libdb/fileops/fop_util.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -28,7 +28,7 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/txn.h"
 
-static int __fop_set_pgsize __P((DB *, DB_FH *, const char *));
+static gint __fop_set_pgsize __P((DB *, DB_FH *, const gchar *));
 
 /*
  * Acquire the environment meta-data lock.  The parameters are the
@@ -76,11 +76,11 @@ static int __fop_set_pgsize __P((DB *, DB_FH *, const char *));
  * do this as a lock_vec call that releases the enviroment lock before
  * acquiring the handle lock.
  *
- * PUBLIC: int __fop_lock_handle __P((DB_ENV *,
+ * PUBLIC: gint __fop_lock_handle __P((DB_ENV *,
  * PUBLIC:     DB *, u_int32_t, db_lockmode_t, DB_LOCK *, u_int32_t));
  *
  */
-int
+gint
 __fop_lock_handle(dbenv, dbp, locker, mode, elock, flags)
 	DB_ENV *dbenv;
 	DB *dbp;
@@ -92,7 +92,7 @@ __fop_lock_handle(dbenv, dbp, locker, mode, elock, flags)
 	DBT fileobj;
 	DB_LOCKREQ reqs[2], *ereq;
 	DB_LOCK_ILOCK lock_desc;
-	int ret;
+	gint ret;
 
 	if (!LOCKING_ON(dbenv) || F_ISSET(dbp, DB_AM_COMPENSATE))
 		return (0);
@@ -156,24 +156,24 @@ __fop_lock_handle(dbenv, dbp, locker, mode, elock, flags)
  * buffer cache or obtaining a lock (we use this unique fileid to lock
  * as well as to identify like files in the cache).
  *
- * PUBLIC: int __fop_file_setup __P((DB *,
- * PUBLIC:     DB_TXN *, const char *, int, u_int32_t, u_int32_t *));
+ * PUBLIC: gint __fop_file_setup __P((DB *,
+ * PUBLIC:     DB_TXN *, const gchar *, int, u_int32_t, u_int32_t *));
  */
-int
+gint
 __fop_file_setup(dbp, txn, name, mode, flags, retidp)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
-	int mode;
+	const gchar *name;
+	gint mode;
 	u_int32_t flags, *retidp;
 {
 	DB_ENV *dbenv;
 	DB_FH fh, *fhp;
 	DB_LOCK elock, tmp_lock;
 	DB_TXN *stxn;
-	char *real_name, *real_tmpname, *tmpname;
+	gchar *real_name, *real_tmpname, *tmpname;
 	db_lockmode_t lmode;
-	int created_fhp, created_locker, ret, tmp_created, t_ret, truncating;
+	gint created_fhp, created_locker, ret, tmp_created, t_ret, truncating;
 	size_t len;
 	u_int32_t locker, oflags;
 	u_int8_t mbuf[DBMETASIZE];
@@ -265,7 +265,7 @@ reopen:		ret = __fop_read_meta(dbenv, real_name,
 		 */
 		if (ret != 0 &&
 		    LF_ISSET(DB_FCNTL_LOCKING) && txn == NULL && len == 0) {
-			tmpname = (char *)real_name;
+			tmpname = (gchar *)real_name;
 			real_name = NULL;
 			goto creat2;
 		}
@@ -332,7 +332,7 @@ do_trunc:		if ((ret = __os_open(dbenv,
 			 */
 			tmp_lock = dbp->handle_lock;
 			truncating = 1;
-			tmpname = (char *)name;
+			tmpname = (gchar *)name;
 			goto creat2;
 		}
 
@@ -489,11 +489,11 @@ static int
 __fop_set_pgsize(dbp, fhp, name)
 	DB *dbp;
 	DB_FH *fhp;
-	const char *name;
+	const gchar *name;
 {
 	DB_ENV *dbenv;
 	u_int32_t iopsize;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -539,20 +539,20 @@ __fop_set_pgsize(dbp, fhp, name)
  * page lock with a different type (DB_HANDLE_LOCK) for the long-term handle.
  * locks.
  *
- * PUBLIC: int __fop_subdb_setup __P((DB *, DB_TXN *,
- * PUBLIC:     const char *, const char *, int, u_int32_t));
+ * PUBLIC: gint __fop_subdb_setup __P((DB *, DB_TXN *,
+ * PUBLIC:     const gchar *, const gchar *, int, u_int32_t));
  */
-int
+gint
 __fop_subdb_setup(dbp, txn, mname, name, mode, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *mname, *name;
-	int mode;
+	const gchar *mname, *name;
+	gint mode;
 	u_int32_t flags;
 {
 	DB *mdbp;
 	DB_ENV *dbenv;
-	int do_remove, ret;
+	gint do_remove, ret;
 
 	mdbp = NULL;
 	dbenv = dbp->dbenv;
@@ -669,21 +669,21 @@ DB_TEST_RECOVERY_LABEL
  * __fop_remove_setup --
  *	Open handle appropriately and lock for removal of a database file.
  *
- * PUBLIC: int __fop_remove_setup __P((DB *,
- * PUBLIC:      DB_TXN *, const char *, u_int32_t));
+ * PUBLIC: gint __fop_remove_setup __P((DB *,
+ * PUBLIC:      DB_TXN *, const gchar *, u_int32_t));
  */
-int
+gint
 __fop_remove_setup(dbp, txn, name, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 	DB_LOCK elock;
 	u_int8_t mbuf[DBMETASIZE];
-	int ret;
+	gint ret;
 
 	COMPQUIET(flags, 0);
 	dbenv = dbp->dbenv;
@@ -744,23 +744,23 @@ err:	(void)REL_ENVLOCK(dbenv, &elock);
  *	Read the meta-data page from a file and return it in buf.  The
  * open file handle is returned in fhp.
  *
- * PUBLIC: int __fop_read_meta __P((DB_ENV *, const char *,
+ * PUBLIC: gint __fop_read_meta __P((DB_ENV *, const gchar *,
  * PUBLIC:     u_int8_t *, size_t, DB_FH *, int, size_t *, u_int32_t));
  */
-int
+gint
 __fop_read_meta(dbenv, name, buf, size, fhp, errok, nbytesp, flags)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 	u_int8_t *buf;
 	size_t size;
 	DB_FH *fhp;
-	int errok;
+	gint errok;
 	size_t *nbytesp;
 	u_int32_t flags;
 {
 	DB_FH fh, *lfhp;
 	size_t nr;
-	int myfhp, ret;
+	gint myfhp, ret;
 
 	nr = 0;
 	myfhp = 0;
@@ -802,14 +802,14 @@ err:	/*
  * we use for remove and rename (remove is simply a rename with a delayed
  * remove).
  *
- * PUBLIC: int __fop_dummy __P((DB *,
- * PUBLIC:     DB_TXN *, const char *, const char *, u_int32_t));
+ * PUBLIC: gint __fop_dummy __P((DB *,
+ * PUBLIC:     DB_TXN *, const gchar *, const gchar *, u_int32_t));
  */
-int
+gint
 __fop_dummy(dbp, txn, old, new, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *old, *new;
+	const gchar *old, *new;
 	u_int32_t flags;
 {
 	DB *tmpdbp;
@@ -818,9 +818,9 @@ __fop_dummy(dbp, txn, old, new, flags)
 	DB_LSN lsn;
 	DBT fiddbt, namedbt, tmpdbt;
 	DB_TXN *stxn;
-	char *back;
-	char *realback, *realnew, *realold;
-	int ret, t_ret;
+	gchar *back;
+	gchar *realback, *realnew, *realold;
+	gint ret, t_ret;
 	u_int8_t mbuf[DBMETASIZE];
 	u_int32_t locker, stxnid;
 
@@ -909,7 +909,7 @@ __fop_dummy(dbp, txn, old, new, flags)
 		fiddbt.size = DB_FILE_ID_LEN;
 		tmpdbt.data = tmpdbp->fileid;
 		tmpdbt.size = DB_FILE_ID_LEN;
-		namedbt.data = (void *)old;
+		namedbt.data = (gpointer)old;
 		namedbt.size = (u_int32_t)strlen(old) + 1;
 		if ((t_ret =
 		    __fop_file_remove_log(dbenv, txn, &lsn, 0, &fiddbt,
@@ -948,17 +948,17 @@ err:	(void)REL_ENVLOCK(dbenv, &elock);
  * and the subsequent calls in __db_rename do the work for the
  * transactional case).
  *
- * PUBLIC: int __fop_dbrename __P((DB *, const char *, const char *));
+ * PUBLIC: gint __fop_dbrename __P((DB *, const gchar *, const gchar *));
  */
-int
+gint
 __fop_dbrename(dbp, old, new)
 	DB *dbp;
-	const char *old, *new;
+	const gchar *old, *new;
 {
 	DB_ENV *dbenv;
 	DB_LOCK elock;
-	char *real_new, *real_old;
-	int ret, tret;
+	gchar *real_new, *real_old;
+	gint ret, tret;
 
 	dbenv = dbp->dbenv;
 	real_new = NULL;
diff --git a/libdb/hash/hash.c b/libdb/hash/hash.c
index 8f22b58..b2cef7b 100644
--- a/libdb/hash/hash.c
+++ b/libdb/hash/hash.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -60,18 +60,18 @@ static const char revid[] = "$Id$";
 #include "dbinc/hash.h"
 #include "dbinc/lock.h"
 
-static int  __ham_bulk __P((DBC *, DBT *, u_int32_t));
-static int  __ham_c_close __P((DBC *, db_pgno_t, int *));
-static int  __ham_c_del __P((DBC *));
-static int  __ham_c_destroy __P((DBC *));
-static int  __ham_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-static int  __ham_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-static int  __ham_c_writelock __P((DBC *));
-static int  __ham_dup_return __P((DBC *, DBT *, u_int32_t));
-static int  __ham_expand_table __P((DBC *));
-static int  __ham_lookup __P((DBC *,
+static gint  __ham_bulk __P((DBC *, DBT *, u_int32_t));
+static gint  __ham_c_close __P((DBC *, db_pgno_t, gint *));
+static gint  __ham_c_del __P((DBC *));
+static gint  __ham_c_destroy __P((DBC *));
+static gint  __ham_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+static gint  __ham_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+static gint  __ham_c_writelock __P((DBC *));
+static gint  __ham_dup_return __P((DBC *, DBT *, u_int32_t));
+static gint  __ham_expand_table __P((DBC *));
+static gint  __ham_lookup __P((DBC *,
 		const DBT *, u_int32_t, db_lockmode_t, db_pgno_t *));
-static int  __ham_overwrite __P((DBC *, DBT *, u_int32_t));
+static gint  __ham_overwrite __P((DBC *, DBT *, u_int32_t));
 
 /*
  * __ham_quick_delete --
@@ -91,13 +91,13 @@ static int  __ham_overwrite __P((DBC *, DBT *, u_int32_t));
  *	set, or to the sole key/data pair when the key does not have a
  *	duplicate set, before the function is called.
  *
- * PUBLIC: int __ham_quick_delete __P((DBC *));
+ * PUBLIC: gint __ham_quick_delete __P((DBC *));
  */
-int
+gint
 __ham_quick_delete(dbc)
 	DBC *dbc;
 {
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	if ((ret = __ham_get_meta(dbc)) != 0)
 		return (ret);
@@ -126,15 +126,15 @@ __ham_quick_delete(dbc)
  * __ham_c_init --
  *	Initialize the hash-specific portion of a cursor.
  *
- * PUBLIC: int __ham_c_init __P((DBC *));
+ * PUBLIC: gint __ham_c_init __P((DBC *));
  */
-int
+gint
 __ham_c_init(dbc)
 	DBC *dbc;
 {
 	DB_ENV *dbenv;
 	HASH_CURSOR *new_curs;
-	int ret;
+	gint ret;
 
 	dbenv = dbc->dbp->dbenv;
 	if ((ret = __os_calloc(dbenv,
@@ -175,12 +175,12 @@ static int
 __ham_c_close(dbc, root_pgno, rmroot)
 	DBC *dbc;
 	db_pgno_t root_pgno;
-	int *rmroot;
+	gint *rmroot;
 {
 	DB_MPOOLFILE *mpf;
 	HASH_CURSOR *hcp;
 	HKEYDATA *dp;
-	int doroot, gotmeta, ret, t_ret;
+	gint doroot, gotmeta, ret, t_ret;
 	u_int32_t dirty;
 
 	COMPQUIET(rmroot, 0);
@@ -248,9 +248,9 @@ __ham_c_destroy(dbc)
  * __ham_c_count --
  *	Return a count of on-page duplicates.
  *
- * PUBLIC: int __ham_c_count __P((DBC *, db_recno_t *));
+ * PUBLIC: gint __ham_c_count __P((DBC *, db_recno_t *));
  */
-int
+gint
 __ham_c_count(dbc, recnop)
 	DBC *dbc;
 	db_recno_t *recnop;
@@ -260,7 +260,7 @@ __ham_c_count(dbc, recnop)
 	HASH_CURSOR *hcp;
 	db_indx_t len;
 	db_recno_t recno;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int8_t *p, *pend;
 
 	dbp = dbc->dbp;
@@ -309,7 +309,7 @@ __ham_c_del(dbc)
 	DBT repldbt;
 	DB_MPOOLFILE *mpf;
 	HASH_CURSOR *hcp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -368,9 +368,9 @@ out:	if (hcp->page != NULL) {
  *	Duplicate a hash cursor, such that the new one holds appropriate
  *	locks for the position of the original.
  *
- * PUBLIC: int __ham_c_dup __P((DBC *, DBC *));
+ * PUBLIC: gint __ham_c_dup __P((DBC *, DBC *));
  */
-int
+gint
 __ham_c_dup(orig_dbc, new_dbc)
 	DBC *orig_dbc, *new_dbc;
 {
@@ -418,7 +418,7 @@ __ham_c_get(dbc, key, data, flags, pgnop)
 	DB_MPOOLFILE *mpf;
 	HASH_CURSOR *hcp;
 	db_lockmode_t lock_type;
-	int get_key, ret, t_ret;
+	gint get_key, ret, t_ret;
 
 	hcp = (HASH_CURSOR *)dbc->internal;
 	dbp = dbc->dbp;
@@ -603,8 +603,8 @@ __ham_bulk(dbc, data, flags)
 	int32_t  *endp, key_off, *offp, *saveoff;
 	u_int32_t key_size, size, space;
 	u_int8_t *dbuf, *dp, *hk, *np, *tmp;
-	int is_dup, is_key;
-	int need_pg, next_key, no_dup, pagesize, ret, t_ret;
+	gint is_dup, is_key;
+	gint need_pg, next_key, no_dup, pagesize, ret, t_ret;
 
 	ret = 0;
 	key_off = 0;
@@ -973,7 +973,7 @@ __ham_c_put(dbc, key, data, flags, pgnop)
 	DBT tmp_val, *myval;
 	HASH_CURSOR *hcp;
 	u_int32_t nbytes;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	/*
 	 * The compiler doesn't realize that we only use this when ret is
@@ -1088,7 +1088,7 @@ __ham_expand_table(dbc)
 	PAGE *h;
 	db_pgno_t pgno, mpgno;
 	u_int32_t newalloc, new_bucket, old_bucket;
-	int dirty_meta, got_meta, logn, new_double, ret;
+	gint dirty_meta, got_meta, logn, new_double, ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1269,7 +1269,7 @@ __ham_dup_return(dbc, val, flags)
 	db_pgno_t pgno;
 	u_int32_t off, tlen;
 	u_int8_t *hk, type;
-	int cmp, ret;
+	gint cmp, ret;
 	db_indx_t len;
 
 	/* Check for duplicate and return the first one. */
@@ -1455,11 +1455,11 @@ __ham_overwrite(dbc, nval, flags)
 	DB_ENV *dbenv;
 	HASH_CURSOR *hcp;
 	DBT *myval, tmp_val, tmp_val2;
-	void *newrec;
+	gpointer newrec;
 	u_int8_t *hk, *p;
 	u_int32_t len, nondup_size;
 	db_indx_t newsize;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -1664,7 +1664,7 @@ __ham_lookup(dbc, key, sought, mode, pgnop)
 	HASH_CURSOR *hcp;
 	db_pgno_t pgno;
 	u_int32_t tlen;
-	int match, ret;
+	gint match, ret;
 	u_int8_t *hk, *dk;
 
 	dbp = dbc->dbp;
@@ -1741,18 +1741,18 @@ found_key:			F_SET(hcp, H_OK);
  *	Initialize a dbt using some possibly already allocated storage
  *	for items.
  *
- * PUBLIC: int __ham_init_dbt __P((DB_ENV *,
- * PUBLIC:     DBT *, u_int32_t, void **, u_int32_t *));
+ * PUBLIC: gint __ham_init_dbt __P((DB_ENV *,
+ * PUBLIC:     DBT *, u_int32_t, gpointer *, u_int32_t *));
  */
-int
+gint
 __ham_init_dbt(dbenv, dbt, size, bufp, sizep)
 	DB_ENV *dbenv;
 	DBT *dbt;
 	u_int32_t size;
-	void **bufp;
+	gpointer *bufp;
 	u_int32_t *sizep;
 {
-	int ret;
+	gint ret;
 
 	memset(dbt, 0, sizeof(*dbt));
 	if (*sizep < size) {
@@ -1777,14 +1777,14 @@ __ham_init_dbt(dbenv, dbt, size, bufp, sizep)
  * added (add == 1) or deleted (add == 0).
  * dup indicates if the addition occurred into a duplicate set.
  *
- * PUBLIC: int __ham_c_update
+ * PUBLIC: gint __ham_c_update
  * PUBLIC:    __P((DBC *, u_int32_t, int, int));
  */
-int
+gint
 __ham_c_update(dbc, len, add, is_dup)
 	DBC *dbc;
 	u_int32_t len;
-	int add, is_dup;
+	gint add, is_dup;
 {
 	DB *dbp, *ldbp;
 	DBC *cp;
@@ -1792,7 +1792,7 @@ __ham_c_update(dbc, len, add, is_dup)
 	DB_LSN lsn;
 	DB_TXN *my_txn;
 	HASH_CURSOR *hcp, *lcp;
-	int found, ret;
+	gint found, ret;
 	u_int32_t order;
 
 	dbp = dbc->dbp;
@@ -1965,9 +1965,9 @@ __ham_c_update(dbc, len, add, is_dup)
  * cursors on a split.  The latter is so we can update cursors when we
  * move items off page.
  *
- * PUBLIC: int __ham_get_clist __P((DB *, db_pgno_t, u_int32_t, DBC ***));
+ * PUBLIC: gint __ham_get_clist __P((DB *, db_pgno_t, u_int32_t, DBC ***));
  */
-int
+gint
 __ham_get_clist(dbp, pgno, indx, listp)
 	DB *dbp;
 	db_pgno_t pgno;
@@ -1977,7 +1977,7 @@ __ham_get_clist(dbp, pgno, indx, listp)
 	DB *ldbp;
 	DBC *cp;
 	DB_ENV *dbenv;
-	int nalloc, nused, ret;
+	gint nalloc, nused, ret;
 
 	/*
 	 * Assume that finding anything is the exception, so optimize for
@@ -2039,7 +2039,7 @@ __ham_c_writelock(dbc)
 	DB_ENV *dbenv;
 	DB_LOCK tmp_lock;
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	/*
 	 * All we need do is acquire the lock and let the off-page
diff --git a/libdb/hash/hash_auto.c b/libdb/hash/hash_auto.c
index 918797b..f4ae9d3 100644
--- a/libdb/hash/hash_auto.c
+++ b/libdb/hash/hash_auto.c
@@ -19,11 +19,11 @@
 #include "dbinc/txn.h"
 
 /*
- * PUBLIC: int __ham_insdel_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_insdel_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *,
  * PUBLIC:     const DBT *, const DBT *));
  */
-int
+gint
 __ham_insdel_log(dbp, txnid, ret_lsnp, flags,
     opcode, pgno, ndx, pagelsn, key,
     data)
@@ -44,7 +44,7 @@ __ham_insdel_log(dbp, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -160,16 +160,16 @@ __ham_insdel_log(dbp, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __ham_insdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_insdel_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_insdel_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -206,21 +206,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __ham_insdel_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_insdel_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_insdel_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_insdel_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -259,18 +259,18 @@ __ham_insdel_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_insdel_read __P((DB_ENV *, void *, __ham_insdel_args **));
+ * PUBLIC: gint __ham_insdel_read __P((DB_ENV *, gpointer , __ham_insdel_args **));
  */
-int
+gint
 __ham_insdel_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_insdel_args **argpp;
 {
 	__ham_insdel_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_insdel_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -324,11 +324,11 @@ __ham_insdel_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_newpage_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_newpage_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *,
  * PUBLIC:     db_pgno_t, DB_LSN *));
  */
-int
+gint
 __ham_newpage_log(dbp, txnid, ret_lsnp, flags,
     opcode, prev_pgno, prevlsn, new_pgno, pagelsn,
     next_pgno, nextlsn)
@@ -349,7 +349,7 @@ __ham_newpage_log(dbp, txnid, ret_lsnp, flags,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -460,16 +460,16 @@ __ham_newpage_log(dbp, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __ham_newpage_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_newpage_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_newpage_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -528,19 +528,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_newpage_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_newpage_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -572,19 +572,19 @@ __ham_newpage_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_newpage_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __ham_newpage_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __ham_newpage_args **));
  */
-int
+gint
 __ham_newpage_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_newpage_args **argpp;
 {
 	__ham_newpage_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_newpage_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -636,10 +636,10 @@ __ham_newpage_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_splitdata_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_splitdata_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
  */
-int
+gint
 __ham_splitdata_log(dbp, txnid, ret_lsnp, flags, opcode, pgno, pageimage, pagelsn)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -656,7 +656,7 @@ __ham_splitdata_log(dbp, txnid, ret_lsnp, flags, opcode, pgno, pageimage, pagels
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -755,16 +755,16 @@ __ham_splitdata_log(dbp, txnid, ret_lsnp, flags, opcode, pgno, pageimage, pagels
 }
 
 /*
- * PUBLIC: int __ham_splitdata_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_splitdata_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_splitdata_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -801,21 +801,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_splitdata_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_splitdata_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -847,19 +847,19 @@ __ham_splitdata_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_splitdata_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __ham_splitdata_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __ham_splitdata_args **));
  */
-int
+gint
 __ham_splitdata_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_splitdata_args **argpp;
 {
 	__ham_splitdata_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_splitdata_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -903,11 +903,11 @@ __ham_splitdata_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_replace_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_replace_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, u_int32_t, DB_LSN *, int32_t, const DBT *,
  * PUBLIC:     const DBT *, u_int32_t));
  */
-int
+gint
 __ham_replace_log(dbp, txnid, ret_lsnp, flags, pgno, ndx, pagelsn, off, olditem,
     newitem, makedup)
 	DB *dbp;
@@ -928,7 +928,7 @@ __ham_replace_log(dbp, txnid, ret_lsnp, flags, pgno, ndx, pagelsn, off, olditem,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1049,16 +1049,16 @@ __ham_replace_log(dbp, txnid, ret_lsnp, flags, pgno, ndx, pagelsn, off, olditem,
 }
 
 /*
- * PUBLIC: int __ham_replace_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_replace_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_replace_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1095,21 +1095,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_replace_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_replace_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1149,19 +1149,19 @@ __ham_replace_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_replace_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __ham_replace_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __ham_replace_args **));
  */
-int
+gint
 __ham_replace_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_replace_args **argpp;
 {
 	__ham_replace_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_replace_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1219,11 +1219,11 @@ __ham_replace_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_copypage_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_copypage_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t,
  * PUBLIC:     DB_LSN *, const DBT *));
  */
-int
+gint
 __ham_copypage_log(dbp, txnid, ret_lsnp, flags, pgno, pagelsn, next_pgno, nextlsn, nnext_pgno,
     nnextlsn, page)
 	DB *dbp;
@@ -1244,7 +1244,7 @@ __ham_copypage_log(dbp, txnid, ret_lsnp, flags, pgno, pagelsn, next_pgno, nextls
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1362,16 +1362,16 @@ __ham_copypage_log(dbp, txnid, ret_lsnp, flags, pgno, pagelsn, next_pgno, nextls
 }
 
 /*
- * PUBLIC: int __ham_copypage_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_copypage_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_copypage_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1426,21 +1426,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_copypage_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_copypage_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1477,19 +1477,19 @@ __ham_copypage_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_copypage_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __ham_copypage_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __ham_copypage_args **));
  */
-int
+gint
 __ham_copypage_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_copypage_args **argpp;
 {
 	__ham_copypage_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_copypage_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1543,11 +1543,11 @@ __ham_copypage_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_metagroup_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_metagroup_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *,
  * PUBLIC:     db_pgno_t, DB_LSN *, u_int32_t));
  */
-int
+gint
 __ham_metagroup_log(dbp, txnid, ret_lsnp, flags, bucket, mmpgno, mmetalsn, mpgno, metalsn,
     pgno, pagelsn, newalloc)
 	DB *dbp;
@@ -1568,7 +1568,7 @@ __ham_metagroup_log(dbp, txnid, ret_lsnp, flags, bucket, mmpgno, mmetalsn, mpgno
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1684,16 +1684,16 @@ __ham_metagroup_log(dbp, txnid, ret_lsnp, flags, bucket, mmpgno, mmetalsn, mpgno
 }
 
 /*
- * PUBLIC: int __ham_metagroup_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_metagroup_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_metagroup_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -1748,19 +1748,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_metagroup_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_metagroup_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1793,19 +1793,19 @@ __ham_metagroup_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_metagroup_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __ham_metagroup_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __ham_metagroup_args **));
  */
-int
+gint
 __ham_metagroup_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_metagroup_args **argpp;
 {
 	__ham_metagroup_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_metagroup_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1861,10 +1861,10 @@ __ham_metagroup_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_groupalloc_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_groupalloc_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t));
  */
-int
+gint
 __ham_groupalloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, start_pgno, num, free)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -1880,7 +1880,7 @@ __ham_groupalloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, start_pgno, num, fre
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1972,16 +1972,16 @@ __ham_groupalloc_log(dbp, txnid, ret_lsnp, flags, meta_lsn, start_pgno, num, fre
 }
 
 /*
- * PUBLIC: int __ham_groupalloc_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_groupalloc_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_groupalloc_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -2018,19 +2018,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_groupalloc_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_groupalloc_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -2057,19 +2057,19 @@ __ham_groupalloc_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_groupalloc_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __ham_groupalloc_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __ham_groupalloc_args **));
  */
-int
+gint
 __ham_groupalloc_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_groupalloc_args **argpp;
 {
 	__ham_groupalloc_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_groupalloc_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2111,11 +2111,11 @@ __ham_groupalloc_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_curadj_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_curadj_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t, int, int,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __ham_curadj_log(dbp, txnid, ret_lsnp, flags, pgno, indx, len, dup_off, add,
     is_dup, order)
 	DB *dbp;
@@ -2126,8 +2126,8 @@ __ham_curadj_log(dbp, txnid, ret_lsnp, flags, pgno, indx, len, dup_off, add,
 	u_int32_t indx;
 	u_int32_t len;
 	u_int32_t dup_off;
-	int add;
-	int is_dup;
+	gint add;
+	gint is_dup;
 	u_int32_t order;
 {
 	DBT logrec;
@@ -2135,7 +2135,7 @@ __ham_curadj_log(dbp, txnid, ret_lsnp, flags, pgno, indx, len, dup_off, add,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -2240,19 +2240,19 @@ __ham_curadj_log(dbp, txnid, ret_lsnp, flags, pgno, indx, len, dup_off, add,
 }
 
 /*
- * PUBLIC: int __ham_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_curadj_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_curadj_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -2273,19 +2273,19 @@ __ham_curadj_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __ham_curadj_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_curadj_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_curadj_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_curadj_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -2314,18 +2314,18 @@ __ham_curadj_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_curadj_read __P((DB_ENV *, void *, __ham_curadj_args **));
+ * PUBLIC: gint __ham_curadj_read __P((DB_ENV *, gpointer , __ham_curadj_args **));
  */
-int
+gint
 __ham_curadj_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_curadj_args **argpp;
 {
 	__ham_curadj_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_curadj_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2380,11 +2380,11 @@ __ham_curadj_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_chgpg_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __ham_chgpg_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_ham_mode, db_pgno_t, db_pgno_t, u_int32_t,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __ham_chgpg_log(dbp, txnid, ret_lsnp, flags, mode, old_pgno, new_pgno, old_indx, new_indx)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -2401,7 +2401,7 @@ __ham_chgpg_log(dbp, txnid, ret_lsnp, flags, mode, old_pgno, new_pgno, old_indx,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -2496,19 +2496,19 @@ __ham_chgpg_log(dbp, txnid, ret_lsnp, flags, mode, old_pgno, new_pgno, old_indx,
 }
 
 /*
- * PUBLIC: int __ham_chgpg_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_chgpg_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_chgpg_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -2529,19 +2529,19 @@ __ham_chgpg_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __ham_chgpg_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __ham_chgpg_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __ham_chgpg_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__ham_chgpg_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -2568,18 +2568,18 @@ __ham_chgpg_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __ham_chgpg_read __P((DB_ENV *, void *, __ham_chgpg_args **));
+ * PUBLIC: gint __ham_chgpg_read __P((DB_ENV *, gpointer , __ham_chgpg_args **));
  */
-int
+gint
 __ham_chgpg_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__ham_chgpg_args **argpp;
 {
 	__ham_chgpg_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__ham_chgpg_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -2626,16 +2626,16 @@ __ham_chgpg_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __ham_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __ham_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __ham_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __ham_insdel_print, DB___ham_insdel)) != 0)
@@ -2668,16 +2668,16 @@ __ham_init_print(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __ham_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __ham_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __ham_init_getpgnos(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __ham_insdel_getpgnos, DB___ham_insdel)) != 0)
@@ -2710,16 +2710,16 @@ __ham_init_getpgnos(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __ham_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __ham_init_recover __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __ham_init_recover(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __ham_insdel_recover, DB___ham_insdel)) != 0)
diff --git a/libdb/hash/hash_conv.c b/libdb/hash/hash_conv.c
index 073aecc..64e0625 100644
--- a/libdb/hash/hash_conv.c
+++ b/libdb/hash/hash_conv.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,14 +24,14 @@ static const char revid[] = "$Id$";
  *	Convert host-specific page layout from the host-independent format
  *	stored on disk.
  *
- * PUBLIC: int __ham_pgin __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
+ * PUBLIC: gint __ham_pgin __P((DB_ENV *, DB *, db_pgno_t, gpointer , DBT *));
  */
-int
+gint
 __ham_pgin(dbenv, dummydbp, pg, pp, cookie)
 	DB_ENV *dbenv;
 	DB *dummydbp;
 	db_pgno_t pg;
-	void *pp;
+	gpointer pp;
 	DBT *cookie;
 {
 	DB_PGINFO *pginfo;
@@ -63,14 +63,14 @@ __ham_pgin(dbenv, dummydbp, pg, pp, cookie)
  *	Convert host-specific page layout to the host-independent format
  *	stored on disk.
  *
- * PUBLIC: int __ham_pgout __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
+ * PUBLIC: gint __ham_pgout __P((DB_ENV *, DB *, db_pgno_t, gpointer , DBT *));
  */
-int
+gint
 __ham_pgout(dbenv, dummydbp, pg, pp, cookie)
 	DB_ENV *dbenv;
 	DB *dummydbp;
 	db_pgno_t pg;
-	void *pp;
+	gpointer pp;
 	DBT *cookie;
 {
 	DB_PGINFO *pginfo;
@@ -89,14 +89,14 @@ __ham_pgout(dbenv, dummydbp, pg, pp, cookie)
  * __ham_mswap --
  *	Swap the bytes on the hash metadata page.
  *
- * PUBLIC: int __ham_mswap __P((void *));
+ * PUBLIC: gint __ham_mswap __P((gpointer));
  */
-int
+gint
 __ham_mswap(pg)
-	void *pg;
+	gpointer pg;
 {
 	u_int8_t *p;
-	int i;
+	gint i;
 
 	__db_metaswap(pg);
 
diff --git a/libdb/hash/hash_dup.c b/libdb/hash/hash_dup.c
index 102fab5..c041863 100644
--- a/libdb/hash/hash_dup.c
+++ b/libdb/hash/hash_dup.c
@@ -38,7 +38,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 /*
@@ -59,11 +59,11 @@ static const char revid[] = "$Id$";
 #include "dbinc/hash.h"
 #include "dbinc/btree.h"
 
-static int __ham_c_chgpg __P((DBC *,
+static gint __ham_c_chgpg __P((DBC *,
     db_pgno_t, u_int32_t, db_pgno_t, u_int32_t));
-static int __ham_check_move __P((DBC *, u_int32_t));
-static int __ham_dcursor __P((DBC *, db_pgno_t, u_int32_t));
-static int __ham_move_offpage __P((DBC *, PAGE *, u_int32_t, db_pgno_t));
+static gint __ham_check_move __P((DBC *, u_int32_t));
+static gint __ham_dcursor __P((DBC *, db_pgno_t, u_int32_t));
+static gint __ham_move_offpage __P((DBC *, PAGE *, u_int32_t, db_pgno_t));
 
 /*
  * Called from hash_access to add a duplicate key. nval is the new
@@ -78,9 +78,9 @@ static int __ham_move_offpage __P((DBC *, PAGE *, u_int32_t, db_pgno_t));
  * Case 4: The element is large enough to push the duplicate set onto a
  *	   separate page.
  *
- * PUBLIC: int __ham_add_dup __P((DBC *, DBT *, u_int32_t, db_pgno_t *));
+ * PUBLIC: gint __ham_add_dup __P((DBC *, DBT *, u_int32_t, db_pgno_t *));
  */
-int
+gint
 __ham_add_dup(dbc, nval, flags, pgnop)
 	DBC *dbc;
 	DBT *nval;
@@ -92,7 +92,7 @@ __ham_add_dup(dbc, nval, flags, pgnop)
 	DB_MPOOLFILE *mpf;
 	HASH_CURSOR *hcp;
 	u_int32_t add_bytes, new_size;
-	int cmp, ret;
+	gint cmp, ret;
 	u_int8_t *hk;
 
 	dbp = dbc->dbp;
@@ -237,9 +237,9 @@ __ham_add_dup(dbc, nval, flags, pgnop)
 /*
  * Convert an on-page set of duplicates to an offpage set of duplicates.
  *
- * PUBLIC: int __ham_dup_convert __P((DBC *));
+ * PUBLIC: gint __ham_dup_convert __P((DBC *));
  */
-int
+gint
 __ham_dup_convert(dbc)
 	DBC *dbc;
 {
@@ -253,7 +253,7 @@ __ham_dup_convert(dbc)
 	HOFFPAGE ho;
 	PAGE *dp;
 	db_indx_t i, len, off;
-	int c, ret, t_ret;
+	gint c, ret, t_ret;
 	u_int8_t *p, *pend;
 
 	dbp = dbc->dbp;
@@ -393,19 +393,19 @@ err:	if (ret == 0)
  * information set appropriately. If the incoming dbt is a partial, assume
  * we are creating a new entry and make sure that we do any initial padding.
  *
- * PUBLIC: int __ham_make_dup __P((DB_ENV *,
- * PUBLIC:     const DBT *, DBT *d, void **, u_int32_t *));
+ * PUBLIC: gint __ham_make_dup __P((DB_ENV *,
+ * PUBLIC:     const DBT *, DBT *d, gpointer *, u_int32_t *));
  */
-int
+gint
 __ham_make_dup(dbenv, notdup, duplicate, bufp, sizep)
 	DB_ENV *dbenv;
 	const DBT *notdup;
 	DBT *duplicate;
-	void **bufp;
+	gpointer *bufp;
 	u_int32_t *sizep;
 {
 	db_indx_t tsize, item_size;
-	int ret;
+	gint ret;
 	u_int8_t *p;
 
 	item_size = (db_indx_t)notdup->size;
@@ -457,7 +457,7 @@ __ham_check_move(dbc, add_len)
 	db_pgno_t next_pgno;
 	u_int32_t new_datalen, old_len, rectype;
 	u_int8_t *hk;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -647,7 +647,7 @@ __ham_move_offpage(dbc, pagep, ndx, pgno)
 	db_indx_t i, *inp;
 	int32_t shrink;
 	u_int8_t *src;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	od.type = H_OFFDUP;
@@ -694,20 +694,20 @@ __ham_move_offpage(dbc, pagep, ndx, pgno)
  *	we exit with the cursor set appropriately.
  *
  * PUBLIC: void __ham_dsearch
- * PUBLIC:     __P((DBC *, DBT *, u_int32_t *, int *, u_int32_t));
+ * PUBLIC:     __P((DBC *, DBT *, u_int32_t *, gint *, u_int32_t));
  */
 void
 __ham_dsearch(dbc, dbt, offp, cmpp, flags)
 	DBC *dbc;
 	DBT *dbt;
 	u_int32_t *offp, flags;
-	int *cmpp;
+	gint *cmpp;
 {
 	DB *dbp;
 	HASH_CURSOR *hcp;
 	DBT cur;
 	db_indx_t i, len;
-	int (*func) __P((DB *, const DBT *, const DBT *));
+	gint (*func) __P((DB *, const DBT *, const DBT *));
 	u_int8_t *data;
 
 	dbp = dbc->dbp;
@@ -786,7 +786,7 @@ __ham_dcursor(dbc, pgno, indx)
 	DB *dbp;
 	HASH_CURSOR *hcp;
 	BTREE_CURSOR *dcp;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	hcp = (HASH_CURSOR *)dbc->internal;
@@ -840,7 +840,7 @@ __ham_c_chgpg(dbc, old_pgno, old_index, new_pgno, new_index)
 	DB_TXN *my_txn;
 	DBC *cp;
 	HASH_CURSOR *hcp;
-	int found, ret;
+	gint found, ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
diff --git a/libdb/hash/hash_func.c b/libdb/hash/hash_func.c
index 3d0509a..de47adf 100644
--- a/libdb/hash/hash_func.c
+++ b/libdb/hash/hash_func.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -56,14 +56,14 @@ static const char revid[] = "$Id$";
  * __ham_func2 --
  *	Phong Vo's linear congruential hash.
  *
- * PUBLIC: u_int32_t __ham_func2 __P((DB *, const void *, u_int32_t));
+ * PUBLIC: u_int32_t __ham_func2 __P((DB *, gconstpointer , u_int32_t));
  */
 #define	DCHARHASH(h, c)	((h) = 0x63c63cd9*(h) + 0x9c39c33d + (c))
 
 u_int32_t
 __ham_func2(dbp, key, len)
 	DB *dbp;
-	const void *key;
+	gconstpointer key;
 	u_int32_t len;
 {
 	const u_int8_t *e, *k;
@@ -93,12 +93,12 @@ __ham_func2(dbp, key, len)
  * iteration, perform 8 HASHC's so we handle all 8 bytes.  Essentially, this
  * saves us 7 cmp & branch instructions.
  *
- * PUBLIC: u_int32_t __ham_func3 __P((DB *, const void *, u_int32_t));
+ * PUBLIC: u_int32_t __ham_func3 __P((DB *, gconstpointer , u_int32_t));
  */
 u_int32_t
 __ham_func3(dbp, key, len)
 	DB *dbp;
-	const void *key;
+	gconstpointer key;
 	u_int32_t len;
 {
 	const u_int8_t *k;
@@ -144,12 +144,12 @@ __ham_func3(dbp, key, len)
  *	slightly worse than __ham_func5 on strings, it performs horribly on
  *	numbers.
  *
- * PUBLIC: u_int32_t __ham_func4 __P((DB *, const void *, u_int32_t));
+ * PUBLIC: u_int32_t __ham_func4 __P((DB *, gconstpointer , u_int32_t));
  */
 u_int32_t
 __ham_func4(dbp, key, len)
 	DB *dbp;
-	const void *key;
+	gconstpointer key;
 	u_int32_t len;
 {
 	const u_int8_t *k;
@@ -205,12 +205,12 @@ __ham_func4(dbp, key, len)
  * This hash produces the fewest collisions of any function that we've seen so
  * far, and works well on both numbers and strings.
  *
- * PUBLIC: u_int32_t __ham_func5 __P((DB *, const void *, u_int32_t));
+ * PUBLIC: u_int32_t __ham_func5 __P((DB *, gconstpointer , u_int32_t));
  */
 u_int32_t
 __ham_func5(dbp, key, len)
 	DB *dbp;
-	const void *key;
+	gconstpointer key;
 	u_int32_t len;
 {
 	const u_int8_t *k, *e;
@@ -231,15 +231,15 @@ __ham_func5(dbp, key, len)
 /*
  * __ham_test --
  *
- * PUBLIC: u_int32_t __ham_test __P((DB *, const void *, u_int32_t));
+ * PUBLIC: u_int32_t __ham_test __P((DB *, gconstpointer , u_int32_t));
  */
 u_int32_t
 __ham_test(dbp, key, len)
 	DB *dbp;
-	const void *key;
+	gconstpointer key;
 	u_int32_t len;
 {
 	COMPQUIET(dbp, NULL);
 	COMPQUIET(len, 0);
-	return ((u_int32_t)*(char *)key);
+	return ((u_int32_t)*(gchar *)key);
 }
diff --git a/libdb/hash/hash_meta.c b/libdb/hash/hash_meta.c
index cdf1087..32e0bfc 100644
--- a/libdb/hash/hash_meta.c
+++ b/libdb/hash/hash_meta.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,9 +24,9 @@ static const char revid[] = "$Id$";
 /*
  * Acquire the meta-data page.
  *
- * PUBLIC: int __ham_get_meta __P((DBC *));
+ * PUBLIC: gint __ham_get_meta __P((DBC *));
  */
-int
+gint
 __ham_get_meta(dbc)
 	DBC *dbc;
 {
@@ -35,7 +35,7 @@ __ham_get_meta(dbc)
 	DB_MPOOLFILE *mpf;
 	HASH *hashp;
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -63,9 +63,9 @@ __ham_get_meta(dbc)
 /*
  * Release the meta-data page.
  *
- * PUBLIC: int __ham_release_meta __P((DBC *));
+ * PUBLIC: gint __ham_release_meta __P((DBC *));
  */
-int
+gint
 __ham_release_meta(dbc)
 	DBC *dbc;
 {
@@ -90,9 +90,9 @@ __ham_release_meta(dbc)
 /*
  * Mark the meta-data page dirty.
  *
- * PUBLIC: int __ham_dirty_meta __P((DBC *));
+ * PUBLIC: gint __ham_dirty_meta __P((DBC *));
  */
-int
+gint
 __ham_dirty_meta(dbc)
 	DBC *dbc;
 {
@@ -101,7 +101,7 @@ __ham_dirty_meta(dbc)
 	DB_LOCK _tmp;
 	HASH *hashp;
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	hashp = dbp->h_internal;
diff --git a/libdb/hash/hash_method.c b/libdb/hash/hash_method.c
index 7fd7618..aa8cf4b 100644
--- a/libdb/hash/hash_method.c
+++ b/libdb/hash/hash_method.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -19,23 +19,23 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_page.h"
 #include "dbinc/hash.h"
 
-static int __ham_set_h_ffactor __P((DB *, u_int32_t));
-static int __ham_set_h_hash
-	       __P((DB *, u_int32_t(*)(DB *, const void *, u_int32_t)));
-static int __ham_set_h_nelem __P((DB *, u_int32_t));
+static gint __ham_set_h_ffactor __P((DB *, u_int32_t));
+static gint __ham_set_h_hash
+	       __P((DB *, u_int32_t(*)(DB *, gconstpointer , u_int32_t)));
+static gint __ham_set_h_nelem __P((DB *, u_int32_t));
 
 /*
  * __ham_db_create --
  *	Hash specific initialization of the DB structure.
  *
- * PUBLIC: int __ham_db_create __P((DB *));
+ * PUBLIC: gint __ham_db_create __P((DB *));
  */
-int
+gint
 __ham_db_create(dbp)
 	DB *dbp;
 {
 	HASH *hashp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbp->dbenv,
 	    sizeof(HASH), &dbp->h_internal)) != 0)
@@ -55,9 +55,9 @@ __ham_db_create(dbp)
 }
 
 /*
- * PUBLIC: int __ham_db_close __P((DB *));
+ * PUBLIC: gint __ham_db_close __P((DB *));
  */
-int
+gint
 __ham_db_close(dbp)
 	DB *dbp;
 {
@@ -94,7 +94,7 @@ __ham_set_h_ffactor(dbp, h_ffactor)
 static int
 __ham_set_h_hash(dbp, func)
 	DB *dbp;
-	u_int32_t (*func) __P((DB *, const void *, u_int32_t));
+	u_int32_t (*func) __P((DB *, gconstpointer , u_int32_t));
 {
 	HASH *hashp;
 
diff --git a/libdb/hash/hash_open.c b/libdb/hash/hash_open.c
index 0159ab1..e91a370 100644
--- a/libdb/hash/hash_open.c
+++ b/libdb/hash/hash_open.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -69,14 +69,14 @@ static db_pgno_t __ham_init_meta __P((DB *, HMETA *, db_pgno_t, DB_LSN *));
 /*
  * __ham_open --
  *
- * PUBLIC: int __ham_open __P((DB *,
- * PUBLIC:     DB_TXN *, const char * name, db_pgno_t, u_int32_t));
+ * PUBLIC: gint __ham_open __P((DB *,
+ * PUBLIC:     DB_TXN *, const gchar * name, db_pgno_t, u_int32_t));
  */
-int
+gint
 __ham_open(dbp, txn, name, base_pgno, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	db_pgno_t base_pgno;
 	u_int32_t flags;
 {
@@ -85,7 +85,7 @@ __ham_open(dbp, txn, name, base_pgno, flags)
 	DB_MPOOLFILE *mpf;
 	HASH_CURSOR *hcp;
 	HASH *hashp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	COMPQUIET(name, NULL);
 	dbenv = dbp->dbenv;
@@ -155,17 +155,17 @@ err1:	if ((t_ret  = dbc->c_close(dbc)) != 0 && ret == 0)
 /*
  * __ham_metachk --
  *
- * PUBLIC: int __ham_metachk __P((DB *, const char *, HMETA *));
+ * PUBLIC: gint __ham_metachk __P((DB *, const gchar *, HMETA *));
  */
-int
+gint
 __ham_metachk(dbp, name, hashm)
 	DB *dbp;
-	const char *name;
+	const gchar *name;
 	HMETA *hashm;
 {
 	DB_ENV *dbenv;
 	u_int32_t vers;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -269,7 +269,7 @@ __ham_init_meta(dbp, meta, pgno, lsnp)
 {
 	HASH *hashp;
 	db_pgno_t nbuckets;
-	int i;
+	gint i;
 	int32_t l2;
 
 	hashp = dbp->h_internal;
@@ -344,14 +344,14 @@ __ham_init_meta(dbp, meta, pgno, lsnp)
  * memory or calls mpf->get), 2) the initialization, and 3) the "put page"
  * chunk which either does a fop write or an mpf->put.
  *
- * PUBLIC: int __ham_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
+ * PUBLIC: gint __ham_new_file __P((DB *, DB_TXN *, DB_FH *, const gchar *));
  */
-int
+gint
 __ham_new_file(dbp, txn, fhp, name)
 	DB *dbp;
 	DB_TXN *txn;
 	DB_FH *fhp;
-	const char *name;
+	const gchar *name;
 {
 	DB_ENV *dbenv;
 	DB_LSN lsn;
@@ -360,9 +360,9 @@ __ham_new_file(dbp, txn, fhp, name)
 	DBT pdbt;
 	HMETA *meta;
 	PAGE *page;
-	int ret;
+	gint ret;
 	db_pgno_t lpgno;
-	void *buf;
+	gpointer buf;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -444,9 +444,9 @@ err:	if (name != NULL)
  * __ham_new_subdb --
  *	Create the necessary pages to begin a new subdatabase.
  *
- * PUBLIC: int __ham_new_subdb __P((DB *, DB *, DB_TXN *));
+ * PUBLIC: gint __ham_new_subdb __P((DB *, DB *, DB_TXN *));
  */
-int
+gint
 __ham_new_subdb(mdbp, dbp, txn)
 	DB *mdbp, *dbp;
 	DB_TXN *txn;
@@ -459,7 +459,7 @@ __ham_new_subdb(mdbp, dbp, txn)
 	DBMETA *mmeta;
 	HMETA *meta;
 	PAGE *h;
-	int i, ret, t_ret;
+	gint i, ret, t_ret;
 	db_pgno_t lpgno, mpgno;
 
 	dbenv = mdbp->dbenv;
diff --git a/libdb/hash/hash_page.c b/libdb/hash/hash_page.c
index 790323f..42d1be3 100644
--- a/libdb/hash/hash_page.c
+++ b/libdb/hash/hash_page.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 /*
@@ -65,13 +65,13 @@ static const char revid[] = "$Id$";
 #include "dbinc/hash.h"
 #include "dbinc/lock.h"
 
-static int __ham_c_delpg
+static gint __ham_c_delpg
     __P((DBC *, db_pgno_t, db_pgno_t, u_int32_t, db_ham_mode, u_int32_t *));
 
 /*
- * PUBLIC: int __ham_item __P((DBC *, db_lockmode_t, db_pgno_t *));
+ * PUBLIC: gint __ham_item __P((DBC *, db_lockmode_t, db_pgno_t *));
  */
-int
+gint
 __ham_item(dbc, mode, pgnop)
 	DBC *dbc;
 	db_lockmode_t mode;
@@ -80,7 +80,7 @@ __ham_item(dbc, mode, pgnop)
 	DB *dbp;
 	HASH_CURSOR *hcp;
 	db_pgno_t next_pgno;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	hcp = (HASH_CURSOR *)dbc->internal;
@@ -140,16 +140,16 @@ recheck:
 }
 
 /*
- * PUBLIC: int __ham_item_reset __P((DBC *));
+ * PUBLIC: gint __ham_item_reset __P((DBC *));
  */
-int
+gint
 __ham_item_reset(dbc)
 	DBC *dbc;
 {
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -203,16 +203,16 @@ __ham_item_init(dbc)
 /*
  * Returns the last item in a bucket.
  *
- * PUBLIC: int __ham_item_last __P((DBC *, db_lockmode_t, db_pgno_t *));
+ * PUBLIC: gint __ham_item_last __P((DBC *, db_lockmode_t, db_pgno_t *));
  */
-int
+gint
 __ham_item_last(dbc, mode, pgnop)
 	DBC *dbc;
 	db_lockmode_t mode;
 	db_pgno_t *pgnop;
 {
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	hcp = (HASH_CURSOR *)dbc->internal;
 	if ((ret = __ham_item_reset(dbc)) != 0)
@@ -225,16 +225,16 @@ __ham_item_last(dbc, mode, pgnop)
 }
 
 /*
- * PUBLIC: int __ham_item_first __P((DBC *, db_lockmode_t, db_pgno_t *));
+ * PUBLIC: gint __ham_item_first __P((DBC *, db_lockmode_t, db_pgno_t *));
  */
-int
+gint
 __ham_item_first(dbc, mode, pgnop)
 	DBC *dbc;
 	db_lockmode_t mode;
 	db_pgno_t *pgnop;
 {
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	hcp = (HASH_CURSOR *)dbc->internal;
 	if ((ret = __ham_item_reset(dbc)) != 0)
@@ -251,9 +251,9 @@ __ham_item_first(dbc, mode, pgnop)
  *	bigkeys, just returns the page number and index of the bigkey
  *	pointer pair.
  *
- * PUBLIC: int __ham_item_prev __P((DBC *, db_lockmode_t, db_pgno_t *));
+ * PUBLIC: gint __ham_item_prev __P((DBC *, db_lockmode_t, db_pgno_t *));
  */
-int
+gint
 __ham_item_prev(dbc, mode, pgnop)
 	DBC *dbc;
 	db_lockmode_t mode;
@@ -262,7 +262,7 @@ __ham_item_prev(dbc, mode, pgnop)
 	DB *dbp;
 	HASH_CURSOR *hcp;
 	db_pgno_t next_pgno;
-	int ret;
+	gint ret;
 
 	hcp = (HASH_CURSOR *)dbc->internal;
 	dbp = dbc->dbp;
@@ -369,16 +369,16 @@ __ham_item_prev(dbc, mode, pgnop)
 /*
  * Sets the cursor to the next key/data pair on a page.
  *
- * PUBLIC: int __ham_item_next __P((DBC *, db_lockmode_t, db_pgno_t *));
+ * PUBLIC: gint __ham_item_next __P((DBC *, db_lockmode_t, db_pgno_t *));
  */
-int
+gint
 __ham_item_next(dbc, mode, pgnop)
 	DBC *dbc;
 	db_lockmode_t mode;
 	db_pgno_t *pgnop;
 {
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	hcp = (HASH_CURSOR *)dbc->internal;
 
@@ -457,7 +457,7 @@ __ham_putitem(dbp, p, dbt, type)
 	DB *dbp;
 	PAGE *p;
 	const DBT *dbt;
-	int type;
+	gint type;
 {
 	u_int16_t n, off;
 	db_indx_t *inp;
@@ -533,12 +533,12 @@ __ham_reputpair(dbp, p, ndx, key, data)
 }
 
 /*
- * PUBLIC: int __ham_del_pair __P((DBC *, int));
+ * PUBLIC: gint __ham_del_pair __P((DBC *, int));
  */
-int
+gint
 __ham_del_pair(dbc, reclaim_page)
 	DBC *dbc;
-	int reclaim_page;
+	gint reclaim_page;
 {
 	DB *dbp;
 	DBT data_dbt, key_dbt;
@@ -549,7 +549,7 @@ __ham_del_pair(dbc, reclaim_page)
 	db_ham_mode op;
 	db_indx_t ndx;
 	db_pgno_t chg_pgno, pgno, tmp_pgno;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int32_t order;
 
 	dbp = dbc->dbp;
@@ -819,9 +819,9 @@ err:	/* Clean up any pages. */
  *	Given the key data indicated by the cursor, replace part/all of it
  *	according to the fields in the dbt.
  *
- * PUBLIC: int __ham_replpair __P((DBC *, DBT *, u_int32_t));
+ * PUBLIC: gint __ham_replpair __P((DBC *, DBT *, u_int32_t));
  */
-int
+gint
 __ham_replpair(dbc, dbt, make_dup)
 	DBC *dbc;
 	DBT *dbt;
@@ -834,9 +834,9 @@ __ham_replpair(dbc, dbt, make_dup)
 	HASH_CURSOR *hcp;
 	int32_t change;			/* XXX: Possible overflow. */
 	u_int32_t dup_flag, len, memsize;
-	int beyond_eor, is_big, ret, type;
+	gint beyond_eor, is_big, ret, type;
 	u_int8_t *beg, *dest, *end, *hk, *src;
-	void *memp;
+	gpointer memp;
 
 	/*
 	 * Big item replacements are handled in generic code.
@@ -1010,7 +1010,7 @@ __ham_onpage_replace(dbp, pagep, ndx, off, change, dbt)
 	int32_t len;
 	size_t pgsize;
 	u_int8_t *src, *dest;
-	int zero_me;
+	gint zero_me;
 
 	pgsize = dbp->pgsize;
 	inp = P_INP(dbp, pagep);
@@ -1046,9 +1046,9 @@ __ham_onpage_replace(dbp, pagep, ndx, off, change, dbt)
 }
 
 /*
- * PUBLIC: int __ham_split_page __P((DBC *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __ham_split_page __P((DBC *, u_int32_t, u_int32_t));
  */
-int
+gint
 __ham_split_page(dbc, obucket, nbucket)
 	DBC *dbc;
 	u_int32_t obucket, nbucket;
@@ -1065,8 +1065,8 @@ __ham_split_page(dbc, obucket, nbucket)
 	db_indx_t n;
 	db_pgno_t bucket_pgno, npgno, next_pgno;
 	u_int32_t big_len, len;
-	int found, i, ret, t_ret;
-	void *big_buf;
+	gint found, i, ret, t_ret;
+	gpointer big_buf;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -1277,13 +1277,13 @@ err:		if (old_pagep != NULL)
  * to which we just added something.  This allows us to link overflow
  * pages and return the new page having correctly put the last page.
  *
- * PUBLIC: int __ham_add_el __P((DBC *, const DBT *, const DBT *, int));
+ * PUBLIC: gint __ham_add_el __P((DBC *, const DBT *, const DBT *, int));
  */
-int
+gint
 __ham_add_el(dbc, key, val, type)
 	DBC *dbc;
 	const DBT *key, *val;
-	int type;
+	gint type;
 {
 	const DBT *pkey, *pdata;
 	DB *dbp;
@@ -1294,8 +1294,8 @@ __ham_add_el(dbc, key, val, type)
 	HOFFPAGE doff, koff;
 	db_pgno_t next_pgno, pgno;
 	u_int32_t data_size, key_size, pairsize, rectype;
-	int do_expand, is_keybig, is_databig, ret;
-	int key_type, data_type;
+	gint do_expand, is_keybig, is_databig, ret;
+	gint key_type, data_type;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1447,7 +1447,7 @@ __ham_copy_item(dbp, src_page, src_ndx, dest_page)
 {
 	u_int32_t len;
 	size_t pgsize;
-	void *src, *dest;
+	gpointer src, *dest;
 	db_indx_t *inp;
 
 	pgsize = dbp->pgsize;
@@ -1473,20 +1473,20 @@ __ham_copy_item(dbp, src_page, src_ndx, dest_page)
  *	pointer on success
  *	NULL on error
  *
- * PUBLIC: int __ham_add_ovflpage __P((DBC *, PAGE *, int, PAGE **));
+ * PUBLIC: gint __ham_add_ovflpage __P((DBC *, PAGE *, int, PAGE **));
  */
-int
+gint
 __ham_add_ovflpage(dbc, pagep, release, pp)
 	DBC *dbc;
 	PAGE *pagep;
-	int release;
+	gint release;
 	PAGE **pp;
 {
 	DB *dbp;
 	DB_LSN new_lsn;
 	DB_MPOOLFILE *mpf;
 	PAGE *new_pagep;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1516,9 +1516,9 @@ __ham_add_ovflpage(dbc, pagep, release, pp)
 }
 
 /*
- * PUBLIC: int __ham_get_cpage __P((DBC *, db_lockmode_t));
+ * PUBLIC: gint __ham_get_cpage __P((DBC *, db_lockmode_t));
  */
-int
+gint
 __ham_get_cpage(dbc, mode)
 	DBC *dbc;
 	db_lockmode_t mode;
@@ -1527,7 +1527,7 @@ __ham_get_cpage(dbc, mode)
 	DB_LOCK tmp_lock;
 	DB_MPOOLFILE *mpf;
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1592,19 +1592,19 @@ __ham_get_cpage(dbc, mode)
  * If the flag is set to H_ISDUP, then we are talking about the
  * duplicate page, not the main page.
  *
- * PUBLIC: int __ham_next_cpage __P((DBC *, db_pgno_t, int));
+ * PUBLIC: gint __ham_next_cpage __P((DBC *, db_pgno_t, int));
  */
-int
+gint
 __ham_next_cpage(dbc, pgno, dirty)
 	DBC *dbc;
 	db_pgno_t pgno;
-	int dirty;
+	gint dirty;
 {
 	DB *dbp;
 	DB_MPOOLFILE *mpf;
 	HASH_CURSOR *hcp;
 	PAGE *p;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1629,16 +1629,16 @@ __ham_next_cpage(dbc, pgno, dirty)
  * __ham_lock_bucket --
  *	Get the lock on a particular bucket.
  *
- * PUBLIC: int __ham_lock_bucket __P((DBC *, db_lockmode_t));
+ * PUBLIC: gint __ham_lock_bucket __P((DBC *, db_lockmode_t));
  */
-int
+gint
 __ham_lock_bucket(dbc, mode)
 	DBC *dbc;
 	db_lockmode_t mode;
 {
 	HASH_CURSOR *hcp;
 	db_pgno_t pgno;
-	int gotmeta, ret;
+	gint gotmeta, ret;
 
 	hcp = (HASH_CURSOR *)dbc->internal;
 	gotmeta = hcp->hdr == NULL ? 1 : 0;
@@ -1758,7 +1758,7 @@ __ham_c_delpg(dbc, old_pgno, new_pgno, num_ent, op, orderp)
 	DB_TXN *my_txn;
 	DBC *cp;
 	HASH_CURSOR *hcp;
-	int found, ret;
+	gint found, ret;
 	db_indx_t indx;
 	u_int32_t order;
 
diff --git a/libdb/hash/hash_rec.c b/libdb/hash/hash_rec.c
index 5cddc95..adb211b 100644
--- a/libdb/hash/hash_rec.c
+++ b/libdb/hash/hash_rec.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -58,21 +58,21 @@ static const char revid[] = "$Id$";
 #include "dbinc/hash.h"
 #include "dbinc/log.h"
 
-static int __ham_alloc_pages __P((DB *, __ham_groupalloc_args *, DB_LSN *));
+static gint __ham_alloc_pages __P((DB *, __ham_groupalloc_args *, DB_LSN *));
 
 /*
  * __ham_insdel_recover --
  *
- * PUBLIC: int __ham_insdel_recover
- * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_insdel_recover
+ * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_insdel_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_insdel_args *argp;
 	DB *file_dbp;
@@ -80,7 +80,7 @@ __ham_insdel_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	u_int32_t flags, opcode;
-	int cmp_n, cmp_p, ret, type;
+	gint cmp_n, cmp_p, ret, type;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -172,16 +172,16 @@ out:	if (pagep != NULL)
  *	This log message is used when we add/remove overflow pages.  This
  *	message takes care of the pointer chains, not the data on the pages.
  *
- * PUBLIC: int __ham_newpage_recover
- * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_newpage_recover
+ * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_newpage_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_newpage_args *argp;
 	DB *file_dbp;
@@ -189,7 +189,7 @@ __ham_newpage_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	u_int32_t flags;
-	int cmp_n, cmp_p, ret;
+	gint cmp_n, cmp_p, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -343,16 +343,16 @@ out:	if (pagep != NULL)
  *	page.  You can think of them as special cases of the more general
  *	insdel log message.
  *
- * PUBLIC: int __ham_replace_recover
- * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_replace_recover
+ * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_replace_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_replace_args *argp;
 	DB *file_dbp;
@@ -362,7 +362,7 @@ __ham_replace_recover(dbenv, dbtp, lsnp, op, info)
 	PAGE *pagep;
 	u_int32_t flags;
 	int32_t grow;
-	int cmp_n, cmp_p, ret;
+	gint cmp_n, cmp_p, ret;
 	u_int8_t *hk;
 
 	pagep = NULL;
@@ -436,16 +436,16 @@ out:	if (pagep != NULL)
 /*
  * __ham_splitdata_recover --
  *
- * PUBLIC: int __ham_splitdata_recover
- * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_splitdata_recover
+ * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_splitdata_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_splitdata_args *argp;
 	DB *file_dbp;
@@ -453,7 +453,7 @@ __ham_splitdata_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	u_int32_t flags;
-	int cmp_n, cmp_p, ret;
+	gint cmp_n, cmp_p, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -524,16 +524,16 @@ out:	if (pagep != NULL)
  * __ham_copypage_recover --
  *	Recovery function for copypage.
  *
- * PUBLIC: int __ham_copypage_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_copypage_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_copypage_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_copypage_args *argp;
 	DB *file_dbp;
@@ -541,7 +541,7 @@ __ham_copypage_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	u_int32_t flags;
-	int cmp_n, cmp_p, ret;
+	gint cmp_n, cmp_p, ret;
 
 	pagep = NULL;
 	COMPQUIET(info, NULL);
@@ -672,16 +672,16 @@ out:	if (pagep != NULL)
  * __ham_metagroup_recover --
  *	Recovery function for metagroup.
  *
- * PUBLIC: int __ham_metagroup_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_metagroup_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_metagroup_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_metagroup_args *argp;
 	HASH_CURSOR *hcp;
@@ -692,7 +692,7 @@ __ham_metagroup_recover(dbenv, dbtp, lsnp, op, info)
 	PAGE *pagep;
 	db_pgno_t pgno;
 	u_int32_t flags, mmeta_flags;
-	int cmp_n, cmp_p, did_recover, groupgrow, ret;
+	gint cmp_n, cmp_p, did_recover, groupgrow, ret;
 
 	COMPQUIET(info, NULL);
 	mmeta_flags = 0;
@@ -840,16 +840,16 @@ out:	if (mmeta != NULL)
  * __ham_groupalloc_recover --
  *	Recover the batch creation of a set of pages for a new database.
  *
- * PUBLIC: int __ham_groupalloc_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_groupalloc_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_groupalloc_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_groupalloc_args *argp;
 	DBMETA *mmeta;
@@ -858,7 +858,7 @@ __ham_groupalloc_recover(dbenv, dbtp, lsnp, op, info)
 	DBC *dbc;
 	PAGE *pagep;
 	db_pgno_t pgno;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	mmeta = NULL;
 	modified = 0;
@@ -953,7 +953,7 @@ __ham_alloc_pages(dbp, argp, lsnp)
 	DB_MPOOLFILE *mpf;
 	PAGE *pagep;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	mpf = dbp->mpf;
 
@@ -990,22 +990,22 @@ reinit_page:
  * __ham_curadj_recover --
  *	Undo cursor adjustments if a subtransaction fails.
  *
- * PUBLIC: int __ham_curadj_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_curadj_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_curadj_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_curadj_args *argp;
 	DB_MPOOLFILE *mpf;
 	DB *file_dbp;
 	DBC *dbc;
-	int ret;
+	gint ret;
 	HASH_CURSOR *hcp;
 
 	COMPQUIET(info, NULL);
@@ -1037,23 +1037,23 @@ out:	REC_CLOSE;
  * __ham_chgpg_recover --
  *	Undo cursor adjustments if a subtransaction fails.
  *
- * PUBLIC: int __ham_chgpg_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __ham_chgpg_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __ham_chgpg_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__ham_chgpg_args *argp;
 	BTREE_CURSOR *opdcp;
 	DB_MPOOLFILE *mpf;
 	DB *file_dbp, *ldbp;
 	DBC *dbc;
-	int ret;
+	gint ret;
 	DBC *cp;
 	HASH_CURSOR *lcp;
 	u_int32_t order, indx;
diff --git a/libdb/hash/hash_reclaim.c b/libdb/hash/hash_reclaim.c
index 444d32e..4099f4c 100644
--- a/libdb/hash/hash_reclaim.c
+++ b/libdb/hash/hash_reclaim.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -31,16 +31,16 @@ static const char revid[] = "$Id$";
  * need to go to a model where we maintain the free list with chunks of
  * contiguous pages as well.
  *
- * PUBLIC: int __ham_reclaim __P((DB *, DB_TXN *txn));
+ * PUBLIC: gint __ham_reclaim __P((DB *, DB_TXN *txn));
  */
-int
+gint
 __ham_reclaim(dbp, txn)
 	DB *dbp;
 	DB_TXN *txn;
 {
 	DBC *dbc;
 	HASH_CURSOR *hcp;
-	int ret;
+	gint ret;
 
 	/* Open up a cursor that we'll use for traversing. */
 	if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0)
@@ -70,9 +70,9 @@ err:	if (hcp->hdr != NULL)
  *	Reclaim the pages from a subdatabase and return them to the
  * parent free list.
  *
- * PUBLIC: int __ham_truncate __P((DB *, DB_TXN *txn, u_int32_t *));
+ * PUBLIC: gint __ham_truncate __P((DB *, DB_TXN *txn, u_int32_t *));
  */
-int
+gint
 __ham_truncate(dbp, txn, countp)
 	DB *dbp;
 	DB_TXN *txn;
@@ -81,7 +81,7 @@ __ham_truncate(dbp, txn, countp)
 	DBC *dbc;
 	HASH_CURSOR *hcp;
 	db_trunc_param trunc;
-	int ret;
+	gint ret;
 
 	/* Open up a cursor that we'll use for traversing. */
 	if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0)
diff --git a/libdb/hash/hash_stat.c b/libdb/hash/hash_stat.c
index 9858595..bf903da 100644
--- a/libdb/hash/hash_stat.c
+++ b/libdb/hash/hash_stat.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -22,18 +22,18 @@ static const char revid[] = "$Id$";
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
 
-static int __ham_stat_callback __P((DB *, PAGE *, void *, int *));
+static gint __ham_stat_callback __P((DB *, PAGE *, gpointer , gint *));
 
 /*
  * __ham_stat --
  *	Gather/print the hash statistics
  *
- * PUBLIC: int __ham_stat __P((DB *, void *, u_int32_t));
+ * PUBLIC: gint __ham_stat __P((DB *, gpointer , u_int32_t));
  */
-int
+gint
 __ham_stat(dbp, spp, flags)
 	DB *dbp;
-	void *spp;
+	gpointer spp;
 	u_int32_t flags;
 {
 	DBC *dbc;
@@ -43,7 +43,7 @@ __ham_stat(dbp, spp, flags)
 	HASH_CURSOR *hcp;
 	PAGE *h;
 	db_pgno_t pgno;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 
@@ -130,16 +130,16 @@ err:	if (sp != NULL)
  *	 Traverse an entire hash table.  We use the callback so that we
  * can use this both for stat collection and for deallocation.
  *
- * PUBLIC: int __ham_traverse __P((DBC *, db_lockmode_t,
- * PUBLIC:     int (*)(DB *, PAGE *, void *, int *), void *, int));
+ * PUBLIC: gint __ham_traverse __P((DBC *, db_lockmode_t,
+ * PUBLIC:     gint (*)(DB *, PAGE *, gpointer , gint *), gpointer , int));
  */
-int
+gint
 __ham_traverse(dbc, mode, callback, cookie, look_past_max)
 	DBC *dbc;
 	db_lockmode_t mode;
-	int (*callback) __P((DB *, PAGE *, void *, int *));
-	void *cookie;
-	int look_past_max;
+	gint (*callback) __P((DB *, PAGE *, gpointer , gint *));
+	gpointer cookie;
+	gint look_past_max;
 {
 	DB *dbp;
 	DBC *opd;
@@ -147,7 +147,7 @@ __ham_traverse(dbc, mode, callback, cookie, look_past_max)
 	HASH_CURSOR *hcp;
 	HKEYDATA *hk;
 	db_pgno_t pgno, opgno;
-	int did_put, i, ret, t_ret;
+	gint did_put, i, ret, t_ret;
 	u_int32_t bucket, spares_entry;
 
 	dbp = dbc->dbp;
@@ -282,14 +282,14 @@ static int
 __ham_stat_callback(dbp, pagep, cookie, putp)
 	DB *dbp;
 	PAGE *pagep;
-	void *cookie;
-	int *putp;
+	gpointer cookie;
+	gint *putp;
 {
 	DB_HASH_STAT *sp;
 	DB_BTREE_STAT bstat;
 	db_indx_t indx, len, off, tlen, top;
 	u_int8_t *hk;
-	int ret;
+	gint ret;
 
 	*putp = 0;
 	sp = cookie;
diff --git a/libdb/hash/hash_upgrade.c b/libdb/hash/hash_upgrade.c
index d08b7ef..c3cc775 100644
--- a/libdb/hash/hash_upgrade.c
+++ b/libdb/hash/hash_upgrade.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,12 +26,12 @@ static const char revid[] = "$Id$";
  * __ham_30_hashmeta --
  *	Upgrade the database from version 4/5 to version 6.
  *
- * PUBLIC: int __ham_30_hashmeta __P((DB *, char *, u_int8_t *));
+ * PUBLIC: gint __ham_30_hashmeta __P((DB *, gchar *, u_int8_t *));
  */
-int
+gint
 __ham_30_hashmeta(dbp, real_name, obuf)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int8_t *obuf;
 {
 	DB_ENV *dbenv;
@@ -39,7 +39,7 @@ __ham_30_hashmeta(dbp, real_name, obuf)
 	HMETA30 newmeta;
 	u_int32_t *o_spares, *n_spares;
 	u_int32_t fillf, maxb, nelem;
-	int i, max_entry, ret;
+	gint i, max_entry, ret;
 
 	dbenv = dbp->dbenv;
 	memset(&newmeta, 0, sizeof(newmeta));
@@ -115,20 +115,20 @@ __ham_30_hashmeta(dbp, real_name, obuf)
  *	Make sure that all hash pages belonging to the current
  *	hash doubling are within the bounds of the file.
  *
- * PUBLIC: int __ham_30_sizefix __P((DB *, DB_FH *, char *, u_int8_t *));
+ * PUBLIC: gint __ham_30_sizefix __P((DB *, DB_FH *, gchar *, u_int8_t *));
  */
-int
+gint
 __ham_30_sizefix(dbp, fhp, realname, metabuf)
 	DB *dbp;
 	DB_FH *fhp;
-	char *realname;
+	gchar *realname;
 	u_int8_t *metabuf;
 {
 	u_int8_t buf[DB_MAX_PGSIZE];
 	DB_ENV *dbenv;
 	HMETA30 *meta;
 	db_pgno_t last_actual, last_desired;
-	int ret;
+	gint ret;
 	size_t nw;
 	u_int32_t pagesize;
 
@@ -171,17 +171,17 @@ __ham_30_sizefix(dbp, fhp, realname, metabuf)
  * __ham_31_hashmeta --
  *	Upgrade the database from version 6 to version 7.
  *
- * PUBLIC: int __ham_31_hashmeta
- * PUBLIC:      __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
+ * PUBLIC: gint __ham_31_hashmeta
+ * PUBLIC:      __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
  */
-int
+gint
 __ham_31_hashmeta(dbp, real_name, flags, fhp, h, dirtyp)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int32_t flags;
 	DB_FH *fhp;
 	PAGE *h;
-	int *dirtyp;
+	gint *dirtyp;
 {
 	HMETA31 *newmeta;
 	HMETA30 *oldmeta;
@@ -226,22 +226,22 @@ __ham_31_hashmeta(dbp, real_name, flags, fhp, h, dirtyp)
  * __ham_31_hash --
  *	Upgrade the database hash leaf pages.
  *
- * PUBLIC: int __ham_31_hash
- * PUBLIC:      __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *));
+ * PUBLIC: gint __ham_31_hash
+ * PUBLIC:      __P((DB *, gchar *, u_int32_t, DB_FH *, PAGE *, gint *));
  */
-int
+gint
 __ham_31_hash(dbp, real_name, flags, fhp, h, dirtyp)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int32_t flags;
 	DB_FH *fhp;
 	PAGE *h;
-	int *dirtyp;
+	gint *dirtyp;
 {
 	HKEYDATA *hk;
 	db_pgno_t pgno, tpgno;
 	db_indx_t indx;
-	int ret;
+	gint ret;
 
 	COMPQUIET(flags, 0);
 
diff --git a/libdb/hash/hash_verify.c b/libdb/hash/hash_verify.c
index ebe3fea..62c051e 100644
--- a/libdb/hash/hash_verify.c
+++ b/libdb/hash/hash_verify.c
@@ -10,7 +10,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,10 +25,10 @@ static const char revid[] = "$Id$";
 #include "dbinc/btree.h"
 #include "dbinc/hash.h"
 
-static int __ham_dups_unsorted __P((DB *, u_int8_t *, u_int32_t));
-static int __ham_vrfy_bucket __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t,
+static gint __ham_dups_unsorted __P((DB *, u_int8_t *, u_int32_t));
+static gint __ham_vrfy_bucket __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t,
     u_int32_t));
-static int __ham_vrfy_item __P((DB *,
+static gint __ham_vrfy_item __P((DB *,
     VRFY_DBINFO *, db_pgno_t, PAGE *, u_int32_t, u_int32_t));
 
 /*
@@ -39,10 +39,10 @@ static int __ham_vrfy_item __P((DB *,
  *	will need most everything again to verify each page and the
  *	amount of state here is significant.
  *
- * PUBLIC: int __ham_vrfy_meta __P((DB *, VRFY_DBINFO *, HMETA *,
+ * PUBLIC: gint __ham_vrfy_meta __P((DB *, VRFY_DBINFO *, HMETA *,
  * PUBLIC:     db_pgno_t, u_int32_t));
  */
-int
+gint
 __ham_vrfy_meta(dbp, vdp, m, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -52,9 +52,9 @@ __ham_vrfy_meta(dbp, vdp, m, pgno, flags)
 {
 	HASH *hashp;
 	VRFY_PAGEINFO *pip;
-	int i, ret, t_ret, isbad;
+	gint i, ret, t_ret, isbad;
 	u_int32_t pwr, mbucket;
-	u_int32_t (*hfunc) __P((DB *, const void *, u_int32_t));
+	u_int32_t (*hfunc) __P((DB *, gconstpointer , u_int32_t));
 
 	if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
 		return (ret);
@@ -180,10 +180,10 @@ err:	if ((t_ret =
  * __ham_vrfy --
  *	Verify hash page.
  *
- * PUBLIC: int __ham_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
+ * PUBLIC: gint __ham_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __ham_vrfy(dbp, vdp, h, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -194,7 +194,7 @@ __ham_vrfy(dbp, vdp, h, pgno, flags)
 	VRFY_PAGEINFO *pip;
 	u_int32_t ent, himark, inpend;
 	db_indx_t *inp;
-	int isbad, ret, t_ret;
+	gint isbad, ret, t_ret;
 
 	isbad = 0;
 	if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
@@ -277,7 +277,7 @@ __ham_vrfy_item(dbp, vdp, pgno, h, i, flags)
 	VRFY_CHILDINFO child;
 	VRFY_PAGEINFO *pip;
 	db_indx_t offset, len, dlen, elen;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int8_t *databuf;
 
 	if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
@@ -392,10 +392,10 @@ err:	if ((t_ret =
  * __ham_vrfy_structure --
  *	Verify the structure of a hash database.
  *
- * PUBLIC: int __ham_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t,
+ * PUBLIC: gint __ham_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t,
  * PUBLIC:     u_int32_t));
  */
-int
+gint
 __ham_vrfy_structure(dbp, vdp, meta_pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -407,7 +407,7 @@ __ham_vrfy_structure(dbp, vdp, meta_pgno, flags)
 	HMETA *m;
 	PAGE *h;
 	VRFY_PAGEINFO *pip;
-	int isbad, p, ret, t_ret;
+	gint isbad, p, ret, t_ret;
 	db_pgno_t pgno;
 	u_int32_t bucket, spares_entry;
 
@@ -526,10 +526,10 @@ __ham_vrfy_bucket(dbp, vdp, m, bucket, flags)
 	HASH *hashp;
 	VRFY_CHILDINFO *child;
 	VRFY_PAGEINFO *mip, *pip;
-	int ret, t_ret, isbad, p;
+	gint ret, t_ret, isbad, p;
 	db_pgno_t pgno, next_pgno;
 	DBC *cc;
-	u_int32_t (*hfunc) __P((DB *, const void *, u_int32_t));
+	u_int32_t (*hfunc) __P((DB *, gconstpointer , u_int32_t));
 
 	isbad = 0;
 	pip = NULL;
@@ -714,11 +714,11 @@ err:	if (cc != NULL && ((t_ret = __db_vrfy_ccclose(cc)) != 0) && ret == 0)
  * __ham_vrfy_hashing --
  *	Verify that all items on a given hash page hash correctly.
  *
- * PUBLIC: int __ham_vrfy_hashing __P((DB *,
+ * PUBLIC: gint __ham_vrfy_hashing __P((DB *,
  * PUBLIC:     u_int32_t, HMETA *, u_int32_t, db_pgno_t, u_int32_t,
- * PUBLIC:     u_int32_t (*) __P((DB *, const void *, u_int32_t))));
+ * PUBLIC:     u_int32_t (*) __P((DB *, gconstpointer , u_int32_t))));
  */
-int
+gint
 __ham_vrfy_hashing(dbp, nentries, m, thisbucket, pgno, flags, hfunc)
 	DB *dbp;
 	u_int32_t nentries;
@@ -726,13 +726,13 @@ __ham_vrfy_hashing(dbp, nentries, m, thisbucket, pgno, flags, hfunc)
 	u_int32_t thisbucket;
 	db_pgno_t pgno;
 	u_int32_t flags;
-	u_int32_t (*hfunc) __P((DB *, const void *, u_int32_t));
+	u_int32_t (*hfunc) __P((DB *, gconstpointer , u_int32_t));
 {
 	DBT dbt;
 	DB_MPOOLFILE *mpf;
 	PAGE *h;
 	db_indx_t i;
-	int ret, t_ret, isbad;
+	gint ret, t_ret, isbad;
 	u_int32_t hval, bucket;
 
 	mpf = dbp->mpf;
@@ -782,25 +782,25 @@ err:	if (dbt.data != NULL)
  *	Safely dump out anything that looks like a key on an alleged
  *	hash page.
  *
- * PUBLIC: int __ham_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *,
- * PUBLIC:     void *, int (*)(void *, const void *), u_int32_t));
+ * PUBLIC: gint __ham_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *,
+ * PUBLIC:     gpointer , gint (*)(gpointer , gconstpointer ), u_int32_t));
  */
-int
+gint
 __ham_salvage(dbp, vdp, pgno, h, handle, callback, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	db_pgno_t pgno;
 	PAGE *h;
-	void *handle;
-	int (*callback) __P((void *, const void *));
+	gpointer handle;
+	gint (*callback) __P((gpointer , gconstpointer ));
 	u_int32_t flags;
 {
 	DBT dbt, unkdbt;
 	db_pgno_t dpgno;
-	int ret, err_ret, t_ret;
+	gint ret, err_ret, t_ret;
 	u_int32_t himark, tlen;
 	u_int8_t *hk;
-	void *buf;
+	gpointer buf;
 	u_int32_t dlen, len, i;
 
 	memset(&dbt, 0, sizeof(DBT));
@@ -953,10 +953,10 @@ keydata:			memcpy(buf, HKEYDATA_DATA(hk), len);
  *	Return the set of hash pages corresponding to the given
  *	known-good meta page.
  *
- * PUBLIC: int __ham_meta2pgset __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t,
+ * PUBLIC: gint __ham_meta2pgset __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t,
  * PUBLIC:     DB *));
  */
-int __ham_meta2pgset(dbp, vdp, hmeta, flags, pgset)
+gint __ham_meta2pgset(dbp, vdp, hmeta, flags, pgset)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
 	HMETA *hmeta;
@@ -967,7 +967,7 @@ int __ham_meta2pgset(dbp, vdp, hmeta, flags, pgset)
 	PAGE *h;
 	db_pgno_t pgno;
 	u_int32_t bucket, totpgs;
-	int ret, val;
+	gint ret, val;
 
 	/*
 	 * We don't really need flags, but leave them for consistency with
@@ -1051,7 +1051,7 @@ __ham_dups_unsorted(dbp, buf, len)
 {
 	DBT a, b;
 	db_indx_t offset, dlen;
-	int (*func) __P((DB *, const DBT *, const DBT *));
+	gint (*func) __P((DB *, const DBT *, const DBT *));
 
 	memset(&a, 0, sizeof(DBT));
 	memset(&b, 0, sizeof(DBT));
diff --git a/libdb/hmac/hmac.c b/libdb/hmac/hmac.c
index 029b764..782c5e9 100644
--- a/libdb/hmac/hmac.c
+++ b/libdb/hmac/hmac.c
@@ -11,7 +11,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -53,7 +53,7 @@ __db_hmac(k, data, data_len, mac)
 	u_int8_t ipad[HMAC_BLOCK_SIZE];
 	u_int8_t opad[HMAC_BLOCK_SIZE];
 	u_int8_t tmp[HMAC_OUTPUT_SIZE];
-	int i;
+	gint i;
 
 	memset(key, 0x00, HMAC_BLOCK_SIZE);
 	memset(ipad, 0x36, HMAC_BLOCK_SIZE);
@@ -90,7 +90,7 @@ __db_chksum(data, data_len, mac_key, store)
 	u_int8_t *mac_key;
 	u_int8_t *store;
 {
-	int sumlen;
+	gint sumlen;
 	u_int32_t hash4;
 	u_int8_t tmp[DB_MAC_KEY];
 
@@ -146,19 +146,19 @@ __db_derive_mac(passwd, plen, mac_key)
  *
  *	Return 0 on success, >0 (errno) on error, -1 on checksum mismatch.
  *
- * PUBLIC: int __db_check_chksum __P((DB_ENV *,
- * PUBLIC:     DB_CIPHER *, u_int8_t *, void *, size_t, int));
+ * PUBLIC: gint __db_check_chksum __P((DB_ENV *,
+ * PUBLIC:     DB_CIPHER *, u_int8_t *, gpointer , size_t, int));
  */
-int
+gint
 __db_check_chksum(dbenv, db_cipher, chksum, data, data_len, is_hmac)
 	DB_ENV *dbenv;
 	DB_CIPHER *db_cipher;
 	u_int8_t *chksum;
-	void *data;
+	gpointer data;
 	size_t data_len;
-	int is_hmac;
+	gint is_hmac;
 {
-	int ret;
+	gint ret;
 	size_t sum_len;
 	u_int32_t hash4;
 	u_int8_t *mac_key, old[DB_MAC_KEY], new[DB_MAC_KEY];
diff --git a/libdb/hmac/sha1.c b/libdb/hmac/sha1.c
index b4d5def..b59793d 100644
--- a/libdb/hmac/sha1.c
+++ b/libdb/hmac/sha1.c
@@ -1,7 +1,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 /*
 SHA-1 in C
@@ -15,14 +15,14 @@ Still 100% Public Domain
 
 Corrected a problem which generated improper hash values on 16 bit machines
 Routine SHA1Update changed from
-	void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int
+	void SHA1Update(SHA1_CTX* context, guchar * data, unsigned int
 len)
 to
-	void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned
+	void SHA1Update(SHA1_CTX* context, guchar * data, unsigned
 long len)
 
-The 'len' parameter was declared an int which works fine on 32 bit machines.
-However, on 16 bit machines an int is too small for the shifts being done
+The 'len' parameter was declared an gint which works fine on 32 bit machines.
+However, on 16 bit machines an gint is too small for the shifts being done
 against
 it.  This caused the hash function to generate incorrect values if len was
 greater than 8191 (8K - 1) due to the 'len << 3' on line 3 of SHA1Update().
@@ -32,11 +32,11 @@ be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million
 "a"s).
 
 I also changed the declaration of variables i & j in SHA1Update to
-unsigned long from unsigned int for the same reason.
+unsigned long from guint for the same reason.
 
 These changes should make no difference to any 32 bit implementations since
 an
-int and a long are the same size in those environments.
+gint and a long are the same size in those environments.
 
 --
 I also corrected a few compiler warnings generated by Borland C.
@@ -104,11 +104,11 @@ A million repetitions of "a"
 
 
 #ifdef VERBOSE  /* SAK */
-static void __db_SHAPrintContext __P((SHA1_CTX *, char *));
+static void __db_SHAPrintContext __P((SHA1_CTX *, gchar *));
 static void
 __db_SHAPrintContext(context, msg)
 	SHA1_CTX *context;
-	char *msg;
+	gchar *msg;
 {
   printf("%s (%d,%d) %x %x %x %x %x\n",
 	 msg,
@@ -126,22 +126,22 @@ __db_SHAPrintContext(context, msg)
 /*
  * __db_SHA1Transform --
  *
- * PUBLIC: void __db_SHA1Transform __P((u_int32_t *, unsigned char *));
+ * PUBLIC: void __db_SHA1Transform __P((u_int32_t *, guchar *));
  */
 void
 __db_SHA1Transform(state, buffer)
         u_int32_t *state;
-        unsigned char *buffer;
+        guchar *buffer;
 {
 u_int32_t a, b, c, d, e;
 typedef union {
-    unsigned char c[64];
+    guchar c[64];
     u_int32_t l[16];
 } CHAR64LONG16;
 CHAR64LONG16* block;
-static int is_bigendian = -1;
+static gint is_bigendian = -1;
 #ifdef SHA1HANDSOFF
-    unsigned char workspace[64];
+    guchar workspace[64];
 
     block = (CHAR64LONG16*)workspace;
     memcpy(block, buffer, 64);
@@ -216,13 +216,13 @@ __db_SHA1Init(context)
  * __db_SHA1Update --
  *      Run your data through this.
  *
- * PUBLIC: void __db_SHA1Update __P((SHA1_CTX *, unsigned char *,
+ * PUBLIC: void __db_SHA1Update __P((SHA1_CTX *, guchar *,
  * PUBLIC:     size_t));
  */
 void
 __db_SHA1Update(context, data, len)
         SHA1_CTX *context;
-        unsigned char *data;
+        guchar *data;
         size_t len;
 {
 u_int32_t i, j;	/* JHB */
@@ -255,23 +255,23 @@ u_int32_t i, j;	/* JHB */
  * __db_SHA1Final --
  *      Add padding and return the message digest.
  *
- * PUBLIC: void __db_SHA1Final __P((unsigned char *, SHA1_CTX *));
+ * PUBLIC: void __db_SHA1Final __P((guchar *, SHA1_CTX *));
  */
 void
 __db_SHA1Final(digest, context)
-        unsigned char *digest;
+        guchar *digest;
         SHA1_CTX *context;
 {
 u_int32_t i;	/* JHB */
-unsigned char finalcount[8];
+guchar finalcount[8];
 
     for (i = 0; i < 8; i++) {
         finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
          >> ((3-(i & 3)) * 8) ) & 255);  /* Endian independent */
     }
-    __db_SHA1Update(context, (unsigned char *)"\200", 1);
+    __db_SHA1Update(context, (guchar *)"\200", 1);
     while ((context->count[0] & 504) != 448) {
-        __db_SHA1Update(context, (unsigned char *)"\0", 1);
+        __db_SHA1Update(context, (guchar *)"\0", 1);
     }
     __db_SHA1Update(context, finalcount, 8);  /* Should cause a SHA1Transform()
 */
diff --git a/libdb/hsearch/hsearch.c b/libdb/hsearch/hsearch.c
index 5b6b42d..2d7d7e5 100644
--- a/libdb/hsearch/hsearch.c
+++ b/libdb/hsearch/hsearch.c
@@ -43,7 +43,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -64,17 +64,17 @@ static ENTRY	 retval;
  *
  * EXTERN: #if DB_DBM_HSEARCH != 0
  *
- * EXTERN: int __db_hcreate __P((size_t));
+ * EXTERN: gint __db_hcreate __P((size_t));
  * EXTERN: ENTRY *__db_hsearch __P((ENTRY, ACTION));
  * EXTERN: void __db_hdestroy __P((void));
  *
  * EXTERN: #endif
  */
-int
+gint
 __db_hcreate(nel)
 	size_t nel;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = db_create(&dbp, NULL, 0)) != 0) {
 		__os_set_errno(ret);
@@ -101,7 +101,7 @@ __db_hsearch(item, action)
 	ACTION action;
 {
 	DBT key, val;
-	int ret;
+	gint ret;
 
 	if (dbp == NULL) {
 		__os_set_errno(EINVAL);
@@ -139,7 +139,7 @@ __db_hsearch(item, action)
 				__os_set_errno(ret);
 			return (NULL);
 		}
-		item.data = (char *)val.data;
+		item.data = (gchar *)val.data;
 		break;
 	default:
 		__os_set_errno(EINVAL);
diff --git a/libdb/libdb_java/java_Db.c b/libdb/libdb_java/java_Db.c
index d6dace9..6182ab0 100644
--- a/libdb/libdb_java/java_Db.c
+++ b/libdb/libdb_java/java_Db.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -27,7 +27,7 @@ struct verify_callback_struct {
 	JNIEnv *env;
 	jobject streamobj;
 	jbyteArray bytes;
-	int nbytes;
+	gint nbytes;
 	jmethodID writemid;
 };
 
@@ -59,7 +59,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db_one_1time_1init
 JNIEXPORT void JNICALL Java_com_sleepycat_db_Db__1init
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbEnv*/ jobject jdbenv, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	DB_JAVAINFO *dbinfo;
 	DB_ENV *dbenv;
@@ -99,7 +99,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db__1associate
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db__1close
   (JNIEnv *jnienv, /*Db*/ jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	DB_JAVAINFO *dbinfo;
 
@@ -179,7 +179,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db_bt_1prefix_1changed
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_Db_cursor
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbTxn*/ jobject txnid, jint flags)
 {
-	int err;
+	gint err;
 	DBC *dbc;
 	DB *db = get_DB(jnienv, jthis);
 	DB_TXN *dbtxnid = get_DB_TXN(jnienv, txnid);
@@ -195,7 +195,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db_del
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbTxn*/ jobject txnid,
    /*Dbt*/ jobject key, jint dbflags)
 {
-	int err;
+	gint err;
 	DB_TXN *dbtxnid;
 	DB *db;
 	LOCKED_DBT lkey;
@@ -270,8 +270,8 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db_errx
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db_fd
   (JNIEnv *jnienv, /*Db*/ jobject jthis)
 {
-	int err;
-	int return_value = 0;
+	gint err;
+	gint return_value = 0;
 	DB *db = get_DB(jnienv, jthis);
 
 	if (!verify_non_null(jnienv, db))
@@ -286,7 +286,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db_fd
 JNIEXPORT void JNICALL Java_com_sleepycat_db_Db_set_1encrypt
   (JNIEnv *jnienv, /*Db*/ jobject jthis, jstring jpasswd, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	LOCKED_STRING ls_passwd;
 
@@ -320,7 +320,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db_get
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbTxn*/ jobject txnid,
    /*Dbt*/ jobject key, /*Dbt*/ jobject data, jint flags)
 {
-	int err, op_flags, retry;
+	gint err, op_flags, retry;
 	DB *db;
 	DB_ENV *dbenv;
 	OpKind keyop, dataop;
@@ -396,13 +396,13 @@ JNIEXPORT jobject JNICALL Java_com_sleepycat_db_Db_join
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*Dbc[]*/ jobjectArray curslist,
    jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
-	int count;
+	gint count;
 	DBC **newlist;
 	DBC *dbc;
-	int i;
-	int size;
+	gint i;
+	gint size;
 
 	db = get_DB(jnienv, jthis);
 	count = (*jnienv)->GetArrayLength(jnienv, curslist);
@@ -444,7 +444,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db_key_1range
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbTxn*/ jobject txnid,
    /*Dbt*/ jobject jkey, jobject /*DbKeyRange*/ range, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	DB_TXN *dbtxnid;
 	LOCKED_DBT lkey;
@@ -480,7 +480,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db_pget
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbTxn*/ jobject txnid,
    /*Dbt*/ jobject key, /*Dbt*/ jobject rkey, /*Dbt*/ jobject data, jint flags)
 {
-	int err, op_flags, retry;
+	gint err, op_flags, retry;
 	DB *db;
 	DB_ENV *dbenv;
 	OpKind keyop, rkeyop, dataop;
@@ -550,7 +550,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db_put
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbTxn*/ jobject txnid,
    /*Dbt*/ jobject key, /*Dbt*/ jobject data, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	DB_ENV *dbenv;
 	DB_TXN *dbtxnid;
@@ -597,7 +597,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db__1remove
   (JNIEnv *jnienv, /*Db*/ jobject jthis,
    jstring file, jstring database, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	DB_JAVAINFO *dbinfo;
 	LOCKED_STRING ls_file;
@@ -629,7 +629,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db__1rename
   (JNIEnv *jnienv, /*Db*/ jobject jthis,
    jstring file, jstring database, jstring newname, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	DB_JAVAINFO *dbinfo;
 	LOCKED_STRING ls_file;
@@ -675,7 +675,7 @@ JNIEXPORT void JNICALL
   Java_com_sleepycat_db_Db_set_1re_1source
   (JNIEnv *jnienv, /*Db*/ jobject jthis, jstring re_source)
 {
-	int err;
+	gint err;
 	DB *db;
 
 	db = get_DB(jnienv, jthis);
@@ -703,7 +703,7 @@ JNIEXPORT jobject JNICALL Java_com_sleepycat_db_Db_stat
 	jobject retval;
 	jclass dbclass;
 	size_t bytesize;
-	void *statp;
+	gpointer statp;
 
 	bytesize = 0;
 	retval = NULL;
@@ -777,7 +777,7 @@ JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_Db_get_1byteswapped
   (JNIEnv *jnienv, /*Db*/ jobject jthis)
 {
 	DB *db;
-	int err, isbyteswapped;
+	gint err, isbyteswapped;
 
 	/* This value should never be seen, because of the exception. */
 	isbyteswapped = 0;
@@ -796,7 +796,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db_get_1type
   (JNIEnv *jnienv, /*Db*/ jobject jthis)
 {
 	DB *db;
-	int err;
+	gint err;
 	DBTYPE dbtype;
 
 	/* This value should never be seen, because of the exception. */
@@ -816,7 +816,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db__1open
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbTxn*/ jobject txnid,
    jstring file, jstring database, jint type, jint flags, jint mode)
 {
-	int err;
+	gint err;
 	DB *db;
 	DB_TXN *dbtxnid;
 	LOCKED_STRING ls_file;
@@ -846,7 +846,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db__1open
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_Db_truncate
   (JNIEnv *jnienv, /*Db*/ jobject jthis, /*DbTxn*/ jobject jtxnid, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	u_int32_t count;
 	DB_TXN *dbtxnid;
@@ -865,7 +865,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db_upgrade
   (JNIEnv *jnienv, /*Db*/ jobject jthis, jstring name,
    jint flags)
 {
-	int err;
+	gint err;
 	DB *db = get_DB(jnienv, jthis);
 	LOCKED_STRING ls_name;
 
@@ -879,14 +879,14 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db_upgrade
 	locked_string_put(&ls_name, jnienv);
 }
 
-static int java_verify_callback(void *handle, const void *str_arg)
+static gint java_verify_callback(gpointer handle, gconstpointer str_arg)
 {
-	char *str;
+	gchar *str;
 	struct verify_callback_struct *vc;
-	int len;
+	gint len;
 	JNIEnv *jnienv;
 
-	str = (char *)str_arg;
+	str = (gchar *)str_arg;
 	vc = (struct verify_callback_struct *)handle;
 	jnienv = vc->env;
 	len = strlen(str)+1;
@@ -912,7 +912,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Db_verify
   (JNIEnv *jnienv, /*Db*/ jobject jthis, jstring name,
    jstring subdb, jobject stream, jint flags)
 {
-	int err;
+	gint err;
 	DB *db;
 	LOCKED_STRING ls_name;
 	LOCKED_STRING ls_subdb;
diff --git a/libdb/libdb_java/java_DbEnv.c b/libdb/libdb_java/java_DbEnv.c
index 561ae90..e4edaac 100644
--- a/libdb/libdb_java/java_DbEnv.c
+++ b/libdb/libdb_java/java_DbEnv.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -36,7 +36,7 @@ JAVADB_SET_METH(DbEnv, jint, lk_1max_1objects, DB_ENV, lk_max_objects)
 JAVADB_SET_METH_STR(DbEnv,   tmp_1dir, DB_ENV, tmp_dir)
 JAVADB_SET_METH(DbEnv, jint, tx_1max, DB_ENV, tx_max)
 
-static void DbEnv_errcall_callback(const char *prefix, char *message)
+static void DbEnv_errcall_callback(const gchar *prefix, gchar *message)
 {
 	JNIEnv *jnienv;
 	DB_ENV_JAVAINFO *envinfo = (DB_ENV_JAVAINFO *)prefix;
@@ -78,7 +78,7 @@ static void DbEnv_errcall_callback(const char *prefix, char *message)
 static void DbEnv_initialize(JNIEnv *jnienv, DB_ENV *dbenv,
 			     /*DbEnv*/ jobject jenv,
 			     /*DbErrcall*/ jobject jerrcall,
-			     int is_dbopen)
+			     gint is_dbopen)
 {
 	DB_ENV_JAVAINFO *envinfo;
 
@@ -86,7 +86,7 @@ static void DbEnv_initialize(JNIEnv *jnienv, DB_ENV *dbenv,
 	DB_ASSERT(envinfo == NULL);
 	envinfo = dbjie_construct(jnienv, jenv, jerrcall, is_dbopen);
 	set_private_info(jnienv, name_DB_ENV, jenv, envinfo);
-	dbenv->set_errpfx(dbenv, (const char*)envinfo);
+	dbenv->set_errpfx(dbenv, (const gchar *)envinfo);
 	dbenv->set_errcall(dbenv, DbEnv_errcall_callback);
 	dbenv->api2_internal = envinfo;
 	set_private_dbobj(jnienv, name_DB_ENV, jenv, dbenv);
@@ -129,7 +129,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv__1init
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jobject /*DbErrcall*/ jerrcall,
    jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 
 	err = db_env_create(&dbenv, flags);
@@ -153,7 +153,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_open
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jstring db_home,
    jint flags, jint mode)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	LOCKED_STRING ls_home;
 	DB_ENV_JAVAINFO *dbenvinfo;
@@ -181,7 +181,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_remove
 	DB_ENV *dbenv;
 	DB_ENV_JAVAINFO *dbenvinfo;
 	LOCKED_STRING ls_home;
-	int err = 0;
+	gint err = 0;
 
 	dbenv = get_DB_ENV(jnienv, jthis);
 	dbenvinfo = get_DB_ENV_JAVAINFO(jnienv, jthis);
@@ -204,7 +204,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_remove
 JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv__1close
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	DB_ENV_JAVAINFO *dbenvinfo;
 
@@ -230,7 +230,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_dbremove
 	LOCKED_STRING ls_name, ls_subdb;
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	int err;
+	gint err;
 
 	dbenv = get_DB_ENV(jnienv, jthis);
 	if (!verify_non_null(jnienv, dbenv))
@@ -258,7 +258,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_dbrename
 	LOCKED_STRING ls_name, ls_subdb, ls_newname;
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	int err;
+	gint err;
 
 	dbenv = get_DB_ENV(jnienv, jthis);
 	if (!verify_non_null(jnienv, dbenv))
@@ -322,7 +322,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_errx
 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_DbEnv_strerror
   (JNIEnv *jnienv, jclass jthis_class, jint ecode)
 {
-	const char *message;
+	const gchar *message;
 
 	COMPQUIET(jthis_class, NULL);
 	message = db_strerror(ecode);
@@ -336,7 +336,7 @@ JAVADB_METHOD(DbEnv_set_1cachesize,
 JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_set_1encrypt
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jstring jpasswd, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	LOCKED_STRING ls_passwd;
 
@@ -371,10 +371,10 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_set_1lk_1conflicts
 {
 	DB_ENV *dbenv;
 	DB_ENV_JAVAINFO *dbenvinfo;
-	int err;
+	gint err;
 	jsize i, len;
 	u_char *newarr;
-	int bytesize;
+	gint bytesize;
 
 	dbenv = get_DB_ENV(jnienv, jthis);
 	dbenvinfo = get_DB_ENV_JAVAINFO(jnienv, jthis);
@@ -408,7 +408,7 @@ JNIEXPORT jint JNICALL
    jint timeout)
 {
 	DB_ENV *dbenv;
-	int err, id;
+	gint err, id;
 
 	if (!verify_non_null(jnienv, jthis))
 		return (DB_EID_INVALID);
@@ -429,7 +429,7 @@ JNIEXPORT jint JNICALL
 {
 	DB_ENV *dbenv;
 	LOCKED_DBT cdbt, rdbt;
-	int err, envid;
+	gint err, envid;
 
 	if (!verify_non_null(jnienv, jthis) || !verify_non_null(jnienv, result))
 		return (-1);
@@ -469,7 +469,7 @@ JNIEXPORT void JNICALL
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	LOCKED_DBT ldbt;
-	int err;
+	gint err;
 
 	if (!verify_non_null(jnienv, jthis))
 		return;
@@ -494,7 +494,7 @@ out:	if (cookie != NULL)
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_DbEnv_rep_1stat
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
 	DB_REP_STAT *statp = NULL;
 	jobject retval = NULL;
@@ -522,7 +522,7 @@ Java_com_sleepycat_db_DbEnv_set_1rep_1limit
   (JNIEnv *jnienv, /* DbEnv */ jobject jthis, jint gbytes, jint bytes)
 {
 	DB_ENV *dbenv;
-	int err;
+	gint err;
 
 	dbenv = get_DB_ENV(jnienv, jthis);
 
@@ -557,9 +557,9 @@ JNIEXPORT void JNICALL
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, /*DbClient*/ jobject jclient,
    jstring jhost, jlong tsec, jlong ssec, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
-	const char *host = (*jnienv)->GetStringUTFChars(jnienv, jhost, NULL);
+	const gchar *host = (*jnienv)->GetStringUTFChars(jnienv, jhost, NULL);
 
 	if (jclient != NULL) {
 		report_exception(jnienv, "DbEnv.set_rpc_server client arg "
@@ -583,7 +583,7 @@ JNIEXPORT void JNICALL
   Java_com_sleepycat_db_DbEnv__1set_1tx_1timestamp
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jlong seconds)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
 	time_t time = seconds;
 
@@ -641,7 +641,7 @@ JNIEXPORT jstring JNICALL Java_com_sleepycat_db_DbEnv_get_1version_1string
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_DbEnv_lock_1id
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis)
 {
-	int err;
+	gint err;
 	u_int32_t id;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
 
@@ -658,7 +658,7 @@ JAVADB_METHOD(DbEnv_lock_1id_1free, (JAVADB_ARGS, jint id), DB_ENV,
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_DbEnv_lock_1stat
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
 	DB_LOCK_STAT *statp = NULL;
 	jobject retval = NULL;
@@ -684,9 +684,9 @@ err:		__os_ufree(dbenv, statp);
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_DbEnv_lock_1detect
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint atype, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
-	int aborted;
+	gint aborted;
 
 	if (!verify_non_null(jnienv, dbenv))
 		return (0);
@@ -699,7 +699,7 @@ JNIEXPORT /*DbLock*/ jobject JNICALL Java_com_sleepycat_db_DbEnv_lock_1get
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, /*u_int32_t*/ jint locker,
    jint flags, /*const Dbt*/ jobject obj, /*db_lockmode_t*/ jint lock_mode)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	DB_LOCK *dblock;
 	LOCKED_DBT lobj;
@@ -747,16 +747,16 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_lock_1vec
 	DB_LOCKREQ *failedreq;
 	DB_LOCK *lockp;
 	LOCKED_DBT *locked_dbts;
-	int err;
-	int alloc_err;
-	int i;
+	gint err;
+	gint alloc_err;
+	gint i;
 	size_t bytesize;
 	size_t ldbtsize;
 	jobject jlockreq;
 	db_lockop_t op;
 	jobject jobj;
 	jobject jlock;
-	int completed;
+	gint completed;
 
 	dbenv = get_DB_ENV(jnienv, jthis);
 	if (!verify_non_null(jnienv, dbenv))
@@ -931,7 +931,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_lock_1vec
 JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_lock_1put
   (JNIEnv *jnienv, jobject jthis, /*DbLock*/ jobject jlock)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	DB_LOCK *dblock;
 
@@ -959,8 +959,8 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_lock_1put
 JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_DbEnv_log_1archive
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err, len, i;
-	char** ret;
+	gint err, len, i;
+	gchar ** ret;
 	jclass stringClass;
 	jobjectArray strarray;
 	DB_ENV *dbenv;
@@ -1007,7 +1007,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_DbEnv_log_1compare
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_DbEnv_log_1cursor
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DB_LOGC *dblogc;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
 
@@ -1021,10 +1021,10 @@ JNIEXPORT jobject JNICALL Java_com_sleepycat_db_DbEnv_log_1cursor
 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_DbEnv_log_1file
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, /*DbLsn*/ jobject lsn)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
 	DB_LSN *dblsn = get_DB_LSN(jnienv, lsn);
-	char filename[FILENAME_MAX+1] = "";
+	gchar filename[FILENAME_MAX+1] = "";
 
 	if (!verify_non_null(jnienv, dbenv))
 		return (NULL);
@@ -1043,7 +1043,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_log_1put
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, /*DbLsn*/ jobject lsn,
    /*DbDbt*/ jobject data, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	DB_LSN *dblsn;
 	LOCKED_DBT ldata;
@@ -1069,7 +1069,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_log_1put
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_DbEnv_log_1stat
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	DB_LOG_STAT *statp;
 	jobject retval;
@@ -1098,7 +1098,7 @@ err:		__os_ufree(dbenv, statp);
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_DbEnv_memp_1stat
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	jclass dbclass;
 	DB_ENV *dbenv;
 	DB_MPOOL_STAT *statp;
@@ -1127,7 +1127,7 @@ err:		__os_ufree(dbenv, statp);
 JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_DbEnv_memp_1fstat
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err, i, len;
+	gint err, i, len;
 	jclass fstat_class;
 	DB_ENV *dbenv;
 	DB_MPOOL_FSTAT **fstatp;
@@ -1190,9 +1190,9 @@ err:		__os_ufree(dbenv, fstatp);
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_DbEnv_memp_1trickle
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint pct)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv = get_DB_ENV(jnienv, jthis);
-	int result = 0;
+	gint result = 0;
 
 	if (verify_non_null(jnienv, dbenv)) {
 		err = dbenv->memp_trickle(dbenv, pct, &result);
@@ -1204,7 +1204,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_DbEnv_memp_1trickle
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_DbEnv_txn_1begin
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, /*DbTxn*/ jobject pid, jint flags)
 {
-	int err;
+	gint err;
 	DB_TXN *dbpid, *result;
 	DB_ENV *dbenv;
 
@@ -1243,12 +1243,12 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_DbEnv_app_1dispatch_1changed
 JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_DbEnv_txn_1recover
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint count, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	DB_PREPLIST *preps;
 	long retcount;
-	int i;
-	char signature[128];
+	gint i;
+	gchar signature[128];
 	size_t bytesize;
 	jobject retval;
 	jobject obj;
@@ -1328,15 +1328,15 @@ out:	return (retval);
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_DbEnv_txn_1stat
   (JNIEnv *jnienv, /*DbEnv*/ jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DB_ENV *dbenv;
 	DB_TXN_STAT *statp;
 	jobject retval, obj;
 	jclass dbclass, active_class;
-	char active_signature[512];
+	gchar active_signature[512];
 	jfieldID arrid;
 	jobjectArray actives;
-	unsigned int i;
+	guint i;
 
 	retval = NULL;
 	statp = NULL;
diff --git a/libdb/libdb_java/java_DbLock.c b/libdb/libdb_java/java_DbLock.c
index 51aca62..50b1a27 100644
--- a/libdb/libdb_java/java_DbLock.c
+++ b/libdb/libdb_java/java_DbLock.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
diff --git a/libdb/libdb_java/java_DbLogc.c b/libdb/libdb_java/java_DbLogc.c
index f42667d..59f9c12 100644
--- a/libdb/libdb_java/java_DbLogc.c
+++ b/libdb/libdb_java/java_DbLogc.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -25,7 +25,7 @@ static const char revid[] = "$Id$";
 JNIEXPORT void JNICALL Java_com_sleepycat_db_DbLogc_close
   (JNIEnv *jnienv, jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DB_LOGC *dblogc = get_DB_LOGC(jnienv, jthis);
 
 	if (!verify_non_null(jnienv, dblogc))
@@ -40,7 +40,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_DbLogc_get
   (JNIEnv *jnienv, jobject jthis,
    /*DbLsn*/ jobject lsn, /*Dbt*/ jobject data, jint flags)
 {
-	int err, retry;
+	gint err, retry;
 	DB_LOGC *dblogc;
 	DB_LSN *dblsn;
 	LOCKED_DBT ldata;
diff --git a/libdb/libdb_java/java_DbLsn.c b/libdb/libdb_java/java_DbLsn.c
index f4d5d62..6ea3e18 100644
--- a/libdb/libdb_java/java_DbLsn.c
+++ b/libdb/libdb_java/java_DbLsn.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
diff --git a/libdb/libdb_java/java_DbTxn.c b/libdb/libdb_java/java_DbTxn.c
index 0a8b2af..3e94379 100644
--- a/libdb/libdb_java/java_DbTxn.c
+++ b/libdb/libdb_java/java_DbTxn.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -29,7 +29,7 @@ JAVADB_METHOD(DbTxn_discard, (JAVADB_ARGS, jint flags), DB_TXN,
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_DbTxn_id
   (JNIEnv *jnienv, jobject jthis)
 {
-	int retval = 0;
+	gint retval = 0;
 	DB_TXN *dbtxn = get_DB_TXN(jnienv, jthis);
 	if (!verify_non_null(jnienv, dbtxn))
 		return (-1);
@@ -42,7 +42,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_DbTxn_id
 JNIEXPORT void JNICALL Java_com_sleepycat_db_DbTxn_prepare
   (JNIEnv *jnienv, jobject jthis, jbyteArray gid)
 {
-	int err;
+	gint err;
 	DB_TXN *dbtxn;
 	jbyte *c_array;
 
diff --git a/libdb/libdb_java/java_DbUtil.c b/libdb/libdb_java/java_DbUtil.c
index ed958dd..bbabde0 100644
--- a/libdb/libdb_java/java_DbUtil.c
+++ b/libdb/libdb_java/java_DbUtil.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
diff --git a/libdb/libdb_java/java_DbXAResource.c b/libdb/libdb_java/java_DbXAResource.c
index fba0900..7039f8a 100644
--- a/libdb/libdb_java/java_DbXAResource.c
+++ b/libdb/libdb_java/java_DbXAResource.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -27,7 +27,7 @@ static const char revid[] = "$Id$";
 JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1init
   (JNIEnv *jnienv, jobject jthis, jstring home, jint rmid, jint flags)
 {
-	int err;
+	gint err;
 	LOCKED_STRING ls_home;
 	jclass cl;
 	jmethodID mid;
@@ -35,7 +35,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1init
 	COMPQUIET(jthis, NULL);
 	if (locked_string_get(&ls_home, jnienv, home) != 0)
 		goto out;
-	if ((err = __db_xa_open((char *)ls_home.string,
+	if ((err = __db_xa_open((gchar *)ls_home.string,
 				rmid, flags)) != XA_OK) {
 		verify_return(jnienv, err, EXCEPTION_XA);
 	}
@@ -58,13 +58,13 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1init
 JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1close
   (JNIEnv *jnienv, jobject jthis, jstring home, jint rmid, jint flags)
 {
-	int err;
+	gint err;
 	LOCKED_STRING ls_home;
 
 	COMPQUIET(jthis, NULL);
 	if (locked_string_get(&ls_home, jnienv, home) != 0)
 		goto out;
-	if ((err = __db_xa_close((char *)ls_home.string,
+	if ((err = __db_xa_close((gchar *)ls_home.string,
 				 rmid, flags)) != XA_OK)
 		verify_return(jnienv, err, EXCEPTION_XA);
  out:
@@ -77,7 +77,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1commit
 {
 	XID xid;
 	long flags;
-	int err;
+	gint err;
 
 	COMPQUIET(jthis, NULL);
 	if (!get_XID(jnienv, jxid, &xid))
@@ -93,7 +93,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1end
   (JNIEnv *jnienv, jobject jthis, jobject jxid, jint rmid, jint flags)
 {
 	XID xid;
-	int err;
+	gint err;
 
 	COMPQUIET(jthis, NULL);
 	if (!get_XID(jnienv, jxid, &xid))
@@ -106,7 +106,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1forget
   (JNIEnv *jnienv, jobject jthis, jobject jxid, jint rmid)
 {
 	XID xid;
-	int err;
+	gint err;
 
 	COMPQUIET(jthis, NULL);
 	if (!get_XID(jnienv, jxid, &xid))
@@ -119,7 +119,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_xa_DbXAResource__1prepare
   (JNIEnv *jnienv, jobject jthis, jobject jxid, jint rmid)
 {
 	XID xid;
-	int err;
+	gint err;
 
 	COMPQUIET(jthis, NULL);
 	if (!get_XID(jnienv, jxid, &xid))
@@ -135,11 +135,11 @@ JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_xa_DbXAResource__1recover
   (JNIEnv *jnienv, jobject jthis, jint rmid, jint flags)
 {
 	XID *xids;
-	int err;
-	int total;
-	int cnt;
-	int i;
-	int curflags;
+	gint err;
+	gint total;
+	gint cnt;
+	gint i;
+	gint curflags;
 	size_t nbytes;
 	jclass xid_class;
 	jmethodID mid;
@@ -212,7 +212,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1rollback
   (JNIEnv *jnienv, jobject jthis, jobject jxid, jint rmid)
 {
 	XID xid;
-	int err;
+	gint err;
 
 	COMPQUIET(jthis, NULL);
 	if (!get_XID(jnienv, jxid, &xid))
@@ -225,7 +225,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_xa_DbXAResource__1start
   (JNIEnv *jnienv, jobject jthis, jobject jxid, jint rmid, jint flags)
 {
 	XID xid;
-	int err;
+	gint err;
 
 	COMPQUIET(jthis, NULL);
 	if (!get_XID(jnienv, jxid, &xid))
@@ -240,11 +240,11 @@ JNIEXPORT jobject JNICALL Java_com_sleepycat_db_xa_DbXAResource_xa_1attach
 {
 	XID xid;
 	XID *xidp;
-	int ret;
+	gint ret;
 	DB_ENV *env;
 	DB_TXN *txn;
-	int rmid;
-	int *rmidp;
+	gint rmid;
+	gint *rmidp;
 	jobject jtxn;
 	jobject jenv;
 	jclass cl;
diff --git a/libdb/libdb_java/java_Dbc.c b/libdb/libdb_java/java_Dbc.c
index 025da40..b69db1e 100644
--- a/libdb/libdb_java/java_Dbc.c
+++ b/libdb/libdb_java/java_Dbc.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -25,7 +25,7 @@ static const char revid[] = "$Id$";
 JNIEXPORT void JNICALL Java_com_sleepycat_db_Dbc_close
   (JNIEnv *jnienv, jobject jthis)
 {
-	int err;
+	gint err;
 	DBC *dbc = get_DBC(jnienv, jthis);
 
 	if (!verify_non_null(jnienv, dbc))
@@ -39,7 +39,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_Dbc_close
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_Dbc_count
   (JNIEnv *jnienv, jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DBC *dbc = get_DBC(jnienv, jthis);
 	db_recno_t count;
 
@@ -56,7 +56,7 @@ JAVADB_METHOD_INT(Dbc_del, (JAVADB_ARGS, jint flags), DBC,
 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_Dbc_dup
   (JNIEnv *jnienv, jobject jthis, jint flags)
 {
-	int err;
+	gint err;
 	DBC *dbc = get_DBC(jnienv, jthis);
 	DBC *dbc_ret = NULL;
 
@@ -73,7 +73,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Dbc_get
   (JNIEnv *jnienv, jobject jthis,
    /*Dbt*/ jobject key, /*Dbt*/ jobject data, jint flags)
 {
-	int err, retry, op_flags;
+	gint err, retry, op_flags;
 	DBC *dbc;
 	DB_ENV *dbenv;
 	LOCKED_DBT lkey, ldata;
@@ -143,7 +143,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Dbc_pget
   (JNIEnv *jnienv, jobject jthis,
    /*Dbt*/ jobject key, /*Dbt*/ jobject pkey, /*Dbt*/ jobject data, jint flags)
 {
-	int err, retry, op_flags;
+	gint err, retry, op_flags;
 	DBC *dbc;
 	DB_ENV *dbenv;
 	LOCKED_DBT lkey, lpkey, ldata;
@@ -220,7 +220,7 @@ JNIEXPORT jint JNICALL Java_com_sleepycat_db_Dbc_put
   (JNIEnv *jnienv, jobject jthis,
    /*Dbt*/ jobject key, /*Dbt*/ jobject data, jint flags)
 {
-	int err;
+	gint err;
 	DBC *dbc;
 	DB_ENV *dbenv;
 	LOCKED_DBT lkey, ldata;
diff --git a/libdb/libdb_java/java_Dbt.c b/libdb/libdb_java/java_Dbt.c
index 5d04c91..5207f5a 100644
--- a/libdb/libdb_java/java_Dbt.c
+++ b/libdb/libdb_java/java_Dbt.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -33,7 +33,7 @@ JNIEXPORT jbyteArray JNICALL Java_com_sleepycat_db_Dbt_create_1data
 {
 	DBT_JAVAINFO *db_this;
 	jbyteArray arr = NULL;
-	int len;
+	gint len;
 
 	db_this = get_DBT_JAVAINFO(jnienv, jthis);
 	if (verify_non_null(jnienv, db_this)) {
diff --git a/libdb/libdb_java/java_info.c b/libdb/libdb_java/java_info.c
index a0369d8..c4c54ab 100644
--- a/libdb/libdb_java/java_info.c
+++ b/libdb/libdb_java/java_info.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -23,7 +23,7 @@ static const char revid[] = "$Id$";
  * Callback functions
  */
 
-static int Db_assoc_callback(DB *db,
+static gint Db_assoc_callback(DB *db,
 			     const DBT *key,
 			     const DBT *data,
 			     DBT *retval)
@@ -36,7 +36,7 @@ static int Db_assoc_callback(DB *db,
 	    key, data, retval));
 }
 
-static void Db_feedback_callback(DB *db, int opcode, int percent)
+static void Db_feedback_callback(DB *db, gint opcode, gint percent)
 {
 	DB_JAVAINFO *dbinfo;
 
@@ -45,7 +45,7 @@ static void Db_feedback_callback(DB *db, int opcode, int percent)
 	dbji_call_feedback(dbinfo, db, dbinfo->jdbref, opcode, percent);
 }
 
-static int Db_append_recno_callback(DB *db, DBT *dbt, db_recno_t recno)
+static gint Db_append_recno_callback(DB *db, DBT *dbt, db_recno_t recno)
 {
 	DB_JAVAINFO *dbinfo;
 
@@ -53,7 +53,7 @@ static int Db_append_recno_callback(DB *db, DBT *dbt, db_recno_t recno)
 	return (dbji_call_append_recno(dbinfo, db, dbinfo->jdbref, dbt, recno));
 }
 
-static int Db_bt_compare_callback(DB *db, const DBT *dbt1, const DBT *dbt2)
+static gint Db_bt_compare_callback(DB *db, const DBT *dbt1, const DBT *dbt2)
 {
 	DB_JAVAINFO *dbinfo;
 
@@ -69,7 +69,7 @@ static size_t Db_bt_prefix_callback(DB *db, const DBT *dbt1, const DBT *dbt2)
 	return (dbji_call_bt_prefix(dbinfo, db, dbinfo->jdbref, dbt1, dbt2));
 }
 
-static int Db_dup_compare_callback(DB *db, const DBT *dbt1, const DBT *dbt2)
+static gint Db_dup_compare_callback(DB *db, const DBT *dbt1, const DBT *dbt2)
 {
 	DB_JAVAINFO *dbinfo;
 
@@ -77,7 +77,7 @@ static int Db_dup_compare_callback(DB *db, const DBT *dbt1, const DBT *dbt2)
 	return (dbji_call_dup_compare(dbinfo, db, dbinfo->jdbref, dbt1, dbt2));
 }
 
-static u_int32_t Db_h_hash_callback(DB *db, const void *data, u_int32_t len)
+static u_int32_t Db_h_hash_callback(DB *db, gconstpointer data, u_int32_t len)
 {
 	DB_JAVAINFO *dbinfo;
 
@@ -85,7 +85,7 @@ static u_int32_t Db_h_hash_callback(DB *db, const void *data, u_int32_t len)
 	return (dbji_call_h_hash(dbinfo, db, dbinfo->jdbref, data, len));
 }
 
-static void DbEnv_feedback_callback(DB_ENV *dbenv, int opcode, int percent)
+static void DbEnv_feedback_callback(DB_ENV *dbenv, gint opcode, gint percent)
 {
 	DB_ENV_JAVAINFO *dbinfo;
 
@@ -94,9 +94,9 @@ static void DbEnv_feedback_callback(DB_ENV *dbenv, int opcode, int percent)
 	dbjie_call_feedback(dbinfo, dbenv, dbinfo->jenvref, opcode, percent);
 }
 
-static int DbEnv_rep_transport_callback(DB_ENV *dbenv,
+static gint DbEnv_rep_transport_callback(DB_ENV *dbenv,
 					const DBT *control, const DBT *rec,
-					int envid, u_int32_t flags)
+					gint envid, u_int32_t flags)
 {
 	DB_ENV_JAVAINFO *dbinfo;
 
@@ -105,7 +105,7 @@ static int DbEnv_rep_transport_callback(DB_ENV *dbenv,
 	    dbinfo->jenvref, control, rec, envid, (int)flags));
 }
 
-static int DbEnv_app_dispatch_callback(DB_ENV *dbenv, DBT *dbt,
+static gint DbEnv_app_dispatch_callback(DB_ENV *dbenv, DBT *dbt,
 				     DB_LSN *lsn, db_recops recops)
 {
 	DB_ENV_JAVAINFO *dbinfo;
@@ -124,7 +124,7 @@ DBT_JAVAINFO *
 dbjit_construct()
 {
 	DBT_JAVAINFO *dbjit;
-	int err;
+	gint err;
 
 	/*XXX should return err*/
 	if ((err = __os_malloc(NULL, sizeof(DBT_JAVAINFO), &dbjit)) != 0)
@@ -152,10 +152,10 @@ DB_ENV_JAVAINFO *
 dbjie_construct(JNIEnv *jnienv,
 		jobject jenv,
 		jobject default_errcall,
-		int is_dbopen)
+		gint is_dbopen)
 {
 	DB_ENV_JAVAINFO *dbjie;
-	int err;
+	gint err;
 
 	/*XXX should return err*/
 	if ((err = __os_malloc(NULL, sizeof(DB_ENV_JAVAINFO), &dbjie)) != 0)
@@ -243,10 +243,10 @@ dbjie_get_jnienv(DB_ENV_JAVAINFO *dbjie)
 	 * Different versions of the JNI disagree on the signature
 	 * for AttachCurrentThread.  The most recent documentation
 	 * seems to say that (JNIEnv **) is correct, but newer
-	 * JNIs seem to use (void **), oddly enough.
+	 * JNIs seem to use (gpointer *), oddly enough.
 	 */
 #ifdef JNI_VERSION_1_2
-	void *attachret = 0;
+	gpointer attachret = 0;
 #else
 	JNIEnv *attachret = 0;
 #endif
@@ -306,7 +306,7 @@ dbjie_set_conflict(DB_ENV_JAVAINFO *dbjie, u_char *newarr, size_t size)
 void dbjie_set_feedback_object(DB_ENV_JAVAINFO *dbjie, JNIEnv *jnienv,
 			       DB_ENV *dbenv, jobject jfeedback)
 {
-	int err;
+	gint err;
 
 	if (dbjie->feedback != NULL) {
 		DELETE_GLOBAL_REF(jnienv, dbjie->feedback);
@@ -327,7 +327,7 @@ void dbjie_set_feedback_object(DB_ENV_JAVAINFO *dbjie, JNIEnv *jnienv,
 }
 
 void dbjie_call_feedback(DB_ENV_JAVAINFO *dbjie, DB_ENV *dbenv, jobject jenv,
-			 int opcode, int percent)
+			 gint opcode, gint percent)
 {
 	JNIEnv *jnienv;
 	jclass feedback_class;
@@ -359,9 +359,9 @@ void dbjie_call_feedback(DB_ENV_JAVAINFO *dbjie, DB_ENV *dbenv, jobject jenv,
 }
 
 void dbjie_set_rep_transport_object(DB_ENV_JAVAINFO *dbjie, JNIEnv *jnienv,
-				    DB_ENV *dbenv, int id, jobject jtransport)
+				    DB_ENV *dbenv, gint id, jobject jtransport)
 {
-	int err;
+	gint err;
 
 	if (dbjie->rep_transport != NULL)
 		DELETE_GLOBAL_REF(jnienv, dbjie->rep_transport);
@@ -373,9 +373,9 @@ void dbjie_set_rep_transport_object(DB_ENV_JAVAINFO *dbjie, JNIEnv *jnienv,
 	dbjie->rep_transport = NEW_GLOBAL_REF(jnienv, jtransport);
 }
 
-int dbjie_call_rep_transport(DB_ENV_JAVAINFO *dbjie, DB_ENV *dbenv,
+gint dbjie_call_rep_transport(DB_ENV_JAVAINFO *dbjie, DB_ENV *dbenv,
 			     jobject jenv, const DBT *control,
-			     const DBT *rec, int flags, int envid)
+			     const DBT *rec, gint flags, gint envid)
 {
 	JNIEnv *jnienv;
 	jclass rep_transport_class;
@@ -416,7 +416,7 @@ int dbjie_call_rep_transport(DB_ENV_JAVAINFO *dbjie, DB_ENV *dbenv,
 void dbjie_set_app_dispatch_object(DB_ENV_JAVAINFO *dbjie, JNIEnv *jnienv,
 				 DB_ENV *dbenv, jobject japp_dispatch)
 {
-	int err;
+	gint err;
 
 	if (dbjie->app_dispatch != NULL) {
 		DELETE_GLOBAL_REF(jnienv, dbjie->app_dispatch);
@@ -436,8 +436,8 @@ void dbjie_set_app_dispatch_object(DB_ENV_JAVAINFO *dbjie, JNIEnv *jnienv,
 	dbjie->app_dispatch = NEW_GLOBAL_REF(jnienv, japp_dispatch);
 }
 
-int dbjie_call_app_dispatch(DB_ENV_JAVAINFO *dbjie, DB_ENV *dbenv, jobject jenv,
-			  DBT *dbt, DB_LSN *lsn, int recops)
+gint dbjie_call_app_dispatch(DB_ENV_JAVAINFO *dbjie, DB_ENV *dbenv, jobject jenv,
+			  DBT *dbt, DB_LSN *lsn, gint recops)
 {
 	JNIEnv *jnienv;
 	jclass app_dispatch_class;
@@ -498,7 +498,7 @@ jint dbjie_is_dbopen(DB_ENV_JAVAINFO *dbjie)
 DB_JAVAINFO *dbji_construct(JNIEnv *jnienv, jobject jdb, jint flags)
 {
 	DB_JAVAINFO *dbji;
-	int err;
+	gint err;
 
 	/*XXX should return err*/
 	if ((err = __os_malloc(NULL, sizeof(DB_JAVAINFO), &dbji)) != 0)
@@ -567,10 +567,10 @@ JNIEnv *dbji_get_jnienv(DB_JAVAINFO *dbji)
 	 * Different versions of the JNI disagree on the signature
 	 * for AttachCurrentThread.  The most recent documentation
 	 * seems to say that (JNIEnv **) is correct, but newer
-	 * JNIs seem to use (void **), oddly enough.
+	 * JNIs seem to use (gpointer *), oddly enough.
 	 */
 #ifdef JNI_VERSION_1_2
-	void *attachret = 0;
+	gpointer attachret = 0;
 #else
 	JNIEnv *attachret = 0;
 #endif
@@ -632,7 +632,7 @@ void dbji_set_feedback_object(DB_JAVAINFO *dbji, JNIEnv *jnienv,
 }
 
 void dbji_call_feedback(DB_JAVAINFO *dbji, DB *db, jobject jdb,
-			int opcode, int percent)
+			gint opcode, gint percent)
 {
 	JNIEnv *jnienv;
 
@@ -689,7 +689,7 @@ void dbji_set_append_recno_object(DB_JAVAINFO *dbji, JNIEnv *jnienv,
 	dbji->append_recno = NEW_GLOBAL_REF(jnienv, jcallback);
 }
 
-extern int dbji_call_append_recno(DB_JAVAINFO *dbji, DB *db, jobject jdb,
+extern gint dbji_call_append_recno(DB_JAVAINFO *dbji, DB *db, jobject jdb,
 				  DBT *dbt, jint recno)
 {
 	JNIEnv *jnienv;
@@ -698,7 +698,7 @@ extern int dbji_call_append_recno(DB_JAVAINFO *dbji, DB *db, jobject jdb,
 	LOCKED_DBT lresult;
 	DB_ENV *dbenv;
 	u_char *bytearray;
-	int err;
+	gint err;
 
 	jnienv = dbji_get_jnienv(dbji);
 	dbenv = db->dbenv;
@@ -761,10 +761,10 @@ extern int dbji_call_append_recno(DB_JAVAINFO *dbji, DB *db, jobject jdb,
 
 void dbji_set_assoc_object(DB_JAVAINFO *dbji, JNIEnv *jnienv,
 			       DB *db, DB_TXN *txn, DB *second,
-			       jobject jcallback, int flags)
+			       jobject jcallback, gint flags)
 {
 	jclass assoc_class;
-	int err;
+	gint err;
 
 	if (dbji->assoc_method_id == NULL) {
 		if ((assoc_class =
@@ -804,15 +804,15 @@ void dbji_set_assoc_object(DB_JAVAINFO *dbji, JNIEnv *jnienv,
 		dbji->assoc = NEW_GLOBAL_REF(jnienv, jcallback);
 }
 
-extern int dbji_call_assoc(DB_JAVAINFO *dbji, DB *db, jobject jdb,
+extern gint dbji_call_assoc(DB_JAVAINFO *dbji, DB *db, jobject jdb,
 			   const DBT *key, const DBT *value, DBT *result)
 {
 	JNIEnv *jnienv;
 	jobject jresult;
 	LOCKED_DBT lresult;
 	DB_ENV *dbenv;
-	int err;
-	int sz;
+	gint err;
+	gint sz;
 	u_char *bytearray;
 	jint retval;
 
@@ -917,7 +917,7 @@ void dbji_set_bt_compare_object(DB_JAVAINFO *dbji, JNIEnv *jnienv,
 	dbji->bt_compare = NEW_GLOBAL_REF(jnienv, jcompare);
 }
 
-int dbji_call_bt_compare(DB_JAVAINFO *dbji, DB *db, jobject jdb,
+gint dbji_call_bt_compare(DB_JAVAINFO *dbji, DB *db, jobject jdb,
 			 const DBT *dbt1, const DBT *dbt2)
 {
 	JNIEnv *jnienv;
@@ -1041,7 +1041,7 @@ void dbji_set_dup_compare_object(DB_JAVAINFO *dbji, JNIEnv *jnienv,
 	dbji->dup_compare = NEW_GLOBAL_REF(jnienv, jcompare);
 }
 
-int dbji_call_dup_compare(DB_JAVAINFO *dbji, DB *db, jobject jdb,
+gint dbji_call_dup_compare(DB_JAVAINFO *dbji, DB *db, jobject jdb,
 			 const DBT *dbt1, const DBT *dbt2)
 {
 	JNIEnv *jnienv;
@@ -1101,8 +1101,8 @@ void dbji_set_h_hash_object(DB_JAVAINFO *dbji, JNIEnv *jnienv,
 	dbji->h_hash = NEW_GLOBAL_REF(jnienv, jhash);
 }
 
-int dbji_call_h_hash(DB_JAVAINFO *dbji, DB *db, jobject jdb,
-		     const void *data, int len)
+gint dbji_call_h_hash(DB_JAVAINFO *dbji, DB *db, jobject jdb,
+		     gconstpointer data, gint len)
 {
 	JNIEnv *jnienv;
 	jbyteArray jdata;
@@ -1118,7 +1118,7 @@ int dbji_call_h_hash(DB_JAVAINFO *dbji, DB *db, jobject jdb,
 
 	if ((jdata = (*jnienv)->NewByteArray(jnienv, len)) == NULL)
 		return (0);	/* An exception has been posted by the JVM */
-	(*jnienv)->SetByteArrayRegion(jnienv, jdata, 0, len, (void *)data);
+	(*jnienv)->SetByteArrayRegion(jnienv, jdata, 0, len, (gpointer)data);
 	return (*jnienv)->CallIntMethod(jnienv, dbji->h_hash,
 					dbji->h_hash_method_id,
 					jdb, jdata, len);
diff --git a/libdb/libdb_java/java_info.h b/libdb/libdb_java/java_info.h
index a3356a7..08817aa 100644
--- a/libdb/libdb_java/java_info.h
+++ b/libdb/libdb_java/java_info.h
@@ -40,7 +40,7 @@ typedef struct _dbt_javainfo
 	jobject dbtref;		/* the java Dbt object */
 	jbyteArray array;	/* the java array object -
 				   this is only valid during the API call */
-	int offset;		/* offset into the Java array */
+	gint offset;		/* offset into the Java array */
 
 #define	DBT_JAVAINFO_LOCKED	0x01	/* a LOCKED_DBT has been created */
 	u_int32_t flags;
@@ -89,8 +89,8 @@ extern void dbjit_destroy(DBT_JAVAINFO *dbjit);
 typedef struct _db_env_javainfo
 {
 	JavaVM *javavm;
-	int is_dbopen;
-	char *errpfx;
+	gint is_dbopen;
+	gchar *errpfx;
 	jobject jenvref;	/* global reference */
 	jobject default_errcall; /* global reference */
 	jobject errcall;	/* global reference */
@@ -108,7 +108,7 @@ DB_ENV_JAVAINFO;	/* used with all 'dbjie' functions */
 extern DB_ENV_JAVAINFO *dbjie_construct(JNIEnv *jnienv,
 		       jobject jenv,
 		       jobject default_errcall,
-		       int is_dbopen);
+		       gint is_dbopen);
 
 /* release all objects held by this this one */
 extern void dbjie_dealloc(DB_ENV_JAVAINFO *, JNIEnv *jnienv);
@@ -128,21 +128,21 @@ extern void dbjie_set_conflict(DB_ENV_JAVAINFO *, u_char *v, size_t sz);
 extern void dbjie_set_feedback_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
 				      DB_ENV *dbenv, jobject value);
 extern void dbjie_call_feedback(DB_ENV_JAVAINFO *, DB_ENV *dbenv, jobject jenv,
-				int opcode, int percent);
+				gint opcode, gint percent);
 extern void dbjie_set_recovery_init_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
 					   DB_ENV *dbenv, jobject value);
-extern int dbjie_call_recovery_init(DB_ENV_JAVAINFO *, DB_ENV *dbenv,
+extern gint dbjie_call_recovery_init(DB_ENV_JAVAINFO *, DB_ENV *dbenv,
 				    jobject jenv);
 extern void dbjie_set_rep_transport_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
-					   DB_ENV *dbenv, int id, jobject obj);
-extern int dbjie_call_rep_transport(DB_ENV_JAVAINFO *, DB_ENV *dbenv,
+					   DB_ENV *dbenv, gint id, jobject obj);
+extern gint dbjie_call_rep_transport(DB_ENV_JAVAINFO *, DB_ENV *dbenv,
 				    jobject jenv, const DBT *control,
-				    const DBT *rec, int envid, int flags);
+				    const DBT *rec, gint envid, gint flags);
 extern void dbjie_set_app_dispatch_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
 					DB_ENV *dbenv, jobject value);
-extern int dbjie_call_app_dispatch(DB_ENV_JAVAINFO *,
+extern gint dbjie_call_app_dispatch(DB_ENV_JAVAINFO *,
 				 DB_ENV *dbenv, jobject jenv,
-				 DBT *dbt, DB_LSN *lsn, int recops);
+				 DBT *dbt, DB_LSN *lsn, gint recops);
 extern jobject dbjie_get_errcall(DB_ENV_JAVAINFO *) ;
 extern jint dbjie_is_dbopen(DB_ENV_JAVAINFO *);
 
@@ -195,27 +195,27 @@ extern jint dbji_get_flags();
 
 extern void dbji_set_feedback_object(DB_JAVAINFO *, JNIEnv *jnienv, DB *db, jobject value);
 extern void dbji_call_feedback(DB_JAVAINFO *, DB *db, jobject jdb,
-			       int opcode, int percent);
+			       gint opcode, gint percent);
 
 extern void dbji_set_append_recno_object(DB_JAVAINFO *, JNIEnv *jnienv, DB *db, jobject value);
-extern int dbji_call_append_recno(DB_JAVAINFO *, DB *db, jobject jdb,
+extern gint dbji_call_append_recno(DB_JAVAINFO *, DB *db, jobject jdb,
 				  DBT *dbt, jint recno);
 extern void dbji_set_assoc_object(DB_JAVAINFO *, JNIEnv *jnienv,
 				  DB *db, DB_TXN *txn, DB *second,
-				  jobject value, int flags);
-extern int dbji_call_assoc(DB_JAVAINFO *, DB *db, jobject jdb,
+				  jobject value, gint flags);
+extern gint dbji_call_assoc(DB_JAVAINFO *, DB *db, jobject jdb,
 			   const DBT *key, const DBT* data, DBT *result);
 extern void dbji_set_bt_compare_object(DB_JAVAINFO *, JNIEnv *jnienv, DB *db, jobject value);
-extern int dbji_call_bt_compare(DB_JAVAINFO *, DB *db, jobject jdb,
+extern gint dbji_call_bt_compare(DB_JAVAINFO *, DB *db, jobject jdb,
 				const DBT *dbt1, const DBT *dbt2);
 extern void dbji_set_bt_prefix_object(DB_JAVAINFO *, JNIEnv *jnienv, DB *db, jobject value);
 extern size_t dbji_call_bt_prefix(DB_JAVAINFO *, DB *db, jobject jdb,
 				  const DBT *dbt1, const DBT *dbt2);
 extern void dbji_set_dup_compare_object(DB_JAVAINFO *, JNIEnv *jnienv, DB *db, jobject value);
-extern int dbji_call_dup_compare(DB_JAVAINFO *, DB *db, jobject jdb,
+extern gint dbji_call_dup_compare(DB_JAVAINFO *, DB *db, jobject jdb,
 				 const DBT *dbt1, const DBT *dbt2);
 extern void dbji_set_h_hash_object(DB_JAVAINFO *, JNIEnv *jnienv, DB *db, jobject value);
-extern int dbji_call_h_hash(DB_JAVAINFO *, DB *db, jobject jdb,
-			    const void *data, int len);
+extern gint dbji_call_h_hash(DB_JAVAINFO *, DB *db, jobject jdb,
+			    gconstpointer data, gint len);
 
 #endif /* !_JAVA_INFO_H_ */
diff --git a/libdb/libdb_java/java_locked.c b/libdb/libdb_java/java_locked.c
index 7805f06..41a354f 100644
--- a/libdb/libdb_java/java_locked.c
+++ b/libdb/libdb_java/java_locked.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -22,7 +22,7 @@ static const char revid[] = "$Id$";
  *
  * Implementation of functions to manipulate LOCKED_DBT.
  */
-int
+gint
 locked_dbt_get(LOCKED_DBT *ldbt, JNIEnv *jnienv, DB_ENV *dbenv,
 	       jobject jdbt, OpKind kind)
 {
@@ -261,7 +261,7 @@ locked_dbt_put(LOCKED_DBT *ldbt, JNIEnv *jnienv, DB_ENV *dbenv)
  * Return 1 if these conditions are met, otherwise 0.  This is used
  * internally to simulate the operations needed for DB_DBT_REALLOC.
  */
-int locked_dbt_realloc(LOCKED_DBT *ldbt, JNIEnv *jnienv, DB_ENV *dbenv)
+gint locked_dbt_realloc(LOCKED_DBT *ldbt, JNIEnv *jnienv, DB_ENV *dbenv)
 {
 	DBT *dbt;
 
@@ -301,7 +301,7 @@ int locked_dbt_realloc(LOCKED_DBT *ldbt, JNIEnv *jnienv, DB_ENV *dbenv)
  *
  * Implementation of functions to manipulate LOCKED_STRING.
  */
-int
+gint
 locked_string_get(LOCKED_STRING *ls, JNIEnv *jnienv, jstring jstr)
 {
 	ls->jstr = jstr;
diff --git a/libdb/libdb_java/java_locked.h b/libdb/libdb_java/java_locked.h
index 60419ff..5e6710b 100644
--- a/libdb/libdb_java/java_locked.h
+++ b/libdb/libdb_java/java_locked.h
@@ -34,7 +34,7 @@ typedef struct _locked_dbt
 {
 	/* these are accessed externally to locked_dbt_ functions */
 	DBT_JAVAINFO *javainfo;
-	unsigned int java_array_len;
+	guint java_array_len;
 	jobject jdbt;
 
 	/* these are for used internally by locked_dbt_ functions */
@@ -49,19 +49,19 @@ typedef struct _locked_dbt
 } LOCKED_DBT;
 
 /* Fill the LOCKED_DBT struct and lock the Java byte array */
-extern int locked_dbt_get(LOCKED_DBT *, JNIEnv *, DB_ENV *, jobject, OpKind);
+extern gint locked_dbt_get(LOCKED_DBT *, JNIEnv *, DB_ENV *, jobject, OpKind);
 
 /* unlock the Java byte array */
 extern void locked_dbt_put(LOCKED_DBT *, JNIEnv *, DB_ENV *);
 
 /* realloc the Java byte array */
-extern int locked_dbt_realloc(LOCKED_DBT *, JNIEnv *, DB_ENV *);
+extern gint locked_dbt_realloc(LOCKED_DBT *, JNIEnv *, DB_ENV *);
 
 /*
  * LOCKED_STRING
  *
  * A LOCKED_STRING exists temporarily to convert a java jstring object
- * to a char *.  Because the memory for the char * string is
+ * to a gchar *.  Because the memory for the gchar * string is
  * managed by the JVM, it must be released when we are done
  * looking at it.  Typically, locked_string_get() is called at the
  * beginning of a function for each jstring object, and locked_string_put
@@ -70,13 +70,13 @@ extern int locked_dbt_realloc(LOCKED_DBT *, JNIEnv *, DB_ENV *);
 typedef struct _locked_string
 {
 	/* this accessed externally to locked_string_ functions */
-	const char *string;
+	const gchar *string;
 
 	/* this is used internally by locked_string_ functions */
 	jstring jstr;
 } LOCKED_STRING;
 
-extern int locked_string_get(LOCKED_STRING *, JNIEnv *jnienv, jstring jstr);
+extern gint locked_string_get(LOCKED_STRING *, JNIEnv *jnienv, jstring jstr);
 extern void locked_string_put(LOCKED_STRING *, JNIEnv *jnienv);  /* this unlocks and frees mem */
 
 #endif /* !_JAVA_LOCKED_H_ */
diff --git a/libdb/libdb_java/java_stat_auto.c b/libdb/libdb_java/java_stat_auto.c
index c141223..8840b67 100644
--- a/libdb/libdb_java/java_stat_auto.c
+++ b/libdb/libdb_java/java_stat_auto.c
@@ -1,6 +1,6 @@
 /* DO NOT EDIT: automatically built by dist/s_java. */
 #include "java_util.h"
-int __jv_fill_bt_stat(JNIEnv *jnienv, jclass cl,
+gint __jv_fill_bt_stat(JNIEnv *jnienv, jclass cl,
     jobject jobj, struct __db_bt_stat *statp) {
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, bt_magic);
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, bt_version);
@@ -24,7 +24,7 @@ int __jv_fill_bt_stat(JNIEnv *jnienv, jclass cl,
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, bt_over_pgfree);
 	return (0);
 }
-int __jv_fill_h_stat(JNIEnv *jnienv, jclass cl,
+gint __jv_fill_h_stat(JNIEnv *jnienv, jclass cl,
     jobject jobj, struct __db_h_stat *statp) {
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, hash_magic);
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, hash_version);
@@ -44,7 +44,7 @@ int __jv_fill_h_stat(JNIEnv *jnienv, jclass cl,
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, hash_dup_free);
 	return (0);
 }
-int __jv_fill_lock_stat(JNIEnv *jnienv, jclass cl,
+gint __jv_fill_lock_stat(JNIEnv *jnienv, jclass cl,
     jobject jobj, struct __db_lock_stat *statp) {
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_id);
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_cur_maxid);
@@ -72,7 +72,7 @@ int __jv_fill_lock_stat(JNIEnv *jnienv, jclass cl,
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_regsize);
 	return (0);
 }
-int __jv_fill_log_stat(JNIEnv *jnienv, jclass cl,
+gint __jv_fill_log_stat(JNIEnv *jnienv, jclass cl,
     jobject jobj, struct __db_log_stat *statp) {
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_magic);
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_version);
@@ -97,7 +97,7 @@ int __jv_fill_log_stat(JNIEnv *jnienv, jclass cl,
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_mincommitperflush);
 	return (0);
 }
-int __jv_fill_mpool_stat(JNIEnv *jnienv, jclass cl,
+gint __jv_fill_mpool_stat(JNIEnv *jnienv, jclass cl,
     jobject jobj, struct __db_mpool_stat *statp) {
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_gbytes);
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_bytes);
@@ -131,7 +131,7 @@ int __jv_fill_mpool_stat(JNIEnv *jnienv, jclass cl,
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_alloc_max_pages);
 	return (0);
 }
-int __jv_fill_qam_stat(JNIEnv *jnienv, jclass cl,
+gint __jv_fill_qam_stat(JNIEnv *jnienv, jclass cl,
     jobject jobj, struct __db_qam_stat *statp) {
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, qs_magic);
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, qs_version);
@@ -148,7 +148,7 @@ int __jv_fill_qam_stat(JNIEnv *jnienv, jclass cl,
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, qs_cur_recno);
 	return (0);
 }
-int __jv_fill_rep_stat(JNIEnv *jnienv, jclass cl,
+gint __jv_fill_rep_stat(JNIEnv *jnienv, jclass cl,
     jobject jobj, struct __db_rep_stat *statp) {
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_status);
 	JAVADB_STAT_LSN(jnienv, cl, jobj, statp, st_next_lsn);
@@ -187,7 +187,7 @@ int __jv_fill_rep_stat(JNIEnv *jnienv, jclass cl,
 	JAVADB_STAT_INT(jnienv, cl, jobj, statp, st_election_votes);
 	return (0);
 }
-int __jv_fill_txn_stat(JNIEnv *jnienv, jclass cl,
+gint __jv_fill_txn_stat(JNIEnv *jnienv, jclass cl,
     jobject jobj, struct __db_txn_stat *statp) {
 	JAVADB_STAT_LSN(jnienv, cl, jobj, statp, st_last_ckp);
 	JAVADB_STAT_LONG(jnienv, cl, jobj, statp, st_time_ckp);
diff --git a/libdb/libdb_java/java_stat_auto.h b/libdb/libdb_java/java_stat_auto.h
index 20eecf1..e4512a5 100644
--- a/libdb/libdb_java/java_stat_auto.h
+++ b/libdb/libdb_java/java_stat_auto.h
@@ -1,9 +1,9 @@
 /* DO NOT EDIT: automatically built by dist/s_java. */
-extern int __jv_fill_bt_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_bt_stat *statp);
-extern int __jv_fill_h_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_h_stat *statp);
-extern int __jv_fill_lock_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_lock_stat *statp);
-extern int __jv_fill_log_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_log_stat *statp);
-extern int __jv_fill_mpool_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_mpool_stat *statp);
-extern int __jv_fill_qam_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_qam_stat *statp);
-extern int __jv_fill_rep_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_rep_stat *statp);
-extern int __jv_fill_txn_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_txn_stat *statp);
+extern gint __jv_fill_bt_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_bt_stat *statp);
+extern gint __jv_fill_h_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_h_stat *statp);
+extern gint __jv_fill_lock_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_lock_stat *statp);
+extern gint __jv_fill_log_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_log_stat *statp);
+extern gint __jv_fill_mpool_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_mpool_stat *statp);
+extern gint __jv_fill_qam_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_qam_stat *statp);
+extern gint __jv_fill_rep_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_rep_stat *statp);
+extern gint __jv_fill_txn_stat(JNIEnv *jnienv, jclass cl, jobject jobj, struct __db_txn_stat *statp);
diff --git a/libdb/libdb_java/java_util.c b/libdb/libdb_java/java_util.c
index 0e83c64..c26edc9 100644
--- a/libdb/libdb_java/java_util.c
+++ b/libdb/libdb_java/java_util.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <jni.h>
@@ -21,48 +21,48 @@ static const char revid[] = "$Id$";
 #define	sys_nerr _sys_nerr
 #endif
 
-const char * const name_DB                 = "Db";
-const char * const name_DB_BTREE_STAT      = "DbBtreeStat";
-const char * const name_DBC                = "Dbc";
-const char * const name_DB_DEADLOCK_EX     = "DbDeadlockException";
-const char * const name_DB_ENV             = "DbEnv";
-const char * const name_DB_EXCEPTION       = "DbException";
-const char * const name_DB_HASH_STAT       = "DbHashStat";
-const char * const name_DB_LOCK            = "DbLock";
-const char * const name_DB_LOCK_STAT       = "DbLockStat";
-const char * const name_DB_LOCKNOTGRANTED_EX = "DbLockNotGrantedException";
-const char * const name_DB_LOGC            = "DbLogc";
-const char * const name_DB_LOG_STAT        = "DbLogStat";
-const char * const name_DB_LSN             = "DbLsn";
-const char * const name_DB_MEMORY_EX       = "DbMemoryException";
-const char * const name_DB_MPOOL_FSTAT     = "DbMpoolFStat";
-const char * const name_DB_MPOOL_STAT      = "DbMpoolStat";
-const char * const name_DB_PREPLIST        = "DbPreplist";
-const char * const name_DB_QUEUE_STAT      = "DbQueueStat";
-const char * const name_DB_REP_STAT        = "DbRepStat";
-const char * const name_DB_RUNRECOVERY_EX  = "DbRunRecoveryException";
-const char * const name_DBT                = "Dbt";
-const char * const name_DB_TXN             = "DbTxn";
-const char * const name_DB_TXN_STAT        = "DbTxnStat";
-const char * const name_DB_TXN_STAT_ACTIVE = "DbTxnStat$Active";
-const char * const name_DB_UTIL            = "DbUtil";
-const char * const name_DbAppendRecno      = "DbAppendRecno";
-const char * const name_DbBtreeCompare     = "DbBtreeCompare";
-const char * const name_DbBtreePrefix      = "DbBtreePrefix";
-const char * const name_DbDupCompare       = "DbDupCompare";
-const char * const name_DbEnvFeedback      = "DbEnvFeedback";
-const char * const name_DbErrcall          = "DbErrcall";
-const char * const name_DbHash             = "DbHash";
-const char * const name_DbLockRequest      = "DbLockRequest";
-const char * const name_DbFeedback         = "DbFeedback";
-const char * const name_DbRecoveryInit     = "DbRecoveryInit";
-const char * const name_DbRepTransport	   = "DbRepTransport";
-const char * const name_DbSecondaryKeyCreate = "DbSecondaryKeyCreate";
-const char * const name_DbTxnRecover       = "DbTxnRecover";
-const char * const name_RepElectResult = "DbEnv$RepElectResult";
-const char * const name_RepProcessMessage = "DbEnv$RepProcessMessage";
-
-const char * const string_signature    = "Ljava/lang/String;";
+const gchar * const name_DB                 = "Db";
+const gchar * const name_DB_BTREE_STAT      = "DbBtreeStat";
+const gchar * const name_DBC                = "Dbc";
+const gchar * const name_DB_DEADLOCK_EX     = "DbDeadlockException";
+const gchar * const name_DB_ENV             = "DbEnv";
+const gchar * const name_DB_EXCEPTION       = "DbException";
+const gchar * const name_DB_HASH_STAT       = "DbHashStat";
+const gchar * const name_DB_LOCK            = "DbLock";
+const gchar * const name_DB_LOCK_STAT       = "DbLockStat";
+const gchar * const name_DB_LOCKNOTGRANTED_EX = "DbLockNotGrantedException";
+const gchar * const name_DB_LOGC            = "DbLogc";
+const gchar * const name_DB_LOG_STAT        = "DbLogStat";
+const gchar * const name_DB_LSN             = "DbLsn";
+const gchar * const name_DB_MEMORY_EX       = "DbMemoryException";
+const gchar * const name_DB_MPOOL_FSTAT     = "DbMpoolFStat";
+const gchar * const name_DB_MPOOL_STAT      = "DbMpoolStat";
+const gchar * const name_DB_PREPLIST        = "DbPreplist";
+const gchar * const name_DB_QUEUE_STAT      = "DbQueueStat";
+const gchar * const name_DB_REP_STAT        = "DbRepStat";
+const gchar * const name_DB_RUNRECOVERY_EX  = "DbRunRecoveryException";
+const gchar * const name_DBT                = "Dbt";
+const gchar * const name_DB_TXN             = "DbTxn";
+const gchar * const name_DB_TXN_STAT        = "DbTxnStat";
+const gchar * const name_DB_TXN_STAT_ACTIVE = "DbTxnStat$Active";
+const gchar * const name_DB_UTIL            = "DbUtil";
+const gchar * const name_DbAppendRecno      = "DbAppendRecno";
+const gchar * const name_DbBtreeCompare     = "DbBtreeCompare";
+const gchar * const name_DbBtreePrefix      = "DbBtreePrefix";
+const gchar * const name_DbDupCompare       = "DbDupCompare";
+const gchar * const name_DbEnvFeedback      = "DbEnvFeedback";
+const gchar * const name_DbErrcall          = "DbErrcall";
+const gchar * const name_DbHash             = "DbHash";
+const gchar * const name_DbLockRequest      = "DbLockRequest";
+const gchar * const name_DbFeedback         = "DbFeedback";
+const gchar * const name_DbRecoveryInit     = "DbRecoveryInit";
+const gchar * const name_DbRepTransport	   = "DbRepTransport";
+const gchar * const name_DbSecondaryKeyCreate = "DbSecondaryKeyCreate";
+const gchar * const name_DbTxnRecover       = "DbTxnRecover";
+const gchar * const name_RepElectResult = "DbEnv$RepElectResult";
+const gchar * const name_RepProcessMessage = "DbEnv$RepProcessMessage";
+
+const gchar * const string_signature    = "Ljava/lang/String;";
 
 jfieldID fid_Dbt_data;
 jfieldID fid_Dbt_offset;
@@ -129,7 +129,7 @@ void one_time_init(JNIEnv *jnienv)
  * The private data is stored in the object as a Java long (64 bits),
  * which is long enough to store a pointer on current architectures.
  */
-void *get_private_dbobj(JNIEnv *jnienv, const char *classname,
+gpointer get_private_dbobj(JNIEnv *jnienv, const gchar *classname,
 			jobject obj)
 {
 	jclass dbClass;
@@ -151,8 +151,8 @@ void *get_private_dbobj(JNIEnv *jnienv, const char *classname,
  * The private data is stored in the object as a Java long (64 bits),
  * which is long enough to store a pointer on current architectures.
  */
-void set_private_dbobj(JNIEnv *jnienv, const char *classname,
-		       jobject obj, void *value)
+void set_private_dbobj(JNIEnv *jnienv, const gchar *classname,
+		       jobject obj, gpointer value)
 {
 	long_to_ptr lp;
 	jclass dbClass;
@@ -171,7 +171,7 @@ void set_private_dbobj(JNIEnv *jnienv, const char *classname,
  * The private data is stored in the object as a Java long (64 bits),
  * which is long enough to store a pointer on current architectures.
  */
-void *get_private_info(JNIEnv *jnienv, const char *classname,
+gpointer get_private_info(JNIEnv *jnienv, const gchar *classname,
 		       jobject obj)
 {
 	jclass dbClass;
@@ -193,8 +193,8 @@ void *get_private_info(JNIEnv *jnienv, const char *classname,
  * The private data is stored in the object as a Java long (64 bits),
  * which is long enough to store a pointer on current architectures.
  */
-void set_private_info(JNIEnv *jnienv, const char *classname,
-		      jobject obj, void *value)
+void set_private_info(JNIEnv *jnienv, const gchar *classname,
+		      jobject obj, gpointer value)
 {
 	long_to_ptr lp;
 	jclass dbClass;
@@ -212,7 +212,7 @@ void set_private_info(JNIEnv *jnienv, const char *classname,
  * Given a non-qualified name (e.g. "foo"), get the class handle
  * for the fully qualified name (e.g. "com.sleepycat.db.foo")
  */
-jclass get_class(JNIEnv *jnienv, const char *classname)
+jclass get_class(JNIEnv *jnienv, const gchar *classname)
 {
 	/*
 	 * Note: PERFORMANCE: It should be possible to cache jclass's.
@@ -222,7 +222,7 @@ jclass get_class(JNIEnv *jnienv, const char *classname)
 	 * technically right, but it would likely work with
 	 * most implementations.  Possibly make it configurable.
 	 */
-	char fullname[128];
+	gchar fullname[128];
 
 	(void)snprintf(fullname, sizeof(fullname),
 	    "%s%s", DB_PACKAGE_NAME, classname);
@@ -236,14 +236,14 @@ jclass get_class(JNIEnv *jnienv, const char *classname)
  * This is appropriate to be used for classes that may
  * not be present.
  */
-jclass get_fully_qualified_class(JNIEnv *jnienv, const char *classname)
+jclass get_fully_qualified_class(JNIEnv *jnienv, const gchar *classname)
 {
 	jclass result;
 
 	result = ((*jnienv)->FindClass(jnienv, classname));
 	if (result == NULL) {
 		jclass cnfe;
-		char message[1024];
+		gchar message[1024];
 
 		cnfe = (*jnienv)->FindClass(jnienv,
 				    "java/lang/ClassNotFoundException");
@@ -259,10 +259,10 @@ jclass get_fully_qualified_class(JNIEnv *jnienv, const char *classname)
  * The field must be a DB object type.
  */
 void set_object_field(JNIEnv *jnienv, jclass class_of_this,
-		      jobject jthis, const char *object_classname,
-		      const char *name_of_field, jobject obj)
+		      jobject jthis, const gchar *object_classname,
+		      const gchar *name_of_field, jobject obj)
 {
-	char signature[512];
+	gchar signature[512];
 	jfieldID id;
 
 	(void)snprintf(signature, sizeof(signature),
@@ -277,7 +277,7 @@ void set_object_field(JNIEnv *jnienv, jclass class_of_this,
  * The field must be an integer type.
  */
 void set_int_field(JNIEnv *jnienv, jclass class_of_this,
-		   jobject jthis, const char *name_of_field, jint value)
+		   jobject jthis, const gchar *name_of_field, jint value)
 {
 	jfieldID id  =
 	    (*jnienv)->GetFieldID(jnienv, class_of_this, name_of_field, "I");
@@ -289,7 +289,7 @@ void set_int_field(JNIEnv *jnienv, jclass class_of_this,
  * The field must be an integer type.
  */
 void set_long_field(JNIEnv *jnienv, jclass class_of_this,
-		    jobject jthis, const char *name_of_field, jlong value)
+		    jobject jthis, const gchar *name_of_field, jlong value)
 {
 	jfieldID id  = (*jnienv)->GetFieldID(jnienv, class_of_this,
 					     name_of_field, "J");
@@ -301,7 +301,7 @@ void set_long_field(JNIEnv *jnienv, jclass class_of_this,
  * The field must be an integer type.
  */
 void set_lsn_field(JNIEnv *jnienv, jclass class_of_this,
-		   jobject jthis, const char *name_of_field, DB_LSN value)
+		   jobject jthis, const gchar *name_of_field, DB_LSN value)
 {
 	set_object_field(jnienv, class_of_this, jthis, name_DB_LSN,
 			 name_of_field, get_DbLsn(jnienv, value));
@@ -310,8 +310,8 @@ void set_lsn_field(JNIEnv *jnienv, jclass class_of_this,
 /*
  * Report an exception back to the java side.
  */
-void report_exception(JNIEnv *jnienv, const char *text,
-		      int err, unsigned long expect_mask)
+void report_exception(JNIEnv *jnienv, const gchar *text,
+		      gint err, unsigned long expect_mask)
 {
 	jstring textString;
 	jclass dbexcept;
@@ -351,7 +351,7 @@ void report_exception(JNIEnv *jnienv, const char *text,
 				    "java/io/FileNotFoundException");
 			}
 			else {
-				char errstr[1024];
+				gchar errstr[1024];
 
 				snprintf(errstr, sizeof(errstr),
 				  "internal error: unexpected errno: %s",
@@ -393,9 +393,9 @@ void report_exception(JNIEnv *jnienv, const char *text,
  * case of DB_LOCK_NOTGRANTED, as more things are added to the
  * constructor of this type of exception.
  */
-void report_notgranted_exception(JNIEnv *jnienv, const char *text,
+void report_notgranted_exception(JNIEnv *jnienv, const gchar *text,
 				 db_lockop_t op, db_lockmode_t mode,
-				 jobject jdbt, jobject jlock, int index)
+				 jobject jdbt, jobject jlock, gint index)
 {
 	jstring textString;
 	jclass dbexcept;
@@ -421,11 +421,11 @@ void report_notgranted_exception(JNIEnv *jnienv, const char *text,
 /*
  * Create an exception object and return it.
  * The given class must have a constructor that has a
- * constructor with args (java.lang.String text, int errno);
+ * constructor with args (java.lang.String text, gint errno);
  * DbException and its subclasses fit this bill.
  */
 jobject create_exception(JNIEnv *jnienv, jstring text,
-				  int err, jclass dbexcept)
+				  gint err, jclass dbexcept)
 {
 	jthrowable obj;
 	jmethodID mid;
@@ -447,7 +447,7 @@ jobject create_exception(JNIEnv *jnienv, jstring text,
  * Report an error via the errcall mechanism.
  */
 void report_errcall(JNIEnv *jnienv, jobject errcall,
-		    jstring prefix, const char *message)
+		    jstring prefix, const gchar *message)
 {
 	jmethodID id;
 	jclass errcall_class;
@@ -473,7 +473,7 @@ void report_errcall(JNIEnv *jnienv, jobject errcall,
  * If the object is null, report an exception and return false (0),
  * otherwise return true (1).
  */
-int verify_non_null(JNIEnv *jnienv, void *obj)
+gint verify_non_null(JNIEnv *jnienv, gpointer obj)
 {
 	if (obj == NULL) {
 		report_exception(jnienv, "null object", EINVAL, 0);
@@ -486,7 +486,7 @@ int verify_non_null(JNIEnv *jnienv, void *obj)
  * If the error code is non-zero, report an exception and return false (0),
  * otherwise return true (1).
  */
-int verify_return(JNIEnv *jnienv, int err, unsigned long expect_mask)
+gint verify_return(JNIEnv *jnienv, gint err, unsigned long expect_mask)
 {
 	if (err == 0)
 		return (1);
@@ -500,7 +500,7 @@ int verify_return(JNIEnv *jnienv, int err, unsigned long expect_mask)
  * If there is report a DbMemoryException, with the Dbt attached
  * and return false (0), otherwise return true (1).
  */
-int verify_dbt(JNIEnv *jnienv, int err, LOCKED_DBT *ldbt)
+gint verify_dbt(JNIEnv *jnienv, gint err, LOCKED_DBT *ldbt)
 {
 	DBT *dbt;
 	jobject exception;
@@ -533,7 +533,7 @@ int verify_dbt(JNIEnv *jnienv, int err, LOCKED_DBT *ldbt)
 /*
  * Create an object of the given class, calling its default constructor.
  */
-jobject create_default_object(JNIEnv *jnienv, const char *class_name)
+jobject create_default_object(JNIEnv *jnienv, const gchar *class_name)
 {
 	jmethodID id;
 	jclass dbclass;
@@ -549,7 +549,7 @@ jobject create_default_object(JNIEnv *jnienv, const char *class_name)
  * Note: This implementation creates a new Java object on each call,
  * so it is generally useful when a new DB object has just been created.
  */
-jobject convert_object(JNIEnv *jnienv, const char *class_name, void *dbobj)
+jobject convert_object(JNIEnv *jnienv, const gchar *class_name, gpointer dbobj)
 {
 	jobject jo;
 
@@ -564,11 +564,11 @@ jobject convert_object(JNIEnv *jnienv, const char *class_name, void *dbobj)
 /*
  * Create a copy of the string
  */
-char *dup_string(const char *str)
+gchar *dup_string(const gchar *str)
 {
-	int len;
-	char *retval;
-	int err;
+	gint len;
+	gchar *retval;
+	gint err;
 
 	len = strlen(str) + 1;
 	if ((err = __os_malloc(NULL, sizeof(char)*len, &retval)) != 0)
@@ -580,7 +580,7 @@ char *dup_string(const char *str)
 /*
  * Create a java string from the given string
  */
-jstring get_java_string(JNIEnv *jnienv, const char* string)
+jstring get_java_string(JNIEnv *jnienv, const gchar * string)
 {
 	if (string == 0)
 		return (0);
@@ -591,10 +591,10 @@ jstring get_java_string(JNIEnv *jnienv, const char* string)
  * Create a copy of the java string using __os_malloc.
  * Caller must free it.
  */
-char *get_c_string(JNIEnv *jnienv, jstring jstr)
+gchar *get_c_string(JNIEnv *jnienv, jstring jstr)
 {
-	const char *utf;
-	char *retval;
+	const gchar *utf;
+	gchar *retval;
 
 	utf = (*jnienv)->GetStringUTFChars(jnienv, jstr, NULL);
 	retval = dup_string(utf);
@@ -680,7 +680,7 @@ DB_LSN *get_DB_LSN(JNIEnv *jnienv, /* DbLsn */ jobject obj) {
 	 * DB_LSN is legitimate.
 	 */
 	DB_LSN *lsnp;
-	int err;
+	gint err;
 
 	if (obj == NULL)
 		return (NULL);
@@ -778,7 +778,7 @@ jobject get_DbLogStat(JNIEnv *jnienv, DB_LOG_STAT *dbobj)
 jobject get_DbLsn(JNIEnv *jnienv, DB_LSN dbobj)
 {
 	DB_LSN *lsnp;
-	int err;
+	gint err;
 
 	if ((err = __os_malloc(NULL, sizeof(DB_LSN), &lsnp)) != 0)
 		return (NULL);
@@ -804,7 +804,7 @@ jobject get_DbLsn(JNIEnv *jnienv, DB_LSN dbobj)
  * arbitrary number.  We might also have sharing of the byte arrays
  * used by the Dbts.
  */
-static jobject get_Dbt_shared(JNIEnv *jnienv, const DBT *dbt, int readonly,
+static jobject get_Dbt_shared(JNIEnv *jnienv, const DBT *dbt, gint readonly,
 			      DBT_JAVAINFO **ret_info)
 {
 	jobject jdbt;
diff --git a/libdb/libdb_java/java_util.h b/libdb/libdb_java/java_util.h
index 9051a94..1008cc6 100644
--- a/libdb/libdb_java/java_util.h
+++ b/libdb/libdb_java/java_util.h
@@ -47,7 +47,7 @@
 /* Union to convert longs to pointers (see {get,set}_private_dbobj). */
 typedef union {
     jlong java_long;
-    void *ptr;
+    gpointer ptr;
 } long_to_ptr;
 
 /****************************************************************
@@ -70,19 +70,19 @@ typedef union {
  */
 #ifdef DBJAVA_DEBUG
 #include <unistd.h>
-static void wrdebug(const char *str)
+static void wrdebug(const gchar *str)
 {
 	write(2, str, strlen(str));
 	write(2, "\n", 1);
 }
 
-static jobject debug_new_global_ref(JNIEnv *jnienv, jobject obj, const char *s)
+static jobject debug_new_global_ref(JNIEnv *jnienv, jobject obj, const gchar *s)
 {
 	wrdebug(s);
 	return ((*jnienv)->NewGlobalRef(jnienv, obj));
 }
 
-static void debug_delete_global_ref(JNIEnv *jnienv, jobject obj, const char *s)
+static void debug_delete_global_ref(JNIEnv *jnienv, jobject obj, const gchar *s)
 {
 	wrdebug(s);
 	(*jnienv)->DeleteGlobalRef(jnienv, obj);
@@ -116,7 +116,7 @@ JNIEnv *get_jnienv(JavaVM *jvm);
  * The private data is stored in the object as a Java long (64 bits),
  * which is long enough to store a pointer on current architectures.
  */
-void *get_private_dbobj(JNIEnv *jnienv, const char *classname,
+gpointer get_private_dbobj(JNIEnv *jnienv, const gchar *classname,
 		       jobject obj);
 
 /*
@@ -124,15 +124,15 @@ void *get_private_dbobj(JNIEnv *jnienv, const char *classname,
  * The private data is stored in the object as a Java long (64 bits),
  * which is long enough to store a pointer on current architectures.
  */
-void set_private_dbobj(JNIEnv *jnienv, const char *classname,
-		      jobject obj, void *value);
+void set_private_dbobj(JNIEnv *jnienv, const gchar *classname,
+		      jobject obj, gpointer value);
 
 /*
  * Get the private data in a Db/DbEnv object that holds additional 'side data'.
  * The private data is stored in the object as a Java long (64 bits),
  * which is long enough to store a pointer on current architectures.
  */
-void *get_private_info(JNIEnv *jnienv, const char *classname,
+gpointer get_private_info(JNIEnv *jnienv, const gchar *classname,
 		       jobject obj);
 
 /*
@@ -140,43 +140,43 @@ void *get_private_info(JNIEnv *jnienv, const char *classname,
  * The private data is stored in the object as a Java long (64 bits),
  * which is long enough to store a pointer on current architectures.
  */
-void set_private_info(JNIEnv *jnienv, const char *classname,
-		      jobject obj, void *value);
+void set_private_info(JNIEnv *jnienv, const gchar *classname,
+		      jobject obj, gpointer value);
 
 /*
  * Given a non-qualified name (e.g. "foo"), get the class handle
  * for the fully qualified name (e.g. "com.sleepycat.db.foo")
  */
-jclass get_class(JNIEnv *jnienv, const char *classname);
+jclass get_class(JNIEnv *jnienv, const gchar *classname);
 
 /*
  * Set an individual field in a Db* object.
  * The field must be a DB object type.
  */
 void set_object_field(JNIEnv *jnienv, jclass class_of_this,
-		      jobject jthis, const char *object_classname,
-		      const char *name_of_field, jobject obj);
+		      jobject jthis, const gchar *object_classname,
+		      const gchar *name_of_field, jobject obj);
 
 /*
  * Set an individual field in a Db* object.
  * The field must be an integer type.
  */
 void set_int_field(JNIEnv *jnienv, jclass class_of_this,
-		   jobject jthis, const char *name_of_field, jint value);
+		   jobject jthis, const gchar *name_of_field, jint value);
 
 /*
  * Set an individual field in a Db* object.
  * The field must be an integer type.
  */
 void set_long_field(JNIEnv *jnienv, jclass class_of_this,
-			jobject jthis, const char *name_of_field, jlong value);
+			jobject jthis, const gchar *name_of_field, jlong value);
 
 /*
  * Set an individual field in a Db* object.
  * The field must be an DbLsn type.
  */
 void set_lsn_field(JNIEnv *jnienv, jclass class_of_this,
-		   jobject jthis, const char *name_of_field, DB_LSN value);
+		   jobject jthis, const gchar *name_of_field, DB_LSN value);
 
 /*
  * Values of flags for verify_return() and report_exception().
@@ -188,79 +188,79 @@ static const u_int32_t EXCEPTION_FILE_NOT_FOUND = 0x0001; /*FileNotFound*/
 /*
  * Report an exception back to the java side.
  */
-void report_exception(JNIEnv *jnienv, const char *text,
-		      int err, unsigned long expect_mask);
+void report_exception(JNIEnv *jnienv, const gchar *text,
+		      gint err, unsigned long expect_mask);
 
 /*
  * Report an exception back to the java side, for the specific
  * case of DB_LOCK_NOTGRANTED, as more things are added to the
  * constructor of this type of exception.
  */
-void report_notgranted_exception(JNIEnv *jnienv, const char *text,
+void report_notgranted_exception(JNIEnv *jnienv, const gchar *text,
 				 db_lockop_t op, db_lockmode_t mode,
-				 jobject jdbt, jobject jlock, int index);
+				 jobject jdbt, jobject jlock, gint index);
 
 /*
  * Create an exception object and return it.
  * The given class must have a constructor that has a
- * constructor with args (java.lang.String text, int errno);
+ * constructor with args (java.lang.String text, gint errno);
  * DbException and its subclasses fit this bill.
  */
 jobject create_exception(JNIEnv *jnienv, jstring text,
-			 int err, jclass dbexcept);
+			 gint err, jclass dbexcept);
 
 /*
  * Report an error via the errcall mechanism.
  */
 void report_errcall(JNIEnv *jnienv, jobject errcall,
-		    jstring prefix, const char *message);
+		    jstring prefix, const gchar *message);
 
 /*
  * If the object is null, report an exception and return false (0),
  * otherwise return true (1).
  */
-int verify_non_null(JNIEnv *jnienv, void *obj);
+gint verify_non_null(JNIEnv *jnienv, gpointer obj);
 
 /*
  * If the error code is non-zero, report an exception and return false (0),
  * otherwise return true (1).
  */
-int verify_return(JNIEnv *jnienv, int err, unsigned long flags);
+gint verify_return(JNIEnv *jnienv, gint err, unsigned long flags);
 
 /*
  * Verify that there was no memory error due to undersized Dbt.
  * If there is report a DbMemoryException, with the Dbt attached
  * and return false (0), otherwise return true (1).
  */
-int verify_dbt(JNIEnv *jnienv, int err, LOCKED_DBT *locked_dbt);
+gint verify_dbt(JNIEnv *jnienv, gint err, LOCKED_DBT *locked_dbt);
 
 /*
  * Create an object of the given class, calling its default constructor.
  */
-jobject create_default_object(JNIEnv *jnienv, const char *class_name);
+jobject create_default_object(JNIEnv *jnienv, const gchar *class_name);
 
 /*
  * Create a Dbt object, , calling its default constructor.
  */
-jobject create_dbt(JNIEnv *jnienv, const char *class_name);
+jobject create_dbt(JNIEnv *jnienv, const gchar *class_name);
 
 /*
  * Convert an DB object to a Java encapsulation of that object.
  * Note: This implementation creates a new Java object on each call,
  * so it is generally useful when a new DB object has just been created.
  */
-jobject convert_object(JNIEnv *jnienv, const char *class_name, void *dbobj);
+jobject convert_object(JNIEnv *jnienv, const gchar *class_name, gpointer dbobj);
 
 /*
  * Create a copy of the java string using __os_malloc.
  * Caller must free it.
  */
-char *get_c_string(JNIEnv *jnienv, jstring jstr);
+gchar *get_c_string(JNIEnv *jnienv, jstring jstr);
 
 /*
  * Create a java string from the given string
  */
-jstring get_java_string(JNIEnv *jnienv, const char* string);
+jstring get_java_string(JNIEnv *jnienv, const gchar * string);
 
 /*
  * Convert a java object to the various C pointers they represent.
@@ -302,47 +302,47 @@ jobject get_DbTxn        (JNIEnv *jnienv, DB_TXN *dbobj);
 jobject get_DbTxnStat    (JNIEnv *jnienv, DB_TXN_STAT *dbobj);
 
 /* The java names of DB classes */
-extern const char * const name_DB;
-extern const char * const name_DB_BTREE_STAT;
-extern const char * const name_DBC;
-extern const char * const name_DB_DEADLOCK_EX;
-extern const char * const name_DB_ENV;
-extern const char * const name_DB_EXCEPTION;
-extern const char * const name_DB_HASH_STAT;
-extern const char * const name_DB_LOCK;
-extern const char * const name_DB_LOCK_STAT;
-extern const char * const name_DB_LOGC;
-extern const char * const name_DB_LOG_STAT;
-extern const char * const name_DB_LSN;
-extern const char * const name_DB_MEMORY_EX;
-extern const char * const name_DB_MPOOL_FSTAT;
-extern const char * const name_DB_MPOOL_STAT;
-extern const char * const name_DB_LOCKNOTGRANTED_EX;
-extern const char * const name_DB_PREPLIST;
-extern const char * const name_DB_QUEUE_STAT;
-extern const char * const name_DB_REP_STAT;
-extern const char * const name_DB_RUNRECOVERY_EX;
-extern const char * const name_DBT;
-extern const char * const name_DB_TXN;
-extern const char * const name_DB_TXN_STAT;
-extern const char * const name_DB_TXN_STAT_ACTIVE;
-extern const char * const name_DB_UTIL;
-extern const char * const name_DbAppendRecno;
-extern const char * const name_DbBtreeCompare;
-extern const char * const name_DbBtreePrefix;
-extern const char * const name_DbDupCompare;
-extern const char * const name_DbEnvFeedback;
-extern const char * const name_DbErrcall;
-extern const char * const name_DbFeedback;
-extern const char * const name_DbHash;
-extern const char * const name_DbRecoveryInit;
-extern const char * const name_DbRepTransport;
-extern const char * const name_DbSecondaryKeyCreate;
-extern const char * const name_DbTxnRecover;
-extern const char * const name_RepElectResult;
-extern const char * const name_RepProcessMessage;
-
-extern const char * const string_signature;
+extern const gchar * const name_DB;
+extern const gchar * const name_DB_BTREE_STAT;
+extern const gchar * const name_DBC;
+extern const gchar * const name_DB_DEADLOCK_EX;
+extern const gchar * const name_DB_ENV;
+extern const gchar * const name_DB_EXCEPTION;
+extern const gchar * const name_DB_HASH_STAT;
+extern const gchar * const name_DB_LOCK;
+extern const gchar * const name_DB_LOCK_STAT;
+extern const gchar * const name_DB_LOGC;
+extern const gchar * const name_DB_LOG_STAT;
+extern const gchar * const name_DB_LSN;
+extern const gchar * const name_DB_MEMORY_EX;
+extern const gchar * const name_DB_MPOOL_FSTAT;
+extern const gchar * const name_DB_MPOOL_STAT;
+extern const gchar * const name_DB_LOCKNOTGRANTED_EX;
+extern const gchar * const name_DB_PREPLIST;
+extern const gchar * const name_DB_QUEUE_STAT;
+extern const gchar * const name_DB_REP_STAT;
+extern const gchar * const name_DB_RUNRECOVERY_EX;
+extern const gchar * const name_DBT;
+extern const gchar * const name_DB_TXN;
+extern const gchar * const name_DB_TXN_STAT;
+extern const gchar * const name_DB_TXN_STAT_ACTIVE;
+extern const gchar * const name_DB_UTIL;
+extern const gchar * const name_DbAppendRecno;
+extern const gchar * const name_DbBtreeCompare;
+extern const gchar * const name_DbBtreePrefix;
+extern const gchar * const name_DbDupCompare;
+extern const gchar * const name_DbEnvFeedback;
+extern const gchar * const name_DbErrcall;
+extern const gchar * const name_DbFeedback;
+extern const gchar * const name_DbHash;
+extern const gchar * const name_DbRecoveryInit;
+extern const gchar * const name_DbRepTransport;
+extern const gchar * const name_DbSecondaryKeyCreate;
+extern const gchar * const name_DbTxnRecover;
+extern const gchar * const name_RepElectResult;
+extern const gchar * const name_RepProcessMessage;
+
+extern const gchar * const string_signature;
 
 extern jfieldID fid_Dbt_data;
 extern jfieldID fid_Dbt_offset;
@@ -388,7 +388,7 @@ JNIEXPORT void JNICALL							      \
 JNIEXPORT void JNICALL Java_com_sleepycat_db_##_meth _argspec		      \
 {									      \
 	c_type *c_this = get_##c_type(jnienv, jthis);			      \
-	int ret;							      \
+	gint ret;							      \
 									      \
 	if (!verify_non_null(jnienv, c_this))				      \
 		return;							      \
@@ -401,7 +401,7 @@ JNIEXPORT void JNICALL Java_com_sleepycat_db_##_meth _argspec		      \
 JNIEXPORT jint JNICALL Java_com_sleepycat_db_##_meth _argspec		      \
 {									      \
 	c_type *c_this = get_##c_type(jnienv, jthis);			      \
-	int ret;							      \
+	gint ret;							      \
 									      \
 	if (!verify_non_null(jnienv, c_this))				      \
 		return (0);						      \
diff --git a/libdb/lock/lock.c b/libdb/lock/lock.c
index 66d4a2b..0011fef 100644
--- a/libdb/lock/lock.c
+++ b/libdb/lock/lock.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,34 +23,34 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/txn.h"
 
-static int  __lock_checklocker __P((DB_LOCKTAB *,
+static gint  __lock_checklocker __P((DB_LOCKTAB *,
 		struct __db_lock *, u_int32_t, u_int32_t));
 static void __lock_expires __P((DB_ENV *, db_timeval_t *, db_timeout_t));
 static void __lock_freelocker
 		__P((DB_LOCKTAB *, DB_LOCKREGION *, DB_LOCKER *, u_int32_t));
-static int  __lock_get_internal __P((DB_LOCKTAB *, u_int32_t, u_int32_t,
+static gint  __lock_get_internal __P((DB_LOCKTAB *, u_int32_t, u_int32_t,
 		const DBT *, db_lockmode_t, db_timeout_t, DB_LOCK *));
-static int  __lock_getobj
+static gint  __lock_getobj
 		__P((DB_LOCKTAB *, const DBT *, u_int32_t, int, DB_LOCKOBJ **));
-static int  __lock_is_parent __P((DB_LOCKTAB *, u_int32_t, DB_LOCKER *));
-static int  __lock_put_internal __P((DB_LOCKTAB *,
+static gint  __lock_is_parent __P((DB_LOCKTAB *, u_int32_t, DB_LOCKER *));
+static gint  __lock_put_internal __P((DB_LOCKTAB *,
 		struct __db_lock *, u_int32_t,  u_int32_t));
-static int  __lock_put_nolock __P((DB_ENV *, DB_LOCK *, int *, u_int32_t));
+static gint  __lock_put_nolock __P((DB_ENV *, DB_LOCK *, gint *, u_int32_t));
 static void __lock_remove_waiter __P((DB_LOCKTAB *,
 		DB_LOCKOBJ *, struct __db_lock *, db_status_t));
-static int __lock_trade __P((DB_ENV *, DB_LOCK *, u_int32_t));
+static gint __lock_trade __P((DB_ENV *, DB_LOCK *, u_int32_t));
 
-static const char __db_lock_err[] = "Lock table is out of available %s";
-static const char __db_lock_invalid[] = "%s: Lock is no longer valid";
-static const char __db_locker_invalid[] = "Locker is not valid";
+static const gchar __db_lock_err[] = "Lock table is out of available %s";
+static const gchar __db_lock_invalid[] = "%s: Lock is no longer valid";
+static const gchar __db_locker_invalid[] = "Locker is not valid";
 
 /*
  * __lock_id --
  *	Generate a unique locker id.
  *
- * PUBLIC: int __lock_id __P((DB_ENV *, u_int32_t *));
+ * PUBLIC: gint __lock_id __P((DB_ENV *, u_int32_t *));
  */
-int
+gint
 __lock_id(dbenv, idp)
 	DB_ENV *dbenv;
 	u_int32_t *idp;
@@ -59,7 +59,7 @@ __lock_id(dbenv, idp)
 	DB_LOCKTAB *lt;
 	DB_LOCKREGION *region;
 	u_int32_t *ids, locker_ndx;
-	int nids, ret;
+	gint nids, ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -114,9 +114,9 @@ err:	UNLOCKREGION(dbenv, lt);
  * __lock_id_free --
  *	Free a locker id.
  *
- * PUBLIC: int __lock_id_free __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __lock_id_free __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __lock_id_free(dbenv, id)
 	DB_ENV *dbenv;
 	u_int32_t id;
@@ -125,7 +125,7 @@ __lock_id_free(dbenv, id)
 	DB_LOCKTAB *lt;
 	DB_LOCKREGION *region;
 	u_int32_t locker_ndx;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -164,14 +164,14 @@ err:	UNLOCKREGION(dbenv, lt);
  *	given locker (used during transaction commit/abort), releasing
  *	all locks on a given object, and generating debugging information.
  *
- * PUBLIC: int __lock_vec __P((DB_ENV *,
+ * PUBLIC: gint __lock_vec __P((DB_ENV *,
  * PUBLIC:     u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
  */
-int
+gint
 __lock_vec(dbenv, locker, flags, list, nlist, elistp)
 	DB_ENV *dbenv;
 	u_int32_t locker, flags;
-	int nlist;
+	gint nlist;
 	DB_LOCKREQ *list, **elistp;
 {
 	struct __db_lock *lp, *next_lock;
@@ -181,7 +181,7 @@ __lock_vec(dbenv, locker, flags, list, nlist, elistp)
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	u_int32_t lndx, ndx;
-	int did_abort, i, ret, run_dd, upgrade, writes;
+	gint did_abort, i, ret, run_dd, upgrade, writes;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -485,10 +485,10 @@ __lock_vec(dbenv, locker, flags, list, nlist, elistp)
  * All the work for lock_get (and for the GET option of lock_vec) is done
  * inside of lock_get_internal.
  *
- * PUBLIC: int __lock_get __P((DB_ENV *,
+ * PUBLIC: gint __lock_get __P((DB_ENV *,
  * PUBLIC:     u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
  */
-int
+gint
 __lock_get(dbenv, locker, flags, obj, lock_mode, lock)
 	DB_ENV *dbenv;
 	u_int32_t locker, flags;
@@ -496,7 +496,7 @@ __lock_get(dbenv, locker, flags, obj, lock_mode, lock)
 	db_lockmode_t lock_mode;
 	DB_LOCK *lock;
 {
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -534,7 +534,7 @@ __lock_get_internal(lt, locker, flags, obj, lock_mode, timeout, lock)
 	DB_LOCKOBJ *sh_obj;
 	DB_LOCKREGION *region;
 	u_int32_t locker_ndx, obj_ndx;
-	int did_abort, ihold, on_locker_list, no_dd, ret;
+	gint did_abort, ihold, on_locker_list, no_dd, ret;
 
 	dbenv = lt->dbenv;
 	region = lt->reginfo.primary;
@@ -918,15 +918,15 @@ err:	newl->status = DB_LSTAT_FREE;
  * The user callable one is lock_put and the three we use internally are
  * __lock_put_nolock, __lock_put_internal and __lock_downgrade.
  *
- * PUBLIC: int  __lock_put __P((DB_ENV *, DB_LOCK *));
+ * PUBLIC: gint  __lock_put __P((DB_ENV *, DB_LOCK *));
  */
-int
+gint
 __lock_put(dbenv, lock)
 	DB_ENV *dbenv;
 	DB_LOCK *lock;
 {
 	DB_LOCKTAB *lt;
-	int ret, run_dd;
+	gint ret, run_dd;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -957,13 +957,13 @@ static int
 __lock_put_nolock(dbenv, lock, runp, flags)
 	DB_ENV *dbenv;
 	DB_LOCK *lock;
-	int *runp;
+	gint *runp;
 	u_int32_t flags;
 {
 	struct __db_lock *lockp;
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
-	int ret;
+	gint ret;
 
 	/* Check if locks have been globally turned off. */
 	if (F_ISSET(dbenv, DB_ENV_NOLOCKING))
@@ -996,10 +996,10 @@ __lock_put_nolock(dbenv, lock, runp, flags)
  * back to iwrite locks and 2) to downgrade write-handle locks to read-handle
  * locks at the end of an open/create.
  *
- * PUBLIC: int __lock_downgrade __P((DB_ENV *,
+ * PUBLIC: gint __lock_downgrade __P((DB_ENV *,
  * PUBLIC:     DB_LOCK *, db_lockmode_t, u_int32_t));
  */
-int
+gint
 __lock_downgrade(dbenv, lock, new_mode, flags)
 	DB_ENV *dbenv;
 	DB_LOCK *lock;
@@ -1012,7 +1012,7 @@ __lock_downgrade(dbenv, lock, new_mode, flags)
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	u_int32_t indx;
-	int ret;
+	gint ret;
 
 	COMPQUIET(flags, 0);
 
@@ -1069,7 +1069,7 @@ __lock_put_internal(lt, lockp, obj_ndx, flags)
 {
 	DB_LOCKOBJ *sh_obj;
 	DB_LOCKREGION *region;
-	int ret, state_changed;
+	gint ret, state_changed;
 
 	region = lt->reginfo.primary;
 	ret = state_changed = 0;
@@ -1174,7 +1174,7 @@ __lock_checklocker(lt, lockp, locker, flags)
 	DB_LOCKER *sh_locker;
 	DB_LOCKREGION *region;
 	u_int32_t indx;
-	int ret;
+	gint ret;
 
 	dbenv = lt->dbenv;
 	region = lt->reginfo.primary;
@@ -1225,9 +1225,9 @@ freelock:
  * __lock_addfamilylocker
  *	Put a locker entry in for a child transaction.
  *
- * PUBLIC: int __lock_addfamilylocker __P((DB_ENV *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __lock_addfamilylocker __P((DB_ENV *, u_int32_t, u_int32_t));
  */
-int
+gint
 __lock_addfamilylocker(dbenv, pid, id)
 	DB_ENV *dbenv;
 	u_int32_t pid, id;
@@ -1236,7 +1236,7 @@ __lock_addfamilylocker(dbenv, pid, id)
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	u_int32_t ndx;
-	int ret;
+	gint ret;
 
 	lt = dbenv->lk_handle;
 	region = lt->reginfo.primary;
@@ -1291,9 +1291,9 @@ err:
  *
  * This must be called without the locker bucket locked.
  *
- * PUBLIC: int __lock_freefamilylocker  __P((DB_LOCKTAB *, u_int32_t));
+ * PUBLIC: gint __lock_freefamilylocker  __P((DB_LOCKTAB *, u_int32_t));
  */
-int
+gint
 __lock_freefamilylocker(lt, locker)
 	DB_LOCKTAB *lt;
 	u_int32_t locker;
@@ -1302,7 +1302,7 @@ __lock_freefamilylocker(lt, locker)
 	DB_LOCKER *sh_locker;
 	DB_LOCKREGION *region;
 	u_int32_t indx;
-	int ret;
+	gint ret;
 
 	dbenv = lt->dbenv;
 	region = lt->reginfo.primary;
@@ -1361,10 +1361,10 @@ __lock_freelocker(lt, region, sh_locker, indx)
  * amount of time that a lock for this transaction is permitted
  * to wait.
  *
- * PUBLIC: int __lock_set_timeout __P(( DB_ENV *,
+ * PUBLIC: gint __lock_set_timeout __P(( DB_ENV *,
  * PUBLIC:      u_int32_t, db_timeout_t, u_int32_t));
  */
-int
+gint
 __lock_set_timeout(dbenv, locker, timeout, op)
 	DB_ENV *dbenv;
 	u_int32_t locker;
@@ -1375,7 +1375,7 @@ __lock_set_timeout(dbenv, locker, timeout, op)
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	u_int32_t locker_ndx;
-	int ret;
+	gint ret;
 
 	lt = dbenv->lk_handle;
 	region = lt->reginfo.primary;
@@ -1412,9 +1412,9 @@ __lock_set_timeout(dbenv, locker, timeout, op)
  * return EINVAL if the parent does not exist or did not
  * have a current txn timeout set.
  *
- * PUBLIC: int __lock_inherit_timeout __P(( DB_ENV *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __lock_inherit_timeout __P(( DB_ENV *, u_int32_t, u_int32_t));
  */
-int
+gint
 __lock_inherit_timeout(dbenv, parent, locker)
 	DB_ENV *dbenv;
 	u_int32_t parent, locker;
@@ -1423,7 +1423,7 @@ __lock_inherit_timeout(dbenv, parent, locker)
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	u_int32_t locker_ndx;
-	int ret;
+	gint ret;
 
 	lt = dbenv->lk_handle;
 	region = lt->reginfo.primary;
@@ -1476,14 +1476,14 @@ err:
  *
  * This must be called with the locker bucket locked.
  *
- * PUBLIC: int __lock_getlocker __P((DB_LOCKTAB *,
+ * PUBLIC: gint __lock_getlocker __P((DB_LOCKTAB *,
  * PUBLIC:     u_int32_t, u_int32_t, int, DB_LOCKER **));
  */
-int
+gint
 __lock_getlocker(lt, locker, indx, create, retp)
 	DB_LOCKTAB *lt;
 	u_int32_t locker, indx;
-	int create;
+	gint create;
 	DB_LOCKER **retp;
 {
 	DB_ENV *dbenv;
@@ -1550,14 +1550,14 @@ __lock_getobj(lt, obj, ndx, create, retp)
 	DB_LOCKTAB *lt;
 	const DBT *obj;
 	u_int32_t ndx;
-	int create;
+	gint create;
 	DB_LOCKOBJ **retp;
 {
 	DB_ENV *dbenv;
 	DB_LOCKOBJ *sh_obj;
 	DB_LOCKREGION *region;
-	int ret;
-	void *p;
+	gint ret;
+	gpointer p;
 
 	dbenv = lt->dbenv;
 	region = lt->reginfo.primary;
@@ -1644,9 +1644,9 @@ __lock_is_parent(lt, locker, sh_locker)
  * Look through the waiters and holders lists and decide which (if any)
  * locks can be promoted.   Promote any that are eligible.
  *
- * PUBLIC: int __lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *, u_int32_t));
+ * PUBLIC: gint __lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *, u_int32_t));
  */
-int
+gint
 __lock_promote(lt, obj, flags)
 	DB_LOCKTAB *lt;
 	DB_LOCKOBJ *obj;
@@ -1656,7 +1656,7 @@ __lock_promote(lt, obj, flags)
 	DB_LOCKER *sh_locker;
 	DB_LOCKREGION *region;
 	u_int32_t locker_ndx;
-	int had_waiters, state_changed;
+	gint had_waiters, state_changed;
 
 	region = lt->reginfo.primary;
 	had_waiters = 0;
@@ -1749,7 +1749,7 @@ __lock_remove_waiter(lt, sh_obj, lockp, status)
 	db_status_t status;
 {
 	DB_LOCKREGION *region;
-	int do_wakeup;
+	gint do_wakeup;
 
 	region = lt->reginfo.primary;
 
@@ -1801,9 +1801,9 @@ __lock_expires(dbenv, timevalp, timeout)
 /*
  * __lock_expired -- determine if a lock has expired.
  *
- * PUBLIC: int __lock_expired __P((DB_ENV *, db_timeval_t *, db_timeval_t *));
+ * PUBLIC: gint __lock_expired __P((DB_ENV *, db_timeval_t *, db_timeval_t *));
  */
-int
+gint
 __lock_expired(dbenv, now, timevalp)
 	DB_ENV *dbenv;
 	db_timeval_t *now, *timevalp;
@@ -1836,7 +1836,7 @@ __lock_trade(dbenv, lock, new_locker)
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	DB_LOCKER *sh_locker;
-	int ret;
+	gint ret;
 	u_int32_t locker_ndx;
 
 	lt = dbenv->lk_handle;
diff --git a/libdb/lock/lock_deadlock.c b/libdb/lock/lock_deadlock.c
index 6ec9ebe..49d43ac 100644
--- a/libdb/lock/lock_deadlock.c
+++ b/libdb/lock/lock_deadlock.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -51,13 +51,13 @@ typedef struct {
 	db_pgno_t	pgno;
 } locker_info;
 
-static int  __dd_abort __P((DB_ENV *, locker_info *));
-static int  __dd_build __P((DB_ENV *,
+static gint  __dd_abort __P((DB_ENV *, locker_info *));
+static gint  __dd_build __P((DB_ENV *,
 	    u_int32_t, u_int32_t **, u_int32_t *, u_int32_t *, locker_info **));
-static int  __dd_find __P((DB_ENV *,
+static gint  __dd_find __P((DB_ENV *,
 	    u_int32_t *, locker_info *, u_int32_t, u_int32_t, u_int32_t ***));
-static int  __dd_isolder __P((u_int32_t, u_int32_t, u_int32_t, u_int32_t));
-static int __dd_verify __P((locker_info *, u_int32_t *, u_int32_t *,
+static gint  __dd_isolder __P((u_int32_t, u_int32_t, u_int32_t, u_int32_t));
+static gint __dd_verify __P((locker_info *, u_int32_t *, u_int32_t *,
 	    u_int32_t *, u_int32_t, u_int32_t, u_int32_t));
 
 #ifdef DIAGNOSTIC
@@ -68,13 +68,13 @@ static void __dd_debug
 /*
  * lock_detect --
  *
- * PUBLIC: int __lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, int *));
+ * PUBLIC: gint __lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, gint *));
  */
-int
+gint
 __lock_detect(dbenv, flags, atype, abortp)
 	DB_ENV *dbenv;
 	u_int32_t flags, atype;
-	int *abortp;
+	gint *abortp;
 {
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
@@ -83,7 +83,7 @@ __lock_detect(dbenv, flags, atype, abortp)
 	u_int32_t *bitmap, *copymap, **deadp, **free_me, *tmpmap;
 	u_int32_t i, keeper, killid, limit, nalloc, nlockers;
 	u_int32_t lock_max, txn_max;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -328,7 +328,7 @@ __dd_build(dbenv, atype, bmp, nlockers, allocp, idmap)
 	db_timeval_t now;
 	u_int32_t *bitmap, count, dd, *entryp, id, ndx, nentries, *tmpmap;
 	u_int8_t *pptr;
-	int expire_only, is_first, need_timeout, ret;
+	gint expire_only, is_first, need_timeout, ret;
 
 	lt = dbenv->lk_handle;
 	region = lt->reginfo.primary;
@@ -615,7 +615,7 @@ __dd_find(dbenv, bmp, idmap, nlockers, nalloc, deadp)
 {
 	u_int32_t i, j, k, *mymap, *tmpmap;
 	u_int32_t **retp;
-	int ndead, ndeadalloc, ret;
+	gint ndead, ndeadalloc, ret;
 
 #undef	INITIAL_DEAD_ALLOC
 #define	INITIAL_DEAD_ALLOC	8
@@ -683,7 +683,7 @@ __dd_abort(dbenv, info)
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	u_int32_t ndx;
-	int ret;
+	gint ret;
 
 	lt = dbenv->lk_handle;
 	region = lt->reginfo.primary;
@@ -747,7 +747,7 @@ __dd_debug(dbenv, idmap, bitmap, nlockers, nalloc)
 	u_int32_t *bitmap, nlockers, nalloc;
 {
 	u_int32_t i, j, *mymap;
-	char *msgbuf;
+	gchar *msgbuf;
 
 	__db_err(dbenv, "Waitsfor array\nWaiter:\tWaiting on:");
 
@@ -794,7 +794,7 @@ __dd_verify(idmap, deadmap, tmpmap, origmap, nlockers, nalloc, which)
 {
 	u_int32_t *tmap;
 	u_int32_t j;
-	int count;
+	gint count;
 
 	memset(tmpmap, 0, sizeof(u_int32_t) * nalloc);
 
diff --git a/libdb/lock/lock_method.c b/libdb/lock/lock_method.c
index 529a420..eddc32f 100644
--- a/libdb/lock/lock_method.c
+++ b/libdb/lock/lock_method.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -30,13 +30,13 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_client_ext.h"
 #endif
 
-static int __lock_set_lk_conflicts __P((DB_ENV *, u_int8_t *, int));
-static int __lock_set_lk_detect __P((DB_ENV *, u_int32_t));
-static int __lock_set_lk_max __P((DB_ENV *, u_int32_t));
-static int __lock_set_lk_max_lockers __P((DB_ENV *, u_int32_t));
-static int __lock_set_lk_max_locks __P((DB_ENV *, u_int32_t));
-static int __lock_set_lk_max_objects __P((DB_ENV *, u_int32_t));
-static int __lock_set_env_timeout __P((DB_ENV *, db_timeout_t, u_int32_t));
+static gint __lock_set_lk_conflicts __P((DB_ENV *, u_int8_t *, int));
+static gint __lock_set_lk_detect __P((DB_ENV *, u_int32_t));
+static gint __lock_set_lk_max __P((DB_ENV *, u_int32_t));
+static gint __lock_set_lk_max_lockers __P((DB_ENV *, u_int32_t));
+static gint __lock_set_lk_max_locks __P((DB_ENV *, u_int32_t));
+static gint __lock_set_lk_max_objects __P((DB_ENV *, u_int32_t));
+static gint __lock_set_env_timeout __P((DB_ENV *, db_timeout_t, u_int32_t));
 
 /*
  * __lock_dbenv_create --
@@ -124,9 +124,9 @@ static int
 __lock_set_lk_conflicts(dbenv, lk_conflicts, lk_modes)
 	DB_ENV *dbenv;
 	u_int8_t *lk_conflicts;
-	int lk_modes;
+	gint lk_modes;
 {
-	int ret;
+	gint ret;
 
 	ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_lk_conflicts");
 
diff --git a/libdb/lock/lock_region.c b/libdb/lock/lock_region.c
index 9a53d58..8ed61bc 100644
--- a/libdb/lock/lock_region.c
+++ b/libdb/lock/lock_region.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,7 +21,7 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_shash.h"
 #include "dbinc/lock.h"
 
-static int  __lock_init __P((DB_ENV *, DB_LOCKTAB *));
+static gint  __lock_init __P((DB_ENV *, DB_LOCKTAB *));
 static size_t
 	    __lock_region_size __P((DB_ENV *));
 
@@ -66,16 +66,16 @@ static const u_int8_t db_cdb_conflicts[] = {
  * __lock_open --
  *	Internal version of lock_open: only called from DB_ENV->open.
  *
- * PUBLIC: int __lock_open __P((DB_ENV *));
+ * PUBLIC: gint __lock_open __P((DB_ENV *));
  */
-int
+gint
 __lock_open(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	size_t size;
-	int ret;
+	gint ret;
 
 	/* Create the lock table structure. */
 	if ((ret = __os_calloc(dbenv, 1, sizeof(DB_LOCKTAB), &lt)) != 0)
@@ -170,7 +170,7 @@ __lock_init(dbenv, lt)
 #endif
 	u_int32_t i, lk_modes;
 	u_int8_t *addr;
-	int ret;
+	gint ret;
 
 	if ((ret = __db_shalloc(lt->reginfo.addr,
 	    sizeof(DB_LOCKREGION), 0, &lt->reginfo.primary)) != 0)
@@ -290,14 +290,14 @@ mem_err:		__db_err(dbenv,
  *	Clean up after the lock system on a close or failed open.  Called
  * only from __dbenv_refresh.  (Formerly called __lock_close.)
  *
- * PUBLIC: int __lock_dbenv_refresh __P((DB_ENV *));
+ * PUBLIC: gint __lock_dbenv_refresh __P((DB_ENV *));
  */
-int
+gint
 __lock_dbenv_refresh(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_LOCKTAB *lt;
-	int ret;
+	gint ret;
 
 	lt = dbenv->lk_handle;
 
@@ -394,9 +394,9 @@ __lock_region_destroy(dbenv, infop)
  *	Set the current locker ID and current maximum unused ID (for
  *	testing purposes only).
  *
- * PUBLIC: int __lock_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __lock_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
  */
-int
+gint
 __lock_id_set(dbenv, cur_id, max_id)
 	DB_ENV *dbenv;
 	u_int32_t cur_id, max_id;
diff --git a/libdb/lock/lock_stat.c b/libdb/lock/lock_stat.c
index 72c2490..680e394 100644
--- a/libdb/lock/lock_stat.c
+++ b/libdb/lock/lock_stat.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -43,9 +43,9 @@ static void __lock_printheader __P((void));
  * __lock_stat --
  *	Return LOCK statistics.
  *
- * PUBLIC: int __lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
+ * PUBLIC: gint __lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
  */
-int
+gint
 __lock_stat(dbenv, statp, flags)
 	DB_ENV *dbenv;
 	DB_LOCK_STAT **statp;
@@ -54,7 +54,7 @@ __lock_stat(dbenv, statp, flags)
 	DB_LOCKREGION *region;
 	DB_LOCKTAB *lt;
 	DB_LOCK_STAT *stats, tmp;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -119,12 +119,12 @@ __lock_stat(dbenv, statp, flags)
 /*
  * __lock_dump_region --
  *
- * PUBLIC: int __lock_dump_region __P((DB_ENV *, char *, FILE *));
+ * PUBLIC: gint __lock_dump_region __P((DB_ENV *, gchar *, FILE *));
  */
-int
+gint
 __lock_dump_region(dbenv, area, fp)
 	DB_ENV *dbenv;
-	char *area;
+	gchar *area;
 	FILE *fp;
 {
 	DB_LOCKER *lip;
@@ -229,7 +229,7 @@ __lock_dump_locker(lt, lip, fp)
 {
 	struct __db_lock *lp;
 	time_t s;
-	char buf[64];
+	gchar buf[64];
 
 	fprintf(fp, "%8lx dd=%2ld locks held %-4d write locks %-4d",
 	    (u_long)lip->id, (long)lip->dd_id, lip->nlocks, lip->nwrites);
@@ -301,14 +301,14 @@ void
 __lock_printlock(lt, lp, ispgno)
 	DB_LOCKTAB *lt;
 	struct __db_lock *lp;
-	int ispgno;
+	gint ispgno;
 {
 	DB_LOCKOBJ *lockobj;
 	db_pgno_t pgno;
 	u_int32_t *fidp, type;
 	u_int8_t *ptr;
-	char *namep;
-	const char *mode, *status;
+	gchar *namep;
+	const gchar *mode, *status;
 
 	switch (lp->mode) {
 	case DB_LOCK_DIRTY:
diff --git a/libdb/lock/lock_util.c b/libdb/lock/lock_util.c
index 1fa2b93..f805b2b 100644
--- a/libdb/lock/lock_util.c
+++ b/libdb/lock/lock_util.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -31,14 +31,14 @@ static const char revid[] = "$Id$";
  *	this function cannot be used as a sort function; its purpose is to
  *	be used as a hash comparison function.
  *
- * PUBLIC: int __lock_cmp __P((const DBT *, DB_LOCKOBJ *));
+ * PUBLIC: gint __lock_cmp __P((const DBT *, DB_LOCKOBJ *));
  */
-int
+gint
 __lock_cmp(dbt, lock_obj)
 	const DBT *dbt;
 	DB_LOCKOBJ *lock_obj;
 {
-	void *obj_data;
+	gpointer obj_data;
 
 	obj_data = SH_DBT_PTR(&lock_obj->lockobj);
 	return (dbt->size == lock_obj->lockobj.size &&
@@ -46,9 +46,9 @@ __lock_cmp(dbt, lock_obj)
 }
 
 /*
- * PUBLIC: int __lock_locker_cmp __P((u_int32_t, DB_LOCKER *));
+ * PUBLIC: gint __lock_locker_cmp __P((u_int32_t, DB_LOCKER *));
  */
-int
+gint
 __lock_locker_cmp(locker, sh_locker)
 	u_int32_t locker;
 	DB_LOCKER *sh_locker;
@@ -112,7 +112,7 @@ u_int32_t
 __lock_lhash(lock_obj)
 	DB_LOCKOBJ *lock_obj;
 {
-	void *obj_data;
+	gpointer obj_data;
 
 	obj_data = SH_DBT_PTR(&lock_obj->lockobj);
 
diff --git a/libdb/log/log.c b/libdb/log/log.c
index 033f77e..e9852f2 100644
--- a/libdb/log/log.c
+++ b/libdb/log/log.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,24 +25,24 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/txn.h"
 
-static int __log_init __P((DB_ENV *, DB_LOG *));
-static int __log_recover __P((DB_LOG *));
+static gint __log_init __P((DB_ENV *, DB_LOG *));
+static gint __log_recover __P((DB_LOG *));
 static size_t __log_region_size __P((DB_ENV *));
-static int __log_zero __P((DB_ENV *, DB_LSN *, DB_LSN *));
+static gint __log_zero __P((DB_ENV *, DB_LSN *, DB_LSN *));
 
 /*
  * __log_open --
  *	Internal version of log_open: only called from DB_ENV->open.
  *
- * PUBLIC: int __log_open __P((DB_ENV *));
+ * PUBLIC: gint __log_open __P((DB_ENV *));
  */
-int
+gint
 __log_open(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_LOG *dblp;
 	LOG *lp;
-	int ret;
+	gint ret;
 
 	/* Create/initialize the DB_LOG structure. */
 	if ((ret = __os_calloc(dbenv, 1, sizeof(DB_LOG), &dblp)) != 0)
@@ -145,8 +145,8 @@ __log_init(dbenv, dblp)
 {
 	DB_MUTEX *flush_mutexp;
 	LOG *region;
-	int ret;
-	void *p;
+	gint ret;
+	gpointer p;
 #ifdef  HAVE_MUTEX_SYSTEM_RESOURCES
 	u_int8_t *addr;
 #endif
@@ -250,7 +250,7 @@ __log_recover(dblp)
 	DB_LSN lsn;
 	LOG *lp;
 	u_int32_t cnt, rectype;
-	int ret;
+	gint ret;
 	logfile_validity status;
 
 	logc = NULL;
@@ -353,21 +353,21 @@ err:	if (logc != NULL)
  * the number of the first readable log file, else it will contain the number
  * of the last log file (which may be too old to read).
  *
- * PUBLIC: int __log_find __P((DB_LOG *, int, u_int32_t *, logfile_validity *));
+ * PUBLIC: gint __log_find __P((DB_LOG *, int, u_int32_t *, logfile_validity *));
  */
-int
+gint
 __log_find(dblp, find_first, valp, statusp)
 	DB_LOG *dblp;
-	int find_first;
+	gint find_first;
 	u_int32_t *valp;
 	logfile_validity *statusp;
 {
 	DB_ENV *dbenv;
 	logfile_validity logval_status, status;
 	u_int32_t clv, logval;
-	int cnt, fcnt, ret;
-	const char *dir;
-	char *c, **names, *p, *q, savech;
+	gint cnt, fcnt, ret;
+	const gchar *dir;
+	gchar *c, **names, *p, *q, savech;
 
 	dbenv = dblp->dbenv;
 	logval_status = status = DB_LV_NONEXISTENT;
@@ -510,13 +510,13 @@ err:	__os_dirfree(dbenv, names, fcnt);
  *	log file if it is not unexpectedly flawed (that is, if it's perfectly
  *	normal, if it's zero-length, or if it's an old version).
  *
- * PUBLIC: int __log_valid __P((DB_LOG *, u_int32_t, int, logfile_validity *));
+ * PUBLIC: gint __log_valid __P((DB_LOG *, u_int32_t, int, logfile_validity *));
  */
-int
+gint
 __log_valid(dblp, number, set_persist, statusp)
 	DB_LOG *dblp;
 	u_int32_t number;
-	int set_persist;
+	gint set_persist;
 	logfile_validity *statusp;
 {
 	DB_CIPHER *db_cipher;
@@ -527,9 +527,9 @@ __log_valid(dblp, number, set_persist, statusp)
 	LOGP *persist;
 	logfile_validity status;
 	size_t hdrsize, nw, recsize;
-	int is_hmac, need_free, ret;
+	gint is_hmac, need_free, ret;
 	u_int8_t *tmp;
-	char *fname;
+	gchar *fname;
 
 	dbenv = dblp->dbenv;
 	db_cipher = dbenv->crypto_handle;
@@ -697,14 +697,14 @@ err:	__os_free(dbenv, fname);
  *	Clean up after the log system on a close or failed open.  Called only
  * from __dbenv_refresh.  (Formerly called __log_close.)
  *
- * PUBLIC: int __log_dbenv_refresh __P((DB_ENV *));
+ * PUBLIC: gint __log_dbenv_refresh __P((DB_ENV *));
  */
-int
+gint
 __log_dbenv_refresh(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_LOG *dblp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dblp = dbenv->lg_handle;
 
@@ -738,9 +738,9 @@ __log_dbenv_refresh(dbenv)
  * __log_stat --
  *	Return log statistics.
  *
- * PUBLIC: int __log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
+ * PUBLIC: gint __log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
  */
-int
+gint
 __log_stat(dbenv, statp, flags)
 	DB_ENV *dbenv;
 	DB_LOG_STAT **statp;
@@ -749,7 +749,7 @@ __log_stat(dbenv, statp, flags)
 	DB_LOG *dblp;
 	DB_LOG_STAT *stats;
 	LOG *region;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -867,9 +867,9 @@ __log_region_destroy(dbenv, infop)
  * record to be written). This is used in replication to discard records
  * in the log file that do not agree with the master.
  *
- * PUBLIC: int __log_vtruncate __P((DB_ENV *, DB_LSN *, DB_LSN *));
+ * PUBLIC: gint __log_vtruncate __P((DB_ENV *, DB_LSN *, DB_LSN *));
  */
-int
+gint
 __log_vtruncate(dbenv, lsn, ckplsn)
 	DB_ENV *dbenv;
 	DB_LSN *lsn, *ckplsn;
@@ -881,8 +881,8 @@ __log_vtruncate(dbenv, lsn, ckplsn)
 	DB_LSN end_lsn;
 	LOG *lp;
 	u_int32_t bytes, c_len;
-	int fn, ret, t_ret;
-	char *fname;
+	gint fn, ret, t_ret;
+	gchar *fname;
 
 	/* Need to find out the length of this soon-to-be-last record. */
 	if ((ret = dbenv->log_cursor(dbenv, &logc, 0)) != 0)
@@ -977,19 +977,19 @@ err:	R_UNLOCK(dbenv, &dblp->reginfo);
  * lower-numbered than the current logs, the we return *outdatedp non
  * zero, else we return it 0.
  *
- * PUBLIC: int __log_is_outdated __P((DB_ENV *dbenv,
- * PUBLIC:     u_int32_t fnum, int *outdatedp));
+ * PUBLIC: gint __log_is_outdated __P((DB_ENV *dbenv,
+ * PUBLIC:     u_int32_t fnum, gint *outdatedp));
  */
-int
+gint
 __log_is_outdated(dbenv, fnum, outdatedp)
 	DB_ENV *dbenv;
 	u_int32_t fnum;
-	int *outdatedp;
+	gint *outdatedp;
 {
 	DB_LOG *dblp;
 	LOG *lp;
-	char *name;
-	int ret;
+	gchar *name;
+	gint ret;
 	u_int32_t cfile;
 
 	dblp = dbenv->lg_handle;
@@ -1027,10 +1027,10 @@ __log_zero(dbenv, from_lsn, to_lsn)
 	DB_ENV *dbenv;
 	DB_LSN *from_lsn, *to_lsn;
 {
-	char *lname;
+	gchar *lname;
 	DB_LOG *dblp;
 	LOG *lp;
-	int ret;
+	gint ret;
 	size_t nbytes, len, nw;
 	u_int8_t buf[4096];
 	u_int32_t mbytes, bytes;
diff --git a/libdb/log/log_archive.c b/libdb/log/log_archive.c
index f52403e..3d37374 100644
--- a/libdb/log/log_archive.c
+++ b/libdb/log/log_archive.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,21 +25,21 @@ static const char revid[] = "$Id$";
 #include "dbinc/qam.h"
 #include "dbinc/txn.h"
 
-static int __absname __P((DB_ENV *, char *, char *, char **));
-static int __build_data __P((DB_ENV *, char *, char ***));
-static int __cmpfunc __P((const void *, const void *));
-static int __usermem __P((DB_ENV *, char ***));
+static gint __absname __P((DB_ENV *, gchar *, gchar *, gchar **));
+static gint __build_data __P((DB_ENV *, gchar *, gchar ***));
+static gint __cmpfunc __P((gconstpointer , gconstpointer ));
+static gint __usermem __P((DB_ENV *, gchar ***));
 
 /*
  * __log_archive --
  *	Supporting function for db_archive(1).
  *
- * PUBLIC: int __log_archive __P((DB_ENV *, char **[], u_int32_t));
+ * PUBLIC: gint __log_archive __P((DB_ENV *, gchar **[], u_int32_t));
  */
-int
+gint
 __log_archive(dbenv, listp, flags)
 	DB_ENV *dbenv;
-	char ***listp;
+	gchar ***listp;
 	u_int32_t flags;
 {
 	DBT rec;
@@ -47,8 +47,8 @@ __log_archive(dbenv, listp, flags)
 	DB_LOGC *logc;
 	DB_LSN stable_lsn;
 	__txn_ckp_args *ckp_args;
-	char **array, **arrayp, *name, *p, *pref, buf[MAXPATHLEN];
-	int array_size, db_arch_abs, n, ret;
+	gchar **array, **arrayp, *name, *p, *pref, buf[MAXPATHLEN];
+	gint array_size, db_arch_abs, n, ret;
 	u_int32_t fnum;
 
 	PANIC_CHECK(dbenv);
@@ -156,7 +156,7 @@ __log_archive(dbenv, listp, flags)
 	/* Get some initial space. */
 	array_size = 64;
 	if ((ret = __os_malloc(dbenv,
-	    sizeof(char *) * array_size, &array)) != 0)
+	    sizeof(gchar *) * array_size, &array)) != 0)
 		return (ret);
 	array[0] = NULL;
 
@@ -175,7 +175,7 @@ __log_archive(dbenv, listp, flags)
 		if (n >= array_size - 2) {
 			array_size += LIST_INCREMENT;
 			if ((ret = __os_realloc(dbenv,
-			    sizeof(char *) * array_size, &array)) != 0)
+			    sizeof(gchar *) * array_size, &array)) != 0)
 				goto err;
 		}
 
@@ -203,7 +203,7 @@ __log_archive(dbenv, listp, flags)
 	}
 
 	/* Sort the list. */
-	qsort(array, (size_t)n, sizeof(char *), __cmpfunc);
+	qsort(array, (size_t)n, sizeof(gchar *), __cmpfunc);
 
 	/* Rework the memory. */
 	if ((ret = __usermem(dbenv, &array)) != 0)
@@ -229,20 +229,20 @@ err:	if (array != NULL) {
 static int
 __build_data(dbenv, pref, listp)
 	DB_ENV *dbenv;
-	char *pref, ***listp;
+	gchar *pref, ***listp;
 {
 	DBT rec;
 	DB_LOGC *logc;
 	DB_LSN lsn;
 	__dbreg_register_args *argp;
 	u_int32_t rectype;
-	int array_size, last, n, nxt, ret, t_ret;
-	char **array, **arrayp, **list, **lp, *p, *real_name;
+	gint array_size, last, n, nxt, ret, t_ret;
+	gchar **array, **arrayp, **list, **lp, *p, *real_name;
 
 	/* Get some initial space. */
 	array_size = 64;
 	if ((ret = __os_malloc(dbenv,
-	    sizeof(char *) * array_size, &array)) != 0)
+	    sizeof(gchar *) * array_size, &array)) != 0)
 		return (ret);
 	array[0] = NULL;
 
@@ -270,7 +270,7 @@ __build_data(dbenv, pref, listp)
 		if (n >= array_size - 2) {
 			array_size += LIST_INCREMENT;
 			if ((ret = __os_realloc(dbenv,
-			    sizeof(char *) * array_size, &array)) != 0)
+			    sizeof(gchar *) * array_size, &array)) != 0)
 				goto free_continue;
 		}
 
@@ -288,7 +288,7 @@ __build_data(dbenv, pref, listp)
 				if (n >= array_size - 2) {
 					array_size += LIST_INCREMENT;
 					if ((ret = __os_realloc(dbenv,
-					    sizeof(char *) *
+					    sizeof(gchar *) *
 					    array_size, &array)) != 0)
 						goto q_err;
 				}
@@ -319,7 +319,7 @@ free_continue:	__os_free(dbenv, argp);
 	}
 
 	/* Sort the list. */
-	qsort(array, (size_t)n, sizeof(char *), __cmpfunc);
+	qsort(array, (size_t)n, sizeof(gchar *), __cmpfunc);
 
 	/*
 	 * Build the real pathnames, discarding nonexistent files and
@@ -407,11 +407,11 @@ err1:	if (array != NULL) {
 static int
 __absname(dbenv, pref, name, newnamep)
 	DB_ENV *dbenv;
-	char *pref, *name, **newnamep;
+	gchar *pref, *name, **newnamep;
 {
 	size_t l_pref, l_name;
-	int isabspath, ret;
-	char *newname;
+	gint isabspath, ret;
+	gchar *newname;
 
 	l_name = strlen(name);
 	isabspath = __os_abspath(name);
@@ -442,22 +442,22 @@ __absname(dbenv, pref, name, newnamep)
 static int
 __usermem(dbenv, listp)
 	DB_ENV *dbenv;
-	char ***listp;
+	gchar ***listp;
 {
 	size_t len;
-	int ret;
-	char **array, **arrayp, **orig, *strp;
+	gint ret;
+	gchar **array, **arrayp, **orig, *strp;
 
 	/* Find out how much space we need. */
 	for (len = 0, orig = *listp; *orig != NULL; ++orig)
-		len += sizeof(char *) + strlen(*orig) + 1;
-	len += sizeof(char *);
+		len += sizeof(gchar *) + strlen(*orig) + 1;
+	len += sizeof(gchar *);
 
 	/* Allocate it and set up the pointers. */
 	if ((ret = __os_umalloc(dbenv, len, &array)) != 0)
 		return (ret);
 
-	strp = (char *)(array + (orig - *listp) + 1);
+	strp = (gchar *)(array + (orig - *listp) + 1);
 
 	/* Copy the original information into the new memory. */
 	for (orig = *listp, arrayp = array; *orig != NULL; ++orig, ++arrayp) {
@@ -480,7 +480,7 @@ __usermem(dbenv, listp)
 
 static int
 __cmpfunc(p1, p2)
-	const void *p1, *p2;
+	gconstpointer p1, *p2;
 {
-	return (strcmp(*((char * const *)p1), *((char * const *)p2)));
+	return (strcmp(*((gchar * const *)p1), *((gchar * const *)p2)));
 }
diff --git a/libdb/log/log_compare.c b/libdb/log/log_compare.c
index 887ba0e..86a49eb 100644
--- a/libdb/log/log_compare.c
+++ b/libdb/log/log_compare.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -20,9 +20,9 @@ static const char revid[] = "$Id$";
  * log_compare --
  *	Compare two LSN's; return 1, 0, -1 if first is >, == or < second.
  *
- * EXTERN: int log_compare __P((const DB_LSN *, const DB_LSN *));
+ * EXTERN: gint log_compare __P((const DB_LSN *, const DB_LSN *));
  */
-int
+gint
 log_compare(lsn0, lsn1)
 	const DB_LSN *lsn0, *lsn1;
 {
diff --git a/libdb/log/log_get.c b/libdb/log/log_get.c
index faf0be1..03ae2b1 100644
--- a/libdb/log/log_get.c
+++ b/libdb/log/log_get.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,34 +26,34 @@ static const char revid[] = "$Id$";
 
 typedef enum { L_ALREADY, L_ACQUIRED, L_NONE } RLOCK;
 
-static int __log_c_close __P((DB_LOGC *, u_int32_t));
-static int __log_c_get __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
-static int __log_c_get_int __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
-static int __log_c_hdrchk __P((DB_LOGC *, HDR *, int *));
-static int __log_c_incursor __P((DB_LOGC *, DB_LSN *, HDR *, u_int8_t **));
-static int __log_c_inregion __P((DB_LOGC *,
+static gint __log_c_close __P((DB_LOGC *, u_int32_t));
+static gint __log_c_get __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
+static gint __log_c_get_int __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
+static gint __log_c_hdrchk __P((DB_LOGC *, HDR *, gint *));
+static gint __log_c_incursor __P((DB_LOGC *, DB_LSN *, HDR *, u_int8_t **));
+static gint __log_c_inregion __P((DB_LOGC *,
 	       DB_LSN *, RLOCK *, DB_LSN *, HDR *, u_int8_t **));
-static int __log_c_io __P((DB_LOGC *,
-	       u_int32_t, u_int32_t, void *, size_t *, int *));
-static int __log_c_ondisk __P((DB_LOGC *,
-	       DB_LSN *, DB_LSN *, int, HDR *, u_int8_t **, int *));
-static int __log_c_set_maxrec __P((DB_LOGC *, char *));
-static int __log_c_shortread __P((DB_LOGC *, int));
+static gint __log_c_io __P((DB_LOGC *,
+	       u_int32_t, u_int32_t, gpointer , size_t *, gint *));
+static gint __log_c_ondisk __P((DB_LOGC *,
+	       DB_LSN *, DB_LSN *, int, HDR *, u_int8_t **, gint *));
+static gint __log_c_set_maxrec __P((DB_LOGC *, gchar *));
+static gint __log_c_shortread __P((DB_LOGC *, int));
 
 /*
  * __log_cursor --
  *	Create a log cursor.
  *
- * PUBLIC: int __log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
+ * PUBLIC: gint __log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
  */
-int
+gint
 __log_cursor(dbenv, logcp, flags)
 	DB_ENV *dbenv;
 	DB_LOGC **logcp;
 	u_int32_t flags;
 {
 	DB_LOGC *logc;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -101,7 +101,7 @@ __log_c_close(logc, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	dbenv = logc->dbenv;
 
@@ -135,7 +135,7 @@ __log_c_get(logc, alsn, dbt, flags)
 {
 	DB_ENV *dbenv;
 	DB_LSN saved_lsn;
-	int ret;
+	gint ret;
 
 	dbenv = logc->dbenv;
 
@@ -228,7 +228,7 @@ __log_c_get_int(logc, alsn, dbt, flags)
 	logfile_validity status;
 	u_int32_t cnt;
 	u_int8_t *rp;
-	int eof, is_hmac, ret;
+	gint eof, is_hmac, ret;
 
 	dbenv = logc->dbenv;
 	dblp = dbenv->lg_handle;
@@ -574,7 +574,7 @@ __log_c_inregion(logc, lsn, rlockp, last_lsn, hdr, pp)
 	LOG *lp;
 	size_t len, nr;
 	u_int32_t b_disk, b_region;
-	int ret;
+	gint ret;
 	u_int8_t *p;
 
 	dbenv = logc->dbenv;
@@ -747,14 +747,14 @@ static int
 __log_c_ondisk(logc, lsn, last_lsn, flags, hdr, pp, eofp)
 	DB_LOGC *logc;
 	DB_LSN *lsn, *last_lsn;
-	int flags, *eofp;
+	gint flags, *eofp;
 	HDR *hdr;
 	u_int8_t **pp;
 {
 	DB_ENV *dbenv;
 	size_t len, nr;
 	u_int32_t offset;
-	int ret;
+	gint ret;
 
 	dbenv = logc->dbenv;
 	*eofp = 0;
@@ -877,10 +877,10 @@ static int
 __log_c_hdrchk(logc, hdr, eofp)
 	DB_LOGC *logc;
 	HDR *hdr;
-	int *eofp;
+	gint *eofp;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 
 	dbenv = logc->dbenv;
 
@@ -927,14 +927,14 @@ static int
 __log_c_io(logc, fnum, offset, p, nrp, eofp)
 	DB_LOGC *logc;
 	u_int32_t fnum, offset;
-	void *p;
+	gpointer p;
 	size_t *nrp;
-	int *eofp;
+	gint *eofp;
 {
 	DB_ENV *dbenv;
 	DB_LOG *dblp;
-	int ret;
-	char *np;
+	gint ret;
+	gchar *np;
 
 	dbenv = logc->dbenv;
 	dblp = dbenv->lg_handle;
@@ -999,7 +999,7 @@ __log_c_io(logc, fnum, offset, p, nrp, eofp)
 static int
 __log_c_shortread(logc, silent)
 	DB_LOGC *logc;
-	int silent;
+	gint silent;
 {
 	if (!silent || !F_ISSET(logc, DB_LOG_SILENT_ERR))
 		__db_err(logc->dbenv, "DB_LOGC->get: short read");
@@ -1013,13 +1013,13 @@ __log_c_shortread(logc, silent)
 static int
 __log_c_set_maxrec(logc, np)
 	DB_LOGC *logc;
-	char *np;
+	gchar *np;
 {
 	DB_ENV *dbenv;
 	DB_LOG *dblp;
 	LOG *lp;
 	u_int32_t mbytes, bytes;
-	int ret;
+	gint ret;
 
 	dbenv = logc->dbenv;
 	dblp = dbenv->lg_handle;
diff --git a/libdb/log/log_method.c b/libdb/log/log_method.c
index 96c80c8..908422d 100644
--- a/libdb/log/log_method.c
+++ b/libdb/log/log_method.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -30,10 +30,10 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_client_ext.h"
 #endif
 
-static int __log_set_lg_bsize __P((DB_ENV *, u_int32_t));
-static int __log_set_lg_dir __P((DB_ENV *, const char *));
-static int __log_set_lg_max __P((DB_ENV *, u_int32_t));
-static int __log_set_lg_regionmax __P((DB_ENV *, u_int32_t));
+static gint __log_set_lg_bsize __P((DB_ENV *, u_int32_t));
+static gint __log_set_lg_dir __P((DB_ENV *, const gchar *));
+static gint __log_set_lg_max __P((DB_ENV *, u_int32_t));
+static gint __log_set_lg_regionmax __P((DB_ENV *, u_int32_t));
 
 /*
  * __log_dbenv_create --
@@ -180,7 +180,7 @@ __log_set_lg_regionmax(dbenv, lg_regionmax)
 static int
 __log_set_lg_dir(dbenv, dir)
 	DB_ENV *dbenv;
-	const char *dir;
+	const gchar *dir;
 {
 	if (dbenv->db_log_dir != NULL)
 		__os_free(dbenv, dbenv->db_log_dir);
diff --git a/libdb/log/log_put.c b/libdb/log/log_put.c
index c4bd5e8..d8068a0 100644
--- a/libdb/log/log_put.c
+++ b/libdb/log/log_put.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -36,24 +36,24 @@ static const char revid[] = "$Id$";
 #include "dbinc/rep.h"
 #include "dbinc/txn.h"
 
-static int __log_encrypt_record __P((DB_ENV *, DBT *, HDR *, u_int32_t));
-static int __log_fill __P((DB_LOG *, DB_LSN *, void *, u_int32_t));
-static int __log_flush_commit __P((DB_ENV *, const DB_LSN *, u_int32_t));
-static int __log_flush_int __P((DB_LOG *, const DB_LSN *, int));
-static int __log_newfh __P((DB_LOG *));
-static int __log_put_next __P((DB_ENV *,
+static gint __log_encrypt_record __P((DB_ENV *, DBT *, HDR *, u_int32_t));
+static gint __log_fill __P((DB_LOG *, DB_LSN *, gpointer , u_int32_t));
+static gint __log_flush_commit __P((DB_ENV *, const DB_LSN *, u_int32_t));
+static gint __log_flush_int __P((DB_LOG *, const DB_LSN *, int));
+static gint __log_newfh __P((DB_LOG *));
+static gint __log_put_next __P((DB_ENV *,
     DB_LSN *, const DBT *, HDR *, DB_LSN *));
-static int __log_putr __P((DB_LOG *,
+static gint __log_putr __P((DB_LOG *,
     DB_LSN *, const DBT *, u_int32_t, HDR *));
-static int __log_write __P((DB_LOG *, void *, u_int32_t));
+static gint __log_write __P((DB_LOG *, gpointer , u_int32_t));
 
 /*
  * __log_put --
  *	Write a log record.  This is the public interface, DB_ENV->log_put.
  *
- * PUBLIC: int __log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
+ * PUBLIC: gint __log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
  */
-int
+gint
 __log_put(dbenv, lsnp, udbt, flags)
 	DB_ENV *dbenv;
 	DB_LSN *lsnp;
@@ -67,7 +67,7 @@ __log_put(dbenv, lsnp, udbt, flags)
 	HDR hdr;
 	LOG *lp;
 	u_int32_t do_flush, op, writeonly;
-	int lock_held, need_free, ret;
+	gint lock_held, need_free, ret;
 	u_int8_t *key;
 
 	PANIC_CHECK(dbenv);
@@ -291,7 +291,7 @@ __log_put_next(dbenv, lsn, dbt, hdr, old_lsnp)
 	DB_LOG *dblp;
 	DB_LSN old_lsn;
 	LOG *lp;
-	int newfile, ret;
+	gint newfile, ret;
 
 	dblp = dbenv->lg_handle;
 	lp = dblp->reginfo.primary;
@@ -360,7 +360,7 @@ __log_flush_commit(dbenv, lsnp, flags)
 	DB_LOG *dblp;
 	DB_LSN flush_lsn;
 	LOG *lp;
-	int ret;
+	gint ret;
 	u_int32_t op;
 
 	dblp = dbenv->lg_handle;
@@ -405,9 +405,9 @@ __log_flush_commit(dbenv, lsnp, flags)
  *	Initialize and switch to a new log file.  (Note that this is
  * called both when no log yet exists and when we fill a log file.)
  *
- * PUBLIC: int __log_newfile __P((DB_LOG *, DB_LSN *));
+ * PUBLIC: gint __log_newfile __P((DB_LOG *, DB_LSN *));
  */
-int
+gint
 __log_newfile(dblp, lsnp)
 	DB_LOG *dblp;
 	DB_LSN *lsnp;
@@ -418,7 +418,7 @@ __log_newfile(dblp, lsnp)
 	DBT t;
 	HDR hdr;
 	LOG *lp;
-	int need_free, ret;
+	gint need_free, ret;
 	u_int32_t lastoff;
 	size_t tsize;
 	u_int8_t *tmp;
@@ -520,7 +520,7 @@ __log_putr(dblp, lsn, dbt, prev, h)
 	DB_LSN f_lsn;
 	LOG *lp;
 	HDR tmp, *hdr;
-	int ret, t_ret;
+	gint ret, t_ret;
 	size_t b_off, nr;
 	u_int32_t w_off;
 
@@ -607,15 +607,15 @@ err:
  * __log_flush --
  *	Write all records less than or equal to the specified LSN.
  *
- * PUBLIC: int __log_flush __P((DB_ENV *, const DB_LSN *));
+ * PUBLIC: gint __log_flush __P((DB_ENV *, const DB_LSN *));
  */
-int
+gint
 __log_flush(dbenv, lsn)
 	DB_ENV *dbenv;
 	const DB_LSN *lsn;
 {
 	DB_LOG *dblp;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -637,13 +637,13 @@ static int
 __log_flush_int(dblp, lsnp, release)
 	DB_LOG *dblp;
 	const DB_LSN *lsnp;
-	int release;
+	gint release;
 {
 	DB_ENV *dbenv;
 	DB_LSN flush_lsn, f_lsn;
 	DB_MUTEX *flush_mutexp;
 	LOG *lp;
-	int current, do_flush, first, ret;
+	gint current, do_flush, first, ret;
 	size_t b_off;
 	struct __db_commit *commit;
 	u_int32_t ncommit, w_off;
@@ -887,13 +887,13 @@ static int
 __log_fill(dblp, lsn, addr, len)
 	DB_LOG *dblp;
 	DB_LSN *lsn;
-	void *addr;
+	gpointer addr;
 	u_int32_t len;
 {
 	LOG *lp;
 	u_int32_t bsize, nrec;
 	size_t nw, remain;
-	int ret;
+	gint ret;
 
 	lp = dblp->reginfo.primary;
 	bsize = lp->buffer_size;
@@ -948,13 +948,13 @@ __log_fill(dblp, lsn, addr, len)
 static int
 __log_write(dblp, addr, len)
 	DB_LOG *dblp;
-	void *addr;
+	gpointer addr;
 	u_int32_t len;
 {
 	DB_ENV *dbenv;
 	LOG *lp;
 	size_t nw;
-	int ret;
+	gint ret;
 
 	dbenv = dblp->dbenv;
 	lp = dblp->reginfo.primary;
@@ -998,18 +998,18 @@ __log_write(dblp, addr, len)
  * __log_file --
  *	Map a DB_LSN to a file name.
  *
- * PUBLIC: int __log_file __P((DB_ENV *, const DB_LSN *, char *, size_t));
+ * PUBLIC: gint __log_file __P((DB_ENV *, const DB_LSN *, gchar *, size_t));
  */
-int
+gint
 __log_file(dbenv, lsn, namep, len)
 	DB_ENV *dbenv;
 	const DB_LSN *lsn;
-	char *namep;
+	gchar *namep;
 	size_t len;
 {
 	DB_LOG *dblp;
-	int ret;
-	char *name;
+	gint ret;
+	gchar *name;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -1044,8 +1044,8 @@ __log_newfh(dblp)
 {
 	DB_ENV *dbenv;
 	LOG *lp;
-	int ret;
-	char *name;
+	gint ret;
+	gchar *name;
 
 	dbenv = dblp->dbenv;
 	lp = dblp->reginfo.primary;
@@ -1085,21 +1085,21 @@ __log_newfh(dblp)
  * __log_name --
  *	Return the log name for a particular file, and optionally open it.
  *
- * PUBLIC: int __log_name __P((DB_LOG *,
- * PUBLIC:     u_int32_t, char **, DB_FH *, u_int32_t));
+ * PUBLIC: gint __log_name __P((DB_LOG *,
+ * PUBLIC:     u_int32_t, gchar **, DB_FH *, u_int32_t));
  */
-int
+gint
 __log_name(dblp, filenumber, namep, fhp, flags)
 	DB_LOG *dblp;
 	u_int32_t filenumber, flags;
-	char **namep;
+	gchar **namep;
 	DB_FH *fhp;
 {
 	DB_ENV *dbenv;
 	LOG *lp;
-	int ret;
-	char *oname;
-	char old[sizeof(LFPREFIX) + 5 + 20], new[sizeof(LFPREFIX) + 10 + 20];
+	gint ret;
+	gchar *oname;
+	gchar old[sizeof(LFPREFIX) + 5 + 20], new[sizeof(LFPREFIX) + 10 + 20];
 
 	dbenv = dblp->dbenv;
 	lp = dblp->reginfo.primary;
@@ -1180,9 +1180,9 @@ err:	__os_free(dbenv, oname);
  *
  * Note that the log region mutex should be held when this is called.
  *
- * PUBLIC: int __log_rep_put __P((DB_ENV *, DB_LSN *, const DBT *));
+ * PUBLIC: gint __log_rep_put __P((DB_ENV *, DB_LSN *, const DBT *));
  */
-int
+gint
 __log_rep_put(dbenv, lsnp, rec)
 	DB_ENV *dbenv;
 	DB_LSN *lsnp;
@@ -1193,7 +1193,7 @@ __log_rep_put(dbenv, lsnp, rec)
 	HDR hdr;
 	DBT *dbt, t;
 	LOG *lp;
-	int need_free, ret;
+	gint need_free, ret;
 
 	dblp = dbenv->lg_handle;
 	lp = dblp->reginfo.primary;
@@ -1231,7 +1231,7 @@ __log_encrypt_record(dbenv, dbt, hdr, orig)
 	u_int32_t orig;
 {
 	DB_CIPHER *db_cipher;
-	int ret;
+	gint ret;
 
 	if (CRYPTO_ON(dbenv)) {
 		db_cipher = (DB_CIPHER *)dbenv->crypto_handle;
diff --git a/libdb/mp/mp_alloc.c b/libdb/mp/mp_alloc.c
index 3672150..d3ac85b 100644
--- a/libdb/mp/mp_alloc.c
+++ b/libdb/mp/mp_alloc.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -31,17 +31,17 @@ static void __memp_reset_lru __P((DB_ENV *, REGINFO *, MPOOL *));
  * __memp_alloc --
  *	Allocate some space from a cache region.
  *
- * PUBLIC: int __memp_alloc __P((DB_MPOOL *,
- * PUBLIC:     REGINFO *, MPOOLFILE *, size_t, roff_t *, void *));
+ * PUBLIC: gint __memp_alloc __P((DB_MPOOL *,
+ * PUBLIC:     REGINFO *, MPOOLFILE *, size_t, roff_t *, gpointer ));
  */
-int
+gint
 __memp_alloc(dbmp, memreg, mfp, len, offsetp, retp)
 	DB_MPOOL *dbmp;
 	REGINFO *memreg;
 	MPOOLFILE *mfp;
 	size_t len;
 	roff_t *offsetp;
-	void *retp;
+	gpointer retp;
 {
 	BH *bhp;
 	DB_ENV *dbenv;
@@ -51,8 +51,8 @@ __memp_alloc(dbmp, memreg, mfp, len, offsetp, retp)
 	MPOOLFILE *bh_mfp;
 	size_t freed_space;
 	u_int32_t buckets, buffers, high_priority, max_na, priority;
-	int aggressive, ret;
-	void *p;
+	gint aggressive, ret;
+	gpointer p;
 
 	dbenv = dbmp->dbenv;
 	c_mp = memreg->primary;
@@ -112,7 +112,7 @@ alloc:	if ((ret = __db_shalloc(memreg->addr, len, MUTEX_ALIGN, &p)) == 0) {
 
 found:		if (offsetp != NULL)
 			*offsetp = R_OFFSET(memreg, p);
-		*(void **)retp = p;
+		*(gpointer *)retp = p;
 
 		/*
 		 * Update the search statistics.
@@ -374,7 +374,7 @@ __memp_reset_lru(dbenv, memreg, c_mp)
 {
 	BH *bhp;
 	DB_MPOOL_HASH *hp;
-	int bucket;
+	gint bucket;
 
 	/*
 	 * Update the counter so all future allocations will start at the
diff --git a/libdb/mp/mp_bh.c b/libdb/mp/mp_bh.c
index 34df0a8..e730f7d 100644
--- a/libdb/mp/mp_bh.c
+++ b/libdb/mp/mp_bh.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,29 +23,29 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/db_page.h"
 
-static int __memp_pgwrite
+static gint __memp_pgwrite
 	   __P((DB_MPOOL *, DB_MPOOLFILE *, DB_MPOOL_HASH *, BH *));
-static int __memp_upgrade __P((DB_MPOOL *, DB_MPOOLFILE *, MPOOLFILE *));
+static gint __memp_upgrade __P((DB_MPOOL *, DB_MPOOLFILE *, MPOOLFILE *));
 
 /*
  * __memp_bhwrite --
  *	Write the page associated with a given buffer header.
  *
- * PUBLIC: int __memp_bhwrite __P((DB_MPOOL *,
+ * PUBLIC: gint __memp_bhwrite __P((DB_MPOOL *,
  * PUBLIC:      DB_MPOOL_HASH *, MPOOLFILE *, BH *, int));
  */
-int
+gint
 __memp_bhwrite(dbmp, hp, mfp, bhp, open_extents)
 	DB_MPOOL *dbmp;
 	DB_MPOOL_HASH *hp;
 	MPOOLFILE *mfp;
 	BH *bhp;
-	int open_extents;
+	gint open_extents;
 {
 	DB_ENV *dbenv;
 	DB_MPOOLFILE *dbmfp;
 	DB_MPREG *mpreg;
-	int local_open, incremented, ret;
+	gint local_open, incremented, ret;
 
 	dbenv = dbmp->dbenv;
 	local_open = incremented = 0;
@@ -173,21 +173,21 @@ found:	ret = __memp_pgwrite(dbmp, dbmfp, hp, bhp);
  * __memp_pgread --
  *	Read a page from a file.
  *
- * PUBLIC: int __memp_pgread __P((DB_MPOOLFILE *, DB_MUTEX *, BH *, int));
+ * PUBLIC: gint __memp_pgread __P((DB_MPOOLFILE *, DB_MUTEX *, BH *, int));
  */
-int
+gint
 __memp_pgread(dbmfp, mutexp, bhp, can_create)
 	DB_MPOOLFILE *dbmfp;
 	DB_MUTEX *mutexp;
 	BH *bhp;
-	int can_create;
+	gint can_create;
 {
 	DB_IO db_io;
 	DB_ENV *dbenv;
 	DB_MPOOL *dbmp;
 	MPOOLFILE *mfp;
 	size_t len, nr, pagesize;
-	int ret;
+	gint ret;
 
 	dbmp = dbmfp->dbmp;
 	dbenv = dbmp->dbenv;
@@ -286,7 +286,7 @@ __memp_pgwrite(dbmp, dbmfp, hp, bhp)
 	DB_LSN lsn;
 	MPOOLFILE *mfp;
 	size_t nw;
-	int callpgin, ret;
+	gint callpgin, ret;
 
 	dbenv = dbmp->dbenv;
 	mfp = dbmfp == NULL ? NULL : dbmfp->mfp;
@@ -447,20 +447,20 @@ file_dead:
  * __memp_pg --
  *	Call the pgin/pgout routine.
  *
- * PUBLIC: int __memp_pg __P((DB_MPOOLFILE *, BH *, int));
+ * PUBLIC: gint __memp_pg __P((DB_MPOOLFILE *, BH *, int));
  */
-int
+gint
 __memp_pg(dbmfp, bhp, is_pgin)
 	DB_MPOOLFILE *dbmfp;
 	BH *bhp;
-	int is_pgin;
+	gint is_pgin;
 {
 	DBT dbt, *dbtp;
 	DB_ENV *dbenv;
 	DB_MPOOL *dbmp;
 	DB_MPREG *mpreg;
 	MPOOLFILE *mfp;
-	int ftype, ret;
+	gint ftype, ret;
 
 	dbmp = dbmfp->dbmp;
 	dbenv = dbmp->dbenv;
@@ -517,7 +517,7 @@ __memp_bhfree(dbmp, hp, bhp, free_mem)
 	DB_MPOOL *dbmp;
 	DB_MPOOL_HASH *hp;
 	BH *bhp;
-	int free_mem;
+	gint free_mem;
 {
 	DB_ENV *dbenv;
 	MPOOL *c_mp, *mp;
@@ -591,8 +591,8 @@ __memp_upgrade(dbmp, dbmfp, mfp)
 {
 	DB_ENV *dbenv;
 	DB_FH *fhp, *tfhp;
-	int ret;
-	char *rpath;
+	gint ret;
+	gchar *rpath;
 
 	dbenv = dbmp->dbenv;
 	fhp = NULL;
diff --git a/libdb/mp/mp_fget.c b/libdb/mp/mp_fget.c
index 0e1346e..ddcfdac 100644
--- a/libdb/mp/mp_fget.c
+++ b/libdb/mp/mp_fget.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,7 +21,7 @@ static const char revid[] = "$Id$";
 #include "dbinc/mp.h"
 
 #ifdef HAVE_FILESYSTEM_NOTZERO
-static int __memp_fs_notzero
+static gint __memp_fs_notzero
     __P((DB_ENV *, DB_MPOOLFILE *, MPOOLFILE *, db_pgno_t *));
 #endif
 
@@ -29,15 +29,15 @@ static int __memp_fs_notzero
  * __memp_fget --
  *	Get a page from the file.
  *
- * PUBLIC: int __memp_fget
- * PUBLIC:     __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *));
+ * PUBLIC: gint __memp_fget
+ * PUBLIC:     __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, gpointer ));
  */
-int
+gint
 __memp_fget(dbmfp, pgnoaddr, flags, addrp)
 	DB_MPOOLFILE *dbmfp;
 	db_pgno_t *pgnoaddr;
 	u_int32_t flags;
-	void *addrp;
+	gpointer addrp;
 {
 	enum { FIRST_FOUND, FIRST_MISS, SECOND_FOUND, SECOND_MISS } state;
 	BH *alloc_bhp, *bhp;
@@ -48,9 +48,9 @@ __memp_fget(dbmfp, pgnoaddr, flags, addrp)
 	MPOOLFILE *mfp;
 	roff_t mf_offset;
 	u_int32_t n_cache, st_hsearch;
-	int b_incr, extending, first, ret;
+	gint b_incr, extending, first, ret;
 
-	*(void **)addrp = NULL;
+	*(gpointer *)addrp = NULL;
 
 	dbmp = dbmfp->dbmp;
 	dbenv = dbmp->dbenv;
@@ -128,7 +128,7 @@ __memp_fget(dbmfp, pgnoaddr, flags, addrp)
 	 */
 	if (dbmfp->addr != NULL &&
 	    F_ISSET(mfp, MP_CAN_MMAP) && *pgnoaddr <= mfp->orig_last_pgno) {
-		*(void **)addrp =
+		*(gpointer *)addrp =
 		    R_ADDR(dbmfp, *pgnoaddr * mfp->stat.st_pagesize);
 		++mfp->stat.st_map;
 		return (0);
@@ -557,7 +557,7 @@ alloc:		/*
 		__os_yield(dbenv, 1);
 #endif
 
-	*(void **)addrp = bhp->buf;
+	*(gpointer *)addrp = bhp->buf;
 	return (0);
 
 err:	/*
@@ -596,9 +596,9 @@ __memp_fs_notzero(dbenv, dbmfp, mfp, pgnoaddr)
 	DB_IO db_io;
 	u_int32_t i, npages;
 	size_t nw;
-	int ret;
+	gint ret;
 	u_int8_t *page;
-	char *fail;
+	gchar *fail;
 
 	/*
 	 * Pages allocated by writing pages past end-of-file are not zeroed,
diff --git a/libdb/mp/mp_fopen.c b/libdb/mp/mp_fopen.c
index 0b9a8b2..65c3d50 100644
--- a/libdb/mp/mp_fopen.c
+++ b/libdb/mp/mp_fopen.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -20,18 +20,18 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_shash.h"
 #include "dbinc/mp.h"
 
-static int  __memp_fclose __P((DB_MPOOLFILE *, u_int32_t));
-static int  __memp_fopen __P((DB_MPOOLFILE *,
-		const char *, u_int32_t, int, size_t));
+static gint  __memp_fclose __P((DB_MPOOLFILE *, u_int32_t));
+static gint  __memp_fopen __P((DB_MPOOLFILE *,
+		const gchar *, u_int32_t, int, size_t));
 static void __memp_get_fileid __P((DB_MPOOLFILE *, u_int8_t *));
 static void __memp_last_pgno __P((DB_MPOOLFILE *, db_pgno_t *));
 static void __memp_refcnt __P((DB_MPOOLFILE *, db_pgno_t *));
-static int  __memp_set_clear_len __P((DB_MPOOLFILE *, u_int32_t));
-static int  __memp_set_fileid __P((DB_MPOOLFILE *, u_int8_t *));
-static int  __memp_set_ftype __P((DB_MPOOLFILE *, int));
-static int  __memp_set_lsn_offset __P((DB_MPOOLFILE *, int32_t));
-static int  __memp_set_pgcookie __P((DB_MPOOLFILE *, DBT *));
-static int  __memp_set_priority __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
+static gint  __memp_set_clear_len __P((DB_MPOOLFILE *, u_int32_t));
+static gint  __memp_set_fileid __P((DB_MPOOLFILE *, u_int8_t *));
+static gint  __memp_set_ftype __P((DB_MPOOLFILE *, int));
+static gint  __memp_set_lsn_offset __P((DB_MPOOLFILE *, int32_t));
+static gint  __memp_set_pgcookie __P((DB_MPOOLFILE *, DBT *));
+static gint  __memp_set_priority __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
 static void __memp_set_unlink __P((DB_MPOOLFILE *, int));
 
 /* Initialization methods cannot be called after open is called. */
@@ -43,9 +43,9 @@ static void __memp_set_unlink __P((DB_MPOOLFILE *, int));
  * __memp_fcreate --
  *	Create a DB_MPOOLFILE handle.
  *
- * PUBLIC: int __memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
+ * PUBLIC: gint __memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
  */
-int
+gint
 __memp_fcreate(dbenv, retp, flags)
 	DB_ENV *dbenv;
 	DB_MPOOLFILE **retp;
@@ -53,7 +53,7 @@ __memp_fcreate(dbenv, retp, flags)
 {
 	DB_MPOOL *dbmp;
 	DB_MPOOLFILE *dbmfp;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -152,7 +152,7 @@ __memp_set_fileid(dbmfp, fileid)
 static int
 __memp_set_ftype(dbmfp, ftype)
 	DB_MPOOLFILE *dbmfp;
-	int ftype;
+	gint ftype;
 {
 	MPF_ILLEGAL_AFTER_OPEN(dbmfp, "set_ftype");
 
@@ -231,14 +231,14 @@ __memp_set_priority(dbmfp, priority)
 static int
 __memp_fopen(dbmfp, path, flags, mode, pagesize)
 	DB_MPOOLFILE *dbmfp;
-	const char *path;
+	const gchar *path;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 	size_t pagesize;
 {
 	DB_ENV *dbenv;
 	DB_MPOOL *dbmp;
-	int ret;
+	gint ret;
 
 	dbmp = dbmfp->dbmp;
 	dbenv = dbmp->dbenv;
@@ -280,16 +280,16 @@ __memp_fopen(dbmfp, path, flags, mode, pagesize)
  * __memp_fopen_int --
  *	Open a backing file for the memory pool; internal version.
  *
- * PUBLIC: int __memp_fopen_int __P((DB_MPOOLFILE *,
- * PUBLIC:     MPOOLFILE *, const char *, u_int32_t, int, size_t));
+ * PUBLIC: gint __memp_fopen_int __P((DB_MPOOLFILE *,
+ * PUBLIC:     MPOOLFILE *, const gchar *, u_int32_t, int, size_t));
  */
-int
+gint
 __memp_fopen_int(dbmfp, mfp, path, flags, mode, pagesize)
 	DB_MPOOLFILE *dbmfp;
 	MPOOLFILE *mfp;
-	const char *path;
+	const gchar *path;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 	size_t pagesize;
 {
 	DB_ENV *dbenv;
@@ -298,10 +298,10 @@ __memp_fopen_int(dbmfp, mfp, path, flags, mode, pagesize)
 	db_pgno_t last_pgno;
 	size_t maxmap;
 	u_int32_t mbytes, bytes, oflags;
-	int mfp_alloc, ret;
+	gint mfp_alloc, ret;
 	u_int8_t idbuf[DB_FILE_ID_LEN];
-	char *rpath;
-	void *p;
+	gchar *rpath;
+	gpointer p;
 
 	dbmp = dbmfp->dbmp;
 	dbenv = dbmp->dbenv;
@@ -722,7 +722,7 @@ __memp_refcnt(dbmfp, cntp)
 static void
 __memp_set_unlink(dbmpf, set)
 	DB_MPOOLFILE *dbmpf;
-	int set;
+	gint set;
 {
 	DB_ENV *dbenv;
 
@@ -746,7 +746,7 @@ __memp_fclose(dbmfp, flags)
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbenv = dbmfp->dbmp->dbenv;
 
@@ -768,9 +768,9 @@ __memp_fclose(dbmfp, flags)
  * __memp_fclose_int --
  *	Internal version of __memp_fclose.
  *
- * PUBLIC: int __memp_fclose_int __P((DB_MPOOLFILE *, u_int32_t));
+ * PUBLIC: gint __memp_fclose_int __P((DB_MPOOLFILE *, u_int32_t));
  */
-int
+gint
 __memp_fclose_int(dbmfp, flags)
 	DB_MPOOLFILE *dbmfp;
 	u_int32_t flags;
@@ -778,8 +778,8 @@ __memp_fclose_int(dbmfp, flags)
 	DB_ENV *dbenv;
 	DB_MPOOL *dbmp;
 	MPOOLFILE *mfp;
-	char *rpath;
-	int deleted, ret, t_ret;
+	gchar *rpath;
+	gint deleted, ret, t_ret;
 
 	dbmp = dbmfp->dbmp;
 	dbenv = dbmp->dbenv;
@@ -906,9 +906,9 @@ done:	__os_free(dbenv, dbmfp->fhp);
  * __memp_mf_discard --
  *	Discard an MPOOLFILE.
  *
- * PUBLIC: int __memp_mf_discard __P((DB_MPOOL *, MPOOLFILE *));
+ * PUBLIC: gint __memp_mf_discard __P((DB_MPOOL *, MPOOLFILE *));
  */
-int
+gint
 __memp_mf_discard(dbmp, mfp)
 	DB_MPOOL *dbmp;
 	MPOOLFILE *mfp;
@@ -917,8 +917,8 @@ __memp_mf_discard(dbmp, mfp)
 	DB_FH fh;
 	DB_MPOOL_STAT *sp;
 	MPOOL *mp;
-	char *rpath;
-	int ret;
+	gchar *rpath;
+	gint ret;
 
 	dbenv = dbmp->dbenv;
 	mp = dbmp->reginfo[0].primary;
@@ -990,9 +990,9 @@ __memp_mf_discard(dbmp, mfp)
  * __memp_fn --
  *	On errors we print whatever is available as the file name.
  *
- * PUBLIC: char * __memp_fn __P((DB_MPOOLFILE *));
+ * PUBLIC: gchar * __memp_fn __P((DB_MPOOLFILE *));
  */
-char *
+gchar *
 __memp_fn(dbmfp)
 	DB_MPOOLFILE *dbmfp;
 {
@@ -1003,16 +1003,16 @@ __memp_fn(dbmfp)
  * __memp_fns --
  *	On errors we print whatever is available as the file name.
  *
- * PUBLIC: char * __memp_fns __P((DB_MPOOL *, MPOOLFILE *));
+ * PUBLIC: gchar * __memp_fns __P((DB_MPOOL *, MPOOLFILE *));
  *
  */
-char *
+gchar *
 __memp_fns(dbmp, mfp)
 	DB_MPOOL *dbmp;
 	MPOOLFILE *mfp;
 {
 	if (mfp->path_off == 0)
-		return ((char *)"temporary");
+		return ((gchar *)"temporary");
 
-	return ((char *)R_ADDR(dbmp->reginfo, mfp->path_off));
+	return ((gchar *)R_ADDR(dbmp->reginfo, mfp->path_off));
 }
diff --git a/libdb/mp/mp_fput.c b/libdb/mp/mp_fput.c
index 64cda27..8401452 100644
--- a/libdb/mp/mp_fput.c
+++ b/libdb/mp/mp_fput.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,12 +23,12 @@ static const char revid[] = "$Id$";
  * __memp_fput --
  *	Mpool file put function.
  *
- * PUBLIC: int __memp_fput __P((DB_MPOOLFILE *, void *, u_int32_t));
+ * PUBLIC: gint __memp_fput __P((DB_MPOOLFILE *, gpointer , u_int32_t));
  */
-int
+gint
 __memp_fput(dbmfp, pgaddr, flags)
 	DB_MPOOLFILE *dbmfp;
-	void *pgaddr;
+	gpointer pgaddr;
 	u_int32_t flags;
 {
 	BH *argbhp, *bhp, *prev;
@@ -37,7 +37,7 @@ __memp_fput(dbmfp, pgaddr, flags)
 	DB_MPOOL_HASH *hp;
 	MPOOL *c_mp;
 	u_int32_t n_cache;
-	int adjust, ret;
+	gint adjust, ret;
 
 	dbmp = dbmfp->dbmp;
 	dbenv = dbmp->dbenv;
diff --git a/libdb/mp/mp_fset.c b/libdb/mp/mp_fset.c
index a8e012d..9265dd6 100644
--- a/libdb/mp/mp_fset.c
+++ b/libdb/mp/mp_fset.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,12 +23,12 @@ static const char revid[] = "$Id$";
  * __memp_fset --
  *	Mpool page set-flag routine.
  *
- * PUBLIC: int __memp_fset __P((DB_MPOOLFILE *, void *, u_int32_t));
+ * PUBLIC: gint __memp_fset __P((DB_MPOOLFILE *, gpointer , u_int32_t));
  */
-int
+gint
 __memp_fset(dbmfp, pgaddr, flags)
 	DB_MPOOLFILE *dbmfp;
-	void *pgaddr;
+	gpointer pgaddr;
 	u_int32_t flags;
 {
 	BH *bhp;
@@ -37,7 +37,7 @@ __memp_fset(dbmfp, pgaddr, flags)
 	DB_MPOOL_HASH *hp;
 	MPOOL *c_mp;
 	u_int32_t n_cache;
-	int ret;
+	gint ret;
 
 	dbmp = dbmfp->dbmp;
 	dbenv = dbmp->dbenv;
diff --git a/libdb/mp/mp_method.c b/libdb/mp/mp_method.c
index 0a78d5e..ecb7ab7 100644
--- a/libdb/mp/mp_method.c
+++ b/libdb/mp/mp_method.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,8 +27,8 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_client_ext.h"
 #endif
 
-static int __memp_set_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
-static int __memp_set_mp_mmapsize __P((DB_ENV *, size_t));
+static gint __memp_set_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
+static gint __memp_set_mp_mmapsize __P((DB_ENV *, size_t));
 
 /*
  * __memp_dbenv_create --
@@ -91,7 +91,7 @@ static int
 __memp_set_cachesize(dbenv, gbytes, bytes, ncache)
 	DB_ENV *dbenv;
 	u_int32_t gbytes, bytes;
-	int ncache;
+	gint ncache;
 {
 	ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_cachesize");
 
diff --git a/libdb/mp/mp_region.c b/libdb/mp/mp_region.c
index fd0299a..d0c1c7a 100644
--- a/libdb/mp/mp_region.c
+++ b/libdb/mp/mp_region.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -20,7 +20,7 @@ static const char revid[] = "$Id$";
 #include "dbinc/db_shash.h"
 #include "dbinc/mp.h"
 
-static int __mpool_init __P((DB_ENV *, DB_MPOOL *, int, int));
+static gint __mpool_init __P((DB_ENV *, DB_MPOOL *, int, int));
 #ifdef HAVE_MUTEX_SYSTEM_RESOURCES
 static size_t __mpool_region_maint __P((REGINFO *));
 #endif
@@ -29,9 +29,9 @@ static size_t __mpool_region_maint __P((REGINFO *));
  * __memp_open --
  *	Internal version of memp_open: only called from DB_ENV->open.
  *
- * PUBLIC: int __memp_open __P((DB_ENV *));
+ * PUBLIC: gint __memp_open __P((DB_ENV *));
  */
-int
+gint
 __memp_open(dbenv)
 	DB_ENV *dbenv;
 {
@@ -40,7 +40,7 @@ __memp_open(dbenv)
 	REGINFO reginfo;
 	roff_t reg_size, *regids;
 	u_int32_t i;
-	int htab_buckets, ret;
+	gint htab_buckets, ret;
 
 	/* Figure out how big each cache region is. */
 	reg_size = (dbenv->mp_gbytes / dbenv->mp_ncache) * GIGABYTE;
@@ -204,7 +204,7 @@ static int
 __mpool_init(dbenv, dbmp, reginfo_off, htab_buckets)
 	DB_ENV *dbenv;
 	DB_MPOOL *dbmp;
-	int reginfo_off, htab_buckets;
+	gint reginfo_off, htab_buckets;
 {
 	DB_MPOOL_HASH *htab;
 	MPOOL *mp;
@@ -212,8 +212,8 @@ __mpool_init(dbenv, dbmp, reginfo_off, htab_buckets)
 #ifdef HAVE_MUTEX_SYSTEM_RESOURCES
 	size_t maint_size;
 #endif
-	int i, ret;
-	void *p;
+	gint i, ret;
+	gpointer p;
 
 	mp = NULL;
 
@@ -278,9 +278,9 @@ mem_err:__db_err(dbenv, "Unable to allocate memory for mpool region");
  * __memp_dbenv_refresh --
  *	Clean up after the mpool system on a close or failed open.
  *
- * PUBLIC: int __memp_dbenv_refresh __P((DB_ENV *));
+ * PUBLIC: gint __memp_dbenv_refresh __P((DB_ENV *));
  */
-int
+gint
 __memp_dbenv_refresh(dbenv)
 	DB_ENV *dbenv;
 {
@@ -288,7 +288,7 @@ __memp_dbenv_refresh(dbenv)
 	DB_MPOOLFILE *dbmfp;
 	DB_MPREG *mpreg;
 	u_int32_t i;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 	dbmp = dbenv->mp_handle;
@@ -332,7 +332,7 @@ __mpool_region_maint(infop)
 	REGINFO *infop;
 {
 	size_t s;
-	int numlocks;
+	gint numlocks;
 
 	/*
 	 * For mutex maintenance we need one mutex per possible page.
@@ -369,24 +369,24 @@ __mpool_region_destroy(dbenv, infop)
  * __memp_nameop
  *	Remove or rename a file in the pool.
  *
- * PUBLIC: int  __memp_nameop __P((DB_ENV *,
- * PUBLIC:     u_int8_t *, const char *, const char *, const char *));
+ * PUBLIC: gint  __memp_nameop __P((DB_ENV *,
+ * PUBLIC:     u_int8_t *, const gchar *, const gchar *, const gchar *));
  *
  * XXX
  * Undocumented interface: DB private.
  */
-int
+gint
 __memp_nameop(dbenv, fileid, newname, fullold, fullnew)
 	DB_ENV *dbenv;
 	u_int8_t *fileid;
-	const char *newname, *fullold, *fullnew;
+	const gchar *newname, *fullold, *fullnew;
 {
 	DB_MPOOL *dbmp;
 	MPOOL *mp;
 	MPOOLFILE *mfp;
 	roff_t newname_off;
-	int locked, ret;
-	void *p;
+	gint locked, ret;
+	gpointer p;
 
 	locked = 0;
 	dbmp = NULL;
diff --git a/libdb/mp/mp_register.c b/libdb/mp/mp_register.c
index 89b6b60..b58d1b3 100644
--- a/libdb/mp/mp_register.c
+++ b/libdb/mp/mp_register.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -22,20 +22,20 @@ static const char revid[] = "$Id$";
  * memp_register --
  *	Register a file type's pgin, pgout routines.
  *
- * PUBLIC: int __memp_register __P((DB_ENV *, int,
- * PUBLIC:     int (*)(DB_ENV *, db_pgno_t, void *, DBT *),
- * PUBLIC:     int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
+ * PUBLIC: gint __memp_register __P((DB_ENV *, int,
+ * PUBLIC:     gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *),
+ * PUBLIC:     gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *)));
  */
-int
+gint
 __memp_register(dbenv, ftype, pgin, pgout)
 	DB_ENV *dbenv;
-	int ftype;
-	int (*pgin) __P((DB_ENV *, db_pgno_t, void *, DBT *));
-	int (*pgout) __P((DB_ENV *, db_pgno_t, void *, DBT *));
+	gint ftype;
+	gint (*pgin) __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
+	gint (*pgout) __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
 {
 	DB_MPOOL *dbmp;
 	DB_MPREG *mpreg;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
diff --git a/libdb/mp/mp_stat.c b/libdb/mp/mp_stat.c
index 23779b3..55530f2 100644
--- a/libdb/mp/mp_stat.c
+++ b/libdb/mp/mp_stat.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -33,10 +33,10 @@ static void __memp_stat_wait __P((REGINFO *, MPOOL *, DB_MPOOL_STAT *, int));
  * __memp_stat --
  *	Display MPOOL statistics.
  *
- * PUBLIC: int __memp_stat
+ * PUBLIC: gint __memp_stat
  * PUBLIC:     __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
  */
-int
+gint
 __memp_stat(dbenv, gspp, fspp, flags)
 	DB_ENV *dbenv;
 	DB_MPOOL_STAT **gspp;
@@ -50,8 +50,8 @@ __memp_stat(dbenv, gspp, fspp, flags)
 	MPOOLFILE *mfp;
 	size_t len, nlen, pagesize;
 	u_int32_t pages, i;
-	int ret;
-	char *name, *tname;
+	gint ret;
+	gchar *name, *tname;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -200,7 +200,7 @@ __memp_stat(dbenv, gspp, fspp, flags)
 		 */
 		tfsp = *fspp;
 		tstruct = (DB_MPOOL_FSTAT *)(tfsp + i + 1);
-		tname = (char *)(tstruct + i);
+		tname = (gchar *)(tstruct + i);
 
 		/*
 		 * Files may have been opened since we counted, don't walk
@@ -240,12 +240,12 @@ __memp_stat(dbenv, gspp, fspp, flags)
  * __memp_dump_region --
  *	Display MPOOL structures.
  *
- * PUBLIC: int __memp_dump_region __P((DB_ENV *, char *, FILE *));
+ * PUBLIC: gint __memp_dump_region __P((DB_ENV *, gchar *, FILE *));
  */
-int
+gint
 __memp_dump_region(dbenv, area, fp)
 	DB_ENV *dbenv;
-	char *area;
+	gchar *area;
 	FILE *fp;
 {
 	static const FN fn[] = {
@@ -263,7 +263,7 @@ __memp_dump_region(dbenv, area, fp)
 	MPOOLFILE *mfp;
 	size_t fmap[FMAP_ENTRIES + 1];
 	u_int32_t i, flags;
-	int cnt;
+	gint cnt;
 	u_int8_t *p;
 
 	PANIC_CHECK(dbenv);
@@ -363,7 +363,7 @@ __memp_dumpcache(dbenv, dbmp, reginfo, fmap, fp, flags)
 	BH *bhp;
 	DB_MPOOL_HASH *hp;
 	MPOOL *c_mp;
-	int bucket;
+	gint bucket;
 
 	c_mp = reginfo->primary;
 
@@ -413,7 +413,7 @@ __memp_pbh(dbmp, bhp, fmap, fp)
 		{ BH_TRASH,		"trash" },
 		{ 0,			NULL }
 	};
-	int i;
+	gint i;
 
 	for (i = 0; i < FMAP_ENTRIES; ++i)
 		if (fmap[i] == INVALID_ROFF || fmap[i] == bhp->mf_offset)
@@ -451,7 +451,7 @@ __memp_stat_hash(reginfo, mp, dirtyp)
 {
 	DB_MPOOL_HASH *hp;
 	u_int32_t dirty;
-	int i;
+	gint i;
 
 	hp = R_ADDR(reginfo, mp->htab);
 	for (i = 0, dirty = 0; i < mp->htab_buckets; i++, hp++)
@@ -468,11 +468,11 @@ __memp_stat_wait(reginfo, mp, mstat, flags)
 	REGINFO *reginfo;
 	MPOOL *mp;
 	DB_MPOOL_STAT *mstat;
-	int flags;
+	gint flags;
 {
 	DB_MPOOL_HASH *hp;
 	DB_MUTEX *mutexp;
-	int i;
+	gint i;
 
 	mstat->st_hash_max_wait = 0;
 	hp = R_ADDR(reginfo, mp->htab);
diff --git a/libdb/mp/mp_sync.c b/libdb/mp/mp_sync.c
index 0ffc1cc..6503b89 100644
--- a/libdb/mp/mp_sync.c
+++ b/libdb/mp/mp_sync.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,24 +27,24 @@ typedef struct {
 	db_pgno_t track_pgno;		/* Page number. */
 } BH_TRACK;
 
-static int __bhcmp __P((const void *, const void *));
-static int __memp_close_flush_files __P((DB_ENV *, DB_MPOOL *));
-static int __memp_sync_files __P((DB_ENV *, DB_MPOOL *));
+static gint __bhcmp __P((gconstpointer , gconstpointer ));
+static gint __memp_close_flush_files __P((DB_ENV *, DB_MPOOL *));
+static gint __memp_sync_files __P((DB_ENV *, DB_MPOOL *));
 
 /*
  * __memp_sync --
  *	Mpool sync function.
  *
- * PUBLIC: int __memp_sync __P((DB_ENV *, DB_LSN *));
+ * PUBLIC: gint __memp_sync __P((DB_ENV *, DB_LSN *));
  */
-int
+gint
 __memp_sync(dbenv, lsnp)
 	DB_ENV *dbenv;
 	DB_LSN *lsnp;
 {
 	DB_MPOOL *dbmp;
 	MPOOL *mp;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -90,9 +90,9 @@ __memp_sync(dbenv, lsnp)
  * __memp_fsync --
  *	Mpool file sync function.
  *
- * PUBLIC: int __memp_fsync __P((DB_MPOOLFILE *));
+ * PUBLIC: gint __memp_fsync __P((DB_MPOOLFILE *));
  */
-int
+gint
 __memp_fsync(dbmfp)
 	DB_MPOOLFILE *dbmfp;
 {
@@ -122,9 +122,9 @@ __memp_fsync(dbmfp)
  * __mp_xxx_fh --
  *	Return a file descriptor for DB 1.85 compatibility locking.
  *
- * PUBLIC: int __mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **));
+ * PUBLIC: gint __mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **));
  */
-int
+gint
 __mp_xxx_fh(dbmfp, fhp)
 	DB_MPOOLFILE *dbmfp;
 	DB_FH **fhp;
@@ -156,14 +156,14 @@ __mp_xxx_fh(dbmfp, fhp)
  * __memp_sync_int --
  *	Mpool sync internal function.
  *
- * PUBLIC: int __memp_sync_int
- * PUBLIC:     __P((DB_ENV *, DB_MPOOLFILE *, int, db_sync_op, int *));
+ * PUBLIC: gint __memp_sync_int
+ * PUBLIC:     __P((DB_ENV *, DB_MPOOLFILE *, int, db_sync_op, gint *));
  */
-int
+gint
 __memp_sync_int(dbenv, dbmfp, ar_max, op, wrotep)
 	DB_ENV *dbenv;
 	DB_MPOOLFILE *dbmfp;
-	int ar_max, *wrotep;
+	gint ar_max, *wrotep;
 	db_sync_op op;
 {
 	BH *bhp;
@@ -174,7 +174,7 @@ __memp_sync_int(dbenv, dbmfp, ar_max, op, wrotep)
 	MPOOL *c_mp, *mp;
 	MPOOLFILE *mfp;
 	u_int32_t n_cache;
-	int ar_cnt, hb_lock, i, pass, remaining, ret, t_ret, wait_cnt, wrote;
+	gint ar_cnt, hb_lock, i, pass, remaining, ret, t_ret, wait_cnt, wrote;
 
 	dbmp = dbenv->mp_handle;
 	mp = dbmp->reginfo[0].primary;
@@ -501,14 +501,14 @@ err:	__os_free(dbenv, bharray);
  *	Sync all the files in the environment, open or not.
  */
 static
-int __memp_sync_files(dbenv, dbmp)
+gint __memp_sync_files(dbenv, dbmp)
 	DB_ENV *dbenv;
 	DB_MPOOL *dbmp;
 {
 	DB_MPOOLFILE *dbmfp;
 	MPOOL *mp;
 	MPOOLFILE *mfp;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 	mp = dbmp->reginfo[0].primary;
@@ -569,7 +569,7 @@ __memp_close_flush_files(dbenv, dbmp)
 	DB_MPOOL *dbmp;
 {
 	DB_MPOOLFILE *dbmfp;
-	int ret;
+	gint ret;
 
 	/*
 	 * The routine exists because we must close files opened by sync to
@@ -601,7 +601,7 @@ retry:	MUTEX_THREAD_LOCK(dbenv, dbmp->mutexp);
 
 static int
 __bhcmp(p1, p2)
-	const void *p1, *p2;
+	gconstpointer p1, *p2;
 {
 	BH_TRACK *bhp1, *bhp2;
 
diff --git a/libdb/mp/mp_trickle.c b/libdb/mp/mp_trickle.c
index 8f78a2b..a93d62b 100644
--- a/libdb/mp/mp_trickle.c
+++ b/libdb/mp/mp_trickle.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,17 +24,17 @@ static const char revid[] = "$Id$";
  * __memp_trickle --
  *	Keep a specified percentage of the buffers clean.
  *
- * PUBLIC: int __memp_trickle __P((DB_ENV *, int, int *));
+ * PUBLIC: gint __memp_trickle __P((DB_ENV *, int, gint *));
  */
-int
+gint
 __memp_trickle(dbenv, pct, nwrotep)
 	DB_ENV *dbenv;
-	int pct, *nwrotep;
+	gint pct, *nwrotep;
 {
 	DB_MPOOL *dbmp;
 	MPOOL *c_mp, *mp;
 	u_int32_t clean, dirty, i, total, dtmp;
-	int ret, wrote;
+	gint ret, wrote;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
diff --git a/libdb/mutex/mut_fcntl.c b/libdb/mutex/mut_fcntl.c
index 687ca6b..0d0699a 100644
--- a/libdb/mutex/mut_fcntl.c
+++ b/libdb/mutex/mut_fcntl.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,9 +26,9 @@ static const char revid[] = "$Id$";
  * __db_fcntl_mutex_init --
  *	Initialize a DB mutex structure.
  *
- * PUBLIC: int __db_fcntl_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
+ * PUBLIC: gint __db_fcntl_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
  */
-int
+gint
 __db_fcntl_mutex_init(dbenv, mutexp, offset)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
@@ -69,15 +69,15 @@ __db_fcntl_mutex_init(dbenv, mutexp, offset)
  * __db_fcntl_mutex_lock
  *	Lock on a mutex, blocking if necessary.
  *
- * PUBLIC: int __db_fcntl_mutex_lock __P((DB_ENV *, DB_MUTEX *));
+ * PUBLIC: gint __db_fcntl_mutex_lock __P((DB_ENV *, DB_MUTEX *));
  */
-int
+gint
 __db_fcntl_mutex_lock(dbenv, mutexp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
 {
 	struct flock k_lock;
-	int locked, ms, waited;
+	gint locked, ms, waited;
 
 	if (F_ISSET(dbenv, DB_ENV_NOLOCKING))
 		return (0);
@@ -139,9 +139,9 @@ __db_fcntl_mutex_lock(dbenv, mutexp)
  * __db_fcntl_mutex_unlock --
  *	Release a lock.
  *
- * PUBLIC: int __db_fcntl_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
+ * PUBLIC: gint __db_fcntl_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
  */
-int
+gint
 __db_fcntl_mutex_unlock(dbenv, mutexp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
@@ -172,9 +172,9 @@ __db_fcntl_mutex_unlock(dbenv, mutexp)
  * __db_fcntl_mutex_destroy --
  *	Destroy a DB_MUTEX.
  *
- * PUBLIC: int __db_fcntl_mutex_destroy __P((DB_MUTEX *));
+ * PUBLIC: gint __db_fcntl_mutex_destroy __P((DB_MUTEX *));
  */
-int
+gint
 __db_fcntl_mutex_destroy(mutexp)
 	DB_MUTEX *mutexp;
 {
diff --git a/libdb/mutex/mut_pthread.c b/libdb/mutex/mut_pthread.c
index 04d4b08..a87df4d 100644
--- a/libdb/mutex/mut_pthread.c
+++ b/libdb/mutex/mut_pthread.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -59,16 +59,16 @@ static const char revid[] = "$Id$";
  * __db_pthread_mutex_init --
  *	Initialize a DB_MUTEX.
  *
- * PUBLIC: int __db_pthread_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
+ * PUBLIC: gint __db_pthread_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
  */
-int
+gint
 __db_pthread_mutex_init(dbenv, mutexp, flags)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
 	u_int32_t flags;
 {
 	u_int32_t save;
-	int ret;
+	gint ret;
 
 	ret = 0;
 
@@ -172,7 +172,7 @@ __db_pthread_mutex_init(dbenv, mutexp, flags)
 #endif
 #ifdef HAVE_MUTEX_UI_THREADS
 	{
-	int type;
+	gint type;
 
 	type = LF_ISSET(MUTEX_THREAD) ? USYNC_THREAD : USYNC_PROCESS;
 
@@ -201,15 +201,15 @@ __db_pthread_mutex_init(dbenv, mutexp, flags)
  * __db_pthread_mutex_lock
  *	Lock on a mutex, logically blocking if necessary.
  *
- * PUBLIC: int __db_pthread_mutex_lock __P((DB_ENV *, DB_MUTEX *));
+ * PUBLIC: gint __db_pthread_mutex_lock __P((DB_ENV *, DB_MUTEX *));
  */
-int
+gint
 __db_pthread_mutex_lock(dbenv, mutexp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
 {
 	u_int32_t nspins;
-	int i, ret, waited;
+	gint i, ret, waited;
 
 	if (F_ISSET(dbenv, DB_ENV_NOLOCKING) || F_ISSET(mutexp, MUTEX_IGNORE))
 		return (0);
@@ -280,7 +280,7 @@ __db_pthread_mutex_lock(dbenv, mutexp)
 			++mutexp->mutex_set_wait;
 #ifdef DIAGNOSTIC
 		if (mutexp->locked) {
-			char msgbuf[128];
+			gchar msgbuf[128];
 			(void)snprintf(msgbuf,
 			    sizeof(msgbuf), MSG1, (u_long)mutexp->locked);
 			(void)write(STDERR_FILENO, msgbuf, strlen(msgbuf));
@@ -300,14 +300,14 @@ err:	__db_err(dbenv, "unable to lock mutex: %s", strerror(ret));
  * __db_pthread_mutex_unlock --
  *	Release a lock.
  *
- * PUBLIC: int __db_pthread_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
+ * PUBLIC: gint __db_pthread_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
  */
-int
+gint
 __db_pthread_mutex_unlock(dbenv, mutexp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
 {
-	int i, ret;
+	gint i, ret;
 
 	if (F_ISSET(dbenv, DB_ENV_NOLOCKING) || F_ISSET(mutexp, MUTEX_IGNORE))
 		return (0);
@@ -344,13 +344,13 @@ err:	__db_err(dbenv, "unable to unlock mutex: %s", strerror(ret));
  * __db_pthread_mutex_destroy --
  *	Destroy a DB_MUTEX.
  *
- * PUBLIC: int __db_pthread_mutex_destroy __P((DB_MUTEX *));
+ * PUBLIC: gint __db_pthread_mutex_destroy __P((DB_MUTEX *));
  */
-int
+gint
 __db_pthread_mutex_destroy(mutexp)
 	DB_MUTEX *mutexp;
 {
-	int ret;
+	gint ret;
 
 	if (F_ISSET(mutexp, MUTEX_IGNORE))
 		return (0);
diff --git a/libdb/mutex/mut_tas.c b/libdb/mutex/mut_tas.c
index 8ad8a4a..7d1f618 100644
--- a/libdb/mutex/mut_tas.c
+++ b/libdb/mutex/mut_tas.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -41,9 +41,9 @@ static const char revid[] = "$Id$";
  * __db_tas_mutex_init --
  *	Initialize a DB_MUTEX.
  *
- * PUBLIC: int __db_tas_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
+ * PUBLIC: gint __db_tas_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
  */
-int
+gint
 __db_tas_mutex_init(dbenv, mutexp, flags)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
@@ -97,15 +97,15 @@ __db_tas_mutex_init(dbenv, mutexp, flags)
  * __db_tas_mutex_lock
  *	Lock on a mutex, logically blocking if necessary.
  *
- * PUBLIC: int __db_tas_mutex_lock __P((DB_ENV *, DB_MUTEX *));
+ * PUBLIC: gint __db_tas_mutex_lock __P((DB_ENV *, DB_MUTEX *));
  */
-int
+gint
 __db_tas_mutex_lock(dbenv, mutexp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
 {
 	u_long ms;
-	int nspins;
+	gint nspins;
 
 	if (F_ISSET(dbenv, DB_ENV_NOLOCKING) || F_ISSET(mutexp, MUTEX_IGNORE))
 		return (0);
@@ -168,9 +168,9 @@ relock:
  * __db_tas_mutex_unlock --
  *	Release a lock.
  *
- * PUBLIC: int __db_tas_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
+ * PUBLIC: gint __db_tas_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
  */
-int
+gint
 __db_tas_mutex_unlock(dbenv, mutexp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
@@ -196,9 +196,9 @@ __db_tas_mutex_unlock(dbenv, mutexp)
  * __db_tas_mutex_destroy --
  *	Destroy a DB_MUTEX.
  *
- * PUBLIC: int __db_tas_mutex_destroy __P((DB_MUTEX *));
+ * PUBLIC: gint __db_tas_mutex_destroy __P((DB_MUTEX *));
  */
-int
+gint
 __db_tas_mutex_destroy(mutexp)
 	DB_MUTEX *mutexp;
 {
diff --git a/libdb/mutex/mut_win32.c b/libdb/mutex/mut_win32.c
index fef57f0..ba33078 100644
--- a/libdb/mutex/mut_win32.c
+++ b/libdb/mutex/mut_win32.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -28,7 +28,7 @@ static const char revid[] = "$Id$";
 #undef MUTEX_DIAG
 
 #define	GET_HANDLE(mutexp, event) do {					\
-	char idbuf[13];							\
+	gchar idbuf[13];							\
 									\
 	snprintf(idbuf, sizeof idbuf, "db.m%08x", mutexp->id);		\
 	event = CreateEvent(NULL, FALSE, FALSE, idbuf);			\
@@ -40,9 +40,9 @@ static const char revid[] = "$Id$";
  * __db_win32_mutex_init --
  *	Initialize a DB_MUTEX.
  *
- * PUBLIC: int __db_win32_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
+ * PUBLIC: gint __db_win32_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t));
  */
-int
+gint
 __db_win32_mutex_init(dbenv, mutexp, flags)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
@@ -84,15 +84,15 @@ __db_win32_mutex_init(dbenv, mutexp, flags)
  * __db_win32_mutex_lock
  *	Lock on a mutex, logically blocking if necessary.
  *
- * PUBLIC: int __db_win32_mutex_lock __P((DB_ENV *, DB_MUTEX *));
+ * PUBLIC: gint __db_win32_mutex_lock __P((DB_ENV *, DB_MUTEX *));
  */
-int
+gint
 __db_win32_mutex_lock(dbenv, mutexp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
 {
 	HANDLE event;
-	int ret, ms, nspins;
+	gint ret, ms, nspins;
 #ifdef MUTEX_DIAG
 	LARGE_INTEGER now;
 #endif
@@ -163,14 +163,14 @@ loop:	/* Attempt to acquire the resource for N spins. */
  * __db_win32_mutex_unlock --
  *	Release a lock.
  *
- * PUBLIC: int __db_win32_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
+ * PUBLIC: gint __db_win32_mutex_unlock __P((DB_ENV *, DB_MUTEX *));
  */
-int
+gint
 __db_win32_mutex_unlock(dbenv, mutexp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
 {
-	int ret;
+	gint ret;
 	HANDLE event;
 #ifdef MUTEX_DIAG
 		LARGE_INTEGER now;
@@ -217,9 +217,9 @@ __db_win32_mutex_unlock(dbenv, mutexp)
  * __db_win32_mutex_destroy --
  *	Destroy a DB_MUTEX - noop with this implementation.
  *
- * PUBLIC: int __db_win32_mutex_destroy __P((DB_MUTEX *));
+ * PUBLIC: gint __db_win32_mutex_destroy __P((DB_MUTEX *));
  */
-int
+gint
 __db_win32_mutex_destroy(mutexp)
 	DB_MUTEX *mutexp;
 {
diff --git a/libdb/mutex/mutex.c b/libdb/mutex/mutex.c
index 97fec83..c368eea 100644
--- a/libdb/mutex/mutex.c
+++ b/libdb/mutex/mutex.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,7 +27,7 @@ static const char revid[] = "$Id$";
 #include "dbinc/txn.h"
 #endif
 
-static int __db_mutex_alloc_int __P((DB_ENV *, REGINFO *, DB_MUTEX **));
+static gint __db_mutex_alloc_int __P((DB_ENV *, REGINFO *, DB_MUTEX **));
 #ifdef	HAVE_MUTEX_SYSTEM_RESOURCES
 static REGMAINT * __db_mutex_maint __P((DB_ENV *, REGINFO *));
 #endif
@@ -37,19 +37,19 @@ static REGMAINT * __db_mutex_maint __P((DB_ENV *, REGINFO *));
  *	External interface to allocate, and/or initialize, record
  *	mutexes.
  *
- * PUBLIC: int __db_mutex_setup __P((DB_ENV *, REGINFO *, void *, u_int32_t));
+ * PUBLIC: gint __db_mutex_setup __P((DB_ENV *, REGINFO *, gpointer , u_int32_t));
  */
-int
+gint
 __db_mutex_setup(dbenv, infop, ptr, flags)
 	DB_ENV *dbenv;
 	REGINFO *infop;
-	void *ptr;
+	gpointer ptr;
 	u_int32_t flags;
 {
 	DB_MUTEX *mutex;
 	REGMAINT *maint;
 	u_int32_t iflags, offset;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	/*
@@ -122,7 +122,7 @@ __db_mutex_alloc_int(dbenv, infop, storep)
 	REGINFO *infop;
 	DB_MUTEX **storep;
 {
-	int ret;
+	gint ret;
 
 	/*
 	 * If the architecture supports mutexes in heap memory, use heap memory.
@@ -299,10 +299,10 @@ __db_shreg_locks_destroy(infop, rp)
  * __db_shreg_mutex_init --
  *	Initialize a shared memory mutex.
  *
- * PUBLIC: int __db_shreg_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t,
+ * PUBLIC: gint __db_shreg_mutex_init __P((DB_ENV *, DB_MUTEX *, u_int32_t,
  * PUBLIC:    u_int32_t, REGINFO *, REGMAINT *));
  */
-int
+gint
 __db_shreg_mutex_init(dbenv, mutexp, offset, flags, infop, rp)
 	DB_ENV *dbenv;
 	DB_MUTEX *mutexp;
@@ -311,7 +311,7 @@ __db_shreg_mutex_init(dbenv, mutexp, offset, flags, infop, rp)
 	REGINFO *infop;
 	REGMAINT *rp;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_mutex_init_int(dbenv, mutexp, offset, flags)) != 0)
 		return (ret);
@@ -344,12 +344,12 @@ __db_shreg_mutex_init(dbenv, mutexp, offset, flags, infop, rp)
  * __db_shreg_maintinit --
  *	Initialize a region's maintenance information.
  *
- * PUBLIC: void __db_shreg_maintinit __P((REGINFO *, void *addr, size_t));
+ * PUBLIC: void __db_shreg_maintinit __P((REGINFO *, gpointer addr, size_t));
  */
 void
 __db_shreg_maintinit(infop, addr, size)
 	REGINFO *infop;
-	void *addr;
+	gpointer addr;
 	size_t size;
 {
 	REGMAINT *rp;
diff --git a/libdb/mutex/tm.c b/libdb/mutex/tm.c
index 4af1b19..9e4559f 100644
--- a/libdb/mutex/tm.c
+++ b/libdb/mutex/tm.c
@@ -25,8 +25,8 @@ void  exec_proc();
 void  tm_file_init();
 void  map_file();
 void  run_proc();
-void *run_thread();
-void *run_thread_wake();
+gpointer run_thread();
+gpointer run_thread_wake();
 void  tm_mutex_destroy();
 void  tm_mutex_init();
 void  tm_mutex_stats();
@@ -47,16 +47,16 @@ int	 child;					/* -s: Slave. */
 int	 nthreads = 1;				/* -t: Threads. */
 int	 verbose;				/* -v: Verbosity. */
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char *argv[];
+	gint argc;
+	gchar *argv[];
 {
-	extern int optind;
-	extern char *optarg;
+	extern gint optind;
+	extern gchar *optarg;
 	pid_t pid;
-	int ch, eval, i, status;
-	char *tmpath;
+	gint ch, eval, i, status;
+	gchar *tmpath;
 
 	tmpath = argv[0];
 	while ((ch = getopt(argc, argv, "l:n:p:st:v")) != EOF)
@@ -150,9 +150,9 @@ main(argc, argv)
 
 void
 exec_proc(tmpath)
-	char *tmpath;
+	gchar *tmpath;
 {
-	char *argv[10], **ap, b_l[10], b_n[10], b_t[10];
+	gchar *argv[10], **ap, b_l[10], b_n[10], b_t[10];
 
 	ap = &argv[0];
 	*ap++ = "tm";
@@ -178,15 +178,15 @@ run_proc()
 {
 #if defined(HAVE_MUTEX_PTHREADS) || defined(BUILD_PTHREADS_ANYWAY)
 	pthread_t *kidsp, wakep;
-	int i, status;
-	void *retp;
+	gint i, status;
+	gpointer retp;
 #endif
 	__os_sleep(&dbenv, 3, 0);		/* Let everyone catch up. */
 
 	srand((u_int)time(NULL) / getpid());	/* Initialize random numbers. */
 
 	if (nthreads == 1)			/* Simple case. */
-		exit((int)run_thread((void *)0));
+		exit((int)run_thread((gpointer)0));
 
 #if defined(HAVE_MUTEX_PTHREADS) || defined(BUILD_PTHREADS_ANYWAY)
 	/*
@@ -200,14 +200,14 @@ run_proc()
 	}
 	for (i = 0; i < nthreads; i++)
 		if ((errno = pthread_create(
-		    &kidsp[i], NULL, run_thread, (void *)i)) != 0) {
+		    &kidsp[i], NULL, run_thread, (gpointer)i)) != 0) {
 			fprintf(stderr, "tm: failed spawning thread %d: %s\n",
 			    i, strerror(errno));
 			exit(EXIT_FAILURE);
 		}
 
 	if ((errno = pthread_create(
-	    &wakep, NULL, run_thread_wake, (void *)0)) != 0) {
+	    &wakep, NULL, run_thread_wake, (gpointer)0)) != 0) {
 		fprintf(stderr, "tm: failed spawning wakeup thread: %s\n",
 		    strerror(errno));
 		exit(EXIT_FAILURE);
@@ -237,13 +237,13 @@ run_proc()
 #endif
 }
 
-void *
+gpointer
 run_thread(arg)
-	void *arg;
+	gpointer arg;
 {
 	DB_MUTEX *gm_addr, *lm_addr, *tm_addr, *mp;
 	u_long gid1, gid2, *id_addr;
-	int fd, i, lock, id, nl, remap;
+	gint fd, i, lock, id, nl, remap;
 
 	/* Set local and global per-thread ID. */
 	id = (int)arg;
@@ -272,14 +272,14 @@ run_thread(arg)
 		if (__db_mutex_lock(&dbenv, mp)) {
 			fprintf(stderr,
 			    "%lu/%lx: never got lock\n", gid1, gid2);
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 		if (id_addr[lock * 2] != 0) {
 			fprintf(stderr,
 			    "RACE! (%lu/%lx granted lock %d held by %lu/%lx)\n",
 			    gid1, gid2,
 			    lock, id_addr[lock * 2], id_addr[lock * 2 + 1]);
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 		id_addr[lock * 2] = gid1;
 		id_addr[lock * 2 + 1] = gid2;
@@ -296,7 +296,7 @@ run_thread(arg)
 			    "RACE! (%lu/%lx stole lock %d from %lu/%lx)\n",
 				    id_addr[lock * 2],
 				    id_addr[lock * 2 + 1], lock, gid1, gid2);
-				return ((void *)EXIT_FAILURE);
+				return ((gpointer)EXIT_FAILURE);
 			}
 		}
 
@@ -313,25 +313,25 @@ run_thread(arg)
 		 */
 		if (__db_mutex_lock(&dbenv, gm_addr)) {
 			fprintf(stderr, "%lu/%lx: global lock\n", gid1, gid2);
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 		mp = (DB_MUTEX *)((u_int8_t *)tm_addr + id * align);
 		F_SET(mp, MUTEX_WAKEME);
 		if (__db_mutex_unlock(&dbenv, gm_addr)) {
 			fprintf(stderr,
 			    "%lu/%lx: per-thread wakeup failed\n", gid1, gid2);
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 		if (__db_mutex_lock(&dbenv, mp)) {
 			fprintf(stderr,
 			    "%lu/%lx: per-thread lock\n", gid1, gid2);
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 		/* Time passes... */
 		if (F_ISSET(mp, MUTEX_WAKEME)) {
 			fprintf(stderr, "%lu/%lx: %03d wakeup flag still set\n",
 			    gid1, gid2, id);
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 #endif
 
@@ -340,14 +340,14 @@ run_thread(arg)
 		mp = (DB_MUTEX *)((u_int8_t *)lm_addr + lock * align);
 		if (__db_mutex_unlock(&dbenv, mp)) {
 			fprintf(stderr, "%lu/%lx: wakeup failed\n", gid1, gid2);
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 
 		if (--nl % 100 == 0)
 			fprintf(stderr, "%lu/%lx: %d\n", gid1, gid2, nl);
 
 		if (nl == 0 || --remap == 0) {
-			unmap_file((void *)gm_addr, fd);
+			unmap_file((gpointer)gm_addr, fd);
 			gm_addr = NULL;
 
 			if (nl == 0)
@@ -365,12 +365,12 @@ run_thread(arg)
  * run_thread_wake --
  *	Thread to wake up other threads that are sleeping.
  */
-void *
+gpointer
 run_thread_wake(arg)
-	void *arg;
+	gpointer arg;
 {
 	DB_MUTEX *gm_addr, *tm_addr, *mp;
-	int fd, id;
+	gint fd, id;
 
 	arg = NULL;
 	map_file(&gm_addr, &tm_addr, NULL, NULL, &fd);
@@ -382,7 +382,7 @@ run_thread_wake(arg)
 		/* Acquire the global lock. */
 retry:		if (__db_mutex_lock(&dbenv, gm_addr)) {
 			fprintf(stderr, "wt: global lock failed\n");
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 
 next:		mp = (DB_MUTEX *)((u_int8_t *)tm_addr + id * align);
@@ -390,7 +390,7 @@ next:		mp = (DB_MUTEX *)((u_int8_t *)tm_addr + id * align);
 			F_CLR(mp, MUTEX_WAKEME);
 			if (__db_mutex_unlock(&dbenv, mp)) {
 				fprintf(stderr, "wt: wakeup failed\n");
-				return ((void *)EXIT_FAILURE);
+				return ((gpointer)EXIT_FAILURE);
 			}
 		}
 
@@ -399,7 +399,7 @@ next:		mp = (DB_MUTEX *)((u_int8_t *)tm_addr + id * align);
 
 		if (__db_mutex_unlock(&dbenv, gm_addr)) {
 			fprintf(stderr, "wt: global unlock failed\n");
-			return ((void *)EXIT_FAILURE);
+			return ((gpointer)EXIT_FAILURE);
 		}
 
 		__os_sleep(&dbenv, 0, 500);
@@ -418,7 +418,7 @@ next:		mp = (DB_MUTEX *)((u_int8_t *)tm_addr + id * align);
 void
 tm_file_init()
 {
-	int fd;
+	gint fd;
 
 
 	/* Initialize the backing file. */
@@ -451,7 +451,7 @@ void
 tm_mutex_init()
 {
 	DB_MUTEX *gm_addr, *lm_addr, *mp, *tm_addr;
-	int fd, i;
+	gint fd, i;
 
 	map_file(&gm_addr, &tm_addr, &lm_addr, NULL, &fd);
 
@@ -487,7 +487,7 @@ tm_mutex_init()
 			exit(EXIT_FAILURE);
 		}
 
-	unmap_file((void *)gm_addr, fd);
+	unmap_file((gpointer)gm_addr, fd);
 }
 
 /*
@@ -498,7 +498,7 @@ void
 tm_mutex_destroy()
 {
 	DB_MUTEX *gm_addr, *lm_addr, *mp, *tm_addr;
-	int fd, i;
+	gint fd, i;
 
 	map_file(&gm_addr, &tm_addr, &lm_addr, NULL, &fd);
 
@@ -530,7 +530,7 @@ tm_mutex_destroy()
 			exit(EXIT_FAILURE);
 		}
 
-	unmap_file((void *)gm_addr, fd);
+	unmap_file((gpointer)gm_addr, fd);
 #ifdef HAVE_QNX
 	(void)shm_unlink(file);
 #endif
@@ -544,7 +544,7 @@ void
 tm_mutex_stats()
 {
 	DB_MUTEX *gm_addr, *lm_addr, *mp;
-	int fd, i;
+	gint fd, i;
 
 	map_file(&gm_addr, NULL, &lm_addr, NULL, &fd);
 
@@ -554,7 +554,7 @@ tm_mutex_stats()
 		printf("mutex %2d: wait: %lu; no wait %lu\n", i,
 		    (u_long)mp->mutex_set_wait, (u_long)mp->mutex_set_nowait);
 
-	unmap_file((void *)gm_addr, fd);
+	unmap_file((gpointer)gm_addr, fd);
 }
 
 /*
@@ -565,13 +565,13 @@ void
 map_file(gm_addrp, tm_addrp, lm_addrp, id_addrp, fdp)
 	DB_MUTEX **gm_addrp, **tm_addrp, **lm_addrp;
 	u_long **id_addrp;
-	int *fdp;
+	gint *fdp;
 {
-	void *maddr;
-	int fd;
+	gpointer maddr;
+	gint fd;
 
 #ifndef MAP_FAILED
-#define	MAP_FAILED	(void *)-1
+#define	MAP_FAILED	(gpointer)-1
 #endif
 #ifndef MAP_FILE
 #define	MAP_FILE	0
@@ -613,8 +613,8 @@ map_file(gm_addrp, tm_addrp, lm_addrp, id_addrp, fdp)
  */
 void
 unmap_file(maddr, fd)
-	void *maddr;
-	int fd;
+	gpointer maddr;
+	gint fd;
 {
 	if (munmap(maddr, len) != 0) {
 		fprintf(stderr, "munmap: %s\n", strerror(errno));
diff --git a/libdb/os/os_abs.c b/libdb/os/os_abs.c
index 538e335..f03480e 100644
--- a/libdb/os/os_abs.c
+++ b/libdb/os/os_abs.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,11 +21,11 @@ static const char revid[] = "$Id$";
  * __os_abspath --
  *	Return if a path is an absolute path.
  *
- * PUBLIC: int __os_abspath __P((const char *));
+ * PUBLIC: gint __os_abspath __P((const gchar *));
  */
-int
+gint
 __os_abspath(path)
-	const char *path;
+	const gchar *path;
 {
 	return (path[0] == '/');
 }
diff --git a/libdb/os/os_alloc.c b/libdb/os/os_alloc.c
index 388cf9f..61adcaf 100644
--- a/libdb/os/os_alloc.c
+++ b/libdb/os/os_alloc.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -59,15 +59,15 @@ union __db_alloc {
  *	the allocation function specified to the DB handle, the DB_ENV
  *	handle, or __os_malloc.
  *
- * PUBLIC: int __os_umalloc __P((DB_ENV *, size_t, void *));
+ * PUBLIC: gint __os_umalloc __P((DB_ENV *, size_t, gpointer ));
  */
-int
+gint
 __os_umalloc(dbenv, size, storep)
 	DB_ENV *dbenv;
 	size_t size;
-	void *storep;
+	gpointer storep;
 {
-	int ret;
+	gint ret;
 
 	/* Require an environment handle. */
 	DB_ASSERT(dbenv != NULL);
@@ -78,10 +78,10 @@ __os_umalloc(dbenv, size, storep)
 
 	if (dbenv == NULL || dbenv->db_malloc == NULL) {
 		if (DB_GLOBAL(j_malloc) != NULL)
-			*(void **)storep = DB_GLOBAL(j_malloc)(size);
+			*(gpointer *)storep = DB_GLOBAL(j_malloc)(size);
 		else
-			*(void **)storep = malloc(size);
-		if (*(void **)storep == NULL) {
+			*(gpointer *)storep = malloc(size);
+		if (*(gpointer *)storep == NULL) {
 			/*
 			 *  Correct error return, see __os_malloc.
 			 */
@@ -96,7 +96,7 @@ __os_umalloc(dbenv, size, storep)
 		return (0);
 	}
 
-	if ((*(void **)storep = dbenv->db_malloc(size)) == NULL) {
+	if ((*(gpointer *)storep = dbenv->db_malloc(size)) == NULL) {
 		__db_err(dbenv, "User-specified malloc function returned NULL");
 		return (ENOMEM);
 	}
@@ -108,18 +108,18 @@ __os_umalloc(dbenv, size, storep)
  * __os_urealloc --
  *	realloc(3) counterpart to __os_umalloc.
  *
- * PUBLIC: int __os_urealloc __P((DB_ENV *, size_t, void *));
+ * PUBLIC: gint __os_urealloc __P((DB_ENV *, size_t, gpointer ));
  */
-int
+gint
 __os_urealloc(dbenv, size, storep)
 	DB_ENV *dbenv;
 	size_t size;
-	void *storep;
+	gpointer storep;
 {
-	int ret;
-	void *ptr;
+	gint ret;
+	gpointer ptr;
 
-	ptr = *(void **)storep;
+	ptr = *(gpointer *)storep;
 
 	/* Require an environment handle. */
 	DB_ASSERT(dbenv != NULL);
@@ -133,10 +133,10 @@ __os_urealloc(dbenv, size, storep)
 			return (__os_umalloc(dbenv, size, storep));
 
 		if (DB_GLOBAL(j_realloc) != NULL)
-			*(void **)storep = DB_GLOBAL(j_realloc)(ptr, size);
+			*(gpointer *)storep = DB_GLOBAL(j_realloc)(ptr, size);
 		else
-			*(void **)storep = realloc(ptr, size);
-		if (*(void **)storep == NULL) {
+			*(gpointer *)storep = realloc(ptr, size);
+		if (*(gpointer *)storep == NULL) {
 			/*
 			 * Correct errno, see __os_realloc.
 			 */
@@ -151,7 +151,7 @@ __os_urealloc(dbenv, size, storep)
 		return (0);
 	}
 
-	if ((*(void **)storep = dbenv->db_realloc(ptr, size)) == NULL) {
+	if ((*(gpointer *)storep = dbenv->db_realloc(ptr, size)) == NULL) {
 		__db_err(dbenv,
 		    "User-specified realloc function returned NULL");
 		return (ENOMEM);
@@ -164,12 +164,12 @@ __os_urealloc(dbenv, size, storep)
  * __os_ufree --
  *	free(3) counterpart to __os_umalloc.
  *
- * PUBLIC: int __os_ufree __P((DB_ENV *, void *));
+ * PUBLIC: gint __os_ufree __P((DB_ENV *, gpointer ));
  */
-int
+gint
 __os_ufree(dbenv, ptr)
 	DB_ENV *dbenv;
-	void *ptr;
+	gpointer ptr;
 {
 	/* Require an environment handle. */
 	DB_ASSERT(dbenv != NULL);
@@ -188,19 +188,19 @@ __os_ufree(dbenv, ptr)
  * __os_strdup --
  *	The strdup(3) function for DB.
  *
- * PUBLIC: int __os_strdup __P((DB_ENV *, const char *, void *));
+ * PUBLIC: gint __os_strdup __P((DB_ENV *, const gchar *, gpointer ));
  */
-int
+gint
 __os_strdup(dbenv, str, storep)
 	DB_ENV *dbenv;
-	const char *str;
-	void *storep;
+	const gchar *str;
+	gpointer storep;
 {
 	size_t size;
-	int ret;
-	void *p;
+	gint ret;
+	gpointer p;
 
-	*(void **)storep = NULL;
+	*(gpointer *)storep = NULL;
 
 	size = strlen(str) + 1;
 	if ((ret = __os_malloc(dbenv, size, &p)) != 0)
@@ -208,7 +208,7 @@ __os_strdup(dbenv, str, storep)
 
 	memcpy(p, str, size);
 
-	*(void **)storep = p;
+	*(gpointer *)storep = p;
 	return (0);
 }
 
@@ -216,16 +216,16 @@ __os_strdup(dbenv, str, storep)
  * __os_calloc --
  *	The calloc(3) function for DB.
  *
- * PUBLIC: int __os_calloc __P((DB_ENV *, size_t, size_t, void *));
+ * PUBLIC: gint __os_calloc __P((DB_ENV *, size_t, size_t, gpointer ));
  */
-int
+gint
 __os_calloc(dbenv, num, size, storep)
 	DB_ENV *dbenv;
 	size_t num, size;
-	void *storep;
+	gpointer storep;
 {
-	void *p;
-	int ret;
+	gpointer p;
+	gint ret;
 
 	size *= num;
 	if ((ret = __os_malloc(dbenv, size, &p)) != 0)
@@ -233,7 +233,7 @@ __os_calloc(dbenv, num, size, storep)
 
 	memset(p, 0, size);
 
-	*(void **)storep = p;
+	*(gpointer *)storep = p;
 	return (0);
 }
 
@@ -241,18 +241,18 @@ __os_calloc(dbenv, num, size, storep)
  * __os_malloc --
  *	The malloc(3) function for DB.
  *
- * PUBLIC: int __os_malloc __P((DB_ENV *, size_t, void *));
+ * PUBLIC: gint __os_malloc __P((DB_ENV *, size_t, gpointer ));
  */
-int
+gint
 __os_malloc(dbenv, size, storep)
 	DB_ENV *dbenv;
 	size_t size;
-	void *storep;
+	gpointer storep;
 {
-	int ret;
-	void *p;
+	gint ret;
+	gpointer p;
 
-	*(void **)storep = NULL;
+	*(gpointer *)storep = NULL;
 
 	/* Never allocate 0 bytes -- some C libraries don't like it. */
 	if (size == 0)
@@ -294,7 +294,7 @@ __os_malloc(dbenv, size, storep)
 	((union __db_alloc *)p)->size = size;
 	p = &((union __db_alloc *)p)[1];
 #endif
-	*(void **)storep = p;
+	*(gpointer *)storep = p;
 
 	return (0);
 }
@@ -303,18 +303,18 @@ __os_malloc(dbenv, size, storep)
  * __os_realloc --
  *	The realloc(3) function for DB.
  *
- * PUBLIC: int __os_realloc __P((DB_ENV *, size_t, void *));
+ * PUBLIC: gint __os_realloc __P((DB_ENV *, size_t, gpointer ));
  */
-int
+gint
 __os_realloc(dbenv, size, storep)
 	DB_ENV *dbenv;
 	size_t size;
-	void *storep;
+	gpointer storep;
 {
-	int ret;
-	void *p, *ptr;
+	gint ret;
+	gpointer p, *ptr;
 
-	ptr = *(void **)storep;
+	ptr = *(gpointer *)storep;
 
 	/* Never allocate 0 bytes -- some C libraries don't like it. */
 	if (size == 0)
@@ -362,7 +362,7 @@ __os_realloc(dbenv, size, storep)
 	p = &((union __db_alloc *)p)[1];
 #endif
 
-	*(void **)storep = p;
+	*(gpointer *)storep = p;
 
 	return (0);
 }
@@ -371,15 +371,15 @@ __os_realloc(dbenv, size, storep)
  * __os_free --
  *	The free(3) function for DB.
  *
- * PUBLIC: void __os_free __P((DB_ENV *, void *));
+ * PUBLIC: void __os_free __P((DB_ENV *, gpointer ));
  */
 void
 __os_free(dbenv, ptr)
 	DB_ENV *dbenv;
-	void *ptr;
+	gpointer ptr;
 {
 #ifdef DIAGNOSTIC
-	int size;
+	gint size;
 	/*
 	 * Check that the guard byte (one past the end of the memory) is
 	 * still CLEAR_BYTE.
@@ -428,11 +428,11 @@ __os_guard(dbenv)
  *	we want to look at it.  Unfortunately, if you have code like:
  *
  *		struct a {
- *			int x;
+ *			gint x;
  *		} *p;
  *
- *		void *func_argument;
- *		int local;
+ *		gpointer func_argument;
+ *		gint local;
  *
  *		p = (struct a *)func_argument;
  *		memcpy(&local, p->x, sizeof(local));
@@ -446,13 +446,13 @@ __os_guard(dbenv)
  *	of the time, but we've seen examples where it wasn't sufficient
  *	and there's nothing in ANSI C that requires that work.
  *
- * PUBLIC: void *__ua_memcpy __P((void *, const void *, size_t));
+ * PUBLIC: gpointer __ua_memcpy __P((gpointer , gconstpointer , size_t));
  */
-void *
+gpointer
 __ua_memcpy(dst, src, len)
-	void *dst;
-	const void *src;
+	gpointer dst;
+	gconstpointer src;
 	size_t len;
 {
-	return ((void *)memcpy(dst, src, len));
+	return ((gpointer)memcpy(dst, src, len));
 }
diff --git a/libdb/os/os_clock.c b/libdb/os/os_clock.c
index 6dc5700..791feae 100644
--- a/libdb/os/os_clock.c
+++ b/libdb/os/os_clock.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -34,16 +34,16 @@ static const char revid[] = "$Id$";
  * __os_clock --
  *	Return the current time-of-day clock in seconds and microseconds.
  *
- * PUBLIC: int __os_clock __P((DB_ENV *, u_int32_t *, u_int32_t *));
+ * PUBLIC: gint __os_clock __P((DB_ENV *, u_int32_t *, u_int32_t *));
  */
-int
+gint
 __os_clock(dbenv, secsp, usecsp)
 	DB_ENV *dbenv;
 	u_int32_t *secsp, *usecsp;	/* Seconds and microseconds. */
 {
 #if defined(HAVE_GETTIMEOFDAY)
 	struct timeval tp;
-	int ret;
+	gint ret;
 
 retry:	if (gettimeofday(&tp, NULL) != 0) {
 		if ((ret = __os_get_errno()) == EINTR)
@@ -59,7 +59,7 @@ retry:	if (gettimeofday(&tp, NULL) != 0) {
 #endif
 #if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_CLOCK_GETTIME)
 	struct timespec tp;
-	int ret;
+	gint ret;
 
 retry:	if (clock_gettime(CLOCK_REALTIME, &tp) != 0) {
 		if ((ret = __os_get_errno()) == EINTR)
@@ -75,7 +75,7 @@ retry:	if (clock_gettime(CLOCK_REALTIME, &tp) != 0) {
 #endif
 #if !defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_CLOCK_GETTIME)
 	time_t now;
-	int ret;
+	gint ret;
 
 	if (time(&now) == (time_t)-1) {
 		ret = __os_get_errno();
diff --git a/libdb/os/os_config.c b/libdb/os/os_config.c
index bf791e3..58f2c06 100644
--- a/libdb/os/os_config.c
+++ b/libdb/os/os_config.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,9 +21,9 @@ static const char revid[] = "$Id$";
  * __os_fs_notzero --
  *	Return 1 if allocated filesystem blocks are not zeroed.
  *
- * PUBLIC: int __os_fs_notzero __P((void));
+ * PUBLIC: gint __os_fs_notzero __P((void));
  */
-int
+gint
 __os_fs_notzero()
 {
 	/* Most filesystems zero out implicitly created pages. */
diff --git a/libdb/os/os_dir.c b/libdb/os/os_dir.c
index aed7add..f7863a1 100644
--- a/libdb/os/os_dir.c
+++ b/libdb/os/os_dir.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -39,25 +39,25 @@ static const char revid[] = "$Id$";
  * __os_dirlist --
  *	Return a list of the files in a directory.
  *
- * PUBLIC: int __os_dirlist __P((DB_ENV *, const char *, char ***, int *));
+ * PUBLIC: gint __os_dirlist __P((DB_ENV *, const gchar *, gchar ***, gint *));
  */
-int
+gint
 __os_dirlist(dbenv, dir, namesp, cntp)
 	DB_ENV *dbenv;
-	const char *dir;
-	char ***namesp;
-	int *cntp;
+	const gchar *dir;
+	gchar ***namesp;
+	gint *cntp;
 {
 	struct dirent *dp;
 	DIR *dirp;
-	int arraysz, cnt, ret;
-	char **names;
+	gint arraysz, cnt, ret;
+	gchar **names;
 
 	if (DB_GLOBAL(j_dirlist) != NULL)
 		return (DB_GLOBAL(j_dirlist)(dir, namesp, cntp));
 
 #ifdef HAVE_VXWORKS
-	if ((dirp = opendir((char *)dir)) == NULL)
+	if ((dirp = opendir((gchar *)dir)) == NULL)
 #else
 	if ((dirp = opendir(dir)) == NULL)
 #endif
@@ -90,13 +90,13 @@ nomem:	if (names != NULL)
  * __os_dirfree --
  *	Free the list of files.
  *
- * PUBLIC: void __os_dirfree __P((DB_ENV *, char **, int));
+ * PUBLIC: void __os_dirfree __P((DB_ENV *, gchar **, int));
  */
 void
 __os_dirfree(dbenv, names, cnt)
 	DB_ENV *dbenv;
-	char **names;
-	int cnt;
+	gchar **names;
+	gint cnt;
 {
 	if (DB_GLOBAL(j_dirfree) != NULL)
 		DB_GLOBAL(j_dirfree)(names, cnt);
diff --git a/libdb/os/os_errno.c b/libdb/os/os_errno.c
index ad7c8dd..ed9787a 100644
--- a/libdb/os/os_errno.c
+++ b/libdb/os/os_errno.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,9 +17,9 @@ static const char revid[] = "$Id$";
  * __os_get_errno_ret_zero --
  *	Return the value of errno, even if it's zero.
  *
- * PUBLIC: int __os_get_errno_ret_zero __P((void));
+ * PUBLIC: gint __os_get_errno_ret_zero __P((void));
  */
-int
+gint
 __os_get_errno_ret_zero()
 {
 	/* This routine must be able to return the same value repeatedly. */
@@ -30,9 +30,9 @@ __os_get_errno_ret_zero()
  * __os_get_errno --
  *	Return the value of errno, or EAGAIN if errno is zero.
  *
- * PUBLIC: int __os_get_errno __P((void));
+ * PUBLIC: gint __os_get_errno __P((void));
  */
-int
+gint
 __os_get_errno()
 {
 	/*
@@ -58,7 +58,7 @@ __os_get_errno()
  */
 void
 __os_set_errno(evalue)
-	int evalue;
+	gint evalue;
 {
 	errno = evalue;
 }
diff --git a/libdb/os/os_fid.c b/libdb/os/os_fid.c
index bd2ffc7..11b2ccc 100644
--- a/libdb/os/os_fid.c
+++ b/libdb/os/os_fid.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -45,18 +45,18 @@ static u_int32_t fid_serial = SERIAL_INIT;
  * temporary files, the inode and device fields are left blank and
  * the extra four bytes are filled in with a random value.
  *
- * PUBLIC: int __os_fileid __P((DB_ENV *, const char *, int, u_int8_t *));
+ * PUBLIC: gint __os_fileid __P((DB_ENV *, const gchar *, int, u_int8_t *));
  */
-int
+gint
 __os_fileid(dbenv, fname, unique_okay, fidp)
 	DB_ENV *dbenv;
-	const char *fname;
-	int unique_okay;
+	const gchar *fname;
+	gint unique_okay;
 	u_int8_t *fidp;
 {
 	struct stat sb;
 	size_t i;
-	int ret;
+	gint ret;
 	u_int32_t tmp;
 	u_int8_t *p;
 
@@ -66,7 +66,7 @@ __os_fileid(dbenv, fname, unique_okay, fidp)
 	/* On POSIX/UNIX, use a dev/inode pair. */
 retry:
 #ifdef HAVE_VXWORKS
-	if (stat((char *)fname, &sb) != 0) {
+	if (stat((gchar *)fname, &sb) != 0) {
 #else
 	if (stat(fname, &sb) != 0) {
 #endif
diff --git a/libdb/os/os_fsync.c b/libdb/os/os_fsync.c
index 4bcb4f6..1f2db36 100644
--- a/libdb/os/os_fsync.c
+++ b/libdb/os/os_fsync.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,11 +26,11 @@ static const char revid[] = "$Id$";
 
 #define	fsync(fd)	__vx_fsync(fd);
 
-int
+gint
 __vx_fsync(fd)
-	int fd;
+	gint fd;
 {
-	int ret;
+	gint ret;
 
 	/*
 	 * The results of ioctl are driver dependent.  Some will return the
@@ -46,11 +46,11 @@ __vx_fsync(fd)
 #ifdef __hp3000s900
 #define	fsync(fd)	__mpe_fsync(fd);
 
-int
+gint
 __mpe_fsync(fd)
-	int fd;
+	gint fd;
 {
-	extern FCONTROL(short, short, void *);
+	extern FCONTROL(short, short, gpointer );
 
 	FCONTROL(_MPE_FILENO(fd), 2, NULL);	/* Flush the buffers */
 	FCONTROL(_MPE_FILENO(fd), 6, NULL);	/* Write the EOF */
@@ -62,14 +62,14 @@ __mpe_fsync(fd)
  * __os_fsync --
  *	Flush a file descriptor.
  *
- * PUBLIC: int __os_fsync __P((DB_ENV *, DB_FH *));
+ * PUBLIC: gint __os_fsync __P((DB_ENV *, DB_FH *));
  */
-int
+gint
 __os_fsync(dbenv, fhp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 {
-	int ret;
+	gint ret;
 
 	/*
 	 * Do nothing if the file descriptor has been marked as not requiring
diff --git a/libdb/os/os_handle.c b/libdb/os/os_handle.c
index 5341f65..8d74809 100644
--- a/libdb/os/os_handle.c
+++ b/libdb/os/os_handle.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,18 +25,18 @@ static const char revid[] = "$Id$";
  * __os_openhandle --
  *	Open a file, using POSIX 1003.1 open flags.
  *
- * PUBLIC: int __os_openhandle __P((DB_ENV *, const char *, int, int, DB_FH *));
+ * PUBLIC: gint __os_openhandle __P((DB_ENV *, const gchar *, int, int, DB_FH *));
  */
-int
+gint
 __os_openhandle(dbenv, name, flags, mode, fhp)
 	DB_ENV *dbenv;
-	const char *name;
-	int flags, mode;
+	const gchar *name;
+	gint flags, mode;
 	DB_FH *fhp;
 {
-	int ret, nrepeat;
+	gint ret, nrepeat;
 #ifdef HAVE_VXWORKS
-	int newflags;
+	gint newflags;
 #endif
 
 	memset(fhp, 0, sizeof(*fhp));
@@ -151,14 +151,14 @@ __os_openhandle(dbenv, name, flags, mode, fhp)
  * __os_closehandle --
  *	Close a file.
  *
- * PUBLIC: int __os_closehandle __P((DB_ENV *, DB_FH *));
+ * PUBLIC: gint __os_closehandle __P((DB_ENV *, DB_FH *));
  */
-int
+gint
 __os_closehandle(dbenv, fhp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 {
-	int ret;
+	gint ret;
 
 	/* Don't close file descriptors that were never opened. */
 	DB_ASSERT(F_ISSET(fhp, DB_FH_VALID) && fhp->fd != -1);
diff --git a/libdb/os/os_id.c b/libdb/os/os_id.c
index 78221d9..dd3e5e6 100644
--- a/libdb/os/os_id.c
+++ b/libdb/os/os_id.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
diff --git a/libdb/os/os_map.c b/libdb/os/os_map.c
index ed3da9d..7e1ffeb 100644
--- a/libdb/os/os_map.c
+++ b/libdb/os/os_map.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -28,19 +28,19 @@ static const char revid[] = "$Id$";
 #include "db_int.h"
 
 #ifdef HAVE_MMAP
-static int __os_map __P((DB_ENV *, char *, DB_FH *, size_t, int, int, void **));
+static gint __os_map __P((DB_ENV *, gchar *, DB_FH *, size_t, int, int, gpointer *));
 #endif
 #ifndef HAVE_SHMGET
-static int __db_nosystemmem __P((DB_ENV *));
+static gint __db_nosystemmem __P((DB_ENV *));
 #endif
 
 /*
  * __os_r_sysattach --
  *	Create/join a shared memory region.
  *
- * PUBLIC: int __os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *));
+ * PUBLIC: gint __os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *));
  */
-int
+gint
 __os_r_sysattach(dbenv, infop, rp)
 	DB_ENV *dbenv;
 	REGINFO *infop;
@@ -65,7 +65,7 @@ __os_r_sysattach(dbenv, infop, rp)
 #if defined(HAVE_SHMGET)
 		{
 		key_t segid;
-		int id, ret;
+		gint id, ret;
 
 		/*
 		 * We could potentially create based on REGION_CREATE_OK, but
@@ -118,7 +118,7 @@ __os_r_sysattach(dbenv, infop, rp)
 		} else
 			id = rp->segid;
 
-		if ((infop->addr = shmat(id, NULL, 0)) == (void *)-1) {
+		if ((infop->addr = shmat(id, NULL, 0)) == (gpointer)-1) {
 			infop->addr = NULL;
 			ret = __os_get_errno();
 			__db_err(dbenv,
@@ -137,7 +137,7 @@ __os_r_sysattach(dbenv, infop, rp)
 #ifdef HAVE_MMAP
 	{
 	DB_FH fh;
-	int ret;
+	gint ret;
 
 	/*
 	 * Try to open/create the shared region file.  We DO NOT need to ensure
@@ -185,13 +185,13 @@ __os_r_sysattach(dbenv, infop, rp)
  * __os_r_sysdetach --
  *	Detach from a shared memory region.
  *
- * PUBLIC: int __os_r_sysdetach __P((DB_ENV *, REGINFO *, int));
+ * PUBLIC: gint __os_r_sysdetach __P((DB_ENV *, REGINFO *, int));
  */
-int
+gint
 __os_r_sysdetach(dbenv, infop, destroy)
 	DB_ENV *dbenv;
 	REGINFO *infop;
-	int destroy;
+	gint destroy;
 {
 	REGION *rp;
 
@@ -199,7 +199,7 @@ __os_r_sysdetach(dbenv, infop, destroy)
 
 	if (F_ISSET(dbenv, DB_ENV_SYSTEM_MEM)) {
 #ifdef HAVE_SHMGET
-		int ret, segid;
+		gint ret, segid;
 
 		/*
 		 * We may be about to remove the memory referenced by rp,
@@ -235,7 +235,7 @@ __os_r_sysdetach(dbenv, infop, destroy)
 		(void)munlock(infop->addr, rp->size);
 #endif
 	if (munmap(infop->addr, rp->size) != 0) {
-		int ret;
+		gint ret;
 
 		ret = __os_get_errno();
 		__db_err(dbenv, "munmap: %s", strerror(ret));
@@ -256,17 +256,17 @@ __os_r_sysdetach(dbenv, infop, destroy)
  * __os_mapfile --
  *	Map in a shared memory file.
  *
- * PUBLIC: int __os_mapfile __P((DB_ENV *,
- * PUBLIC:     char *, DB_FH *, size_t, int, void **));
+ * PUBLIC: gint __os_mapfile __P((DB_ENV *,
+ * PUBLIC:     gchar *, DB_FH *, size_t, int, gpointer *));
  */
-int
+gint
 __os_mapfile(dbenv, path, fhp, len, is_rdonly, addrp)
 	DB_ENV *dbenv;
-	char *path;
+	gchar *path;
 	DB_FH *fhp;
-	int is_rdonly;
+	gint is_rdonly;
 	size_t len;
-	void **addrp;
+	gpointer *addrp;
 {
 #if defined(HAVE_MMAP) && !defined(HAVE_QNX)
 	return (__os_map(dbenv, path, fhp, len, 0, is_rdonly, addrp));
@@ -285,12 +285,12 @@ __os_mapfile(dbenv, path, fhp, len, is_rdonly, addrp)
  * __os_unmapfile --
  *	Unmap the shared memory file.
  *
- * PUBLIC: int __os_unmapfile __P((DB_ENV *, void *, size_t));
+ * PUBLIC: gint __os_unmapfile __P((DB_ENV *, gpointer , size_t));
  */
-int
+gint
 __os_unmapfile(dbenv, addr, len)
 	DB_ENV *dbenv;
-	void *addr;
+	gpointer addr;
 	size_t len;
 {
 	/* If the user replaced the map call, call through their interface. */
@@ -306,7 +306,7 @@ __os_unmapfile(dbenv, addr, len)
 	COMPQUIET(dbenv, NULL);
 #endif
 	{
-		int ret;
+		gint ret;
 
 		while ((ret = munmap(addr, len)) != 0 &&
 		    __os_get_errno() == EINTR)
@@ -328,14 +328,14 @@ __os_unmapfile(dbenv, addr, len)
 static int
 __os_map(dbenv, path, fhp, len, is_region, is_rdonly, addrp)
 	DB_ENV *dbenv;
-	char *path;
+	gchar *path;
 	DB_FH *fhp;
-	int is_region, is_rdonly;
+	gint is_region, is_rdonly;
 	size_t len;
-	void **addrp;
+	gpointer *addrp;
 {
-	void *p;
-	int flags, prot, ret;
+	gpointer p;
+	gint flags, prot, ret;
 
 	/* If the user replaced the map call, call through their interface. */
 	if (DB_GLOBAL(j_map) != NULL)
@@ -396,7 +396,7 @@ __os_map(dbenv, path, fhp, len, is_region, is_rdonly, addrp)
 #define	MAP_FAILED	-1
 #endif
 	if ((p = mmap(NULL,
-	    len, prot, flags, fhp->fd, (off_t)0)) == (void *)MAP_FAILED) {
+	    len, prot, flags, fhp->fd, (off_t)0)) == (gpointer)MAP_FAILED) {
 		ret = __os_get_errno();
 		__db_err(dbenv, "mmap: %s", strerror(ret));
 		return (ret);
diff --git a/libdb/os/os_method.c b/libdb/os/os_method.c
index 2db73f6..0aaac80 100644
--- a/libdb/os/os_method.c
+++ b/libdb/os/os_method.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -18,216 +18,216 @@ static const char revid[] = "$Id$";
 #include "db_int.h"
 
 /*
- * EXTERN: int db_env_set_func_close __P((int (*)(int)));
+ * EXTERN: gint db_env_set_func_close __P((gint (*)(int)));
  */
-int
+gint
 db_env_set_func_close(func_close)
-	int (*func_close) __P((int));
+	gint (*func_close) __P((int));
 {
 	DB_GLOBAL(j_close) = func_close;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_dirfree __P((void (*)(char **, int)));
+ * EXTERN: gint db_env_set_func_dirfree __P((void (*)(gchar **, int)));
  */
-int
+gint
 db_env_set_func_dirfree(func_dirfree)
-	void (*func_dirfree) __P((char **, int));
+	void (*func_dirfree) __P((gchar **, int));
 {
 	DB_GLOBAL(j_dirfree) = func_dirfree;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_dirlist
- * EXTERN:     __P((int (*)(const char *, char ***, int *)));
+ * EXTERN: gint db_env_set_func_dirlist
+ * EXTERN:     __P((gint (*)(const gchar *, gchar ***, gint *)));
  */
-int
+gint
 db_env_set_func_dirlist(func_dirlist)
-	int (*func_dirlist) __P((const char *, char ***, int *));
+	gint (*func_dirlist) __P((const gchar *, gchar ***, gint *));
 {
 	DB_GLOBAL(j_dirlist) = func_dirlist;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_exists __P((int (*)(const char *, int *)));
+ * EXTERN: gint db_env_set_func_exists __P((gint (*)(const gchar *, gint *)));
  */
-int
+gint
 db_env_set_func_exists(func_exists)
-	int (*func_exists) __P((const char *, int *));
+	gint (*func_exists) __P((const gchar *, gint *));
 {
 	DB_GLOBAL(j_exists) = func_exists;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_free __P((void (*)(void *)));
+ * EXTERN: gint db_env_set_func_free __P((void (*)(gpointer)));
  */
-int
+gint
 db_env_set_func_free(func_free)
-	void (*func_free) __P((void *));
+	void (*func_free) __P((gpointer));
 {
 	DB_GLOBAL(j_free) = func_free;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_fsync __P((int (*)(int)));
+ * EXTERN: gint db_env_set_func_fsync __P((gint (*)(int)));
  */
-int
+gint
 db_env_set_func_fsync(func_fsync)
-	int (*func_fsync) __P((int));
+	gint (*func_fsync) __P((int));
 {
 	DB_GLOBAL(j_fsync) = func_fsync;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_ioinfo __P((int (*)(const char *,
+ * EXTERN: gint db_env_set_func_ioinfo __P((gint (*)(const gchar *,
  * EXTERN:     int, u_int32_t *, u_int32_t *, u_int32_t *)));
  */
-int
+gint
 db_env_set_func_ioinfo(func_ioinfo)
-	int (*func_ioinfo)
-	    __P((const char *, int, u_int32_t *, u_int32_t *, u_int32_t *));
+	gint (*func_ioinfo)
+	    __P((const gchar *, int, u_int32_t *, u_int32_t *, u_int32_t *));
 {
 	DB_GLOBAL(j_ioinfo) = func_ioinfo;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_malloc __P((void *(*)(size_t)));
+ * EXTERN: gint db_env_set_func_malloc __P((gpointer (*)(size_t)));
  */
-int
+gint
 db_env_set_func_malloc(func_malloc)
-	void *(*func_malloc) __P((size_t));
+	gpointer (*func_malloc) __P((size_t));
 {
 	DB_GLOBAL(j_malloc) = func_malloc;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_map
- * EXTERN:     __P((int (*)(char *, size_t, int, int, void **)));
+ * EXTERN: gint db_env_set_func_map
+ * EXTERN:     __P((gint (*)(gchar *, size_t, int, int, gpointer *)));
  */
-int
+gint
 db_env_set_func_map(func_map)
-	int (*func_map) __P((char *, size_t, int, int, void **));
+	gint (*func_map) __P((gchar *, size_t, int, int, gpointer *));
 {
 	DB_GLOBAL(j_map) = func_map;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_open __P((int (*)(const char *, int, ...)));
+ * EXTERN: gint db_env_set_func_open __P((gint (*)(const gchar *, int, ...)));
  */
-int
+gint
 db_env_set_func_open(func_open)
-	int (*func_open) __P((const char *, int, ...));
+	gint (*func_open) __P((const gchar *, int, ...));
 {
 	DB_GLOBAL(j_open) = func_open;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_read __P((ssize_t (*)(int, void *, size_t)));
+ * EXTERN: gint db_env_set_func_read __P((ssize_t (*)(int, gpointer , size_t)));
  */
-int
+gint
 db_env_set_func_read(func_read)
-	ssize_t (*func_read) __P((int, void *, size_t));
+	ssize_t (*func_read) __P((int, gpointer , size_t));
 {
 	DB_GLOBAL(j_read) = func_read;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_realloc __P((void *(*)(void *, size_t)));
+ * EXTERN: gint db_env_set_func_realloc __P((gpointer (*)(gpointer , size_t)));
  */
-int
+gint
 db_env_set_func_realloc(func_realloc)
-	void *(*func_realloc) __P((void *, size_t));
+	gpointer (*func_realloc) __P((gpointer , size_t));
 {
 	DB_GLOBAL(j_realloc) = func_realloc;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_rename
- * EXTERN:     __P((int (*)(const char *, const char *)));
+ * EXTERN: gint db_env_set_func_rename
+ * EXTERN:     __P((gint (*)(const gchar *, const gchar *)));
  */
-int
+gint
 db_env_set_func_rename(func_rename)
-	int (*func_rename) __P((const char *, const char *));
+	gint (*func_rename) __P((const gchar *, const gchar *));
 {
 	DB_GLOBAL(j_rename) = func_rename;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_seek
- * EXTERN:     __P((int (*)(int, size_t, db_pgno_t, u_int32_t, int, int)));
+ * EXTERN: gint db_env_set_func_seek
+ * EXTERN:     __P((gint (*)(int, size_t, db_pgno_t, u_int32_t, int, int)));
  */
-int
+gint
 db_env_set_func_seek(func_seek)
-	int (*func_seek) __P((int, size_t, db_pgno_t, u_int32_t, int, int));
+	gint (*func_seek) __P((int, size_t, db_pgno_t, u_int32_t, int, int));
 {
 	DB_GLOBAL(j_seek) = func_seek;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_sleep __P((int (*)(u_long, u_long)));
+ * EXTERN: gint db_env_set_func_sleep __P((gint (*)(u_long, u_long)));
  */
-int
+gint
 db_env_set_func_sleep(func_sleep)
-	int (*func_sleep) __P((u_long, u_long));
+	gint (*func_sleep) __P((u_long, u_long));
 {
 	DB_GLOBAL(j_sleep) = func_sleep;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_unlink __P((int (*)(const char *)));
+ * EXTERN: gint db_env_set_func_unlink __P((gint (*)(const gchar *)));
  */
-int
+gint
 db_env_set_func_unlink(func_unlink)
-	int (*func_unlink) __P((const char *));
+	gint (*func_unlink) __P((const gchar *));
 {
 	DB_GLOBAL(j_unlink) = func_unlink;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_unmap __P((int (*)(void *, size_t)));
+ * EXTERN: gint db_env_set_func_unmap __P((gint (*)(gpointer , size_t)));
  */
-int
+gint
 db_env_set_func_unmap(func_unmap)
-	int (*func_unmap) __P((void *, size_t));
+	gint (*func_unmap) __P((gpointer , size_t));
 {
 	DB_GLOBAL(j_unmap) = func_unmap;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_write
- * EXTERN:     __P((ssize_t (*)(int, const void *, size_t)));
+ * EXTERN: gint db_env_set_func_write
+ * EXTERN:     __P((ssize_t (*)(int, gconstpointer , size_t)));
  */
-int
+gint
 db_env_set_func_write(func_write)
-	ssize_t (*func_write) __P((int, const void *, size_t));
+	ssize_t (*func_write) __P((int, gconstpointer , size_t));
 {
 	DB_GLOBAL(j_write) = func_write;
 	return (0);
 }
 
 /*
- * EXTERN: int db_env_set_func_yield __P((int (*)(void)));
+ * EXTERN: gint db_env_set_func_yield __P((gint (*)(void)));
  */
-int
+gint
 db_env_set_func_yield(func_yield)
-	int (*func_yield) __P((void));
+	gint (*func_yield) __P((void));
 {
 	DB_GLOBAL(j_yield) = func_yield;
 	return (0);
diff --git a/libdb/os/os_oflags.c b/libdb/os/os_oflags.c
index b5c68c1..2fdfd72 100644
--- a/libdb/os/os_oflags.c
+++ b/libdb/os/os_oflags.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -28,7 +28,7 @@ static const char revid[] = "$Id$";
  */
 u_int32_t
 __db_oflags(oflags)
-	int oflags;
+	gint oflags;
 {
 	u_int32_t dbflags;
 
@@ -64,13 +64,13 @@ __db_oflags(oflags)
  * __db_omode --
  *	Convert a permission string to the correct open(2) flags.
  *
- * PUBLIC: int __db_omode __P((const char *));
+ * PUBLIC: gint __db_omode __P((const gchar *));
  */
-int
+gint
 __db_omode(perm)
-	const char *perm;
+	const gchar *perm;
 {
-	int mode;
+	gint mode;
 
 #ifdef DB_WIN32
 #ifndef	S_IRUSR
diff --git a/libdb/os/os_open.c b/libdb/os/os_open.c
index 08749eb..60157ce 100644
--- a/libdb/os/os_open.c
+++ b/libdb/os/os_open.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,24 +21,24 @@ static const char revid[] = "$Id$";
 #include "db_int.h"
 
 #ifdef HAVE_QNX
-static int __os_region_open __P((DB_ENV *, const char *, int, int, DB_FH *));
+static gint __os_region_open __P((DB_ENV *, const gchar *, int, int, DB_FH *));
 #endif
 
 /*
  * __os_open --
  *	Open a file.
  *
- * PUBLIC: int __os_open __P((DB_ENV *, const char *, u_int32_t, int, DB_FH *));
+ * PUBLIC: gint __os_open __P((DB_ENV *, const gchar *, u_int32_t, int, DB_FH *));
  */
-int
+gint
 __os_open(dbenv, name, flags, mode, fhp)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 	DB_FH *fhp;
 {
-	int oflags, ret;
+	gint oflags, ret;
 
 	oflags = 0;
 
@@ -145,13 +145,13 @@ __os_open(dbenv, name, flags, mode, fhp)
 static int
 __os_region_open(dbenv, name, oflags, mode, fhp)
 	DB_ENV *dbenv;
-	const char *name;
-	int oflags;
-	int mode;
+	const gchar *name;
+	gint oflags;
+	gint mode;
 	DB_FH *fhp;
 {
-	int ret;
-	char *newname;
+	gint ret;
+	gchar *newname;
 
 	if ((ret = __os_shmname(dbenv, name, &newname)) != 0)
 		goto err;
@@ -185,18 +185,18 @@ err:
  *	Translate a pathname into a shm_open memory object name.
  *
  * PUBLIC: #ifdef HAVE_QNX
- * PUBLIC: int __os_shmname __P((DB_ENV *, const char *, char **));
+ * PUBLIC: gint __os_shmname __P((DB_ENV *, const gchar *, gchar **));
  * PUBLIC: #endif
  */
-int
+gint
 __os_shmname(dbenv, name, newnamep)
 	DB_ENV *dbenv;
-	const char *name;
-	char **newnamep;
+	const gchar *name;
+	gchar **newnamep;
 {
-	int ret;
+	gint ret;
 	size_t size;
-	char *p, *q, *tmpname;
+	gchar *p, *q, *tmpname;
 
 	*newnamep = NULL;
 
diff --git a/libdb/os/os_region.c b/libdb/os/os_region.c
index d810e8a..e803db0 100644
--- a/libdb/os/os_region.c
+++ b/libdb/os/os_region.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -22,15 +22,15 @@ static const char revid[] = "$Id$";
  * __os_r_attach --
  *	Attach to a shared memory region.
  *
- * PUBLIC: int __os_r_attach __P((DB_ENV *, REGINFO *, REGION *));
+ * PUBLIC: gint __os_r_attach __P((DB_ENV *, REGINFO *, REGION *));
  */
-int
+gint
 __os_r_attach(dbenv, infop, rp)
 	DB_ENV *dbenv;
 	REGINFO *infop;
 	REGION *rp;
 {
-	int ret;
+	gint ret;
 	/* Round off the requested size for the underlying VM. */
 	OS_VMROUNDOFF(rp->size);
 
@@ -89,13 +89,13 @@ __os_r_attach(dbenv, infop, rp)
  * __os_r_detach --
  *	Detach from a shared memory region.
  *
- * PUBLIC: int __os_r_detach __P((DB_ENV *, REGINFO *, int));
+ * PUBLIC: gint __os_r_detach __P((DB_ENV *, REGINFO *, int));
  */
-int
+gint
 __os_r_detach(dbenv, infop, destroy)
 	DB_ENV *dbenv;
 	REGINFO *infop;
-	int destroy;
+	gint destroy;
 {
 	REGION *rp;
 
diff --git a/libdb/os/os_rename.c b/libdb/os/os_rename.c
index 94ed6fc..18a332c 100644
--- a/libdb/os/os_rename.c
+++ b/libdb/os/os_rename.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,16 +25,16 @@ static const char revid[] = "$Id$";
  *	Rename a file.  If flags is non-zero, then errors are OK and we
  * should not output an error message.
  *
- * PUBLIC: int __os_rename __P((DB_ENV *,
- * PUBLIC:    const char *, const char *, u_int32_t));
+ * PUBLIC: gint __os_rename __P((DB_ENV *,
+ * PUBLIC:    const gchar *, const gchar *, u_int32_t));
  */
-int
+gint
 __os_rename(dbenv, old, new, flags)
 	DB_ENV *dbenv;
-	const char *old, *new;
+	const gchar *old, *new;
 	u_int32_t flags;
 {
-	int ret;
+	gint ret;
 
 	do {
 		ret = DB_GLOBAL(j_rename) != NULL ?
diff --git a/libdb/os/os_root.c b/libdb/os/os_root.c
index 5dc63c9..91b9346 100644
--- a/libdb/os/os_root.c
+++ b/libdb/os/os_root.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,9 +23,9 @@ static const char revid[] = "$Id$";
  * __os_isroot --
  *	Return if user has special permissions.
  *
- * PUBLIC: int __os_isroot __P((void));
+ * PUBLIC: gint __os_isroot __P((void));
  */
-int
+gint
 __os_isroot()
 {
 #ifdef HAVE_GETUID
diff --git a/libdb/os/os_rpath.c b/libdb/os/os_rpath.c
index 7b34913..e17473c 100644
--- a/libdb/os/os_rpath.c
+++ b/libdb/os/os_rpath.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,16 +24,16 @@ static const char revid[] = "$Id$";
  * __db_rpath --
  *	Return the last path separator in the path or NULL if none found.
  *
- * PUBLIC: char *__db_rpath __P((const char *));
+ * PUBLIC: gchar *__db_rpath __P((const gchar *));
  */
-char *
+gchar *
 __db_rpath(path)
-	const char *path;
+	const gchar *path;
 {
-	const char *s, *last;
+	const gchar *s, *last;
 #ifdef HAVE_VXWORKS
 	DEV_HDR *dummy;
-	char *ptail;
+	gchar *ptail;
 
 	/*
 	 * VxWorks devices can be rooted at any name.  We want to
@@ -48,7 +48,7 @@ __db_rpath(path)
 	 * We do not support the first usage here.
 	 * XXX
 	 */
-	if ((dummy = iosDevFind((char *)path, &ptail)) == NULL)
+	if ((dummy = iosDevFind((gchar *)path, &ptail)) == NULL)
 		s = path;
 	else
 		s = ptail;
@@ -65,5 +65,5 @@ __db_rpath(path)
 		for (; s[0] != '\0'; ++s)
 			if (s[0] == PATH_SEPARATOR[0])
 				last = s;
-	return ((char *)last);
+	return ((gchar *)last);
 }
diff --git a/libdb/os/os_rw.c b/libdb/os/os_rw.c
index c21abb7..19ff32f 100644
--- a/libdb/os/os_rw.c
+++ b/libdb/os/os_rw.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -22,24 +22,24 @@ static const char revid[] = "$Id$";
 #include "db_int.h"
 
 #ifdef HAVE_FILESYSTEM_NOTZERO
-static int __os_zerofill __P((DB_ENV *, DB_FH *));
+static gint __os_zerofill __P((DB_ENV *, DB_FH *));
 #endif
-static int __os_physwrite __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
+static gint __os_physwrite __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
 
 /*
  * __os_io --
  *	Do an I/O.
  *
- * PUBLIC: int __os_io __P((DB_ENV *, DB_IO *, int, size_t *));
+ * PUBLIC: gint __os_io __P((DB_ENV *, DB_IO *, int, size_t *));
  */
-int
+gint
 __os_io(dbenv, db_iop, op, niop)
 	DB_ENV *dbenv;
 	DB_IO *db_iop;
-	int op;
+	gint op;
 	size_t *niop;
 {
-	int ret;
+	gint ret;
 
 	/* Check for illegal usage. */
 	DB_ASSERT(F_ISSET(db_iop->fhp, DB_FH_VALID) && db_iop->fhp->fd != -1);
@@ -93,19 +93,19 @@ err:	MUTEX_THREAD_UNLOCK(dbenv, db_iop->mutexp);
  * __os_read --
  *	Read from a file handle.
  *
- * PUBLIC: int __os_read __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
+ * PUBLIC: gint __os_read __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
  */
-int
+gint
 __os_read(dbenv, fhp, addr, len, nrp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
-	void *addr;
+	gpointer addr;
 	size_t len;
 	size_t *nrp;
 {
 	size_t offset;
 	ssize_t nr;
-	int ret;
+	gint ret;
 	u_int8_t *taddr;
 
 	/* Check for illegal usage. */
@@ -133,13 +133,13 @@ retry:		if ((nr = DB_GLOBAL(j_read) != NULL ?
  * __os_write --
  *	Write to a file handle.
  *
- * PUBLIC: int __os_write __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
+ * PUBLIC: gint __os_write __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
  */
-int
+gint
 __os_write(dbenv, fhp, addr, len, nwp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
-	void *addr;
+	gpointer addr;
 	size_t len;
 	size_t *nwp;
 {
@@ -149,7 +149,7 @@ __os_write(dbenv, fhp, addr, len, nwp)
 #ifdef HAVE_FILESYSTEM_NOTZERO
 	/* Zero-fill as necessary. */
 	if (__os_fs_notzero()) {
-		int ret;
+		gint ret;
 		if ((ret = __os_zerofill(dbenv, fhp)) != 0)
 			return (ret);
 	}
@@ -165,13 +165,13 @@ static int
 __os_physwrite(dbenv, fhp, addr, len, nwp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
-	void *addr;
+	gpointer addr;
 	size_t len;
 	size_t *nwp;
 {
 	size_t offset;
 	ssize_t nw;
-	int ret;
+	gint ret;
 	u_int8_t *taddr;
 
 #if defined(HAVE_FILESYSTEM_NOTZERO) && defined(DIAGNOSTIC)
@@ -222,7 +222,7 @@ __os_zerofill(dbenv, fhp)
 	off_t stat_offset, write_offset;
 	size_t blen, nw;
 	u_int32_t bytes, mbytes;
-	int group_sync, need_free, ret;
+	gint group_sync, need_free, ret;
 	u_int8_t buf[8 * 1024], *bp;
 
 	/* Calculate the byte offset of the next write. */
diff --git a/libdb/os/os_seek.c b/libdb/os/os_seek.c
index 339836d..4915dae 100644
--- a/libdb/os/os_seek.c
+++ b/libdb/os/os_seek.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,21 +25,21 @@ static const char revid[] = "$Id$";
  * __os_seek --
  *	Seek to a page/byte offset in the file.
  *
- * PUBLIC: int __os_seek __P((DB_ENV *,
+ * PUBLIC: gint __os_seek __P((DB_ENV *,
  * PUBLIC:      DB_FH *, size_t, db_pgno_t, u_int32_t, int, DB_OS_SEEK));
  */
-int
+gint
 __os_seek(dbenv, fhp, pgsize, pageno, relative, isrewind, db_whence)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 	size_t pgsize;
 	db_pgno_t pageno;
 	u_int32_t relative;
-	int isrewind;
+	gint isrewind;
 	DB_OS_SEEK db_whence;
 {
 	off_t offset;
-	int ret, whence;
+	gint ret, whence;
 
 	switch (db_whence) {
 	case DB_OS_SEEK_CUR:
diff --git a/libdb/os/os_sleep.c b/libdb/os/os_sleep.c
index fb1b68d..32d9830 100644
--- a/libdb/os/os_sleep.c
+++ b/libdb/os/os_sleep.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -45,15 +45,15 @@ static const char revid[] = "$Id$";
  * __os_sleep --
  *	Yield the processor for a period of time.
  *
- * PUBLIC: int __os_sleep __P((DB_ENV *, u_long, u_long));
+ * PUBLIC: gint __os_sleep __P((DB_ENV *, u_long, u_long));
  */
-int
+gint
 __os_sleep(dbenv, secs, usecs)
 	DB_ENV *dbenv;
 	u_long secs, usecs;		/* Seconds and microseconds. */
 {
 	struct timeval t;
-	int ret;
+	gint ret;
 
 	/* Don't require that the values be normalized. */
 	for (; usecs >= 1000000; usecs -= 1000000)
diff --git a/libdb/os/os_spin.c b/libdb/os/os_spin.c
index 872f523..95c3158 100644
--- a/libdb/os/os_spin.c
+++ b/libdb/os/os_spin.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,7 +24,7 @@ static const char revid[] = "$Id$";
 #include "db_int.h"
 
 #if defined(HAVE_PSTAT_GETDYNAMIC)
-static int __os_pstat_getdynamic __P((void));
+static gint __os_pstat_getdynamic __P((void));
 
 /*
  * __os_pstat_getdynamic --
@@ -41,7 +41,7 @@ __os_pstat_getdynamic()
 #endif
 
 #if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
-static int __os_sysconf __P((void));
+static gint __os_sysconf __P((void));
 
 /*
  * __os_sysconf --
@@ -60,9 +60,9 @@ __os_sysconf()
  * __os_spin --
  *	Return the number of default spins before blocking.
  *
- * PUBLIC: int __os_spin __P((DB_ENV *));
+ * PUBLIC: gint __os_spin __P((DB_ENV *));
  */
-int
+gint
 __os_spin(dbenv)
 	DB_ENV *dbenv;
 {
diff --git a/libdb/os/os_stat.c b/libdb/os/os_stat.c
index 6d0426b..8579ff2 100644
--- a/libdb/os/os_stat.c
+++ b/libdb/os/os_stat.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,14 +24,14 @@ static const char revid[] = "$Id$";
  * __os_exists --
  *	Return if the file exists.
  *
- * PUBLIC: int __os_exists __P((const char *, int *));
+ * PUBLIC: gint __os_exists __P((const gchar *, gint *));
  */
-int
+gint
 __os_exists(path, isdirp)
-	const char *path;
-	int *isdirp;
+	const gchar *path;
+	gint *isdirp;
 {
-	int ret;
+	gint ret;
 	struct stat sb;
 
 	if (DB_GLOBAL(j_exists) != NULL)
@@ -40,7 +40,7 @@ __os_exists(path, isdirp)
 	do {
 		ret =
 #ifdef HAVE_VXWORKS
-		    stat((char *)path, &sb);
+		    stat((gchar *)path, &sb);
 #else
 		    stat(path, &sb);
 #endif
@@ -70,17 +70,17 @@ __os_exists(path, isdirp)
  *	Return file size and I/O size; abstracted to make it easier
  *	to replace.
  *
- * PUBLIC: int __os_ioinfo __P((DB_ENV *, const char *,
+ * PUBLIC: gint __os_ioinfo __P((DB_ENV *, const gchar *,
  * PUBLIC:    DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *));
  */
-int
+gint
 __os_ioinfo(dbenv, path, fhp, mbytesp, bytesp, iosizep)
 	DB_ENV *dbenv;
-	const char *path;
+	const gchar *path;
 	DB_FH *fhp;
 	u_int32_t *mbytesp, *bytesp, *iosizep;
 {
-	int ret;
+	gint ret;
 	struct stat sb;
 
 	if (DB_GLOBAL(j_ioinfo) != NULL)
diff --git a/libdb/os/os_tmpdir.c b/libdb/os/os_tmpdir.c
index e09385e..a1619f4 100644
--- a/libdb/os/os_tmpdir.c
+++ b/libdb/os/os_tmpdir.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -30,24 +30,24 @@ static const char revid[] = "$Id$";
  * The order of items in the list structure and the order of checks in
  * the environment are documented.
  *
- * PUBLIC: int __os_tmpdir __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __os_tmpdir __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __os_tmpdir(dbenv, flags)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 {
-	int isdir;
+	gint isdir;
 
 	/*
 	 * !!!
 	 * Don't change this to:
 	 *
-	 *	static const char * const list[]
+	 *	static const gchar * const list[]
 	 *
 	 * because it creates a text relocation in position independent code.
 	 */
-	static const char * list[] = {
+	static const gchar * list[] = {
 		"/var/tmp",
 		"/usr/tmp",
 		"/temp",		/* Windows. */
@@ -56,7 +56,7 @@ __os_tmpdir(dbenv, flags)
 		"C:/tmp",		/* Windows. */
 		NULL
 	};
-	const char * const *lp, *p;
+	const gchar * const *lp, *p;
 
 	/* Use the environment if it's permitted and initialized. */
 	if (LF_ISSET(DB_USE_ENVIRON) ||
@@ -99,7 +99,7 @@ __os_tmpdir(dbenv, flags)
 #ifdef DB_WIN32
 	/* Get the path to the temporary directory. */
 	{int len;
-	char *eos, temp[MAXPATHLEN + 1];
+	gchar *eos, temp[MAXPATHLEN + 1];
 
 		if ((len = GetTempPath(sizeof(temp) - 1, temp)) > 2) {
 			eos = &temp[len];
diff --git a/libdb/os/os_unlink.c b/libdb/os/os_unlink.c
index ea3a8a8..b74f222 100644
--- a/libdb/os/os_unlink.c
+++ b/libdb/os/os_unlink.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,16 +24,16 @@ static const char revid[] = "$Id$";
  * __os_region_unlink --
  *	Remove a shared memory object file.
  *
- * PUBLIC: int __os_region_unlink __P((DB_ENV *, const char *));
+ * PUBLIC: gint __os_region_unlink __P((DB_ENV *, const gchar *));
  */
-int
+gint
 __os_region_unlink(dbenv, path)
 	DB_ENV *dbenv;
-	const char *path;
+	const gchar *path;
 {
 #ifdef HAVE_QNX
-	int ret;
-	char *newname;
+	gint ret;
+	gchar *newname;
 
 	if ((ret = __os_shmname(dbenv, path, &newname)) != 0)
 		goto err;
@@ -60,19 +60,19 @@ err:
  * __os_unlink --
  *	Remove a file.
  *
- * PUBLIC: int __os_unlink __P((DB_ENV *, const char *));
+ * PUBLIC: gint __os_unlink __P((DB_ENV *, const gchar *));
  */
-int
+gint
 __os_unlink(dbenv, path)
 	DB_ENV *dbenv;
-	const char *path;
+	const gchar *path;
 {
-	int ret;
+	gint ret;
 
 retry:	ret = DB_GLOBAL(j_unlink) != NULL ?
 	    DB_GLOBAL(j_unlink)(path) :
 #ifdef HAVE_VXWORKS
-	    unlink((char *)path);
+	    unlink((gchar *)path);
 #else
 	    unlink(path);
 #endif
diff --git a/libdb/os_vxworks/os_vx_abs.c b/libdb/os_vxworks/os_vx_abs.c
index 7d9bad4..e59f4b4 100644
--- a/libdb/os_vxworks/os_vx_abs.c
+++ b/libdb/os_vxworks/os_vx_abs.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -18,18 +18,18 @@ static const char revid[] = "$Id$";
  * __os_abspath --
  *	Return if a path is an absolute path.
  */
-int
+gint
 __os_abspath(path)
-	const char *path;
+	const gchar *path;
 {
 	DEV_HDR *dummy;
-	char *ptail;
+	gchar *ptail;
 
 	/*
 	 * VxWorks devices can be rooted at any name at all.
 	 * Use iosDevFind() to see if name matches any of our devices.
 	 */
-	if ((dummy = iosDevFind((char *)path, &ptail)) == NULL)
+	if ((dummy = iosDevFind((gchar *)path, &ptail)) == NULL)
 		return (0);
 	/*
 	 * If the routine used a device, then ptail points to the
diff --git a/libdb/os_vxworks/os_vx_config.c b/libdb/os_vxworks/os_vx_config.c
index 6ccc12d..e3ceb66 100644
--- a/libdb/os_vxworks/os_vx_config.c
+++ b/libdb/os_vxworks/os_vx_config.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,9 +17,9 @@ static const char revid[] = "$Id$";
  * __os_fs_notzero --
  *	Return 1 if allocated filesystem blocks are not zeroed.
  *
- * PUBLIC: int __os_fs_notzero __P((void));
+ * PUBLIC: gint __os_fs_notzero __P((void));
  */
-int
+gint
 __os_fs_notzero()
 {
 	/*
diff --git a/libdb/os_vxworks/os_vx_map.c b/libdb/os_vxworks/os_vx_map.c
index c4ae7fe..9bf223f 100644
--- a/libdb/os_vxworks/os_vx_map.c
+++ b/libdb/os_vxworks/os_vx_map.c
@@ -11,7 +11,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -38,39 +38,39 @@ static const char revid[] = "$Id$";
  * list of already open segments.
  */
 typedef struct {
-	void *segment;			/* Segment address. */
+	gpointer segment;			/* Segment address. */
 	u_int32_t size;			/* Segment size. */
-	char *name;			/* Segment name. */
+	gchar *name;			/* Segment name. */
 	long segid;			/* Segment ID. */
 } os_segdata_t;
 
 static os_segdata_t *__os_segdata;	/* Segment table. */
-static int __os_segdata_size;		/* Segment table size. */
+static gint __os_segdata_size;		/* Segment table size. */
 
 #define	OS_SEGDATA_STARTING_SIZE 16
 #define	OS_SEGDATA_INCREMENT	 16
 
-static int __os_segdata_allocate
-	       __P((DB_ENV *, const char *, REGINFO *, REGION *));
-static int __os_segdata_find_byname
-	       __P((DB_ENV *, const char *, REGINFO *, REGION *));
-static int __os_segdata_init __P((DB_ENV *));
-static int __os_segdata_new __P((DB_ENV *, int *));
-static int __os_segdata_release __P((DB_ENV *, REGION *, int));
+static gint __os_segdata_allocate
+	       __P((DB_ENV *, const gchar *, REGINFO *, REGION *));
+static gint __os_segdata_find_byname
+	       __P((DB_ENV *, const gchar *, REGINFO *, REGION *));
+static gint __os_segdata_init __P((DB_ENV *));
+static gint __os_segdata_new __P((DB_ENV *, gint *));
+static gint __os_segdata_release __P((DB_ENV *, REGION *, int));
 
 /*
  * __os_r_sysattach --
  *	Create/join a shared memory region.
  *
- * PUBLIC: int __os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *));
+ * PUBLIC: gint __os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *));
  */
-int
+gint
 __os_r_sysattach(dbenv, infop, rp)
 	DB_ENV *dbenv;
 	REGINFO *infop;
 	REGION *rp;
 {
-	int ret;
+	gint ret;
 
 	if (__os_segdata == NULL)
 		__os_segdata_init(dbenv);
@@ -130,13 +130,13 @@ out:
  * __os_r_sysdetach --
  *	Detach from a shared region.
  *
- * PUBLIC: int __os_r_sysdetach __P((DB_ENV *, REGINFO *, int));
+ * PUBLIC: gint __os_r_sysdetach __P((DB_ENV *, REGINFO *, int));
  */
-int
+gint
 __os_r_sysdetach(dbenv, infop, destroy)
 	DB_ENV *dbenv;
 	REGINFO *infop;
-	int destroy;
+	gint destroy;
 {
 	/*
 	 * If just detaching, there is no mapping to discard.
@@ -151,17 +151,17 @@ __os_r_sysdetach(dbenv, infop, destroy)
  * __os_mapfile --
  *	Map in a shared memory file.
  *
- * PUBLIC: int __os_mapfile __P((DB_ENV *,
- * PUBLIC:    char *, DB_FH *, size_t, int, void **));
+ * PUBLIC: gint __os_mapfile __P((DB_ENV *,
+ * PUBLIC:    gchar *, DB_FH *, size_t, int, gpointer *));
  */
-int
+gint
 __os_mapfile(dbenv, path, fhp, len, is_rdonly, addrp)
 	DB_ENV *dbenv;
-	char *path;
+	gchar *path;
 	DB_FH *fhp;
-	int is_rdonly;
+	gint is_rdonly;
 	size_t len;
-	void **addrp;
+	gpointer *addrp;
 {
 	/* We cannot map in regular files in VxWorks. */
 	COMPQUIET(dbenv, NULL);
@@ -177,12 +177,12 @@ __os_mapfile(dbenv, path, fhp, len, is_rdonly, addrp)
  * __os_unmapfile --
  *	Unmap the shared memory file.
  *
- * PUBLIC: int __os_unmapfile __P((DB_ENV *, void *, size_t));
+ * PUBLIC: gint __os_unmapfile __P((DB_ENV *, gpointer , size_t));
  */
-int
+gint
 __os_unmapfile(dbenv, addr, len)
 	DB_ENV *dbenv;
-	void *addr;
+	gpointer addr;
 	size_t len;
 {
 	/* We cannot map in regular files in VxWorks. */
@@ -201,7 +201,7 @@ static int
 __os_segdata_init(dbenv)
 	DB_ENV *dbenv;
 {
-	int ret;
+	gint ret;
 
 	if (__os_segdata != NULL) {
 		__db_err(dbenv, "shared memory segment already exists");
@@ -226,14 +226,14 @@ __os_segdata_init(dbenv)
  *	Currently not called.  This function should be called if the
  *	user creates a function to unload or shutdown.
  *
- * PUBLIC: int __os_segdata_destroy __P((DB_ENV *));
+ * PUBLIC: gint __os_segdata_destroy __P((DB_ENV *));
  */
-int
+gint
 __os_segdata_destroy(dbenv)
 	DB_ENV *dbenv;
 {
 	os_segdata_t *p;
-	int i;
+	gint i;
 
 	if (__os_segdata == NULL)
 		return (0);
@@ -270,12 +270,12 @@ __os_segdata_destroy(dbenv)
 static int
 __os_segdata_allocate(dbenv, name, infop, rp)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 	REGINFO *infop;
 	REGION *rp;
 {
 	os_segdata_t *p;
-	int id, ret;
+	gint id, ret;
 
 	if ((ret = __os_segdata_new(dbenv, &id)) != 0)
 		return (ret);
@@ -307,10 +307,10 @@ __os_segdata_allocate(dbenv, name, infop, rp)
 static int
 __os_segdata_new(dbenv, segidp)
 	DB_ENV *dbenv;
-	int *segidp;
+	gint *segidp;
 {
 	os_segdata_t *p;
-	int i, newsize, ret;
+	gint i, newsize, ret;
 
 	if (__os_segdata == NULL) {
 		__db_err(dbenv, "shared memory segment not initialized");
@@ -348,18 +348,18 @@ __os_segdata_new(dbenv, segidp)
  * Assumes it is called with the SEGDATA lock taken.
  *
  * PUBLIC: __os_segdata_find_byname
- * PUBLIC:     __P((DB_ENV *, const char *, REGINFO *, REGION *));
+ * PUBLIC:     __P((DB_ENV *, const gchar *, REGINFO *, REGION *));
  */
 static int
 __os_segdata_find_byname(dbenv, name, infop, rp)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 	REGINFO *infop;
 	REGION *rp;
 {
 	os_segdata_t *p;
 	long segid;
-	int i;
+	gint i;
 
 	if (__os_segdata == NULL) {
 		__db_err(dbenv, "shared memory segment not initialized");
@@ -406,7 +406,7 @@ static int
 __os_segdata_release(dbenv, rp, is_locked)
 	DB_ENV *dbenv;
 	REGION *rp;
-	int is_locked;
+	gint is_locked;
 {
 	os_segdata_t *p;
 
diff --git a/libdb/os_win32/os_abs.c b/libdb/os_win32/os_abs.c
index b31cce9..aa75797 100644
--- a/libdb/os_win32/os_abs.c
+++ b/libdb/os_win32/os_abs.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,9 +17,9 @@ static const char revid[] = "$Id$";
  * __os_abspath --
  *	Return if a path is an absolute path.
  */
-int
+gint
 __os_abspath(path)
-	const char *path;
+	const gchar *path;
 {
 	/*
 	 * !!!
diff --git a/libdb/os_win32/os_clock.c b/libdb/os_win32/os_clock.c
index 472f7a0..594efd4 100644
--- a/libdb/os_win32/os_clock.c
+++ b/libdb/os_win32/os_clock.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -21,7 +21,7 @@ static const char revid[] = "$Id$";
  * __os_clock --
  *	Return the current time-of-day clock in seconds and microseconds.
  */
-int
+gint
 __os_clock(dbenv, secsp, usecsp)
 	DB_ENV *dbenv;
 	u_int32_t *secsp, *usecsp;	/* Seconds and microseconds. */
diff --git a/libdb/os_win32/os_config.c b/libdb/os_win32/os_config.c
index dd9493b..bb76652 100644
--- a/libdb/os_win32/os_config.c
+++ b/libdb/os_win32/os_config.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,7 +17,7 @@ static const char revid[] = "$Id$";
  * __os_fs_notzero --
  *	Return 1 if allocated filesystem blocks are not zeroed.
  */
-int
+gint
 __os_fs_notzero()
 {
 	/*
diff --git a/libdb/os_win32/os_dir.c b/libdb/os_win32/os_dir.c
index 034c4b5..1f1e0ff 100644
--- a/libdb/os_win32/os_dir.c
+++ b/libdb/os_win32/os_dir.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,12 +17,12 @@ static const char revid[] = "$Id$";
  * __os_dirlist --
  *	Return a list of the files in a directory.
  */
-int
+gint
 __os_dirlist(dbenv, dir, namesp, cntp)
 	DB_ENV *dbenv;
-	const char *dir;
-	char ***namesp;
-	int *cntp;
+	const gchar *dir;
+	gchar ***namesp;
+	gint *cntp;
 {
 	struct _finddata_t fdata;
 #ifdef _WIN64
@@ -30,8 +30,8 @@ __os_dirlist(dbenv, dir, namesp, cntp)
 #else
 	long dirhandle;
 #endif
-	int arraysz, cnt, finished, ret;
-	char **names, filespec[MAXPATHLEN];
+	gint arraysz, cnt, finished, ret;
+	gchar **names, filespec[MAXPATHLEN];
 
 	if (DB_GLOBAL(j_dirlist) != NULL)
 		return (DB_GLOBAL(j_dirlist)(dir, namesp, cntp));
@@ -72,8 +72,8 @@ nomem:	if (names != NULL)
 void
 __os_dirfree(dbenv, names, cnt)
 	DB_ENV *dbenv;
-	char **names;
-	int cnt;
+	gchar **names;
+	gint cnt;
 {
 	if (DB_GLOBAL(j_dirfree) != NULL) {
 		DB_GLOBAL(j_dirfree)(names, cnt);
diff --git a/libdb/os_win32/os_errno.c b/libdb/os_win32/os_errno.c
index a030925..12edc58 100644
--- a/libdb/os_win32/os_errno.c
+++ b/libdb/os_win32/os_errno.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,7 +17,7 @@ static const char revid[] = "$Id$";
  * __os_get_errno --
  *	Return the value of errno.
  */
-int
+gint
 __os_get_errno()
 {
 	/* This routine must be able to return the same value repeatedly. */
@@ -30,7 +30,7 @@ __os_get_errno()
  */
 void
 __os_set_errno(evalue)
-	int evalue;
+	gint evalue;
 {
 	errno = evalue;
 }
@@ -49,14 +49,14 @@ __os_set_errno(evalue)
  *	  here.
  *
  * PUBLIC: #if defined(DB_WIN32)
- * PUBLIC: int __os_win32_errno __P((void));
+ * PUBLIC: gint __os_win32_errno __P((void));
  * PUBLIC: #endif
  */
-int
+gint
 __os_win32_errno(void)
 {
 	DWORD last_error;
-	int ret;
+	gint ret;
 
 	/* Ignore errno - we used to check it here. */
 
diff --git a/libdb/os_win32/os_fid.c b/libdb/os_win32/os_fid.c
index 4d73710..fba8493 100644
--- a/libdb/os_win32/os_fid.c
+++ b/libdb/os_win32/os_fid.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -20,17 +20,17 @@ static u_int32_t fid_serial = SERIAL_INIT;
  * __os_fileid --
  *	Return a unique identifier for a file.
  */
-int
+gint
 __os_fileid(dbenv, fname, unique_okay, fidp)
 	DB_ENV *dbenv;
-	const char *fname;
-	int unique_okay;
+	const gchar *fname;
+	gint unique_okay;
 	u_int8_t *fidp;
 {
 	size_t i;
 	u_int32_t tmp;
 	u_int8_t *p;
-	int ret;
+	gint ret;
 
 	/*
 	 * The documentation for GetFileInformationByHandle() states that the
diff --git a/libdb/os_win32/os_fsync.c b/libdb/os_win32/os_fsync.c
index b99fb61..cf23275 100644
--- a/libdb/os_win32/os_fsync.c
+++ b/libdb/os_win32/os_fsync.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,15 +25,15 @@ static const char revid[] = "$Id$";
  * __os_fsync --
  *	Flush a file descriptor.
  *
- * PUBLIC: int __os_fsync __P((DB_ENV *, DB_FH *));
+ * PUBLIC: gint __os_fsync __P((DB_ENV *, DB_FH *));
  */
-int
+gint
 __os_fsync(dbenv, fhp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 {
 	BOOL success;
-	int ret;
+	gint ret;
 
 	/*
 	 * Do nothing if the file descriptor has been marked as not requiring
diff --git a/libdb/os_win32/os_handle.c b/libdb/os_win32/os_handle.c
index 3e36daa..ea8b9f3 100644
--- a/libdb/os_win32/os_handle.c
+++ b/libdb/os_win32/os_handle.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,16 +25,16 @@ static const char revid[] = "$Id$";
  * __os_openhandle --
  *	Open a file, using POSIX 1003.1 open flags.
  *
- * PUBLIC: int __os_openhandle __P((DB_ENV *, const char *, int, int, DB_FH *));
+ * PUBLIC: gint __os_openhandle __P((DB_ENV *, const gchar *, int, int, DB_FH *));
  */
-int
+gint
 __os_openhandle(dbenv, name, flags, mode, fhp)
 	DB_ENV *dbenv;
-	const char *name;
-	int flags, mode;
+	const gchar *name;
+	gint flags, mode;
 	DB_FH *fhp;
 {
-	int ret, nrepeat;
+	gint ret, nrepeat;
 
 	memset(fhp, 0, sizeof(*fhp));
 	fhp->handle = INVALID_HANDLE_VALUE;
@@ -85,15 +85,15 @@ __os_openhandle(dbenv, name, flags, mode, fhp)
  * __os_closehandle --
  *	Close a file.
  *
- * PUBLIC: int __os_closehandle __P((DB_ENV *, DB_FH *));
+ * PUBLIC: gint __os_closehandle __P((DB_ENV *, DB_FH *));
  */
-int
+gint
 __os_closehandle(dbenv, fhp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 {
 	BOOL success;
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbenv, NULL);
 	/* Don't close file descriptors that were never opened. */
diff --git a/libdb/os_win32/os_map.c b/libdb/os_win32/os_map.c
index b81dd4e..48e862b 100644
--- a/libdb/os_win32/os_map.c
+++ b/libdb/os_win32/os_map.c
@@ -8,27 +8,27 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
 
-static int __os_map
-  __P((DB_ENV *, char *, REGINFO *, DB_FH *, size_t, int, int, int, void **));
-static int __os_unique_name __P((char *, HANDLE, char *, size_t));
+static gint __os_map
+  __P((DB_ENV *, gchar *, REGINFO *, DB_FH *, size_t, int, int, int, gpointer *));
+static gint __os_unique_name __P((gchar *, HANDLE, gchar *, size_t));
 
 /*
  * __os_r_sysattach --
  *	Create/join a shared memory region.
  */
-int
+gint
 __os_r_sysattach(dbenv, infop, rp)
 	DB_ENV *dbenv;
 	REGINFO *infop;
 	REGION *rp;
 {
 	DB_FH fh;
-	int is_system, ret;
+	gint is_system, ret;
 
 	/*
 	 * Try to open/create the file.  We DO NOT need to ensure that multiple
@@ -72,13 +72,13 @@ __os_r_sysattach(dbenv, infop, rp)
  * __os_r_sysdetach --
  *	Detach from a shared memory region.
  */
-int
+gint
 __os_r_sysdetach(dbenv, infop, destroy)
 	DB_ENV *dbenv;
 	REGINFO *infop;
-	int destroy;
+	gint destroy;
 {
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	if (infop->wnt_handle != NULL) {
 		(void)CloseHandle(*((HANDLE*)(infop->wnt_handle)));
@@ -103,14 +103,14 @@ __os_r_sysdetach(dbenv, infop, destroy)
  * __os_mapfile --
  *	Map in a shared memory file.
  */
-int
+gint
 __os_mapfile(dbenv, path, fhp, len, is_rdonly, addr)
 	DB_ENV *dbenv;
-	char *path;
+	gchar *path;
 	DB_FH *fhp;
-	int is_rdonly;
+	gint is_rdonly;
 	size_t len;
-	void **addr;
+	gpointer *addr;
 {
 	/* If the user replaced the map call, call through their interface. */
 	if (DB_GLOBAL(j_map) != NULL)
@@ -123,10 +123,10 @@ __os_mapfile(dbenv, path, fhp, len, is_rdonly, addr)
  * __os_unmapfile --
  *	Unmap the shared memory file.
  */
-int
+gint
 __os_unmapfile(dbenv, addr, len)
 	DB_ENV *dbenv;
-	void *addr;
+	gpointer addr;
 	size_t len;
 {
 	/* If the user replaced the map call, call through their interface. */
@@ -165,12 +165,12 @@ __os_unmapfile(dbenv, addr, len)
  */
 static int
 __os_unique_name(orig_path, hfile, result_path, result_path_len)
-	char *orig_path, *result_path;
+	gchar *orig_path, *result_path;
 	HANDLE hfile;
 	size_t result_path_len;
 {
 	BY_HANDLE_FILE_INFORMATION fileinfo;
-	char *basename, *p;
+	gchar *basename, *p;
 
 	/*
 	 * In Windows, pathname components are delimited by '/' or '\', and
@@ -212,17 +212,17 @@ static int
 __os_map(dbenv, path, infop, fhp, len, is_region, is_system, is_rdonly, addr)
 	DB_ENV *dbenv;
 	REGINFO *infop;
-	char *path;
+	gchar *path;
 	DB_FH *fhp;
-	int is_region, is_system, is_rdonly;
+	gint is_region, is_system, is_rdonly;
 	size_t len;
-	void **addr;
+	gpointer *addr;
 {
 	HANDLE hMemory;
 	REGENV *renv;
-	int ret, use_pagefile;
-	char shmem_name[MAXPATHLEN];
-	void *pMemory;
+	gint ret, use_pagefile;
+	gchar shmem_name[MAXPATHLEN];
+	gpointer pMemory;
 
 	ret = 0;
 	if (infop != NULL)
diff --git a/libdb/os_win32/os_open.c b/libdb/os_win32/os_open.c
index ede9742..2483671 100644
--- a/libdb/os_win32/os_open.c
+++ b/libdb/os_win32/os_open.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,19 +26,19 @@ static const char revid[] = "$Id$";
  * __os_open --
  *	Open a file descriptor.
  */
-int
+gint
 __os_open(dbenv, name, flags, mode, fhp)
 	DB_ENV *dbenv;
-	const char *name;
+	const gchar *name;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 	DB_FH *fhp;
 {
 	DWORD bytesWritten;
 	u_int32_t log_size, pagesize, sectorsize;
-	int access, attr, oflags, share, createflag;
-	int ret, nrepeat;
-	char *drive, dbuf[4]; /* <letter><colon><slosh><nul> */
+	gint access, attr, oflags, share, createflag;
+	gint ret, nrepeat;
+	gchar *drive, dbuf[4]; /* <letter><colon><slosh><nul> */
 
 #ifdef DIAGNOSTIC
 #define	OKFLAGS								\
diff --git a/libdb/os_win32/os_rename.c b/libdb/os_win32/os_rename.c
index e0cb1f5..61f9daa 100644
--- a/libdb/os_win32/os_rename.c
+++ b/libdb/os_win32/os_rename.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,13 +17,13 @@ static const char revid[] = "$Id$";
  * __os_rename --
  *	Rename a file.
  */
-int
+gint
 __os_rename(dbenv, oldname, newname, flags)
 	DB_ENV *dbenv;
-	const char *oldname, *newname;
+	const gchar *oldname, *newname;
 	u_int32_t flags;
 {
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (DB_GLOBAL(j_rename) != NULL) {
diff --git a/libdb/os_win32/os_rw.c b/libdb/os_win32/os_rw.c
index f562931..5c5c90d 100644
--- a/libdb/os_win32/os_rw.c
+++ b/libdb/os_win32/os_rw.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,24 +21,24 @@ static const char revid[] = "$Id$";
 #include "db_int.h"
 
 #ifdef HAVE_FILESYSTEM_NOTZERO
-static int __os_zerofill __P((DB_ENV *, DB_FH *));
+static gint __os_zerofill __P((DB_ENV *, DB_FH *));
 #endif
-static int __os_physwrite __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
+static gint __os_physwrite __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
 
 /*
  * __os_io --
  *	Do an I/O.
  *
- * PUBLIC: int __os_io __P((DB_ENV *, DB_IO *, int, size_t *));
+ * PUBLIC: gint __os_io __P((DB_ENV *, DB_IO *, int, size_t *));
  */
-int
+gint
 __os_io(dbenv, db_iop, op, niop)
 	DB_ENV *dbenv;
 	DB_IO *db_iop;
-	int op;
+	gint op;
 	size_t *niop;
 {
-	int ret;
+	gint ret;
 
 	if (__os_is_winnt()) {
 		ULONG64 off = (ULONG64)db_iop->pagesize * db_iop->pgno;
@@ -100,19 +100,19 @@ err:	MUTEX_THREAD_UNLOCK(dbenv, db_iop->mutexp);
  * __os_read --
  *	Read from a file handle.
  *
- * PUBLIC: int __os_read __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
+ * PUBLIC: gint __os_read __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
  */
-int
+gint
 __os_read(dbenv, fhp, addr, len, nrp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
-	void *addr;
+	gpointer addr;
 	size_t len;
 	size_t *nrp;
 {
 	size_t offset;
 	DWORD nr;
-	int ret;
+	gint ret;
 	BOOL success;
 	u_int8_t *taddr;
 
@@ -148,17 +148,17 @@ retry:		if (DB_GLOBAL(j_read) != NULL) {
  * __os_write --
  *	Write to a file handle.
  *
- * PUBLIC: int __os_write __P((DB_ENV *, DB_FH *, void *, size_t, size_t *));
+ * PUBLIC: gint __os_write __P((DB_ENV *, DB_FH *, gpointer , size_t, size_t *));
  */
-int
+gint
 __os_write(dbenv, fhp, addr, len, nwp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
-	void *addr;
+	gpointer addr;
 	size_t len;
 	size_t *nwp;
 {
-	int ret;
+	gint ret;
 
 #ifdef HAVE_FILESYSTEM_NOTZERO
 	/* Zero-fill as necessary. */
@@ -176,13 +176,13 @@ static int
 __os_physwrite(dbenv, fhp, addr, len, nwp)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
-	void *addr;
+	gpointer addr;
 	size_t len;
 	size_t *nwp;
 {
 	size_t offset;
 	DWORD nw;
-	int ret;
+	gint ret;
 	BOOL success;
 	u_int8_t *taddr;
 
@@ -234,7 +234,7 @@ __os_zerofill(dbenv, fhp)
 	unsigned __int64 stat_offset, write_offset;
 	size_t blen, nw;
 	u_int32_t bytes, mbytes;
-	int group_sync, need_free, ret;
+	gint group_sync, need_free, ret;
 	u_int8_t buf[8 * 1024], *bp;
 
 	/* Calculate the byte offset of the next write. */
diff --git a/libdb/os_win32/os_seek.c b/libdb/os_win32/os_seek.c
index b26dec8..e697a5a 100644
--- a/libdb/os_win32/os_seek.c
+++ b/libdb/os_win32/os_seek.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,14 +17,14 @@ static const char revid[] = "$Id$";
  * __os_seek --
  *	Seek to a page/byte offset in the file.
  */
-int
+gint
 __os_seek(dbenv, fhp, pgsize, pageno, relative, isrewind, db_whence)
 	DB_ENV *dbenv;
 	DB_FH *fhp;
 	size_t pgsize;
 	db_pgno_t pageno;
 	u_int32_t relative;
-	int isrewind;
+	gint isrewind;
 	DB_OS_SEEK db_whence;
 {
 	/* Yes, this really is how Microsoft have designed their API */
@@ -35,7 +35,7 @@ __os_seek(dbenv, fhp, pgsize, pageno, relative, isrewind, db_whence)
 			long high;
 		};
 	} offset;
-	int ret, whence;
+	gint ret, whence;
 	DWORD from;
 
 	if (DB_GLOBAL(j_seek) != NULL) {
diff --git a/libdb/os_win32/os_sleep.c b/libdb/os_win32/os_sleep.c
index 18c5a6a..7249529 100644
--- a/libdb/os_win32/os_sleep.c
+++ b/libdb/os_win32/os_sleep.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,7 +17,7 @@ static const char revid[] = "$Id$";
  * __os_sleep --
  *	Yield the processor for a period of time.
  */
-int
+gint
 __os_sleep(dbenv, secs, usecs)
 	DB_ENV *dbenv;
 	u_long secs, usecs;		/* Seconds and microseconds. */
diff --git a/libdb/os_win32/os_spin.c b/libdb/os_win32/os_spin.c
index 4387947..8ff7469 100644
--- a/libdb/os_win32/os_spin.c
+++ b/libdb/os_win32/os_spin.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #include "db_int.h"
@@ -17,7 +17,7 @@ static const char revid[] = "$Id$";
  * __os_spin --
  *	Return the number of default spins before blocking.
  */
-int
+gint
 __os_spin(dbenv)
 	DB_ENV *dbenv;
 {
diff --git a/libdb/os_win32/os_stat.c b/libdb/os_win32/os_stat.c
index 1aea275..5968304 100644
--- a/libdb/os_win32/os_stat.c
+++ b/libdb/os_win32/os_stat.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,14 +24,14 @@ static const char revid[] = "$Id$";
  * __os_exists --
  *	Return if the file exists.
  *
- * PUBLIC: int __os_exists __P((const char *, int *));
+ * PUBLIC: gint __os_exists __P((const gchar *, gint *));
  */
-int
+gint
 __os_exists(path, isdirp)
-	const char *path;
-	int *isdirp;
+	const gchar *path;
+	gint *isdirp;
 {
-	int ret;
+	gint ret;
 	DWORD attrs;
 
 	if (DB_GLOBAL(j_exists) != NULL)
@@ -58,17 +58,17 @@ __os_exists(path, isdirp)
  *	Return file size and I/O size; abstracted to make it easier
  *	to replace.
  *
- * PUBLIC: int __os_ioinfo __P((DB_ENV *, const char *,
+ * PUBLIC: gint __os_ioinfo __P((DB_ENV *, const gchar *,
  * PUBLIC:    DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *));
  */
-int
+gint
 __os_ioinfo(dbenv, path, fhp, mbytesp, bytesp, iosizep)
 	DB_ENV *dbenv;
-	const char *path;
+	const gchar *path;
 	DB_FH *fhp;
 	u_int32_t *mbytesp, *bytesp, *iosizep;
 {
-	int ret;
+	gint ret;
 	BY_HANDLE_FILE_INFORMATION bhfi;
 	unsigned __int64 filesize;
 
diff --git a/libdb/os_win32/os_type.c b/libdb/os_win32/os_type.c
index da51a5c..807f833 100644
--- a/libdb/os_win32/os_type.c
+++ b/libdb/os_win32/os_type.c
@@ -9,19 +9,19 @@
 #include "db_int_def.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 /*
  * __os_is_winnt --
  *	Return 1 if Windows/NT, otherwise 0.
  *
- * PUBLIC: int __os_is_winnt __P((void));
+ * PUBLIC: gint __os_is_winnt __P((void));
  */
-int
+gint
 __os_is_winnt()
 {
-	static int __os_type = -1;
+	static gint __os_type = -1;
 
 	/*
 	 * The value of __os_type is computed only once, and cached to
diff --git a/libdb/perl/BerkeleyDB/constants.h b/libdb/perl/BerkeleyDB/constants.h
index d86cef1..ecc0174 100644
--- a/libdb/perl/BerkeleyDB/constants.h
+++ b/libdb/perl/BerkeleyDB/constants.h
@@ -21,7 +21,7 @@ typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it.  */
 #endif
 
 static int
-constant_6 (pTHX_ const char *name, IV *iv_return) {
+constant_6 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_DUP DB_PAD DB_RMW DB_SET */
@@ -76,7 +76,7 @@ constant_6 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_7 (pTHX_ const char *name, IV *iv_return) {
+constant_7 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_EXCL DB_HASH DB_LAST DB_NEXT DB_PREV */
@@ -145,7 +145,7 @@ constant_7 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_8 (pTHX_ const char *name, IV *iv_return) {
+constant_8 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_AFTER DB_BTREE DB_FIRST DB_FLUSH DB_FORCE DB_QUEUE DB_RECNO */
@@ -242,7 +242,7 @@ constant_8 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_9 (pTHX_ const char *name, IV *iv_return) {
+constant_9 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_APPEND DB_BEFORE DB_CLIENT DB_COMMIT DB_CREATE DB_CURLSN DB_DIRECT
@@ -423,7 +423,7 @@ constant_9 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_10 (pTHX_ const char *name, IV *iv_return) {
+constant_10 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_CONSUME DB_CURRENT DB_DELETED DB_DUPSORT DB_ENCRYPT DB_ENV_CDB
@@ -639,7 +639,7 @@ constant_10 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_11 (pTHX_ const char *name, IV *iv_return) {
+constant_11 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_APP_INIT DB_ARCH_ABS DB_ARCH_LOG DB_FIXEDLEN DB_GET_BOTH DB_INIT_CDB
@@ -1010,7 +1010,7 @@ constant_11 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_12 (pTHX_ const char *name, IV *iv_return) {
+constant_12 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_ARCH_DATA DB_CDB_ALLDB DB_CL_WRITER DB_DELIMITER DB_DIRECT_DB
@@ -1438,7 +1438,7 @@ constant_12 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_13 (pTHX_ const char *name, IV *iv_return) {
+constant_13 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_AGGRESSIVE DB_BTREEMAGIC DB_CHECKPOINT DB_DIRECT_LOG DB_DIRTY_READ
@@ -1817,7 +1817,7 @@ constant_13 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_14 (pTHX_ const char *name, IV *iv_return) {
+constant_14 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_AUTO_COMMIT DB_BTREEOLDVER DB_CHKSUM_SHA1 DB_EID_INVALID DB_ENCRYPT_AES
@@ -2287,7 +2287,7 @@ constant_14 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_15 (pTHX_ const char *name, IV *iv_return) {
+constant_15 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_APPLY_LOGREG DB_BTREEVERSION DB_CONSUME_WAIT DB_ENV_LOCKDOWN
@@ -2636,7 +2636,7 @@ constant_15 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_16 (pTHX_ const char *name, IV *iv_return) {
+constant_16 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_BROADCAST_EID DB_CACHED_COUNTS DB_EID_BROADCAST DB_ENV_CDB_ALLDB
@@ -3071,7 +3071,7 @@ constant_16 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_17 (pTHX_ const char *name, IV *iv_return, const char **pv_return) {
+constant_17 (pTHX_ const gchar *name, IV *iv_return, const gchar **pv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_ENV_DIRECT_LOG DB_ENV_REP_CLIENT DB_ENV_REP_MASTER DB_ENV_STANDALONE
@@ -3252,7 +3252,7 @@ constant_17 (pTHX_ const char *name, IV *iv_return, const char **pv_return) {
 }
 
 static int
-constant_18 (pTHX_ const char *name, IV *iv_return) {
+constant_18 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_ALREADY_ABORTED DB_ENV_AUTO_COMMIT DB_ENV_OPEN_CALLED
@@ -3424,7 +3424,7 @@ constant_18 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_19 (pTHX_ const char *name, IV *iv_return) {
+constant_19 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_ENV_REP_LOGSONLY DB_LOCK_FREE_LOCKER DB_LOCK_GET_TIMEOUT
@@ -3635,7 +3635,7 @@ constant_19 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_20 (pTHX_ const char *name, IV *iv_return) {
+constant_20 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_CXX_NO_EXCEPTIONS DB_LOGFILEID_INVALID DB_PANIC_ENVIRONMENT
@@ -3740,7 +3740,7 @@ constant_20 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_21 (pTHX_ const char *name, IV *iv_return) {
+constant_21 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_LOCK_UPGRADE_WRITE DB_PRIORITY_VERY_HIGH DB_TEST_POSTEXTDELETE
@@ -3816,7 +3816,7 @@ constant_21 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant (pTHX_ const char *name, STRLEN len, IV *iv_return, const char **pv_return) {
+constant (pTHX_ const gchar *name, STRLEN len, IV *iv_return, const gchar **pv_return) {
   /* Initially switch on the length of the name.  */
   /* When generated this function returned values for the list of names given
      in this section of perl code.  Rather than manually editing these functions
diff --git a/libdb/perl/BerkeleyDB/ppport.h b/libdb/perl/BerkeleyDB/ppport.h
index 16ea842..5d88c2c 100644
--- a/libdb/perl/BerkeleyDB/ppport.h
+++ b/libdb/perl/BerkeleyDB/ppport.h
@@ -62,9 +62,9 @@
 
 #ifndef dTHR
 #  ifdef WIN32
-#	define dTHR extern int Perl___notused
+#	define dTHR extern gint Perl___notused
 #  else
-#	define dTHR extern int errno
+#	define dTHR extern gint errno
 #  endif
 #endif
 
@@ -126,14 +126,14 @@ static SV * newRV_noinc (SV * sv)
 #if defined(NEED_newCONSTSUB)
 static
 #else
-extern void newCONSTSUB _((HV * stash, char * name, SV *sv));
+extern void newCONSTSUB _((HV * stash, gchar * name, SV *sv));
 #endif
 
 #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
 void
 newCONSTSUB(stash,name,sv)
 HV *stash;
-char *name;
+gchar *name;
 SV *sv;
 {
 	U32 oldhints = PL_hints;
@@ -258,7 +258,7 @@ SV *sv;
 #endif
 
 #ifndef dNOOP
-#  define dNOOP extern int Perl___notused PERL_UNUSED_DECL
+#  define dNOOP extern gint Perl___notused PERL_UNUSED_DECL
 #endif
 
 #define START_MY_CXT	static my_cxt_t my_cxt;
diff --git a/libdb/perl/DB_File/fallback.h b/libdb/perl/DB_File/fallback.h
index 0213308..73daf93 100644
--- a/libdb/perl/DB_File/fallback.h
+++ b/libdb/perl/DB_File/fallback.h
@@ -21,7 +21,7 @@ typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it.  */
 #endif
 
 static int
-constant_6 (pTHX_ const char *name, IV *iv_return) {
+constant_6 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_TXN R_LAST R_NEXT R_PREV */
@@ -76,7 +76,7 @@ constant_6 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_7 (pTHX_ const char *name, IV *iv_return) {
+constant_7 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_LOCK R_FIRST R_NOKEY */
@@ -120,7 +120,7 @@ constant_7 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_8 (pTHX_ const char *name, IV *iv_return) {
+constant_8 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      DB_SHMEM R_CURSOR R_IAFTER */
@@ -164,7 +164,7 @@ constant_8 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_9 (pTHX_ const char *name, IV *iv_return) {
+constant_9 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      HASHMAGIC RET_ERROR R_IBEFORE */
@@ -208,7 +208,7 @@ constant_9 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_10 (pTHX_ const char *name, IV *iv_return) {
+constant_10 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      BTREEMAGIC R_FIXEDLEN R_SNAPSHOT __R_UNUSED */
@@ -263,7 +263,7 @@ constant_10 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant_11 (pTHX_ const char *name, IV *iv_return) {
+constant_11 (pTHX_ const gchar *name, IV *iv_return) {
   /* When generated this function returned values for the list of names given
      here.  However, subsequent manual editing may have added or removed some.
      HASHVERSION RET_SPECIAL RET_SUCCESS R_RECNOSYNC R_SETCURSOR */
@@ -329,7 +329,7 @@ constant_11 (pTHX_ const char *name, IV *iv_return) {
 }
 
 static int
-constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
+constant (pTHX_ const gchar *name, STRLEN len, IV *iv_return) {
   /* Initially switch on the length of the name.  */
   /* When generated this function returned values for the list of names given
      in this section of perl code.  Rather than manually editing these functions
diff --git a/libdb/perl/DB_File/ppport.h b/libdb/perl/DB_File/ppport.h
index 16ea842..5d88c2c 100644
--- a/libdb/perl/DB_File/ppport.h
+++ b/libdb/perl/DB_File/ppport.h
@@ -62,9 +62,9 @@
 
 #ifndef dTHR
 #  ifdef WIN32
-#	define dTHR extern int Perl___notused
+#	define dTHR extern gint Perl___notused
 #  else
-#	define dTHR extern int errno
+#	define dTHR extern gint errno
 #  endif
 #endif
 
@@ -126,14 +126,14 @@ static SV * newRV_noinc (SV * sv)
 #if defined(NEED_newCONSTSUB)
 static
 #else
-extern void newCONSTSUB _((HV * stash, char * name, SV *sv));
+extern void newCONSTSUB _((HV * stash, gchar * name, SV *sv));
 #endif
 
 #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
 void
 newCONSTSUB(stash,name,sv)
 HV *stash;
-char *name;
+gchar *name;
 SV *sv;
 {
 	U32 oldhints = PL_hints;
@@ -258,7 +258,7 @@ SV *sv;
 #endif
 
 #ifndef dNOOP
-#  define dNOOP extern int Perl___notused PERL_UNUSED_DECL
+#  define dNOOP extern gint Perl___notused PERL_UNUSED_DECL
 #endif
 
 #define START_MY_CXT	static my_cxt_t my_cxt;
diff --git a/libdb/perl/DB_File/version.c b/libdb/perl/DB_File/version.c
index 09c9a38..b493df3 100644
--- a/libdb/perl/DB_File/version.c
+++ b/libdb/perl/DB_File/version.c
@@ -44,7 +44,7 @@ __getBerkeleyDBInfo()
     SV * compat_sv = perl_get_sv("DB_File::db_185_compat", GV_ADD|GV_ADDMULTI) ;
 
 #ifdef DB_VERSION_MAJOR
-    int Major, Minor, Patch ;
+    gint Major, Minor, Patch ;
 
     (void)db_version(&Major, &Minor, &Patch) ;
 
@@ -61,7 +61,7 @@ __getBerkeleyDBInfo()
 		 Major, Minor, Patch) ;
 
     {
-        char buffer[40] ;
+        gchar buffer[40] ;
         sprintf(buffer, "%d.%d", Major, Minor) ;
         sv_setpv(version_sv, buffer) ;
         sprintf(buffer, "%d.%03d%03d", Major, Minor, Patch) ;
diff --git a/libdb/qam/qam.c b/libdb/qam/qam.c
index 32b3711..81dfb2b 100644
--- a/libdb/qam/qam.c
+++ b/libdb/qam/qam.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,34 +25,34 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/qam.h"
 
-static int __qam_bulk __P((DBC *, DBT *, u_int32_t));
-static int __qam_c_close __P((DBC *, db_pgno_t, int *));
-static int __qam_c_del __P((DBC *));
-static int __qam_c_destroy __P((DBC *));
-static int __qam_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-static int __qam_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-static int __qam_consume __P((DBC *, QMETA *, db_recno_t));
-static int __qam_getno __P((DB *, const DBT *, db_recno_t *));
+static gint __qam_bulk __P((DBC *, DBT *, u_int32_t));
+static gint __qam_c_close __P((DBC *, db_pgno_t, gint *));
+static gint __qam_c_del __P((DBC *));
+static gint __qam_c_destroy __P((DBC *));
+static gint __qam_c_get __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+static gint __qam_c_put __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+static gint __qam_consume __P((DBC *, QMETA *, db_recno_t));
+static gint __qam_getno __P((DB *, const DBT *, db_recno_t *));
 
 /*
  * __qam_position --
  *	Position a queued access method cursor at a record.  This returns
  *	the page locked.  *exactp will be set if the record is valid.
- * PUBLIC: int __qam_position
- * PUBLIC:       __P((DBC *, db_recno_t *, qam_position_mode, int *));
+ * PUBLIC: gint __qam_position
+ * PUBLIC:       __P((DBC *, db_recno_t *, qam_position_mode, gint *));
  */
-int
+gint
 __qam_position(dbc, recnop, mode, exactp)
 	DBC *dbc;		/* open cursor */
 	db_recno_t *recnop;	/* pointer to recno to find */
 	qam_position_mode mode;/* locking: read or write */
-	int *exactp;		/* indicate if it was found */
+	gint *exactp;		/* indicate if it was found */
 {
 	QUEUE_CURSOR *cp;
 	DB *dbp;
 	QAMDATA  *qp;
 	db_pgno_t pg;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 	cp = (QUEUE_CURSOR *)dbc->internal;
@@ -100,10 +100,10 @@ __qam_position(dbc, recnop, mode, exactp)
  *
  *   pagep must be write locked
  *
- * PUBLIC: int __qam_pitem
+ * PUBLIC: gint __qam_pitem
  * PUBLIC:     __P((DBC *,  QPAGE *, u_int32_t, db_recno_t, DBT *));
  */
-int
+gint
 __qam_pitem(dbc, pagep, indx, recno, data)
 	DBC *dbc;
 	QPAGE *pagep;
@@ -117,7 +117,7 @@ __qam_pitem(dbc, pagep, indx, recno, data)
 	QUEUE *t;
 	u_int32_t alloced;
 	u_int8_t *dest, *p;
-	int ret;
+	gint ret;
 
 	alloced = ret = 0;
 
@@ -229,7 +229,7 @@ __qam_c_put(dbc, key, data, flags, pgnop)
 	db_pgno_t pg;
 	db_recno_t new_cur, new_first;
 	u_int32_t opcode;
-	int exact, ret, t_ret;
+	gint exact, ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -359,9 +359,9 @@ __qam_c_put(dbc, key, data, flags, pgnop)
  * __qam_append --
  *	Perform a put(DB_APPEND) in queue.
  *
- * PUBLIC: int __qam_append __P((DBC *, DBT *, DBT *));
+ * PUBLIC: gint __qam_append __P((DBC *, DBT *, DBT *));
  */
-int
+gint
 __qam_append(dbc, key, data)
 	DBC *dbc;
 	DBT *key, *data;
@@ -375,7 +375,7 @@ __qam_append(dbc, key, data)
 	QUEUE_CURSOR *cp;
 	db_pgno_t pg;
 	db_recno_t recno;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -508,7 +508,7 @@ __qam_c_del(dbc)
 	QUEUE_CURSOR *cp;
 	db_pgno_t pg;
 	db_recno_t first;
-	int exact, ret, t_ret;
+	gint exact, ret, t_ret;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -633,8 +633,8 @@ __qam_c_get(dbc, key, data, flags, pgnop)
 	db_pgno_t metapno;
 	db_recno_t first;
 	qam_position_mode mode;
-	int exact, is_first, locked, ret, t_ret, wait, with_delete;
-	int put_mode, meta_dirty, retrying;
+	gint exact, is_first, locked, ret, t_ret, wait, with_delete;
+	gint put_mode, meta_dirty, retrying;
 
 	dbp = dbc->dbp;
 	dbenv = dbp->dbenv;
@@ -1095,7 +1095,7 @@ __qam_consume(dbc, meta, first)
 	db_pgno_t save_page;
 	db_recno_t current, save_recno;
 	u_int32_t rec_extent;
-	int exact, put_mode, ret, t_ret, wrapped;
+	gint exact, put_mode, ret, t_ret, wrapped;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1271,8 +1271,8 @@ __qam_bulk(dbc, data, flags)
 	qam_position_mode mode;
 	int32_t  *endp, *offp;
 	u_int8_t *dbuf, *dp, *np;
-	int exact, recs, re_len, ret, t_ret, valid;
-	int is_key, need_pg, pagesize, size, space;
+	gint exact, recs, re_len, ret, t_ret, valid;
+	gint is_key, need_pg, pagesize, size, space;
 
 	dbp = dbc->dbp;
 	mpf = dbp->mpf;
@@ -1356,7 +1356,7 @@ get_space:
 						break;
 					}
 					memcpy(dp,
-					    (char *)pg + QPAGE_SZ(dbp), size);
+					    (gchar *)pg + QPAGE_SZ(dbp), size);
 					need_pg = 0;
 					space -= size;
 					np += size;
@@ -1419,7 +1419,7 @@ static int
 __qam_c_close(dbc, root_pgno, rmroot)
 	DBC *dbc;
 	db_pgno_t root_pgno;
-	int *rmroot;
+	gint *rmroot;
 {
 	QUEUE_CURSOR *cp;
 
@@ -1447,9 +1447,9 @@ __qam_c_close(dbc, root_pgno, rmroot)
  *	Duplicate a queue cursor, such that the new one holds appropriate
  *	locks for the position of the original.
  *
- * PUBLIC: int __qam_c_dup __P((DBC *, DBC *));
+ * PUBLIC: gint __qam_c_dup __P((DBC *, DBC *));
  */
-int
+gint
 __qam_c_dup(orig_dbc, new_dbc)
 	DBC *orig_dbc, *new_dbc;
 {
@@ -1472,15 +1472,15 @@ __qam_c_dup(orig_dbc, new_dbc)
 /*
  * __qam_c_init
  *
- * PUBLIC: int __qam_c_init __P((DBC *));
+ * PUBLIC: gint __qam_c_init __P((DBC *));
  */
-int
+gint
 __qam_c_init(dbc)
 	DBC *dbc;
 {
 	QUEUE_CURSOR *cp;
 	DB *dbp;
-	int ret;
+	gint ret;
 
 	dbp = dbc->dbp;
 
@@ -1547,9 +1547,9 @@ __qam_getno(dbp, key, rep)
  * __qam_truncate --
  *	Truncate a queue database
  *
- * PUBLIC: int __qam_truncate __P((DB *, DB_TXN *, u_int32_t *));
+ * PUBLIC: gint __qam_truncate __P((DB *, DB_TXN *, u_int32_t *));
  */
-int
+gint
 __qam_truncate(dbp, txn, countp)
 	DB *dbp;
 	DB_TXN *txn;
@@ -1560,7 +1560,7 @@ __qam_truncate(dbp, txn, countp)
 	DB_MPOOLFILE *mpf;
 	QMETA *meta;
 	db_pgno_t metapno;
-	int count, ret, t_ret;
+	gint count, ret, t_ret;
 
 	mpf = dbp->mpf;
 
diff --git a/libdb/qam/qam_auto.c b/libdb/qam/qam_auto.c
index 784598a..37b7292 100644
--- a/libdb/qam/qam_auto.c
+++ b/libdb/qam/qam_auto.c
@@ -19,10 +19,10 @@
 #include "dbinc/txn.h"
 
 /*
- * PUBLIC: int __qam_incfirst_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __qam_incfirst_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, db_recno_t, db_pgno_t));
  */
-int
+gint
 __qam_incfirst_log(dbp, txnid, ret_lsnp, flags, recno, meta_pgno)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -36,7 +36,7 @@ __qam_incfirst_log(dbp, txnid, ret_lsnp, flags, recno, meta_pgno)
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -116,16 +116,16 @@ __qam_incfirst_log(dbp, txnid, ret_lsnp, flags, recno, meta_pgno)
 }
 
 /*
- * PUBLIC: int __qam_incfirst_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __qam_incfirst_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __qam_incfirst_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -162,19 +162,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __qam_incfirst_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_incfirst_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_incfirst_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__qam_incfirst_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -198,19 +198,19 @@ __qam_incfirst_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __qam_incfirst_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __qam_incfirst_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __qam_incfirst_args **));
  */
-int
+gint
 __qam_incfirst_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__qam_incfirst_args **argpp;
 {
 	__qam_incfirst_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__qam_incfirst_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -245,11 +245,11 @@ __qam_incfirst_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __qam_mvptr_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __qam_mvptr_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, db_recno_t, db_recno_t, db_recno_t,
  * PUBLIC:     db_recno_t, DB_LSN *, db_pgno_t));
  */
-int
+gint
 __qam_mvptr_log(dbp, txnid, ret_lsnp, flags,
     opcode, old_first, new_first, old_cur, new_cur,
     metalsn, meta_pgno)
@@ -270,7 +270,7 @@ __qam_mvptr_log(dbp, txnid, ret_lsnp, flags,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -377,16 +377,16 @@ __qam_mvptr_log(dbp, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __qam_mvptr_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_mvptr_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_mvptr_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -423,19 +423,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __qam_mvptr_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_mvptr_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_mvptr_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__qam_mvptr_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -465,18 +465,18 @@ __qam_mvptr_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __qam_mvptr_read __P((DB_ENV *, void *, __qam_mvptr_args **));
+ * PUBLIC: gint __qam_mvptr_read __P((DB_ENV *, gpointer , __qam_mvptr_args **));
  */
-int
+gint
 __qam_mvptr_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__qam_mvptr_args **argpp;
 {
 	__qam_mvptr_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__qam_mvptr_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -530,10 +530,10 @@ __qam_mvptr_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __qam_del_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __qam_del_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t));
  */
-int
+gint
 __qam_del_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -549,7 +549,7 @@ __qam_del_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno)
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -641,16 +641,16 @@ __qam_del_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno)
 }
 
 /*
- * PUBLIC: int __qam_del_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_del_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_del_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -687,19 +687,19 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __qam_del_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_del_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_del_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__qam_del_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -726,18 +726,18 @@ __qam_del_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __qam_del_read __P((DB_ENV *, void *, __qam_del_args **));
+ * PUBLIC: gint __qam_del_read __P((DB_ENV *, gpointer , __qam_del_args **));
  */
-int
+gint
 __qam_del_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__qam_del_args **argpp;
 {
 	__qam_del_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__qam_del_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -779,11 +779,11 @@ __qam_del_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __qam_add_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __qam_add_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t,
  * PUBLIC:     const DBT *, u_int32_t, const DBT *));
  */
-int
+gint
 __qam_add_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno, data,
     vflag, olddata)
 	DB *dbp;
@@ -804,7 +804,7 @@ __qam_add_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno, data,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -925,16 +925,16 @@ __qam_add_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno, data,
 }
 
 /*
- * PUBLIC: int __qam_add_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_add_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_add_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	DB *dbp;
 	TXN_RECS *t;
@@ -971,21 +971,21 @@ err:	if (argp != NULL)
 }
 
 /*
- * PUBLIC: int __qam_add_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_add_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_add_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__qam_add_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1025,18 +1025,18 @@ __qam_add_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __qam_add_read __P((DB_ENV *, void *, __qam_add_args **));
+ * PUBLIC: gint __qam_add_read __P((DB_ENV *, gpointer , __qam_add_args **));
  */
-int
+gint
 __qam_add_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__qam_add_args **argpp;
 {
 	__qam_add_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__qam_add_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1094,11 +1094,11 @@ __qam_add_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __qam_delext_log __P((DB *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __qam_delext_log __P((DB *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t,
  * PUBLIC:     const DBT *));
  */
-int
+gint
 __qam_delext_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno, data)
 	DB *dbp;
 	DB_TXN *txnid;
@@ -1116,7 +1116,7 @@ __qam_delext_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno, data)
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	dbenv = dbp->dbenv;
@@ -1220,19 +1220,19 @@ __qam_delext_log(dbp, txnid, ret_lsnp, flags, lsn, pgno, indx, recno, data)
 }
 
 /*
- * PUBLIC: int __qam_delext_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_delext_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_delext_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -1253,21 +1253,21 @@ __qam_delext_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __qam_delext_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __qam_delext_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __qam_delext_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__qam_delext_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1300,18 +1300,18 @@ __qam_delext_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __qam_delext_read __P((DB_ENV *, void *, __qam_delext_args **));
+ * PUBLIC: gint __qam_delext_read __P((DB_ENV *, gpointer , __qam_delext_args **));
  */
-int
+gint
 __qam_delext_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__qam_delext_args **argpp;
 {
 	__qam_delext_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__qam_delext_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1359,16 +1359,16 @@ __qam_delext_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __qam_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __qam_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __qam_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __qam_incfirst_print, DB___qam_incfirst)) != 0)
@@ -1389,16 +1389,16 @@ __qam_init_print(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __qam_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __qam_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __qam_init_getpgnos(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __qam_incfirst_getpgnos, DB___qam_incfirst)) != 0)
@@ -1419,16 +1419,16 @@ __qam_init_getpgnos(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __qam_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __qam_init_recover __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __qam_init_recover(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __qam_incfirst_recover, DB___qam_incfirst)) != 0)
diff --git a/libdb/qam/qam_conv.c b/libdb/qam/qam_conv.c
index 02dbc32..d1fca20 100644
--- a/libdb/qam/qam_conv.c
+++ b/libdb/qam/qam_conv.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,9 +24,9 @@ static const char revid[] = "$Id$";
  * __qam_mswap --
  *	Swap the bytes on the queue metadata page.
  *
- * PUBLIC: int __qam_mswap __P((PAGE *));
+ * PUBLIC: gint __qam_mswap __P((PAGE *));
  */
-int
+gint
 __qam_mswap(pg)
 	PAGE *pg;
 {
@@ -54,13 +54,13 @@ __qam_mswap(pg)
  *	stored on disk.
  *  We only need to fix up a few fields in the header
  *
- * PUBLIC: int __qam_pgin_out __P((DB_ENV *, db_pgno_t, void *, DBT *));
+ * PUBLIC: gint __qam_pgin_out __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
  */
-int
+gint
 __qam_pgin_out(dbenv, pg, pp, cookie)
 	DB_ENV *dbenv;
 	db_pgno_t pg;
-	void *pp;
+	gpointer pp;
 	DBT *cookie;
 {
 	DB_PGINFO *pginfo;
diff --git a/libdb/qam/qam_files.c b/libdb/qam/qam_files.c
index e7b77f3..cae02af 100644
--- a/libdb/qam/qam_files.c
+++ b/libdb/qam/qam_files.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -28,14 +28,14 @@ static const char revid[] = "$Id$";
  *
  * Calculate which extent the page is in, open and create if necessary.
  *
- * PUBLIC: int __qam_fprobe
- * PUBLIC:	   __P((DB *, db_pgno_t, void *, qam_probe_mode, u_int32_t));
+ * PUBLIC: gint __qam_fprobe
+ * PUBLIC:	   __P((DB *, db_pgno_t, gpointer , qam_probe_mode, u_int32_t));
  */
-int
+gint
 __qam_fprobe(dbp, pgno, addrp, mode, flags)
 	DB *dbp;
 	db_pgno_t pgno;
-	void *addrp;
+	gpointer addrp;
 	qam_probe_mode mode;
 	u_int32_t flags;
 {
@@ -45,8 +45,8 @@ __qam_fprobe(dbp, pgno, addrp, mode, flags)
 	QUEUE *qp;
 	u_int8_t fid[DB_FILE_ID_LEN];
 	u_int32_t extid, maxext, openflags;
-	char buf[MAXPATHLEN];
-	int numext, offset, oldext, ret;
+	gchar buf[MAXPATHLEN];
+	gint numext, offset, oldext, ret;
 
 	dbenv = dbp->dbenv;
 	qp = (QUEUE *)dbp->q_internal;
@@ -247,9 +247,9 @@ err:
  * Calculate which extent the page is in and close it.
  * We assume the mpf entry is present.
  *
- * PUBLIC: int __qam_fclose __P((DB *, db_pgno_t));
+ * PUBLIC: gint __qam_fclose __P((DB *, db_pgno_t));
  */
-int
+gint
 __qam_fclose(dbp, pgnoaddr)
 	DB *dbp;
 	db_pgno_t pgnoaddr;
@@ -259,7 +259,7 @@ __qam_fclose(dbp, pgnoaddr)
 	MPFARRAY *array;
 	QUEUE *qp;
 	u_int32_t extid;
-	int offset, ret;
+	gint offset, ret;
 
 	ret = 0;
 	dbenv = dbp->dbenv;
@@ -295,9 +295,9 @@ done:
  * to remove an extent without probing it first and seeing that is is empty
  * so we assume the mpf entry is present.
  *
- * PUBLIC: int __qam_fremove __P((DB *, db_pgno_t));
+ * PUBLIC: gint __qam_fremove __P((DB *, db_pgno_t));
  */
-int
+gint
 __qam_fremove(dbp, pgnoaddr)
 	DB *dbp;
 	db_pgno_t pgnoaddr;
@@ -308,9 +308,9 @@ __qam_fremove(dbp, pgnoaddr)
 	QUEUE *qp;
 	u_int32_t extid;
 #if CONFIG_TEST
-	char buf[MAXPATHLEN], *real_name;
+	gchar buf[MAXPATHLEN], *real_name;
 #endif
-	int offset, ret;
+	gint offset, ret;
 
 	qp = (QUEUE *)dbp->q_internal;
 	dbenv = dbp->dbenv;
@@ -378,9 +378,9 @@ err:
  * __qam_sync --
  *	Flush the database cache.
  *
- * PUBLIC: int __qam_sync __P((DB *, u_int32_t));
+ * PUBLIC: gint __qam_sync __P((DB *, u_int32_t));
  */
-int
+gint
 __qam_sync(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
@@ -392,7 +392,7 @@ __qam_sync(dbp, flags)
 	QUEUE_FILELIST *filelist;
 	struct __qmpf *mpfp;
 	u_int32_t i;
-	int done, ret;
+	gint done, ret;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -466,9 +466,9 @@ err:
  *	Another thread may close the handle so this should only
  *	be used single threaded or with care.
  *
- * PUBLIC: int __qam_gen_filelist __P(( DB *, QUEUE_FILELIST **));
+ * PUBLIC: gint __qam_gen_filelist __P(( DB *, QUEUE_FILELIST **));
  */
-int
+gint
 __qam_gen_filelist(dbp, filelistp)
 	DB *dbp;
 	QUEUE_FILELIST **filelistp;
@@ -480,7 +480,7 @@ __qam_gen_filelist(dbp, filelistp)
 	db_pgno_t i, last, start;
 	db_recno_t current, first;
 	QUEUE_FILELIST *fp;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -542,19 +542,19 @@ again:	for (; i <= last; i += qp->page_ext) {
 /*
  * __qam_extent_names -- generate a list of extent files names.
  *
- * PUBLIC: int __qam_extent_names __P((DB_ENV *, char *, char ***));
+ * PUBLIC: gint __qam_extent_names __P((DB_ENV *, gchar *, gchar ***));
  */
-int
+gint
 __qam_extent_names(dbenv, name, namelistp)
 	DB_ENV *dbenv;
-	char *name;
-	char ***namelistp;
+	gchar *name;
+	gchar ***namelistp;
 {
 	DB *dbp;
 	QUEUE *qp;
 	QUEUE_FILELIST *filelist, *fp;
-	char buf[MAXPATHLEN], *dir, **cp, *freep;
-	int cnt, len, ret;
+	gchar buf[MAXPATHLEN], *dir, **cp, *freep;
+	gint cnt, len, ret;
 
 	*namelistp = NULL;
 	filelist = NULL;
@@ -587,7 +587,7 @@ __qam_extent_names(dbenv, name, namelistp)
 	    __os_malloc(dbp->dbenv, len, namelistp)) != 0)
 		goto done;
 	cp = *namelistp;
-	freep = (char *)(cp + cnt + 1);
+	freep = (gchar *)(cp + cnt + 1);
 	for (fp = filelist; fp->mpf != NULL; fp++) {
 		snprintf(buf, sizeof(buf),
 		    QUEUE_EXTENT, dir, PATH_SEPARATOR[0], name, fp->id);
@@ -626,7 +626,7 @@ __qam_exid(dbp, fidp, exnum)
 	u_int8_t *fidp;
 	u_int32_t exnum;
 {
-	int i;
+	gint i;
 	u_int8_t *p;
 
 	/* Copy the fileid from the master. */
diff --git a/libdb/qam/qam_method.c b/libdb/qam/qam_method.c
index f51bad4..57c4c69 100644
--- a/libdb/qam/qam_method.c
+++ b/libdb/qam/qam_method.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,7 +26,7 @@ static const char revid[] = "$Id$";
 #include "dbinc/qam.h"
 #include "dbinc/txn.h"
 
-static int __qam_set_extentsize __P((DB *, u_int32_t));
+static gint __qam_set_extentsize __P((DB *, u_int32_t));
 
 struct __qam_cookie {
 	DB_LSN lsn;
@@ -37,14 +37,14 @@ struct __qam_cookie {
  * __qam_db_create --
  *	Queue specific initialization of the DB structure.
  *
- * PUBLIC: int __qam_db_create __P((DB *));
+ * PUBLIC: gint __qam_db_create __P((DB *));
  */
-int
+gint
 __qam_db_create(dbp)
 	DB *dbp;
 {
 	QUEUE *t;
-	int ret;
+	gint ret;
 
 	/* Allocate and initialize the private queue structure. */
 	if ((ret = __os_calloc(dbp->dbenv, 1, sizeof(QUEUE), &t)) != 0)
@@ -61,9 +61,9 @@ __qam_db_create(dbp)
  * __qam_db_close --
  *	Queue specific discard of the DB structure.
  *
- * PUBLIC: int __qam_db_close __P((DB *));
+ * PUBLIC: gint __qam_db_close __P((DB *));
  */
-int
+gint
 __qam_db_close(dbp)
 	DB *dbp;
 {
@@ -72,7 +72,7 @@ __qam_db_close(dbp)
 	QUEUE *t;
 	struct __qmpf *mpfp;
 	u_int32_t i;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 	if ((t = dbp->q_internal) == NULL)
@@ -127,9 +127,9 @@ __qam_set_extentsize(dbp, extentsize)
  * __db_prqueue --
  *	Print out a queue
  *
- * PUBLIC: int __db_prqueue __P((DB *, FILE *, u_int32_t));
+ * PUBLIC: gint __db_prqueue __P((DB *, FILE *, u_int32_t));
  */
-int
+gint
 __db_prqueue(dbp, fp, flags)
 	DB *dbp;
 	FILE *fp;
@@ -139,7 +139,7 @@ __db_prqueue(dbp, fp, flags)
 	PAGE *h;
 	QMETA *meta;
 	db_pgno_t first, i, last, pg_ext, stop;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	mpf = dbp->mpf;
 
@@ -198,14 +198,14 @@ begin:
  * __qam_remove
  *	Remove method for a Queue.
  *
- * PUBLIC: int __qam_remove __P((DB *,
- * PUBLIC:     DB_TXN *, const char *, const char *, DB_LSN *));
+ * PUBLIC: gint __qam_remove __P((DB *,
+ * PUBLIC:     DB_TXN *, const gchar *, const gchar *, DB_LSN *));
  */
-int
+gint
 __qam_remove(dbp, txn, name, subdb, lsnp)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	DB_LSN *lsnp;
 {
 	DB_ENV *dbenv;
@@ -213,8 +213,8 @@ __qam_remove(dbp, txn, name, subdb, lsnp)
 	MPFARRAY *ap;
 	QUEUE *qp;
 	QUEUE_FILELIST *filelist, *fp;
-	int ret, needclose, t_ret;
-	char buf[MAXPATHLEN];
+	gint ret, needclose, t_ret;
+	gchar buf[MAXPATHLEN];
 	u_int8_t fid[DB_FILE_ID_LEN];
 
 	COMPQUIET(lsnp, NULL);
@@ -319,23 +319,23 @@ err:	if (filelist != NULL)
  * __qam_rename
  *	Rename method for Queue.
  *
- * PUBLIC: int __qam_rename __P((DB *, DB_TXN *,
- * PUBLIC:     const char *, const char *, const char *));
+ * PUBLIC: gint __qam_rename __P((DB *, DB_TXN *,
+ * PUBLIC:     const gchar *, const gchar *, const gchar *));
  */
-int
+gint
 __qam_rename(dbp, txn, filename, subdb, newname)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *filename, *subdb, *newname;
+	const gchar *filename, *subdb, *newname;
 {
 	DB_ENV *dbenv;
 	DB *tmpdbp;
 	MPFARRAY *ap;
 	QUEUE *qp;
 	QUEUE_FILELIST *fp, *filelist;
-	char buf[MAXPATHLEN], nbuf[MAXPATHLEN];
-	char *namep;
-	int ret, needclose, t_ret;
+	gchar buf[MAXPATHLEN], nbuf[MAXPATHLEN];
+	gchar *namep;
+	gint ret, needclose, t_ret;
 	u_int8_t fid[DB_FILE_ID_LEN], *fidp;
 
 	dbenv = dbp->dbenv;
diff --git a/libdb/qam/qam_open.c b/libdb/qam/qam_open.c
index c31b091..62dc132 100644
--- a/libdb/qam/qam_open.c
+++ b/libdb/qam/qam_open.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,21 +27,21 @@ static const char revid[] = "$Id$";
 #include "dbinc/qam.h"
 #include "dbinc/fop.h"
 
-static int __qam_init_meta __P((DB *, QMETA *));
+static gint __qam_init_meta __P((DB *, QMETA *));
 
 /*
  * __qam_open
  *
- * PUBLIC: int __qam_open __P((DB *,
- * PUBLIC:     DB_TXN *, const char *, db_pgno_t, int, u_int32_t));
+ * PUBLIC: gint __qam_open __P((DB *,
+ * PUBLIC:     DB_TXN *, const gchar *, db_pgno_t, int, u_int32_t));
  */
-int
+gint
 __qam_open(dbp, txn, name, base_pgno, mode, flags)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	db_pgno_t base_pgno;
-	int mode;
+	gint mode;
 	u_int32_t flags;
 {
 	DBC *dbc;
@@ -50,7 +50,7 @@ __qam_open(dbp, txn, name, base_pgno, mode, flags)
 	DB_MPOOLFILE *mpf;
 	QMETA *qmeta;
 	QUEUE *t;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
@@ -147,17 +147,17 @@ err:	if (qmeta != NULL && (t_ret = mpf->put(mpf, qmeta, 0)) != 0 && ret == 0)
 /*
  * __qam_metachk --
  *
- * PUBLIC: int __qam_metachk __P((DB *, const char *, QMETA *));
+ * PUBLIC: gint __qam_metachk __P((DB *, const gchar *, QMETA *));
  */
-int
+gint
 __qam_metachk(dbp, name, qmeta)
 	DB *dbp;
-	const char *name;
+	const gchar *name;
 	QMETA *qmeta;
 {
 	DB_ENV *dbenv;
 	u_int32_t vers;
-	int ret;
+	gint ret;
 
 	dbenv = dbp->dbenv;
 	ret = 0;
@@ -267,14 +267,14 @@ __qam_init_meta(dbp, meta)
  * memory or calls mpf->get), 2) the initialization, and 3) the "put page"
  * chunk which either does a fop write or an mpf->put.
  *
- * PUBLIC: int __qam_new_file __P((DB *, DB_TXN *, DB_FH *, const char *));
+ * PUBLIC: gint __qam_new_file __P((DB *, DB_TXN *, DB_FH *, const gchar *));
  */
-int
+gint
 __qam_new_file(dbp, txn, fhp, name)
 	DB *dbp;
 	DB_TXN *txn;
 	DB_FH *fhp;
-	const char *name;
+	const gchar *name;
 {
 	QMETA *meta;
 	DB_ENV *dbenv;
@@ -282,8 +282,8 @@ __qam_new_file(dbp, txn, fhp, name)
 	DB_PGINFO pginfo;
 	DBT pdbt;
 	db_pgno_t pgno;
-	int ret;
-	void *buf;
+	gint ret;
+	gpointer buf;
 
 	dbenv = dbp->dbenv;
 	mpf = dbp->mpf;
diff --git a/libdb/qam/qam_rec.c b/libdb/qam/qam_rec.c
index 439ecf0..b6dc64c 100644
--- a/libdb/qam/qam_rec.c
+++ b/libdb/qam/qam_rec.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -29,16 +29,16 @@ static const char revid[] = "$Id$";
  * __qam_incfirst_recover --
  *	Recovery function for incfirst.
  *
- * PUBLIC: int __qam_incfirst_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __qam_incfirst_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __qam_incfirst_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__qam_incfirst_args *argp;
 	DB *file_dbp;
@@ -48,7 +48,7 @@ __qam_incfirst_recover(dbenv, dbtp, lsnp, op, info)
 	QMETA *meta;
 	QUEUE_CURSOR *cp;
 	db_pgno_t metapg;
-	int exact, modified, ret, rec_ext;
+	gint exact, modified, ret, rec_ext;
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__qam_incfirst_print);
@@ -141,16 +141,16 @@ out:	REC_CLOSE;
  * __qam_mvptr_recover --
  *	Recovery function for mvptr.
  *
- * PUBLIC: int __qam_mvptr_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __qam_mvptr_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __qam_mvptr_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__qam_mvptr_args *argp;
 	DB *file_dbp;
@@ -159,7 +159,7 @@ __qam_mvptr_recover(dbenv, dbtp, lsnp, op, info)
 	DB_MPOOLFILE *mpf;
 	QMETA *meta;
 	db_pgno_t metapg;
-	int cmp_n, cmp_p, modified, ret;
+	gint cmp_n, cmp_p, modified, ret;
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__qam_mvptr_print);
@@ -232,16 +232,16 @@ out:	REC_CLOSE;
  *	Recovery function for del.
  *		Non-extent version or if there is no data (zero len).
  *
- * PUBLIC: int __qam_del_recover
- * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __qam_del_recover
+ * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __qam_del_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__qam_del_args *argp;
 	DB *file_dbp;
@@ -252,7 +252,7 @@ __qam_del_recover(dbenv, dbtp, lsnp, op, info)
 	QMETA *meta;
 	QPAGE *pagep;
 	db_pgno_t metapg;
-	int cmp_n, modified, ret;
+	gint cmp_n, modified, ret;
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__qam_del_print);
@@ -331,16 +331,16 @@ out:	REC_CLOSE;
  * __qam_delext_recover --
  *	Recovery function for del in an extent based queue.
  *
- * PUBLIC: int __qam_delext_recover __P((DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __qam_delext_recover __P((DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __qam_delext_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__qam_delext_args *argp;
 	DB *file_dbp;
@@ -351,7 +351,7 @@ __qam_delext_recover(dbenv, dbtp, lsnp, op, info)
 	QMETA *meta;
 	QPAGE *pagep;
 	db_pgno_t metapg;
-	int cmp_n, modified, ret;
+	gint cmp_n, modified, ret;
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__qam_delext_print);
@@ -440,16 +440,16 @@ out:	REC_CLOSE;
  * __qam_add_recover --
  *	Recovery function for add.
  *
- * PUBLIC: int __qam_add_recover
- * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __qam_add_recover
+ * PUBLIC:     __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __qam_add_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__qam_add_args *argp;
 	DB *file_dbp;
@@ -459,7 +459,7 @@ __qam_add_recover(dbenv, dbtp, lsnp, op, info)
 	QMETA *meta;
 	QPAGE *pagep;
 	db_pgno_t metapg;
-	int cmp_n, meta_dirty, modified, ret;
+	gint cmp_n, meta_dirty, modified, ret;
 
 	COMPQUIET(info, NULL);
 	REC_PRINT(__qam_add_print);
diff --git a/libdb/qam/qam_stat.c b/libdb/qam/qam_stat.c
index ad7b1fb..a8a5331 100644
--- a/libdb/qam/qam_stat.c
+++ b/libdb/qam/qam_stat.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -29,12 +29,12 @@ static const char revid[] = "$Id$";
  * __qam_stat --
  *	Gather/print the qam statistics
  *
- * PUBLIC: int __qam_stat __P((DB *, void *, u_int32_t));
+ * PUBLIC: gint __qam_stat __P((DB *, gpointer , u_int32_t));
  */
-int
+gint
 __qam_stat(dbp, spp, flags)
 	DB *dbp;
-	void *spp;
+	gpointer spp;
 	u_int32_t flags;
 {
 	DBC *dbc;
@@ -48,7 +48,7 @@ __qam_stat(dbp, spp, flags)
 	db_indx_t indx;
 	db_pgno_t first, last, pgno, pg_ext, stop;
 	u_int32_t re_len;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	PANIC_CHECK(dbp->dbenv);
 	DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->stat");
diff --git a/libdb/qam/qam_upgrade.c b/libdb/qam/qam_upgrade.c
index a30fa67..59cc40a 100644
--- a/libdb/qam/qam_upgrade.c
+++ b/libdb/qam/qam_upgrade.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -24,12 +24,12 @@ static const char revid[] = "$Id$";
  * __qam_31_qammeta --
  *	Upgrade the database from version 1 to version 2.
  *
- * PUBLIC: int __qam_31_qammeta __P((DB *, char *, u_int8_t *));
+ * PUBLIC: gint __qam_31_qammeta __P((DB *, gchar *, u_int8_t *));
  */
-int
+gint
 __qam_31_qammeta(dbp, real_name, buf)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int8_t *buf;
 {
 	QMETA31 *newmeta;
@@ -68,12 +68,12 @@ __qam_31_qammeta(dbp, real_name, buf)
  * __qam_32_qammeta --
  *	Upgrade the database from version 2 to version 3.
  *
- * PUBLIC: int __qam_32_qammeta __P((DB *, char *, u_int8_t *));
+ * PUBLIC: gint __qam_32_qammeta __P((DB *, gchar *, u_int8_t *));
  */
-int
+gint
 __qam_32_qammeta(dbp, real_name, buf)
 	DB *dbp;
-	char *real_name;
+	gchar *real_name;
 	u_int8_t *buf;
 {
 	QMETA32 *newmeta;
diff --git a/libdb/qam/qam_verify.c b/libdb/qam/qam_verify.c
index 49b36d0..3619ac9 100644
--- a/libdb/qam/qam_verify.c
+++ b/libdb/qam/qam_verify.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,10 +26,10 @@ static const char revid[] = "$Id$";
  * __qam_vrfy_meta --
  *	Verify the queue-specific part of a metadata page.
  *
- * PUBLIC: int __qam_vrfy_meta __P((DB *, VRFY_DBINFO *, QMETA *,
+ * PUBLIC: gint __qam_vrfy_meta __P((DB *, VRFY_DBINFO *, QMETA *,
  * PUBLIC:     db_pgno_t, u_int32_t));
  */
-int
+gint
 __qam_vrfy_meta(dbp, vdp, meta, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -38,7 +38,7 @@ __qam_vrfy_meta(dbp, vdp, meta, pgno, flags)
 	u_int32_t flags;
 {
 	VRFY_PAGEINFO *pip;
-	int isbad, ret, t_ret;
+	gint isbad, ret, t_ret;
 
 	if ((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
 		return (ret);
@@ -93,10 +93,10 @@ err:	if ((t_ret =
  * __qam_vrfy_data --
  *	Verify a queue data page.
  *
- * PUBLIC: int __qam_vrfy_data __P((DB *, VRFY_DBINFO *, QPAGE *,
+ * PUBLIC: gint __qam_vrfy_data __P((DB *, VRFY_DBINFO *, QPAGE *,
  * PUBLIC:     db_pgno_t, u_int32_t));
  */
-int
+gint
 __qam_vrfy_data(dbp, vdp, h, pgno, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -147,9 +147,9 @@ __qam_vrfy_data(dbp, vdp, h, pgno, flags)
  * __qam_vrfy_structure --
  *	Verify a queue database structure, such as it is.
  *
- * PUBLIC: int __qam_vrfy_structure __P((DB *, VRFY_DBINFO *, u_int32_t));
+ * PUBLIC: gint __qam_vrfy_structure __P((DB *, VRFY_DBINFO *, u_int32_t));
  */
-int
+gint
 __qam_vrfy_structure(dbp, vdp, flags)
 	DB *dbp;
 	VRFY_DBINFO *vdp;
@@ -157,7 +157,7 @@ __qam_vrfy_structure(dbp, vdp, flags)
 {
 	VRFY_PAGEINFO *pip;
 	db_pgno_t i;
-	int ret, isbad;
+	gint ret, isbad;
 
 	isbad = 0;
 
diff --git a/libdb/rep/rep_method.c b/libdb/rep/rep_method.c
index 6857c89..e9c4e20 100644
--- a/libdb/rep/rep_method.c
+++ b/libdb/rep/rep_method.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -34,33 +34,33 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_client_ext.h"
 #endif
 
-static int __rep_abort_prepared __P((DB_ENV *));
-static int __rep_bt_cmp __P((DB *, const DBT *, const DBT *));
-static int __rep_client_dbinit __P((DB_ENV *, int));
-static int __rep_elect __P((DB_ENV *, int, int, u_int32_t, int *));
-static int __rep_elect_init __P((DB_ENV *, DB_LSN *, int, int, int, int *));
-static int __rep_flush __P((DB_ENV *));
-static int __rep_restore_prepared __P((DB_ENV *));
-static int __rep_set_limit __P((DB_ENV *, u_int32_t, u_int32_t));
-static int __rep_set_request __P((DB_ENV *, u_int32_t, u_int32_t));
-static int __rep_set_rep_transport __P((DB_ENV *, int,
-    int (*)(DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
-static int __rep_start __P((DB_ENV *, DBT *, u_int32_t));
-static int __rep_stat __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
-static int __rep_wait __P((DB_ENV *, u_int32_t, int *, u_int32_t));
+static gint __rep_abort_prepared __P((DB_ENV *));
+static gint __rep_bt_cmp __P((DB *, const DBT *, const DBT *));
+static gint __rep_client_dbinit __P((DB_ENV *, int));
+static gint __rep_elect __P((DB_ENV *, int, int, u_int32_t, gint *));
+static gint __rep_elect_init __P((DB_ENV *, DB_LSN *, int, int, int, gint *));
+static gint __rep_flush __P((DB_ENV *));
+static gint __rep_restore_prepared __P((DB_ENV *));
+static gint __rep_set_limit __P((DB_ENV *, u_int32_t, u_int32_t));
+static gint __rep_set_request __P((DB_ENV *, u_int32_t, u_int32_t));
+static gint __rep_set_rep_transport __P((DB_ENV *, int,
+    gint (*)(DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
+static gint __rep_start __P((DB_ENV *, DBT *, u_int32_t));
+static gint __rep_stat __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
+static gint __rep_wait __P((DB_ENV *, u_int32_t, gint *, u_int32_t));
 
 /*
  * __rep_dbenv_create --
  *	Replication-specific initialization of the DB_ENV structure.
  *
- * PUBLIC: int __rep_dbenv_create __P((DB_ENV *));
+ * PUBLIC: gint __rep_dbenv_create __P((DB_ENV *));
  */
-int
+gint
 __rep_dbenv_create(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_REP *db_rep;
-	int ret;
+	gint ret;
 
 #ifdef HAVE_RPC
 	if (F_ISSET(dbenv, DB_ENV_RPCCLIENT)) {
@@ -120,7 +120,7 @@ __rep_start(dbenv, dbt, flags)
 	DB_LSN lsn;
 	DB_REP *db_rep;
 	REP *rep;
-	int announce, init_db, redo_prepared, ret;
+	gint announce, init_db, redo_prepared, ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_ILLEGAL_BEFORE_OPEN(dbenv, "rep_start");
@@ -288,11 +288,11 @@ __rep_start(dbenv, dbt, flags)
 static int
 __rep_client_dbinit(dbenv, startup)
 	DB_ENV *dbenv;
-	int startup;
+	gint startup;
 {
 	DB_REP *db_rep;
 	DB *dbp;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int32_t flags;
 
 	PANIC_CHECK(dbenv);
@@ -400,7 +400,7 @@ __rep_abort_prepared(dbenv)
 	DB_PREPLIST prep[PREPLISTSIZE], *p;
 	DB_TXNMGR *mgr;
 	DB_TXNREGION *region;
-	int do_aborts, ret;
+	gint do_aborts, ret;
 	long count, i;
 	u_int32_t op;
 
@@ -451,9 +451,9 @@ __rep_restore_prepared(dbenv)
 	__txn_ckp_args *ckp_args;
 	__txn_regop_args *regop_args;
 	__txn_xa_regop_args *prep_args;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int32_t hi_txn, low_txn, rectype;
-	void *txninfo;
+	gpointer txninfo;
 
 	txninfo = NULL;
 	ckp_args = NULL;
@@ -709,8 +709,8 @@ __rep_set_request(dbenv, min, max)
 static int
 __rep_set_rep_transport(dbenv, eid, f_send)
 	DB_ENV *dbenv;
-	int eid;
-	int (*f_send) __P((DB_ENV *, const DBT *, const DBT *, int, u_int32_t));
+	gint eid;
+	gint (*f_send) __P((DB_ENV *, const DBT *, const DBT *, int, u_int32_t));
 {
 	DB_REP *db_rep;
 
@@ -748,15 +748,15 @@ __rep_set_rep_transport(dbenv, eid, f_send)
 static int
 __rep_elect(dbenv, nsites, priority, timeout, eidp)
 	DB_ENV *dbenv;
-	int nsites, priority;
+	gint nsites, priority;
 	u_int32_t timeout;
-	int *eidp;
+	gint *eidp;
 {
 	DB_LOG *dblp;
 	DB_LSN lsn;
 	DB_REP *db_rep;
 	REP *rep;
-	int in_progress, ret, send_vote, tiebreaker;
+	gint in_progress, ret, send_vote, tiebreaker;
 	u_int32_t pid, sec, usec;
 
 	PANIC_CHECK(dbenv);
@@ -900,11 +900,11 @@ static int
 __rep_elect_init(dbenv, lsnp, nsites, priority, tiebreaker, beginp)
 	DB_ENV *dbenv;
 	DB_LSN *lsnp;
-	int nsites, priority, tiebreaker, *beginp;
+	gint nsites, priority, tiebreaker, *beginp;
 {
 	DB_REP *db_rep;
 	REP *rep;
-	int ret, *tally;
+	gint ret, *tally;
 
 	db_rep = dbenv->rep_handle;
 	rep = db_rep->region;
@@ -970,12 +970,12 @@ static int
 __rep_wait(dbenv, timeout, eidp, flags)
 	DB_ENV *dbenv;
 	u_int32_t timeout;
-	int *eidp;
+	gint *eidp;
 	u_int32_t flags;
 {
 	DB_REP *db_rep;
 	REP *rep;
-	int done, ret;
+	gint done, ret;
 	u_int32_t sleeptime;
 
 	done = 0;
@@ -1022,7 +1022,7 @@ __rep_flush(dbenv)
 	DBT rec;
 	DB_LOGC *logc;
 	DB_LSN lsn;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, "rep_stat", DB_INIT_TXN);
@@ -1060,7 +1060,7 @@ __rep_stat(dbenv, statp, flags)
 	LOG *lp;
 	REP *rep;
 	u_int32_t queued;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, "rep_stat", DB_INIT_TXN);
diff --git a/libdb/rep/rep_record.c b/libdb/rep/rep_record.c
index f0bf5fe..53dbfb8 100644
--- a/libdb/rep/rep_record.c
+++ b/libdb/rep/rep_record.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,10 +23,10 @@ static const char revid[] = "$Id$";
 #include "dbinc/rep.h"
 #include "dbinc/txn.h"
 
-static int __rep_apply __P((DB_ENV *, REP_CONTROL *, DBT *));
-static int __rep_collect_txn __P((DB_ENV *, DB_LSN *, LSN_COLLECTION *));
-static int __rep_lsn_cmp __P((const void *, const void *));
-static int __rep_newfile __P((DB_ENV *, REP_CONTROL *, DBT *, DB_LSN *));
+static gint __rep_apply __P((DB_ENV *, REP_CONTROL *, DBT *));
+static gint __rep_collect_txn __P((DB_ENV *, DB_LSN *, LSN_COLLECTION *));
+static gint __rep_lsn_cmp __P((gconstpointer , gconstpointer ));
+static gint __rep_newfile __P((DB_ENV *, REP_CONTROL *, DBT *, DB_LSN *));
 
 #define	IS_SIMPLE(R)	((R) != DB___txn_regop && \
     (R) != DB___txn_ckp && (R) != DB___dbreg_register)
@@ -42,13 +42,13 @@ static int __rep_newfile __P((DB_ENV *, REP_CONTROL *, DBT *, DB_LSN *));
  *	in the case of a DB_NEWMASTER message, returns the eid
  *	of the new master.
  *
- * PUBLIC: int __rep_process_message __P((DB_ENV *, DBT *, DBT *, int *));
+ * PUBLIC: gint __rep_process_message __P((DB_ENV *, DBT *, DBT *, gint *));
  */
-int
+gint
 __rep_process_message(dbenv, control, rec, eidp)
 	DB_ENV *dbenv;
 	DBT *control, *rec;
-	int *eidp;
+	gint *eidp;
 {
 	DB_LOG *dblp;
 	DB_LOGC *logc;
@@ -60,8 +60,8 @@ __rep_process_message(dbenv, control, rec, eidp)
 	REP_CONTROL *rp;
 	REP_VOTE_INFO *vi;
 	u_int32_t bytes, gen, gbytes, type, unused;
-	int check_limit, cmp, done, do_req, i;
-	int master, old, recovering, ret, t_ret, *tally;
+	gint check_limit, cmp, done, do_req, i;
+	gint master, old, recovering, ret, t_ret, *tally;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, "rep_stat", DB_INIT_TXN);
@@ -765,7 +765,7 @@ __rep_apply(dbenv, rp, rec)
 	REP *rep;
 	REP_CONTROL lsn_rc;
 	u_int32_t rectype, txnid;
-	int cmp, do_req, eid, have_mutex, ret, t_ret;
+	gint cmp, do_req, eid, have_mutex, ret, t_ret;
 
 	db_rep = dbenv->rep_handle;
 	rep = db_rep->region;
@@ -1249,9 +1249,9 @@ err:	if (dbc != NULL && (t_ret = dbc->c_close(dbc)) != 0 && ret == 0)
  * This is the routine that actually gets a transaction ready for
  * processing.
  *
- * PUBLIC: int __rep_process_txn __P((DB_ENV *, DBT *));
+ * PUBLIC: gint __rep_process_txn __P((DB_ENV *, DBT *));
  */
-int
+gint
 __rep_process_txn(dbenv, rec)
 	DB_ENV *dbenv;
 	DBT *rec;
@@ -1266,10 +1266,10 @@ __rep_process_txn(dbenv, rec)
 	__txn_regop_args *txn_args;
 	__txn_xa_regop_args *prep_args;
 	u_int32_t lockid, op, rectype;
-	int i, ret, t_ret;
-	int (**dtab)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint i, ret, t_ret;
+	gint (**dtab)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t dtabsize;
-	void *txninfo;
+	gpointer txninfo;
 
 	db_rep = dbenv->rep_handle;
 	rep = db_rep->region;
@@ -1405,7 +1405,7 @@ __rep_collect_txn(dbenv, lsnp, lc)
 	DB_LSN c_lsn;
 	DBT data;
 	u_int32_t rectype;
-	int nalloc, ret, t_ret;
+	gint nalloc, ret, t_ret;
 
 	memset(&data, 0, sizeof(data));
 	F_SET(&data, DB_DBT_REALLOC);
@@ -1463,7 +1463,7 @@ err:	if ((t_ret = logc->close(logc, 0)) != 0 && ret == 0)
  */
 static int
 __rep_lsn_cmp(lsn1, lsn2)
-	const void *lsn1, *lsn2;
+	gconstpointer lsn1, *lsn2;
 {
 
 	return (log_compare((DB_LSN *)lsn1, (DB_LSN *)lsn2));
diff --git a/libdb/rep/rep_region.c b/libdb/rep/rep_region.c
index f766fd9..08f2317 100644
--- a/libdb/rep/rep_region.c
+++ b/libdb/rep/rep_region.c
@@ -7,7 +7,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,9 +23,9 @@ static const char revid[] = "$Id$";
  * __rep_region_init --
  *	Initialize the shared memory state for the replication system.
  *
- * PUBLIC: int __rep_region_init __P((DB_ENV *));
+ * PUBLIC: gint __rep_region_init __P((DB_ENV *));
  */
-int
+gint
 __rep_region_init(dbenv)
 	DB_ENV *dbenv;
 {
@@ -34,7 +34,7 @@ __rep_region_init(dbenv)
 	DB_MUTEX *db_mutexp;
 	DB_REP *db_rep;
 	REP *rep;
-	int ret;
+	gint ret;
 
 	db_rep = dbenv->rep_handle;
 	infop = dbenv->reginfo;
@@ -106,14 +106,14 @@ err:	MUTEX_UNLOCK(dbenv, &renv->mutex);
  * __rep_region_destroy --
  *	Destroy any system resources allocated in the replication region.
  *
- * PUBLIC: int __rep_region_destroy __P((DB_ENV *));
+ * PUBLIC: gint __rep_region_destroy __P((DB_ENV *));
  */
-int
+gint
 __rep_region_destroy(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_REP *db_rep;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = t_ret = 0;
 	db_rep = (DB_REP *)dbenv->rep_handle;
@@ -132,9 +132,9 @@ __rep_region_destroy(dbenv)
  * __rep_dbenv_close --
  *	Replication-specific destruction of the DB_ENV structure.
  *
- * PUBLIC: int __rep_dbenv_close __P((DB_ENV *));
+ * PUBLIC: gint __rep_dbenv_close __P((DB_ENV *));
  */
-int
+gint
 __rep_dbenv_close(dbenv)
 	DB_ENV *dbenv;
 {
@@ -156,16 +156,16 @@ __rep_dbenv_close(dbenv)
  * actually closing the environment, close all databases we've opened
  * while applying messages.
  *
- * PUBLIC: int __rep_preclose __P((DB_ENV *, int));
+ * PUBLIC: gint __rep_preclose __P((DB_ENV *, int));
  */
-int
+gint
 __rep_preclose(dbenv, do_closefiles)
 	DB_ENV *dbenv;
-	int do_closefiles;
+	gint do_closefiles;
 {
 	DB *dbp;
 	DB_REP *db_rep;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = t_ret = 0;
 
diff --git a/libdb/rep/rep_util.c b/libdb/rep/rep_util.c
index 0f16100..f994901 100644
--- a/libdb/rep/rep_util.c
+++ b/libdb/rep/rep_util.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -31,8 +31,8 @@ static const char revid[] = "$Id$";
  *	Miscellaneous replication-related utility functions, including
  *	those called by other subsystems.
  */
-static int __rep_cmp_bylsn __P((const void *, const void *));
-static int __rep_cmp_bypage __P((const void *, const void *));
+static gint __rep_cmp_bylsn __P((gconstpointer , gconstpointer ));
+static gint __rep_cmp_bypage __P((gconstpointer , gconstpointer ));
 
 #ifdef REP_DIAGNOSTIC
 static void __rep_print_logmsg __P((DB_ENV *, const DBT *, DB_LSN *));
@@ -44,15 +44,15 @@ static void __rep_print_logmsg __P((DB_ENV *, const DBT *, DB_LSN *));
  *	(This function is called by the __*_getpgnos() functions in
  *	*.src.)
  *
- * PUBLIC: int __rep_check_alloc __P((DB_ENV *, TXN_RECS *, int));
+ * PUBLIC: gint __rep_check_alloc __P((DB_ENV *, TXN_RECS *, int));
  */
-int
+gint
 __rep_check_alloc(dbenv, r, n)
 	DB_ENV *dbenv;
 	TXN_RECS *r;
-	int n;
+	gint n;
 {
-	int nalloc, ret;
+	gint nalloc, ret;
 
 	while (r->nalloc < r->npages + n) {
 		nalloc = r->nalloc == 0 ? 20 : r->nalloc * 2;
@@ -72,13 +72,13 @@ __rep_check_alloc(dbenv, r, n)
  *	This is a wrapper for sending a message.  It takes care of constructing
  * the REP_CONTROL structure and calling the user's specified send function.
  *
- * PUBLIC: int __rep_send_message __P((DB_ENV *, int,
+ * PUBLIC: gint __rep_send_message __P((DB_ENV *, int,
  * PUBLIC:     u_int32_t, DB_LSN *, const DBT *, u_int32_t));
  */
-int
+gint
 __rep_send_message(dbenv, eid, rtype, lsnp, dbtp, flags)
 	DB_ENV *dbenv;
-	int eid;
+	gint eid;
 	u_int32_t rtype;
 	DB_LSN *lsnp;
 	const DBT *dbtp;
@@ -89,7 +89,7 @@ __rep_send_message(dbenv, eid, rtype, lsnp, dbtp, flags)
 	DBT cdbt, scrap_dbt;
 	REP_CONTROL cntrl;
 	u_int32_t send_flags;
-	int ret;
+	gint ret;
 
 	db_rep = dbenv->rep_handle;
 	rep = db_rep->region;
@@ -157,8 +157,8 @@ __rep_print_logmsg(dbenv, logdbt, lsnp)
 	DB_LSN *lsnp;
 {
 	/* Static structures to hold the printing functions. */
-	static int (**ptab)__P((DB_ENV *,
-	    DBT *, DB_LSN *, db_recops, void *)) = NULL;
+	static gint (**ptab)__P((DB_ENV *,
+	    DBT *, DB_LSN *, db_recops, gpointer )) = NULL;
 	size_t ptabsize = 0;
 
 	if (ptabsize == 0) {
@@ -188,13 +188,13 @@ __rep_print_logmsg(dbenv, logdbt, lsnp)
  * need to enforce that in __rep_process_record, but right now, we have
  * no way to identify the master.
  *
- * PUBLIC: int __rep_new_master __P((DB_ENV *, REP_CONTROL *, int));
+ * PUBLIC: gint __rep_new_master __P((DB_ENV *, REP_CONTROL *, int));
  */
-int
+gint
 __rep_new_master(dbenv, cntrl, eid)
 	DB_ENV *dbenv;
 	REP_CONTROL *cntrl;
-	int eid;
+	gint eid;
 {
 	DB_LOG *dblp;
 	DB_LOGC *logc;
@@ -203,7 +203,7 @@ __rep_new_master(dbenv, cntrl, eid)
 	DBT dbt;
 	LOG *lp;
 	REP *rep;
-	int change, ret, t_ret;
+	gint change, ret, t_ret;
 
 	db_rep = dbenv->rep_handle;
 	rep = db_rep->region;
@@ -281,17 +281,17 @@ empty:		MUTEX_LOCK(dbenv, db_rep->mutexp);
  * __rep_lockpgno_init
  *	Create a dispatch table for acquiring locks on each log record.
  *
- * PUBLIC: int __rep_lockpgno_init __P((DB_ENV *,
- * PUBLIC:     int (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *),
+ * PUBLIC: gint __rep_lockpgno_init __P((DB_ENV *,
+ * PUBLIC:     gint (***)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ),
  * PUBLIC:     size_t *));
  */
-int
+gint
 __rep_lockpgno_init(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	/* Initialize dispatch table. */
 	*dtabsizep = 0;
@@ -313,9 +313,9 @@ __rep_lockpgno_init(dbenv, dtabp, dtabsizep)
  * __rep_unlockpages --
  *	Unlock the pages locked in __rep_lockpages.
  *
- * PUBLIC: int __rep_unlockpages __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __rep_unlockpages __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __rep_unlockpages(dbenv, lid)
 	DB_ENV *dbenv;
 	u_int32_t lid;
@@ -335,14 +335,14 @@ __rep_unlockpages(dbenv, lid)
  *	to the joint LSN.  A non-NULL max_lsn means that we are applying
  *	a transaction whose commit is at max_lsn.
  *
- * PUBLIC: int __rep_lockpages __P((DB_ENV *,
- * PUBLIC:     int (**)(DB_ENV *, DBT *, DB_LSN *, db_recops, void *),
+ * PUBLIC: gint __rep_lockpages __P((DB_ENV *,
+ * PUBLIC:     gint (**)(DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ),
  * PUBLIC:     size_t, DB_LSN *, DB_LSN *, TXN_RECS *, u_int32_t));
  */
-int
+gint
 __rep_lockpages(dbenv, dtab, dtabsize, key_lsn, max_lsn, recs, lid)
 	DB_ENV *dbenv;
-	int (**dtab)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (**dtab)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t dtabsize;
 	DB_LSN *key_lsn, *max_lsn;
 	TXN_RECS *recs;
@@ -356,7 +356,7 @@ __rep_lockpages(dbenv, dtab, dtabsize, key_lsn, max_lsn, recs, lid)
 	TXN_RECS tmp, *t;
 	db_pgno_t cur_pgno;
 	linfo_t locks;
-	int i, ret, t_ret, unique;
+	gint i, ret, t_ret, unique;
 	u_int32_t cur_fid;
 
 	/*
@@ -526,7 +526,7 @@ out2:	if ((ret != 0 || recs == NULL) && t->nalloc != 0) {
  */
 static int
 __rep_cmp_bypage(a, b)
-	const void *a, *b;
+	gconstpointer a, *b;
 {
 	LSN_PAGE *ap, *bp;
 
@@ -562,7 +562,7 @@ __rep_cmp_bypage(a, b)
 
 static int
 __rep_cmp_bylsn(a, b)
-	const void *a, *b;
+	gconstpointer a, *b;
 {
 	LSN_PAGE *ap, *bp;
 
@@ -601,15 +601,15 @@ __rep_cmp_bylsn(a, b)
  *	Used by other subsystems to figure out if this is a replication
  * client sites.
  *
- * PUBLIC: int __rep_is_client __P((DB_ENV *));
+ * PUBLIC: gint __rep_is_client __P((DB_ENV *));
  */
-int
+gint
 __rep_is_client(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_REP *db_rep;
 	REP *rep;
-	int ret;
+	gint ret;
 
 	if ((db_rep = dbenv->rep_handle) == NULL)
 		return (0);
@@ -625,13 +625,13 @@ __rep_is_client(dbenv)
  * __rep_send_vote
  *	Send this site's vote for the election.
  *
- * PUBLIC: int __rep_send_vote __P((DB_ENV *, DB_LSN *, int, int, int));
+ * PUBLIC: gint __rep_send_vote __P((DB_ENV *, DB_LSN *, int, int, int));
  */
-int
+gint
 __rep_send_vote(dbenv, lsnp, nsites, pri, tiebreaker)
 	DB_ENV *dbenv;
 	DB_LSN *lsnp;
-	int nsites, pri, tiebreaker;
+	gint nsites, pri, tiebreaker;
 {
 	DBT vote_dbt;
 	REP_VOTE_INFO vi;
@@ -657,17 +657,17 @@ __rep_send_vote(dbenv, lsnp, nsites, pri, tiebreaker)
  * we need to make sure that we *never* acquire those mutexes in the
  * opposite order.
  *
- * PUBLIC: int __rep_grow_sites __P((DB_ENV *dbenv, int nsites));
+ * PUBLIC: gint __rep_grow_sites __P((DB_ENV *dbenv, gint nsites));
  */
-int
+gint
 __rep_grow_sites(dbenv, nsites)
 	DB_ENV *dbenv;
-	int nsites;
+	gint nsites;
 {
 	REGENV *renv;
 	REGINFO *infop;
 	REP *rep;
-	int nalloc, ret, *tally;
+	gint nalloc, ret, *tally;
 
 	rep = ((DB_REP *)dbenv->rep_handle)->region;
 
@@ -697,7 +697,7 @@ __rep_grow_sites(dbenv, nsites)
 }
 
 #ifdef NOTYET
-static int __rep_send_file __P((DB_ENV *, DBT *, u_int32_t));
+static gint __rep_send_file __P((DB_ENV *, DBT *, u_int32_t));
 /*
  * __rep_send_file --
  *	Send an entire file, one block at a time.
@@ -715,7 +715,7 @@ __rep_send_file(dbenv, rec, eid)
 	DBT rec_dbt;
 	PAGE *pagep;
 	db_pgno_t last_pgno, pgno;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbp = NULL;
 	dbc = NULL;
@@ -776,16 +776,16 @@ err:	if (LOCK_ISSET(lk) && (t_ret = __LPUT(dbc, lk)) != 0 && ret == 0)
 
 #if 0
 /*
- * PUBLIC: void __rep_print_message __P((DB_ENV *, int, REP_CONTROL *, char *));
+ * PUBLIC: void __rep_print_message __P((DB_ENV *, int, REP_CONTROL *, gchar *));
  */
 void
 __rep_print_message(dbenv, eid, rp, str)
 	DB_ENV *dbenv;
-	int eid;
+	gint eid;
 	REP_CONTROL *rp;
-	char *str;
+	gchar *str;
 {
-	char *type;
+	gchar *type;
 	switch (rp->rectype) {
 	case REP_ALIVE:
 		type = "alive";
diff --git a/libdb/rpc_client/client.c b/libdb/rpc_client/client.c
index bc6b9f6..92ee188 100644
--- a/libdb/rpc_client/client.c
+++ b/libdb/rpc_client/client.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifdef HAVE_RPC
@@ -34,21 +34,21 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/db_server.h"
 #include "dbinc_auto/rpc_client_ext.h"
 
-static int __dbcl_c_destroy __P((DBC *));
-static int __dbcl_txn_close __P((DB_ENV *));
+static gint __dbcl_c_destroy __P((DBC *));
+static gint __dbcl_txn_close __P((DB_ENV *));
 
 /*
  * __dbcl_envrpcserver --
  *	Initialize an environment's server.
  *
- * PUBLIC: int __dbcl_envrpcserver
- * PUBLIC:     __P((DB_ENV *, void *, const char *, long, long, u_int32_t));
+ * PUBLIC: gint __dbcl_envrpcserver
+ * PUBLIC:     __P((DB_ENV *, gpointer , const gchar *, long, long, u_int32_t));
  */
-int
+gint
 __dbcl_envrpcserver(dbenv, clnt, host, tsec, ssec, flags)
 	DB_ENV *dbenv;
-	void *clnt;
-	const char *host;
+	gpointer clnt;
+	const gchar *host;
 	long tsec, ssec;
 	u_int32_t flags;
 {
@@ -72,15 +72,15 @@ __dbcl_envrpcserver(dbenv, clnt, host, tsec, ssec, flags)
 	 * did not pass us a client structure to begin with.
 	 */
 	if (clnt == NULL) {
-		if ((cl = clnt_create((char *)host, DB_RPC_SERVERPROG,
+		if ((cl = clnt_create((gchar *)host, DB_RPC_SERVERPROG,
 		    DB_RPC_SERVERVERS, "tcp")) == NULL) {
-			__db_err(dbenv, clnt_spcreateerror((char *)host));
+			__db_err(dbenv, clnt_spcreateerror((gchar *)host));
 			return (DB_NOSERVER);
 		}
 		if (tsec != 0) {
 			tp.tv_sec = tsec;
 			tp.tv_usec = 0;
-			(void)clnt_control(cl, CLSET_TIMEOUT, (char *)&tp);
+			(void)clnt_control(cl, CLSET_TIMEOUT, (gchar *)&tp);
 		}
 	} else {
 		cl = (CLIENT *)clnt;
@@ -97,17 +97,17 @@ __dbcl_envrpcserver(dbenv, clnt, host, tsec, ssec, flags)
  *	We need a wrapper function to deal with DB_USE_ENVIRON* flags
  *	and we don't want to complicate the generated code for env_open.
  *
- * PUBLIC: int __dbcl_env_open_wrap
- * PUBLIC:     __P((DB_ENV *, const char *, u_int32_t, int));
+ * PUBLIC: gint __dbcl_env_open_wrap
+ * PUBLIC:     __P((DB_ENV *, const gchar *, u_int32_t, int));
  */
-int
+gint
 __dbcl_env_open_wrap(dbenv, home, flags, mode)
 	DB_ENV * dbenv;
-	const char * home;
+	const gchar * home;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 {
-	int ret;
+	gint ret;
 
 	if (LF_ISSET(DB_THREAD)) {
 		__db_err(dbenv, "DB_THREAD not allowed on RPC clients");
@@ -124,19 +124,19 @@ __dbcl_env_open_wrap(dbenv, home, flags, mode)
  *	We need a wrapper function to error on DB_THREAD flag.
  *	and we don't want to complicate the generated code.
  *
- * PUBLIC: int __dbcl_db_open_wrap
- * PUBLIC:     __P((DB *, DB_TXN *, const char *, const char *,
+ * PUBLIC: gint __dbcl_db_open_wrap
+ * PUBLIC:     __P((DB *, DB_TXN *, const gchar *, const gchar *,
  * PUBLIC:     DBTYPE, u_int32_t, int));
  */
-int
+gint
 __dbcl_db_open_wrap(dbp, txnp, name, subdb, type, flags, mode)
 	DB * dbp;
 	DB_TXN * txnp;
-	const char * name;
-	const char * subdb;
+	const gchar * name;
+	const gchar * subdb;
 	DBTYPE type;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 {
 	if (LF_ISSET(DB_THREAD)) {
 		__db_err(dbp->dbenv, "DB_THREAD not allowed on RPC clients");
@@ -149,14 +149,14 @@ __dbcl_db_open_wrap(dbp, txnp, name, subdb, type, flags, mode)
  * __dbcl_refresh --
  *	Clean up an environment.
  *
- * PUBLIC: int __dbcl_refresh __P((DB_ENV *));
+ * PUBLIC: gint __dbcl_refresh __P((DB_ENV *));
  */
-int
+gint
 __dbcl_refresh(dbenv)
 	DB_ENV *dbenv;
 {
 	CLIENT *cl;
-	int ret;
+	gint ret;
 
 	cl = (CLIENT *)dbenv->cl_handle;
 
@@ -185,19 +185,19 @@ __dbcl_refresh(dbenv)
  *	Copy the returned data into the user's DBT, handling allocation flags,
  *	but not DB_DBT_PARTIAL.
  *
- * PUBLIC: int __dbcl_retcopy __P((DB_ENV *, DBT *,
- * PUBLIC:    void *, u_int32_t, void **, u_int32_t *));
+ * PUBLIC: gint __dbcl_retcopy __P((DB_ENV *, DBT *,
+ * PUBLIC:    gpointer , u_int32_t, gpointer *, u_int32_t *));
  */
-int
+gint
 __dbcl_retcopy(dbenv, dbt, data, len, memp, memsize)
 	DB_ENV *dbenv;
 	DBT *dbt;
-	void *data;
+	gpointer data;
 	u_int32_t len;
-	void **memp;
+	gpointer *memp;
 	u_int32_t *memsize;
 {
-	int ret;
+	gint ret;
 	u_int32_t orig_flags;
 
 	/*
@@ -215,13 +215,13 @@ __dbcl_retcopy(dbenv, dbt, data, len, memp, memsize)
  * __dbcl_txn_close --
  *	Clean up an environment's transactions.
  */
-int
+gint
 __dbcl_txn_close(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_TXN *txnp;
 	DB_TXNMGR *tmgrp;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	tmgrp = dbenv->tx_handle;
@@ -377,16 +377,16 @@ __dbcl_c_refresh(dbc)
  * __dbcl_c_setup --
  *	Allocate a cursor.
  *
- * PUBLIC: int __dbcl_c_setup __P((long, DB *, DBC **));
+ * PUBLIC: gint __dbcl_c_setup __P((long, DB *, DBC **));
  */
-int
+gint
 __dbcl_c_setup(cl_id, dbp, dbcp)
 	long cl_id;
 	DB *dbp;
 	DBC **dbcp;
 {
 	DBC *dbc, tmpdbc;
-	int ret;
+	gint ret;
 
 	if ((dbc = TAILQ_FIRST(&dbp->free_queue)) != NULL)
 		TAILQ_REMOVE(&dbp->free_queue, dbc, links);
@@ -422,13 +422,13 @@ __dbcl_c_setup(cl_id, dbp, dbcp)
  * __dbcl_dbclose_common --
  *	Common code for closing/cleaning a dbp.
  *
- * PUBLIC: int __dbcl_dbclose_common __P((DB *));
+ * PUBLIC: gint __dbcl_dbclose_common __P((DB *));
  */
-int
+gint
 __dbcl_dbclose_common(dbp)
 	DB *dbp;
 {
-	int ret, t_ret;
+	gint ret, t_ret;
 	DBC *dbc;
 
 	/*
diff --git a/libdb/rpc_client/db_server_clnt.c b/libdb/rpc_client/db_server_clnt.c
index 9b57a23..b8c1f2e 100644
--- a/libdb/rpc_client/db_server_clnt.c
+++ b/libdb/rpc_client/db_server_clnt.c
@@ -25,7 +25,7 @@ __db_env_cachesize_4001(argp, clnt)
 {
 	static __env_cachesize_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_cachesize,
 		(xdrproc_t) xdr___env_cachesize_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_cachesize_reply, (caddr_t) &clnt_res,
@@ -42,7 +42,7 @@ __db_env_close_4001(argp, clnt)
 {
 	static __env_close_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_close,
 		(xdrproc_t) xdr___env_close_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_close_reply, (caddr_t) &clnt_res,
@@ -59,7 +59,7 @@ __db_env_create_4001(argp, clnt)
 {
 	static __env_create_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_create,
 		(xdrproc_t) xdr___env_create_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_create_reply, (caddr_t) &clnt_res,
@@ -76,7 +76,7 @@ __db_env_dbremove_4001(argp, clnt)
 {
 	static __env_dbremove_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_dbremove,
 		(xdrproc_t) xdr___env_dbremove_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_dbremove_reply, (caddr_t) &clnt_res,
@@ -93,7 +93,7 @@ __db_env_dbrename_4001(argp, clnt)
 {
 	static __env_dbrename_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_dbrename,
 		(xdrproc_t) xdr___env_dbrename_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_dbrename_reply, (caddr_t) &clnt_res,
@@ -110,7 +110,7 @@ __db_env_encrypt_4001(argp, clnt)
 {
 	static __env_encrypt_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_encrypt,
 		(xdrproc_t) xdr___env_encrypt_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_encrypt_reply, (caddr_t) &clnt_res,
@@ -127,7 +127,7 @@ __db_env_flags_4001(argp, clnt)
 {
 	static __env_flags_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_flags,
 		(xdrproc_t) xdr___env_flags_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_flags_reply, (caddr_t) &clnt_res,
@@ -144,7 +144,7 @@ __db_env_open_4001(argp, clnt)
 {
 	static __env_open_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_open,
 		(xdrproc_t) xdr___env_open_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_open_reply, (caddr_t) &clnt_res,
@@ -161,7 +161,7 @@ __db_env_remove_4001(argp, clnt)
 {
 	static __env_remove_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_env_remove,
 		(xdrproc_t) xdr___env_remove_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___env_remove_reply, (caddr_t) &clnt_res,
@@ -178,7 +178,7 @@ __db_txn_abort_4001(argp, clnt)
 {
 	static __txn_abort_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_txn_abort,
 		(xdrproc_t) xdr___txn_abort_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___txn_abort_reply, (caddr_t) &clnt_res,
@@ -195,7 +195,7 @@ __db_txn_begin_4001(argp, clnt)
 {
 	static __txn_begin_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_txn_begin,
 		(xdrproc_t) xdr___txn_begin_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___txn_begin_reply, (caddr_t) &clnt_res,
@@ -212,7 +212,7 @@ __db_txn_commit_4001(argp, clnt)
 {
 	static __txn_commit_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_txn_commit,
 		(xdrproc_t) xdr___txn_commit_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___txn_commit_reply, (caddr_t) &clnt_res,
@@ -229,7 +229,7 @@ __db_txn_discard_4001(argp, clnt)
 {
 	static __txn_discard_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_txn_discard,
 		(xdrproc_t) xdr___txn_discard_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___txn_discard_reply, (caddr_t) &clnt_res,
@@ -246,7 +246,7 @@ __db_txn_prepare_4001(argp, clnt)
 {
 	static __txn_prepare_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_txn_prepare,
 		(xdrproc_t) xdr___txn_prepare_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___txn_prepare_reply, (caddr_t) &clnt_res,
@@ -263,7 +263,7 @@ __db_txn_recover_4001(argp, clnt)
 {
 	static __txn_recover_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_txn_recover,
 		(xdrproc_t) xdr___txn_recover_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___txn_recover_reply, (caddr_t) &clnt_res,
@@ -280,7 +280,7 @@ __db_db_associate_4001(argp, clnt)
 {
 	static __db_associate_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_associate,
 		(xdrproc_t) xdr___db_associate_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_associate_reply, (caddr_t) &clnt_res,
@@ -297,7 +297,7 @@ __db_db_bt_maxkey_4001(argp, clnt)
 {
 	static __db_bt_maxkey_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_bt_maxkey,
 		(xdrproc_t) xdr___db_bt_maxkey_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_bt_maxkey_reply, (caddr_t) &clnt_res,
@@ -314,7 +314,7 @@ __db_db_bt_minkey_4001(argp, clnt)
 {
 	static __db_bt_minkey_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_bt_minkey,
 		(xdrproc_t) xdr___db_bt_minkey_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_bt_minkey_reply, (caddr_t) &clnt_res,
@@ -331,7 +331,7 @@ __db_db_close_4001(argp, clnt)
 {
 	static __db_close_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_close,
 		(xdrproc_t) xdr___db_close_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_close_reply, (caddr_t) &clnt_res,
@@ -348,7 +348,7 @@ __db_db_create_4001(argp, clnt)
 {
 	static __db_create_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_create,
 		(xdrproc_t) xdr___db_create_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_create_reply, (caddr_t) &clnt_res,
@@ -365,7 +365,7 @@ __db_db_del_4001(argp, clnt)
 {
 	static __db_del_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_del,
 		(xdrproc_t) xdr___db_del_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_del_reply, (caddr_t) &clnt_res,
@@ -382,7 +382,7 @@ __db_db_encrypt_4001(argp, clnt)
 {
 	static __db_encrypt_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_encrypt,
 		(xdrproc_t) xdr___db_encrypt_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_encrypt_reply, (caddr_t) &clnt_res,
@@ -399,7 +399,7 @@ __db_db_extentsize_4001(argp, clnt)
 {
 	static __db_extentsize_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_extentsize,
 		(xdrproc_t) xdr___db_extentsize_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_extentsize_reply, (caddr_t) &clnt_res,
@@ -416,7 +416,7 @@ __db_db_flags_4001(argp, clnt)
 {
 	static __db_flags_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_flags,
 		(xdrproc_t) xdr___db_flags_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_flags_reply, (caddr_t) &clnt_res,
@@ -433,7 +433,7 @@ __db_db_get_4001(argp, clnt)
 {
 	static __db_get_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_get,
 		(xdrproc_t) xdr___db_get_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_get_reply, (caddr_t) &clnt_res,
@@ -450,7 +450,7 @@ __db_db_h_ffactor_4001(argp, clnt)
 {
 	static __db_h_ffactor_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_h_ffactor,
 		(xdrproc_t) xdr___db_h_ffactor_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_h_ffactor_reply, (caddr_t) &clnt_res,
@@ -467,7 +467,7 @@ __db_db_h_nelem_4001(argp, clnt)
 {
 	static __db_h_nelem_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_h_nelem,
 		(xdrproc_t) xdr___db_h_nelem_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_h_nelem_reply, (caddr_t) &clnt_res,
@@ -484,7 +484,7 @@ __db_db_key_range_4001(argp, clnt)
 {
 	static __db_key_range_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_key_range,
 		(xdrproc_t) xdr___db_key_range_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_key_range_reply, (caddr_t) &clnt_res,
@@ -501,7 +501,7 @@ __db_db_lorder_4001(argp, clnt)
 {
 	static __db_lorder_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_lorder,
 		(xdrproc_t) xdr___db_lorder_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_lorder_reply, (caddr_t) &clnt_res,
@@ -518,7 +518,7 @@ __db_db_open_4001(argp, clnt)
 {
 	static __db_open_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_open,
 		(xdrproc_t) xdr___db_open_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_open_reply, (caddr_t) &clnt_res,
@@ -535,7 +535,7 @@ __db_db_pagesize_4001(argp, clnt)
 {
 	static __db_pagesize_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_pagesize,
 		(xdrproc_t) xdr___db_pagesize_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_pagesize_reply, (caddr_t) &clnt_res,
@@ -552,7 +552,7 @@ __db_db_pget_4001(argp, clnt)
 {
 	static __db_pget_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_pget,
 		(xdrproc_t) xdr___db_pget_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_pget_reply, (caddr_t) &clnt_res,
@@ -569,7 +569,7 @@ __db_db_put_4001(argp, clnt)
 {
 	static __db_put_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_put,
 		(xdrproc_t) xdr___db_put_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_put_reply, (caddr_t) &clnt_res,
@@ -586,7 +586,7 @@ __db_db_re_delim_4001(argp, clnt)
 {
 	static __db_re_delim_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_re_delim,
 		(xdrproc_t) xdr___db_re_delim_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_re_delim_reply, (caddr_t) &clnt_res,
@@ -603,7 +603,7 @@ __db_db_re_len_4001(argp, clnt)
 {
 	static __db_re_len_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_re_len,
 		(xdrproc_t) xdr___db_re_len_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_re_len_reply, (caddr_t) &clnt_res,
@@ -620,7 +620,7 @@ __db_db_re_pad_4001(argp, clnt)
 {
 	static __db_re_pad_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_re_pad,
 		(xdrproc_t) xdr___db_re_pad_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_re_pad_reply, (caddr_t) &clnt_res,
@@ -637,7 +637,7 @@ __db_db_remove_4001(argp, clnt)
 {
 	static __db_remove_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_remove,
 		(xdrproc_t) xdr___db_remove_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_remove_reply, (caddr_t) &clnt_res,
@@ -654,7 +654,7 @@ __db_db_rename_4001(argp, clnt)
 {
 	static __db_rename_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_rename,
 		(xdrproc_t) xdr___db_rename_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_rename_reply, (caddr_t) &clnt_res,
@@ -671,7 +671,7 @@ __db_db_stat_4001(argp, clnt)
 {
 	static __db_stat_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_stat,
 		(xdrproc_t) xdr___db_stat_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_stat_reply, (caddr_t) &clnt_res,
@@ -688,7 +688,7 @@ __db_db_sync_4001(argp, clnt)
 {
 	static __db_sync_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_sync,
 		(xdrproc_t) xdr___db_sync_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_sync_reply, (caddr_t) &clnt_res,
@@ -705,7 +705,7 @@ __db_db_truncate_4001(argp, clnt)
 {
 	static __db_truncate_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_truncate,
 		(xdrproc_t) xdr___db_truncate_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_truncate_reply, (caddr_t) &clnt_res,
@@ -722,7 +722,7 @@ __db_db_cursor_4001(argp, clnt)
 {
 	static __db_cursor_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_cursor,
 		(xdrproc_t) xdr___db_cursor_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_cursor_reply, (caddr_t) &clnt_res,
@@ -739,7 +739,7 @@ __db_db_join_4001(argp, clnt)
 {
 	static __db_join_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_db_join,
 		(xdrproc_t) xdr___db_join_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___db_join_reply, (caddr_t) &clnt_res,
@@ -756,7 +756,7 @@ __db_dbc_close_4001(argp, clnt)
 {
 	static __dbc_close_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_dbc_close,
 		(xdrproc_t) xdr___dbc_close_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___dbc_close_reply, (caddr_t) &clnt_res,
@@ -773,7 +773,7 @@ __db_dbc_count_4001(argp, clnt)
 {
 	static __dbc_count_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_dbc_count,
 		(xdrproc_t) xdr___dbc_count_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___dbc_count_reply, (caddr_t) &clnt_res,
@@ -790,7 +790,7 @@ __db_dbc_del_4001(argp, clnt)
 {
 	static __dbc_del_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_dbc_del,
 		(xdrproc_t) xdr___dbc_del_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___dbc_del_reply, (caddr_t) &clnt_res,
@@ -807,7 +807,7 @@ __db_dbc_dup_4001(argp, clnt)
 {
 	static __dbc_dup_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_dbc_dup,
 		(xdrproc_t) xdr___dbc_dup_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___dbc_dup_reply, (caddr_t) &clnt_res,
@@ -824,7 +824,7 @@ __db_dbc_get_4001(argp, clnt)
 {
 	static __dbc_get_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_dbc_get,
 		(xdrproc_t) xdr___dbc_get_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___dbc_get_reply, (caddr_t) &clnt_res,
@@ -841,7 +841,7 @@ __db_dbc_pget_4001(argp, clnt)
 {
 	static __dbc_pget_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_dbc_pget,
 		(xdrproc_t) xdr___dbc_pget_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___dbc_pget_reply, (caddr_t) &clnt_res,
@@ -858,7 +858,7 @@ __db_dbc_put_4001(argp, clnt)
 {
 	static __dbc_put_reply clnt_res;
 
-	memset((char *)&clnt_res, 0, sizeof (clnt_res));
+	memset((gchar *)&clnt_res, 0, sizeof (clnt_res));
 	if (clnt_call(clnt, __DB_dbc_put,
 		(xdrproc_t) xdr___dbc_put_msg, (caddr_t) argp,
 		(xdrproc_t) xdr___dbc_put_reply, (caddr_t) &clnt_res,
diff --git a/libdb/rpc_client/gen_client.c b/libdb/rpc_client/gen_client.c
index aed4946..d040c48 100644
--- a/libdb/rpc_client/gen_client.c
+++ b/libdb/rpc_client/gen_client.c
@@ -17,7 +17,7 @@
 #include "dbinc_auto/db_server.h"
 #include "dbinc_auto/rpc_client_ext.h"
 
-static int __dbcl_noserver __P((DB_ENV *));
+static gint __dbcl_noserver __P((DB_ENV *));
 
 static int
 __dbcl_noserver(dbenv)
@@ -27,27 +27,27 @@ __dbcl_noserver(dbenv)
 	return (DB_NOSERVER);
 }
 
-static int __dbcl_rpc_illegal __P((DB_ENV *, char *));
+static gint __dbcl_rpc_illegal __P((DB_ENV *, gchar *));
 
 static int
 __dbcl_rpc_illegal(dbenv, name)
 	DB_ENV *dbenv;
-	char *name;
+	gchar *name;
 {
 	__db_err(dbenv, "%s method meaningless in an RPC environment", name);
 	return (__db_eopnotsup(dbenv));
 }
 
 /*
- * PUBLIC: int __dbcl_env_alloc __P((DB_ENV *, void *(*)(size_t),
- * PUBLIC:      void *(*)(void *, size_t), void (*)(void *)));
+ * PUBLIC: gint __dbcl_env_alloc __P((DB_ENV *, gpointer (*)(size_t),
+ * PUBLIC:      gpointer (*)(gpointer , size_t), void (*)(gpointer)));
  */
-int
+gint
 __dbcl_env_alloc(dbenv, func0, func1, func2)
 	DB_ENV * dbenv;
-	void *(*func0) __P((size_t));
-	void *(*func1) __P((void *, size_t));
-	void (*func2) __P((void *));
+	gpointer (*func0) __P((size_t));
+	gpointer (*func1) __P((gpointer , size_t));
+	void (*func2) __P((gpointer));
 {
 	COMPQUIET(func0, 0);
 	COMPQUIET(func1, 0);
@@ -56,32 +56,32 @@ __dbcl_env_alloc(dbenv, func0, func1, func2)
 }
 
 /*
- * PUBLIC: int __dbcl_set_app_dispatch __P((DB_ENV *, int (*)(DB_ENV *, DBT *,
+ * PUBLIC: gint __dbcl_set_app_dispatch __P((DB_ENV *, gint (*)(DB_ENV *, DBT *,
  * PUBLIC:      DB_LSN *, db_recops)));
  */
-int
+gint
 __dbcl_set_app_dispatch(dbenv, func0)
 	DB_ENV * dbenv;
-	int (*func0) __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
+	gint (*func0) __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
 {
 	COMPQUIET(func0, 0);
 	return (__dbcl_rpc_illegal(dbenv, "set_app_dispatch"));
 }
 
 /*
- * PUBLIC: int __dbcl_env_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
+ * PUBLIC: gint __dbcl_env_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int));
  */
-int
+gint
 __dbcl_env_cachesize(dbenv, gbytes, bytes, ncache)
 	DB_ENV * dbenv;
 	u_int32_t gbytes;
 	u_int32_t bytes;
-	int ncache;
+	gint ncache;
 {
 	CLIENT *cl;
 	__env_cachesize_msg msg;
 	__env_cachesize_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -106,14 +106,14 @@ __dbcl_env_cachesize(dbenv, gbytes, bytes, ncache)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_cachesize_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_cachesize_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_env_close __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_env_close __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_env_close(dbenv, flags)
 	DB_ENV * dbenv;
 	u_int32_t flags;
@@ -121,7 +121,7 @@ __dbcl_env_close(dbenv, flags)
 	CLIENT *cl;
 	__env_close_msg msg;
 	__env_close_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -144,14 +144,14 @@ __dbcl_env_close(dbenv, flags)
 	ret = __dbcl_env_close_ret(dbenv, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_close_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_close_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_env_create __P((DB_ENV *, long));
+ * PUBLIC: gint __dbcl_env_create __P((DB_ENV *, long));
  */
-int
+gint
 __dbcl_env_create(dbenv, timeout)
 	DB_ENV * dbenv;
 	long timeout;
@@ -159,7 +159,7 @@ __dbcl_env_create(dbenv, timeout)
 	CLIENT *cl;
 	__env_create_msg msg;
 	__env_create_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -178,38 +178,38 @@ __dbcl_env_create(dbenv, timeout)
 	ret = __dbcl_env_create_ret(dbenv, timeout, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_create_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_create_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_set_data_dir __P((DB_ENV *, const char *));
+ * PUBLIC: gint __dbcl_set_data_dir __P((DB_ENV *, const gchar *));
  */
-int
+gint
 __dbcl_set_data_dir(dbenv, dir)
 	DB_ENV * dbenv;
-	const char * dir;
+	const gchar * dir;
 {
 	COMPQUIET(dir, NULL);
 	return (__dbcl_rpc_illegal(dbenv, "set_data_dir"));
 }
 
 /*
- * PUBLIC: int __dbcl_env_dbremove __P((DB_ENV *, DB_TXN *, const char *,
- * PUBLIC:      const char *, u_int32_t));
+ * PUBLIC: gint __dbcl_env_dbremove __P((DB_ENV *, DB_TXN *, const gchar *,
+ * PUBLIC:      const gchar *, u_int32_t));
  */
-int
+gint
 __dbcl_env_dbremove(dbenv, txnp, name, subdb, flags)
 	DB_ENV * dbenv;
 	DB_TXN * txnp;
-	const char * name;
-	const char * subdb;
+	const gchar * name;
+	const gchar * subdb;
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__env_dbremove_msg msg;
 	__env_dbremove_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -228,11 +228,11 @@ __dbcl_env_dbremove(dbenv, txnp, name, subdb, flags)
 	if (name == NULL)
 		msg.name = "";
 	else
-		msg.name = (char *)name;
+		msg.name = (gchar *)name;
 	if (subdb == NULL)
 		msg.subdb = "";
 	else
-		msg.subdb = (char *)subdb;
+		msg.subdb = (gchar *)subdb;
 	msg.flags = flags;
 
 	replyp = __db_env_dbremove_4001(&msg, cl);
@@ -244,27 +244,27 @@ __dbcl_env_dbremove(dbenv, txnp, name, subdb, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_dbremove_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_dbremove_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_env_dbrename __P((DB_ENV *, DB_TXN *, const char *,
- * PUBLIC:      const char *, const char *, u_int32_t));
+ * PUBLIC: gint __dbcl_env_dbrename __P((DB_ENV *, DB_TXN *, const gchar *,
+ * PUBLIC:      const gchar *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbcl_env_dbrename(dbenv, txnp, name, subdb, newname, flags)
 	DB_ENV * dbenv;
 	DB_TXN * txnp;
-	const char * name;
-	const char * subdb;
-	const char * newname;
+	const gchar * name;
+	const gchar * subdb;
+	const gchar * newname;
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__env_dbrename_msg msg;
 	__env_dbrename_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -283,15 +283,15 @@ __dbcl_env_dbrename(dbenv, txnp, name, subdb, newname, flags)
 	if (name == NULL)
 		msg.name = "";
 	else
-		msg.name = (char *)name;
+		msg.name = (gchar *)name;
 	if (subdb == NULL)
 		msg.subdb = "";
 	else
-		msg.subdb = (char *)subdb;
+		msg.subdb = (gchar *)subdb;
 	if (newname == NULL)
 		msg.newname = "";
 	else
-		msg.newname = (char *)newname;
+		msg.newname = (gchar *)newname;
 	msg.flags = flags;
 
 	replyp = __db_env_dbrename_4001(&msg, cl);
@@ -303,23 +303,23 @@ __dbcl_env_dbrename(dbenv, txnp, name, subdb, newname, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_dbrename_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_dbrename_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_env_encrypt __P((DB_ENV *, const char *, u_int32_t));
+ * PUBLIC: gint __dbcl_env_encrypt __P((DB_ENV *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbcl_env_encrypt(dbenv, passwd, flags)
 	DB_ENV * dbenv;
-	const char * passwd;
+	const gchar * passwd;
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__env_encrypt_msg msg;
 	__env_encrypt_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -334,7 +334,7 @@ __dbcl_env_encrypt(dbenv, passwd, flags)
 	if (passwd == NULL)
 		msg.passwd = "";
 	else
-		msg.passwd = (char *)passwd;
+		msg.passwd = (gchar *)passwd;
 	msg.flags = flags;
 
 	replyp = __db_env_encrypt_4001(&msg, cl);
@@ -346,15 +346,15 @@ __dbcl_env_encrypt(dbenv, passwd, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_encrypt_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_encrypt_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_env_set_feedback __P((DB_ENV *, void (*)(DB_ENV *, int,
+ * PUBLIC: gint __dbcl_env_set_feedback __P((DB_ENV *, void (*)(DB_ENV *, int,
  * PUBLIC:      int)));
  */
-int
+gint
 __dbcl_env_set_feedback(dbenv, func0)
 	DB_ENV * dbenv;
 	void (*func0) __P((DB_ENV *, int, int));
@@ -364,18 +364,18 @@ __dbcl_env_set_feedback(dbenv, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_env_flags __P((DB_ENV *, u_int32_t, int));
+ * PUBLIC: gint __dbcl_env_flags __P((DB_ENV *, u_int32_t, int));
  */
-int
+gint
 __dbcl_env_flags(dbenv, flags, onoff)
 	DB_ENV * dbenv;
 	u_int32_t flags;
-	int onoff;
+	gint onoff;
 {
 	CLIENT *cl;
 	__env_flags_msg msg;
 	__env_flags_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -399,14 +399,14 @@ __dbcl_env_flags(dbenv, flags, onoff)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_flags_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_flags_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_set_lg_bsize __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_lg_bsize __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_lg_bsize(dbenv, bsize)
 	DB_ENV * dbenv;
 	u_int32_t bsize;
@@ -416,21 +416,21 @@ __dbcl_set_lg_bsize(dbenv, bsize)
 }
 
 /*
- * PUBLIC: int __dbcl_set_lg_dir __P((DB_ENV *, const char *));
+ * PUBLIC: gint __dbcl_set_lg_dir __P((DB_ENV *, const gchar *));
  */
-int
+gint
 __dbcl_set_lg_dir(dbenv, dir)
 	DB_ENV * dbenv;
-	const char * dir;
+	const gchar * dir;
 {
 	COMPQUIET(dir, NULL);
 	return (__dbcl_rpc_illegal(dbenv, "set_lg_dir"));
 }
 
 /*
- * PUBLIC: int __dbcl_set_lg_max __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_lg_max __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_lg_max(dbenv, max)
 	DB_ENV * dbenv;
 	u_int32_t max;
@@ -440,9 +440,9 @@ __dbcl_set_lg_max(dbenv, max)
 }
 
 /*
- * PUBLIC: int __dbcl_set_lg_regionmax __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_lg_regionmax __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_lg_regionmax(dbenv, max)
 	DB_ENV * dbenv;
 	u_int32_t max;
@@ -452,13 +452,13 @@ __dbcl_set_lg_regionmax(dbenv, max)
 }
 
 /*
- * PUBLIC: int __dbcl_set_lk_conflict __P((DB_ENV *, u_int8_t *, int));
+ * PUBLIC: gint __dbcl_set_lk_conflict __P((DB_ENV *, u_int8_t *, int));
  */
-int
+gint
 __dbcl_set_lk_conflict(dbenv, conflicts, modes)
 	DB_ENV * dbenv;
 	u_int8_t * conflicts;
-	int modes;
+	gint modes;
 {
 	COMPQUIET(conflicts, 0);
 	COMPQUIET(modes, 0);
@@ -466,9 +466,9 @@ __dbcl_set_lk_conflict(dbenv, conflicts, modes)
 }
 
 /*
- * PUBLIC: int __dbcl_set_lk_detect __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_lk_detect __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_lk_detect(dbenv, detect)
 	DB_ENV * dbenv;
 	u_int32_t detect;
@@ -478,9 +478,9 @@ __dbcl_set_lk_detect(dbenv, detect)
 }
 
 /*
- * PUBLIC: int __dbcl_set_lk_max __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_lk_max __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_lk_max(dbenv, max)
 	DB_ENV * dbenv;
 	u_int32_t max;
@@ -490,9 +490,9 @@ __dbcl_set_lk_max(dbenv, max)
 }
 
 /*
- * PUBLIC: int __dbcl_set_lk_max_locks __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_lk_max_locks __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_lk_max_locks(dbenv, max)
 	DB_ENV * dbenv;
 	u_int32_t max;
@@ -502,9 +502,9 @@ __dbcl_set_lk_max_locks(dbenv, max)
 }
 
 /*
- * PUBLIC: int __dbcl_set_lk_max_lockers __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_lk_max_lockers __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_lk_max_lockers(dbenv, max)
 	DB_ENV * dbenv;
 	u_int32_t max;
@@ -514,9 +514,9 @@ __dbcl_set_lk_max_lockers(dbenv, max)
 }
 
 /*
- * PUBLIC: int __dbcl_set_lk_max_objects __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_lk_max_objects __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_lk_max_objects(dbenv, max)
 	DB_ENV * dbenv;
 	u_int32_t max;
@@ -526,9 +526,9 @@ __dbcl_set_lk_max_objects(dbenv, max)
 }
 
 /*
- * PUBLIC: int __dbcl_set_mp_mmapsize __P((DB_ENV *, size_t));
+ * PUBLIC: gint __dbcl_set_mp_mmapsize __P((DB_ENV *, size_t));
  */
-int
+gint
 __dbcl_set_mp_mmapsize(dbenv, mmapsize)
 	DB_ENV * dbenv;
 	size_t mmapsize;
@@ -538,19 +538,19 @@ __dbcl_set_mp_mmapsize(dbenv, mmapsize)
 }
 
 /*
- * PUBLIC: int __dbcl_env_open __P((DB_ENV *, const char *, u_int32_t, int));
+ * PUBLIC: gint __dbcl_env_open __P((DB_ENV *, const gchar *, u_int32_t, int));
  */
-int
+gint
 __dbcl_env_open(dbenv, home, flags, mode)
 	DB_ENV * dbenv;
-	const char * home;
+	const gchar * home;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 {
 	CLIENT *cl;
 	__env_open_msg msg;
 	__env_open_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -565,7 +565,7 @@ __dbcl_env_open(dbenv, home, flags, mode)
 	if (home == NULL)
 		msg.home = "";
 	else
-		msg.home = (char *)home;
+		msg.home = (gchar *)home;
 	msg.flags = flags;
 	msg.mode = mode;
 
@@ -578,14 +578,14 @@ __dbcl_env_open(dbenv, home, flags, mode)
 	ret = __dbcl_env_open_ret(dbenv, home, flags, mode, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_open_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_open_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_env_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
+ * PUBLIC: gint __dbcl_env_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int)));
  */
-int
+gint
 __dbcl_env_paniccall(dbenv, func0)
 	DB_ENV * dbenv;
 	void (*func0) __P((DB_ENV *, int));
@@ -595,18 +595,18 @@ __dbcl_env_paniccall(dbenv, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_env_remove __P((DB_ENV *, const char *, u_int32_t));
+ * PUBLIC: gint __dbcl_env_remove __P((DB_ENV *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbcl_env_remove(dbenv, home, flags)
 	DB_ENV * dbenv;
-	const char * home;
+	const gchar * home;
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__env_remove_msg msg;
 	__env_remove_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -621,7 +621,7 @@ __dbcl_env_remove(dbenv, home, flags)
 	if (home == NULL)
 		msg.home = "";
 	else
-		msg.home = (char *)home;
+		msg.home = (gchar *)home;
 	msg.flags = flags;
 
 	replyp = __db_env_remove_4001(&msg, cl);
@@ -633,14 +633,14 @@ __dbcl_env_remove(dbenv, home, flags)
 	ret = __dbcl_env_remove_ret(dbenv, home, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___env_remove_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___env_remove_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_set_shm_key __P((DB_ENV *, long));
+ * PUBLIC: gint __dbcl_set_shm_key __P((DB_ENV *, long));
  */
-int
+gint
 __dbcl_set_shm_key(dbenv, shm_key)
 	DB_ENV * dbenv;
 	long shm_key;
@@ -650,9 +650,9 @@ __dbcl_set_shm_key(dbenv, shm_key)
 }
 
 /*
- * PUBLIC: int __dbcl_set_tas_spins __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_tas_spins __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_tas_spins(dbenv, tas_spins)
 	DB_ENV * dbenv;
 	u_int32_t tas_spins;
@@ -662,9 +662,9 @@ __dbcl_set_tas_spins(dbenv, tas_spins)
 }
 
 /*
- * PUBLIC: int __dbcl_set_timeout __P((DB_ENV *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __dbcl_set_timeout __P((DB_ENV *, u_int32_t, u_int32_t));
  */
-int
+gint
 __dbcl_set_timeout(dbenv, timeout, flags)
 	DB_ENV * dbenv;
 	u_int32_t timeout;
@@ -676,21 +676,21 @@ __dbcl_set_timeout(dbenv, timeout, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_set_tmp_dir __P((DB_ENV *, const char *));
+ * PUBLIC: gint __dbcl_set_tmp_dir __P((DB_ENV *, const gchar *));
  */
-int
+gint
 __dbcl_set_tmp_dir(dbenv, dir)
 	DB_ENV * dbenv;
-	const char * dir;
+	const gchar * dir;
 {
 	COMPQUIET(dir, NULL);
 	return (__dbcl_rpc_illegal(dbenv, "set_tmp_dir"));
 }
 
 /*
- * PUBLIC: int __dbcl_set_tx_max __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_set_tx_max __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_set_tx_max(dbenv, max)
 	DB_ENV * dbenv;
 	u_int32_t max;
@@ -700,9 +700,9 @@ __dbcl_set_tx_max(dbenv, max)
 }
 
 /*
- * PUBLIC: int __dbcl_set_tx_timestamp __P((DB_ENV *, time_t *));
+ * PUBLIC: gint __dbcl_set_tx_timestamp __P((DB_ENV *, time_t *));
  */
-int
+gint
 __dbcl_set_tx_timestamp(dbenv, max)
 	DB_ENV * dbenv;
 	time_t * max;
@@ -712,13 +712,13 @@ __dbcl_set_tx_timestamp(dbenv, max)
 }
 
 /*
- * PUBLIC: int __dbcl_set_verbose __P((DB_ENV *, u_int32_t, int));
+ * PUBLIC: gint __dbcl_set_verbose __P((DB_ENV *, u_int32_t, int));
  */
-int
+gint
 __dbcl_set_verbose(dbenv, which, onoff)
 	DB_ENV * dbenv;
 	u_int32_t which;
-	int onoff;
+	gint onoff;
 {
 	COMPQUIET(which, 0);
 	COMPQUIET(onoff, 0);
@@ -726,16 +726,16 @@ __dbcl_set_verbose(dbenv, which, onoff)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_abort __P((DB_TXN *));
+ * PUBLIC: gint __dbcl_txn_abort __P((DB_TXN *));
  */
-int
+gint
 __dbcl_txn_abort(txnp)
 	DB_TXN * txnp;
 {
 	CLIENT *cl;
 	__txn_abort_msg msg;
 	__txn_abort_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -759,15 +759,15 @@ __dbcl_txn_abort(txnp)
 	ret = __dbcl_txn_abort_ret(txnp, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___txn_abort_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___txn_abort_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **,
+ * PUBLIC: gint __dbcl_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_txn_begin(dbenv, parent, txnpp, flags)
 	DB_ENV * dbenv;
 	DB_TXN * parent;
@@ -777,7 +777,7 @@ __dbcl_txn_begin(dbenv, parent, txnpp, flags)
 	CLIENT *cl;
 	__txn_begin_msg msg;
 	__txn_begin_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -804,15 +804,15 @@ __dbcl_txn_begin(dbenv, parent, txnpp, flags)
 	ret = __dbcl_txn_begin_ret(dbenv, parent, txnpp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___txn_begin_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___txn_begin_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t,
+ * PUBLIC: gint __dbcl_txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_txn_checkpoint(dbenv, kbyte, min, flags)
 	DB_ENV * dbenv;
 	u_int32_t kbyte;
@@ -826,9 +826,9 @@ __dbcl_txn_checkpoint(dbenv, kbyte, min, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_commit __P((DB_TXN *, u_int32_t));
+ * PUBLIC: gint __dbcl_txn_commit __P((DB_TXN *, u_int32_t));
  */
-int
+gint
 __dbcl_txn_commit(txnp, flags)
 	DB_TXN * txnp;
 	u_int32_t flags;
@@ -836,7 +836,7 @@ __dbcl_txn_commit(txnp, flags)
 	CLIENT *cl;
 	__txn_commit_msg msg;
 	__txn_commit_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -861,14 +861,14 @@ __dbcl_txn_commit(txnp, flags)
 	ret = __dbcl_txn_commit_ret(txnp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___txn_commit_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___txn_commit_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_txn_discard __P((DB_TXN *, u_int32_t));
+ * PUBLIC: gint __dbcl_txn_discard __P((DB_TXN *, u_int32_t));
  */
-int
+gint
 __dbcl_txn_discard(txnp, flags)
 	DB_TXN * txnp;
 	u_int32_t flags;
@@ -876,7 +876,7 @@ __dbcl_txn_discard(txnp, flags)
 	CLIENT *cl;
 	__txn_discard_msg msg;
 	__txn_discard_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -901,14 +901,14 @@ __dbcl_txn_discard(txnp, flags)
 	ret = __dbcl_txn_discard_ret(txnp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___txn_discard_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___txn_discard_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_txn_prepare __P((DB_TXN *, u_int8_t *));
+ * PUBLIC: gint __dbcl_txn_prepare __P((DB_TXN *, u_int8_t *));
  */
-int
+gint
 __dbcl_txn_prepare(txnp, gid)
 	DB_TXN * txnp;
 	u_int8_t * gid;
@@ -916,7 +916,7 @@ __dbcl_txn_prepare(txnp, gid)
 	CLIENT *cl;
 	__txn_prepare_msg msg;
 	__txn_prepare_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -941,15 +941,15 @@ __dbcl_txn_prepare(txnp, gid)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___txn_prepare_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___txn_prepare_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *,
+ * PUBLIC: gint __dbcl_txn_recover __P((DB_ENV *, DB_PREPLIST *, long, long *,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_txn_recover(dbenv, preplist, count, retp, flags)
 	DB_ENV * dbenv;
 	DB_PREPLIST * preplist;
@@ -960,7 +960,7 @@ __dbcl_txn_recover(dbenv, preplist, count, retp, flags)
 	CLIENT *cl;
 	__txn_recover_msg msg;
 	__txn_recover_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -984,14 +984,14 @@ __dbcl_txn_recover(dbenv, preplist, count, retp, flags)
 	ret = __dbcl_txn_recover_ret(dbenv, preplist, count, retp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___txn_recover_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___txn_recover_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
+ * PUBLIC: gint __dbcl_txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
  */
-int
+gint
 __dbcl_txn_stat(dbenv, statp, flags)
 	DB_ENV * dbenv;
 	DB_TXN_STAT ** statp;
@@ -1003,9 +1003,9 @@ __dbcl_txn_stat(dbenv, statp, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_timeout __P((DB_TXN *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __dbcl_txn_timeout __P((DB_TXN *, u_int32_t, u_int32_t));
  */
-int
+gint
 __dbcl_txn_timeout(txnp, timeout, flags)
 	DB_TXN * txnp;
 	u_int32_t timeout;
@@ -1020,15 +1020,15 @@ __dbcl_txn_timeout(txnp, timeout, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_rep_elect __P((DB_ENV *, int, int, u_int32_t, int *));
+ * PUBLIC: gint __dbcl_rep_elect __P((DB_ENV *, int, int, u_int32_t, gint *));
  */
-int
+gint
 __dbcl_rep_elect(dbenv, nsites, pri, timeout, idp)
 	DB_ENV * dbenv;
-	int nsites;
-	int pri;
+	gint nsites;
+	gint pri;
 	u_int32_t timeout;
-	int * idp;
+	gint * idp;
 {
 	COMPQUIET(nsites, 0);
 	COMPQUIET(pri, 0);
@@ -1038,9 +1038,9 @@ __dbcl_rep_elect(dbenv, nsites, pri, timeout, idp)
 }
 
 /*
- * PUBLIC: int __dbcl_rep_flush __P((DB_ENV *));
+ * PUBLIC: gint __dbcl_rep_flush __P((DB_ENV *));
  */
-int
+gint
 __dbcl_rep_flush(dbenv)
 	DB_ENV * dbenv;
 {
@@ -1048,14 +1048,14 @@ __dbcl_rep_flush(dbenv)
 }
 
 /*
- * PUBLIC: int __dbcl_rep_process_message __P((DB_ENV *, DBT *, DBT *, int *));
+ * PUBLIC: gint __dbcl_rep_process_message __P((DB_ENV *, DBT *, DBT *, gint *));
  */
-int
+gint
 __dbcl_rep_process_message(dbenv, rec, control, idp)
 	DB_ENV * dbenv;
 	DBT * rec;
 	DBT * control;
-	int * idp;
+	gint * idp;
 {
 	COMPQUIET(rec, NULL);
 	COMPQUIET(control, NULL);
@@ -1064,9 +1064,9 @@ __dbcl_rep_process_message(dbenv, rec, control, idp)
 }
 
 /*
- * PUBLIC: int __dbcl_rep_set_limit __P((DB_ENV *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __dbcl_rep_set_limit __P((DB_ENV *, u_int32_t, u_int32_t));
  */
-int
+gint
 __dbcl_rep_set_limit(dbenv, mbytes, bytes)
 	DB_ENV * dbenv;
 	u_int32_t mbytes;
@@ -1078,9 +1078,9 @@ __dbcl_rep_set_limit(dbenv, mbytes, bytes)
 }
 
 /*
- * PUBLIC: int __dbcl_rep_set_request __P((DB_ENV *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __dbcl_rep_set_request __P((DB_ENV *, u_int32_t, u_int32_t));
  */
-int
+gint
 __dbcl_rep_set_request(dbenv, min, max)
 	DB_ENV * dbenv;
 	u_int32_t min;
@@ -1092,14 +1092,14 @@ __dbcl_rep_set_request(dbenv, min, max)
 }
 
 /*
- * PUBLIC: int __dbcl_rep_set_rep_transport __P((DB_ENV *, int,
- * PUBLIC:      int (*)(DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
+ * PUBLIC: gint __dbcl_rep_set_rep_transport __P((DB_ENV *, int,
+ * PUBLIC:      gint (*)(DB_ENV *, const DBT *, const DBT *, int, u_int32_t)));
  */
-int
+gint
 __dbcl_rep_set_rep_transport(dbenv, id, func0)
 	DB_ENV * dbenv;
-	int id;
-	int (*func0) __P((DB_ENV *, const DBT *, const DBT *, int, u_int32_t));
+	gint id;
+	gint (*func0) __P((DB_ENV *, const DBT *, const DBT *, int, u_int32_t));
 {
 	COMPQUIET(id, 0);
 	COMPQUIET(func0, 0);
@@ -1107,9 +1107,9 @@ __dbcl_rep_set_rep_transport(dbenv, id, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_rep_start __P((DB_ENV *, DBT *, u_int32_t));
+ * PUBLIC: gint __dbcl_rep_start __P((DB_ENV *, DBT *, u_int32_t));
  */
-int
+gint
 __dbcl_rep_start(dbenv, cdata, flags)
 	DB_ENV * dbenv;
 	DBT * cdata;
@@ -1121,9 +1121,9 @@ __dbcl_rep_start(dbenv, cdata, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_rep_stat __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
+ * PUBLIC: gint __dbcl_rep_stat __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
  */
-int
+gint
 __dbcl_rep_stat(dbenv, statp, flags)
 	DB_ENV * dbenv;
 	DB_REP_STAT ** statp;
@@ -1135,15 +1135,15 @@ __dbcl_rep_stat(dbenv, statp, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_db_alloc __P((DB *, void *(*)(size_t), void *(*)(void *,
- * PUBLIC:      size_t), void (*)(void *)));
+ * PUBLIC: gint __dbcl_db_alloc __P((DB *, gpointer (*)(size_t), gpointer (*)(gpointer ,
+ * PUBLIC:      size_t), void (*)(gpointer)));
  */
-int
+gint
 __dbcl_db_alloc(dbp, func0, func1, func2)
 	DB * dbp;
-	void *(*func0) __P((size_t));
-	void *(*func1) __P((void *, size_t));
-	void (*func2) __P((void *));
+	gpointer (*func0) __P((size_t));
+	gpointer (*func1) __P((gpointer , size_t));
+	void (*func2) __P((gpointer));
 {
 	DB_ENV *dbenv;
 
@@ -1155,21 +1155,21 @@ __dbcl_db_alloc(dbp, func0, func1, func2)
 }
 
 /*
- * PUBLIC: int __dbcl_db_associate __P((DB *, DB_TXN *, DB *, int (*)(DB *,
+ * PUBLIC: gint __dbcl_db_associate __P((DB *, DB_TXN *, DB *, gint (*)(DB *,
  * PUBLIC:      const DBT *, const DBT *, DBT *), u_int32_t));
  */
-int
+gint
 __dbcl_db_associate(dbp, txnp, sdbp, func0, flags)
 	DB * dbp;
 	DB_TXN * txnp;
 	DB * sdbp;
-	int (*func0) __P((DB *, const DBT *, const DBT *, DBT *));
+	gint (*func0) __P((DB *, const DBT *, const DBT *, DBT *));
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__db_associate_msg msg;
 	__db_associate_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1206,18 +1206,18 @@ __dbcl_db_associate(dbp, txnp, sdbp, func0, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_associate_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_associate_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_bt_compare __P((DB *, int (*)(DB *, const DBT *,
+ * PUBLIC: gint __dbcl_db_bt_compare __P((DB *, gint (*)(DB *, const DBT *,
  * PUBLIC:      const DBT *)));
  */
-int
+gint
 __dbcl_db_bt_compare(dbp, func0)
 	DB * dbp;
-	int (*func0) __P((DB *, const DBT *, const DBT *));
+	gint (*func0) __P((DB *, const DBT *, const DBT *));
 {
 	DB_ENV *dbenv;
 
@@ -1227,9 +1227,9 @@ __dbcl_db_bt_compare(dbp, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_db_bt_maxkey __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_bt_maxkey __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_bt_maxkey(dbp, maxkey)
 	DB * dbp;
 	u_int32_t maxkey;
@@ -1237,7 +1237,7 @@ __dbcl_db_bt_maxkey(dbp, maxkey)
 	CLIENT *cl;
 	__db_bt_maxkey_msg msg;
 	__db_bt_maxkey_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1262,14 +1262,14 @@ __dbcl_db_bt_maxkey(dbp, maxkey)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_bt_maxkey_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_bt_maxkey_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_bt_minkey __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_bt_minkey __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_bt_minkey(dbp, minkey)
 	DB * dbp;
 	u_int32_t minkey;
@@ -1277,7 +1277,7 @@ __dbcl_db_bt_minkey(dbp, minkey)
 	CLIENT *cl;
 	__db_bt_minkey_msg msg;
 	__db_bt_minkey_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1302,15 +1302,15 @@ __dbcl_db_bt_minkey(dbp, minkey)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_bt_minkey_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_bt_minkey_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_bt_prefix __P((DB *, size_t(*)(DB *, const DBT *,
+ * PUBLIC: gint __dbcl_db_bt_prefix __P((DB *, size_t(*)(DB *, const DBT *,
  * PUBLIC:      const DBT *)));
  */
-int
+gint
 __dbcl_db_bt_prefix(dbp, func0)
 	DB * dbp;
 	size_t (*func0) __P((DB *, const DBT *, const DBT *));
@@ -1323,13 +1323,13 @@ __dbcl_db_bt_prefix(dbp, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_db_set_append_recno __P((DB *, int (*)(DB *, DBT *,
+ * PUBLIC: gint __dbcl_db_set_append_recno __P((DB *, gint (*)(DB *, DBT *,
  * PUBLIC:      db_recno_t)));
  */
-int
+gint
 __dbcl_db_set_append_recno(dbp, func0)
 	DB * dbp;
-	int (*func0) __P((DB *, DBT *, db_recno_t));
+	gint (*func0) __P((DB *, DBT *, db_recno_t));
 {
 	DB_ENV *dbenv;
 
@@ -1339,9 +1339,9 @@ __dbcl_db_set_append_recno(dbp, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_db_cache_priority __P((DB *, DB_CACHE_PRIORITY));
+ * PUBLIC: gint __dbcl_db_cache_priority __P((DB *, DB_CACHE_PRIORITY));
  */
-int
+gint
 __dbcl_db_cache_priority(dbp, priority)
 	DB * dbp;
 	DB_CACHE_PRIORITY priority;
@@ -1354,14 +1354,14 @@ __dbcl_db_cache_priority(dbp, priority)
 }
 
 /*
- * PUBLIC: int __dbcl_db_cachesize __P((DB *, u_int32_t, u_int32_t, int));
+ * PUBLIC: gint __dbcl_db_cachesize __P((DB *, u_int32_t, u_int32_t, int));
  */
-int
+gint
 __dbcl_db_cachesize(dbp, gbytes, bytes, ncache)
 	DB * dbp;
 	u_int32_t gbytes;
 	u_int32_t bytes;
-	int ncache;
+	gint ncache;
 {
 	DB_ENV *dbenv;
 
@@ -1373,9 +1373,9 @@ __dbcl_db_cachesize(dbp, gbytes, bytes, ncache)
 }
 
 /*
- * PUBLIC: int __dbcl_db_close __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_close __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_close(dbp, flags)
 	DB * dbp;
 	u_int32_t flags;
@@ -1383,7 +1383,7 @@ __dbcl_db_close(dbp, flags)
 	CLIENT *cl;
 	__db_close_msg msg;
 	__db_close_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1408,14 +1408,14 @@ __dbcl_db_close(dbp, flags)
 	ret = __dbcl_db_close_ret(dbp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_close_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_close_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_create __P((DB *, DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_create __P((DB *, DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_db_create(dbp, dbenv, flags)
 	DB * dbp;
 	DB_ENV * dbenv;
@@ -1424,7 +1424,7 @@ __dbcl_db_create(dbp, dbenv, flags)
 	CLIENT *cl;
 	__db_create_msg msg;
 	__db_create_reply *replyp = NULL;
-	int ret;
+	gint ret;
 
 	ret = 0;
 	if (dbenv == NULL || !RPC_ON(dbenv))
@@ -1447,14 +1447,14 @@ __dbcl_db_create(dbp, dbenv, flags)
 	ret = __dbcl_db_create_ret(dbp, dbenv, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_create_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_create_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_del __P((DB *, DB_TXN *, DBT *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_del __P((DB *, DB_TXN *, DBT *, u_int32_t));
  */
-int
+gint
 __dbcl_db_del(dbp, txnp, key, flags)
 	DB * dbp;
 	DB_TXN * txnp;
@@ -1464,7 +1464,7 @@ __dbcl_db_del(dbp, txnp, key, flags)
 	CLIENT *cl;
 	__db_del_msg msg;
 	__db_del_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1499,18 +1499,18 @@ __dbcl_db_del(dbp, txnp, key, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_del_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_del_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_dup_compare __P((DB *, int (*)(DB *, const DBT *,
+ * PUBLIC: gint __dbcl_db_dup_compare __P((DB *, gint (*)(DB *, const DBT *,
  * PUBLIC:      const DBT *)));
  */
-int
+gint
 __dbcl_db_dup_compare(dbp, func0)
 	DB * dbp;
-	int (*func0) __P((DB *, const DBT *, const DBT *));
+	gint (*func0) __P((DB *, const DBT *, const DBT *));
 {
 	DB_ENV *dbenv;
 
@@ -1520,18 +1520,18 @@ __dbcl_db_dup_compare(dbp, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_db_encrypt __P((DB *, const char *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_encrypt __P((DB *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbcl_db_encrypt(dbp, passwd, flags)
 	DB * dbp;
-	const char * passwd;
+	const gchar * passwd;
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__db_encrypt_msg msg;
 	__db_encrypt_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1548,7 +1548,7 @@ __dbcl_db_encrypt(dbp, passwd, flags)
 	if (passwd == NULL)
 		msg.passwd = "";
 	else
-		msg.passwd = (char *)passwd;
+		msg.passwd = (gchar *)passwd;
 	msg.flags = flags;
 
 	replyp = __db_db_encrypt_4001(&msg, cl);
@@ -1560,14 +1560,14 @@ __dbcl_db_encrypt(dbp, passwd, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_encrypt_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_encrypt_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_extentsize __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_extentsize __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_extentsize(dbp, extentsize)
 	DB * dbp;
 	u_int32_t extentsize;
@@ -1575,7 +1575,7 @@ __dbcl_db_extentsize(dbp, extentsize)
 	CLIENT *cl;
 	__db_extentsize_msg msg;
 	__db_extentsize_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1600,17 +1600,17 @@ __dbcl_db_extentsize(dbp, extentsize)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_extentsize_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_extentsize_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_fd __P((DB *, int *));
+ * PUBLIC: gint __dbcl_db_fd __P((DB *, gint *));
  */
-int
+gint
 __dbcl_db_fd(dbp, fdp)
 	DB * dbp;
-	int * fdp;
+	gint * fdp;
 {
 	DB_ENV *dbenv;
 
@@ -1620,9 +1620,9 @@ __dbcl_db_fd(dbp, fdp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_feedback __P((DB *, void (*)(DB *, int, int)));
+ * PUBLIC: gint __dbcl_db_feedback __P((DB *, void (*)(DB *, int, int)));
  */
-int
+gint
 __dbcl_db_feedback(dbp, func0)
 	DB * dbp;
 	void (*func0) __P((DB *, int, int));
@@ -1635,9 +1635,9 @@ __dbcl_db_feedback(dbp, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_db_flags __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_flags __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_flags(dbp, flags)
 	DB * dbp;
 	u_int32_t flags;
@@ -1645,7 +1645,7 @@ __dbcl_db_flags(dbp, flags)
 	CLIENT *cl;
 	__db_flags_msg msg;
 	__db_flags_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1670,14 +1670,14 @@ __dbcl_db_flags(dbp, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_flags_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_flags_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __dbcl_db_get(dbp, txnp, key, data, flags)
 	DB * dbp;
 	DB_TXN * txnp;
@@ -1688,7 +1688,7 @@ __dbcl_db_get(dbp, txnp, key, data, flags)
 	CLIENT *cl;
 	__db_get_msg msg;
 	__db_get_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1729,14 +1729,14 @@ __dbcl_db_get(dbp, txnp, key, data, flags)
 	ret = __dbcl_db_get_ret(dbp, txnp, key, data, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_get_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_get_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_h_ffactor __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_h_ffactor __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_h_ffactor(dbp, ffactor)
 	DB * dbp;
 	u_int32_t ffactor;
@@ -1744,7 +1744,7 @@ __dbcl_db_h_ffactor(dbp, ffactor)
 	CLIENT *cl;
 	__db_h_ffactor_msg msg;
 	__db_h_ffactor_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1769,18 +1769,18 @@ __dbcl_db_h_ffactor(dbp, ffactor)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_h_ffactor_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_h_ffactor_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_h_hash __P((DB *, u_int32_t(*)(DB *, const void *,
+ * PUBLIC: gint __dbcl_db_h_hash __P((DB *, u_int32_t(*)(DB *, gconstpointer ,
  * PUBLIC:      u_int32_t)));
  */
-int
+gint
 __dbcl_db_h_hash(dbp, func0)
 	DB * dbp;
-	u_int32_t (*func0) __P((DB *, const void *, u_int32_t));
+	u_int32_t (*func0) __P((DB *, gconstpointer , u_int32_t));
 {
 	DB_ENV *dbenv;
 
@@ -1790,9 +1790,9 @@ __dbcl_db_h_hash(dbp, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_db_h_nelem __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_h_nelem __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_h_nelem(dbp, nelem)
 	DB * dbp;
 	u_int32_t nelem;
@@ -1800,7 +1800,7 @@ __dbcl_db_h_nelem(dbp, nelem)
 	CLIENT *cl;
 	__db_h_nelem_msg msg;
 	__db_h_nelem_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1825,15 +1825,15 @@ __dbcl_db_h_nelem(dbp, nelem)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_h_nelem_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_h_nelem_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *,
+ * PUBLIC: gint __dbcl_db_key_range __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_db_key_range(dbp, txnp, key, range, flags)
 	DB * dbp;
 	DB_TXN * txnp;
@@ -1844,7 +1844,7 @@ __dbcl_db_key_range(dbp, txnp, key, range, flags)
 	CLIENT *cl;
 	__db_key_range_msg msg;
 	__db_key_range_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1879,22 +1879,22 @@ __dbcl_db_key_range(dbp, txnp, key, range, flags)
 	ret = __dbcl_db_key_range_ret(dbp, txnp, key, range, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_key_range_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_key_range_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_lorder __P((DB *, int));
+ * PUBLIC: gint __dbcl_db_lorder __P((DB *, int));
  */
-int
+gint
 __dbcl_db_lorder(dbp, lorder)
 	DB * dbp;
-	int lorder;
+	gint lorder;
 {
 	CLIENT *cl;
 	__db_lorder_msg msg;
 	__db_lorder_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1919,28 +1919,28 @@ __dbcl_db_lorder(dbp, lorder)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_lorder_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_lorder_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_open __P((DB *, DB_TXN *, const char *, const char *,
+ * PUBLIC: gint __dbcl_db_open __P((DB *, DB_TXN *, const gchar *, const gchar *,
  * PUBLIC:      DBTYPE, u_int32_t, int));
  */
-int
+gint
 __dbcl_db_open(dbp, txnp, name, subdb, type, flags, mode)
 	DB * dbp;
 	DB_TXN * txnp;
-	const char * name;
-	const char * subdb;
+	const gchar * name;
+	const gchar * subdb;
 	DBTYPE type;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 {
 	CLIENT *cl;
 	__db_open_msg msg;
 	__db_open_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -1961,11 +1961,11 @@ __dbcl_db_open(dbp, txnp, name, subdb, type, flags, mode)
 	if (name == NULL)
 		msg.name = "";
 	else
-		msg.name = (char *)name;
+		msg.name = (gchar *)name;
 	if (subdb == NULL)
 		msg.subdb = "";
 	else
-		msg.subdb = (char *)subdb;
+		msg.subdb = (gchar *)subdb;
 	msg.type = type;
 	msg.flags = flags;
 	msg.mode = mode;
@@ -1979,14 +1979,14 @@ __dbcl_db_open(dbp, txnp, name, subdb, type, flags, mode)
 	ret = __dbcl_db_open_ret(dbp, txnp, name, subdb, type, flags, mode, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_open_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_open_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_pagesize __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_pagesize __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_pagesize(dbp, pagesize)
 	DB * dbp;
 	u_int32_t pagesize;
@@ -1994,7 +1994,7 @@ __dbcl_db_pagesize(dbp, pagesize)
 	CLIENT *cl;
 	__db_pagesize_msg msg;
 	__db_pagesize_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2019,14 +2019,14 @@ __dbcl_db_pagesize(dbp, pagesize)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_pagesize_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_pagesize_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_panic __P((DB *, void (*)(DB_ENV *, int)));
+ * PUBLIC: gint __dbcl_db_panic __P((DB *, void (*)(DB_ENV *, int)));
  */
-int
+gint
 __dbcl_db_panic(dbp, func0)
 	DB * dbp;
 	void (*func0) __P((DB_ENV *, int));
@@ -2039,10 +2039,10 @@ __dbcl_db_panic(dbp, func0)
 }
 
 /*
- * PUBLIC: int __dbcl_db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *,
+ * PUBLIC: gint __dbcl_db_pget __P((DB *, DB_TXN *, DBT *, DBT *, DBT *,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_db_pget(dbp, txnp, skey, pkey, data, flags)
 	DB * dbp;
 	DB_TXN * txnp;
@@ -2054,7 +2054,7 @@ __dbcl_db_pget(dbp, txnp, skey, pkey, data, flags)
 	CLIENT *cl;
 	__db_pget_msg msg;
 	__db_pget_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2101,14 +2101,14 @@ __dbcl_db_pget(dbp, txnp, skey, pkey, data, flags)
 	ret = __dbcl_db_pget_ret(dbp, txnp, skey, pkey, data, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_pget_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_pget_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __dbcl_db_put(dbp, txnp, key, data, flags)
 	DB * dbp;
 	DB_TXN * txnp;
@@ -2119,7 +2119,7 @@ __dbcl_db_put(dbp, txnp, key, data, flags)
 	CLIENT *cl;
 	__db_put_msg msg;
 	__db_put_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2160,22 +2160,22 @@ __dbcl_db_put(dbp, txnp, key, data, flags)
 	ret = __dbcl_db_put_ret(dbp, txnp, key, data, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_put_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_put_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_re_delim __P((DB *, int));
+ * PUBLIC: gint __dbcl_db_re_delim __P((DB *, int));
  */
-int
+gint
 __dbcl_db_re_delim(dbp, delim)
 	DB * dbp;
-	int delim;
+	gint delim;
 {
 	CLIENT *cl;
 	__db_re_delim_msg msg;
 	__db_re_delim_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2200,14 +2200,14 @@ __dbcl_db_re_delim(dbp, delim)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_re_delim_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_re_delim_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_re_len __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_re_len __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_re_len(dbp, len)
 	DB * dbp;
 	u_int32_t len;
@@ -2215,7 +2215,7 @@ __dbcl_db_re_len(dbp, len)
 	CLIENT *cl;
 	__db_re_len_msg msg;
 	__db_re_len_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2240,22 +2240,22 @@ __dbcl_db_re_len(dbp, len)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_re_len_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_re_len_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_re_pad __P((DB *, int));
+ * PUBLIC: gint __dbcl_db_re_pad __P((DB *, int));
  */
-int
+gint
 __dbcl_db_re_pad(dbp, pad)
 	DB * dbp;
-	int pad;
+	gint pad;
 {
 	CLIENT *cl;
 	__db_re_pad_msg msg;
 	__db_re_pad_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2280,17 +2280,17 @@ __dbcl_db_re_pad(dbp, pad)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_re_pad_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_re_pad_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_re_source __P((DB *, const char *));
+ * PUBLIC: gint __dbcl_db_re_source __P((DB *, const gchar *));
  */
-int
+gint
 __dbcl_db_re_source(dbp, re_source)
 	DB * dbp;
-	const char * re_source;
+	const gchar * re_source;
 {
 	DB_ENV *dbenv;
 
@@ -2300,20 +2300,20 @@ __dbcl_db_re_source(dbp, re_source)
 }
 
 /*
- * PUBLIC: int __dbcl_db_remove __P((DB *, const char *, const char *,
+ * PUBLIC: gint __dbcl_db_remove __P((DB *, const gchar *, const gchar *,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_db_remove(dbp, name, subdb, flags)
 	DB * dbp;
-	const char * name;
-	const char * subdb;
+	const gchar * name;
+	const gchar * subdb;
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__db_remove_msg msg;
 	__db_remove_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2330,11 +2330,11 @@ __dbcl_db_remove(dbp, name, subdb, flags)
 	if (name == NULL)
 		msg.name = "";
 	else
-		msg.name = (char *)name;
+		msg.name = (gchar *)name;
 	if (subdb == NULL)
 		msg.subdb = "";
 	else
-		msg.subdb = (char *)subdb;
+		msg.subdb = (gchar *)subdb;
 	msg.flags = flags;
 
 	replyp = __db_db_remove_4001(&msg, cl);
@@ -2346,26 +2346,26 @@ __dbcl_db_remove(dbp, name, subdb, flags)
 	ret = __dbcl_db_remove_ret(dbp, name, subdb, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_remove_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_remove_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_rename __P((DB *, const char *, const char *,
- * PUBLIC:      const char *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_rename __P((DB *, const gchar *, const gchar *,
+ * PUBLIC:      const gchar *, u_int32_t));
  */
-int
+gint
 __dbcl_db_rename(dbp, name, subdb, newname, flags)
 	DB * dbp;
-	const char * name;
-	const char * subdb;
-	const char * newname;
+	const gchar * name;
+	const gchar * subdb;
+	const gchar * newname;
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__db_rename_msg msg;
 	__db_rename_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2382,15 +2382,15 @@ __dbcl_db_rename(dbp, name, subdb, newname, flags)
 	if (name == NULL)
 		msg.name = "";
 	else
-		msg.name = (char *)name;
+		msg.name = (gchar *)name;
 	if (subdb == NULL)
 		msg.subdb = "";
 	else
-		msg.subdb = (char *)subdb;
+		msg.subdb = (gchar *)subdb;
 	if (newname == NULL)
 		msg.newname = "";
 	else
-		msg.newname = (char *)newname;
+		msg.newname = (gchar *)newname;
 	msg.flags = flags;
 
 	replyp = __db_db_rename_4001(&msg, cl);
@@ -2402,23 +2402,23 @@ __dbcl_db_rename(dbp, name, subdb, newname, flags)
 	ret = __dbcl_db_rename_ret(dbp, name, subdb, newname, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_rename_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_rename_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_stat __P((DB *, void *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_stat __P((DB *, gpointer , u_int32_t));
  */
-int
+gint
 __dbcl_db_stat(dbp, sp, flags)
 	DB * dbp;
-	void * sp;
+	gpointer  sp;
 	u_int32_t flags;
 {
 	CLIENT *cl;
 	__db_stat_msg msg;
 	__db_stat_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2443,14 +2443,14 @@ __dbcl_db_stat(dbp, sp, flags)
 	ret = __dbcl_db_stat_ret(dbp, sp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_stat_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_stat_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_sync __P((DB *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_sync __P((DB *, u_int32_t));
  */
-int
+gint
 __dbcl_db_sync(dbp, flags)
 	DB * dbp;
 	u_int32_t flags;
@@ -2458,7 +2458,7 @@ __dbcl_db_sync(dbp, flags)
 	CLIENT *cl;
 	__db_sync_msg msg;
 	__db_sync_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2483,15 +2483,15 @@ __dbcl_db_sync(dbp, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_sync_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_sync_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_truncate __P((DB *, DB_TXN *, u_int32_t  *,
+ * PUBLIC: gint __dbcl_db_truncate __P((DB *, DB_TXN *, u_int32_t  *,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_db_truncate(dbp, txnp, countp, flags)
 	DB * dbp;
 	DB_TXN * txnp;
@@ -2501,7 +2501,7 @@ __dbcl_db_truncate(dbp, txnp, countp, flags)
 	CLIENT *cl;
 	__db_truncate_msg msg;
 	__db_truncate_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2530,17 +2530,17 @@ __dbcl_db_truncate(dbp, txnp, countp, flags)
 	ret = __dbcl_db_truncate_ret(dbp, txnp, countp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_truncate_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_truncate_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_upgrade __P((DB *, const char *, u_int32_t));
+ * PUBLIC: gint __dbcl_db_upgrade __P((DB *, const gchar *, u_int32_t));
  */
-int
+gint
 __dbcl_db_upgrade(dbp, fname, flags)
 	DB * dbp;
-	const char * fname;
+	const gchar * fname;
 	u_int32_t flags;
 {
 	DB_ENV *dbenv;
@@ -2552,14 +2552,14 @@ __dbcl_db_upgrade(dbp, fname, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_db_verify __P((DB *, const char *, const char *, FILE *,
+ * PUBLIC: gint __dbcl_db_verify __P((DB *, const gchar *, const gchar *, FILE *,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_db_verify(dbp, fname, subdb, outfile, flags)
 	DB * dbp;
-	const char * fname;
-	const char * subdb;
+	const gchar * fname;
+	const gchar * subdb;
 	FILE * outfile;
 	u_int32_t flags;
 {
@@ -2574,9 +2574,9 @@ __dbcl_db_verify(dbp, fname, subdb, outfile, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
+ * PUBLIC: gint __dbcl_db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
  */
-int
+gint
 __dbcl_db_cursor(dbp, txnp, dbcpp, flags)
 	DB * dbp;
 	DB_TXN * txnp;
@@ -2586,7 +2586,7 @@ __dbcl_db_cursor(dbp, txnp, dbcpp, flags)
 	CLIENT *cl;
 	__db_cursor_msg msg;
 	__db_cursor_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2615,14 +2615,14 @@ __dbcl_db_cursor(dbp, txnp, dbcpp, flags)
 	ret = __dbcl_db_cursor_ret(dbp, txnp, dbcpp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_cursor_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_cursor_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_db_join __P((DB *, DBC **, DBC **, u_int32_t));
+ * PUBLIC: gint __dbcl_db_join __P((DB *, DBC **, DBC **, u_int32_t));
  */
-int
+gint
 __dbcl_db_join(dbp, curs, dbcp, flags)
 	DB * dbp;
 	DBC ** curs;
@@ -2632,10 +2632,10 @@ __dbcl_db_join(dbp, curs, dbcp, flags)
 	CLIENT *cl;
 	__db_join_msg msg;
 	__db_join_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 	DBC ** cursp;
-	int cursi;
+	gint cursi;
 	u_int32_t * cursq;
 
 	ret = 0;
@@ -2669,21 +2669,21 @@ __dbcl_db_join(dbp, curs, dbcp, flags)
 	ret = __dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___db_join_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___db_join_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_close __P((DBC *));
+ * PUBLIC: gint __dbcl_dbc_close __P((DBC *));
  */
-int
+gint
 __dbcl_dbc_close(dbc)
 	DBC * dbc;
 {
 	CLIENT *cl;
 	__dbc_close_msg msg;
 	__dbc_close_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2707,14 +2707,14 @@ __dbcl_dbc_close(dbc)
 	ret = __dbcl_dbc_close_ret(dbc, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___dbc_close_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___dbc_close_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_count __P((DBC *, db_recno_t *, u_int32_t));
+ * PUBLIC: gint __dbcl_dbc_count __P((DBC *, db_recno_t *, u_int32_t));
  */
-int
+gint
 __dbcl_dbc_count(dbc, countp, flags)
 	DBC * dbc;
 	db_recno_t * countp;
@@ -2723,7 +2723,7 @@ __dbcl_dbc_count(dbc, countp, flags)
 	CLIENT *cl;
 	__dbc_count_msg msg;
 	__dbc_count_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2748,14 +2748,14 @@ __dbcl_dbc_count(dbc, countp, flags)
 	ret = __dbcl_dbc_count_ret(dbc, countp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___dbc_count_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___dbc_count_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_del __P((DBC *, u_int32_t));
+ * PUBLIC: gint __dbcl_dbc_del __P((DBC *, u_int32_t));
  */
-int
+gint
 __dbcl_dbc_del(dbc, flags)
 	DBC * dbc;
 	u_int32_t flags;
@@ -2763,7 +2763,7 @@ __dbcl_dbc_del(dbc, flags)
 	CLIENT *cl;
 	__dbc_del_msg msg;
 	__dbc_del_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2788,14 +2788,14 @@ __dbcl_dbc_del(dbc, flags)
 	ret = replyp->status;
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___dbc_del_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___dbc_del_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_dup __P((DBC *, DBC **, u_int32_t));
+ * PUBLIC: gint __dbcl_dbc_dup __P((DBC *, DBC **, u_int32_t));
  */
-int
+gint
 __dbcl_dbc_dup(dbc, dbcp, flags)
 	DBC * dbc;
 	DBC ** dbcp;
@@ -2804,7 +2804,7 @@ __dbcl_dbc_dup(dbc, dbcp, flags)
 	CLIENT *cl;
 	__dbc_dup_msg msg;
 	__dbc_dup_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2829,14 +2829,14 @@ __dbcl_dbc_dup(dbc, dbcp, flags)
 	ret = __dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___dbc_dup_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___dbc_dup_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_get __P((DBC *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __dbcl_dbc_get __P((DBC *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __dbcl_dbc_get(dbc, key, data, flags)
 	DBC * dbc;
 	DBT * key;
@@ -2846,7 +2846,7 @@ __dbcl_dbc_get(dbc, key, data, flags)
 	CLIENT *cl;
 	__dbc_get_msg msg;
 	__dbc_get_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2883,14 +2883,14 @@ __dbcl_dbc_get(dbc, key, data, flags)
 	ret = __dbcl_dbc_get_ret(dbc, key, data, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___dbc_get_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___dbc_get_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __dbcl_dbc_pget __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __dbcl_dbc_pget(dbc, skey, pkey, data, flags)
 	DBC * dbc;
 	DBT * skey;
@@ -2901,7 +2901,7 @@ __dbcl_dbc_pget(dbc, skey, pkey, data, flags)
 	CLIENT *cl;
 	__dbc_pget_msg msg;
 	__dbc_pget_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2944,14 +2944,14 @@ __dbcl_dbc_pget(dbc, skey, pkey, data, flags)
 	ret = __dbcl_dbc_pget_ret(dbc, skey, pkey, data, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___dbc_pget_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___dbc_pget_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_put __P((DBC *, DBT *, DBT *, u_int32_t));
+ * PUBLIC: gint __dbcl_dbc_put __P((DBC *, DBT *, DBT *, u_int32_t));
  */
-int
+gint
 __dbcl_dbc_put(dbc, key, data, flags)
 	DBC * dbc;
 	DBT * key;
@@ -2961,7 +2961,7 @@ __dbcl_dbc_put(dbc, key, data, flags)
 	CLIENT *cl;
 	__dbc_put_msg msg;
 	__dbc_put_reply *replyp = NULL;
-	int ret;
+	gint ret;
 	DB_ENV *dbenv;
 
 	ret = 0;
@@ -2998,19 +2998,19 @@ __dbcl_dbc_put(dbc, key, data, flags)
 	ret = __dbcl_dbc_put_ret(dbc, key, data, flags, replyp);
 out:
 	if (replyp != NULL)
-		xdr_free((xdrproc_t)xdr___dbc_put_reply, (void *)replyp);
+		xdr_free((xdrproc_t)xdr___dbc_put_reply, (gpointer)replyp);
 	return (ret);
 }
 
 /*
- * PUBLIC: int __dbcl_lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, int *));
+ * PUBLIC: gint __dbcl_lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, gint *));
  */
-int
+gint
 __dbcl_lock_detect(dbenv, flags, atype, aborted)
 	DB_ENV * dbenv;
 	u_int32_t flags;
 	u_int32_t atype;
-	int * aborted;
+	gint * aborted;
 {
 	COMPQUIET(flags, 0);
 	COMPQUIET(atype, 0);
@@ -3019,10 +3019,10 @@ __dbcl_lock_detect(dbenv, flags, atype, aborted)
 }
 
 /*
- * PUBLIC: int __dbcl_lock_get __P((DB_ENV *, u_int32_t, u_int32_t,
+ * PUBLIC: gint __dbcl_lock_get __P((DB_ENV *, u_int32_t, u_int32_t,
  * PUBLIC:      const DBT *, db_lockmode_t, DB_LOCK *));
  */
-int
+gint
 __dbcl_lock_get(dbenv, locker, flags, obj, mode, lock)
 	DB_ENV * dbenv;
 	u_int32_t locker;
@@ -3040,9 +3040,9 @@ __dbcl_lock_get(dbenv, locker, flags, obj, mode, lock)
 }
 
 /*
- * PUBLIC: int __dbcl_lock_id __P((DB_ENV *, u_int32_t *));
+ * PUBLIC: gint __dbcl_lock_id __P((DB_ENV *, u_int32_t *));
  */
-int
+gint
 __dbcl_lock_id(dbenv, idp)
 	DB_ENV * dbenv;
 	u_int32_t * idp;
@@ -3052,9 +3052,9 @@ __dbcl_lock_id(dbenv, idp)
 }
 
 /*
- * PUBLIC: int __dbcl_lock_id_free __P((DB_ENV *, u_int32_t));
+ * PUBLIC: gint __dbcl_lock_id_free __P((DB_ENV *, u_int32_t));
  */
-int
+gint
 __dbcl_lock_id_free(dbenv, id)
 	DB_ENV * dbenv;
 	u_int32_t id;
@@ -3064,9 +3064,9 @@ __dbcl_lock_id_free(dbenv, id)
 }
 
 /*
- * PUBLIC: int __dbcl_lock_put __P((DB_ENV *, DB_LOCK *));
+ * PUBLIC: gint __dbcl_lock_put __P((DB_ENV *, DB_LOCK *));
  */
-int
+gint
 __dbcl_lock_put(dbenv, lock)
 	DB_ENV * dbenv;
 	DB_LOCK * lock;
@@ -3076,9 +3076,9 @@ __dbcl_lock_put(dbenv, lock)
 }
 
 /*
- * PUBLIC: int __dbcl_lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
+ * PUBLIC: gint __dbcl_lock_stat __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
  */
-int
+gint
 __dbcl_lock_stat(dbenv, statp, flags)
 	DB_ENV * dbenv;
 	DB_LOCK_STAT ** statp;
@@ -3090,16 +3090,16 @@ __dbcl_lock_stat(dbenv, statp, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_lock_vec __P((DB_ENV *, u_int32_t, u_int32_t,
+ * PUBLIC: gint __dbcl_lock_vec __P((DB_ENV *, u_int32_t, u_int32_t,
  * PUBLIC:      DB_LOCKREQ *, int, DB_LOCKREQ **));
  */
-int
+gint
 __dbcl_lock_vec(dbenv, locker, flags, list, nlist, elistp)
 	DB_ENV * dbenv;
 	u_int32_t locker;
 	u_int32_t flags;
 	DB_LOCKREQ * list;
-	int nlist;
+	gint nlist;
 	DB_LOCKREQ ** elistp;
 {
 	COMPQUIET(locker, 0);
@@ -3111,12 +3111,12 @@ __dbcl_lock_vec(dbenv, locker, flags, list, nlist, elistp)
 }
 
 /*
- * PUBLIC: int __dbcl_log_archive __P((DB_ENV *, char ***, u_int32_t));
+ * PUBLIC: gint __dbcl_log_archive __P((DB_ENV *, gchar ***, u_int32_t));
  */
-int
+gint
 __dbcl_log_archive(dbenv, listp, flags)
 	DB_ENV * dbenv;
-	char *** listp;
+	gchar *** listp;
 	u_int32_t flags;
 {
 	COMPQUIET(listp, 0);
@@ -3125,9 +3125,9 @@ __dbcl_log_archive(dbenv, listp, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
+ * PUBLIC: gint __dbcl_log_cursor __P((DB_ENV *, DB_LOGC **, u_int32_t));
  */
-int
+gint
 __dbcl_log_cursor(dbenv, logcp, flags)
 	DB_ENV * dbenv;
 	DB_LOGC ** logcp;
@@ -3139,13 +3139,13 @@ __dbcl_log_cursor(dbenv, logcp, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_log_file __P((DB_ENV *, const DB_LSN *, char *, size_t));
+ * PUBLIC: gint __dbcl_log_file __P((DB_ENV *, const DB_LSN *, gchar *, size_t));
  */
-int
+gint
 __dbcl_log_file(dbenv, lsn, namep, len)
 	DB_ENV * dbenv;
 	const DB_LSN * lsn;
-	char * namep;
+	gchar * namep;
 	size_t len;
 {
 	COMPQUIET(lsn, NULL);
@@ -3155,9 +3155,9 @@ __dbcl_log_file(dbenv, lsn, namep, len)
 }
 
 /*
- * PUBLIC: int __dbcl_log_flush __P((DB_ENV *, const DB_LSN *));
+ * PUBLIC: gint __dbcl_log_flush __P((DB_ENV *, const DB_LSN *));
  */
-int
+gint
 __dbcl_log_flush(dbenv, lsn)
 	DB_ENV * dbenv;
 	const DB_LSN * lsn;
@@ -3167,10 +3167,10 @@ __dbcl_log_flush(dbenv, lsn)
 }
 
 /*
- * PUBLIC: int __dbcl_log_put __P((DB_ENV *, DB_LSN *, const DBT *,
+ * PUBLIC: gint __dbcl_log_put __P((DB_ENV *, DB_LSN *, const DBT *,
  * PUBLIC:      u_int32_t));
  */
-int
+gint
 __dbcl_log_put(dbenv, lsn, data, flags)
 	DB_ENV * dbenv;
 	DB_LSN * lsn;
@@ -3184,9 +3184,9 @@ __dbcl_log_put(dbenv, lsn, data, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
+ * PUBLIC: gint __dbcl_log_stat __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
  */
-int
+gint
 __dbcl_log_stat(dbenv, statp, flags)
 	DB_ENV * dbenv;
 	DB_LOG_STAT ** statp;
@@ -3198,9 +3198,9 @@ __dbcl_log_stat(dbenv, statp, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
+ * PUBLIC: gint __dbcl_memp_fcreate __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
  */
-int
+gint
 __dbcl_memp_fcreate(dbenv, mpf, flags)
 	DB_ENV * dbenv;
 	DB_MPOOLFILE ** mpf;
@@ -3212,15 +3212,15 @@ __dbcl_memp_fcreate(dbenv, mpf, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_memp_register __P((DB_ENV *, int, int (*)(DB_ENV *,
- * PUBLIC:      db_pgno_t, void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *)));
+ * PUBLIC: gint __dbcl_memp_register __P((DB_ENV *, int, gint (*)(DB_ENV *,
+ * PUBLIC:      db_pgno_t, gpointer , DBT *), gint (*)(DB_ENV *, db_pgno_t, gpointer , DBT *)));
  */
-int
+gint
 __dbcl_memp_register(dbenv, ftype, func0, func1)
 	DB_ENV * dbenv;
-	int ftype;
-	int (*func0) __P((DB_ENV *, db_pgno_t, void *, DBT *));
-	int (*func1) __P((DB_ENV *, db_pgno_t, void *, DBT *));
+	gint ftype;
+	gint (*func0) __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
+	gint (*func1) __P((DB_ENV *, db_pgno_t, gpointer , DBT *));
 {
 	COMPQUIET(ftype, 0);
 	COMPQUIET(func0, 0);
@@ -3229,10 +3229,10 @@ __dbcl_memp_register(dbenv, ftype, func0, func1)
 }
 
 /*
- * PUBLIC: int __dbcl_memp_stat __P((DB_ENV *, DB_MPOOL_STAT **,
+ * PUBLIC: gint __dbcl_memp_stat __P((DB_ENV *, DB_MPOOL_STAT **,
  * PUBLIC:      DB_MPOOL_FSTAT ***, u_int32_t));
  */
-int
+gint
 __dbcl_memp_stat(dbenv, gstatp, fstatp, flags)
 	DB_ENV * dbenv;
 	DB_MPOOL_STAT ** gstatp;
@@ -3246,9 +3246,9 @@ __dbcl_memp_stat(dbenv, gstatp, fstatp, flags)
 }
 
 /*
- * PUBLIC: int __dbcl_memp_sync __P((DB_ENV *, DB_LSN *));
+ * PUBLIC: gint __dbcl_memp_sync __P((DB_ENV *, DB_LSN *));
  */
-int
+gint
 __dbcl_memp_sync(dbenv, lsn)
 	DB_ENV * dbenv;
 	DB_LSN * lsn;
@@ -3258,13 +3258,13 @@ __dbcl_memp_sync(dbenv, lsn)
 }
 
 /*
- * PUBLIC: int __dbcl_memp_trickle __P((DB_ENV *, int, int *));
+ * PUBLIC: gint __dbcl_memp_trickle __P((DB_ENV *, int, gint *));
  */
-int
+gint
 __dbcl_memp_trickle(dbenv, pct, nwrotep)
 	DB_ENV * dbenv;
-	int pct;
-	int * nwrotep;
+	gint pct;
+	gint * nwrotep;
 {
 	COMPQUIET(pct, 0);
 	COMPQUIET(nwrotep, 0);
diff --git a/libdb/rpc_client/gen_client_ret.c b/libdb/rpc_client/gen_client_ret.c
index 70aae86..450bfbe 100644
--- a/libdb/rpc_client/gen_client_ret.c
+++ b/libdb/rpc_client/gen_client_ret.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifdef HAVE_RPC
@@ -29,16 +29,16 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_client_ext.h"
 
 /*
- * PUBLIC: int __dbcl_env_close_ret
+ * PUBLIC: gint __dbcl_env_close_ret
  * PUBLIC:     __P((DB_ENV *, u_int32_t, __env_close_reply *));
  */
-int
+gint
 __dbcl_env_close_ret(dbenv, flags, replyp)
 	DB_ENV *dbenv;
 	u_int32_t flags;
 	__env_close_reply *replyp;
 {
-	int ret;
+	gint ret;
 
 	COMPQUIET(flags, 0);
 
@@ -51,10 +51,10 @@ __dbcl_env_close_ret(dbenv, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_env_create_ret
+ * PUBLIC: gint __dbcl_env_create_ret
  * PUBLIC:     __P((DB_ENV *, long, __env_create_reply *));
  */
-int
+gint
 __dbcl_env_create_ret(dbenv, timeout, replyp)
 	DB_ENV * dbenv;
 	long timeout;
@@ -70,19 +70,19 @@ __dbcl_env_create_ret(dbenv, timeout, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_env_open_ret __P((DB_ENV *,
- * PUBLIC:     const char *, u_int32_t, int, __env_open_reply *));
+ * PUBLIC: gint __dbcl_env_open_ret __P((DB_ENV *,
+ * PUBLIC:     const gchar *, u_int32_t, int, __env_open_reply *));
  */
-int
+gint
 __dbcl_env_open_ret(dbenv, home, flags, mode, replyp)
 	DB_ENV *dbenv;
-	const char *home;
+	const gchar *home;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 	__env_open_reply *replyp;
 {
 	DB_TXNMGR *tmgrp;
-	int ret;
+	gint ret;
 
 	COMPQUIET(home, NULL);
 	COMPQUIET(mode, 0);
@@ -111,17 +111,17 @@ __dbcl_env_open_ret(dbenv, home, flags, mode, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_env_remove_ret
- * PUBLIC:     __P((DB_ENV *, const char *, u_int32_t, __env_remove_reply *));
+ * PUBLIC: gint __dbcl_env_remove_ret
+ * PUBLIC:     __P((DB_ENV *, const gchar *, u_int32_t, __env_remove_reply *));
  */
-int
+gint
 __dbcl_env_remove_ret(dbenv, home, flags, replyp)
 	DB_ENV *dbenv;
-	const char *home;
+	const gchar *home;
 	u_int32_t flags;
 	__env_remove_reply *replyp;
 {
-	int ret;
+	gint ret;
 
 	COMPQUIET(home, NULL);
 	COMPQUIET(flags, 0);
@@ -135,9 +135,9 @@ __dbcl_env_remove_ret(dbenv, home, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_abort_ret __P((DB_TXN *, __txn_abort_reply *));
+ * PUBLIC: gint __dbcl_txn_abort_ret __P((DB_TXN *, __txn_abort_reply *));
  */
-int
+gint
 __dbcl_txn_abort_ret(txnp, replyp)
 	DB_TXN *txnp;
 	__txn_abort_reply *replyp;
@@ -147,10 +147,10 @@ __dbcl_txn_abort_ret(txnp, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_begin_ret __P((DB_ENV *,
+ * PUBLIC: gint __dbcl_txn_begin_ret __P((DB_ENV *,
  * PUBLIC:     DB_TXN *, DB_TXN **, u_int32_t, __txn_begin_reply *));
  */
-int
+gint
 __dbcl_txn_begin_ret(envp, parent, txnpp, flags, replyp)
 	DB_ENV *envp;
 	DB_TXN *parent, **txnpp;
@@ -158,7 +158,7 @@ __dbcl_txn_begin_ret(envp, parent, txnpp, flags, replyp)
 	__txn_begin_reply *replyp;
 {
 	DB_TXN *txn;
-	int ret;
+	gint ret;
 
 	COMPQUIET(flags, 0);
 
@@ -173,10 +173,10 @@ __dbcl_txn_begin_ret(envp, parent, txnpp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_commit_ret
+ * PUBLIC: gint __dbcl_txn_commit_ret
  * PUBLIC:     __P((DB_TXN *, u_int32_t, __txn_commit_reply *));
  */
-int
+gint
 __dbcl_txn_commit_ret(txnp, flags, replyp)
 	DB_TXN *txnp;
 	u_int32_t flags;
@@ -189,10 +189,10 @@ __dbcl_txn_commit_ret(txnp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_discard_ret __P((DB_TXN *, u_int32_t,
+ * PUBLIC: gint __dbcl_txn_discard_ret __P((DB_TXN *, u_int32_t,
  * PUBLIC:      __txn_discard_reply *));
  */
-int
+gint
 __dbcl_txn_discard_ret(txnp, flags, replyp)
 	DB_TXN * txnp;
 	u_int32_t flags;
@@ -205,10 +205,10 @@ __dbcl_txn_discard_ret(txnp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_txn_recover_ret __P((DB_ENV *, DB_PREPLIST *, long,
+ * PUBLIC: gint __dbcl_txn_recover_ret __P((DB_ENV *, DB_PREPLIST *, long,
  * PUBLIC:      long *, u_int32_t, __txn_recover_reply *));
  */
-int
+gint
 __dbcl_txn_recover_ret(dbenv, preplist, count, retp, flags, replyp)
 	DB_ENV * dbenv;
 	DB_PREPLIST * preplist;
@@ -220,7 +220,7 @@ __dbcl_txn_recover_ret(dbenv, preplist, count, retp, flags, replyp)
 	DB_PREPLIST *prep;
 	DB_TXN *txnarray, *txn;
 	u_int32_t i, *txnid;
-	int ret;
+	gint ret;
 	u_int8_t *gid;
 
 	COMPQUIET(flags, 0);
@@ -263,15 +263,15 @@ __dbcl_txn_recover_ret(dbenv, preplist, count, retp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_close_ret __P((DB *, u_int32_t, __db_close_reply *));
+ * PUBLIC: gint __dbcl_db_close_ret __P((DB *, u_int32_t, __db_close_reply *));
  */
-int
+gint
 __dbcl_db_close_ret(dbp, flags, replyp)
 	DB *dbp;
 	u_int32_t flags;
 	__db_close_reply *replyp;
 {
-	int ret;
+	gint ret;
 
 	COMPQUIET(flags, 0);
 
@@ -284,10 +284,10 @@ __dbcl_db_close_ret(dbp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_create_ret
+ * PUBLIC: gint __dbcl_db_create_ret
  * PUBLIC:     __P((DB *, DB_ENV *, u_int32_t, __db_create_reply *));
  */
-int
+gint
 __dbcl_db_create_ret(dbp, dbenv, flags, replyp)
 	DB * dbp;
 	DB_ENV * dbenv;
@@ -304,10 +304,10 @@ __dbcl_db_create_ret(dbp, dbenv, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_get_ret
+ * PUBLIC: gint __dbcl_db_get_ret
  * PUBLIC:     __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t, __db_get_reply *));
  */
-int
+gint
 __dbcl_db_get_ret(dbp, txnp, key, data, flags, replyp)
 	DB *dbp;
 	DB_TXN *txnp;
@@ -316,8 +316,8 @@ __dbcl_db_get_ret(dbp, txnp, key, data, flags, replyp)
 	__db_get_reply *replyp;
 {
 	DB_ENV *dbenv;
-	int ret;
-	void *oldkey;
+	gint ret;
+	gpointer oldkey;
 
 	COMPQUIET(txnp, NULL);
 	COMPQUIET(flags, 0);
@@ -347,10 +347,10 @@ __dbcl_db_get_ret(dbp, txnp, key, data, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_key_range_ret __P((DB *, DB_TXN *,
+ * PUBLIC: gint __dbcl_db_key_range_ret __P((DB *, DB_TXN *,
  * PUBLIC:     DBT *, DB_KEY_RANGE *, u_int32_t, __db_key_range_reply *));
  */
-int
+gint
 __dbcl_db_key_range_ret(dbp, txnp, key, range, flags, replyp)
 	DB *dbp;
 	DB_TXN *txnp;
@@ -373,17 +373,17 @@ __dbcl_db_key_range_ret(dbp, txnp, key, range, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_open_ret __P((DB *, DB_TXN *, const char *,
- * PUBLIC:     const char *, DBTYPE, u_int32_t, int, __db_open_reply *));
+ * PUBLIC: gint __dbcl_db_open_ret __P((DB *, DB_TXN *, const gchar *,
+ * PUBLIC:     const gchar *, DBTYPE, u_int32_t, int, __db_open_reply *));
  */
-int
+gint
 __dbcl_db_open_ret(dbp, txn, name, subdb, type, flags, mode, replyp)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	DBTYPE type;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 	__db_open_reply *replyp;
 {
 	COMPQUIET(txn, NULL);
@@ -419,10 +419,10 @@ __dbcl_db_open_ret(dbp, txn, name, subdb, type, flags, mode, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_pget_ret __P((DB *, DB_TXN *, DBT *, DBT *, DBT *,
+ * PUBLIC: gint __dbcl_db_pget_ret __P((DB *, DB_TXN *, DBT *, DBT *, DBT *,
  * PUBLIC:      u_int32_t, __db_pget_reply *));
  */
-int
+gint
 __dbcl_db_pget_ret(dbp, txnp, skey, pkey, data, flags, replyp)
 	DB * dbp;
 	DB_TXN * txnp;
@@ -433,8 +433,8 @@ __dbcl_db_pget_ret(dbp, txnp, skey, pkey, data, flags, replyp)
 	__db_pget_reply *replyp;
 {
 	DB_ENV *dbenv;
-	int ret;
-	void *oldskey, *oldpkey;
+	gint ret;
+	gpointer oldskey, *oldpkey;
 
 	COMPQUIET(txnp, NULL);
 	COMPQUIET(flags, 0);
@@ -477,10 +477,10 @@ __dbcl_db_pget_ret(dbp, txnp, skey, pkey, data, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_put_ret
+ * PUBLIC: gint __dbcl_db_put_ret
  * PUBLIC:     __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t, __db_put_reply *));
  */
-int
+gint
 __dbcl_db_put_ret(dbp, txnp, key, data, flags, replyp)
 	DB *dbp;
 	DB_TXN *txnp;
@@ -488,7 +488,7 @@ __dbcl_db_put_ret(dbp, txnp, key, data, flags, replyp)
 	u_int32_t flags;
 	__db_put_reply *replyp;
 {
-	int ret;
+	gint ret;
 
 	COMPQUIET(dbp, NULL);
 	COMPQUIET(txnp, NULL);
@@ -502,17 +502,17 @@ __dbcl_db_put_ret(dbp, txnp, key, data, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_remove_ret __P((DB *,
- * PUBLIC:     const char *, const char *, u_int32_t, __db_remove_reply *));
+ * PUBLIC: gint __dbcl_db_remove_ret __P((DB *,
+ * PUBLIC:     const gchar *, const gchar *, u_int32_t, __db_remove_reply *));
  */
-int
+gint
 __dbcl_db_remove_ret(dbp, name, subdb, flags, replyp)
 	DB *dbp;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	u_int32_t flags;
 	__db_remove_reply *replyp;
 {
-	int ret;
+	gint ret;
 
 	COMPQUIET(name, 0);
 	COMPQUIET(subdb, 0);
@@ -527,17 +527,17 @@ __dbcl_db_remove_ret(dbp, name, subdb, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_rename_ret __P((DB *, const char *,
- * PUBLIC:     const char *, const char *, u_int32_t, __db_rename_reply *));
+ * PUBLIC: gint __dbcl_db_rename_ret __P((DB *, const gchar *,
+ * PUBLIC:     const gchar *, const gchar *, u_int32_t, __db_rename_reply *));
  */
-int
+gint
 __dbcl_db_rename_ret(dbp, name, subdb, newname, flags, replyp)
 	DB *dbp;
-	const char *name, *subdb, *newname;
+	const gchar *name, *subdb, *newname;
 	u_int32_t flags;
 	__db_rename_reply *replyp;
 {
-	int ret;
+	gint ret;
 
 	COMPQUIET(name, 0);
 	COMPQUIET(subdb, 0);
@@ -553,17 +553,17 @@ __dbcl_db_rename_ret(dbp, name, subdb, newname, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_stat_ret
- * PUBLIC:     __P((DB *, void *, u_int32_t, __db_stat_reply *));
+ * PUBLIC: gint __dbcl_db_stat_ret
+ * PUBLIC:     __P((DB *, gpointer , u_int32_t, __db_stat_reply *));
  */
-int
+gint
 __dbcl_db_stat_ret(dbp, sp, flags, replyp)
 	DB *dbp;
-	void *sp;
+	gpointer sp;
 	u_int32_t flags;
 	__db_stat_reply *replyp;
 {
-	int len, ret;
+	gint len, ret;
 	u_int32_t i, *q, *p, *retsp;
 
 	COMPQUIET(flags, 0);
@@ -582,10 +582,10 @@ __dbcl_db_stat_ret(dbp, sp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_truncate_ret __P((DB *, DB_TXN *, u_int32_t  *,
+ * PUBLIC: gint __dbcl_db_truncate_ret __P((DB *, DB_TXN *, u_int32_t  *,
  * PUBLIC:      u_int32_t, __db_truncate_reply *));
  */
-int
+gint
 __dbcl_db_truncate_ret(dbp, txnp, countp, flags, replyp)
 	DB *dbp;
 	DB_TXN *txnp;
@@ -604,10 +604,10 @@ __dbcl_db_truncate_ret(dbp, txnp, countp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_cursor_ret
+ * PUBLIC: gint __dbcl_db_cursor_ret
  * PUBLIC:     __P((DB *, DB_TXN *, DBC **, u_int32_t, __db_cursor_reply *));
  */
-int
+gint
 __dbcl_db_cursor_ret(dbp, txnp, dbcp, flags, replyp)
 	DB *dbp;
 	DB_TXN *txnp;
@@ -625,10 +625,10 @@ __dbcl_db_cursor_ret(dbp, txnp, dbcp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_db_join_ret
+ * PUBLIC: gint __dbcl_db_join_ret
  * PUBLIC:     __P((DB *, DBC **, DBC **, u_int32_t, __db_join_reply *));
  */
-int
+gint
 __dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp)
 	DB *dbp;
 	DBC **curs, **dbcp;
@@ -652,9 +652,9 @@ __dbcl_db_join_ret(dbp, curs, dbcp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_close_ret __P((DBC *, __dbc_close_reply *));
+ * PUBLIC: gint __dbcl_dbc_close_ret __P((DBC *, __dbc_close_reply *));
  */
-int
+gint
 __dbcl_dbc_close_ret(dbc, replyp)
 	DBC *dbc;
 	__dbc_close_reply *replyp;
@@ -664,10 +664,10 @@ __dbcl_dbc_close_ret(dbc, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_count_ret
+ * PUBLIC: gint __dbcl_dbc_count_ret
  * PUBLIC:     __P((DBC *, db_recno_t *, u_int32_t, __dbc_count_reply *));
  */
-int
+gint
 __dbcl_dbc_count_ret(dbc, countp, flags, replyp)
 	DBC *dbc;
 	db_recno_t *countp;
@@ -685,10 +685,10 @@ __dbcl_dbc_count_ret(dbc, countp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_dup_ret
+ * PUBLIC: gint __dbcl_dbc_dup_ret
  * PUBLIC:     __P((DBC *, DBC **, u_int32_t, __dbc_dup_reply *));
  */
-int
+gint
 __dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp)
 	DBC *dbc, **dbcp;
 	u_int32_t flags;
@@ -703,10 +703,10 @@ __dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_get_ret
+ * PUBLIC: gint __dbcl_dbc_get_ret
  * PUBLIC:     __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_get_reply *));
  */
-int
+gint
 __dbcl_dbc_get_ret(dbc, key, data, flags, replyp)
 	DBC *dbc;
 	DBT *key, *data;
@@ -714,8 +714,8 @@ __dbcl_dbc_get_ret(dbc, key, data, flags, replyp)
 	__dbc_get_reply *replyp;
 {
 	DB_ENV *dbenv;
-	int ret;
-	void *oldkey;
+	gint ret;
+	gpointer oldkey;
 
 	COMPQUIET(flags, 0);
 
@@ -744,10 +744,10 @@ __dbcl_dbc_get_ret(dbc, key, data, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_pget_ret __P((DBC *, DBT *, DBT *, DBT *, u_int32_t,
+ * PUBLIC: gint __dbcl_dbc_pget_ret __P((DBC *, DBT *, DBT *, DBT *, u_int32_t,
  * PUBLIC:      __dbc_pget_reply *));
  */
-int
+gint
 __dbcl_dbc_pget_ret(dbc, skey, pkey, data, flags, replyp)
 	DBC * dbc;
 	DBT * skey;
@@ -757,8 +757,8 @@ __dbcl_dbc_pget_ret(dbc, skey, pkey, data, flags, replyp)
 	__dbc_pget_reply *replyp;
 {
 	DB_ENV *dbenv;
-	int ret;
-	void *oldskey, *oldpkey;
+	gint ret;
+	gpointer oldskey, *oldpkey;
 
 	COMPQUIET(flags, 0);
 
@@ -800,10 +800,10 @@ __dbcl_dbc_pget_ret(dbc, skey, pkey, data, flags, replyp)
 }
 
 /*
- * PUBLIC: int __dbcl_dbc_put_ret
+ * PUBLIC: gint __dbcl_dbc_put_ret
  * PUBLIC:     __P((DBC *, DBT *, DBT *, u_int32_t, __dbc_put_reply *));
  */
-int
+gint
 __dbcl_dbc_put_ret(dbc, key, data, flags, replyp)
 	DBC *dbc;
 	DBT *key, *data;
diff --git a/libdb/rpc_server/c/db_server_proc.c b/libdb/rpc_server/c/db_server_proc.c
index 6056749..980a40c 100644
--- a/libdb/rpc_server/c/db_server_proc.c
+++ b/libdb/rpc_server/c/db_server_proc.c
@@ -9,7 +9,7 @@
 
 #ifdef HAVE_RPC
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -42,7 +42,7 @@ __env_cachesize_proc(dbenvcl_id, gbytes, bytes,
 {
 	DB_ENV *dbenv;
 	ct_entry *dbenv_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
 	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
@@ -83,7 +83,7 @@ __env_create_proc(timeout, replyp)
 {
 	DB_ENV *dbenv;
 	ct_entry *ctp;
-	int ret;
+	gint ret;
 
 	ctp = new_ct_ent(&replyp->status);
 	if (ctp == NULL)
@@ -105,7 +105,7 @@ __env_create_proc(timeout, replyp)
 
 /* BEGIN __env_dbremove_proc */
 /*
- * PUBLIC: void __env_dbremove_proc __P((long, long, char *, char *, u_int32_t,
+ * PUBLIC: void __env_dbremove_proc __P((long, long, gchar *, gchar *, u_int32_t,
  * PUBLIC:      __env_dbremove_reply *));
  */
 void
@@ -113,13 +113,13 @@ __env_dbremove_proc(dbenvcl_id, txnpcl_id, name,
 		subdb, flags, replyp)
 	long dbenvcl_id;
 	long txnpcl_id;
-	char *name;
-	char *subdb;
+	gchar *name;
+	gchar *subdb;
 	u_int32_t flags;
 	__env_dbremove_reply *replyp;
 /* END __env_dbremove_proc */
 {
-	int ret;
+	gint ret;
 	DB_ENV * dbenv;
 	ct_entry *dbenv_ctp;
 	DB_TXN * txnp;
@@ -142,7 +142,7 @@ __env_dbremove_proc(dbenvcl_id, txnpcl_id, name,
 
 /* BEGIN __env_dbrename_proc */
 /*
- * PUBLIC: void __env_dbrename_proc __P((long, long, char *, char *, char *,
+ * PUBLIC: void __env_dbrename_proc __P((long, long, gchar *, gchar *, gchar *,
  * PUBLIC:      u_int32_t, __env_dbrename_reply *));
  */
 void
@@ -150,14 +150,14 @@ __env_dbrename_proc(dbenvcl_id, txnpcl_id, name,
 		subdb, newname, flags, replyp)
 	long dbenvcl_id;
 	long txnpcl_id;
-	char *name;
-	char *subdb;
-	char *newname;
+	gchar *name;
+	gchar *subdb;
+	gchar *newname;
 	u_int32_t flags;
 	__env_dbrename_reply *replyp;
 /* END __env_dbrename_proc */
 {
-	int ret;
+	gint ret;
 	DB_ENV * dbenv;
 	ct_entry *dbenv_ctp;
 	DB_TXN * txnp;
@@ -180,18 +180,18 @@ __env_dbrename_proc(dbenvcl_id, txnpcl_id, name,
 
 /* BEGIN __env_encrypt_proc */
 /*
- * PUBLIC: void __env_encrypt_proc __P((long, char *, u_int32_t,
+ * PUBLIC: void __env_encrypt_proc __P((long, gchar *, u_int32_t,
  * PUBLIC:      __env_encrypt_reply *));
  */
 void
 __env_encrypt_proc(dbenvcl_id, passwd, flags, replyp)
 	long dbenvcl_id;
-	char *passwd;
+	gchar *passwd;
 	u_int32_t flags;
 	__env_encrypt_reply *replyp;
 /* END __env_encrypt_proc */
 {
-	int ret;
+	gint ret;
 	DB_ENV * dbenv;
 	ct_entry *dbenv_ctp;
 
@@ -219,7 +219,7 @@ __env_flags_proc(dbenvcl_id, flags, onoff, replyp)
 {
 	DB_ENV *dbenv;
 	ct_entry *dbenv_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
 	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
@@ -235,14 +235,14 @@ __env_flags_proc(dbenvcl_id, flags, onoff, replyp)
 }
 /* BEGIN __env_open_proc */
 /*
- * PUBLIC: void __env_open_proc __P((long, char *, u_int32_t, u_int32_t,
+ * PUBLIC: void __env_open_proc __P((long, gchar *, u_int32_t, u_int32_t,
  * PUBLIC:      __env_open_reply *));
  */
 void
 __env_open_proc(dbenvcl_id, home, flags,
 		mode, replyp)
 	long dbenvcl_id;
-	char *home;
+	gchar *home;
 	u_int32_t flags;
 	u_int32_t mode;
 	__env_open_reply *replyp;
@@ -251,7 +251,7 @@ __env_open_proc(dbenvcl_id, home, flags,
 	DB_ENV *dbenv;
 	ct_entry *dbenv_ctp, *new_ctp;
 	u_int32_t newflags, shareflags;
-	int ret;
+	gint ret;
 	home_entry *fullhome;
 
 	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
@@ -304,20 +304,20 @@ out:	replyp->status = ret;
 
 /* BEGIN __env_remove_proc */
 /*
- * PUBLIC: void __env_remove_proc __P((long, char *, u_int32_t,
+ * PUBLIC: void __env_remove_proc __P((long, gchar *, u_int32_t,
  * PUBLIC:      __env_remove_reply *));
  */
 void
 __env_remove_proc(dbenvcl_id, home, flags, replyp)
 	long dbenvcl_id;
-	char *home;
+	gchar *home;
 	u_int32_t flags;
 	__env_remove_reply *replyp;
 /* END __env_remove_proc */
 {
 	DB_ENV *dbenv;
 	ct_entry *dbenv_ctp;
-	int ret;
+	gint ret;
 	home_entry *fullhome;
 
 	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
@@ -347,7 +347,7 @@ __txn_abort_proc(txnpcl_id, replyp)
 {
 	DB_TXN *txnp;
 	ct_entry *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
 	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
@@ -375,7 +375,7 @@ __txn_begin_proc(dbenvcl_id, parentcl_id,
 	DB_ENV *dbenv;
 	DB_TXN *parent, *txnp;
 	ct_entry *ctp, *dbenv_ctp, *parent_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
 	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
@@ -422,7 +422,7 @@ __txn_commit_proc(txnpcl_id, flags, replyp)
 {
 	DB_TXN *txnp;
 	ct_entry *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
 	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
@@ -448,7 +448,7 @@ __txn_discard_proc(txnpcl_id, flags, replyp)
 {
 	DB_TXN *txnp;
 	ct_entry *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
 	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
@@ -474,7 +474,7 @@ __txn_prepare_proc(txnpcl_id, gid, replyp)
 {
 	DB_TXN *txnp;
 	ct_entry *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
 	txnp = (DB_TXN *)txnp_ctp->ct_anyp;
@@ -487,7 +487,7 @@ __txn_prepare_proc(txnpcl_id, gid, replyp)
 /* BEGIN __txn_recover_proc */
 /*
  * PUBLIC: void __txn_recover_proc __P((long, u_int32_t, u_int32_t,
- * PUBLIC:      __txn_recover_reply *, int *));
+ * PUBLIC:      __txn_recover_reply *, gint *));
  */
 void
 __txn_recover_proc(dbenvcl_id, count,
@@ -496,7 +496,7 @@ __txn_recover_proc(dbenvcl_id, count,
 	u_int32_t count;
 	u_int32_t flags;
 	__txn_recover_reply *replyp;
-	int * freep;
+	gint * freep;
 /* END __txn_recover_proc */
 {
 	DB_ENV *dbenv;
@@ -504,7 +504,7 @@ __txn_recover_proc(dbenvcl_id, count,
 	ct_entry *dbenv_ctp, *ctp;
 	long erri, i, retcount;
 	u_int32_t *txnidp;
-	int ret;
+	gint ret;
 	u_int8_t *gid;
 
 	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
@@ -614,7 +614,7 @@ __db_bt_maxkey_proc(dbpcl_id, maxkey, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -643,7 +643,7 @@ __db_associate_proc(dbpcl_id, txnpcl_id, sdbpcl_id,
 	DB *dbp, *sdbp;
 	DB_TXN *txnp;
 	ct_entry *dbp_ctp, *sdbp_ctp, *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -684,7 +684,7 @@ __db_bt_minkey_proc(dbpcl_id, minkey, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -727,7 +727,7 @@ __db_create_proc(dbenvcl_id, flags, replyp)
 	DB *dbp;
 	DB_ENV *dbenv;
 	ct_entry *dbenv_ctp, *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
 	dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
@@ -755,7 +755,7 @@ __db_create_proc(dbenvcl_id, flags, replyp)
 /* BEGIN __db_del_proc */
 /*
  * PUBLIC: void __db_del_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, void *, u_int32_t, u_int32_t, __db_del_reply *));
+ * PUBLIC:      u_int32_t, gpointer , u_int32_t, u_int32_t, __db_del_reply *));
  */
 void
 __db_del_proc(dbpcl_id, txnpcl_id, keydlen,
@@ -767,7 +767,7 @@ __db_del_proc(dbpcl_id, txnpcl_id, keydlen,
 	u_int32_t keydoff;
 	u_int32_t keyulen;
 	u_int32_t keyflags;
-	void *keydata;
+	gpointer keydata;
 	u_int32_t keysize;
 	u_int32_t flags;
 	__db_del_reply *replyp;
@@ -777,7 +777,7 @@ __db_del_proc(dbpcl_id, txnpcl_id, keydlen,
 	DBT key;
 	DB_TXN *txnp;
 	ct_entry *dbp_ctp, *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -805,18 +805,18 @@ __db_del_proc(dbpcl_id, txnpcl_id, keydlen,
 
 /* BEGIN __db_encrypt_proc */
 /*
- * PUBLIC: void __db_encrypt_proc __P((long, char *, u_int32_t,
+ * PUBLIC: void __db_encrypt_proc __P((long, gchar *, u_int32_t,
  * PUBLIC:      __db_encrypt_reply *));
  */
 void
 __db_encrypt_proc(dbpcl_id, passwd, flags, replyp)
 	long dbpcl_id;
-	char *passwd;
+	gchar *passwd;
 	u_int32_t flags;
 	__db_encrypt_reply *replyp;
 /* END __db_encrypt_proc */
 {
-	int ret;
+	gint ret;
 	DB * dbp;
 	ct_entry *dbp_ctp;
 
@@ -842,7 +842,7 @@ __db_extentsize_proc(dbpcl_id, extentsize, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -866,7 +866,7 @@ __db_flags_proc(dbpcl_id, flags, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -881,8 +881,8 @@ __db_flags_proc(dbpcl_id, flags, replyp)
 /* BEGIN __db_get_proc */
 /*
  * PUBLIC: void __db_get_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
- * PUBLIC:      u_int32_t, u_int32_t, __db_get_reply *, int *));
+ * PUBLIC:      u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer ,
+ * PUBLIC:      u_int32_t, u_int32_t, __db_get_reply *, gint *));
  */
 void
 __db_get_proc(dbpcl_id, txnpcl_id, keydlen,
@@ -895,24 +895,24 @@ __db_get_proc(dbpcl_id, txnpcl_id, keydlen,
 	u_int32_t keydoff;
 	u_int32_t keyulen;
 	u_int32_t keyflags;
-	void *keydata;
+	gpointer keydata;
 	u_int32_t keysize;
 	u_int32_t datadlen;
 	u_int32_t datadoff;
 	u_int32_t dataulen;
 	u_int32_t dataflags;
-	void *datadata;
+	gpointer datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
 	__db_get_reply *replyp;
-	int * freep;
+	gint * freep;
 /* END __db_get_proc */
 {
 	DB *dbp;
 	DBT key, data;
 	DB_TXN *txnp;
 	ct_entry *dbp_ctp, *txnp_ctp;
-	int key_alloc, bulk_alloc, ret;
+	gint key_alloc, bulk_alloc, ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1042,7 +1042,7 @@ __db_h_ffactor_proc(dbpcl_id, ffactor, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1067,7 +1067,7 @@ __db_h_nelem_proc(dbpcl_id, nelem, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1081,7 +1081,7 @@ __db_h_nelem_proc(dbpcl_id, nelem, replyp)
 /* BEGIN __db_key_range_proc */
 /*
  * PUBLIC: void __db_key_range_proc __P((long, long, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_key_range_reply *));
+ * PUBLIC:      u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, __db_key_range_reply *));
  */
 void
 __db_key_range_proc(dbpcl_id, txnpcl_id, keydlen,
@@ -1093,7 +1093,7 @@ __db_key_range_proc(dbpcl_id, txnpcl_id, keydlen,
 	u_int32_t keydoff;
 	u_int32_t keyulen;
 	u_int32_t keyflags;
-	void *keydata;
+	gpointer keydata;
 	u_int32_t keysize;
 	u_int32_t flags;
 	__db_key_range_reply *replyp;
@@ -1104,7 +1104,7 @@ __db_key_range_proc(dbpcl_id, txnpcl_id, keydlen,
 	DB_KEY_RANGE range;
 	DB_TXN *txnp;
 	ct_entry *dbp_ctp, *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1145,7 +1145,7 @@ __db_lorder_proc(dbpcl_id, lorder, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1158,7 +1158,7 @@ __db_lorder_proc(dbpcl_id, lorder, replyp)
 
 /* BEGIN __db_open_proc */
 /*
- * PUBLIC: void __db_open_proc __P((long, long, char *, char *, u_int32_t,
+ * PUBLIC: void __db_open_proc __P((long, long, gchar *, gchar *, u_int32_t,
  * PUBLIC:      u_int32_t, u_int32_t, __db_open_reply *));
  */
 void
@@ -1166,8 +1166,8 @@ __db_open_proc(dbpcl_id, txnpcl_id, name,
 		subdb, type, flags, mode, replyp)
 	long dbpcl_id;
 	long txnpcl_id;
-	char *name;
-	char *subdb;
+	gchar *name;
+	gchar *subdb;
 	u_int32_t type;
 	u_int32_t flags;
 	u_int32_t mode;
@@ -1178,7 +1178,7 @@ __db_open_proc(dbpcl_id, txnpcl_id, name,
 	DB_TXN *txnp;
 	DBTYPE dbtype;
 	ct_entry *dbp_ctp, *new_ctp, *txnp_ctp;
-	int isswapped, ret;
+	gint isswapped, ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1260,7 +1260,7 @@ __db_pagesize_proc(dbpcl_id, pagesize, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1274,9 +1274,9 @@ __db_pagesize_proc(dbpcl_id, pagesize, replyp)
 /* BEGIN __db_pget_proc */
 /*
  * PUBLIC: void __db_pget_proc __P((long, long, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
- * PUBLIC:      u_int32_t, u_int32_t, __db_pget_reply *, int *));
+ * PUBLIC:      u_int32_t, u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t,
+ * PUBLIC:      u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer ,
+ * PUBLIC:      u_int32_t, u_int32_t, __db_pget_reply *, gint *));
  */
 void
 __db_pget_proc(dbpcl_id, txnpcl_id, skeydlen,
@@ -1291,30 +1291,30 @@ __db_pget_proc(dbpcl_id, txnpcl_id, skeydlen,
 	u_int32_t skeydoff;
 	u_int32_t skeyulen;
 	u_int32_t skeyflags;
-	void *skeydata;
+	gpointer skeydata;
 	u_int32_t skeysize;
 	u_int32_t pkeydlen;
 	u_int32_t pkeydoff;
 	u_int32_t pkeyulen;
 	u_int32_t pkeyflags;
-	void *pkeydata;
+	gpointer pkeydata;
 	u_int32_t pkeysize;
 	u_int32_t datadlen;
 	u_int32_t datadoff;
 	u_int32_t dataulen;
 	u_int32_t dataflags;
-	void *datadata;
+	gpointer datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
 	__db_pget_reply *replyp;
-	int * freep;
+	gint * freep;
 /* END __db_pget_proc */
 {
 	DB *dbp;
 	DBT skey, pkey, data;
 	DB_TXN *txnp;
 	ct_entry *dbp_ctp, *txnp_ctp;
-	int key_alloc, ret;
+	gint key_alloc, ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1468,8 +1468,8 @@ err:		replyp->skeydata.skeydata_val = NULL;
 /* BEGIN __db_put_proc */
 /*
  * PUBLIC: void __db_put_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
- * PUBLIC:      u_int32_t, u_int32_t, __db_put_reply *, int *));
+ * PUBLIC:      u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer ,
+ * PUBLIC:      u_int32_t, u_int32_t, __db_put_reply *, gint *));
  */
 void
 __db_put_proc(dbpcl_id, txnpcl_id, keydlen,
@@ -1482,24 +1482,24 @@ __db_put_proc(dbpcl_id, txnpcl_id, keydlen,
 	u_int32_t keydoff;
 	u_int32_t keyulen;
 	u_int32_t keyflags;
-	void *keydata;
+	gpointer keydata;
 	u_int32_t keysize;
 	u_int32_t datadlen;
 	u_int32_t datadoff;
 	u_int32_t dataulen;
 	u_int32_t dataflags;
-	void *datadata;
+	gpointer datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
 	__db_put_reply *replyp;
-	int * freep;
+	gint * freep;
 /* END __db_put_proc */
 {
 	DB *dbp;
 	DBT key, data;
 	DB_TXN *txnp;
 	ct_entry *dbp_ctp, *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1587,7 +1587,7 @@ __db_re_delim_proc(dbpcl_id, delim, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1611,7 +1611,7 @@ __db_re_len_proc(dbpcl_id, len, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1635,7 +1635,7 @@ __db_re_pad_proc(dbpcl_id, pad, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1648,22 +1648,22 @@ __db_re_pad_proc(dbpcl_id, pad, replyp)
 
 /* BEGIN __db_remove_proc */
 /*
- * PUBLIC: void __db_remove_proc __P((long, char *, char *, u_int32_t,
+ * PUBLIC: void __db_remove_proc __P((long, gchar *, gchar *, u_int32_t,
  * PUBLIC:      __db_remove_reply *));
  */
 void
 __db_remove_proc(dbpcl_id, name, subdb,
 		flags, replyp)
 	long dbpcl_id;
-	char *name;
-	char *subdb;
+	gchar *name;
+	gchar *subdb;
 	u_int32_t flags;
 	__db_remove_reply *replyp;
 /* END __db_remove_proc */
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1677,23 +1677,23 @@ __db_remove_proc(dbpcl_id, name, subdb,
 
 /* BEGIN __db_rename_proc */
 /*
- * PUBLIC: void __db_rename_proc __P((long, char *, char *, char *, u_int32_t,
+ * PUBLIC: void __db_rename_proc __P((long, gchar *, gchar *, gchar *, u_int32_t,
  * PUBLIC:      __db_rename_reply *));
  */
 void
 __db_rename_proc(dbpcl_id, name, subdb,
 		newname, flags, replyp)
 	long dbpcl_id;
-	char *name;
-	char *subdb;
-	char *newname;
+	gchar *name;
+	gchar *subdb;
+	gchar *newname;
 	u_int32_t flags;
 	__db_rename_reply *replyp;
 /* END __db_rename_proc */
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1708,22 +1708,22 @@ __db_rename_proc(dbpcl_id, name, subdb,
 /* BEGIN __db_stat_proc */
 /*
  * PUBLIC: void __db_stat_proc __P((long, u_int32_t, __db_stat_reply *,
- * PUBLIC:      int *));
+ * PUBLIC:      gint *));
  */
 void
 __db_stat_proc(dbpcl_id, flags, replyp, freep)
 	long dbpcl_id;
 	u_int32_t flags;
 	__db_stat_reply *replyp;
-	int * freep;
+	gint * freep;
 /* END __db_stat_proc */
 {
 	DB *dbp;
 	DBTYPE type;
 	ct_entry *dbp_ctp;
 	u_int32_t *q, *p, *retsp;
-	int i, len, ret;
-	void *sp;
+	gint i, len, ret;
+	gpointer sp;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1778,7 +1778,7 @@ __db_sync_proc(dbpcl_id, flags, replyp)
 {
 	DB *dbp;
 	ct_entry *dbp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1807,7 +1807,7 @@ __db_truncate_proc(dbpcl_id, txnpcl_id,
 	DB_TXN *txnp;
 	ct_entry *dbp_ctp, *txnp_ctp;
 	u_int32_t count;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1842,7 +1842,7 @@ __db_cursor_proc(dbpcl_id, txnpcl_id,
 	DBC *dbc;
 	DB_TXN *txnp;
 	ct_entry *dbc_ctp, *env_ctp, *dbp_ctp, *txnp_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -1894,7 +1894,7 @@ __db_join_proc(dbpcl_id, curs, curslen,
 	ct_entry *dbc_ctp, *ctp, *dbp_ctp;
 	size_t size;
 	u_int32_t *cl, i;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
 	dbp = (DB *)dbp_ctp->ct_anyp;
@@ -2010,7 +2010,7 @@ __dbc_count_proc(dbccl_id, flags, replyp)
 	DBC *dbc;
 	ct_entry *dbc_ctp;
 	db_recno_t num;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
 	dbc = (DBC *)dbc_ctp->ct_anyp;
@@ -2035,7 +2035,7 @@ __dbc_del_proc(dbccl_id, flags, replyp)
 {
 	DBC *dbc;
 	ct_entry *dbc_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
 	dbc = (DBC *)dbc_ctp->ct_anyp;
@@ -2059,7 +2059,7 @@ __dbc_dup_proc(dbccl_id, flags, replyp)
 {
 	DBC *dbc, *newdbc;
 	ct_entry *dbc_ctp, *new_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
 	dbc = (DBC *)dbc_ctp->ct_anyp;
@@ -2091,8 +2091,8 @@ __dbc_dup_proc(dbccl_id, flags, replyp)
 /* BEGIN __dbc_get_proc */
 /*
  * PUBLIC: void __dbc_get_proc __P((long, u_int32_t, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
- * PUBLIC:      u_int32_t, u_int32_t, __dbc_get_reply *, int *));
+ * PUBLIC:      u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer ,
+ * PUBLIC:      u_int32_t, u_int32_t, __dbc_get_reply *, gint *));
  */
 void
 __dbc_get_proc(dbccl_id, keydlen, keydoff,
@@ -2104,24 +2104,24 @@ __dbc_get_proc(dbccl_id, keydlen, keydoff,
 	u_int32_t keydoff;
 	u_int32_t keyulen;
 	u_int32_t keyflags;
-	void *keydata;
+	gpointer keydata;
 	u_int32_t keysize;
 	u_int32_t datadlen;
 	u_int32_t datadoff;
 	u_int32_t dataulen;
 	u_int32_t dataflags;
-	void *datadata;
+	gpointer datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
 	__dbc_get_reply *replyp;
-	int * freep;
+	gint * freep;
 /* END __dbc_get_proc */
 {
 	DBC *dbc;
 	DBT key, data;
 	DB_ENV *dbenv;
 	ct_entry *dbc_ctp;
-	int key_alloc, bulk_alloc, ret;
+	gint key_alloc, bulk_alloc, ret;
 
 	ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
 	dbc = (DBC *)dbc_ctp->ct_anyp;
@@ -2232,9 +2232,9 @@ err:		replyp->keydata.keydata_val = NULL;
 /* BEGIN __dbc_pget_proc */
 /*
  * PUBLIC: void __dbc_pget_proc __P((long, u_int32_t, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
- * PUBLIC:      u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t,
- * PUBLIC:      u_int32_t, __dbc_pget_reply *, int *));
+ * PUBLIC:      u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer ,
+ * PUBLIC:      u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer , u_int32_t,
+ * PUBLIC:      u_int32_t, __dbc_pget_reply *, gint *));
  */
 void
 __dbc_pget_proc(dbccl_id, skeydlen, skeydoff,
@@ -2248,30 +2248,30 @@ __dbc_pget_proc(dbccl_id, skeydlen, skeydoff,
 	u_int32_t skeydoff;
 	u_int32_t skeyulen;
 	u_int32_t skeyflags;
-	void *skeydata;
+	gpointer skeydata;
 	u_int32_t skeysize;
 	u_int32_t pkeydlen;
 	u_int32_t pkeydoff;
 	u_int32_t pkeyulen;
 	u_int32_t pkeyflags;
-	void *pkeydata;
+	gpointer pkeydata;
 	u_int32_t pkeysize;
 	u_int32_t datadlen;
 	u_int32_t datadoff;
 	u_int32_t dataulen;
 	u_int32_t dataflags;
-	void *datadata;
+	gpointer datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
 	__dbc_pget_reply *replyp;
-	int * freep;
+	gint * freep;
 /* END __dbc_pget_proc */
 {
 	DBC *dbc;
 	DBT skey, pkey, data;
 	DB_ENV *dbenv;
 	ct_entry *dbc_ctp;
-	int key_alloc, ret;
+	gint key_alloc, ret;
 
 	ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
 	dbc = (DBC *)dbc_ctp->ct_anyp;
@@ -2420,8 +2420,8 @@ err:		replyp->skeydata.skeydata_val = NULL;
 /* BEGIN __dbc_put_proc */
 /*
  * PUBLIC: void __dbc_put_proc __P((long, u_int32_t, u_int32_t, u_int32_t,
- * PUBLIC:      u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
- * PUBLIC:      u_int32_t, u_int32_t, __dbc_put_reply *, int *));
+ * PUBLIC:      u_int32_t, gpointer , u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, gpointer ,
+ * PUBLIC:      u_int32_t, u_int32_t, __dbc_put_reply *, gint *));
  */
 void
 __dbc_put_proc(dbccl_id, keydlen, keydoff,
@@ -2433,24 +2433,24 @@ __dbc_put_proc(dbccl_id, keydlen, keydoff,
 	u_int32_t keydoff;
 	u_int32_t keyulen;
 	u_int32_t keyflags;
-	void *keydata;
+	gpointer keydata;
 	u_int32_t keysize;
 	u_int32_t datadlen;
 	u_int32_t datadoff;
 	u_int32_t dataulen;
 	u_int32_t dataflags;
-	void *datadata;
+	gpointer datadata;
 	u_int32_t datasize;
 	u_int32_t flags;
 	__dbc_put_reply *replyp;
-	int * freep;
+	gint * freep;
 /* END __dbc_put_proc */
 {
 	DB *dbp;
 	DBC *dbc;
 	DBT key, data;
 	ct_entry *dbc_ctp;
-	int ret;
+	gint ret;
 
 	ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
 	dbc = (DBC *)dbc_ctp->ct_anyp;
diff --git a/libdb/rpc_server/c/db_server_svc.c b/libdb/rpc_server/c/db_server_svc.c
index 96dd959..f4dcee2 100644
--- a/libdb/rpc_server/c/db_server_svc.c
+++ b/libdb/rpc_server/c/db_server_svc.c
@@ -81,322 +81,322 @@ db_rpc_serverprog_4001(rqstp, transp)
 		__dbc_pget_msg __db_dbc_pget_4001_arg;
 		__dbc_put_msg __db_dbc_put_4001_arg;
 	} argument;
-	char *result;
+	gchar *result;
 	bool_t (*xdr_argument)(), (*xdr_result)();
-	char *(*local)();
+	gchar *(*local)();
 
 	switch (rqstp->rq_proc) {
 	case NULLPROC:
 		(void) svc_sendreply(transp, (xdrproc_t)xdr_void,
-			(char *)NULL);
+			(gchar *)NULL);
 		return;
 
 	case __DB_env_cachesize:
 		xdr_argument = xdr___env_cachesize_msg;
 		xdr_result = xdr___env_cachesize_reply;
-		local = (char *(*)()) __db_env_cachesize_4001;
+		local = (gchar *(*)()) __db_env_cachesize_4001;
 		break;
 
 	case __DB_env_close:
 		xdr_argument = xdr___env_close_msg;
 		xdr_result = xdr___env_close_reply;
-		local = (char *(*)()) __db_env_close_4001;
+		local = (gchar *(*)()) __db_env_close_4001;
 		break;
 
 	case __DB_env_create:
 		xdr_argument = xdr___env_create_msg;
 		xdr_result = xdr___env_create_reply;
-		local = (char *(*)()) __db_env_create_4001;
+		local = (gchar *(*)()) __db_env_create_4001;
 		break;
 
 	case __DB_env_dbremove:
 		xdr_argument = xdr___env_dbremove_msg;
 		xdr_result = xdr___env_dbremove_reply;
-		local = (char *(*)()) __db_env_dbremove_4001;
+		local = (gchar *(*)()) __db_env_dbremove_4001;
 		break;
 
 	case __DB_env_dbrename:
 		xdr_argument = xdr___env_dbrename_msg;
 		xdr_result = xdr___env_dbrename_reply;
-		local = (char *(*)()) __db_env_dbrename_4001;
+		local = (gchar *(*)()) __db_env_dbrename_4001;
 		break;
 
 	case __DB_env_encrypt:
 		xdr_argument = xdr___env_encrypt_msg;
 		xdr_result = xdr___env_encrypt_reply;
-		local = (char *(*)()) __db_env_encrypt_4001;
+		local = (gchar *(*)()) __db_env_encrypt_4001;
 		break;
 
 	case __DB_env_flags:
 		xdr_argument = xdr___env_flags_msg;
 		xdr_result = xdr___env_flags_reply;
-		local = (char *(*)()) __db_env_flags_4001;
+		local = (gchar *(*)()) __db_env_flags_4001;
 		break;
 
 	case __DB_env_open:
 		xdr_argument = xdr___env_open_msg;
 		xdr_result = xdr___env_open_reply;
-		local = (char *(*)()) __db_env_open_4001;
+		local = (gchar *(*)()) __db_env_open_4001;
 		break;
 
 	case __DB_env_remove:
 		xdr_argument = xdr___env_remove_msg;
 		xdr_result = xdr___env_remove_reply;
-		local = (char *(*)()) __db_env_remove_4001;
+		local = (gchar *(*)()) __db_env_remove_4001;
 		break;
 
 	case __DB_txn_abort:
 		xdr_argument = xdr___txn_abort_msg;
 		xdr_result = xdr___txn_abort_reply;
-		local = (char *(*)()) __db_txn_abort_4001;
+		local = (gchar *(*)()) __db_txn_abort_4001;
 		break;
 
 	case __DB_txn_begin:
 		xdr_argument = xdr___txn_begin_msg;
 		xdr_result = xdr___txn_begin_reply;
-		local = (char *(*)()) __db_txn_begin_4001;
+		local = (gchar *(*)()) __db_txn_begin_4001;
 		break;
 
 	case __DB_txn_commit:
 		xdr_argument = xdr___txn_commit_msg;
 		xdr_result = xdr___txn_commit_reply;
-		local = (char *(*)()) __db_txn_commit_4001;
+		local = (gchar *(*)()) __db_txn_commit_4001;
 		break;
 
 	case __DB_txn_discard:
 		xdr_argument = xdr___txn_discard_msg;
 		xdr_result = xdr___txn_discard_reply;
-		local = (char *(*)()) __db_txn_discard_4001;
+		local = (gchar *(*)()) __db_txn_discard_4001;
 		break;
 
 	case __DB_txn_prepare:
 		xdr_argument = xdr___txn_prepare_msg;
 		xdr_result = xdr___txn_prepare_reply;
-		local = (char *(*)()) __db_txn_prepare_4001;
+		local = (gchar *(*)()) __db_txn_prepare_4001;
 		break;
 
 	case __DB_txn_recover:
 		xdr_argument = xdr___txn_recover_msg;
 		xdr_result = xdr___txn_recover_reply;
-		local = (char *(*)()) __db_txn_recover_4001;
+		local = (gchar *(*)()) __db_txn_recover_4001;
 		break;
 
 	case __DB_db_associate:
 		xdr_argument = xdr___db_associate_msg;
 		xdr_result = xdr___db_associate_reply;
-		local = (char *(*)()) __db_db_associate_4001;
+		local = (gchar *(*)()) __db_db_associate_4001;
 		break;
 
 	case __DB_db_bt_maxkey:
 		xdr_argument = xdr___db_bt_maxkey_msg;
 		xdr_result = xdr___db_bt_maxkey_reply;
-		local = (char *(*)()) __db_db_bt_maxkey_4001;
+		local = (gchar *(*)()) __db_db_bt_maxkey_4001;
 		break;
 
 	case __DB_db_bt_minkey:
 		xdr_argument = xdr___db_bt_minkey_msg;
 		xdr_result = xdr___db_bt_minkey_reply;
-		local = (char *(*)()) __db_db_bt_minkey_4001;
+		local = (gchar *(*)()) __db_db_bt_minkey_4001;
 		break;
 
 	case __DB_db_close:
 		xdr_argument = xdr___db_close_msg;
 		xdr_result = xdr___db_close_reply;
-		local = (char *(*)()) __db_db_close_4001;
+		local = (gchar *(*)()) __db_db_close_4001;
 		break;
 
 	case __DB_db_create:
 		xdr_argument = xdr___db_create_msg;
 		xdr_result = xdr___db_create_reply;
-		local = (char *(*)()) __db_db_create_4001;
+		local = (gchar *(*)()) __db_db_create_4001;
 		break;
 
 	case __DB_db_del:
 		xdr_argument = xdr___db_del_msg;
 		xdr_result = xdr___db_del_reply;
-		local = (char *(*)()) __db_db_del_4001;
+		local = (gchar *(*)()) __db_db_del_4001;
 		break;
 
 	case __DB_db_encrypt:
 		xdr_argument = xdr___db_encrypt_msg;
 		xdr_result = xdr___db_encrypt_reply;
-		local = (char *(*)()) __db_db_encrypt_4001;
+		local = (gchar *(*)()) __db_db_encrypt_4001;
 		break;
 
 	case __DB_db_extentsize:
 		xdr_argument = xdr___db_extentsize_msg;
 		xdr_result = xdr___db_extentsize_reply;
-		local = (char *(*)()) __db_db_extentsize_4001;
+		local = (gchar *(*)()) __db_db_extentsize_4001;
 		break;
 
 	case __DB_db_flags:
 		xdr_argument = xdr___db_flags_msg;
 		xdr_result = xdr___db_flags_reply;
-		local = (char *(*)()) __db_db_flags_4001;
+		local = (gchar *(*)()) __db_db_flags_4001;
 		break;
 
 	case __DB_db_get:
 		xdr_argument = xdr___db_get_msg;
 		xdr_result = xdr___db_get_reply;
-		local = (char *(*)()) __db_db_get_4001;
+		local = (gchar *(*)()) __db_db_get_4001;
 		break;
 
 	case __DB_db_h_ffactor:
 		xdr_argument = xdr___db_h_ffactor_msg;
 		xdr_result = xdr___db_h_ffactor_reply;
-		local = (char *(*)()) __db_db_h_ffactor_4001;
+		local = (gchar *(*)()) __db_db_h_ffactor_4001;
 		break;
 
 	case __DB_db_h_nelem:
 		xdr_argument = xdr___db_h_nelem_msg;
 		xdr_result = xdr___db_h_nelem_reply;
-		local = (char *(*)()) __db_db_h_nelem_4001;
+		local = (gchar *(*)()) __db_db_h_nelem_4001;
 		break;
 
 	case __DB_db_key_range:
 		xdr_argument = xdr___db_key_range_msg;
 		xdr_result = xdr___db_key_range_reply;
-		local = (char *(*)()) __db_db_key_range_4001;
+		local = (gchar *(*)()) __db_db_key_range_4001;
 		break;
 
 	case __DB_db_lorder:
 		xdr_argument = xdr___db_lorder_msg;
 		xdr_result = xdr___db_lorder_reply;
-		local = (char *(*)()) __db_db_lorder_4001;
+		local = (gchar *(*)()) __db_db_lorder_4001;
 		break;
 
 	case __DB_db_open:
 		xdr_argument = xdr___db_open_msg;
 		xdr_result = xdr___db_open_reply;
-		local = (char *(*)()) __db_db_open_4001;
+		local = (gchar *(*)()) __db_db_open_4001;
 		break;
 
 	case __DB_db_pagesize:
 		xdr_argument = xdr___db_pagesize_msg;
 		xdr_result = xdr___db_pagesize_reply;
-		local = (char *(*)()) __db_db_pagesize_4001;
+		local = (gchar *(*)()) __db_db_pagesize_4001;
 		break;
 
 	case __DB_db_pget:
 		xdr_argument = xdr___db_pget_msg;
 		xdr_result = xdr___db_pget_reply;
-		local = (char *(*)()) __db_db_pget_4001;
+		local = (gchar *(*)()) __db_db_pget_4001;
 		break;
 
 	case __DB_db_put:
 		xdr_argument = xdr___db_put_msg;
 		xdr_result = xdr___db_put_reply;
-		local = (char *(*)()) __db_db_put_4001;
+		local = (gchar *(*)()) __db_db_put_4001;
 		break;
 
 	case __DB_db_re_delim:
 		xdr_argument = xdr___db_re_delim_msg;
 		xdr_result = xdr___db_re_delim_reply;
-		local = (char *(*)()) __db_db_re_delim_4001;
+		local = (gchar *(*)()) __db_db_re_delim_4001;
 		break;
 
 	case __DB_db_re_len:
 		xdr_argument = xdr___db_re_len_msg;
 		xdr_result = xdr___db_re_len_reply;
-		local = (char *(*)()) __db_db_re_len_4001;
+		local = (gchar *(*)()) __db_db_re_len_4001;
 		break;
 
 	case __DB_db_re_pad:
 		xdr_argument = xdr___db_re_pad_msg;
 		xdr_result = xdr___db_re_pad_reply;
-		local = (char *(*)()) __db_db_re_pad_4001;
+		local = (gchar *(*)()) __db_db_re_pad_4001;
 		break;
 
 	case __DB_db_remove:
 		xdr_argument = xdr___db_remove_msg;
 		xdr_result = xdr___db_remove_reply;
-		local = (char *(*)()) __db_db_remove_4001;
+		local = (gchar *(*)()) __db_db_remove_4001;
 		break;
 
 	case __DB_db_rename:
 		xdr_argument = xdr___db_rename_msg;
 		xdr_result = xdr___db_rename_reply;
-		local = (char *(*)()) __db_db_rename_4001;
+		local = (gchar *(*)()) __db_db_rename_4001;
 		break;
 
 	case __DB_db_stat:
 		xdr_argument = xdr___db_stat_msg;
 		xdr_result = xdr___db_stat_reply;
-		local = (char *(*)()) __db_db_stat_4001;
+		local = (gchar *(*)()) __db_db_stat_4001;
 		break;
 
 	case __DB_db_sync:
 		xdr_argument = xdr___db_sync_msg;
 		xdr_result = xdr___db_sync_reply;
-		local = (char *(*)()) __db_db_sync_4001;
+		local = (gchar *(*)()) __db_db_sync_4001;
 		break;
 
 	case __DB_db_truncate:
 		xdr_argument = xdr___db_truncate_msg;
 		xdr_result = xdr___db_truncate_reply;
-		local = (char *(*)()) __db_db_truncate_4001;
+		local = (gchar *(*)()) __db_db_truncate_4001;
 		break;
 
 	case __DB_db_cursor:
 		xdr_argument = xdr___db_cursor_msg;
 		xdr_result = xdr___db_cursor_reply;
-		local = (char *(*)()) __db_db_cursor_4001;
+		local = (gchar *(*)()) __db_db_cursor_4001;
 		break;
 
 	case __DB_db_join:
 		xdr_argument = xdr___db_join_msg;
 		xdr_result = xdr___db_join_reply;
-		local = (char *(*)()) __db_db_join_4001;
+		local = (gchar *(*)()) __db_db_join_4001;
 		break;
 
 	case __DB_dbc_close:
 		xdr_argument = xdr___dbc_close_msg;
 		xdr_result = xdr___dbc_close_reply;
-		local = (char *(*)()) __db_dbc_close_4001;
+		local = (gchar *(*)()) __db_dbc_close_4001;
 		break;
 
 	case __DB_dbc_count:
 		xdr_argument = xdr___dbc_count_msg;
 		xdr_result = xdr___dbc_count_reply;
-		local = (char *(*)()) __db_dbc_count_4001;
+		local = (gchar *(*)()) __db_dbc_count_4001;
 		break;
 
 	case __DB_dbc_del:
 		xdr_argument = xdr___dbc_del_msg;
 		xdr_result = xdr___dbc_del_reply;
-		local = (char *(*)()) __db_dbc_del_4001;
+		local = (gchar *(*)()) __db_dbc_del_4001;
 		break;
 
 	case __DB_dbc_dup:
 		xdr_argument = xdr___dbc_dup_msg;
 		xdr_result = xdr___dbc_dup_reply;
-		local = (char *(*)()) __db_dbc_dup_4001;
+		local = (gchar *(*)()) __db_dbc_dup_4001;
 		break;
 
 	case __DB_dbc_get:
 		xdr_argument = xdr___dbc_get_msg;
 		xdr_result = xdr___dbc_get_reply;
-		local = (char *(*)()) __db_dbc_get_4001;
+		local = (gchar *(*)()) __db_dbc_get_4001;
 		break;
 
 	case __DB_dbc_pget:
 		xdr_argument = xdr___dbc_pget_msg;
 		xdr_result = xdr___dbc_pget_reply;
-		local = (char *(*)()) __db_dbc_pget_4001;
+		local = (gchar *(*)()) __db_dbc_pget_4001;
 		break;
 
 	case __DB_dbc_put:
 		xdr_argument = xdr___dbc_put_msg;
 		xdr_result = xdr___dbc_put_reply;
-		local = (char *(*)()) __db_dbc_put_4001;
+		local = (gchar *(*)()) __db_dbc_put_4001;
 		break;
 
 	default:
 		svcerr_noproc(transp);
 		return;
 	}
-	(void) memset((char *)&argument, 0, sizeof (argument));
-	if (!svc_getargs(transp, (xdrproc_t)xdr_argument, (char *)&argument)) {
+	(void) memset((gchar *)&argument, 0, sizeof (argument));
+	if (!svc_getargs(transp, (xdrproc_t)xdr_argument, (gchar *)&argument)) {
 		svcerr_decode(transp);
 		return;
 	}
@@ -404,7 +404,7 @@ db_rpc_serverprog_4001(rqstp, transp)
 	if (result != NULL && !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
 		svcerr_systemerr(transp);
 	}
-	if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, (char *)&argument)) {
+	if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, (gchar *)&argument)) {
 		fprintf(stderr, "unable to free arguments");
 		exit(1);
 	}
diff --git a/libdb/rpc_server/c/db_server_util.c b/libdb/rpc_server/c/db_server_util.c
index 869bf0c..5a2a531 100644
--- a/libdb/rpc_server/c/db_server_util.c
+++ b/libdb/rpc_server/c/db_server_util.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -42,10 +42,10 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_server_ext.h"
 #include "dbinc_auto/common_ext.h"
 
-extern int __dbsrv_main	 __P((void));
-static int add_home __P((char *));
-static int add_passwd __P((char *));
-static int env_recover __P((char *));
+extern gint __dbsrv_main	 __P((void));
+static gint add_home __P((gchar *));
+static gint add_passwd __P((gchar *));
+static gint env_recover __P((gchar *));
 static void __dbclear_child __P((ct_entry *));
 
 static LIST_HEAD(cthead, ct_entry) __dbsrv_head;
@@ -53,23 +53,23 @@ static LIST_HEAD(homehead, home_entry) __dbsrv_home;
 static long __dbsrv_defto = DB_SERVER_TIMEOUT;
 static long __dbsrv_maxto = DB_SERVER_MAXTIMEOUT;
 static long __dbsrv_idleto = DB_SERVER_IDLETIMEOUT;
-static char *logfile = NULL;
-static char *prog;
+static gchar *logfile = NULL;
+static gchar *prog;
 
-static void usage __P((char *));
+static void usage __P((gchar *));
 static void version_check __P((void));
 
-int __dbsrv_verbose = 0;
+gint __dbsrv_verbose = 0;
 
-int
+gint
 main(argc, argv)
-	int argc;
-	char **argv;
+	gint argc;
+	gchar **argv;
 {
-	extern char *optarg;
+	extern gchar *optarg;
 	CLIENT *cl;
-	int ch, ret;
-	char *passwd;
+	gint ch, ret;
+	gchar *passwd;
 
 	prog = argv[0];
 
@@ -191,7 +191,7 @@ main(argc, argv)
 
 static void
 usage(prog)
-	char *prog;
+	gchar *prog;
 {
 	fprintf(stderr, "usage: %s %s\n\t%s\n", prog,
 	    "[-Vv] [-h home] [-P passwd]",
@@ -202,7 +202,7 @@ usage(prog)
 static void
 version_check()
 {
-	int v_major, v_minor, v_patch;
+	gint v_major, v_minor, v_patch;
 
 	/* Make sure we're loaded with the right version of the DB library. */
 	(void)db_version(&v_major, &v_minor, &v_patch);
@@ -237,7 +237,7 @@ __dbsrv_settimeout(ctp, to)
  */
 void
 __dbsrv_timeout(force)
-	int force;
+	gint force;
 {
 	static long to_hint = -1;
 	time_t t;
@@ -386,15 +386,15 @@ __dbdel_ctp(parent)
 }
 
 /*
- * PUBLIC: ct_entry *new_ct_ent __P((int *));
+ * PUBLIC: ct_entry *new_ct_ent __P((gint *));
  */
 ct_entry *
 new_ct_ent(errp)
-	int *errp;
+	gint *errp;
 {
 	time_t t;
 	ct_entry *ctp, *octp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(NULL, sizeof(ct_entry), &ctp)) != 0) {
 		*errp = ret;
@@ -443,13 +443,13 @@ get_tableent(id)
 }
 
 /*
- * PUBLIC: ct_entry *__dbsrv_sharedb __P((ct_entry *, const char *,
- * PUBLIC:    const char *, DBTYPE, u_int32_t));
+ * PUBLIC: ct_entry *__dbsrv_sharedb __P((ct_entry *, const gchar *,
+ * PUBLIC:    const gchar *, DBTYPE, u_int32_t));
  */
 ct_entry *
 __dbsrv_sharedb(db_ctp, name, subdb, type, flags)
 	ct_entry *db_ctp;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	DBTYPE type;
 	u_int32_t flags;
 {
@@ -574,15 +574,15 @@ __dbsrv_active(ctp)
 }
 
 /*
- * PUBLIC: int __db_close_int __P((long, u_int32_t));
+ * PUBLIC: gint __db_close_int __P((long, u_int32_t));
  */
-int
+gint
 __db_close_int(id, flags)
 	long id;
 	u_int32_t flags;
 {
 	DB *dbp;
-	int ret;
+	gint ret;
 	ct_entry *ctp;
 
 	ret = 0;
@@ -605,14 +605,14 @@ __db_close_int(id, flags)
 }
 
 /*
- * PUBLIC: int __dbc_close_int __P((ct_entry *));
+ * PUBLIC: gint __dbc_close_int __P((ct_entry *));
  */
-int
+gint
 __dbc_close_int(dbc_ctp)
 	ct_entry *dbc_ctp;
 {
 	DBC *dbc;
-	int ret;
+	gint ret;
 	ct_entry *ctp;
 
 	dbc = (DBC *)dbc_ctp->ct_anyp;
@@ -642,16 +642,16 @@ __dbc_close_int(dbc_ctp)
 }
 
 /*
- * PUBLIC: int __dbenv_close_int __P((long, u_int32_t, int));
+ * PUBLIC: gint __dbenv_close_int __P((long, u_int32_t, int));
  */
-int
+gint
 __dbenv_close_int(id, flags, force)
 	long id;
 	u_int32_t flags;
-	int force;
+	gint force;
 {
 	DB_ENV *dbenv;
-	int ret;
+	gint ret;
 	ct_entry *ctp;
 
 	ret = 0;
@@ -679,10 +679,10 @@ __dbenv_close_int(id, flags, force)
 
 static int
 add_home(home)
-	char *home;
+	gchar *home;
 {
 	home_entry *hp, *homep;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(NULL, sizeof(home_entry), &hp)) != 0)
 		return (ret);
@@ -724,7 +724,7 @@ add_home(home)
 
 static int
 add_passwd(passwd)
-	char *passwd;
+	gchar *passwd;
 {
 	home_entry *hp;
 
@@ -745,11 +745,11 @@ add_passwd(passwd)
 }
 
 /*
- * PUBLIC: home_entry *get_home __P((char *));
+ * PUBLIC: home_entry *get_home __P((gchar *));
  */
 home_entry *
 get_home(name)
-	char *name;
+	gchar *name;
 {
 	home_entry *hp;
 
@@ -762,12 +762,12 @@ get_home(name)
 
 static int
 env_recover(progname)
-	char *progname;
+	gchar *progname;
 {
 	DB_ENV *dbenv;
 	home_entry *hp;
 	u_int32_t flags;
-	int exitval, ret;
+	gint exitval, ret;
 
 	for (hp = LIST_FIRST(&__dbsrv_home); hp != NULL;
 	    hp = LIST_NEXT(hp, entries)) {
diff --git a/libdb/rpc_server/c/db_server_xdr.c b/libdb/rpc_server/c/db_server_xdr.c
index bfe2b6c..471782d 100644
--- a/libdb/rpc_server/c/db_server_xdr.c
+++ b/libdb/rpc_server/c/db_server_xdr.c
@@ -406,10 +406,10 @@ xdr___txn_recover_reply(xdrs, objp)
 
 	if (!xdr_int(xdrs, &objp->status))
 		return (FALSE);
-	if (!xdr_array(xdrs, (char **)&objp->txn.txn_val, (u_int *) &objp->txn.txn_len, ~0,
+	if (!xdr_array(xdrs, (gchar **)&objp->txn.txn_val, (u_int *) &objp->txn.txn_len, ~0,
 		sizeof (u_int), (xdrproc_t) xdr_u_int))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->gid.gid_val, (u_int *) &objp->gid.gid_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->gid.gid_val, (u_int *) &objp->gid.gid_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->retcount))
 		return (FALSE);
@@ -560,7 +560,7 @@ xdr___db_del_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->keyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
 		return (FALSE);
@@ -670,7 +670,7 @@ xdr___db_get_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->keyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->datadlen))
 		return (FALSE);
@@ -680,7 +680,7 @@ xdr___db_get_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->dataflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
 		return (FALSE);
@@ -695,9 +695,9 @@ xdr___db_get_reply(xdrs, objp)
 
 	if (!xdr_int(xdrs, &objp->status))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	return (TRUE);
 }
@@ -768,7 +768,7 @@ xdr___db_key_range_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->keyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
 		return (FALSE);
@@ -900,7 +900,7 @@ xdr___db_pget_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->skeyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->skeydata.skeydata_val, (u_int *) &objp->skeydata.skeydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->skeydata.skeydata_val, (u_int *) &objp->skeydata.skeydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->pkeydlen))
 		return (FALSE);
@@ -910,7 +910,7 @@ xdr___db_pget_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->pkeyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->pkeydata.pkeydata_val, (u_int *) &objp->pkeydata.pkeydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->pkeydata.pkeydata_val, (u_int *) &objp->pkeydata.pkeydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->datadlen))
 		return (FALSE);
@@ -920,7 +920,7 @@ xdr___db_pget_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->dataflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
 		return (FALSE);
@@ -935,11 +935,11 @@ xdr___db_pget_reply(xdrs, objp)
 
 	if (!xdr_int(xdrs, &objp->status))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->skeydata.skeydata_val, (u_int *) &objp->skeydata.skeydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->skeydata.skeydata_val, (u_int *) &objp->skeydata.skeydata_len, ~0))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->pkeydata.pkeydata_val, (u_int *) &objp->pkeydata.pkeydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->pkeydata.pkeydata_val, (u_int *) &objp->pkeydata.pkeydata_len, ~0))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	return (TRUE);
 }
@@ -962,7 +962,7 @@ xdr___db_put_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->keyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->datadlen))
 		return (FALSE);
@@ -972,7 +972,7 @@ xdr___db_put_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->dataflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
 		return (FALSE);
@@ -987,7 +987,7 @@ xdr___db_put_reply(xdrs, objp)
 
 	if (!xdr_int(xdrs, &objp->status))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
 	return (TRUE);
 }
@@ -1143,7 +1143,7 @@ xdr___db_stat_reply(xdrs, objp)
 
 	if (!xdr_int(xdrs, &objp->status))
 		return (FALSE);
-	if (!xdr_array(xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
+	if (!xdr_array(xdrs, (gchar **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
 		sizeof (u_int), (xdrproc_t) xdr_u_int))
 		return (FALSE);
 	return (TRUE);
@@ -1237,7 +1237,7 @@ xdr___db_join_msg(xdrs, objp)
 
 	if (!xdr_u_int(xdrs, &objp->dbpcl_id))
 		return (FALSE);
-	if (!xdr_array(xdrs, (char **)&objp->curs.curs_val, (u_int *) &objp->curs.curs_len, ~0,
+	if (!xdr_array(xdrs, (gchar **)&objp->curs.curs_val, (u_int *) &objp->curs.curs_len, ~0,
 		sizeof (u_int), (xdrproc_t) xdr_u_int))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
@@ -1372,7 +1372,7 @@ xdr___dbc_get_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->keyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->datadlen))
 		return (FALSE);
@@ -1382,7 +1382,7 @@ xdr___dbc_get_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->dataflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
 		return (FALSE);
@@ -1397,9 +1397,9 @@ xdr___dbc_get_reply(xdrs, objp)
 
 	if (!xdr_int(xdrs, &objp->status))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	return (TRUE);
 }
@@ -1420,7 +1420,7 @@ xdr___dbc_pget_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->skeyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->skeydata.skeydata_val, (u_int *) &objp->skeydata.skeydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->skeydata.skeydata_val, (u_int *) &objp->skeydata.skeydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->pkeydlen))
 		return (FALSE);
@@ -1430,7 +1430,7 @@ xdr___dbc_pget_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->pkeyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->pkeydata.pkeydata_val, (u_int *) &objp->pkeydata.pkeydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->pkeydata.pkeydata_val, (u_int *) &objp->pkeydata.pkeydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->datadlen))
 		return (FALSE);
@@ -1440,7 +1440,7 @@ xdr___dbc_pget_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->dataflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
 		return (FALSE);
@@ -1455,11 +1455,11 @@ xdr___dbc_pget_reply(xdrs, objp)
 
 	if (!xdr_int(xdrs, &objp->status))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->skeydata.skeydata_val, (u_int *) &objp->skeydata.skeydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->skeydata.skeydata_val, (u_int *) &objp->skeydata.skeydata_len, ~0))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->pkeydata.pkeydata_val, (u_int *) &objp->pkeydata.pkeydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->pkeydata.pkeydata_val, (u_int *) &objp->pkeydata.pkeydata_len, ~0))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	return (TRUE);
 }
@@ -1480,7 +1480,7 @@ xdr___dbc_put_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->keyflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->datadlen))
 		return (FALSE);
@@ -1490,7 +1490,7 @@ xdr___dbc_put_msg(xdrs, objp)
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->dataflags))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->datadata.datadata_val, (u_int *) &objp->datadata.datadata_len, ~0))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->flags))
 		return (FALSE);
@@ -1505,7 +1505,7 @@ xdr___dbc_put_reply(xdrs, objp)
 
 	if (!xdr_int(xdrs, &objp->status))
 		return (FALSE);
-	if (!xdr_bytes(xdrs, (char **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
+	if (!xdr_bytes(xdrs, (gchar **)&objp->keydata.keydata_val, (u_int *) &objp->keydata.keydata_len, ~0))
 		return (FALSE);
 	return (TRUE);
 }
diff --git a/libdb/rpc_server/c/gen_db_server.c b/libdb/rpc_server/c/gen_db_server.c
index d5a4cca..d610354 100644
--- a/libdb/rpc_server/c/gen_db_server.c
+++ b/libdb/rpc_server/c/gen_db_server.c
@@ -304,11 +304,11 @@ __db_txn_recover_4001(msg, req)
 	struct svc_req *req;
 {
 	static __txn_recover_reply reply; /* must be static */
-	static int __txn_recover_free = 0; /* must be static */
+	static gint __txn_recover_free = 0; /* must be static */
 
 	COMPQUIET(req, NULL);
 	if (__txn_recover_free)
-		xdr_free((xdrproc_t)xdr___txn_recover_reply, (void *)&reply);
+		xdr_free((xdrproc_t)xdr___txn_recover_reply, (gpointer)&reply);
 	__txn_recover_free = 0;
 
 	/* Reinitialize allocated fields */
@@ -514,11 +514,11 @@ __db_db_get_4001(msg, req)
 	struct svc_req *req;
 {
 	static __db_get_reply reply; /* must be static */
-	static int __db_get_free = 0; /* must be static */
+	static gint __db_get_free = 0; /* must be static */
 
 	COMPQUIET(req, NULL);
 	if (__db_get_free)
-		xdr_free((xdrproc_t)xdr___db_get_reply, (void *)&reply);
+		xdr_free((xdrproc_t)xdr___db_get_reply, (gpointer)&reply);
 	__db_get_free = 0;
 
 	/* Reinitialize allocated fields */
@@ -681,11 +681,11 @@ __db_db_pget_4001(msg, req)
 	struct svc_req *req;
 {
 	static __db_pget_reply reply; /* must be static */
-	static int __db_pget_free = 0; /* must be static */
+	static gint __db_pget_free = 0; /* must be static */
 
 	COMPQUIET(req, NULL);
 	if (__db_pget_free)
-		xdr_free((xdrproc_t)xdr___db_pget_reply, (void *)&reply);
+		xdr_free((xdrproc_t)xdr___db_pget_reply, (gpointer)&reply);
 	__db_pget_free = 0;
 
 	/* Reinitialize allocated fields */
@@ -729,11 +729,11 @@ __db_db_put_4001(msg, req)
 	struct svc_req *req;
 {
 	static __db_put_reply reply; /* must be static */
-	static int __db_put_free = 0; /* must be static */
+	static gint __db_put_free = 0; /* must be static */
 
 	COMPQUIET(req, NULL);
 	if (__db_put_free)
-		xdr_free((xdrproc_t)xdr___db_put_reply, (void *)&reply);
+		xdr_free((xdrproc_t)xdr___db_put_reply, (gpointer)&reply);
 	__db_put_free = 0;
 
 	/* Reinitialize allocated fields */
@@ -869,11 +869,11 @@ __db_db_stat_4001(msg, req)
 	struct svc_req *req;
 {
 	static __db_stat_reply reply; /* must be static */
-	static int __db_stat_free = 0; /* must be static */
+	static gint __db_stat_free = 0; /* must be static */
 
 	COMPQUIET(req, NULL);
 	if (__db_stat_free)
-		xdr_free((xdrproc_t)xdr___db_stat_reply, (void *)&reply);
+		xdr_free((xdrproc_t)xdr___db_stat_reply, (gpointer)&reply);
 	__db_stat_free = 0;
 
 	/* Reinitialize allocated fields */
@@ -1051,11 +1051,11 @@ __db_dbc_get_4001(msg, req)
 	struct svc_req *req;
 {
 	static __dbc_get_reply reply; /* must be static */
-	static int __dbc_get_free = 0; /* must be static */
+	static gint __dbc_get_free = 0; /* must be static */
 
 	COMPQUIET(req, NULL);
 	if (__dbc_get_free)
-		xdr_free((xdrproc_t)xdr___dbc_get_reply, (void *)&reply);
+		xdr_free((xdrproc_t)xdr___dbc_get_reply, (gpointer)&reply);
 	__dbc_get_free = 0;
 
 	/* Reinitialize allocated fields */
@@ -1091,11 +1091,11 @@ __db_dbc_pget_4001(msg, req)
 	struct svc_req *req;
 {
 	static __dbc_pget_reply reply; /* must be static */
-	static int __dbc_pget_free = 0; /* must be static */
+	static gint __dbc_pget_free = 0; /* must be static */
 
 	COMPQUIET(req, NULL);
 	if (__dbc_pget_free)
-		xdr_free((xdrproc_t)xdr___dbc_pget_reply, (void *)&reply);
+		xdr_free((xdrproc_t)xdr___dbc_pget_reply, (gpointer)&reply);
 	__dbc_pget_free = 0;
 
 	/* Reinitialize allocated fields */
@@ -1138,11 +1138,11 @@ __db_dbc_put_4001(msg, req)
 	struct svc_req *req;
 {
 	static __dbc_put_reply reply; /* must be static */
-	static int __dbc_put_free = 0; /* must be static */
+	static gint __dbc_put_free = 0; /* must be static */
 
 	COMPQUIET(req, NULL);
 	if (__dbc_put_free)
-		xdr_free((xdrproc_t)xdr___dbc_put_reply, (void *)&reply);
+		xdr_free((xdrproc_t)xdr___dbc_put_reply, (gpointer)&reply);
 	__dbc_put_free = 0;
 
 	/* Reinitialize allocated fields */
diff --git a/libdb/tcl/tcl_compat.c b/libdb/tcl/tcl_compat.c
index d2dda70..18dc39c 100644
--- a/libdb/tcl/tcl_compat.c
+++ b/libdb/tcl/tcl_compat.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #if CONFIG_TEST
@@ -31,15 +31,15 @@ static const char revid[] = "$Id$";
  * bdb_HCommand --
  *	Implements h* functions.
  *
- * PUBLIC: int bdb_HCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
+ * PUBLIC: gint bdb_HCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
  */
-int
+gint
 bdb_HCommand(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *hcmds[] = {
+	static gchar *hcmds[] = {
 		"hcreate",
 		"hdestroy",
 		"hsearch",
@@ -50,7 +50,7 @@ bdb_HCommand(interp, objc, objv)
 		HHDESTROY,
 		HHSEARCH
 	};
-	static char *srchacts[] = {
+	static gchar *srchacts[] = {
 		"enter",
 		"find",
 		NULL
@@ -61,7 +61,7 @@ bdb_HCommand(interp, objc, objv)
 	};
 	ENTRY item, *hres;
 	ACTION action;
-	int actindex, cmdindex, nelem, result, ret;
+	gint actindex, cmdindex, nelem, result, ret;
 	Tcl_Obj *res;
 
 	result = TCL_OK;
@@ -118,7 +118,7 @@ bdb_HCommand(interp, objc, objv)
 		if (hres == NULL)
 			Tcl_SetResult(interp, "-1", TCL_STATIC);
 		else if (action == FIND)
-			Tcl_SetResult(interp, (char *)hres->data, TCL_STATIC);
+			Tcl_SetResult(interp, (gchar *)hres->data, TCL_STATIC);
 		else
 			/* action is ENTER */
 			Tcl_SetResult(interp, "0", TCL_STATIC);
@@ -152,17 +152,17 @@ bdb_HCommand(interp, objc, objv)
  *	Opens an ndbm database.
  *
  * PUBLIC: #if DB_DBM_HSEARCH != 0
- * PUBLIC: int bdb_NdbmOpen __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBM **));
+ * PUBLIC: gint bdb_NdbmOpen __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBM **));
  * PUBLIC: #endif
  */
-int
+gint
 bdb_NdbmOpen(interp, objc, objv, dbpp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DBM **dbpp;			/* Dbm pointer */
 {
-	static char *ndbopen[] = {
+	static gchar *ndbopen[] = {
 		"-create",
 		"-mode",
 		"-rdonly",
@@ -179,8 +179,8 @@ bdb_NdbmOpen(interp, objc, objv, dbpp)
 	};
 
 	u_int32_t open_flags;
-	int endarg, i, mode, optindex, read_only, result, ret;
-	char *arg, *db;
+	gint endarg, i, mode, optindex, read_only, result, ret;
+	gchar *arg, *db;
 
 	result = TCL_OK;
 	open_flags = 0;
@@ -295,19 +295,19 @@ error:
  *	Implements "dbm" commands.
  *
  * PUBLIC: #if DB_DBM_HSEARCH != 0
- * PUBLIC: int bdb_DbmCommand
+ * PUBLIC: gint bdb_DbmCommand
  * PUBLIC:     __P((Tcl_Interp *, int, Tcl_Obj * CONST*, int, DBM *));
  * PUBLIC: #endif
  */
-int
+gint
 bdb_DbmCommand(interp, objc, objv, flag, dbm)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
-	int flag;			/* Which db interface */
+	gint flag;			/* Which db interface */
 	DBM *dbm;			/* DBM pointer */
 {
-	static char *dbmcmds[] = {
+	static gchar *dbmcmds[] = {
 		"dbmclose",
 		"dbminit",
 		"delete",
@@ -326,7 +326,7 @@ bdb_DbmCommand(interp, objc, objv, flag, dbm)
 		DBMNEXT,
 		DBMSTORE
 	};
-	static char *stflag[] = {
+	static gchar *stflag[] = {
 		"insert",	"replace",
 		NULL
 	};
@@ -334,10 +334,10 @@ bdb_DbmCommand(interp, objc, objv, flag, dbm)
 		STINSERT,	STREPLACE
 	};
 	datum key, data;
-	void *dtmp, *ktmp;
+	gpointer dtmp, *ktmp;
 	u_int32_t size;
-	int cmdindex, freedata, freekey, stindex, result, ret;
-	char *name, *t;
+	gint cmdindex, freedata, freekey, stindex, result, ret;
+	gchar *name, *t;
 
 	result = TCL_OK;
 	freekey = freedata = 0;
@@ -402,7 +402,7 @@ bdb_DbmCommand(interp, objc, objv, flag, dbm)
 			goto out;
 		}
 		key.dsize = size;
-		key.dptr = (char *)ktmp;
+		key.dptr = (gchar *)ktmp;
 		_debug_check();
 		if (flag == DBTCL_DBM)
 			data = fetch(key);
@@ -443,7 +443,7 @@ bdb_DbmCommand(interp, objc, objv, flag, dbm)
 			goto out;
 		}
 		key.dsize = size;
-		key.dptr = (char *)ktmp;
+		key.dptr = (gchar *)ktmp;
 		if ((ret = _CopyObjBytes(
 		    interp, objv[3], &dtmp, &size, &freedata)) != 0) {
 			result = _ReturnSetup(interp, ret,
@@ -451,7 +451,7 @@ bdb_DbmCommand(interp, objc, objv, flag, dbm)
 			goto out;
 		}
 		data.dsize = size;
-		data.dptr = (char *)dtmp;
+		data.dptr = (gchar *)dtmp;
 		_debug_check();
 		if (flag == DBTCL_DBM)
 			ret = store(key, data);
@@ -490,7 +490,7 @@ bdb_DbmCommand(interp, objc, objv, flag, dbm)
 			goto out;
 		}
 		key.dsize = size;
-		key.dptr = (char *)ktmp;
+		key.dptr = (gchar *)ktmp;
 		_debug_check();
 		if (flag == DBTCL_DBM)
 			ret = delete(key);
@@ -548,7 +548,7 @@ bdb_DbmCommand(interp, objc, objv, flag, dbm)
 				goto out;
 			}
 			key.dsize = size;
-			key.dptr = (char *)ktmp;
+			key.dptr = (gchar *)ktmp;
 			data = nextkey(key);
 		} else if (flag == DBTCL_NDBM) {
 			if (objc != 2) {
@@ -584,16 +584,16 @@ out:
  * ndbm_Cmd --
  *	Implements the "ndbm" widget.
  *
- * PUBLIC: int ndbm_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+ * PUBLIC: gint ndbm_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
  */
-int
+gint
 ndbm_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* DB handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *ndbcmds[] = {
+	static gchar *ndbcmds[] = {
 		"clearerr",
 		"close",
 		"delete",
@@ -623,11 +623,11 @@ ndbm_Cmd(clientData, interp, objc, objv)
 	DBM *dbp;
 	DBTCL_INFO *dbip;
 	Tcl_Obj *res;
-	int cmdindex, result, ret;
+	gint cmdindex, result, ret;
 
 	Tcl_ResetResult(interp);
 	dbp = (DBM *)clientData;
-	dbip = _PtrToInfo((void *)dbp);
+	dbip = _PtrToInfo((gpointer)dbp);
 	result = TCL_OK;
 	if (objc <= 1) {
 		Tcl_WrongNumArgs(interp, 1, objv, "command cmdargs");
diff --git a/libdb/tcl/tcl_db.c b/libdb/tcl/tcl_db.c
index 12344cd..b392913 100644
--- a/libdb/tcl/tcl_db.c
+++ b/libdb/tcl/tcl_db.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -78,19 +78,19 @@ _DbInfoDelete(interp, dbip)
 
 /*
  *
- * PUBLIC: int db_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+ * PUBLIC: gint db_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
  *
  * db_Cmd --
  *	Implements the "db" widget.
  */
-int
+gint
 db_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* DB handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *dbcmds[] = {
+	static gchar *dbcmds[] = {
 #if CONFIG_TEST
 		"keyrange",
 		"pget",
@@ -141,12 +141,12 @@ db_Cmd(clientData, interp, objc, objv)
 	DBTCL_INFO *ip;
 	DBTYPE type;
 	Tcl_Obj *res;
-	int cmdindex, isswapped, result, ret;
-	char newname[MSG_SIZE];
+	gint cmdindex, isswapped, result, ret;
+	gchar newname[MSG_SIZE];
 
 	Tcl_ResetResult(interp);
 	dbp = (DB *)clientData;
-	dbip = _PtrToInfo((void *)dbp);
+	dbip = _PtrToInfo((gpointer)dbp);
 	memset(newname, 0, MSG_SIZE);
 	result = TCL_OK;
 	if (objc <= 1) {
@@ -338,19 +338,19 @@ db_Cmd(clientData, interp, objc, objv)
 static int
 tcl_DbStat(interp, objc, objv, dbp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 {
 	DB_BTREE_STAT *bsp;
 	DB_HASH_STAT *hsp;
 	DB_QUEUE_STAT *qsp;
-	void *sp;
+	gpointer sp;
 	Tcl_Obj *res, *flaglist, *myobjv[2];
 	DBTYPE type;
 	u_int32_t flag;
-	int result, ret;
-	char *arg;
+	gint result, ret;
+	gchar *arg;
 
 	result = TCL_OK;
 	flag = 0;
@@ -482,12 +482,12 @@ error:
 static int
 tcl_DbClose(interp, objc, objv, dbp, dbip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 	DBTCL_INFO *dbip;		/* Info pointer */
 {
-	static char *dbclose[] = {
+	static gchar *dbclose[] = {
 		"-nosync", "--", NULL
 	};
 	enum dbclose {
@@ -495,8 +495,8 @@ tcl_DbClose(interp, objc, objv, dbp, dbip)
 		TCL_DBCLOSE_ENDARG
 	};
 	u_int32_t flag;
-	int endarg, i, optindex, result, ret;
-	char *arg;
+	gint endarg, i, optindex, result, ret;
+	gchar *arg;
 
 	result = TCL_OK;
 	endarg = 0;
@@ -552,11 +552,11 @@ tcl_DbClose(interp, objc, objv, dbp, dbip)
 static int
 tcl_DbPut(interp, objc, objv, dbp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 {
-	static char *dbputopts[] = {
+	static gchar *dbputopts[] = {
 #if CONFIG_TEST
 		"-nodupdata",
 #endif
@@ -577,7 +577,7 @@ tcl_DbPut(interp, objc, objv, dbp)
 		DBPUT_PART,
 		DBPUT_TXN
 	};
-	static char *dbputapp[] = {
+	static gchar *dbputapp[] = {
 		"-append",	NULL
 	};
 	enum dbputapp { DBPUT_APPEND0 };
@@ -585,12 +585,12 @@ tcl_DbPut(interp, objc, objv, dbp)
 	DBTYPE type;
 	DB_TXN *txn;
 	Tcl_Obj **elemv, *res;
-	void *dtmp, *ktmp;
+	gpointer dtmp, *ktmp;
 	db_recno_t recno;
 	u_int32_t flag;
-	int auto_commit, elemc, end, freekey, freedata;
-	int i, optindex, result, ret;
-	char *arg, msg[MSG_SIZE];
+	gint auto_commit, elemc, end, freekey, freedata;
+	gint i, optindex, result, ret;
+	gchar *arg, msg[MSG_SIZE];
 
 	txn = NULL;
 	result = TCL_OK;
@@ -775,12 +775,12 @@ out:
 static int
 tcl_DbGet(interp, objc, objv, dbp, ispget)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
-	int ispget;			/* 1 for pget, 0 for get */
+	gint ispget;			/* 1 for pget, 0 for get */
 {
-	static char *dbgetopts[] = {
+	static gchar *dbgetopts[] = {
 #if CONFIG_TEST
 		"-dirty",
 		"-multi",
@@ -816,11 +816,11 @@ tcl_DbGet(interp, objc, objv, dbp, ispget)
 	DBTYPE type;
 	DB_TXN *txn;
 	Tcl_Obj **elemv, *retlist;
-	void *dtmp, *ktmp;
+	gpointer dtmp, *ktmp;
 	u_int32_t flag, cflag, isdup, mflag, rmw;
-	int bufsize, elemc, end, endarg, freekey, freedata, i;
-	int optindex, result, ret, useglob, useprecno, userecno;
-	char *arg, *pattern, *prefix, msg[MSG_SIZE];
+	gint bufsize, elemc, end, endarg, freekey, freedata, i;
+	gint optindex, result, ret, useglob, useprecno, userecno;
+	gchar *arg, *pattern, *prefix, msg[MSG_SIZE];
 	db_recno_t precno, recno;
 
 	result = TCL_OK;
@@ -1365,11 +1365,11 @@ out:
 static int
 tcl_DbDelete(interp, objc, objv, dbp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 {
-	static char *dbdelopts[] = {
+	static gchar *dbdelopts[] = {
 		"-auto_commit",
 		"-glob",
 		"-txn",
@@ -1384,11 +1384,11 @@ tcl_DbDelete(interp, objc, objv, dbp)
 	DBT key, data;
 	DBTYPE type;
 	DB_TXN *txn;
-	void *ktmp;
+	gpointer ktmp;
 	db_recno_t recno;
-	int freekey, i, optindex, result, ret;
+	gint freekey, i, optindex, result, ret;
 	u_int32_t flag;
-	char *arg, *pattern, *prefix, msg[MSG_SIZE];
+	gchar *arg, *pattern, *prefix, msg[MSG_SIZE];
 
 	result = TCL_OK;
 	freekey = 0;
@@ -1617,12 +1617,12 @@ out:
 static int
 tcl_DbCursor(interp, objc, objv, dbp, dbcp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 	DBC **dbcp;			/* Return cursor pointer */
 {
-	static char *dbcuropts[] = {
+	static gchar *dbcuropts[] = {
 #if CONFIG_TEST
 		"-dirty",
 		"-update",
@@ -1639,8 +1639,8 @@ tcl_DbCursor(interp, objc, objv, dbp, dbcp)
 	};
 	DB_TXN *txn;
 	u_int32_t flag;
-	int i, optindex, result, ret;
-	char *arg, msg[MSG_SIZE];
+	gint i, optindex, result, ret;
+	gchar *arg, msg[MSG_SIZE];
 
 	result = TCL_OK;
 	flag = 0;
@@ -1699,11 +1699,11 @@ out:
 static int
 tcl_DbAssociate(interp, objc, objv, dbp)
 	Tcl_Interp *interp;
-	int objc;
+	gint objc;
 	Tcl_Obj *CONST objv[];
 	DB *dbp;
 {
-	static char *dbaopts[] = {
+	static gchar *dbaopts[] = {
 		"-auto_commit",
 		"-create",
 		"-txn",
@@ -1717,8 +1717,8 @@ tcl_DbAssociate(interp, objc, objv, dbp)
 	DB *sdbp;
 	DB_TXN *txn;
 	DBTCL_INFO *sdbip;
-	int i, optindex, result, ret;
-	char *arg, msg[MSG_SIZE];
+	gint i, optindex, result, ret;
+	gchar *arg, msg[MSG_SIZE];
 	u_int32_t flag;
 
 	txn = NULL;
@@ -1828,8 +1828,8 @@ tcl_second_call(dbp, pkey, data, skey)
 	DBTCL_INFO *ip;
 	Tcl_Interp *interp;
 	Tcl_Obj *pobj, *dobj, *objv[3];
-	int len, result, ret;
-	void *retbuf, *databuf;
+	gint len, result, ret;
+	gpointer retbuf, *databuf;
 
 	ip = (DBTCL_INFO *)dbp->api_internal;
 	interp = ip->i_interp;
@@ -1884,12 +1884,12 @@ tcl_second_call(dbp, pkey, data, skey)
 static int
 tcl_DbJoin(interp, objc, objv, dbp, dbcp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 	DBC **dbcp;			/* Cursor pointer */
 {
-	static char *dbjopts[] = {
+	static gchar *dbjopts[] = {
 		"-nosort",
 		NULL
 	};
@@ -1898,8 +1898,8 @@ tcl_DbJoin(interp, objc, objv, dbp, dbcp)
 	};
 	DBC **listp;
 	u_int32_t flag;
-	int adj, i, j, optindex, size, result, ret;
-	char *arg, msg[MSG_SIZE];
+	gint adj, i, j, optindex, size, result, ret;
+	gchar *arg, msg[MSG_SIZE];
 
 	result = TCL_OK;
 	flag = 0;
@@ -1968,11 +1968,11 @@ out:
 static int
 tcl_DbGetjoin(interp, objc, objv, dbp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 {
-	static char *dbgetjopts[] = {
+	static gchar *dbgetjopts[] = {
 #if CONFIG_TEST
 		"-nosort",
 #endif
@@ -1991,10 +1991,10 @@ tcl_DbGetjoin(interp, objc, objv, dbp)
 	DBC *dbc;
 	DBT key, data;
 	Tcl_Obj **elemv, *retlist;
-	void *ktmp;
+	gpointer ktmp;
 	u_int32_t flag;
-	int adj, elemc, freekey, i, j, optindex, result, ret, size;
-	char *arg, msg[MSG_SIZE];
+	gint adj, elemc, freekey, i, j, optindex, result, ret, size;
+	gchar *arg, msg[MSG_SIZE];
 
 	result = TCL_OK;
 	flag = 0;
@@ -2142,16 +2142,16 @@ out:
 static int
 tcl_DbCount(interp, objc, objv, dbp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 {
 	Tcl_Obj *res;
 	DBC *dbc;
 	DBT key, data;
-	void *ktmp;
+	gpointer ktmp;
 	db_recno_t count, recno;
-	int freekey, result, ret;
+	gint freekey, result, ret;
 
 	result = TCL_OK;
 	count = 0;
@@ -2230,11 +2230,11 @@ out:
 static int
 tcl_DbKeyRange(interp, objc, objv, dbp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 {
-	static char *dbkeyropts[] = {
+	static gchar *dbkeyropts[] = {
 		"-txn",
 		NULL
 	};
@@ -2246,11 +2246,11 @@ tcl_DbKeyRange(interp, objc, objv, dbp)
 	DBT key;
 	DBTYPE type;
 	Tcl_Obj *myobjv[3], *retlist;
-	void *ktmp;
+	gpointer ktmp;
 	db_recno_t recno;
 	u_int32_t flag;
-	int freekey, i, myobjc, optindex, result, ret;
-	char *arg, msg[MSG_SIZE];
+	gint freekey, i, myobjc, optindex, result, ret;
+	gchar *arg, msg[MSG_SIZE];
 
 	result = TCL_OK;
 	flag = 0;
@@ -2350,11 +2350,11 @@ out:
 static int
 tcl_DbTruncate(interp, objc, objv, dbp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB *dbp;			/* Database pointer */
 {
-	static char *dbcuropts[] = {
+	static gchar *dbcuropts[] = {
 		"-auto_commit",
 		"-txn",
 		NULL
@@ -2366,8 +2366,8 @@ tcl_DbTruncate(interp, objc, objv, dbp)
 	DB_TXN *txn;
 	Tcl_Obj *res;
 	u_int32_t count, flag;
-	int i, optindex, result, ret;
-	char *arg, msg[MSG_SIZE];
+	gint i, optindex, result, ret;
+	gchar *arg, msg[MSG_SIZE];
 
 	txn = NULL;
 	flag = 0;
diff --git a/libdb/tcl/tcl_db_pkg.c b/libdb/tcl/tcl_db_pkg.c
index 96bf184..07ba2ec 100644
--- a/libdb/tcl/tcl_db_pkg.c
+++ b/libdb/tcl/tcl_db_pkg.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -49,16 +49,16 @@ static int	bdb_Handles __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
 
 static int	tcl_bt_compare __P((DB *, const DBT *, const DBT *));
 static int	tcl_compare_callback __P((DB *, const DBT *, const DBT *,
-    Tcl_Obj *, char *));
+    Tcl_Obj *, gchar *));
 static int	tcl_dup_compare __P((DB *, const DBT *, const DBT *));
-static u_int32_t tcl_h_hash __P((DB *, const void *, u_int32_t));
+static u_int32_t tcl_h_hash __P((DB *, gconstpointer , u_int32_t));
 static int	tcl_rep_send __P((DB_ENV *,
     const DBT *, const DBT *, int, u_int32_t));
 
 #ifdef TEST_ALLOC
-static void *	tcl_db_malloc __P((size_t));
-static void *	tcl_db_realloc __P((void *, size_t));
-static void	tcl_db_free __P((void *));
+static gpointer 	tcl_db_malloc __P((size_t));
+static gpointer 	tcl_db_realloc __P((gpointer , size_t));
+static void	tcl_db_free __P((gpointer));
 #endif
 
 /*
@@ -69,12 +69,12 @@ static void	tcl_db_free __P((void *));
  * name of the shared library, currently libdb_tcl-X.Y.so, which Tcl uses
  * to determine the name of this function.
  */
-int
+gint
 Db_tcl_Init(interp)
 	Tcl_Interp *interp;		/* Interpreter in which the package is
 					 * to be made available. */
 {
-	int code;
+	gint code;
 
 	code = Tcl_PkgProvide(interp, "Db_tcl", "1.0");
 	if (code != TCL_OK)
@@ -85,12 +85,12 @@ Db_tcl_Init(interp)
 	/*
 	 * Create shared global debugging variables
 	 */
-	Tcl_LinkVar(interp, "__debug_on", (char *)&__debug_on, TCL_LINK_INT);
-	Tcl_LinkVar(interp, "__debug_print", (char *)&__debug_print,
+	Tcl_LinkVar(interp, "__debug_on", (gchar *)&__debug_on, TCL_LINK_INT);
+	Tcl_LinkVar(interp, "__debug_print", (gchar *)&__debug_print,
 	    TCL_LINK_INT);
-	Tcl_LinkVar(interp, "__debug_stop", (char *)&__debug_stop,
+	Tcl_LinkVar(interp, "__debug_stop", (gchar *)&__debug_stop,
 	    TCL_LINK_INT);
-	Tcl_LinkVar(interp, "__debug_test", (char *)&__debug_test,
+	Tcl_LinkVar(interp, "__debug_test", (gchar *)&__debug_test,
 	    TCL_LINK_INT);
 	LIST_INIT(&__db_infohead);
 	return (TCL_OK);
@@ -113,10 +113,10 @@ static int
 berkdb_Cmd(notused, interp, objc, objv)
 	ClientData notused;		/* Not used. */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *berkdbcmds[] = {
+	static gchar *berkdbcmds[] = {
 #if CONFIG_TEST
 		"dbverify",
 		"handles",
@@ -164,19 +164,19 @@ berkdb_Cmd(notused, interp, objc, objv)
 		BDB_RANDX,	BDB_RAND_INTX,	BDB_SRANDX,
 		BDB_DBGCKX
 	};
-	static int env_id = 0;
-	static int db_id = 0;
+	static gint env_id = 0;
+	static gint db_id = 0;
 
 	DB *dbp;
 #if CONFIG_TEST
 	DBM *ndbmp;
-	static int ndbm_id = 0;
+	static gint ndbm_id = 0;
 #endif
 	DBTCL_INFO *ip;
 	DB_ENV *envp;
 	Tcl_Obj *res;
-	int cmdindex, result;
-	char newname[MSG_SIZE];
+	gint cmdindex, result;
+	gchar newname[MSG_SIZE];
 
 	COMPQUIET(notused, NULL);
 
@@ -337,12 +337,12 @@ berkdb_Cmd(notused, interp, objc, objv)
 static int
 bdb_EnvOpen(interp, objc, objv, ip, env)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DBTCL_INFO *ip;			/* Our internal info */
 	DB_ENV **env;			/* Environment pointer */
 {
-	static char *envopen[] = {
+	static gchar *envopen[] = {
 #if CONFIG_TEST
 		"-auto_commit",
 		"-cdb",
@@ -461,10 +461,10 @@ bdb_EnvOpen(interp, objc, objv, ip, env)
 	u_int32_t detect, gbytes, bytes, ncaches, logbufset, logmaxset;
 	u_int32_t open_flags, rep_flags, set_flags, size, uintarg;
 	u_int8_t *conflicts;
-	int i, intarg, j, mode, myobjc, nmodes, optindex;
-	int result, ret, temp;
+	gint i, intarg, j, mode, myobjc, nmodes, optindex;
+	gint result, ret, temp;
 	long client_to, server_to, shm;
-	char *arg, *home, *passwd, *server;
+	gchar *arg, *home, *passwd, *server;
 
 	result = TCL_OK;
 	mode = 0;
@@ -1252,18 +1252,18 @@ error:	if (result == TCL_ERROR) {
 static int
 bdb_DbOpen(interp, objc, objv, ip, dbp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DBTCL_INFO *ip;			/* Our internal info */
 	DB **dbp;			/* DB handle */
 {
-	static char *bdbenvopen[] = {
+	static gchar *bdbenvopen[] = {
 		"-env",	NULL
 	};
 	enum bdbenvopen {
 		TCL_DB_ENV0
 	};
-	static char *bdbopen[] = {
+	static gchar *bdbopen[] = {
 #if CONFIG_TEST
 		"-btcompare",
 		"-dirty",
@@ -1365,10 +1365,10 @@ bdb_DbOpen(interp, objc, objv, ip, dbp)
 	DB_ENV *envp;
 	Tcl_Obj **myobjv;
 	u_int32_t gbytes, bytes, ncaches, open_flags, uintarg;
-	int endarg, i, intarg, mode, myobjc;
-	int optindex, result, ret, set_err, set_flags, set_pfx, subdblen;
+	gint endarg, i, intarg, mode, myobjc;
+	gint optindex, result, ret, set_err, set_flags, set_pfx, subdblen;
 	u_char *subdbtmp;
-	char *arg, *db, *passwd, *subdb, msg[MSG_SIZE];
+	gchar *arg, *db, *passwd, *subdb, msg[MSG_SIZE];
 
 	type = DB_UNKNOWN;
 	endarg = mode = set_err = set_flags = set_pfx = 0;
@@ -2019,10 +2019,10 @@ error:
 static int
 bdb_DbRemove(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *bdbrem[] = {
+	static gchar *bdbrem[] = {
 		"-auto_commit",
 		"-encrypt",
 		"-encryptaes",
@@ -2044,10 +2044,10 @@ bdb_DbRemove(interp, objc, objv)
 	DB *dbp;
 	DB_ENV *envp;
 	DB_TXN *txn;
-	int endarg, i, optindex, result, ret, subdblen;
+	gint endarg, i, optindex, result, ret, subdblen;
 	u_int32_t enc_flag, iflags, set_flags;
 	u_char *subdbtmp;
-	char *arg, *db, msg[MSG_SIZE], *passwd, *subdb;
+	gchar *arg, *db, msg[MSG_SIZE], *passwd, *subdb;
 
 	db = subdb = NULL;
 	dbp = NULL;
@@ -2225,10 +2225,10 @@ error:
 static int
 bdb_DbRename(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *bdbmv[] = {
+	static gchar *bdbmv[] = {
 		"-auto_commit",
 		"-encrypt",
 		"-encryptaes",
@@ -2251,9 +2251,9 @@ bdb_DbRename(interp, objc, objv)
 	DB_ENV *envp;
 	DB_TXN *txn;
 	u_int32_t enc_flag, iflags, set_flags;
-	int endarg, i, newlen, optindex, result, ret, subdblen;
+	gint endarg, i, newlen, optindex, result, ret, subdblen;
 	u_char *subdbtmp;
-	char *arg, *db, msg[MSG_SIZE], *newname, *passwd, *subdb;
+	gchar *arg, *db, msg[MSG_SIZE], *newname, *passwd, *subdb;
 
 	db = newname = subdb = NULL;
 	dbp = NULL;
@@ -2444,10 +2444,10 @@ error:
 static int
 bdb_DbVerify(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *bdbverify[] = {
+	static gchar *bdbverify[] = {
 		"-encrypt",
 		"-encryptaes",
 		"-encryptany",
@@ -2470,8 +2470,8 @@ bdb_DbVerify(interp, objc, objv)
 	DB *dbp;
 	FILE *errf;
 	u_int32_t enc_flag, flags, set_flags;
-	int endarg, i, optindex, result, ret;
-	char *arg, *db, *errpfx, *passwd;
+	gint endarg, i, optindex, result, ret;
+	gchar *arg, *db, *errpfx, *passwd;
 
 	envp = NULL;
 	dbp = NULL;
@@ -2644,17 +2644,17 @@ error:
 static int
 bdb_Version(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *bdbver[] = {
+	static gchar *bdbver[] = {
 		"-string", NULL
 	};
 	enum bdbver {
 		TCL_VERSTRING
 	};
-	int i, optindex, maj, min, patch, result, string, verobjc;
-	char *arg, *v;
+	gint i, optindex, maj, min, patch, result, string, verobjc;
+	gchar *arg, *v;
 	Tcl_Obj *res, *verobjv[3];
 
 	result = TCL_OK;
@@ -2720,7 +2720,7 @@ error:
 static int
 bdb_Handles(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
 	DBTCL_INFO *p;
@@ -2754,10 +2754,10 @@ bdb_Handles(interp, objc, objv)
 static int
 bdb_DbUpgrade(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *bdbupg[] = {
+	static gchar *bdbupg[] = {
 		"-dupsort", "-env", "--", NULL
 	};
 	enum bdbupg {
@@ -2768,8 +2768,8 @@ bdb_DbUpgrade(interp, objc, objv)
 	DB_ENV *envp;
 	DB *dbp;
 	u_int32_t flags;
-	int endarg, i, optindex, result, ret;
-	char *arg, *db;
+	gint endarg, i, optindex, result, ret;
+	gchar *arg, *db;
 
 	envp = NULL;
 	dbp = NULL;
@@ -2886,12 +2886,12 @@ tcl_compare_callback(dbp, dbta, dbtb, procobj, errname)
 	DB *dbp;
 	const DBT *dbta, *dbtb;
 	Tcl_Obj *procobj;
-	char *errname;
+	gchar *errname;
 {
 	DBTCL_INFO *ip;
 	Tcl_Interp *interp;
 	Tcl_Obj *a, *b, *resobj, *objv[3];
-	int result, cmp;
+	gint result, cmp;
 
 	ip = (DBTCL_INFO *)dbp->api_internal;
 	interp = ip->i_interp;
@@ -2951,13 +2951,13 @@ panic:		__db_err(dbp->dbenv, "Tcl %s callback failed", errname);
 static u_int32_t
 tcl_h_hash(dbp, buf, len)
 	DB *dbp;
-	const void *buf;
+	gconstpointer buf;
 	u_int32_t len;
 {
 	DBTCL_INFO *ip;
 	Tcl_Interp *interp;
 	Tcl_Obj *objv[2];
-	int result, hval;
+	gint result, hval;
 
 	ip = (DBTCL_INFO *)dbp->api_internal;
 	interp = ip->i_interp;
@@ -2966,7 +2966,7 @@ tcl_h_hash(dbp, buf, len)
 	/*
 	 * Create a ByteArray for the buffer.
 	 */
-	objv[1] = Tcl_NewByteArrayObj((void *)buf, len);
+	objv[1] = Tcl_NewByteArrayObj((gpointer)buf, len);
 	Tcl_IncrRefCount(objv[1]);
 	result = Tcl_EvalObjv(interp, 2, objv, 0);
 	if (result != TCL_OK) {
@@ -2996,13 +2996,13 @@ static int
 tcl_rep_send(dbenv, control, rec, eid, flags)
 	DB_ENV *dbenv;
 	const DBT *control, *rec;
-	int eid;
+	gint eid;
 	u_int32_t flags;
 {
 	DBTCL_INFO *ip;
 	Tcl_Interp *interp;
 	Tcl_Obj *control_o, *eid_o, *origobj, *rec_o, *resobj, *objv[5];
-	int result, ret;
+	gint result, ret;
 
 	COMPQUIET(flags, 0);
 
@@ -3065,12 +3065,12 @@ err:		__db_err(dbenv, "Tcl rep_send failure");
  * to exercise umalloc/urealloc/ufree.  Allocate the memory as a Tcl object
  * so we're sure to exacerbate and catch any shared-library issues.
  */
-static void *
+static gpointer
 tcl_db_malloc(size)
 	size_t size;
 {
 	Tcl_Obj *obj;
-	void *buf;
+	gpointer buf;
 
 	obj = Tcl_NewObj();
 	if (obj == NULL)
@@ -3085,9 +3085,9 @@ tcl_db_malloc(size)
 	return (buf);
 }
 
-static void *
+static gpointer
 tcl_db_realloc(ptr, size)
-	void *ptr;
+	gpointer ptr;
 	size_t size;
 {
 	Tcl_Obj *obj;
@@ -3107,7 +3107,7 @@ tcl_db_realloc(ptr, size)
 
 static void
 tcl_db_free(ptr)
-	void *ptr;
+	gpointer ptr;
 {
 	Tcl_Obj *obj;
 
diff --git a/libdb/tcl/tcl_dbcursor.c b/libdb/tcl/tcl_dbcursor.c
index c698892..2d595eb 100644
--- a/libdb/tcl/tcl_dbcursor.c
+++ b/libdb/tcl/tcl_dbcursor.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,24 +25,24 @@ static const char revid[] = "$Id$";
 /*
  * Prototypes for procedures defined later in this file:
  */
-static int tcl_DbcDup __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBC *));
-static int tcl_DbcGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBC *, int));
-static int tcl_DbcPut __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBC *));
+static gint tcl_DbcDup __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBC *));
+static gint tcl_DbcGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBC *, int));
+static gint tcl_DbcPut __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DBC *));
 
 /*
- * PUBLIC: int dbc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+ * PUBLIC: gint dbc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
  *
  * dbc_cmd --
  *	Implements the cursor command.
  */
-int
+gint
 dbc_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* Cursor handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *dbccmds[] = {
+	static gchar *dbccmds[] = {
 #if CONFIG_TEST
 		"pget",
 #endif
@@ -65,11 +65,11 @@ dbc_Cmd(clientData, interp, objc, objv)
 	};
 	DBC *dbc;
 	DBTCL_INFO *dbip;
-	int cmdindex, result, ret;
+	gint cmdindex, result, ret;
 
 	Tcl_ResetResult(interp);
 	dbc = (DBC *)clientData;
-	dbip = _PtrToInfo((void *)dbc);
+	dbip = _PtrToInfo((gpointer)dbc);
 	result = TCL_OK;
 
 	if (objc <= 1) {
@@ -147,11 +147,11 @@ dbc_Cmd(clientData, interp, objc, objv)
 static int
 tcl_DbcPut(interp, objc, objv, dbc)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DBC *dbc;			/* Cursor pointer */
 {
-	static char *dbcutopts[] = {
+	static gchar *dbcutopts[] = {
 #if CONFIG_TEST
 		"-nodupdata",
 #endif
@@ -179,10 +179,10 @@ tcl_DbcPut(interp, objc, objv, dbc)
 	DBTCL_INFO *dbcip, *dbip;
 	DBTYPE type;
 	Tcl_Obj **elemv, *res;
-	void *dtmp, *ktmp;
+	gpointer dtmp, *ktmp;
 	db_recno_t recno;
 	u_int32_t flag;
-	int elemc, freekey, freedata, i, optindex, result, ret;
+	gint elemc, freekey, freedata, i, optindex, result, ret;
 
 	result = TCL_OK;
 	flag = 0;
@@ -375,12 +375,12 @@ out:
 static int
 tcl_DbcGet(interp, objc, objv, dbc, ispget)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DBC *dbc;			/* Cursor pointer */
-	int ispget;			/* 1 for pget, 0 for get */
+	gint ispget;			/* 1 for pget, 0 for get */
 {
-	static char *dbcgetopts[] = {
+	static gchar *dbcgetopts[] = {
 #if CONFIG_TEST
 		"-dirty",
 		"-get_both_range",
@@ -434,10 +434,10 @@ tcl_DbcGet(interp, objc, objv, dbc, ispget)
 	DBTCL_INFO *dbcip, *dbip;
 	DBTYPE ptype, type;
 	Tcl_Obj **elemv, *myobj, *retlist;
-	void *dtmp, *ktmp;
+	gpointer dtmp, *ktmp;
 	db_recno_t precno, recno;
 	u_int32_t flag, op;
-	int bufsize, elemc, freekey, freedata, i, optindex, result, ret;
+	gint bufsize, elemc, freekey, freedata, i, optindex, result, ret;
 
 	result = TCL_OK;
 	flag = 0;
@@ -812,11 +812,11 @@ out:
 static int
 tcl_DbcDup(interp, objc, objv, dbc)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DBC *dbc;			/* Cursor pointer */
 {
-	static char *dbcdupopts[] = {
+	static gchar *dbcdupopts[] = {
 		"-position",
 		NULL
 	};
@@ -827,8 +827,8 @@ tcl_DbcDup(interp, objc, objv, dbc)
 	DBTCL_INFO *dbcip, *newdbcip, *dbip;
 	Tcl_Obj *res;
 	u_int32_t flag;
-	int i, optindex, result, ret;
-	char newname[MSG_SIZE];
+	gint i, optindex, result, ret;
+	gchar newname[MSG_SIZE];
 
 	result = TCL_OK;
 	flag = 0;
diff --git a/libdb/tcl/tcl_env.c b/libdb/tcl/tcl_env.c
index f720079..da4d3b3 100644
--- a/libdb/tcl/tcl_env.c
+++ b/libdb/tcl/tcl_env.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,23 +26,23 @@ static const char revid[] = "$Id$";
  * Prototypes for procedures defined later in this file:
  */
 static void _EnvInfoDelete __P((Tcl_Interp *, DBTCL_INFO *));
-static int  env_DbRemove __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
-static int  env_DbRename __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+static gint  env_DbRemove __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+static gint  env_DbRename __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
 
 /*
- * PUBLIC: int env_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+ * PUBLIC: gint env_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
  *
  * env_Cmd --
  *	Implements the "env" command.
  */
-int
+gint
 env_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* Env handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *envcmds[] = {
+	static gchar *envcmds[] = {
 #if CONFIG_TEST
 		"attributes",
 		"lock_detect",
@@ -137,8 +137,8 @@ env_Cmd(clientData, interp, objc, objv)
 	DB_ENV *dbenv;
 	DB_LOGC *logc;
 	Tcl_Obj *res;
-	char newname[MSG_SIZE];
-	int cmdindex, result, ret;
+	gchar newname[MSG_SIZE];
+	gint cmdindex, result, ret;
 	u_int32_t newval;
 #if CONFIG_TEST
 	u_int32_t otherval;
@@ -146,7 +146,7 @@ env_Cmd(clientData, interp, objc, objv)
 
 	Tcl_ResetResult(interp);
 	dbenv = (DB_ENV *)clientData;
-	envip = _PtrToInfo((void *)dbenv);
+	envip = _PtrToInfo((gpointer)dbenv);
 	result = TCL_OK;
 	memset(newname, 0, MSG_SIZE);
 
@@ -419,20 +419,20 @@ env_Cmd(clientData, interp, objc, objv)
 }
 
 /*
- * PUBLIC: int tcl_EnvRemove __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
+ * PUBLIC: gint tcl_EnvRemove __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
  * PUBLIC:      DB_ENV *, DBTCL_INFO *));
  *
  * tcl_EnvRemove --
  */
-int
+gint
 tcl_EnvRemove(interp, objc, objv, dbenv, envip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;			/* Env pointer */
 	DBTCL_INFO *envip;		/* Info pointer */
 {
-	static char *envremopts[] = {
+	static gchar *envremopts[] = {
 #if CONFIG_TEST
 		"-overwrite",
 		"-server",
@@ -465,8 +465,8 @@ tcl_EnvRemove(interp, objc, objv, dbenv, envip)
 	};
 	DB_ENV *e;
 	u_int32_t cflag, enc_flag, flag, forceflag, sflag;
-	int i, optindex, result, ret;
-	char *datadir, *home, *logdir, *passwd, *server, *tmpdir;
+	gint i, optindex, result, ret;
+	gchar *datadir, *home, *logdir, *passwd, *server, *tmpdir;
 
 	result = TCL_OK;
 	cflag = flag = forceflag = sflag = 0;
@@ -716,19 +716,19 @@ _EnvInfoDelete(interp, envip)
 
 #if CONFIG_TEST
 /*
- * PUBLIC: int tcl_EnvVerbose __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *,
+ * PUBLIC: gint tcl_EnvVerbose __P((Tcl_Interp *, DB_ENV *, Tcl_Obj *,
  * PUBLIC:    Tcl_Obj *));
  *
  * tcl_EnvVerbose --
  */
-int
+gint
 tcl_EnvVerbose(interp, dbenv, which, onoff)
 	Tcl_Interp *interp;		/* Interpreter */
 	DB_ENV *dbenv;			/* Env pointer */
 	Tcl_Obj *which;			/* Which subsystem */
 	Tcl_Obj *onoff;			/* On or off */
 {
-	static char *verbwhich[] = {
+	static gchar *verbwhich[] = {
 		"chkpt",
 		"deadlock",
 		"recovery",
@@ -743,7 +743,7 @@ tcl_EnvVerbose(interp, dbenv, which, onoff)
 		ENVVERB_REP,
 		ENVVERB_WAIT
 	};
-	static char *verbonoff[] = {
+	static gchar *verbonoff[] = {
 		"off",
 		"on",
 		NULL
@@ -752,7 +752,7 @@ tcl_EnvVerbose(interp, dbenv, which, onoff)
 		ENVVERB_OFF,
 		ENVVERB_ON
 	};
-	int on, optindex, ret;
+	gint on, optindex, ret;
 	u_int32_t wh;
 
 	if (Tcl_GetIndexFromObj(interp, which, verbwhich, "option",
@@ -799,19 +799,19 @@ tcl_EnvVerbose(interp, dbenv, which, onoff)
 
 #if	CONFIG_TEST
 /*
- * PUBLIC: int tcl_EnvAttr __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+ * PUBLIC: gint tcl_EnvAttr __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
  *
  * tcl_EnvAttr --
  *	Return a list of the env's attributes
  */
-int
+gint
 tcl_EnvAttr(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;			/* Env pointer */
 {
-	int result;
+	gint result;
 	Tcl_Obj *myobj, *retlist;
 
 	result = TCL_OK;
@@ -882,18 +882,18 @@ err:
 }
 
 /*
- * PUBLIC: int tcl_EnvTest __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+ * PUBLIC: gint tcl_EnvTest __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
  *
  * tcl_EnvTest --
  */
-int
+gint
 tcl_EnvTest(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;			/* Env pointer */
 {
-	static char *envtestcmd[] = {
+	static gchar *envtestcmd[] = {
 		"abort",
 		"copy",
 		NULL
@@ -902,7 +902,7 @@ tcl_EnvTest(interp, objc, objv, dbenv)
 		ENVTEST_ABORT,
 		ENVTEST_COPY
 	};
-	static char *envtestat[] = {
+	static gchar *envtestat[] = {
 		"electinit",
 		"electsend",
 		"electvote1",
@@ -937,7 +937,7 @@ tcl_EnvTest(interp, objc, objv, dbenv)
 		ENVTEST_POSTSYNC,
 		ENVTEST_SUBDB_LOCKS
 	};
-	int *loc, optindex, result, testval;
+	gint *loc, optindex, result, testval;
 
 	result = TCL_OK;
 	loc = NULL;
@@ -1046,11 +1046,11 @@ tcl_EnvTest(interp, objc, objv, dbenv)
 static int
 env_DbRemove(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;
 {
-	static char *envdbrem[] = {
+	static gchar *envdbrem[] = {
 		"-auto_commit",
 		"-txn",
 		"--",
@@ -1063,9 +1063,9 @@ env_DbRemove(interp, objc, objv, dbenv)
 	};
 	DB_TXN *txn;
 	u_int32_t flag;
-	int endarg, i, optindex, result, ret, subdblen;
+	gint endarg, i, optindex, result, ret, subdblen;
 	u_char *subdbtmp;
-	char *arg, *db, *subdb, msg[MSG_SIZE];
+	gchar *arg, *db, *subdb, msg[MSG_SIZE];
 
 	txn = NULL;
 	result = TCL_OK;
@@ -1174,11 +1174,11 @@ error:
 static int
 env_DbRename(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;
 {
-	static char *envdbmv[] = {
+	static gchar *envdbmv[] = {
 		"-auto_commit",
 		"-txn",
 		"--",
@@ -1191,9 +1191,9 @@ env_DbRename(interp, objc, objv, dbenv)
 	};
 	DB_TXN *txn;
 	u_int32_t flag;
-	int endarg, i, newlen, optindex, result, ret, subdblen;
+	gint endarg, i, newlen, optindex, result, ret, subdblen;
 	u_char *subdbtmp;
-	char *arg, *db, *newname, *subdb, msg[MSG_SIZE];
+	gchar *arg, *db, *newname, *subdb, msg[MSG_SIZE];
 
 	txn = NULL;
 	result = TCL_OK;
diff --git a/libdb/tcl/tcl_internal.c b/libdb/tcl/tcl_internal.c
index ffe9b8a..dcc6fbe 100644
--- a/libdb/tcl/tcl_internal.c
+++ b/libdb/tcl/tcl_internal.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -46,11 +46,11 @@ static const char revid[] = "$Id$";
 /*
  * Prototypes for procedures defined later in this file:
  */
-static void tcl_flag_callback __P((u_int32_t, const FN *, void *));
+static void tcl_flag_callback __P((u_int32_t, const FN *, gpointer ));
 
 /*
  * Private structure type used to pass both an interp and an object into
- * a callback's single void *.
+ * a callback's single gpointer .
  */
 struct __tcl_callback_bundle {
 	Tcl_Interp *interp;
@@ -61,7 +61,7 @@ struct __tcl_callback_bundle {
 
 /*
  * PUBLIC: DBTCL_INFO *_NewInfo __P((Tcl_Interp *,
- * PUBLIC:    void *, char *, enum INFOTYPE));
+ * PUBLIC:    gpointer , gchar *, enum INFOTYPE));
  *
  * _NewInfo --
  *
@@ -71,12 +71,12 @@ struct __tcl_callback_bundle {
 DBTCL_INFO *
 _NewInfo(interp, anyp, name, type)
 	Tcl_Interp *interp;
-	void *anyp;
-	char *name;
+	gpointer anyp;
+	gchar *name;
 	enum INFOTYPE type;
 {
 	DBTCL_INFO *p;
-	int i, ret;
+	gint i, ret;
 
 	if ((ret = __os_malloc(NULL, sizeof(DBTCL_INFO), &p)) != 0) {
 		Tcl_SetResult(interp, db_strerror(ret), TCL_STATIC);
@@ -111,11 +111,11 @@ _NewInfo(interp, anyp, name, type)
 }
 
 /*
- * PUBLIC: void *_NameToPtr __P((CONST char *));
+ * PUBLIC: gpointer _NameToPtr __P((CONST gchar *));
  */
 void	*
 _NameToPtr(name)
-	CONST char *name;
+	CONST gchar *name;
 {
 	DBTCL_INFO *p;
 
@@ -127,11 +127,11 @@ _NameToPtr(name)
 }
 
 /*
- * PUBLIC: DBTCL_INFO *_PtrToInfo __P((CONST void *));
+ * PUBLIC: DBTCL_INFO *_PtrToInfo __P((CONST gpointer ));
  */
 DBTCL_INFO *
 _PtrToInfo(ptr)
-	CONST void *ptr;
+	CONST gpointer ptr;
 {
 	DBTCL_INFO *p;
 
@@ -143,11 +143,11 @@ _PtrToInfo(ptr)
 }
 
 /*
- * PUBLIC: DBTCL_INFO *_NameToInfo __P((CONST char *));
+ * PUBLIC: DBTCL_INFO *_NameToInfo __P((CONST gchar *));
  */
 DBTCL_INFO *
 _NameToInfo(name)
-	CONST char *name;
+	CONST gchar *name;
 {
 	DBTCL_INFO *p;
 
@@ -159,12 +159,12 @@ _NameToInfo(name)
 }
 
 /*
- * PUBLIC: void  _SetInfoData __P((DBTCL_INFO *, void *));
+ * PUBLIC: void  _SetInfoData __P((DBTCL_INFO *, gpointer ));
  */
 void
 _SetInfoData(p, data)
 	DBTCL_INFO *p;
-	void *data;
+	gpointer data;
 {
 	if (p == NULL)
 		return;
@@ -209,18 +209,18 @@ _DeleteInfo(p)
 }
 
 /*
- * PUBLIC: int _SetListElem __P((Tcl_Interp *,
- * PUBLIC:    Tcl_Obj *, void *, int, void *, int));
+ * PUBLIC: gint _SetListElem __P((Tcl_Interp *,
+ * PUBLIC:    Tcl_Obj *, gpointer , int, gpointer , int));
  */
-int
+gint
 _SetListElem(interp, list, elem1, e1cnt, elem2, e2cnt)
 	Tcl_Interp *interp;
 	Tcl_Obj *list;
-	void *elem1, *elem2;
-	int e1cnt, e2cnt;
+	gpointer elem1, *elem2;
+	gint e1cnt, e2cnt;
 {
 	Tcl_Obj *myobjv[2], *thislist;
-	int myobjc;
+	gint myobjc;
 
 	myobjc = 2;
 	myobjv[0] = Tcl_NewByteArrayObj((u_char *)elem1, e1cnt);
@@ -233,20 +233,20 @@ _SetListElem(interp, list, elem1, e1cnt, elem2, e2cnt)
 }
 
 /*
- * PUBLIC: int _SetListElemInt __P((Tcl_Interp *, Tcl_Obj *, void *, int));
+ * PUBLIC: gint _SetListElemInt __P((Tcl_Interp *, Tcl_Obj *, gpointer , int));
  */
-int
+gint
 _SetListElemInt(interp, list, elem1, elem2)
 	Tcl_Interp *interp;
 	Tcl_Obj *list;
-	void *elem1;
-	int elem2;
+	gpointer elem1;
+	gint elem2;
 {
 	Tcl_Obj *myobjv[2], *thislist;
-	int myobjc;
+	gint myobjc;
 
 	myobjc = 2;
-	myobjv[0] = Tcl_NewByteArrayObj((u_char *)elem1, strlen((char *)elem1));
+	myobjv[0] = Tcl_NewByteArrayObj((u_char *)elem1, strlen((gchar *)elem1));
 	myobjv[1] = Tcl_NewIntObj(elem2);
 	thislist = Tcl_NewListObj(myobjc, myobjv);
 	if (thislist == NULL)
@@ -255,19 +255,19 @@ _SetListElemInt(interp, list, elem1, elem2)
 }
 
 /*
- * PUBLIC: int _SetListRecnoElem __P((Tcl_Interp *, Tcl_Obj *,
+ * PUBLIC: gint _SetListRecnoElem __P((Tcl_Interp *, Tcl_Obj *,
  * PUBLIC:     db_recno_t, u_char *, int));
  */
-int
+gint
 _SetListRecnoElem(interp, list, elem1, elem2, e2size)
 	Tcl_Interp *interp;
 	Tcl_Obj *list;
 	db_recno_t elem1;
 	u_char *elem2;
-	int e2size;
+	gint e2size;
 {
 	Tcl_Obj *myobjv[2], *thislist;
-	int myobjc;
+	gint myobjc;
 
 	myobjc = 2;
 	myobjv[0] = Tcl_NewLongObj((long)elem1);
@@ -292,15 +292,15 @@ _SetListRecnoElem(interp, list, elem1, elem2, e2size)
  *	to eliminate redundancy and bring them into the standard DB
  *	function namespace.
  *
- * PUBLIC: int _Set3DBTList __P((Tcl_Interp *, Tcl_Obj *, DBT *, int,
+ * PUBLIC: gint _Set3DBTList __P((Tcl_Interp *, Tcl_Obj *, DBT *, int,
  * PUBLIC:     DBT *, int, DBT *));
  */
-int
+gint
 _Set3DBTList(interp, list, elem1, is1recno, elem2, is2recno, elem3)
 	Tcl_Interp *interp;
 	Tcl_Obj *list;
 	DBT *elem1, *elem2, *elem3;
-	int is1recno, is2recno;
+	gint is1recno, is2recno;
 {
 
 	Tcl_Obj *myobjv[3], *thislist;
@@ -329,20 +329,20 @@ _Set3DBTList(interp, list, elem1, is1recno, elem2, is2recno, elem3)
 /*
  * _SetMultiList -- build a list for return from multiple get.
  *
- * PUBLIC: int _SetMultiList __P((Tcl_Interp *,
+ * PUBLIC: gint _SetMultiList __P((Tcl_Interp *,
  * PUBLIC:	    Tcl_Obj *, DBT *, DBT*, int, int));
  */
-int
+gint
 _SetMultiList(interp, list, key, data, type, flag)
 	Tcl_Interp *interp;
 	Tcl_Obj *list;
 	DBT *key, *data;
-	int type, flag;
+	gint type, flag;
 {
 	db_recno_t recno;
 	u_int32_t dlen, klen;
-	int result;
-	void *pointer, *dp, *kp;
+	gint result;
+	gpointer pointer, *dp, *kp;
 
 	recno = 0;
 	dlen = 0;
@@ -381,15 +381,15 @@ _SetMultiList(interp, list, key, data, type, flag)
 	return (result);
 }
 /*
- * PUBLIC: int _GetGlobPrefix __P((char *, char **));
+ * PUBLIC: gint _GetGlobPrefix __P((gchar *, gchar **));
  */
-int
+gint
 _GetGlobPrefix(pattern, prefix)
-	char *pattern;
-	char **prefix;
+	gchar *pattern;
+	gchar **prefix;
 {
-	int i, j;
-	char *p;
+	gint i, j;
+	gchar *p;
 
 	/*
 	 * Duplicate it, we get enough space and most of the work is done.
@@ -412,15 +412,15 @@ _GetGlobPrefix(pattern, prefix)
 }
 
 /*
- * PUBLIC: int _ReturnSetup __P((Tcl_Interp *, int, int, char *));
+ * PUBLIC: gint _ReturnSetup __P((Tcl_Interp *, int, int, gchar *));
  */
-int
+gint
 _ReturnSetup(interp, ret, ok, errmsg)
 	Tcl_Interp *interp;
-	int ret, ok;
-	char *errmsg;
+	gint ret, ok;
+	gchar *errmsg;
 {
-	char *msg;
+	gchar *msg;
 
 	if (ret > 0)
 		return (_ErrorSetup(interp, ret, errmsg));
@@ -449,13 +449,13 @@ _ReturnSetup(interp, ret, ok, errmsg)
 }
 
 /*
- * PUBLIC: int _ErrorSetup __P((Tcl_Interp *, int, char *));
+ * PUBLIC: gint _ErrorSetup __P((Tcl_Interp *, int, gchar *));
  */
-int
+gint
 _ErrorSetup(interp, ret, errmsg)
 	Tcl_Interp *interp;
-	int ret;
-	char *errmsg;
+	gint ret;
+	gchar *errmsg;
 {
 	Tcl_SetErrno(ret);
 	Tcl_AppendResult(interp, errmsg, ":", Tcl_PosixError(interp), NULL);
@@ -463,17 +463,17 @@ _ErrorSetup(interp, ret, errmsg)
 }
 
 /*
- * PUBLIC: void _ErrorFunc __P((CONST char *, char *));
+ * PUBLIC: void _ErrorFunc __P((CONST gchar *, gchar *));
  */
 void
 _ErrorFunc(pfx, msg)
-	CONST char *pfx;
-	char *msg;
+	CONST gchar *pfx;
+	gchar *msg;
 {
 	DBTCL_INFO *p;
 	Tcl_Interp *interp;
-	int size;
-	char *err;
+	gint size;
+	gchar *err;
 
 	p = _NameToInfo(pfx);
 	if (p == NULL)
@@ -500,17 +500,17 @@ _ErrorFunc(pfx, msg)
 #define	INVALID_LSNMSG "Invalid LSN with %d parts. Should have 2.\n"
 
 /*
- * PUBLIC: int _GetLsn __P((Tcl_Interp *, Tcl_Obj *, DB_LSN *));
+ * PUBLIC: gint _GetLsn __P((Tcl_Interp *, Tcl_Obj *, DB_LSN *));
  */
-int
+gint
 _GetLsn(interp, obj, lsn)
 	Tcl_Interp *interp;
 	Tcl_Obj *obj;
 	DB_LSN *lsn;
 {
 	Tcl_Obj **myobjv;
-	char msg[MSG_SIZE];
-	int myobjc, result;
+	gchar msg[MSG_SIZE];
+	gint myobjc, result;
 	u_int32_t tmp;
 
 	result = Tcl_ListObjGetElements(interp, obj, &myobjc, &myobjv);
@@ -535,7 +535,7 @@ _GetLsn(interp, obj, lsn)
  * _GetUInt32 --
  *	Get a u_int32_t from a Tcl object.  Tcl_GetIntFromObj does the
  * right thing most of the time, but on machines where a long is 8 bytes
- * and an int is 4 bytes, it errors on integers between the maximum
+ * and an gint is 4 bytes, it errors on integers between the maximum
  * int32_t and the maximum u_int32_t.  This is correct, but we generally
  * want a u_int32_t in the end anyway, so we use Tcl_GetLongFromObj and do
  * the bounds checking ourselves.
@@ -544,15 +544,15 @@ _GetLsn(interp, obj, lsn)
  * bounds check.  It's essentially Tcl_GetUnsignedIntFromObj, which
  * unfortunately doesn't exist.
  *
- * PUBLIC: int _GetUInt32 __P((Tcl_Interp *, Tcl_Obj *, u_int32_t *));
+ * PUBLIC: gint _GetUInt32 __P((Tcl_Interp *, Tcl_Obj *, u_int32_t *));
  */
-int
+gint
 _GetUInt32(interp, obj, resp)
 	Tcl_Interp *interp;
 	Tcl_Obj *obj;
 	u_int32_t *resp;
 {
-	int result;
+	gint result;
 	long ltmp;
 
 	result = Tcl_GetLongFromObj(interp, obj, &ltmp);
@@ -582,12 +582,12 @@ static void
 tcl_flag_callback(flags, fn, vtcbp)
 	u_int32_t flags;
 	const FN *fn;
-	void *vtcbp;
+	gpointer vtcbp;
 {
 	const FN *fnp;
 	Tcl_Interp *interp;
 	Tcl_Obj *newobj, *listobj;
-	int result;
+	gint result;
 	struct __tcl_callback_bundle *tcbp;
 
 	tcbp = (struct __tcl_callback_bundle *)vtcbp;
@@ -617,15 +617,15 @@ tcl_flag_callback(flags, fn, vtcbp)
  * that can extract the right names for the right flags.
  *
  * PUBLIC: Tcl_Obj *_GetFlagsList __P((Tcl_Interp *, u_int32_t,
- * PUBLIC:     void (*)(u_int32_t, void *,
- * PUBLIC:     void (*)(u_int32_t, const FN *, void *))));
+ * PUBLIC:     void (*)(u_int32_t, gpointer ,
+ * PUBLIC:     void (*)(u_int32_t, const FN *, gpointer ))));
  */
 Tcl_Obj *
 _GetFlagsList(interp, flags, func)
 	Tcl_Interp *interp;
 	u_int32_t flags;
 	void (*func)
-	    __P((u_int32_t, void *, void (*)(u_int32_t, const FN *, void *)));
+	    __P((u_int32_t, gpointer , void (*)(u_int32_t, const FN *, gpointer )));
 {
 	Tcl_Obj *newlist;
 	struct __tcl_callback_bundle tcb;
@@ -641,7 +641,7 @@ _GetFlagsList(interp, flags, func)
 	return (newlist);
 }
 
-int __debug_stop, __debug_on, __debug_print, __debug_test;
+gint __debug_stop, __debug_on, __debug_print, __debug_test;
 
 /*
  * PUBLIC: void _debug_check  __P((void));
@@ -674,19 +674,19 @@ _debug_check()
  * memory.
  */
 /*
- * PUBLIC: int _CopyObjBytes  __P((Tcl_Interp *, Tcl_Obj *obj, void **,
- * PUBLIC:     u_int32_t *, int *));
+ * PUBLIC: gint _CopyObjBytes  __P((Tcl_Interp *, Tcl_Obj *obj, gpointer *,
+ * PUBLIC:     u_int32_t *, gint *));
  */
-int
+gint
 _CopyObjBytes(interp, obj, newp, sizep, freep)
 	Tcl_Interp *interp;
 	Tcl_Obj *obj;
-	void **newp;
+	gpointer *newp;
 	u_int32_t *sizep;
-	int *freep;
+	gint *freep;
 {
-	void *tmp, *new;
-	int i, len, ret;
+	gpointer tmp, *new;
+	gint i, len, ret;
 
 	/*
 	 * If the object is not an int, then just return the byte
diff --git a/libdb/tcl/tcl_lock.c b/libdb/tcl/tcl_lock.c
index c70abd5..a765376 100644
--- a/libdb/tcl/tcl_lock.c
+++ b/libdb/tcl/tcl_lock.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,14 +25,14 @@ static const char revid[] = "$Id$";
 /*
  * Prototypes for procedures defined later in this file:
  */
-static int      lock_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+static gint      lock_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
 static int	_LockMode __P((Tcl_Interp *, Tcl_Obj *, db_lockmode_t *));
 static int	_GetThisLock __P((Tcl_Interp *, DB_ENV *, u_int32_t,
-				     u_int32_t, DBT *, db_lockmode_t, char *));
+				     u_int32_t, DBT *, db_lockmode_t, gchar *));
 static void	_LockPutInfo __P((Tcl_Interp *, db_lockop_t, DB_LOCK *,
 				     u_int32_t, DBT *));
 #if CONFIG_TEST
-static char *lkmode[] = {
+static gchar *lkmode[] = {
 	"ng",
 	"read",
 	"write",
@@ -53,17 +53,17 @@ enum lkmode {
 /*
  * tcl_LockDetect --
  *
- * PUBLIC: int tcl_LockDetect __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LockDetect __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LockDetect(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
-	static char *ldopts[] = {
+	static gchar *ldopts[] = {
 		"expire",
 		"default",
 		"maxlocks",
@@ -85,7 +85,7 @@ tcl_LockDetect(interp, objc, objv, envp)
 		LD_YOUNGEST
 	};
 	u_int32_t flag, policy;
-	int i, optindex, result, ret;
+	gint i, optindex, result, ret;
 
 	result = TCL_OK;
 	flag = policy = 0;
@@ -140,17 +140,17 @@ tcl_LockDetect(interp, objc, objv, envp)
 /*
  * tcl_LockGet --
  *
- * PUBLIC: int tcl_LockGet __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LockGet __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LockGet(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
-	static char *lgopts[] = {
+	static gchar *lgopts[] = {
 		"-nowait",
 		 NULL
 	};
@@ -159,11 +159,11 @@ tcl_LockGet(interp, objc, objv, envp)
 	};
 	DBT obj;
 	Tcl_Obj *res;
-	void *otmp;
+	gpointer otmp;
 	db_lockmode_t mode;
 	u_int32_t flag, lockid;
-	int freeobj, optindex, result, ret;
-	char newname[MSG_SIZE];
+	gint freeobj, optindex, result, ret;
+	gchar newname[MSG_SIZE];
 
 	result = TCL_OK;
 	freeobj = 0;
@@ -224,19 +224,19 @@ out:
 /*
  * tcl_LockStat --
  *
- * PUBLIC: int tcl_LockStat __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LockStat __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LockStat(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 	DB_LOCK_STAT *sp;
 	Tcl_Obj *res;
-	int result, ret;
+	gint result, ret;
 
 	result = TCL_OK;
 	/*
@@ -292,18 +292,18 @@ error:
 /*
  * tcl_LockTimeout --
  *
- * PUBLIC: int tcl_LockTimeout __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LockTimeout __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LockTimeout(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 	long timeout;
-	int result, ret;
+	gint result, ret;
 
 	/*
 	 * One arg, the timeout.
@@ -329,10 +329,10 @@ static int
 lock_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* Lock handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *lkcmds[] = {
+	static gchar *lkcmds[] = {
 		"put",
 		NULL
 	};
@@ -342,11 +342,11 @@ lock_Cmd(clientData, interp, objc, objv)
 	DB_ENV *env;
 	DB_LOCK *lock;
 	DBTCL_INFO *lkip;
-	int cmdindex, result, ret;
+	gint cmdindex, result, ret;
 
 	Tcl_ResetResult(interp);
 	lock = (DB_LOCK *)clientData;
-	lkip = _PtrToInfo((void *)lock);
+	lkip = _PtrToInfo((gpointer)lock);
 	result = TCL_OK;
 
 	if (lock == NULL) {
@@ -391,23 +391,23 @@ lock_Cmd(clientData, interp, objc, objv)
 /*
  * tcl_LockVec --
  *
- * PUBLIC: int tcl_LockVec __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+ * PUBLIC: gint tcl_LockVec __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LockVec(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* environment pointer */
 {
-	static char *lvopts[] = {
+	static gchar *lvopts[] = {
 		"-nowait",
 		 NULL
 	};
 	enum lvopts {
 		LVNOWAIT
 	};
-	static char *lkops[] = {
+	static gchar *lkops[] = {
 		"get",
 		"put",
 		"put_all",
@@ -426,10 +426,10 @@ tcl_LockVec(interp, objc, objv, envp)
 	DB_LOCKREQ list;
 	DBT obj;
 	Tcl_Obj **myobjv, *res, *thisop;
-	void *otmp;
+	gpointer otmp;
 	u_int32_t flag, lockid;
-	int freeobj, i, myobjc, optindex, result, ret;
-	char *lockname, msg[MSG_SIZE], newname[MSG_SIZE];
+	gint freeobj, i, myobjc, optindex, result, ret;
+	gchar *lockname, msg[MSG_SIZE], newname[MSG_SIZE];
 
 	result = TCL_OK;
 	memset(newname, 0, MSG_SIZE);
@@ -615,7 +615,7 @@ _LockMode(interp, obj, mode)
 	Tcl_Obj *obj;
 	db_lockmode_t *mode;
 {
-	int optindex;
+	gint optindex;
 
 	if (Tcl_GetIndexFromObj(interp, obj, lkmode, "option",
 	    TCL_EXACT, &optindex) != TCL_OK)
@@ -652,7 +652,7 @@ _LockPutInfo(interp, op, lock, lockid, objp)
 	DBT *objp;
 {
 	DBTCL_INFO *p, *nextp;
-	int found;
+	gint found;
 
 	for (p = LIST_FIRST(&__db_infohead); p != NULL; p = nextp) {
 		found = 0;
@@ -678,14 +678,14 @@ _GetThisLock(interp, envp, lockid, flag, objp, mode, newname)
 	u_int32_t flag;			/* Lock flag */
 	DBT *objp;			/* Object to lock */
 	db_lockmode_t mode;		/* Lock mode */
-	char *newname;			/* New command name */
+	gchar *newname;			/* New command name */
 {
 	DB_LOCK *lock;
 	DBTCL_INFO *envip, *ip;
-	int result, ret;
+	gint result, ret;
 
 	result = TCL_OK;
-	envip = _PtrToInfo((void *)envp);
+	envip = _PtrToInfo((gpointer)envp);
 	if (envip == NULL) {
 		Tcl_SetResult(interp, "Could not find env info\n", TCL_STATIC);
 		return (TCL_ERROR);
diff --git a/libdb/tcl/tcl_log.c b/libdb/tcl/tcl_log.c
index cdc56cf..09d1718 100644
--- a/libdb/tcl/tcl_log.c
+++ b/libdb/tcl/tcl_log.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,22 +25,22 @@ static const char revid[] = "$Id$";
 #include "dbinc/txn.h"
 
 #ifdef CONFIG_TEST
-static int tcl_LogcGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_LOGC *));
+static gint tcl_LogcGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_LOGC *));
 
 /*
  * tcl_LogArchive --
  *
- * PUBLIC: int tcl_LogArchive __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LogArchive __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LogArchive(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
-	static char *archopts[] = {
+	static gchar *archopts[] = {
 		"-arch_abs",	"-arch_data",	"-arch_log",
 		NULL
 	};
@@ -49,8 +49,8 @@ tcl_LogArchive(interp, objc, objv, envp)
 	};
 	Tcl_Obj *fileobj, *res;
 	u_int32_t flag;
-	int i, optindex, result, ret;
-	char **file, **list;
+	gint i, optindex, result, ret;
+	gchar **file, **list;
 
 	result = TCL_OK;
 	flag = 0;
@@ -98,18 +98,18 @@ tcl_LogArchive(interp, objc, objv, envp)
 /*
  * tcl_LogCompare --
  *
- * PUBLIC: int tcl_LogCompare __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LogCompare __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*));
  */
-int
+gint
 tcl_LogCompare(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
 	DB_LSN lsn0, lsn1;
 	Tcl_Obj *res;
-	int result, ret;
+	gint result, ret;
 
 	result = TCL_OK;
 	/*
@@ -137,21 +137,21 @@ tcl_LogCompare(interp, objc, objv)
 /*
  * tcl_LogFile --
  *
- * PUBLIC: int tcl_LogFile __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LogFile __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LogFile(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 	DB_LSN lsn;
 	Tcl_Obj *res;
 	size_t len;
-	int result, ret;
-	char *name;
+	gint result, ret;
+	gchar *name;
 
 	result = TCL_OK;
 	/*
@@ -196,18 +196,18 @@ tcl_LogFile(interp, objc, objv, envp)
 /*
  * tcl_LogFlush --
  *
- * PUBLIC: int tcl_LogFlush __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LogFlush __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LogFlush(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 	DB_LSN lsn, *lsnp;
-	int result, ret;
+	gint result, ret;
 
 	result = TCL_OK;
 	/*
@@ -235,13 +235,13 @@ tcl_LogFlush(interp, objc, objv, envp)
 /*
  * tcl_LogGet --
  *
- * PUBLIC: int tcl_LogGet __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LogGet __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LogGet(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
@@ -257,17 +257,17 @@ tcl_LogGet(interp, objc, objv, envp)
 /*
  * tcl_LogPut --
  *
- * PUBLIC: int tcl_LogPut __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LogPut __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LogPut(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
-	static char *logputopts[] = {
+	static gchar *logputopts[] = {
 		"-flush",
 		NULL
 	};
@@ -277,9 +277,9 @@ tcl_LogPut(interp, objc, objv, envp)
 	DB_LSN lsn;
 	DBT data;
 	Tcl_Obj *intobj, *res;
-	void *dtmp;
+	gpointer dtmp;
 	u_int32_t flag;
-	int freedata, optindex, result, ret;
+	gint freedata, optindex, result, ret;
 
 	result = TCL_OK;
 	flag = 0;
@@ -339,19 +339,19 @@ tcl_LogPut(interp, objc, objv, envp)
 /*
  * tcl_LogStat --
  *
- * PUBLIC: int tcl_LogStat __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_LogStat __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_LogStat(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 	DB_LOG_STAT *sp;
 	Tcl_Obj *res;
-	int result, ret;
+	gint result, ret;
 
 	result = TCL_OK;
 	/*
@@ -408,16 +408,16 @@ error:
  * logc_Cmd --
  *	Implements the log cursor command.
  *
- * PUBLIC: int logc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+ * PUBLIC: gint logc_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
  */
-int
+gint
 logc_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* Cursor handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *logccmds[] = {
+	static gchar *logccmds[] = {
 		"close",
 		"get",
 		NULL
@@ -428,11 +428,11 @@ logc_Cmd(clientData, interp, objc, objv)
 	};
 	DB_LOGC *logc;
 	DBTCL_INFO *logcip;
-	int cmdindex, result, ret;
+	gint cmdindex, result, ret;
 
 	Tcl_ResetResult(interp);
 	logc = (DB_LOGC *)clientData;
-	logcip = _PtrToInfo((void *)logc);
+	logcip = _PtrToInfo((gpointer)logc);
 	result = TCL_OK;
 
 	if (objc <= 1) {
@@ -483,11 +483,11 @@ logc_Cmd(clientData, interp, objc, objv)
 static int
 tcl_LogcGet(interp, objc, objv, logc)
 	Tcl_Interp *interp;
-	int objc;
+	gint objc;
 	Tcl_Obj * CONST *objv;
 	DB_LOGC *logc;
 {
-	static char *logcgetopts[] = {
+	static gchar *logcgetopts[] = {
 		"-current",
 		"-first",
 		"-last",
@@ -508,7 +508,7 @@ tcl_LogcGet(interp, objc, objv, logc)
 	DBT data;
 	Tcl_Obj *dataobj, *lsnlist, *myobjv[2], *res;
 	u_int32_t flag;
-	int i, myobjc, optindex, result, ret;
+	gint i, myobjc, optindex, result, ret;
 
 	result = TCL_OK;
 	res = NULL;
diff --git a/libdb/tcl/tcl_mp.c b/libdb/tcl/tcl_mp.c
index c734670..19ae8aa 100644
--- a/libdb/tcl/tcl_mp.c
+++ b/libdb/tcl/tcl_mp.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -25,16 +25,16 @@ static const char revid[] = "$Id$";
 /*
  * Prototypes for procedures defined later in this file:
  */
-static int      mp_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
-static int      pg_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
-static int      tcl_MpGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
+static gint      mp_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+static gint      pg_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+static gint      tcl_MpGet __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
     DB_MPOOLFILE *, DBTCL_INFO *));
-static int      tcl_Pg __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
-    void *, DB_MPOOLFILE *, DBTCL_INFO *, int));
-static int      tcl_PgInit __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
-    void *, DBTCL_INFO *));
-static int      tcl_PgIsset __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
-    void *, DBTCL_INFO *));
+static gint      tcl_Pg __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
+    gpointer , DB_MPOOLFILE *, DBTCL_INFO *, int));
+static gint      tcl_PgInit __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
+    gpointer , DBTCL_INFO *));
+static gint      tcl_PgIsset __P((Tcl_Interp *, int, Tcl_Obj * CONST*,
+    gpointer , DBTCL_INFO *));
 
 /*
  * _MpInfoDelete --
@@ -67,18 +67,18 @@ _MpInfoDelete(interp, mpip)
 /*
  * tcl_MpSync --
  *
- * PUBLIC: int tcl_MpSync __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+ * PUBLIC: gint tcl_MpSync __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_MpSync(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 
 	DB_LSN lsn, *lsnp;
-	int result, ret;
+	gint result, ret;
 
 	result = TCL_OK;
 	lsnp = NULL;
@@ -105,21 +105,21 @@ tcl_MpSync(interp, objc, objv, envp)
 /*
  * tcl_MpTrickle --
  *
- * PUBLIC: int tcl_MpTrickle __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_MpTrickle __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_MpTrickle(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 
-	int pages;
-	int percent;
-	int result;
-	int ret;
+	gint pages;
+	gint percent;
+	gint result;
+	gint ret;
 	Tcl_Obj *res;
 
 	result = TCL_OK;
@@ -150,18 +150,18 @@ tcl_MpTrickle(interp, objc, objv, envp)
 /*
  * tcl_Mp --
  *
- * PUBLIC: int tcl_Mp __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_Mp __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
  */
-int
+gint
 tcl_Mp(interp, objc, objv, envp, envip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 	DBTCL_INFO *envip;		/* Info pointer */
 {
-	static char *mpopts[] = {
+	static gchar *mpopts[] = {
 		"-create",
 		"-mode",
 		"-nommap",
@@ -180,8 +180,8 @@ tcl_Mp(interp, objc, objv, envp, envip)
 	DB_MPOOLFILE *mpf;
 	Tcl_Obj *res;
 	u_int32_t flag;
-	int i, pgsize, mode, optindex, result, ret;
-	char *file, newname[MSG_SIZE];
+	gint i, pgsize, mode, optindex, result, ret;
+	gchar *file, newname[MSG_SIZE];
 
 	result = TCL_OK;
 	i = 2;
@@ -308,19 +308,19 @@ error:
 /*
  * tcl_MpStat --
  *
- * PUBLIC: int tcl_MpStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
+ * PUBLIC: gint tcl_MpStat __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_MpStat(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 	DB_MPOOL_STAT *sp;
 	DB_MPOOL_FSTAT **fsp, **savefsp;
-	int result;
-	int ret;
+	gint result;
+	gint ret;
 	Tcl_Obj *res;
 	Tcl_Obj *res1;
 
@@ -427,10 +427,10 @@ static int
 mp_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* Mp handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *mpcmds[] = {
+	static gchar *mpcmds[] = {
 		"close",
 		"fsync",
 		"get",
@@ -442,10 +442,10 @@ mp_Cmd(clientData, interp, objc, objv)
 		MPGET
 	};
 	DB_MPOOLFILE *mp;
-	int cmdindex, length, result, ret;
+	gint cmdindex, length, result, ret;
 	DBTCL_INFO *mpip;
 	Tcl_Obj *res;
-	char *obj_name;
+	gchar *obj_name;
 
 	Tcl_ResetResult(interp);
 	mp = (DB_MPOOLFILE *)clientData;
@@ -513,12 +513,12 @@ mp_Cmd(clientData, interp, objc, objv)
 static int
 tcl_MpGet(interp, objc, objv, mp, mpip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_MPOOLFILE *mp;		/* mp pointer */
 	DBTCL_INFO *mpip;		/* mp info pointer */
 {
-	static char *mpget[] = {
+	static gchar *mpget[] = {
 		"-create",
 		"-last",
 		"-new",
@@ -534,9 +534,9 @@ tcl_MpGet(interp, objc, objv, mp, mpip)
 	Tcl_Obj *res;
 	db_pgno_t pgno;
 	u_int32_t flag;
-	int i, ipgno, optindex, result, ret;
-	char newname[MSG_SIZE];
-	void *page;
+	gint i, ipgno, optindex, result, ret;
+	gchar newname[MSG_SIZE];
+	gpointer page;
 
 	result = TCL_OK;
 	memset(newname, 0, MSG_SIZE);
@@ -626,10 +626,10 @@ static int
 pg_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* Page handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *pgcmds[] = {
+	static gchar *pgcmds[] = {
 		"init",
 		"is_setto",
 		"pgnum",
@@ -647,14 +647,14 @@ pg_Cmd(clientData, interp, objc, objv)
 		PGSET
 	};
 	DB_MPOOLFILE *mp;
-	int cmdindex, length, result;
-	char *obj_name;
-	void *page;
+	gint cmdindex, length, result;
+	gchar *obj_name;
+	gpointer page;
 	DBTCL_INFO *pgip;
 	Tcl_Obj *res;
 
 	Tcl_ResetResult(interp);
-	page = (void *)clientData;
+	page = (gpointer)clientData;
 	obj_name = Tcl_GetStringFromObj(objv[0], &length);
 	pgip = _NameToInfo(obj_name);
 	mp = NAME_TO_MP(pgip->i_parent->i_name);
@@ -713,14 +713,14 @@ pg_Cmd(clientData, interp, objc, objv)
 static int
 tcl_Pg(interp, objc, objv, page, mp, pgip, putop)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
-	void *page;			/* Page pointer */
+	gpointer page;			/* Page pointer */
 	DB_MPOOLFILE *mp;		/* Mpool pointer */
 	DBTCL_INFO *pgip;		/* Info pointer */
-	int putop;			/* Operation */
+	gint putop;			/* Operation */
 {
-	static char *pgopt[] = {
+	static gchar *pgopt[] = {
 		"-clean",
 		"-dirty",
 		"-discard",
@@ -732,7 +732,7 @@ tcl_Pg(interp, objc, objv, page, mp, pgip, putop)
 		PGDISCARD
 	};
 	u_int32_t flag;
-	int i, optindex, result, ret;
+	gint i, optindex, result, ret;
 
 	result = TCL_OK;
 	i = 2;
@@ -773,15 +773,15 @@ tcl_Pg(interp, objc, objv, page, mp, pgip, putop)
 static int
 tcl_PgInit(interp, objc, objv, page, pgip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
-	void *page;			/* Page pointer */
+	gpointer page;			/* Page pointer */
 	DBTCL_INFO *pgip;		/* Info pointer */
 {
 	Tcl_Obj *res;
 	size_t pgsz;
 	long *p, *endp, newval;
-	int length, result;
+	gint length, result;
 	u_char *s;
 
 	result = TCL_OK;
@@ -812,15 +812,15 @@ tcl_PgInit(interp, objc, objv, page, pgip)
 static int
 tcl_PgIsset(interp, objc, objv, page, pgip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
-	void *page;			/* Page pointer */
+	gpointer page;			/* Page pointer */
 	DBTCL_INFO *pgip;		/* Info pointer */
 {
 	Tcl_Obj *res;
 	size_t pgsz;
 	long *p, *endp, newval;
-	int length, result;
+	gint length, result;
 	u_char *s;
 
 	result = TCL_OK;
diff --git a/libdb/tcl/tcl_rep.c b/libdb/tcl/tcl_rep.c
index f5d3e5e..048cd7c 100644
--- a/libdb/tcl/tcl_rep.c
+++ b/libdb/tcl/tcl_rep.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -27,17 +27,17 @@ static const char revid[] = "$Id$";
  * tcl_RepElect --
  *	Call DB_ENV->rep_elect().
  *
- * PUBLIC: int tcl_RepElect
+ * PUBLIC: gint tcl_RepElect
  * PUBLIC:     __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
  */
-int
+gint
 tcl_RepElect(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;			/* Environment pointer */
 {
-	int eid, nsites, pri, result, ret;
+	gint eid, nsites, pri, result, ret;
 	u_int32_t timeout;
 
 	if (objc != 5) {
@@ -68,17 +68,17 @@ tcl_RepElect(interp, objc, objv, dbenv)
  * tcl_RepFlush --
  *	Call DB_ENV->rep_flush().
  *
- * PUBLIC: int tcl_RepFlush
+ * PUBLIC: gint tcl_RepFlush
  * PUBLIC:     __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
  */
-int
+gint
 tcl_RepFlush(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;
-	int objc;
+	gint objc;
 	Tcl_Obj *CONST objv[];
 	DB_ENV *dbenv;
 {
-	int ret;
+	gint ret;
 
 	if (objc != 2) {
 		Tcl_WrongNumArgs(interp, 2, objv, "");
@@ -95,17 +95,17 @@ tcl_RepFlush(interp, objc, objv, dbenv)
  * tcl_RepLimit --
  *	Call DB_ENV->set_rep_limit().
  *
- * PUBLIC: int tcl_RepLimit
+ * PUBLIC: gint tcl_RepLimit
  * PUBLIC:     __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
  */
-int
+gint
 tcl_RepLimit(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;			/* Environment pointer */
 {
-	int result, ret;
+	gint result, ret;
 	u_int32_t bytes, gbytes;
 
 	if (objc != 4) {
@@ -133,17 +133,17 @@ tcl_RepLimit(interp, objc, objv, dbenv)
  * tcl_RepRequest --
  *	Call DB_ENV->set_rep_request().
  *
- * PUBLIC: int tcl_RepRequest
+ * PUBLIC: gint tcl_RepRequest
  * PUBLIC:     __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
  */
-int
+gint
 tcl_RepRequest(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;			/* Environment pointer */
 {
-	int result, ret;
+	gint result, ret;
 	u_int32_t min, max;
 
 	if (objc != 4) {
@@ -171,21 +171,21 @@ tcl_RepRequest(interp, objc, objv, dbenv)
  * tcl_RepStart --
  *	Call DB_ENV->rep_start().
  *
- * PUBLIC: int tcl_RepStart
+ * PUBLIC: gint tcl_RepStart
  * PUBLIC:     __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
  *
  *	Note that this normally can/should be achieved as an argument to
  * berkdb env, but we need to test forcible upgrading of clients, which
  * involves calling this on an open environment handle.
  */
-int
+gint
 tcl_RepStart(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;
 {
-	static char *tclrpstrt[] = {
+	static gchar *tclrpstrt[] = {
 		"-client",
 		"-master",
 		NULL
@@ -194,8 +194,8 @@ tcl_RepStart(interp, objc, objv, dbenv)
 		TCL_RPSTRT_CLIENT,
 		TCL_RPSTRT_MASTER
 	};
-	char *arg;
-	int i, optindex, ret;
+	gchar *arg;
+	gint i, optindex, ret;
 	u_int32_t flag;
 
 	flag = 0;
@@ -238,21 +238,21 @@ tcl_RepStart(interp, objc, objv, dbenv)
  * tcl_RepProcessMessage --
  *	Call DB_ENV->rep_process_message().
  *
- * PUBLIC: int tcl_RepProcessMessage
+ * PUBLIC: gint tcl_RepProcessMessage
  * PUBLIC:     __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
  */
-int
+gint
 tcl_RepProcessMessage(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;			/* Environment pointer */
 {
 	DBT control, rec;
 	Tcl_Obj *res;
-	void *ctmp, *rtmp;
-	int eid;
-	int freectl, freerec, result, ret;
+	gpointer ctmp, *rtmp;
+	gint eid;
+	gint freectl, freerec, result, ret;
 
 	if (objc != 5) {
 		Tcl_WrongNumArgs(interp, 5, objv, "id control rec");
@@ -313,21 +313,21 @@ out:
  * tcl_RepStat --
  *	Call DB_ENV->rep_stat().
  *
- * PUBLIC: int tcl_RepStat
+ * PUBLIC: gint tcl_RepStat
  * PUBLIC:     __P((Tcl_Interp *, int, Tcl_Obj * CONST *, DB_ENV *));
  */
-int
+gint
 tcl_RepStat(interp, objc, objv, dbenv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *dbenv;
 {
 	DB_REP_STAT *sp;
 	Tcl_Obj *myobjv[2], *res, *thislist, *lsnlist;
 	u_int32_t flag;
-	int myobjc, result, ret;
-	char *arg;
+	gint myobjc, result, ret;
+	gchar *arg;
 
 	result = TCL_OK;
 	flag = 0;
diff --git a/libdb/tcl/tcl_txn.c b/libdb/tcl/tcl_txn.c
index 1526cb1..b61ca98 100644
--- a/libdb/tcl/tcl_txn.c
+++ b/libdb/tcl/tcl_txn.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -22,9 +22,9 @@ static const char revid[] = "$Id$";
 #include "db_int.h"
 #include "dbinc/tcl_db.h"
 
-static int tcl_TxnCommit __P((Tcl_Interp *,
+static gint tcl_TxnCommit __P((Tcl_Interp *,
 	       int, Tcl_Obj * CONST *, DB_TXN *, DBTCL_INFO *));
-static int txn_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST *));
+static gint txn_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST *));
 
 /*
  * _TxnInfoDelete --
@@ -59,24 +59,24 @@ _TxnInfoDelete(interp, txnip)
 /*
  * tcl_TxnCheckpoint --
  *
- * PUBLIC: int tcl_TxnCheckpoint __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_TxnCheckpoint __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_TxnCheckpoint(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
-	static char *txnckpopts[] = {
+	static gchar *txnckpopts[] = {
 		"-kbyte",	"-min",
 		NULL
 	};
 	enum txnckpopts {
 		TXNCKP_KB,	TXNCKP_MIN
 	};
-	int i, kb, min, optindex, result, ret;
+	gint i, kb, min, optindex, result, ret;
 
 	result = TCL_OK;
 	kb = min = 0;
@@ -122,18 +122,18 @@ tcl_TxnCheckpoint(interp, objc, objv, envp)
 /*
  * tcl_Txn --
  *
- * PUBLIC: int tcl_Txn __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_Txn __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
  */
-int
+gint
 tcl_Txn(interp, objc, objv, envp, envip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 	DBTCL_INFO *envip;		/* Info pointer */
 {
-	static char *txnopts[] = {
+	static gchar *txnopts[] = {
 #if CONFIG_TEST
 		"-dirty",
 		"-lock_timeout",
@@ -162,8 +162,8 @@ tcl_Txn(interp, objc, objv, envp, envip)
 	Tcl_Obj *res;
 	db_timeout_t lk_time, tx_time;
 	u_int32_t flag, lk_timeflag, tx_timeflag;
-	int i, optindex, result, ret;
-	char *arg, msg[MSG_SIZE], newname[MSG_SIZE];
+	gint i, optindex, result, ret;
+	gchar *arg, msg[MSG_SIZE], newname[MSG_SIZE];
 
 	result = TCL_OK;
 	memset(newname, 0, MSG_SIZE);
@@ -286,13 +286,13 @@ getit:
 /*
  * tcl_TxnStat --
  *
- * PUBLIC: int tcl_TxnStat __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_TxnStat __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_TxnStat(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
@@ -301,7 +301,7 @@ tcl_TxnStat(interp, objc, objv, envp)
 	DB_TXN_STAT *sp;
 	Tcl_Obj *myobjv[2], *res, *thislist, *lsnlist;
 	u_int32_t i;
-	int myobjc, result, ret;
+	gint myobjc, result, ret;
 
 	result = TCL_OK;
 	/*
@@ -364,18 +364,18 @@ error:
 /*
  * tcl_TxnTimeout --
  *
- * PUBLIC: int tcl_TxnTimeout __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_TxnTimeout __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *));
  */
-int
+gint
 tcl_TxnTimeout(interp, objc, objv, envp)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 {
 	long timeout;
-	int result, ret;
+	gint result, ret;
 
 	/*
 	 * One arg, the timeout.
@@ -402,10 +402,10 @@ static int
 txn_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* Txn handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *txncmds[] = {
+	static gchar *txncmds[] = {
 #if CONFIG_TEST
 		"discard",
 		"id",
@@ -427,12 +427,12 @@ txn_Cmd(clientData, interp, objc, objv)
 	DBTCL_INFO *txnip;
 	DB_TXN *txnp;
 	Tcl_Obj *res;
-	int cmdindex, result, ret;
+	gint cmdindex, result, ret;
 	u_int8_t *gid;
 
 	Tcl_ResetResult(interp);
 	txnp = (DB_TXN *)clientData;
-	txnip = _PtrToInfo((void *)txnp);
+	txnip = _PtrToInfo((gpointer)txnp);
 	result = TCL_OK;
 	if (txnp == NULL) {
 		Tcl_SetResult(interp, "NULL txn pointer", TCL_STATIC);
@@ -528,12 +528,12 @@ txn_Cmd(clientData, interp, objc, objv)
 static int
 tcl_TxnCommit(interp, objc, objv, txnp, txnip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_TXN *txnp;			/* Transaction pointer */
 	DBTCL_INFO *txnip;		/* Info pointer */
 {
-	static char *commitopt[] = {
+	static gchar *commitopt[] = {
 		"-nosync",
 		"-sync",
 		NULL
@@ -543,7 +543,7 @@ tcl_TxnCommit(interp, objc, objv, txnp, txnip)
 		COMNOSYNC
 	};
 	u_int32_t flag;
-	int optindex, result, ret;
+	gint optindex, result, ret;
 
 	COMPQUIET(txnip, NULL);
 
@@ -580,13 +580,13 @@ tcl_TxnCommit(interp, objc, objv, txnp, txnip)
 /*
  * tcl_TxnRecover --
  *
- * PUBLIC: int tcl_TxnRecover __P((Tcl_Interp *, int,
+ * PUBLIC: gint tcl_TxnRecover __P((Tcl_Interp *, int,
  * PUBLIC:    Tcl_Obj * CONST*, DB_ENV *, DBTCL_INFO *));
  */
-int
+gint
 tcl_TxnRecover(interp, objc, objv, envp, envip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 	DBTCL_INFO *envip;		/* Info pointer */
@@ -617,8 +617,8 @@ for (i = 0; i < count; i++) {						\
 	DB_PREPLIST prep[DBTCL_PREP], *p;
 	Tcl_Obj *res;
 	long count, i;
-	int result, ret;
-	char newname[MSG_SIZE];
+	gint result, ret;
+	gchar newname[MSG_SIZE];
 
 	result = TCL_OK;
 	/*
diff --git a/libdb/tcl/tcl_util.c b/libdb/tcl/tcl_util.c
index 943beab..7888b6e 100644
--- a/libdb/tcl/tcl_util.c
+++ b/libdb/tcl/tcl_util.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -26,21 +26,21 @@ static const char revid[] = "$Id$";
 /*
  * Prototypes for procedures defined later in this file:
  */
-static int mutex_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
+static gint mutex_Cmd __P((ClientData, Tcl_Interp *, int, Tcl_Obj * CONST*));
 
 /*
  * bdb_RandCommand --
  *	Implements rand* functions.
  *
- * PUBLIC: int bdb_RandCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
+ * PUBLIC: gint bdb_RandCommand __P((Tcl_Interp *, int, Tcl_Obj * CONST*));
  */
-int
+gint
 bdb_RandCommand(interp, objc, objv)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *rcmds[] = {
+	static gchar *rcmds[] = {
 		"rand",	"random_int",	"srand",
 		NULL
 	};
@@ -48,9 +48,9 @@ bdb_RandCommand(interp, objc, objv)
 		RRAND, RRAND_INT, RSRAND
 	};
 	long t;
-	int cmdindex, hi, lo, result, ret;
+	gint cmdindex, hi, lo, result, ret;
 	Tcl_Obj *res;
-	char msg[MSG_SIZE];
+	gchar msg[MSG_SIZE];
 
 	result = TCL_OK;
 	/*
@@ -136,13 +136,13 @@ bdb_RandCommand(interp, objc, objv)
  * tcl_Mutex --
  *	Opens an env mutex.
  *
- * PUBLIC: int tcl_Mutex __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *,
+ * PUBLIC: gint tcl_Mutex __P((Tcl_Interp *, int, Tcl_Obj * CONST*, DB_ENV *,
  * PUBLIC:    DBTCL_INFO *));
  */
-int
+gint
 tcl_Mutex(interp, objc, objv, envp, envip)
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 	DB_ENV *envp;			/* Environment pointer */
 	DBTCL_INFO *envip;		/* Info pointer */
@@ -150,8 +150,8 @@ tcl_Mutex(interp, objc, objv, envp, envip)
 	DBTCL_INFO *ip;
 	Tcl_Obj *res;
 	_MUTEX_DATA *md;
-	int i, mode, nitems, result, ret;
-	char newname[MSG_SIZE];
+	gint i, mode, nitems, result, ret;
+	gchar newname[MSG_SIZE];
 
 	md = NULL;
 	result = TCL_OK;
@@ -250,10 +250,10 @@ static int
 mutex_Cmd(clientData, interp, objc, objv)
 	ClientData clientData;		/* Mutex handle */
 	Tcl_Interp *interp;		/* Interpreter */
-	int objc;			/* How many arguments? */
+	gint objc;			/* How many arguments? */
 	Tcl_Obj *CONST objv[];		/* The argument objects */
 {
-	static char *mxcmds[] = {
+	static gchar *mxcmds[] = {
 		"close",
 		"get",
 		"getval",
@@ -272,11 +272,11 @@ mutex_Cmd(clientData, interp, objc, objv)
 	DBTCL_INFO *envip, *mpip;
 	_MUTEX_DATA *mp;
 	Tcl_Obj *res;
-	int cmdindex, id, result, newval;
+	gint cmdindex, id, result, newval;
 
 	Tcl_ResetResult(interp);
 	mp = (_MUTEX_DATA *)clientData;
-	mpip = _PtrToInfo((void *)mp);
+	mpip = _PtrToInfo((gpointer)mp);
 	envip = mpip->i_parent;
 	dbenv = envip->i_envp;
 	result = TCL_OK;
diff --git a/libdb/test/scr017/t.c b/libdb/test/scr017/t.c
index f03b338..7181d5c 100644
--- a/libdb/test/scr017/t.c
+++ b/libdb/test/scr017/t.c
@@ -8,11 +8,11 @@
 
 #include "db_185.h"
 
-void	err(char *);
+void	err(gchar *);
 int	mycmp(const DBT *, const DBT *);
 void	ops(DB *, int);
 
-int
+gint
 main()
 {
 	DB *dbp;
@@ -61,7 +61,7 @@ main()
 	return (0);
 }
 
-int
+gint
 mycmp(a, b)
 	const DBT *a, *b;
 {
@@ -78,13 +78,13 @@ mycmp(a, b)
 void
 ops(dbp, type)
 	DB *dbp;
-	int type;
+	gint type;
 {
 	FILE *outfp;
 	DBT key, data;
 	recno_t recno;
-	int i, ret;
-	char buf[64];
+	gint i, ret;
+	gchar buf[64];
 
 	memset(&key, 0, sizeof(key));
 	memset(&data, 0, sizeof(data));
@@ -149,11 +149,11 @@ ops(dbp, type)
 		err("fopen: output");
 	while ((ret = dbp->seq(dbp, &key, &data, R_NEXT)) == 0) {
 		if (type == DB_RECNO)
-			fprintf(outfp, "%d\n", *(int *)key.data);
+			fprintf(outfp, "%d\n", *(gint *)key.data);
 		else
 			fprintf(outfp,
-			    "%.*s\n", (int)key.size, (char *)key.data);
-		fprintf(outfp, "%.*s\n", (int)data.size, (char *)data.data);
+			    "%.*s\n", (int)key.size, (gchar *)key.data);
+		fprintf(outfp, "%.*s\n", (int)data.size, (gchar *)data.data);
 	}
 	if (ret != 1)
 		err("DB->seq");
@@ -181,7 +181,7 @@ ops(dbp, type)
 
 void
 err(s)
-	char *s;
+	gchar *s;
 {
 	fprintf(stderr, "\t%s: %s\n", s, strerror(errno));
 	exit (1);
diff --git a/libdb/test/scr018/t.c b/libdb/test/scr018/t.c
index 4056a60..209e7ab 100644
--- a/libdb/test/scr018/t.c
+++ b/libdb/test/scr018/t.c
@@ -5,11 +5,11 @@
 #include <stdio.h>
 #include <strings.h>
 
-int
+gint
 chk(f)
-	char *f;
+	gchar *f;
 {
-	int ch, l, r;
+	gint ch, l, r;
 
 	if (freopen(f, "r", stdin) == NULL) {
 		fprintf(stderr, "%s: %s\n", f, strerror(errno));
@@ -34,10 +34,10 @@ next:		if (ch == '\n')
 	return (r);
 }
 
-int
-main(int argc, char *argv[])
+gint
+main(gint argc, gchar *argv[])
 {
-	int r;
+	gint r;
 
 	for (r = 0; *++argv != NULL;)
 		if (chk(*argv))
diff --git a/libdb/txn/txn.c b/libdb/txn/txn.c
index 2e54d83..452e6e9 100644
--- a/libdb/txn/txn.c
+++ b/libdb/txn/txn.c
@@ -39,7 +39,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -96,11 +96,11 @@ typedef enum {
 	TXN_OP_PREPARE
 } txnop_t;
 
-static int  __txn_begin_int __P((DB_TXN *, int));
-static int  __txn_end __P((DB_TXN *, int));
-static int  __txn_isvalid __P((const DB_TXN *, TXN_DETAIL **, txnop_t));
-static int  __txn_set_timeout __P(( DB_TXN *, db_timeout_t, u_int32_t));
-static int  __txn_undo __P((DB_TXN *));
+static gint  __txn_begin_int __P((DB_TXN *, int));
+static gint  __txn_end __P((DB_TXN *, int));
+static gint  __txn_isvalid __P((const DB_TXN *, TXN_DETAIL **, txnop_t));
+static gint  __txn_set_timeout __P(( DB_TXN *, db_timeout_t, u_int32_t));
+static gint  __txn_undo __P((DB_TXN *));
 
 #ifndef db_create
 /*
@@ -123,18 +123,18 @@ static int  __txn_undo __P((DB_TXN *));
  * not generate them for these three functions, and don't include the three
  * functions in libraries built with that configuration option.
  *
- * EXTERN: int txn_abort __P((DB_TXN *));
- * EXTERN: int txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
- * EXTERN: int txn_commit __P((DB_TXN *, u_int32_t));
+ * EXTERN: gint txn_abort __P((DB_TXN *));
+ * EXTERN: gint txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+ * EXTERN: gint txn_commit __P((DB_TXN *, u_int32_t));
  */
-int
+gint
 txn_abort(txnp)
 	DB_TXN *txnp;
 {
 	return (txnp->abort(txnp));
 }
 
-int
+gint
 txn_begin(dbenv, parent, txnpp, flags)
 	DB_ENV *dbenv;
 	DB_TXN *parent, **txnpp;
@@ -143,7 +143,7 @@ txn_begin(dbenv, parent, txnpp, flags)
 	return (dbenv->txn_begin(dbenv, parent, txnpp, flags));
 }
 
-int
+gint
 txn_commit(txnp, flags)
 	DB_TXN *txnp;
 	u_int32_t flags;
@@ -163,9 +163,9 @@ txn_commit(txnp, flags)
  * provides access to the transaction ID and the offset in the transaction
  * region of the TXN_DETAIL structure.
  *
- * PUBLIC: int __txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
+ * PUBLIC: gint __txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
  */
-int
+gint
 __txn_begin(dbenv, parent, txnpp, flags)
 	DB_ENV *dbenv;
 	DB_TXN *parent, **txnpp;
@@ -173,7 +173,7 @@ __txn_begin(dbenv, parent, txnpp, flags)
 {
 	DB_LOCKREGION *region;
 	DB_TXN *txn;
-	int ret;
+	gint ret;
 
 	*txnpp = NULL;
 	PANIC_CHECK(dbenv);
@@ -247,9 +247,9 @@ err:
  * __txn_xa_begin --
  *	XA version of txn_begin.
  *
- * PUBLIC: int __txn_xa_begin __P((DB_ENV *, DB_TXN *));
+ * PUBLIC: gint __txn_xa_begin __P((DB_ENV *, DB_TXN *));
  */
-int
+gint
 __txn_xa_begin(dbenv, txn)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
@@ -271,15 +271,15 @@ __txn_xa_begin(dbenv, txn)
  * that is used only for transactions that must be started to compensate
  * for actions during an abort.  Currently only used for allocations.
  *
- * PUBLIC: int __txn_compensate_begin __P((DB_ENV *, DB_TXN **txnp));
+ * PUBLIC: gint __txn_compensate_begin __P((DB_ENV *, DB_TXN **txnp));
  */
-int
+gint
 __txn_compensate_begin(dbenv, txnpp)
 	DB_ENV *dbenv;
 	DB_TXN **txnpp;
 {
 	DB_TXN *txn;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 
@@ -303,7 +303,7 @@ __txn_compensate_begin(dbenv, txnpp)
 static int
 __txn_begin_int(txn, internal)
 	DB_TXN *txn;
-	int internal;
+	gint internal;
 {
 	DB_ENV *dbenv;
 	DB_LSN begin_lsn, null_lsn;
@@ -312,7 +312,7 @@ __txn_begin_int(txn, internal)
 	TXN_DETAIL *td;
 	size_t off;
 	u_int32_t id, *ids;
-	int nids, ret;
+	gint nids, ret;
 
 	mgr = txn->mgrp;
 	dbenv = mgr->dbenv;
@@ -440,9 +440,9 @@ err:	R_UNLOCK(dbenv, &mgr->reginfo);
  * __txn_commit --
  *	Commit a transaction.
  *
- * PUBLIC: int __txn_commit __P((DB_TXN *, u_int32_t));
+ * PUBLIC: gint __txn_commit __P((DB_TXN *, u_int32_t));
  */
-int
+gint
 __txn_commit(txnp, flags)
 	DB_TXN *txnp;
 	u_int32_t flags;
@@ -452,7 +452,7 @@ __txn_commit(txnp, flags)
 	DB_TXN *kid;
 	TXN_DETAIL *td;
 	u_int32_t lflags;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	dbenv = txnp->mgrp->dbenv;
 
@@ -578,9 +578,9 @@ err:	/*
  * __txn_abort --
  *	Abort a transaction.
  *
- * PUBLIC: int __txn_abort __P((DB_TXN *));
+ * PUBLIC: gint __txn_abort __P((DB_TXN *));
  */
-int
+gint
 __txn_abort(txnp)
 	DB_TXN *txnp;
 {
@@ -589,7 +589,7 @@ __txn_abort(txnp)
 	DB_TXN *kid;
 	TXN_DETAIL *td;
 	u_int32_t lflags;
-	int ret;
+	gint ret;
 
 	dbenv = txnp->mgrp->dbenv;
 
@@ -658,9 +658,9 @@ __txn_abort(txnp)
  * __txn_discard --
  *	Free the per-process resources associated with this txn handle.
  *
- * PUBLIC: int __txn_discard __P((DB_TXN *, u_int32_t flags));
+ * PUBLIC: gint __txn_discard __P((DB_TXN *, u_int32_t flags));
  */
-int
+gint
 __txn_discard(txnp, flags)
 	DB_TXN *txnp;
 	u_int32_t flags;
@@ -668,7 +668,7 @@ __txn_discard(txnp, flags)
 	DB_ENV *dbenv;
 	DB_TXN *freep;
 	TXN_DETAIL *td;
-	int ret;
+	gint ret;
 
 	COMPQUIET(flags, 0);
 
@@ -702,9 +702,9 @@ __txn_discard(txnp, flags)
  * __txn_prepare --
  *	Flush the log so a future commit is guaranteed to succeed.
  *
- * PUBLIC: int __txn_prepare __P((DB_TXN *, u_int8_t *));
+ * PUBLIC: gint __txn_prepare __P((DB_TXN *, u_int8_t *));
  */
-int
+gint
 __txn_prepare(txnp, gid)
 	DB_TXN *txnp;
 	u_int8_t *gid;
@@ -714,7 +714,7 @@ __txn_prepare(txnp, gid)
 	DB_TXN *kid;
 	TXN_DETAIL *td;
 	u_int32_t lflags;
-	int ret;
+	gint ret;
 
 	dbenv = txnp->mgrp->dbenv;
 
@@ -906,14 +906,14 @@ err:	/*
 static int
 __txn_end(txnp, is_commit)
 	DB_TXN *txnp;
-	int is_commit;
+	gint is_commit;
 {
 	DB_ENV *dbenv;
 	DB_LOCKREQ request;
 	DB_TXNMGR *mgr;
 	DB_TXNREGION *region;
 	TXN_DETAIL *tp;
-	int do_closefiles, ret;
+	gint do_closefiles, ret;
 
 	mgr = txnp->mgrp;
 	dbenv = mgr->dbenv;
@@ -1003,8 +1003,8 @@ __txn_undo(txnp)
 	DB_LSN key_lsn;
 	DB_TXN *ptxn;
 	DB_TXNMGR *mgr;
-	int ret, t_ret;
-	void *txnlist;
+	gint ret, t_ret;
+	gpointer txnlist;
 
 	mgr = txnp->mgrp;
 	dbenv = mgr->dbenv;
@@ -1093,10 +1093,10 @@ err:	if (logc != NULL && (t_ret = logc->close(logc, 0)) != 0 && ret == 0)
  * written after since that point may be involved in a transaction and may
  * therefore need to be undone in the case of an abort.
  *
- * PUBLIC: int __txn_checkpoint
+ * PUBLIC: gint __txn_checkpoint
  * PUBLIC:     __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
  */
-int
+gint
 __txn_checkpoint(dbenv, kbytes, minutes, flags)
 	DB_ENV *dbenv;
 	u_int32_t kbytes, minutes, flags;
@@ -1107,7 +1107,7 @@ __txn_checkpoint(dbenv, kbytes, minutes, flags)
 	TXN_DETAIL *txnp;
 	time_t last_ckp_time, now;
 	u_int32_t bytes, mbytes;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv,
@@ -1218,9 +1218,9 @@ do_ckp:	/* Look through the active transactions for the lowest begin LSN. */
  * __txn_getckp --
  *	Get the LSN of the last transaction checkpoint.
  *
- * PUBLIC: int __txn_getckp __P((DB_ENV *, DB_LSN *));
+ * PUBLIC: gint __txn_getckp __P((DB_ENV *, DB_LSN *));
  */
-int
+gint
 __txn_getckp(dbenv, lsnp)
 	DB_ENV *dbenv;
 	DB_LSN *lsnp;
@@ -1247,9 +1247,9 @@ __txn_getckp(dbenv, lsnp)
  * __txn_activekids --
  *	Return if this transaction has any active children.
  *
- * PUBLIC: int __txn_activekids __P((DB_ENV *, u_int32_t, DB_TXN *));
+ * PUBLIC: gint __txn_activekids __P((DB_ENV *, u_int32_t, DB_TXN *));
  */
-int
+gint
 __txn_activekids(dbenv, rectype, txnp)
 	DB_ENV *dbenv;
 	u_int32_t rectype;
@@ -1274,9 +1274,9 @@ __txn_activekids(dbenv, rectype, txnp)
  *	Force an abort record into the log if the commit record
  *	failed to get to disk.
  *
- * PUBLIC: int __txn_force_abort __P((DB_ENV *, u_int8_t *));
+ * PUBLIC: gint __txn_force_abort __P((DB_ENV *, u_int8_t *));
  */
-int
+gint
 __txn_force_abort(dbenv, buffer)
 	DB_ENV *dbenv;
 	u_int8_t *buffer;
@@ -1286,7 +1286,7 @@ __txn_force_abort(dbenv, buffer)
 	u_int32_t offset, opcode, rec_len, rec_type, sum_len;
 	u_int8_t *bp, *key, chksum[DB_MAC_KEY];
 	size_t hdrsize;
-	int ret;
+	gint ret;
 
 	db_cipher = dbenv->crypto_handle;
 
@@ -1337,15 +1337,15 @@ __txn_force_abort(dbenv, buffer)
  * were in the midst of taking care of restored transactions.  If
  * so, then we need to close the files that we opened.
  *
- * PUBLIC: int __txn_preclose __P((DB_ENV *));
+ * PUBLIC: gint __txn_preclose __P((DB_ENV *));
  */
-int
+gint
 __txn_preclose(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_TXNMGR *mgr;
 	DB_TXNREGION *region;
-	int do_closefiles, ret;
+	gint do_closefiles, ret;
 
 	mgr = (DB_TXNMGR *)dbenv->tx_handle;
 	region = mgr->reginfo.primary;
@@ -1377,9 +1377,9 @@ __txn_preclose(dbenv)
  * __txn_reset --
  *	Reset the last txnid to its minimum value, and log the reset.
  *
- * PUBLIC: int __txn_reset __P((DB_ENV *));
+ * PUBLIC: gint __txn_reset __P((DB_ENV *));
  */
-int
+gint
 __txn_reset(dbenv)
 	DB_ENV *dbenv;
 {
diff --git a/libdb/txn/txn_auto.c b/libdb/txn/txn_auto.c
index 55fb4bb..21bc7bc 100644
--- a/libdb/txn/txn_auto.c
+++ b/libdb/txn/txn_auto.c
@@ -18,10 +18,10 @@
 #include "dbinc/txn.h"
 
 /*
- * PUBLIC: int __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, int32_t));
  */
-int
+gint
 __txn_regop_log(dbenv, txnid, ret_lsnp, flags,
     opcode, timestamp)
 	DB_ENV *dbenv;
@@ -35,7 +35,7 @@ __txn_regop_log(dbenv, txnid, ret_lsnp, flags,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___txn_regop;
@@ -104,19 +104,19 @@ __txn_regop_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __txn_regop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_regop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_regop_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -137,19 +137,19 @@ __txn_regop_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_regop_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__txn_regop_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -172,18 +172,18 @@ __txn_regop_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __txn_regop_read __P((DB_ENV *, void *, __txn_regop_args **));
+ * PUBLIC: gint __txn_regop_read __P((DB_ENV *, gpointer , __txn_regop_args **));
  */
-int
+gint
 __txn_regop_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__txn_regop_args **argpp;
 {
 	__txn_regop_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__txn_regop_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -214,10 +214,10 @@ __txn_regop_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, DB_LSN *, DB_LSN *, int32_t));
  */
-int
+gint
 __txn_ckp_log(dbenv, txnid, ret_lsnp, flags,
     ckp_lsn, last_ckp, timestamp)
 	DB_ENV *dbenv;
@@ -232,7 +232,7 @@ __txn_ckp_log(dbenv, txnid, ret_lsnp, flags,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___txn_ckp;
@@ -310,19 +310,19 @@ __txn_ckp_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __txn_ckp_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_ckp_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_ckp_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -343,19 +343,19 @@ __txn_ckp_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_ckp_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__txn_ckp_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -381,18 +381,18 @@ __txn_ckp_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __txn_ckp_read __P((DB_ENV *, void *, __txn_ckp_args **));
+ * PUBLIC: gint __txn_ckp_read __P((DB_ENV *, gpointer , __txn_ckp_args **));
  */
-int
+gint
 __txn_ckp_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__txn_ckp_args **argpp;
 {
 	__txn_ckp_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__txn_ckp_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -425,10 +425,10 @@ __txn_ckp_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __txn_child_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __txn_child_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, DB_LSN *));
  */
-int
+gint
 __txn_child_log(dbenv, txnid, ret_lsnp, flags,
     child, c_lsn)
 	DB_ENV *dbenv;
@@ -442,7 +442,7 @@ __txn_child_log(dbenv, txnid, ret_lsnp, flags,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___txn_child;
@@ -513,19 +513,19 @@ __txn_child_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __txn_child_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_child_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_child_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -546,19 +546,19 @@ __txn_child_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __txn_child_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_child_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_child_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__txn_child_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -582,18 +582,18 @@ __txn_child_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __txn_child_read __P((DB_ENV *, void *, __txn_child_args **));
+ * PUBLIC: gint __txn_child_read __P((DB_ENV *, gpointer , __txn_child_args **));
  */
-int
+gint
 __txn_child_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__txn_child_args **argpp;
 {
 	__txn_child_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__txn_child_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -623,11 +623,11 @@ __txn_child_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __txn_xa_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __txn_xa_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, const DBT *, int32_t, u_int32_t, u_int32_t,
  * PUBLIC:     DB_LSN *));
  */
-int
+gint
 __txn_xa_regop_log(dbenv, txnid, ret_lsnp, flags,
     opcode, xid, formatID, gtrid, bqual, begin_lsn)
 	DB_ENV *dbenv;
@@ -646,7 +646,7 @@ __txn_xa_regop_log(dbenv, txnid, ret_lsnp, flags,
 	u_int32_t zero;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___txn_xa_regop;
@@ -744,19 +744,19 @@ __txn_xa_regop_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __txn_xa_regop_getpgnos __P((DB_ENV *, DBT *,
- * PUBLIC:     DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __txn_xa_regop_getpgnos __P((DB_ENV *, DBT *,
+ * PUBLIC:     DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __txn_xa_regop_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -777,21 +777,21 @@ __txn_xa_regop_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __txn_xa_regop_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_xa_regop_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_xa_regop_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__txn_xa_regop_args *argp;
 	u_int32_t i;
-	int ch;
-	int ret;
+	gint ch;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -824,19 +824,19 @@ __txn_xa_regop_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __txn_xa_regop_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __txn_xa_regop_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __txn_xa_regop_args **));
  */
-int
+gint
 __txn_xa_regop_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__txn_xa_regop_args **argpp;
 {
 	__txn_xa_regop_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__txn_xa_regop_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -884,10 +884,10 @@ __txn_xa_regop_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __txn_recycle_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
+ * PUBLIC: gint __txn_recycle_log __P((DB_ENV *, DB_TXN *, DB_LSN *,
  * PUBLIC:     u_int32_t, u_int32_t, u_int32_t));
  */
-int
+gint
 __txn_recycle_log(dbenv, txnid, ret_lsnp, flags,
     min, max)
 	DB_ENV *dbenv;
@@ -901,7 +901,7 @@ __txn_recycle_log(dbenv, txnid, ret_lsnp, flags,
 	DB_LSN *lsnp, null_lsn;
 	u_int32_t uinttmp;
 	u_int32_t npad, rectype, txn_num;
-	int ret;
+	gint ret;
 	u_int8_t *bp;
 
 	rectype = DB___txn_recycle;
@@ -970,19 +970,19 @@ __txn_recycle_log(dbenv, txnid, ret_lsnp, flags,
 }
 
 /*
- * PUBLIC: int __txn_recycle_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_recycle_getpgnos __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_recycle_getpgnos(dbenv, rec, lsnp, notused1, summary)
 	DB_ENV *dbenv;
 	DBT *rec;
 	DB_LSN *lsnp;
 	db_recops notused1;
-	void *summary;
+	gpointer summary;
 {
 	TXN_RECS *t;
-	int ret;
+	gint ret;
 	COMPQUIET(rec, NULL);
 	COMPQUIET(notused1, DB_TXN_ABORT);
 
@@ -1003,19 +1003,19 @@ __txn_recycle_getpgnos(dbenv, rec, lsnp, notused1, summary)
 }
 
 /*
- * PUBLIC: int __txn_recycle_print __P((DB_ENV *, DBT *, DB_LSN *,
- * PUBLIC:     db_recops, void *));
+ * PUBLIC: gint __txn_recycle_print __P((DB_ENV *, DBT *, DB_LSN *,
+ * PUBLIC:     db_recops, gpointer ));
  */
-int
+gint
 __txn_recycle_print(dbenv, dbtp, lsnp, notused2, notused3)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops notused2;
-	void *notused3;
+	gpointer notused3;
 {
 	__txn_recycle_args *argp;
-	int ret;
+	gint ret;
 
 	notused2 = DB_TXN_ABORT;
 	notused3 = NULL;
@@ -1038,19 +1038,19 @@ __txn_recycle_print(dbenv, dbtp, lsnp, notused2, notused3)
 }
 
 /*
- * PUBLIC: int __txn_recycle_read __P((DB_ENV *, void *,
+ * PUBLIC: gint __txn_recycle_read __P((DB_ENV *, gpointer ,
  * PUBLIC:     __txn_recycle_args **));
  */
-int
+gint
 __txn_recycle_read(dbenv, recbuf, argpp)
 	DB_ENV *dbenv;
-	void *recbuf;
+	gpointer recbuf;
 	__txn_recycle_args **argpp;
 {
 	__txn_recycle_args *argp;
 	u_int32_t uinttmp;
 	u_int8_t *bp;
-	int ret;
+	gint ret;
 
 	if ((ret = __os_malloc(dbenv,
 	    sizeof(__txn_recycle_args) + sizeof(DB_TXN), &argp)) != 0)
@@ -1081,16 +1081,16 @@ __txn_recycle_read(dbenv, recbuf, argpp)
 }
 
 /*
- * PUBLIC: int __txn_init_print __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __txn_init_print __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __txn_init_print(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __txn_regop_print, DB___txn_regop)) != 0)
@@ -1111,16 +1111,16 @@ __txn_init_print(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __txn_init_getpgnos __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __txn_init_getpgnos __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __txn_init_getpgnos(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __txn_regop_getpgnos, DB___txn_regop)) != 0)
@@ -1141,16 +1141,16 @@ __txn_init_getpgnos(dbenv, dtabp, dtabsizep)
 }
 
 /*
- * PUBLIC: int __txn_init_recover __P((DB_ENV *, int (***)(DB_ENV *,
- * PUBLIC:     DBT *, DB_LSN *, db_recops, void *), size_t *));
+ * PUBLIC: gint __txn_init_recover __P((DB_ENV *, gint (***)(DB_ENV *,
+ * PUBLIC:     DBT *, DB_LSN *, db_recops, gpointer ), size_t *));
  */
-int
+gint
 __txn_init_recover(dbenv, dtabp, dtabsizep)
 	DB_ENV *dbenv;
-	int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+	gint (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
 	size_t *dtabsizep;
 {
-	int ret;
+	gint ret;
 
 	if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
 	    __txn_regop_recover, DB___txn_regop)) != 0)
diff --git a/libdb/txn/txn_method.c b/libdb/txn/txn_method.c
index aed1387..e63ecae 100644
--- a/libdb/txn/txn_method.c
+++ b/libdb/txn/txn_method.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -29,8 +29,8 @@ static const char revid[] = "$Id$";
 #include "dbinc_auto/rpc_client_ext.h"
 #endif
 
-static int __txn_set_tx_max __P((DB_ENV *, u_int32_t));
-static int __txn_set_tx_timestamp __P((DB_ENV *, time_t *));
+static gint __txn_set_tx_max __P((DB_ENV *, u_int32_t));
+static gint __txn_set_tx_timestamp __P((DB_ENV *, time_t *));
 
 /*
  * __txn_dbenv_create --
diff --git a/libdb/txn/txn_rec.c b/libdb/txn/txn_rec.c
index 14db7f5..8cede05 100644
--- a/libdb/txn/txn_rec.c
+++ b/libdb/txn/txn_rec.c
@@ -36,7 +36,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -54,24 +54,24 @@ static const char revid[] = "$Id$";
 #define	IS_XA_TXN(R) (R->xid.size != 0)
 
 /*
- * PUBLIC: int __txn_regop_recover
- * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __txn_regop_recover
+ * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  *
  * These records are only ever written for commits.  Normally, we redo any
  * committed transaction, however if we are doing recovery to a timestamp, then
  * we may treat transactions that commited after the timestamp as aborted.
  */
-int
+gint
 __txn_regop_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	DB_TXNHEAD *headp;
 	__txn_regop_args *argp;
-	int ret;
+	gint ret;
 
 #ifdef DEBUG_RECOVER
 	(void)__txn_regop_print(dbenv, dbtp, lsnp, op, info);
@@ -141,21 +141,21 @@ err:		__db_err(dbenv,
 }
 
 /*
- * PUBLIC: int __txn_xa_regop_recover
- * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __txn_xa_regop_recover
+ * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  *
  * These records are only ever written for prepares.
  */
-int
+gint
 __txn_xa_regop_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__txn_xa_regop_args *argp;
-	int ret;
+	gint ret;
 
 #ifdef DEBUG_RECOVER
 	(void)__txn_xa_regop_print(dbenv, dbtp, lsnp, op, info);
@@ -218,19 +218,19 @@ err:	__os_free(dbenv, argp);
 }
 
 /*
- * PUBLIC: int __txn_ckp_recover
- * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __txn_ckp_recover
+ * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __txn_ckp_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__txn_ckp_args *argp;
-	int ret;
+	gint ret;
 
 #ifdef DEBUG_RECOVER
 	__txn_ckp_print(dbenv, dbtp, lsnp, op, info);
@@ -252,19 +252,19 @@ __txn_ckp_recover(dbenv, dbtp, lsnp, op, info)
  * __txn_child_recover
  *	Recover a commit record for a child transaction.
  *
- * PUBLIC: int __txn_child_recover
- * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __txn_child_recover
+ * PUBLIC:    __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __txn_child_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__txn_child_args *argp;
-	int c_stat, p_stat, ret;
+	gint c_stat, p_stat, ret;
 
 #ifdef DEBUG_RECOVER
 	(void)__txn_child_print(dbenv, dbtp, lsnp, op, info);
@@ -348,10 +348,10 @@ __txn_child_recover(dbenv, dbtp, lsnp, op, info)
  * lsnp is the LSN of the returned LSN
  * argp is the perpare record (in an appropriate structure)
  *
- * PUBLIC: int __txn_restore_txn __P((DB_ENV *,
+ * PUBLIC: gint __txn_restore_txn __P((DB_ENV *,
  * PUBLIC:     DB_LSN *, __txn_xa_regop_args *));
  */
-int
+gint
 __txn_restore_txn(dbenv, lsnp, argp)
 	DB_ENV *dbenv;
 	DB_LSN *lsnp;
@@ -360,7 +360,7 @@ __txn_restore_txn(dbenv, lsnp, argp)
 	DB_TXNMGR *mgr;
 	TXN_DETAIL *td;
 	DB_TXNREGION *region;
-	int ret;
+	gint ret;
 
 	if (argp->xid.size == 0)
 	return (0);
@@ -404,19 +404,19 @@ __txn_restore_txn(dbenv, lsnp, argp)
  * __txn_recycle_recover --
  *	Recovery function for recycle.
  *
- * PUBLIC: int __txn_recycle_recover
- * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
+ * PUBLIC: gint __txn_recycle_recover
+ * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, gpointer ));
  */
-int
+gint
 __txn_recycle_recover(dbenv, dbtp, lsnp, op, info)
 	DB_ENV *dbenv;
 	DBT *dbtp;
 	DB_LSN *lsnp;
 	db_recops op;
-	void *info;
+	gpointer info;
 {
 	__txn_recycle_args *argp;
-	int ret;
+	gint ret;
 
 #ifdef DEBUG_RECOVER
 	(void)__txn_child_print(dbenv, dbtp, lsnp, op, info);
diff --git a/libdb/txn/txn_recover.c b/libdb/txn/txn_recover.c
index 0a077e4..25ea4a2 100644
--- a/libdb/txn/txn_recover.c
+++ b/libdb/txn/txn_recover.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -61,10 +61,10 @@ __txn_continue(env, txnp, td, off)
  * __txn_map_gid
  *	Return the txn that corresponds to this global ID.
  *
- * PUBLIC: int __txn_map_gid __P((DB_ENV *,
+ * PUBLIC: gint __txn_map_gid __P((DB_ENV *,
  * PUBLIC:     u_int8_t *, TXN_DETAIL **, size_t *));
  */
-int
+gint
 __txn_map_gid(dbenv, gid, tdp, offp)
 	DB_ENV *dbenv;
 	u_int8_t *gid;
@@ -103,10 +103,10 @@ __txn_map_gid(dbenv, gid, tdp, offp)
  * commited transactions.  See __txn_get_prepared for details.  This
  * function and __db_xa_recover both wrap that one.
  *
- * PUBLIC: int __txn_recover
+ * PUBLIC: gint __txn_recover
  * PUBLIC:     __P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
  */
-int
+gint
 __txn_recover(dbenv, preplist, count, retp, flags)
 	DB_ENV *dbenv;
 	DB_PREPLIST *preplist;
@@ -136,10 +136,10 @@ __txn_recover(dbenv, preplist, count, retp, flags)
  *	entries	returned in the xids/txns array.  Flags indicates the operation,
  *	one of DB_FIRST or DB_NEXT.
  *
- * PUBLIC: int __txn_get_prepared __P((DB_ENV *,
+ * PUBLIC: gint __txn_get_prepared __P((DB_ENV *,
  * PUBLIC:     XID *, DB_PREPLIST *, long, long *, u_int32_t));
  */
-int
+gint
 __txn_get_prepared(dbenv, xids, txns, count, retp, flags)
 	DB_ENV *dbenv;
 	XID *xids;
@@ -158,8 +158,8 @@ __txn_get_prepared(dbenv, xids, txns, count, retp, flags)
 	XID *xidp;
 	__txn_ckp_args *ckp_args;
 	long i;
-	int nrestores, open_files, ret, t_ret;
-	void *txninfo;
+	gint nrestores, open_files, ret, t_ret;
+	gpointer txninfo;
 
 	*retp = 0;
 
diff --git a/libdb/txn/txn_region.c b/libdb/txn/txn_region.c
index 8a8e445..e0cbafa 100644
--- a/libdb/txn/txn_region.c
+++ b/libdb/txn/txn_region.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -32,22 +32,22 @@ static const char revid[] = "$Id$";
 #include "dbinc/log.h"
 #include "dbinc/txn.h"
 
-static int __txn_findlastckp __P((DB_ENV *, DB_LSN *));
-static int __txn_init __P((DB_ENV *, DB_TXNMGR *));
+static gint __txn_findlastckp __P((DB_ENV *, DB_LSN *));
+static gint __txn_init __P((DB_ENV *, DB_TXNMGR *));
 static size_t __txn_region_size __P((DB_ENV *));
 
 /*
  * __txn_open --
  *	Open a transaction region.
  *
- * PUBLIC: int __txn_open __P((DB_ENV *));
+ * PUBLIC: gint __txn_open __P((DB_ENV *));
  */
-int
+gint
 __txn_open(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_TXNMGR *tmgrp;
-	int ret;
+	gint ret;
 
 	/* Create/initialize the transaction manager structure. */
 	if ((ret = __os_calloc(dbenv, 1, sizeof(DB_TXNMGR), &tmgrp)) != 0)
@@ -110,7 +110,7 @@ __txn_init(dbenv, tmgrp)
 {
 	DB_LSN last_ckp;
 	DB_TXNREGION *region;
-	int ret;
+	gint ret;
 #ifdef	HAVE_MUTEX_SYSTEM_RESOURCES
 	u_int8_t *addr;
 #endif
@@ -191,7 +191,7 @@ __txn_findlastckp(dbenv, lsnp)
 	DB_LOGC *logc;
 	DB_LSN lsn;
 	DBT dbt;
-	int ret, t_ret;
+	gint ret, t_ret;
 	u_int32_t rectype;
 
 	if ((ret = dbenv->log_cursor(dbenv, &logc, 0)) != 0)
@@ -234,16 +234,16 @@ err:	if ((t_ret = logc->close(logc, 0)) != 0 && ret == 0)
  *	Clean up after the transaction system on a close or failed open.
  * Called only from __dbenv_refresh.  (Formerly called __txn_close.)
  *
- * PUBLIC: int __txn_dbenv_refresh __P((DB_ENV *));
+ * PUBLIC: gint __txn_dbenv_refresh __P((DB_ENV *));
  */
-int
+gint
 __txn_dbenv_refresh(dbenv)
 	DB_ENV *dbenv;
 {
 	DB_TXN *txnp;
 	DB_TXNMGR *tmgrp;
 	u_int32_t txnid;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 	tmgrp = dbenv->tx_handle;
@@ -340,16 +340,16 @@ __txn_region_destroy(dbenv, infop)
  *	Set the current transaction ID and current maximum unused ID (for
  *	testing purposes only).
  *
- * PUBLIC: int __txn_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
+ * PUBLIC: gint __txn_id_set __P((DB_ENV *, u_int32_t, u_int32_t));
  */
-int
+gint
 __txn_id_set(dbenv, cur_txnid, max_txnid)
 	DB_ENV *dbenv;
 	u_int32_t cur_txnid, max_txnid;
 {
 	DB_TXNMGR *mgr;
 	DB_TXNREGION *region;
-	int ret;
+	gint ret;
 
 	ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, "txn_id_set", DB_INIT_TXN);
 
diff --git a/libdb/txn/txn_stat.c b/libdb/txn/txn_stat.c
index 6228785..9720358 100644
--- a/libdb/txn/txn_stat.c
+++ b/libdb/txn/txn_stat.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -23,9 +23,9 @@ static const char revid[] = "$Id$";
 /*
  * __txn_stat --
  *
- * PUBLIC: int __txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
+ * PUBLIC: gint __txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
  */
-int
+gint
 __txn_stat(dbenv, statp, flags)
 	DB_ENV *dbenv;
 	DB_TXN_STAT **statp;
@@ -37,7 +37,7 @@ __txn_stat(dbenv, statp, flags)
 	TXN_DETAIL *txnp;
 	size_t nbytes;
 	u_int32_t ndx;
-	int ret;
+	gint ret;
 
 	PANIC_CHECK(dbenv);
 	ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, "txn_stat", DB_INIT_TXN);
diff --git a/libdb/txn/txn_util.c b/libdb/txn/txn_util.c
index 238aac5..b3d7309 100644
--- a/libdb/txn/txn_util.c
+++ b/libdb/txn/txn_util.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -28,7 +28,7 @@ struct __txn_event {
 	union {
 		struct {
 			/* Delayed remove. */
-			char *name;
+			gchar *name;
 			u_int8_t *fileid;
 		} r;
 		struct {
@@ -45,17 +45,17 @@ struct __txn_event {
  *
  * Creates a remove event that can be added to the commit list.
  *
- * PUBLIC: int __txn_remevent __P((DB_ENV *,
- * PUBLIC:       DB_TXN *, const char *, u_int8_t*));
+ * PUBLIC: gint __txn_remevent __P((DB_ENV *,
+ * PUBLIC:       DB_TXN *, const gchar *, u_int8_t*));
  */
-int
+gint
 __txn_remevent(dbenv, txn, name, fileid)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	const char *name;
+	const gchar *name;
 	u_int8_t *fileid;
 {
-	int ret;
+	gint ret;
 	TXN_EVENT *e;
 
 	e = NULL;
@@ -89,10 +89,10 @@ err:	if (e != NULL)
  * Add a lockevent to the commit-queue.  The lock event indicates a locker
  * trade.
  *
- * PUBLIC: int __txn_lockevent __P((DB_ENV *,
+ * PUBLIC: gint __txn_lockevent __P((DB_ENV *,
  * PUBLIC:     DB_TXN *, DB *, DB_LOCK *, u_int32_t));
  */
-int
+gint
 __txn_lockevent(dbenv, txn, dbp, lock, locker)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
@@ -100,7 +100,7 @@ __txn_lockevent(dbenv, txn, dbp, lock, locker)
 	DB_LOCK *lock;
 	u_int32_t locker;
 {
-	int ret;
+	gint ret;
 	TXN_EVENT *e;
 
 	if (!LOCKING_ON(dbenv))
@@ -152,7 +152,7 @@ __txn_remlock(dbenv, txn, lock, locker)
  * Process the list of events associated with a transaction.  On commit,
  * apply the events; on abort, just toss the entries.
  *
- * PUBLIC: int __txn_doevents __P((DB_ENV *, DB_TXN *, int, int));
+ * PUBLIC: gint __txn_doevents __P((DB_ENV *, DB_TXN *, int, int));
  */
 #define	DO_TRADE do {							\
 	memset(&req, 0, sizeof(req));					\
@@ -168,15 +168,15 @@ __txn_remlock(dbenv, txn, lock, locker)
 	e->op = TXN_TRADED;						\
 } while (0)
 
-int
+gint
 __txn_doevents(dbenv, txn, is_commit, preprocess)
 	DB_ENV *dbenv;
 	DB_TXN *txn;
-	int is_commit, preprocess;
+	gint is_commit, preprocess;
 {
 	DB_LOCKREQ req;
 	TXN_EVENT *e;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	ret = 0;
 
diff --git a/libdb/xa/xa.c b/libdb/xa/xa.c
index 8cabbfa..14350f4 100644
--- a/libdb/xa/xa.c
+++ b/libdb/xa/xa.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -21,16 +21,16 @@ static const char revid[] = "$Id$";
 #include "db_int.h"
 #include "dbinc/txn.h"
 
-static int  __db_xa_close __P((char *, int, long));
-static int  __db_xa_commit __P((XID *, int, long));
-static int  __db_xa_complete __P((int *, int *, int, long));
-static int  __db_xa_end __P((XID *, int, long));
-static int  __db_xa_forget __P((XID *, int, long));
-static int  __db_xa_open __P((char *, int, long));
-static int  __db_xa_prepare __P((XID *, int, long));
-static int  __db_xa_recover __P((XID *, long, int, long));
-static int  __db_xa_rollback __P((XID *, int, long));
-static int  __db_xa_start __P((XID *, int, long));
+static gint  __db_xa_close __P((gchar *, int, long));
+static gint  __db_xa_commit __P((XID *, int, long));
+static gint  __db_xa_complete __P((gint *, gint *, int, long));
+static gint  __db_xa_end __P((XID *, int, long));
+static gint  __db_xa_forget __P((XID *, int, long));
+static gint  __db_xa_open __P((gchar *, int, long));
+static gint  __db_xa_prepare __P((XID *, int, long));
+static gint  __db_xa_recover __P((XID *, long, int, long));
+static gint  __db_xa_rollback __P((XID *, int, long));
+static gint  __db_xa_start __P((XID *, int, long));
 static void __xa_txn_end __P((DB_TXN *));
 
 /*
@@ -75,8 +75,8 @@ const struct xa_switch_t db_xa_switch = {
  */
 static int
 __db_xa_open(xa_info, rmid, flags)
-	char *xa_info;
-	int rmid;
+	gchar *xa_info;
+	gint rmid;
 	long flags;
 {
 	DB_ENV *env;
@@ -126,12 +126,12 @@ err:	(void)env->close(env, 0);
  */
 static int
 __db_xa_close(xa_info, rmid, flags)
-	char *xa_info;
-	int rmid;
+	gchar *xa_info;
+	gint rmid;
 	long flags;
 {
 	DB_ENV *env;
-	int ret, t_ret;
+	gint ret, t_ret;
 
 	COMPQUIET(xa_info, NULL);
 
@@ -169,13 +169,13 @@ __db_xa_close(xa_info, rmid, flags)
 static int
 __db_xa_start(xid, rmid, flags)
 	XID *xid;
-	int rmid;
+	gint rmid;
 	long flags;
 {
 	DB_ENV *env;
 	TXN_DETAIL *td;
 	size_t off;
-	int is_known;
+	gint is_known;
 
 #define	OK_FLAGS	(TMJOIN | TMRESUME | TMNOWAIT | TMASYNC | TMNOFLAGS)
 	if (LF_ISSET(~OK_FLAGS))
@@ -236,7 +236,7 @@ __db_xa_start(xid, rmid, flags)
 static int
 __db_xa_end(xid, rmid, flags)
 	XID *xid;
-	int rmid;
+	gint rmid;
 	long flags;
 {
 	DB_ENV *env;
@@ -290,7 +290,7 @@ __db_xa_end(xid, rmid, flags)
 static int
 __db_xa_prepare(xid, rmid, flags)
 	XID *xid;
-	int rmid;
+	gint rmid;
 	long flags;
 {
 	DB_ENV *env;
@@ -341,7 +341,7 @@ __db_xa_prepare(xid, rmid, flags)
 static int
 __db_xa_commit(xid, rmid, flags)
 	XID *xid;
-	int rmid;
+	gint rmid;
 	long flags;
 {
 	DB_ENV *env;
@@ -402,7 +402,7 @@ static int
 __db_xa_recover(xids, count, rmid, flags)
 	XID *xids;
 	long count, flags;
-	int rmid;
+	gint rmid;
 {
 	DB_ENV *env;
 	u_int32_t newflags;
@@ -433,7 +433,7 @@ __db_xa_recover(xids, count, rmid, flags)
 static int
 __db_xa_rollback(xid, rmid, flags)
 	XID *xid;
-	int rmid;
+	gint rmid;
 	long flags;
 {
 	DB_ENV *env;
@@ -482,7 +482,7 @@ __db_xa_rollback(xid, rmid, flags)
 static int
 __db_xa_forget(xid, rmid, flags)
 	XID *xid;
-	int rmid;
+	gint rmid;
 	long flags;
 {
 	DB_ENV *env;
@@ -515,7 +515,7 @@ __db_xa_forget(xid, rmid, flags)
  */
 static int
 __db_xa_complete(handle, retval, rmid, flags)
-	int *handle, *retval, rmid;
+	gint *handle, *retval, rmid;
 	long flags;
 {
 	COMPQUIET(handle, NULL);
diff --git a/libdb/xa/xa_db.c b/libdb/xa/xa_db.c
index 7035cab..54e915f 100644
--- a/libdb/xa/xa_db.c
+++ b/libdb/xa/xa_db.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -19,36 +19,36 @@ static const char revid[] = "$Id$";
 #include "dbinc/xa.h"
 #include "dbinc/txn.h"
 
-static int __xa_close __P((DB *, u_int32_t));
-static int __xa_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
-static int __xa_del __P((DB *, DB_TXN *, DBT *, u_int32_t));
-static int __xa_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-static int __xa_open __P((DB *, DB_TXN *,
-	    const char *, const char *, DBTYPE, u_int32_t, int));
-static int __xa_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+static gint __xa_close __P((DB *, u_int32_t));
+static gint __xa_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
+static gint __xa_del __P((DB *, DB_TXN *, DBT *, u_int32_t));
+static gint __xa_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+static gint __xa_open __P((DB *, DB_TXN *,
+	    const gchar *, const gchar *, DBTYPE, u_int32_t, int));
+static gint __xa_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
 
 typedef struct __xa_methods {
-	int (*close) __P((DB *, u_int32_t));
-	int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
-	int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
-	int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int (*open) __P((DB *, DB_TXN *,
-	    const char *, const char *, DBTYPE, u_int32_t, int));
-	int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+	gint (*close) __P((DB *, u_int32_t));
+	gint (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
+	gint (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
+	gint (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
+	gint (*open) __P((DB *, DB_TXN *,
+	    const gchar *, const gchar *, DBTYPE, u_int32_t, int));
+	gint (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
 } XA_METHODS;
 
 /*
  * __db_xa_create --
  *	DB XA constructor.
  *
- * PUBLIC: int __db_xa_create __P((DB *));
+ * PUBLIC: gint __db_xa_create __P((DB *));
  */
-int
+gint
 __db_xa_create(dbp)
 	DB *dbp;
 {
 	XA_METHODS *xam;
-	int ret;
+	gint ret;
 
 	/*
 	 * Interpose XA routines in front of any method that takes a TXN
@@ -75,13 +75,13 @@ static int
 __xa_open(dbp, txn, name, subdb, type, flags, mode)
 	DB *dbp;
 	DB_TXN *txn;
-	const char *name, *subdb;
+	const gchar *name, *subdb;
 	DBTYPE type;
 	u_int32_t flags;
-	int mode;
+	gint mode;
 {
 	XA_METHODS *xam;
-	int ret;
+	gint ret;
 
 	xam = (XA_METHODS *)dbp->xa_internal;
 
@@ -137,7 +137,7 @@ __xa_close(dbp, flags)
 	DB *dbp;
 	u_int32_t flags;
 {
-	int (*real_close) __P((DB *, u_int32_t));
+	gint (*real_close) __P((DB *, u_int32_t));
 
 	real_close = ((XA_METHODS *)dbp->xa_internal)->close;
 
diff --git a/libdb/xa/xa_map.c b/libdb/xa/xa_map.c
index d0141ed..51d98da 100644
--- a/libdb/xa/xa_map.c
+++ b/libdb/xa/xa_map.c
@@ -8,7 +8,7 @@
 #include "db_config.h"
 
 #ifndef lint
-static const char revid[] = "$Id$";
+static const gchar revid[] = "$Id$";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -29,11 +29,11 @@ static const char revid[] = "$Id$";
  * __db_rmid_to_env
  *	Return the environment associated with a given XA rmid.
  *
- * PUBLIC: int __db_rmid_to_env __P((int rmid, DB_ENV **envp));
+ * PUBLIC: gint __db_rmid_to_env __P((gint rmid, DB_ENV **envp));
  */
-int
+gint
 __db_rmid_to_env(rmid, envp)
-	int rmid;
+	gint rmid;
 	DB_ENV **envp;
 {
 	DB_ENV *env;
@@ -64,9 +64,9 @@ __db_rmid_to_env(rmid, envp)
  * __db_xid_to_txn
  *	Return the txn that corresponds to this XID.
  *
- * PUBLIC: int __db_xid_to_txn __P((DB_ENV *, XID *, size_t *));
+ * PUBLIC: gint __db_xid_to_txn __P((DB_ENV *, XID *, size_t *));
  */
-int
+gint
 __db_xid_to_txn(dbenv, xid, offp)
 	DB_ENV *dbenv;
 	XID *xid;
@@ -81,11 +81,11 @@ __db_xid_to_txn(dbenv, xid, offp)
  * __db_map_rmid
  *	Create a mapping between the specified rmid and environment.
  *
- * PUBLIC: int __db_map_rmid __P((int, DB_ENV *));
+ * PUBLIC: gint __db_map_rmid __P((int, DB_ENV *));
  */
-int
+gint
 __db_map_rmid(rmid, env)
-	int rmid;
+	gint rmid;
 	DB_ENV *env;
 {
 	env->xa_rmid = rmid;
@@ -97,11 +97,11 @@ __db_map_rmid(rmid, env)
  * __db_unmap_rmid
  *	Destroy the mapping for the given rmid.
  *
- * PUBLIC: int __db_unmap_rmid __P((int));
+ * PUBLIC: gint __db_unmap_rmid __P((int));
  */
-int
+gint
 __db_unmap_rmid(rmid)
-	int rmid;
+	gint rmid;
 {
 	DB_ENV *e;
 
@@ -121,9 +121,9 @@ __db_unmap_rmid(rmid)
  *	Create a mapping between this XID and the transaction at
  *	"off" in the shared region.
  *
- * PUBLIC: int __db_map_xid __P((DB_ENV *, XID *, size_t));
+ * PUBLIC: gint __db_map_xid __P((DB_ENV *, XID *, size_t));
  */
-int
+gint
 __db_map_xid(env, xid, off)
 	DB_ENV *env;
 	XID *xid;
diff --git a/libebackend/e-data-server-module.c b/libebackend/e-data-server-module.c
index fe7d27c..21c5ea3 100644
--- a/libebackend/e-data-server-module.c
+++ b/libebackend/e-data-server-module.c
@@ -44,13 +44,13 @@ struct _EDataServerModule {
 
 	GModule *library;
 
-	char *path;
+	gchar *path;
 
 	void (*initialize) (GTypeModule  *module);
 	void (*shutdown)   (void);
 
 	void (*list_types) (const GType **types,
-			    int          *num_types);
+			    gint          *num_types);
 
 };
 
@@ -154,8 +154,8 @@ static void
 add_module_objects (EDataServerModule *module)
 {
 	const GType *types;
-	int num_types;
-	int i;
+	gint num_types;
+	gint i;
 
 	module->list_types (&types, &num_types);
 
@@ -165,7 +165,7 @@ add_module_objects (EDataServerModule *module)
 }
 
 static EDataServerModule *
-e_data_server_module_load_file (const char *filename)
+e_data_server_module_load_file (const gchar *filename)
 {
 	EDataServerModule *module;
 
@@ -183,18 +183,18 @@ e_data_server_module_load_file (const char *filename)
 }
 
 static void
-load_module_dir (const char *dirname)
+load_module_dir (const gchar *dirname)
 {
 	GDir *dir;
 
 	dir = g_dir_open (dirname, 0, NULL);
 
 	if (dir) {
-		const char *name;
+		const gchar *name;
 
 		while ((name = g_dir_read_name (dir))) {
 			if (g_str_has_suffix (name, "." G_MODULE_SUFFIX)) {
-				char *filename;
+				gchar *filename;
 
 				filename = g_build_filename (dirname,
 							     name,
diff --git a/libebackend/e-data-server-module.h b/libebackend/e-data-server-module.h
index 56d8a5b..a7e9c4a 100644
--- a/libebackend/e-data-server-module.h
+++ b/libebackend/e-data-server-module.h
@@ -40,7 +40,7 @@ void   e_data_server_module_add_type         (GType  type);
    written to be dynamically loaded */
 void                 eds_module_initialize (GTypeModule *module);
 void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, int *num_types);
+void                 eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/libebackend/e-db3-utils.c b/libebackend/e-db3-utils.c
index e9bd96f..e94c9e6 100644
--- a/libebackend/e-db3-utils.c
+++ b/libebackend/e-db3-utils.c
@@ -18,26 +18,26 @@
 
 #include "e-db3-utils.h"
 
-static char *
-get_check_filename (const char *filename)
+static gchar *
+get_check_filename (const gchar *filename)
 {
 	return g_strdup_printf ("%s-upgrading", filename);
 }
 
-static char *
-get_copy_filename (const char *filename)
+static gchar *
+get_copy_filename (const gchar *filename)
 {
 	return g_strdup_printf ("%s-copy", filename);
 }
 
 static int
-cp_file (const char *src, const char *dest)
+cp_file (const gchar *src, const gchar *dest)
 {
-	int i;
-	int o;
-	char buffer[1024];
-	int length;
-	int place;
+	gint i;
+	gint o;
+	gchar buffer[1024];
+	gint length;
+	gint place;
 
 	i = g_open (src, O_RDONLY | O_BINARY, 0);
 	if (i == -1)
@@ -66,7 +66,7 @@ cp_file (const char *src, const char *dest)
 
 		place = 0;
 		while (length != 0) {
-			int count;
+			gint count;
 			count = write (o, buffer + place, length);
 			if (count == -1) {
 				if (errno == EINTR)
@@ -90,9 +90,9 @@ cp_file (const char *src, const char *dest)
 }
 
 static int
-touch_file (const char *file)
+touch_file (const gchar *file)
 {
-	int o;
+	gint o;
 	o = g_open (file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE);
 	if (o == -1)
 		return -1;
@@ -101,10 +101,10 @@ touch_file (const char *file)
 }
 
 static int
-resume_upgrade (const char *filename, const char *copy_filename, const char *check_filename)
+resume_upgrade (const gchar *filename, const gchar *copy_filename, const gchar *check_filename)
 {
 	DB *db;
-	int ret_val;
+	gint ret_val;
 
 	ret_val = db_create (&db, NULL, 0);
 
@@ -124,12 +124,12 @@ resume_upgrade (const char *filename, const char *copy_filename, const char *che
 	return ret_val;
 }
 
-int
-e_db3_utils_maybe_recover (const char *filename)
+gint
+e_db3_utils_maybe_recover (const gchar *filename)
 {
-	int ret_val = 0;
-	char *copy_filename;
-	char *check_filename;
+	gint ret_val = 0;
+	gchar *copy_filename;
+	gchar *check_filename;
 
 	copy_filename = get_copy_filename (filename);
 	check_filename = get_check_filename (filename);
@@ -145,13 +145,13 @@ e_db3_utils_maybe_recover (const char *filename)
 	return ret_val;
 }
 
-int
-e_db3_utils_upgrade_format (const char *filename)
+gint
+e_db3_utils_upgrade_format (const gchar *filename)
 {
-	char *copy_filename;
-	char *check_filename;
+	gchar *copy_filename;
+	gchar *check_filename;
 	DB *db;
-	int ret_val;
+	gint ret_val;
 
 	ret_val = db_create (&db, NULL, 0);
 	if (ret_val != 0)
diff --git a/libebackend/e-db3-utils.h b/libebackend/e-db3-utils.h
index 8ddcee4..ace772b 100644
--- a/libebackend/e-db3-utils.h
+++ b/libebackend/e-db3-utils.h
@@ -15,8 +15,8 @@
 
 G_BEGIN_DECLS
 
-int e_db3_utils_maybe_recover (const char *filename);
-int e_db3_utils_upgrade_format (const char *filename);
+gint e_db3_utils_maybe_recover (const gchar *filename);
+gint e_db3_utils_upgrade_format (const gchar *filename);
 
 G_END_DECLS
 
diff --git a/libebackend/e-dbhash.c b/libebackend/e-dbhash.c
index 8f8f0fc..f720f84 100644
--- a/libebackend/e-dbhash.c
+++ b/libebackend/e-dbhash.c
@@ -20,11 +20,11 @@ struct _EDbHashPrivate
 };
 
 EDbHash *
-e_dbhash_new (const char *filename)
+e_dbhash_new (const gchar *filename)
 {
 	EDbHash *edbh;
 	DB *db;
-	int rv;
+	gint rv;
 
 	/* Attempt to open the database */
 	rv = db_create (&db, NULL, 0);
@@ -50,10 +50,10 @@ e_dbhash_new (const char *filename)
 }
 
 static void
-string_to_dbt(const char *str, DBT *dbt)
+string_to_dbt(const gchar *str, DBT *dbt)
 {
 	memset (dbt, 0, sizeof (DBT));
-	dbt->data = (void*)str;
+	dbt->data = (gpointer)str;
 	dbt->size = strlen (str) + 1;
 }
 
@@ -61,7 +61,7 @@ static void
 md5_to_dbt(const guint8 str[16], DBT *dbt)
 {
 	memset (dbt, 0, sizeof (DBT));
-	dbt->data = (void*)str;
+	dbt->data = (gpointer)str;
 	dbt->size = 16;
 }
 
@@ -103,7 +103,7 @@ e_dbhash_add (EDbHash *edbh, const gchar *key, const gchar *data)
 }
 
 void
-e_dbhash_remove (EDbHash *edbh, const char *key)
+e_dbhash_remove (EDbHash *edbh, const gchar *key)
 {
 	DB *db;
 	DBT dkey;
@@ -128,7 +128,7 @@ e_dbhash_foreach_key (EDbHash *edbh, EDbHashFunc func, gpointer user_data)
 	DBT dkey;
 	DBT ddata;
 	DBC *dbc;
-	int db_error = 0;
+	gint db_error = 0;
 
 	g_return_if_fail (edbh != NULL);
 	g_return_if_fail (edbh->priv != NULL);
@@ -147,7 +147,7 @@ e_dbhash_foreach_key (EDbHash *edbh, EDbHashFunc func, gpointer user_data)
 	db_error = dbc->c_get(dbc, &dkey, &ddata, DB_FIRST);
 
 	while (db_error == 0) {
-		(*func) ((const char *)dkey.data, user_data);
+		(*func) ((const gchar *)dkey.data, user_data);
 
 		db_error = dbc->c_get(dbc, &dkey, &ddata, DB_NEXT);
 	}
@@ -155,7 +155,7 @@ e_dbhash_foreach_key (EDbHash *edbh, EDbHashFunc func, gpointer user_data)
 }
 
 EDbHashStatus
-e_dbhash_compare (EDbHash *edbh, const char *key, const char *compare_data)
+e_dbhash_compare (EDbHash *edbh, const gchar *key, const gchar *compare_data)
 {
 	DB *db;
 	DBT dkey;
diff --git a/libebackend/e-dbhash.h b/libebackend/e-dbhash.h
index 9d7b7c5..ea231bf 100644
--- a/libebackend/e-dbhash.h
+++ b/libebackend/e-dbhash.h
@@ -29,14 +29,14 @@ struct _EDbHash
 	EDbHashPrivate *priv;
 };
 
-typedef void (*EDbHashFunc) (const char *key, gpointer user_data);
+typedef void (*EDbHashFunc) (const gchar *key, gpointer user_data);
 
-EDbHash *e_dbhash_new (const char *filename);
+EDbHash *e_dbhash_new (const gchar *filename);
 
-void e_dbhash_add (EDbHash *edbh, const char *key, const char *data);
-void e_dbhash_remove (EDbHash *edbh, const char *key);
+void e_dbhash_add (EDbHash *edbh, const gchar *key, const gchar *data);
+void e_dbhash_remove (EDbHash *edbh, const gchar *key);
 
-EDbHashStatus e_dbhash_compare (EDbHash *edbh, const char *key, const char *compare_data);
+EDbHashStatus e_dbhash_compare (EDbHash *edbh, const gchar *key, const gchar *compare_data);
 void e_dbhash_foreach_key (EDbHash *edbh, EDbHashFunc func, gpointer user_data);
 
 void e_dbhash_write (EDbHash *edbh);
diff --git a/libebackend/e-file-cache.c b/libebackend/e-file-cache.c
index a59219a..12ca96f 100644
--- a/libebackend/e-file-cache.c
+++ b/libebackend/e-file-cache.c
@@ -31,7 +31,7 @@
 #include "libedataserver/e-xml-hash-utils.h"
 
 struct _EFileCachePrivate {
-	char *filename;
+	gchar *filename;
 	EXmlHash *xml_hash;
 	gboolean dirty;
 	gboolean frozen;
@@ -50,8 +50,8 @@ e_file_cache_set_property (GObject *object, guint property_id, const GValue *val
 {
 	EFileCache *cache;
 	EFileCachePrivate *priv;
-	char *dirname;
-	int result;
+	gchar *dirname;
+	gint result;
 
 	cache = E_FILE_CACHE (object);
 	priv = cache->priv;
@@ -173,7 +173,7 @@ e_file_cache_init (EFileCache *cache)
  * Return value: The newly created object.
  */
 EFileCache *
-e_file_cache_new (const char *filename)
+e_file_cache_new (const gchar *filename)
 {
 	EFileCache *cache;
 
@@ -200,8 +200,8 @@ e_file_cache_remove (EFileCache *cache)
 	priv = cache->priv;
 
 	if (priv->filename) {
-		char *dirname, *full_path;
-		const char *fname;
+		gchar *dirname, *full_path;
+		const gchar *fname;
 		GDir *dir;
 		gboolean success;
 
@@ -243,11 +243,11 @@ e_file_cache_remove (EFileCache *cache)
 }
 
 static void
-add_key_to_slist (const char *key, const char *value, gpointer user_data)
+add_key_to_slist (const gchar *key, const gchar *value, gpointer user_data)
 {
 	GSList **keys = user_data;
 
-	*keys = g_slist_append (*keys, (char *) key);
+	*keys = g_slist_append (*keys, (gchar *) key);
 }
 
 /**
@@ -275,7 +275,7 @@ e_file_cache_clean (EFileCache *cache)
 
 	e_xmlhash_foreach_key (priv->xml_hash, (EXmlHashFunc) add_key_to_slist, &keys);
 	while (keys != NULL) {
-		e_file_cache_remove_object (cache, (const char *) keys->data);
+		e_file_cache_remove_object (cache, (const gchar *) keys->data);
 		keys = g_slist_remove (keys, keys->data);
 	}
 
@@ -286,9 +286,9 @@ e_file_cache_clean (EFileCache *cache)
 }
 
 typedef struct {
-	const char *key;
+	const gchar *key;
 	gboolean found;
-	const char *found_value;
+	const gchar *found_value;
 } CacheFindData;
 
 static void
@@ -299,17 +299,17 @@ find_object_in_hash (gpointer key, gpointer value, gpointer user_data)
 	if (find_data->found)
 		return;
 
-	if (!strcmp (find_data->key, (const char *) key)) {
+	if (!strcmp (find_data->key, (const gchar *) key)) {
 		find_data->found = TRUE;
-		find_data->found_value = (const char *) value;
+		find_data->found_value = (const gchar *) value;
 	}
 }
 
 /**
  * e_file_cache_get_object:
  */
-const char *
-e_file_cache_get_object (EFileCache *cache, const char *key)
+const gchar *
+e_file_cache_get_object (EFileCache *cache, const gchar *key)
 {
 	CacheFindData find_data;
 	EFileCachePrivate *priv;
@@ -329,11 +329,11 @@ e_file_cache_get_object (EFileCache *cache, const char *key)
 }
 
 static void
-add_object_to_slist (const char *key, const char *value, gpointer user_data)
+add_object_to_slist (const gchar *key, const gchar *value, gpointer user_data)
 {
 	GSList **list = user_data;
 
-	*list = g_slist_prepend (*list, (char *) value);
+	*list = g_slist_prepend (*list, (gchar *) value);
 }
 
 /**
@@ -376,7 +376,7 @@ e_file_cache_get_keys (EFileCache *cache)
  * e_file_cache_add_object:
  */
 gboolean
-e_file_cache_add_object (EFileCache *cache, const char *key, const char *value)
+e_file_cache_add_object (EFileCache *cache, const gchar *key, const gchar *value)
 {
 	EFileCachePrivate *priv;
 
@@ -403,7 +403,7 @@ e_file_cache_add_object (EFileCache *cache, const char *key, const char *value)
  * e_file_cache_replace_object:
  */
 gboolean
-e_file_cache_replace_object (EFileCache *cache, const char *key, const char *new_value)
+e_file_cache_replace_object (EFileCache *cache, const gchar *key, const gchar *new_value)
 {
 	EFileCachePrivate *priv;
 
@@ -425,7 +425,7 @@ e_file_cache_replace_object (EFileCache *cache, const char *key, const char *new
  * e_file_cache_remove_object:
  */
 gboolean
-e_file_cache_remove_object (EFileCache *cache, const char *key)
+e_file_cache_remove_object (EFileCache *cache, const gchar *key)
 {
 	EFileCachePrivate *priv;
 
@@ -496,10 +496,10 @@ e_file_cache_thaw_changes (EFileCache *cache)
  *
  * Return value: The name of the cache.
  */
-const char *
+const gchar *
 e_file_cache_get_filename (EFileCache *cache)
 {
 	g_return_val_if_fail (E_IS_FILE_CACHE (cache), NULL);
-	return (const char *) cache->priv->filename;
+	return (const gchar *) cache->priv->filename;
 }
 
diff --git a/libebackend/e-file-cache.h b/libebackend/e-file-cache.h
index 5ed8bb0..b708c0f 100644
--- a/libebackend/e-file-cache.h
+++ b/libebackend/e-file-cache.h
@@ -45,20 +45,20 @@ typedef struct {
 
 GType       e_file_cache_get_type (void);
 
-EFileCache *e_file_cache_new (const char *filename);
+EFileCache *e_file_cache_new (const gchar *filename);
 gboolean    e_file_cache_remove (EFileCache *cache);
 gboolean    e_file_cache_clean (EFileCache *cache);
 
-const char *e_file_cache_get_object (EFileCache *cache, const char *key);
+const gchar *e_file_cache_get_object (EFileCache *cache, const gchar *key);
 GSList     *e_file_cache_get_objects (EFileCache *cache);
 GSList     *e_file_cache_get_keys (EFileCache *cache);
-gboolean    e_file_cache_add_object (EFileCache *cache, const char *key, const char *value);
-gboolean    e_file_cache_replace_object (EFileCache *cache, const char *key, const char *new_value);
-gboolean    e_file_cache_remove_object (EFileCache *cache, const char *key);
+gboolean    e_file_cache_add_object (EFileCache *cache, const gchar *key, const gchar *value);
+gboolean    e_file_cache_replace_object (EFileCache *cache, const gchar *key, const gchar *new_value);
+gboolean    e_file_cache_remove_object (EFileCache *cache, const gchar *key);
 
 void        e_file_cache_freeze_changes (EFileCache *cache);
 void        e_file_cache_thaw_changes (EFileCache *cache);
-const char *e_file_cache_get_filename (EFileCache *cache);
+const gchar *e_file_cache_get_filename (EFileCache *cache);
 
 G_END_DECLS
 
diff --git a/libedataserver/e-account-list.c b/libedataserver/e-account-list.c
index 0c683f5..5e85f97 100644
--- a/libedataserver/e-account-list.c
+++ b/libedataserver/e-account-list.c
@@ -126,7 +126,7 @@ gconf_accounts_changed (GConfClient *client, guint cnxn_id,
 	EAccount *account;
 	EList *old_accounts;
 	EIterator *iter;
-	char *uid;
+	gchar *uid;
 
 	old_accounts = e_list_duplicate (E_LIST (account_list));
 
@@ -193,8 +193,8 @@ gconf_accounts_changed (GConfClient *client, guint cnxn_id,
 	g_object_unref (old_accounts);
 }
 
-static void *
-copy_func (const void *data, void *closure)
+static gpointer
+copy_func (gconstpointer data, gpointer closure)
 {
 	GObject *object = (GObject *)data;
 
@@ -203,7 +203,7 @@ copy_func (const void *data, void *closure)
 }
 
 static void
-free_func (void *data, void *closure)
+free_func (gpointer data, gpointer closure)
 {
 	g_object_unref (data);
 }
@@ -271,7 +271,7 @@ e_account_list_save (EAccountList *account_list)
 	GSList *list = NULL;
 	EAccount *account;
 	EIterator *iter;
-	char *xmlbuf;
+	gchar *xmlbuf;
 
 	for (iter = e_list_get_iterator (E_LIST (account_list));
 	     e_iterator_is_valid (iter);
@@ -327,7 +327,7 @@ e_account_list_remove_account_proxies (EAccountList *accounts, EAccount *account
 	e_account_list_save (accounts);
 }
 
-int
+gint
 e_account_list_account_has_proxies (EAccountList *accounts, EAccount *account)
 {
 	if (e_account_list_find (accounts, E_ACCOUNT_FIND_PARENT_UID, account->uid))
@@ -401,7 +401,7 @@ e_account_list_remove(EAccountList *accounts, EAccount *account)
 const EAccount *
 e_account_list_get_default(EAccountList *accounts)
 {
-	char *uid;
+	gchar *uid;
 	EIterator *it;
 	const EAccount *account = NULL;
 
@@ -460,9 +460,9 @@ e_account_list_set_default(EAccountList *accounts, EAccount *account)
  * Return value: The account or NULL if it doesn't exist.
  **/
 const EAccount *
-e_account_list_find(EAccountList *accounts, e_account_find_t type, const char *key)
+e_account_list_find(EAccountList *accounts, e_account_find_t type, const gchar *key)
 {
-	char *val;
+	gchar *val;
 	EIterator *it;
 	const EAccount *account = NULL;
 
@@ -475,7 +475,7 @@ e_account_list_find(EAccountList *accounts, e_account_find_t type, const char *k
 	for (it = e_list_get_iterator ((EList *)accounts);
 	     e_iterator_is_valid (it);
 	     e_iterator_next (it)) {
-		int found = 0;
+		gint found = 0;
 
 		account = (const EAccount *)e_iterator_get (it);
 
diff --git a/libedataserver/e-account-list.h b/libedataserver/e-account-list.h
index 10df7db..2d3f7ad 100644
--- a/libedataserver/e-account-list.h
+++ b/libedataserver/e-account-list.h
@@ -73,11 +73,11 @@ void            e_account_list_remove    (EAccountList *, EAccount *);
 
 const EAccount *e_account_list_get_default(EAccountList *);
 void            e_account_list_set_default(EAccountList *, EAccount *);
-const EAccount *e_account_list_find       (EAccountList *, e_account_find_t type, const char *key);
+const EAccount *e_account_list_find       (EAccountList *, e_account_find_t type, const gchar *key);
 
 void e_account_list_prune_proxies (EAccountList *);
 void e_account_list_remove_account_proxies (EAccountList *, EAccount *);
-int e_account_list_account_has_proxies (EAccountList *, EAccount *);
+gint e_account_list_account_has_proxies (EAccountList *, EAccount *);
 
 G_END_DECLS
 
diff --git a/libedataserver/e-account.c b/libedataserver/e-account.c
index 1a1cddb..943201d 100644
--- a/libedataserver/e-account.c
+++ b/libedataserver/e-account.c
@@ -191,7 +191,7 @@ e_account_new (void)
  * if @xml could not be parsed as valid account data.
  **/
 EAccount *
-e_account_new_from_xml (const char *xml)
+e_account_new_from_xml (const gchar *xml)
 {
 	EAccount *account;
 
@@ -206,13 +206,13 @@ e_account_new_from_xml (const char *xml)
 
 
 static gboolean
-xml_set_bool (xmlNodePtr node, const char *name, gboolean *val)
+xml_set_bool (xmlNodePtr node, const gchar *name, gboolean *val)
 {
 	gboolean bool;
 	xmlChar *buf;
 
 	if ((buf = xmlGetProp (node, (xmlChar*)name))) {
-		bool = (!strcmp ((char*)buf, "true") || !strcmp ((char*)buf, "yes"));
+		bool = (!strcmp ((gchar *)buf, "true") || !strcmp ((gchar *)buf, "yes"));
 		xmlFree (buf);
 
 		if (bool != *val) {
@@ -225,13 +225,13 @@ xml_set_bool (xmlNodePtr node, const char *name, gboolean *val)
 }
 
 static gboolean
-xml_set_int (xmlNodePtr node, const char *name, int *val)
+xml_set_int (xmlNodePtr node, const gchar *name, gint *val)
 {
-	int number;
+	gint number;
 	xmlChar *buf;
 
 	if ((buf = xmlGetProp (node, (xmlChar*)name))) {
-		number = strtol ((char*)buf, NULL, 10);
+		number = strtol ((gchar *)buf, NULL, 10);
 		xmlFree (buf);
 
 		if (number != *val) {
@@ -244,10 +244,10 @@ xml_set_int (xmlNodePtr node, const char *name, int *val)
 }
 
 static gboolean
-xml_set_prop (xmlNodePtr node, const char *name, char **val)
+xml_set_prop (xmlNodePtr node, const gchar *name, gchar **val)
 {
 	xmlChar *buf;
-	int res;
+	gint res;
 
 	buf = xmlGetProp (node, (xmlChar*)name);
 	if (buf == NULL) {
@@ -257,10 +257,10 @@ xml_set_prop (xmlNodePtr node, const char *name, char **val)
 			*val = NULL;
 		}
 	} else {
-		res = *val == NULL || strcmp(*val, (char*)buf) != 0;
+		res = *val == NULL || strcmp(*val, (gchar *)buf) != 0;
 		if (res) {
 			g_free(*val);
-			*val = g_strdup((char*)buf);
+			*val = g_strdup((gchar *)buf);
 		}
 		xmlFree(buf);
 	}
@@ -271,9 +271,9 @@ xml_set_prop (xmlNodePtr node, const char *name, char **val)
 static EAccountReceiptPolicy
 str_to_receipt_policy (const xmlChar *str)
 {
-	if (!strcmp ((char*)str, "ask"))
+	if (!strcmp ((gchar *)str, "ask"))
 		return E_ACCOUNT_RECEIPT_ASK;
-	if (!strcmp ((char*)str, "always"))
+	if (!strcmp ((gchar *)str, "always"))
 		return E_ACCOUNT_RECEIPT_ALWAYS;
 
 	return E_ACCOUNT_RECEIPT_NEVER;
@@ -282,7 +282,7 @@ str_to_receipt_policy (const xmlChar *str)
 static xmlChar*
 receipt_policy_to_str (EAccountReceiptPolicy val)
 {
-	const char *ret = NULL;
+	const gchar *ret = NULL;
 
 	switch (val) {
 	case E_ACCOUNT_RECEIPT_NEVER:
@@ -300,7 +300,7 @@ receipt_policy_to_str (EAccountReceiptPolicy val)
 }
 
 static gboolean
-xml_set_receipt_policy (xmlNodePtr node, const char *name, EAccountReceiptPolicy *val)
+xml_set_receipt_policy (xmlNodePtr node, const gchar *name, EAccountReceiptPolicy *val)
 {
 	EAccountReceiptPolicy new_val;
 	xmlChar *buf;
@@ -319,10 +319,10 @@ xml_set_receipt_policy (xmlNodePtr node, const char *name, EAccountReceiptPolicy
 }
 
 static gboolean
-xml_set_content (xmlNodePtr node, char **val)
+xml_set_content (xmlNodePtr node, gchar **val)
 {
 	xmlChar *buf;
-	int res;
+	gint res;
 
 	buf = xmlNodeGetContent(node);
 	if (buf == NULL) {
@@ -332,10 +332,10 @@ xml_set_content (xmlNodePtr node, char **val)
 			*val = NULL;
 		}
 	} else {
-		res = *val == NULL || strcmp(*val, (char*)buf) != 0;
+		res = *val == NULL || strcmp(*val, (gchar *)buf) != 0;
 		if (res) {
 			g_free(*val);
-			*val = g_strdup((char*)buf);
+			*val = g_strdup((gchar *)buf);
 		}
 		xmlFree(buf);
 	}
@@ -349,15 +349,15 @@ xml_set_identity (xmlNodePtr node, EAccountIdentity *id)
 	gboolean changed = FALSE;
 
 	for (node = node->children; node; node = node->next) {
-		if (!strcmp ((char*)node->name, "name"))
+		if (!strcmp ((gchar *)node->name, "name"))
 			changed |= xml_set_content (node, &id->name);
-		else if (!strcmp ((char*)node->name, "addr-spec"))
+		else if (!strcmp ((gchar *)node->name, "addr-spec"))
 			changed |= xml_set_content (node, &id->address);
-		else if (!strcmp ((char*)node->name, "reply-to"))
+		else if (!strcmp ((gchar *)node->name, "reply-to"))
 			changed |= xml_set_content (node, &id->reply_to);
-		else if (!strcmp ((char*)node->name, "organization"))
+		else if (!strcmp ((gchar *)node->name, "organization"))
 			changed |= xml_set_content (node, &id->organization);
-		else if (!strcmp ((char*)node->name, "signature")) {
+		else if (!strcmp ((gchar *)node->name, "signature")) {
 			changed |= xml_set_prop (node, "uid", &id->sig_uid);
 			if (!id->sig_uid) {
 
@@ -365,7 +365,7 @@ xml_set_identity (xmlNodePtr node, EAccountIdentity *id)
 
 				/* set a fake sig uid so the migrate code can handle this */
 				gboolean autogen = FALSE;
-				int sig_id = 0;
+				gint sig_id = 0;
 
 				xml_set_bool (node, "auto", &autogen);
 				xml_set_int (node, "default", &sig_id);
@@ -400,7 +400,7 @@ xml_set_service (xmlNodePtr node, EAccountService *service)
 	}
 
 	for (node = node->children; node; node = node->next) {
-		if (!strcmp ((char*)node->name, "url")) {
+		if (!strcmp ((gchar *)node->name, "url")) {
 			changed |= xml_set_content (node, &service->url);
 			break;
 		}
@@ -420,7 +420,7 @@ xml_set_service (xmlNodePtr node, EAccountService *service)
  * already matched @xml or @xml could not be parsed
  **/
 gboolean
-e_account_set_from_xml (EAccount *account, const char *xml)
+e_account_set_from_xml (EAccount *account, const gchar *xml)
 {
 	xmlNodePtr node, cur;
 	xmlDocPtr doc;
@@ -430,7 +430,7 @@ e_account_set_from_xml (EAccount *account, const char *xml)
 		return FALSE;
 
 	node = doc->children;
-	if (strcmp ((char*)node->name, "account") != 0) {
+	if (strcmp ((gchar *)node->name, "account") != 0) {
 		xmlFreeDoc (doc);
 		return FALSE;
 	}
@@ -442,25 +442,25 @@ e_account_set_from_xml (EAccount *account, const char *xml)
 	changed |= xml_set_bool (node, "enabled", &account->enabled);
 
 	for (node = node->children; node; node = node->next) {
-		if (!strcmp ((char*)node->name, "identity")) {
+		if (!strcmp ((gchar *)node->name, "identity")) {
 			changed |= xml_set_identity (node, account->id);
-		} else if (!strcmp ((char*)node->name, "source")) {
+		} else if (!strcmp ((gchar *)node->name, "source")) {
 			changed |= xml_set_service (node, account->source);
-		} else if (!strcmp ((char*)node->name, "transport")) {
+		} else if (!strcmp ((gchar *)node->name, "transport")) {
 			changed |= xml_set_service (node, account->transport);
-		} else if (!strcmp ((char*)node->name, "drafts-folder")) {
+		} else if (!strcmp ((gchar *)node->name, "drafts-folder")) {
 			changed |= xml_set_content (node, &account->drafts_folder_uri);
-		} else if (!strcmp ((char*)node->name, "sent-folder")) {
+		} else if (!strcmp ((gchar *)node->name, "sent-folder")) {
 			changed |= xml_set_content (node, &account->sent_folder_uri);
-		} else if (!strcmp ((char*)node->name, "auto-cc")) {
+		} else if (!strcmp ((gchar *)node->name, "auto-cc")) {
 			changed |= xml_set_bool (node, "always", &account->always_cc);
 			changed |= xml_set_content (node, &account->cc_addrs);
-		} else if (!strcmp ((char*)node->name, "auto-bcc")) {
+		} else if (!strcmp ((gchar *)node->name, "auto-bcc")) {
 			changed |= xml_set_bool (node, "always", &account->always_bcc);
 			changed |= xml_set_content (node, &account->bcc_addrs);
-		} else if (!strcmp ((char*)node->name, "receipt-policy")) {
+		} else if (!strcmp ((gchar *)node->name, "receipt-policy")) {
 			changed |= xml_set_receipt_policy (node, "policy", &account->receipt_policy);
-		} else if (!strcmp ((char*)node->name, "pgp")) {
+		} else if (!strcmp ((gchar *)node->name, "pgp")) {
 			changed |= xml_set_bool (node, "encrypt-to-self", &account->pgp_encrypt_to_self);
 			changed |= xml_set_bool (node, "always-trust", &account->pgp_always_trust);
 			changed |= xml_set_bool (node, "always-sign", &account->pgp_always_sign);
@@ -468,31 +468,31 @@ e_account_set_from_xml (EAccount *account, const char *xml)
 
 			if (node->children) {
 				for (cur = node->children; cur; cur = cur->next) {
-					if (!strcmp ((char*)cur->name, "key-id")) {
+					if (!strcmp ((gchar *)cur->name, "key-id")) {
 						changed |= xml_set_content (cur, &account->pgp_key);
 						break;
 					}
 				}
 			}
-		} else if (!strcmp ((char*)node->name, "smime")) {
+		} else if (!strcmp ((gchar *)node->name, "smime")) {
 			changed |= xml_set_bool (node, "sign-default", &account->smime_sign_default);
 			changed |= xml_set_bool (node, "encrypt-to-self", &account->smime_encrypt_to_self);
 			changed |= xml_set_bool (node, "encrypt-default", &account->smime_encrypt_default);
 
 			if (node->children) {
 				for (cur = node->children; cur; cur = cur->next) {
-					if (!strcmp ((char*)cur->name, "sign-key-id")) {
+					if (!strcmp ((gchar *)cur->name, "sign-key-id")) {
 						changed |= xml_set_content (cur, &account->smime_sign_key);
-					} else if (!strcmp ((char*)cur->name, "encrypt-key-id")) {
+					} else if (!strcmp ((gchar *)cur->name, "encrypt-key-id")) {
 						changed |= xml_set_content (cur, &account->smime_encrypt_key);
 						break;
 					}
 				}
 			}
-		} else if (!strcmp ((char*)node->name, "proxy")) {
+		} else if (!strcmp ((gchar *)node->name, "proxy")) {
 			if (node->children) {
 				for (cur = node->children; cur; cur = cur->next) {
-					if (!strcmp ((char*)cur->name, "parent-uid")) {
+					if (!strcmp ((gchar *)cur->name, "parent-uid")) {
 						changed |= xml_set_content (cur, &account->parent_uid);
 						break;
 					}
@@ -588,14 +588,14 @@ e_account_import (EAccount *dest, EAccount *src)
  * Return value: an XML representation of @account, which the caller
  * must free.
  **/
-char *
+gchar *
 e_account_to_xml (EAccount *account)
 {
 	xmlNodePtr root, node, id, src, xport;
-	char *tmp, buf[20];
+	gchar *tmp, buf[20];
 	xmlChar *xmlbuf;
 	xmlDocPtr doc;
-	int n;
+	gint n;
 
 	doc = xmlNewDoc ((xmlChar*)"1.0");
 
@@ -692,18 +692,18 @@ e_account_to_xml (EAccount *account)
  * (or %NULL if @xml could not be parsed or did not contain a uid).
  * The caller must free this string.
  **/
-char *
-e_account_uid_from_xml (const char *xml)
+gchar *
+e_account_uid_from_xml (const gchar *xml)
 {
 	xmlNodePtr node;
 	xmlDocPtr doc;
-	char *uid = NULL;
+	gchar *uid = NULL;
 
 	if (!(doc = xmlParseDoc ((xmlChar *)xml)))
 		return NULL;
 
 	node = doc->children;
-	if (strcmp ((char*)node->name, "account") != 0) {
+	if (strcmp ((gchar *)node->name, "account") != 0) {
 		xmlFreeDoc (doc);
 		return NULL;
 	}
@@ -730,7 +730,7 @@ enum {
 };
 
 static struct _system_info {
-	const char *key;
+	const gchar *key;
 	guint32 perm;
 } system_perms[] = {
 	{ "imap_subscribed", 1<<EAP_IMAP_SUBSCRIBED },
@@ -756,8 +756,8 @@ static struct _system_info {
 static struct _account_info {
 	guint32 perms;
 	guint32 type;
-	unsigned int offset;
-	unsigned int struct_offset;
+	guint offset;
+	guint struct_offset;
 } account_info[E_ACCOUNT_ITEM_LAST] = {
 	{ /* E_ACCOUNT_NAME */ 0, TYPE_STRING, G_STRUCT_OFFSET(EAccount, name) },
 
@@ -807,7 +807,7 @@ static GHashTable *ea_system_table;
 static guint32 ea_perms;
 
 static struct _option_info {
-	const char *key;
+	const gchar *key;
 	guint32 perms;
 } ea_option_list[] = {
 	{ "imap_use_lsub", 1<<EAP_IMAP_SUBSCRIBED },
@@ -822,10 +822,10 @@ static struct _option_info {
 #define LOCK_BASE "/apps/evolution/lock/mail/accounts"
 
 static void
-ea_setting_notify (GConfClient *gconf, guint cnxn_id, GConfEntry *entry, void *crap)
+ea_setting_notify (GConfClient *gconf, guint cnxn_id, GConfEntry *entry, gpointer crap)
 {
 	GConfValue *value;
-	char *tkey;
+	gchar *tkey;
 	struct _system_info *info;
 
 	g_return_if_fail (gconf_entry_get_key (entry) != NULL);
@@ -851,8 +851,8 @@ ea_setting_setup (void)
 	GConfClient *gconf = gconf_client_get_default();
 	GConfEntry *entry;
 	GError *err = NULL;
-	int i;
-	char key[64];
+	gint i;
+	gchar key[64];
 
 	if (ea_option_table != NULL)
 		return;
@@ -865,7 +865,7 @@ ea_setting_setup (void)
 
 	ea_system_table = g_hash_table_new(g_str_hash, g_str_equal);
 	for (i=0;i<sizeof(system_perms)/sizeof(system_perms[0]);i++) {
-		g_hash_table_insert(ea_system_table, (char *)system_perms[i].key, &system_perms[i]);
+		g_hash_table_insert(ea_system_table, (gchar *)system_perms[i].key, &system_perms[i]);
 		sprintf(key, LOCK_BASE "/%s", system_perms[i].key);
 		entry = gconf_client_get_entry(gconf, key, NULL, TRUE, &err);
 		if (entry) {
@@ -886,21 +886,21 @@ ea_setting_setup (void)
 /* look up the item in the structure or the substructure using our table of reflection data */
 #define addr(ea, type) \
 	((account_info[type].type & TYPE_STRUCT)? \
-	(((char **)(((char *)ea)+account_info[type].offset))[0] + account_info[type].struct_offset): \
-	(((char *)ea)+account_info[type].offset))
+	(((gchar **)(((gchar *)ea)+account_info[type].offset))[0] + account_info[type].struct_offset): \
+	(((gchar *)ea)+account_info[type].offset))
 
-const char*
+const gchar *
 e_account_get_string (EAccount *ea, e_account_item_t type)
 {
 	g_return_val_if_fail (ea != NULL, NULL);
-	return *((const char **)addr(ea, type));
+	return *((const gchar **)addr(ea, type));
 }
 
-int
+gint
 e_account_get_int (EAccount *ea, e_account_item_t type)
 {
 	g_return_val_if_fail (ea != NULL, 0);
-	return *((int *)addr(ea, type));
+	return *((gint *)addr(ea, type));
 }
 
 gboolean
@@ -914,7 +914,7 @@ e_account_get_bool (EAccount *ea, e_account_item_t type)
 static void
 dump_account (EAccount *ea)
 {
-	char *xml;
+	gchar *xml;
 
 	printf("Account changed\n");
 	xml = e_account_to_xml(ea);
@@ -925,16 +925,16 @@ dump_account (EAccount *ea)
 
 /* TODO: should it return true if it changed? */
 void
-e_account_set_string (EAccount *ea, e_account_item_t type, const char *val)
+e_account_set_string (EAccount *ea, e_account_item_t type, const gchar *val)
 {
-	char **p;
+	gchar **p;
 
 	g_return_if_fail (ea != NULL);
 
 	if (!e_account_writable(ea, type)) {
 		g_warning("Trying to set non-writable option account value");
 	} else {
-		p = (char **)addr(ea, type);
+		p = (gchar **)addr(ea, type);
 		d(printf("Setting string %d: old '%s' new '%s'\n", type, *p, val));
 		if (*p != val
 		    && (*p == NULL || val == NULL || strcmp(*p, val) != 0)) {
@@ -947,14 +947,14 @@ e_account_set_string (EAccount *ea, e_account_item_t type, const char *val)
 }
 
 void
-e_account_set_int (EAccount *ea, e_account_item_t type, int val)
+e_account_set_int (EAccount *ea, e_account_item_t type, gint val)
 {
 	g_return_if_fail (ea != NULL);
 
 	if (!e_account_writable(ea, type)) {
 		g_warning("Trying to set non-writable option account value");
 	} else {
-		int *p = (int *)addr(ea, type);
+		gint *p = (gint *)addr(ea, type);
 
 		if (*p != val) {
 			*p = val;
@@ -983,9 +983,9 @@ e_account_set_bool (EAccount *ea, e_account_item_t type, gboolean val)
 }
 
 gboolean
-e_account_writable_option (EAccount *ea, const char *protocol, const char *option)
+e_account_writable_option (EAccount *ea, const gchar *protocol, const gchar *option)
 {
-	char *key;
+	gchar *key;
 	struct _option_info *info;
 
 	ea_setting_setup();
diff --git a/libedataserver/e-account.h b/libedataserver/e-account.h
index 4d92103..8aa702e 100644
--- a/libedataserver/e-account.h
+++ b/libedataserver/e-account.h
@@ -81,12 +81,12 @@ typedef enum _e_account_access_t {
 } e_account_access_t;
 
 typedef struct _EAccountIdentity {
-	char *name;
-	char *address;
-	char *reply_to;
-	char *organization;
+	gchar *name;
+	gchar *address;
+	gchar *reply_to;
+	gchar *organization;
 
-	char *sig_uid;
+	gchar *sig_uid;
 } EAccountIdentity;
 
 typedef enum _EAccountReceiptPolicy {
@@ -96,10 +96,10 @@ typedef enum _EAccountReceiptPolicy {
 } EAccountReceiptPolicy;
 
 typedef struct _EAccountService {
-	char *url;
+	gchar *url;
 	gboolean keep_on_server;
 	gboolean auto_check;
-	int auto_check_time;
+	gint auto_check_time;
 	gboolean save_passwd;
 	gboolean get_password_canceled;
 } EAccountService;
@@ -107,8 +107,8 @@ typedef struct _EAccountService {
 typedef struct _EAccount {
 	GObject parent_object;
 
-	char *name;
-	char *uid;
+	gchar *name;
+	gchar *uid;
 
 	gboolean enabled;
 
@@ -116,25 +116,25 @@ typedef struct _EAccount {
 	EAccountService *source;
 	EAccountService *transport;
 
-	char *drafts_folder_uri, *sent_folder_uri, *templates_folder_uri;
+	gchar *drafts_folder_uri, *sent_folder_uri, *templates_folder_uri;
 
 	gboolean always_cc;
-	char *cc_addrs;
+	gchar *cc_addrs;
 	gboolean always_bcc;
-	char *bcc_addrs;
+	gchar *bcc_addrs;
 
 	EAccountReceiptPolicy receipt_policy;
 
-	char *pgp_key;
+	gchar *pgp_key;
 	gboolean pgp_encrypt_to_self;
 	gboolean pgp_always_sign;
 	gboolean pgp_no_imip_sign;
 	gboolean pgp_always_trust;
 
-	char *parent_uid;
+	gchar *parent_uid;
 
-	char *smime_sign_key;
-	char *smime_encrypt_key;
+	gchar *smime_sign_key;
+	gchar *smime_encrypt_key;
 	gboolean smime_sign_default;
 	gboolean smime_encrypt_to_self;
 	gboolean smime_encrypt_default;
@@ -143,7 +143,7 @@ typedef struct _EAccount {
 typedef struct {
 	GObjectClass parent_class;
 
-	void (*changed)(EAccount *, int field);
+	void (*changed)(EAccount *, gint field);
 } EAccountClass;
 
 
@@ -151,30 +151,30 @@ GType     e_account_get_type (void);
 
 EAccount *e_account_new          (void);
 
-EAccount *e_account_new_from_xml (const char *xml);
+EAccount *e_account_new_from_xml (const gchar *xml);
 
 gboolean  e_account_set_from_xml (EAccount   *account,
-				  const char *xml);
+				  const gchar *xml);
 
 void      e_account_import       (EAccount   *dest,
 				  EAccount   *src);
 
-char     *e_account_to_xml       (EAccount   *account);
+gchar     *e_account_to_xml       (EAccount   *account);
 
 
-char     *e_account_uid_from_xml (const char *xml);
+gchar     *e_account_uid_from_xml (const gchar *xml);
 
-const char *e_account_get_string (EAccount *,
+const gchar *e_account_get_string (EAccount *,
 				  e_account_item_t type);
 
-int       e_account_get_int      (EAccount *,
+gint       e_account_get_int      (EAccount *,
 				  e_account_item_t type);
 
 gboolean  e_account_get_bool     (EAccount *,
 				  e_account_item_t type);
 
 void      e_account_set_string   (EAccount *,
-				  e_account_item_t type, const char *);
+				  e_account_item_t type, const gchar *);
 
 void      e_account_set_int      (EAccount *,
 				  e_account_item_t type, int);
@@ -186,8 +186,8 @@ gboolean  e_account_writable     (EAccount *ea,
 				  e_account_item_t type);
 
 gboolean  e_account_writable_option (EAccount *ea,
-				  const char *protocol,
-				  const char *option);
+				  const gchar *protocol,
+				  const gchar *option);
 
 G_END_DECLS
 
diff --git a/libedataserver/e-categories.c b/libedataserver/e-categories.c
index 7494a73..7e19d84 100644
--- a/libedataserver/e-categories.c
+++ b/libedataserver/e-categories.c
@@ -505,7 +505,7 @@ e_categories_get_list (void)
  * configuration database.
  */
 void
-e_categories_add (const char *category, const char *unused, const char *icon_file, gboolean searchable)
+e_categories_add (const gchar *category, const gchar *unused, const gchar *icon_file, gboolean searchable)
 {
 	CategoryInfo *cat_info;
 
@@ -533,7 +533,7 @@ e_categories_add (const char *category, const char *unused, const char *icon_fil
  * Removes the given category from the configuration.
  */
 void
-e_categories_remove (const char *category)
+e_categories_remove (const gchar *category)
 {
 	g_return_if_fail (category != NULL);
 
@@ -555,7 +555,7 @@ e_categories_remove (const char *category)
  * Return value: %TRUE if the category is available, %FALSE otherwise.
  */
 gboolean
-e_categories_exist (const char *category)
+e_categories_exist (const gchar *category)
 {
 	g_return_val_if_fail (category != NULL, FALSE);
 
@@ -574,8 +574,8 @@ e_categories_exist (const char *category)
  *
  * DEPRECATED!
  */
-const char *
-e_categories_get_color_for (const char *category)
+const gchar *
+e_categories_get_color_for (const gchar *category)
 {
 	return NULL;
 }
@@ -590,7 +590,7 @@ e_categories_get_color_for (const char *category)
  * DEPRECATED!
  */
 void
-e_categories_set_color_for (const char *category, const char *color)
+e_categories_set_color_for (const gchar *category, const gchar *color)
 {
 }
 #endif /* EDS_DISABLE_DEPRECATED */
@@ -603,8 +603,8 @@ e_categories_set_color_for (const char *category, const char *color)
  *
  * Return value: icon file name.
  */
-const char *
-e_categories_get_icon_file_for (const char *category)
+const gchar *
+e_categories_get_icon_file_for (const gchar *category)
 {
 	CategoryInfo *cat_info;
 
@@ -628,7 +628,7 @@ e_categories_get_icon_file_for (const char *category)
  * Sets the icon file associated with the given category.
  */
 void
-e_categories_set_icon_file_for (const char *category, const char *icon_file)
+e_categories_set_icon_file_for (const gchar *category, const gchar *icon_file)
 {
 	CategoryInfo *cat_info;
 
@@ -655,7 +655,7 @@ e_categories_set_icon_file_for (const char *category, const char *icon_file)
  * Return value; %TRUE% if the category is searchable, %FALSE% if not.
  */
 gboolean
-e_categories_is_searchable (const char *category)
+e_categories_is_searchable (const gchar *category)
 {
 	CategoryInfo *cat_info;
 
diff --git a/libedataserver/e-categories.h b/libedataserver/e-categories.h
index f6117e9..0d370e8 100644
--- a/libedataserver/e-categories.h
+++ b/libedataserver/e-categories.h
@@ -27,18 +27,18 @@ G_BEGIN_DECLS
 GList      *e_categories_get_list (void);
 
 /* 'unused' parameter was 'color', but it is deprecated now (see bug #308815) */
-void        e_categories_add (const char *category, const char *unused, const char *icon_file, gboolean searchable);
+void        e_categories_add (const gchar *category, const gchar *unused, const gchar *icon_file, gboolean searchable);
 
-void        e_categories_remove (const char *category);
+void        e_categories_remove (const gchar *category);
 
-gboolean    e_categories_exist (const char *category);
+gboolean    e_categories_exist (const gchar *category);
 #ifndef EDS_DISABLE_DEPRECATED
-const char *e_categories_get_color_for (const char *category);
-void        e_categories_set_color_for (const char *category, const char *color);
+const gchar *e_categories_get_color_for (const gchar *category);
+void        e_categories_set_color_for (const gchar *category, const gchar *color);
 #endif
-const char *e_categories_get_icon_file_for (const char *category);
-void        e_categories_set_icon_file_for (const char *category, const char *icon_file);
-gboolean    e_categories_is_searchable (const char *category);
+const gchar *e_categories_get_icon_file_for (const gchar *category);
+void        e_categories_set_icon_file_for (const gchar *category, const gchar *icon_file);
+gboolean    e_categories_is_searchable (const gchar *category);
 
 void e_categories_register_change_listener   (GCallback listener, gpointer user_data);
 void e_categories_unregister_change_listener (GCallback listener, gpointer user_data);
diff --git a/libedataserver/e-data-server-util.c b/libedataserver/e-data-server-util.c
index ce4e445..507cdac 100644
--- a/libedataserver/e-data-server-util.c
+++ b/libedataserver/e-data-server-util.c
@@ -46,8 +46,8 @@
  *
  * Returns: 0 on success; -1 on failure.
  **/
-int
-e_util_mkdir_hier (const char *path, mode_t mode)
+gint
+e_util_mkdir_hier (const gchar *path, mode_t mode)
 {
 	return g_mkdir_with_parents (path, mode);
 }
@@ -141,7 +141,7 @@ e_util_utf8_strstrcase (const gchar *haystack, const gchar *needle)
         for (p = e_util_unicode_get_utf8 (o, &unival); p && unival; p = e_util_unicode_get_utf8 (p, &unival)) {
                 gunichar sc;
                 sc = g_unichar_tolower (unival);
-                /* We have valid stripped char */
+                /* We have valid stripped gchar */
                 if (sc == nuni[0]) {
                         const gchar *q = p;
                         gint npos = 1;
@@ -240,7 +240,7 @@ e_util_utf8_strstrcasedecomp (const gchar *haystack, const gchar *needle)
                 gunichar sc;
                 sc = stripped_char (unival);
                 if (sc) {
-                        /* We have valid stripped char */
+                        /* We have valid stripped gchar */
                         if (sc == nuni[0]) {
                                 const gchar *q = p;
                                 gint npos = 1;
@@ -262,11 +262,11 @@ e_util_utf8_strstrcasedecomp (const gchar *haystack, const gchar *needle)
         return NULL;
 }
 
-int
+gint
 e_util_utf8_strcasecmp (const gchar *s1, const gchar *s2)
 {
 	gchar *folded_s1, *folded_s2;
-	int retval;
+	gint retval;
 
 	g_return_val_if_fail (s1 != NULL && s2 != NULL, -1);
 
@@ -290,10 +290,10 @@ e_util_utf8_strcasecmp (const gchar *s1, const gchar *s2)
  * Returns newly allocates string, copy of 'str', without accents.
  **/
 gchar *
-e_util_utf8_remove_accents (const char *str)
+e_util_utf8_remove_accents (const gchar *str)
 {
-	char *res;
-	int i, j;
+	gchar *res;
+	gint i, j;
 
 	if (!str)
 		return NULL;
@@ -328,13 +328,13 @@ e_util_utf8_remove_accents (const char *str)
  *
  * Returns: The number of characters placed in @s.
  **/
-size_t e_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
+size_t e_strftime(gchar *s, size_t max, const gchar *fmt, const struct tm *tm)
 {
 	size_t ret;
 #ifdef HAVE_LKSTRFTIME
 	ret = strftime(s, max, fmt, tm);
 #else
-	char *c, *ffmt, *ff;
+	gchar *c, *ffmt, *ff;
 
 	ffmt = g_strdup(fmt);
 	ff = ffmt;
@@ -378,10 +378,10 @@ size_t e_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
  * Returns: The number of characters placed in @s.
  **/
 size_t
-e_utf8_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
+e_utf8_strftime(gchar *s, size_t max, const gchar *fmt, const struct tm *tm)
 {
 	size_t sz, ret;
-	char *locale_fmt, *buf;
+	gchar *locale_fmt, *buf;
 
 	locale_fmt = g_locale_from_utf8(fmt, -1, NULL, &sz, NULL);
 	if (!locale_fmt)
@@ -400,7 +400,7 @@ e_utf8_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
 	}
 
 	if (sz >= max) {
-		char *tmp = buf + max - 1;
+		gchar *tmp = buf + max - 1;
 		tmp = g_utf8_find_prev_char(buf, tmp);
 		if (tmp)
 			sz = tmp - buf;
@@ -490,9 +490,9 @@ e_filename_make_safe (gchar *string)
 	gchar *p, *ts;
 	gunichar c;
 #ifdef G_OS_WIN32
-	const char *unsafe_chars = " /'\"`&();|<>$%{}!\\:*?#";
+	const gchar *unsafe_chars = " /'\"`&();|<>$%{}!\\:*?#";
 #else
-	const char *unsafe_chars = " /'\"`&();|<>$%{}!#";
+	const gchar *unsafe_chars = " /'\"`&();|<>$%{}!#";
 #endif
 
 	g_return_if_fail (string != NULL);
@@ -548,11 +548,11 @@ e_filename_make_safe (gchar *string)
  */
 static void
 get_prefixes (gpointer  hmodule,
-	      char    **full_prefix,
-	      char    **cp_prefix)
+	      gchar    **full_prefix,
+	      gchar    **cp_prefix)
 {
         wchar_t wcbfr[1000];
-        char cpbfr[1000];
+        gchar cpbfr[1000];
 
         g_return_if_fail (full_prefix != NULL);
         g_return_if_fail (cp_prefix != NULL);
@@ -599,13 +599,13 @@ get_prefixes (gpointer  hmodule,
         }
 }
 
-static const char *prefix = NULL;
-static const char *cp_prefix;
+static const gchar *prefix = NULL;
+static const gchar *cp_prefix;
 
-static const char *localedir;
-static const char *extensiondir;
-static const char *imagesdir;
-static const char *ui_gladedir;
+static const gchar *localedir;
+static const gchar *extensiondir;
+static const gchar *imagesdir;
+static const gchar *ui_gladedir;
 
 static HMODULE hmodule;
 G_LOCK_DEFINE_STATIC (mutex);
@@ -629,14 +629,14 @@ DllMain (HINSTANCE hinstDLL,
         return TRUE;
 }
 
-char *
-e_util_replace_prefix (const char *configure_time_prefix,
-		       const char *runtime_prefix,
-		       const char *configure_time_path)
+gchar *
+e_util_replace_prefix (const gchar *configure_time_prefix,
+		       const gchar *runtime_prefix,
+		       const gchar *configure_time_path)
 {
-	char *c_t_prefix_slash = g_strconcat (configure_time_prefix, "/",
+	gchar *c_t_prefix_slash = g_strconcat (configure_time_prefix, "/",
 					      NULL);
-	char *retval;
+	gchar *retval;
 
         if (runtime_prefix &&
             g_str_has_prefix (configure_time_path, c_t_prefix_slash)) {
@@ -651,9 +651,9 @@ e_util_replace_prefix (const char *configure_time_prefix,
 	return retval;
 }
 
-static char *
-replace_prefix (const char *runtime_prefix,
-		const char *configure_time_path)
+static gchar *
+replace_prefix (const gchar *runtime_prefix,
+		const gchar *configure_time_path)
 {
 	return e_util_replace_prefix (E_DATA_SERVER_PREFIX,
 				      runtime_prefix,
@@ -663,8 +663,8 @@ replace_prefix (const char *runtime_prefix,
 static void
 setup (void)
 {
-	char *full_pfx;
-	char *cp_pfx;
+	gchar *full_pfx;
+	gchar *cp_pfx;
 
         G_LOCK (mutex);
         if (prefix != NULL) {
@@ -698,12 +698,12 @@ setup (void)
 }
 
 #define PRIVATE_GETTER(varbl)			\
-const char *					\
+const gchar *					\
 _libedataserver_get_##varbl (void)		\
 	GETTER_IMPL(varbl)
 
 #define PUBLIC_GETTER(varbl)			\
-const char *					\
+const gchar *					\
 e_util_get_##varbl (void)			\
 	GETTER_IMPL(varbl)
 
diff --git a/libedataserver/e-data-server-util.h b/libedataserver/e-data-server-util.h
index bd0cc41..9628180 100644
--- a/libedataserver/e-data-server-util.h
+++ b/libedataserver/e-data-server-util.h
@@ -32,7 +32,7 @@ struct tm;
 
 #ifndef EDS_DISABLE_DEPRECATED
 G_GNUC_DEPRECATED
-int          e_util_mkdir_hier (const char *path, mode_t mode);
+gint          e_util_mkdir_hier (const gchar *path, mode_t mode);
 #endif
 
 gchar       *e_util_strstrcase (const gchar *haystack, const gchar *needle);
@@ -40,18 +40,18 @@ gchar       *e_util_unicode_get_utf8 (const gchar *text, gunichar *out);
 const gchar *e_util_utf8_strstrcase (const gchar *haystack, const gchar *needle);
 const gchar *e_util_utf8_strstrcasedecomp (const gchar *haystack, const gchar *needle);
 int	     e_util_utf8_strcasecmp (const gchar *s1, const gchar *s2);
-gchar       *e_util_utf8_remove_accents (const char *str);
+gchar       *e_util_utf8_remove_accents (const gchar *str);
 guint64      e_util_pthread_id (pthread_t t);
 void         e_filename_make_safe (gchar *string);
 
-size_t e_utf8_strftime(char *s, size_t max, const char *fmt, const struct tm *tm);
-size_t e_strftime(char *s, size_t max, const char *fmt, const struct tm *tm);
+size_t e_utf8_strftime(gchar *s, size_t max, const gchar *fmt, const struct tm *tm);
+size_t e_strftime(gchar *s, size_t max, const gchar *fmt, const struct tm *tm);
 
 #ifdef G_OS_WIN32
-const char  *e_util_get_prefix (void) G_GNUC_CONST;
-const char  *e_util_get_cp_prefix (void) G_GNUC_CONST;
-const char  *e_util_get_localedir (void) G_GNUC_CONST;
-char        *e_util_replace_prefix (const char *configure_time_prefix, const char *runtime_prefix, const char *configure_time_path);
+const gchar  *e_util_get_prefix (void) G_GNUC_CONST;
+const gchar  *e_util_get_cp_prefix (void) G_GNUC_CONST;
+const gchar  *e_util_get_localedir (void) G_GNUC_CONST;
+gchar        *e_util_replace_prefix (const gchar *configure_time_prefix, const gchar *runtime_prefix, const gchar *configure_time_path);
 #endif
 
 G_END_DECLS
diff --git a/libedataserver/e-iconv.c b/libedataserver/e-iconv.c
index 2cb59c9..3570305 100644
--- a/libedataserver/e-iconv.c
+++ b/libedataserver/e-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;
 
 	EDList open;		/* stores iconv_cache_nodes, busy ones up front */
 };
@@ -90,15 +90,15 @@ struct _iconv_cache {
 static EDList 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;
 
 static const struct {
-	const char *charset;
-	const char *iconv_name;
+	const gchar *charset;
+	const gchar *iconv_name;
 } known_iconv_charsets[] = {
 	/* charset name (lowercase!), iconv-friendly name (sometimes case sensitive) */
 	{ "utf-8",           "UTF-8"      },
@@ -190,10 +190,10 @@ static EDListNode *e_dlist_remove(EDListNode *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')
@@ -204,10 +204,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')
@@ -220,9 +220,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);
@@ -259,10 +259,10 @@ locale_parse_lang (const char *locale)
 
 /* NOTE: Owns the lock on return if keep is TRUE ! */
 static void
-e_iconv_init(int keep)
+e_iconv_init(gint keep)
 {
-	char *from, *to, *locale;
-	int i;
+	gchar *from, *to, *locale;
+	gint i;
 
 	LOCK();
 
@@ -315,7 +315,7 @@ e_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) {
@@ -344,9 +344,9 @@ e_iconv_init(int keep)
 		UNLOCK();
 }
 
-const char *e_iconv_charset_name(const char *charset)
+const gchar *e_iconv_charset_name(const gchar *charset)
 {
-	char *name, *ret, *tmp;
+	gchar *name, *ret, *tmp;
 
 	if (charset == NULL)
 		return NULL;
@@ -365,8 +365,8 @@ const char *e_iconv_charset_name(const char *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 == '_')
@@ -441,13 +441,13 @@ flush_entry(struct _iconv_cache *ic)
 }
 
 /* This should run pretty quick, its called a lot */
-iconv_t e_iconv_open(const char *oto, const char *ofrom)
+iconv_t e_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) {
@@ -504,7 +504,7 @@ iconv_t e_iconv_open(const char *oto, const char *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);
@@ -535,9 +535,9 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom)
 	return ip;
 }
 
-size_t e_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char ** outbuf, size_t *outbytesleft)
+size_t e_iconv(iconv_t cd, const gchar **inbuf, size_t *inbytesleft, gchar ** outbuf, size_t *outbytesleft)
 {
-	return iconv(cd, (char **) inbuf, inbytesleft, outbuf, outbytesleft);
+	return iconv(cd, (gchar **) inbuf, inbytesleft, outbuf, outbytesleft);
 }
 
 void
@@ -563,7 +563,7 @@ e_iconv_close(iconv_t ip)
 
 }
 
-const char *e_iconv_locale_charset(void)
+const gchar *e_iconv_locale_charset(void)
 {
 	e_iconv_init(FALSE);
 
@@ -571,7 +571,7 @@ const char *e_iconv_locale_charset(void)
 }
 
 
-const char *
+const gchar *
 e_iconv_locale_language (void)
 {
 	e_iconv_init (FALSE);
@@ -584,8 +584,8 @@ e_iconv_locale_language (void)
  * e_iconv_charset_name() so that we don't have to keep track of all
  * the aliases too. */
 static const struct {
-	const char *charset;
-	const char *lang;
+	const gchar *charset;
+	const gchar *lang;
 } cjkr_lang_map[] = {
 	{ "Big5",        "zh" },
 	{ "BIG5HKSCS",   "zh" },
@@ -605,10 +605,10 @@ static const struct {
 
 #define NUM_CJKR_LANGS (sizeof (cjkr_lang_map) / sizeof (cjkr_lang_map[0]))
 
-const char *
-e_iconv_charset_language (const char *charset)
+const gchar *
+e_iconv_charset_language (const gchar *charset)
 {
-	int i;
+	gint i;
 
 	if (!charset)
 		return NULL;
diff --git a/libedataserver/e-iconv.h b/libedataserver/e-iconv.h
index 6335704..ef6a834 100644
--- a/libedataserver/e-iconv.h
+++ b/libedataserver/e-iconv.h
@@ -36,15 +36,15 @@ extern "C" {
 #pragma }
 #endif /* __cplusplus */
 
-const char *e_iconv_charset_name(const char *charset);
-iconv_t e_iconv_open(const char *oto, const char *ofrom);
-size_t e_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char ** outbuf, size_t *outbytesleft);
+const gchar *e_iconv_charset_name(const gchar *charset);
+iconv_t e_iconv_open(const gchar *oto, const gchar *ofrom);
+size_t e_iconv(iconv_t cd, const gchar **inbuf, size_t *inbytesleft, gchar ** outbuf, size_t *outbytesleft);
 void e_iconv_close(iconv_t ip);
-const char *e_iconv_locale_charset(void);
+const gchar *e_iconv_locale_charset(void);
 
 /* languages */
-const char *e_iconv_locale_language (void);
-const char *e_iconv_charset_language (const char *charset);
+const gchar *e_iconv_locale_language (void);
+const gchar *e_iconv_charset_language (const gchar *charset);
 
 #ifdef __cplusplus
 }
diff --git a/libedataserver/e-iterator.c b/libedataserver/e-iterator.c
index 0c35f59..fbc7e16 100644
--- a/libedataserver/e-iterator.c
+++ b/libedataserver/e-iterator.c
@@ -58,7 +58,7 @@ e_iterator_init (EIterator *card)
 /*
  * Virtual functions:
  */
-const void *
+gconstpointer
 e_iterator_get      (EIterator *iterator)
 {
 	if (E_ITERATOR_GET_CLASS(iterator)->get)
@@ -107,7 +107,7 @@ e_iterator_delete   (EIterator *iterator)
 }
 
 void           e_iterator_insert     (EIterator  *iterator,
-				      const void *object,
+				      gconstpointer object,
 				      gboolean    before)
 {
 	if (E_ITERATOR_GET_CLASS(iterator)->insert)
diff --git a/libedataserver/e-iterator.h b/libedataserver/e-iterator.h
index 7f6be4c..29ba67c 100644
--- a/libedataserver/e-iterator.h
+++ b/libedataserver/e-iterator.h
@@ -37,17 +37,17 @@ struct _EIteratorClass {
 	void         (*invalidate) (EIterator  *iterator);
 
 	/* Virtual functions */
-	const void * (*get)        (EIterator  *iterator);
+	gconstpointer  (*get)        (EIterator  *iterator);
 	void         (*reset)      (EIterator  *iterator);
 	void         (*last)       (EIterator  *iterator);
 	gboolean     (*next)       (EIterator  *iterator);
 	gboolean     (*prev)       (EIterator  *iterator);
 	void         (*remove)     (EIterator  *iterator);
 	void         (*insert)     (EIterator  *iterator,
-				    const void *object,
+				    gconstpointer object,
 				    gboolean	before);
 	void         (*set)        (EIterator  *iterator,
-				    const void *object);
+				    gconstpointer object);
 	gboolean     (*is_valid)   (EIterator  *iterator);
 };
 
@@ -58,10 +58,10 @@ gboolean       e_iterator_next       (EIterator  *iterator);
 gboolean       e_iterator_prev       (EIterator  *iterator);
 void           e_iterator_delete     (EIterator  *iterator);
 void           e_iterator_insert     (EIterator  *iterator,
-				      const void *object,
+				      gconstpointer object,
 				      gboolean    before);
 void           e_iterator_set        (EIterator  *iterator,
-				      const void *object);
+				      gconstpointer object);
 gboolean       e_iterator_is_valid   (EIterator  *iterator);
 
 void           e_iterator_invalidate (EIterator  *iterator);
diff --git a/libedataserver/e-list-iterator.c b/libedataserver/e-list-iterator.c
index d3b0fc4..10f8823 100644
--- a/libedataserver/e-list-iterator.c
+++ b/libedataserver/e-list-iterator.c
@@ -15,16 +15,16 @@
 static void        e_list_iterator_invalidate (EIterator *iterator);
 static gboolean    e_list_iterator_is_valid   (EIterator *iterator);
 static void        e_list_iterator_set        (EIterator  *iterator,
-					       const void *object);
+					       gconstpointer object);
 static void        e_list_iterator_remove     (EIterator  *iterator);
 static void        e_list_iterator_insert     (EIterator  *iterator,
-					       const void *object,
+					       gconstpointer object,
 					       gboolean    before);
 static gboolean    e_list_iterator_prev       (EIterator  *iterator);
 static gboolean    e_list_iterator_next       (EIterator  *iterator);
 static void        e_list_iterator_reset      (EIterator *iterator);
 static void        e_list_iterator_last       (EIterator *iterator);
-static const void *e_list_iterator_get        (EIterator *iterator);
+static gconstpointer e_list_iterator_get        (EIterator *iterator);
 static void        e_list_iterator_dispose    (GObject *object);
 
 G_DEFINE_TYPE(EListIterator, e_list_iterator, E_TYPE_ITERATOR)
@@ -92,7 +92,7 @@ e_list_iterator_dispose (GObject *object)
 		(* G_OBJECT_CLASS (e_list_iterator_parent_class)->dispose) (object);
 }
 
-static const void *
+static gconstpointer
 e_list_iterator_get      (EIterator *_iterator)
 {
 	EListIterator *iterator = E_LIST_ITERATOR(_iterator);
@@ -140,15 +140,15 @@ e_list_iterator_prev     (EIterator *_iterator)
 
 static void
 e_list_iterator_insert   (EIterator  *_iterator,
-			  const void *object,
+			  gconstpointer object,
 			  gboolean    before)
 {
 	EListIterator *iterator = E_LIST_ITERATOR(_iterator);
-	void *data;
+	gpointer data;
 	if (iterator->list->copy)
 		data = iterator->list->copy(object, iterator->list->closure);
 	else
-		data = (void *) object;
+		data = (gpointer) object;
 	if (iterator->iterator) {
 		if (before) {
 			iterator->list->list = g_list_first(g_list_prepend(iterator->iterator, data));
@@ -184,7 +184,7 @@ e_list_iterator_remove   (EIterator *_iterator)
 
 static void
 e_list_iterator_set      (EIterator  *_iterator,
-			  const void *object)
+			  gconstpointer object)
 {
 	EListIterator *iterator = E_LIST_ITERATOR(_iterator);
 	if (iterator->iterator) {
@@ -193,7 +193,7 @@ e_list_iterator_set      (EIterator  *_iterator,
 		if (iterator->list->copy)
 			iterator->iterator->data = iterator->list->copy(object, iterator->list->closure);
 		else
-			iterator->iterator->data = (void *) object;
+			iterator->iterator->data = (gpointer) object;
 	}
 }
 
diff --git a/libedataserver/e-list.c b/libedataserver/e-list.c
index a1970df..1a79916 100644
--- a/libedataserver/e-list.c
+++ b/libedataserver/e-list.c
@@ -36,7 +36,7 @@ e_list_init (EList *list)
 }
 
 EList *
-e_list_new (EListCopyFunc copy, EListFreeFunc free, void *closure)
+e_list_new (EListCopyFunc copy, EListFreeFunc free, gpointer closure)
 {
 	EList *list = g_object_new (E_TYPE_LIST, NULL);
 	e_list_construct (list, copy, free, closure);
@@ -44,7 +44,7 @@ e_list_new (EListCopyFunc copy, EListFreeFunc free, void *closure)
 }
 
 void
-e_list_construct (EList *list, EListCopyFunc copy, EListFreeFunc free, void *closure)
+e_list_construct (EList *list, EListCopyFunc copy, EListFreeFunc free, gpointer closure)
 {
 	list->copy    = copy;
 	list->free    = free;
@@ -80,24 +80,24 @@ e_list_get_iterator (EList *list)
 	return iterator;
 }
 
-int
+gint
 e_list_length (EList *list)
 {
 	return g_list_length(list->list);
 }
 
 void
-e_list_append (EList *list, const void *data)
+e_list_append (EList *list, gconstpointer data)
 {
 	e_list_invalidate_iterators(list, NULL);
 	if (list->copy)
 		list->list = g_list_append(list->list, list->copy(data, list->closure));
 	else
-		list->list = g_list_append(list->list, (void *) data);
+		list->list = g_list_append(list->list, (gpointer) data);
 }
 
 void
-e_list_remove (EList *list, const void *data)
+e_list_remove (EList *list, gconstpointer data)
 {
 	GList *link;
 	link = g_list_find (list->list, data);
diff --git a/libedataserver/e-list.h b/libedataserver/e-list.h
index 442ea16..bded32d 100644
--- a/libedataserver/e-list.h
+++ b/libedataserver/e-list.h
@@ -27,8 +27,8 @@ G_BEGIN_DECLS
 #define E_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_LIST))
 #define E_LIST_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_LIST, EListClass))
 
-typedef void *(*EListCopyFunc) (const void *data, void *closure);
-typedef void (*EListFreeFunc) (void *data, void *closure);
+typedef gpointer (*EListCopyFunc) (gconstpointer data, gpointer closure);
+typedef void (*EListFreeFunc) (gpointer data, gpointer closure);
 
 struct _EList {
 	GObject      object;
@@ -56,7 +56,7 @@ void       e_list_append               (EList         *list,
 					const void    *data);
 void       e_list_remove               (EList         *list,
 					const void    *data);
-int        e_list_length               (EList         *list);
+gint        e_list_length               (EList         *list);
 
 /* For iterators to call. */
 void       e_list_remove_link          (EList         *list,
diff --git a/libedataserver/e-memory.c b/libedataserver/e-memory.c
index 15f9179..aaa041f 100644
--- a/libedataserver/e-memory.c
+++ b/libedataserver/e-memory.c
@@ -49,13 +49,13 @@
 
 struct timeval timeit_start;
 
-static time_start(const char *desc)
+static time_start(const gchar *desc)
 {
 	gettimeofday(&timeit_start, NULL);
 	printf("starting: %s\n", desc);
 }
 
-static time_end(const char *desc)
+static time_end(const gchar *desc)
 {
 	unsigned long diff;
 	struct timeval end;
@@ -75,10 +75,10 @@ static time_end(const char *desc)
 #include <mcheck.h>
 #include <stdio.h>
 static void
-checkmem(void *p)
+checkmem(gpointer p)
 {
 	if (p) {
-		int status = mprobe(p);
+		gint status = mprobe(p);
 
 		switch (status) {
 		case MCHECK_HEAD:
@@ -93,7 +93,7 @@ checkmem(void *p)
 		}
 	}
 }
-#define MPROBE(x) checkmem((void *)(x))
+#define MPROBE(x) checkmem((gpointer)(x))
 #else
 #define MPROBE(x)
 #endif
@@ -102,12 +102,12 @@ checkmem(void *p)
 
 typedef struct _MemChunkFreeNode {
 	struct _MemChunkFreeNode *next;
-	unsigned int atoms;
+	guint atoms;
 } MemChunkFreeNode;
 
 typedef struct _EMemChunk {
-	unsigned int blocksize;	/* number of atoms in a block */
-	unsigned int atomsize;	/* size of each atom */
+	guint blocksize;	/* number of atoms in a block */
+	guint atomsize;	/* size of each atom */
 	GPtrArray *blocks;	/* blocks of raw memory */
 	struct _MemChunkFreeNode *free;
 } MemChunk;
@@ -125,7 +125,7 @@ typedef struct _EMemChunk {
  *
  * Return value: The new header.
  **/
-MemChunk *e_memchunk_new(int atomcount, int atomsize)
+MemChunk *e_memchunk_new(gint atomcount, gint atomsize)
 {
 	MemChunk *m = g_malloc(sizeof(*m));
 
@@ -143,17 +143,17 @@ MemChunk *e_memchunk_new(int atomcount, int atomsize)
  *
  * Allocate a new atom size block of memory from a memchunk.
  **/
-void *e_memchunk_alloc(MemChunk *m)
+gpointer e_memchunk_alloc(MemChunk *m)
 {
-	char *b;
+	gchar *b;
 	MemChunkFreeNode *f;
-	void *mem;
+	gpointer mem;
 
 	f = m->free;
 	if (f) {
 		f->atoms--;
 		if (f->atoms > 0) {
-			mem = ((char *)f) + (f->atoms*m->atomsize);
+			mem = ((gchar *)f) + (f->atoms*m->atomsize);
 		} else {
 			mem = f;
 			m->free = m->free->next;
@@ -170,9 +170,9 @@ void *e_memchunk_alloc(MemChunk *m)
 	}
 }
 
-void *e_memchunk_alloc0(EMemChunk *m)
+gpointer e_memchunk_alloc0(EMemChunk *m)
 {
-	void *mem;
+	gpointer mem;
 
 	mem = e_memchunk_alloc(m);
 	memset(mem, 0, m->atomsize);
@@ -189,7 +189,7 @@ void *e_memchunk_alloc0(EMemChunk *m)
  * memchunk.
  **/
 void
-e_memchunk_free(MemChunk *m, void *mem)
+e_memchunk_free(MemChunk *m, gpointer mem)
 {
 	MemChunkFreeNode *f;
 
@@ -217,7 +217,7 @@ e_memchunk_free(MemChunk *m, void *mem)
 void
 e_memchunk_empty(MemChunk *m)
 {
-	int i;
+	gint i;
 	MemChunkFreeNode *f, *h = NULL;
 
 	for (i=0;i<m->blocks->len;i++) {
@@ -231,12 +231,12 @@ e_memchunk_empty(MemChunk *m)
 
 struct _cleaninfo {
 	struct _cleaninfo *next;
-	char *base;
-	int count;
-	int size;		/* just so tree_search has it, sigh */
+	gchar *base;
+	gint count;
+	gint size;		/* just so tree_search has it, sigh */
 };
 
-static int tree_compare(struct _cleaninfo *a, struct _cleaninfo *b)
+static gint tree_compare(struct _cleaninfo *a, struct _cleaninfo *b)
 {
 	if (a->base < b->base)
 		return -1;
@@ -245,7 +245,7 @@ static int tree_compare(struct _cleaninfo *a, struct _cleaninfo *b)
 	return 0;
 }
 
-static int tree_search(struct _cleaninfo *a, char *mem)
+static gint tree_search(struct _cleaninfo *a, gchar *mem)
 {
 	if (a->base <= mem) {
 		if (mem < &a->base[a->size])
@@ -270,7 +270,7 @@ void
 e_memchunk_clean(MemChunk *m)
 {
 	GTree *tree;
-	int i;
+	gint i;
 	MemChunkFreeNode *f;
 	struct _cleaninfo *ci, *hi = NULL;
 
@@ -309,7 +309,7 @@ e_memchunk_clean(MemChunk *m)
 
 			f = m->free;
 			while (f) {
-				if (tree_search (ci, (void *) f) == 0) {
+				if (tree_search (ci, (gpointer) f) == 0) {
 					/* prune this node from our free-node list */
 					if (prev)
 						prev->next = f->next;
@@ -340,7 +340,7 @@ e_memchunk_clean(MemChunk *m)
 void
 e_memchunk_destroy(MemChunk *m)
 {
-	int i;
+	gint i;
 
 	if (m == NULL)
 		return;
@@ -354,7 +354,7 @@ e_memchunk_destroy(MemChunk *m)
 typedef struct _MemPoolNode {
 	struct _MemPoolNode *next;
 
-	int free;
+	gint free;
 } MemPoolNode;
 
 typedef struct _MemPoolThresholdNode {
@@ -364,9 +364,9 @@ typedef struct _MemPoolThresholdNode {
 #define ALIGNED_SIZEOF(t)	((sizeof (t) + G_MEM_ALIGN - 1) & -G_MEM_ALIGN)
 
 typedef struct _EMemPool {
-	int blocksize;
-	int threshold;
-	unsigned int align;
+	gint blocksize;
+	gint threshold;
+	guint align;
 	struct _MemPoolNode *blocks;
 	struct _MemPoolThresholdNode *threshold_blocks;
 } MemPool;
@@ -399,7 +399,7 @@ static GStaticMutex mempool_mutex = G_STATIC_MUTEX_INIT;
  *
  * Return value:
  **/
-MemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags)
+MemPool *e_mempool_new(gint blocksize, gint threshold, EMemPoolFlags flags)
 {
 	MemPool *pool;
 
@@ -443,7 +443,7 @@ MemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags)
  * be rounded up to the mempool's alignment restrictions
  * before being used.
  **/
-void *e_mempool_alloc(MemPool *pool, register int size)
+gpointer e_mempool_alloc(MemPool *pool, register gint size)
 {
 	size = (size + pool->align) & (~(pool->align));
 	if (size>=pool->threshold) {
@@ -452,14 +452,14 @@ void *e_mempool_alloc(MemPool *pool, register int size)
 		n = g_malloc(ALIGNED_SIZEOF(*n) + size);
 		n->next = pool->threshold_blocks;
 		pool->threshold_blocks = n;
-		return (char *) n + ALIGNED_SIZEOF(*n);
+		return (gchar *) n + ALIGNED_SIZEOF(*n);
 	} else {
 		register MemPoolNode *n;
 
 		n = pool->blocks;
 		if (n && n->free >= size) {
 			n->free -= size;
-			return (char *) n + ALIGNED_SIZEOF(*n) + n->free;
+			return (gchar *) n + ALIGNED_SIZEOF(*n) + n->free;
 		}
 
 		/* maybe we could do some sort of the free blocks based on size, but
@@ -469,13 +469,13 @@ void *e_mempool_alloc(MemPool *pool, register int size)
 		n->next = pool->blocks;
 		pool->blocks = n;
 		n->free = pool->blocksize - size;
-		return (char *) n + ALIGNED_SIZEOF(*n) + n->free;
+		return (gchar *) n + ALIGNED_SIZEOF(*n) + n->free;
 	}
 }
 
-char *e_mempool_strdup(EMemPool *pool, const char *str)
+gchar *e_mempool_strdup(EMemPool *pool, const gchar *str)
 {
-	char *out;
+	gchar *out;
 
 	out = e_mempool_alloc(pool, strlen(str)+1);
 	strcpy(out, str);
@@ -494,7 +494,7 @@ char *e_mempool_strdup(EMemPool *pool, const char *str)
  * as well.  Otherwise only blocks above the threshold are
  * actually freed, and the others are simply marked as empty.
  **/
-void e_mempool_flush(MemPool *pool, int freeall)
+void e_mempool_flush(MemPool *pool, gint freeall)
 {
 	MemPoolThresholdNode *tn, *tw;
 	MemPoolNode *pw, *pn;
@@ -552,20 +552,20 @@ void e_mempool_destroy(MemPool *pool)
 #define STRV_UNPACKED ((unsigned char)(~0))
 
 struct _EStrv {
-	unsigned char length;	/* how many entries we have (or the token STRV_UNPACKED) */
-	char data[1];		/* data follows */
+	guchar length;	/* how many entries we have (or the token STRV_UNPACKED) */
+	gchar data[1];		/* data follows */
 };
 
 struct _s_strv_string {
-	char *string;		/* the string to output */
-	char *free;		/* a string to free, if we referenced it */
+	gchar *string;		/* the string to output */
+	gchar *free;		/* a string to free, if we referenced it */
 };
 
 struct _e_strvunpacked {
-	unsigned char type;	/* we overload last to indicate this is unpacked */
+	guchar type;	/* we overload last to indicate this is unpacked */
 	MemPool *pool;		/* pool of memory for strings */
 	struct _EStrv *source;	/* if we were converted from a packed one, keep the source around for a while */
-	unsigned int length;
+	guint length;
 	struct _s_strv_string strings[1]; /* the string array data follows */
 };
 
@@ -587,14 +587,14 @@ struct _e_strvunpacked {
  * Return value:
  **/
 struct _EStrv *
-e_strv_new(int size)
+e_strv_new(gint size)
 {
 	struct _e_strvunpacked *s;
 
 	g_assert(size<255);
 
 	s = g_malloc(sizeof(*s) + (size-1)*sizeof(s->strings[0]));
-	s(printf("new strv=%p, size = %d bytes\n", s, sizeof(*s) + (size-1)*sizeof(char *)));
+	s(printf("new strv=%p, size = %d bytes\n", s, sizeof(*s) + (size-1)*sizeof(gchar *)));
 	s->type = STRV_UNPACKED;
 	s->pool = NULL;
 	s->length = size;
@@ -608,8 +608,8 @@ static struct _e_strvunpacked *
 strv_unpack(struct _EStrv *strv)
 {
 	struct _e_strvunpacked *s;
-	register char *p;
-	int i;
+	register gchar *p;
+	gint i;
 
 	s(printf("unpacking\n"));
 
@@ -645,7 +645,7 @@ strv_unpack(struct _EStrv *strv)
  * been packed, otherwise @strv.
  **/
 struct _EStrv *
-e_strv_set_ref(struct _EStrv *strv, int index, char *str)
+e_strv_set_ref(struct _EStrv *strv, gint index, gchar *str)
 {
 	struct _e_strvunpacked *s;
 
@@ -678,7 +678,7 @@ e_strv_set_ref(struct _EStrv *strv, int index, char *str)
  * EStrv.
  **/
 struct _EStrv *
-e_strv_set_ref_free(struct _EStrv *strv, int index, char *str)
+e_strv_set_ref_free(struct _EStrv *strv, gint index, gchar *str)
 {
 	struct _e_strvunpacked *s;
 
@@ -715,7 +715,7 @@ e_strv_set_ref_free(struct _EStrv *strv, int index, char *str)
  * been packed, otherwise @strv.
  **/
 struct _EStrv *
-e_strv_set(struct _EStrv *strv, int index, const char *str)
+e_strv_set(struct _EStrv *strv, gint index, const gchar *str)
 {
 	struct _e_strvunpacked *s;
 
@@ -752,8 +752,8 @@ struct _EStrv *
 e_strv_pack(struct _EStrv *strv)
 {
 	struct _e_strvunpacked *s;
-	int len, i;
-	register char *src, *dst;
+	gint len, i;
+	register gchar *src, *dst;
 
 	if (strv->length == STRV_UNPACKED) {
 		s = (struct _e_strvunpacked *)strv;
@@ -792,11 +792,11 @@ e_strv_pack(struct _EStrv *strv)
  *
  * Return value:
  **/
-const char *
-e_strv_get(struct _EStrv *strv, int index)
+const gchar *
+e_strv_get(struct _EStrv *strv, gint index)
 {
 	struct _e_strvunpacked *s;
-	char *p;
+	gchar *p;
 
 	if (strv->length != STRV_UNPACKED) {
 		g_assert(index>=0 && index < strv->length);
@@ -825,7 +825,7 @@ void
 e_strv_destroy(struct _EStrv *strv)
 {
 	struct _e_strvunpacked *s;
-	int i;
+	gint i;
 
 	s(printf("freeing strv\n"));
 
@@ -883,8 +883,8 @@ static GStaticMutex poolv_mutex = G_STATIC_MUTEX_INIT;
 #endif
 
 struct _EPoolv {
-	unsigned char length;
-	char *s[1];
+	guchar length;
+	gchar *s[1];
 };
 
 /**
@@ -904,13 +904,13 @@ struct _EPoolv {
  * Return value: new pooled string vector
  **/
 EPoolv *
-e_poolv_new(unsigned int size)
+e_poolv_new(guint size)
 {
 	EPoolv *poolv;
 
 	g_assert(size < 255);
 
-	poolv = g_malloc0(sizeof (*poolv) + (size - 1) * sizeof (char *));
+	poolv = g_malloc0(sizeof (*poolv) + (size - 1) * sizeof (gchar *));
 	poolv->length = size;
 
 #ifdef G_THREADS_ENABLED
@@ -924,7 +924,7 @@ e_poolv_new(unsigned int size)
 
 #ifdef MALLOC_CHECK
 	{
-		int i;
+		gint i;
 
 		if (poolv_table == NULL)
 			poolv_table = g_ptr_array_new();
@@ -940,7 +940,7 @@ e_poolv_new(unsigned int size)
 	g_static_mutex_unlock(&poolv_mutex);
 #endif
 
-	p(printf("new poolv=%p\tsize=%d\n", poolv, sizeof(*poolv) + (size-1)*sizeof(char *)));
+	p(printf("new poolv=%p\tsize=%d\n", poolv, sizeof(*poolv) + (size-1)*sizeof(gchar *)));
 
 #ifdef PROFILE_POOLV
 	poolv_count++;
@@ -962,9 +962,9 @@ EPoolv *
 e_poolv_cpy(EPoolv *dest, const EPoolv *src)
 {
 #ifdef POOLV_REFCNT
-	int i;
-	unsigned int ref;
-	char *key;
+	gint i;
+	guint ref;
+	gchar *key;
 #endif
 
 	p2(g_return_val_if_fail (dest != NULL, NULL));
@@ -985,8 +985,8 @@ e_poolv_cpy(EPoolv *dest, const EPoolv *src)
 	/* ref new copies */
 	for (i=0;i<src->length;i++) {
 		if (src->s[i]) {
-			if (g_hash_table_lookup_extended(poolv_pool, src->s[i], (void **)&key, (void **)&ref)) {
-				g_hash_table_insert(poolv_pool, key, (void *)(ref+1));
+			if (g_hash_table_lookup_extended(poolv_pool, src->s[i], (gpointer *)&key, (gpointer *)&ref)) {
+				g_hash_table_insert(poolv_pool, key, (gpointer)(ref+1));
 			} else {
 				g_assert_not_reached();
 			}
@@ -996,10 +996,10 @@ e_poolv_cpy(EPoolv *dest, const EPoolv *src)
 	/* unref the old ones */
 	for (i=0;i<dest->length;i++) {
 		if (dest->s[i]) {
-			if (g_hash_table_lookup_extended(poolv_pool, dest->s[i], (void **)&key, (void **)&ref)) {
+			if (g_hash_table_lookup_extended(poolv_pool, dest->s[i], (gpointer *)&key, (gpointer *)&ref)) {
 				/* if ref == 1 free it */
 				g_assert(ref > 0);
-				g_hash_table_insert(poolv_pool, key, (void *)(ref-1));
+				g_hash_table_insert(poolv_pool, key, (gpointer)(ref-1));
 			} else {
 				g_assert_not_reached();
 			}
@@ -1010,7 +1010,7 @@ e_poolv_cpy(EPoolv *dest, const EPoolv *src)
 #endif
 #endif
 
-	memcpy(dest->s, src->s, src->length * sizeof (char *));
+	memcpy(dest->s, src->s, src->length * sizeof (gchar *));
 
 	return dest;
 }
@@ -1050,11 +1050,11 @@ poolv_profile_update (void)
  * Return value: @poolv
  **/
 EPoolv *
-e_poolv_set (EPoolv *poolv, int index, char *str, int freeit)
+e_poolv_set (EPoolv *poolv, gint index, gchar *str, gint freeit)
 {
 #ifdef POOLV_REFCNT
-	unsigned int ref;
-	char *key;
+	guint ref;
+	gchar *key;
 #endif
 
 	p2(g_return_val_if_fail (poolv != NULL, NULL));
@@ -1068,9 +1068,9 @@ e_poolv_set (EPoolv *poolv, int index, char *str, int freeit)
 	if (!str) {
 #ifdef POOLV_REFCNT
 		if (poolv->s[index]) {
-			if (g_hash_table_lookup_extended(poolv_pool, poolv->s[index], (void **)&key, (void **)&ref)) {
+			if (g_hash_table_lookup_extended(poolv_pool, poolv->s[index], (gpointer *)&key, (gpointer *)&ref)) {
 				g_assert(ref > 0);
-				g_hash_table_insert(poolv_pool, key, (void *)(ref-1));
+				g_hash_table_insert(poolv_pool, key, (gpointer)(ref-1));
 			} else {
 				g_assert_not_reached();
 			}
@@ -1085,8 +1085,8 @@ e_poolv_set (EPoolv *poolv, int index, char *str, int freeit)
 #endif
 
 #ifdef POOLV_REFCNT
-	if (g_hash_table_lookup_extended(poolv_pool, str, (void **)&key, (void **)&ref)) {
-		g_hash_table_insert(poolv_pool, key, (void *)(ref+1));
+	if (g_hash_table_lookup_extended(poolv_pool, str, (gpointer *)&key, (gpointer *)&ref)) {
+		g_hash_table_insert(poolv_pool, key, (gpointer)(ref+1));
 		poolv->s[index] = key;
 # ifdef PROFILE_POOLV
 		poolv_hits++;
@@ -1099,7 +1099,7 @@ e_poolv_set (EPoolv *poolv, int index, char *str, int freeit)
 		poolv_profile_update ();
 # endif
 		poolv->s[index] = e_mempool_strdup(poolv_mempool, str);
-		g_hash_table_insert(poolv_pool, poolv->s[index], (void *)1);
+		g_hash_table_insert(poolv_pool, poolv->s[index], (gpointer)1);
 	}
 
 #else  /* !POOLV_REFCNT */
@@ -1141,8 +1141,8 @@ e_poolv_set (EPoolv *poolv, int index, char *str, int freeit)
  *
  * Return value: string at that index.
  **/
-const char *
-e_poolv_get(EPoolv *poolv, int index)
+const gchar *
+e_poolv_get(EPoolv *poolv, gint index)
 {
 	g_assert(poolv != NULL);
 	g_assert(index>= 0 && index < poolv->length);
@@ -1165,9 +1165,9 @@ void
 e_poolv_destroy(EPoolv *poolv)
 {
 #ifdef POOLV_REFCNT
-	int i;
-	unsigned int ref;
-	char *key;
+	gint i;
+	guint ref;
+	gchar *key;
 
 	MPROBE(poolv);
 
@@ -1184,10 +1184,10 @@ e_poolv_destroy(EPoolv *poolv)
 
 	for (i=0;i<poolv->length;i++) {
 		if (poolv->s[i]) {
-			if (g_hash_table_lookup_extended(poolv_pool, poolv->s[i], (void **)&key, (void **)&ref)) {
+			if (g_hash_table_lookup_extended(poolv_pool, poolv->s[i], (gpointer *)&key, (gpointer *)&ref)) {
 				/* if ref == 1 free it */
 				g_assert(ref > 0);
-				g_hash_table_insert(poolv_pool, key, (void *)(ref-1));
+				g_hash_table_insert(poolv_pool, key, (gpointer)(ref-1));
 			} else {
 				g_assert_not_reached();
 			}
@@ -1213,9 +1213,9 @@ e_poolv_destroy(EPoolv *poolv)
 
 main()
 {
-	int i;
+	gint i;
 	MemChunk *mc;
-	void *mem, *last;
+	gpointer mem, *last;
 	GMemChunk *gmc;
 	struct _EStrv *s;
 
diff --git a/libedataserver/e-memory.h b/libedataserver/e-memory.h
index 2737486..aefe734 100644
--- a/libedataserver/e-memory.h
+++ b/libedataserver/e-memory.h
@@ -30,10 +30,10 @@ G_BEGIN_DECLS
 /* this is like gmemchunk, only faster and less overhead (only 4 bytes for every atomcount allocations) */
 typedef struct _EMemChunk EMemChunk;
 
-EMemChunk *e_memchunk_new(int atomcount, int atomsize);
-void *e_memchunk_alloc(EMemChunk *m);
-void *e_memchunk_alloc0(EMemChunk *m);
-void e_memchunk_free(EMemChunk *m, void *mem);
+EMemChunk *e_memchunk_new(gint atomcount, gint atomsize);
+gpointer e_memchunk_alloc(EMemChunk *m);
+gpointer e_memchunk_alloc0(EMemChunk *m);
+void e_memchunk_free(EMemChunk *m, gpointer mem);
 void e_memchunk_empty(EMemChunk *m);
 void e_memchunk_clean(EMemChunk *m);
 void e_memchunk_destroy(EMemChunk *m);
@@ -48,31 +48,31 @@ typedef enum {
 	E_MEMPOOL_ALIGN_MASK = 3	/* which bits determine the alignment information */
 } EMemPoolFlags;
 
-EMemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags);
-void *e_mempool_alloc(EMemPool *pool, int size);
-char *e_mempool_strdup(EMemPool *pool, const char *str);
-void e_mempool_flush(EMemPool *pool, int freeall);
+EMemPool *e_mempool_new(gint blocksize, gint threshold, EMemPoolFlags flags);
+gpointer e_mempool_alloc(EMemPool *pool, gint size);
+gchar *e_mempool_strdup(EMemPool *pool, const gchar *str);
+void e_mempool_flush(EMemPool *pool, gint freeall);
 void e_mempool_destroy(EMemPool *pool);
 
 /* strv's string arrays that can be efficiently modified and then compressed mainly for retrival */
 /* building is relatively fast, once compressed it takes the minimum amount of memory possible to store */
 typedef struct _EStrv EStrv;
 
-EStrv *e_strv_new(int size);
-EStrv *e_strv_set_ref(EStrv *strv, int index, char *str);
-EStrv *e_strv_set_ref_free(EStrv *strv, int index, char *str);
-EStrv *e_strv_set(EStrv *strv, int index, const char *str);
+EStrv *e_strv_new(gint size);
+EStrv *e_strv_set_ref(EStrv *strv, gint index, gchar *str);
+EStrv *e_strv_set_ref_free(EStrv *strv, gint index, gchar *str);
+EStrv *e_strv_set(EStrv *strv, gint index, const gchar *str);
 EStrv *e_strv_pack(EStrv *strv);
-const char *e_strv_get(EStrv *strv, int index);
+const gchar *e_strv_get(EStrv *strv, gint index);
 void e_strv_destroy(EStrv *strv);
 
 /* poolv's are similar to strv's, but they store common strings */
 typedef struct _EPoolv EPoolv;
 
-EPoolv *e_poolv_new(unsigned int size);
+EPoolv *e_poolv_new(guint size);
 EPoolv *e_poolv_cpy(EPoolv *dest, const EPoolv *src);
-EPoolv *e_poolv_set(EPoolv *poolv, int index, char *str, int freeit);
-const char *e_poolv_get(EPoolv *poolv, int index);
+EPoolv *e_poolv_set(EPoolv *poolv, gint index, gchar *str, gint freeit);
+const gchar *e_poolv_get(EPoolv *poolv, gint index);
 void e_poolv_destroy(EPoolv *poolv);
 
 G_END_DECLS
diff --git a/libedataserver/e-msgport.c b/libedataserver/e-msgport.c
index f040e0a..a04601f 100644
--- a/libedataserver/e-msgport.c
+++ b/libedataserver/e-msgport.c
@@ -67,7 +67,7 @@
 #endif
 
 static int
-e_pipe (int *fds)
+e_pipe (gint *fds)
 {
 #ifndef G_OS_WIN32
 	if (pipe (fds) != -1)
@@ -80,7 +80,7 @@ e_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;
@@ -256,15 +256,15 @@ EDListNode *e_dlist_remtail(EDList *l)
 	return NULL;
 }
 
-int e_dlist_empty(EDList *l)
+gint e_dlist_empty(EDList *l)
 {
 	return (l->head == (EDListNode *)&l->tail);
 }
 
-int e_dlist_length(EDList *l)
+gint e_dlist_length(EDList *l)
 {
 	EDListNode *n, *nn;
-	int count = 0;
+	gint count = 0;
 
 	n = l->head;
 	nn = n->next;
@@ -282,7 +282,7 @@ struct _EMCache {
 	GHashTable *key_table;
 	EDList lru_list;
 	size_t node_size;
-	int node_count;
+	gint node_count;
 	time_t timeout;
 	GFreeFunc node_free;
 };
@@ -339,7 +339,7 @@ em_cache_destroy(EMCache *emc)
  * Return value:
  **/
 EMCacheNode *
-em_cache_lookup(EMCache *emc, const char *key)
+em_cache_lookup(EMCache *emc, const gchar *key)
 {
 	EMCacheNode *n;
 
@@ -369,7 +369,7 @@ em_cache_lookup(EMCache *emc, const char *key)
  * Return value:
  **/
 EMCacheNode *
-em_cache_node_new(EMCache *emc, const char *key)
+em_cache_node_new(EMCache *emc, const gchar *key)
 {
 	EMCacheNode *n;
 
@@ -591,7 +591,7 @@ e_msgport_destroy (EMsgPort *msgport)
 	g_slice_free (EMsgPort, msgport);
 }
 
-int
+gint
 e_msgport_fd (EMsgPort *msgport)
 {
 	gint fd;
@@ -735,7 +735,7 @@ e_msgport_reply (EMsg *msg)
 
 struct _thread_info {
 	pthread_t id;
-	int busy;
+	gint busy;
 };
 
 struct _EThread {
@@ -746,21 +746,21 @@ struct _EThread {
 	EMsgPort *reply_port;
 	pthread_mutex_t mutex;
 	e_thread_t type;
-	int queue_limit;
+	gint queue_limit;
 
-	int waiting;		/* if we are waiting for a new message, count of waiting processes */
+	gint waiting;		/* if we are waiting for a new message, count of waiting processes */
 	pthread_t id;		/* our running child thread */
-	int have_thread;
+	gint have_thread;
 	GList *id_list;		/* if THREAD_NEW, then a list of our child threads in thread_info structs */
 
 	EThreadFunc destroy;
-	void *destroy_data;
+	gpointer destroy_data;
 
 	EThreadFunc received;
-	void *received_data;
+	gpointer received_data;
 
 	EThreadFunc lost;
-	void *lost_data;
+	gpointer lost_data;
 };
 
 /* All active threads */
@@ -825,7 +825,7 @@ EThread *e_thread_new(e_thread_t type)
 /* close down the threads & resources etc */
 void e_thread_destroy(EThread *e)
 {
-	int busy = FALSE;
+	gint busy = FALSE;
 	EMsg *msg;
 	struct _thread_info *info;
 	GList *l;
@@ -905,13 +905,13 @@ void e_thread_destroy(EThread *e)
 
 /* set the queue maximum depth, what happens when the queue
    fills up depends on the queue type */
-void e_thread_set_queue_limit(EThread *e, int limit)
+void e_thread_set_queue_limit(EThread *e, gint limit)
 {
 	e->queue_limit = limit;
 }
 
 /* set a msg destroy callback, this can not call any e_thread functions on @e */
-void e_thread_set_msg_destroy(EThread *e, EThreadFunc destroy, void *data)
+void e_thread_set_msg_destroy(EThread *e, EThreadFunc destroy, gpointer data)
 {
 	pthread_mutex_lock(&e->mutex);
 	e->destroy = destroy;
@@ -920,7 +920,7 @@ void e_thread_set_msg_destroy(EThread *e, EThreadFunc destroy, void *data)
 }
 
 /* set a message lost callback, called if any message is discarded */
-void e_thread_set_msg_lost(EThread *e, EThreadFunc lost, void *data)
+void e_thread_set_msg_lost(EThread *e, EThreadFunc lost, gpointer data)
 {
 	pthread_mutex_lock(&e->mutex);
 	e->lost = lost;
@@ -935,7 +935,7 @@ void e_thread_set_reply_port(EThread *e, EMsgPort *reply_port)
 }
 
 /* set a received data callback */
-void e_thread_set_msg_received(EThread *e, EThreadFunc received, void *data)
+void e_thread_set_msg_received(EThread *e, EThreadFunc received, gpointer data)
 {
 	pthread_mutex_lock(&e->mutex);
 	e->received = received;
@@ -944,9 +944,9 @@ void e_thread_set_msg_received(EThread *e, EThreadFunc received, void *data)
 }
 
 /* find out if we're busy doing any work, e==NULL, check for all work */
-int e_thread_busy(EThread *e)
+gint e_thread_busy(EThread *e)
 {
-	int busy = FALSE;
+	gint busy = FALSE;
 
 	if (e == NULL) {
 		pthread_mutex_lock(&ethread_lock);
@@ -977,7 +977,7 @@ static void
 thread_destroy_msg(EThread *e, EMsg *m)
 {
 	EThreadFunc func;
-	void *func_data;
+	gpointer func_data;
 
 	/* we do this so we never get an incomplete/unmatched callback + data */
 	pthread_mutex_lock(&e->mutex);
@@ -993,7 +993,7 @@ static void
 thread_received_msg(EThread *e, EMsg *m)
 {
 	EThreadFunc func;
-	void *func_data;
+	gpointer func_data;
 
 	/* we do this so we never get an incomplete/unmatched callback + data */
 	pthread_mutex_lock(&e->mutex);
@@ -1011,7 +1011,7 @@ static void
 thread_lost_msg(EThread *e, EMsg *m)
 {
 	EThreadFunc func;
-	void *func_data;
+	gpointer func_data;
 
 	/* we do this so we never get an incomplete/unmatched callback + data */
 	pthread_mutex_lock(&e->mutex);
@@ -1024,8 +1024,8 @@ thread_lost_msg(EThread *e, EMsg *m)
 }
 
 /* the actual thread dispatcher */
-static void *
-thread_dispatch(void *din)
+static gpointer
+thread_dispatch(gpointer din)
 {
 	EThread *e = din;
 	EMsg *m;
@@ -1140,7 +1140,7 @@ void e_thread_put(EThread *e, EMsg *msg)
 
 	/* create the thread, if there is none to receive it yet */
 	if (!e->have_thread) {
-		int err;
+		gint err;
 
 		if ((err = pthread_create(&e->id, NULL, thread_dispatch, e)) != 0) {
 			g_warning("Could not create dispatcher thread, message queued?: %s", g_strerror(err));
@@ -1160,9 +1160,9 @@ void e_thread_put(EThread *e, EMsg *msg)
 
 /* yet-another-mutex interface */
 struct _EMutex {
-	int type;
+	gint type;
 	pthread_t owner;
-	int have_owner;
+	gint have_owner;
 	short waiters;
 	short depth;
 	pthread_mutex_t mutex;
@@ -1197,9 +1197,9 @@ EMutex *e_mutex_new(e_mutex_t type)
 	return m;
 }
 
-int e_mutex_destroy(EMutex *m)
+gint e_mutex_destroy(EMutex *m)
 {
-	int ret = 0;
+	gint ret = 0;
 
 	switch (m->type) {
 	case E_MUTEX_SIMPLE:
@@ -1221,10 +1221,10 @@ int e_mutex_destroy(EMutex *m)
 	return ret;
 }
 
-int e_mutex_lock(EMutex *m)
+gint e_mutex_lock(EMutex *m)
 {
 	pthread_t id;
-	int err;
+	gint err;
 
 	switch (m->type) {
 	case E_MUTEX_SIMPLE:
@@ -1255,9 +1255,9 @@ int e_mutex_lock(EMutex *m)
 	return EINVAL;
 }
 
-int e_mutex_unlock(EMutex *m)
+gint e_mutex_unlock(EMutex *m)
 {
-	int err;
+	gint err;
 
 	switch (m->type) {
 	case E_MUTEX_SIMPLE:
@@ -1288,9 +1288,9 @@ void e_mutex_assert_locked(EMutex *m)
 	pthread_mutex_unlock(&m->mutex);
 }
 
-int e_mutex_cond_wait(void *vcond, EMutex *m)
+gint e_mutex_cond_wait(gpointer vcond, EMutex *m)
 {
-	int ret;
+	gint ret;
 	pthread_cond_t *cond = vcond;
 
 	switch(m->type) {
@@ -1313,17 +1313,17 @@ int e_mutex_cond_wait(void *vcond, EMutex *m)
 
 static EMsgPort *server_port;
 
-void *fdserver(void *data)
+gpointer fdserver(gpointer data)
 {
-	int fd;
+	gint fd;
 	EMsg *msg;
-	int id = (int)data;
+	gint id = (int)data;
 	fd_set rfds;
 
 	fd = e_msgport_fd(server_port);
 
 	while (1) {
-		int count = 0;
+		gint count = 0;
 
 		printf("server %d: waiting on fd %d\n", id, fd);
 		FD_ZERO(&rfds);
@@ -1341,10 +1341,10 @@ void *fdserver(void *data)
 	}
 }
 
-void *server(void *data)
+gpointer server(gpointer data)
 {
 	EMsg *msg;
-	int id = (int)data;
+	gint id = (int)data;
 
 	while (1) {
 		printf("server %d: waiting\n", id);
@@ -1361,11 +1361,11 @@ void *server(void *data)
 	return NULL;
 }
 
-void *client(void *data)
+gpointer client(gpointer data)
 {
 	EMsg *msg;
 	EMsgPort *replyport;
-	int i;
+	gint i;
 
 	replyport = e_msgport_new();
 	msg = g_malloc0(sizeof(*msg));
@@ -1399,7 +1399,7 @@ void *client(void *data)
 	return NULL;
 }
 
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
 {
 	pthread_t serverid, clientid;
 
@@ -1415,8 +1415,8 @@ int main(int argc, char **argv)
 
 	server_port = e_msgport_new();
 
-	/*pthread_create(&serverid, NULL, server, (void *)1);*/
-	pthread_create(&serverid, NULL, fdserver, (void *)1);
+	/*pthread_create(&serverid, NULL, server, (gpointer)1);*/
+	pthread_create(&serverid, NULL, fdserver, (gpointer)1);
 	pthread_create(&clientid, NULL, client, NULL);
 
 	g_usleep(60000000);
diff --git a/libedataserver/e-msgport.h b/libedataserver/e-msgport.h
index f7b9e2b..769d62f 100644
--- a/libedataserver/e-msgport.h
+++ b/libedataserver/e-msgport.h
@@ -25,8 +25,8 @@ EDListNode *e_dlist_addtail(EDList *l, EDListNode *n);
 EDListNode *e_dlist_remove(EDListNode *n);
 EDListNode *e_dlist_remhead(EDList *l);
 EDListNode *e_dlist_remtail(EDList *l);
-int e_dlist_empty(EDList *l);
-int e_dlist_length(EDList *l);
+gint e_dlist_empty(EDList *l);
+gint e_dlist_length(EDList *l);
 
 /* a time-based cache */
 typedef struct _EMCache EMCache;
@@ -35,15 +35,15 @@ typedef struct _EMCacheNode EMCacheNode;
 /* subclass this for your data nodes, EMCache is opaque */
 struct _EMCacheNode {
 	struct _EMCacheNode *next, *prev;
-	char *key;
-	int ref_count;
+	gchar *key;
+	gint ref_count;
 	time_t stamp;
 };
 
 EMCache *em_cache_new(time_t timeout, size_t nodesize, GFreeFunc nodefree);
 void em_cache_destroy(EMCache *emc);
-EMCacheNode *em_cache_lookup(EMCache *emc, const char *key);
-EMCacheNode *em_cache_node_new(EMCache *emc, const char *key);
+EMCacheNode *em_cache_lookup(EMCache *emc, const gchar *key);
+EMCacheNode *em_cache_node_new(EMCache *emc, const gchar *key);
 void em_cache_node_unref(EMCache *emc, EMCacheNode *n);
 void em_cache_add(EMCache *emc, EMCacheNode *n);
 void em_cache_clear(EMCache *emc);
@@ -63,7 +63,7 @@ typedef struct _EMsg {
 EMsgPort *e_msgport_new(void);
 void e_msgport_destroy(EMsgPort *mp);
 /* get a fd that can be used to wait on the port asynchronously */
-int e_msgport_fd(EMsgPort *mp);
+gint e_msgport_fd(EMsgPort *mp);
 void e_msgport_put(EMsgPort *mp, EMsg *msg);
 EMsg *e_msgport_wait(EMsgPort *mp);
 EMsg *e_msgport_get(EMsgPort *mp);
@@ -84,17 +84,17 @@ typedef enum {
 				   stored in the queue until a thread becomes available for it, creating a thread pool */
 } e_thread_t;
 
-typedef void (*EThreadFunc)(EThread *, EMsg *, void *data);
+typedef void (*EThreadFunc)(EThread *, EMsg *, gpointer data);
 
 EThread *e_thread_new(e_thread_t type);
 void e_thread_destroy(EThread *e);
-void e_thread_set_queue_limit(EThread *e, int limit);
-void e_thread_set_msg_lost(EThread *e, EThreadFunc destroy, void *data);
-void e_thread_set_msg_destroy(EThread *e, EThreadFunc destroy, void *data);
+void e_thread_set_queue_limit(EThread *e, gint limit);
+void e_thread_set_msg_lost(EThread *e, EThreadFunc destroy, gpointer data);
+void e_thread_set_msg_destroy(EThread *e, EThreadFunc destroy, gpointer data);
 void e_thread_set_reply_port(EThread *e, EMsgPort *reply_port);
-void e_thread_set_msg_received(EThread *e, EThreadFunc received, void *data);
+void e_thread_set_msg_received(EThread *e, EThreadFunc received, gpointer data);
 void e_thread_put(EThread *e, EMsg *msg);
-int e_thread_busy(EThread *e);
+gint e_thread_busy(EThread *e);
 #endif /* EDS_DISABLE_DEPRECATED */
 
 #ifndef EDS_DISABLE_DEPRECATED
@@ -107,12 +107,12 @@ typedef enum _e_mutex_t {
 } e_mutex_t;
 
 EMutex *e_mutex_new(e_mutex_t type);
-int e_mutex_destroy(EMutex *m);
-int e_mutex_lock(EMutex *m);
-int e_mutex_unlock(EMutex *m);
+gint e_mutex_destroy(EMutex *m);
+gint e_mutex_lock(EMutex *m);
+gint e_mutex_unlock(EMutex *m);
 void e_mutex_assert_locked(EMutex *m);
 /* this uses pthread cond's */
-int e_mutex_cond_wait(void *cond, EMutex *m);
+gint e_mutex_cond_wait(gpointer cond, EMutex *m);
 #endif /* EDS_DISABLE_DEPRECATED */
 
 #endif
diff --git a/libedataserver/e-proxy.c b/libedataserver/e-proxy.c
index 0694fd3..313cf13 100644
--- a/libedataserver/e-proxy.c
+++ b/libedataserver/e-proxy.c
@@ -107,8 +107,8 @@ typedef enum {
 
 typedef struct {
 	ProxyAddrType type;	/* Specifies whether IPV4 or IPV6 */
-	void* addr;		/* Either in_addr* or in6_addr* */
-	void* mask;		/* Either in_addr* or in6_addr* */
+	gpointer  addr;		/* Either in_addr* or in6_addr* */
+	gpointer  mask;		/* Either in_addr* or in6_addr* */
 } ProxyHostAddr;
 
 /* Signals.  */
@@ -118,7 +118,7 @@ enum {
 };
 
 static GObjectClass *parent_class;
-static unsigned int signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
 
 /* Forward declarations.  */
 
@@ -266,7 +266,7 @@ e_proxy_get_type (void)
 }
 
 static gboolean
-ep_is_in_ignored (EProxy *proxy, const char *host)
+ep_is_in_ignored (EProxy *proxy, const gchar *host)
 {
 	EProxyPrivate *priv;
 	GSList* l;
@@ -298,7 +298,7 @@ ep_is_in_ignored (EProxy *proxy, const char *host)
 }
 
 static gboolean
-ep_need_proxy_http (EProxy* proxy, const char* host)
+ep_need_proxy_http (EProxy* proxy, const gchar * host)
 {
 	SoupAddress *addr = NULL;
 	EProxyPrivate *priv = proxy->priv;
@@ -379,7 +379,7 @@ ep_need_proxy_http (EProxy* proxy, const char* host)
 }
 
 static gboolean
-ep_need_proxy_https (EProxy* proxy, const char* host)
+ep_need_proxy_https (EProxy* proxy, const gchar * host)
 {
 	/* Can we share ignore list from HTTP at all? */
 	return !ep_is_in_ignored (proxy, host);
@@ -388,7 +388,7 @@ ep_need_proxy_https (EProxy* proxy, const char* host)
 static gboolean
 ep_manipulate_ipv4 (ProxyHostAddr *host_addr,
 		    struct in_addr *addr_in,
-		    gchar* netmask)
+		    gchar * netmask)
 {
 	gboolean has_error = FALSE;
 	struct in_addr *addr, *mask;
@@ -437,11 +437,11 @@ ipv6_network_addr(const struct in6_addr *addr, const struct in6_addr *mask,
 static gboolean
 ep_manipulate_ipv6 (ProxyHostAddr *host_addr,
 		    struct in6_addr *addr_in6,
-		    gchar* netmask)
+		    gchar * netmask)
 {
 	gboolean has_error = FALSE;
 	struct in6_addr *addr, *mask;
-	int i;
+	gint i;
 
 	if (!addr_in6)
 		return has_error;
@@ -543,7 +543,7 @@ ep_parse_ignore_host (gpointer data, gpointer user_data)
 }
 
 static gboolean
-ep_change_uri (SoupURI **soup_uri, const char *uri)
+ep_change_uri (SoupURI **soup_uri, const gchar *uri)
 {
 	gboolean changed = FALSE;
 
@@ -556,7 +556,7 @@ ep_change_uri (SoupURI **soup_uri, const char *uri)
 			changed = TRUE;
 		}
 	} else if (*soup_uri) {
-		char *old = soup_uri_to_string (*soup_uri, FALSE);
+		gchar *old = soup_uri_to_string (*soup_uri, FALSE);
 
 		changed = old && uri && g_ascii_strcasecmp (old, uri) != 0;
 		if (changed) {
@@ -578,8 +578,8 @@ ep_set_proxy (GConfClient *client,
 	      gpointer user_data,
 	      gboolean regen_ign_host_list)
 {
-	char *proxy_server, *uri_http = NULL, *uri_https = NULL;
-	int proxy_port, old_type;
+	gchar *proxy_server, *uri_http = NULL, *uri_https = NULL;
+	gint proxy_port, old_type;
 	EProxy* proxy = (EProxy *)user_data;
 	EProxyPrivate* priv = proxy->priv;
 	GSList *ignore;
@@ -632,7 +632,7 @@ ep_set_proxy (GConfClient *client,
 	}
 
 	if (gconf_client_get_bool (client, RIGHT_KEY (HTTP_USE_AUTH), NULL)) {
-		char *proxy_user, *proxy_pw, *tmp;
+		gchar *proxy_user, *proxy_pw, *tmp;
 
 		proxy_user = gconf_client_get_string (client, RIGHT_KEY (HTTP_AUTH_USER), NULL);
 		proxy_pw = gconf_client_get_string (client, RIGHT_KEY (HTTP_AUTH_PWD), NULL);
@@ -663,7 +663,7 @@ ep_set_proxy (GConfClient *client,
 static void
 ep_setting_changed (GConfClient *client, guint32 cnxn_id, GConfEntry *entry, gpointer user_data)
 {
-	const char *key;
+	const gchar *key;
 	EProxy* proxy = (EProxy *)user_data;
 	EProxyPrivate *priv;
 
@@ -756,7 +756,7 @@ e_proxy_setup_proxy (EProxy* proxy)
 }
 
 SoupURI*
-e_proxy_peek_uri_for (EProxy* proxy, const char *uri)
+e_proxy_peek_uri_for (EProxy* proxy, const gchar *uri)
 {
 	SoupURI *suri;
 
@@ -774,7 +774,7 @@ e_proxy_peek_uri_for (EProxy* proxy, const char *uri)
 }
 
 gboolean
-e_proxy_require_proxy_for_uri (EProxy* proxy, const char* uri)
+e_proxy_require_proxy_for_uri (EProxy* proxy, const gchar * uri)
 {
 	SoupURI *srv_uri = NULL;
 	gboolean ret = FALSE;
diff --git a/libedataserver/e-proxy.h b/libedataserver/e-proxy.h
index fdbef44..752d292 100644
--- a/libedataserver/e-proxy.h
+++ b/libedataserver/e-proxy.h
@@ -51,11 +51,11 @@ struct _EProxyClass {
 };
 
 EProxy* e_proxy_new (void);
-SoupURI* e_proxy_peek_uri_for (EProxy* proxy, const char *uri);
+SoupURI* e_proxy_peek_uri_for (EProxy* proxy, const gchar *uri);
 void e_proxy_setup_proxy (EProxy* proxy);
 GType e_proxy_get_type (void);
 gboolean e_proxy_require_proxy_for_uri (EProxy *proxy,
-					const char* uri);
+					const gchar * uri);
 
 G_END_DECLS
 
diff --git a/libedataserver/e-sexp.c b/libedataserver/e-sexp.c
index 31ccbb1..072d86f 100644
--- a/libedataserver/e-sexp.c
+++ b/libedataserver/e-sexp.c
@@ -36,7 +36,7 @@
   bool = (or bool*)
 	perform a boolean OR of boolean values.
 
-  int = (+ int*)
+  gint = (+ int*)
 	Add integers.
 
   string = (+ string*)
@@ -45,13 +45,13 @@
   time_t = (+ time_t*)
 	Add time_t values.
 
-  int = (- int int*)
+  gint = (- gint int*)
 	Subtract integers from the first.
 
   time_t = (- time_t*)
 	Subtract time_t values from the first.
 
-  int = (cast-int string|int|bool)
+  gint = (cast-int string|int|bool)
         Cast to an integer value.
 
   string = (cast-string string|int|bool)
@@ -59,9 +59,9 @@
 
   Comparison operators:
 
-  bool = (< int int)
-  bool = (> int int)
-  bool = (= int int)
+  bool = (< gint int)
+  bool = (> gint int)
+  bool = (= gint int)
 
   bool = (< string string)
   bool = (> string string)
@@ -100,10 +100,10 @@
 #define d(x)			/* general debug */
 
 
-static struct _ESExpTerm * parse_list(ESExp *f, int gotbrace);
+static struct _ESExpTerm * parse_list(ESExp *f, gint gotbrace);
 static struct _ESExpTerm * parse_value(ESExp *f);
 
-static void parse_dump_term(struct _ESExpTerm *t, int depth);
+static void parse_dump_term(struct _ESExpTerm *t, gint depth);
 
 #ifdef E_SEXP_IS_G_OBJECT
 static GObjectClass *parent_class;
@@ -148,7 +148,7 @@ static const GScannerConfig scanner_config =
 
 /* jumps back to the caller of f->failenv, only to be called from inside a callback */
 void
-e_sexp_fatal_error(struct _ESExp *f, const char *why, ...)
+e_sexp_fatal_error(struct _ESExp *f, const gchar *why, ...)
 {
 	va_list args;
 
@@ -162,14 +162,14 @@ e_sexp_fatal_error(struct _ESExp *f, const char *why, ...)
 	longjmp(f->failenv, 1);
 }
 
-const char *
+const gchar *
 e_sexp_error(struct _ESExp *f)
 {
 	return f->error;
 }
 
 struct _ESExpResult *
-e_sexp_result_new(struct _ESExp *f, int type)
+e_sexp_result_new(struct _ESExp *f, gint type)
 {
 	struct _ESExpResult *r = e_memchunk_alloc0(f->result_chunks);
 	r->type = type;
@@ -203,9 +203,9 @@ e_sexp_result_free(struct _ESExp *f, struct _ESExpResult *t)
 
 /* used in normal functions if they have to abort, and free their arguments */
 void
-e_sexp_resultv_free(struct _ESExp *f, int argc, struct _ESExpResult **argv)
+e_sexp_resultv_free(struct _ESExp *f, gint argc, struct _ESExpResult **argv)
 {
-	int i;
+	gint i;
 
 	for (i=0;i<argc;i++) {
 		e_sexp_result_free(f, argv[i]);
@@ -216,13 +216,13 @@ e_sexp_resultv_free(struct _ESExp *f, int argc, struct _ESExpResult **argv)
 
 /* we can only itereate a hashtable from a called function */
 struct IterData {
-	int count;
+	gint count;
 	GPtrArray *uids;
 };
 
 /* ok, store any values that are in all sets */
 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);
@@ -231,21 +231,21 @@ htand(char *key, int value, struct IterData *iter_data)
 
 /* 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);
 }
 
 static ESExpResult *
-term_eval_and(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+term_eval_and(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
 {
 	struct _ESExpResult *r, *r1;
 	GHashTable *ht = g_hash_table_new(g_str_hash, g_str_equal);
 	struct IterData lambdafoo;
-	int type=-1;
-	int bool = TRUE;
-	int i;
-	const char *oper;
+	gint type=-1;
+	gint bool = TRUE;
+	gint i;
+	const gchar *oper;
 
 	r(printf("( and\n"));
 
@@ -264,14 +264,14 @@ term_eval_and(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
 			g_hash_table_destroy(ht);
 			e_sexp_fatal_error(f, "Invalid types in AND");
 		} else if (r1->type == ESEXP_RES_ARRAY_PTR) {
-			char **a1;
-			int l1, j;
+			gchar **a1;
+			gint l1, j;
 
-			a1 = (char **)r1->value.ptrarray->pdata;
+			a1 = (gchar **)r1->value.ptrarray->pdata;
 			l1 = r1->value.ptrarray->len;
 			for (j=0;j<l1;j++) {
 				gpointer ptr;
-				int n;
+				gint n;
 				ptr = g_hash_table_lookup(ht, a1[j]);
 				n = GPOINTER_TO_INT(ptr);
 				g_hash_table_insert(ht, a1[j], GINT_TO_POINTER(n+1));
@@ -300,15 +300,15 @@ term_eval_and(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
 }
 
 static ESExpResult *
-term_eval_or(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+term_eval_or(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
 {
 	struct _ESExpResult *r, *r1;
 	GHashTable *ht = g_hash_table_new(g_str_hash, g_str_equal);
 	struct IterData lambdafoo;
-	int type = -1;
-	int bool = FALSE;
-	int i;
-	const char *oper;
+	gint type = -1;
+	gint bool = FALSE;
+	gint i;
+	const gchar *oper;
 
 	r(printf("(or \n"));
 
@@ -327,13 +327,13 @@ term_eval_or(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
 			g_hash_table_destroy(ht);
 			e_sexp_fatal_error(f, "Invalid types in OR");
 		} else if (r1->type == ESEXP_RES_ARRAY_PTR) {
-			char **a1;
-			int l1, j;
+			gchar **a1;
+			gint l1, j;
 
-			a1 = (char **)r1->value.ptrarray->pdata;
+			a1 = (gchar **)r1->value.ptrarray->pdata;
 			l1 = r1->value.ptrarray->len;
 			for (j=0;j<l1;j++) {
-				g_hash_table_insert(ht, a1[j], (void *)1);
+				g_hash_table_insert(ht, a1[j], (gpointer)1);
 			}
 		} else if (r1->type == ESEXP_RES_BOOL) {
 			bool |= r1->value.bool;
@@ -358,9 +358,9 @@ term_eval_or(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
 }
 
 static ESExpResult *
-term_eval_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+term_eval_not(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
-	int res = TRUE;
+	gint res = TRUE;
 	ESExpResult *r;
 
 	if (argc>0) {
@@ -375,7 +375,7 @@ term_eval_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 
 /* this should support all arguments ...? */
 static ESExpResult *
-term_eval_lt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+term_eval_lt(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
 {
 	struct _ESExpResult *r, *r1, *r2;
 
@@ -407,7 +407,7 @@ term_eval_lt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
 
 /* this should support all arguments ...? */
 static ESExpResult *
-term_eval_gt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+term_eval_gt(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
 {
 	struct _ESExpResult *r, *r1, *r2;
 
@@ -439,7 +439,7 @@ term_eval_gt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
 
 /* this should support all arguments ...? */
 static ESExpResult *
-term_eval_eq(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+term_eval_eq(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
 {
 	struct _ESExpResult *r, *r1, *r2;
 
@@ -466,17 +466,17 @@ term_eval_eq(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
 }
 
 static ESExpResult *
-term_eval_plus(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+term_eval_plus(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	struct _ESExpResult *r=NULL;
-	int type;
-	int i;
+	gint type;
+	gint i;
 
 	if (argc>0) {
 		type = argv[0]->type;
 		switch(type) {
 		case ESEXP_RES_INT: {
-			int total = argv[0]->value.number;
+			gint total = argv[0]->value.number;
 			for (i=1;i<argc && argv[i]->type == ESEXP_RES_INT;i++) {
 				total += argv[i]->value.number;
 			}
@@ -527,17 +527,17 @@ term_eval_plus(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *dat
 }
 
 static ESExpResult *
-term_eval_sub(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+term_eval_sub(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	struct _ESExpResult *r=NULL;
-	int type;
-	int i;
+	gint type;
+	gint i;
 
 	if (argc>0) {
 		type = argv[0]->type;
 		switch(type) {
 		case ESEXP_RES_INT: {
-			int total = argv[0]->value.number;
+			gint total = argv[0]->value.number;
 			for (i=1;i<argc && argv[i]->type == ESEXP_RES_INT;i++) {
 				total -= argv[i]->value.number;
 			}
@@ -574,14 +574,14 @@ term_eval_sub(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 	return r;
 }
 
-/* cast to int */
+/* cast to gint */
 static ESExpResult *
-term_eval_castint(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+term_eval_castint(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	struct _ESExpResult *r;
 
 	if (argc != 1)
-		e_sexp_fatal_error(f, "Incorrect argument count to (int )");
+		e_sexp_fatal_error(f, "Incorrect argument count to (gint )");
 
 	r = e_sexp_result_new(f, ESEXP_RES_INT);
 	switch (argv[0]->type) {
@@ -604,7 +604,7 @@ term_eval_castint(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *
 
 /* cast to string */
 static ESExpResult *
-term_eval_caststring(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
+term_eval_caststring(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 {
 	struct _ESExpResult *r;
 
@@ -624,7 +624,7 @@ term_eval_caststring(struct _ESExp *f, int argc, struct _ESExpResult **argv, voi
 		break;
 	default:
 		e_sexp_result_free(f, r);
-		e_sexp_fatal_error(f, "Invalid type in (int )");
+		e_sexp_fatal_error(f, "Invalid type in (gint )");
 	}
 
 	return r;
@@ -632,10 +632,10 @@ term_eval_caststring(struct _ESExp *f, int argc, struct _ESExpResult **argv, voi
 
 /* implements 'if' function */
 static ESExpResult *
-term_eval_if(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+term_eval_if(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
 {
 	struct _ESExpResult *r;
-	int doit;
+	gint doit;
 
 	if (argc >=2 && argc<=3) {
 		r = e_sexp_term_eval(f, argv[0]);
@@ -652,10 +652,10 @@ term_eval_if(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
 
 /* implements 'begin' statement */
 static ESExpResult *
-term_eval_begin(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
+term_eval_begin(struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer data)
 {
 	struct _ESExpResult *r=NULL;
-	int i;
+	gint i;
 
 	for (i=0;i<argc;i++) {
 		if (r)
@@ -674,7 +674,7 @@ struct _ESExpResult *
 e_sexp_term_eval(struct _ESExp *f, struct _ESExpTerm *t)
 {
 	struct _ESExpResult *r = NULL;
-	int i;
+	gint i;
 	struct _ESExpResult **argv;
 
 	g_return_val_if_fail(t != NULL, NULL);
@@ -690,12 +690,12 @@ e_sexp_term_eval(struct _ESExp *f, struct _ESExpTerm *t)
 		r->value.string = g_strdup(t->value.string);
 		break;
 	case ESEXP_TERM_INT:
-		r(printf(" (int %d)\n", t->value.number));
+		r(printf(" (gint %d)\n", t->value.number));
 		r = e_sexp_result_new(f, ESEXP_RES_INT);
 		r->value.number = t->value.number;
 		break;
 	case ESEXP_TERM_BOOL:
-		r(printf(" (int %d)\n", t->value.number));
+		r(printf(" (gint %d)\n", t->value.number));
 		r = e_sexp_result_new(f, ESEXP_RES_BOOL);
 		r->value.bool = t->value.bool;
 		break;
@@ -732,9 +732,9 @@ e_sexp_term_eval(struct _ESExp *f, struct _ESExpTerm *t)
 
 #ifdef TESTER
 static void
-eval_dump_result(ESExpResult *r, int depth)
+eval_dump_result(ESExpResult *r, gint depth)
 {
-	int i;
+	gint i;
 
 	if (r==NULL) {
 		printf("null result???\n");
@@ -769,9 +769,9 @@ eval_dump_result(ESExpResult *r, int depth)
 #endif
 
 static void
-parse_dump_term(struct _ESExpTerm *t, int depth)
+parse_dump_term(struct _ESExpTerm *t, gint depth)
 {
-	int i;
+	gint i;
 
 	if (t==NULL) {
 		printf("null term??\n");
@@ -820,7 +820,7 @@ parse_dump_term(struct _ESExpTerm *t, int depth)
 */
 
 static struct _ESExpTerm *
-parse_term_new(struct _ESExp *f, int type)
+parse_term_new(struct _ESExp *f, gint type)
 {
 	struct _ESExpTerm *s = e_memchunk_alloc0(f->term_chunks);
 	s->type = type;
@@ -830,7 +830,7 @@ parse_term_new(struct _ESExp *f, int type)
 static void
 parse_term_free(struct _ESExp *f, struct _ESExpTerm *t)
 {
-	int i;
+	gint i;
 
 	if (t==NULL) {
 		return;
@@ -862,11 +862,11 @@ parse_term_free(struct _ESExp *f, struct _ESExpTerm *t)
 }
 
 static struct _ESExpTerm **
-parse_values(ESExp *f, int *len)
+parse_values(ESExp *f, gint *len)
 {
-	int token;
+	gint token;
 	struct _ESExpTerm **terms;
-	int i, size = 0;
+	gint i, size = 0;
 	GScanner *gs = f->scanner;
 	GSList *list = NULL, *l;
 
@@ -905,7 +905,7 @@ ESExpTerm * e_sexp_parse_value (ESExp *f)
 static struct _ESExpTerm *
 parse_value(ESExp *f)
 {
-	int token, negative = FALSE;
+	gint token, negative = FALSE;
 	struct _ESExpTerm *t = NULL;
 	GScanner *gs = f->scanner;
 	struct _ESExpSymbol *s;
@@ -939,10 +939,10 @@ parse_value(ESExp *f)
 		t->value.number = g_scanner_cur_value(gs).v_int;
 		if (negative)
 			t->value.number = -t->value.number;
-		p(printf("got int %d\n", t->value.number));
+		p(printf("got gint %d\n", t->value.number));
 		break;
 	case '#': {
-		char *str;
+		gchar *str;
 
 		p(printf("got bool?\n"));
 		token = g_scanner_get_next_token(gs);
@@ -995,9 +995,9 @@ parse_value(ESExp *f)
 
 /* FIXME: this needs some robustification */
 static struct _ESExpTerm *
-parse_list(ESExp *f, int gotbrace)
+parse_list(ESExp *f, gint gotbrace)
 {
-	int token;
+	gint token;
 	struct _ESExpTerm *t = NULL;
 	GScanner *gs = f->scanner;
 
@@ -1049,7 +1049,7 @@ parse_list(ESExp *f, int gotbrace)
 	return t;
 }
 
-static void e_sexp_finalise(void *);
+static void e_sexp_finalise(gpointer);
 
 #ifdef E_SEXP_IS_G_OBJECT
 static void
@@ -1065,9 +1065,9 @@ e_sexp_class_init (ESExpClass *klass)
 
 /* 'builtin' functions */
 static const struct {
-	const char *name;
+	const 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[] = {
 	{ "and", (ESExpFunc *)term_eval_and, 1 },
@@ -1085,7 +1085,7 @@ static const struct {
 };
 
 static void
-free_symbol(void *key, void *value, void *data)
+free_symbol(gpointer key, gpointer value, gpointer data)
 {
 	struct _ESExpSymbol *s = value;
 
@@ -1094,7 +1094,7 @@ free_symbol(void *key, void *value, void *data)
 }
 
 static void
-e_sexp_finalise(void *o)
+e_sexp_finalise(gpointer o)
 {
 	ESExp *s = (ESExp *)o;
 
@@ -1117,7 +1117,7 @@ e_sexp_finalise(void *o)
 static void
 e_sexp_init (ESExp *s)
 {
-	int i;
+	gint i;
 
 	s->scanner = g_scanner_new(&scanner_config);
 	s->term_chunks = e_memchunk_new(16, sizeof(struct _ESExpTerm));
@@ -1126,9 +1126,9 @@ e_sexp_init (ESExp *s)
 	/* load in builtin symbols? */
 	for(i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
 		if (symbols[i].type == 1) {
-			e_sexp_add_ifunction(s, 0, (char *) symbols[i].name, (ESExpIFunc *)symbols[i].func, (void *)&symbols[i]);
+			e_sexp_add_ifunction(s, 0, (gchar *) symbols[i].name, (ESExpIFunc *)symbols[i].func, (gpointer)&symbols[i]);
 		} else {
-			e_sexp_add_function(s, 0, (char *) symbols[i].name, symbols[i].func, (void *)&symbols[i]);
+			e_sexp_add_function(s, 0, (gchar *) symbols[i].name, symbols[i].func, (gpointer)&symbols[i]);
 		}
 	}
 
@@ -1195,7 +1195,7 @@ e_sexp_unref (ESExp *f)
 #endif
 
 void
-e_sexp_add_function(ESExp *f, int scope, char *name, ESExpFunc *func, void *data)
+e_sexp_add_function(ESExp *f, gint scope, gchar *name, ESExpFunc *func, gpointer data)
 {
 	struct _ESExpSymbol *s;
 
@@ -1213,7 +1213,7 @@ e_sexp_add_function(ESExp *f, int scope, char *name, ESExpFunc *func, void *data
 }
 
 void
-e_sexp_add_ifunction(ESExp *f, int scope, char *name, ESExpIFunc *ifunc, void *data)
+e_sexp_add_ifunction(ESExp *f, gint scope, gchar *name, ESExpIFunc *ifunc, gpointer data)
 {
 	struct _ESExpSymbol *s;
 
@@ -1231,7 +1231,7 @@ e_sexp_add_ifunction(ESExp *f, int scope, char *name, ESExpIFunc *ifunc, void *d
 }
 
 void
-e_sexp_add_variable(ESExp *f, int scope, char *name, ESExpTerm *value)
+e_sexp_add_variable(ESExp *f, gint scope, gchar *name, ESExpTerm *value)
 {
 	struct _ESExpSymbol *s;
 
@@ -1246,9 +1246,9 @@ e_sexp_add_variable(ESExp *f, int scope, char *name, ESExpTerm *value)
 }
 
 void
-e_sexp_remove_symbol(ESExp *f, int scope, char *name)
+e_sexp_remove_symbol(ESExp *f, gint scope, gchar *name)
 {
-	int oldscope;
+	gint oldscope;
 	struct _ESExpSymbol *s;
 
 	g_return_if_fail (IS_E_SEXP (f));
@@ -1264,8 +1264,8 @@ e_sexp_remove_symbol(ESExp *f, int scope, char *name)
 	}
 }
 
-int
-e_sexp_set_scope(ESExp *f, int scope)
+gint
+e_sexp_set_scope(ESExp *f, gint scope)
 {
 	g_return_val_if_fail (IS_E_SEXP (f), 0);
 
@@ -1273,7 +1273,7 @@ e_sexp_set_scope(ESExp *f, int scope)
 }
 
 void
-e_sexp_input_text(ESExp *f, const char *text, int len)
+e_sexp_input_text(ESExp *f, const gchar *text, gint len)
 {
 	g_return_if_fail (IS_E_SEXP (f));
 	g_return_if_fail (text != NULL);
@@ -1282,7 +1282,7 @@ e_sexp_input_text(ESExp *f, const char *text, int len)
 }
 
 void
-e_sexp_input_file (ESExp *f, int fd)
+e_sexp_input_file (ESExp *f, gint fd)
 {
 	g_return_if_fail (IS_E_SEXP (f));
 
@@ -1290,7 +1290,7 @@ e_sexp_input_file (ESExp *f, int fd)
 }
 
 /* returns -1 on error */
-int
+gint
 e_sexp_parse(ESExp *f)
 {
 	g_return_val_if_fail (IS_E_SEXP (f), -1);
@@ -1350,10 +1350,10 @@ e_sexp_encode_bool(GString *s, gboolean state)
  * are escaped appropriately.
  **/
 void
-e_sexp_encode_string(GString *s, const char *string)
+e_sexp_encode_string(GString *s, const gchar *string)
 {
-	char c;
-	const char *p;
+	gchar c;
+	const gchar *p;
 
 	if (string == NULL)
 		p = "";
@@ -1369,10 +1369,10 @@ e_sexp_encode_string(GString *s, const char *string)
 }
 
 #ifdef TESTER
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
 {
 	ESExp *f;
-	char *t = "(+ \"foo\" \"\\\"\" \"bar\" \"\\\\ blah \\x \")";
+	gchar *t = "(+ \"foo\" \"\\\"\" \"bar\" \"\\\\ blah \\x \")";
 	ESExpResult *r;
 
 	g_type_init();
diff --git a/libedataserver/e-sexp.h b/libedataserver/e-sexp.h
index ae353a9..b6e9535 100644
--- a/libedataserver/e-sexp.h
+++ b/libedataserver/e-sexp.h
@@ -52,20 +52,20 @@ struct _ESExpResult {
 	enum _ESExpResultType type;
 	union {
 		GPtrArray *ptrarray;
-		int number;
-		char *string;
-		int bool;
+		gint number;
+		gchar *string;
+		gint bool;
 		time_t time;
 	} value;
 };
 
-typedef struct _ESExpResult *(ESExpFunc)(struct _ESExp *sexp, int argc,
+typedef struct _ESExpResult *(ESExpFunc)(struct _ESExp *sexp, gint argc,
 					 struct _ESExpResult **argv,
-					 void *data);
+					 gpointer data);
 
-typedef struct _ESExpResult *(ESExpIFunc)(struct _ESExp *sexp, int argc,
+typedef struct _ESExpResult *(ESExpIFunc)(struct _ESExp *sexp, gint argc,
 					  struct _ESExpTerm **argv,
-					  void *data);
+					  gpointer data);
 
 enum _ESExpTermType {
 	ESEXP_TERM_INT	= 0,	/* integer literal */
@@ -78,9 +78,9 @@ enum _ESExpTermType {
 };
 
 struct _ESExpSymbol {
-	int type;		/* ESEXP_TERM_FUNC or ESEXP_TERM_VAR */
-	char *name;
-	void *data;
+	gint type;		/* ESEXP_TERM_FUNC or ESEXP_TERM_VAR */
+	gchar *name;
+	gpointer data;
 	union {
 		ESExpFunc *func;
 		ESExpIFunc *ifunc;
@@ -90,14 +90,14 @@ struct _ESExpSymbol {
 struct _ESExpTerm {
 	enum _ESExpTermType type;
 	union {
-		char *string;
-		int number;
-		int bool;
+		gchar *string;
+		gint number;
+		gint bool;
 		time_t time;
 		struct {
 			struct _ESExpSymbol *sym;
 			struct _ESExpTerm **terms;
-			int termcount;
+			gint termcount;
 		} func;
 		struct _ESExpSymbol *var;
 	} value;
@@ -109,14 +109,14 @@ struct _ESExp {
 #ifdef E_SEXP_IS_G_OBJECT
 	GObject parent_object;
 #else
-	int refcount;
+	gint refcount;
 #endif
 	GScanner *scanner;	/* for parsing text version */
 	ESExpTerm *tree;	/* root of expression tree */
 
 	/* private stuff */
 	jmp_buf failenv;
-	char *error;
+	gchar *error;
 	GSList *operators;
 
 	/* TODO: may also need a pool allocator for term strings, so we dont lose them
@@ -129,7 +129,7 @@ struct _ESExpClass {
 #ifdef E_SEXP_IS_G_OBJECT
 	GObjectClass parent_class;
 #else
-	int dummy;
+	gint dummy;
 #endif
 };
 
@@ -144,35 +144,35 @@ ESExp	       *e_sexp_new		(void);
 void		e_sexp_ref		(ESExp *f);
 void		e_sexp_unref		(ESExp *f);
 #endif
-void		e_sexp_add_function	(ESExp *f, int scope, char *name, ESExpFunc *func, void *data);
-void		e_sexp_add_ifunction	(ESExp *f, int scope, char *name, ESExpIFunc *func, void *data);
-void		e_sexp_add_variable	(ESExp *f, int scope, char *name, ESExpTerm *value);
-void		e_sexp_remove_symbol	(ESExp *f, int scope, char *name);
-int		e_sexp_set_scope	(ESExp *f, int scope);
+void		e_sexp_add_function	(ESExp *f, gint scope, gchar *name, ESExpFunc *func, gpointer data);
+void		e_sexp_add_ifunction	(ESExp *f, gint scope, gchar *name, ESExpIFunc *func, gpointer data);
+void		e_sexp_add_variable	(ESExp *f, gint scope, gchar *name, ESExpTerm *value);
+void		e_sexp_remove_symbol	(ESExp *f, gint scope, gchar *name);
+int		e_sexp_set_scope	(ESExp *f, gint scope);
 
-void		e_sexp_input_text	(ESExp *f, const char *text, int len);
-void		e_sexp_input_file	(ESExp *f, int fd);
+void		e_sexp_input_text	(ESExp *f, const gchar *text, gint len);
+void		e_sexp_input_file	(ESExp *f, gint fd);
 
 
 int		e_sexp_parse		(ESExp *f);
 ESExpResult    *e_sexp_eval		(ESExp *f);
 
 ESExpResult    *e_sexp_term_eval	(struct _ESExp *f, struct _ESExpTerm *t);
-ESExpResult    *e_sexp_result_new	(struct _ESExp *f, int type);
+ESExpResult    *e_sexp_result_new	(struct _ESExp *f, gint type);
 void		e_sexp_result_free	(struct _ESExp *f, struct _ESExpResult *t);
 
 /* used in normal functions if they have to abort, to free their arguments */
-void		e_sexp_resultv_free	(struct _ESExp *f, int argc, struct _ESExpResult **argv);
+void		e_sexp_resultv_free	(struct _ESExp *f, gint argc, struct _ESExpResult **argv);
 
 /* utility functions for creating s-exp strings. */
 void		e_sexp_encode_bool	(GString *s, gboolean state);
-void		e_sexp_encode_string	(GString *s, const char *string);
+void		e_sexp_encode_string	(GString *s, const gchar *string);
 
 /* only to be called from inside a callback to signal a fatal execution error */
-void		e_sexp_fatal_error	(struct _ESExp *f, const char *why, ...) G_GNUC_NORETURN;
+void		e_sexp_fatal_error	(struct _ESExp *f, const gchar *why, ...) G_GNUC_NORETURN;
 
 /* return the error string */
-const char     *e_sexp_error		(struct _ESExp *f);
+const gchar     *e_sexp_error		(struct _ESExp *f);
 
 ESExpTerm * e_sexp_parse_value(ESExp *f);
 
diff --git a/libedataserver/e-source-group.c b/libedataserver/e-source-group.c
index 06f1c14..c3563d1 100644
--- a/libedataserver/e-source-group.c
+++ b/libedataserver/e-source-group.c
@@ -34,9 +34,9 @@
 /* Private members.  */
 
 struct _ESourceGroupPrivate {
-	char *uid;
-	char *name;
-	char *base_uri;
+	gchar *uid;
+	gchar *name;
+	gchar *base_uri;
 
 	GSList *sources;
 
@@ -55,7 +55,7 @@ enum {
 	SOURCE_ADDED,
 	LAST_SIGNAL
 };
-static unsigned int signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
 
 
 /* Callbacks.  */
@@ -233,8 +233,8 @@ property_dump_cb (const gchar *key, const gchar *value, xmlNodePtr root)
 /* Public methods.  */
 
 ESourceGroup *
-e_source_group_new (const char *name,
-		    const char *base_uri)
+e_source_group_new (const gchar *name,
+		    const gchar *base_uri)
 {
 	ESourceGroup *new;
 
@@ -251,7 +251,7 @@ e_source_group_new (const char *name,
 }
 
 ESourceGroup *
-e_source_group_new_from_xml (const char *xml)
+e_source_group_new_from_xml (const gchar *xml)
 {
 	xmlDocPtr doc;
 	ESourceGroup *group;
@@ -336,7 +336,7 @@ e_source_group_new_from_xmldoc (xmlDocPtr doc)
 
 gboolean
 e_source_group_update_from_xml (ESourceGroup *group,
-				const char *xml,
+				const gchar *xml,
 				gboolean *changed_return)
 {
 	xmlDocPtr xmldoc;
@@ -420,7 +420,7 @@ e_source_group_update_from_xmldoc (ESourceGroup *group,
 
 	for (nodep = root->children; nodep != NULL; nodep = nodep->next) {
 		ESource *existing_source;
-		char *uid;
+		gchar *uid;
 
 		if (!nodep->name)
 			continue;
@@ -519,12 +519,12 @@ e_source_group_update_from_xmldoc (ESourceGroup *group,
 	return TRUE;		/* Success. */
 }
 
-char *
+gchar *
 e_source_group_uid_from_xmldoc (xmlDocPtr doc)
 {
 	xmlNodePtr root = doc->children;
 	xmlChar *name;
-	char *retval;
+	gchar *retval;
 
 	if (root && root->name) {
 		if (strcmp (GC root->name, "group") != 0)
@@ -544,7 +544,7 @@ e_source_group_uid_from_xmldoc (xmlDocPtr doc)
 
 void
 e_source_group_set_name (ESourceGroup *group,
-			 const char *name)
+			 const gchar *name)
 {
 	g_return_if_fail (E_IS_SOURCE_GROUP (group));
 	g_return_if_fail (name != NULL);
@@ -563,7 +563,7 @@ e_source_group_set_name (ESourceGroup *group,
 }
 
 void e_source_group_set_base_uri (ESourceGroup *group,
-				  const char *base_uri)
+				  const gchar *base_uri)
 {
 	g_return_if_fail (E_IS_SOURCE_GROUP (group));
 	g_return_if_fail (base_uri != NULL);
@@ -600,7 +600,7 @@ void e_source_group_set_readonly (ESourceGroup *group,
 	g_signal_emit (group, signals[CHANGED], 0);
 }
 
-const char *
+const gchar *
 e_source_group_peek_uid (ESourceGroup *group)
 {
 	g_return_val_if_fail (E_IS_SOURCE_GROUP (group), NULL);
@@ -608,7 +608,7 @@ e_source_group_peek_uid (ESourceGroup *group)
 	return group->priv->uid;
 }
 
-const char *
+const gchar *
 e_source_group_peek_name (ESourceGroup *group)
 {
 	g_return_val_if_fail (E_IS_SOURCE_GROUP (group), NULL);
@@ -616,7 +616,7 @@ e_source_group_peek_name (ESourceGroup *group)
 	return group->priv->name;
 }
 
-const char *
+const gchar *
 e_source_group_peek_base_uri (ESourceGroup *group)
 {
 	g_return_val_if_fail (E_IS_SOURCE_GROUP (group), NULL);
@@ -642,7 +642,7 @@ e_source_group_peek_sources (ESourceGroup *group)
 
 ESource *
 e_source_group_peek_source_by_uid (ESourceGroup *group,
-				   const char *uid)
+				   const gchar *uid)
 {
 	GSList *p;
 
@@ -656,7 +656,7 @@ e_source_group_peek_source_by_uid (ESourceGroup *group,
 
 ESource *
 e_source_group_peek_source_by_name (ESourceGroup *group,
-				    const char *name)
+				    const gchar *name)
 {
 	GSList *p;
 
@@ -671,7 +671,7 @@ e_source_group_peek_source_by_name (ESourceGroup *group,
 gboolean
 e_source_group_add_source (ESourceGroup *group,
 			   ESource *source,
-			   int position)
+			   gint position)
 {
 	g_return_val_if_fail (E_IS_SOURCE_GROUP (group), FALSE);
 
@@ -724,7 +724,7 @@ e_source_group_remove_source (ESourceGroup *group,
 
 gboolean
 e_source_group_remove_source_by_uid (ESourceGroup *group,
-				     const char *uid)
+				     const gchar *uid)
 {
 	GSList *p;
 
@@ -753,14 +753,14 @@ e_source_group_remove_source_by_uid (ESourceGroup *group,
 }
 
 
-char *
+gchar *
 e_source_group_to_xml (ESourceGroup *group)
 {
 	xmlDocPtr doc;
 	xmlNodePtr root;
 	xmlChar *xml_buffer;
-	char *returned_buffer;
-	int xml_buffer_size;
+	gchar *returned_buffer;
+	gint xml_buffer_size;
 	GSList *p;
 
 	doc = xmlNewDoc (XC "1.0");
diff --git a/libedataserver/e-source-group.h b/libedataserver/e-source-group.h
index 5c1b473..49ecfcd 100644
--- a/libedataserver/e-source-group.h
+++ b/libedataserver/e-source-group.h
@@ -61,46 +61,46 @@ struct _ESourceGroupClass {
 
 GType    e_source_group_get_type (void);
 
-ESourceGroup *e_source_group_new              (const char *name,
-					       const char *base_uri);
-ESourceGroup *e_source_group_new_from_xml     (const char *xml);
+ESourceGroup *e_source_group_new              (const gchar *name,
+					       const gchar *base_uri);
+ESourceGroup *e_source_group_new_from_xml     (const gchar *xml);
 ESourceGroup *e_source_group_new_from_xmldoc  (xmlDocPtr   doc);
 
 gboolean  e_source_group_update_from_xml     (ESourceGroup *group,
-					      const char   *xml,
+					      const gchar   *xml,
 					      gboolean     *changed_return);
 gboolean  e_source_group_update_from_xmldoc  (ESourceGroup *group,
 					      xmlDocPtr     doc,
 					      gboolean     *changed_return);
 
-char *e_source_group_uid_from_xmldoc  (xmlDocPtr doc);
+gchar *e_source_group_uid_from_xmldoc  (xmlDocPtr doc);
 
 void  e_source_group_set_name      (ESourceGroup *group,
-				    const char   *name);
+				    const gchar   *name);
 void  e_source_group_set_base_uri  (ESourceGroup *group,
-				    const char   *base_uri);
+				    const gchar   *base_uri);
 
 void e_source_group_set_readonly (ESourceGroup *group,
 				  gboolean      readonly);
 
-const char *e_source_group_peek_uid       (ESourceGroup *group);
-const char *e_source_group_peek_name      (ESourceGroup *group);
-const char *e_source_group_peek_base_uri  (ESourceGroup *group);
+const gchar *e_source_group_peek_uid       (ESourceGroup *group);
+const gchar *e_source_group_peek_name      (ESourceGroup *group);
+const gchar *e_source_group_peek_base_uri  (ESourceGroup *group);
 gboolean    e_source_group_get_readonly   (ESourceGroup *group);
 
 GSList  *e_source_group_peek_sources        (ESourceGroup *group);
 ESource *e_source_group_peek_source_by_uid  (ESourceGroup *group,
-					     const char   *source_uid);
+					     const gchar   *source_uid);
 ESource *e_source_group_peek_source_by_name (ESourceGroup *group,
-					     const char   *source_name);
+					     const gchar   *source_name);
 
 gboolean  e_source_group_add_source            (ESourceGroup *group,
 						ESource      *source,
-						int           position);
+						gint           position);
 gboolean  e_source_group_remove_source         (ESourceGroup *group,
 						ESource      *source);
 gboolean  e_source_group_remove_source_by_uid  (ESourceGroup *group,
-						const char   *uid);
+						const gchar   *uid);
 
 gchar *e_source_group_get_property     (ESourceGroup *source,
 					      const gchar *property);
@@ -111,7 +111,7 @@ void         e_source_group_foreach_property (ESourceGroup *source,
 					      GHFunc func,
 					      gpointer data);
 
-char *e_source_group_to_xml (ESourceGroup *group);
+gchar *e_source_group_to_xml (ESourceGroup *group);
 
 gboolean e_source_group_equal (ESourceGroup *a, ESourceGroup *b);
 gboolean e_source_group_xmlstr_equal (const gchar *a, const gchar *b);
diff --git a/libedataserver/e-source-list.c b/libedataserver/e-source-list.c
index 675de23..b4f23e3 100644
--- a/libedataserver/e-source-list.c
+++ b/libedataserver/e-source-list.c
@@ -29,14 +29,14 @@
 
 struct _ESourceListPrivate {
 	GConfClient *gconf_client;
-	char *gconf_path;
+	gchar *gconf_path;
 
-	int gconf_notify_id;
+	gint gconf_notify_id;
 
 	GSList *groups;
 
 	gboolean ignore_group_changed;
-	int sync_idle_id;
+	gint sync_idle_id;
 };
 
 
@@ -48,7 +48,7 @@ enum {
 	GROUP_ADDED,
 	LAST_SIGNAL
 };
-static unsigned int signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
 
 
 /* Forward declarations.  */
@@ -57,7 +57,7 @@ static gboolean  sync_idle_callback      (ESourceList  *list);
 static void      group_changed_callback  (ESourceGroup *group,
 					  ESourceList  *list);
 static void      conf_changed_callback   (GConfClient  *client,
-					  unsigned int  connection_id,
+					  guint  connection_id,
 					  GConfEntry   *entry,
 					  ESourceList  *list);
 
@@ -71,7 +71,7 @@ load_from_gconf (ESourceList *list)
 	GSList *new_groups_list;
 	GHashTable *new_groups_hash;
 	gboolean changed = FALSE;
-	int pos;
+	gint pos;
 
 	conf_list = gconf_client_get_list (list->priv->gconf_client,
 					   list->priv->gconf_path,
@@ -83,7 +83,7 @@ load_from_gconf (ESourceList *list)
 	for (p = conf_list, pos = 0; p != NULL; p = p->next, pos++) {
 		const xmlChar *xml = p->data;
 		xmlDocPtr xmldoc;
-		char *group_uid;
+		gchar *group_uid;
 		ESourceGroup *existing_group;
 
 		xmldoc = xmlParseDoc (xml);
@@ -218,7 +218,7 @@ group_changed_callback (ESourceGroup *group,
 
 static void
 conf_changed_callback (GConfClient *client,
-		       unsigned int connection_id,
+		       guint connection_id,
 		       GConfEntry *entry,
 		       ESourceList *list)
 {
@@ -366,7 +366,7 @@ e_source_list_new (void)
 
 ESourceList *
 e_source_list_new_for_gconf (GConfClient *client,
-			     const char *path)
+			     const gchar *path)
 {
 	ESourceList *list;
 
@@ -391,7 +391,7 @@ e_source_list_new_for_gconf (GConfClient *client,
 }
 
 ESourceList *
-e_source_list_new_for_gconf_default (const char  *path)
+e_source_list_new_for_gconf_default (const gchar  *path)
 {
 	ESourceList *list;
 
@@ -423,7 +423,7 @@ e_source_list_peek_groups (ESourceList *list)
 
 ESourceGroup *
 e_source_list_peek_group_by_uid (ESourceList *list,
-				 const char *uid)
+				 const gchar *uid)
 {
 	GSList *p;
 
@@ -447,7 +447,7 @@ e_source_list_peek_group_by_uid (ESourceList *list,
  **/
 ESourceGroup *
 e_source_list_peek_group_by_name (ESourceList *list,
-				  const char *name)
+				  const gchar *name)
 {
 	GSList *p;
 
@@ -470,10 +470,10 @@ e_source_list_peek_group_by_name (ESourceList *list,
  * Returns the first group which base uri begins with a base_uri.
  **/
 ESourceGroup *
-e_source_list_peek_group_by_base_uri (ESourceList *list, const char *base_uri)
+e_source_list_peek_group_by_base_uri (ESourceList *list, const gchar *base_uri)
 {
 	GSList *p;
-	int len;
+	gint len;
 
 	g_return_val_if_fail (E_IS_SOURCE_LIST (list), NULL);
 	g_return_val_if_fail (base_uri != NULL, NULL);
@@ -482,7 +482,7 @@ e_source_list_peek_group_by_base_uri (ESourceList *list, const char *base_uri)
 
 	for (p = list->priv->groups; p != NULL; p = p->next) {
 		ESourceGroup *group = E_SOURCE_GROUP (p->data);
-		const char *buri = e_source_group_peek_base_uri (group);
+		const gchar *buri = e_source_group_peek_base_uri (group);
 
 		if (buri && g_ascii_strncasecmp (buri, base_uri, len) == 0)
 			return group;
@@ -497,9 +497,9 @@ struct property_check_struct {
 };
 
 static void
-check_group_property (const char *property_name, const char *property_value, struct property_check_struct *pcs)
+check_group_property (const gchar *property_name, const gchar *property_value, struct property_check_struct *pcs)
 {
-	char *value;
+	gchar *value;
 
 	g_return_if_fail (property_name != NULL);
 	g_return_if_fail (property_value != NULL);
@@ -519,7 +519,7 @@ check_group_property (const char *property_name, const char *property_value, str
  * case insensitively.
  **/
 ESourceGroup *
-e_source_list_peek_group_by_properties (ESourceList *list, const char *property_name, ...)
+e_source_list_peek_group_by_properties (ESourceList *list, const gchar *property_name, ...)
 {
 	GSList *p;
 	va_list ap;
@@ -532,13 +532,13 @@ e_source_list_peek_group_by_properties (ESourceList *list, const char *property_
 
 	va_start (ap, property_name);
 	while (property_name) {
-		const char *value = va_arg (ap, const char *);
+		const gchar *value = va_arg (ap, const gchar *);
 
 		if (!value)
 			break;
 
 		g_hash_table_insert (props, (gpointer)property_name, (gpointer)value);
-		property_name = va_arg (ap, const char *);
+		property_name = va_arg (ap, const gchar *);
 	}
 	va_end (ap);
 
@@ -563,7 +563,7 @@ e_source_list_peek_group_by_properties (ESourceList *list, const char *property_
 
 ESource *
 e_source_list_peek_source_by_uid (ESourceList *list,
-				  const char *uid)
+				  const gchar *uid)
 {
 	GSList *p;
 
@@ -604,7 +604,7 @@ e_source_list_peek_source_any (ESourceList *list)
 gboolean
 e_source_list_add_group (ESourceList *list,
 			 ESourceGroup *group,
-			 int position)
+			 gint position)
 {
 	g_return_val_if_fail (E_IS_SOURCE_LIST (list), FALSE);
 	g_return_val_if_fail (E_IS_SOURCE_GROUP (group), FALSE);
@@ -639,7 +639,7 @@ e_source_list_remove_group (ESourceList *list,
 
 gboolean
 e_source_list_remove_group_by_uid (ESourceList *list,
-				    const char *uid)
+				    const gchar *uid)
 {
 	ESourceGroup *group;
 
@@ -661,7 +661,7 @@ e_source_list_remove_group_by_uid (ESourceList *list,
  * g_object_unref the group. Otherwise it returns NULL.
  **/
 ESourceGroup *
-e_source_list_ensure_group (ESourceList *list, const char *name, const char *base_uri, gboolean ret_it)
+e_source_list_ensure_group (ESourceList *list, const gchar *name, const gchar *base_uri, gboolean ret_it)
 {
 	ESourceGroup *group;
 
@@ -703,7 +703,7 @@ e_source_list_ensure_group (ESourceList *list, const char *name, const char *bas
  * Returns TRUE if group was found.
  **/
 gboolean
-e_source_list_remove_group_by_base_uri (ESourceList *list, const char *base_uri)
+e_source_list_remove_group_by_base_uri (ESourceList *list, const gchar *base_uri)
 {
 	ESourceGroup *group;
 
@@ -720,7 +720,7 @@ e_source_list_remove_group_by_base_uri (ESourceList *list, const char *base_uri)
 
 gboolean
 e_source_list_remove_source_by_uid (ESourceList *list,
-				     const char *uid)
+				     const gchar *uid)
 {
 	GSList *p;
 
@@ -773,9 +773,9 @@ e_source_list_sync (ESourceList *list,
 gboolean
 e_source_list_is_gconf_updated (ESourceList *list)
 {
-	char *source_group_xml = NULL;
-	char *gconf_xml = NULL;
-	char *group_uid = NULL;
+	gchar *source_group_xml = NULL;
+	gchar *gconf_xml = NULL;
+	gchar *group_uid = NULL;
 	GSList *conf_list = NULL, *temp = NULL, *p = NULL;
 	xmlDocPtr xmldoc;
 	ESourceGroup *group = NULL;
@@ -791,7 +791,7 @@ e_source_list_is_gconf_updated (ESourceList *list)
 	/* From conf to list */
 
 	for (temp = conf_list; temp != NULL; temp = temp->next) {
-		gconf_xml = (char *)temp->data;
+		gconf_xml = (gchar *)temp->data;
 		xmldoc = xmlParseDoc ((const xmlChar *)gconf_xml);
 
 		if (xmldoc == NULL)
@@ -823,7 +823,7 @@ e_source_list_is_gconf_updated (ESourceList *list)
 	/* If there is mismatch, free the conf_list and return FALSE */
 	if (!conf_to_list) {
 		for (p = conf_list; p != NULL ; p = p->next) {
-			gconf_xml = (char *) p->data;
+			gconf_xml = (gchar *) p->data;
 			g_free (gconf_xml);
 		}
 		g_slist_free (conf_list);
@@ -839,7 +839,7 @@ e_source_list_is_gconf_updated (ESourceList *list)
 		source_group_xml = e_source_group_to_xml (group);
 
 		for (temp = conf_list; temp != NULL; temp = temp->next) {
-			gconf_xml = (char *)temp->data;
+			gconf_xml = (gchar *)temp->data;
 			if (!e_source_group_xmlstr_equal (gconf_xml, source_group_xml))
 				continue;
 			else
@@ -855,7 +855,7 @@ e_source_list_is_gconf_updated (ESourceList *list)
 	}
 
 	for (p = conf_list; p != NULL ; p = p->next) {
-		gconf_xml = (char *) p->data;
+		gconf_xml = (gchar *) p->data;
 		g_free (gconf_xml);
 	}
 	g_slist_free (conf_list);
diff --git a/libedataserver/e-source-list.h b/libedataserver/e-source-list.h
index 4a7461d..b0e7885 100644
--- a/libedataserver/e-source-list.h
+++ b/libedataserver/e-source-list.h
@@ -63,36 +63,36 @@ GType    e_source_list_get_type (void);
 
 ESourceList *e_source_list_new            (void);
 ESourceList *e_source_list_new_for_gconf  (GConfClient *client,
-					   const char  *path);
-ESourceList *e_source_list_new_for_gconf_default  (const char  *path);
+					   const gchar  *path);
+ESourceList *e_source_list_new_for_gconf_default  (const gchar  *path);
 
 GSList       *e_source_list_peek_groups         (ESourceList *list);
 ESourceGroup *e_source_list_peek_group_by_uid   (ESourceList *list,
-						 const char  *uid);
+						 const gchar  *uid);
 #ifndef EDS_DISABLE_DEPRECATED
 ESourceGroup *e_source_list_peek_group_by_name  (ESourceList *list,
-						 const char *name);
+						 const gchar *name);
 #endif
-ESourceGroup *e_source_list_peek_group_by_base_uri (ESourceList *list, const char *base_uri);
-ESourceGroup *e_source_list_peek_group_by_properties (ESourceList *list, const char *property_name, ...);
+ESourceGroup *e_source_list_peek_group_by_base_uri (ESourceList *list, const gchar *base_uri);
+ESourceGroup *e_source_list_peek_group_by_properties (ESourceList *list, const gchar *property_name, ...);
 
 ESource      *e_source_list_peek_source_by_uid  (ESourceList *list,
-						 const char  *uid);
+						 const gchar  *uid);
 ESource      *e_source_list_peek_source_any     (ESourceList *list);
 
 gboolean  e_source_list_add_group             (ESourceList  *list,
 					       ESourceGroup *group,
-					       int           position);
+					       gint           position);
 gboolean  e_source_list_remove_group          (ESourceList  *list,
 					       ESourceGroup *group);
 gboolean  e_source_list_remove_group_by_uid   (ESourceList  *list,
-					       const char   *uid);
+					       const gchar   *uid);
 
-ESourceGroup *e_source_list_ensure_group (ESourceList *list, const char *name, const char *base_uri, gboolean ret_it);
-gboolean e_source_list_remove_group_by_base_uri (ESourceList *list, const char *base_uri);
+ESourceGroup *e_source_list_ensure_group (ESourceList *list, const gchar *name, const gchar *base_uri, gboolean ret_it);
+gboolean e_source_list_remove_group_by_base_uri (ESourceList *list, const gchar *base_uri);
 
 gboolean  e_source_list_remove_source_by_uid  (ESourceList  *list,
-					       const char   *uidj);
+					       const gchar   *uidj);
 
 gboolean  e_source_list_sync  (ESourceList  *list,
 			       GError      **error);
diff --git a/libedataserver/e-source.c b/libedataserver/e-source.c
index c86a316..bdb1f57 100644
--- a/libedataserver/e-source.c
+++ b/libedataserver/e-source.c
@@ -36,10 +36,10 @@
 struct _ESourcePrivate {
 	ESourceGroup *group;
 
-	char *uid;
-	char *name;
-	char *relative_uri;
-	char *absolute_uri;
+	gchar *uid;
+	gchar *name;
+	gchar *relative_uri;
+	gchar *absolute_uri;
 
 	gboolean readonly;
 
@@ -55,7 +55,7 @@ enum {
 	CHANGED,
 	LAST_SIGNAL
 };
-static unsigned int signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
 
 
 /* Callbacks.  */
@@ -163,8 +163,8 @@ set_color_spec (ESource *source,
 /* Public methods.  */
 
 ESource *
-e_source_new  (const char *name,
-	       const char *relative_uri)
+e_source_new  (const gchar *name,
+	       const gchar *relative_uri)
 {
 	ESource *source;
 
@@ -180,8 +180,8 @@ e_source_new  (const char *name,
 }
 
 ESource *
-e_source_new_with_absolute_uri (const char *name,
-				const char *absolute_uri)
+e_source_new_with_absolute_uri (const gchar *name,
+				const gchar *absolute_uri)
 {
 	ESource *source;
 
@@ -208,7 +208,7 @@ e_source_new_from_xml_node (xmlNodePtr node)
 
 	source = g_object_new (e_source_get_type (), NULL);
 
-	source->priv->uid = g_strdup ((char*)uid);
+	source->priv->uid = g_strdup ((gchar *)uid);
 	xmlFree (uid);
 
 	if (e_source_update_from_xml_node (source, node, NULL))
@@ -228,14 +228,14 @@ import_properties (ESource *source,
 	for (prop_node = prop_root->children; prop_node; prop_node = prop_node->next) {
 		xmlChar *name, *value;
 
-		if (!prop_node->name || strcmp ((char*)prop_node->name, "property"))
+		if (!prop_node->name || strcmp ((gchar *)prop_node->name, "property"))
 			continue;
 
 		name = xmlGetProp (prop_node, (xmlChar*)"name");
 		value = xmlGetProp (prop_node, (xmlChar*)"value");
 
 		if (name && value)
-			g_hash_table_insert (priv->properties, g_strdup ((char*)name), g_strdup ((char*)value));
+			g_hash_table_insert (priv->properties, g_strdup ((gchar *)name), g_strdup ((gchar *)value));
 
 		if (name)
 			xmlFree (name);
@@ -308,28 +308,28 @@ e_source_update_from_xml_node (ESource *source,
 		goto done;
 
 	if (source->priv->name == NULL
-	    || strcmp ((char*)name, source->priv->name) != 0
+	    || strcmp ((gchar *)name, source->priv->name) != 0
 	    || source->priv->relative_uri == NULL
 	    || relative_uri != NULL
-	    || strcmp ((char*)relative_uri, source->priv->relative_uri) != 0) {
+	    || strcmp ((gchar *)relative_uri, source->priv->relative_uri) != 0) {
 		g_free (source->priv->name);
-		source->priv->name = g_strdup ((char*)name);
+		source->priv->name = g_strdup ((gchar *)name);
 
 		g_free (source->priv->relative_uri);
-		source->priv->relative_uri = g_strdup ((char*)relative_uri);
+		source->priv->relative_uri = g_strdup ((gchar *)relative_uri);
 
 		changed = TRUE;
 	}
 
 	if (absolute_uri != NULL) {
 		g_free (source->priv->absolute_uri);
-		source->priv->absolute_uri = g_strdup ((char*)absolute_uri);
+		source->priv->absolute_uri = g_strdup ((gchar *)absolute_uri);
 		changed = TRUE;
 	}
 
 	if (color == NULL) {
 		/* It is okay for color_spec to be NULL. */
-		changed |= set_color_spec (source, (char*)color_spec);
+		changed |= set_color_spec (source, (gchar *)color_spec);
 	} else {
 		gchar buffer[8];
 		g_snprintf (buffer, sizeof (buffer), "#%s", color);
@@ -347,7 +347,7 @@ e_source_update_from_xml_node (ESource *source,
 		if (!node->name)
 			continue;
 
-		if (!strcmp ((char*)node->name, "properties")) {
+		if (!strcmp ((gchar *)node->name, "properties")) {
 			GHashTable *temp = source->priv->properties;
 			source->priv->properties = g_hash_table_new_full (g_str_hash, g_str_equal,
 									  g_free, g_free);
@@ -392,21 +392,21 @@ e_source_update_from_xml_node (ESource *source,
  * Return value: Name of the source in the specified @node.  The caller must
  * free the string.
  **/
-char *
+gchar *
 e_source_uid_from_xml_node (xmlNodePtr node)
 {
 	xmlChar *uid = xmlGetProp (node, (xmlChar*)"uid");
-	char *retval;
+	gchar *retval;
 
 	if (uid == NULL)
 		return NULL;
 
-	retval = g_strdup ((char*)uid);
+	retval = g_strdup ((gchar *)uid);
 	xmlFree (uid);
 	return retval;
 }
 
-char *
+gchar *
 e_source_build_absolute_uri (ESource *source)
 {
 	const gchar *base_uri_str;
@@ -461,7 +461,7 @@ e_source_set_group (ESource *source,
 
 void
 e_source_set_name (ESource *source,
-		   const char *name)
+		   const gchar *name)
 {
 	g_return_if_fail (E_IS_SOURCE (source));
 	g_return_if_fail (name != NULL);
@@ -481,9 +481,9 @@ e_source_set_name (ESource *source,
 
 void
 e_source_set_relative_uri (ESource *source,
-			   const char *relative_uri)
+			   const gchar *relative_uri)
 {
-	char *absolute_uri;
+	gchar *absolute_uri;
 
 	g_return_if_fail (E_IS_SOURCE (source));
 
@@ -508,7 +508,7 @@ e_source_set_relative_uri (ESource *source,
 
 void
 e_source_set_absolute_uri (ESource *source,
-			   const char *absolute_uri)
+			   const gchar *absolute_uri)
 {
 	g_return_if_fail (E_IS_SOURCE (source));
 
@@ -588,7 +588,7 @@ e_source_peek_group (ESource *source)
 	return source->priv->group;
 }
 
-const char *
+const gchar *
 e_source_peek_uid (ESource *source)
 {
 	g_return_val_if_fail (E_IS_SOURCE (source), NULL);
@@ -596,7 +596,7 @@ e_source_peek_uid (ESource *source)
 	return source->priv->uid;
 }
 
-const char *
+const gchar *
 e_source_peek_name (ESource *source)
 {
 	g_return_val_if_fail (E_IS_SOURCE (source), NULL);
@@ -604,7 +604,7 @@ e_source_peek_name (ESource *source)
 	return source->priv->name;
 }
 
-const char *
+const gchar *
 e_source_peek_relative_uri (ESource *source)
 {
 	g_return_val_if_fail (E_IS_SOURCE (source), NULL);
@@ -612,7 +612,7 @@ e_source_peek_relative_uri (ESource *source)
 	return source->priv->relative_uri;
 }
 
-const char *
+const gchar *
 e_source_peek_absolute_uri (ESource *source)
 {
 	g_return_val_if_fail (E_IS_SOURCE (source), NULL);
@@ -631,7 +631,7 @@ e_source_peek_absolute_uri (ESource *source)
  *
  * Since: 1.10
  **/
-const char *
+const gchar *
 e_source_peek_color_spec (ESource *source)
 {
 	g_return_val_if_fail (E_IS_SOURCE (source), NULL);
@@ -684,7 +684,7 @@ e_source_get_color (ESource *source,
 }
 #endif
 
-char *
+gchar *
 e_source_get_uri (ESource *source)
 {
 	g_return_val_if_fail (E_IS_SOURCE (source), NULL);
@@ -720,7 +720,7 @@ dump_common_to_xml_node (ESource *source,
 {
 	ESourcePrivate *priv;
 	xmlNodePtr node;
-	const char *abs_uri = NULL, *relative_uri = NULL;
+	const gchar *abs_uri = NULL, *relative_uri = NULL;
 
 	priv = source->priv;
 
@@ -762,14 +762,14 @@ e_source_dump_to_xml_node (ESource *source,
 }
 
 
-char *
+gchar *
 e_source_to_standalone_xml (ESource *source)
 {
 	xmlDocPtr doc;
 	xmlNodePtr node;
 	xmlChar *xml_buffer;
-	char *returned_buffer;
-	int xml_buffer_size;
+	gchar *returned_buffer;
+	gint xml_buffer_size;
 	gchar *uri;
 
 	g_return_val_if_fail (E_IS_SOURCE (source), NULL);
@@ -878,7 +878,7 @@ e_source_xmlstr_equal (const gchar *a, const gchar *b)
 }
 
 ESource *
-e_source_new_from_standalone_xml (const char *xml)
+e_source_new_from_standalone_xml (const gchar *xml)
 {
 	xmlDocPtr doc;
 	xmlNodePtr root;
@@ -889,7 +889,7 @@ e_source_new_from_standalone_xml (const char *xml)
 		return NULL;
 
 	root = doc->children;
-	if (strcmp ((char*)root->name, "source") != 0)
+	if (strcmp ((gchar *)root->name, "source") != 0)
 		return NULL;
 
 	source = e_source_new_from_xml_node (root);
@@ -911,8 +911,8 @@ e_source_get_property (ESource *source,
 	return g_hash_table_lookup (priv->properties, property);
 }
 
-char *
-e_source_get_duped_property (ESource *source, const char *property)
+gchar *
+e_source_get_duped_property (ESource *source, const gchar *property)
 {
 	ESourcePrivate *priv;
 
diff --git a/libedataserver/e-source.h b/libedataserver/e-source.h
index b35b260..571b10a 100644
--- a/libedataserver/e-source.h
+++ b/libedataserver/e-source.h
@@ -57,12 +57,12 @@ struct _ESourceClass {
 
 GType    e_source_get_type (void);
 
-ESource *e_source_new                (const char   *name,
-				      const char   *relative_uri);
-ESource *e_source_new_with_absolute_uri(const char   *name,
-					const char   *absolute_uri);
+ESource *e_source_new                (const gchar   *name,
+				      const gchar   *relative_uri);
+ESource *e_source_new_with_absolute_uri(const gchar   *name,
+					const gchar   *absolute_uri);
 ESource *e_source_new_from_xml_node  (xmlNodePtr    node);
-ESource *e_source_new_from_standalone_xml (const char *xml);
+ESource *e_source_new_from_standalone_xml (const gchar *xml);
 
 ESource *e_source_copy (ESource *source);
 
@@ -70,16 +70,16 @@ gboolean  e_source_update_from_xml_node  (ESource    *source,
 					  xmlNodePtr  node,
 					  gboolean   *changed_return);
 
-char *e_source_uid_from_xml_node  (xmlNodePtr node);
+gchar *e_source_uid_from_xml_node  (xmlNodePtr node);
 
 void  e_source_set_group         (ESource      *source,
 				  ESourceGroup *group);
 void  e_source_set_name          (ESource      *source,
-				  const char   *name);
+				  const gchar   *name);
 void  e_source_set_relative_uri  (ESource      *source,
-				  const char   *relative_uri);
+				  const gchar   *relative_uri);
 void  e_source_set_absolute_uri  (ESource      *source,
-				  const char   *absolute_uri);
+				  const gchar   *absolute_uri);
 void  e_source_set_color_spec    (ESource      *source,
 				  const gchar  *color_spec);
 void  e_source_set_readonly      (ESource      *source,
@@ -91,22 +91,22 @@ void  e_source_unset_color       (ESource      *source);
 #endif
 
 ESourceGroup *e_source_peek_group         (ESource *source);
-const char   *e_source_peek_uid           (ESource *source);
-const char   *e_source_peek_name          (ESource *source);
-const char   *e_source_peek_relative_uri  (ESource *source);
-const char   *e_source_peek_absolute_uri  (ESource *source);
-const char   *e_source_peek_color_spec    (ESource *source);
+const gchar   *e_source_peek_uid           (ESource *source);
+const gchar   *e_source_peek_name          (ESource *source);
+const gchar   *e_source_peek_relative_uri  (ESource *source);
+const gchar   *e_source_peek_absolute_uri  (ESource *source);
+const gchar   *e_source_peek_color_spec    (ESource *source);
 gboolean      e_source_get_readonly       (ESource *source);
 #ifndef EDS_DISABLE_DEPRECATED
 gboolean      e_source_get_color          (ESource *source,
 					   guint32 *color_return);
 #endif
 
-char *e_source_get_uri  (ESource *source);
+gchar *e_source_get_uri  (ESource *source);
 
 void  e_source_dump_to_xml_node  (ESource    *source,
 				  xmlNodePtr  parent_node);
-char *e_source_to_standalone_xml (ESource *source);
+gchar *e_source_to_standalone_xml (ESource *source);
 
 const gchar *e_source_get_property     (ESource *source,
 					const gchar *property);
@@ -117,8 +117,8 @@ void         e_source_foreach_property (ESource *source,
 					GHFunc func,
 					gpointer data);
 
-char *e_source_get_duped_property (ESource *source, const char *property);
-char *e_source_build_absolute_uri (ESource *source);
+gchar *e_source_get_duped_property (ESource *source, const gchar *property);
+gchar *e_source_build_absolute_uri (ESource *source);
 
 gboolean e_source_equal (ESource *a, ESource *b);
 gboolean e_source_xmlstr_equal (const gchar *a, const gchar *b);
diff --git a/libedataserver/e-time-utils.c b/libedataserver/e-time-utils.c
index 868092d..ea5174d 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -41,10 +41,10 @@
 #include <windows.h>
 
 static const gchar *
-get_locale_string (int lctype)
+get_locale_string (gint lctype)
 {
-	int nbytes = GetLocaleInfo (GetThreadLocale (), lctype, NULL, 0);
-	char *tem;
+	gint nbytes = GetLocaleInfo (GetThreadLocale (), lctype, NULL, 0);
+	gchar *tem;
 	GQuark quark;
 
 	if (nbytes == 0)
@@ -63,15 +63,15 @@ get_locale_string (int lctype)
 	return g_quark_to_string (quark);
 }
 
-static const char *
-translate_picture (const char *picture)
+static const gchar *
+translate_picture (const gchar *picture)
 {
 	GString *s = g_string_new ("");
 	GQuark quark;
 
 	while (*picture) {
-		const char *q = picture + 1;
-		int count;
+		const gchar *q = picture + 1;
+		gint count;
 
 		while (*picture == *q)
 			q++;
@@ -239,7 +239,7 @@ localtime_r (t, tp)
 #if defined _LIBC && defined __GNUC__ && __GNUC__ >= 2
 # define match_string(cs1, s2) \
   ({ size_t len = strlen (cs1);						      \
-     int result = __strncasecmp_l ((cs1), (s2), len, locale) == 0;	      \
+     gint result = __strncasecmp_l ((cs1), (s2), len, locale) == 0;	      \
      if (result) (s2) += len;						      \
      result; })
 #else
@@ -251,7 +251,7 @@ localtime_r (t, tp)
    lead to problems with the wide character version.  */
 #define get_number(from, to, n) \
   do {									      \
-    int __n = n;							      \
+    gint __n = n;							      \
     val = 0;								      \
     while (*rp == ' ')							      \
       ++rp;								      \
@@ -317,21 +317,21 @@ extern const struct locale_data _nl_C_LC_TIME attribute_hidden;
 
 # define strncasecmp(s1, s2, n) __strncasecmp (s1, s2, n)
 #else
-static char const weekday_name[][10] =
+static gchar const weekday_name[][10] =
   {
     "Sunday", "Monday", "Tuesday", "Wednesday",
     "Thursday", "Friday", "Saturday"
   };
-static char const ab_weekday_name[][4] =
+static gchar const ab_weekday_name[][4] =
   {
     "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
   };
-static char const month_name[][10] =
+static gchar const month_name[][10] =
   {
     "January", "February", "March", "April", "May", "June",
     "July", "August", "September", "October", "November", "December"
   };
-static char const ab_month_name[][4] =
+static gchar const ab_month_name[][4] =
   {
     "Jan", "Feb", "Mar", "Apr", "May", "Jun",
     "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
@@ -343,7 +343,7 @@ static char const ab_month_name[][4] =
 # define HERE_T_FMT_AMPM "%I:%M:%S %p"
 # define HERE_T_FMT "%H:%M:%S"
 
-static const unsigned short int __mon_yday[2][13] =
+static const unsigned short gint __mon_yday[2][13] =
   {
     /* Normal years.  */
     { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
@@ -396,8 +396,8 @@ day_of_the_week (struct tm *tm)
   /* We know that January 1st 1970 was a Thursday (= 4).  Compute the
      the difference between this data in the one on TM and so determine
      the weekday.  */
-  int corr_year = 1900 + tm->tm_year - (tm->tm_mon < 2);
-  int wday = (-473
+  gint corr_year = 1900 + tm->tm_year - (tm->tm_mon < 2);
+  gint wday = (-473
 	      + (365 * (tm->tm_year - 70))
 	      + (corr_year / 4)
 	      - ((corr_year / 4) / 25) + ((corr_year / 4) % 25 < 0)
@@ -417,34 +417,34 @@ day_of_the_year (struct tm *tm)
 
 
 #ifdef _LIBC
-char *
+gchar *
 internal_function
 #else
-static char *
+static gchar *
 #endif
 __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
-     const char *rp;
-     const char *fmt;
+     const gchar *rp;
+     const gchar *fmt;
      struct tm *tm;
      enum ptime_locale_status *decided;
-     int era_cnt;
+     gint era_cnt;
      LOCALE_PARAM_DECL
 {
 #ifdef _LIBC
   struct locale_data *const current = locale->__locales[LC_TIME];
 #endif
 
-  const char *rp_backup;
-  int cnt;
+  const gchar *rp_backup;
+  gint cnt;
   size_t val;
-  int have_I, is_pm;
-  int century, want_century;
-  int want_era;
-  int have_wday, want_xday;
-  int have_yday;
-  int have_mon, have_mday;
-  int have_uweek, have_wweek;
-  int week_no;
+  gint have_I, is_pm;
+  gint century, want_century;
+  gint want_era;
+  gint have_wday, want_xday;
+  gint have_yday;
+  gint have_mon, have_mday;
+  gint have_uweek, have_wweek;
+  gint week_no;
 #ifdef _NL_CURRENT
   size_t num_eras;
 #endif
@@ -640,12 +640,12 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 #elif defined (G_OS_WIN32)
 	  if (*decided != raw)
 	    {
-	      char *d_t_fmt =
+	      gchar *d_t_fmt =
 		      g_strconcat (get_locale_string (LOCALE_SSHORTDATE),
 				   " ",
 				   get_locale_string (LOCALE_STIMEFORMAT),
 				   NULL);
-	      const char *posix_d_t_fmt = translate_picture (d_t_fmt);
+	      const gchar *posix_d_t_fmt = translate_picture (d_t_fmt);
 
 	      g_free (d_t_fmt);
 
@@ -717,7 +717,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 #elif defined (G_OS_WIN32)
 	  if (*decided != raw)
 	    {
-		const char *posix_d_fmt = translate_picture (get_locale_string (LOCALE_SSHORTDATE));
+		const gchar *posix_d_fmt = translate_picture (get_locale_string (LOCALE_SSHORTDATE));
 		if (!recursive (posix_d_fmt))
 		{
 		  if (*decided == loc)
@@ -853,11 +853,11 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 #elif defined (G_OS_WIN32)
 	  if (*decided != raw)
 	    {
-	      char *t_p_fmt =
+	      gchar *t_p_fmt =
 		      g_strconcat (get_locale_string (LOCALE_STIMEFORMAT),
 				   " tt",
 				   NULL);
-	      const char *posix_t_p_fmt = translate_picture (t_p_fmt);
+	      const gchar *posix_t_p_fmt = translate_picture (t_p_fmt);
 
 	      g_free (t_p_fmt);
 
@@ -935,7 +935,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 #elif defined (G_OS_WIN32)
 	  if (*decided != raw)
 	    {
-	      const char *posix_t_fmt = translate_picture (get_locale_string (LOCALE_STIMEFORMAT));
+	      const gchar *posix_t_fmt = translate_picture (get_locale_string (LOCALE_STIMEFORMAT));
 	      if (!recursive (posix_t_fmt))
 		{
 		  if (*decided == loc)
@@ -1027,7 +1027,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 	      /* Match locale's alternate date and time format.  */
 	      if (*decided != raw)
 		{
-		  const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT);
+		  const gchar *fmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT);
 
 		  if (*fmt == '\0')
 		    fmt = _NL_CURRENT (LC_TIME, D_T_FMT);
@@ -1108,10 +1108,10 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 		      assert (*decided == loc);
 
 		      era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG);
-		      int match = FALSE;
+		      gint match = FALSE;
 		      if (era != NULL)
 			{
-			  int delta = ((tm->tm_year - era->offset)
+			  gint delta = ((tm->tm_year - era->offset)
 				       * era->absolute_direction);
 			  match = (delta >= 0
 				   && delta < (((int64_t) era->stop_date[0]
@@ -1132,7 +1132,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 						  HELPER_LOCALE_ARG);
 		      if (era != NULL)
 			{
-			  int delta = ((tm->tm_year - era->offset)
+			  gint delta = ((tm->tm_year - era->offset)
 				       * era->absolute_direction);
 			  if (delta >= 0
 			      && delta < (((int64_t) era->stop_date[0]
@@ -1192,7 +1192,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 	    case 'x':
 	      if (*decided != raw)
 		{
-		  const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_FMT);
+		  const gchar *fmt = _NL_CURRENT (LC_TIME, ERA_D_FMT);
 
 		  if (*fmt == '\0')
 		    fmt = _NL_CURRENT (LC_TIME, D_FMT);
@@ -1218,7 +1218,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 	    case 'X':
 	      if (*decided != raw)
 		{
-		  const char *fmt = _NL_CURRENT (LC_TIME, ERA_T_FMT);
+		  const gchar *fmt = _NL_CURRENT (LC_TIME, ERA_T_FMT);
 
 		  if (*fmt == '\0')
 		    fmt = _NL_CURRENT (LC_TIME, T_FMT);
@@ -1374,7 +1374,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
       if ( !(have_mon && have_mday) && have_yday)
 	{
 	  /* We don't have tm_mon and/or tm_mday, compute them.  */
-	  int t_mon = 0;
+	  gint t_mon = 0;
 	  while (__mon_yday[__isleap(1900 + tm->tm_year)][t_mon] <= tm->tm_yday)
 	      t_mon++;
 	  if (!have_mon)
@@ -1392,10 +1392,10 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 
   if ((have_uweek || have_wweek) && have_wday)
     {
-      int save_wday = tm->tm_wday;
-      int save_mday = tm->tm_mday;
-      int save_mon = tm->tm_mon;
-      int w_offset = have_uweek ? 0 : 1;
+      gint save_wday = tm->tm_wday;
+      gint save_mday = tm->tm_mday;
+      gint save_mon = tm->tm_mon;
+      gint w_offset = have_uweek ? 0 : 1;
 
       tm->tm_mday = 1;
       tm->tm_mon = 0;
@@ -1412,7 +1412,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 
       if (!have_mday || !have_mon)
 	{
-	  int t_mon = 0;
+	  gint t_mon = 0;
 	  while (__mon_yday[__isleap(1900 + tm->tm_year)][t_mon]
 		 <= tm->tm_yday)
 	    t_mon++;
@@ -1427,13 +1427,13 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
       tm->tm_wday = save_wday;
     }
 
-  return (char *) rp;
+  return (gchar *) rp;
 }
 
-static char *
+static gchar *
 strptime (buf, format, tm LOCALE_PARAM)
-     const char *buf;
-     const char *format;
+     const gchar *buf;
+     const gchar *format;
      struct tm *tm;
      LOCALE_PARAM_DECL
 {
@@ -1456,9 +1456,9 @@ weak_alias (__strptime_l, strptime_l)
 
 /* Returns whether a string is NULL, empty, or full of whitespace */
 static gboolean
-string_is_empty (const char *value)
+string_is_empty (const gchar *value)
 {
-	const char *p;
+	const gchar *p;
 	gboolean empty = TRUE;
 
 	if (value) {
@@ -1479,13 +1479,13 @@ string_is_empty (const char *value)
  * string with them.
  */
 static ETimeParseStatus
-parse_with_strptime (const char *value, struct tm *result, const char **formats, int n_formats)
+parse_with_strptime (const gchar *value, struct tm *result, const gchar **formats, gint n_formats)
 {
-	const char *parse_end = NULL, *pos;
+	const gchar *parse_end = NULL, *pos;
 	gchar *locale_str;
 	gchar *format_str;
 	ETimeParseStatus parse_ret;
-	int i, n;
+	gint i, n;
 
 	if (string_is_empty (value)) {
 		memset (result, 0, sizeof (*result));
@@ -1495,7 +1495,7 @@ parse_with_strptime (const char *value, struct tm *result, const char **formats,
 
 	parse_ret =  E_TIME_PARSE_INVALID;
 	locale_str = g_locale_from_utf8 (value, -1, NULL, NULL, NULL);
-	pos = (const char *) locale_str;
+	pos = (const gchar *) locale_str;
 
 	if (!locale_str)
 		return E_TIME_PARSE_INVALID;
@@ -1563,7 +1563,7 @@ static gboolean
 locale_supports_12_hour_format (void)
 {
 	struct tm tmp_tm = { 0 };
-	char s[16];
+	gchar s[16];
 
 	e_utf8_strftime (s, sizeof (s), "%p", &tmp_tm);
 	return s[0] != '\0';
@@ -1572,8 +1572,8 @@ locale_supports_12_hour_format (void)
 static gboolean
 has_correct_date (const struct tm *value)
 {
-	const int days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-	int days, year;
+	const gint days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+	gint days, year;
 
 	g_return_val_if_fail (value != NULL, FALSE);
 	g_return_val_if_fail (value->tm_mon >= 0 && value->tm_mon < 12, FALSE);
@@ -1611,8 +1611,8 @@ e_time_parse_date_and_time_ex		(const char	*value,
 {
 	struct tm *today_tm;
 	time_t t;
-	const char *format[16];
-	int num_formats = 0;
+	const gchar *format[16];
+	gint num_formats = 0;
 	gboolean use_12_hour_formats = locale_supports_12_hour_format ();
 	ETimeParseStatus status;
 
@@ -1755,9 +1755,9 @@ e_time_parse_date_and_time		(const char	*value,
  * @value was an empty string, a valid date, or an invalid date.
  **/
 ETimeParseStatus
-e_time_parse_date_ex (const char *value, struct tm *result, gboolean *two_digit_year)
+e_time_parse_date_ex (const gchar *value, struct tm *result, gboolean *two_digit_year)
 {
-	const char *format[4];
+	const gchar *format[4];
 	ETimeParseStatus status;
 
 	g_return_val_if_fail (value != NULL, E_TIME_PARSE_INVALID);
@@ -1779,7 +1779,7 @@ e_time_parse_date_ex (const char *value, struct tm *result, gboolean *two_digit_
 		/* when we need to know about two digit year, then always first try
 		   full year, because for example nl_NL have format %d-%m-%y and it
 		   changes from two year itself, which isn't what we want */
-		const char *tmp = format [1];
+		const gchar *tmp = format [1];
 		format [1] = format [0];
 		format [0] = tmp;
 		*two_digit_year = FALSE;
@@ -1795,15 +1795,15 @@ e_time_parse_date_ex (const char *value, struct tm *result, gboolean *two_digit_
 	}
 
 	if (two_digit_year)
-		g_free ((char*)format [0]);
+		g_free ((gchar *)format [0]);
 	else
-		g_free ((char*)format [1]);
+		g_free ((gchar *)format [1]);
 
 	return status;
 }
 
 ETimeParseStatus
-e_time_parse_date (const char *value, struct tm *result)
+e_time_parse_date (const gchar *value, struct tm *result)
 {
 	return e_time_parse_date_ex (value, result, NULL);
 }
@@ -1823,10 +1823,10 @@ e_time_parse_date (const char *value, struct tm *result)
  * @value was an empty string, a valid date, or an invalid date.
  **/
 ETimeParseStatus
-e_time_parse_time (const char *value, struct tm *result)
+e_time_parse_time (const gchar *value, struct tm *result)
 {
-	const char *format[7];
-	int num_formats = 0;
+	const gchar *format[7];
+	gint num_formats = 0;
 	gboolean use_12_hour_formats = locale_supports_12_hour_format ();
 
 	if (use_12_hour_formats) {
@@ -1885,7 +1885,7 @@ e_time_format_date_and_time		(struct tm	*date_tm,
 					 char		*buffer,
 					 int		 buffer_size)
 {
-	char *format;
+	gchar *format;
 
 	if (!show_midnight && date_tm->tm_hour == 0
 	    && date_tm->tm_min == 0 && date_tm->tm_sec == 0) {
@@ -1936,7 +1936,7 @@ e_time_format_time			(struct tm	*date_tm,
 					 char		*buffer,
 					 int		 buffer_size)
 {
-	char *format;
+	gchar *format;
 
 	if (use_24_hour_format) {
 		if (!show_zero_seconds && date_tm->tm_sec == 0)
@@ -2006,7 +2006,7 @@ e_mktime_utc (struct tm *tm)
  * seconds from UTC time, stored in @offset.
  **/
 void
-e_localtime_with_offset (time_t tt, struct tm *tm, int *offset)
+e_localtime_with_offset (time_t tt, struct tm *tm, gint *offset)
 {
 	localtime_r (&tt, tm);
 
@@ -2024,11 +2024,11 @@ e_localtime_with_offset (time_t tt, struct tm *tm, int *offset)
 #endif
 }
 
-char *
+gchar *
 e_time_get_d_fmt_with_4digit_year (void)
 {
-	char *p;
-	char *res =
+	gchar *p;
+	gchar *res =
 	#if defined(__linux__)
 		g_strdup (nl_langinfo (D_FMT) );
 	/*#elif defined(G_OS_WIN32)
diff --git a/libedataserver/e-time-utils.h b/libedataserver/e-time-utils.h
index 824f310..0f98480 100644
--- a/libedataserver/e-time-utils.h
+++ b/libedataserver/e-time-utils.h
@@ -69,11 +69,11 @@ time_t e_mktime_utc (struct tm *tm);
 
 /* Like localtime_r(3), but also returns an offset in minutes after UTC.
    (Calling gmtime with tt + offset would generate the same tm) */
-void e_localtime_with_offset (time_t tt, struct tm *tm, int *offset);
+void e_localtime_with_offset (time_t tt, struct tm *tm, gint *offset);
 
 /* Returns format like %x, but always exchange all 'y' to 'Y'
    (force 4 digit year in format).
    Caller is responsible to g_free returned pointer. */
-char *e_time_get_d_fmt_with_4digit_year (void);
+gchar *e_time_get_d_fmt_with_4digit_year (void);
 
 #endif /* E_TIME_UTILS */
diff --git a/libedataserver/e-trie.c b/libedataserver/e-trie.c
index c627cfc..e7321ce 100644
--- a/libedataserver/e-trie.c
+++ b/libedataserver/e-trie.c
@@ -37,8 +37,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 {
@@ -63,11 +63,11 @@ struct _ETrie {
 
 
 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)
@@ -163,7 +163,7 @@ g (struct _trie_state *s, gunichar c)
 }
 
 static struct _trie_state *
-trie_insert (ETrie *trie, int depth, struct _trie_state *q, gunichar c)
+trie_insert (ETrie *trie, gint depth, struct _trie_state *q, gunichar c)
 {
 	struct _trie_match *m;
 
@@ -179,7 +179,7 @@ trie_insert (ETrie *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);
@@ -194,9 +194,9 @@ trie_insert (ETrie *trie, int depth, struct _trie_state *q, gunichar c)
 
 #if 1
 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,12 +239,12 @@ dump_trie (struct _trie_state *s, int depth)
  * Add a new pattern to the #ETrie @trie.
  **/
 void
-e_trie_add (ETrie *trie, const char *pattern, int pattern_id)
+e_trie_add (ETrie *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 */
@@ -334,16 +334,16 @@ e_trie_add (ETrie *trie, const char *pattern, int pattern_id)
  *
  * Returns: The matched pattern, or %NULL if no pattern is matched.
  **/
-const char *
-e_trie_search (ETrie *trie, const char *buffer, size_t buflen, int *matched_id)
+const gchar *
+e_trie_search (ETrie *trie, const gchar *buffer, size_t 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;
@@ -371,7 +371,7 @@ e_trie_search (ETrie *trie, const char *buffer, size_t buflen, int *matched_id)
 					if (matched_id)
 						*matched_id = q->id;
 
-					return (const char *) pat;
+					return (const gchar *) pat;
 				}
 			}
 		}
diff --git a/libedataserver/e-trie.h b/libedataserver/e-trie.h
index 3e64681..1652c48 100644
--- a/libedataserver/e-trie.h
+++ b/libedataserver/e-trie.h
@@ -39,9 +39,9 @@ typedef struct _ETrie ETrie;
 ETrie *e_trie_new (gboolean icase);
 void e_trie_free (ETrie *trie);
 
-void e_trie_add (ETrie *trie, const char *pattern, int pattern_id);
+void e_trie_add (ETrie *trie, const gchar *pattern, gint pattern_id);
 
-const char *e_trie_search (ETrie *trie, const char *buffer, size_t buflen, int *matched_id);
+const gchar *e_trie_search (ETrie *trie, const gchar *buffer, size_t buflen, gint *matched_id);
 
 #ifdef __cplusplus
 }
diff --git a/libedataserver/e-uid.c b/libedataserver/e-uid.c
index bf2161c..732a990 100644
--- a/libedataserver/e-uid.c
+++ b/libedataserver/e-uid.c
@@ -36,14 +36,14 @@
  * Return value: The newly generated UID.  The caller should free the string
  * when it's done with it.
  **/
-char *
+gchar *
 e_uid_new (void)
 {
-	static int serial;
-	static char *hostname;
+	static gint serial;
+	static gchar *hostname;
 
 	if (!hostname) {
-		hostname = (char *) g_get_host_name ();
+		hostname = (gchar *) g_get_host_name ();
 	}
 
 	return g_strdup_printf ("%lu %lu %d %s",
diff --git a/libedataserver/e-uid.h b/libedataserver/e-uid.h
index 2853ed4..5e38ea5 100644
--- a/libedataserver/e-uid.h
+++ b/libedataserver/e-uid.h
@@ -27,7 +27,7 @@
 
 G_BEGIN_DECLS
 
-char *e_uid_new  (void);
+gchar *e_uid_new  (void);
 
 G_END_DECLS
 
diff --git a/libedataserver/e-url.c b/libedataserver/e-url.c
index 7a34a59..5f67ba1 100644
--- a/libedataserver/e-url.c
+++ b/libedataserver/e-url.c
@@ -39,13 +39,13 @@
  *
  * Returns: The newly-allocated shrouded url.
  **/
-char *
-e_url_shroud (const char *url)
+gchar *
+e_url_shroud (const gchar *url)
 {
-	const char *first_colon = NULL;
-	const char *last_at = NULL;
-	const char *p;
-	char *shrouded;
+	const gchar *first_colon = NULL;
+	const gchar *last_at = NULL;
+	const gchar *p;
+	gchar *shrouded;
 
 	if (url == NULL)
 		return NULL;
@@ -85,10 +85,10 @@ e_url_shroud (const char *url)
  * Returns: %TRUE if the urls are equal, %FALSE if they are not.
  **/
 gboolean
-e_url_equal (const char *url1, const char *url2)
+e_url_equal (const gchar *url1, const gchar *url2)
 {
-	char *shroud1 = e_url_shroud (url1);
-	char *shroud2 = e_url_shroud (url2);
+	gchar *shroud1 = e_url_shroud (url1);
+	gchar *shroud2 = e_url_shroud (url2);
 	gint len1, len2;
 	gboolean rv;
 
@@ -110,7 +110,7 @@ e_url_equal (const char *url1, const char *url2)
 #define HEXVAL(c) (isdigit (c) ? (c) - '0' : tolower (c) - 'a' + 10)
 
 static void
-uri_decode (char *part)
+uri_decode (gchar *part)
 {
 	guchar *s, *d;
 
@@ -137,11 +137,11 @@ uri_decode (char *part)
  * Returns: The newly-allocated #EUri structure.
  **/
 EUri *
-e_uri_new (const char *uri_string)
+e_uri_new (const gchar *uri_string)
 {
 	EUri *uri;
-	const char *end, *hash, *colon, *semi, *at, *slash, *question;
-	const char *p;
+	const gchar *end, *hash, *colon, *semi, *at, *slash, *question;
+	const gchar *p;
 
 	if (!uri_string)
 		return NULL;
@@ -180,7 +180,7 @@ e_uri_new (const char *uri_string)
 		slash = uri_string + strcspn (uri_string, "/#");
 		at = strchr (uri_string, '@');
 		if (at && at < slash) {
-			const char *at2;
+			const gchar *at2;
 			/* this is for cases where username contains '@' at it, like:
 			   http://user domain com@server.addr.com/path
 			   We skip all at-s before the slash here. */
@@ -247,8 +247,8 @@ e_uri_new (const char *uri_string)
 	semi = memchr (uri_string, ';', end - uri_string);
 	if (semi) {
 		if (semi[1]) {
-			const char *cur, *ptr, *eq;
-			char *name, *value;
+			const gchar *cur, *ptr, *eq;
+			gchar *name, *value;
 
 			for (cur = semi + 1; cur < end; cur = ptr + 1) {
 				ptr = memchr (cur, ';', end - cur);
@@ -313,8 +313,8 @@ e_uri_free (EUri *uri)
  *
  * Returns: The value of the parameter.
  **/
-const char *
-e_uri_get_param (EUri *uri, const char *name)
+const gchar *
+e_uri_get_param (EUri *uri, const gchar *name)
 {
 	return g_datalist_get_data (&uri->params, name);
 }
@@ -371,10 +371,10 @@ e_uri_copy (EUri *uri)
  *
  * Returns: The string representation of @uri.
  **/
-char *
+gchar *
 e_uri_to_string (EUri *uri, gboolean show_password)
 {
-	char *str_uri = NULL;
+	gchar *str_uri = NULL;
 
 	g_return_val_if_fail (uri != NULL, NULL);
 
diff --git a/libedataserver/e-url.h b/libedataserver/e-url.h
index 792d968..9acfb1f 100644
--- a/libedataserver/e-url.h
+++ b/libedataserver/e-url.h
@@ -32,8 +32,8 @@
 
 G_BEGIN_DECLS
 
-char *e_url_shroud (const char *url);
-gboolean e_url_equal (const char *url1, const char *url2);
+gchar *e_url_shroud (const gchar *url);
+gboolean e_url_equal (const gchar *url1, const gchar *url2);
 
 /**
  * EUri:
@@ -51,23 +51,23 @@ gboolean e_url_equal (const char *url1, const char *url2);
  * A structure representing a URI.
  **/
 typedef struct {
-	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;
 } EUri;
 
-EUri       *e_uri_new       (const char *uri_string);
+EUri       *e_uri_new       (const gchar *uri_string);
 void        e_uri_free      (EUri *uri);
-const char *e_uri_get_param (EUri *uri, const char *name);
+const gchar *e_uri_get_param (EUri *uri, const gchar *name);
 EUri       *e_uri_copy      (EUri *uri);
-char       *e_uri_to_string (EUri *uri, gboolean show_password);
+gchar       *e_uri_to_string (EUri *uri, gboolean show_password);
 
 G_END_DECLS
 
diff --git a/libedataserver/e-xml-hash-utils.c b/libedataserver/e-xml-hash-utils.c
index 59a8f41..817fa85 100644
--- a/libedataserver/e-xml-hash-utils.c
+++ b/libedataserver/e-xml-hash-utils.c
@@ -61,7 +61,7 @@ e_xml_to_hash (xmlDoc *doc, EXmlHashType type)
 			continue;
 
 		if (type == E_XML_HASH_TYPE_OBJECT_UID &&
-		    !strcmp ((char*)node->name, "object"))
+		    !strcmp ((gchar *)node->name, "object"))
 			key = xmlGetProp (node, (xmlChar*)"uid");
 		else
 			key = xmlStrdup (node->name);
@@ -78,7 +78,7 @@ e_xml_to_hash (xmlDoc *doc, EXmlHashType type)
 			continue;
 		}
 
-		g_hash_table_insert (hash, g_strdup ((char*)key), g_strdup ((char*)value));
+		g_hash_table_insert (hash, g_strdup ((gchar *)key), g_strdup ((gchar *)value));
 		xmlFree (key);
 		xmlFree (value);
 	}
@@ -126,7 +126,7 @@ foreach_save_func (gpointer key, gpointer value, gpointer user_data)
  * Returns: The #xmlDoc created from the data in @hash.
  **/
 xmlDoc *
-e_xml_from_hash (GHashTable *hash, EXmlHashType type, const char *root_name)
+e_xml_from_hash (GHashTable *hash, EXmlHashType type, const gchar *root_name)
 {
 	xmlDoc *doc;
 	struct save_data sd;
@@ -169,7 +169,7 @@ e_xml_destroy_hash (GHashTable *hash)
  * A hash table representation of an XML file.
  **/
 struct EXmlHash {
-	char *filename;
+	gchar *filename;
 	GHashTable *objects;
 };
 
@@ -184,7 +184,7 @@ struct EXmlHash {
  *          @filename.
  **/
 EXmlHash *
-e_xmlhash_new (const char *filename)
+e_xmlhash_new (const gchar *filename)
 {
 	EXmlHash *hash;
 	xmlDoc *doc = NULL;
@@ -219,7 +219,7 @@ e_xmlhash_new (const char *filename)
  * Adds a new key/value pair to the #EXmlHash @hash.
  **/
 void
-e_xmlhash_add (EXmlHash *hash, const char *key, const char *data)
+e_xmlhash_add (EXmlHash *hash, const gchar *key, const gchar *data)
 {
 	g_return_if_fail (hash != NULL);
 	g_return_if_fail (key != NULL);
@@ -237,7 +237,7 @@ e_xmlhash_add (EXmlHash *hash, const char *key, const char *data)
  * Remove the entry in @hash with key equal to @key, if it exists.
  **/
 void
-e_xmlhash_remove (EXmlHash *hash, const char *key)
+e_xmlhash_remove (EXmlHash *hash, const gchar *key)
 {
 	gpointer orig_key;
 	gpointer orig_value;
@@ -267,10 +267,10 @@ e_xmlhash_remove (EXmlHash *hash, const char *key)
  *          its key equal to @key.
  **/
 EXmlHashStatus
-e_xmlhash_compare (EXmlHash *hash, const char *key, const char *compare_data)
+e_xmlhash_compare (EXmlHash *hash, const gchar *key, const gchar *compare_data)
 {
-	char *data;
-	int rc;
+	gchar *data;
+	gint rc;
 
 	g_return_val_if_fail (hash != NULL, E_XMLHASH_STATUS_NOT_FOUND);
 	g_return_val_if_fail (key != NULL, E_XMLHASH_STATUS_NOT_FOUND);
@@ -297,7 +297,7 @@ foreach_hash_func (gpointer  key, gpointer value, gpointer user_data)
 {
 	foreach_data_t *data = (foreach_data_t *) user_data;
 
-	data->func ((const char *) key, (const char *) value, data->user_data);
+	data->func ((const gchar *) key, (const gchar *) value, data->user_data);
 }
 
 /**
diff --git a/libedataserver/e-xml-hash-utils.h b/libedataserver/e-xml-hash-utils.h
index c024b67..69aceb1 100644
--- a/libedataserver/e-xml-hash-utils.h
+++ b/libedataserver/e-xml-hash-utils.h
@@ -39,7 +39,7 @@ GHashTable *e_xml_to_hash      (xmlDoc       *doc,
 				EXmlHashType  type);
 xmlDoc     *e_xml_from_hash    (GHashTable   *hash,
 				EXmlHashType  type,
-				const char   *root_node);
+				const gchar   *root_node);
 
 void        e_xml_destroy_hash (GHashTable   *hash);
 
@@ -57,22 +57,22 @@ typedef enum {
 	E_XMLHASH_STATUS_NOT_FOUND
 } EXmlHashStatus;
 
-typedef void (* EXmlHashFunc) (const char *key, const char *value, gpointer user_data);
-typedef gboolean (* EXmlHashRemoveFunc) (const char *key, const char *value, gpointer user_data);
+typedef void (* EXmlHashFunc) (const gchar *key, const gchar *value, gpointer user_data);
+typedef gboolean (* EXmlHashRemoveFunc) (const gchar *key, const gchar *value, gpointer user_data);
 
 typedef struct EXmlHash EXmlHash;
 
-EXmlHash      *e_xmlhash_new         (const char   *filename);
+EXmlHash      *e_xmlhash_new         (const gchar   *filename);
 
 void           e_xmlhash_add         (EXmlHash     *hash,
-				      const char   *key,
-				      const char   *data);
+				      const gchar   *key,
+				      const gchar   *data);
 void           e_xmlhash_remove      (EXmlHash     *hash,
-				      const char   *key);
+				      const gchar   *key);
 
 EXmlHashStatus e_xmlhash_compare     (EXmlHash     *hash,
-				      const char   *key,
-				      const char   *compare_data);
+				      const gchar   *key,
+				      const gchar   *compare_data);
 void           e_xmlhash_foreach_key (EXmlHash     *hash,
 				      EXmlHashFunc  func,
 				      gpointer      user_data);
diff --git a/libedataserver/e-xml-utils.c b/libedataserver/e-xml-utils.c
index 4b8663e..98f3658 100644
--- a/libedataserver/e-xml-utils.c
+++ b/libedataserver/e-xml-utils.c
@@ -40,7 +40,7 @@
 #endif
 
 xmlDocPtr
-e_xml_parse_file (const char *filename)
+e_xml_parse_file (const gchar *filename)
 {
 	xmlDocPtr result = NULL;
 
@@ -55,14 +55,14 @@ e_xml_parse_file (const char *filename)
 	return result;
 }
 
-int
-e_xml_save_file (const char *filename, xmlDocPtr doc)
+gint
+e_xml_save_file (const gchar *filename, xmlDocPtr doc)
 {
-	char *filesave;
+	gchar *filesave;
 	xmlChar *xmlbuf;
 	size_t n, written = 0;
-	int ret, fd, size;
-	int errnosave;
+	gint ret, fd, size;
+	gint errnosave;
 	ssize_t w;
 	gchar *dirname = g_path_get_dirname (filename);
 	gchar *basename = g_path_get_basename (filename);
diff --git a/libedataserver/e-xml-utils.h b/libedataserver/e-xml-utils.h
index 0f1e210..c52e0de 100644
--- a/libedataserver/e-xml-utils.h
+++ b/libedataserver/e-xml-utils.h
@@ -26,8 +26,8 @@
 
 G_BEGIN_DECLS
 
-xmlDocPtr   e_xml_parse_file (const char *filename);
-int         e_xml_save_file  (const char *filename,
+xmlDocPtr   e_xml_parse_file (const gchar *filename);
+gint         e_xml_save_file  (const gchar *filename,
 			      xmlDocPtr   doc);
 xmlNode    *e_xml_get_child_by_name (const xmlNode *parent,
 				     const xmlChar *child_name);
diff --git a/libedataserver/libedataserver-private.h b/libedataserver/libedataserver-private.h
index 2090f74..03c65a1 100644
--- a/libedataserver/libedataserver-private.h
+++ b/libedataserver/libedataserver-private.h
@@ -26,9 +26,9 @@
 
 #ifdef G_OS_WIN32
 
-const char *_libedataserver_get_extensiondir (void) G_GNUC_CONST;
-const char *_libedataserver_get_imagesdir (void) G_GNUC_CONST;
-const char *_libedataserver_get_ui_gladedir (void) G_GNUC_CONST;
+const gchar *_libedataserver_get_extensiondir (void) G_GNUC_CONST;
+const gchar *_libedataserver_get_imagesdir (void) G_GNUC_CONST;
+const gchar *_libedataserver_get_ui_gladedir (void) G_GNUC_CONST;
 
 #undef E_DATA_SERVER_EXTENSIONDIR
 #define E_DATA_SERVER_EXTENSIONDIR _libedataserver_get_extensiondir ()
diff --git a/libedataserver/md5-utils.c b/libedataserver/md5-utils.c
index 40e0998..4ef3780 100644
--- a/libedataserver/md5-utils.c
+++ b/libedataserver/md5-utils.c
@@ -155,7 +155,7 @@ md5_final (MD5Context *ctx, guchar digest[16])
 	/* Compute number of bytes mod 64 */
 	count = (ctx->bits[0] >> 3) & 0x3F;
 
-	/* Set the first char of padding to 0x80.  This is safe since there is
+	/* Set the first gchar of padding to 0x80.  This is safe since there is
 	   always at least one byte free */
 	p = ctx->in + count;
 	*p++ = 0x80;
diff --git a/libedataserver/test-source-list.c b/libedataserver/test-source-list.c
index e6600a2..47ea877 100644
--- a/libedataserver/test-source-list.c
+++ b/libedataserver/test-source-list.c
@@ -31,26 +31,26 @@
 
 static GMainLoop *main_loop = NULL;
 static ESourceList *list = NULL;
-static int idle_dump_id = 0;
+static gint idle_dump_id = 0;
 
 
 /* Options.  */
 
 static gboolean listen = FALSE;
 static gboolean dump = FALSE;
-static char *key_arg = (char *) "/apps/evolution/test/source_list";
-static char *source_arg = NULL;
-static char *group_arg = NULL;
-static char *add_group_arg = NULL;
-static char *add_source_arg = NULL;
-static char *remove_group_arg = NULL;
-static char *remove_source_arg = NULL;
-static char *property_arg = NULL;
-static char *set_name_arg = NULL;
-static char *set_base_uri_arg = NULL;
-static char *set_relative_uri_arg = NULL;
-static char *set_color_arg = NULL;
-static char *set_value_arg = NULL;
+static gchar *key_arg = (gchar *) "/apps/evolution/test/source_list";
+static gchar *source_arg = NULL;
+static gchar *group_arg = NULL;
+static gchar *add_group_arg = NULL;
+static gchar *add_source_arg = NULL;
+static gchar *remove_group_arg = NULL;
+static gchar *remove_source_arg = NULL;
+static gchar *property_arg = NULL;
+static gchar *set_name_arg = NULL;
+static gchar *set_base_uri_arg = NULL;
+static gchar *set_relative_uri_arg = NULL;
+static gchar *set_color_arg = NULL;
+static gchar *set_value_arg = NULL;
 static gboolean unset_value = FALSE;
 static gboolean unset_color = FALSE;
 
@@ -90,7 +90,7 @@ dump_property (const gchar *prop, const gchar *value)
 static void
 dump_source (ESource *source)
 {
-	char *uri = e_source_get_uri (source);
+	gchar *uri = e_source_get_uri (source);
 	const gchar *color_spec;
 
 	g_print ("\tSource %s\n", e_source_peek_uid (source));
@@ -147,7 +147,7 @@ dump_list (void)
 
 
 static int
-idle_dump_callback (void *unused_data)
+idle_dump_callback (gpointer unused_data)
 {
 	dump_list ();
 	idle_dump_id = 0;
@@ -166,7 +166,7 @@ dump_on_idle (void)
 static void
 source_changed_callback (ESource *source)
 {
-	static int count = 0;
+	static gint count = 0;
 
 	g_print ("** Event: source \"%s\" changed (%d)\n", e_source_peek_name (source), ++count);
 
@@ -176,7 +176,7 @@ source_changed_callback (ESource *source)
 static void
 group_changed_callback (ESourceGroup *group)
 {
-	static int count = 0;
+	static gint count = 0;
 
 	g_print ("** Event: group \"%s\" changed (%d)\n", e_source_group_peek_name (group), ++count);
 
@@ -186,7 +186,7 @@ group_changed_callback (ESourceGroup *group)
 static void
 list_changed_callback (ESourceGroup *group)
 {
-	static int count = 0;
+	static gint count = 0;
 
 	g_print ("** Event: list changed (%d)\n", ++count);
 
@@ -252,7 +252,7 @@ static void
 source_added_callback (ESourceGroup *group,
 		       ESource *source)
 {
-	static int count = 0;
+	static gint count = 0;
 
 	g_print ("** Event: source \"%s\" added (%d)\n", e_source_peek_name (source), ++count);
 
@@ -264,7 +264,7 @@ static void
 source_removed_callback (ESourceGroup *group,
 			 ESource *source)
 {
-	static int count = 0;
+	static gint count = 0;
 
 	g_print ("** Event: source \"%s\" removed (%d)\n", e_source_peek_name (source), ++count);
 
@@ -276,7 +276,7 @@ static void
 group_added_callback (ESourceList *list,
 		      ESourceGroup *group)
 {
-	static int count = 0;
+	static gint count = 0;
 
 	g_print ("** Event: group \"%s\" added (%d)\n", e_source_group_peek_name (group), ++count);
 
@@ -288,7 +288,7 @@ static void
 group_removed_callback (ESourceList *list,
 			ESourceGroup *group)
 {
-	static int count = 0;
+	static gint count = 0;
 
 	g_print ("** Event: group \"%s\" removed (%d)\n", e_source_group_peek_name (group), ++count);
 
@@ -298,7 +298,7 @@ group_removed_callback (ESourceList *list,
 
 
 static int
-on_idle_do_stuff (void *unused_data)
+on_idle_do_stuff (gpointer unused_data)
 {
 	GConfClient *client = gconf_client_get_default ();
 	ESourceGroup *new_group = NULL;
@@ -537,8 +537,8 @@ on_idle_do_stuff (void *unused_data)
 }
 
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	GOptionContext *context;
 	GError *error = NULL;
diff --git a/libedataserverui/e-book-auth-util.c b/libedataserverui/e-book-auth-util.c
index a91ad71..98d26b1 100644
--- a/libedataserverui/e-book-auth-util.c
+++ b/libedataserverui/e-book-auth-util.c
@@ -58,7 +58,7 @@ free_load_source_data (LoadSourceData *data)
 static gchar *
 remove_parameters_from_uri (const gchar *uri)
 {
-	char *euri_str;
+	gchar *euri_str;
 	EUri *euri;
 
 	euri = e_uri_new (uri);
@@ -153,8 +153,8 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc
 	const gchar *auth;
 	const gchar *user;
 	const gchar *component_name;
-	const char *password     = NULL;
-	char *pass_dup           = NULL;
+	const gchar *password     = NULL;
+	gchar *pass_dup           = NULL;
 	const gchar *uri               = e_book_get_uri (book);
         gchar *stripped_uri      = remove_parameters_from_uri (uri);
 	const gchar *auth_domain = e_source_get_property (source, "auth-domain");
@@ -182,10 +182,10 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc
 		user = "";
 
 	if (!password) {
-		char *prompt;
-		char *password_prompt;
+		gchar *prompt;
+		gchar *password_prompt;
 		gboolean remember;
-		char *failed_auth;
+		gchar *failed_auth;
 		guint32 flags = E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET|E_PASSWORDS_ONLINE;
 
 		if (previous_failure) {
diff --git a/libedataserverui/e-categories-dialog.c b/libedataserverui/e-categories-dialog.c
index f86fdfa..43b32e8 100644
--- a/libedataserverui/e-categories-dialog.c
+++ b/libedataserverui/e-categories-dialog.c
@@ -71,7 +71,7 @@ static void
 update_preview (GtkFileChooser *chooser, gpointer user_data)
 {
 	GtkImage *image;
-	char *filename;
+	gchar *filename;
 
 	g_return_if_fail (chooser != NULL);
 
@@ -90,7 +90,7 @@ static CategoryPropertiesDialog *
 load_properties_dialog (ECategoriesDialog *parent)
 {
 	CategoryPropertiesDialog *prop_dialog;
-	char *gladefile;
+	gchar *gladefile;
 
 	prop_dialog = g_new0 (CategoryPropertiesDialog, 1);
 
@@ -224,7 +224,7 @@ add_comma_sep_categories (gpointer key, gpointer value, gpointer user_data)
 	if (strlen ((*str)->str) > 0)
 		*str = g_string_append (*str, ", ");
 
-	*str = g_string_append (*str, (const char *) key);
+	*str = g_string_append (*str, (const gchar *) key);
 }
 
 static void
@@ -275,11 +275,11 @@ entry_changed_cb (GtkEditable *editable, gpointer user_data)
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE);
 }
 
-static char *
-check_category_name (const char *name)
+static gchar *
+check_category_name (const gchar *name)
 {
 	GString *str = NULL;
-	char *p = (char *) name;
+	gchar *p = (gchar *) name;
 
 	str = g_string_new ("");
 	while (*p) {
@@ -312,8 +312,8 @@ new_button_clicked_cb (GtkButton *button, gpointer user_data)
 
 	do {
 		if (gtk_dialog_run (GTK_DIALOG (prop_dialog->the_dialog)) == GTK_RESPONSE_OK) {
-			const char *category_name;
-			char *correct_category_name;
+			const gchar *category_name;
+			gchar *correct_category_name;
 
 			category_name = gtk_entry_get_text (GTK_ENTRY (prop_dialog->category_name));
 			correct_category_name = check_category_name (category_name);
@@ -360,8 +360,8 @@ edit_button_clicked_cb (GtkButton *button, gpointer user_data)
 	GtkTreeModel *model;
 	GtkTreeView *tree_view;
 	GList *selected;
-	char *category_name;
-	const char *icon_file;
+	gchar *category_name;
+	const gchar *icon_file;
 
 	dialog = user_data;
 	priv = dialog->priv;
@@ -552,7 +552,7 @@ categories_dialog_init (ECategoriesDialog *dialog)
 	GtkTreeView *tree_view;
 	GtkWidget *main_widget;
 	GtkWidget *content_area;
-	char *gladefile;
+	gchar *gladefile;
 
 	dialog->priv = E_CATEGORIES_DIALOG_GET_PRIVATE (dialog);
 	dialog->priv->selected_categories = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
@@ -666,7 +666,7 @@ e_categories_dialog_get_type (void)
  * Returns: a new #ECategoriesDialog
  **/
 GtkWidget *
-e_categories_dialog_new (const char *categories)
+e_categories_dialog_new (const gchar *categories)
 {
 	ECategoriesDialog *dialog;
 
@@ -726,7 +726,7 @@ e_categories_dialog_set_categories (ECategoriesDialog *dialog,
 
 	arr = g_strsplit (categories, ",", 0);
 	if (arr) {
-		int i = 0;
+		gint i = 0;
 		while (arr[i] != NULL) {
 			g_hash_table_insert (priv->selected_categories, g_strdup (arr[i]), g_strdup (arr[i]));
 			i++;
@@ -741,7 +741,7 @@ e_categories_dialog_set_categories (ECategoriesDialog *dialog,
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->categories_list));
 	if (gtk_tree_model_get_iter_first (model, &iter)) {
 		do {
-			char *place_string;
+			gchar *place_string;
 
 			gtk_tree_model_get (model, &iter, COLUMN_CATEGORY, &place_string, -1);
 			if (g_hash_table_lookup (priv->selected_categories, place_string))
diff --git a/libedataserverui/e-destination-store.c b/libedataserverui/e-destination-store.c
index f8114f8..f52de41 100644
--- a/libedataserverui/e-destination-store.c
+++ b/libedataserverui/e-destination-store.c
@@ -259,11 +259,11 @@ static gint
 find_destination_by_email (EDestinationStore *destination_store, EDestination *destination)
 {
 	gint i;
-	const char *e_mail = e_destination_get_email (destination);
+	const gchar *e_mail = e_destination_get_email (destination);
 
 	for (i = 0; i < destination_store->destinations->len; i++) {
 		EDestination *destination_here = g_ptr_array_index (destination_store->destinations, i);
-		const char *mail = e_destination_get_email (destination_here);
+		const gchar *mail = e_destination_get_email (destination_here);
 
 		if (g_str_equal (e_mail, mail))
 			return i;
@@ -450,7 +450,7 @@ e_destination_store_remove_destination (EDestinationStore *destination_store, ED
 }
 
 void
-e_destination_store_remove_destination_nth (EDestinationStore *destination_store, int n)
+e_destination_store_remove_destination_nth (EDestinationStore *destination_store, gint n)
 {
 	EDestination *destination;
 
diff --git a/libedataserverui/e-destination-store.h b/libedataserverui/e-destination-store.h
index 3e316f3..b0a3bea 100644
--- a/libedataserverui/e-destination-store.h
+++ b/libedataserverui/e-destination-store.h
@@ -89,7 +89,7 @@ void               e_destination_store_append_destination (EDestinationStore *de
 void               e_destination_store_remove_destination (EDestinationStore *destination_store,
 							   EDestination *destination);
 void		   e_destination_store_remove_destination_nth (EDestinationStore *destination_store,
-							       int n);
+							       gint n);
 guint		   e_destination_store_get_destination_count (EDestinationStore *destination_store);
 GtkTreePath       *e_destination_store_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter);
 
diff --git a/libedataserverui/e-name-selector-dialog.c b/libedataserverui/e-name-selector-dialog.c
index df9467d..f8dd230 100644
--- a/libedataserverui/e-name-selector-dialog.c
+++ b/libedataserverui/e-name-selector-dialog.c
@@ -137,9 +137,9 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
 	GtkWidget         *parent;
 	GtkTreeSelection  *selection;
 	ESourceList       *source_list;
-	char              *gladefile;
+	gchar              *gladefile;
 	GConfClient *gconf_client;
-	char *uid;
+	gchar *uid;
 
 	ENameSelectorDialogPrivate *priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
 	priv->destination_index = 0;
diff --git a/libedataserverui/e-name-selector-entry.c b/libedataserverui/e-name-selector-entry.c
index a186529..8bb8c7e 100644
--- a/libedataserverui/e-name-selector-entry.c
+++ b/libedataserverui/e-name-selector-entry.c
@@ -139,7 +139,7 @@ e_name_selector_entry_finalize (GObject *object)
 }
 
 static void
-e_name_selector_entry_updated (ENameSelectorEntry *entry, char *email)
+e_name_selector_entry_updated (ENameSelectorEntry *entry, gchar *email)
 {
 	g_return_if_fail (E_IS_NAME_SELECTOR_ENTRY (entry));
 }
@@ -485,7 +485,7 @@ escape_sexp_string (const gchar *string)
  * or NULL if no fields defined.
  **/
 gchar *
-ens_util_populate_user_query_fields (GSList *user_query_fields, const char *cue_str, const char *encoded_cue_str)
+ens_util_populate_user_query_fields (GSList *user_query_fields, const gchar *cue_str, const gchar *encoded_cue_str)
 {
 	GString *user_fields;
 	GSList *s;
@@ -496,7 +496,7 @@ ens_util_populate_user_query_fields (GSList *user_query_fields, const char *cue_
 	user_fields = g_string_new ("");
 
 	for (s = user_query_fields; s; s = s->next) {
-		const char *field = s->data;
+		const gchar *field = s->data;
 
 		if (!field || !*field)
 			continue;
@@ -589,7 +589,7 @@ utf8_casefold_collate_len (const gchar *str1, const gchar *str2, gint len)
 {
 	gchar *s1 = g_utf8_casefold(str1, len);
 	gchar *s2 = g_utf8_casefold(str2, len);
-	int rv;
+	gint rv;
 
 	rv = g_utf8_collate (s1, s2);
 
@@ -865,7 +865,7 @@ type_ahead_complete (ENameSelectorEntry *name_selector_entry)
 					 destination_row_changed, name_selector_entry);
 
 	if (textrep_len > range_len) {
-		int i;
+		gint i;
 
 		/* keep character's case as user types */
 		for (i = 0; textrep [i] && cue_str [i]; i++)
@@ -1268,9 +1268,9 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
 	 * Here, we let the model know about removals. */
 	for (i = index_end; i > index_start; i--) {
 		EDestination *destination = find_destination_by_index (name_selector_entry, i);
-		int range_start, range_end;
-		char *ttext;
-		const char *email=NULL;
+		gint range_start, range_end;
+		gchar *ttext;
+		const gchar *email=NULL;
 		gboolean sel=FALSE;
 
 		if (destination)
@@ -1310,7 +1310,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
 
 	if (end_pos == start_pos +1 &&  index_end == index_start) {
 		/* We could be just deleting the empty text */
-		char *c;
+		gchar *c;
 
 		/* Get the actual deleted text */
 		c = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), start_pos, start_pos+1);
@@ -1321,7 +1321,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
 		}
 	} else	if (end_pos == start_pos +1 &&  index_end == index_start+1) {
 		/* We could be just deleting the empty text */
-		char *c;
+		gchar *c;
 
 		/* Get the actual deleted text */
 		c = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), start_pos, start_pos+1);
@@ -1333,7 +1333,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
 	}
 
 	if (del_comma) {
-		int range_start=-1, range_end;
+		gint range_start=-1, range_end;
 		EDestination *dest = find_destination_by_index (name_selector_entry, index_end);
 		/* If we have deleted the last comma, let us autocomplete normally
 		 */
@@ -1341,8 +1341,8 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
 		if (dest && len - end_pos  != 0) {
 
 			EDestination *destination1  = find_destination_by_index (name_selector_entry, index_start);
-			char *ttext;
-			const char *email=NULL;
+			gchar *ttext;
+			const gchar *email=NULL;
 
 			if (destination1)
 				email = e_destination_get_address (destination1);
@@ -1499,7 +1499,7 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
 	get_range_at_position (text, cursor_pos, &range_start, &range_end);
 
 	if (priv->is_completing) {
-		char *str_context=NULL;
+		gchar *str_context=NULL;
 
 		str_context = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), range_end, range_end+1);
 
@@ -1508,7 +1508,7 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
 			gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &range_end);
 		} else {
 			/* In the middle */
-			int newpos = strlen (text);
+			gint newpos = strlen (text);
 
                         /* Doing this we can make sure that It wont ask for completion again. */
 			gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &newpos);
@@ -1531,7 +1531,7 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
 static void
 sanitize_entry (ENameSelectorEntry *name_selector_entry)
 {
-	int n;
+	gint n;
 	GList *l, *known, *del = NULL;
 	GString *str = g_string_new ("");
 
@@ -1545,7 +1545,7 @@ sanitize_entry (ENameSelectorEntry *name_selector_entry)
 		if (!dest || !e_destination_get_address (dest))
 			del = g_list_prepend (del, GINT_TO_POINTER (n));
 		else {
-			char *text;
+			gchar *text;
 
 			text = get_destination_textrep (dest);
 			if (text) {
@@ -1630,7 +1630,7 @@ static guint
 entry_height (GtkWidget *widget)
 {
 	PangoLayout *layout;
-	int bound;
+	gint bound;
 
 	g_return_val_if_fail (widget != NULL, 0);
 
@@ -2153,10 +2153,10 @@ editor_closed_cb (GtkObject *editor, gpointer data)
 static void
 popup_activate_inline_expand (ENameSelectorEntry *name_selector_entry, GtkWidget *menu_item)
 {
-	const char *email_list, *text;
+	const gchar *email_list, *text;
 	gchar *sanitized_text;
 	EDestination *destination = name_selector_entry->popup_destination;
-	int position, start, end;
+	gint position, start, end;
 
 	position = GPOINTER_TO_INT(g_object_get_data ((GObject *)name_selector_entry, "index"));
 
@@ -2266,8 +2266,8 @@ static void
 popup_activate_cut (ENameSelectorEntry *name_selector_entry, GtkWidget *menu_item)
 {
 	EDestination *destination;
-	const char *contact_email;
-	char *pemail = NULL;
+	const gchar *contact_email;
+	gchar *pemail = NULL;
 	GtkClipboard *clipboard;
 
 	destination = name_selector_entry->popup_destination;
@@ -2295,8 +2295,8 @@ static void
 popup_activate_copy (ENameSelectorEntry *name_selector_entry, GtkWidget *menu_item)
 {
 	EDestination *destination;
-	const char *contact_email;
-	char *pemail;
+	const gchar *contact_email;
+	gchar *pemail;
 	GtkClipboard *clipboard;
 
 	destination = name_selector_entry->popup_destination;
@@ -2332,7 +2332,7 @@ destination_set_list (GtkWidget *item, EDestination *destination)
 static void
 destination_set_email (GtkWidget *item, EDestination *destination)
 {
-	int email_num;
+	gint email_num;
 	EContact *contact;
 
 	if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
@@ -2356,7 +2356,7 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 	gint          i;
 	char	     *edit_label;
 	char	     *cut_label;
-	char         *copy_label;
+	gchar         *copy_label;
 	int	      email_num, len;
 	GSList	     *group = NULL;
 	gboolean      is_list;
@@ -2384,11 +2384,11 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 	if (is_list) {
 		const GList *dests = e_destination_list_get_dests (destination);
 		GList *iter;
-		int length = g_list_length ((GList *)dests);
+		gint length = g_list_length ((GList *)dests);
 
 		for (iter = (GList *)dests; iter; iter = iter->next) {
 			EDestination *dest = (EDestination *) iter->data;
-			const char *email = e_destination_get_email (dest);
+			const gchar *email = e_destination_get_email (dest);
 
 			if (!email || *email == '\0')
 				continue;
@@ -2453,7 +2453,7 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 	/* Expand a list inline */
 	if (is_list) {
 		/* To Translators: This would be similiar to "Expand MyList Inline" where MyList is a Contact List*/
-		edit_label = g_strdup_printf (_("E_xpand %s Inline"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+		edit_label = g_strdup_printf (_("E_xpand %s Inline"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 		menu_item = gtk_menu_item_new_with_mnemonic (edit_label);
 		g_free (edit_label);
 		gtk_widget_show (menu_item);
@@ -2468,7 +2468,7 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 	}
 
 	/* Copy Contact Item */
-	copy_label = g_strdup_printf (_("Cop_y %s"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+	copy_label = g_strdup_printf (_("Cop_y %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 	menu_item = gtk_menu_item_new_with_mnemonic (copy_label);
 	g_free (copy_label);
 	gtk_widget_show (menu_item);
@@ -2478,7 +2478,7 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 				  name_selector_entry);
 
 	/* Cut Contact Item */
-	cut_label = g_strdup_printf (_("C_ut %s"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+	cut_label = g_strdup_printf (_("C_ut %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 	menu_item = gtk_menu_item_new_with_mnemonic (cut_label);
 	g_free (cut_label);
 	gtk_widget_show (menu_item);
@@ -2495,7 +2495,7 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 
 	/* Edit Contact item */
 
-	edit_label = g_strdup_printf (_("_Edit %s"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+	edit_label = g_strdup_printf (_("_Edit %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 	menu_item = gtk_menu_item_new_with_mnemonic (edit_label);
 	g_free (edit_label);
 	gtk_widget_show (menu_item);
@@ -2530,7 +2530,7 @@ copy_or_cut_clipboard (ENameSelectorEntry *name_selector_entry, gboolean is_cut)
 
 	hash = g_hash_table_new (g_direct_hash, g_direct_equal);
 	for (i = start; i <= end; i++) {
-		int index = get_index_at_position (text, i);
+		gint index = get_index_at_position (text, i);
 
 		g_hash_table_insert (hash, GINT_TO_POINTER (index), NULL);
 	}
@@ -2539,7 +2539,7 @@ copy_or_cut_clipboard (ENameSelectorEntry *name_selector_entry, gboolean is_cut)
 
 	g_hash_table_iter_init (&iter, hash);
 	while (g_hash_table_iter_next (&iter, &key, &value)) {
-		int index = GPOINTER_TO_INT (key);
+		gint index = GPOINTER_TO_INT (key);
 		EDestination *dest;
 		gint rstart, rend;
 
diff --git a/libedataserverui/e-name-selector-entry.h b/libedataserverui/e-name-selector-entry.h
index 8653c1a..7c03884 100644
--- a/libedataserverui/e-name-selector-entry.h
+++ b/libedataserverui/e-name-selector-entry.h
@@ -60,9 +60,9 @@ typedef struct _ENameSelectorEntryClass ENameSelectorEntryClass;
 
 struct _ENameSelectorEntryClass {
 	GtkEntryClass parent_class;
-	void (*updated) (ENameSelectorEntry *entry, char *email);
-	void *reserved1;
-	void *reserved2;
+	void (*updated) (ENameSelectorEntry *entry, gchar *email);
+	gpointer reserved1;
+	gpointer reserved2;
 };
 
 struct _ENameSelectorEntry {
@@ -104,7 +104,7 @@ void                e_name_selector_entry_set_contact_editor_func      (ENameSel
 void                e_name_selector_entry_set_contact_list_editor_func (ENameSelectorEntry *name_selector_entry,
 									gpointer func);
 
-gchar *ens_util_populate_user_query_fields (GSList *user_query_fields, const char *cue_str, const char *encoded_cue_str);
+gchar *ens_util_populate_user_query_fields (GSList *user_query_fields, const gchar *cue_str, const gchar *encoded_cue_str);
 
 G_END_DECLS
 
diff --git a/libedataserverui/e-name-selector-list.c b/libedataserverui/e-name-selector-list.c
index 023c3d2..7ac10e3 100644
--- a/libedataserverui/e-name-selector-list.c
+++ b/libedataserverui/e-name-selector-list.c
@@ -51,7 +51,7 @@ static void e_name_selector_list_finalize   (GObject *object);
 static void
 enl_popup_size (ENameSelectorList *list)
 {
-	int height = 0, count;
+	gint height = 0, count;
 	GtkTreeViewColumn *column = NULL;
 
 	column = gtk_tree_view_get_column ( GTK_TREE_VIEW (list->tree_view), 0);
@@ -72,7 +72,7 @@ static void
 enl_popup_position (ENameSelectorList *list)
 {
 	GdkWindow *window;
-	int x,y;
+	gint x,y;
 
 	enl_popup_size (list);
 	window = gtk_widget_get_window (GTK_WIDGET (list));
@@ -86,7 +86,7 @@ static void
 enl_popup_grab (ENameSelectorList *list)
 {
 	GdkWindow *window;
-	int len;
+	gint len;
 
 	window = gtk_widget_get_window (GTK_WIDGET (list->popup));
 
@@ -123,7 +123,7 @@ enl_popup_ungrab (ENameSelectorList *list)
 static gboolean
 enl_entry_focus_in (ENameSelectorList *list, GdkEventFocus *event, gpointer dummy)
 {
-	int len;
+	gint len;
 
 	/* FIXME: Dont select every thing by default- Code is there but still it does */
 	len = strlen(gtk_entry_get_text(GTK_ENTRY(list)));
@@ -182,7 +182,7 @@ enl_popup_enter_notify (GtkWidget        *widget,
 
 static void
 enl_tree_select_node (ENameSelectorList *list,
-		      int n)
+		      gint n)
 {
 	GtkTreeSelection *selection;
 	GtkTreeIter iter;
@@ -225,7 +225,7 @@ static void
 delete_row (GtkTreePath *path, ENameSelectorList *list)
 {
 	GtkTreeIter   iter;
-	int n, len;
+	gint n, len;
 	GtkTreeSelection *selection;
 
 	if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (E_NAME_SELECTOR_ENTRY (list)->destination_store), &iter, path))
@@ -307,7 +307,7 @@ destination_set_list (GtkWidget *item, EDestination *destination)
 static void
 destination_set_email (GtkWidget *item, EDestination *destination)
 {
-	int email_num;
+	gint email_num;
 	EContact *contact;
 
 	if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
@@ -351,7 +351,7 @@ enl_tree_button_press_event (GtkWidget *widget,
 	GList        *email_list = NULL, *l;
 	gint          i;
 	int	      email_num, len;
-	char         *delete_label;
+	gchar         *delete_label;
 	GSList	     *group = NULL;
 	gboolean      is_list;
 	gboolean      show_menu = FALSE;
@@ -401,11 +401,11 @@ enl_tree_button_press_event (GtkWidget *widget,
 	if (is_list) {
 		const GList *dests = e_destination_list_get_dests (destination);
 		GList *iters;
-		int length = g_list_length ((GList *)dests);
+		gint length = g_list_length ((GList *)dests);
 
 		for (iters = (GList *)dests; iters; iters = iters->next) {
 			EDestination *dest = (EDestination *) iters->data;
-			const char *email = e_destination_get_email (dest);
+			const gchar *email = e_destination_get_email (dest);
 
 			if (!email || *email == '\0')
 				continue;
@@ -469,7 +469,7 @@ enl_tree_button_press_event (GtkWidget *widget,
 		gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
 	}
 
-	delete_label = g_strdup_printf(_("_Delete %s"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+	delete_label = g_strdup_printf(_("_Delete %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 	menu_item = gtk_menu_item_new_with_mnemonic (delete_label);
 	g_free (delete_label);
 	gtk_widget_show (menu_item);
diff --git a/libedataserverui/e-name-selector-list.h b/libedataserverui/e-name-selector-list.h
index ab7323a..edd1f00 100644
--- a/libedataserverui/e-name-selector-list.h
+++ b/libedataserverui/e-name-selector-list.h
@@ -69,7 +69,7 @@ struct _ENameSelectorList {
 	GtkWidget *tree_view;
 	GtkWidget *menu;
 	EDestinationStore *store;
-	int rows;
+	gint rows;
 };
 
 GType		 e_name_selector_list_get_type (void);
diff --git a/libedataserverui/e-passwords.c b/libedataserverui/e-passwords.c
index 0e985b2..8bbd8c9 100644
--- a/libedataserverui/e-passwords.c
+++ b/libedataserverui/e-passwords.c
@@ -92,14 +92,14 @@ static gint idle_id;
 static gint ep_online_state = TRUE;
 
 #ifdef WITH_GNOME_KEYRING
-static char *default_keyring = NULL;
+static gchar *default_keyring = NULL;
 #endif
 
 #define KEY_FILE_GROUP_PREFIX "Passwords-"
 static GKeyFile *key_file = NULL;
 
 static gboolean
-check_key_file (const char *funcname)
+check_key_file (const gchar *funcname)
 {
 	if (!key_file)
 		g_message ("%s: Failed to create key file!", funcname);
@@ -451,7 +451,7 @@ ep_password_decode (const gchar *encoded_password)
 }
 
 static gboolean
-ep_idle_dispatch (void *data)
+ep_idle_dispatch (gpointer data)
 {
 	EPassMsg *msg;
 
@@ -1014,7 +1014,7 @@ ep_add_password (EPassMsg *msg)
 static void ep_ask_password (EPassMsg *msg);
 
 static void
-pass_response (GtkDialog *dialog, gint response, void *data)
+pass_response (GtkDialog *dialog, gint response, gpointer data)
 {
 	EPassMsg *msg = data;
 	gint type = msg->flags & E_PASSWORDS_REMEMBER_MASK;
@@ -1415,7 +1415,7 @@ e_passwords_forget_password (const gchar *component_name, const gchar *key)
  * Return value: the password associated with @key, or %NULL.  Caller
  * must free the returned password.
  **/
-char *
+gchar *
 e_passwords_get_password (const gchar *component_name, const gchar *key)
 {
 	EPassMsg *msg;
@@ -1481,7 +1481,7 @@ e_passwords_add_password (const gchar *key, const gchar *passwd)
  * return value is non-%NULL and @remember_type is not
  * E_PASSWORDS_DO_NOT_REMEMBER.
  **/
-char *
+gchar *
 e_passwords_ask_password (const gchar *title, const gchar *component_name,
 			  const gchar *key,
 			  const gchar *prompt,
diff --git a/libedataserverui/e-passwords.h b/libedataserverui/e-passwords.h
index 4260c0e..b231a1c 100644
--- a/libedataserverui/e-passwords.h
+++ b/libedataserverui/e-passwords.h
@@ -39,13 +39,13 @@ void e_passwords_init (void);
 
 void        e_passwords_shutdown          (void);
 void	    e_passwords_cancel(void);
-void        e_passwords_set_online(int state);
-void        e_passwords_remember_password (const char *component, const char *key);
-void        e_passwords_add_password      (const char *key, const char *passwd);
-char       *e_passwords_get_password      (const char *component, const char *key);
-void        e_passwords_forget_password   (const char *component, const char *key);
+void        e_passwords_set_online(gint state);
+void        e_passwords_remember_password (const gchar *component, const gchar *key);
+void        e_passwords_add_password      (const gchar *key, const gchar *passwd);
+gchar       *e_passwords_get_password      (const gchar *component, const gchar *key);
+void        e_passwords_forget_password   (const gchar *component, const gchar *key);
 void        e_passwords_forget_passwords  (void);
-void        e_passwords_clear_passwords (const char *component);
+void        e_passwords_clear_passwords (const gchar *component);
 
 typedef enum {
 	E_PASSWORDS_REMEMBER_NEVER,
@@ -61,9 +61,9 @@ typedef enum {
 	E_PASSWORDS_PASSPHRASE = 1<<12 /* We are asking a passphrase */
 } EPasswordsRememberType;
 
-char *      e_passwords_ask_password      (const char *title,
-					   const char*component_name, const char *key,
-					   const char *prompt,
+gchar *      e_passwords_ask_password      (const gchar *title,
+					   const gchar *component_name, const gchar *key,
+					   const gchar *prompt,
 					   EPasswordsRememberType remember_type,
 					   gboolean *remember,
 					   GtkWindow *parent);
diff --git a/libedataserverui/e-source-option-menu.c b/libedataserverui/e-source-option-menu.c
index 27819cd..c95f275 100644
--- a/libedataserverui/e-source-option-menu.c
+++ b/libedataserverui/e-source-option-menu.c
@@ -40,7 +40,7 @@ typedef struct {
 	ESourceOptionMenu *option_menu;
 	ESource *source;
 	ESource *found_source;
-	int i;
+	gint i;
 } ForeachMenuItemData;
 
 enum {
@@ -114,9 +114,9 @@ populate (ESourceOptionMenu *option_menu)
 	GSList *groups = e_source_list_peek_groups (option_menu->priv->source_list);
 	GSList *p;
 	ESource *first_source = NULL;
-	int first_source_item = -1;
-	int selected_item = -1;
-	int i;
+	gint first_source_item = -1;
+	gint selected_item = -1;
+	gint i;
 
 	i = 0;
 	for (p = groups; p != NULL; p = p->next) {
@@ -132,8 +132,8 @@ populate (ESourceOptionMenu *option_menu)
 
 		for (q = e_source_group_peek_sources (group); q != NULL; q = q->next) {
 			ESource *source = E_SOURCE (q->data);
-			char *label = g_strconcat ("    ", e_source_peek_name (source), NULL);
-			const char *colour = e_source_peek_color_spec (source);
+			gchar *label = g_strconcat ("    ", e_source_peek_name (source), NULL);
+			const gchar *colour = e_source_peek_color_spec (source);
 			GtkWidget *item2 = gtk_image_menu_item_new_with_label (label);
 			g_free (label);
 
diff --git a/libedataserverui/e-source-selector-dialog.c b/libedataserverui/e-source-selector-dialog.c
index 8ff431e..29abf90 100644
--- a/libedataserverui/e-source-selector-dialog.c
+++ b/libedataserverui/e-source-selector-dialog.c
@@ -141,7 +141,7 @@ setup_dialog (GtkWindow *parent, ESourceSelectorDialog *dialog, ESourceList *sou
 {
 	GtkWidget *vbox, *label, *scroll, *hbox, *spacer;
 	GtkWidget *content_area;
-	char *label_text;
+	gchar *label_text;
 	ESourceSelectorDialogPrivate *priv = dialog->priv;
 
 	priv->source_list = g_object_ref (source_list);
diff --git a/libedataserverui/e-source-selector.c b/libedataserverui/e-source-selector.c
index 7c4bd14..09b0b02 100644
--- a/libedataserverui/e-source-selector.c
+++ b/libedataserverui/e-source-selector.c
@@ -43,7 +43,7 @@ struct _ESourceSelectorPrivate {
 	GtkTreeRowReference *saved_primary_selection;
 	ESourceGroup *primary_source_group;
 
-	int rebuild_model_idle_id;
+	gint rebuild_model_idle_id;
 
 	gboolean toggled_last;
 	gboolean checkboxes_shown;
@@ -71,7 +71,7 @@ enum {
 	DATA_DROPPED,
 	NUM_SIGNALS
 };
-static unsigned int signals[NUM_SIGNALS] = { 0 };
+static guint signals[NUM_SIGNALS] = { 0 };
 
 G_DEFINE_TYPE (ESourceSelector, e_source_selector, GTK_TYPE_TREE_VIEW)
 
@@ -220,7 +220,7 @@ find_source_iter (ESourceSelector *selector, ESource *source, GtkTreeIter *paren
 		do {
 			if (gtk_tree_model_iter_children (model, source_iter, parent_iter)) {
 				do {
-					void *data;
+					gpointer data;
 
 					gtk_tree_model_get (model, source_iter, 0, &data, -1);
 					g_assert (E_IS_SOURCE (data));
@@ -245,8 +245,8 @@ static gboolean
 rebuild_existing_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 {
 	ESourceSelectorRebuildData *rebuild_data = data;
-	void *node;
-	const char *uid;
+	gpointer node;
+	const gchar *uid;
 
 	gtk_tree_model_get (model, iter, 0, &node, -1);
 
@@ -462,7 +462,7 @@ toggle_cell_data_func (GtkTreeViewColumn *column,
 		       GtkTreeIter *iter,
 		       ESourceSelector *selector)
 {
-	void *data;
+	gpointer data;
 
 	gtk_tree_model_get (model, iter, 0, &data, -1);
 
@@ -488,7 +488,7 @@ text_cell_data_func (GtkTreeViewColumn *column,
 		     GtkTreeIter *iter,
 		     ESourceSelector *selector)
 {
-	void *data;
+	gpointer data;
 
 	gtk_tree_model_get (model, iter, 0, &data, -1);
 
@@ -521,7 +521,7 @@ pixbuf_cell_data_func (GtkTreeViewColumn *column,
 		       GtkTreeIter *iter,
 		       ESourceSelector *selector)
 {
-	void *data;
+	gpointer data;
 
 	gtk_tree_model_get (model, iter, 0, &data, -1);
 
@@ -572,7 +572,7 @@ selection_func (GtkTreeSelection *selection,
 		ESourceSelector *selector)
 {
 	GtkTreeIter iter;
-	void *data;
+	gpointer data;
 
 	if (selector->priv->toggled_last) {
 		selector->priv->toggled_last = FALSE;
@@ -630,14 +630,14 @@ text_cell_edited_cb (ESourceSelector *selector,
 
 static void
 cell_toggled_callback (GtkCellRendererToggle *renderer,
-		       const char *path_string,
+		       const gchar *path_string,
 		       ESourceSelector *selector)
 {
 	GtkTreeModel *model = GTK_TREE_MODEL (selector->priv->tree_store);
 	GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
 	GtkTreeIter iter;
 	ESource *source;
-	void *data;
+	gpointer data;
 
 	if (! gtk_tree_model_get_iter (model, &iter, path)) {
 		gtk_tree_path_free (path);
@@ -1029,7 +1029,7 @@ source_selector_popup_menu (GtkWidget *widget)
 
 /* Initialization.  */
 static gboolean
-ess_bool_accumulator(GSignalInvocationHint *ihint, GValue *out, const GValue *in, void *data)
+ess_bool_accumulator(GSignalInvocationHint *ihint, GValue *out, const GValue *in, gpointer data)
 {
 	gboolean val = g_value_get_boolean(in);
 
@@ -1117,8 +1117,8 @@ group_search_function   (GtkTreeModel *model,
 			 GtkTreeIter *iter,
 			 gpointer dummy)
 {
-	void *data;
-	const char *name = NULL;
+	gpointer data;
+	const gchar *name = NULL;
 	gboolean status = TRUE;
 
 	gtk_tree_model_get (model, iter, 0, &data, -1);
@@ -1531,7 +1531,7 @@ e_source_selector_peek_primary_selection (ESourceSelector *selector)
 	GtkTreeModel *model;
 	GtkTreeIter iter;
 	gboolean have_iter = FALSE;
-	void *data = NULL;
+	gpointer data = NULL;
 
 	g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), NULL);
 
diff --git a/libedataserverui/test-category-completion.c b/libedataserverui/test-category-completion.c
index 468e58a..4a921ed 100644
--- a/libedataserverui/test-category-completion.c
+++ b/libedataserverui/test-category-completion.c
@@ -46,8 +46,8 @@ on_idle_create_widget (void)
 	return FALSE;
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	gtk_init (&argc, &argv);
 
diff --git a/libedataserverui/test-contact-store.c b/libedataserverui/test-contact-store.c
index 0d515d5..727f0ed 100644
--- a/libedataserverui/test-contact-store.c
+++ b/libedataserverui/test-contact-store.c
@@ -59,7 +59,7 @@ create_text_column_for_field (EContactField field_id)
 }
 
 static gint
-start_test (const char *gconf_path)
+start_test (const gchar *gconf_path)
 {
 	EContactStore *contact_store;
 	GtkTreeModel *model_sort;
@@ -115,10 +115,10 @@ start_test (const char *gconf_path)
 	return FALSE;
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
-	const char *gconf_path;
+	const gchar *gconf_path;
 
 	gtk_init (&argc, &argv);
 
@@ -127,7 +127,7 @@ main (int argc, char **argv)
 	else
 		gconf_path = argv [1];
 
-	g_idle_add ((GSourceFunc) start_test, (void *) gconf_path);
+	g_idle_add ((GSourceFunc) start_test, (gpointer) gconf_path);
 
 	gtk_main ();
 
diff --git a/libedataserverui/test-name-selector.c b/libedataserverui/test-name-selector.c
index 3173f37..f82e62f 100644
--- a/libedataserverui/test-name-selector.c
+++ b/libedataserverui/test-name-selector.c
@@ -35,7 +35,7 @@ ENameSelectorDialog *name_selector_dialog;
 GtkWidget           *name_selector_entry_window;
 
 static void
-close_dialog (GtkWidget *widget, int response, gpointer data)
+close_dialog (GtkWidget *widget, gint response, gpointer data)
 {
 	gtk_widget_destroy (GTK_WIDGET (name_selector_dialog));
 	gtk_widget_destroy (name_selector_entry_window);
@@ -79,8 +79,8 @@ start_test (void)
 	return FALSE;
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	gtk_init (&argc, &argv);
 	g_thread_init (NULL);
diff --git a/libedataserverui/test-source-combo-box.c b/libedataserverui/test-source-combo-box.c
index 8b3c9dc..28b0ca0 100644
--- a/libedataserverui/test-source-combo-box.c
+++ b/libedataserverui/test-source-combo-box.c
@@ -39,7 +39,7 @@ source_changed_cb (ESourceComboBox *combo_box)
 
 
 static int
-on_idle_create_widget (const char *gconf_path)
+on_idle_create_widget (const gchar *gconf_path)
 {
 	GtkWidget *window;
 	GtkWidget *combo_box;
@@ -65,10 +65,10 @@ on_idle_create_widget (const char *gconf_path)
 }
 
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
-	const char *gconf_path;
+	const gchar *gconf_path;
 
 	gtk_init (&argc, &argv);
 
@@ -77,7 +77,7 @@ main (int argc, char **argv)
 	else
 		gconf_path = argv [1];
 
-	g_idle_add ((GSourceFunc) on_idle_create_widget, (void *) gconf_path);
+	g_idle_add ((GSourceFunc) on_idle_create_widget, (gpointer) gconf_path);
 
 	gtk_main ();
 
diff --git a/libedataserverui/test-source-selector.c b/libedataserverui/test-source-selector.c
index 24e130b..3da4c85 100644
--- a/libedataserverui/test-source-selector.c
+++ b/libedataserverui/test-source-selector.c
@@ -54,7 +54,7 @@ dump_selection (ESourceSelector *selector)
 
 static void
 selection_changed_callback (ESourceSelector *selector,
-			    void *unused_data)
+			    gpointer unused_data)
 {
 	g_print ("Selection changed!\n");
 	dump_selection (selector);
@@ -68,7 +68,7 @@ check_toggled_callback (GtkToggleButton *button,
 }
 
 static int
-on_idle_create_widget (const char *gconf_path)
+on_idle_create_widget (const gchar *gconf_path)
 {
 	GtkWidget *window;
 	GtkWidget *vbox;
@@ -108,10 +108,10 @@ on_idle_create_widget (const char *gconf_path)
 }
 
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
-	const char *gconf_path;
+	const gchar *gconf_path;
 
 	gtk_init (&argc, &argv);
 	if (argc < 2)
@@ -119,7 +119,7 @@ main (int argc, char **argv)
 	else
 		gconf_path = argv [1];
 
-	g_idle_add ((GSourceFunc) on_idle_create_widget, (void *) gconf_path);
+	g_idle_add ((GSourceFunc) on_idle_create_widget, (gpointer) gconf_path);
 
 	gtk_main ();
 
diff --git a/servers/exchange/lib/actest.c b/servers/exchange/lib/actest.c
index ee64649..31d076a 100644
--- a/servers/exchange/lib/actest.c
+++ b/servers/exchange/lib/actest.c
@@ -31,19 +31,19 @@
 #include "e2k-autoconfig.h"
 #include "test-utils.h"
 
-const char *test_program_name = "actest";
+const gchar *test_program_name = "actest";
 
 static E2kOperation op;
 
-static void *
-cancel (void *data)
+static gpointer
+cancel (gpointer data)
 {
 	e2k_operation_cancel (&op);
 	return NULL;
 }
 
 static void
-quit (int sig)
+quit (gint sig)
 {
 	static pthread_t cancel_thread;
 
@@ -54,11 +54,11 @@ quit (int sig)
 }
 
 void
-test_main (int argc, char **argv)
+test_main (gint argc, gchar **argv)
 {
 	E2kAutoconfig *ac;
 	E2kAutoconfigResult result;
-	const char *username, *password, *owa_uri, *gc_server;
+	const gchar *username, *password, *owa_uri, *gc_server;
 
 	signal (SIGINT, quit);
 
@@ -98,7 +98,7 @@ test_main (int argc, char **argv)
 
 	result = e2k_autoconfig_check_exchange (ac, &op);
 	if (result != E2K_AUTOCONFIG_OK) {
-		const char *msg;
+		const gchar *msg;
 		switch (result) {
 		case E2K_AUTOCONFIG_CANT_RESOLVE:
 			msg = "Could not resolve hostname";
@@ -155,7 +155,7 @@ test_main (int argc, char **argv)
 
 	result = e2k_autoconfig_check_global_catalog (ac, &op);
 	if (result != E2K_AUTOCONFIG_OK) {
-		const char *msg;
+		const gchar *msg;
 		switch (result) {
 		case E2K_AUTOCONFIG_CANT_RESOLVE:
 			msg = "Could not resolve GC server";
diff --git a/servers/exchange/lib/cptest.c b/servers/exchange/lib/cptest.c
index 1843fcb..91c0349 100644
--- a/servers/exchange/lib/cptest.c
+++ b/servers/exchange/lib/cptest.c
@@ -31,10 +31,10 @@
 #include "e2k-kerberos.h"
 #include "test-utils.h"
 
-const char *test_program_name = "cptest";
+const gchar *test_program_name = "cptest";
 
 static void
-krb_error (E2kKerberosResult result, const char *failed)
+krb_error (E2kKerberosResult result, const gchar *failed)
 {
 	switch (result) {
 	case E2K_KERBEROS_USER_UNKNOWN:
@@ -75,12 +75,12 @@ krb_error (E2kKerberosResult result, const char *failed)
 }
 
 void
-test_main (int argc, char **argv)
+test_main (gint argc, gchar **argv)
 {
-	char *domain, *at, *prompt, *password;
-	char *newpass1, *newpass2;
-	const char *user;
-	int res;
+	gchar *domain, *at, *prompt, *password;
+	gchar *newpass1, *newpass2;
+	const gchar *user;
+	gint res;
 
 	if (argc != 2) {
 		fprintf (stderr, "Usage: %s [user ]domain\n", argv[0]);
diff --git a/servers/exchange/lib/davcat.c b/servers/exchange/lib/davcat.c
index 6536f7d..cb1754e 100644
--- a/servers/exchange/lib/davcat.c
+++ b/servers/exchange/lib/davcat.c
@@ -41,24 +41,24 @@ print_header (gpointer name, gpointer value, gpointer data)
 {
 	gboolean *isxml = data;
 
-	printf ("%s: %s\n", (char *)name, (char *)value);
+	printf ("%s: %s\n", (gchar *)name, (gchar *)value);
 	if (!g_ascii_strcasecmp (name, "Content-Type") &&
 	    strstr (value, "/xml"))
 		*isxml = TRUE;
 }
 
-const char *test_program_name = "davcat";
+const gchar *test_program_name = "davcat";
 
 void
-test_main (int argc, char **argv)
+test_main (gint argc, gchar **argv)
 {
 	E2kContext *ctx;
 	SoupMessage *msg;
 	GByteArray *input;
-	char buf[1024], *base_uri, *root_uri, *eol, *vers, *p;
-	char *method, *path, *uri;
-	char *name, *value;
-	int nread;
+	gchar buf[1024], *base_uri, *root_uri, *eol, *vers, *p;
+	gchar *method, *path, *uri;
+	gchar *name, *value;
+	gint nread;
 	gboolean isxml = FALSE;
 
 	if (argc != 2) {
diff --git a/servers/exchange/lib/e2k-action.c b/servers/exchange/lib/e2k-action.c
index b72501c..881d077 100644
--- a/servers/exchange/lib/e2k-action.c
+++ b/servers/exchange/lib/e2k-action.c
@@ -235,7 +235,7 @@ e2k_action_delegate (E2kAddrList *list)
  * Return value: the new rule action
  **/
 E2kAction *
-e2k_action_tag (const char *propname, E2kPropType type, gpointer value)
+e2k_action_tag (const gchar *propname, E2kPropType type, gpointer value)
 {
 	E2kAction *act;
 
@@ -278,7 +278,7 @@ e2k_action_delete (void)
  * Return value: the new address list
  **/
 E2kAddrList *
-e2k_addr_list_new (int nentries)
+e2k_addr_list_new (gint nentries)
 {
 	E2kAddrList *list;
 
@@ -291,8 +291,8 @@ e2k_addr_list_new (int nentries)
 
 static void
 addr_entry_set_core (E2kPropValue *pv, GByteArray *entryid,
-		     const char *display_name, const char *email_type,
-		     const char *email_addr)
+		     const gchar *display_name, const gchar *email_type,
+		     const gchar *email_addr)
 {
 	e2k_rule_prop_set (&pv[0].prop, PR_ENTRYID);
 	pv[0].type = E2K_PROP_TYPE_BINARY;
@@ -347,10 +347,10 @@ addr_entry_set_core (E2kPropValue *pv, GByteArray *entryid,
  * local Exchange user.
  **/
 void
-e2k_addr_list_set_local (E2kAddrList *list, int entry_num,
-			 const char *display_name,
-			 const char *exchange_dn,
-			 const char *email)
+e2k_addr_list_set_local (E2kAddrList *list, gint entry_num,
+			 const gchar *display_name,
+			 const gchar *exchange_dn,
+			 const gchar *email)
 {
 	E2kPropValue *pv;
 
@@ -380,8 +380,8 @@ e2k_addr_list_set_local (E2kAddrList *list, int entry_num,
  * "one-off" SMTP user.
  **/
 void
-e2k_addr_list_set_oneoff (E2kAddrList *list, int entry_num,
-			  const char *display_name, const char *email)
+e2k_addr_list_set_oneoff (E2kAddrList *list, gint entry_num,
+			  const gchar *display_name, const gchar *email)
 {
 	E2kPropValue *pv;
 
@@ -409,7 +409,7 @@ e2k_addr_list_set_oneoff (E2kAddrList *list, int entry_num,
 void
 e2k_addr_list_free (E2kAddrList *list)
 {
-	int i, j;
+	gint i, j;
 	E2kAddrEntry *entry;
 
 	for (i = 0; i < list->nentries; i++) {
@@ -478,7 +478,7 @@ e2k_action_free (E2kAction *act)
 void
 e2k_actions_free (GPtrArray *actions)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < actions->len; i++)
 		e2k_action_free (actions->pdata[i]);
@@ -486,9 +486,9 @@ e2k_actions_free (GPtrArray *actions)
 }
 
 static gboolean
-extract_action (guint8 **data, int *len, E2kAction **act_ret)
+extract_action (guint8 **data, gint *len, E2kAction **act_ret)
 {
-	int my_len;
+	gint my_len;
 	guint8 *my_data;
 	guint16 actlen;
 	E2kAction *act;
@@ -590,7 +590,7 @@ extract_action (guint8 **data, int *len, E2kAction **act_ret)
 	case E2K_ACTION_DELEGATE:
 	{
 		guint16 nentries, nvalues;
-		int i, j;
+		gint i, j;
 
 		if (!e2k_rule_extract_uint16 (data, len, &nentries))
 			goto lose;
@@ -657,13 +657,13 @@ extract_action (guint8 **data, int *len, E2kAction **act_ret)
  * Return value: success or failure
  **/
 gboolean
-e2k_actions_extract (guint8 **data, int *len, GPtrArray **actions)
+e2k_actions_extract (guint8 **data, gint *len, GPtrArray **actions)
 {
 	GPtrArray *acts;
 	E2kAction *act;
 	guint32 actlen;
 	guint16 nacts;
-	int i;
+	gint i;
 
 	if (!e2k_rule_extract_uint32 (data, len, &actlen))
 		return FALSE;
@@ -689,8 +689,8 @@ e2k_actions_extract (guint8 **data, int *len, GPtrArray **actions)
 static void
 append_action (GByteArray *ba, E2kAction *act)
 {
-	int actlen_offset, actlen;
-	char type;
+	gint actlen_offset, actlen;
+	gchar type;
 
 	/* Save space for length */
 	actlen_offset = ba->len;
@@ -739,7 +739,7 @@ append_action (GByteArray *ba, E2kAction *act)
 	case E2K_ACTION_FORWARD:
 	case E2K_ACTION_DELEGATE:
 	{
-		int i, j;
+		gint i, j;
 		E2kAddrList *list;
 		E2kAddrEntry *entry;
 
@@ -786,7 +786,7 @@ append_action (GByteArray *ba, E2kAction *act)
 void
 e2k_actions_append (GByteArray *ba, GPtrArray *actions)
 {
-	int actlen_offset, actlen, i;
+	gint actlen_offset, actlen, i;
 
 	/* Save space for length */
 	actlen_offset = ba->len;
diff --git a/servers/exchange/lib/e2k-autoconfig.c b/servers/exchange/lib/e2k-autoconfig.c
index ead223c..dc2055c 100644
--- a/servers/exchange/lib/e2k-autoconfig.c
+++ b/servers/exchange/lib/e2k-autoconfig.c
@@ -76,7 +76,7 @@
 #define CONNECTOR_PREFIX e_util_get_prefix ()
 #endif
 
-static char *find_olson_timezone (const char *windows_timezone);
+static gchar *find_olson_timezone (const gchar *windows_timezone);
 static void set_account_uri_string (E2kAutoconfig *ac);
 
 /**
@@ -92,8 +92,8 @@ static void set_account_uri_string (E2kAutoconfig *ac);
  * Return value: an autoconfig context
  **/
 E2kAutoconfig *
-e2k_autoconfig_new (const char *owa_uri, const char *username,
-		    const char *password, E2kAutoconfigAuthPref auth_pref)
+e2k_autoconfig_new (const gchar *owa_uri, const gchar *username,
+		    const gchar *password, E2kAutoconfigAuthPref auth_pref)
 {
 	E2kAutoconfig *ac;
 
@@ -208,7 +208,7 @@ reset_owa_derived (E2kAutoconfig *ac)
  * the old value of #owa_uri.
  **/
 void
-e2k_autoconfig_set_owa_uri (E2kAutoconfig *ac, const char *owa_uri)
+e2k_autoconfig_set_owa_uri (E2kAutoconfig *ac, const gchar *owa_uri)
 {
 	reset_owa_derived (ac);
 	if (ac->gc_server_autodetected)
@@ -237,10 +237,10 @@ e2k_autoconfig_set_owa_uri (E2kAutoconfig *ac, const char *owa_uri)
  * of #gc_server.
  **/
 void
-e2k_autoconfig_set_gc_server (E2kAutoconfig *ac, const char *gc_server,
-			      int gal_limit, E2kAutoconfigGalAuthPref gal_auth)
+e2k_autoconfig_set_gc_server (E2kAutoconfig *ac, const gchar *gc_server,
+			      gint gal_limit, E2kAutoconfigGalAuthPref gal_auth)
 {
-	const char *default_gal_limit;
+	const gchar *default_gal_limit;
 
 	reset_gc_derived (ac);
 	g_free (ac->gc_server);
@@ -270,9 +270,9 @@ e2k_autoconfig_set_gc_server (E2kAutoconfig *ac, const char *gc_server,
  * set based on the old value of #username.
  **/
 void
-e2k_autoconfig_set_username (E2kAutoconfig *ac, const char *username)
+e2k_autoconfig_set_username (E2kAutoconfig *ac, const gchar *username)
 {
-	int dlen;
+	gint dlen;
 
 	reset_owa_derived (ac);
 	g_free (ac->username);
@@ -299,7 +299,7 @@ e2k_autoconfig_set_username (E2kAutoconfig *ac, const char *username)
  * Sets or clears @ac's #password field.
  **/
 void
-e2k_autoconfig_set_password (E2kAutoconfig *ac, const char *password)
+e2k_autoconfig_set_password (E2kAutoconfig *ac, const gchar *password)
 {
 	g_free (ac->password);
 	ac->password = g_strdup (password);
@@ -310,7 +310,7 @@ get_ctx_auth_handler (SoupMessage *msg, gpointer user_data)
 {
 	E2kAutoconfig *ac = user_data;
 	GSList *headers;
-	const char *challenge_hdr;
+	const gchar *challenge_hdr;
 
 	ac->saw_ntlm = ac->saw_basic = FALSE;
 	headers = e2k_http_get_headers (msg->response_headers,
@@ -394,7 +394,7 @@ e2k_autoconfig_get_context (E2kAutoconfig *ac, E2kOperation *op,
 	E2kContext *ctx;
 	SoupMessage *msg;
 	E2kHTTPStatus status;
-	const char *ms_webstorage;
+	const gchar *ms_webstorage;
 	xmlDoc *doc;
 	xmlNode *node;
 	xmlChar *equiv, *content, *href;
@@ -463,8 +463,8 @@ e2k_autoconfig_get_context (E2kAutoconfig *ac, E2kOperation *op,
 	 * new server.
 	 */
 	if (E2K_HTTP_STATUS_IS_REDIRECTION (status)) {
-		const char *location;
-		char *new_uri;
+		const gchar *location;
+		gchar *new_uri;
 
 		location = soup_message_headers_get (msg->response_headers,
 						     "Location");
@@ -497,7 +497,7 @@ e2k_autoconfig_get_context (E2kAutoconfig *ac, E2kOperation *op,
 	if (status == E2K_HTTP_FORBIDDEN &&
 	    !strncmp (ac->owa_uri, "http:", 5) && msg->response_body->length > 0) {
 		if (strstr (msg->response_body->data, "SSL")) {
-			char *new_uri =
+			gchar *new_uri =
 				g_strconcat ("https:", ac->owa_uri + 5, NULL);
 			e2k_autoconfig_set_owa_uri (ac, new_uri);
 			g_free (new_uri);
@@ -517,7 +517,7 @@ e2k_autoconfig_get_context (E2kAutoconfig *ac, E2kOperation *op,
 		else
 			ac->version = E2K_EXCHANGE_FUTURE;
 	} else {
-		const char *server = soup_message_headers_get (msg->response_headers, "Server");
+		const gchar *server = soup_message_headers_get (msg->response_headers, "Server");
 
 		/* If the server explicitly claims to be something
 		 * other than IIS, then return the "not windows"
@@ -614,11 +614,11 @@ e2k_autoconfig_get_context (E2kAutoconfig *ac, E2kOperation *op,
 	return ctx;
 }
 
-static const char *home_properties[] = {
+static const gchar *home_properties[] = {
 	PR_STORE_ENTRYID,
 	E2K_PR_EXCHANGE_TIMEZONE
 };
-static const int n_home_properties = sizeof (home_properties) / sizeof (home_properties[0]);
+static const gint n_home_properties = sizeof (home_properties) / sizeof (home_properties[0]);
 
 /*
  * e2k_autoconfig_check_exchange:
@@ -652,13 +652,13 @@ e2k_autoconfig_check_exchange (E2kAutoconfig *ac, E2kOperation *op)
 	xmlNode *node;
 	E2kHTTPStatus status;
 	E2kAutoconfigResult result;
-	char *new_uri, *pf_uri;
+	gchar *new_uri, *pf_uri;
 	E2kContext *ctx;
 	gboolean redirected = FALSE;
 	E2kResultIter *iter;
 	E2kResult *results;
 	GByteArray *entryid;
-	const char *exchange_dn, *timezone, *hrefs[] = { "" };
+	const gchar *exchange_dn, *timezone, *hrefs[] = { "" };
 	xmlChar *prop;
 	SoupBuffer *response;
 	E2kUri *euri;
@@ -798,8 +798,8 @@ static void
 find_global_catalog (E2kAutoconfig *ac)
 {
 #ifndef G_OS_WIN32
-	int count, len;
-	unsigned char answer[1024], namebuf[1024], *end, *p;
+	gint count, len;
+	guchar answer[1024], namebuf[1024], *end, *p;
 	guint16 type, qclass, rdlength, priority, weight, port;
 	guint32 ttl;
 	HEADER *header;
@@ -977,7 +977,7 @@ static void
 set_account_uri_string (E2kAutoconfig *ac)
 {
 	E2kUri *owa_uri, *home_uri;
-	char *path, *mailbox;
+	gchar *path, *mailbox;
 	GString *uri;
 
 	owa_uri = e2k_uri_new (ac->owa_uri);
@@ -1006,7 +1006,7 @@ set_account_uri_string (E2kAutoconfig *ac)
 	if (ac->gal_limit != -1)
 		g_string_append_printf (uri, ";ad_limit=%d", ac->gal_limit);
 	if (ac->gal_auth != E2K_AUTOCONFIG_USE_GAL_DEFAULT) {
-		const char *value = NULL;
+		const gchar *value = NULL;
 
 		switch (ac->gal_auth) {
 		case E2K_AUTOCONFIG_USE_GAL_BASIC: value = "basic"; break;
@@ -1052,7 +1052,7 @@ set_account_uri_string (E2kAutoconfig *ac)
  * timezone names. (Actually, we just strip the last two words.)
  */
 static struct {
-	const char *windows_name, *lang, *country, *olson_name;
+	const gchar *windows_name, *lang, *country, *olson_name;
 } zonemap[] = {
 	/* (GMT-12:00) Eniwetok, Kwajalein */
 	{ "Dateline", NULL, NULL, "Pacific/Kwajalein" },
@@ -1321,14 +1321,14 @@ static struct {
 	/* (GMT+13:00) Nuku'alofa */
 	{ "Tonga", NULL, NULL, "Pacific/Tongatapu" }
 };
-static const int n_zone_mappings = sizeof (zonemap) / sizeof (zonemap[0]);
+static const gint n_zone_mappings = sizeof (zonemap) / sizeof (zonemap[0]);
 
-static char *
-find_olson_timezone (const char *windows_timezone)
+static gchar *
+find_olson_timezone (const gchar *windows_timezone)
 {
-	int i, tzlen;
-	const char *locale, *p;
-	char lang[3] = { 0 }, country[3] = { 0 };
+	gint i, tzlen;
+	const gchar *locale, *p;
+	gchar lang[3] = { 0 }, country[3] = { 0 };
 
 	/* Strip " Standard Time" / " Daylight Time" from name */
 	p = windows_timezone + strlen (windows_timezone) - 1;
@@ -1365,7 +1365,7 @@ find_olson_timezone (const char *windows_timezone)
 			strncpy (country, locale, 2);
 	}
 #ifdef G_OS_WIN32
-	g_free ((char *) locale);
+	g_free ((gchar *) locale);
 #endif
 
 	/* Look for an entry where either the country or the
@@ -1395,9 +1395,9 @@ static void
 read_config (void)
 {
 	struct stat st;
-	char *p, *name, *value;
-	char *config_data;
-	int fd = -1;
+	gchar *p, *name, *value;
+	gchar *config_data;
+	gint fd = -1;
 
 	config_options = g_hash_table_new (e2k_ascii_strcase_hash,
 					    e2k_ascii_strcase_equal);
@@ -1469,8 +1469,8 @@ read_config (void)
  *
  * Return value: the string value of the option, or %NULL if it is unset.
  **/
-const char *
-e2k_autoconfig_lookup_option (const char *option)
+const gchar *
+e2k_autoconfig_lookup_option (const gchar *option)
 {
 	if (!config_options)
 		read_config ();
@@ -1478,14 +1478,14 @@ e2k_autoconfig_lookup_option (const char *option)
 }
 
 static gboolean
-validate (const char *owa_url, char *user, char *password, ExchangeParams *exchange_params, E2kAutoconfigResult *result)
+validate (const gchar *owa_url, gchar *user, gchar *password, ExchangeParams *exchange_params, E2kAutoconfigResult *result)
 {
 	E2kAutoconfig *ac;
 	E2kOperation op;        /* FIXME */
 	E2kUri *euri;
 	gboolean valid = FALSE;
-	const char *old, *new;
-	char *path, *mailbox;
+	const gchar *old, *new;
+	gchar *path, *mailbox;
 
 	ac = e2k_autoconfig_new (owa_url, user, password,
 				 E2K_AUTOCONFIG_USE_EITHER);
@@ -1516,7 +1516,7 @@ validate (const char *owa_url, char *user, char *password, ExchangeParams *excha
 	}
 
 	if (*result == E2K_AUTOCONFIG_OK) {
-		int len;
+		gint len;
 
 		*result = e2k_autoconfig_check_global_catalog (ac, &op);
 		e2k_operation_free (&op);
@@ -1547,7 +1547,7 @@ validate (const char *owa_url, char *user, char *password, ExchangeParams *excha
 			exchange_params->mailbox  = g_strdup (mailbox);
 		} else {
 			/* always strip the mailbox part from the path */
-			char *slash = strrchr (path, '/');
+			gchar *slash = strrchr (path, '/');
 
 			if (slash)
 				*slash = '\0';
@@ -1667,15 +1667,15 @@ validate (const char *owa_url, char *user, char *password, ExchangeParams *excha
 }
 
 gboolean
-e2k_validate_user (const char *owa_url, char *pkey, char **user,
+e2k_validate_user (const gchar *owa_url, gchar *pkey, gchar **user,
 		   ExchangeParams *exchange_params, gboolean *remember_password,
 		   E2kAutoconfigResult *result, GtkWindow *parent)
 {
 	gboolean valid = FALSE, remember=FALSE;
-	char *key, *password, *prompt;
-	char *username;
+	gchar *key, *password, *prompt;
+	gchar *username;
 	gchar **usernames;
-	int try = 0;
+	gint try = 0;
 	EUri *uri;
 
 	uri = e_uri_new (owa_url);
diff --git a/servers/exchange/lib/e2k-autoconfig.h b/servers/exchange/lib/e2k-autoconfig.h
index 5aab24d..d922b32 100644
--- a/servers/exchange/lib/e2k-autoconfig.h
+++ b/servers/exchange/lib/e2k-autoconfig.h
@@ -29,43 +29,43 @@ typedef enum {
 
 typedef struct {
 	/* Input data. (gc_server is optional) */
-	char *owa_uri, *gc_server;
-	char *username, *password;
-	int gal_limit;
+	gchar *owa_uri, *gc_server;
+	gchar *username, *password;
+	gint gal_limit;
 	E2kAutoconfigGalAuthPref gal_auth;
 
 	/* Output data */
 	E2kExchangeVersion version;
-	char *display_name, *email;
-	char *account_uri, *exchange_server;
-	char *timezone;
+	gchar *display_name, *email;
+	gchar *account_uri, *exchange_server;
+	gchar *timezone;
 
 	/* Private-ish members */
-	char *nt_domain, *w2k_domain;
-	char *home_uri, *exchange_dn;
-	char *pf_server;
+	gchar *nt_domain, *w2k_domain;
+	gchar *home_uri, *exchange_dn;
+	gchar *pf_server;
 	E2kAutoconfigAuthPref auth_pref;
 	gboolean require_ntlm, use_ntlm;
 	gboolean saw_basic, saw_ntlm;
 	gboolean nt_domain_defaulted, gc_server_autodetected;
 } E2kAutoconfig;
 
-E2kAutoconfig       *e2k_autoconfig_new                  (const char *owa_uri,
-							  const char *username,
-							  const char *password,
+E2kAutoconfig       *e2k_autoconfig_new                  (const gchar *owa_uri,
+							  const gchar *username,
+							  const gchar *password,
 							  E2kAutoconfigAuthPref auth_pref);
 void                 e2k_autoconfig_free                 (E2kAutoconfig *ac);
 
 void                 e2k_autoconfig_set_owa_uri          (E2kAutoconfig *ac,
-							  const char *owa_uri);
+							  const gchar *owa_uri);
 void                 e2k_autoconfig_set_gc_server        (E2kAutoconfig *ac,
-							  const char *gc_server,
-							  int gal_limit,
+							  const gchar *gc_server,
+							  gint gal_limit,
 							  E2kAutoconfigGalAuthPref gal_auth);
 void                 e2k_autoconfig_set_username         (E2kAutoconfig *ac,
-							  const char *username);
+							  const gchar *username);
 void                 e2k_autoconfig_set_password         (E2kAutoconfig *ac,
-							  const char *password);
+							  const gchar *password);
 
 E2kContext          *e2k_autoconfig_get_context          (E2kAutoconfig *ac,
 							  E2kOperation *op,
@@ -78,7 +78,7 @@ E2kAutoconfigResult  e2k_autoconfig_check_global_catalog (E2kAutoconfig *ac,
 							  E2kOperation *op);
 
 
-const char          *e2k_autoconfig_lookup_option        (const char *option);
+const gchar          *e2k_autoconfig_lookup_option        (const gchar *option);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/lib/e2k-context.c b/servers/exchange/lib/e2k-context.c
index 1d9e07c..e3beed4 100644
--- a/servers/exchange/lib/e2k-context.c
+++ b/servers/exchange/lib/e2k-context.c
@@ -85,19 +85,19 @@ static guint signals [LAST_SIGNAL] = { 0 };
 
 struct _E2kContextPrivate {
 	SoupSession *session, *async_session;
-	char *owa_uri, *username, *password;
+	gchar *owa_uri, *username, *password;
 	time_t last_timestamp;
 
 	/* Notification listener */
 	SoupSocket *get_local_address_sock;
 	GIOChannel *listener_channel;
-	int listener_watch_id;
+	gint listener_watch_id;
 
-	char *notification_uri;
+	gchar *notification_uri;
 	GHashTable *subscriptions_by_id, *subscriptions_by_uri;
 
 	/* Forms-based authentication */
-	char *cookie;
+	gchar *cookie;
 	gboolean cookie_verified;
 	EProxy* proxy;
 };
@@ -113,8 +113,8 @@ struct _E2kContextPrivate {
 #define SOUP_SESSION_PROXY_URI "proxy-uri"
 
 #ifdef E2K_DEBUG
-char *e2k_debug;
-int e2k_debug_level;
+gchar *e2k_debug;
+gint e2k_debug_level;
 
 static SoupLoggerLogLevel e2k_debug_request_filter  (SoupLogger  *logger,
 						     SoupMessage *msg,
@@ -125,7 +125,7 @@ static SoupLoggerLogLevel e2k_debug_response_filter (SoupLogger  *logger,
 #endif
 
 static gboolean renew_subscription (gpointer user_data);
-static void unsubscribe_internal (E2kContext *ctx, const char *uri, GList *sub_list, gboolean destrying);
+static void unsubscribe_internal (E2kContext *ctx, const gchar *uri, GList *sub_list, gboolean destrying);
 static gboolean do_notification (GIOChannel *source, GIOCondition condition, gpointer data);
 
 static void setup_message (SoupSession *session, SoupMessage *msg, SoupSocket *socket, gpointer user_data);
@@ -272,9 +272,9 @@ got_connection (SoupSocket *sock, guint status, gpointer user_data)
 	E2kContext *ctx = user_data;
 	SoupAddress *addr;
 	struct sockaddr_in sin;
-	const char *local_ipaddr;
+	const gchar *local_ipaddr;
 	unsigned short port;
-	int s, ret;
+	gint s, ret;
 
 	ctx->priv->get_local_address_sock = NULL;
 
@@ -339,7 +339,7 @@ got_connection (SoupSocket *sock, guint status, gpointer user_data)
  * Return value: the new context
  **/
 E2kContext *
-e2k_context_new (const char *uri)
+e2k_context_new (const gchar *uri)
 {
 	E2kContext *ctx;
 	SoupURI *suri;
@@ -394,9 +394,9 @@ session_authenticate (SoupSession *session, SoupMessage *msg,
  * side effect of cancelling any pending requests on @ctx.
  **/
 void
-e2k_context_set_auth (E2kContext *ctx, const char *username,
-		      const char *domain, const char *authmech,
-		      const char *password)
+e2k_context_set_auth (E2kContext *ctx, const gchar *username,
+		      const gchar *domain, const gchar *authmech,
+		      const gchar *password)
 {
 	guint timeout = E2K_SOUP_SESSION_TIMEOUT;
 	SoupURI* uri = NULL;
@@ -517,7 +517,7 @@ static SoupLoggerLogLevel
 e2k_debug_response_filter (SoupLogger *logger, SoupMessage *msg,
 			   gpointer user_data)
 {
-	const char *content_type;
+	const gchar *content_type;
 
 	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (msg->status_code))
 		return SOUP_LOGGER_LOG_HEADERS;
@@ -549,14 +549,14 @@ gboolean
 e2k_context_fba (E2kContext *ctx, SoupMessage *failed_msg)
 {
 	static gboolean in_fba_auth = FALSE;
-	int status, len;
+	gint status, len;
 	SoupBuffer *response = NULL;
-	char *action, *method, *name, *value;
+	gchar *action, *method, *name, *value;
 	xmlDoc *doc = NULL;
 	xmlNode *node;
 	SoupMessage *post_msg;
 	GHashTable *form_data;
-	char *form_body;
+	gchar *form_body;
 	GString *cookie_str;
 	GSList *cookies, *c;
 
@@ -618,8 +618,8 @@ e2k_context_fba (E2kContext *ctx, SoupMessage *failed_msg)
 		soup_uri_free (suri);
 	} else if (strncmp(value, "http", 4) != 0) {
 		SoupURI *suri;
-		char *path_end;
-		const char *location;
+		gchar *path_end;
+		const gchar *location;
 
 		location = soup_message_headers_get (failed_msg->response_headers,
 						     "Location");
@@ -743,7 +743,7 @@ static void
 timestamp_handler (SoupMessage *msg, gpointer user_data)
 {
 	E2kContext *ctx = user_data;
-	const char *date;
+	const gchar *date;
 
 	date = soup_message_headers_get (msg->response_headers, "Date");
 	if (date)
@@ -754,9 +754,9 @@ static void
 redirect_handler (SoupMessage *msg, gpointer user_data)
 {
 	E2kContext *ctx = user_data;
-	const char *new_uri;
+	const gchar *new_uri;
 	SoupURI *soup_uri;
-	char *old_uri;
+	gchar *old_uri;
 
 	if (!SOUP_STATUS_IS_REDIRECTION (msg->status_code) ||
 	    (soup_message_get_flags (msg) & SOUP_MESSAGE_NO_REDIRECT))
@@ -812,12 +812,12 @@ setup_message (SoupSession *session, SoupMessage *msg,
  * Return value: a new %SoupMessage, set up for connector use
  **/
 SoupMessage *
-e2k_soup_message_new (E2kContext *ctx, const char *uri, const char *method)
+e2k_soup_message_new (E2kContext *ctx, const gchar *uri, const gchar *method)
 {
 	SoupMessage *msg;
 
 	if (method[0] == 'B') {
-		char *slash_uri = e2k_strdup_with_trailing_slash (uri);
+		gchar *slash_uri = e2k_strdup_with_trailing_slash (uri);
 		msg = soup_message_new (method, slash_uri);
 		if (!msg)
 			g_warning ("Invalid uri '%s'", slash_uri ? slash_uri : "[null]");
@@ -847,9 +847,9 @@ e2k_soup_message_new (E2kContext *ctx, const char *uri, const char *method)
  * connector use
  **/
 SoupMessage *
-e2k_soup_message_new_full (E2kContext *ctx, const char *uri,
-			   const char *method, const char *content_type,
-			   SoupMemoryUse use, const char *body,
+e2k_soup_message_new_full (E2kContext *ctx, const gchar *uri,
+			   const gchar *method, const gchar *content_type,
+			   SoupMemoryUse use, const gchar *body,
 			   gsize length)
 {
 	SoupMessage *msg;
@@ -923,11 +923,11 @@ e2k_context_send_message (E2kContext *ctx, E2kOperation *op, SoupMessage *msg)
 
 static void
 update_unique_uri (E2kContext *ctx, SoupMessage *msg,
-		   const char *folder_uri, const char *encoded_name, int *count,
+		   const gchar *folder_uri, const gchar *encoded_name, gint *count,
 		   E2kContextTestCallback test_callback, gpointer user_data)
 {
 	SoupURI *suri;
-	char *uri = NULL;
+	gchar *uri = NULL;
 
 	do {
 		g_free (uri);
@@ -951,7 +951,7 @@ update_unique_uri (E2kContext *ctx, SoupMessage *msg,
 /* GET */
 
 static SoupMessage *
-get_msg (E2kContext *ctx, const char *uri, gboolean owa, gboolean claim_ie)
+get_msg (E2kContext *ctx, const gchar *uri, gboolean owa, gboolean claim_ie)
 {
 	SoupMessage *msg;
 
@@ -985,8 +985,8 @@ get_msg (E2kContext *ctx, const char *uri, gboolean owa, gboolean claim_ie)
  * Return value: the HTTP status
  **/
 E2kHTTPStatus
-e2k_context_get (E2kContext *ctx, E2kOperation *op, const char *uri,
-		 char **content_type, SoupBuffer **response)
+e2k_context_get (E2kContext *ctx, E2kOperation *op, const gchar *uri,
+		 gchar **content_type, SoupBuffer **response)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
@@ -999,7 +999,7 @@ e2k_context_get (E2kContext *ctx, E2kOperation *op, const char *uri,
 
 	if (E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) {
 		if (content_type) {
-			const char *header;
+			const gchar *header;
 			header = soup_message_headers_get (msg->response_headers,
 							   "Content-Type");
 			*content_type = g_strdup (header);
@@ -1027,7 +1027,7 @@ e2k_context_get (E2kContext *ctx, E2kOperation *op, const char *uri,
  **/
 E2kHTTPStatus
 e2k_context_get_owa (E2kContext *ctx, E2kOperation *op,
-		     const char *uri, gboolean claim_ie,
+		     const gchar *uri, gboolean claim_ie,
 		     SoupBuffer **response)
 {
 	SoupMessage *msg;
@@ -1051,8 +1051,8 @@ e2k_context_get_owa (E2kContext *ctx, E2kOperation *op,
 /* PUT / POST */
 
 static SoupMessage *
-put_msg (E2kContext *ctx, const char *uri, const char *content_type,
-	 SoupMemoryUse buffer_type, const char *body, int length)
+put_msg (E2kContext *ctx, const gchar *uri, const gchar *content_type,
+	 SoupMemoryUse buffer_type, const gchar *body, gint length)
 {
 	SoupMessage *msg;
 
@@ -1064,8 +1064,8 @@ put_msg (E2kContext *ctx, const char *uri, const char *content_type,
 }
 
 static SoupMessage *
-post_msg (E2kContext *ctx, const char *uri, const char *content_type,
-	  SoupMemoryUse buffer_type, const char *body, int length)
+post_msg (E2kContext *ctx, const gchar *uri, const gchar *content_type,
+	  SoupMemoryUse buffer_type, const gchar *body, gint length)
 {
 	SoupMessage *msg;
 
@@ -1077,9 +1077,9 @@ post_msg (E2kContext *ctx, const char *uri, const char *content_type,
 }
 
 static void
-extract_put_results (SoupMessage *msg, char **location, char **repl_uid)
+extract_put_results (SoupMessage *msg, gchar **location, gchar **repl_uid)
 {
-	const char *header;
+	const gchar *header;
 
 	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (msg->status_code))
 		return;
@@ -1112,9 +1112,9 @@ extract_put_results (SoupMessage *msg, char **location, char **repl_uid)
  * Return value: the HTTP status
  **/
 E2kHTTPStatus
-e2k_context_put (E2kContext *ctx, E2kOperation *op, const char *uri,
-		 const char *content_type, const char *body, int length,
-		 char **repl_uid)
+e2k_context_put (E2kContext *ctx, E2kOperation *op, const gchar *uri,
+		 const gchar *content_type, const gchar *body, gint length,
+		 gchar **repl_uid)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
@@ -1159,15 +1159,15 @@ e2k_context_put (E2kContext *ctx, E2kOperation *op, const char *uri,
  **/
 E2kHTTPStatus
 e2k_context_put_new (E2kContext *ctx, E2kOperation *op,
-		     const char *folder_uri, const char *object_name,
+		     const gchar *folder_uri, const gchar *object_name,
 		     E2kContextTestCallback test_callback, gpointer user_data,
-		     const char *content_type, const char *body, int length,
-		     char **location, char **repl_uid)
+		     const gchar *content_type, const gchar *body, gint length,
+		     gchar **location, gchar **repl_uid)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
-	char *slash_uri, *encoded_name;
-	int count;
+	gchar *slash_uri, *encoded_name;
+	gint count;
 
 	g_return_val_if_fail (E2K_IS_CONTEXT (ctx), E2K_HTTP_MALFORMED);
 	g_return_val_if_fail (folder_uri != NULL, E2K_HTTP_MALFORMED);
@@ -1220,9 +1220,9 @@ e2k_context_put_new (E2kContext *ctx, E2kOperation *op,
  * Return value: the HTTP status
  **/
 E2kHTTPStatus
-e2k_context_post (E2kContext *ctx, E2kOperation *op, const char *uri,
-		  const char *content_type, const char *body, int length,
-		  char **location, char **repl_uid)
+e2k_context_post (E2kContext *ctx, E2kOperation *op, const gchar *uri,
+		  const gchar *content_type, const gchar *body, gint length,
+		  gchar **location, gchar **repl_uid)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
@@ -1245,7 +1245,7 @@ e2k_context_post (E2kContext *ctx, E2kOperation *op, const char *uri,
 /* PROPPATCH */
 
 static void
-add_namespaces (const char *namespace, char abbrev, gpointer user_data)
+add_namespaces (const gchar *namespace, gchar abbrev, gpointer user_data)
 {
 	GString *propxml = user_data;
 
@@ -1253,15 +1253,15 @@ add_namespaces (const char *namespace, char abbrev, gpointer user_data)
 }
 
 static void
-write_prop (GString *xml, const char *propertyname,
+write_prop (GString *xml, const gchar *propertyname,
 	    E2kPropType type, gpointer value, gboolean set)
 {
-	const char *namespace, *name, *typestr;
-	char *encoded, abbrev;
+	const gchar *namespace, *name, *typestr;
+	gchar *encoded, abbrev;
 	gboolean b64enc, need_type;
 	GByteArray *data;
 	GPtrArray *array;
-	int i;
+	gint i;
 
 	if (set && (value == NULL))
 		return;
@@ -1361,7 +1361,7 @@ write_prop (GString *xml, const char *propertyname,
 }
 
 static void
-add_set_props (const char *propertyname, E2kPropType type,
+add_set_props (const gchar *propertyname, E2kPropType type,
 	       gpointer value, gpointer user_data)
 {
 	GString **props = user_data;
@@ -1373,7 +1373,7 @@ add_set_props (const char *propertyname, E2kPropType type,
 }
 
 static void
-add_remove_props (const char *propertyname, E2kPropType type,
+add_remove_props (const gchar *propertyname, E2kPropType type,
 		  gpointer value, gpointer user_data)
 {
 	GString **props = user_data;
@@ -1385,13 +1385,13 @@ add_remove_props (const char *propertyname, E2kPropType type,
 }
 
 static SoupMessage *
-patch_msg (E2kContext *ctx, const char *uri, const char *method,
-	   const char **hrefs, int nhrefs, E2kProperties *props,
+patch_msg (E2kContext *ctx, const gchar *uri, const gchar *method,
+	   const gchar **hrefs, gint nhrefs, E2kProperties *props,
 	   gboolean create)
 {
 	SoupMessage *msg;
 	GString *propxml, *subxml;
-	int i;
+	gint i;
 
 	propxml = g_string_new (E2K_XML_HEADER);
 	g_string_append (propxml, "<D:propertyupdate xmlns:D=\"DAV:\"");
@@ -1466,8 +1466,8 @@ patch_msg (E2kContext *ctx, const char *uri, const char *method,
  **/
 E2kHTTPStatus
 e2k_context_proppatch (E2kContext *ctx, E2kOperation *op,
-		       const char *uri, E2kProperties *props,
-		       gboolean create, char **repl_uid)
+		       const gchar *uri, E2kProperties *props,
+		       gboolean create, gchar **repl_uid)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
@@ -1508,16 +1508,16 @@ e2k_context_proppatch (E2kContext *ctx, E2kOperation *op,
  **/
 E2kHTTPStatus
 e2k_context_proppatch_new (E2kContext *ctx, E2kOperation *op,
-			   const char *folder_uri, const char *object_name,
+			   const gchar *folder_uri, const gchar *object_name,
 			   E2kContextTestCallback test_callback,
 			   gpointer user_data,
 			   E2kProperties *props,
-			   char **location, char **repl_uid)
+			   gchar **location, gchar **repl_uid)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
-	char *slash_uri, *encoded_name;
-	int count;
+	gchar *slash_uri, *encoded_name;
+	gint count;
 
 	g_return_val_if_fail (E2K_IS_CONTEXT (ctx), E2K_HTTP_MALFORMED);
 	g_return_val_if_fail (folder_uri != NULL, E2K_HTTP_MALFORMED);
@@ -1551,8 +1551,8 @@ e2k_context_proppatch_new (E2kContext *ctx, E2kOperation *op,
 static E2kHTTPStatus
 bproppatch_fetch (E2kResultIter *iter,
 		  E2kContext *ctx, E2kOperation *op,
-		  E2kResult **results, int *nresults,
-		  int *first, int *total,
+		  E2kResult **results, gint *nresults,
+		  gint *first, gint *total,
 		  gpointer user_data)
 {
 	SoupMessage *msg = user_data;
@@ -1594,7 +1594,7 @@ bproppatch_free (E2kResultIter *iter, gpointer msg)
  **/
 E2kResultIter *
 e2k_context_bproppatch_start (E2kContext *ctx, E2kOperation *op,
-			      const char *uri, const char **hrefs, int nhrefs,
+			      const gchar *uri, const gchar **hrefs, gint nhrefs,
 			      E2kProperties *props, gboolean create)
 {
 	SoupMessage *msg;
@@ -1612,15 +1612,15 @@ e2k_context_bproppatch_start (E2kContext *ctx, E2kOperation *op,
 /* PROPFIND */
 
 static SoupMessage *
-propfind_msg (E2kContext *ctx, const char *base_uri,
-	      const char **props, int nprops, const char **hrefs, int nhrefs)
+propfind_msg (E2kContext *ctx, const gchar *base_uri,
+	      const gchar **props, gint nprops, const gchar **hrefs, gint nhrefs)
 {
 	SoupMessage *msg;
 	GString *propxml;
 	GData *set_namespaces;
-	const char *name;
-	char abbrev;
-	int i;
+	const gchar *name;
+	gchar abbrev;
+	gint i;
 
 	propxml = g_string_new (E2K_XML_HEADER);
 	g_string_append (propxml, "<D:propfind xmlns:D=\"DAV:\"");
@@ -1687,8 +1687,8 @@ propfind_msg (E2kContext *ctx, const char *base_uri,
  **/
 E2kHTTPStatus
 e2k_context_propfind (E2kContext *ctx, E2kOperation *op,
-		      const char *uri, const char **props, int nprops,
-		      E2kResult **results, int *nresults)
+		      const gchar *uri, const gchar **props, gint nprops,
+		      E2kResult **results, gint *nresults)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
@@ -1709,8 +1709,8 @@ e2k_context_propfind (E2kContext *ctx, E2kOperation *op,
 static E2kHTTPStatus
 bpropfind_fetch (E2kResultIter *iter,
 		 E2kContext *ctx, E2kOperation *op,
-		 E2kResult **results, int *nresults,
-		 int *first, int *total,
+		 E2kResult **results, gint *nresults,
+		 gint *first, gint *total,
 		 gpointer user_data)
 {
 	GSList **msgs = user_data;
@@ -1758,12 +1758,12 @@ bpropfind_free (E2kResultIter *iter, gpointer user_data)
  **/
 E2kResultIter *
 e2k_context_bpropfind_start (E2kContext *ctx, E2kOperation *op,
-			     const char *uri, const char **hrefs, int nhrefs,
-			     const char **props, int nprops)
+			     const gchar *uri, const gchar **hrefs, gint nhrefs,
+			     const gchar **props, gint nprops)
 {
 	SoupMessage *msg;
 	GSList **msgs;
-	int i;
+	gint i;
 
 	g_return_val_if_fail (E2K_IS_CONTEXT (ctx), NULL);
 	g_return_val_if_fail (uri != NULL, NULL);
@@ -1785,9 +1785,9 @@ e2k_context_bpropfind_start (E2kContext *ctx, E2kOperation *op,
 /* SEARCH */
 
 static SoupMessage *
-search_msg (E2kContext *ctx, const char *uri,
-	    SoupMemoryUse buffer_type, const char *searchxml,
-	    int size, gboolean ascending, int offset)
+search_msg (E2kContext *ctx, const gchar *uri,
+	    SoupMemoryUse buffer_type, const gchar *searchxml,
+	    gint size, gboolean ascending, gint offset)
 {
 	SoupMessage *msg;
 
@@ -1797,7 +1797,7 @@ search_msg (E2kContext *ctx, const char *uri,
 	soup_message_headers_append (msg->request_headers, "Brief", "t");
 
 	if (size) {
-		char *range;
+		gchar *range;
 
 		if (offset == INT_MAX) {
 			range = g_strdup_printf ("rows=-%u", size);
@@ -1812,13 +1812,13 @@ search_msg (E2kContext *ctx, const char *uri,
 	return msg;
 }
 
-static char *
-search_xml (const char **props, int nprops,
-	    E2kRestriction *rn, const char *orderby)
+static gchar *
+search_xml (const gchar **props, gint nprops,
+	    E2kRestriction *rn, const gchar *orderby)
 {
 	GString *xml;
-	char *ret, *where;
-	int i;
+	gchar *ret, *where;
+	gint i;
 
 	xml = g_string_new (E2K_XML_HEADER);
 	g_string_append (xml, "<searchrequest xmlns=\"DAV:\"><sql>\r\n");
@@ -1858,9 +1858,9 @@ search_xml (const char **props, int nprops,
 }
 
 static gboolean
-search_result_get_range (SoupMessage *msg, int *first, int *total)
+search_result_get_range (SoupMessage *msg, gint *first, gint *total)
 {
-	const char *range, *p;
+	const gchar *range, *p;
 
 	range = soup_message_headers_get (msg->response_headers,
 					  "Content-Range");
@@ -1885,16 +1885,16 @@ search_result_get_range (SoupMessage *msg, int *first, int *total)
 }
 
 typedef struct {
-	char *uri, *xml;
+	gchar *uri, *xml;
 	gboolean ascending;
-	int batch_size, next;
+	gint batch_size, next;
 } E2kSearchData;
 
 static E2kHTTPStatus
 search_fetch (E2kResultIter *iter,
 	      E2kContext *ctx, E2kOperation *op,
-	      E2kResult **results, int *nresults,
-	      int *first, int *total,
+	      E2kResult **results, gint *nresults,
+	      gint *first, gint *total,
 	      gpointer user_data)
 {
 	E2kSearchData *search_data = user_data;
@@ -1964,9 +1964,9 @@ search_free (E2kResultIter *iter, gpointer user_data)
  * Return value: an iterator for returning the search results
  **/
 E2kResultIter *
-e2k_context_search_start (E2kContext *ctx, E2kOperation *op, const char *uri,
-			  const char **props, int nprops, E2kRestriction *rn,
-			  const char *orderby, gboolean ascending)
+e2k_context_search_start (E2kContext *ctx, E2kOperation *op, const gchar *uri,
+			  const gchar **props, gint nprops, E2kRestriction *rn,
+			  const gchar *orderby, gboolean ascending)
 {
 	E2kSearchData *search_data;
 
@@ -1991,7 +1991,7 @@ e2k_context_search_start (E2kContext *ctx, E2kOperation *op, const char *uri,
 /* DELETE */
 
 static SoupMessage *
-delete_msg (E2kContext *ctx, const char *uri)
+delete_msg (E2kContext *ctx, const gchar *uri)
 {
 	return e2k_soup_message_new (ctx, uri, "DELETE");
 }
@@ -2007,7 +2007,7 @@ delete_msg (E2kContext *ctx, const char *uri)
  * Return value: the HTTP status
  **/
 E2kHTTPStatus
-e2k_context_delete (E2kContext *ctx, E2kOperation *op, const char *uri)
+e2k_context_delete (E2kContext *ctx, E2kOperation *op, const gchar *uri)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
@@ -2025,11 +2025,11 @@ e2k_context_delete (E2kContext *ctx, E2kOperation *op, const char *uri)
 /* BDELETE */
 
 static SoupMessage *
-bdelete_msg (E2kContext *ctx, const char *uri, const char **hrefs, int nhrefs)
+bdelete_msg (E2kContext *ctx, const gchar *uri, const gchar **hrefs, gint nhrefs)
 {
 	SoupMessage *msg;
 	GString *xml;
-	int i;
+	gint i;
 
 	xml = g_string_new (E2K_XML_HEADER "<delete xmlns=\"DAV:\"><target>");
 
@@ -2052,8 +2052,8 @@ bdelete_msg (E2kContext *ctx, const char *uri, const char **hrefs, int nhrefs)
 static E2kHTTPStatus
 bdelete_fetch (E2kResultIter *iter,
 	       E2kContext *ctx, E2kOperation *op,
-	       E2kResult **results, int *nresults,
-	       int *first, int *total,
+	       E2kResult **results, gint *nresults,
+	       gint *first, gint *total,
 	       gpointer user_data)
 {
 	GSList **msgs = user_data;
@@ -2099,10 +2099,10 @@ bdelete_free (E2kResultIter *iter, gpointer user_data)
  **/
 E2kResultIter *
 e2k_context_bdelete_start (E2kContext *ctx, E2kOperation *op,
-			   const char *uri, const char **hrefs, int nhrefs)
+			   const gchar *uri, const gchar **hrefs, gint nhrefs)
 {
 	GSList **msgs;
-	int i, batchsize;
+	gint i, batchsize;
 	SoupMessage *msg;
 
 	g_return_val_if_fail (E2K_IS_CONTEXT (ctx), NULL);
@@ -2145,8 +2145,8 @@ e2k_context_bdelete_start (E2kContext *ctx, E2kOperation *op,
  **/
 E2kHTTPStatus
 e2k_context_mkcol (E2kContext *ctx, E2kOperation *op,
-		   const char *uri, E2kProperties *props,
-		   char **permanent_url)
+		   const gchar *uri, E2kProperties *props,
+		   gchar **permanent_url)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
@@ -2161,7 +2161,7 @@ e2k_context_mkcol (E2kContext *ctx, E2kOperation *op,
 
 	status = e2k_context_send_message (ctx, op, msg);
 	if (E2K_HTTP_STATUS_IS_SUCCESSFUL (status) && permanent_url) {
-		const char *header;
+		const gchar *header;
 
 		header = soup_message_headers_get (msg->response_headers,
 						   "MS-Exchange-Permanent-URL");
@@ -2176,13 +2176,13 @@ e2k_context_mkcol (E2kContext *ctx, E2kOperation *op,
 
 static SoupMessage *
 transfer_msg (E2kContext *ctx,
-	      const char *source_uri, const char *dest_uri,
-	      const char **source_hrefs, int nhrefs,
+	      const gchar *source_uri, const gchar *dest_uri,
+	      const gchar **source_hrefs, gint nhrefs,
 	      gboolean delete_originals)
 {
 	SoupMessage *msg;
 	GString *xml;
-	int i;
+	gint i;
 
 	xml = g_string_new (E2K_XML_HEADER);
 	g_string_append (xml, delete_originals ? "<move" : "<copy");
@@ -2211,8 +2211,8 @@ transfer_msg (E2kContext *ctx,
 static E2kHTTPStatus
 transfer_next (E2kResultIter *iter,
 	       E2kContext *ctx, E2kOperation *op,
-	       E2kResult **results, int *nresults,
-	       int *first, int *total,
+	       E2kResult **results, gint *nresults,
+	       gint *first, gint *total,
 	       gpointer user_data)
 {
 	GSList **msgs = user_data;
@@ -2266,14 +2266,14 @@ transfer_free (E2kResultIter *iter, gpointer user_data)
  **/
 E2kResultIter *
 e2k_context_transfer_start (E2kContext *ctx, E2kOperation *op,
-			    const char *source_folder, const char *dest_folder,
+			    const gchar *source_folder, const gchar *dest_folder,
 			    GPtrArray *source_hrefs, gboolean delete_originals)
 {
 	GSList **msgs;
 	SoupMessage *msg;
-	char *dest_uri;
-	const char **hrefs;
-	int i;
+	gchar *dest_uri;
+	const gchar **hrefs;
+	gint i;
 
 	g_return_val_if_fail (E2K_IS_CONTEXT (ctx), NULL);
 	g_return_val_if_fail (source_folder != NULL, NULL);
@@ -2283,7 +2283,7 @@ e2k_context_transfer_start (E2kContext *ctx, E2kOperation *op,
 	dest_uri = e2k_strdup_with_trailing_slash (dest_folder);
 	if (!dest_uri)
 		return NULL;
-	hrefs = (const char **)source_hrefs->pdata;
+	hrefs = (const gchar **)source_hrefs->pdata;
 
 	msgs = g_new0 (GSList *, 1);
 	for (i = 0; i < source_hrefs->len; i += E2K_CONTEXT_MAX_BATCH_SIZE) {
@@ -2318,9 +2318,9 @@ e2k_context_transfer_start (E2kContext *ctx, E2kOperation *op,
  **/
 E2kHTTPStatus
 e2k_context_transfer_dir (E2kContext *ctx, E2kOperation *op,
-			  const char *source_href, const char *dest_href,
+			  const gchar *source_href, const gchar *dest_href,
 			  gboolean delete_original,
-			  char **permanent_url)
+			  gchar **permanent_url)
 {
 	SoupMessage *msg;
 	E2kHTTPStatus status;
@@ -2335,7 +2335,7 @@ e2k_context_transfer_dir (E2kContext *ctx, E2kOperation *op,
 
 	status = e2k_context_send_message (ctx, op, msg);
 	if (E2K_HTTP_STATUS_IS_SUCCESSFUL (status) && permanent_url) {
-		const char *header;
+		const gchar *header;
 
 		header = soup_message_headers_get (msg->response_headers,
 						   "MS-Exchange-Permanent-URL");
@@ -2351,9 +2351,9 @@ e2k_context_transfer_dir (E2kContext *ctx, E2kOperation *op,
 
 typedef struct {
 	E2kContext *ctx;
-	char *uri, *id;
+	gchar *uri, *id;
 	E2kContextChangeType type;
-	int lifetime, min_interval;
+	gint lifetime, min_interval;
 	time_t last_notification;
 
 	E2kContextChangeCallback callback;
@@ -2380,7 +2380,7 @@ static void
 maybe_notification (E2kSubscription *sub)
 {
 	time_t now = time (NULL);
-	int delay = sub->last_notification + sub->min_interval - now;
+	gint delay = sub->last_notification + sub->min_interval - now;
 
 	if (delay > 0) {
 		if (sub->notification_timeout)
@@ -2401,9 +2401,9 @@ polled (SoupSession *session, SoupMessage *msg, gpointer user_data)
 	E2kSubscription *sub = user_data;
 	E2kContext *ctx = sub->ctx;
 	E2kResult *results;
-	int nresults, i;
+	gint nresults, i;
 	xmlNode *ids;
-	char *id;
+	gchar *id;
 
 	sub->poll_msg = NULL;
 	if (msg->status_code != E2K_HTTP_MULTI_STATUS) {
@@ -2475,7 +2475,7 @@ do_notification (GIOChannel *source, GIOCondition condition, gpointer data)
 {
 	E2kContext *ctx = data;
 	E2kSubscription *sub;
-	char buffer[1024], *id, *lasts;
+	gchar buffer[1024], *id, *lasts;
 	gsize len;
 	GIOStatus status;
 
@@ -2557,7 +2557,7 @@ renew_cb (SoupSession *session, SoupMessage *msg, gpointer user_data)
 #define E2K_SUBSCRIPTION_MAX_LIFETIME     57600 /* 16 hours */
 
 /* This must be kept in sync with E2kSubscriptionType */
-static char *subscription_type[] = {
+static gchar *subscription_type[] = {
 	"update",		/* E2K_SUBSCRIPTION_OBJECT_CHANGED */
 	"update/newmember",	/* E2K_SUBSCRIPTION_OBJECT_ADDED */
 	"delete",		/* E2K_SUBSCRIPTION_OBJECT_REMOVED */
@@ -2569,7 +2569,7 @@ renew_subscription (gpointer user_data)
 {
 	E2kSubscription *sub = user_data;
 	E2kContext *ctx = sub->ctx;
-	char ltbuf[80];
+	gchar ltbuf[80];
 
 	if (!ctx->priv->notification_uri)
 		return FALSE;
@@ -2633,8 +2633,8 @@ renew_subscription (gpointer user_data)
  * and the server, it is possible that all notifications will be lost.
  **/
 void
-e2k_context_subscribe (E2kContext *ctx, const char *uri,
-		       E2kContextChangeType type, int min_interval,
+e2k_context_subscribe (E2kContext *ctx, const gchar *uri,
+		       E2kContextChangeType type, gint min_interval,
 		       E2kContextChangeCallback callback,
 		       gpointer user_data)
 {
@@ -2698,13 +2698,13 @@ unsubscribed (SoupSession *session, SoupMessage *msg, gpointer user_data)
 }
 
 static void
-unsubscribe_internal (E2kContext *ctx, const char *puri, GList *sub_list, gboolean destrying)
+unsubscribe_internal (E2kContext *ctx, const gchar *puri, GList *sub_list, gboolean destrying)
 {
 	GList *l;
 	E2kSubscription *sub;
 	SoupMessage *msg;
 	GString *subscription_ids = NULL;
-	char *uri = g_strdup (puri);
+	gchar *uri = g_strdup (puri);
 	/* puri comes from sub->uri, but we are using it after sub is freed, thus making copy here */
 
 	for (l = sub_list; l; l = l->next) {
@@ -2747,7 +2747,7 @@ unsubscribe_internal (E2kContext *ctx, const char *puri, GList *sub_list, gboole
  * Unsubscribes to all notifications on @ctx for @uri.
  **/
 void
-e2k_context_unsubscribe (E2kContext *ctx, const char *uri)
+e2k_context_unsubscribe (E2kContext *ctx, const gchar *uri)
 {
 	GList *sub_list;
 
diff --git a/servers/exchange/lib/e2k-context.h b/servers/exchange/lib/e2k-context.h
index 2093adb..7fc815e 100644
--- a/servers/exchange/lib/e2k-context.h
+++ b/servers/exchange/lib/e2k-context.h
@@ -37,136 +37,136 @@ struct _E2kContextClass {
 
 	/* signals */
 	void (*redirect) (E2kContext *ctx, E2kHTTPStatus status,
-			  const char *old_uri, const char *new_uri);
+			  const gchar *old_uri, const gchar *new_uri);
 };
 
 GType          e2k_context_get_type         (void);
 
-E2kContext    *e2k_context_new              (const char  *uri);
+E2kContext    *e2k_context_new              (const gchar  *uri);
 void           e2k_context_set_auth         (E2kContext  *ctx,
-					     const char  *username,
-					     const char  *domain,
-					     const char  *authmech,
-					     const char  *password);
+					     const gchar  *username,
+					     const gchar  *domain,
+					     const gchar  *authmech,
+					     const gchar  *password);
 gboolean       e2k_context_fba              (E2kContext  *ctx,
 					     SoupMessage *failed_msg);
 
 time_t        e2k_context_get_last_timestamp    (E2kContext *ctx);
 
 typedef gboolean (*E2kContextTestCallback)     (E2kContext *ctx,
-						const char *test_name,
+						const gchar *test_name,
 						gpointer user_data);
 
 E2kHTTPStatus  e2k_context_get               (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
-					      char **content_type,
+					      const gchar *uri,
+					      gchar **content_type,
 					      SoupBuffer **response);
 E2kHTTPStatus  e2k_context_get_owa           (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
+					      const gchar *uri,
 					      gboolean claim_ie,
 					      SoupBuffer **response);
 
 E2kHTTPStatus  e2k_context_put               (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
-					      const char *content_type,
-					      const char *body, int length,
-					      char **repl_uid);
+					      const gchar *uri,
+					      const gchar *content_type,
+					      const gchar *body, gint length,
+					      gchar **repl_uid);
 E2kHTTPStatus  e2k_context_put_new           (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *folder_uri,
-					      const char *object_name,
+					      const gchar *folder_uri,
+					      const gchar *object_name,
 					      E2kContextTestCallback test_callback,
 					      gpointer user_data,
-					      const char *content_type,
-					      const char *body, int length,
-					      char **location,
-					      char **repl_uid);
+					      const gchar *content_type,
+					      const gchar *body, gint length,
+					      gchar **location,
+					      gchar **repl_uid);
 E2kHTTPStatus  e2k_context_post              (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
-					      const char *content_type,
-					      const char *body, int length,
-					      char **location,
-					      char **repl_uid);
+					      const gchar *uri,
+					      const gchar *content_type,
+					      const gchar *body, gint length,
+					      gchar **location,
+					      gchar **repl_uid);
 
 E2kHTTPStatus  e2k_context_proppatch         (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
+					      const gchar *uri,
 					      E2kProperties *props,
 					      gboolean create,
-					      char **repl_uid);
+					      gchar **repl_uid);
 E2kHTTPStatus  e2k_context_proppatch_new     (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *folder_uri,
-					      const char *object_name,
+					      const gchar *folder_uri,
+					      const gchar *object_name,
 					      E2kContextTestCallback test_callback,
 					      gpointer user_data,
 					      E2kProperties *props,
-					      char **location,
-					      char **repl_uid);
+					      gchar **location,
+					      gchar **repl_uid);
 E2kResultIter *e2k_context_bproppatch_start  (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
-					      const char **hrefs,
-					      int nhrefs,
+					      const gchar *uri,
+					      const gchar **hrefs,
+					      gint nhrefs,
 					      E2kProperties *props,
 					      gboolean create);
 
 E2kHTTPStatus  e2k_context_propfind          (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
-					      const char **props,
-					      int nprops,
+					      const gchar *uri,
+					      const gchar **props,
+					      gint nprops,
 					      E2kResult **results,
-					      int *nresults);
+					      gint *nresults);
 E2kResultIter *e2k_context_bpropfind_start   (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
-					      const char **hrefs,
-					      int nhrefs,
-					      const char **props,
-					      int nprops);
+					      const gchar *uri,
+					      const gchar **hrefs,
+					      gint nhrefs,
+					      const gchar **props,
+					      gint nprops);
 
 E2kResultIter *e2k_context_search_start      (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
-					      const char **props,
-					      int nprops,
+					      const gchar *uri,
+					      const gchar **props,
+					      gint nprops,
 					      E2kRestriction *rn,
-					      const char *orderby,
+					      const gchar *orderby,
 					      gboolean ascending);
 
 E2kHTTPStatus  e2k_context_delete            (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri);
+					      const gchar *uri);
 
 E2kResultIter *e2k_context_bdelete_start     (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
-					      const char **hrefs,
-					      int nhrefs);
+					      const gchar *uri,
+					      const gchar **hrefs,
+					      gint nhrefs);
 
 E2kHTTPStatus  e2k_context_mkcol             (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *uri,
+					      const gchar *uri,
 					      E2kProperties *props,
-					      char **permanent_url);
+					      gchar **permanent_url);
 
 E2kResultIter *e2k_context_transfer_start    (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *source_folder,
-					      const char *dest_folder,
+					      const gchar *source_folder,
+					      const gchar *dest_folder,
 					      GPtrArray *source_hrefs,
 					      gboolean delete_originals);
 E2kHTTPStatus  e2k_context_transfer_dir      (E2kContext *ctx,
 					      E2kOperation *op,
-					      const char *source_href,
-					      const char *dest_href,
+					      const gchar *source_href,
+					      const gchar *dest_href,
 					      gboolean delete_original,
-					      char **permanent_url);
+					      gchar **permanent_url);
 
 /* Subscriptions */
 typedef enum {
@@ -177,32 +177,32 @@ typedef enum {
 } E2kContextChangeType;
 
 typedef void (*E2kContextChangeCallback)     (E2kContext *ctx,
-					      const char *uri,
+					      const gchar *uri,
 					      E2kContextChangeType type,
 					      gpointer user_data);
 
 void          e2k_context_subscribe          (E2kContext *ctx,
-					      const char *uri,
+					      const gchar *uri,
 					      E2kContextChangeType type,
-					      int min_interval,
+					      gint min_interval,
 					      E2kContextChangeCallback callback,
 					      gpointer user_data);
 void          e2k_context_unsubscribe        (E2kContext *ctx,
-					      const char *uri);
+					      const gchar *uri);
 
 
 /*
  * Utility functions
  */
 SoupMessage   *e2k_soup_message_new      (E2kContext *ctx,
-					  const char *uri,
-					  const char *method);
+					  const gchar *uri,
+					  const gchar *method);
 SoupMessage   *e2k_soup_message_new_full (E2kContext *ctx,
-					  const char *uri,
-					  const char *method,
-					  const char *content_type,
+					  const gchar *uri,
+					  const gchar *method,
+					  const gchar *content_type,
 					  SoupMemoryUse use,
-					  const char *body,
+					  const gchar *body,
 					  gsize length);
 void           e2k_context_queue_message (E2kContext *ctx,
 					  SoupMessage *msg,
diff --git a/servers/exchange/lib/e2k-freebusy.c b/servers/exchange/lib/e2k-freebusy.c
index f2ca78a..06e8a59 100644
--- a/servers/exchange/lib/e2k-freebusy.c
+++ b/servers/exchange/lib/e2k-freebusy.c
@@ -43,7 +43,7 @@
 void
 e2k_freebusy_destroy (E2kFreebusy *fb)
 {
-	int i;
+	gint i;
 
 	g_object_unref (fb->ctx);
 	for (i = 0; i < E2K_BUSYSTATUS_MAX; i++)
@@ -53,10 +53,10 @@ e2k_freebusy_destroy (E2kFreebusy *fb)
 	g_free (fb);
 }
 
-static char *
-fb_uri_for_dn (const char *public_uri, const char *dn)
+static gchar *
+fb_uri_for_dn (const gchar *public_uri, const gchar *dn)
 {
-	char *uri, *div, *org;
+	gchar *uri, *div, *org;
 	GString *str;
 
 	for (div = strchr (dn, '/'); div; div = strchr (div + 1, '/')) {
@@ -85,7 +85,7 @@ static void
 merge_events (GArray *events)
 {
 	E2kFreebusyEvent evt, evt2;
-	int i;
+	gint i;
 
 	if (events->len < 2)
 		return;
@@ -106,9 +106,9 @@ static void
 add_data_for_status (E2kFreebusy *fb, GPtrArray *monthyears, GPtrArray *fbdatas, GArray *events)
 {
 	E2kFreebusyEvent evt;
-	int i, monthyear;
+	gint i, monthyear;
 	GByteArray *fbdata;
-	unsigned char *p;
+	guchar *p;
 	struct tm tm;
 
 	if (!monthyears || !fbdatas)
@@ -139,7 +139,7 @@ add_data_for_status (E2kFreebusy *fb, GPtrArray *monthyears, GPtrArray *fbdatas,
 	merge_events (events);
 }
 
-static const char *public_freebusy_props[] = {
+static const gchar *public_freebusy_props[] = {
 	PR_FREEBUSY_START_RANGE,
 	PR_FREEBUSY_END_RANGE,
 	PR_FREEBUSY_ALL_MONTHS,
@@ -151,7 +151,7 @@ static const char *public_freebusy_props[] = {
 	PR_FREEBUSY_OOF_MONTHS,
 	PR_FREEBUSY_OOF_EVENTS
 };
-static const int n_public_freebusy_props = sizeof (public_freebusy_props) / sizeof (public_freebusy_props[0]);
+static const gint n_public_freebusy_props = sizeof (public_freebusy_props) / sizeof (public_freebusy_props[0]);
 
 /**
  * e2k_freebusy_new:
@@ -170,14 +170,14 @@ static const int n_public_freebusy_props = sizeof (public_freebusy_props) / size
  * Return value: the freebusy information
  **/
 E2kFreebusy *
-e2k_freebusy_new (E2kContext *ctx, const char *public_uri, const char *dn)
+e2k_freebusy_new (E2kContext *ctx, const gchar *public_uri, const gchar *dn)
 {
 	E2kFreebusy *fb;
-	char *uri, *time;
+	gchar *uri, *time;
 	GPtrArray *monthyears, *fbdatas;
 	E2kHTTPStatus status;
 	E2kResult *results;
-	int nresults = 0, i;
+	gint nresults = 0, i;
 
 	uri = fb_uri_for_dn (public_uri, dn);
 	g_return_val_if_fail (uri, NULL);
@@ -245,11 +245,11 @@ e2k_freebusy_new (E2kContext *ctx, const char *public_uri, const char *dn)
  * to a span of @nmonths around the current date.
  **/
 void
-e2k_freebusy_reset (E2kFreebusy *fb, int nmonths)
+e2k_freebusy_reset (E2kFreebusy *fb, gint nmonths)
 {
 	time_t now;
 	struct tm tm;
-	int i;
+	gint i;
 
 	/* Remove all existing events */
 	for (i = 0; i < E2K_BUSYSTATUS_MAX; i++)
@@ -286,7 +286,7 @@ e2k_freebusy_add_interval (E2kFreebusy *fb, E2kBusyStatus busystatus,
 			   time_t start, time_t end)
 {
 	E2kFreebusyEvent evt, *events;
-	int i;
+	gint i;
 
 	if (busystatus == E2K_BUSYSTATUS_FREE)
 		return;
@@ -339,7 +339,7 @@ void
 e2k_freebusy_clear_interval (E2kFreebusy *fb, time_t start, time_t end)
 {
 	E2kFreebusyEvent *evt;
-	int busystatus, i;
+	gint busystatus, i;
 
 	for (busystatus = 0; busystatus < E2K_BUSYSTATUS_MAX; busystatus++) {
 		for (i = 0; i < fb->events[busystatus]->len; i++) {
@@ -362,12 +362,12 @@ e2k_freebusy_clear_interval (E2kFreebusy *fb, time_t start, time_t end)
 	}
 }
 
-static const char *freebusy_props[] = {
+static const gchar *freebusy_props[] = {
 	E2K_PR_CALENDAR_DTSTART,
 	E2K_PR_CALENDAR_DTEND,
 	E2K_PR_CALENDAR_BUSY_STATUS
 };
-static const int n_freebusy_props = sizeof (freebusy_props) / sizeof (freebusy_props[0]);
+static const gint n_freebusy_props = sizeof (freebusy_props) / sizeof (freebusy_props[0]);
 
 /**
  * e2k_freebusy_add_from_calendar_uri:
@@ -384,10 +384,10 @@ static const int n_freebusy_props = sizeof (freebusy_props) / sizeof (freebusy_p
  * Return value: an HTTP status code.
  **/
 E2kHTTPStatus
-e2k_freebusy_add_from_calendar_uri (E2kFreebusy *fb, const char *uri,
+e2k_freebusy_add_from_calendar_uri (E2kFreebusy *fb, const gchar *uri,
 				    time_t start_tt, time_t end_tt)
 {
-	char *start, *end, *busystatus;
+	gchar *start, *end, *busystatus;
 	E2kBusyStatus busy;
 	E2kRestriction *rn;
 	E2kResultIter *iter;
@@ -445,15 +445,15 @@ e2k_freebusy_add_from_calendar_uri (E2kFreebusy *fb, const char *uri,
 
 static void
 add_events (GArray *events_array, E2kProperties *props,
-	    const char *month_list_prop, const char *data_list_prop)
+	    const gchar *month_list_prop, const gchar *data_list_prop)
 {
 	E2kFreebusyEvent *events = (E2kFreebusyEvent *)events_array->data;
-	int i, evt_start, evt_end, monthyear;
+	gint i, evt_start, evt_end, monthyear;
 	struct tm start_tm, end_tm;
 	time_t start, end;
 	GPtrArray *monthyears, *datas;
 	GByteArray *data;
-	char startend[4];
+	gchar startend[4];
 
 	if (!events_array->len) {
 		e2k_properties_remove (props, month_list_prop);
@@ -524,7 +524,7 @@ E2kHTTPStatus
 e2k_freebusy_save (E2kFreebusy *fb)
 {
 	E2kProperties *props;
-	char *timestamp;
+	gchar *timestamp;
 	E2kHTTPStatus status;
 
 	props = e2k_properties_new ();
diff --git a/servers/exchange/lib/e2k-freebusy.h b/servers/exchange/lib/e2k-freebusy.h
index 70d9503..cc9ca4d 100644
--- a/servers/exchange/lib/e2k-freebusy.h
+++ b/servers/exchange/lib/e2k-freebusy.h
@@ -31,7 +31,7 @@ typedef struct {
 typedef struct {
 	/*< private >*/
 	E2kContext *ctx;
-	char *dn, *uri;
+	gchar *dn, *uri;
 
 	time_t start, end;
 
@@ -39,11 +39,11 @@ typedef struct {
 } E2kFreebusy;
 
 E2kFreebusy   *e2k_freebusy_new                   (E2kContext      *ctx,
-						   const char      *public_uri,
-						   const char      *dn);
+						   const gchar      *public_uri,
+						   const gchar      *dn);
 
 void           e2k_freebusy_reset                 (E2kFreebusy     *fb,
-						   int              nmonths);
+						   gint              nmonths);
 
 void           e2k_freebusy_add_interval          (E2kFreebusy     *fb,
 						   E2kBusyStatus    busystatus,
@@ -54,7 +54,7 @@ void           e2k_freebusy_clear_interval        (E2kFreebusy     *fb,
 						   time_t           end);
 
 E2kHTTPStatus  e2k_freebusy_add_from_calendar_uri (E2kFreebusy     *fb,
-						   const char      *uri,
+						   const gchar      *uri,
 						   time_t           start_tt,
 						   time_t           end_tt);
 
diff --git a/servers/exchange/lib/e2k-global-catalog-ldap.h b/servers/exchange/lib/e2k-global-catalog-ldap.h
index 8077f57..070f2ac 100644
--- a/servers/exchange/lib/e2k-global-catalog-ldap.h
+++ b/servers/exchange/lib/e2k-global-catalog-ldap.h
@@ -27,7 +27,7 @@ extern "C" {
 
 LDAP             *e2k_global_catalog_get_ldap        (E2kGlobalCatalog *gc,
 						      E2kOperation     *op,
-						      int              *ldap_error);
+						      gint              *ldap_error);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/lib/e2k-global-catalog.c b/servers/exchange/lib/e2k-global-catalog.c
index 4f0827c..5718237 100644
--- a/servers/exchange/lib/e2k-global-catalog.c
+++ b/servers/exchange/lib/e2k-global-catalog.c
@@ -48,7 +48,7 @@ struct _E2kGlobalCatalogPrivate {
 	GPtrArray *entries;
 	GHashTable *entry_cache, *server_cache;
 
-	char *server, *user, *nt_domain, *password;
+	gchar *server, *user, *nt_domain, *password;
 	E2kAutoconfigGalAuthPref auth;
 };
 
@@ -56,14 +56,14 @@ struct _E2kGlobalCatalogPrivate {
 static GObjectClass *parent_class = NULL;
 
 static void finalize (GObject *);
-static int get_gc_connection (E2kGlobalCatalog *gc, E2kOperation *op);
+static gint get_gc_connection (E2kGlobalCatalog *gc, E2kOperation *op);
 
 
 static void
 class_init (GObjectClass *object_class)
 {
 #ifdef E2K_DEBUG
-	char *e2k_debug = getenv ("E2K_DEBUG");
+	gchar *e2k_debug = getenv ("E2K_DEBUG");
 
 	if (e2k_debug && atoi (e2k_debug) > 3)
 		e2k_gc_debug = TRUE;
@@ -97,7 +97,7 @@ init (GObject *object)
 static void
 free_entry (E2kGlobalCatalogEntry *entry)
 {
-	int i;
+	gint i;
 
 	g_free (entry->dn);
 	g_free (entry->display_name);
@@ -133,7 +133,7 @@ static void
 finalize (GObject *object)
 {
 	E2kGlobalCatalog *gc = E2K_GLOBAL_CATALOG (object);
-	int i;
+	gint i;
 
 	if (gc->priv) {
 		if (gc->priv->ldap)
@@ -171,10 +171,10 @@ E2K_MAKE_TYPE (e2k_global_catalog, E2kGlobalCatalog, class_init, init, PARENT_TY
 
 static int
 gc_ldap_result (LDAP *ldap, E2kOperation *op,
-		int msgid, LDAPMessage **msg)
+		gint msgid, LDAPMessage **msg)
 {
 	struct timeval tv;
-	int status, ldap_error;
+	gint status, ldap_error;
 
 	tv.tv_sec = 1;
 	tv.tv_usec = 0;
@@ -197,17 +197,17 @@ gc_ldap_result (LDAP *ldap, E2kOperation *op,
 
 static int
 gc_search (E2kGlobalCatalog *gc, E2kOperation *op,
-	   const char *base, int scope, const char *filter,
-	   const char **attrs, LDAPMessage **msg)
+	   const gchar *base, gint scope, const gchar *filter,
+	   const gchar **attrs, LDAPMessage **msg)
 {
-	int ldap_error, msgid, try;
+	gint ldap_error, msgid, try;
 
 	for (try = 0; try < 2; try++) {
 		ldap_error = get_gc_connection (gc, op);
 		if (ldap_error != LDAP_SUCCESS)
 			return ldap_error;
 		ldap_error = ldap_search_ext (gc->priv->ldap, base, scope,
-					      filter, (char **)attrs,
+					      filter, (gchar **)attrs,
 					      FALSE, NULL, NULL, NULL, 0,
 					      &msgid);
 		if (ldap_error == LDAP_SERVER_DOWN)
@@ -232,8 +232,8 @@ static int
 ntlm_bind (E2kGlobalCatalog *gc, E2kOperation *op, LDAP *ldap)
 {
 	LDAPMessage *msg;
-	int ldap_error, msgid, err;
-	char *nonce, *default_domain;
+	gint ldap_error, msgid, err;
+	gchar *nonce, *default_domain;
 	GByteArray *ba;
 	struct berval ldap_buf;
 
@@ -307,8 +307,8 @@ ntlm_bind (E2kGlobalCatalog *gc, E2kOperation *op, LDAP *ldap)
 static int
 connect_ldap (E2kGlobalCatalog *gc, E2kOperation *op, LDAP *ldap)
 {
-	int ldap_error;
-	char *nt_name;
+	gint ldap_error;
+	gchar *nt_name;
 #ifdef G_OS_WIN32
 	SEC_WINNT_AUTH_IDENTITY_W auth;
 #endif
@@ -365,10 +365,10 @@ connect_ldap (E2kGlobalCatalog *gc, E2kOperation *op, LDAP *ldap)
 
 static int
 get_ldap_connection (E2kGlobalCatalog *gc, E2kOperation *op,
-		     const char *server, int port,
+		     const gchar *server, gint port,
 		     LDAP **ldap)
 {
-	int ldap_opt, ldap_error;
+	gint ldap_opt, ldap_error;
 
 	E2K_GC_DEBUG_MSG(("\nGC: Connecting to ldap://%s:%d/\n";, server, port));
 
@@ -399,7 +399,7 @@ get_ldap_connection (E2kGlobalCatalog *gc, E2kOperation *op,
 static int
 get_gc_connection (E2kGlobalCatalog *gc, E2kOperation *op)
 {
-	int err;
+	gint err;
 
 	if (gc->priv->ldap) {
 		ldap_get_option (gc->priv->ldap, LDAP_OPT_ERROR_NUMBER, &err);
@@ -426,10 +426,10 @@ get_gc_connection (E2kGlobalCatalog *gc, E2kOperation *op)
  * Return value: an LDAP handle, or %NULL if it can't connect
  **/
 LDAP *
-e2k_global_catalog_get_ldap (E2kGlobalCatalog *gc, E2kOperation *op, int *ldap_error)
+e2k_global_catalog_get_ldap (E2kGlobalCatalog *gc, E2kOperation *op, gint *ldap_error)
 {
 	LDAP *ldap;
-	int err;
+	gint err;
 
 	g_return_val_if_fail (E2K_IS_GLOBAL_CATALOG (gc), NULL);
 
@@ -456,9 +456,9 @@ e2k_global_catalog_get_ldap (E2kGlobalCatalog *gc, E2kOperation *op, int *ldap_e
  * If the passed-in data is bad, it will fail on a later call.)
  **/
 E2kGlobalCatalog *
-e2k_global_catalog_new (const char *server, int response_limit,
-			const char *user, const char *domain,
-			const char *password, E2kAutoconfigGalAuthPref use_auth)
+e2k_global_catalog_new (const gchar *server, gint response_limit,
+			const gchar *user, const gchar *domain,
+			const gchar *password, E2kAutoconfigGalAuthPref use_auth)
 {
 	E2kGlobalCatalog *gc;
 
@@ -473,13 +473,13 @@ e2k_global_catalog_new (const char *server, int response_limit,
 	return gc;
 }
 
-static const char *
-lookup_mta (E2kGlobalCatalog *gc, E2kOperation *op, const char *mta_dn)
+static const gchar *
+lookup_mta (E2kGlobalCatalog *gc, E2kOperation *op, const gchar *mta_dn)
 {
-	char *hostname, **values;
-	const char *attrs[2];
+	gchar *hostname, **values;
+	const gchar *attrs[2];
 	LDAPMessage *resp;
-	int ldap_error, i;
+	gint ldap_error, i;
 
 	/* Skip over "CN=Microsoft MTA," */
 	mta_dn = strchr (mta_dn, ',');
@@ -536,7 +536,7 @@ static void
 get_sid_values (E2kGlobalCatalog *gc, E2kOperation *op,
 		LDAPMessage *msg, E2kGlobalCatalogEntry *entry)
 {
-	char **values;
+	gchar **values;
 	struct berval **bsid_values;
 	E2kSidType type;
 
@@ -577,7 +577,7 @@ static void
 get_mail_values (E2kGlobalCatalog *gc, E2kOperation *op,
 		 LDAPMessage *msg, E2kGlobalCatalogEntry *entry)
 {
-	char **values, **mtavalues;
+	gchar **values, **mtavalues;
 
 	values = ldap_get_values (gc->priv->ldap, msg, "mail");
 	if (values) {
@@ -594,7 +594,7 @@ get_mail_values (E2kGlobalCatalog *gc, E2kOperation *op,
 	if (values && mtavalues) {
 		E2K_GC_DEBUG_MSG(("GC: mailNickname %s\n", values[0]));
 		E2K_GC_DEBUG_MSG(("GC: homeMTA %s\n", mtavalues[0]));
-		entry->exchange_server = (char *)lookup_mta (gc, op, mtavalues[0]);
+		entry->exchange_server = (gchar *)lookup_mta (gc, op, mtavalues[0]);
 		ldap_value_free (mtavalues);
 		if (entry->exchange_server)
 			entry->mailbox = g_strdup (values[0]);
@@ -618,8 +618,8 @@ static void
 get_delegation_values (E2kGlobalCatalog *gc, E2kOperation *op,
 		       LDAPMessage *msg, E2kGlobalCatalogEntry *entry)
 {
-	char **values;
-	int i;
+	gchar **values;
+	gint i;
 
 	values = ldap_get_values (gc->priv->ldap, msg, "publicDelegates");
 	if (values) {
@@ -651,7 +651,7 @@ static void
 get_quota_values (E2kGlobalCatalog *gc, E2kOperation *op,
 		  LDAPMessage *msg, E2kGlobalCatalogEntry *entry)
 {
-	char **quota_setting_values, **quota_limit_values;
+	gchar **quota_setting_values, **quota_limit_values;
 
 	/* Check if mailbox store default values are used */
 	quota_setting_values = ldap_get_values (gc->priv->ldap, msg, "mDBUseDefaults");
@@ -695,7 +695,7 @@ static void
 get_account_control_values (E2kGlobalCatalog *gc, E2kOperation *op,
 			    LDAPMessage *msg, E2kGlobalCatalogEntry *entry)
 {
-	char **values;
+	gchar **values;
 
 	values = ldap_get_values (gc->priv->ldap, msg, "userAccountControl");
 	if (values) {
@@ -725,16 +725,16 @@ E2kGlobalCatalogStatus
 e2k_global_catalog_lookup (E2kGlobalCatalog *gc,
 			   E2kOperation *op,
 			   E2kGlobalCatalogLookupType type,
-			   const char *key,
+			   const gchar *key,
 			   E2kGlobalCatalogLookupFlags flags,
 			   E2kGlobalCatalogEntry **entry_p)
 {
 	E2kGlobalCatalogEntry *entry;
 	GPtrArray *attrs;
 	E2kGlobalCatalogLookupFlags lookup_flags, need_flags = 0;
-	const char *base = NULL;
-	char *filter = NULL, *dn;
-	int scope = LDAP_SCOPE_BASE, ldap_error;
+	const gchar *base = NULL;
+	gchar *filter = NULL, *dn;
+	gint scope = LDAP_SCOPE_BASE, ldap_error;
 	E2kGlobalCatalogStatus status;
 	LDAPMessage *msg, *resp;
 
@@ -816,7 +816,7 @@ e2k_global_catalog_lookup (E2kGlobalCatalog *gc,
 	}
 
 	ldap_error = gc_search (gc, op, base, scope, filter,
-				(const char **)attrs->pdata, &msg);
+				(const gchar **)attrs->pdata, &msg);
 	if (ldap_error == LDAP_USER_CANCELLED) {
 		E2K_GC_DEBUG_MSG(("GC: ldap_search cancelled"));
 		status = E2K_GLOBAL_CATALOG_CANCELLED;
@@ -883,7 +883,7 @@ struct async_lookup_data {
 	E2kGlobalCatalog *gc;
 	E2kOperation *op;
 	E2kGlobalCatalogLookupType type;
-	char *key;
+	gchar *key;
 	E2kGlobalCatalogLookupFlags flags;
 	E2kGlobalCatalogCallback callback;
 	gpointer user_data;
@@ -904,8 +904,8 @@ idle_lookup_result (gpointer user_data)
 	return FALSE;
 }
 
-static void *
-do_lookup_thread (void *user_data)
+static gpointer
+do_lookup_thread (gpointer user_data)
 {
 	struct async_lookup_data *ald = user_data;
 
@@ -933,7 +933,7 @@ void
 e2k_global_catalog_async_lookup (E2kGlobalCatalog *gc,
 				 E2kOperation *op,
 				 E2kGlobalCatalogLookupType type,
-				 const char *key,
+				 const gchar *key,
 				 E2kGlobalCatalogLookupFlags flags,
 				 E2kGlobalCatalogCallback callback,
 				 gpointer user_data)
@@ -957,14 +957,14 @@ e2k_global_catalog_async_lookup (E2kGlobalCatalog *gc,
 	}
 }
 
-static const char *
+static const gchar *
 lookup_controlling_ad_server (E2kGlobalCatalog *gc, E2kOperation *op,
-			      const char *dn)
+			      const gchar *dn)
 {
-	char *hostname, **values, *ad_dn;
-	const char *attrs[2];
+	gchar *hostname, **values, *ad_dn;
+	const gchar *attrs[2];
 	LDAPMessage *resp;
-	int ldap_error;
+	gint ldap_error;
 
 	while (g_ascii_strncasecmp (dn, "DC=", 3) != 0) {
 		dn = strchr (dn, ',');
@@ -1032,11 +1032,11 @@ lookup_controlling_ad_server (E2kGlobalCatalog *gc, E2kOperation *op,
 }
 
 static gchar *
-find_domain_dn (char *domain)
+find_domain_dn (gchar *domain)
 {
 	GString *dn_value = g_string_new (NULL);
 	gchar *dn;
-	char  *sub_domain=NULL;
+	gchar  *sub_domain=NULL;
 
 	sub_domain = strtok (domain, ".");
 	while (sub_domain != NULL) {
@@ -1056,11 +1056,11 @@ find_domain_dn (char *domain)
 double
 lookup_passwd_max_age (E2kGlobalCatalog *gc, E2kOperation *op)
 {
-	char **values = NULL, *filter = NULL, *val=NULL;
-	const char *attrs[2];
+	gchar **values = NULL, *filter = NULL, *val=NULL;
+	const gchar *attrs[2];
 	LDAP *ldap;
 	LDAPMessage *msg=NULL;
-	int ldap_error, msgid;
+	gint ldap_error, msgid;
 	double maxAge=0;
 	gchar *dn=NULL;
 
@@ -1078,7 +1078,7 @@ lookup_passwd_max_age (E2kGlobalCatalog *gc, E2kOperation *op)
 		return -1;
 	}
 
-	ldap_error = ldap_search_ext (ldap, dn, LDAP_SCOPE_BASE, filter, (char **)attrs,
+	ldap_error = ldap_search_ext (ldap, dn, LDAP_SCOPE_BASE, filter, (gchar **)attrs,
 				      FALSE, NULL, NULL, NULL, 0, &msgid);
 	if (!ldap_error) {
 		ldap_error = gc_ldap_result (ldap, op, msgid, &msg);
@@ -1120,14 +1120,14 @@ lookup_passwd_max_age (E2kGlobalCatalog *gc, E2kOperation *op)
 }
 
 static E2kGlobalCatalogStatus
-do_delegate_op (E2kGlobalCatalog *gc, E2kOperation *op, int deleg_op,
-		const char *self_dn, const char *delegate_dn)
+do_delegate_op (E2kGlobalCatalog *gc, E2kOperation *op, gint deleg_op,
+		const gchar *self_dn, const gchar *delegate_dn)
 {
 	LDAP *ldap;
 	LDAPMod *mods[2], mod;
-	const char *ad_server;
-	char *values[2];
-	int ldap_error, msgid;
+	const gchar *ad_server;
+	gchar *values[2];
+	gint ldap_error, msgid;
 
 	g_return_val_if_fail (E2K_IS_GLOBAL_CATALOG (gc), E2K_GLOBAL_CATALOG_ERROR);
 	g_return_val_if_fail (self_dn != NULL, E2K_GLOBAL_CATALOG_ERROR);
@@ -1150,7 +1150,7 @@ do_delegate_op (E2kGlobalCatalog *gc, E2kOperation *op, int deleg_op,
 	mod.mod_op = deleg_op;
 	mod.mod_type = "publicDelegates";
 	mod.mod_values = values;
-	values[0] = (char *)delegate_dn;
+	values[0] = (gchar *)delegate_dn;
 	values[1] = NULL;
 
 	mods[0] = &mod;
@@ -1217,8 +1217,8 @@ do_delegate_op (E2kGlobalCatalog *gc, E2kOperation *op, int deleg_op,
 E2kGlobalCatalogStatus
 e2k_global_catalog_add_delegate (E2kGlobalCatalog *gc,
 				 E2kOperation *op,
-				 const char *self_dn,
-				 const char *delegate_dn)
+				 const gchar *self_dn,
+				 const gchar *delegate_dn)
 {
 	E2K_GC_DEBUG_MSG(("\nGC: adding %s as delegate for %s\n", delegate_dn, self_dn));
 
@@ -1242,8 +1242,8 @@ e2k_global_catalog_add_delegate (E2kGlobalCatalog *gc,
 E2kGlobalCatalogStatus
 e2k_global_catalog_remove_delegate (E2kGlobalCatalog *gc,
 				    E2kOperation *op,
-				    const char *self_dn,
-				    const char *delegate_dn)
+				    const gchar *self_dn,
+				    const gchar *delegate_dn)
 {
 	E2K_GC_DEBUG_MSG(("\nGC: removing %s as delegate for %s\n", delegate_dn, self_dn));
 
diff --git a/servers/exchange/lib/e2k-global-catalog.h b/servers/exchange/lib/e2k-global-catalog.h
index daf305b..f876d5a 100644
--- a/servers/exchange/lib/e2k-global-catalog.h
+++ b/servers/exchange/lib/e2k-global-catalog.h
@@ -23,8 +23,8 @@ extern "C" {
 struct _E2kGlobalCatalog {
 	GObject parent;
 
-	char *domain;
-	int response_limit;
+	gchar *domain;
+	gint response_limit;
 
 	E2kGlobalCatalogPrivate *priv;
 };
@@ -35,11 +35,11 @@ struct _E2kGlobalCatalogClass {
 };
 
 GType             e2k_global_catalog_get_type        (void);
-E2kGlobalCatalog *e2k_global_catalog_new             (const char *server,
-						      int response_limit,
-						      const char *user,
-						      const char *domain,
-						      const char *password,
+E2kGlobalCatalog *e2k_global_catalog_new             (const gchar *server,
+						      gint response_limit,
+						      const gchar *user,
+						      const gchar *domain,
+						      const gchar *password,
 						      E2kAutoconfigGalAuthPref use_auth);
 
 
@@ -72,12 +72,12 @@ typedef enum {
 } E2kGlobalCatalogLookupFlags;
 
 typedef struct {
-	char *dn, *display_name;
+	gchar *dn, *display_name;
 	E2kSid *sid;
-	char *email, *exchange_server, *mailbox, *legacy_exchange_dn;
+	gchar *email, *exchange_server, *mailbox, *legacy_exchange_dn;
 	GPtrArray *delegates, *delegators;
-	int quota_warn, quota_nosend, quota_norecv;
-	int user_account_control;
+	gint quota_warn, quota_nosend, quota_norecv;
+	gint user_account_control;
 
 	E2kGlobalCatalogLookupFlags mask;
 } E2kGlobalCatalogEntry;
@@ -85,7 +85,7 @@ typedef struct {
 E2kGlobalCatalogStatus e2k_global_catalog_lookup (E2kGlobalCatalog *gc,
 						  E2kOperation     *op,
 						  E2kGlobalCatalogLookupType type,
-						  const char *key,
+						  const gchar *key,
 						  E2kGlobalCatalogLookupFlags flags,
 						  E2kGlobalCatalogEntry **entry_p);
 
@@ -97,7 +97,7 @@ typedef void         (*E2kGlobalCatalogCallback) (E2kGlobalCatalog *gc,
 void             e2k_global_catalog_async_lookup (E2kGlobalCatalog *gc,
 						  E2kOperation     *op,
 						  E2kGlobalCatalogLookupType type,
-						  const char *key,
+						  const gchar *key,
 						  E2kGlobalCatalogLookupFlags flags,
 						  E2kGlobalCatalogCallback callback,
 						  gpointer user_data);
@@ -110,12 +110,12 @@ double		lookup_passwd_max_age (E2kGlobalCatalog *gc,
 
 E2kGlobalCatalogStatus e2k_global_catalog_add_delegate    (E2kGlobalCatalog *gc,
 							   E2kOperation     *op,
-							   const char *self_dn,
-							   const char *delegate_dn);
+							   const gchar *self_dn,
+							   const gchar *delegate_dn);
 E2kGlobalCatalogStatus e2k_global_catalog_remove_delegate (E2kGlobalCatalog *gc,
 							   E2kOperation     *op,
-							   const char *self_dn,
-							   const char *delegate_dn);
+							   const gchar *self_dn,
+							   const gchar *delegate_dn);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/lib/e2k-http-utils.c b/servers/exchange/lib/e2k-http-utils.c
index 17f333b..56da368 100644
--- a/servers/exchange/lib/e2k-http-utils.c
+++ b/servers/exchange/lib/e2k-http-utils.c
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-extern const char *e2k_rfc822_months [];
+extern const gchar *e2k_rfc822_months [];
 
 /**
  * e2k_http_parse_date:
@@ -43,16 +43,16 @@ extern const char *e2k_rfc822_months [];
  * Return value: a %time_t corresponding to @date.
  **/
 time_t
-e2k_http_parse_date (const char *date)
+e2k_http_parse_date (const gchar *date)
 {
 	struct tm tm;
-	char *p;
+	gchar *p;
 
 	if (strlen (date) < 29 || date[3] != ',' || date[4] != ' ')
 		return -1;
 
 	memset (&tm, 0, sizeof (tm));
-	p = (char *)date + 5;
+	p = (gchar *)date + 5;
 
 	tm.tm_mday = strtol (p, &p, 10);
 	p++;
@@ -82,7 +82,7 @@ e2k_http_parse_date (const char *date)
  * Return value: the Status-Code portion of @status_line
  **/
 E2kHTTPStatus
-e2k_http_parse_status (const char *status_line)
+e2k_http_parse_status (const gchar *status_line)
 {
 	if (strncmp (status_line, "HTTP/1.", 7) != 0 ||
 	    !isdigit (status_line[7]) ||
@@ -107,15 +107,15 @@ e2k_http_parse_status (const char *status_line)
  *
  * Return value: an Accept-Language string.
  **/
-const char *
+const gchar *
 e2k_http_accept_language (void)
 {
-	static char *accept = NULL;
+	static gchar *accept = NULL;
 
 	if (!accept) {
 		GString *buf;
-		const char *lang, *sub;
-		int baselen;
+		const gchar *lang, *sub;
+		gint baselen;
 
 		buf = g_string_new (NULL);
 
@@ -154,17 +154,17 @@ e2k_http_accept_language (void)
 }
 
 typedef struct {
-	const char *wanted_header;
+	const gchar *wanted_header;
 	GSList *matches;
 } GetHeadersData;
 
 static void
-maybe_append_header (const char *header_name, const char *value, gpointer data)
+maybe_append_header (const gchar *header_name, const gchar *value, gpointer data)
 {
 	GetHeadersData *ghd = data;
 
 	if (!g_ascii_strcasecmp (header_name, ghd->wanted_header))
-		ghd->matches = g_slist_append (ghd->matches, (char *)value);
+		ghd->matches = g_slist_append (ghd->matches, (gchar *)value);
 }
 
 /* This is a cheat to recreate the behavior of libsoup 2.2's
@@ -173,7 +173,7 @@ maybe_append_header (const char *header_name, const char *value, gpointer data)
  * be doing this...
  */
 GSList *
-e2k_http_get_headers (SoupMessageHeaders *hdrs, const char *header_name)
+e2k_http_get_headers (SoupMessageHeaders *hdrs, const gchar *header_name)
 {
 	GetHeadersData ghd;
 
diff --git a/servers/exchange/lib/e2k-http-utils.h b/servers/exchange/lib/e2k-http-utils.h
index 1f3f8c5..eda30c6 100644
--- a/servers/exchange/lib/e2k-http-utils.h
+++ b/servers/exchange/lib/e2k-http-utils.h
@@ -9,15 +9,15 @@
 #include <libsoup/soup-status.h>
 #include <libsoup/soup-message-headers.h>
 
-typedef unsigned int E2kHTTPStatus;
+typedef guint E2kHTTPStatus;
 
-time_t         e2k_http_parse_date      (const char *date);
-E2kHTTPStatus  e2k_http_parse_status    (const char *status_line);
+time_t         e2k_http_parse_date      (const gchar *date);
+E2kHTTPStatus  e2k_http_parse_status    (const gchar *status_line);
 
-const char    *e2k_http_accept_language (void);
+const gchar    *e2k_http_accept_language (void);
 
 GSList        *e2k_http_get_headers     (SoupMessageHeaders *hdrs,
-					 const char         *header_name);
+					 const gchar         *header_name);
 
 #define E2K_HTTP_STATUS_IS_TRANSPORT_ERROR(status) SOUP_STATUS_IS_TRANSPORT_ERROR(status)
 #define E2K_HTTP_CANCELLED                         SOUP_STATUS_CANCELLED
diff --git a/servers/exchange/lib/e2k-kerberos.c b/servers/exchange/lib/e2k-kerberos.c
index b4f8810..bf1a99e 100644
--- a/servers/exchange/lib/e2k-kerberos.c
+++ b/servers/exchange/lib/e2k-kerberos.c
@@ -31,10 +31,10 @@
 #include <krb5.h>
 
 static krb5_context
-e2k_kerberos_context_new (const char *domain)
+e2k_kerberos_context_new (const gchar *domain)
 {
 	krb5_context ctx;
-	char *realm;
+	gchar *realm;
 
 	if (krb5_init_context (&ctx) != 0)
 		return NULL;
@@ -47,7 +47,7 @@ e2k_kerberos_context_new (const char *domain)
 }
 
 static E2kKerberosResult
-krb5_result_to_e2k_kerberos_result (int result)
+krb5_result_to_e2k_kerberos_result (gint result)
 {
 	switch (result) {
 	case 0:
@@ -76,8 +76,8 @@ krb5_result_to_e2k_kerberos_result (int result)
 }
 
 static E2kKerberosResult
-get_init_cred (krb5_context ctx, const char *usr_name, const char *passwd,
-	       const char *in_tkt_service, krb5_creds *cred)
+get_init_cred (krb5_context ctx, const gchar *usr_name, const gchar *passwd,
+	       const gchar *in_tkt_service, krb5_creds *cred)
 {
 	krb5_principal principal;
 	krb5_get_init_creds_opt opt;
@@ -94,9 +94,9 @@ get_init_cred (krb5_context ctx, const char *usr_name, const char *passwd,
 	krb5_get_init_creds_opt_set_proxiable (&opt, 0);
 
 	result = krb5_get_init_creds_password (ctx, cred, principal,
-					       (char *) passwd,
+					       (gchar *) passwd,
 					       NULL, NULL, 0,
-					       (char *) in_tkt_service, &opt);
+					       (gchar *) in_tkt_service, &opt);
 	krb5_free_principal (ctx, principal);
 
 	return krb5_result_to_e2k_kerberos_result (result);
@@ -114,14 +114,14 @@ get_init_cred (krb5_context ctx, const char *usr_name, const char *passwd,
  * Return value: an #E2kKerberosResult
  **/
 E2kKerberosResult
-e2k_kerberos_change_password (const char *user, const char *domain,
-			      const char *old_password, const char *new_password)
+e2k_kerberos_change_password (const gchar *user, const gchar *domain,
+			      const gchar *old_password, const gchar *new_password)
 {
 	krb5_context ctx;
 	krb5_creds creds;
 	krb5_data res_code_string, res_string;
 	E2kKerberosResult result;
-	int res_code;
+	gint res_code;
 
 	ctx = e2k_kerberos_context_new (domain);
 	if (!ctx)
@@ -134,7 +134,7 @@ e2k_kerberos_change_password (const char *user, const char *domain,
 		return result;
 	}
 
-	result = krb5_change_password (ctx, &creds, (char *)new_password,
+	result = krb5_change_password (ctx, &creds, (gchar *)new_password,
 				       &res_code, &res_code_string, &res_string);
 	krb5_free_cred_contents (ctx, &creds);
 	krb5_free_data_contents (ctx, &res_code_string);
@@ -162,8 +162,8 @@ e2k_kerberos_change_password (const char *user, const char *domain,
  * or %E2K_KERBEROS_FAILED (for unknown errors)
  **/
 E2kKerberosResult
-e2k_kerberos_check_password (const char *user, const char *domain,
-			     const char *password)
+e2k_kerberos_check_password (const gchar *user, const gchar *domain,
+			     const gchar *password)
 {
 	krb5_context ctx;
 	krb5_creds creds;
diff --git a/servers/exchange/lib/e2k-kerberos.h b/servers/exchange/lib/e2k-kerberos.h
index aec7e31..b0cba0e 100644
--- a/servers/exchange/lib/e2k-kerberos.h
+++ b/servers/exchange/lib/e2k-kerberos.h
@@ -22,14 +22,14 @@ typedef enum {
 	E2K_KERBEROS_FAILED
 } E2kKerberosResult;
 
-E2kKerberosResult e2k_kerberos_check_password  (const char *user,
-						const char *domain,
-						const char *password);
-
-E2kKerberosResult e2k_kerberos_change_password (const char *user,
-						const char *domain,
-						const char *old_password,
-						const char *new_password);
+E2kKerberosResult e2k_kerberos_check_password  (const gchar *user,
+						const gchar *domain,
+						const gchar *password);
+
+E2kKerberosResult e2k_kerberos_change_password (const gchar *user,
+						const gchar *domain,
+						const gchar *old_password,
+						const gchar *new_password);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/lib/e2k-path.c b/servers/exchange/lib/e2k-path.c
index 7a47600..9c650e6 100644
--- a/servers/exchange/lib/e2k-path.c
+++ b/servers/exchange/lib/e2k-path.c
@@ -48,14 +48,14 @@
  *
  * 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++;
@@ -125,11 +125,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) {
@@ -155,9 +155,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)
@@ -198,7 +198,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)
 {
@@ -219,10 +219,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);
diff --git a/servers/exchange/lib/e2k-path.h b/servers/exchange/lib/e2k-path.h
index eaeeff3..c6d43c6 100644
--- a/servers/exchange/lib/e2k-path.h
+++ b/servers/exchange/lib/e2k-path.h
@@ -25,15 +25,15 @@
 /* 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);
 #endif /* __E_PATH__ */
diff --git a/servers/exchange/lib/e2k-properties.c b/servers/exchange/lib/e2k-properties.c
index 3605ea4..af30169 100644
--- a/servers/exchange/lib/e2k-properties.c
+++ b/servers/exchange/lib/e2k-properties.c
@@ -36,9 +36,9 @@ struct E2kProperties {
 };
 
 typedef struct {
-	char *name;
-	const char *namespace;
-	const char *short_name;
+	gchar *name;
+	const gchar *namespace;
+	const gchar *short_name;
 
 	E2kPropType type;
 	guint32 proptag;
@@ -69,7 +69,7 @@ e2k_properties_new (void)
 static void
 copy_prop (gpointer key, gpointer value, gpointer data)
 {
-	const char *name = key;
+	const gchar *name = key;
 	GHashTable *props_copy = data;
 	gpointer value_copy;
 	E2kPropInfo *pi;
@@ -83,7 +83,7 @@ copy_prop (gpointer key, gpointer value, gpointer data)
 	{
 		GPtrArray *orig = value, *copy;
 		GByteArray *new, *old;
-		int i;
+		gint i;
 
 		copy = g_ptr_array_new ();
 		for (i = 0; i < orig->len; i++) {
@@ -99,7 +99,7 @@ copy_prop (gpointer key, gpointer value, gpointer data)
 	case E2K_PROP_TYPE_STRING_ARRAY:
 	{
 		GPtrArray *orig = value, *copy;
-		int i;
+		gint i;
 
 		copy = g_ptr_array_new ();
 		for (i = 0; i < orig->len; i++)
@@ -162,7 +162,7 @@ free_prop (E2kPropInfo *pi, gpointer value)
 	case E2K_PROP_TYPE_BINARY_ARRAY:
 	{
 		GPtrArray *array = value;
-		int i;
+		gint i;
 
 		for (i = 0; i < array->len; i++)
 			g_byte_array_free (array->pdata[i], TRUE);
@@ -174,7 +174,7 @@ free_prop (E2kPropInfo *pi, gpointer value)
 	case E2K_PROP_TYPE_INT_ARRAY:
 	{
 		GPtrArray *array = value;
-		int i;
+		gint i;
 
 		for (i = 0; i < array->len; i++)
 			g_free (array->pdata[i]);
@@ -238,7 +238,7 @@ e2k_properties_free (E2kProperties *props)
  * @props.
  **/
 gpointer
-e2k_properties_get_prop (E2kProperties *props, const char *propname)
+e2k_properties_get_prop (E2kProperties *props, const gchar *propname)
 {
 	g_return_val_if_fail (props != NULL, NULL);
 
@@ -263,10 +263,10 @@ e2k_properties_empty (E2kProperties *props)
 }
 
 
-extern char e2k_des_key[8];
+extern gchar e2k_des_key[8];
 
 static E2kPropInfo *
-get_propinfo (const char *propname, E2kPropType type)
+get_propinfo (const gchar *propname, E2kPropType type)
 {
 	E2kPropInfo *pi;
 
@@ -400,7 +400,7 @@ get_propinfo (const char *propname, E2kPropType type)
 #define E2K_PROPERTIES_SETTER(fname, valuetype, pitype, data)		\
 void									\
 e2k_properties_set_ ## fname (E2kProperties *props,			\
-			      const char    *propname,			\
+			      const gchar    *propname,			\
 			      valuetype      value)			\
 {									\
 	E2kPropInfo *pi;						\
@@ -411,7 +411,7 @@ e2k_properties_set_ ## fname (E2kProperties *props,			\
 	g_hash_table_remove (props->removed, pi->name);			\
 }
 
-E2K_PROPERTIES_SETTER (string, char *, STRING, value)
+E2K_PROPERTIES_SETTER (string, gchar *, STRING, value)
 E2K_PROPERTIES_SETTER (string_array, GPtrArray *, STRING_ARRAY, value)
 E2K_PROPERTIES_SETTER (binary, GByteArray *, BINARY, value)
 E2K_PROPERTIES_SETTER (binary_array, GPtrArray *, BINARY_ARRAY, value)
@@ -421,7 +421,7 @@ E2K_PROPERTIES_SETTER (int, int, INT, g_strdup_printf ("%d", value))
 E2K_PROPERTIES_SETTER (int_array, GPtrArray *, INT_ARRAY, value)
 E2K_PROPERTIES_SETTER (float, float, FLOAT, g_strdup_printf ("%f", value))
 E2K_PROPERTIES_SETTER (bool, gboolean, BOOL, g_strdup_printf ("%d", value != FALSE))
-E2K_PROPERTIES_SETTER (date, char *, DATE, value)
+E2K_PROPERTIES_SETTER (date, gchar *, DATE, value)
 
 
 
@@ -450,7 +450,7 @@ E2K_PROPERTIES_SETTER (date, char *, DATE, value)
 #define E2K_PROPERTIES_SETTER_AS(fname, valuetype)			\
 void									\
 e2k_properties_set_type_as_ ## fname (E2kProperties *props,		\
-				      const char    *propname,		\
+				      const gchar    *propname,		\
 				      E2kPropType    type,		\
 				      valuetype      value)		\
 {									\
@@ -462,7 +462,7 @@ e2k_properties_set_type_as_ ## fname (E2kProperties *props,		\
 	g_hash_table_remove (props->removed, pi->name);			\
 }
 
-E2K_PROPERTIES_SETTER_AS (string, char *)
+E2K_PROPERTIES_SETTER_AS (string, gchar *)
 E2K_PROPERTIES_SETTER_AS (string_array, GPtrArray *)
 
 /**
@@ -476,7 +476,7 @@ E2K_PROPERTIES_SETTER_AS (string_array, GPtrArray *)
  * this frees the old value.
  **/
 void
-e2k_properties_remove (E2kProperties *props, const char *propname)
+e2k_properties_remove (E2kProperties *props, const gchar *propname)
 {
 	E2kPropInfo *pi;
 
@@ -566,7 +566,7 @@ foreach_namespace_callback (gpointer key, gpointer value, gpointer data)
 {
 	struct foreach_namespace_data *fnd = data;
 	E2kPropInfo *pi;
-	const char *name;
+	const gchar *name;
 
 	g_static_mutex_lock (&known_properties_lock);
 	pi = g_hash_table_lookup (known_properties, key);
@@ -577,7 +577,7 @@ foreach_namespace_callback (gpointer key, gpointer value, gpointer data)
 	name = e2k_prop_namespace_name (pi->name);
 	if (!g_hash_table_lookup (fnd->seen_namespaces, name)) {
 		g_hash_table_insert (fnd->seen_namespaces,
-				     (char *)name, (char *)name);
+				     (gchar *)name, (gchar *)name);
 		fnd->callback (name, e2k_prop_namespace_abbrev (pi->name),
 			       fnd->user_data);
 	}
@@ -640,13 +640,13 @@ e2k_properties_foreach_namespace (E2kProperties *props,
 
 
 static GHashTable *namespaces;
-static int next_namespace = 'a';
+static gint next_namespace = 'a';
 static GStaticMutex namespaces_lock = G_STATIC_MUTEX_INIT;
 
-static const char *
-get_div (const char *propname)
+static const gchar *
+get_div (const gchar *propname)
 {
-	const char *div;
+	const gchar *div;
 
 	div = strrchr (propname, '/');
 	if (div)
@@ -657,8 +657,8 @@ get_div (const char *propname)
 static gint
 prop_equal (gconstpointer v1, gconstpointer v2)
 {
-	const char *s1 = (const char *)v1, *s2 = (const char *)v2;
-	const char *d1 = get_div (s1), *d2 = get_div (s2);
+	const gchar *s1 = (const gchar *)v1, *s2 = (const gchar *)v2;
+	const gchar *d1 = get_div (s1), *d2 = get_div (s2);
 
 	return (d1 - s1 == d2 - s2) && !g_ascii_strncasecmp (s1, s2, d1 - s1);
 }
@@ -666,8 +666,8 @@ prop_equal (gconstpointer v1, gconstpointer v2)
 static guint
 prop_hash (gconstpointer v)
 {
-	const char *d = get_div (v);
-	const char *p = v;
+	const gchar *d = get_div (v);
+	const gchar *p = v;
 	guint h = g_ascii_tolower (*p);
 
 	for (p += 1; p < d; p++)
@@ -690,12 +690,12 @@ setup_namespaces (void)
  *
  * Return value: the URI of @prop's namespace
  **/
-const char *
-e2k_prop_namespace_name (const char *prop)
+const gchar *
+e2k_prop_namespace_name (const gchar *prop)
 {
-	const char *div = get_div (prop);
+	const gchar *div = get_div (prop);
 	gpointer key, value;
-	char *name;
+	gchar *name;
 
 	g_static_mutex_lock (&namespaces_lock);
 	if (!namespaces)
@@ -723,11 +723,11 @@ e2k_prop_namespace_name (const char *prop)
  * Return value: the abbreviation used for prop's namespace
  **/
 char
-e2k_prop_namespace_abbrev (const char *prop)
+e2k_prop_namespace_abbrev (const gchar *prop)
 {
-	const char *div = get_div (prop);
+	const gchar *div = get_div (prop);
 	gpointer key, value;
-	char *name, res;
+	gchar *name, res;
 
 	g_static_mutex_lock (&namespaces_lock);
 	if (!namespaces)
@@ -754,8 +754,8 @@ e2k_prop_namespace_abbrev (const char *prop)
  *
  * Return value: the non-namespaced name of @prop
  **/
-const char *
-e2k_prop_property_name (const char *prop)
+const gchar *
+e2k_prop_property_name (const gchar *prop)
 {
 	return get_div (prop) + 1;
 }
@@ -770,7 +770,7 @@ e2k_prop_property_name (const char *prop)
  * Return value: the MAPI proptag value
  **/
 guint32
-e2k_prop_proptag (const char *prop)
+e2k_prop_proptag (const gchar *prop)
 {
 	E2kPropInfo *pi;
 
@@ -787,11 +787,11 @@ e2k_prop_proptag (const char *prop)
  *
  * Return value: the WebDAV property name associated with @proptag
  **/
-const char *
+const gchar *
 e2k_proptag_prop (guint32 proptag)
 {
 	E2kPropInfo *pi;
-	char *tmpname;
+	gchar *tmpname;
 
 	tmpname = g_strdup_printf (E2K_NS_MAPI_PROPTAG "x%08x",
 				   (unsigned)proptag);
diff --git a/servers/exchange/lib/e2k-properties.h b/servers/exchange/lib/e2k-properties.h
index fdfc7df..d1878d1 100644
--- a/servers/exchange/lib/e2k-properties.h
+++ b/servers/exchange/lib/e2k-properties.h
@@ -33,54 +33,54 @@ E2kProperties *e2k_properties_copy              (E2kProperties *props);
 void           e2k_properties_free              (E2kProperties *props);
 
 gpointer       e2k_properties_get_prop          (E2kProperties *props,
-						 const char    *propname);
+						 const gchar    *propname);
 gboolean       e2k_properties_empty             (E2kProperties *props);
 
 void           e2k_properties_set_string        (E2kProperties *props,
-						 const char    *propname,
-						 char          *value);
+						 const gchar    *propname,
+						 gchar          *value);
 void           e2k_properties_set_string_array  (E2kProperties *props,
-						 const char    *propname,
+						 const gchar    *propname,
 						 GPtrArray     *value);
 void           e2k_properties_set_binary        (E2kProperties *props,
-						 const char    *propname,
+						 const gchar    *propname,
 						 GByteArray    *value);
 void           e2k_properties_set_binary_array  (E2kProperties *props,
-						 const char    *propname,
+						 const gchar    *propname,
 						 GPtrArray     *value);
 void           e2k_properties_set_int           (E2kProperties *props,
-						 const char    *propname,
-						 int            value);
+						 const gchar    *propname,
+						 gint            value);
 void           e2k_properties_set_int_array     (E2kProperties *props,
-						 const char    *propname,
+						 const gchar    *propname,
 						 GPtrArray     *value);
 void           e2k_properties_set_xml           (E2kProperties *props,
-						 const char    *propname,
+						 const gchar    *propname,
 						 xmlNode       *value);
 void           e2k_properties_set_bool          (E2kProperties *props,
-						 const char    *propname,
+						 const gchar    *propname,
 						 gboolean       value);
 void           e2k_properties_set_float         (E2kProperties *props,
-						 const char    *propname,
+						 const gchar    *propname,
 						 float          value);
 void           e2k_properties_set_date          (E2kProperties *props,
-						 const char    *propname,
-						 char          *value);
+						 const gchar    *propname,
+						 gchar          *value);
 
 void           e2k_properties_set_type_as_string       (E2kProperties *props,
-							const char    *propname,
+							const gchar    *propname,
 							E2kPropType    type,
-							char          *value);
+							gchar          *value);
 void           e2k_properties_set_type_as_string_array (E2kProperties *props,
-							const char    *propname,
+							const gchar    *propname,
 							E2kPropType    type,
 							GPtrArray     *value);
 
 void           e2k_properties_remove            (E2kProperties *props,
-						 const char    *propname);
+						 const gchar    *propname);
 
 
-typedef void (*E2kPropertiesForeachFunc)        (const char    *propname,
+typedef void (*E2kPropertiesForeachFunc)        (const gchar    *propname,
 						 E2kPropType    type,
 						 gpointer       value,
 						 gpointer       user_data);
@@ -92,19 +92,19 @@ void           e2k_properties_foreach_removed   (E2kProperties *props,
 						 gpointer       user_data);
 
 
-typedef void(*E2kPropertiesForeachNamespaceFunc)(const char    *namespace,
-						 char           abbrev,
+typedef void(*E2kPropertiesForeachNamespaceFunc)(const gchar    *namespace,
+						 gchar           abbrev,
 						 gpointer       user_data);
 void           e2k_properties_foreach_namespace (E2kProperties *props,
 						 E2kPropertiesForeachNamespaceFunc callback,
 						 gpointer user_data);
 
-const char *e2k_prop_namespace_name   (const char *prop);
-char        e2k_prop_namespace_abbrev (const char *prop);
-const char *e2k_prop_property_name    (const char *prop);
+const gchar *e2k_prop_namespace_name   (const gchar *prop);
+gchar        e2k_prop_namespace_abbrev (const gchar *prop);
+const gchar *e2k_prop_property_name    (const gchar *prop);
 
-guint32     e2k_prop_proptag          (const char *prop);
-const char *e2k_proptag_prop          (guint32     proptag);
+guint32     e2k_prop_proptag          (const gchar *prop);
+const gchar *e2k_proptag_prop          (guint32     proptag);
 
 #define E2K_PROPTAG_TYPE(proptag) (proptag & 0xFFFF)
 #define E2K_PROPTAG_ID(proptag) (proptag & 0xFFFF0000)
diff --git a/servers/exchange/lib/e2k-restriction.c b/servers/exchange/lib/e2k-restriction.c
index 490eba3..da7ab04 100644
--- a/servers/exchange/lib/e2k-restriction.c
+++ b/servers/exchange/lib/e2k-restriction.c
@@ -31,10 +31,10 @@
 #include <string.h>
 
 static E2kRestriction *
-conjoin (E2kRestrictionType type, int nrns, E2kRestriction **rns, gboolean unref)
+conjoin (E2kRestrictionType type, gint nrns, E2kRestriction **rns, gboolean unref)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
-	int i;
+	gint i;
 
 	ret->type = type;
 	ret->res.and.nrns = nrns;
@@ -65,7 +65,7 @@ conjoin (E2kRestrictionType type, int nrns, E2kRestriction **rns, gboolean unref
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_and (int nrns, E2kRestriction **rns, gboolean unref)
+e2k_restriction_and (gint nrns, E2kRestriction **rns, gboolean unref)
 {
 	return conjoin (E2K_RESTRICTION_AND, nrns, rns, unref);
 }
@@ -82,7 +82,7 @@ e2k_restriction_and (int nrns, E2kRestriction **rns, gboolean unref)
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_or (int nrns, E2kRestriction **rns, gboolean unref)
+e2k_restriction_or (gint nrns, E2kRestriction **rns, gboolean unref)
 {
 	return conjoin (E2K_RESTRICTION_OR, nrns, rns, unref);
 }
@@ -192,9 +192,9 @@ e2k_restriction_not (E2kRestriction *rn, gboolean unref)
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_content (const char *propname,
+e2k_restriction_content (const gchar *propname,
 			 E2kRestrictionFuzzyLevel fuzzy_level,
-			 const char *value)
+			 const gchar *value)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
 
@@ -219,7 +219,7 @@ e2k_restriction_content (const char *propname,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_prop_bool (const char *propname, E2kRestrictionRelop relop,
+e2k_restriction_prop_bool (const gchar *propname, E2kRestrictionRelop relop,
 			   gboolean value)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
@@ -245,8 +245,8 @@ e2k_restriction_prop_bool (const char *propname, E2kRestrictionRelop relop,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_prop_int (const char *propname, E2kRestrictionRelop relop,
-			  int value)
+e2k_restriction_prop_int (const gchar *propname, E2kRestrictionRelop relop,
+			  gint value)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
 
@@ -271,8 +271,8 @@ e2k_restriction_prop_int (const char *propname, E2kRestrictionRelop relop,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_prop_date (const char *propname, E2kRestrictionRelop relop,
-			   const char *value)
+e2k_restriction_prop_date (const gchar *propname, E2kRestrictionRelop relop,
+			   const gchar *value)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
 
@@ -299,8 +299,8 @@ e2k_restriction_prop_date (const char *propname, E2kRestrictionRelop relop,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_prop_string (const char *propname, E2kRestrictionRelop relop,
-			     const char *value)
+e2k_restriction_prop_string (const gchar *propname, E2kRestrictionRelop relop,
+			     const gchar *value)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
 
@@ -326,8 +326,8 @@ e2k_restriction_prop_string (const char *propname, E2kRestrictionRelop relop,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_prop_binary (const char *propname, E2kRestrictionRelop relop,
-			     gconstpointer data, int len)
+e2k_restriction_prop_binary (const gchar *propname, E2kRestrictionRelop relop,
+			     gconstpointer data, gint len)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
 
@@ -354,8 +354,8 @@ e2k_restriction_prop_binary (const char *propname, E2kRestrictionRelop relop,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_compare (const char *propname1, E2kRestrictionRelop relop,
-			 const char *propname2)
+e2k_restriction_compare (const gchar *propname1, E2kRestrictionRelop relop,
+			 const gchar *propname2)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
 
@@ -382,7 +382,7 @@ e2k_restriction_compare (const char *propname1, E2kRestrictionRelop relop,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_bitmask (const char *propname, E2kRestrictionBitop bitop,
+e2k_restriction_bitmask (const gchar *propname, E2kRestrictionBitop bitop,
 			 guint32 mask)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
@@ -414,7 +414,7 @@ e2k_restriction_bitmask (const char *propname, E2kRestrictionBitop bitop,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_size (const char *propname, E2kRestrictionRelop relop,
+e2k_restriction_size (const gchar *propname, E2kRestrictionRelop relop,
 		      guint32 size)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
@@ -439,7 +439,7 @@ e2k_restriction_size (const char *propname, E2kRestrictionRelop relop,
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_exist (const char *propname)
+e2k_restriction_exist (const gchar *propname)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
 
@@ -468,7 +468,7 @@ e2k_restriction_exist (const char *propname)
  * Return value: the new restriction
  **/
 E2kRestriction *
-e2k_restriction_sub (const char *subtable, E2kRestriction *rn, gboolean unref)
+e2k_restriction_sub (const gchar *subtable, E2kRestriction *rn, gboolean unref)
 {
 	E2kRestriction *ret = g_new0 (E2kRestriction, 1);
 
@@ -490,7 +490,7 @@ e2k_restriction_sub (const char *subtable, E2kRestriction *rn, gboolean unref)
 void
 e2k_restriction_unref (E2kRestriction *rn)
 {
-	int i;
+	gint i;
 
 	if (rn->ref_count--)
 		return;
@@ -539,13 +539,13 @@ e2k_restriction_ref (E2kRestriction *rn)
 
 static gboolean rn_to_sql (E2kRestriction *rn, GString *sql, E2kRestrictionType inside);
 
-static const char *sql_relops[] = { "<", "<=", ">", ">=", "=", "!=" };
-static const int n_sql_relops = G_N_ELEMENTS (sql_relops);
+static const gchar *sql_relops[] = { "<", "<=", ">", ">=", "=", "!=" };
+static const gint n_sql_relops = G_N_ELEMENTS (sql_relops);
 
 static gboolean
-rns_to_sql (E2kRestrictionType type, E2kRestriction **rns, int nrns, GString *sql)
+rns_to_sql (E2kRestrictionType type, E2kRestriction **rns, gint nrns, GString *sql)
 {
-	int i;
+	gint i;
 	gboolean need_op = FALSE;
 	gboolean rv = FALSE;
 
@@ -564,7 +564,7 @@ rns_to_sql (E2kRestrictionType type, E2kRestriction **rns, int nrns, GString *sq
 }
 
 static void
-append_sql_quoted (GString *sql, const char *string)
+append_sql_quoted (GString *sql, const gchar *string)
 {
 	while (*string) {
 		if (*string == '\'')
@@ -663,7 +663,7 @@ rn_to_sql (E2kRestriction *rn, GString *sql, E2kRestrictionType inside)
 		case E2K_PROP_TYPE_DATE:
 			g_string_append_printf (sql,
 						"cast (\"%s\" as 'dateTime.tz')",
-						(char *)pv->value);
+						(gchar *)pv->value);
 			break;
 
 		default:
@@ -711,11 +711,11 @@ rn_to_sql (E2kRestriction *rn, GString *sql, E2kRestrictionType inside)
  * Return value: the SQL WHERE clause, which the caller must free,
  * or %NULL if @rn could not be converted to SQL.
  **/
-char *
+gchar *
 e2k_restriction_to_sql (E2kRestriction *rn)
 {
 	GString *sql;
-	char *ret;
+	gchar *ret;
 
 	sql = g_string_new (NULL);
 	if (!rn_to_sql (rn, sql, E2K_RESTRICTION_AND)) {
@@ -735,9 +735,9 @@ e2k_restriction_to_sql (E2kRestriction *rn)
 /* Binary import/export */
 
 static gboolean
-extract_restriction (guint8 **data, int *len, E2kRestriction **rn)
+extract_restriction (guint8 **data, gint *len, E2kRestriction **rn)
 {
-	int type;
+	gint type;
 
 	if (*len == 0)
 		return FALSE;
@@ -751,7 +751,7 @@ extract_restriction (guint8 **data, int *len, E2kRestriction **rn)
 	{
 		E2kRestriction **rns;
 		guint16 nrns;
-		int i;
+		gint i;
 
 		if (!e2k_rule_extract_uint16 (data, len, &nrns))
 			return FALSE;
@@ -883,7 +883,7 @@ extract_restriction (guint8 **data, int *len, E2kRestriction **rn)
 	{
 		guint8 nprops, dummy;
 		E2kPropValue *props;
-		int i;
+		gint i;
 
 		if (!e2k_rule_extract_byte (data, len, &nprops))
 			return FALSE;
@@ -940,7 +940,7 @@ extract_restriction (guint8 **data, int *len, E2kRestriction **rn)
  * Return value: success or failure
  **/
 gboolean
-e2k_restriction_extract (guint8 **data, int *len, E2kRestriction **rn)
+e2k_restriction_extract (guint8 **data, gint *len, E2kRestriction **rn)
 {
 	guint32 rnlen;
 
@@ -969,7 +969,7 @@ e2k_restriction_extract (guint8 **data, int *len, E2kRestriction **rn)
 static void
 append_restriction (GByteArray *ba, E2kRestriction *rn)
 {
-	int i;
+	gint i;
 
 	e2k_rule_append_byte (ba, rn->type);
 
@@ -1048,7 +1048,7 @@ append_restriction (GByteArray *ba, E2kRestriction *rn)
 void
 e2k_restriction_append (GByteArray *ba, E2kRestriction *rn)
 {
-	int rnlen_offset, rnlen;
+	gint rnlen_offset, rnlen;
 
 	if (!rn) {
 		e2k_rule_append_uint32 (ba, 1);
diff --git a/servers/exchange/lib/e2k-restriction.h b/servers/exchange/lib/e2k-restriction.h
index dfea32c..cdce468 100644
--- a/servers/exchange/lib/e2k-restriction.h
+++ b/servers/exchange/lib/e2k-restriction.h
@@ -41,56 +41,56 @@ typedef enum {
 
 #define E2K_FL_MATCH_TYPE(fl) ((fl) & 0x3)
 
-E2kRestriction *e2k_restriction_and         (int                   nrns,
+E2kRestriction *e2k_restriction_and         (gint                   nrns,
 					     E2kRestriction      **rns,
 					     gboolean              unref);
 E2kRestriction *e2k_restriction_andv        (E2kRestriction       *rn, ...);
-E2kRestriction *e2k_restriction_or          (int                   nrns,
+E2kRestriction *e2k_restriction_or          (gint                   nrns,
 					     E2kRestriction      **rns,
 					     gboolean              unref);
 E2kRestriction *e2k_restriction_orv         (E2kRestriction       *rn, ...);
 E2kRestriction *e2k_restriction_not         (E2kRestriction       *rn,
 					     gboolean              unref);
-E2kRestriction *e2k_restriction_content     (const char           *propname,
+E2kRestriction *e2k_restriction_content     (const gchar           *propname,
 					     E2kRestrictionFuzzyLevel fuzzy_level,
-					     const char           *value);
-E2kRestriction *e2k_restriction_prop_bool   (const char           *propname,
+					     const gchar           *value);
+E2kRestriction *e2k_restriction_prop_bool   (const gchar           *propname,
 					     E2kRestrictionRelop   relop,
 					     gboolean              value);
-E2kRestriction *e2k_restriction_prop_int    (const char           *propname,
+E2kRestriction *e2k_restriction_prop_int    (const gchar           *propname,
 					     E2kRestrictionRelop   relop,
-					     int                   value);
-E2kRestriction *e2k_restriction_prop_date   (const char           *propname,
+					     gint                   value);
+E2kRestriction *e2k_restriction_prop_date   (const gchar           *propname,
 					     E2kRestrictionRelop   relop,
-					     const char           *value);
-E2kRestriction *e2k_restriction_prop_string (const char           *propname,
+					     const gchar           *value);
+E2kRestriction *e2k_restriction_prop_string (const gchar           *propname,
 					     E2kRestrictionRelop   relop,
-					     const char           *value);
-E2kRestriction *e2k_restriction_prop_binary (const char           *propname,
+					     const gchar           *value);
+E2kRestriction *e2k_restriction_prop_binary (const gchar           *propname,
 					     E2kRestrictionRelop   relop,
 					     gconstpointer         data,
-					     int                   len);
-E2kRestriction *e2k_restriction_compare     (const char           *propname1,
+					     gint                   len);
+E2kRestriction *e2k_restriction_compare     (const gchar           *propname1,
 					     E2kRestrictionRelop   relop,
-					     const char           *propname2);
-E2kRestriction *e2k_restriction_bitmask     (const char           *propname,
+					     const gchar           *propname2);
+E2kRestriction *e2k_restriction_bitmask     (const gchar           *propname,
 					     E2kRestrictionBitop   bitop,
 					     guint32               mask);
-E2kRestriction *e2k_restriction_size        (const char           *propname,
+E2kRestriction *e2k_restriction_size        (const gchar           *propname,
 					     E2kRestrictionRelop   relop,
 					     guint32               size);
-E2kRestriction *e2k_restriction_exist       (const char           *propname);
-E2kRestriction *e2k_restriction_sub         (const char           *subtable,
+E2kRestriction *e2k_restriction_exist       (const gchar           *propname);
+E2kRestriction *e2k_restriction_sub         (const gchar           *subtable,
 					     E2kRestriction       *rn,
 					     gboolean              unref);
 
 void            e2k_restriction_ref         (E2kRestriction       *rn);
 void            e2k_restriction_unref       (E2kRestriction       *rn);
 
-char           *e2k_restriction_to_sql      (E2kRestriction       *rn);
+gchar           *e2k_restriction_to_sql      (E2kRestriction       *rn);
 
 gboolean        e2k_restriction_extract     (guint8              **data,
-					     int                  *len,
+					     gint                  *len,
 					     E2kRestriction      **rn);
 void            e2k_restriction_append      (GByteArray           *ba,
 					     E2kRestriction       *rn);
diff --git a/servers/exchange/lib/e2k-result.c b/servers/exchange/lib/e2k-result.c
index c59796b..a39b348 100644
--- a/servers/exchange/lib/e2k-result.c
+++ b/servers/exchange/lib/e2k-result.c
@@ -34,7 +34,7 @@
 #include <libxml/xmlmemory.h>
 
 static void
-prop_get_binary_array (E2kResult *result, const char *propname, xmlNode *node)
+prop_get_binary_array (E2kResult *result, const gchar *propname, xmlNode *node)
 {
 	GPtrArray *array;
 
@@ -59,7 +59,7 @@ prop_get_binary_array (E2kResult *result, const char *propname, xmlNode *node)
 }
 
 static void
-prop_get_string_array (E2kResult *result, const char *propname,
+prop_get_string_array (E2kResult *result, const gchar *propname,
 		       E2kPropType real_type, xmlNode *node)
 {
 	GPtrArray *array;
@@ -77,7 +77,7 @@ prop_get_string_array (E2kResult *result, const char *propname,
 }
 
 static void
-prop_get_binary (E2kResult *result, const char *propname, xmlNode *node)
+prop_get_binary (E2kResult *result, const gchar *propname, xmlNode *node)
 {
 	GByteArray *byte_array;
 
@@ -96,10 +96,10 @@ prop_get_binary (E2kResult *result, const char *propname, xmlNode *node)
 }
 
 static void
-prop_get_string (E2kResult *result, const char *propname,
+prop_get_string (E2kResult *result, const gchar *propname,
 		 E2kPropType real_type, xmlNode *node)
 {
-	char *content;
+	gchar *content;
 
 	if (node->xmlChildrenNode && node->xmlChildrenNode->content)
 		content = g_strdup (node->xmlChildrenNode->content);
@@ -111,7 +111,7 @@ prop_get_string (E2kResult *result, const char *propname,
 }
 
 static void
-prop_get_xml (E2kResult *result, const char *propname, xmlNode *node)
+prop_get_xml (E2kResult *result, const gchar *propname, xmlNode *node)
 {
 	e2k_properties_set_xml (result->props, propname,
 				xmlCopyNode (node, TRUE));
@@ -120,7 +120,7 @@ prop_get_xml (E2kResult *result, const char *propname, xmlNode *node)
 static void
 prop_parse (xmlNode *node, E2kResult *result)
 {
-	char *name, *type;
+	gchar *name, *type;
 
 	g_return_if_fail (node->ns != NULL);
 
@@ -213,13 +213,13 @@ e2k_results_array_new (void)
  * always) returned with names that start with '0', which is illegal
  * and makes libxml choke. So we preprocess them to fix that.
  */
-static char *
-sanitize_bad_multistatus (const char *buf, int len)
+static gchar *
+sanitize_bad_multistatus (const gchar *buf, gint len)
 {
 	GString *body;
-	const char *p;
-	int start, end;
-	char ns, badprop[7], *ret;
+	const gchar *p;
+	gint start, end;
+	gchar ns, badprop[7], *ret;
 
 	/* If there are no "mapi/id/{...}" namespace declarations, then
 	 * we don't need any cleanup.
@@ -292,7 +292,7 @@ e2k_results_array_add_from_multistatus (GArray *results_array,
 	xmlDoc *doc;
 	xmlNode *node, *rnode;
 	E2kResult result;
-	char *body;
+	gchar *body;
 
 	g_return_if_fail (msg->status_code == E2K_HTTP_MULTI_STATUS);
 
@@ -377,7 +377,7 @@ e2k_results_array_free (GArray *results_array, gboolean free_results)
  **/
 void
 e2k_results_from_multistatus (SoupMessage *msg,
-			      E2kResult **results, int *nresults)
+			      E2kResult **results, gint *nresults)
 {
 	GArray *results_array;
 
@@ -399,11 +399,11 @@ e2k_results_from_multistatus (SoupMessage *msg,
  * Return value: a copy of @results.
  **/
 E2kResult *
-e2k_results_copy (E2kResult *results, int nresults)
+e2k_results_copy (E2kResult *results, gint nresults)
 {
 	GArray *results_array = NULL;
 	E2kResult result, *new_results;
-	int i;
+	gint i;
 
 	results_array = g_array_new (TRUE, FALSE, sizeof (E2kResult));
 	for (i = 0; i < nresults; i++) {
@@ -427,9 +427,9 @@ e2k_results_copy (E2kResult *results, int nresults)
  * Frees the data in @results.
  **/
 void
-e2k_results_free (E2kResult *results, int nresults)
+e2k_results_free (E2kResult *results, gint nresults)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < nresults; i++)
 		e2k_result_clear (&results[i]);
@@ -444,8 +444,8 @@ struct E2kResultIter {
 	E2kHTTPStatus status;
 
 	E2kResult *results;
-	int nresults, next;
-	int first, total;
+	gint nresults, next;
+	gint first, total;
 	gboolean ascending;
 
 	E2kResultIterFetchFunc fetch_func;
@@ -504,7 +504,7 @@ iter_fetch (E2kResultIter *iter)
  **/
 E2kResultIter *
 e2k_result_iter_new (E2kContext *ctx, E2kOperation *op,
-		     gboolean ascending, int total,
+		     gboolean ascending, gint total,
 		     E2kResultIterFetchFunc fetch_func,
 		     E2kResultIterFreeFunc free_func,
 		     gpointer user_data)
@@ -569,7 +569,7 @@ e2k_result_iter_next (E2kResultIter *iter)
  *
  * Return value: the index of the current result
  **/
-int
+gint
 e2k_result_iter_get_index (E2kResultIter *iter)
 {
 	g_return_val_if_fail (iter != NULL, -1);
@@ -590,7 +590,7 @@ e2k_result_iter_get_index (E2kResultIter *iter)
  *
  * Return value: the total number of results expected
  **/
-int
+gint
 e2k_result_iter_get_total (E2kResultIter *iter)
 {
 	g_return_val_if_fail (iter != NULL, -1);
diff --git a/servers/exchange/lib/e2k-result.h b/servers/exchange/lib/e2k-result.h
index 310556e..2140dda 100644
--- a/servers/exchange/lib/e2k-result.h
+++ b/servers/exchange/lib/e2k-result.h
@@ -10,20 +10,20 @@
 #include "e2k-http-utils.h"
 
 typedef struct {
-	char *href;
-	int status;
+	gchar *href;
+	gint status;
 	E2kProperties *props;
 } E2kResult;
 
 void       e2k_results_from_multistatus           (SoupMessage  *msg,
 						   E2kResult   **results,
-						   int          *nresults);
+						   gint          *nresults);
 
 E2kResult *e2k_results_copy                       (E2kResult    *results,
-						   int           nresults);
+						   gint           nresults);
 
 void       e2k_results_free                       (E2kResult    *results,
-						   int           nresults);
+						   gint           nresults);
 
 
 GArray    *e2k_results_array_new                  (void);
@@ -41,9 +41,9 @@ typedef E2kHTTPStatus (*E2kResultIterFetchFunc) (E2kResultIter *iter,
 						 E2kContext *ctx,
 						 E2kOperation *op,
 						 E2kResult **results,
-						 int *nresults,
-						 int *first,
-						 int *total,
+						 gint *nresults,
+						 gint *first,
+						 gint *total,
 						 gpointer user_data);
 typedef void          (*E2kResultIterFreeFunc)  (E2kResultIter *iter,
 						 gpointer user_data);
@@ -51,14 +51,14 @@ typedef void          (*E2kResultIterFreeFunc)  (E2kResultIter *iter,
 E2kResultIter *e2k_result_iter_new         (E2kContext            *ctx,
 					    E2kOperation          *op,
 					    gboolean               ascending,
-					    int                    total,
+					    gint                    total,
 					    E2kResultIterFetchFunc fetch_func,
 					    E2kResultIterFreeFunc  free_func,
 					    gpointer               user_data);
 
 E2kResult     *e2k_result_iter_next        (E2kResultIter         *iter);
-int            e2k_result_iter_get_index   (E2kResultIter         *iter);
-int            e2k_result_iter_get_total   (E2kResultIter         *iter);
+gint            e2k_result_iter_get_index   (E2kResultIter         *iter);
+gint            e2k_result_iter_get_total   (E2kResultIter         *iter);
 E2kHTTPStatus  e2k_result_iter_free        (E2kResultIter         *iter);
 
 #endif /* __E2K_RESULT_H__ */
diff --git a/servers/exchange/lib/e2k-rule-xml.c b/servers/exchange/lib/e2k-rule-xml.c
index 70562f3..1e1d537 100644
--- a/servers/exchange/lib/e2k-rule-xml.c
+++ b/servers/exchange/lib/e2k-rule-xml.c
@@ -31,17 +31,17 @@
 #include "e2k-utils.h"
 #include "mapi.h"
 
-static const char *contains_types[] = { NULL, "contains", NULL, NULL, NULL, "not contains", NULL, NULL };
-static const char *subject_types[] = { "is", "contains", "starts with", NULL, "is not", "not contains", "not starts with", NULL };
+static const gchar *contains_types[] = { NULL, "contains", NULL, NULL, NULL, "not contains", NULL, NULL };
+static const gchar *subject_types[] = { "is", "contains", "starts with", NULL, "is not", "not contains", "not starts with", NULL };
 #define E2K_FL_NEGATE 4
 #define E2K_FL_MAX 8
 
 #if 0
 static gboolean
-fuzzy_level_from_name (const char *name, const char *map[],
-		       int *fuzzy_level, gboolean *negated)
+fuzzy_level_from_name (const gchar *name, const gchar *map[],
+		       gint *fuzzy_level, gboolean *negated)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < E2K_FL_MAX; i++) {
 		if (map[i] && !strcmp (name, map[i])) {
@@ -55,8 +55,8 @@ fuzzy_level_from_name (const char *name, const char *map[],
 }
 #endif
 
-static inline const char *
-fuzzy_level_to_name (int fuzzy_level, gboolean negated, const char *map[])
+static inline const gchar *
+fuzzy_level_to_name (gint fuzzy_level, gboolean negated, const gchar *map[])
 {
 	fuzzy_level = E2K_FL_MATCH_TYPE (fuzzy_level);
 	if (negated)
@@ -65,16 +65,16 @@ fuzzy_level_to_name (int fuzzy_level, gboolean negated, const char *map[])
 	return map[fuzzy_level];
 }
 
-static const char *is_types[] = { NULL, NULL, NULL, NULL, "is", "is not" };
-static const char *date_types[] = { "before", "before", "after", "after", NULL, NULL };
-static const char *size_types[] = { "less than", "less than", "greater than", "greater than", NULL, NULL };
+static const gchar *is_types[] = { NULL, NULL, NULL, NULL, "is", "is not" };
+static const gchar *date_types[] = { "before", "before", "after", "after", NULL, NULL };
+static const gchar *size_types[] = { "less than", "less than", "greater than", "greater than", NULL, NULL };
 
 #if 0
 static gboolean
-relop_from_name (const char *name, const char *map[],
+relop_from_name (const gchar *name, const gchar *map[],
 		 E2kRestrictionRelop *relop)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < E2K_RELOP_RE; i++) {
 		if (map[i] && !strcmp (name, map[i])) {
@@ -87,10 +87,10 @@ relop_from_name (const char *name, const char *map[],
 }
 #endif
 
-static inline const char *
-relop_to_name (E2kRestrictionRelop relop, gboolean negated, const char *map[])
+static inline const gchar *
+relop_to_name (E2kRestrictionRelop relop, gboolean negated, const gchar *map[])
 {
-	static const int negate_map[] = {
+	static const gint negate_map[] = {
 		E2K_RELOP_GE, E2K_RELOP_GT, E2K_RELOP_LE, E2K_RELOP_LT,
 		E2K_RELOP_NE, E2K_RELOP_EQ
 	};
@@ -179,7 +179,7 @@ restriction_is_delegation (E2kRestriction *rn)
 }
 
 static xmlNode *
-new_value (xmlNode *part, const char *name, const char *type, const char *value)
+new_value (xmlNode *part, const gchar *name, const gchar *type, const gchar *value)
 {
 	xmlNode *node;
 
@@ -193,11 +193,11 @@ new_value (xmlNode *part, const char *name, const char *type, const char *value)
 }
 
 static xmlNode *
-new_value_int (xmlNode *part, const char *name, const char *type,
-	       const char *value_name, long value)
+new_value_int (xmlNode *part, const gchar *name, const gchar *type,
+	       const gchar *value_name, long value)
 {
 	xmlNode *node;
-	char *str;
+	gchar *str;
 
 	node = xmlNewChild (part, NULL, "value", NULL);
 	xmlSetProp (node, "name", name);
@@ -211,7 +211,7 @@ new_value_int (xmlNode *part, const char *name, const char *type,
 }
 
 static xmlNode *
-new_part (const char *part_name)
+new_part (const gchar *part_name)
 {
 	xmlNode *part;
 
@@ -221,8 +221,8 @@ new_part (const char *part_name)
 }
 
 static xmlNode *
-match (const char *part_name, const char *value_name, const char *value_value,
-       const char *string_name, const char *string_value)
+match (const gchar *part_name, const gchar *value_name, const gchar *value_value,
+       const gchar *string_name, const gchar *string_value)
 {
 	xmlNode *part, *value;
 
@@ -235,8 +235,8 @@ match (const char *part_name, const char *value_name, const char *value_value,
 }
 
 static xmlNode *
-message_is (const char *name, const char *type_name,
-	    const char *kind, gboolean negated)
+message_is (const gchar *name, const gchar *type_name,
+	    const gchar *kind, gboolean negated)
 {
 	xmlNode *part;
 
@@ -253,10 +253,10 @@ address_is (E2kRestriction *comment_rn, gboolean recipients, gboolean negated)
 	xmlNode *part;
 	E2kRestriction *rn;
 	E2kPropValue *pv;
-	const char *relation, *display_name, *p;
-	char *addr, *full_addr;
+	const gchar *relation, *display_name, *p;
+	gchar *addr, *full_addr;
 	GByteArray *ba;
-	int i;
+	gint i;
 
 	rn = comment_rn->res.comment.rn;
 	if (rn->type != E2K_RESTRICTION_PROPERTY ||
@@ -274,11 +274,11 @@ address_is (E2kRestriction *comment_rn, gboolean recipients, gboolean negated)
 
 	/* Extract the address part */
 	ba = pv->value;
-	p = strchr ((char *)ba->data, ':');
+	p = strchr ((gchar *)ba->data, ':');
 	if (p)
 		addr = g_ascii_strdown (p + 1, -1);
 	else
-		addr = g_ascii_strdown ((char *)ba->data, -1);
+		addr = g_ascii_strdown ((gchar *)ba->data, -1);
 
 	/* Find the display name in the comment */
 	display_name = NULL;
@@ -314,8 +314,8 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
 {
 	xmlNode *part, *value, *node;
 	E2kPropValue *pv;
-	const char *match_type;
-	int i;
+	const gchar *match_type;
+	gint i;
 
 	switch (rn->type) {
 	case E2K_RESTRICTION_AND:
@@ -371,7 +371,7 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
 
 	case E2K_RESTRICTION_CONTENT:
 	{
-		int fuzzy_level = E2K_FL_MATCH_TYPE (rn->res.content.fuzzy_level);
+		gint fuzzy_level = E2K_FL_MATCH_TYPE (rn->res.content.fuzzy_level);
 
 		pv = &rn->res.content.pv;
 
@@ -431,7 +431,7 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
 	case E2K_RESTRICTION_PROPERTY:
 	{
 		E2kRestrictionRelop relop;
-		const char *relation;
+		const gchar *relation;
 
 		relop = rn->res.property.relop;
 		if (relop >= E2K_RELOP_RE)
@@ -463,7 +463,7 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
 		case E2K_PROPTAG_PR_MESSAGE_DELIVERY_TIME:
 		case E2K_PROPTAG_PR_CLIENT_SUBMIT_TIME:
 		{
-			char *timestamp;
+			gchar *timestamp;
 
 			relation = relop_to_name (relop, negated, date_types);
 			if (!relation)
@@ -570,12 +570,12 @@ restriction_to_xml (E2kRestriction *rn, xmlNode *partset,
 }
 
 
-static char *
-stringify_entryid (guint8 *data, int len)
+static gchar *
+stringify_entryid (guint8 *data, gint len)
 {
 	GString *string;
-	char *ret;
-	int i;
+	gchar *ret;
+	gint i;
 
 	string = g_string_new (NULL);
 
@@ -595,7 +595,7 @@ static gboolean
 action_to_xml (E2kAction *act, xmlNode *actionset)
 {
 	xmlNode *part, *value;
-	char *entryid;
+	gchar *entryid;
 
 	switch (act->type) {
 	case E2K_ACTION_MOVE:
@@ -642,12 +642,12 @@ action_to_xml (E2kAction *act, xmlNode *actionset)
 	case E2K_ACTION_FORWARD:
 	case E2K_ACTION_DELEGATE:
 	{
-		int i, j;
+		gint i, j;
 		E2kAddrList *list;
 		E2kAddrEntry *entry;
 		E2kPropValue *pv;
-		const char *display_name, *email;
-		char *full_addr;
+		const gchar *display_name, *email;
+		gchar *full_addr;
 
 		list = act->act.addr_list;
 		for (i = 0; i < list->nentries; i++) {
@@ -708,7 +708,7 @@ rule_to_xml (E2kRule *rule, xmlNode *ruleset)
 {
 	xmlNode *top, *set;
 	E2kRestriction *rn;
-	int i;
+	gint i;
 
 	top = xmlNewChild (ruleset, NULL, "rule", NULL);
 
@@ -772,7 +772,7 @@ e2k_rules_to_xml (E2kRules *rules)
 {
 	xmlDoc *doc;
 	xmlNode *top, *ruleset;
-	int i;
+	gint i;
 
 	doc = xmlNewDoc (NULL);
 	top = xmlNewNode (NULL, "filteroptions");
diff --git a/servers/exchange/lib/e2k-rule.c b/servers/exchange/lib/e2k-rule.c
index 63295f9..9d46ab6 100644
--- a/servers/exchange/lib/e2k-rule.c
+++ b/servers/exchange/lib/e2k-rule.c
@@ -38,7 +38,7 @@
  * fields of @prop.
  **/
 void
-e2k_rule_prop_set (E2kRuleProp *prop, const char *propname)
+e2k_rule_prop_set (E2kRuleProp *prop, const gchar *propname)
 {
 	prop->name = propname;
 	prop->proptag = e2k_prop_proptag (propname);
@@ -100,7 +100,7 @@ e2k_rule_read_uint32 (guint8 *ptr)
  * Return value: success or failure
  **/
 gboolean
-e2k_rule_extract_uint32 (guint8 **ptr, int *len, guint32 *val)
+e2k_rule_extract_uint32 (guint8 **ptr, gint *len, guint32 *val)
 {
 	if (*len < 4)
 		return FALSE;
@@ -166,7 +166,7 @@ e2k_rule_read_uint16 (guint8 *ptr)
  * Return value: success or failure
  **/
 gboolean
-e2k_rule_extract_uint16 (guint8 **ptr, int *len, guint16 *val)
+e2k_rule_extract_uint16 (guint8 **ptr, gint *len, guint16 *val)
 {
 	if (*len < 2)
 		return FALSE;
@@ -203,7 +203,7 @@ e2k_rule_append_byte (GByteArray *ba, guint8 val)
  * Return value: success or failure
  **/
 gboolean
-e2k_rule_extract_byte (guint8 **ptr, int *len, guint8 *val)
+e2k_rule_extract_byte (guint8 **ptr, gint *len, guint8 *val)
 {
 	if (*len < 1)
 		return FALSE;
@@ -223,7 +223,7 @@ e2k_rule_extract_byte (guint8 **ptr, int *len, guint8 *val)
  * Appends @str to the rule in @ba
  **/
 void
-e2k_rule_append_string (GByteArray *ba, const char *str)
+e2k_rule_append_string (GByteArray *ba, const gchar *str)
 {
 	/* FIXME: verify encoding */
 	g_byte_array_append (ba, str, strlen (str) + 1);
@@ -241,9 +241,9 @@ e2k_rule_append_string (GByteArray *ba, const char *str)
  * Return value: success or failure
  **/
 gboolean
-e2k_rule_extract_string (guint8 **ptr, int *len, char **str)
+e2k_rule_extract_string (guint8 **ptr, gint *len, gchar **str)
 {
-	int slen;
+	gint slen;
 
 	for (slen = 0; slen < *len; slen++) {
 		if ((*ptr)[slen] == '\0') {
@@ -265,10 +265,10 @@ e2k_rule_extract_string (guint8 **ptr, int *len, char **str)
  * Appends @str to the rule in @ba
  **/
 void
-e2k_rule_append_unicode (GByteArray *ba, const char *str)
+e2k_rule_append_unicode (GByteArray *ba, const gchar *str)
 {
 	gunichar2 *utf16;
-	int i;
+	gint i;
 
 	utf16 = g_utf8_to_utf16 (str, -1, NULL, NULL, NULL);
 	g_return_if_fail (utf16 != NULL);
@@ -291,7 +291,7 @@ e2k_rule_append_unicode (GByteArray *ba, const char *str)
  * Return value: success or failure
  **/
 gboolean
-e2k_rule_extract_unicode (guint8 **ptr, int *len, char **str)
+e2k_rule_extract_unicode (guint8 **ptr, gint *len, gchar **str)
 {
 	guint8 *start, *end;
 	gunichar2 *utf16;
@@ -339,7 +339,7 @@ e2k_rule_append_binary (GByteArray *ba, GByteArray *data)
  * Return value: success or failure
  **/
 gboolean
-e2k_rule_extract_binary (guint8 **ptr, int *len, GByteArray **data)
+e2k_rule_extract_binary (guint8 **ptr, gint *len, GByteArray **data)
 {
 	guint16 datalen;
 
@@ -390,7 +390,7 @@ e2k_rule_append_proptag (GByteArray *ba, E2kRuleProp *prop)
  * Return value: success or failure
  **/
 gboolean
-e2k_rule_extract_proptag (guint8 **ptr, int *len, E2kRuleProp *prop)
+e2k_rule_extract_proptag (guint8 **ptr, gint *len, E2kRuleProp *prop)
 {
 	if (!e2k_rule_extract_uint32 (ptr, len, &prop->proptag))
 		return FALSE;
@@ -454,7 +454,7 @@ e2k_rule_append_propvalue (GByteArray *ba, E2kPropValue *pv)
  * Return value: success or failure
  **/
 gboolean
-e2k_rule_extract_propvalue (guint8 **ptr, int *len, E2kPropValue *pv)
+e2k_rule_extract_propvalue (guint8 **ptr, gint *len, E2kPropValue *pv)
 {
 	if (!e2k_rule_extract_proptag (ptr, len, &pv->prop))
 		return FALSE;
@@ -463,7 +463,7 @@ e2k_rule_extract_propvalue (guint8 **ptr, int *len, E2kPropValue *pv)
 	case E2K_PT_UNICODE:
 	case E2K_PT_STRING8:
 		pv->type = E2K_PROP_TYPE_STRING;
-		return e2k_rule_extract_unicode (ptr, len, (char **)&pv->value);
+		return e2k_rule_extract_unicode (ptr, len, (gchar **)&pv->value);
 
 	case E2K_PT_BINARY:
 		pv->type = E2K_PROP_TYPE_BINARY;
@@ -561,7 +561,7 @@ e2k_rule_free (E2kRule *rule)
 void
 e2k_rules_free (E2kRules *rules)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < rules->rules->len; i++)
 		e2k_rule_free (rules->rules->pdata[i]);
@@ -582,7 +582,7 @@ E2kRules *
 e2k_rules_from_binary (GByteArray *rules_data)
 {
 	guint8 *data;
-	int len, i;
+	gint len, i;
 	guint32 nrules, pdlen;
 	E2kRules *rules;
 	E2kRule *rule;
@@ -656,7 +656,7 @@ e2k_rules_to_binary (E2kRules *rules)
 {
 	GByteArray *ba;
 	E2kRule *rule;
-	int i;
+	gint i;
 
 	ba = g_byte_array_new ();
 	e2k_rule_append_byte (ba, rules->version);
diff --git a/servers/exchange/lib/e2k-rule.h b/servers/exchange/lib/e2k-rule.h
index 95eddc7..f226062 100644
--- a/servers/exchange/lib/e2k-rule.h
+++ b/servers/exchange/lib/e2k-rule.h
@@ -13,11 +13,11 @@
  */
 
 typedef struct {
-	const char *name;
+	const gchar *name;
 	guint32     proptag;
 } E2kRuleProp;
 
-void e2k_rule_prop_set (E2kRuleProp *prop, const char *propname);
+void e2k_rule_prop_set (E2kRuleProp *prop, const gchar *propname);
 
 typedef struct {
 	E2kRuleProp  prop;
@@ -43,7 +43,7 @@ struct _E2kRestriction {
 	/*< private >*/
 
 	E2kRestrictionType type;
-	int ref_count;
+	gint ref_count;
 
 	union {
 		struct {
@@ -186,7 +186,7 @@ typedef enum {
 } E2kRuleState;
 
 typedef struct {
-	char           *name;
+	gchar           *name;
 	guint32         sequence;
 	guint32         state;
 	guint32         user_flags;
@@ -194,7 +194,7 @@ typedef struct {
 	guint32         condition_lcid;
 	E2kRestriction *condition;
 	GPtrArray      *actions;
-	char           *provider;
+	gchar           *provider;
 	GByteArray     *provider_data;
 } E2kRule;
 
@@ -214,37 +214,37 @@ void        e2k_rule_free         (E2kRule    *rule);
 void     e2k_rule_write_uint32      (guint8 *ptr, guint32 val);
 void     e2k_rule_append_uint32     (GByteArray *ba, guint32 val);
 guint32  e2k_rule_read_uint32       (guint8 *ptr);
-gboolean e2k_rule_extract_uint32    (guint8 **ptr, int *len,
+gboolean e2k_rule_extract_uint32    (guint8 **ptr, gint *len,
 				     guint32 *val);
 
 void     e2k_rule_write_uint16      (guint8 *ptr, guint16 val);
 void     e2k_rule_append_uint16     (GByteArray *ba, guint16 val);
 guint16  e2k_rule_read_uint16       (guint8 *ptr);
-gboolean e2k_rule_extract_uint16    (guint8 **ptr, int *len,
+gboolean e2k_rule_extract_uint16    (guint8 **ptr, gint *len,
 				     guint16 *val);
 
 void     e2k_rule_append_byte       (GByteArray *ba, guint8 val);
-gboolean e2k_rule_extract_byte      (guint8 **ptr, int *len,
+gboolean e2k_rule_extract_byte      (guint8 **ptr, gint *len,
 				     guint8 *val);
 
-void     e2k_rule_append_string     (GByteArray *ba, const char *str);
-gboolean e2k_rule_extract_string    (guint8 **ptr, int *len,
-				     char **str);
+void     e2k_rule_append_string     (GByteArray *ba, const gchar *str);
+gboolean e2k_rule_extract_string    (guint8 **ptr, gint *len,
+				     gchar **str);
 
-void     e2k_rule_append_unicode    (GByteArray *ba, const char *str);
-gboolean e2k_rule_extract_unicode   (guint8 **ptr, int *len,
-				     char **str);
+void     e2k_rule_append_unicode    (GByteArray *ba, const gchar *str);
+gboolean e2k_rule_extract_unicode   (guint8 **ptr, gint *len,
+				     gchar **str);
 
 void     e2k_rule_append_binary     (GByteArray *ba, GByteArray *data);
-gboolean e2k_rule_extract_binary    (guint8 **ptr, int *len,
+gboolean e2k_rule_extract_binary    (guint8 **ptr, gint *len,
 				     GByteArray **data);
 
 void     e2k_rule_append_proptag    (GByteArray *ba, E2kRuleProp *prop);
-gboolean e2k_rule_extract_proptag   (guint8 **ptr, int *len,
+gboolean e2k_rule_extract_proptag   (guint8 **ptr, gint *len,
 				     E2kRuleProp *prop);
 
 void     e2k_rule_append_propvalue  (GByteArray *ba, E2kPropValue *pv);
-gboolean e2k_rule_extract_propvalue (guint8 **ptr, int *len,
+gboolean e2k_rule_extract_propvalue (guint8 **ptr, gint *len,
 				     E2kPropValue *pv);
 void     e2k_rule_free_propvalue    (E2kPropValue *pv);
 
diff --git a/servers/exchange/lib/e2k-security-descriptor.c b/servers/exchange/lib/e2k-security-descriptor.c
index 6c24126..65fbbef 100644
--- a/servers/exchange/lib/e2k-security-descriptor.c
+++ b/servers/exchange/lib/e2k-security-descriptor.c
@@ -115,7 +115,7 @@ static E2kPermissionsMap permissions_map[] = {
 	{ E2K_PERMISSION_FOLDER_VISIBLE,
 	  LE(0x1208a9), LE(0x1200a9), LE(0x000000), LE(0x000000) }
 };
-static const int permissions_map_size =
+static const gint permissions_map_size =
 	sizeof (permissions_map) / sizeof (permissions_map[0]);
 
 static const guint32 container_permissions_all = LE(0x1fc9bf);
@@ -185,7 +185,7 @@ ace_compar (E2k_ACE *ace1, E2k_ACE *ace2, E2kSecurityDescriptor *sd)
 {
 	E2kSidType t1;
 	E2kSidType t2;
-	int order1, order2;
+	gint order1, order2;
 
 	if (ace1 == ace2)
 		return 0;
@@ -277,7 +277,7 @@ ace_compar (E2k_ACE *ace1, E2k_ACE *ace2, E2kSecurityDescriptor *sd)
 
 
 static xmlNode *
-find_child (xmlNode *node, const char *name)
+find_child (xmlNode *node, const gchar *name)
 {
 	for (node = node->xmlChildrenNode; node; node = node->next) {
 		if (node->name && !strcmp (node->name, name))
@@ -290,7 +290,7 @@ static void
 extract_sids (E2kSecurityDescriptor *sd, xmlNodePtr node)
 {
 	xmlNodePtr string_sid_node, type_node, display_name_node;
-	char *string_sid, *content, *display_name;
+	gchar *string_sid, *content, *display_name;
 	const guint8 *bsid;
 	E2kSid *sid;
 	E2kSidType type;
@@ -340,7 +340,7 @@ extract_sids (E2kSecurityDescriptor *sd, xmlNodePtr node)
 			continue;
 		}
 
-		g_hash_table_insert (sd->priv->sids, (char *)bsid, sid);
+		g_hash_table_insert (sd->priv->sids, (gchar *)bsid, sid);
 	}
 }
 
@@ -348,7 +348,7 @@ static gboolean
 parse_sid (E2kSecurityDescriptor *sd, GByteArray *binsd, guint16 *off,
 	   E2kSid **sid)
 {
-	int sid_len;
+	gint sid_len;
 
 	if (binsd->len - *off < E2K_SID_BINARY_SID_MIN_LEN)
 		return FALSE;
@@ -367,7 +367,7 @@ parse_acl (E2kSecurityDescriptor *sd, GByteArray *binsd, guint16 *off)
 {
 	E2k_ACL aclbuf;
 	E2k_ACE acebuf;
-	int ace_count, i;
+	gint ace_count, i;
 
 	if (binsd->len - *off < sizeof (E2k_ACL))
 		return FALSE;
@@ -404,7 +404,7 @@ parse_acl (E2kSecurityDescriptor *sd, GByteArray *binsd, guint16 *off)
 			return FALSE;
 
 		if (!g_hash_table_lookup (sd->priv->sid_order, acebuf.Sid)) {
-			int size = g_hash_table_size (sd->priv->sid_order);
+			gint size = g_hash_table_size (sd->priv->sid_order);
 
 			g_hash_table_insert (sd->priv->sid_order, acebuf.Sid,
 					     GUINT_TO_POINTER (size + 1));
@@ -469,7 +469,7 @@ e2k_security_descriptor_new (xmlNodePtr xml_form, GByteArray *binary_form)
 		e2k_sid_new_from_string_sid (E2K_SID_TYPE_WELL_KNOWN_GROUP,
 					     E2K_SID_WKS_EVERYONE, NULL);
 	g_hash_table_insert (sd->priv->sids,
-			     (char *)e2k_sid_get_binary_sid (sd->priv->default_sid),
+			     (gchar *)e2k_sid_get_binary_sid (sd->priv->default_sid),
 			     sd->priv->default_sid);
 	extract_sids (sd, xml_form);
 
@@ -507,7 +507,7 @@ e2k_security_descriptor_to_binary (E2kSecurityDescriptor *sd)
 	E2k_SECURITY_DESCRIPTOR_RELATIVE sdbuf;
 	E2k_ACL aclbuf;
 	E2k_ACE *aces;
-	int off, ace, last_ace = -1, acl_size, ace_count;
+	gint off, ace, last_ace = -1, acl_size, ace_count;
 	const guint8 *bsid;
 
 	g_return_val_if_fail (E2K_IS_SECURITY_DESCRIPTOR (sd), NULL);
@@ -617,7 +617,7 @@ e2k_security_descriptor_get_sids (E2kSecurityDescriptor *sd)
 	GList *sids = NULL;
 	GHashTable *added_sids;
 	E2k_ACE *aces;
-	int ace;
+	gint ace;
 
 	g_return_val_if_fail (E2K_IS_SECURITY_DESCRIPTOR (sd), NULL);
 
@@ -649,7 +649,7 @@ e2k_security_descriptor_remove_sid (E2kSecurityDescriptor *sd,
 				    E2kSid *sid)
 {
 	E2k_ACE *aces;
-	int ace;
+	gint ace;
 
 	g_return_if_fail (E2K_IS_SECURITY_DESCRIPTOR (sd));
 	g_return_if_fail (E2K_IS_SID (sid));
@@ -692,7 +692,7 @@ e2k_security_descriptor_get_permissions (E2kSecurityDescriptor *sd,
 {
 	E2k_ACE *aces;
 	guint32 mapi_perms, checkperm;
-	int ace, map;
+	gint ace, map;
 
 	g_return_val_if_fail (E2K_IS_SECURITY_DESCRIPTOR (sd), 0);
 	g_return_val_if_fail (E2K_IS_SID (sid), 0);
@@ -736,7 +736,7 @@ static void
 set_ace (E2kSecurityDescriptor *sd, E2k_ACE *ace)
 {
 	E2k_ACE *aces = (E2k_ACE *)sd->priv->aces->data;
-	int low, mid = 0, high, cmp = -1;
+	gint low, mid = 0, high, cmp = -1;
 
 	low = 0;
 	high = sd->priv->aces->len - 1;
@@ -776,7 +776,7 @@ e2k_security_descriptor_set_permissions (E2kSecurityDescriptor *sd,
 	guint32 container_allowed, container_denied;
 	const guint8 *bsid;
 	E2kSid *sid2;
-	int map;
+	gint map;
 
 	g_return_if_fail (E2K_IS_SECURITY_DESCRIPTOR (sd));
 	g_return_if_fail (E2K_IS_SID (sid));
@@ -784,9 +784,9 @@ e2k_security_descriptor_set_permissions (E2kSecurityDescriptor *sd,
 	bsid = e2k_sid_get_binary_sid (sid);
 	sid2 = g_hash_table_lookup (sd->priv->sids, bsid);
 	if (!sid2) {
-		int size = g_hash_table_size (sd->priv->sid_order);
+		gint size = g_hash_table_size (sd->priv->sid_order);
 
-		g_hash_table_insert (sd->priv->sids, (char *)bsid, sid);
+		g_hash_table_insert (sd->priv->sids, (gchar *)bsid, sid);
 		g_object_ref (sid);
 
 		g_hash_table_insert (sd->priv->sid_order, sid,
@@ -839,7 +839,7 @@ e2k_security_descriptor_set_permissions (E2kSecurityDescriptor *sd,
 
 
 static struct {
-	const char *name;
+	const gchar *name;
 	guint32 perms;
 } roles[E2K_PERMISSIONS_ROLE_NUM_ROLES] = {
 	/* i18n: These are Outlook's words for the default roles in
@@ -899,7 +899,7 @@ static struct {
  *
  * Return value: the name
  **/
-const char *
+const gchar *
 e2k_permissions_role_get_name (E2kPermissionsRole role)
 {
 	if (role == E2K_PERMISSIONS_ROLE_CUSTOM)
@@ -940,7 +940,7 @@ e2k_permissions_role_get_perms (E2kPermissionsRole role)
 E2kPermissionsRole
 e2k_permissions_role_find (guint perms)
 {
-	int role;
+	gint role;
 
 	/* "Folder contact" isn't actually a permission, and is ignored
 	 * for purposes of roles.
diff --git a/servers/exchange/lib/e2k-security-descriptor.h b/servers/exchange/lib/e2k-security-descriptor.h
index 492387a..15fff71 100644
--- a/servers/exchange/lib/e2k-security-descriptor.h
+++ b/servers/exchange/lib/e2k-security-descriptor.h
@@ -73,7 +73,7 @@ typedef enum {
 	E2K_PERMISSIONS_ROLE_CUSTOM = -1
 } E2kPermissionsRole;
 
-const char        *e2k_permissions_role_get_name  (E2kPermissionsRole role);
+const gchar        *e2k_permissions_role_get_name  (E2kPermissionsRole role);
 guint32            e2k_permissions_role_get_perms (E2kPermissionsRole role);
 
 E2kPermissionsRole e2k_permissions_role_find      (guint perms);
diff --git a/servers/exchange/lib/e2k-sid.c b/servers/exchange/lib/e2k-sid.c
index 6f2d0fa..7a95096 100644
--- a/servers/exchange/lib/e2k-sid.c
+++ b/servers/exchange/lib/e2k-sid.c
@@ -40,8 +40,8 @@ typedef struct {
 struct _E2kSidPrivate {
 	E2kSidType type;
 	E2kSid_SID *binary_sid;
-	char *string_sid;
-	char *display_name;
+	gchar *string_sid;
+	gchar *display_name;
 };
 
 #define PARENT_TYPE G_TYPE_OBJECT
@@ -87,8 +87,8 @@ dispose (GObject *object)
 E2K_MAKE_TYPE (e2k_sid, E2kSid, class_init, init, PARENT_TYPE)
 
 static E2kSid *
-sid_new_internal (E2kSidType type, const char *display_name,
-		  const char *string_sid, const guint8 *binary_sid)
+sid_new_internal (E2kSidType type, const gchar *display_name,
+		  const gchar *string_sid, const guint8 *binary_sid)
 {
 	E2kSid *sid;
 
@@ -129,8 +129,8 @@ sid_new_internal (E2kSidType type, const char *display_name,
  * Return value: the new SID
  **/
 E2kSid *
-e2k_sid_new_from_string_sid (E2kSidType type, const char *string_sid,
-			     const char *display_name)
+e2k_sid_new_from_string_sid (E2kSidType type, const gchar *string_sid,
+			     const gchar *display_name)
 {
 	g_return_val_if_fail (string_sid != NULL, NULL);
 
@@ -154,7 +154,7 @@ e2k_sid_new_from_string_sid (E2kSidType type, const char *string_sid,
 E2kSid *
 e2k_sid_new_from_binary_sid (E2kSidType    type,
 			     const guint8 *binary_sid,
-			     const char   *display_name)
+			     const gchar   *display_name)
 {
 	g_return_val_if_fail (binary_sid != NULL, NULL);
 
@@ -185,14 +185,14 @@ e2k_sid_get_sid_type (E2kSid *sid)
  *
  * Return value: the string SID
  **/
-const char *
+const gchar *
 e2k_sid_get_string_sid (E2kSid *sid)
 {
 	g_return_val_if_fail (E2K_IS_SID (sid), NULL);
 
 	if (!sid->priv->string_sid) {
 		GString *string;
-		int sa;
+		gint sa;
 
 		string = g_string_new (NULL);
 
@@ -230,9 +230,9 @@ e2k_sid_get_binary_sid (E2kSid *sid)
 	g_return_val_if_fail (E2K_IS_SID (sid), NULL);
 
 	if (!sid->priv->binary_sid) {
-		int sa, subauth_count;
+		gint sa, subauth_count;
 		guint32 subauthority;
-		char *p;
+		gchar *p;
 
 		p = sid->priv->string_sid + 4;
 		subauth_count = 0;
@@ -265,7 +265,7 @@ e2k_sid_get_binary_sid (E2kSid *sid)
  *
  * Return value: the UTF-8 display name
  **/
-const char *
+const gchar *
 e2k_sid_get_display_name (E2kSid *sid)
 {
 	g_return_val_if_fail (E2K_IS_SID (sid), NULL);
diff --git a/servers/exchange/lib/e2k-sid.h b/servers/exchange/lib/e2k-sid.h
index 382ddc9..777dcdb 100644
--- a/servers/exchange/lib/e2k-sid.h
+++ b/servers/exchange/lib/e2k-sid.h
@@ -41,16 +41,16 @@ struct _E2kSidClass {
 GType         e2k_sid_get_type            (void);
 
 E2kSid       *e2k_sid_new_from_string_sid (E2kSidType     type,
-					   const char    *string_sid,
-					   const char    *display_name);
+					   const gchar    *string_sid,
+					   const gchar    *display_name);
 E2kSid       *e2k_sid_new_from_binary_sid (E2kSidType     type,
 					   const guint8  *binary_sid,
-					   const char    *display_name);
+					   const gchar    *display_name);
 
 E2kSidType    e2k_sid_get_sid_type        (E2kSid        *sid);
-const char   *e2k_sid_get_string_sid      (E2kSid        *sid);
+const gchar   *e2k_sid_get_string_sid      (E2kSid        *sid);
 const guint8 *e2k_sid_get_binary_sid      (E2kSid        *sid);
-const char   *e2k_sid_get_display_name    (E2kSid        *sid);
+const gchar   *e2k_sid_get_display_name    (E2kSid        *sid);
 
 #define E2K_SID_BINARY_SID_MIN_LEN   8
 #define E2K_SID_BINARY_SID_LEN(bsid) (8 + ((guint8 *)bsid)[1] * 4)
diff --git a/servers/exchange/lib/e2k-uri.c b/servers/exchange/lib/e2k-uri.c
index 85aeb6f..d8c681f 100644
--- a/servers/exchange/lib/e2k-uri.c
+++ b/servers/exchange/lib/e2k-uri.c
@@ -37,11 +37,11 @@
  * Return value: a parsed %E2kUri
  **/
 E2kUri *
-e2k_uri_new (const char *uri_string)
+e2k_uri_new (const gchar *uri_string)
 {
 	E2kUri *uri;
-	const char *end, *hash, *colon, *semi, *at, *slash;
-	const char *question, *p;
+	const gchar *end, *hash, *colon, *semi, *at, *slash;
+	const gchar *question, *p;
 
 	uri = g_new0 (E2kUri, 1);
 
@@ -74,7 +74,7 @@ e2k_uri_new (const char *uri_string)
 		slash = uri_string + strcspn (uri_string, "/#");
 		at = strchr (uri_string, '@');
 		if (at && at < slash) {
-			char *backslash;
+			gchar *backslash;
 
 			colon = strchr (uri_string, ':');
 			if (colon && colon < at) {
@@ -141,8 +141,8 @@ e2k_uri_new (const char *uri_string)
 	semi = memchr (uri_string, ';', end - uri_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);
@@ -208,8 +208,8 @@ e2k_uri_free (E2kUri *uri)
  *
  * Return value: the value of @name, or %NULL if it is not set
  **/
-const char *
-e2k_uri_get_param (E2kUri *uri, const char *name)
+const gchar *
+e2k_uri_get_param (E2kUri *uri, const gchar *name)
 {
 	return g_datalist_get_data (&uri->params, name);
 }
@@ -224,7 +224,7 @@ e2k_uri_get_param (E2kUri *uri, const char *name)
  * Undoes URI-escaping in @part in-place.
  **/
 void
-e2k_uri_decode (char *part)
+e2k_uri_decode (gchar *part)
 {
 	guchar *s, *d;
 
@@ -242,7 +242,7 @@ e2k_uri_decode (char *part)
 	*d = '\0';
 }
 
-static const int uri_encoded_char[] = {
+static const gint uri_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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2,  /*  ' ' - '/'  */
@@ -277,10 +277,10 @@ static const int uri_encoded_char[] = {
  * e2k_uri_append_encoded() will encode any "/"s passed in.
  **/
 void
-e2k_uri_append_encoded (GString *str, const char *in,
-			gboolean wss_encode, const char *extra_enc_chars)
+e2k_uri_append_encoded (GString *str, const gchar *in,
+			gboolean wss_encode, const gchar *extra_enc_chars)
 {
-	const unsigned char *s = (const unsigned char *)in;
+	const guchar *s = (const guchar *)in;
 
 	while (*s) {
 		if (extra_enc_chars && strchr (extra_enc_chars, *s))
@@ -327,12 +327,12 @@ e2k_uri_append_encoded (GString *str, const char *in,
  *
  * Return value: the encoded string
  **/
-char *
-e2k_uri_encode (const char *in, gboolean wss_encode,
-		const char *extra_enc_chars)
+gchar *
+e2k_uri_encode (const gchar *in, gboolean wss_encode,
+		const gchar *extra_enc_chars)
 {
 	GString *string;
-	char *out;
+	gchar *out;
 
 	string = g_string_new (NULL);
 	e2k_uri_append_encoded (string, in, wss_encode, extra_enc_chars);
@@ -353,10 +353,10 @@ e2k_uri_encode (const char *in, gboolean wss_encode,
  *
  * Return value: the path component of @uri_string.
  **/
-const char *
-e2k_uri_path (const char *uri_string)
+const gchar *
+e2k_uri_path (const gchar *uri_string)
 {
-	const char *p;
+	const gchar *p;
 
 	p = strchr (uri_string, ':');
 	if (p++) {
@@ -381,10 +381,10 @@ e2k_uri_path (const char *uri_string)
  *
  * Return value: the new URI
  **/
-char *
-e2k_uri_concat (const char *uri_prefix, const char *tail)
+gchar *
+e2k_uri_concat (const gchar *uri_prefix, const gchar *tail)
 {
-	const char *p;
+	const gchar *p;
 
 	p = strrchr (uri_prefix, '/');
 	if (p && !p[1])
@@ -404,10 +404,10 @@ e2k_uri_concat (const char *uri_prefix, const char *tail)
  *
  * Return value: the relative URI
  **/
-const char *
-e2k_uri_relative (const char *uri_prefix, const char *uri)
+const gchar *
+e2k_uri_relative (const gchar *uri_prefix, const gchar *uri)
 {
-	int prefix_len = strlen (uri_prefix);
+	gint prefix_len = strlen (uri_prefix);
 
 	if (!strncmp (uri_prefix, uri, prefix_len)) {
 		uri += prefix_len;
diff --git a/servers/exchange/lib/e2k-uri.h b/servers/exchange/lib/e2k-uri.h
index 77fe5a3..27d0293 100644
--- a/servers/exchange/lib/e2k-uri.h
+++ b/servers/exchange/lib/e2k-uri.h
@@ -7,36 +7,36 @@
 #include <glib.h>
 
 typedef struct {
-	char  *protocol;
-	char  *user;
-	char  *domain;
-	char  *authmech;
-	char  *passwd;
-	char  *host;
-	int    port;
-	char  *path;
+	gchar  *protocol;
+	gchar  *user;
+	gchar  *domain;
+	gchar  *authmech;
+	gchar  *passwd;
+	gchar  *host;
+	gint    port;
+	gchar  *path;
 	GData *params;
-	char  *query;
-	char  *fragment;
+	gchar  *query;
+	gchar  *fragment;
 } E2kUri;
 
 
-E2kUri *    e2k_uri_new       (const char *uri_string);
+E2kUri *    e2k_uri_new       (const gchar *uri_string);
 void        e2k_uri_free      (E2kUri *uri);
-const char *e2k_uri_get_param (E2kUri *uri, const char *name);
+const gchar *e2k_uri_get_param (E2kUri *uri, const gchar *name);
 
-void        e2k_uri_decode         (char *part);
-char *      e2k_uri_encode         (const char *in,
+void        e2k_uri_decode         (gchar *part);
+gchar *      e2k_uri_encode         (const gchar *in,
 				    gboolean    wss_encode,
-				    const char *extra_enc_chars);
+				    const gchar *extra_enc_chars);
 void        e2k_uri_append_encoded (GString    *str,
-				    const char *in,
+				    const gchar *in,
 				    gboolean    wss_encode,
-				    const char *extra_enc_chars);
+				    const gchar *extra_enc_chars);
 
-const char *e2k_uri_path      (const char *uri_string);
+const gchar *e2k_uri_path      (const gchar *uri_string);
 
-char       *e2k_uri_concat    (const char *uri_prefix, const char *tail);
-const char *e2k_uri_relative  (const char *uri_prefix, const char *uri);
+gchar       *e2k_uri_concat    (const gchar *uri_prefix, const gchar *tail);
+const gchar *e2k_uri_relative  (const gchar *uri_prefix, const gchar *uri);
 
 #endif /* E2K_URI_H */
diff --git a/servers/exchange/lib/e2k-utils.c b/servers/exchange/lib/e2k-utils.c
index efbd12d..8852e0a 100644
--- a/servers/exchange/lib/e2k-utils.c
+++ b/servers/exchange/lib/e2k-utils.c
@@ -33,7 +33,7 @@
 #include <string.h>
 
 /* Do not internationalize */
-const char *e2k_rfc822_months [] = {
+const gchar *e2k_rfc822_months [] = {
 	"Jan", "Feb", "Mar", "Apr", "May", "Jun",
 	"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
 };
@@ -54,26 +54,26 @@ const char *e2k_rfc822_months [] = {
  * error.
  **/
 time_t
-e2k_parse_timestamp (const char *timestamp)
+e2k_parse_timestamp (const gchar *timestamp)
 {
 	struct tm tm;
 
-	tm.tm_year = strtoul (timestamp, (char **)&timestamp, 10) - 1900;
+	tm.tm_year = strtoul (timestamp, (gchar **)&timestamp, 10) - 1900;
 	if (*timestamp++ != '-')
 		return -1;
-	tm.tm_mon = strtoul (timestamp, (char **)&timestamp, 10) - 1;
+	tm.tm_mon = strtoul (timestamp, (gchar **)&timestamp, 10) - 1;
 	if (*timestamp++ != '-')
 		return -1;
-	tm.tm_mday = strtoul (timestamp, (char **)&timestamp, 10);
+	tm.tm_mday = strtoul (timestamp, (gchar **)&timestamp, 10);
 	if (*timestamp++ != 'T')
 		return -1;
-	tm.tm_hour = strtoul (timestamp, (char **)&timestamp, 10);
+	tm.tm_hour = strtoul (timestamp, (gchar **)&timestamp, 10);
 	if (*timestamp++ != ':')
 		return -1;
-	tm.tm_min = strtoul (timestamp, (char **)&timestamp, 10);
+	tm.tm_min = strtoul (timestamp, (gchar **)&timestamp, 10);
 	if (*timestamp++ != ':')
 		return -1;
-	tm.tm_sec = strtoul (timestamp, (char **)&timestamp, 10);
+	tm.tm_sec = strtoul (timestamp, (gchar **)&timestamp, 10);
 	if (*timestamp != '.' && *timestamp != 'Z')
 		return -1;
 
@@ -89,7 +89,7 @@ e2k_parse_timestamp (const char *timestamp)
  *
  * Return value: the timestamp, which the caller must free.
  **/
-char *
+gchar *
 e2k_make_timestamp (time_t when)
 {
 	struct tm *tm;
@@ -109,11 +109,11 @@ e2k_make_timestamp (time_t when)
  *
  * Return value: the timestamp, which the caller must free.
  **/
-char *
+gchar *
 e2k_make_timestamp_rfc822 (time_t when)
 {
 	struct tm tm;
-	int offset;
+	gint offset;
 
 	e_localtime_with_offset (when, &tm, &offset);
 	offset = (offset / 3600) * 100 + (offset / 60) % 60;
@@ -202,12 +202,12 @@ e2k_filetime_from_time_t (time_t tt)
  *
  * Return value: the converted text, which the caller must free.
  **/
-char *
-e2k_lf_to_crlf (const char *in)
+gchar *
+e2k_lf_to_crlf (const gchar *in)
 {
-	int len;
-	const char *s;
-	char *out, *d;
+	gint len;
+	const gchar *s;
+	gchar *out, *d;
 
 	g_return_val_if_fail (in != NULL, NULL);
 
@@ -235,12 +235,12 @@ e2k_lf_to_crlf (const char *in)
  *
  * Return value: the converted text, which the caller must free.
  **/
-char *
-e2k_crlf_to_lf (const char *in)
+gchar *
+e2k_crlf_to_lf (const gchar *in)
 {
-	int len;
-	const char *s;
-	char *out;
+	gint len;
+	const gchar *s;
+	gchar *out;
 	GString *str;
 
 	g_return_val_if_fail (in != NULL, NULL);
@@ -268,10 +268,10 @@ e2k_crlf_to_lf (const char *in)
  *
  * Return value: the path, which the caller must free
  **/
-char *
-e2k_strdup_with_trailing_slash (const char *path)
+gchar *
+e2k_strdup_with_trailing_slash (const gchar *path)
 {
-	char *p;
+	gchar *p;
 
 	if (!path || !*path)
 		return NULL;
@@ -292,14 +292,14 @@ e2k_strdup_with_trailing_slash (const char *path)
  *
  * Return value: the entryid, which is a pointer into @entryid's data.
  **/
-const char *
+const gchar *
 e2k_entryid_to_dn (GByteArray *entryid)
 {
-	char *p;
+	gchar *p;
 
-	p = ((char *)entryid->data) + entryid->len - 1;
+	p = ((gchar *)entryid->data) + entryid->len - 1;
 	if (*p == 0) {
-		while (*(p - 1) && p > (char *)entryid->data)
+		while (*(p - 1) && p > (gchar *)entryid->data)
 			p--;
 		if (*p == '/')
 			return p;
@@ -310,7 +310,7 @@ e2k_entryid_to_dn (GByteArray *entryid)
 static void
 append_permanenturl_section (GString *url, guint8 *entryid)
 {
-	int i = 0;
+	gint i = 0;
 
 	/* First part */
 	while (i < 16)
@@ -344,11 +344,11 @@ append_permanenturl_section (GString *url, guint8 *entryid)
  *
  * Return value: the permanenturl, which the caller must free.
  **/
-char *
-e2k_entryid_to_permanenturl (GByteArray *entryid, const char *base_uri)
+gchar *
+e2k_entryid_to_permanenturl (GByteArray *entryid, const gchar *base_uri)
 {
 	GString *url;
-	char *ret;
+	gchar *ret;
 
 	g_return_val_if_fail (entryid->len == 22 || entryid->len == 44, NULL);
 
@@ -372,11 +372,11 @@ e2k_entryid_to_permanenturl (GByteArray *entryid, const char *base_uri)
 #define HEXVAL(c) (isdigit (c) ? (c) - '0' : g_ascii_tolower (c) - 'a' + 10)
 
 static gboolean
-append_entryid_section (GByteArray *entryid, const char **permanenturl)
+append_entryid_section (GByteArray *entryid, const gchar **permanenturl)
 {
-	const char *p;
-	char buf[44], byte;
-	int endlen;
+	const gchar *p;
+	gchar buf[44], byte;
+	gint endlen;
 
 	p = *permanenturl;
 	if (strspn (p, "0123456789abcdefABCDEF") != 32)
@@ -413,7 +413,7 @@ append_entryid_section (GByteArray *entryid, const char **permanenturl)
  * Return value: the entryid
  **/
 GByteArray *
-e2k_permanenturl_to_entryid (const char *permanenturl)
+e2k_permanenturl_to_entryid (const gchar *permanenturl)
 {
 	GByteArray *entryid;
 
@@ -462,7 +462,7 @@ e2k_ascii_strcase_hash (gconstpointer v)
 {
 	/* case-insensitive g_str_hash */
 
-	const unsigned char *p = v;
+	const guchar *p = v;
 	guint h = g_ascii_tolower (*p);
 
 	if (h) {
@@ -484,7 +484,7 @@ e2k_ascii_strcase_hash (gconstpointer v)
 gboolean
 e2k_restriction_folders_only (E2kRestriction *rn)
 {
-	int i;
+	gint i;
 
 	if (!rn)
 		return FALSE;
@@ -525,7 +525,7 @@ e2k_restriction_folders_only (E2kRestriction *rn)
 }
 
 /* From MAPIDEFS.H */
-static const char MAPI_ONE_OFF_UID[] = {
+static const gchar MAPI_ONE_OFF_UID[] = {
 	0x81, 0x2b, 0x1f, 0xa4, 0xbe, 0xa3, 0x10, 0x19,
 	0x9d, 0x6e, 0x00, 0xdd, 0x01, 0x0f, 0x54, 0x02
 };
@@ -547,7 +547,7 @@ static const char MAPI_ONE_OFF_UID[] = {
  * Return value: the recipient ENTRYID
  **/
 GByteArray *
-e2k_entryid_generate_oneoff (const char *display_name, const char *email, gboolean unicode)
+e2k_entryid_generate_oneoff (const gchar *display_name, const gchar *email, gboolean unicode)
 {
 	GByteArray *entryid;
 
@@ -574,7 +574,7 @@ e2k_entryid_generate_oneoff (const char *display_name, const char *email, gboole
 	return entryid;
 }
 
-static const char MAPI_LOCAL_UID[] = {
+static const gchar MAPI_LOCAL_UID[] = {
 	0xdc, 0xa7, 0x40, 0xc8, 0xc0, 0x42, 0x10, 0x1a,
 	0xb4, 0xb9, 0x08, 0x00, 0x2b, 0x2f, 0xe1, 0x82
 };
@@ -590,7 +590,7 @@ static const char MAPI_LOCAL_UID[] = {
  * Return value: the recipient ENTRYID
  **/
 GByteArray *
-e2k_entryid_generate_local (const char *exchange_dn)
+e2k_entryid_generate_local (const gchar *exchange_dn)
 {
 	GByteArray *entryid;
 
@@ -605,7 +605,7 @@ e2k_entryid_generate_local (const char *exchange_dn)
 	return entryid;
 }
 
-static const char MAPI_CONTACT_UID[] = {
+static const gchar MAPI_CONTACT_UID[] = {
 	0xfe, 0x42, 0xaa, 0x0a, 0x18, 0xc7, 0x1a, 0x10,
 	0xe8, 0x85, 0x0b, 0x65, 0x1c, 0x24, 0x00, 0x00
 };
@@ -623,7 +623,7 @@ static const char MAPI_CONTACT_UID[] = {
  * Return value: the recipient ENTRYID
  **/
 GByteArray *
-e2k_entryid_generate_contact (GByteArray *contact_entryid, int nth_address)
+e2k_entryid_generate_contact (GByteArray *contact_entryid, gint nth_address)
 {
 	GByteArray *entryid;
 
@@ -650,7 +650,7 @@ e2k_entryid_generate_contact (GByteArray *contact_entryid, int nth_address)
  * Return value: the search key
  **/
 GByteArray *
-e2k_search_key_generate (const char *addrtype, const char *address)
+e2k_search_key_generate (const gchar *addrtype, const gchar *address)
 {
 	GByteArray *search_key;
 	guint8 *p;
diff --git a/servers/exchange/lib/e2k-utils.h b/servers/exchange/lib/e2k-utils.h
index cf8e216..cc71398 100644
--- a/servers/exchange/lib/e2k-utils.h
+++ b/servers/exchange/lib/e2k-utils.h
@@ -7,9 +7,9 @@
 #include <time.h>
 #include "e2k-types.h"
 
-time_t  e2k_parse_timestamp       (const char *timestamp);
-char   *e2k_make_timestamp        (time_t when);
-char   *e2k_make_timestamp_rfc822 (time_t when);
+time_t  e2k_parse_timestamp       (const gchar *timestamp);
+gchar   *e2k_make_timestamp        (time_t when);
+gchar   *e2k_make_timestamp_rfc822 (time_t when);
 
 time_t  e2k_systime_to_time_t     (guint32 systime);
 guint32 e2k_systime_from_time_t   (time_t tt);
@@ -17,16 +17,16 @@ guint32 e2k_systime_from_time_t   (time_t tt);
 time_t  e2k_filetime_to_time_t    (guint64 filetime);
 guint64 e2k_filetime_from_time_t  (time_t tt);
 
-char *e2k_lf_to_crlf (const char *in);
-char *e2k_crlf_to_lf (const char *in);
+gchar *e2k_lf_to_crlf (const gchar *in);
+gchar *e2k_crlf_to_lf (const gchar *in);
 
-char *e2k_strdup_with_trailing_slash (const char *path);
+gchar *e2k_strdup_with_trailing_slash (const gchar *path);
 
-const char *e2k_entryid_to_dn           (GByteArray *entryid);
+const gchar *e2k_entryid_to_dn           (GByteArray *entryid);
 
-char       *e2k_entryid_to_permanenturl (GByteArray *entryid,
-					 const char *base_uri);
-GByteArray *e2k_permanenturl_to_entryid (const char *permanenturl);
+gchar       *e2k_entryid_to_permanenturl (GByteArray *entryid,
+					 const gchar *base_uri);
+GByteArray *e2k_permanenturl_to_entryid (const gchar *permanenturl);
 
 gint  e2k_ascii_strcase_equal (gconstpointer v,
 			       gconstpointer v2);
@@ -34,13 +34,13 @@ guint e2k_ascii_strcase_hash  (gconstpointer v);
 
 gboolean e2k_restriction_folders_only (E2kRestriction *rn);
 
-GByteArray *e2k_entryid_generate_oneoff  (const char *display_name,
-					  const char *email,
+GByteArray *e2k_entryid_generate_oneoff  (const gchar *display_name,
+					  const gchar *email,
 					  gboolean    unicode);
-GByteArray *e2k_entryid_generate_local   (const char *exchange_dn);
+GByteArray *e2k_entryid_generate_local   (const gchar *exchange_dn);
 GByteArray *e2k_entryid_generate_contact (GByteArray *contact_entryid,
-					  int         nth_address);
-GByteArray *e2k_search_key_generate      (const char *addrtype,
-					  const char *address);
+					  gint         nth_address);
+GByteArray *e2k_search_key_generate      (const gchar *addrtype,
+					  const gchar *address);
 
 #endif /* E2K_UTILS_H */
diff --git a/servers/exchange/lib/e2k-validate.h b/servers/exchange/lib/e2k-validate.h
index a0fd9b7..8d80ecc 100644
--- a/servers/exchange/lib/e2k-validate.h
+++ b/servers/exchange/lib/e2k-validate.h
@@ -20,11 +20,11 @@ typedef enum {
 } E2kAutoconfigGalAuthPref;
 
 typedef struct {
-        char *host;
-        char *ad_server;
+        gchar *host;
+        gchar *ad_server;
 	E2kAutoconfigGalAuthPref ad_auth;
-        char *mailbox;
-        char *owa_path;
+        gchar *mailbox;
+        gchar *owa_path;
 	gboolean is_ntlm;
 }ExchangeParams;
 
@@ -47,7 +47,7 @@ typedef enum {
 	E2K_AUTOCONFIG_FAILED
 } E2kAutoconfigResult;
 
-gboolean e2k_validate_user (const char *owa_url, char *key, char **user,
+gboolean e2k_validate_user (const gchar *owa_url, gchar *key, gchar **user,
 			    ExchangeParams *exchange_params,
 			    gboolean *remember_password,
 			    E2kAutoconfigResult *result,
diff --git a/servers/exchange/lib/e2k-xml-utils.c b/servers/exchange/lib/e2k-xml-utils.c
index 626d015..074f721 100644
--- a/servers/exchange/lib/e2k-xml-utils.c
+++ b/servers/exchange/lib/e2k-xml-utils.c
@@ -28,7 +28,7 @@
 #include <libxml/xmlmemory.h>
 
 static void
-my_xml_parser_error_handler (void *ctx, const char *msg, ...)
+my_xml_parser_error_handler (gpointer ctx, const gchar *msg, ...)
 {
 	;
 }
@@ -43,7 +43,7 @@ my_xml_parser_error_handler (void *ctx, const char *msg, ...)
  * Return value: a pointer to an #xmlDoc
  **/
 xmlDoc *
-e2k_parse_xml (const char *buf, int len)
+e2k_parse_xml (const gchar *buf, gint len)
 {
 	static xmlSAXHandler *sax;
 	xmlParserCtxtPtr ctxt;
@@ -105,7 +105,7 @@ e2k_parse_xml (const char *buf, int len)
  * Return value: a pointer to an #xmlDoc
  **/
 xmlDoc *
-e2k_parse_html (const char *buf, int len)
+e2k_parse_html (const gchar *buf, gint len)
 {
 	xmlDoc *doc;
 #if LIBXML_VERSION > 20600
@@ -140,7 +140,7 @@ e2k_parse_html (const char *buf, int len)
 	htmlFreeParserCtxt (ctxt);
 
 #else /* LIBXML_VERSION <= 20600 */
-	char *buf_copy = g_strndup (buf, len);
+	gchar *buf_copy = g_strndup (buf, len);
 
 	doc = htmlParseDoc (buf_copy, NULL);
 	g_free (buf_copy);
@@ -158,7 +158,7 @@ e2k_parse_html (const char *buf, int len)
  * unencoded in XML text (eg, "<").
  **/
 void
-e2k_g_string_append_xml_escaped (GString *string, const char *value)
+e2k_g_string_append_xml_escaped (GString *string, const gchar *value)
 {
 	while (*value) {
 		switch (*value) {
@@ -200,7 +200,7 @@ e2k_g_string_append_xml_escaped (GString *string, const char *value)
  * there are no more matches.
  **/
 xmlNode *
-e2k_xml_find (xmlNode *node, const char *name)
+e2k_xml_find (xmlNode *node, const gchar *name)
 {
 	return e2k_xml_find_in (node, NULL, name);
 }
@@ -225,7 +225,7 @@ e2k_xml_find (xmlNode *node, const char *name)
  * there are no more matches.
  **/
 xmlNode *
-e2k_xml_find_in (xmlNode *node, xmlNode *top, const char *name)
+e2k_xml_find_in (xmlNode *node, xmlNode *top, const gchar *name)
 {
 	g_return_val_if_fail (name != NULL, NULL);
 
diff --git a/servers/exchange/lib/e2k-xml-utils.h b/servers/exchange/lib/e2k-xml-utils.h
index c26be08..7c26bbc 100644
--- a/servers/exchange/lib/e2k-xml-utils.h
+++ b/servers/exchange/lib/e2k-xml-utils.h
@@ -11,14 +11,14 @@
 
 #define E2K_XML_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"
 
-xmlDoc *e2k_parse_xml  (const char *buf, int len);
-xmlDoc *e2k_parse_html (const char *buf, int len);
+xmlDoc *e2k_parse_xml  (const gchar *buf, gint len);
+xmlDoc *e2k_parse_html (const gchar *buf, gint len);
 
 #define E2K_IS_NODE(node, nspace, nname) (!strcmp (node->name, nname) && node->ns && !strcmp (node->ns->href, nspace))
 
-void  e2k_g_string_append_xml_escaped (GString *string, const char *value);
+void  e2k_g_string_append_xml_escaped (GString *string, const gchar *value);
 
-xmlNode *e2k_xml_find    (xmlNode *node, const char *name);
-xmlNode *e2k_xml_find_in (xmlNode *node, xmlNode *top, const char *name);
+xmlNode *e2k_xml_find    (xmlNode *node, const gchar *name);
+xmlNode *e2k_xml_find_in (xmlNode *node, xmlNode *top, const gchar *name);
 
 #endif
diff --git a/servers/exchange/lib/ebrowse.c b/servers/exchange/lib/ebrowse.c
index cbdf707..60d5006 100644
--- a/servers/exchange/lib/ebrowse.c
+++ b/servers/exchange/lib/ebrowse.c
@@ -50,20 +50,20 @@
 static E2kContext *ctx;
 static E2kOperation op;
 
-static const char *folder_tree_props[] = {
+static const gchar *folder_tree_props[] = {
 	E2K_PR_DAV_DISPLAY_NAME,
 	E2K_PR_EXCHANGE_FOLDER_CLASS
 };
-static const int n_folder_tree_props = sizeof (folder_tree_props) / sizeof (folder_tree_props[0]);
+static const gint n_folder_tree_props = sizeof (folder_tree_props) / sizeof (folder_tree_props[0]);
 
 static void
-display_folder_tree (E2kContext *ctx, char *top)
+display_folder_tree (E2kContext *ctx, gchar *top)
 {
 	E2kRestriction *rn;
 	E2kResultIter *iter;
 	E2kResult *result;
-	int status;
-	const char *name, *class;
+	gint status;
+	const gchar *name, *class;
 
 	e2k_operation_init (&op);
 	rn = e2k_restriction_prop_bool (E2K_PR_DAV_IS_COLLECTION,
@@ -91,13 +91,13 @@ display_folder_tree (E2kContext *ctx, char *top)
 }
 
 static void
-list_contents (E2kContext *ctx, char *top, gboolean reverse)
+list_contents (E2kContext *ctx, gchar *top, gboolean reverse)
 {
 	E2kRestriction *rn;
 	E2kResultIter *iter;
 	E2kResult *result;
-	const char *prop;
-	int status;
+	const gchar *prop;
+	gint status;
 
 	e2k_operation_init (&op);
 	prop = E2K_PR_DAV_DISPLAY_NAME;
@@ -110,7 +110,7 @@ list_contents (E2kContext *ctx, char *top, gboolean reverse)
 	while ((result = e2k_result_iter_next (iter))) {
 		printf ("%3d %s (%s)\n", e2k_result_iter_get_index (iter),
 			result->href,
-			(char *)e2k_properties_get_prop (result->props,
+			(gchar *)e2k_properties_get_prop (result->props,
 							 E2K_PR_DAV_DISPLAY_NAME));
 	}
 	status = e2k_result_iter_free (iter);
@@ -121,16 +121,16 @@ list_contents (E2kContext *ctx, char *top, gboolean reverse)
 }
 
 static int
-mp_compar (const void *k, const void *m)
+mp_compar (gconstpointer k, gconstpointer m)
 {
-	const char *key = k;
-	struct mapi_proptag *mp = (void *)m;
+	const gchar *key = k;
+	struct mapi_proptag *mp = (gpointer)m;
 
 	return strncmp (key, mp->proptag, 5);
 }
 
 static void
-print_propname (const char *propname)
+print_propname (const gchar *propname)
 {
 	struct mapi_proptag *mp;
 
@@ -149,7 +149,7 @@ print_propname (const char *propname)
 static void
 print_binary (GByteArray *data)
 {
-	unsigned char *start, *end, *p;
+	guchar *start, *end, *p;
 
 	end = data->data + data->len;
 	for (start = data->data; start < end; start += 16) {
@@ -166,16 +166,16 @@ print_binary (GByteArray *data)
 }
 
 typedef struct {
-	const char *propname;
+	const gchar *propname;
 	E2kPropType type;
 	gpointer value;
 } EBrowseProp;
 
 static int
-prop_compar (const void *a, const void *b)
+prop_compar (gconstpointer a, gconstpointer b)
 {
-	EBrowseProp **pa = (void *)a;
-	EBrowseProp **pb = (void *)b;
+	EBrowseProp **pa = (gpointer)a;
+	EBrowseProp **pb = (gpointer)b;
 
 	return strcmp ((*pa)->propname, (*pb)->propname);
 }
@@ -194,17 +194,17 @@ print_prop (EBrowseProp *prop)
 	case E2K_PROP_TYPE_INT_ARRAY:
 	{
 		GPtrArray *array = prop->value;
-		int i;
+		gint i;
 
 		for (i = 0; i < array->len; i++)
-			printf ("    %s\n", (char *)array->pdata[i]);
+			printf ("    %s\n", (gchar *)array->pdata[i]);
 		break;
 	}
 
 	case E2K_PROP_TYPE_BINARY_ARRAY:
 	{
 		GPtrArray *array = prop->value;
-		int i;
+		gint i;
 
 		for (i = 0; i < array->len; i++) {
 			print_binary (array->pdata[i]);
@@ -219,13 +219,13 @@ print_prop (EBrowseProp *prop)
 
 	case E2K_PROP_TYPE_STRING:
 	default:
-		printf ("    %s\n", (char *)prop->value);
+		printf ("    %s\n", (gchar *)prop->value);
 		break;
 	}
 }
 
 static void
-add_prop (const char *propname, E2kPropType type, gpointer value, gpointer props)
+add_prop (const gchar *propname, E2kPropType type, gpointer value, gpointer props)
 {
 	EBrowseProp *prop;
 
@@ -237,10 +237,10 @@ add_prop (const char *propname, E2kPropType type, gpointer value, gpointer props
 }
 
 static void
-print_properties (E2kResult *results, int nresults)
+print_properties (E2kResult *results, gint nresults)
 {
 	GPtrArray *props;
-	int i;
+	gint i;
 
 	if (nresults != 1) {
 		printf ("Got %d results?\n", nresults);
@@ -263,7 +263,7 @@ static void
 got_all_properties (SoupMessage *msg, gpointer ctx)
 {
 	E2kResult *results;
-	int nresults;
+	gint nresults;
 
 	test_abort_if_http_error (msg->status_code);
 
@@ -283,7 +283,7 @@ got_all_properties (SoupMessage *msg, gpointer ctx)
 "</propfind>"
 
 static void
-get_all_properties (E2kContext *ctx, char *uri)
+get_all_properties (E2kContext *ctx, gchar *uri)
 {
 	SoupMessage *msg;
 
@@ -297,11 +297,11 @@ get_all_properties (E2kContext *ctx, char *uri)
 }
 
 static void
-get_property (E2kContext *ctx, char *uri, char *prop)
+get_property (E2kContext *ctx, gchar *uri, gchar *prop)
 {
 	E2kHTTPStatus status;
 	E2kResult *results;
-	int nresults, i;
+	gint nresults, i;
 
 	if (!strncmp (prop, "PR_", 3)) {
 		for (i = 0; i < nmapi_proptags; i++)
@@ -315,7 +315,7 @@ get_property (E2kContext *ctx, char *uri, char *prop)
 
 	e2k_operation_init (&op);
 	status = e2k_context_propfind (ctx, &op, uri,
-				       (const char **)&prop, 1,
+				       (const gchar **)&prop, 1,
 				       &results, &nresults);
 	e2k_operation_free (&op);
 	test_abort_if_http_error (status);
@@ -324,14 +324,14 @@ get_property (E2kContext *ctx, char *uri, char *prop)
 }
 
 static void
-get_fav_properties(E2kContext *ctx, char *uri)
+get_fav_properties(E2kContext *ctx, gchar *uri)
 {
 	E2kRestriction *rn;
 	E2kResultIter *iter;
 	E2kResult *result;
-	const char *prop;
-	int status;
-	char *eml_str, *top = uri, fav_uri[1024];
+	const gchar *prop;
+	gint status;
+	gchar *eml_str, *top = uri, fav_uri[1024];
 
 
 	/* list the contents and search for the favorite properties */
@@ -378,15 +378,15 @@ get_fav_properties(E2kContext *ctx, char *uri)
 }
 
 static void
-get_sd (E2kContext *ctx, char *uri)
+get_sd (E2kContext *ctx, gchar *uri)
 {
-	const char *props[] = {
+	const gchar *props[] = {
 		E2K_PR_EXCHANGE_SD_BINARY,
 		E2K_PR_EXCHANGE_SD_XML,
 	};
 	E2kHTTPStatus status;
 	E2kResult *results;
-	int nresults;
+	gint nresults;
 	xmlNodePtr xml_form;
 	GByteArray *binary_form;
 	E2kSecurityDescriptor *sd;
@@ -444,11 +444,11 @@ get_sd (E2kContext *ctx, char *uri)
 }
 
 static void
-get_body (E2kContext *ctx, char *uri)
+get_body (E2kContext *ctx, gchar *uri)
 {
 	E2kHTTPStatus status;
-	char *body;
-	int len;
+	gchar *body;
+	gint len;
 
 	e2k_operation_init (&op);
 	status = e2k_context_get (ctx, &op, uri, NULL, &body, &len);
@@ -460,7 +460,7 @@ get_body (E2kContext *ctx, char *uri)
 }
 
 static void
-delete (E2kContext *ctx, char *uri)
+delete (E2kContext *ctx, gchar *uri)
 {
 	E2kHTTPStatus status;
 
@@ -472,7 +472,7 @@ delete (E2kContext *ctx, char *uri)
 }
 
 static void
-notify (E2kContext *ctx, const char *uri,
+notify (E2kContext *ctx, const gchar *uri,
 	E2kContextChangeType type, gpointer user_data)
 {
 	switch (type) {
@@ -492,7 +492,7 @@ notify (E2kContext *ctx, const char *uri,
 }
 
 static void
-subscribe (E2kContext *ctx, char *uri)
+subscribe (E2kContext *ctx, gchar *uri)
 {
 	e2k_context_subscribe (ctx, uri,
 			       E2K_CONTEXT_OBJECT_CHANGED, 0,
@@ -509,7 +509,7 @@ subscribe (E2kContext *ctx, char *uri)
 }
 
 static void
-move (E2kContext *ctx, char *from, char *to, gboolean delete)
+move (E2kContext *ctx, gchar *from, gchar *to, gboolean delete)
 {
 	GPtrArray *source_hrefs;
 	E2kResultIter *iter;
@@ -530,7 +530,7 @@ move (E2kContext *ctx, char *from, char *to, gboolean delete)
 			printf ("Failed: %d\n", result->status);
 		else {
 			printf ("moved to %s\n",
-				(char *)e2k_properties_get_prop (result->props,
+				(gchar *)e2k_properties_get_prop (result->props,
 								 E2K_PR_DAV_LOCATION));
 		}
 	}
@@ -542,14 +542,14 @@ move (E2kContext *ctx, char *from, char *to, gboolean delete)
 }
 
 static void
-name (E2kContext *ctx, char *alias, char *uri_prefix)
+name (E2kContext *ctx, gchar *alias, gchar *uri_prefix)
 {
 	E2kHTTPStatus status;
-	char *uri, *body;
-	int len;
+	gchar *uri, *body;
+	gint len;
 	xmlDoc *doc;
 	xmlNode *item, *node;
-	char *data;
+	gchar *data;
 
 	uri = g_strdup_printf ("%s?Cmd=galfind&AN=%s", uri_prefix, alias);
 	e2k_operation_init (&op);
@@ -580,11 +580,11 @@ name (E2kContext *ctx, char *alias, char *uri_prefix)
 }
 
 static void
-put (E2kContext *ctx, const char *file, const char *uri)
+put (E2kContext *ctx, const gchar *file, const gchar *uri)
 {
 	struct stat st;
-	char *buf;
-	int fd;
+	gchar *buf;
+	gint fd;
 	E2kHTTPStatus status;
 
 	fd = open (file, O_RDONLY);
@@ -605,15 +605,15 @@ put (E2kContext *ctx, const char *file, const char *uri)
 	test_quit ();
 }
 
-static void *
-cancel (void *op)
+static gpointer
+cancel (gpointer op)
 {
 	e2k_operation_cancel (op);
 	return NULL;
 }
 
 static void
-quit (int sig)
+quit (gint sig)
 {
 	static pthread_t cancel_thread;
 
@@ -643,12 +643,12 @@ usage (void)
 	exit (1);
 }
 
-const char *test_program_name = "ebrowse";
+const gchar *test_program_name = "ebrowse";
 
 void
-test_main (int argc, char **argv)
+test_main (gint argc, gchar **argv)
 {
-	char *uri;
+	gchar *uri;
 
 	signal (SIGINT, quit);
 
diff --git a/servers/exchange/lib/fbtest.c b/servers/exchange/lib/fbtest.c
index 7f8e2f0..1adcebb 100644
--- a/servers/exchange/lib/fbtest.c
+++ b/servers/exchange/lib/fbtest.c
@@ -33,20 +33,20 @@
 #include "e2k-global-catalog.h"
 #include "test-utils.h"
 
-const char *test_program_name = "fbtest";
+const gchar *test_program_name = "fbtest";
 
 void
-test_main (int argc, char **argv)
+test_main (gint argc, gchar **argv)
 {
 	E2kGlobalCatalog *gc;
 	E2kGlobalCatalogStatus status;
 	E2kGlobalCatalogEntry *entry;
-	const char *server, *email;
+	const gchar *server, *email;
 	E2kContext *ctx;
 	E2kFreebusy *fb;
 	E2kFreebusyEvent event;
-	int ti, bi, oi;
-	char *public_uri;
+	gint ti, bi, oi;
+	gchar *public_uri;
 	struct tm tm;
 	time_t t;
 
diff --git a/servers/exchange/lib/gctest.c b/servers/exchange/lib/gctest.c
index a7056dc..750e10e 100644
--- a/servers/exchange/lib/gctest.c
+++ b/servers/exchange/lib/gctest.c
@@ -37,13 +37,13 @@ E2kGlobalCatalog *gc;
 E2kOperation op;
 
 static void
-do_lookup (E2kGlobalCatalog *gc, const char *user)
+do_lookup (E2kGlobalCatalog *gc, const gchar *user)
 {
 	E2kGlobalCatalogStatus status;
 	E2kGlobalCatalogEntry *entry;
 	E2kGlobalCatalogLookupType type;
 	guint32 flags;
-	int i, pwd_exp_days;
+	gint i, pwd_exp_days;
 	double maxAge;
 
 	if (*user == '/')
@@ -99,12 +99,12 @@ do_lookup (E2kGlobalCatalog *gc, const char *user)
 	if (entry->delegates) {
 		printf ("  delegates:\n");
 		for (i = 0; i < entry->delegates->len; i++)
-			printf ("    %s\n", (char *)entry->delegates->pdata[i]);
+			printf ("    %s\n", (gchar *)entry->delegates->pdata[i]);
 	}
 	if (entry->delegators) {
 		printf ("  delegators:\n");
 		for (i = 0; i < entry->delegators->len; i++)
-			printf ("    %s\n", (char *)entry->delegators->pdata[i]);
+			printf ("    %s\n", (gchar *)entry->delegators->pdata[i]);
 	}
 
 	if (entry->quota_warn || entry->quota_nosend || entry->quota_norecv )
@@ -130,13 +130,13 @@ do_lookup (E2kGlobalCatalog *gc, const char *user)
 	test_quit ();
 }
 
-static char *
-lookup_dn (E2kGlobalCatalog *gc, const char *id)
+static gchar *
+lookup_dn (E2kGlobalCatalog *gc, const gchar *id)
 {
 	E2kGlobalCatalogEntry *entry;
 	E2kGlobalCatalogLookupType type;
 	E2kGlobalCatalogStatus status;
-	char *dn;
+	gchar *dn;
 
 	if (id[0] == '/')
 		type = E2K_GLOBAL_CATALOG_LOOKUP_BY_LEGACY_EXCHANGE_DN;
@@ -169,10 +169,10 @@ lookup_dn (E2kGlobalCatalog *gc, const char *id)
 }
 
 static void
-do_modify (E2kGlobalCatalog *gc, const char *user,
-	   int deleg_op, const char *delegate)
+do_modify (E2kGlobalCatalog *gc, const gchar *user,
+	   gint deleg_op, const gchar *delegate)
 {
-	char *self_dn, *deleg_dn;
+	gchar *self_dn, *deleg_dn;
 	E2kGlobalCatalogStatus status;
 
 	self_dn = lookup_dn (gc, user);
@@ -206,15 +206,15 @@ do_modify (E2kGlobalCatalog *gc, const char *user,
 	test_quit ();
 }
 
-static void *
-cancel (void *data)
+static gpointer
+cancel (gpointer data)
 {
 	e2k_operation_cancel (&op);
 	return NULL;
 }
 
 static void
-quit (int sig)
+quit (gint sig)
 {
 	static pthread_t cancel_thread;
 
@@ -224,12 +224,12 @@ quit (int sig)
 		exit (0);
 }
 
-const char *test_program_name = "gctest";
+const gchar *test_program_name = "gctest";
 
 void
-test_main (int argc, char **argv)
+test_main (gint argc, gchar **argv)
 {
-	const char *server;
+	const gchar *server;
 
 	if (argc < 3 || argc > 4 ||
 	    (argc == 4 && argv[3][0] != '+' && argv[3][0] != '-')) {
diff --git a/servers/exchange/lib/ruletest.c b/servers/exchange/lib/ruletest.c
index 079c665..7cf0bd4 100644
--- a/servers/exchange/lib/ruletest.c
+++ b/servers/exchange/lib/ruletest.c
@@ -32,21 +32,21 @@
 #include "e2k-rule-xml.h"
 #include "test-utils.h"
 
-const char *test_program_name = "ruletest";
+const gchar *test_program_name = "ruletest";
 
-static const char *rules_props[] = {
+static const gchar *rules_props[] = {
 	PR_RULES_DATA,
 };
-static const int n_rules_props = sizeof (rules_props) / sizeof (rules_props[0]);
+static const gint n_rules_props = sizeof (rules_props) / sizeof (rules_props[0]);
 
 void
-test_main (int argc, char **argv)
+test_main (gint argc, gchar **argv)
 {
-	const char *url;
+	const gchar *url;
 	E2kContext *ctx;
 	E2kHTTPStatus status;
 	E2kResult *results;
-	int nresults;
+	gint nresults;
 	GByteArray *ba;
 	E2kRules *rules;
 	xmlDoc *doc;
diff --git a/servers/exchange/lib/test-utils.c b/servers/exchange/lib/test-utils.c
index 9c9793e..5d40881 100644
--- a/servers/exchange/lib/test-utils.c
+++ b/servers/exchange/lib/test-utils.c
@@ -34,7 +34,7 @@
 
 #include "test-utils.h"
 
-extern const char *test_program_name;
+extern const gchar *test_program_name;
 
 /**
  * test_ask_password:
@@ -45,13 +45,13 @@ extern const char *test_program_name;
  *
  * Return value: the password (or %NULL if stdin is not a tty).
  **/
-char *
-test_ask_password (const char *prompt)
+gchar *
+test_ask_password (const gchar *prompt)
 {
-	char *password;
+	gchar *password;
 	struct termios t;
-	int old_lflag;
-	char buf[80];
+	gint old_lflag;
+	gchar buf[80];
 
 	if (tcgetattr (STDIN_FILENO, &t) != 0)
 		return NULL;
@@ -88,17 +88,17 @@ test_ask_password (const char *prompt)
  *
  * Return value: the password, or %NULL if it could not be determined.
  **/
-const char *
-test_get_password (const char *user, const char *host)
+const gchar *
+test_get_password (const gchar *user, const gchar *host)
 {
-	static char *password = NULL;
-	char *prompt;
+	static gchar *password = NULL;
+	gchar *prompt;
 
 	if (password)
 		return password;
 
 	if (host) {
-		char *key;
+		gchar *key;
 
 		key = g_strdup_printf ("exchange://%s %s", user, host);
 		password = e_passwords_get_password ("Exchange", key);
@@ -131,7 +131,7 @@ test_get_password (const char *user, const char *host)
  * test_get_context() will exit the program).
  **/
 E2kContext *
-test_get_context (const char *uri)
+test_get_context (const gchar *uri)
 {
 	E2kContext *ctx;
 	E2kUri *euri;
@@ -166,11 +166,11 @@ test_get_context (const char *uri)
  * test_get_gc() will exit the program).
  **/
 E2kGlobalCatalog *
-test_get_gc (const char *server)
+test_get_gc (const gchar *server)
 {
 	E2kGlobalCatalog *gc;
-	const char *password;
-	char *user, *p;
+	const gchar *password;
+	gchar *user, *p;
 
 	if (strchr (server, '@')) {
 		user = g_strdup (server);
@@ -191,8 +191,8 @@ test_get_gc (const char *server)
 	return gc;
 }
 
-static char **global_argv;
-static int global_argc;
+static gchar **global_argv;
+static gint global_argc;
 static GMainLoop *loop;
 
 /**
@@ -243,8 +243,8 @@ idle_run (gpointer data)
 	return FALSE;
 }
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	gtk_init (&argc, &argv);
 
diff --git a/servers/exchange/lib/test-utils.h b/servers/exchange/lib/test-utils.h
index 9d2fa0b..df8be68 100644
--- a/servers/exchange/lib/test-utils.h
+++ b/servers/exchange/lib/test-utils.h
@@ -7,19 +7,19 @@
 #include "e2k-types.h"
 #include "e2k-http-utils.h"
 
-void              test_main                (int             argc,
-					    char          **argv);
+void              test_main                (gint             argc,
+					    gchar          **argv);
 void              test_quit                (void);
 
-const char       *test_get_password        (const char     *user,
-					    const char     *host);
-E2kContext       *test_get_context         (const char     *uri);
-E2kGlobalCatalog *test_get_gc              (const char     *server);
+const gchar       *test_get_password        (const gchar     *user,
+					    const gchar     *host);
+E2kContext       *test_get_context         (const gchar     *uri);
+E2kGlobalCatalog *test_get_gc              (const gchar     *server);
 
 void              test_abort_if_http_error (E2kHTTPStatus   status);
 
 
 /* lower-level util */
-char             *test_ask_password        (const char     *prompt);
+gchar             *test_ask_password        (const gchar     *prompt);
 
 #endif /* TEST_UTILS_H */
diff --git a/servers/exchange/lib/urltest.c b/servers/exchange/lib/urltest.c
index 8a2f853..5e13fa9 100644
--- a/servers/exchange/lib/urltest.c
+++ b/servers/exchange/lib/urltest.c
@@ -33,11 +33,11 @@
 #include "e2k-uri.h"
 #include "test-utils.h"
 
-const char *test_program_name = "urltest";
+const gchar *test_program_name = "urltest";
 
 static void
 dump_uri (E2kUri *euri) {
-	const char *temp;
+	const gchar *temp;
 
 	printf ("URI contents \n");
 	printf ("==================== \n");
@@ -141,9 +141,9 @@ dump_uri (E2kUri *euri) {
 }
 
 void
-test_main (int argc, char **argv)
+test_main (gint argc, gchar **argv)
 {
-	const char *url;
+	const gchar *url;
 	E2kUri *euri;
 
 	if (argc != 2) {
diff --git a/servers/exchange/storage/e-folder-exchange.c b/servers/exchange/storage/e-folder-exchange.c
index 856831e..44ffdac 100644
--- a/servers/exchange/storage/e-folder-exchange.c
+++ b/servers/exchange/storage/e-folder-exchange.c
@@ -50,10 +50,10 @@
 
 struct _EFolderExchangePrivate {
 	ExchangeHierarchy *hier;
-	char *internal_uri, *permanent_uri;
-	char *outlook_class, *storage_dir;
-	char *path;
-	long long int folder_size;
+	gchar *internal_uri, *permanent_uri;
+	gchar *outlook_class, *storage_dir;
+	gchar *path;
+	gint64 folder_size;
 	gboolean has_subfolders;
 	gboolean rescan_tree;
 };
@@ -115,11 +115,11 @@ finalize (GObject *object)
 
 E2K_MAKE_TYPE (e_folder_exchange, EFolderExchange, class_init, init, PARENT_TYPE)
 
-static char *
-sanitize_path (const char *path)
+static gchar *
+sanitize_path (const gchar *path)
 {
 	gchar **comps;
-	char *new_path = NULL;
+	gchar *new_path = NULL;
 
 	if (!path)
 		return g_strdup("");	/* ??? or NULL? */
@@ -148,13 +148,13 @@ sanitize_path (const char *path)
  * Return value: a new #EFolderExchange
  **/
 EFolder *
-e_folder_exchange_new (ExchangeHierarchy *hier, const char *name,
-		       const char *type, const char *outlook_class,
-		       const char *physical_uri, const char *internal_uri)
+e_folder_exchange_new (ExchangeHierarchy *hier, const gchar *name,
+		       const gchar *type, const gchar *outlook_class,
+		       const gchar *physical_uri, const gchar *internal_uri)
 {
 	EFolderExchange *efe;
 	EFolder *ef;
-	char *sanitized_path;
+	gchar *sanitized_path;
 
 	g_return_val_if_fail (EXCHANGE_IS_HIERARCHY (hier), NULL);
 	g_return_val_if_fail (name != NULL, NULL);
@@ -222,7 +222,7 @@ e_folder_exchange_new (ExchangeHierarchy *hier, const char *name,
  *
  * Return value: @folder's internal (http/https) URI
  **/
-const char *
+const gchar *
 e_folder_exchange_get_internal_uri (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
@@ -239,7 +239,7 @@ e_folder_exchange_get_internal_uri (EFolder *folder)
  * from the server.
  **/
 void
-e_folder_exchange_set_internal_uri (EFolder *folder, const char *internal_uri)
+e_folder_exchange_set_internal_uri (EFolder *folder, const gchar *internal_uri)
 {
 	EFolderExchange *efe;
 
@@ -257,7 +257,7 @@ e_folder_exchange_set_internal_uri (EFolder *folder, const char *internal_uri)
  *
  * Return value: @folder's path within its Evolution storage
  **/
-const char *
+const gchar *
 e_folder_exchange_get_path (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
@@ -274,7 +274,7 @@ e_folder_exchange_get_path (EFolder *folder)
  *
  * Return value: @folder's permanent URI
  **/
-const char *
+const gchar *
 e_folder_exchange_get_permanent_uri (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
@@ -291,7 +291,7 @@ e_folder_exchange_get_permanent_uri (EFolder *folder)
  * previously been unset).
  **/
 void
-e_folder_exchange_set_permanent_uri (EFolder *folder, const char *permanent_uri)
+e_folder_exchange_set_permanent_uri (EFolder *folder, const gchar *permanent_uri)
 {
 	EFolderExchange *efe;
 
@@ -328,7 +328,7 @@ e_folder_exchange_get_folder_size (EFolder *folder)
  * Sets @folder's folder_size
  **/
 void
-e_folder_exchange_set_folder_size (EFolder *folder, long long int folder_size)
+e_folder_exchange_set_folder_size (EFolder *folder, gint64 folder_size)
 {
 	EFolderExchange *efe;
 
@@ -406,7 +406,7 @@ e_folder_exchange_set_rescan_tree (EFolder *folder,
  *
  * Return value: @folder's Outlook IPM class
  **/
-const char *
+const gchar *
 e_folder_exchange_get_outlook_class (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
@@ -438,11 +438,11 @@ e_folder_exchange_get_hierarchy (EFolder *folder)
  *
  * Return value: the full filename, which must be freed.
  **/
-char *
-e_folder_exchange_get_storage_file (EFolder *folder, const char *filename)
+gchar *
+e_folder_exchange_get_storage_file (EFolder *folder, const gchar *filename)
 {
 	EFolderExchange *efe;
-	char *path;
+	gchar *path;
 
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
 
@@ -470,15 +470,15 @@ e_folder_exchange_get_storage_file (EFolder *folder, const char *filename)
  * Return value: success or failure
  **/
 gboolean
-e_folder_exchange_save_to_file (EFolder *folder, const char *filename)
+e_folder_exchange_save_to_file (EFolder *folder, const gchar *filename)
 {
 	xmlDoc *doc;
 	xmlNode *root;
-	const char *name, *type, *outlook_class;
-	const char *physical_uri, *internal_uri, *permanent_uri;
-	char *folder_size;
-	long long int fsize;
-	int status;
+	const gchar *name, *type, *outlook_class;
+	const gchar *physical_uri, *internal_uri, *permanent_uri;
+	gchar *folder_size;
+	gint64 fsize;
+	gint status;
 
 	name = e_folder_get_name (folder);
 	type = e_folder_get_type_string (folder);
@@ -531,16 +531,16 @@ e_folder_exchange_save_to_file (EFolder *folder, const char *filename)
  * Return value: the folder, or %NULL on a failed load.
  **/
 EFolder *
-e_folder_exchange_new_from_file (ExchangeHierarchy *hier, const char *filename)
+e_folder_exchange_new_from_file (ExchangeHierarchy *hier, const gchar *filename)
 {
 	EFolder *folder = NULL;
 	xmlDoc *doc;
 	xmlNode *root, *node;
-	char *version, *display_name = NULL;
-	char *type = NULL, *outlook_class = NULL;
-	char *physical_uri = NULL, *internal_uri = NULL;
-	char *permanent_uri = NULL;
-	char *folder_size = NULL;
+	gchar *version, *display_name = NULL;
+	gchar *type = NULL, *outlook_class = NULL;
+	gchar *physical_uri = NULL, *internal_uri = NULL;
+	gchar *permanent_uri = NULL;
+	gchar *folder_size = NULL;
 
 	doc = e_xml_parse_file (filename);
 
@@ -643,8 +643,8 @@ e_folder_exchange_new_from_file (ExchangeHierarchy *hier, const char *filename)
  **/
 E2kHTTPStatus
 e_folder_exchange_propfind (EFolder *folder, E2kOperation *op,
-			    const char **props, int nprops,
-			    E2kResult **results, int *nresults)
+			    const gchar **props, gint nprops,
+			    E2kResult **results, gint *nresults)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), E2K_HTTP_MALFORMED);
 
@@ -671,8 +671,8 @@ e_folder_exchange_propfind (EFolder *folder, E2kOperation *op,
  **/
 E2kResultIter *
 e_folder_exchange_bpropfind_start (EFolder *folder, E2kOperation *op,
-				   const char **hrefs, int nhrefs,
-				   const char **props, int nprops)
+				   const gchar **hrefs, gint nhrefs,
+				   const gchar **props, gint nprops)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
 
@@ -699,8 +699,8 @@ e_folder_exchange_bpropfind_start (EFolder *folder, E2kOperation *op,
  **/
 E2kResultIter *
 e_folder_exchange_search_start (EFolder *folder, E2kOperation *op,
-				const char **props, int nprops,
-				E2kRestriction *rn, const char *orderby,
+				const gchar **props, gint nprops,
+				E2kRestriction *rn, const gchar *orderby,
 				gboolean ascending)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
@@ -727,7 +727,7 @@ e_folder_exchange_search_start (EFolder *folder, E2kOperation *op,
  **/
 void
 e_folder_exchange_subscribe (EFolder *folder,
-			     E2kContextChangeType type, int min_interval,
+			     E2kContextChangeType type, gint min_interval,
 			     E2kContextChangeCallback callback,
 			     gpointer user_data)
 {
@@ -811,12 +811,12 @@ e_folder_exchange_transfer_start (EFolder *source, E2kOperation *op,
 E2kHTTPStatus
 e_folder_exchange_put_new (EFolder *folder,
 			   E2kOperation *op,
-			   const char *object_name,
+			   const gchar *object_name,
 			   E2kContextTestCallback test_callback,
 			   gpointer user_data,
-			   const char *content_type,
-			   const char *body, int length,
-			   char **location, char **repl_uid)
+			   const gchar *content_type,
+			   const gchar *body, gint length,
+			   gchar **location, gchar **repl_uid)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), E2K_HTTP_MALFORMED);
 
@@ -848,11 +848,11 @@ e_folder_exchange_put_new (EFolder *folder,
  **/
 E2kHTTPStatus
 e_folder_exchange_proppatch_new (EFolder *folder, E2kOperation *op,
-				 const char *object_name,
+				 const gchar *object_name,
 				 E2kContextTestCallback test_callback,
 				 gpointer user_data,
 				 E2kProperties *props,
-				 char **location, char **repl_uid)
+				 gchar **location, gchar **repl_uid)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), E2K_HTTP_MALFORMED);
 
@@ -880,7 +880,7 @@ e_folder_exchange_proppatch_new (EFolder *folder, E2kOperation *op,
  **/
 E2kResultIter *
 e_folder_exchange_bproppatch_start (EFolder *folder, E2kOperation *op,
-				    const char **hrefs, int nhrefs,
+				    const gchar **hrefs, gint nhrefs,
 				    E2kProperties *props, gboolean create)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
@@ -905,7 +905,7 @@ e_folder_exchange_bproppatch_start (EFolder *folder, E2kOperation *op,
  **/
 E2kResultIter *
 e_folder_exchange_bdelete_start (EFolder *folder, E2kOperation *op,
-				 const char **hrefs, int nhrefs)
+				 const gchar **hrefs, gint nhrefs)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
 
@@ -931,7 +931,7 @@ e_folder_exchange_bdelete_start (EFolder *folder, E2kOperation *op,
 E2kHTTPStatus
 e_folder_exchange_mkcol (EFolder *folder, E2kOperation *op,
 			 E2kProperties *props,
-			 char **permanent_url)
+			 gchar **permanent_url)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), E2K_HTTP_MALFORMED);
 
@@ -954,7 +954,7 @@ E2kHTTPStatus
 e_folder_exchange_delete (EFolder *folder, E2kOperation *op)
 {
 	ExchangeHierarchy *hier;
-	const char *folder_type, *physical_uri;
+	const gchar *folder_type, *physical_uri;
 
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), E2K_HTTP_MALFORMED);
 	/* remove ESources */
@@ -1007,7 +1007,7 @@ e_folder_exchange_delete (EFolder *folder, E2kOperation *op)
 E2kHTTPStatus
 e_folder_exchange_transfer_dir (EFolder *source, E2kOperation *op,
 				EFolder *dest, gboolean delete_original,
-				char **permanent_url)
+				gchar **permanent_url)
 {
 	g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (source), E2K_HTTP_MALFORMED);
 
diff --git a/servers/exchange/storage/e-folder-exchange.h b/servers/exchange/storage/e-folder-exchange.h
index 5be2570..6b5e968 100644
--- a/servers/exchange/storage/e-folder-exchange.h
+++ b/servers/exchange/storage/e-folder-exchange.h
@@ -33,30 +33,30 @@ struct _EFolderExchangeClass {
 GType       e_folder_exchange_get_type      (void);
 
 EFolder    *e_folder_exchange_new           (ExchangeHierarchy     *hier,
-					     const char            *name,
-					     const char            *type,
-					     const char            *outlook_class,
-					     const char            *phys_uri,
-					     const char            *int_uri);
+					     const gchar            *name,
+					     const gchar            *type,
+					     const gchar            *outlook_class,
+					     const gchar            *phys_uri,
+					     const gchar            *int_uri);
 
 EFolder    *e_folder_exchange_new_from_file (ExchangeHierarchy     *hier,
-					     const char            *filename);
+					     const gchar            *filename);
 gboolean    e_folder_exchange_save_to_file  (EFolder               *folder,
-					     const char            *filename);
+					     const gchar            *filename);
 
 
-const char *e_folder_exchange_get_internal_uri     (EFolder    *folder);
+const gchar *e_folder_exchange_get_internal_uri     (EFolder    *folder);
 void        e_folder_exchange_set_internal_uri     (EFolder    *folder,
-						    const char *internal_uri);
+						    const gchar *internal_uri);
 
-const char *e_folder_exchange_get_path             (EFolder    *folder);
+const gchar *e_folder_exchange_get_path             (EFolder    *folder);
 
-const char *e_folder_exchange_get_permanent_uri    (EFolder    *folder);
+const gchar *e_folder_exchange_get_permanent_uri    (EFolder    *folder);
 void        e_folder_exchange_set_permanent_uri    (EFolder    *folder,
-						    const char *permanent_uri);
+						    const gchar *permanent_uri);
 
 long long int	e_folder_exchange_get_folder_size (EFolder *folder);
-void		e_folder_exchange_set_folder_size (EFolder *folder, long long int folder_size);
+void		e_folder_exchange_set_folder_size (EFolder *folder, gint64 folder_size);
 
 gboolean    e_folder_exchange_get_has_subfolders   (EFolder    *folder);
 void        e_folder_exchange_set_has_subfolders   (EFolder    *folder,
@@ -66,10 +66,10 @@ gboolean    e_folder_exchange_get_rescan_tree   (EFolder    *folder);
 void        e_folder_exchange_set_rescan_tree   (EFolder    *folder,
 						 gboolean   has_subfolders);
 
-const char *e_folder_exchange_get_outlook_class    (EFolder    *folder);
+const gchar *e_folder_exchange_get_outlook_class    (EFolder    *folder);
 
-char       *e_folder_exchange_get_storage_file     (EFolder    *folder,
-						    const char *filename);
+gchar       *e_folder_exchange_get_storage_file     (EFolder    *folder,
+						    const gchar *filename);
 
 ExchangeHierarchy *e_folder_exchange_get_hierarchy (EFolder    *folder);
 
@@ -77,28 +77,28 @@ ExchangeHierarchy *e_folder_exchange_get_hierarchy (EFolder    *folder);
 /* E2kContext wrappers */
 E2kHTTPStatus  e_folder_exchange_propfind          (EFolder *folder,
 						    E2kOperation *op,
-						    const char **props,
-						    int nprops,
+						    const gchar **props,
+						    gint nprops,
 						    E2kResult **results,
-						    int *nresults);
+						    gint *nresults);
 E2kResultIter *e_folder_exchange_bpropfind_start   (EFolder *folder,
 						    E2kOperation *op,
-						    const char **hrefs,
-						    int nhrefs,
-						    const char **props,
-						    int nprops);
+						    const gchar **hrefs,
+						    gint nhrefs,
+						    const gchar **props,
+						    gint nprops);
 
 E2kResultIter *e_folder_exchange_search_start      (EFolder *folder,
 						    E2kOperation *op,
-						    const char **props,
-						    int nprops,
+						    const gchar **props,
+						    gint nprops,
 						    E2kRestriction *rn,
-						    const char *orderby,
+						    const gchar *orderby,
 						    gboolean ascending);
 
 void           e_folder_exchange_subscribe         (EFolder *folder,
 						    E2kContextChangeType,
-						    int min_interval,
+						    gint min_interval,
 						    E2kContextChangeCallback,
 						    gpointer user_data);
 void           e_folder_exchange_unsubscribe       (EFolder *folder);
@@ -112,47 +112,47 @@ E2kResultIter *e_folder_exchange_transfer_start    (EFolder *source,
 
 E2kHTTPStatus  e_folder_exchange_put_new           (EFolder *folder,
 						    E2kOperation *op,
-						    const char *object_name,
+						    const gchar *object_name,
 						    E2kContextTestCallback,
 						    gpointer user_data,
-						    const char *content_type,
-						    const char *body,
-						    int length,
-						    char **location,
-						    char **repl_uid);
+						    const gchar *content_type,
+						    const gchar *body,
+						    gint length,
+						    gchar **location,
+						    gchar **repl_uid);
 
 E2kHTTPStatus  e_folder_exchange_proppatch_new     (EFolder *folder,
 						    E2kOperation *op,
-						    const char *object_name,
+						    const gchar *object_name,
 						    E2kContextTestCallback,
 						    gpointer user_data,
 						    E2kProperties *props,
-						    char **location,
-						    char **repl_uid);
+						    gchar **location,
+						    gchar **repl_uid);
 
 E2kResultIter *e_folder_exchange_bproppatch_start  (EFolder *folder,
 						    E2kOperation *op,
-						    const char **hrefs,
-						    int nhrefs,
+						    const gchar **hrefs,
+						    gint nhrefs,
 						    E2kProperties *props,
 						    gboolean create);
 
 E2kResultIter *e_folder_exchange_bdelete_start     (EFolder *folder,
 						    E2kOperation *op,
-						    const char **hrefs,
-						    int nhrefs);
+						    const gchar **hrefs,
+						    gint nhrefs);
 
 E2kHTTPStatus  e_folder_exchange_mkcol             (EFolder *folder,
 						    E2kOperation *op,
 						    E2kProperties *props,
-						    char **permanent_url);
+						    gchar **permanent_url);
 E2kHTTPStatus  e_folder_exchange_delete            (EFolder *folder,
 						    E2kOperation *op);
 E2kHTTPStatus  e_folder_exchange_transfer_dir      (EFolder *source,
 						    E2kOperation *op,
 						    EFolder *dest,
 						    gboolean delete_original,
-						    char **permanent_url);
+						    gchar **permanent_url);
 
 
 #ifdef __cplusplus
diff --git a/servers/exchange/storage/e-folder-tree.c b/servers/exchange/storage/e-folder-tree.c
index cc13446..f4491f3 100644
--- a/servers/exchange/storage/e-folder-tree.c
+++ b/servers/exchange/storage/e-folder-tree.c
@@ -31,8 +31,8 @@
 
 struct Folder {
 	struct Folder *parent;
-	char *path;
-	void *data;
+	gchar *path;
+	gpointer data;
 	GList *subfolders;
 };
 typedef struct Folder Folder;
@@ -42,15 +42,15 @@ struct EFolderTree {
 	GHashTable *data_to_path;
 
 	EFolderDestroyNotify folder_destroy_notify;
-	void *folder_destroy_notify_closure;
+	gpointer folder_destroy_notify_closure;
 };
 
 /* Utility functions.  */
 
-static char *
-get_parent_path (const char *path)
+static gchar *
+get_parent_path (const gchar *path)
 {
-	const char *last_separator;
+	const gchar *last_separator;
 
 	g_assert (g_path_is_absolute (path));
 
@@ -66,7 +66,7 @@ static void
 traverse_subtree (EFolderTree *tree,
 		  Folder *root_folder,
 		  EFolderTreeForeachFunc foreach_func,
-		  void *data)
+		  gpointer data)
 {
 	GList *p;
 
@@ -85,8 +85,8 @@ traverse_subtree (EFolderTree *tree,
 /* Folder handling.  */
 
 static Folder *
-folder_new (const char *path,
-	    void *data)
+folder_new (const gchar *path,
+	    gpointer data)
 {
 	Folder *folder;
 
@@ -168,7 +168,7 @@ remove_folder (EFolderTree *folder_tree,
  **/
 EFolderTree *
 e_folder_tree_new (EFolderDestroyNotify folder_destroy_notify,
-		   void *closure)
+		   gpointer closure)
 {
 	EFolderTree *new;
 
@@ -219,13 +219,13 @@ e_folder_tree_destroy (EFolderTree *folder_tree)
  **/
 gboolean
 e_folder_tree_add (EFolderTree *folder_tree,
-		   const char *path,
-		   void *data)
+		   const gchar *path,
+		   gpointer data)
 {
 	Folder *parent_folder;
 	Folder *folder;
-	const char *existing_path;
-	char *parent_path;
+	const gchar *existing_path;
+	gchar *parent_path;
 
 	g_return_val_if_fail (folder_tree != NULL, FALSE);
 	g_return_val_if_fail (path != NULL, FALSE);
@@ -293,7 +293,7 @@ e_folder_tree_add (EFolderTree *folder_tree,
  **/
 gboolean
 e_folder_tree_remove (EFolderTree *folder_tree,
-		      const char *path)
+		      const gchar *path)
 {
 	Folder *folder;
 
@@ -311,11 +311,11 @@ e_folder_tree_remove (EFolderTree *folder_tree,
 
 static void
 count_nodes (EFolderTree *tree,
-	     const char *path,
-	     void *data,
-	     void *closure)
+	     const gchar *path,
+	     gpointer data,
+	     gpointer closure)
 {
-	int *count = closure;
+	gint *count = closure;
 
 	(*count)++;
 }
@@ -328,10 +328,10 @@ count_nodes (EFolderTree *tree,
  *
  * Return value: The number of folders in the tree
  **/
-int
+gint
 e_folder_tree_get_count (EFolderTree *folder_tree)
 {
-	int count = 0;
+	gint count = 0;
 
 	e_folder_tree_foreach (folder_tree, count_nodes, &count);
 
@@ -347,9 +347,9 @@ e_folder_tree_get_count (EFolderTree *folder_tree)
  *
  * Return value: The pointer to the data for the folder at @path.
  **/
-void *
+gpointer
 e_folder_tree_get_folder (EFolderTree *folder_tree,
-			  const char *path)
+			  const gchar *path)
 {
 	Folder *folder;
 
@@ -376,7 +376,7 @@ e_folder_tree_get_folder (EFolderTree *folder_tree,
  **/
 GList *
 e_folder_tree_get_subfolders (EFolderTree *folder_tree,
-			      const char *path)
+			      const gchar *path)
 {
 	Folder *folder;
 	GList *list;
@@ -413,7 +413,7 @@ e_folder_tree_get_subfolders (EFolderTree *folder_tree,
 void
 e_folder_tree_foreach (EFolderTree *folder_tree,
 		       EFolderTreeForeachFunc foreach_func,
-		       void *data)
+		       gpointer data)
 {
 	Folder *root_node;
 
@@ -439,12 +439,12 @@ e_folder_tree_foreach (EFolderTree *folder_tree,
  *
  * Return value: The path for the folder that holds that @data.
  **/
-const char *
+const gchar *
 e_folder_tree_get_path_for_data  (EFolderTree *folder_tree,
-				  const void *data)
+				  gconstpointer data)
 {
 	g_return_val_if_fail (folder_tree != NULL, NULL);
 	g_return_val_if_fail (data != NULL, NULL);
 
-	return (const char *) g_hash_table_lookup (folder_tree->data_to_path, data);
+	return (const gchar *) g_hash_table_lookup (folder_tree->data_to_path, data);
 }
diff --git a/servers/exchange/storage/e-folder-tree.h b/servers/exchange/storage/e-folder-tree.h
index 45aadeb..f41de66 100644
--- a/servers/exchange/storage/e-folder-tree.h
+++ b/servers/exchange/storage/e-folder-tree.h
@@ -27,8 +27,8 @@
 
 typedef struct EFolderTree EFolderTree;
 
-typedef void (* EFolderDestroyNotify)   (EFolderTree *tree, const char *path, void *data, void *closure);
-typedef void (* EFolderTreeForeachFunc) (EFolderTree *tree, const char *path, void *data, void *closure);
+typedef void (* EFolderDestroyNotify)   (EFolderTree *tree, const gchar *path, gpointer data, gpointer closure);
+typedef void (* EFolderTreeForeachFunc) (EFolderTree *tree, const gchar *path, gpointer data, gpointer closure);
 
 EFolderTree *e_folder_tree_new               (EFolderDestroyNotify    folder_destroy_notify,
 					      void                   *closure);
@@ -36,23 +36,23 @@ EFolderTree *e_folder_tree_new               (EFolderDestroyNotify    folder_des
 void        e_folder_tree_destroy            (EFolderTree            *folder_tree);
 
 gboolean    e_folder_tree_add                (EFolderTree            *folder_tree,
-					      const char             *path,
+					      const gchar             *path,
 					      void                   *data);
 gboolean    e_folder_tree_remove             (EFolderTree            *folder_tree,
-					      const char             *path);
+					      const gchar             *path);
 
-int         e_folder_tree_get_count          (EFolderTree            *folder_tree);
+gint         e_folder_tree_get_count          (EFolderTree            *folder_tree);
 
 void       *e_folder_tree_get_folder         (EFolderTree            *folder_tree,
-					      const char             *path);
+					      const gchar             *path);
 GList      *e_folder_tree_get_subfolders     (EFolderTree            *folder_tree,
-					      const char             *path);
+					      const gchar             *path);
 
 void        e_folder_tree_foreach            (EFolderTree            *folder_tree,
 					      EFolderTreeForeachFunc  foreach_func,
 					      void                   *data);
 
-const char *e_folder_tree_get_path_for_data  (EFolderTree            *folder_tree,
+const gchar *e_folder_tree_get_path_for_data  (EFolderTree            *folder_tree,
 					      const void             *data);
 
 #endif /* _E_FOLDER_TREE_H_ */
diff --git a/servers/exchange/storage/e-folder-type-registry.c b/servers/exchange/storage/e-folder-type-registry.c
index eec224f..0c19a78 100644
--- a/servers/exchange/storage/e-folder-type-registry.c
+++ b/servers/exchange/storage/e-folder-type-registry.c
@@ -30,15 +30,15 @@
 static GObjectClass *parent_class = NULL;
 
 typedef struct {
-	char *name;
-	char *icon_name;
+	gchar *name;
+	gchar *icon_name;
 
-	char *display_name;
-	char *description;
+	gchar *display_name;
+	gchar *description;
 
 	gboolean user_creatable;
 
-	GList *accepted_dnd_types; /* char * */
+	GList *accepted_dnd_types; /* gchar * */
 
 	GObject *handler;
 
@@ -51,16 +51,16 @@ struct EFolderTypeRegistryPrivate {
 /* FolderType handling.  */
 
 static FolderType *
-folder_type_new (const char *name,
-		 const char *icon_name,
-		 const char *display_name,
-		 const char *description,
+folder_type_new (const gchar *name,
+		 const gchar *icon_name,
+		 const gchar *display_name,
+		 const gchar *description,
 		 gboolean user_creatable,
-		 int num_accepted_dnd_types,
-		 const char **accepted_dnd_types)
+		 gint num_accepted_dnd_types,
+		 const gchar **accepted_dnd_types)
 {
 	FolderType *new;
-	int i;
+	gint i;
 
 	new = g_new0 (FolderType, 1);
 
@@ -98,7 +98,7 @@ folder_type_free (FolderType *folder_type)
 
 static FolderType *
 get_folder_type (EFolderTypeRegistry *folder_type_registry,
-		 const char *type_name)
+		 const gchar *type_name)
 {
 	EFolderTypeRegistryPrivate *priv;
 
@@ -109,13 +109,13 @@ get_folder_type (EFolderTypeRegistry *folder_type_registry,
 
 static gboolean
 register_folder_type (EFolderTypeRegistry *folder_type_registry,
-		      const char *name,
-		      const char *icon_name,
-		      const char *display_name,
-		      const char *description,
+		      const gchar *name,
+		      const gchar *icon_name,
+		      const gchar *display_name,
+		      const gchar *description,
 		      gboolean user_creatable,
-		      int num_accepted_dnd_types,
-		      const char **accepted_dnd_types)
+		      gint num_accepted_dnd_types,
+		      const gchar **accepted_dnd_types)
 {
 	EFolderTypeRegistryPrivate *priv;
 	FolderType *folder_type;
@@ -137,7 +137,7 @@ register_folder_type (EFolderTypeRegistry *folder_type_registry,
 
 static gboolean
 set_handler (EFolderTypeRegistry *folder_type_registry,
-	     const char *name,
+	     const gchar *name,
 	     GObject *handler)
 {
 	EFolderTypeRegistryPrivate *priv;
@@ -217,13 +217,13 @@ e_folder_type_registry_new (void)
 
 gboolean
 e_folder_type_registry_register_type (EFolderTypeRegistry *folder_type_registry,
-				      const char *type_name,
-				      const char *icon_name,
-				      const char *display_name,
-				      const char *description,
+				      const gchar *type_name,
+				      const gchar *icon_name,
+				      const gchar *display_name,
+				      const gchar *description,
 				      gboolean user_creatable,
-				      int num_accepted_dnd_types,
-				      const char **accepted_dnd_types)
+				      gint num_accepted_dnd_types,
+				      const gchar **accepted_dnd_types)
 {
 	g_return_val_if_fail (E_IS_FOLDER_TYPE_REGISTRY (folder_type_registry), FALSE);
 	g_return_val_if_fail (type_name != NULL, FALSE);
@@ -236,7 +236,7 @@ e_folder_type_registry_register_type (EFolderTypeRegistry *folder_type_registry,
 
 gboolean
 e_folder_type_registry_set_handler_for_type  (EFolderTypeRegistry *folder_type_registry,
-					      const char *type_name,
+					      const gchar *type_name,
 					      GObject *handler)
 {
 	g_return_val_if_fail (E_IS_FOLDER_TYPE_REGISTRY (folder_type_registry), FALSE);
@@ -247,7 +247,7 @@ e_folder_type_registry_set_handler_for_type  (EFolderTypeRegistry *folder_type_r
 
 gboolean
 e_folder_type_registry_type_registered  (EFolderTypeRegistry *folder_type_registry,
-					 const char *type_name)
+					 const gchar *type_name)
 {
 	EFolderTypeRegistryPrivate *priv;
 
@@ -264,7 +264,7 @@ e_folder_type_registry_type_registered  (EFolderTypeRegistry *folder_type_regist
 
 void
 e_folder_type_registry_unregister_type (EFolderTypeRegistry *folder_type_registry,
-					const char *type_name)
+					const gchar *type_name)
 {
 	EFolderTypeRegistryPrivate *priv;
 	FolderType *folder_type;
@@ -283,15 +283,15 @@ e_folder_type_registry_unregister_type (EFolderTypeRegistry *folder_type_registr
 }
 
 static void
-get_type_names_hash_forall (void *key,
-			    void *value,
-			    void *data)
+get_type_names_hash_forall (gpointer key,
+			    gpointer value,
+			    gpointer data)
 {
 	GList **type_name_list;
 
 	type_name_list = (GList **) data;
 
-	*type_name_list = g_list_prepend (*type_name_list, g_strdup ((const char *) key));
+	*type_name_list = g_list_prepend (*type_name_list, g_strdup ((const gchar *) key));
 }
 
 GList *
@@ -310,9 +310,9 @@ e_folder_type_registry_get_type_names (EFolderTypeRegistry *folder_type_registry
 	return type_name_list;
 }
 
-const char *
+const gchar *
 e_folder_type_registry_get_icon_name_for_type (EFolderTypeRegistry *folder_type_registry,
-					       const char *type_name)
+					       const gchar *type_name)
 {
 	const FolderType *folder_type;
 
@@ -328,7 +328,7 @@ e_folder_type_registry_get_icon_name_for_type (EFolderTypeRegistry *folder_type_
 
 GObject *
 e_folder_type_registry_get_handler_for_type (EFolderTypeRegistry *folder_type_registry,
-					     const char *type_name)
+					     const gchar *type_name)
 {
 	const FolderType *folder_type;
 
@@ -344,7 +344,7 @@ e_folder_type_registry_get_handler_for_type (EFolderTypeRegistry *folder_type_re
 
 gboolean
 e_folder_type_registry_type_is_user_creatable  (EFolderTypeRegistry *folder_type_registry,
-						const char          *type_name)
+						const gchar          *type_name)
 {
 	const FolderType *folder_type;
 
@@ -358,9 +358,9 @@ e_folder_type_registry_type_is_user_creatable  (EFolderTypeRegistry *folder_type
 	return folder_type->user_creatable;
 }
 
-const char *
+const gchar *
 e_folder_type_registry_get_display_name_for_type (EFolderTypeRegistry *folder_type_registry,
-						  const char *type_name)
+						  const gchar *type_name)
 {
 	const FolderType *folder_type;
 
@@ -374,9 +374,9 @@ e_folder_type_registry_get_display_name_for_type (EFolderTypeRegistry *folder_ty
 	return folder_type->display_name;
 }
 
-const char *
+const gchar *
 e_folder_type_registry_get_description_for_type (EFolderTypeRegistry *folder_type_registry,
-						 const char *type_name)
+						 const gchar *type_name)
 {
 	const FolderType *folder_type;
 
@@ -392,7 +392,7 @@ e_folder_type_registry_get_description_for_type (EFolderTypeRegistry *folder_typ
 
 GList *
 e_folder_type_registry_get_accepted_dnd_types_for_type (EFolderTypeRegistry *folder_type_registry,
-							const char *type_name)
+							const gchar *type_name)
 {
 	const FolderType *folder_type;
 
diff --git a/servers/exchange/storage/e-folder-type-registry.h b/servers/exchange/storage/e-folder-type-registry.h
index c67d4f6..eab0097 100644
--- a/servers/exchange/storage/e-folder-type-registry.h
+++ b/servers/exchange/storage/e-folder-type-registry.h
@@ -55,37 +55,37 @@ GType                e_folder_type_registry_get_type   (void);
 EFolderTypeRegistry *e_folder_type_registry_new        (void);
 
 gboolean  e_folder_type_registry_register_type         (EFolderTypeRegistry           *folder_type_registry,
-							const char                    *type_name,
-							const char                    *icon_name,
-							const char                    *display_name,
-							const char                    *description,
+							const gchar                    *type_name,
+							const gchar                    *icon_name,
+							const gchar                    *display_name,
+							const gchar                    *description,
 							gboolean                       user_creatable,
-							int                            num_accepted_dnd_types,
-							const char                   **accepted_dnd_types);
+							gint                            num_accepted_dnd_types,
+							const gchar                   **accepted_dnd_types);
 gboolean  e_folder_type_registry_set_handler_for_type  (EFolderTypeRegistry           *folder_type_registry,
-							const char                    *type_name,
+							const gchar                    *type_name,
 							GObject                       *handler);
 
 GList *e_folder_type_registry_get_type_names  (EFolderTypeRegistry *folder_type_registry);
 
 gboolean  e_folder_type_registry_type_registered  (EFolderTypeRegistry *folder_type_registry,
-						   const char          *type_name);
+						   const gchar          *type_name);
 void      e_folder_type_registry_unregister_type  (EFolderTypeRegistry *folder_type_registry,
-						   const char          *type_name);
+						   const gchar          *type_name);
 
-const char                    *e_folder_type_registry_get_icon_name_for_type     (EFolderTypeRegistry *folder_type_registry,
-										  const char          *type_name);
+const gchar                    *e_folder_type_registry_get_icon_name_for_type     (EFolderTypeRegistry *folder_type_registry,
+										  const gchar          *type_name);
 GObject                       *e_folder_type_registry_get_handler_for_type       (EFolderTypeRegistry *folder_type_registry,
-										  const char          *type_name);
+										  const gchar          *type_name);
 gboolean                       e_folder_type_registry_type_is_user_creatable     (EFolderTypeRegistry *folder_type_registry,
-										  const char          *type_name);
-const char                    *e_folder_type_registry_get_display_name_for_type  (EFolderTypeRegistry *folder_type_registry,
-										  const char          *type_name);
-const char                    *e_folder_type_registry_get_description_for_type   (EFolderTypeRegistry *folder_type_registry,
-										  const char          *type_name);
+										  const gchar          *type_name);
+const gchar                    *e_folder_type_registry_get_display_name_for_type  (EFolderTypeRegistry *folder_type_registry,
+										  const gchar          *type_name);
+const gchar                    *e_folder_type_registry_get_description_for_type   (EFolderTypeRegistry *folder_type_registry,
+										  const gchar          *type_name);
 
 GList *e_folder_type_registry_get_accepted_dnd_types_for_type (EFolderTypeRegistry *folder_type_registry,
-							       const char *type_name);
+							       const gchar *type_name);
 
 
 #ifdef __cplusplus
diff --git a/servers/exchange/storage/e-folder.c b/servers/exchange/storage/e-folder.c
index fc808f9..2a25803 100644
--- a/servers/exchange/storage/e-folder.c
+++ b/servers/exchange/storage/e-folder.c
@@ -34,29 +34,29 @@
 static GObjectClass *parent_class = NULL;
 
 struct EFolderPrivate {
-	char *name;
-	char *type;
-	char *description;
-	char *physical_uri;
+	gchar *name;
+	gchar *type;
+	gchar *description;
+	gchar *physical_uri;
 
-	int child_highlight;
-	int unread_count;
+	gint child_highlight;
+	gint unread_count;
 
 	/* Folders have a default sorting priority of zero; when deciding the
 	   sort order in the Evolution folder tree, folders with the same
 	   priority value are compared by name, while folders with a higher
 	   priority number always come after the folders with a lower priority
 	   number.  */
-	int sorting_priority;
+	gint sorting_priority;
 
-	unsigned int self_highlight : 1;
-	unsigned int is_stock : 1;
-	unsigned int can_sync_offline : 1;
-	unsigned int has_subfolders : 1;
+	guint self_highlight : 1;
+	guint is_stock : 1;
+	guint can_sync_offline : 1;
+	guint has_subfolders : 1;
 
 	/* Custom icon for this folder; if NULL the folder will just use the
 	   icon for its type.  */
-	char *custom_icon_name;
+	gchar *custom_icon_name;
 };
 
 enum {
@@ -71,7 +71,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
 
 static gboolean
 accept_drop (EFolder *folder, GdkDragContext *context,
-	     const char *target_type,
+	     const gchar *target_type,
 	     GtkSelectionData *selection_data)
 {
 	return FALSE;
@@ -140,9 +140,9 @@ e_folder_init (EFolder *folder)
 
 void
 e_folder_construct (EFolder *folder,
-		    const char *name,
-		    const char *type,
-		    const char *description)
+		    const gchar *name,
+		    const gchar *type,
+		    const gchar *description)
 {
 	EFolderPrivate *priv;
 
@@ -158,9 +158,9 @@ e_folder_construct (EFolder *folder,
 }
 
 EFolder *
-e_folder_new (const char *name,
-	      const char *type,
-	      const char *description)
+e_folder_new (const gchar *name,
+	      const gchar *type,
+	      const gchar *description)
 {
 	EFolder *folder;
 
@@ -175,7 +175,7 @@ e_folder_new (const char *name,
 	return folder;
 }
 
-const char *
+const gchar *
 e_folder_get_name (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER (folder), NULL);
@@ -183,7 +183,7 @@ e_folder_get_name (EFolder *folder)
 	return folder->priv->name;
 }
 
-const char *
+const gchar *
 e_folder_get_type_string (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER (folder), NULL);
@@ -191,7 +191,7 @@ e_folder_get_type_string (EFolder *folder)
 	return folder->priv->type;
 }
 
-const char *
+const gchar *
 e_folder_get_description (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER (folder), NULL);
@@ -199,7 +199,7 @@ e_folder_get_description (EFolder *folder)
 	return folder->priv->description;
 }
 
-const char *
+const gchar *
 e_folder_get_physical_uri (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER (folder), NULL);
@@ -207,7 +207,7 @@ e_folder_get_physical_uri (EFolder *folder)
 	return folder->priv->physical_uri;
 }
 
-int
+gint
 e_folder_get_unread_count (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER (folder), FALSE);
@@ -254,7 +254,7 @@ e_folder_get_has_subfolders (EFolder *folder)
  * Get the name of the custom icon for @folder, or NULL if no custom icon is
  * associated with it.
  **/
-const char *
+const gchar *
 e_folder_get_custom_icon_name (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER (folder), NULL);
@@ -270,7 +270,7 @@ e_folder_get_custom_icon_name (EFolder *folder)
  *
  * Return value: Sorting priority value for @folder.
  **/
-int
+gint
 e_folder_get_sorting_priority (EFolder *folder)
 {
 	g_return_val_if_fail (E_IS_FOLDER (folder), 0);
@@ -280,7 +280,7 @@ e_folder_get_sorting_priority (EFolder *folder)
 
 void
 e_folder_set_name (EFolder *folder,
-		   const char *name)
+		   const gchar *name)
 {
 	g_return_if_fail (E_IS_FOLDER (folder));
 	g_return_if_fail (name != NULL);
@@ -297,7 +297,7 @@ e_folder_set_name (EFolder *folder,
 
 void
 e_folder_set_type_string (EFolder *folder,
-			  const char *type)
+			  const gchar *type)
 {
 	g_return_if_fail (E_IS_FOLDER (folder));
 	g_return_if_fail (type != NULL);
@@ -310,7 +310,7 @@ e_folder_set_type_string (EFolder *folder,
 
 void
 e_folder_set_description (EFolder *folder,
-			  const char *description)
+			  const gchar *description)
 {
 	g_return_if_fail (E_IS_FOLDER (folder));
 	g_return_if_fail (description != NULL);
@@ -323,7 +323,7 @@ e_folder_set_description (EFolder *folder,
 
 void
 e_folder_set_physical_uri (EFolder *folder,
-			   const char *physical_uri)
+			   const gchar *physical_uri)
 {
 	g_return_if_fail (E_IS_FOLDER (folder));
 	g_return_if_fail (physical_uri != NULL);
@@ -406,7 +406,7 @@ e_folder_set_has_subfolders (EFolder *folder,
  **/
 void
 e_folder_set_custom_icon (EFolder *folder,
-			  const char *icon_name)
+			  const gchar *icon_name)
 {
 	g_return_if_fail (E_IS_FOLDER (folder));
 
@@ -435,7 +435,7 @@ e_folder_set_custom_icon (EFolder *folder,
  **/
 void
 e_folder_set_sorting_priority (EFolder *folder,
-			       int sorting_priority)
+			       gint sorting_priority)
 {
 	g_return_if_fail (E_IS_FOLDER (folder));
 
@@ -449,7 +449,7 @@ e_folder_set_sorting_priority (EFolder *folder,
 
 gboolean
 e_folder_accept_drop (EFolder *folder, GdkDragContext *context,
-		      const char *target_type,
+		      const gchar *target_type,
 		      GtkSelectionData *selection_data)
 {
 	g_return_val_if_fail (E_IS_FOLDER (folder), FALSE);
diff --git a/servers/exchange/storage/e-folder.h b/servers/exchange/storage/e-folder.h
index 5be7856..2107f3d 100644
--- a/servers/exchange/storage/e-folder.h
+++ b/servers/exchange/storage/e-folder.h
@@ -54,7 +54,7 @@ struct EFolderClass {
 	/* Methods.  */
 	gboolean (* accept_drop) (EFolder *folder,
 				  GdkDragContext *context,
-				  const char *target_type,
+				  const gchar *target_type,
 				  GtkSelectionData *selection_data);
 
 	/* Signals.  */
@@ -64,39 +64,39 @@ struct EFolderClass {
 
 GType    e_folder_get_type   (void);
 void     e_folder_construct  (EFolder    *folder,
-			      const char *name,
-			      const char *type,
-			      const char *description);
-EFolder *e_folder_new        (const char *name,
-			      const char *type,
-			      const char *description);
+			      const gchar *name,
+			      const gchar *type,
+			      const gchar *description);
+EFolder *e_folder_new        (const gchar *name,
+			      const gchar *type,
+			      const gchar *description);
 
-const char *e_folder_get_name		  (EFolder *folder);
-const char *e_folder_get_type_string	  (EFolder *folder);
-const char *e_folder_get_description	  (EFolder *folder);
-const char *e_folder_get_physical_uri	  (EFolder *folder);
-int         e_folder_get_unread_count	  (EFolder *folder);
+const gchar *e_folder_get_name		  (EFolder *folder);
+const gchar *e_folder_get_type_string	  (EFolder *folder);
+const gchar *e_folder_get_description	  (EFolder *folder);
+const gchar *e_folder_get_physical_uri	  (EFolder *folder);
+gint         e_folder_get_unread_count	  (EFolder *folder);
 gboolean    e_folder_get_highlighted	  (EFolder *folder);
 gboolean    e_folder_get_is_stock	  (EFolder *folder);
 gboolean    e_folder_get_can_sync_offline (EFolder *folder);
 gboolean    e_folder_get_has_subfolders   (EFolder *folder);
-const char *e_folder_get_custom_icon_name (EFolder *folder);
-int         e_folder_get_sorting_priority (EFolder *folder);
+const gchar *e_folder_get_custom_icon_name (EFolder *folder);
+gint         e_folder_get_sorting_priority (EFolder *folder);
 
-void  e_folder_set_name              (EFolder *folder, const char *name);
-void  e_folder_set_type_string       (EFolder *folder, const char *type);
-void  e_folder_set_description       (EFolder *folder, const char *description);
-void  e_folder_set_physical_uri      (EFolder *folder, const char *physical_uri);
-void  e_folder_set_unread_count      (EFolder *folder, int unread_count);
+void  e_folder_set_name              (EFolder *folder, const gchar *name);
+void  e_folder_set_type_string       (EFolder *folder, const gchar *type);
+void  e_folder_set_description       (EFolder *folder, const gchar *description);
+void  e_folder_set_physical_uri      (EFolder *folder, const gchar *physical_uri);
+void  e_folder_set_unread_count      (EFolder *folder, gint unread_count);
 void  e_folder_set_child_highlight   (EFolder *folder, gboolean highlighted);
 void  e_folder_set_is_stock          (EFolder *folder, gboolean is_stock);
 void  e_folder_set_can_sync_offline  (EFolder *folder, gboolean can_sync_offline);
 void  e_folder_set_has_subfolders    (EFolder *folder, gboolean has_subfolders);
-void  e_folder_set_custom_icon       (EFolder *folder, const char *icon_name);
-void  e_folder_set_sorting_priority  (EFolder *folder, int sorting_priority);
+void  e_folder_set_custom_icon       (EFolder *folder, const gchar *icon_name);
+void  e_folder_set_sorting_priority  (EFolder *folder, gint sorting_priority);
 
 gboolean e_folder_accept_drop        (EFolder *folder, GdkDragContext *context,
-				      const char *target_type,
+				      const gchar *target_type,
 				      GtkSelectionData *selection_data);
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/storage/e-storage.c b/servers/exchange/storage/e-storage.c
index 6e6fb2f..be8f41e 100644
--- a/servers/exchange/storage/e-storage.c
+++ b/servers/exchange/storage/e-storage.c
@@ -41,7 +41,7 @@ struct EStoragePrivate {
 	EFolderTree *folder_tree;
 
 	/* Internal name of the storage */
-	char *name;
+	gchar *name;
 };
 
 enum {
@@ -57,9 +57,9 @@ static guint signals[LAST_SIGNAL] = { 0 };
 
 static void
 folder_destroy_notify (EFolderTree *tree,
-		       const char *path,
-		       void *data,
-		       void *closure)
+		       const gchar *path,
+		       gpointer data,
+		       gpointer closure)
 {
 	EFolder *e_folder;
 
@@ -76,11 +76,11 @@ folder_destroy_notify (EFolderTree *tree,
 
 static void
 folder_changed_cb (EFolder *folder,
-		   void *data)
+		   gpointer data)
 {
 	EStorage *storage;
 	EStoragePrivate *priv;
-	const char *path, *p;
+	const gchar *path, *p;
 	gboolean highlight;
 
 	g_assert (E_IS_STORAGE (data));
@@ -99,7 +99,7 @@ folder_changed_cb (EFolder *folder,
 		g_object_set_data (G_OBJECT (folder), "last_highlight", GINT_TO_POINTER (highlight));
 		p = strrchr (path, '/');
 		if (p && p != path) {
-			char *name;
+			gchar *name;
 
 			name = g_strndup (path, p - path);
 			folder = e_folder_tree_get_folder (priv->folder_tree, name);
@@ -135,7 +135,7 @@ impl_finalize (GObject *object)
 
 static GList *
 impl_get_subfolder_paths (EStorage *storage,
-			  const char *path)
+			  const gchar *path)
 {
 	EStoragePrivate *priv;
 
@@ -146,7 +146,7 @@ impl_get_subfolder_paths (EStorage *storage,
 
 static EFolder *
 impl_get_folder (EStorage *storage,
-		 const char *path)
+		 const gchar *path)
 {
 	EStoragePrivate *priv;
 	EFolder *e_folder;
@@ -158,7 +158,7 @@ impl_get_folder (EStorage *storage,
 	return e_folder;
 }
 
-static const char *
+static const gchar *
 impl_get_name (EStorage *storage)
 {
 	return storage->priv->name;
@@ -166,39 +166,39 @@ impl_get_name (EStorage *storage)
 
 static void
 impl_async_create_folder (EStorage *storage,
-			  const char *path,
-			  const char *type,
+			  const gchar *path,
+			  const gchar *type,
 			  EStorageResultCallback callback,
-			  void *data)
+			  gpointer data)
 {
 	(* callback) (storage, E_STORAGE_NOTIMPLEMENTED, data);
 }
 
 static void
 impl_async_remove_folder (EStorage *storage,
-			  const char *path,
+			  const gchar *path,
 			  EStorageResultCallback callback,
-			  void *data)
+			  gpointer data)
 {
 	(* callback) (storage, E_STORAGE_NOTIMPLEMENTED, data);
 }
 
 static void
 impl_async_xfer_folder (EStorage *storage,
-			const char *source_path,
-			const char *destination_path,
+			const gchar *source_path,
+			const gchar *destination_path,
 			gboolean remove_source,
 			EStorageResultCallback callback,
-			void *data)
+			gpointer data)
 {
 	(* callback) (storage, E_STORAGE_NOTIMPLEMENTED, data);
 }
 
 static void
 impl_async_open_folder (EStorage *storage,
-			const char *path,
+			const gchar *path,
 			EStorageDiscoveryCallback callback,
-			void *data)
+			gpointer data)
 {
 	(* callback) (storage, E_STORAGE_NOTIMPLEMENTED, NULL, data);
 }
@@ -209,8 +209,8 @@ impl_will_accept_folder (EStorage *storage,
 			 EFolder *source)
 {
 	EStoragePrivate *priv = storage->priv;
-	const char *parent_path, *source_path;
-	int source_len;
+	const gchar *parent_path, *source_path;
+	gint source_len;
 
 	/* By default, we only disallow dragging a folder into
 	 * a subfolder of itself.
@@ -236,19 +236,19 @@ impl_will_accept_folder (EStorage *storage,
 
 static void
 impl_async_discover_shared_folder (EStorage *storage,
-				   const char *owner,
-				   const char *folder_name,
+				   const gchar *owner,
+				   const gchar *folder_name,
 				   EStorageDiscoveryCallback callback,
-				   void *data)
+				   gpointer data)
 {
 	(* callback) (storage, E_STORAGE_NOTIMPLEMENTED, NULL, data);
 }
 
 static void
 impl_async_remove_shared_folder (EStorage *storage,
-				 const char *path,
+				 const gchar *path,
 				 EStorageResultCallback callback,
-				 void *data)
+				 gpointer data)
 {
 	(* callback) (storage, E_STORAGE_NOTIMPLEMENTED, data);
 }
@@ -321,7 +321,7 @@ e_storage_init (EStorage *storage)
 
 void
 e_storage_construct (EStorage *storage,
-		     const char *name,
+		     const gchar *name,
 		     EFolder *root_folder)
 {
 	EStoragePrivate *priv;
@@ -336,7 +336,7 @@ e_storage_construct (EStorage *storage,
 }
 
 EStorage *
-e_storage_new (const char *name,
+e_storage_new (const gchar *name,
 	       EFolder *root_folder)
 {
 	EStorage *new;
@@ -349,7 +349,7 @@ e_storage_new (const char *name,
 }
 
 gboolean
-e_storage_path_is_absolute (const char *path)
+e_storage_path_is_absolute (const gchar *path)
 {
 	g_return_val_if_fail (path != NULL, FALSE);
 
@@ -357,7 +357,7 @@ e_storage_path_is_absolute (const char *path)
 }
 
 gboolean
-e_storage_path_is_relative (const char *path)
+e_storage_path_is_relative (const gchar *path)
 {
 	g_return_val_if_fail (path != NULL, FALSE);
 
@@ -366,7 +366,7 @@ e_storage_path_is_relative (const char *path)
 
 GList *
 e_storage_get_subfolder_paths (EStorage *storage,
-			       const char *path)
+			       const gchar *path)
 {
 	g_return_val_if_fail (E_IS_STORAGE (storage), NULL);
 	g_return_val_if_fail (path != NULL, NULL);
@@ -377,7 +377,7 @@ e_storage_get_subfolder_paths (EStorage *storage,
 
 EFolder *
 e_storage_get_folder (EStorage *storage,
-		      const char *path)
+		      const gchar *path)
 {
 	g_return_val_if_fail (E_IS_STORAGE (storage), NULL);
 	g_return_val_if_fail (path != NULL, NULL);
@@ -386,7 +386,7 @@ e_storage_get_folder (EStorage *storage,
 	return (* E_STORAGE_GET_CLASS (storage)->get_folder) (storage, path);
 }
 
-const char *
+const gchar *
 e_storage_get_name (EStorage *storage)
 {
 	g_return_val_if_fail (E_IS_STORAGE (storage), NULL);
@@ -398,10 +398,10 @@ e_storage_get_name (EStorage *storage)
 
 void
 e_storage_async_create_folder (EStorage *storage,
-			       const char *path,
-			       const char *type,
+			       const gchar *path,
+			       const gchar *type,
 			       EStorageResultCallback callback,
-			       void *data)
+			       gpointer data)
 {
 	g_return_if_fail (E_IS_STORAGE (storage));
 	g_return_if_fail (path != NULL);
@@ -414,7 +414,7 @@ e_storage_async_create_folder (EStorage *storage,
 
 void
 e_storage_async_remove_folder (EStorage              *storage,
-			       const char            *path,
+			       const gchar            *path,
 			       EStorageResultCallback callback,
 			       void                  *data)
 {
@@ -428,11 +428,11 @@ e_storage_async_remove_folder (EStorage              *storage,
 
 void
 e_storage_async_xfer_folder (EStorage *storage,
-			     const char *source_path,
-			     const char *destination_path,
+			     const gchar *source_path,
+			     const gchar *destination_path,
 			     const gboolean remove_source,
 			     EStorageResultCallback callback,
-			     void *data)
+			     gpointer data)
 {
 	g_return_if_fail (E_IS_STORAGE (storage));
 	g_return_if_fail (source_path != NULL);
@@ -446,8 +446,8 @@ e_storage_async_xfer_folder (EStorage *storage,
 	}
 
 	if (remove_source) {
-		int destination_len;
-		int source_len;
+		gint destination_len;
+		gint source_len;
 
 		source_len = strlen (source_path);
 		destination_len = strlen (destination_path);
@@ -465,9 +465,9 @@ e_storage_async_xfer_folder (EStorage *storage,
 
 void
 e_storage_async_open_folder (EStorage *storage,
-			     const char *path,
+			     const gchar *path,
 			     EStorageDiscoveryCallback callback,
-			     void *data)
+			     gpointer data)
 {
 	EStoragePrivate *priv;
 	EFolder *folder;
@@ -507,10 +507,10 @@ e_storage_will_accept_folder (EStorage *storage,
 
 void
 e_storage_async_discover_shared_folder (EStorage *storage,
-					const char *owner,
-					const char *folder_name,
+					const gchar *owner,
+					const gchar *folder_name,
 					EStorageDiscoveryCallback callback,
-					void *data)
+					gpointer data)
 {
 	g_return_if_fail (E_IS_STORAGE (storage));
 	g_return_if_fail (owner != NULL);
@@ -521,8 +521,8 @@ e_storage_async_discover_shared_folder (EStorage *storage,
 
 void
 e_storage_cancel_discover_shared_folder (EStorage *storage,
-					 const char *owner,
-					 const char *folder_name)
+					 const gchar *owner,
+					 const gchar *folder_name)
 {
 	g_return_if_fail (E_IS_STORAGE (storage));
 	g_return_if_fail (owner != NULL);
@@ -534,9 +534,9 @@ e_storage_cancel_discover_shared_folder (EStorage *storage,
 
 void
 e_storage_async_remove_shared_folder (EStorage *storage,
-				      const char *path,
+				      const gchar *path,
 				      EStorageResultCallback callback,
-				      void *data)
+				      gpointer data)
 {
 	g_return_if_fail (E_IS_STORAGE (storage));
 	g_return_if_fail (path != NULL);
@@ -545,7 +545,7 @@ e_storage_async_remove_shared_folder (EStorage *storage,
 	(* E_STORAGE_GET_CLASS (storage)->async_remove_shared_folder) (storage, path, callback, data);
 }
 
-const char *
+const gchar *
 e_storage_result_to_string (EStorageResult result)
 {
 	switch (result) {
@@ -589,18 +589,18 @@ e_storage_result_to_string (EStorageResult result)
 /* Public utility functions.  */
 
 typedef struct {
-	const char *physical_uri;
-	char *retval;
+	const gchar *physical_uri;
+	gchar *retval;
 } GetPathForPhysicalUriForeachData;
 
 static void
 get_path_for_physical_uri_foreach (EFolderTree *folder_tree,
-				   const char *path,
-				   void *path_data,
-				   void *user_data)
+				   const gchar *path,
+				   gpointer path_data,
+				   gpointer user_data)
 {
 	GetPathForPhysicalUriForeachData *foreach_data;
-	const char *physical_uri;
+	const gchar *physical_uri;
 	EFolder *e_folder;
 
 	foreach_data = (GetPathForPhysicalUriForeachData *) user_data;
@@ -630,9 +630,9 @@ get_path_for_physical_uri_foreach (EFolderTree *folder_tree,
  * @storage.  If such a folder does not exist, just return NULL.  The return
  * value must be freed by the caller.
  **/
-char *
+gchar *
 e_storage_get_path_for_physical_uri (EStorage *storage,
-				     const char *physical_uri)
+				     const gchar *physical_uri)
 {
 	GetPathForPhysicalUriForeachData foreach_data;
 	EStoragePrivate *priv;
@@ -656,11 +656,11 @@ e_storage_get_path_for_physical_uri (EStorage *storage,
    state stored in the storage object.  */
 
 static void
-remove_subfolders_except (EStorage *storage, const char *path, const char *except)
+remove_subfolders_except (EStorage *storage, const gchar *path, const gchar *except)
 {
 	EStoragePrivate *priv;
 	GList *subfolders, *f;
-	const char *folder_path;
+	const gchar *folder_path;
 
 	priv = storage->priv;
 
@@ -678,11 +678,11 @@ remove_subfolders_except (EStorage *storage, const char *path, const char *excep
 
 gboolean
 e_storage_new_folder (EStorage *storage,
-		      const char *path,
+		      const gchar *path,
 		      EFolder *e_folder)
 {
 	EStoragePrivate *priv;
-	char *parent_path, *p;
+	gchar *parent_path, *p;
 	EFolder *parent;
 
 	g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
@@ -727,12 +727,12 @@ e_storage_new_folder (EStorage *storage,
  */
 gboolean
 e_storage_declare_has_subfolders (EStorage *storage,
-				  const char *path,
-				  const char *message)
+				  const gchar *path,
+				  const gchar *message)
 {
 	EStoragePrivate *priv;
 	EFolder *parent, *pseudofolder;
-	char *pseudofolder_path;
+	gchar *pseudofolder_path;
 	gboolean ok;
 
 	g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
@@ -770,7 +770,7 @@ e_storage_declare_has_subfolders (EStorage *storage,
 
 gboolean
 e_storage_get_has_subfolders (EStorage *storage,
-			      const char *path)
+			      const gchar *path)
 {
 	EStoragePrivate *priv;
 	EFolder *folder;
@@ -788,11 +788,11 @@ e_storage_get_has_subfolders (EStorage *storage,
 
 gboolean
 e_storage_removed_folder (EStorage *storage,
-			  const char *path)
+			  const gchar *path)
 {
 	EStoragePrivate *priv;
 	EFolder *folder;
-	const char *p;
+	const gchar *p;
 
 	g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
 	g_return_val_if_fail (path != NULL, FALSE);
@@ -807,7 +807,7 @@ e_storage_removed_folder (EStorage *storage,
 	p = strrchr (path, '/');
 	if (p != NULL && p != path) {
 		EFolder *parent_folder;
-		char *parent_path;
+		gchar *parent_path;
 
 		parent_path = g_strndup (path, p - path);
 		parent_folder = e_folder_tree_get_folder (priv->folder_tree, parent_path);
diff --git a/servers/exchange/storage/e-storage.h b/servers/exchange/storage/e-storage.h
index e9747ff..b960f74 100644
--- a/servers/exchange/storage/e-storage.h
+++ b/servers/exchange/storage/e-storage.h
@@ -61,8 +61,8 @@ typedef enum {
 	E_STORAGE_INVALIDNAME
 } EStorageResult;
 
-typedef void (* EStorageResultCallback) (EStorage *storage, EStorageResult result, void *data);
-typedef void (* EStorageDiscoveryCallback) (EStorage *storage, EStorageResult result, const char *path, void *data);
+typedef void (* EStorageResultCallback) (EStorage *storage, EStorageResult result, gpointer data);
+typedef void (* EStorageDiscoveryCallback) (EStorage *storage, EStorageResult result, const gchar *path, gpointer data);
 
 struct EStorage {
 	GObject parent;
@@ -75,99 +75,99 @@ struct EStorageClass {
 
 	/* Signals.  */
 
-	void (* new_folder)     (EStorage *storage, const char *path);
-	void (* updated_folder) (EStorage *storage, const char *path);
-	void (* removed_folder) (EStorage *storage, const char *path);
+	void (* new_folder)     (EStorage *storage, const gchar *path);
+	void (* updated_folder) (EStorage *storage, const gchar *path);
+	void (* removed_folder) (EStorage *storage, const gchar *path);
 
 	/* Virtual methods.  */
 
 	GList      * (* get_subfolder_paths)     (EStorage *storage,
-						  const char *path);
+						  const gchar *path);
 	EFolder    * (* get_folder)		 (EStorage *storage,
-						  const char *path);
-	const char * (* get_name)		 (EStorage *storage);
+						  const gchar *path);
+	const gchar * (* get_name)		 (EStorage *storage);
 
 	void         (* async_create_folder)  (EStorage *storage,
-					       const char *path,
-					       const char *type,
+					       const gchar *path,
+					       const gchar *type,
 					       EStorageResultCallback callback,
-					       void *data);
+					       gpointer data);
 
 	void         (* async_remove_folder)  (EStorage *storage,
-					       const char *path,
+					       const gchar *path,
 					       EStorageResultCallback callback,
-					       void *data);
+					       gpointer data);
 
 	void         (* async_xfer_folder)    (EStorage *storage,
-					       const char *source_path,
-					       const char *destination_path,
+					       const gchar *source_path,
+					       const gchar *destination_path,
 					       const gboolean remove_source,
 					       EStorageResultCallback callback,
-					       void *data);
+					       gpointer data);
 
 	void         (* async_open_folder)    (EStorage *storage,
-					       const char *path,
+					       const gchar *path,
 					       EStorageDiscoveryCallback callback,
-					       void *data);
+					       gpointer data);
 
 	gboolean     (* will_accept_folder)   (EStorage *storage,
 					       EFolder *new_parent,
 					       EFolder *source);
 
 	void         (* async_discover_shared_folder)  (EStorage *storage,
-							const char *owner,
-							const char *folder_name,
+							const gchar *owner,
+							const gchar *folder_name,
 							EStorageDiscoveryCallback callback,
-							void *data);
+							gpointer data);
 	void         (* cancel_discover_shared_folder) (EStorage *storage,
-							const char *owner,
-							const char *folder_name);
+							const gchar *owner,
+							const gchar *folder_name);
 	void         (* async_remove_shared_folder)    (EStorage *storage,
-							const char *path,
+							const gchar *path,
 							EStorageResultCallback callback,
-							void *data);
+							gpointer data);
 };
 
 GType       e_storage_get_type                (void);
 void        e_storage_construct               (EStorage   *storage,
-					       const char *name,
+					       const gchar *name,
 					       EFolder    *root_folder);
-EStorage   *e_storage_new                     (const char *name,
+EStorage   *e_storage_new                     (const gchar *name,
 					       EFolder    *root_folder);
 
-gboolean    e_storage_path_is_relative        (const char *path);
-gboolean    e_storage_path_is_absolute        (const char *path);
+gboolean    e_storage_path_is_relative        (const gchar *path);
+gboolean    e_storage_path_is_absolute        (const gchar *path);
 
 GList      *e_storage_get_subfolder_paths     (EStorage   *storage,
-					       const char *path);
+					       const gchar *path);
 EFolder    *e_storage_get_folder              (EStorage   *storage,
-					       const char *path);
+					       const gchar *path);
 
-const char *e_storage_get_name                (EStorage *storage);
+const gchar *e_storage_get_name                (EStorage *storage);
 
 /* Folder operations.  */
 
 void  e_storage_async_create_folder  (EStorage               *storage,
-				      const char             *path,
-				      const char             *type,
+				      const gchar             *path,
+				      const gchar             *type,
 				      EStorageResultCallback  callback,
 				      void                   *data);
 void  e_storage_async_remove_folder  (EStorage               *storage,
-				      const char             *path,
+				      const gchar             *path,
 				      EStorageResultCallback  callback,
 				      void                   *data);
 void  e_storage_async_xfer_folder    (EStorage               *storage,
-				      const char             *source_path,
-				      const char             *destination_path,
+				      const gchar             *source_path,
+				      const gchar             *destination_path,
 				      const gboolean          remove_source,
 				      EStorageResultCallback  callback,
 				      void                   *data);
 void  e_storage_async_open_folder    (EStorage                  *storage,
-				      const char                *path,
+				      const gchar                *path,
 				      EStorageDiscoveryCallback  callback,
 				      void                      *data);
 
-const char *e_storage_result_to_string   (EStorageResult  result);
+const gchar *e_storage_result_to_string   (EStorageResult  result);
 
 gboolean    e_storage_will_accept_folder (EStorage       *storage,
 					  EFolder        *new_parent,
@@ -175,36 +175,36 @@ gboolean    e_storage_will_accept_folder (EStorage       *storage,
 
 /* Shared folders.  */
 void        e_storage_async_discover_shared_folder  (EStorage                 *storage,
-						     const char               *owner,
-						     const char               *folder_name,
+						     const gchar               *owner,
+						     const gchar               *folder_name,
 						     EStorageDiscoveryCallback callback,
 						     void                     *data);
 void        e_storage_cancel_discover_shared_folder (EStorage                 *storage,
-						     const char               *owner,
-						     const char               *folder_name);
+						     const gchar               *owner,
+						     const gchar               *folder_name);
 void        e_storage_async_remove_shared_folder    (EStorage                 *storage,
-						     const char               *path,
+						     const gchar               *path,
 						     EStorageResultCallback    callback,
 						     void                     *data);
 
 /* Utility functions.  */
 
-char *e_storage_get_path_for_physical_uri  (EStorage   *storage,
-					    const char *physical_uri);
+gchar *e_storage_get_path_for_physical_uri  (EStorage   *storage,
+					    const gchar *physical_uri);
 
 /* FIXME: Need to rename these.  */
 
 gboolean e_storage_new_folder             (EStorage   *storage,
-					   const char *path,
+					   const gchar *path,
 					   EFolder    *folder);
 gboolean e_storage_removed_folder         (EStorage   *storage,
-					   const char *path);
+					   const gchar *path);
 
 gboolean e_storage_declare_has_subfolders (EStorage   *storage,
-					   const char *path,
-					   const char *message);
+					   const gchar *path,
+					   const gchar *message);
 gboolean e_storage_get_has_subfolders     (EStorage   *storage,
-					   const char *path);
+					   const gchar *path);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/storage/exchange-account.c b/servers/exchange/storage/exchange-account.c
index 55191f0..3aed5f0 100644
--- a/servers/exchange/storage/exchange-account.c
+++ b/servers/exchange/storage/exchange-account.c
@@ -62,21 +62,21 @@ struct _ExchangeAccountPrivate {
 
 	GMutex *connect_lock;
 	gboolean connecting, connected;
-	int account_online;
+	gint account_online;
 
 	GPtrArray *hierarchies;
 	GHashTable *hierarchies_by_folder, *foreign_hierarchies;
 	ExchangeHierarchy *favorites_hierarchy;
 	GHashTable *folders;
 	GStaticRecMutex folders_lock;
-	char *uri_authority, *http_uri_schema;
+	gchar *uri_authority, *http_uri_schema;
 	gboolean uris_use_email, offline_sync;
 
-	char *identity_name, *identity_email, *source_uri, *password_key;
-	char *username, *password, *windows_domain, *nt_domain, *ad_server;
-	char *owa_url;
+	gchar *identity_name, *identity_email, *source_uri, *password_key;
+	gchar *username, *password, *windows_domain, *nt_domain, *ad_server;
+	gchar *owa_url;
 	E2kAutoconfigAuthPref auth_pref;
-	int ad_limit, passwd_exp_warn_period, quota_limit;
+	gint ad_limit, passwd_exp_warn_period, quota_limit;
 	E2kAutoconfigGalAuthPref ad_auth;
 
 	EAccountList *account_list;
@@ -175,7 +175,7 @@ static void
 dispose (GObject *object)
 {
 	ExchangeAccount *account = EXCHANGE_ACCOUNT (object);
-	int i;
+	gint i;
 
 	if (account->priv->account) {
 		g_object_unref (account->priv->account);
@@ -314,7 +314,7 @@ E2K_MAKE_TYPE (exchange_account, ExchangeAccount, class_init, init, PARENT_TYPE)
 void
 exchange_account_rescan_tree (ExchangeAccount *account)
 {
-	int i;
+	gint i;
 	EFolder *toplevel;
 
 	g_return_if_fail (EXCHANGE_IS_ACCOUNT (account));
@@ -340,17 +340,17 @@ static void
 hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
 		      ExchangeAccount *account)
 {
-	int table_updated = 0;
-	const char *permanent_uri =
+	gint table_updated = 0;
+	const gchar *permanent_uri =
 		e_folder_exchange_get_permanent_uri (folder);
-	char *key;
+	gchar *key;
 
 	g_static_rec_mutex_lock (&account->priv->folders_lock);
 
 	/* This makes the cleanup easier. We just unref it each time
 	 * we find it in account->priv->folders.
 	 */
-	key = (char *) e_folder_exchange_get_path (folder);
+	key = (gchar *) e_folder_exchange_get_path (folder);
 	if (!g_hash_table_lookup (account->priv->folders, key)) {
 		/* Avoid dupilcations since the user could add a folder as
 		  favorite even though it is already marked as favorite */
@@ -361,7 +361,7 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
 		table_updated = 1;
 	}
 
-	key = (char *) e_folder_get_physical_uri (folder);
+	key = (gchar *) e_folder_get_physical_uri (folder);
 	if (!g_hash_table_lookup (account->priv->folders, key)) {
 		/* Avoid dupilcations since the user could add a folder as
 		  favorite even though it is already marked as favorite */
@@ -372,7 +372,7 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
 		table_updated = 1;
 	}
 
-	key = (char *) e_folder_exchange_get_internal_uri (folder);
+	key = (gchar *) e_folder_exchange_get_internal_uri (folder);
 	if (!g_hash_table_lookup (account->priv->folders, key)) {
 		/* The internal_uri for public folders and favorites folder
 		   is same !!! Without this check the folder value could
@@ -388,7 +388,7 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
 					permanent_uri))) {
 		g_object_ref (folder);
 		g_hash_table_insert (account->priv->folders,
-				     (char *)permanent_uri,
+				     (gchar *)permanent_uri,
 				     folder);
 		table_updated = 1;
 	}
@@ -409,7 +409,7 @@ static void
 hierarchy_removed_folder (ExchangeHierarchy *hier, EFolder *folder,
 			  ExchangeAccount *account)
 {
-	int unref_count = 0;
+	gint unref_count = 0;
 
 	g_static_rec_mutex_lock (&account->priv->folders_lock);
 	if (!g_hash_table_lookup (account->priv->folders,
@@ -447,7 +447,7 @@ hierarchy_removed_folder (ExchangeHierarchy *hier, EFolder *folder,
 }
 
 static gboolean
-get_folder (ExchangeAccount *account, const char *path,
+get_folder (ExchangeAccount *account, const gchar *path,
 	    EFolder **folder, ExchangeHierarchy **hier)
 {
 	g_static_rec_mutex_lock (&account->priv->folders_lock);
@@ -465,10 +465,10 @@ get_folder (ExchangeAccount *account, const char *path,
 }
 
 static gboolean
-get_parent_and_name (ExchangeAccount *account, const char **path,
+get_parent_and_name (ExchangeAccount *account, const gchar **path,
 		     EFolder **parent, ExchangeHierarchy **hier)
 {
-	char *name, *parent_path;
+	gchar *name, *parent_path;
 
 	name = strrchr (*path + 1, '/');
 	if (!name)
@@ -496,7 +496,7 @@ get_parent_and_name (ExchangeAccount *account, const char **path,
 
 ExchangeAccountFolderResult
 exchange_account_create_folder (ExchangeAccount *account,
-				const char *path, const char *type)
+				const gchar *path, const gchar *type)
 {
 	ExchangeHierarchy *hier;
 	EFolder *parent;
@@ -513,8 +513,8 @@ exchange_account_create_folder (ExchangeAccount *account,
 static gboolean
 check_if_sf (gpointer key, gpointer value, gpointer user_data)
 {
-	char *sf_href = (char *)value;
-	char *int_uri = (char *)user_data;
+	gchar *sf_href = (gchar *)value;
+	gchar *int_uri = (gchar *)user_data;
 
 	if (!strcmp (sf_href, int_uri))
 		return TRUE; /* Quit calling the callback */
@@ -523,11 +523,11 @@ check_if_sf (gpointer key, gpointer value, gpointer user_data)
 }
 
 ExchangeAccountFolderResult
-exchange_account_remove_folder (ExchangeAccount *account, const char *path)
+exchange_account_remove_folder (ExchangeAccount *account, const gchar *path)
 {
 	ExchangeHierarchy *hier;
 	EFolder *folder;
-	const char *int_uri;
+	const gchar *int_uri;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
 				EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
@@ -540,7 +540,7 @@ exchange_account_remove_folder (ExchangeAccount *account, const char *path)
 	int_uri = e_folder_exchange_get_internal_uri (folder);
 
 	if (g_hash_table_find (account->priv->standard_uris,
-					check_if_sf, (char *)int_uri)) {
+					check_if_sf, (gchar *)int_uri)) {
 		return EXCHANGE_ACCOUNT_FOLDER_UNSUPPORTED_OPERATION;
 	}
 
@@ -549,13 +549,13 @@ exchange_account_remove_folder (ExchangeAccount *account, const char *path)
 
 ExchangeAccountFolderResult
 exchange_account_xfer_folder (ExchangeAccount *account,
-			      const char *source_path,
-			      const char *dest_path,
+			      const gchar *source_path,
+			      const gchar *dest_path,
 			      gboolean remove_source)
 {
 	EFolder *source, *dest_parent;
 	ExchangeHierarchy *source_hier, *dest_hier;
-	const char *name;
+	const gchar *name;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
 				EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
@@ -584,7 +584,7 @@ exchange_account_xfer_folder (ExchangeAccount *account,
 static void
 remove_hierarchy (ExchangeAccount *account, ExchangeHierarchy *hier)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < account->priv->hierarchies->len; i++) {
 		if (account->priv->hierarchies->pdata[i] == hier) {
@@ -616,12 +616,12 @@ static void
 setup_hierarchy_foreign (ExchangeAccount *account, ExchangeHierarchy *hier)
 {
 	g_hash_table_insert (account->priv->foreign_hierarchies,
-			     (char *)hier->owner_email, hier);
+			     (gchar *)hier->owner_email, hier);
 	setup_hierarchy (account, hier);
 }
 
 struct discover_data {
-	const char *user, *folder_name;
+	const gchar *user, *folder_name;
 	E2kOperation op;
 };
 
@@ -629,8 +629,8 @@ static ExchangeHierarchy *
 get_hierarchy_for (ExchangeAccount *account, E2kGlobalCatalogEntry *entry)
 {
 	ExchangeHierarchy *hier;
-	char *hierarchy_name, *source;
-	char *physical_uri_prefix, *internal_uri_prefix;
+	gchar *hierarchy_name, *source;
+	gchar *physical_uri_prefix, *internal_uri_prefix;
 
 	hier = g_hash_table_lookup (account->priv->foreign_hierarchies,
 				    entry->email);
@@ -665,13 +665,13 @@ get_hierarchy_for (ExchangeAccount *account, E2kGlobalCatalogEntry *entry)
 
 ExchangeAccountFolderResult
 exchange_account_discover_shared_folder (ExchangeAccount *account,
-					 const char *user,
-					 const char *folder_name,
+					 const gchar *user,
+					 const gchar *folder_name,
 					 EFolder **folder)
 {
 	struct discover_data dd;
 	ExchangeHierarchy *hier;
-	char *email;
+	gchar *email;
 	E2kGlobalCatalogStatus status;
 	E2kGlobalCatalogEntry *entry;
 
@@ -730,8 +730,8 @@ exchange_account_discover_shared_folder (ExchangeAccount *account,
 
 void
 exchange_account_cancel_discover_shared_folder (ExchangeAccount *account,
-						const char *user,
-						const char *folder_name)
+						const gchar *user,
+						const gchar *folder_name)
 {
 	struct discover_data *dd;
 	GList *dds;
@@ -764,7 +764,7 @@ exchange_account_cancel_discover_shared_folder (ExchangeAccount *account,
 
 ExchangeAccountFolderResult
 exchange_account_remove_shared_folder (ExchangeAccount *account,
-				       const char *path)
+				       const gchar *path)
 {
 	ExchangeHierarchy *hier;
 	EFolder *folder;
@@ -781,11 +781,11 @@ exchange_account_remove_shared_folder (ExchangeAccount *account,
 }
 
 ExchangeAccountFolderResult
-exchange_account_open_folder (ExchangeAccount *account, const char *path)
+exchange_account_open_folder (ExchangeAccount *account, const gchar *path)
 {
 	ExchangeHierarchy *hier;
 	EFolder *folder;
-	int mode;
+	gint mode;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
 				EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
@@ -847,7 +847,7 @@ exchange_account_is_favorite_folder (ExchangeAccount *account,
 
 static void
 context_redirect (E2kContext *ctx, E2kHTTPStatus status,
-		  const char *old_uri, const char *new_uri,
+		  const gchar *old_uri, const gchar *new_uri,
 		  ExchangeAccount *account)
 {
 	EFolder *folder;
@@ -862,19 +862,19 @@ context_redirect (E2kContext *ctx, E2kHTTPStatus status,
 	g_hash_table_remove (account->priv->folders, old_uri);
 	e_folder_exchange_set_internal_uri (folder, new_uri);
 	g_hash_table_insert (account->priv->folders,
-			     (char *)e_folder_exchange_get_internal_uri (folder),
+			     (gchar *)e_folder_exchange_get_internal_uri (folder),
 			     folder);
 
 	g_static_rec_mutex_unlock (&account->priv->folders_lock);
 }
 
 static void
-set_sf_prop (const char *propname, E2kPropType type,
+set_sf_prop (const gchar *propname, E2kPropType type,
 	     gpointer phref, gpointer user_data)
 {
 	ExchangeAccount *account = user_data;
-	const char *href = (const char *)phref;
-	char *tmp;
+	const gchar *href = (const gchar *)phref;
+	gchar *tmp;
 
 	propname = strrchr (propname, ':');
 	if (!propname++ || !href || !*href)
@@ -891,7 +891,7 @@ set_sf_prop (const char *propname, E2kPropType type,
 			     tmp);
 }
 
-static const char *mailbox_info_props[] = {
+static const gchar *mailbox_info_props[] = {
 	E2K_PR_STD_FOLDER_CALENDAR,
 	E2K_PR_STD_FOLDER_CONTACTS,
 	E2K_PR_STD_FOLDER_DELETED_ITEMS,
@@ -908,7 +908,7 @@ static const char *mailbox_info_props[] = {
 	PR_STORE_ENTRYID,
 	E2K_PR_EXCHANGE_TIMEZONE
 };
-static const int n_mailbox_info_props = G_N_ELEMENTS (mailbox_info_props);
+static const gint n_mailbox_info_props = G_N_ELEMENTS (mailbox_info_props);
 
 
 
@@ -944,7 +944,7 @@ account_moved (ExchangeAccount *account, E2kAutoconfig *ac)
 static gboolean
 get_password (ExchangeAccount *account, E2kAutoconfig *ac, ExchangeAccountResult error)
 {
-	char *password;
+	gchar *password;
 
 	if (error != EXCHANGE_ACCOUNT_CONNECT_SUCCESS)
 		e_passwords_forget_password ("Exchange", account->priv->password_key);
@@ -954,7 +954,7 @@ get_password (ExchangeAccount *account, E2kAutoconfig *ac, ExchangeAccountResult
 	if (exchange_component_is_interactive (global_exchange_component)) {
 		gboolean remember, oldremember;
 		if (!password) {
-			char *prompt;
+			gchar *prompt;
 
 			prompt = g_strdup_printf (_("Enter password for %s"),
 						  account->account_name);
@@ -1010,7 +1010,7 @@ get_password (ExchangeAccount *account, E2kAutoconfig *ac, ExchangeAccountResult
 static gboolean
 is_password_expired (ExchangeAccount *account, E2kAutoconfig *ac)
 {
-	char *domain;
+	gchar *domain;
 	E2kKerberosResult result;
 
 	if (!ac->password)
@@ -1045,7 +1045,7 @@ static int
 find_passwd_exp_period (ExchangeAccount *account, E2kGlobalCatalogEntry *entry)
 {
 	double max_pwd_age = 0;
-	int max_pwd_age_days;
+	gint max_pwd_age_days;
 	E2kOperation gcop;
 	E2kGlobalCatalogStatus gcstatus;
 
@@ -1093,7 +1093,7 @@ find_passwd_exp_period (ExchangeAccount *account, E2kGlobalCatalogEntry *entry)
 	return -1;
 }
 
-char *
+gchar *
 exchange_account_get_password (ExchangeAccount *account)
 {
 	return e_passwords_get_password ("Exchange", account->priv->password_key);
@@ -1106,11 +1106,11 @@ exchange_account_forget_password (ExchangeAccount *account)
 }
 
 ExchangeAccountResult
-exchange_account_set_password (ExchangeAccount *account, char *old_pass, char *new_pass)
+exchange_account_set_password (ExchangeAccount *account, gchar *old_pass, gchar *new_pass)
 {
 #ifdef HAVE_KRB5
 	E2kKerberosResult result;
-	char *domain;
+	gchar *domain;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), EXCHANGE_ACCOUNT_PASSWORD_CHANGE_FAILED);
 	g_return_val_if_fail (old_pass != NULL, EXCHANGE_ACCOUNT_PASSWORD_CHANGE_FAILED);
@@ -1231,7 +1231,7 @@ exchange_account_set_online (ExchangeAccount *account)
  * Return value: Returns TRUE if account is offline
  **/
 void
-exchange_account_is_offline (ExchangeAccount *account, int *state)
+exchange_account_is_offline (ExchangeAccount *account, gint *state)
 {
 	g_return_if_fail (EXCHANGE_IS_ACCOUNT (account));
 
@@ -1243,10 +1243,10 @@ setup_account_hierarchies (ExchangeAccount *account)
 {
 	ExchangeHierarchy *hier, *personal_hier;
 	ExchangeAccountFolderResult fresult;
-	char *phys_uri_prefix, *dir;
+	gchar *phys_uri_prefix, *dir;
 	GDir *d;
-	const char *dent;
-	int mode;
+	const gchar *dent;
+	gint mode;
 
 	exchange_account_is_offline (account, &mode);
 
@@ -1375,7 +1375,7 @@ hierarchies_created:
  * failed.
  **/
 E2kContext *
-exchange_account_connect (ExchangeAccount *account, const char *pword,
+exchange_account_connect (ExchangeAccount *account, const gchar *pword,
 			  ExchangeAccountResult *info_result)
 {
 	E2kAutoconfig *ac;
@@ -1383,13 +1383,13 @@ exchange_account_connect (ExchangeAccount *account, const char *pword,
 	E2kHTTPStatus status;
 	gboolean redirected = FALSE;
 	E2kResult *results;
-	int nresults = 0, mode;
+	gint nresults = 0, mode;
 	GByteArray *entryid;
-	const char *tz;
+	const gchar *tz;
 	E2kGlobalCatalogStatus gcstatus;
 	E2kGlobalCatalogEntry *entry;
 	E2kOperation gcop;
-	char *user_name = NULL;
+	gchar *user_name = NULL;
 
 	*info_result = EXCHANGE_ACCOUNT_UNKNOWN_ERROR;
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
@@ -1631,7 +1631,7 @@ skip_quota:
  * Return value: TRUE if offline_sync is set for @account and FALSE if not.
  */
 void
-exchange_account_is_offline_sync_set (ExchangeAccount *account, int *mode)
+exchange_account_is_offline_sync_set (ExchangeAccount *account, gint *mode)
 {
 	*mode = UNSUPPORTED_MODE;
 
@@ -1696,12 +1696,12 @@ exchange_account_fetch (ExchangeAccount *acct)
  * Reads the parameter #param from the source url of the underlying EAccount.
  * Returns the value or NULL. Returned value should be freed with g_free.
  **/
-char *
-exchange_account_get_account_uri_param (ExchangeAccount *acct, const char *param)
+gchar *
+exchange_account_get_account_uri_param (ExchangeAccount *acct, const gchar *param)
 {
 	EAccount *account;
 	E2kUri *uri;
-	char *res;
+	gchar *res;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (acct), NULL);
 	g_return_val_if_fail (param != NULL, NULL);
@@ -1734,8 +1734,8 @@ exchange_account_get_account_uri_param (ExchangeAccount *acct, const char *param
  * account is not connected or the property is invalid or not
  * defined on @account.
  **/
-const char *
-exchange_account_get_standard_uri (ExchangeAccount *account, const char *item)
+const gchar *
+exchange_account_get_standard_uri (ExchangeAccount *account, const gchar *item)
 {
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
 
@@ -1756,15 +1756,15 @@ exchange_account_get_standard_uri (ExchangeAccount *account, const char *item)
  * Return value: the URI of the folder, or %NULL if either the folder
  * doesn't exist or the user doesn't have permission to access it.
  **/
-char *
+gchar *
 exchange_account_get_standard_uri_for (ExchangeAccount *account,
-				       const char *home_uri,
-				       const char *std_uri_prop)
+				       const gchar *home_uri,
+				       const gchar *std_uri_prop)
 {
-	char *foreign_uri, *prop;
+	gchar *foreign_uri, *prop;
 	E2kHTTPStatus status;
 	E2kResult *results;
-	int nresults = 0;
+	gint nresults = 0;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
 
@@ -1800,17 +1800,17 @@ exchange_account_get_standard_uri_for (ExchangeAccount *account,
  * Return value: the URI of the folder, or %NULL if either the folder
  * doesn't exist or the user doesn't have permission to access it.
  **/
-char *
+gchar *
 exchange_account_get_foreign_uri (ExchangeAccount *account,
 				  E2kGlobalCatalogEntry *entry,
-				  const char *std_uri_prop)
+				  const gchar *std_uri_prop)
 {
-	char *home_uri, *foreign_uri;
+	gchar *home_uri, *foreign_uri;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
 
 	if (account->priv->uris_use_email) {
-		char *mailbox;
+		gchar *mailbox;
 
 		mailbox = g_strndup (entry->email, strcspn (entry->email, "@"));
 		home_uri = g_strdup_printf (account->priv->http_uri_schema,
@@ -1837,11 +1837,11 @@ exchange_account_get_foreign_uri (ExchangeAccount *account,
   problem between exchange and evolution is fixed. Exchange does not get to know
  if an user's folder is subscribed from evolution */
 void
-exchange_account_scan_foreign_hierarchy (ExchangeAccount *account, const char *user_email)
+exchange_account_scan_foreign_hierarchy (ExchangeAccount *account, const gchar *user_email)
 {
-	char *dir;
+	gchar *dir;
 	ExchangeHierarchy *hier;
-	int mode;
+	gint mode;
 
 	hier = g_hash_table_lookup (account->priv->foreign_hierarchies, user_email);
 	if (hier) {
@@ -1873,11 +1873,11 @@ exchange_account_scan_foreign_hierarchy (ExchangeAccount *account, const char *u
  **/
 
 ExchangeHierarchy *
-exchange_account_get_hierarchy_by_email (ExchangeAccount *account, const char *email)
+exchange_account_get_hierarchy_by_email (ExchangeAccount *account, const gchar *email)
 {
-	char *dir;
+	gchar *dir;
 	ExchangeHierarchy *hier = NULL;
-	int mode;
+	gint mode;
 
 	g_return_val_if_fail (email != NULL, NULL);
 
@@ -1907,7 +1907,7 @@ exchange_account_get_hierarchy_by_email (ExchangeAccount *account, const char *e
  **/
 EFolder *
 exchange_account_get_folder (ExchangeAccount *account,
-			     const char *path_or_uri)
+			     const gchar *path_or_uri)
 {
 	EFolder *folder;
 
@@ -1923,7 +1923,7 @@ exchange_account_get_folder (ExchangeAccount *account,
 }
 
 static int
-folder_comparator (const void *a, const void *b)
+folder_comparator (gconstpointer a, gconstpointer b)
 {
 	EFolder **fa = (EFolder **)a;
 	EFolder **fb = (EFolder **)b;
@@ -1933,7 +1933,7 @@ folder_comparator (const void *a, const void *b)
 }
 
 struct _folders_tree {
-	char *path;
+	gchar *path;
 	GPtrArray *folders;
 };
 
@@ -2010,7 +2010,7 @@ exchange_account_get_folders (ExchangeAccount *account)
  * g_ptr_array_free().
  **/
 GPtrArray *
-exchange_account_get_folder_tree (ExchangeAccount *account, char* path)
+exchange_account_get_folder_tree (ExchangeAccount *account, gchar * path)
 {
 	GPtrArray *folders = NULL;
 	EFolder *folder = NULL;
@@ -2050,7 +2050,7 @@ exchange_account_get_folder_tree (ExchangeAccount *account, char* path)
  *
  * Return value: an int
  **/
-int
+gint
 exchange_account_get_quota_limit (ExchangeAccount *account)
 {
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 0);
@@ -2058,11 +2058,11 @@ exchange_account_get_quota_limit (ExchangeAccount *account)
 	return account->priv->quota_limit;
 }
 
-int
+gint
 exchange_account_check_password_expiry (ExchangeAccount *account)
 {
 	E2kGlobalCatalogEntry *entry=NULL; /* This is never set before it's used! */
-	int max_pwd_age_days = -1;
+	gint max_pwd_age_days = -1;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 0);
 
@@ -2070,7 +2070,7 @@ exchange_account_check_password_expiry (ExchangeAccount *account)
 	return max_pwd_age_days;
 }
 
-char *
+gchar *
 exchange_account_get_username (ExchangeAccount *account)
 {
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
@@ -2086,7 +2086,7 @@ exchange_account_get_username (ExchangeAccount *account)
   *
   * Return value : Windows domain
   **/
-char *
+gchar *
 exchange_account_get_windows_domain (ExchangeAccount *account)
 {
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
@@ -2102,7 +2102,7 @@ exchange_account_get_windows_domain (ExchangeAccount *account)
   *
   * Return value : e-mail id string.
   **/
-char *
+gchar *
 exchange_account_get_email_id (ExchangeAccount *account)
 {
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
@@ -2122,7 +2122,7 @@ exchange_account_get_email_id (ExchangeAccount *account)
   **/
 void
 exchange_account_folder_size_add (ExchangeAccount *account,
-				     const char *folder_name,
+				     const gchar *folder_name,
 				     gdouble size)
 {
 	g_return_if_fail (EXCHANGE_IS_ACCOUNT (account));
@@ -2141,7 +2141,7 @@ exchange_account_folder_size_add (ExchangeAccount *account,
   **/
 void
 exchange_account_folder_size_remove (ExchangeAccount *account,
-					const char *folder_name)
+					const gchar *folder_name)
 {
 	g_return_if_fail (EXCHANGE_IS_ACCOUNT (account));
 
@@ -2161,8 +2161,8 @@ exchange_account_folder_size_remove (ExchangeAccount *account,
   **/
 void
 exchange_account_folder_size_rename (ExchangeAccount *account,
-					const char *old_name,
-					const char *new_name)
+					const gchar *old_name,
+					const gchar *new_name)
 {
 	gdouble cached_size;
 
@@ -2194,7 +2194,7 @@ exchange_account_folder_size_get_model (ExchangeAccount *account)
 	return exchange_folder_size_get_model (account->priv->fsize);
 }
 
-char *
+gchar *
 exchange_account_get_authtype (ExchangeAccount *account)
 {
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
@@ -2221,9 +2221,9 @@ ExchangeAccount *
 exchange_account_new (EAccountList *account_list, EAccount *adata)
 {
 	ExchangeAccount *account;
-	char *enc_user, *mailbox;
-	const char *param, *proto="http", *owa_path, *pf_server, *owa_url;
-	const char *passwd_exp_warn_period, *offline_sync;
+	gchar *enc_user, *mailbox;
+	const gchar *param, *proto="http", *owa_path, *pf_server, *owa_url;
+	const gchar *passwd_exp_warn_period, *offline_sync;
 	E2kUri *uri;
 
 	uri = e2k_uri_new (adata->source->url);
@@ -2393,7 +2393,7 @@ ExchangeHierarchy*
 exchange_account_get_hierarchy_by_type (ExchangeAccount* acct,
 					ExchangeHierarchyType type)
 {
-	int i;
+	gint i;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (acct), NULL);
 	g_return_val_if_fail (type != EXCHANGE_HIERARCHY_FOREIGN, NULL);
diff --git a/servers/exchange/storage/exchange-account.h b/servers/exchange/storage/exchange-account.h
index 2e3764c..d07abc6 100644
--- a/servers/exchange/storage/exchange-account.h
+++ b/servers/exchange/storage/exchange-account.h
@@ -34,9 +34,9 @@ struct _ExchangeAccount {
 	 * account_filename is "username hostname" run through
 	 * e_filename_make_safe.
 	 */
-	char *account_name, *account_filename, *storage_dir;
-	char *exchange_server, *home_uri, *public_uri;
-	char *legacy_exchange_dn, *default_timezone;
+	gchar *account_name, *account_filename, *storage_dir;
+	gchar *exchange_server, *home_uri, *public_uri;
+	gchar *legacy_exchange_dn, *default_timezone;
 
 	gboolean filter_inbox, filter_junk, filter_junk_inbox_only;
 	gdouble mbox_size;
@@ -81,30 +81,30 @@ E2kContext            *exchange_account_get_context          (ExchangeAccount  *
 E2kGlobalCatalog      *exchange_account_get_global_catalog   (ExchangeAccount  *acct);
 
 EAccount	      *exchange_account_fetch		     (ExchangeAccount *acct);
-char                  *exchange_account_get_account_uri_param (ExchangeAccount *acct, const char *param);
+gchar                  *exchange_account_get_account_uri_param (ExchangeAccount *acct, const gchar *param);
 
-const char            *exchange_account_get_standard_uri     (ExchangeAccount  *acct,
-							      const char       *item);
+const gchar            *exchange_account_get_standard_uri     (ExchangeAccount  *acct,
+							      const gchar       *item);
 
-char                  *exchange_account_get_standard_uri_for (ExchangeAccount  *acct,
-							      const char       *home_uri,
-							      const char       *std_uri_prop);
-char                  *exchange_account_get_foreign_uri      (ExchangeAccount  *acct,
+gchar                  *exchange_account_get_standard_uri_for (ExchangeAccount  *acct,
+							      const gchar       *home_uri,
+							      const gchar       *std_uri_prop);
+gchar                  *exchange_account_get_foreign_uri      (ExchangeAccount  *acct,
 							      E2kGlobalCatalogEntry *entry,
-							      const char       *std_uri_prop);
-ExchangeHierarchy     *exchange_account_get_hierarchy_by_email (ExchangeAccount *account, const char *email);
+							      const gchar       *std_uri_prop);
+ExchangeHierarchy     *exchange_account_get_hierarchy_by_email (ExchangeAccount *account, const gchar *email);
 
 char		      *exchange_account_get_authtype	     (ExchangeAccount *account);
 
 E2kContext            *exchange_account_connect              (ExchangeAccount  *acct,
-							      const char *pword,
+							      const gchar *pword,
 							      ExchangeAccountResult *result);
 
 EFolder               *exchange_account_get_folder           (ExchangeAccount  *acct,
-							      const char       *path_or_uri);
+							      const gchar       *path_or_uri);
 GPtrArray             *exchange_account_get_folders          (ExchangeAccount  *acct);
 
-GPtrArray	       *exchange_account_get_folder_tree      (ExchangeAccount *account, char* path);
+GPtrArray	       *exchange_account_get_folder_tree      (ExchangeAccount *account, gchar * path);
 
 ExchangeHierarchy     *exchange_account_get_hierarchy_by_type	      (ExchangeAccount *acct,
 							       ExchangeHierarchyType type);
@@ -114,8 +114,8 @@ void                   exchange_account_rescan_tree          (ExchangeAccount  *
 char		      *exchange_account_get_password	     (ExchangeAccount  *acct);
 
 ExchangeAccountResult exchange_account_set_password	     (ExchangeAccount  *acct,
-							      char             *old_password,
-							      char             *new_password);
+							      gchar             *old_password,
+							      gchar             *new_password);
 
 void		       exchange_account_forget_password       (ExchangeAccount  *acct);
 
@@ -129,10 +129,10 @@ gboolean	       exchange_account_set_offline          (ExchangeAccount  *account
 gboolean	       exchange_account_set_online           (ExchangeAccount  *account);
 
 void		       exchange_account_is_offline           (ExchangeAccount  *account,
-							      int              *mode);
+							      gint              *mode);
 
 void		       exchange_account_is_offline_sync_set  (ExchangeAccount *account,
-							      int             *mode);
+							      gint             *mode);
 
 
 typedef enum {
@@ -149,26 +149,26 @@ typedef enum {
 } ExchangeAccountFolderResult;
 
 ExchangeAccountFolderResult exchange_account_create_folder (ExchangeAccount *account,
-							    const char      *path,
-							    const char      *type);
+							    const gchar      *path,
+							    const gchar      *type);
 ExchangeAccountFolderResult exchange_account_remove_folder (ExchangeAccount *account,
-							    const char      *path);
+							    const gchar      *path);
 ExchangeAccountFolderResult exchange_account_xfer_folder   (ExchangeAccount *account,
-							    const char      *source_path,
-							    const char      *dest_path,
+							    const gchar      *source_path,
+							    const gchar      *dest_path,
 							    gboolean         remove_source);
 ExchangeAccountFolderResult exchange_account_open_folder   (ExchangeAccount *account,
-							    const char      *path);
+							    const gchar      *path);
 
 ExchangeAccountFolderResult exchange_account_discover_shared_folder  (ExchangeAccount *account,
-								      const char      *user,
-								      const char      *folder_name,
+								      const gchar      *user,
+								      const gchar      *folder_name,
 								      EFolder        **folder);
 void       exchange_account_cancel_discover_shared_folder (ExchangeAccount *account,
-							      const char      *user,
-							      const char      *folder);
+							      const gchar      *user,
+							      const gchar      *folder);
 ExchangeAccountFolderResult exchange_account_remove_shared_folder    (ExchangeAccount *account,
-								      const char      *path);
+								      const gchar      *path);
 
 ExchangeAccountFolderResult exchange_account_add_favorite (ExchangeAccount *account,
 							   EFolder         *folder);
@@ -178,28 +178,28 @@ ExchangeAccountFolderResult exchange_account_remove_favorite (ExchangeAccount *a
 gboolean exchange_account_is_favorite_folder              (ExchangeAccount *account,
 							   EFolder         *folder);
 
-char * exchange_account_get_username			  (ExchangeAccount *account);
+gchar * exchange_account_get_username			  (ExchangeAccount *account);
 
-char * exchange_account_get_windows_domain		  (ExchangeAccount *account);
+gchar * exchange_account_get_windows_domain		  (ExchangeAccount *account);
 
-char * exchange_account_get_email_id			  (ExchangeAccount *account);
+gchar * exchange_account_get_email_id			  (ExchangeAccount *account);
 
-int exchange_account_get_quota_limit			  (ExchangeAccount *account);
+gint exchange_account_get_quota_limit			  (ExchangeAccount *account);
 
-int exchange_account_check_password_expiry		  (ExchangeAccount *account);
+gint exchange_account_check_password_expiry		  (ExchangeAccount *account);
 
 /* Folder Size methods */
 void			exchange_account_folder_size_add   (ExchangeAccount *account,
-							     const char *folder_name,
+							     const gchar *folder_name,
 							     gdouble size);
 void			exchange_account_folder_size_remove (ExchangeAccount *account,
-							     const char *folder_name);
+							     const gchar *folder_name);
 void			exchange_account_folder_size_rename (ExchangeAccount *account,
-							     const char *old_name,
-							     const char *new_name);
+							     const gchar *old_name,
+							     const gchar *new_name);
 GtkListStore	       *exchange_account_folder_size_get_model (ExchangeAccount *account);
 void			exchange_account_scan_foreign_hierarchy (ExchangeAccount *account,
-							      const char *user_email);
+							      const gchar *user_email);
 
 
 #ifdef __cplusplus
diff --git a/servers/exchange/storage/exchange-esource.c b/servers/exchange/storage/exchange-esource.c
index 0a560cf..3fee5ca 100644
--- a/servers/exchange/storage/exchange-esource.c
+++ b/servers/exchange/storage/exchange-esource.c
@@ -70,18 +70,18 @@ find_account_group (ESourceList *source_list, ExchangeAccount *exa)
 void
 add_folder_esource (ExchangeAccount *account,
 		    FolderType folder_type,
-		    const char *folder_name,
-		    const char *physical_uri)
+		    const gchar *folder_name,
+		    const gchar *physical_uri)
 {
 	ESource *source = NULL;
 	ESourceGroup *source_group = NULL;
-	char *relative_uri = NULL;
+	gchar *relative_uri = NULL;
 	GSList *ids;
 	GConfClient *client;
 	gboolean is_contacts_folder = TRUE, group_new = FALSE, source_new = FALSE;
-	const char *offline = NULL;
-	char *username, *windows_domain, *useremail, *authtype = NULL;
-	int mode;
+	const gchar *offline = NULL;
+	gchar *username, *windows_domain, *useremail, *authtype = NULL;
+	gint mode;
 	ESourceList *source_list = NULL;
 	gboolean offline_flag, update_selection = TRUE, foriegn_folder;
 
@@ -142,7 +142,7 @@ add_folder_esource (ExchangeAccount *account,
 		e_source_group_set_property (source_group, "account-uid", exchange_account_fetch (account)->uid);
 
 		if (is_contacts_folder && g_str_has_prefix (physical_uri, "gal://")) {
-			char *browse = exchange_account_get_account_uri_param (account, "ad_browse");
+			gchar *browse = exchange_account_get_account_uri_param (account, "ad_browse");
 
 			source = e_source_new_with_absolute_uri (folder_name,
 								 physical_uri);
@@ -185,7 +185,7 @@ add_folder_esource (ExchangeAccount *account,
 							folder_name)) == NULL) {
 			printf("old group, new source\n");
 			if (is_contacts_folder && g_str_has_prefix (physical_uri, "gal://")) {
-				char *browse = exchange_account_get_account_uri_param (account, "ad_browse");
+				gchar *browse = exchange_account_get_account_uri_param (account, "ad_browse");
 
 				source = e_source_new_with_absolute_uri (
 						folder_name, physical_uri);
@@ -231,8 +231,8 @@ add_folder_esource (ExchangeAccount *account,
 			}
 
 			if (is_contacts_folder && g_str_has_prefix (physical_uri, "gal://")) {
-				char *browse = exchange_account_get_account_uri_param (account, "ad_browse");
-				const char *old_browse = e_source_get_property (source, "can-browse");
+				gchar *browse = exchange_account_get_account_uri_param (account, "ad_browse");
+				const gchar *old_browse = e_source_get_property (source, "can-browse");
 
 				if ((old_browse || browse) && (!old_browse || !browse)) {
 					e_source_set_property (source, "can-browse", browse ? "1" : NULL);
@@ -290,15 +290,15 @@ add_folder_esource (ExchangeAccount *account,
 void
 remove_folder_esource (ExchangeAccount *account,
 		       FolderType folder_type,
-		       const char *physical_uri)
+		       const gchar *physical_uri)
 {
 	ESourceGroup *group;
 	ESource *source;
 	GSList *groups;
 	GSList *sources;
 	gboolean found_group, is_contacts_folder = TRUE;
-	char *read_uri = NULL;
-	const char *source_uid;
+	gchar *read_uri = NULL;
+	const gchar *source_uid;
 	GSList *ids, *temp_ids, *node_to_be_deleted;
 	GConfClient *client;
 	ESourceList *source_list = NULL;
diff --git a/servers/exchange/storage/exchange-esource.h b/servers/exchange/storage/exchange-esource.h
index 53a7681..65edd9f 100644
--- a/servers/exchange/storage/exchange-esource.h
+++ b/servers/exchange/storage/exchange-esource.h
@@ -19,11 +19,11 @@ extern "C" {
 #define CONF_KEY_CONTACTS "/apps/evolution/addressbook/sources"
 #define EXCHANGE_URI_PREFIX "exchange://"
 
-void			add_folder_esource (ExchangeAccount *account, FolderType folder_type, const char *folder_name, const char *physical_uri);
-void			remove_folder_esource (ExchangeAccount *account, FolderType folder_type, const char *physical_uri);
+void			add_folder_esource (ExchangeAccount *account, FolderType folder_type, const gchar *folder_name, const gchar *physical_uri);
+void			remove_folder_esource (ExchangeAccount *account, FolderType folder_type, const gchar *physical_uri);
 
 /* Remove this ugly hack by moving this to exchange-account.h */
-char * exchange_account_get_authtype (ExchangeAccount *account);
+gchar * exchange_account_get_authtype (ExchangeAccount *account);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/storage/exchange-folder-size.c b/servers/exchange/storage/exchange-folder-size.c
index 6715759..aa02622 100644
--- a/servers/exchange/storage/exchange-folder-size.c
+++ b/servers/exchange/storage/exchange-folder-size.c
@@ -36,7 +36,7 @@
 static GObjectClass *parent_class = NULL;
 
 typedef struct {
-        char *folder_name;
+        gchar *folder_name;
         gdouble folder_size;
 } folder_info;
 
@@ -137,7 +137,7 @@ exchange_folder_size_new (void)
 
 void
 exchange_folder_size_update (ExchangeFolderSize *fsize,
-				const char *folder_name,
+				const gchar *folder_name,
 				gdouble folder_size)
 {
 	folder_info *f_info, *cached_info;
@@ -191,7 +191,7 @@ exchange_folder_size_update (ExchangeFolderSize *fsize,
 
 void
 exchange_folder_size_remove (ExchangeFolderSize *fsize,
-				const char *folder_name)
+				const gchar *folder_name)
 {
 	ExchangeFolderSizePrivate *priv;
 	GHashTable *folder_size_table;
@@ -221,7 +221,7 @@ exchange_folder_size_remove (ExchangeFolderSize *fsize,
 
 gdouble
 exchange_folder_size_get (ExchangeFolderSize *fsize,
-			  const char *folder_name)
+			  const gchar *folder_name)
 {
 	ExchangeFolderSizePrivate *priv;
 	GHashTable *folder_size_table;
diff --git a/servers/exchange/storage/exchange-folder-size.h b/servers/exchange/storage/exchange-folder-size.h
index ef296bf..37c9f38 100644
--- a/servers/exchange/storage/exchange-folder-size.h
+++ b/servers/exchange/storage/exchange-folder-size.h
@@ -40,11 +40,11 @@ GType    exchange_folder_size_get_type (void);
 ExchangeFolderSize *exchange_folder_size_new (void);
 
 void exchange_folder_size_update (ExchangeFolderSize *fsize,
-						const char *folder_name,
+						const gchar *folder_name,
 						gdouble folder_size);
-void exchange_folder_size_remove (ExchangeFolderSize *fsize, const char *folder_name);
+void exchange_folder_size_remove (ExchangeFolderSize *fsize, const gchar *folder_name);
 
-gdouble exchange_folder_size_get (ExchangeFolderSize *fsize, const char *folder_name);
+gdouble exchange_folder_size_get (ExchangeFolderSize *fsize, const gchar *folder_name);
 
 GtkListStore *exchange_folder_size_get_model (ExchangeFolderSize *fsize);
 
diff --git a/servers/exchange/storage/exchange-hierarchy-favorites.c b/servers/exchange/storage/exchange-hierarchy-favorites.c
index c33166a..f4cf5be 100644
--- a/servers/exchange/storage/exchange-hierarchy-favorites.c
+++ b/servers/exchange/storage/exchange-hierarchy-favorites.c
@@ -40,7 +40,7 @@
 #include <unistd.h>
 
 struct _ExchangeHierarchyFavoritesPrivate {
-	char *public_uri, *shortcuts_uri;
+	gchar *public_uri, *shortcuts_uri;
 	GHashTable *shortcuts;
 };
 
@@ -96,17 +96,17 @@ E2K_MAKE_TYPE (exchange_hierarchy_favorites, ExchangeHierarchyFavorites, class_i
 static void
 add_hrefs (ExchangeHierarchy *hier, EFolder *folder, gpointer hrefs)
 {
-	g_ptr_array_add (hrefs, (char *)e2k_uri_path (e_folder_exchange_get_internal_uri (folder)));
+	g_ptr_array_add (hrefs, (gchar *)e2k_uri_path (e_folder_exchange_get_internal_uri (folder)));
 }
 
-static const char *shortcuts_props[] = {
+static const gchar *shortcuts_props[] = {
 	PR_FAV_DISPLAY_NAME,		/* PR_DISPLAY_NAME of referent */
 	PR_FAV_DISPLAY_ALIAS,		/* if set, user-chosen display name */
 	PR_FAV_PUBLIC_SOURCE_KEY,	/* PR_SOURCE_KEY of referent */
 	PR_FAV_PARENT_SOURCE_KEY,	/* PR_FAV_PUBLIC_SOURCE_KEY of parent */
 	PR_FAV_LEVEL_MASK		/* depth in hierarchy (first level is 1) */
 };
-static const int n_shortcuts_props = G_N_ELEMENTS (shortcuts_props);
+static const gint n_shortcuts_props = G_N_ELEMENTS (shortcuts_props);
 
 static GPtrArray *
 get_hrefs (ExchangeHierarchySomeDAV *hsd)
@@ -119,9 +119,9 @@ get_hrefs (ExchangeHierarchySomeDAV *hsd)
 	E2kResult *result, *results;
 	E2kHTTPStatus status;
 	GByteArray *source_key;
-	const char *prop = E2K_PR_DAV_HREF, *shortcut_uri;
-	char *perm_url, *folder_uri;
-	int i, nresults = 0, mode;
+	const gchar *prop = E2K_PR_DAV_HREF, *shortcut_uri;
+	gchar *perm_url, *folder_uri;
+	gint i, nresults = 0, mode;
 
 	hrefs = g_ptr_array_new ();
 
@@ -185,7 +185,7 @@ exchange_hierarchy_favorites_is_added (ExchangeHierarchy *hier, EFolder *folder)
 {
 	ExchangeHierarchyFavorites *hfav =
 		EXCHANGE_HIERARCHY_FAVORITES (hier);
-	const char *folder_uri, *shortcut_uri;
+	const gchar *folder_uri, *shortcut_uri;
 
 	folder_uri = e_folder_exchange_get_internal_uri (folder);
 	shortcut_uri = g_hash_table_lookup (hfav->priv->shortcuts, folder_uri);
@@ -198,9 +198,9 @@ remove_folder (ExchangeHierarchy *hier, EFolder *folder)
 {
 	ExchangeHierarchyFavorites *hfav =
 		EXCHANGE_HIERARCHY_FAVORITES (hier);
-	const char *folder_uri, *shortcut_uri;
+	const gchar *folder_uri, *shortcut_uri;
 	E2kHTTPStatus status;
-	const char *folder_type, *physical_uri;
+	const gchar *folder_type, *physical_uri;
 
 	folder_uri = e_folder_exchange_get_internal_uri (folder);
 	shortcut_uri = g_hash_table_lookup (hfav->priv->shortcuts, folder_uri);
@@ -256,8 +256,8 @@ exchange_hierarchy_favorites_add_folder (ExchangeHierarchy *hier,
 	ExchangeHierarchyFavorites *hfav;
 	E2kProperties *props;
 	E2kHTTPStatus status;
-	const char *folder_uri, *permanent_uri;
-	char *shortcut_uri;
+	const gchar *folder_uri, *permanent_uri;
+	gchar *shortcut_uri;
 
 	g_return_val_if_fail (EXCHANGE_IS_HIERARCHY (hier), EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 	g_return_val_if_fail (E_IS_FOLDER (folder), EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
@@ -309,13 +309,13 @@ exchange_hierarchy_favorites_add_folder (ExchangeHierarchy *hier,
  **/
 ExchangeHierarchy *
 exchange_hierarchy_favorites_new (ExchangeAccount *account,
-				  const char *hierarchy_name,
-				  const char *physical_uri_prefix,
-				  const char *home_uri,
-				  const char *public_uri,
-				  const char *owner_name,
-				  const char *owner_email,
-				  const char *source_uri)
+				  const gchar *hierarchy_name,
+				  const gchar *physical_uri_prefix,
+				  const gchar *home_uri,
+				  const gchar *public_uri,
+				  const gchar *owner_name,
+				  const gchar *owner_email,
+				  const gchar *source_uri)
 {
 	ExchangeHierarchy *hier;
 	ExchangeHierarchyFavorites *hfav;
diff --git a/servers/exchange/storage/exchange-hierarchy-favorites.h b/servers/exchange/storage/exchange-hierarchy-favorites.h
index d3a6de8..a513ea8 100644
--- a/servers/exchange/storage/exchange-hierarchy-favorites.h
+++ b/servers/exchange/storage/exchange-hierarchy-favorites.h
@@ -31,13 +31,13 @@ struct _ExchangeHierarchyFavoritesClass {
 GType              exchange_hierarchy_favorites_get_type (void);
 
 ExchangeHierarchy *exchange_hierarchy_favorites_new (ExchangeAccount *account,
-						     const char *hierarchy_name,
-						     const char *physical_uri_prefix,
-						     const char *home_uri,
-						     const char *public_uri,
-						     const char *owner_name,
-						     const char *owner_email,
-						     const char *source_uri);
+						     const gchar *hierarchy_name,
+						     const gchar *physical_uri_prefix,
+						     const gchar *home_uri,
+						     const gchar *public_uri,
+						     const gchar *owner_name,
+						     const gchar *owner_email,
+						     const gchar *source_uri);
 
 ExchangeAccountFolderResult  exchange_hierarchy_favorites_add_folder (ExchangeHierarchy *hier,
 								      EFolder *folder);
diff --git a/servers/exchange/storage/exchange-hierarchy-foreign.c b/servers/exchange/storage/exchange-hierarchy-foreign.c
index ce0308a..35408ec 100644
--- a/servers/exchange/storage/exchange-hierarchy-foreign.c
+++ b/servers/exchange/storage/exchange-hierarchy-foreign.c
@@ -51,7 +51,7 @@ struct _ExchangeHierarchyForeignPrivate {
 	gboolean checked_hide_private;
 };
 
-extern const char *exchange_localfreebusy_path;
+extern const gchar *exchange_localfreebusy_path;
 
 #define PARENT_TYPE EXCHANGE_TYPE_HIERARCHY_SOMEDAV
 static ExchangeHierarchySomeDAVClass *parent_class = NULL;
@@ -59,13 +59,13 @@ static ExchangeHierarchySomeDAVClass *parent_class = NULL;
 static GPtrArray *get_hrefs (ExchangeHierarchySomeDAV *hsd);
 static ExchangeAccountFolderResult create_folder (ExchangeHierarchy *hier,
 						  EFolder *parent,
-						  const char *name,
-						  const char *type);
+						  const gchar *name,
+						  const gchar *type);
 static ExchangeAccountFolderResult remove_folder (ExchangeHierarchy *hier,
 						  EFolder *folder);
 static ExchangeAccountFolderResult scan_subtree (ExchangeHierarchy *hier,
 						 EFolder *folder,
-						 int mode);
+						 gint mode);
 static void finalize (GObject *object);
 
 static void
@@ -112,11 +112,11 @@ finalize (GObject *object)
 
 E2K_MAKE_TYPE (exchange_hierarchy_foreign, ExchangeHierarchyForeign, class_init, init, PARENT_TYPE)
 
-static const char *privacy_props[] = {
+static const gchar *privacy_props[] = {
 	PR_DELEGATES_ENTRYIDS,
 	PR_DELEGATES_SEE_PRIVATE,
 };
-static const int n_privacy_props = sizeof (privacy_props) / sizeof (privacy_props[0]);
+static const gint n_privacy_props = sizeof (privacy_props) / sizeof (privacy_props[0]);
 
 static void
 check_hide_private (ExchangeHierarchy *hier)
@@ -125,11 +125,11 @@ check_hide_private (ExchangeHierarchy *hier)
 	E2kContext *ctx;
 	E2kHTTPStatus status;
 	E2kResult *results;
-	int nresults = 0, i;
+	gint nresults = 0, i;
 	GPtrArray *entryids, *privflags;
 	GByteArray *entryid;
-	const char *my_dn, *delegate_dn;
-	char *uri;
+	const gchar *my_dn, *delegate_dn;
+	gchar *uri;
 
 	g_mutex_lock (hfor->priv->hide_private_lock);
 
@@ -192,7 +192,7 @@ remove_all_cb (ExchangeHierarchy *hier, EFolder *folder, gpointer user_data)
 static void
 hierarchy_foreign_cleanup (ExchangeHierarchy *hier)
 {
-	char *mf_path;
+	gchar *mf_path;
 
 	exchange_hierarchy_webdav_offline_scan_subtree (hier, remove_all_cb,
 							NULL);
@@ -204,24 +204,24 @@ hierarchy_foreign_cleanup (ExchangeHierarchy *hier)
 	exchange_hierarchy_removed_folder (hier, hier->toplevel);
 }
 
-static const char *folder_props[] = {
+static const gchar *folder_props[] = {
 	E2K_PR_EXCHANGE_FOLDER_CLASS,
 	E2K_PR_HTTPMAIL_UNREAD_COUNT,
 	E2K_PR_DAV_DISPLAY_NAME,
 	PR_ACCESS
 };
-static const int n_folder_props = sizeof (folder_props) / sizeof (folder_props[0]);
+static const gint n_folder_props = sizeof (folder_props) / sizeof (folder_props[0]);
 
 static ExchangeAccountFolderResult
-find_folder (ExchangeHierarchy *hier, const char *uri, EFolder **folder_out)
+find_folder (ExchangeHierarchy *hier, const gchar *uri, EFolder **folder_out)
 {
 	ExchangeHierarchyWebDAV *hwd = EXCHANGE_HIERARCHY_WEBDAV (hier);
 	E2kContext *ctx = exchange_account_get_context (hier->account);
 	E2kHTTPStatus status;
 	E2kResult *results;
-	int nresults = 0;
+	gint nresults = 0;
 	EFolder *folder;
-	const char *access;
+	const gchar *access;
 
 	status = e2k_context_propfind (ctx, NULL, uri,
 				       folder_props, n_folder_props,
@@ -255,7 +255,7 @@ find_folder (ExchangeHierarchy *hier, const char *uri, EFolder **folder_out)
 }
 
 static struct {
-	const char *name, *prop;
+	const gchar *name, *prop;
 } std_folders[] = {
 	{ N_("Calendar"),	E2K_PR_STD_FOLDER_CALENDAR },
 	{ N_("Contacts"),	E2K_PR_STD_FOLDER_CONTACTS },
@@ -270,12 +270,12 @@ static struct {
 };
 static ExchangeAccountFolderResult
 create_internal (ExchangeHierarchy *hier, EFolder *parent,
-		 const char *name, const char *type, EFolder **folder_out)
+		 const gchar *name, const gchar *type, EFolder **folder_out)
 {
 	ExchangeAccountFolderResult result;
-	char *literal_uri = NULL, *standard_uri = NULL;
-	const char *home_uri;
-	int i;
+	gchar *literal_uri = NULL, *standard_uri = NULL;
+	const gchar *home_uri;
+	gint i;
 
 	/* For now, no nesting */
 	if (parent != hier->toplevel || strchr (name + 1, '/'))
@@ -337,7 +337,7 @@ create_internal (ExchangeHierarchy *hier, EFolder *parent,
 
 static ExchangeAccountFolderResult
 create_folder (ExchangeHierarchy *hier, EFolder *parent,
-	       const char *name, const char *type)
+	       const gchar *name, const gchar *type)
 {
 	return create_internal (hier, parent, name, type, NULL);
 }
@@ -345,7 +345,7 @@ create_folder (ExchangeHierarchy *hier, EFolder *parent,
 static ExchangeAccountFolderResult
 remove_folder (ExchangeHierarchy *hier, EFolder *folder)
 {
-	const char *folder_type, *physical_uri;
+	const gchar *folder_type, *physical_uri;
 
 	/* Temp Fix for remove fav folders. see #59168 */
         /* remove ESources */
@@ -377,7 +377,7 @@ remove_folder (ExchangeHierarchy *hier, EFolder *folder)
 }
 
 static ExchangeAccountFolderResult
-scan_subtree (ExchangeHierarchy *hier, EFolder *folder, int mode)
+scan_subtree (ExchangeHierarchy *hier, EFolder *folder, gint mode)
 {
 	ExchangeAccountFolderResult folder_result;
 
@@ -394,7 +394,7 @@ scan_subtree (ExchangeHierarchy *hier, EFolder *folder, int mode)
 static void
 add_href (ExchangeHierarchy *hier, EFolder *folder, gpointer hrefs)
 {
-	char *uri = g_strdup (e_folder_exchange_get_internal_uri (folder));
+	gchar *uri = g_strdup (e_folder_exchange_get_internal_uri (folder));
 
 	g_ptr_array_add (hrefs, (gpointer) uri);
 }
@@ -421,13 +421,13 @@ get_hrefs (ExchangeHierarchySomeDAV *hsd)
  **/
 ExchangeAccountFolderResult
 exchange_hierarchy_foreign_add_folder (ExchangeHierarchy *hier,
-				       const char *folder_name,
+				       const gchar *folder_name,
 				       EFolder **folder)
 {
 	ExchangeAccountFolderResult result;
-	const char *folder_type = NULL;
-	const char *physical_uri = NULL;
-	char *new_folder_name;
+	const gchar *folder_type = NULL;
+	const gchar *physical_uri = NULL;
+	gchar *new_folder_name;
 	guint folder_mask = 0;
 
 	result =  create_internal (hier, hier->toplevel, folder_name, NULL, folder);
@@ -470,12 +470,12 @@ exchange_hierarchy_foreign_add_folder (ExchangeHierarchy *hier,
 
 static ExchangeHierarchy *
 hierarchy_foreign_new (ExchangeAccount *account,
-		       const char *hierarchy_name,
-		       const char *physical_uri_prefix,
-		       const char *internal_uri_prefix,
-		       const char *owner_name,
-		       const char *owner_email,
-		       const char *source_uri)
+		       const gchar *hierarchy_name,
+		       const gchar *physical_uri_prefix,
+		       const gchar *internal_uri_prefix,
+		       const gchar *owner_name,
+		       const gchar *owner_email,
+		       const gchar *source_uri)
 {
 	ExchangeHierarchyForeign *hfor;
 
@@ -513,15 +513,15 @@ hierarchy_foreign_new (ExchangeAccount *account,
  **/
 ExchangeHierarchy *
 exchange_hierarchy_foreign_new (ExchangeAccount *account,
-				const char *hierarchy_name,
-				const char *physical_uri_prefix,
-				const char *internal_uri_prefix,
-				const char *owner_name,
-				const char *owner_email,
-				const char *source_uri)
+				const gchar *hierarchy_name,
+				const gchar *physical_uri_prefix,
+				const gchar *internal_uri_prefix,
+				const gchar *owner_name,
+				const gchar *owner_email,
+				const gchar *source_uri)
 {
 	ExchangeHierarchy *hier;
-	char *mf_path;
+	gchar *mf_path;
 	GHashTable *props;
 	xmlDoc *doc;
 
@@ -534,14 +534,14 @@ exchange_hierarchy_foreign_new (ExchangeAccount *account,
 				      source_uri);
 
 	props = g_hash_table_new (g_str_hash, g_str_equal);
-	g_hash_table_insert (props, "name", (char *)hierarchy_name);
+	g_hash_table_insert (props, "name", (gchar *)hierarchy_name);
 	g_hash_table_insert (props, "physical_uri_prefix",
-			     (char *)physical_uri_prefix);
+			     (gchar *)physical_uri_prefix);
 	g_hash_table_insert (props, "internal_uri_prefix",
-			     (char *)internal_uri_prefix);
-	g_hash_table_insert (props, "owner_name", (char *)owner_name);
-	g_hash_table_insert (props, "owner_email", (char *)owner_email);
-	g_hash_table_insert (props, "source_uri", (char *)source_uri);
+			     (gchar *)internal_uri_prefix);
+	g_hash_table_insert (props, "owner_name", (gchar *)owner_name);
+	g_hash_table_insert (props, "owner_email", (gchar *)owner_email);
+	g_hash_table_insert (props, "source_uri", (gchar *)source_uri);
 
 	mf_path = e_folder_exchange_get_storage_file (hier->toplevel, "hierarchy.xml");
 	doc = e_xml_from_hash (props, E_XML_HASH_TYPE_PROPERTY,
@@ -565,10 +565,10 @@ exchange_hierarchy_foreign_new (ExchangeAccount *account,
  **/
 ExchangeHierarchy *
 exchange_hierarchy_foreign_new_from_dir (ExchangeAccount *account,
-					 const char *folder_path)
+					 const gchar *folder_path)
 {
 	ExchangeHierarchy *hier;
-	char *mf_path;
+	gchar *mf_path;
 	GHashTable *props;
 	xmlDoc *doc;
 
diff --git a/servers/exchange/storage/exchange-hierarchy-foreign.h b/servers/exchange/storage/exchange-hierarchy-foreign.h
index 3c75e08..bb950ab 100644
--- a/servers/exchange/storage/exchange-hierarchy-foreign.h
+++ b/servers/exchange/storage/exchange-hierarchy-foreign.h
@@ -36,17 +36,17 @@ typedef struct _ExchangeHierarchyForeign ExchangeHierarchyForeign;
 GType              exchange_hierarchy_foreign_get_type (void);
 
 ExchangeHierarchy *exchange_hierarchy_foreign_new          (ExchangeAccount *account,
-							    const char *hierarchy_name,
-							    const char *physical_uri_prefix,
-							    const char *internal_uri_prefix,
-							    const char *owner_name,
-							    const char *owner_email,
-							    const char *source_uri);
+							    const gchar *hierarchy_name,
+							    const gchar *physical_uri_prefix,
+							    const gchar *internal_uri_prefix,
+							    const gchar *owner_name,
+							    const gchar *owner_email,
+							    const gchar *source_uri);
 ExchangeHierarchy *exchange_hierarchy_foreign_new_from_dir (ExchangeAccount *account,
-							    const char *folder_path);
+							    const gchar *folder_path);
 
 ExchangeAccountFolderResult  exchange_hierarchy_foreign_add_folder (ExchangeHierarchy *hier,
-								    const char *folder_name,
+								    const gchar *folder_name,
 								    EFolder **folder);
 
 #ifdef __cplusplus
diff --git a/servers/exchange/storage/exchange-hierarchy-gal.c b/servers/exchange/storage/exchange-hierarchy-gal.c
index f1d3819..308fe89 100644
--- a/servers/exchange/storage/exchange-hierarchy-gal.c
+++ b/servers/exchange/storage/exchange-hierarchy-gal.c
@@ -40,8 +40,8 @@ E2K_MAKE_TYPE (exchange_hierarchy_gal, ExchangeHierarchyGAL, NULL, NULL, PARENT_
 
 ExchangeHierarchy *
 exchange_hierarchy_gal_new (ExchangeAccount *account,
-			    const char *hierarchy_name,
-			    const char *physical_uri_prefix)
+			    const gchar *hierarchy_name,
+			    const gchar *physical_uri_prefix)
 {
 	ExchangeHierarchy *hier;
 	EFolder *toplevel;
diff --git a/servers/exchange/storage/exchange-hierarchy-gal.h b/servers/exchange/storage/exchange-hierarchy-gal.h
index 1cc9717..7d00496 100644
--- a/servers/exchange/storage/exchange-hierarchy-gal.h
+++ b/servers/exchange/storage/exchange-hierarchy-gal.h
@@ -30,8 +30,8 @@ struct _ExchangeHierarchyGALClass {
 GType                 exchange_hierarchy_gal_get_type (void);
 
 ExchangeHierarchy    *exchange_hierarchy_gal_new      (ExchangeAccount *account,
-						       const char *hierarchy_name,
-						       const char *physical_uri_prefix);
+						       const gchar *hierarchy_name,
+						       const gchar *physical_uri_prefix);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/storage/exchange-hierarchy-somedav.c b/servers/exchange/storage/exchange-hierarchy-somedav.c
index bbd0c55..4f39bf5 100644
--- a/servers/exchange/storage/exchange-hierarchy-somedav.c
+++ b/servers/exchange/storage/exchange-hierarchy-somedav.c
@@ -54,7 +54,7 @@ static ExchangeHierarchyWebDAVClass *parent_class = NULL;
 
 static ExchangeAccountFolderResult scan_subtree (ExchangeHierarchy *hier,
 						 EFolder *folder,
-						 int mode);
+						 gint mode);
 static void finalize (GObject *object);
 
 static void
@@ -106,28 +106,28 @@ E2K_MAKE_TYPE (exchange_hierarchy_somedav, ExchangeHierarchySomeDAV, class_init,
 static inline gboolean
 folder_is_unreadable (E2kProperties *props)
 {
-	char *access;
+	gchar *access;
 
 	access = e2k_properties_get_prop (props, PR_ACCESS);
 	return !access || !atoi (access);
 }
 
-static const char *folder_props[] = {
+static const gchar *folder_props[] = {
 	E2K_PR_EXCHANGE_FOLDER_CLASS,
 	E2K_PR_HTTPMAIL_UNREAD_COUNT,
 	E2K_PR_DAV_DISPLAY_NAME,
 	PR_ACCESS
 };
-static const int n_folder_props = sizeof (folder_props) / sizeof (folder_props[0]);
+static const gint n_folder_props = sizeof (folder_props) / sizeof (folder_props[0]);
 
 static ExchangeAccountFolderResult
-scan_subtree (ExchangeHierarchy *hier, EFolder *folder, int mode)
+scan_subtree (ExchangeHierarchy *hier, EFolder *folder, gint mode)
 {
 	ExchangeHierarchySomeDAV *hsd = EXCHANGE_HIERARCHY_SOMEDAV (hier);
 	GPtrArray *hrefs;
 	E2kResultIter *iter;
 	E2kResult *result;
-	int folders_returned=0, folders_added=0, i;
+	gint folders_returned=0, folders_added=0, i;
 	E2kHTTPStatus status;
 	ExchangeAccountFolderResult folder_result;
 	EFolder *iter_folder = NULL;
@@ -152,7 +152,7 @@ scan_subtree (ExchangeHierarchy *hier, EFolder *folder, int mode)
 	}
 
 	iter = e_folder_exchange_bpropfind_start (hier->toplevel, NULL,
-						  (const char **)hrefs->pdata,
+						  (const gchar **)hrefs->pdata,
 						  hrefs->len,
 						  folder_props,
 						  n_folder_props);
@@ -205,7 +205,7 @@ exchange_hierarchy_somedav_get_hrefs (ExchangeHierarchySomeDAV *hsd)
 
 void
 exchange_hierarchy_somedav_href_unreadable (ExchangeHierarchySomeDAV *hsd,
-					    const char *href)
+					    const gchar *href)
 {
 	g_return_if_fail (EXCHANGE_IS_HIERARCHY_SOMEDAV (hsd));
 	g_return_if_fail (href != NULL);
@@ -215,14 +215,14 @@ exchange_hierarchy_somedav_href_unreadable (ExchangeHierarchySomeDAV *hsd,
 
 ExchangeAccountFolderResult
 exchange_hierarchy_somedav_add_folder (ExchangeHierarchySomeDAV *hsd,
-				       const char *uri)
+				       const gchar *uri)
 {
 	ExchangeHierarchyWebDAV *hwd;
 	ExchangeHierarchy *hier;
 	E2kContext *ctx;
 	E2kHTTPStatus status;
 	E2kResult *results;
-	int nresults = 0;
+	gint nresults = 0;
 	EFolder *folder;
 
 	g_return_val_if_fail (EXCHANGE_IS_HIERARCHY_SOMEDAV (hsd),
diff --git a/servers/exchange/storage/exchange-hierarchy-somedav.h b/servers/exchange/storage/exchange-hierarchy-somedav.h
index 1ac6626..4adc3d6 100644
--- a/servers/exchange/storage/exchange-hierarchy-somedav.h
+++ b/servers/exchange/storage/exchange-hierarchy-somedav.h
@@ -28,7 +28,7 @@ struct _ExchangeHierarchySomeDAVClass {
 	ExchangeHierarchyWebDAVClass parent_class;
 
 	/* signals */
-	void (*href_unreadable) (ExchangeHierarchySomeDAV *hsd, const char *href);
+	void (*href_unreadable) (ExchangeHierarchySomeDAV *hsd, const gchar *href);
 
 	/* methods */
 	GPtrArray *(*get_hrefs) (ExchangeHierarchySomeDAV *hsd);
@@ -39,11 +39,11 @@ GType exchange_hierarchy_somedav_get_type (void);
 
 GPtrArray *exchange_hierarchy_somedav_get_hrefs (ExchangeHierarchySomeDAV *hsd);
 ExchangeAccountFolderResult exchange_hierarchy_somedav_add_folder (ExchangeHierarchySomeDAV *hsd,
-								   const char *uri);
+								   const gchar *uri);
 
 /* signal emitter */
 void exchange_hierarchy_somedav_href_unreadable (ExchangeHierarchySomeDAV *hsd,
-						 const char *href);
+						 const gchar *href);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/storage/exchange-hierarchy-webdav.c b/servers/exchange/storage/exchange-hierarchy-webdav.c
index c283c4d..3e5ee13 100644
--- a/servers/exchange/storage/exchange-hierarchy-webdav.c
+++ b/servers/exchange/storage/exchange-hierarchy-webdav.c
@@ -55,7 +55,7 @@
 struct _ExchangeHierarchyWebDAVPrivate {
 	GHashTable *folders_by_internal_path;
 	gboolean deep_searchable;
-	char *trash_path;
+	gchar *trash_path;
 	gdouble total_folder_size;
 };
 
@@ -70,17 +70,17 @@ static gboolean is_empty (ExchangeHierarchy *hier);
 static void rescan (ExchangeHierarchy *hier);
 static ExchangeAccountFolderResult scan_subtree  (ExchangeHierarchy *hier,
 						  EFolder *folder,
-						  int mode);
+						  gint mode);
 static ExchangeAccountFolderResult create_folder (ExchangeHierarchy *hier,
 						  EFolder *parent,
-						  const char *name,
-						  const char *type);
+						  const gchar *name,
+						  const gchar *type);
 static ExchangeAccountFolderResult remove_folder (ExchangeHierarchy *hier,
 						  EFolder *folder);
 static ExchangeAccountFolderResult xfer_folder   (ExchangeHierarchy *hier,
 						  EFolder *source,
 						  EFolder *dest_parent,
-						  const char *dest_name,
+						  const gchar *dest_name,
 						  gboolean remove_source);
 
 static void hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
@@ -147,7 +147,7 @@ E2K_MAKE_TYPE (exchange_hierarchy_webdav, ExchangeHierarchyWebDAV, class_init, i
 
 
 typedef struct {
-	char *contentclass, *component;
+	gchar *contentclass, *component;
 	gboolean offline_supported;
 } ExchangeFolderType;
 
@@ -163,7 +163,7 @@ static GHashTable *folder_type_map;
 static void
 folder_type_map_init (void)
 {
-	int i;
+	gint i;
 
 	folder_type_map = g_hash_table_new (g_str_hash, g_str_equal);
 	for (i = 0; folder_types[i].contentclass; i++) {
@@ -181,8 +181,8 @@ static void
 hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
 		      gpointer user_data)
 {
-	const char *internal_uri ;
-	char *mf_path;
+	const gchar *internal_uri ;
+	gchar *mf_path;
 
 	g_return_if_fail (E_IS_FOLDER (folder));
 	internal_uri = e_folder_exchange_get_internal_uri (folder);
@@ -191,11 +191,11 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
 	server has identical folder names [ internal_uri ] for folders. Very much
 	possible in the case of favorite folders */
 	if (g_hash_table_lookup (EXCHANGE_HIERARCHY_WEBDAV (hier)->priv->folders_by_internal_path,
-				(char *)e2k_uri_path (internal_uri)))
+				(gchar *)e2k_uri_path (internal_uri)))
 		return;
 
 	g_hash_table_insert (EXCHANGE_HIERARCHY_WEBDAV (hier)->priv->folders_by_internal_path,
-			     (char *)e2k_uri_path (internal_uri), g_object_ref (folder));
+			     (gchar *)e2k_uri_path (internal_uri), g_object_ref (folder));
 
 	mf_path = e_folder_exchange_get_storage_file (folder, "connector-metadata.xml");
 	e_folder_exchange_save_to_file (folder, mf_path);
@@ -206,11 +206,11 @@ static void
 hierarchy_removed_folder (ExchangeHierarchy *hier, EFolder *folder,
 			  gpointer user_data)
 {
-	const char *internal_uri = e_folder_exchange_get_internal_uri (folder);
-	char *mf_path;
+	const gchar *internal_uri = e_folder_exchange_get_internal_uri (folder);
+	gchar *mf_path;
 
 	g_hash_table_remove (EXCHANGE_HIERARCHY_WEBDAV (hier)->priv->folders_by_internal_path,
-			     (char *)e2k_uri_path (internal_uri));
+			     (gchar *)e2k_uri_path (internal_uri));
 
 	mf_path = e_folder_exchange_get_storage_file (folder, "connector-metadata.xml");
 	g_unlink (mf_path);
@@ -230,13 +230,13 @@ is_empty (ExchangeHierarchy *hier)
 }
 
 static EFolder *
-e_folder_webdav_new (ExchangeHierarchy *hier, const char *internal_uri,
-		     EFolder *parent, const char *name, const char *type,
-		     const char *outlook_class, int unread,
+e_folder_webdav_new (ExchangeHierarchy *hier, const gchar *internal_uri,
+		     EFolder *parent, const gchar *name, const gchar *type,
+		     const gchar *outlook_class, gint unread,
 		     gboolean offline_supported)
 {
 	EFolder *folder;
-	char *real_type, *http_uri, *physical_uri, *fixed_name = NULL;
+	gchar *real_type, *http_uri, *physical_uri, *fixed_name = NULL;
 
 	d( g_print ("exchange-hierarchy-webdave.c:e_folder_webdave_new: internal_uri=[%s], name=[%s], type=[%s], class=[%s]\n",
 		    internal_uri, name, type, outlook_class));
@@ -259,10 +259,10 @@ e_folder_webdav_new (ExchangeHierarchy *hier, const char *internal_uri,
 						real_type, outlook_class,
 						physical_uri, internal_uri);
 	} else {
-		char *temp_name;
-		char *encoded_name = NULL;
-		const char *new_internal_uri;
-		int len;
+		gchar *temp_name;
+		gchar *encoded_name = NULL;
+		const gchar *new_internal_uri;
+		gint len;
 
 		len = strlen (name);
 
@@ -303,13 +303,13 @@ e_folder_webdav_new (ExchangeHierarchy *hier, const char *internal_uri,
 
 static ExchangeAccountFolderResult
 create_folder (ExchangeHierarchy *hier, EFolder *parent,
-	       const char *name, const char *type)
+	       const gchar *name, const gchar *type)
 {
 	EFolder *dest;
 	E2kProperties *props;
 	E2kHTTPStatus status;
-	char *permanent_url = NULL;
-	int i, mode;
+	gchar *permanent_url = NULL;
+	gint i, mode;
 
 	exchange_account_is_offline (hier->account, &mode);
         if (mode != ONLINE_MODE)
@@ -360,7 +360,7 @@ static ExchangeAccountFolderResult
 remove_folder (ExchangeHierarchy *hier, EFolder *folder)
 {
 	E2kHTTPStatus status;
-	int mode;
+	gint mode;
 
         exchange_account_is_offline (hier->account, &mode);
 
@@ -384,15 +384,15 @@ remove_folder (ExchangeHierarchy *hier, EFolder *folder)
 
 static ExchangeAccountFolderResult
 xfer_folder (ExchangeHierarchy *hier, EFolder *source,
-	     EFolder *dest_parent, const char *dest_name,
+	     EFolder *dest_parent, const gchar *dest_name,
 	     gboolean remove_source)
 {
 	E2kHTTPStatus status;
 	EFolder *dest;
-	char *permanent_url = NULL, *physical_uri, *source_parent;
-	const char *folder_type = NULL, *source_folder_name;
+	gchar *permanent_url = NULL, *physical_uri, *source_parent;
+	const gchar *folder_type = NULL, *source_folder_name;
 	ExchangeAccountFolderResult ret_code;
-	int mode;
+	gint mode;
 
 	exchange_account_is_offline (hier->account, &mode);
         if (mode != ONLINE_MODE)
@@ -481,7 +481,7 @@ xfer_folder (ExchangeHierarchy *hier, EFolder *source,
 static void
 add_href (gpointer path, gpointer folder, gpointer hrefs)
 {
-	const char *folder_type;
+	const gchar *folder_type;
 
 	folder_type = e_folder_get_type_string (folder);
 
@@ -495,23 +495,23 @@ add_href (gpointer path, gpointer folder, gpointer hrefs)
 }
 
 /* E2K_PR_EXCHANGE_FOLDER_SIZE also can be used for reading folder size */
-static const char *rescan_props[] = {
+static const gchar *rescan_props[] = {
 	E2K_PR_EXCHANGE_FOLDER_SIZE,
 	E2K_PR_HTTPMAIL_UNREAD_COUNT
 };
-static const int n_rescan_props = sizeof (rescan_props) / sizeof (rescan_props[0]);
+static const gint n_rescan_props = sizeof (rescan_props) / sizeof (rescan_props[0]);
 
 static void
 rescan (ExchangeHierarchy *hier)
 {
 	ExchangeHierarchyWebDAV *hwd = EXCHANGE_HIERARCHY_WEBDAV (hier);
-	const char *prop = E2K_PR_HTTPMAIL_UNREAD_COUNT;
-	const char *folder_size, *folder_name;
+	const gchar *prop = E2K_PR_HTTPMAIL_UNREAD_COUNT;
+	const gchar *folder_size, *folder_name;
 	GPtrArray *hrefs;
 	E2kResultIter *iter;
 	E2kResult *result;
 	EFolder *folder;
-	int unread, mode;
+	gint unread, mode;
 	gboolean personal = ( hier->type == EXCHANGE_HIERARCHY_PERSONAL );
 	gdouble fsize_d;
 
@@ -530,7 +530,7 @@ rescan (ExchangeHierarchy *hier)
 
 	g_object_ref (hier);
 	iter = e_folder_exchange_bpropfind_start (hier->toplevel, NULL,
-						  (const char **)hrefs->pdata,
+						  (const gchar **)hrefs->pdata,
 						  hrefs->len,
 						  rescan_props, n_rescan_props);
 	g_ptr_array_free (hrefs, TRUE);
@@ -595,8 +595,8 @@ exchange_hierarchy_webdav_parse_folder (ExchangeHierarchyWebDAV *hwd,
 {
 	EFolder *folder;
 	ExchangeFolderType *folder_type;
-	const char *name, *prop, *outlook_class, *permanenturl;
-	int unread;
+	const gchar *name, *prop, *outlook_class, *permanenturl;
+	gint unread;
 	gboolean hassubs;
 
 	g_return_val_if_fail (EXCHANGE_IS_HIERARCHY_WEBDAV (hwd), NULL);
@@ -674,7 +674,7 @@ add_folders (ExchangeHierarchy *hier, EFolder *folder, gpointer folders)
 	g_ptr_array_add (folders, folder);
 }
 
-static const char *folder_props[] = {
+static const gchar *folder_props[] = {
 	E2K_PR_EXCHANGE_FOLDER_CLASS,
 	E2K_PR_HTTPMAIL_UNREAD_COUNT,
 	E2K_PR_DAV_DISPLAY_NAME,
@@ -682,18 +682,18 @@ static const char *folder_props[] = {
 	E2K_PR_EXCHANGE_FOLDER_SIZE,
 	E2K_PR_DAV_HAS_SUBS
 };
-static const int n_folder_props = sizeof (folder_props) / sizeof (folder_props[0]);
+static const gint n_folder_props = sizeof (folder_props) / sizeof (folder_props[0]);
 
-static const char *pub_folder_props[] = {
+static const gchar *pub_folder_props[] = {
 	E2K_PR_EXCHANGE_FOLDER_CLASS,
 	E2K_PR_DAV_DISPLAY_NAME,
 	E2K_PR_EXCHANGE_PERMANENTURL,
 	E2K_PR_DAV_HAS_SUBS
 };
-static const int n_pub_folder_props = sizeof (pub_folder_props) / sizeof (pub_folder_props[0]);
+static const gint n_pub_folder_props = sizeof (pub_folder_props) / sizeof (pub_folder_props[0]);
 
 static ExchangeAccountFolderResult
-scan_subtree (ExchangeHierarchy *hier, EFolder *parent, int mode)
+scan_subtree (ExchangeHierarchy *hier, EFolder *parent, gint mode)
 {
 	static E2kRestriction *folders_rn;
 	ExchangeHierarchyWebDAV *hwd = EXCHANGE_HIERARCHY_WEBDAV (hier);
@@ -703,9 +703,9 @@ scan_subtree (ExchangeHierarchy *hier, EFolder *parent, int mode)
 	E2kHTTPStatus status;
 	EFolder *folder, *tmp;
 	GPtrArray *folders;
-	int i;
+	gint i;
 	gdouble fsize_d;
-	const char *name, *folder_size, *deleted_items_uri, *int_uri;
+	const gchar *name, *folder_size, *deleted_items_uri, *int_uri;
 	gboolean personal = ( EXCHANGE_HIERARCHY (hwd)->type == EXCHANGE_HIERARCHY_PERSONAL );
 
 	if (parent) {
@@ -812,11 +812,11 @@ struct scan_offline_data {
 };
 
 static gboolean
-scan_offline_cb (const char *physical_path, const char *path, gpointer data)
+scan_offline_cb (const gchar *physical_path, const gchar *path, gpointer data)
 {
 	struct scan_offline_data *sod = data;
 	EFolder *folder;
-	char *mf_name;
+	gchar *mf_name;
 
 
 	mf_name = g_build_filename (physical_path, "connector-metadata.xml", NULL);
@@ -852,9 +852,9 @@ exchange_hierarchy_webdav_offline_scan_subtree (ExchangeHierarchy *hier,
 						gpointer user_data)
 {
 	struct scan_offline_data sod;
-	const char *path;
-	char *dir, *prefix;
-	int i;
+	const gchar *path;
+	gchar *dir, *prefix;
+	gint i;
 
 	g_return_if_fail (EXCHANGE_IS_HIERARCHY (hier));
 
@@ -884,12 +884,12 @@ void
 exchange_hierarchy_webdav_construct (ExchangeHierarchyWebDAV *hwd,
 				     ExchangeAccount *account,
 				     ExchangeHierarchyType type,
-				     const char *hierarchy_name,
-				     const char *physical_uri_prefix,
-				     const char *internal_uri_prefix,
-				     const char *owner_name,
-				     const char *owner_email,
-				     const char *source_uri,
+				     const gchar *hierarchy_name,
+				     const gchar *physical_uri_prefix,
+				     const gchar *internal_uri_prefix,
+				     const gchar *owner_name,
+				     const gchar *owner_email,
+				     const gchar *source_uri,
 				     gboolean deep_searchable)
 {
 	EFolder *toplevel;
@@ -912,7 +912,7 @@ exchange_hierarchy_webdav_construct (ExchangeHierarchyWebDAV *hwd,
 	g_object_unref (toplevel);
 
 	if (type == EXCHANGE_HIERARCHY_PERSONAL) {
-		const char *trash_uri;
+		const gchar *trash_uri;
 
 		trash_uri = exchange_account_get_standard_uri (account, "deleteditems");
 		if (trash_uri)
@@ -923,12 +923,12 @@ exchange_hierarchy_webdav_construct (ExchangeHierarchyWebDAV *hwd,
 ExchangeHierarchy *
 exchange_hierarchy_webdav_new (ExchangeAccount *account,
 			       ExchangeHierarchyType type,
-			       const char *hierarchy_name,
-			       const char *physical_uri_prefix,
-			       const char *internal_uri_prefix,
-			       const char *owner_name,
-			       const char *owner_email,
-			       const char *source_uri,
+			       const gchar *hierarchy_name,
+			       const gchar *physical_uri_prefix,
+			       const gchar *internal_uri_prefix,
+			       const gchar *owner_name,
+			       const gchar *owner_email,
+			       const gchar *source_uri,
 			       gboolean deep_searchable)
 {
 	ExchangeHierarchy *hier;
diff --git a/servers/exchange/storage/exchange-hierarchy-webdav.h b/servers/exchange/storage/exchange-hierarchy-webdav.h
index 0438d4c..ec670f1 100644
--- a/servers/exchange/storage/exchange-hierarchy-webdav.h
+++ b/servers/exchange/storage/exchange-hierarchy-webdav.h
@@ -33,12 +33,12 @@ GType              exchange_hierarchy_webdav_get_type (void);
 
 ExchangeHierarchy *exchange_hierarchy_webdav_new (ExchangeAccount *account,
 						  ExchangeHierarchyType type,
-						  const char *hierarchy_name,
-						  const char *physical_uri_prefix,
-						  const char *internal_uri_prefix,
-						  const char *owner_name,
-						  const char *owner_email,
-						  const char *source_uri,
+						  const gchar *hierarchy_name,
+						  const gchar *physical_uri_prefix,
+						  const gchar *internal_uri_prefix,
+						  const gchar *owner_name,
+						  const gchar *owner_email,
+						  const gchar *source_uri,
 						  gboolean deep_searchable);
 
 /* for subclasses */
@@ -50,12 +50,12 @@ EFolder *exchange_hierarchy_webdav_parse_folder (ExchangeHierarchyWebDAV *hwd,
 void exchange_hierarchy_webdav_construct   (ExchangeHierarchyWebDAV *hwd,
 					    ExchangeAccount *account,
 					    ExchangeHierarchyType type,
-					    const char *hierarchy_name,
-					    const char *physical_uri_prefix,
-					    const char *internal_uri_prefix,
-					    const char *owner_name,
-					    const char *owner_email,
-					    const char *source_uri,
+					    const gchar *hierarchy_name,
+					    const gchar *physical_uri_prefix,
+					    const gchar *internal_uri_prefix,
+					    const gchar *owner_name,
+					    const gchar *owner_email,
+					    const gchar *source_uri,
 					    gboolean deep_searchable);
 
 typedef void (*ExchangeHierarchyWebDAVScanCallback)    (ExchangeHierarchy *hier,
diff --git a/servers/exchange/storage/exchange-hierarchy.c b/servers/exchange/storage/exchange-hierarchy.c
index 9a854b1..6423f9e 100644
--- a/servers/exchange/storage/exchange-hierarchy.c
+++ b/servers/exchange/storage/exchange-hierarchy.c
@@ -49,18 +49,18 @@ static gboolean is_empty        (ExchangeHierarchy *hier);
 static void add_to_storage      (ExchangeHierarchy *hier);
 static ExchangeAccountFolderResult scan_subtree  (ExchangeHierarchy *hier,
 						  EFolder *folder,
-						  int mode);
+						  gint mode);
 static void                        rescan        (ExchangeHierarchy *hier);
 static ExchangeAccountFolderResult create_folder (ExchangeHierarchy *hier,
 						  EFolder *parent,
-						  const char *name,
-						  const char *type);
+						  const gchar *name,
+						  const gchar *type);
 static ExchangeAccountFolderResult remove_folder (ExchangeHierarchy *hier,
 						  EFolder *folder);
 static ExchangeAccountFolderResult xfer_folder   (ExchangeHierarchy *hier,
 						  EFolder *source,
 						  EFolder *dest_parent,
-						  const char *dest_name,
+						  const gchar *dest_name,
 						  gboolean remove_source);
 
 static void
@@ -183,7 +183,7 @@ exchange_hierarchy_is_empty (ExchangeHierarchy *hier)
 
 static ExchangeAccountFolderResult
 create_folder (ExchangeHierarchy *hier, EFolder *parent,
-	       const char *name, const char *type)
+	       const gchar *name, const gchar *type)
 {
 	return EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED;
 }
@@ -196,7 +196,7 @@ remove_folder (ExchangeHierarchy *hier, EFolder *folder)
 
 static ExchangeAccountFolderResult
 xfer_folder (ExchangeHierarchy *hier, EFolder *source,
-	     EFolder *dest_parent, const char *dest_name,
+	     EFolder *dest_parent, const gchar *dest_name,
 	     gboolean remove_source)
 {
 	return EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED;
@@ -215,7 +215,7 @@ xfer_folder (ExchangeHierarchy *hier, EFolder *source,
  **/
 ExchangeAccountFolderResult
 exchange_hierarchy_create_folder (ExchangeHierarchy *hier, EFolder *parent,
-				  const char *name, const char *type)
+				  const gchar *name, const gchar *type)
 {
 	g_return_val_if_fail (EXCHANGE_IS_HIERARCHY (hier), EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 	g_return_val_if_fail (E_IS_FOLDER (parent), EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
@@ -257,7 +257,7 @@ exchange_hierarchy_remove_folder (ExchangeHierarchy *hier, EFolder *folder)
  **/
 ExchangeAccountFolderResult
 exchange_hierarchy_xfer_folder (ExchangeHierarchy *hier, EFolder *source,
-				EFolder *dest_parent, const char *dest_name,
+				EFolder *dest_parent, const gchar *dest_name,
 				gboolean remove_source)
 {
 	g_return_val_if_fail (EXCHANGE_IS_HIERARCHY (hier), EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
@@ -293,7 +293,7 @@ exchange_hierarchy_rescan (ExchangeHierarchy *hier)
 
 
 static ExchangeAccountFolderResult
-scan_subtree (ExchangeHierarchy *hier, EFolder *folder, int mode)
+scan_subtree (ExchangeHierarchy *hier, EFolder *folder, gint mode)
 {
 	return EXCHANGE_ACCOUNT_FOLDER_OK;
 }
@@ -310,7 +310,7 @@ scan_subtree (ExchangeHierarchy *hier, EFolder *folder, int mode)
  * Return value: the result code
  **/
 ExchangeAccountFolderResult
-exchange_hierarchy_scan_subtree (ExchangeHierarchy *hier, EFolder *folder, int mode)
+exchange_hierarchy_scan_subtree (ExchangeHierarchy *hier, EFolder *folder, gint mode)
 {
 	g_return_val_if_fail (EXCHANGE_IS_HIERARCHY (hier), EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 	g_return_val_if_fail (E_IS_FOLDER (folder), EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
@@ -360,9 +360,9 @@ exchange_hierarchy_construct (ExchangeHierarchy *hier,
 			      ExchangeAccount *account,
 			      ExchangeHierarchyType type,
 			      EFolder *toplevel,
-			      const char *owner_name,
-			      const char *owner_email,
-			      const char *source_uri)
+			      const gchar *owner_name,
+			      const gchar *owner_email,
+			      const gchar *source_uri)
 {
 	g_return_if_fail (EXCHANGE_IS_HIERARCHY (hier));
 	g_return_if_fail (EXCHANGE_IS_ACCOUNT (account));
diff --git a/servers/exchange/storage/exchange-hierarchy.h b/servers/exchange/storage/exchange-hierarchy.h
index 2fb134f..6c9b3d7 100644
--- a/servers/exchange/storage/exchange-hierarchy.h
+++ b/servers/exchange/storage/exchange-hierarchy.h
@@ -26,9 +26,9 @@ struct _ExchangeHierarchy {
 	ExchangeHierarchyType type;
 	EFolder *toplevel;
 
-	char *owner_name;
-	char *owner_email;
-	char *source_uri;
+	gchar *owner_name;
+	gchar *owner_email;
+	gchar *source_uri;
 
 	gboolean hide_private_items;
 };
@@ -43,18 +43,18 @@ struct _ExchangeHierarchyClass {
 	void (*rescan) (ExchangeHierarchy *hier);
 	ExchangeAccountFolderResult (*scan_subtree)  (ExchangeHierarchy *hier,
 						      EFolder *folder,
-						      int mode);
+						      gint mode);
 
 	ExchangeAccountFolderResult (*create_folder) (ExchangeHierarchy *hier,
 						      EFolder *parent,
-						      const char *name,
-						      const char *type);
+						      const gchar *name,
+						      const gchar *type);
 	ExchangeAccountFolderResult (*remove_folder) (ExchangeHierarchy *hier,
 						      EFolder *folder);
 	ExchangeAccountFolderResult (*xfer_folder)   (ExchangeHierarchy *hier,
 						      EFolder *source,
 						      EFolder *dest_parent,
-						      const char *dest_name,
+						      const gchar *dest_name,
 						      gboolean remove_source);
 
 	/* signals */
@@ -70,9 +70,9 @@ void     exchange_hierarchy_construct           (ExchangeHierarchy *hier,
 						 ExchangeAccount   *account,
 						 ExchangeHierarchyType type,
 						 EFolder           *toplevel,
-						 const char        *owner_name,
-						 const char        *owner_email,
-						 const char        *source_uri);
+						 const gchar        *owner_name,
+						 const gchar        *owner_email,
+						 const gchar        *source_uri);
 
 void     exchange_hierarchy_new_folder          (ExchangeHierarchy *hier,
 						 EFolder           *folder);
@@ -89,14 +89,14 @@ ExchangeAccountFolderResult exchange_hierarchy_scan_subtree   (ExchangeHierarchy
 
 ExchangeAccountFolderResult exchange_hierarchy_create_folder (ExchangeHierarchy *hier,
 							      EFolder           *parent,
-							      const char        *name,
-							      const char        *type);
+							      const gchar        *name,
+							      const gchar        *type);
 ExchangeAccountFolderResult exchange_hierarchy_remove_folder (ExchangeHierarchy *hier,
 							      EFolder           *folder);
 ExchangeAccountFolderResult exchange_hierarchy_xfer_folder   (ExchangeHierarchy *hier,
 							      EFolder           *source,
 							      EFolder           *dest_parent,
-							      const char        *dest_name,
+							      const gchar        *dest_name,
 							      gboolean           remove_source);
 
 #ifdef __cplusplus
diff --git a/servers/exchange/storage/exchange-oof.c b/servers/exchange/storage/exchange-oof.c
index a9bbae0..9398169 100644
--- a/servers/exchange/storage/exchange-oof.c
+++ b/servers/exchange/storage/exchange-oof.c
@@ -32,12 +32,12 @@
 #include <string.h>
 
 /* Taken from gal/util/e-util.c */
-static char *
-find_str_case (const char *haystack, const char *needle, const char *end)
+static gchar *
+find_str_case (const gchar *haystack, const gchar *needle, const gchar *end)
 {
 	/* find the needle in the haystack neglecting case */
-	const char *ptr;
-	int len;
+	const gchar *ptr;
+	gint len;
 
 	g_return_val_if_fail (haystack != NULL, NULL);
 	g_return_val_if_fail (needle != NULL, NULL);
@@ -47,11 +47,11 @@ find_str_case (const char *haystack, const char *needle, const char *end)
 		return NULL;
 
 	if (len == 0)
-		return (char *) haystack;
+		return (gchar *) haystack;
 
 	for (ptr = haystack; ptr + len < end; ptr++)
 		if (!g_ascii_strncasecmp (ptr, needle, len))
-			return (char *) ptr;
+			return (gchar *) ptr;
 
 	return NULL;
 
@@ -70,13 +70,13 @@ find_str_case (const char *haystack, const char *needle, const char *end)
  * occurred.
  **/
 gboolean
-exchange_oof_get (ExchangeAccount *account, gboolean *oof, char **message)
+exchange_oof_get (ExchangeAccount *account, gboolean *oof, gchar **message)
 {
 	E2kContext *ctx;
 	E2kHTTPStatus status;
-	char *url, *p = NULL, *checked, *ta_start, *ta_end;
+	gchar *url, *p = NULL, *checked, *ta_start, *ta_end;
 	SoupBuffer *response = NULL;
-	const char *body, *end;
+	const gchar *body, *end;
 
 	ctx = exchange_account_get_context (account);
 	if (!ctx)
@@ -84,9 +84,9 @@ exchange_oof_get (ExchangeAccount *account, gboolean *oof, char **message)
 
 	if (!message) {
 		/* Do this the easy way */
-		const char *prop = E2K_PR_EXCHANGE_OOF_STATE;
+		const gchar *prop = E2K_PR_EXCHANGE_OOF_STATE;
 		E2kResult *results;
-		int nresults = 0;
+		gint nresults = 0;
 
 		url = e2k_uri_concat (account->home_uri, "NON_IPM_SUBTREE/");
 		status = e2k_context_propfind (ctx, NULL, url, &prop, 1,
@@ -166,7 +166,7 @@ exchange_oof_get (ExchangeAccount *account, gboolean *oof, char **message)
  * error occurred.
  **/
 gboolean
-exchange_oof_set (ExchangeAccount *account, gboolean oof, const char *message)
+exchange_oof_set (ExchangeAccount *account, gboolean oof, const gchar *message)
 {
 	E2kContext *ctx;
 	E2kHTTPStatus status;
@@ -176,7 +176,7 @@ exchange_oof_set (ExchangeAccount *account, gboolean oof, const char *message)
 		return FALSE;
 
 	if (message) {
-		char *body, *message_enc;
+		gchar *body, *message_enc;
 
 		message_enc = e2k_uri_encode (message, FALSE, NULL);
 		body = g_strdup_printf ("Cmd=options&OofState=%d&"
@@ -189,7 +189,7 @@ exchange_oof_set (ExchangeAccount *account, gboolean oof, const char *message)
 		g_free (body);
 	} else {
 		E2kProperties *props;
-		char *url;
+		gchar *url;
 
 		props = e2k_properties_new ();
 		e2k_properties_set_bool (props, E2K_PR_EXCHANGE_OOF_STATE, oof);
diff --git a/servers/exchange/storage/exchange-oof.h b/servers/exchange/storage/exchange-oof.h
index 25c98e8..a05fed6 100644
--- a/servers/exchange/storage/exchange-oof.h
+++ b/servers/exchange/storage/exchange-oof.h
@@ -14,10 +14,10 @@ extern "C" {
 
 gboolean      exchange_oof_get              (ExchangeAccount  *account,
 					     gboolean         *oof,
-					     char            **mmsg);
+					     gchar            **mmsg);
 gboolean      exchange_oof_set              (ExchangeAccount  *account,
 					     gboolean          oof,
-					     const char       *msg);
+					     const gchar       *msg);
 
 #ifdef __cplusplus
 }
diff --git a/servers/exchange/xntlm/xntlm-des.c b/servers/exchange/xntlm/xntlm-des.c
index 8b215d3..4f6b49a 100644
--- a/servers/exchange/xntlm/xntlm-des.c
+++ b/servers/exchange/xntlm/xntlm-des.c
@@ -172,7 +172,7 @@ static guint32 Spbox[8][64] = {
 }
 /* Encrypt or decrypt a block of data in ECB mode */
 void
-xntlm_des(XNTLM_DES_KS ks, unsigned char block[8])
+xntlm_des(XNTLM_DES_KS ks, guchar block[8])
 {
 	guint32 left,right,work;
 
@@ -265,7 +265,7 @@ xntlm_des(XNTLM_DES_KS ks, 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,
@@ -278,12 +278,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,
@@ -298,7 +298,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
 };
 
@@ -307,13 +307,13 @@ static int bytebit[] = {
  * depending on the value of "decrypt"
  */
 void
-xntlm_deskey(XNTLM_DES_KS k, const unsigned char *key, int decrypt)
+xntlm_deskey(XNTLM_DES_KS k, const 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/servers/exchange/xntlm/xntlm-des.h b/servers/exchange/xntlm/xntlm-des.h
index ee0e6d0..ea39144 100644
--- a/servers/exchange/xntlm/xntlm-des.h
+++ b/servers/exchange/xntlm/xntlm-des.h
@@ -13,8 +13,8 @@ enum {
 	XNTLM_DES_DECRYPT = 1
 };
 
-void xntlm_deskey (XNTLM_DES_KS ks, const unsigned char *key, int decrypt);
+void xntlm_deskey (XNTLM_DES_KS ks, const guchar *key, gint decrypt);
 
-void xntlm_des (XNTLM_DES_KS ks, unsigned char block[8]);
+void xntlm_des (XNTLM_DES_KS ks, guchar block[8]);
 
 #endif /* _XNTLM_DES_H */
diff --git a/servers/exchange/xntlm/xntlm-md4.c b/servers/exchange/xntlm/xntlm-md4.c
index 8cb0cba..382f984 100644
--- a/servers/exchange/xntlm/xntlm-md4.c
+++ b/servers/exchange/xntlm/xntlm-md4.c
@@ -36,12 +36,12 @@
 #define ROT(val, n) ( ((val) << (n)) | ((val) >> (32 - (n))) )
 
 static void
-md4sum_round (const unsigned char *M,
+md4sum_round (const guchar *M,
 	      guint32 *AA, guint32 *BB,
 	      guint32 *CC, guint32 *DD)
 {
 	guint32 A, B, C, D, X[16];
-	int i;
+	gint i;
 
 	for (i = 0; i < 16; i++) {
 		X[i] =  (M[i*4]) | (M[i*4 + 1] << 8) |
@@ -119,12 +119,12 @@ md4sum_round (const unsigned char *M,
  * Computes the MD4 checksum of @in and puts it in @digest.
  **/
 void
-xntlm_md4sum (const unsigned char *in, int nbytes, unsigned char digest[16])
+xntlm_md4sum (const guchar *in, gint nbytes, guchar digest[16])
 {
-	unsigned char M[128];
+	guchar M[128];
 	guint32 A, B, C, D;
-	int pbytes, nbits = nbytes * 8, remaining_bytes;
-	int total_len, offset;
+	gint pbytes, nbits = nbytes * 8, remaining_bytes;
+	gint total_len, offset;
 
 	pbytes = (120 - (nbytes % 64)) % 64;
 	total_len = nbytes + pbytes + 8;
diff --git a/servers/exchange/xntlm/xntlm-md4.h b/servers/exchange/xntlm/xntlm-md4.h
index 70c91b0..7e4eccd 100644
--- a/servers/exchange/xntlm/xntlm-md4.h
+++ b/servers/exchange/xntlm/xntlm-md4.h
@@ -4,7 +4,7 @@
 #ifndef _XNTLM_MD4_H
 #define _XNTLM_MD4_H
 
-void xntlm_md4sum (const unsigned char *in, int nbytes,
-		   unsigned char digest[16]);
+void xntlm_md4sum (const guchar *in, gint nbytes,
+		   guchar digest[16]);
 
 #endif /* _XNTLM_MD4_H */
diff --git a/servers/exchange/xntlm/xntlm.c b/servers/exchange/xntlm/xntlm.c
index b2409c9..fe7c2f1 100644
--- a/servers/exchange/xntlm/xntlm.c
+++ b/servers/exchange/xntlm/xntlm.c
@@ -29,7 +29,7 @@
 #include <string.h>
 
 
-static unsigned char NTLM_NEGOTIATE_MESSAGE[] = {
+static guchar NTLM_NEGOTIATE_MESSAGE[] = {
 	 'N',  'T',  'L',  'M',  'S',  'S',  'P', 0x00,
 	0x01, 0x00, 0x00, 0x00, 0x06, 0x82, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -59,10 +59,10 @@ xntlm_negotiate (void)
 
 #define GET_SHORTY(p) ((p)[0] + ((p)[1] << 8))
 
-static char *
-strip_dup (unsigned char *mem, int len)
+static gchar *
+strip_dup (guchar *mem, gint len)
 {
-	char *buf = g_malloc (len / 2 + 1), *p = buf;
+	gchar *buf = g_malloc (len / 2 + 1), *p = buf;
 
 	while (len > 0) {
 		*p = (char)*mem;
@@ -104,11 +104,11 @@ strip_dup (unsigned char *mem, int len)
  * %FALSE otherwise.
  **/
 gboolean
-xntlm_parse_challenge (gpointer challenge, int len, char **nonce,
-		       char **nt_domain, char **w2k_domain)
+xntlm_parse_challenge (gpointer challenge, gint len, gchar **nonce,
+		       gchar **nt_domain, gchar **w2k_domain)
 {
-	unsigned char *chall = (unsigned char *)challenge;
-	int off, dlen, doff, type;
+	guchar *chall = (guchar *)challenge;
+	gint off, dlen, doff, type;
 
 	if (len < NTLM_CHALLENGE_BASE_SIZE)
 		return FALSE;
@@ -152,7 +152,7 @@ xntlm_parse_challenge (gpointer challenge, int len, char **nonce,
 
 
 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)
 {
 	ba->data[offset    ] = ba->data[offset + 2] =  len       & 0xFF;
 	ba->data[offset + 1] = ba->data[offset + 3] = (len >> 8) & 0xFF;
@@ -161,13 +161,13 @@ ntlm_set_string (GByteArray *ba, int offset, const char *data, int len)
 	g_byte_array_append (ba, data, len);
 }
 
-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]);
 static void ntlm_calc_response   (const guchar key[21],
 				  const guchar plaintext[8],
 				  guchar results[24]);
 
-static unsigned char NTLM_RESPONSE_MESSAGE_HEADER[] = {
+static guchar NTLM_RESPONSE_MESSAGE_HEADER[] = {
 	 'N',  'T',  'L',  'M',  'S',  'S',  'P', 0x00,
 	0x03, 0x00, 0x00, 0x00, 0x02, 0x82, 0x00, 0x00
 };
@@ -195,9 +195,9 @@ static unsigned char NTLM_RESPONSE_MESSAGE_HEADER[] = {
  * Return value: the NTLM Type 3 message
  **/
 GByteArray *
-xntlm_authenticate (const char *nonce, const char *domain,
-		    const char *user, const char *password,
-		    const char *workstation)
+xntlm_authenticate (const gchar *nonce, const gchar *domain,
+		    const gchar *user, const gchar *password,
+		    const gchar *workstation)
 {
 	GByteArray *message;
 	guchar hash[21], lm_resp[24], nt_resp[24];
@@ -236,7 +236,7 @@ static void
 setup_schedule (const guchar *key_56, XNTLM_DES_KS ks)
 {
 	guchar key[8];
-	int i, c, bit;
+	gint i, c, bit;
 
 	key[0] = (key_56[0])                                 ;
 	key[1] = (key_56[1] >> 1) | ((key_56[0] << 7) & 0xFF);
@@ -259,18 +259,18 @@ setup_schedule (const guchar *key_56, XNTLM_DES_KS ks)
         xntlm_deskey (ks, key, XNTLM_DES_ENCRYPT);
 }
 
-static unsigned char LM_PASSWORD_MAGIC[] = {
+static guchar LM_PASSWORD_MAGIC[] = {
 	0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25,
 	0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25,
 	0x00, 0x00, 0x00, 0x00, 0x00
 };
 
 static void
-ntlm_lanmanager_hash (const char *password, char hash[21])
+ntlm_lanmanager_hash (const gchar *password, gchar hash[21])
 {
 	guchar lm_password [15];
 	XNTLM_DES_KS ks;
-	unsigned int i;
+	guint i;
 
 	for (i = 0; i < 14 && password [i]; i++)
 		lm_password [i] = toupper ((unsigned char) password [i]);
@@ -288,9 +288,9 @@ ntlm_lanmanager_hash (const char *password, char hash[21])
 }
 
 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);
 
diff --git a/servers/exchange/xntlm/xntlm.h b/servers/exchange/xntlm/xntlm.h
index 3b2e278..ff052da 100644
--- a/servers/exchange/xntlm/xntlm.h
+++ b/servers/exchange/xntlm/xntlm.h
@@ -7,10 +7,10 @@
 #include <glib.h>
 
 GByteArray *xntlm_negotiate       (void);
-gboolean    xntlm_parse_challenge (gpointer challenge, int len, char **nonce,
-				   char **nt_domain, char **w2k_domain);
-GByteArray *xntlm_authenticate    (const char *nonce, const char *domain,
-				   const char *user, const char *password,
-				   const char *workstation);
+gboolean    xntlm_parse_challenge (gpointer challenge, gint len, gchar **nonce,
+				   gchar **nt_domain, gchar **w2k_domain);
+GByteArray *xntlm_authenticate    (const gchar *nonce, const gchar *domain,
+				   const gchar *user, const gchar *password,
+				   const gchar *workstation);
 
 #endif /* _XNTLM_H */
diff --git a/servers/google/libgdata-google/gdata-google-service.c b/servers/google/libgdata-google/gdata-google-service.c
index d4cb8f3..74913a6 100644
--- a/servers/google/libgdata-google/gdata-google-service.c
+++ b/servers/google/libgdata-google/gdata-google-service.c
@@ -99,7 +99,7 @@ send_and_handle_google_redirection (SoupSession *soup_session, SoupMessage *msg)
 
 	if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) {
 		SoupURI *new_uri;
-		const char *new_loc;
+		const gchar *new_loc;
 
 		new_loc = soup_message_headers_get (msg->response_headers, "Location");
 		g_return_if_fail (new_loc != NULL);
@@ -347,7 +347,7 @@ gdata_google_service_delete_entry (GDataService *service, GDataEntry *entry, GEr
 static GDataEntry*
 gdata_google_service_update_entry (GDataService *service, GDataEntry *entry, GError **error)
 {
-	const char *entry_edit_url;
+	const gchar *entry_edit_url;
 
 	g_return_val_if_fail (service !=NULL, FALSE);
 	g_return_val_if_fail (GDATA_IS_GOOGLE_SERVICE (service), FALSE);
diff --git a/servers/google/libgdata/gdata-entry.h b/servers/google/libgdata/gdata-entry.h
index df958ee..c15c9e2 100644
--- a/servers/google/libgdata/gdata-entry.h
+++ b/servers/google/libgdata/gdata-entry.h
@@ -138,9 +138,9 @@ struct _GDataEntryPhoneNumber {
 
 typedef struct _GDataEntryPostalAddress GDataEntryPostalAddress;
 struct _GDataEntryPostalAddress {
-	char *address;
-	char *label;
-	char *rel;
+	gchar *address;
+	gchar *label;
+	gchar *rel;
 	gboolean primary;
 };
 
diff --git a/servers/google/libgdata/gdata-feed.c b/servers/google/libgdata/gdata-feed.c
index 1534fce..7c9c9a4 100644
--- a/servers/google/libgdata/gdata-feed.c
+++ b/servers/google/libgdata/gdata-feed.c
@@ -525,7 +525,7 @@ gdata_feed_new(void)
 
 
 GDataFeed *
-gdata_feed_new_from_xml(const gchar* feedXML, const gint length)
+gdata_feed_new_from_xml(const gchar * feedXML, const gint length)
 {
 	GDataFeed *feed;
 	GDataFeedPrivate *priv;
@@ -574,12 +574,12 @@ gdata_feed_new_from_xml(const gchar* feedXML, const gint length)
 		}
 		else if (!xmlStrcmp(cur->name, (xmlChar *)"updated")) {
 			value = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-			priv->updated = g_strdup ((gchar*)value);
+			priv->updated = g_strdup ((gchar *)value);
 			xmlFree(value);
 		} else if (!xmlStrcmp(cur->name, (xmlChar *)"timezone")) {
 			value = xmlGetProp (cur, (xmlChar *)"value");
 			g_free (priv->timezone);
-			priv->timezone = g_strdup ((gchar*)value);
+			priv->timezone = g_strdup ((gchar *)value);
 			xmlFree (value);
 		}
 		else if (!xmlStrcmp(cur->name, (xmlChar *)"entry")) {
diff --git a/servers/google/libgdata/gdata-service-iface.c b/servers/google/libgdata/gdata-service-iface.c
index 07cddca..fe8e663 100644
--- a/servers/google/libgdata/gdata-service-iface.c
+++ b/servers/google/libgdata/gdata-service-iface.c
@@ -32,13 +32,13 @@ gdata_service_set_proxy (GDataService *self, SoupURI *proxy)
 }
 
 void
-gdata_service_set_credentials (GDataService *self, const char *username, const gchar *password)
+gdata_service_set_credentials (GDataService *self, const gchar *username, const gchar *password)
 {
 	GDATA_SERVICE_GET_IFACE(self)->set_credentials(self, username, password);
 }
 
 GDataFeed*
-gdata_service_get_feed (GDataService *self, const char* feedURL, GError **error)
+gdata_service_get_feed (GDataService *self, const gchar * feedURL, GError **error)
 {
 	return GDATA_SERVICE_GET_IFACE(self)->get_feed(self, feedURL, error);
 }
diff --git a/servers/groupwise/create-account.c b/servers/groupwise/create-account.c
index 8b71ee4..b308c87 100644
--- a/servers/groupwise/create-account.c
+++ b/servers/groupwise/create-account.c
@@ -6,15 +6,15 @@
 
 static GConfClient *conf_client;
 static GMainLoop *main_loop;
-static char *arg_hostname, *arg_username, *arg_password;
+static gchar *arg_hostname, *arg_username, *arg_password;
 
 static void
-add_account (const char *conf_key, const char *hostname, const char *username)
+add_account (const gchar *conf_key, const gchar *hostname, const gchar *username)
 {
 	ESourceList *source_list;
 	ESourceGroup *group;
 	ESource *source;
-	char *group_name;
+	gchar *group_name;
 
 	source_list = e_source_list_new_for_gconf (conf_client, conf_key);
 
@@ -48,8 +48,8 @@ idle_cb (gpointer data)
 	return FALSE;
 }
 
-int
-main (int argc, char *argv[])
+gint
+main (gint argc, gchar *argv[])
 {
 	g_type_init ();
 	if (argc != 3 && argc != 4) {
diff --git a/servers/groupwise/e-gw-connection.c b/servers/groupwise/e-gw-connection.c
index 4187bb5..c525058 100644
--- a/servers/groupwise/e-gw-connection.c
+++ b/servers/groupwise/e-gw-connection.c
@@ -47,15 +47,15 @@ static GHashTable *loaded_connections_permissions = NULL;
 struct _EGwConnectionPrivate {
 	SoupSession *soup_session;
 
-	char *uri;
-	char *username;
-	char *password;
-	char *session_id;
-	char *user_name;
-	char *user_email;
-	char *user_uuid;
-	char *version;
-	char *server_time ;
+	gchar *uri;
+	gchar *username;
+	gchar *password;
+	gchar *session_id;
+	gchar *user_name;
+	gchar *user_email;
+	gchar *user_uuid;
+	gchar *version;
+	gchar *server_time ;
 	GHashTable *categories_by_name;
 	GHashTable *categories_by_id;
 	GList *book_list;
@@ -67,7 +67,7 @@ struct _EGwConnectionPrivate {
 
 static void
 update_soup_session_proxy_settings (EProxy *proxy, SoupSession* session,
-				    const char* uri)
+				    const gchar * uri)
 {
 	SoupURI *proxy_uri = NULL;
 
@@ -101,7 +101,7 @@ reauthenticate (EGwConnection *cnc)
 	SoupSoapResponse *response;
 	SoupSoapParameter *param;
 	EGwConnectionStatus status = -1;
-	char *session = NULL;
+	gchar *session = NULL;
 
 	priv = cnc->priv;
 	if (!priv)
@@ -162,7 +162,7 @@ reauthenticate (EGwConnection *cnc)
 }
 
 static gboolean
-e_gw_connection_response_parse_status_and_description (SoupSoapResponse *response, int *status, char **description)
+e_gw_connection_response_parse_status_and_description (SoupSoapResponse *response, gint *status, gchar **description)
 {
 	SoupSoapParameter *param, *subparam;
 
@@ -215,7 +215,7 @@ e_gw_connection_parse_response_status (SoupSoapResponse *response)
 	return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
 }
 
-const char *
+const gchar *
 e_gw_connection_get_error_message (EGwConnectionStatus status)
 {
 	switch (status) {
@@ -279,7 +279,7 @@ e_gw_connection_dispose (GObject *object)
 {
 	EGwConnection *cnc = (EGwConnection *) object;
 	EGwConnectionPrivate *priv;
-	char *hash_key;
+	gchar *hash_key;
 
 	g_return_if_fail (E_IS_GW_CONNECTION (cnc));
 
@@ -488,7 +488,7 @@ e_gw_connection_get_type (void)
 }
 
 static SoupSoapMessage*
-form_login_request (const char*uri, const char* username, const char* password)
+form_login_request (const gchar *uri, const gchar * username, const gchar * password)
 {
 	SoupSoapMessage *msg;
 	/* build the SOAP message */
@@ -506,17 +506,17 @@ form_login_request (const char*uri, const char* username, const char* password)
 }
 
 EGwConnection *
-e_gw_connection_new_with_error_handler (const char *uri, const char *username, const char *password, EGwConnectionErrors *errors)
+e_gw_connection_new_with_error_handler (const gchar *uri, const gchar *username, const gchar *password, EGwConnectionErrors *errors)
 {
 	EGwConnection *cnc;
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
 	SoupSoapParameter *param;
 	EGwConnectionStatus status;
-	char *hash_key;
-	char *redirected_uri = NULL;
-	int code;
-	char *description = NULL;
+	gchar *hash_key;
+	gchar *redirected_uri = NULL;
+	gint code;
+	gchar *description = NULL;
 
 	static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
 
@@ -563,8 +563,8 @@ e_gw_connection_new_with_error_handler (const char *uri, const char *username, c
 
 	status = e_gw_connection_parse_response_status (response);
 	if (status == E_GW_CONNECTION_STATUS_REDIRECT) {
-		char *host, *port;
-		char **tokens;
+		gchar *host, *port;
+		gchar **tokens;
 		SoupSoapParameter *subparam;
 
 		param = soup_soap_response_get_first_parameter_by_name (response, "redirectToHost");
@@ -611,7 +611,7 @@ e_gw_connection_new_with_error_handler (const char *uri, const char *username, c
 
 	if (param) {
 		SoupSoapParameter *subparam;
-		char *param_value;
+		gchar *param_value;
 
 		subparam = soup_soap_parameter_get_first_child_by_name (param, "email");
 		if (subparam) {
@@ -634,7 +634,7 @@ e_gw_connection_new_with_error_handler (const char *uri, const char *username, c
 
 	param = soup_soap_response_get_first_parameter_by_name (response, "gwVersion");
 	if (param) {
-		char *param_value;
+		gchar *param_value;
 		param_value = soup_soap_parameter_get_string_value (param);
 		cnc->priv->version = param_value;
 	} else
@@ -665,7 +665,7 @@ e_gw_connection_new_with_error_handler (const char *uri, const char *username, c
 
 
 EGwConnection *
-e_gw_connection_new (const char *uri, const char *username, const char *password)
+e_gw_connection_new (const gchar *uri, const gchar *username, const gchar *password)
 {
 	/* This is where I miss function-overloading and default-parameters */
 
@@ -687,7 +687,7 @@ e_gw_connection_send_message (EGwConnection *cnc, SoupSoapMessage *msg)
 
 	if (!SOUP_STATUS_IS_SUCCESSFUL (status)) {
 		if (g_getenv ("GROUPWISE_DEBUG")) {
-			const char *error = soup_status_get_phrase (status);
+			const gchar *error = soup_status_get_phrase (status);
 
 			if (!error)
 				error = "Unknown error";
@@ -723,7 +723,7 @@ e_gw_connection_logout (EGwConnection *cnc)
 }
 
 EGwConnectionStatus
-e_gw_connection_get_container_list (EGwConnection *cnc, const char *top, GList **container_list)
+e_gw_connection_get_container_list (EGwConnection *cnc, const gchar *top, GList **container_list)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -792,12 +792,12 @@ e_gw_connection_free_container_list (GList *container_list)
 	g_list_free (container_list);
 }
 
-char *
-e_gw_connection_get_container_id (EGwConnection *cnc, const char *name)
+gchar *
+e_gw_connection_get_container_id (EGwConnection *cnc, const gchar *name)
 {
         EGwConnectionStatus status;
 	GList *container_list = NULL, *l;
-	char *container_id = NULL;
+	gchar *container_id = NULL;
 
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
 	g_return_val_if_fail (name != NULL, NULL);
@@ -826,7 +826,7 @@ e_gw_connection_get_container_id (EGwConnection *cnc, const char *name)
 }
 
 EGwContainer *
-e_gw_connection_get_container (EGwConnection *cnc, const char * uid)
+e_gw_connection_get_container (EGwConnection *cnc, const gchar * uid)
 {
 		SoupSoapMessage *msg;
 		SoupSoapResponse *response;
@@ -870,14 +870,14 @@ e_gw_connection_get_container (EGwConnection *cnc, const char * uid)
 }
 
 EGwConnectionStatus
-e_gw_connection_get_items_delta_info (EGwConnection *cnc, const char *container, gdouble *first_sequence,
+e_gw_connection_get_items_delta_info (EGwConnection *cnc, const gchar *container, gdouble *first_sequence,
 					gdouble *last_sequence, gdouble *last_po_rebuild_time )
 {
         SoupSoapMessage *msg;
         SoupSoapResponse *response;
         EGwConnectionStatus status;
         SoupSoapParameter *param, *subparam;
-	char *tmp = NULL;
+	gchar *tmp = NULL;
 
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
@@ -952,7 +952,7 @@ e_gw_connection_get_items_delta_info (EGwConnection *cnc, const char *container,
 }
 
 EGwConnectionStatus
-e_gw_connection_get_items_delta (EGwConnection *cnc, const char *container, const char *view, const char *count, const char * start_sequence, GList **add_list, GList **delete_list)
+e_gw_connection_get_items_delta (EGwConnection *cnc, const gchar *container, const gchar *view, const gchar *count, const gchar * start_sequence, GList **add_list, GList **delete_list)
 {
         SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -1014,7 +1014,7 @@ e_gw_connection_get_items_delta (EGwConnection *cnc, const char *container, cons
 
 		subsubparam =  soup_soap_parameter_get_first_child_by_name(subparam, "sync");
 		if (subsubparam) {
-			char *value;
+			gchar *value;
 
 			value = soup_soap_parameter_get_string_value (subsubparam);
 			if (!strcmp (value, "add") || !strcmp (value, "update")) {
@@ -1036,7 +1036,7 @@ e_gw_connection_get_items_delta (EGwConnection *cnc, const char *container, cons
 
 
 EGwConnectionStatus
-e_gw_connection_get_items (EGwConnection *cnc, const char *container, const char *view, EGwFilter *filter, GList **list)
+e_gw_connection_get_items (EGwConnection *cnc, const gchar *container, const gchar *view, EGwFilter *filter, GList **list)
 {
         SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -1103,13 +1103,13 @@ e_gw_connection_get_items (EGwConnection *cnc, const char *container, const char
 }
 
 EGwConnectionStatus
-e_gw_connection_get_items_from_ids (EGwConnection *cnc, const char *container, const char *view, GPtrArray *item_ids, GList **list)
+e_gw_connection_get_items_from_ids (EGwConnection *cnc, const gchar *container, const gchar *view, GPtrArray *item_ids, GList **list)
 {
         SoupSoapMessage *msg;
         SoupSoapResponse *response;
         EGwConnectionStatus status;
         SoupSoapParameter *param, *subparam;
-	int i;
+	gint i;
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
 	/* build the SOAP message */
@@ -1124,7 +1124,7 @@ e_gw_connection_get_items_from_ids (EGwConnection *cnc, const char *container, c
 		e_gw_message_write_string_parameter (msg, "view", NULL, view);
 	soup_soap_message_start_element (msg, "items", NULL, NULL);
 	for (i = 0; i < item_ids->len; i ++) {
-		char *id = g_ptr_array_index (item_ids, i);
+		gchar *id = g_ptr_array_index (item_ids, i);
 		e_gw_message_write_string_parameter (msg, "item", NULL, id);
 	}
 	soup_soap_message_end_element (msg);
@@ -1180,7 +1180,7 @@ e_gw_connection_get_deltas ( EGwConnection *cnc, GSList **adds, GSList **deletes
         SoupSoapResponse *response;
         EGwConnectionStatus status;
         SoupSoapParameter *param, *subparam;
-	char *tmp;
+	gchar *tmp;
 
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
@@ -1250,7 +1250,7 @@ e_gw_connection_get_deltas ( EGwConnection *cnc, GSList **adds, GSList **deletes
                          subparam != NULL;
                          subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
                                  /*process each item */
-                                 char *uid;
+                                 gchar *uid;
                                  SoupSoapParameter *param_id;
 
                                  param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id");
@@ -1259,7 +1259,7 @@ e_gw_connection_get_deltas ( EGwConnection *cnc, GSList **adds, GSList **deletes
                                          g_object_unref (msg);
 					/* g_object_unref (cnc); */
                                  }
-                                 uid = (char *)soup_soap_parameter_get_string_value (param_id);
+                                 uid = (gchar *)soup_soap_parameter_get_string_value (param_id);
                                  /*if (!e_cal_backend_cache_remove_component (cache, uid, NULL))
                                          g_message ("Could not remove %s", uid); */
 				 *deletes = g_slist_append (*deletes, uid);
@@ -1366,7 +1366,7 @@ e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item, GSList **id_list)
 }
 
 EGwConnectionStatus
-e_gw_connection_create_item (EGwConnection *cnc, EGwItem *item, char** id)
+e_gw_connection_create_item (EGwConnection *cnc, EGwItem *item, gchar ** id)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -1413,7 +1413,7 @@ e_gw_connection_create_item (EGwConnection *cnc, EGwItem *item, char** id)
 }
 
 EGwConnectionStatus
-e_gw_connection_modify_item (EGwConnection *cnc, const char *id , EGwItem *item)
+e_gw_connection_modify_item (EGwConnection *cnc, const gchar *id , EGwItem *item)
 {
 	SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -1456,7 +1456,7 @@ e_gw_connection_modify_item (EGwConnection *cnc, const char *id , EGwItem *item)
 }
 
 EGwConnectionStatus
-e_gw_connection_get_item (EGwConnection *cnc, const char *container, const char *id, const char *view, EGwItem **item)
+e_gw_connection_get_item (EGwConnection *cnc, const gchar *container, const gchar *id, const gchar *view, EGwItem **item)
 {
 
 	SoupSoapMessage *msg;
@@ -1521,7 +1521,7 @@ e_gw_connection_get_item (EGwConnection *cnc, const char *container, const char
 
 
 EGwConnectionStatus
-e_gw_connection_remove_item (EGwConnection *cnc, const char *container, const char *id)
+e_gw_connection_remove_item (EGwConnection *cnc, const gchar *container, const gchar *id)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -1556,7 +1556,7 @@ e_gw_connection_remove_item (EGwConnection *cnc, const char *container, const ch
 }
 
 EGwConnectionStatus
-e_gw_connection_remove_items (EGwConnection *cnc, const char *container, GList *item_ids)
+e_gw_connection_remove_items (EGwConnection *cnc, const gchar *container, GList *item_ids)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -1593,10 +1593,10 @@ e_gw_connection_remove_items (EGwConnection *cnc, const char *container, GList *
 }
 
 EGwConnectionStatus
-e_gw_connection_accept_request (EGwConnection *cnc, const char *id, const char *accept_level, const char *accept_comment, const char *recurrence_key)
+e_gw_connection_accept_request (EGwConnection *cnc, const gchar *id, const gchar *accept_level, const gchar *accept_comment, const gchar *recurrence_key)
 {
 	SoupSoapMessage *msg;
-	int status;
+	gint status;
 	SoupSoapResponse *response;
 
 	msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "acceptRequest");
@@ -1628,10 +1628,10 @@ e_gw_connection_accept_request (EGwConnection *cnc, const char *id, const char *
 }
 
 EGwConnectionStatus
-e_gw_connection_decline_request (EGwConnection *cnc, const char *id, const char *decline_comment, const char *recurrence_key)
+e_gw_connection_decline_request (EGwConnection *cnc, const gchar *id, const gchar *decline_comment, const gchar *recurrence_key)
 {
 	SoupSoapMessage *msg;
-	int status;
+	gint status;
 	SoupSoapResponse *response;
 
 	msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "declineRequest");
@@ -1662,10 +1662,10 @@ e_gw_connection_decline_request (EGwConnection *cnc, const char *id, const char
 }
 
 EGwConnectionStatus
-e_gw_connection_retract_request (EGwConnection *cnc, const char *id, const char *comment, gboolean retract_all, gboolean resend)
+e_gw_connection_retract_request (EGwConnection *cnc, const gchar *id, const gchar *comment, gboolean retract_all, gboolean resend)
 {
 	SoupSoapMessage *msg;
-	int status;
+	gint status;
 	SoupSoapResponse *response;
 
 	msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "retractRequest");
@@ -1690,10 +1690,10 @@ e_gw_connection_retract_request (EGwConnection *cnc, const char *id, const char
 }
 
 EGwConnectionStatus
-e_gw_connection_complete_request (EGwConnection *cnc, const char *id)
+e_gw_connection_complete_request (EGwConnection *cnc, const gchar *id)
 {
 	SoupSoapMessage *msg;
-	int status;
+	gint status;
 	SoupSoapResponse *response;
 
 	msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "completeRequest");
@@ -1717,10 +1717,10 @@ e_gw_connection_complete_request (EGwConnection *cnc, const char *id)
 }
 
 EGwConnectionStatus
-e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char *id, const char *comments_org, const char *comments_del, const char *recur_key)
+e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const gchar *id, const gchar *comments_org, const gchar *comments_del, const gchar *recur_key)
 {
 	SoupSoapMessage *msg;
-	int status;
+	gint status;
 	SoupSoapResponse *response;
 
 	msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "delegateRequest");
@@ -1754,70 +1754,70 @@ e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char
 	return status;
 }
 
-const char *
+const gchar *
 e_gw_connection_get_version (EGwConnection *cnc)
 {
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
 
-	return (const char *) cnc->priv->version;
+	return (const gchar *) cnc->priv->version;
 }
 
-const char *
+const gchar *
 e_gw_connection_get_uri (EGwConnection *cnc)
 {
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
 
-	return (const char *) cnc->priv->uri;
+	return (const gchar *) cnc->priv->uri;
 }
 
-const char *
+const gchar *
 e_gw_connection_get_session_id (EGwConnection *cnc)
 {
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
 
-	return (const char *) cnc->priv->session_id;
+	return (const gchar *) cnc->priv->session_id;
 }
 
-const char *
+const gchar *
 e_gw_connection_get_user_name (EGwConnection *cnc)
 {
 	g_return_val_if_fail (cnc != NULL, NULL);
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
 
-	return (const char *) cnc->priv->user_name;
+	return (const gchar *) cnc->priv->user_name;
 }
 
-const char*
+const gchar *
 e_gw_connection_get_user_email (EGwConnection *cnc)
 {
 	g_return_val_if_fail (cnc != NULL, NULL);
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
 
-	return (const char*) cnc->priv->user_email;
+	return (const gchar *) cnc->priv->user_email;
 
 }
 
-const char *
+const gchar *
 e_gw_connection_get_user_uuid (EGwConnection *cnc)
 {
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
 
-	return (const char *) cnc->priv->user_uuid;
+	return (const gchar *) cnc->priv->user_uuid;
 }
 
-const char *
+const gchar *
 e_gw_connection_get_server_time (EGwConnection *cnc)
 {
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL) ;
 
-	return (const char *) cnc->priv->server_time ;
+	return (const gchar *) cnc->priv->server_time ;
 }
 
-char *
-e_gw_connection_format_date_string (const char *dtstring)
+gchar *
+e_gw_connection_format_date_string (const gchar *dtstring)
 {
-        char *str2;
-        int i, j, len = strlen (dtstring);
+        gchar *str2;
+        gint i, j, len = strlen (dtstring);
 
         str2 = g_malloc0 (len);
 	if (len <= 0)
@@ -1835,7 +1835,7 @@ e_gw_connection_format_date_string (const char *dtstring)
 }
 
 time_t
-e_gw_connection_get_date_from_string (const char *dtstring)
+e_gw_connection_get_date_from_string (const gchar *dtstring)
 {
 	time_t t = 0;
 	GTimeVal t_val;
@@ -1871,13 +1871,13 @@ e_gw_connection_get_date_from_string (const char *dtstring)
 }
 
 EGwConnectionStatus
-e_gw_connection_create_book (EGwConnection *cnc, char *book_name, char**id)
+e_gw_connection_create_book (EGwConnection *cnc, gchar *book_name, gchar **id)
 {
 	SoupSoapMessage *msg;
-	int status;
+	gint status;
 	SoupSoapResponse *response;
 	SoupSoapParameter *param;
-	char *value;
+	gchar *value;
 
 	msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "createItemRequest");
 	soup_soap_message_start_element (msg, "item", NULL, NULL);
@@ -1920,7 +1920,7 @@ e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_lis
 	EGwConnectionPrivate *priv;
 	SoupSoapParameter *param;
 	SoupSoapParameter *type_param;
-	char *value;
+	gchar *value;
 	static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
 
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
@@ -2011,7 +2011,7 @@ e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_lis
 
 
 EGwConnectionStatus
-e_gw_connection_get_address_book_id ( EGwConnection *cnc, char *book_name, char**id , gboolean *is_writable)
+e_gw_connection_get_address_book_id ( EGwConnection *cnc, gchar *book_name, gchar **id , gboolean *is_writable)
 {
 	EGwConnectionStatus status;
 	GList *container_list = NULL, *l;
@@ -2169,7 +2169,7 @@ e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_i
         EGwConnectionStatus status;
 	EGwConnectionPrivate *priv;
         SoupSoapParameter *param, *subparam, *second_level_child;
-	char *id, *name;
+	gchar *id, *name;
 	static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
 
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
@@ -2234,7 +2234,7 @@ e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_i
 		if (second_level_child)
 			name = soup_soap_parameter_get_string_value (second_level_child);
 		if (id && name) {
-			char **components = g_strsplit (id, "@", -1);
+			gchar **components = g_strsplit (id, "@", -1);
 			g_free (id);
 			id = components[0];
 			if (categories_by_id)
@@ -2259,7 +2259,7 @@ e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_i
 }
 
 EGwConnectionStatus
-e_gw_connection_add_members (EGwConnection *cnc, const char *group_id, GList *member_ids)
+e_gw_connection_add_members (EGwConnection *cnc, const gchar *group_id, GList *member_ids)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2302,7 +2302,7 @@ e_gw_connection_add_members (EGwConnection *cnc, const char *group_id, GList *me
 }
 
 EGwConnectionStatus
-e_gw_connection_remove_members (EGwConnection *cnc, const char *group_id, GList *member_ids)
+e_gw_connection_remove_members (EGwConnection *cnc, const gchar *group_id, GList *member_ids)
 {
 
 	SoupSoapMessage *msg;
@@ -2348,13 +2348,13 @@ e_gw_connection_remove_members (EGwConnection *cnc, const char *group_id, GList
 
 
 EGwConnectionStatus
-e_gw_connection_create_cursor (EGwConnection *cnc, const char *container, const char *view, EGwFilter *filter, int *cursor)
+e_gw_connection_create_cursor (EGwConnection *cnc, const gchar *container, const gchar *view, EGwFilter *filter, gint *cursor)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
         EGwConnectionStatus status;
 	SoupSoapParameter *param;
-	char *value;
+	gchar *value;
 
 	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
 	g_return_val_if_fail ((container != NULL), E_GW_CONNECTION_STATUS_UNKNOWN);
@@ -2405,7 +2405,7 @@ e_gw_connection_create_cursor (EGwConnection *cnc, const char *container, const
 }
 
 EGwConnectionStatus
-e_gw_connection_destroy_cursor (EGwConnection *cnc, const char *container,  int cursor)
+e_gw_connection_destroy_cursor (EGwConnection *cnc, const gchar *container,  gint cursor)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2438,7 +2438,7 @@ e_gw_connection_destroy_cursor (EGwConnection *cnc, const char *container,  int
 
 
 EGwConnectionStatus
-e_gw_connection_position_cursor (EGwConnection *cnc, const char *container, int cursor, const char *seek, int offset)
+e_gw_connection_position_cursor (EGwConnection *cnc, const gchar *container, gint cursor, const gchar *seek, gint offset)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2468,7 +2468,7 @@ e_gw_connection_position_cursor (EGwConnection *cnc, const char *container, int
 }
 
 EGwConnectionStatus
-e_gw_connection_read_cursor (EGwConnection *cnc, const char *container, int cursor, gboolean forward, int count, const char *cursor_seek, GList **item_list)
+e_gw_connection_read_cursor (EGwConnection *cnc, const gchar *container, gint cursor, gboolean forward, gint count, const gchar *cursor_seek, GList **item_list)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2528,7 +2528,7 @@ e_gw_connection_read_cursor (EGwConnection *cnc, const char *container, int curs
         return E_GW_CONNECTION_STATUS_OK;
 }
 
-EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, const char *container, const char *view, char **start_date, const char *message_list, const char *item_types, const char *item_sources, int count, GSList **item_list)
+EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, const gchar *container, const gchar *view, gchar **start_date, const gchar *message_list, const gchar *item_types, const gchar *item_sources, gint count, GSList **item_list)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2581,7 +2581,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
 	if (start_date && *start_date && (((!strcmp (message_list, "New")) || (!strcmp (message_list, "Modified"))))) {
 		subparam = soup_soap_response_get_first_parameter_by_name (response, "startDate");
 		if (subparam) {
-			char *date;
+			gchar *date;
 
 			date = soup_soap_parameter_get_string_value (subparam);
 			if (date)
@@ -2602,7 +2602,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
 		     subparam != NULL;
 		     subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
 			SoupSoapParameter *param_id;
-			char *id;
+			gchar *id;
 
 			if (view_is_id) {
 				param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id");
@@ -2651,7 +2651,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
 
 
 EGwConnectionStatus
-e_gw_connection_create_folder(EGwConnection *cnc, const char *parent_name,const char *folder_name, char **container_id)
+e_gw_connection_create_folder(EGwConnection *cnc, const gchar *parent_name,const gchar *folder_name, gchar **container_id)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2696,14 +2696,14 @@ e_gw_connection_create_folder(EGwConnection *cnc, const char *parent_name,const
  *
  */
 EGwConnectionStatus
-e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset, int length, const char **attachment, int *attach_length)
+e_gw_connection_get_attachment (EGwConnection *cnc, const gchar *id, gint offset, gint length, const gchar **attachment, gint *attach_length)
 {
 
 	SoupSoapMessage *msg;
         SoupSoapResponse *response;
         EGwConnectionStatus status;
 	SoupSoapParameter *param ;
-	char *buffer = NULL, *buf_length = NULL ;
+	gchar *buffer = NULL, *buf_length = NULL ;
 
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
@@ -2746,7 +2746,7 @@ e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset,
 
 	if (buffer && buf_length && atoi (buf_length) > 0) {
 		gsize len = atoi (buf_length) ;
-		*attachment = (char *) g_base64_decode (buffer,&len) ;
+		*attachment = (gchar *) g_base64_decode (buffer,&len) ;
 		*attach_length = len ;
 	} else {
 		*attachment = NULL;
@@ -2766,14 +2766,14 @@ e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset,
  *
  */
 EGwConnectionStatus
-e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const char *id, int offset, int length, const char **attachment, int *attach_length, int *offset_r)
+e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const gchar *id, gint offset, gint length, const gchar **attachment, gint *attach_length, gint *offset_r)
 {
 
 	SoupSoapMessage *msg;
         SoupSoapResponse *response;
         EGwConnectionStatus status;
 	SoupSoapParameter *param ;
-	char *buffer = NULL, *buf_length = NULL, *o_return = NULL;
+	gchar *buffer = NULL, *buf_length = NULL, *o_return = NULL;
 
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
@@ -2816,7 +2816,7 @@ e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const char *id, int o
 	}
 
 	if (buffer && buf_length && atoi (buf_length) > 0) {
-		int len = atoi (buf_length) ;
+		gint len = atoi (buf_length) ;
 		*attachment = g_strdup (buffer);
 		*attach_length = len;
 		if (len && o_return)
@@ -2840,7 +2840,7 @@ e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const char *id, int o
 }
 
 EGwConnectionStatus
-e_gw_connection_add_item (EGwConnection *cnc, const char *container, const char *id)
+e_gw_connection_add_item (EGwConnection *cnc, const gchar *container, const gchar *id)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2875,7 +2875,7 @@ e_gw_connection_add_item (EGwConnection *cnc, const char *container, const char
 }
 
 EGwConnectionStatus
-e_gw_connection_add_items (EGwConnection *cnc, const char *container, GList *item_ids)
+e_gw_connection_add_items (EGwConnection *cnc, const gchar *container, GList *item_ids)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2915,7 +2915,7 @@ e_gw_connection_add_items (EGwConnection *cnc, const char *container, GList *ite
 }
 
 EGwConnectionStatus
-e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *new_name)
+e_gw_connection_rename_folder (EGwConnection *cnc, const gchar *id ,const gchar *new_name)
 {
 	SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -2958,7 +2958,7 @@ e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *n
 }
 
 EGwConnectionStatus
-e_gw_connection_share_folder(EGwConnection *cnc, gchar *id, GList *new_list, const char *sub, const char *mesg ,int flag)
+e_gw_connection_share_folder(EGwConnection *cnc, gchar *id, GList *new_list, const gchar *sub, const gchar *mesg ,int flag)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -2985,7 +2985,7 @@ e_gw_connection_share_folder(EGwConnection *cnc, gchar *id, GList *new_list, con
 }
 
 EGwConnectionStatus
-e_gw_connection_move_item (EGwConnection *cnc, const char *id, const char *dest_container_id, const char *from_container_id)
+e_gw_connection_move_item (EGwConnection *cnc, const gchar *id, const gchar *dest_container_id, const gchar *from_container_id)
 
 {
 	SoupSoapMessage *msg;
@@ -3188,7 +3188,7 @@ e_gw_connection_mark_unread(EGwConnection *cnc, GList *item_ids)
 }
 
 EGwConnectionStatus
-e_gw_connection_reply_item (EGwConnection *cnc, const char *id, const char *view, EGwItem **item)
+e_gw_connection_reply_item (EGwConnection *cnc, const gchar *id, const gchar *view, EGwItem **item)
 {
 	SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -3247,7 +3247,7 @@ e_gw_connection_reply_item (EGwConnection *cnc, const char *id, const char *view
 }
 
 EGwConnectionStatus
-e_gw_connection_forward_item (EGwConnection *cnc, const char *id, const char *view, gboolean embed, EGwItem **item)
+e_gw_connection_forward_item (EGwConnection *cnc, const gchar *id, const gchar *view, gboolean embed, EGwItem **item)
 {
 	SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -3316,7 +3316,7 @@ e_gw_connection_forward_item (EGwConnection *cnc, const char *id, const char *vi
  * */
 
 EGwConnectionStatus
-e_gw_connection_create_junk_entry (EGwConnection *cnc, const char *value, const char *match_type, const char *list_type)
+e_gw_connection_create_junk_entry (EGwConnection *cnc, const gchar *value, const gchar *match_type, const gchar *list_type)
 {
 	SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -3356,7 +3356,7 @@ e_gw_connection_create_junk_entry (EGwConnection *cnc, const char *value, const
 
 /*TODO: move to different file*/
 static void
-parse_junk_settings (SoupSoapParameter *param, int *use_junk, int *use_block, int *use_pab, int *persistence)
+parse_junk_settings (SoupSoapParameter *param, gint *use_junk, gint *use_block, gint *use_pab, gint *persistence)
 {
 	SoupSoapParameter *subparam, *field_param, *val_param;
 
@@ -3367,8 +3367,8 @@ parse_junk_settings (SoupSoapParameter *param, int *use_junk, int *use_block, in
 		for (subparam = soup_soap_parameter_get_first_child_by_name (param, "setting");
 				subparam != NULL;
 				subparam = soup_soap_parameter_get_next_child_by_name (subparam, "setting")) {
-			char *field = NULL;
-			int val = 0;
+			gchar *field = NULL;
+			gint val = 0;
 
 			field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
 			val_param = soup_soap_parameter_get_first_child_by_name (subparam, "value");
@@ -3410,7 +3410,7 @@ parse_junk_settings (SoupSoapParameter *param, int *use_junk, int *use_block, in
  * persistence:
  * */
 EGwConnectionStatus
-e_gw_connection_get_junk_settings (EGwConnection *cnc, int *use_junk, int *use_block, int *use_pab, int *persistence)
+e_gw_connection_get_junk_settings (EGwConnection *cnc, gint *use_junk, gint *use_block, gint *use_pab, gint *persistence)
 {
 	SoupSoapMessage *msg;
         SoupSoapResponse *response;
@@ -3452,7 +3452,7 @@ e_gw_connection_get_junk_settings (EGwConnection *cnc, int *use_junk, int *use_b
 }
 
 static void
-msg_add_settings (SoupSoapMessage *msg, char *field, int value)
+msg_add_settings (SoupSoapMessage *msg, gchar *field, gint value)
 {
 	soup_soap_message_start_element (msg, "setting", NULL, NULL);
 	e_gw_message_write_string_parameter (msg, "field", NULL, field);
@@ -3469,7 +3469,7 @@ msg_add_settings (SoupSoapMessage *msg, char *field, int value)
  * */
 
 EGwConnectionStatus
-e_gw_connection_modify_junk_settings (EGwConnection *cnc, int use_junk, int use_pab, int use_block, int persistence)
+e_gw_connection_modify_junk_settings (EGwConnection *cnc, gint use_junk, gint use_pab, gint use_block, gint persistence)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -3644,7 +3644,7 @@ e_gw_connection_get_junk_entries (EGwConnection *cnc, GList **entries)
 }
 
 EGwConnectionStatus
-e_gw_connection_remove_junk_entry (EGwConnection *cnc, const char *id)
+e_gw_connection_remove_junk_entry (EGwConnection *cnc, const gchar *id)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -3679,7 +3679,7 @@ e_gw_connection_remove_junk_entry (EGwConnection *cnc, const char *id)
 }
 
 EGwConnectionStatus
-e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cursor, gboolean forward, int count, const char *cursor_seek, GList **list)
+e_gw_connection_read_cal_ids (EGwConnection *cnc, const gchar *container, gint cursor, gboolean forward, gint count, const gchar *cursor_seek, GList **list)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -3731,7 +3731,7 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
 		SoupSoapParameter *param_id;
 		EGwItemCalId *calid = g_new0 (EGwItemCalId, 1);
 		EGwItemType type;
-		char *id = NULL, *item_type = NULL;
+		gchar *id = NULL, *item_type = NULL;
 
 		item_type = soup_soap_parameter_get_property (subparam, "type");
 
@@ -3788,7 +3788,7 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
 				param_id = soup_soap_parameter_get_first_child_by_name (subparam, "startDate");
 
 			if (param_id) {
-				char *formatted_date;
+				gchar *formatted_date;
 				id = soup_soap_parameter_get_string_value (param_id);
 				formatted_date = e_gw_connection_format_date_string (id);
 				 /* store the date in calid for recurring events */
@@ -3828,7 +3828,7 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
 }
 
 EGwConnectionStatus
-e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const char *container, int cursor, gboolean forward, int count, const char *cursor_seek, GList **list)
+e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const gchar *container, gint cursor, gboolean forward, gint count, const gchar *cursor_seek, GList **list)
 {
 	SoupSoapMessage *msg;
 	SoupSoapResponse *response;
@@ -3878,7 +3878,7 @@ e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const char *container, in
 			subparam != NULL;
 			subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
 		SoupSoapParameter *param_id;
-		char *id = NULL;
+		gchar *id = NULL;
 
 		param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id");
 		if (!param_id) {
@@ -4086,7 +4086,7 @@ e_gw_connection_get_proxy_list (EGwConnection *cnc, GList **proxy_info)
 }
 
 static SoupSoapMessage*
-form_proxy_login_request (EGwConnection *cnc, const char* username, const char* password, const char *proxy)
+form_proxy_login_request (EGwConnection *cnc, const gchar * username, const gchar * password, const gchar *proxy)
 {
 	SoupSoapMessage *msg;
 	/* build the SOAP message */
@@ -4103,7 +4103,7 @@ form_proxy_login_request (EGwConnection *cnc, const char* username, const char*
 }
 
 EGwConnection *
-e_gw_connection_get_proxy_connection (EGwConnection *parent_cnc, char *username, const char *password, const char *proxy, int  *permissions)
+e_gw_connection_get_proxy_connection (EGwConnection *parent_cnc, gchar *username, const gchar *password, const gchar *proxy, gint  *permissions)
 {
 	EGwConnection *cnc;
 	SoupSoapMessage *msg;
@@ -4111,10 +4111,10 @@ e_gw_connection_get_proxy_connection (EGwConnection *parent_cnc, char *username,
 	EGwConnectionStatus status;
 	SoupSoapParameter *param;
 	SoupSoapParameter *subparam;
-	char *hash_key;
-	char *name = NULL;
-	int i;
-	char *permissions_key = NULL;
+	gchar *hash_key;
+	gchar *name = NULL;
+	gint i;
+	gchar *permissions_key = NULL;
 
 	static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
 
@@ -4181,7 +4181,7 @@ e_gw_connection_get_proxy_connection (EGwConnection *parent_cnc, char *username,
 	param = soup_soap_response_get_first_parameter_by_name (response, "entry");
 
 	if (param) {
-		char *param_value;
+		gchar *param_value;
 
 		subparam = soup_soap_parameter_get_first_child_by_name (param, "email");
 		if (subparam) {
@@ -4206,7 +4206,7 @@ e_gw_connection_get_proxy_connection (EGwConnection *parent_cnc, char *username,
 
 	param = soup_soap_response_get_first_parameter_by_name (response, "gwVersion");
 	if (param) {
-		char *param_value;
+		gchar *param_value;
 		param_value = soup_soap_parameter_get_string_value (param);
 		cnc->priv->version = param_value;
 	} else
diff --git a/servers/groupwise/e-gw-connection.h b/servers/groupwise/e-gw-connection.h
index 18a8f61..7744763 100644
--- a/servers/groupwise/e-gw-connection.h
+++ b/servers/groupwise/e-gw-connection.h
@@ -46,8 +46,8 @@ typedef struct _EGwConnectionClass   EGwConnectionClass;
 typedef struct _EGwConnectionPrivate EGwConnectionPrivate;
 
 typedef struct {
-	int status;
-	char *description;
+	gint status;
+	gchar *description;
 }EGwConnectionErrors;
 
 struct _EGwConnection {
@@ -61,18 +61,18 @@ struct _EGwConnectionClass {
 
 /* TODO:This has to go either in a generic file or specific to junk*/
 typedef struct {
-	char *id ;
-	char *match;
-	char *matchType;
-	char *lastUsed;
-	int version;
-	char *modified;
+	gchar *id ;
+	gchar *match;
+	gchar *matchType;
+	gchar *lastUsed;
+	gint version;
+	gchar *modified;
 } EGwJunkEntry;
 
 GType          e_gw_connection_get_type (void);
-EGwConnection *e_gw_connection_new (const char *uri, const char *username, const char *password);
+EGwConnection *e_gw_connection_new (const gchar *uri, const gchar *username, const gchar *password);
 
-EGwConnection * e_gw_connection_new_with_error_handler (const char *uri, const char *username, const char *password, EGwConnectionErrors *errors);
+EGwConnection * e_gw_connection_new_with_error_handler (const gchar *uri, const gchar *username, const gchar *password, EGwConnectionErrors *errors);
 
 typedef enum {
 	E_GW_CONNECTION_STATUS_OK,
@@ -96,94 +96,94 @@ typedef enum {
 
 SoupSoapResponse   *e_gw_connection_send_message (EGwConnection *cnc, SoupSoapMessage *msg);
 EGwConnectionStatus e_gw_connection_parse_response_status (SoupSoapResponse *response);
-const char         *e_gw_connection_get_error_message (EGwConnectionStatus status);
+const gchar         *e_gw_connection_get_error_message (EGwConnectionStatus status);
 
 EGwConnectionStatus e_gw_connection_logout (EGwConnection *cnc);
 
-EGwConnectionStatus e_gw_connection_get_container_list (EGwConnection *cnc, const char *top, GList **container_list);
+EGwConnectionStatus e_gw_connection_get_container_list (EGwConnection *cnc, const gchar *top, GList **container_list);
 void                e_gw_connection_free_container_list (GList *container_list);
-char               *e_gw_connection_get_container_id (EGwConnection *cnc, const char *name);
-EGwContainer * e_gw_connection_get_container (EGwConnection *cnc, const char * uid);
+gchar               *e_gw_connection_get_container_id (EGwConnection *cnc, const gchar *name);
+EGwContainer * e_gw_connection_get_container (EGwConnection *cnc, const gchar * uid);
 
-EGwConnectionStatus e_gw_connection_get_items (EGwConnection *cnc, const char *container,
-					       const char *view, EGwFilter *filter, GList **list);
+EGwConnectionStatus e_gw_connection_get_items (EGwConnection *cnc, const gchar *container,
+					       const gchar *view, EGwFilter *filter, GList **list);
 EGwConnectionStatus e_gw_connection_get_deltas ( EGwConnection *cnc, GSList **adds, GSList **deletes, GSList **updates);
 EGwConnectionStatus e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item, GSList **id_list);
-EGwConnectionStatus e_gw_connection_remove_item (EGwConnection *cnc, const char *container, const char *id);
-EGwConnectionStatus e_gw_connection_remove_items (EGwConnection *cnc, const char *container, GList *item_ids);
-EGwConnectionStatus e_gw_connection_get_items_delta_info (EGwConnection *cnc, const char *container, gdouble *first_sequence, gdouble *last_sequence, gdouble *last_po_rebuild_time);
-EGwConnectionStatus e_gw_connection_get_items_delta (EGwConnection *cnc, const char *container, const char *view, const char *count, const char * start_sequence, GList **add_list, GList **delete_list);
+EGwConnectionStatus e_gw_connection_remove_item (EGwConnection *cnc, const gchar *container, const gchar *id);
+EGwConnectionStatus e_gw_connection_remove_items (EGwConnection *cnc, const gchar *container, GList *item_ids);
+EGwConnectionStatus e_gw_connection_get_items_delta_info (EGwConnection *cnc, const gchar *container, gdouble *first_sequence, gdouble *last_sequence, gdouble *last_po_rebuild_time);
+EGwConnectionStatus e_gw_connection_get_items_delta (EGwConnection *cnc, const gchar *container, const gchar *view, const gchar *count, const gchar * start_sequence, GList **add_list, GList **delete_list);
 
 
-const char         *e_gw_connection_get_uri (EGwConnection *cnc);
-const char         *e_gw_connection_get_session_id (EGwConnection *cnc);
-const char         *e_gw_connection_get_user_name (EGwConnection *cnc);
-const char         *e_gw_connection_get_user_email (EGwConnection *cnc);
-const char         *e_gw_connection_get_user_uuid (EGwConnection *cnc);
+const gchar         *e_gw_connection_get_uri (EGwConnection *cnc);
+const gchar         *e_gw_connection_get_session_id (EGwConnection *cnc);
+const gchar         *e_gw_connection_get_user_name (EGwConnection *cnc);
+const gchar         *e_gw_connection_get_user_email (EGwConnection *cnc);
+const gchar         *e_gw_connection_get_user_uuid (EGwConnection *cnc);
 const char	   *e_gw_connection_get_version (EGwConnection *cnc);
 const char	   *e_gw_connection_get_server_time (EGwConnection *cnc) ;
 
 
-time_t              e_gw_connection_get_date_from_string (const char *dtstring);
-char               *e_gw_connection_format_date_string (const char *dtstring);
+time_t              e_gw_connection_get_date_from_string (const gchar *dtstring);
+gchar               *e_gw_connection_format_date_string (const gchar *dtstring);
 
 
-EGwConnectionStatus e_gw_connection_create_item (EGwConnection *cnc, EGwItem *item, char** id);
-EGwConnectionStatus e_gw_connection_get_item (EGwConnection *cnc, const char *container, const char *id, const char *view, EGwItem **item);
-EGwConnectionStatus e_gw_connection_modify_item (EGwConnection *cnc, const char *id, EGwItem *item);
-EGwConnectionStatus e_gw_connection_accept_request (EGwConnection *cnc, const char *id, const char *accept_level, const char *accept_comment, const char *recurrence_key);
-EGwConnectionStatus e_gw_connection_decline_request (EGwConnection *cnc, const char *id, const char *decline_comment, const char *recurrence_key);
-EGwConnectionStatus e_gw_connection_retract_request (EGwConnection *cnc, const char *id, const char *comment, gboolean retract_all, gboolean resend);
-EGwConnectionStatus e_gw_connection_complete_request (EGwConnection *cnc, const char *id);
-EGwConnectionStatus e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char *id, const char *comments_org, const char *comments_del, const char *recur_key);
-EGwConnectionStatus e_gw_connection_create_book (EGwConnection *cnc, char *book_name, char**id);
-EGwConnectionStatus e_gw_connection_remove_book (EGwConnection *cnc, char *book_uid);
+EGwConnectionStatus e_gw_connection_create_item (EGwConnection *cnc, EGwItem *item, gchar ** id);
+EGwConnectionStatus e_gw_connection_get_item (EGwConnection *cnc, const gchar *container, const gchar *id, const gchar *view, EGwItem **item);
+EGwConnectionStatus e_gw_connection_modify_item (EGwConnection *cnc, const gchar *id, EGwItem *item);
+EGwConnectionStatus e_gw_connection_accept_request (EGwConnection *cnc, const gchar *id, const gchar *accept_level, const gchar *accept_comment, const gchar *recurrence_key);
+EGwConnectionStatus e_gw_connection_decline_request (EGwConnection *cnc, const gchar *id, const gchar *decline_comment, const gchar *recurrence_key);
+EGwConnectionStatus e_gw_connection_retract_request (EGwConnection *cnc, const gchar *id, const gchar *comment, gboolean retract_all, gboolean resend);
+EGwConnectionStatus e_gw_connection_complete_request (EGwConnection *cnc, const gchar *id);
+EGwConnectionStatus e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const gchar *id, const gchar *comments_org, const gchar *comments_del, const gchar *recur_key);
+EGwConnectionStatus e_gw_connection_create_book (EGwConnection *cnc, gchar *book_name, gchar **id);
+EGwConnectionStatus e_gw_connection_remove_book (EGwConnection *cnc, gchar *book_uid);
 EGwConnectionStatus e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_list);
-EGwConnectionStatus e_gw_connection_get_address_book_id ( EGwConnection *cnc, char *book_name, char**id , gboolean *is_writable);
+EGwConnectionStatus e_gw_connection_get_address_book_id ( EGwConnection *cnc, gchar *book_name, gchar **id , gboolean *is_writable);
 EGwConnectionStatus e_gw_connection_get_categories  (EGwConnection *cnc, GHashTable **categories_by_id, GHashTable **categoreis_by_name);
-EGwConnectionStatus e_gw_connection_add_members (EGwConnection *cnc, const char *group_id, GList *member_ids);
-EGwConnectionStatus e_gw_connection_remove_members (EGwConnection *cnc, const char *group_id, GList *member_ids);
-EGwConnectionStatus e_gw_connection_get_items_from_ids (EGwConnection *cnc, const char *container, const char *view, GPtrArray *item_ids, GList **list);
+EGwConnectionStatus e_gw_connection_add_members (EGwConnection *cnc, const gchar *group_id, GList *member_ids);
+EGwConnectionStatus e_gw_connection_remove_members (EGwConnection *cnc, const gchar *group_id, GList *member_ids);
+EGwConnectionStatus e_gw_connection_get_items_from_ids (EGwConnection *cnc, const gchar *container, const gchar *view, GPtrArray *item_ids, GList **list);
 
-EGwConnectionStatus e_gw_connection_create_cursor (EGwConnection *cnc, const char *container, const char *view, EGwFilter *filter, int *cursor);
-EGwConnectionStatus e_gw_connection_destroy_cursor (EGwConnection *cnc, const char *container,  int cursor);
-EGwConnectionStatus e_gw_connection_read_cursor (EGwConnection *cnc, const char *container, int cursor, gboolean forward, int count, const char *cursor_seek, GList **item_list);
-EGwConnectionStatus e_gw_connection_position_cursor (EGwConnection *cnc, const char *container, int cursor, const char *seek, int offset);
+EGwConnectionStatus e_gw_connection_create_cursor (EGwConnection *cnc, const gchar *container, const gchar *view, EGwFilter *filter, gint *cursor);
+EGwConnectionStatus e_gw_connection_destroy_cursor (EGwConnection *cnc, const gchar *container,  gint cursor);
+EGwConnectionStatus e_gw_connection_read_cursor (EGwConnection *cnc, const gchar *container, gint cursor, gboolean forward, gint count, const gchar *cursor_seek, GList **item_list);
+EGwConnectionStatus e_gw_connection_position_cursor (EGwConnection *cnc, const gchar *container, gint cursor, const gchar *seek, gint offset);
 
-EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, const char *container, const char *view, char **start_date, const char *message_list, const char *item_types, const char *item_sources, int count, GSList **item_list);
+EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, const gchar *container, const gchar *view, gchar **start_date, const gchar *message_list, const gchar *item_types, const gchar *item_sources, gint count, GSList **item_list);
 
-EGwConnectionStatus e_gw_connection_create_folder(EGwConnection *cnc, const char *parent_name,const char *folder_name, char **container_id) ;
+EGwConnectionStatus e_gw_connection_create_folder(EGwConnection *cnc, const gchar *parent_name,const gchar *folder_name, gchar **container_id) ;
 EGwConnectionStatus
-e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset, int length, const char **attachment, int *attach_length) ;
-EGwConnectionStatus e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const char *id, int offset, int length, const char **attachment, int *attach_length, int *offset_r);
-EGwConnectionStatus e_gw_connection_add_item (EGwConnection *cnc, const char *container, const char *id) ;
-EGwConnectionStatus e_gw_connection_add_items (EGwConnection *cnc, const char *container, GList *item_ids) ;
-EGwConnectionStatus e_gw_connection_move_item (EGwConnection *cnc, const char *id, const char *dest_container_id, const char *from_container_id);
-EGwConnectionStatus e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *new_name) ;
+e_gw_connection_get_attachment (EGwConnection *cnc, const gchar *id, gint offset, gint length, const gchar **attachment, gint *attach_length) ;
+EGwConnectionStatus e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const gchar *id, gint offset, gint length, const gchar **attachment, gint *attach_length, gint *offset_r);
+EGwConnectionStatus e_gw_connection_add_item (EGwConnection *cnc, const gchar *container, const gchar *id) ;
+EGwConnectionStatus e_gw_connection_add_items (EGwConnection *cnc, const gchar *container, GList *item_ids) ;
+EGwConnectionStatus e_gw_connection_move_item (EGwConnection *cnc, const gchar *id, const gchar *dest_container_id, const gchar *from_container_id);
+EGwConnectionStatus e_gw_connection_rename_folder (EGwConnection *cnc, const gchar *id ,const gchar *new_name) ;
 EGwConnectionStatus e_gw_connection_get_settings (EGwConnection *cnc, EGwSendOptions **opts);
 EGwConnectionStatus e_gw_connection_modify_settings (EGwConnection *cnc, EGwSendOptions *opts);
-EGwConnectionStatus e_gw_connection_share_folder (EGwConnection *cnc, gchar *id, GList *new_list, const char *sub, const char *mesg ,int flag);
+EGwConnectionStatus e_gw_connection_share_folder (EGwConnection *cnc, gchar *id, GList *new_list, const gchar *sub, const gchar *mesg ,int flag);
 EGwConnectionStatus e_gw_connection_accept_shared_folder (EGwConnection *cnc, gchar *folder_name, gchar *container_id, gchar *item_id, gchar *desc);
 EGwConnectionStatus e_gw_connection_purge_deleted_items (EGwConnection *cnc);
 EGwConnectionStatus e_gw_connection_purge_selected_items (EGwConnection *cnc, GList *item_ids);
 
 EGwConnectionStatus e_gw_connection_mark_read(EGwConnection *cnc, GList *item_ids) ;
 EGwConnectionStatus e_gw_connection_mark_unread(EGwConnection *cnc, GList *item_ids) ;
-EGwConnectionStatus e_gw_connection_reply_item (EGwConnection *cnc, const char *id, const char *view, EGwItem **item) ;
-EGwConnectionStatus e_gw_connection_forward_item (EGwConnection *cnc, const char *id, const char *view, gboolean embed, EGwItem **item);
-EGwConnectionStatus e_gw_connection_create_junk_entry (EGwConnection *cnc, const char *value, const char *match_type , const char *list_type);
-EGwConnectionStatus e_gw_connection_get_junk_settings (EGwConnection *cnc, int *use_junk, int *use_block, int *use_pab,  int *persistence);
-EGwConnectionStatus e_gw_connection_modify_junk_settings (EGwConnection *cnc, int use_junk, int use_block, int use_pab , int persistence);
+EGwConnectionStatus e_gw_connection_reply_item (EGwConnection *cnc, const gchar *id, const gchar *view, EGwItem **item) ;
+EGwConnectionStatus e_gw_connection_forward_item (EGwConnection *cnc, const gchar *id, const gchar *view, gboolean embed, EGwItem **item);
+EGwConnectionStatus e_gw_connection_create_junk_entry (EGwConnection *cnc, const gchar *value, const gchar *match_type , const gchar *list_type);
+EGwConnectionStatus e_gw_connection_get_junk_settings (EGwConnection *cnc, gint *use_junk, gint *use_block, gint *use_pab,  gint *persistence);
+EGwConnectionStatus e_gw_connection_modify_junk_settings (EGwConnection *cnc, gint use_junk, gint use_block, gint use_pab , gint persistence);
 EGwConnectionStatus e_gw_connection_get_junk_entries (EGwConnection *cnc, GList **entries);
-EGwConnectionStatus  e_gw_connection_remove_junk_entry (EGwConnection *cnc, const char *id);
-EGwConnectionStatus e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cursor, gboolean forward, int count, const char *cursor_seek, GList **list);
+EGwConnectionStatus  e_gw_connection_remove_junk_entry (EGwConnection *cnc, const gchar *id);
+EGwConnectionStatus e_gw_connection_read_cal_ids (EGwConnection *cnc, const gchar *container, gint cursor, gboolean forward, gint count, const gchar *cursor_seek, GList **list);
 EGwConnectionStatus e_gw_connection_get_proxy_access_list (EGwConnection *cnc, GList **proxy_list);
 EGwConnectionStatus e_gw_connection_add_proxy (EGwConnection *cnc, proxyHandler *new_proxy);
 EGwConnectionStatus e_gw_connection_remove_proxy (EGwConnection *cnc, proxyHandler *newProxy);
 EGwConnectionStatus e_gw_connection_modify_proxy (EGwConnection *cnc, proxyHandler *newProxy);
 EGwConnectionStatus e_gw_connection_get_proxy_list (EGwConnection *cnc, GList **proxy_info);
-EGwConnection *e_gw_connection_get_proxy_connection (EGwConnection *cnc1, char *username, const char *password, const char *proxy, int* permissions);
-EGwConnectionStatus e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const char *container, int cursor, gboolean forward, int count, const char *cursor_seek, GList **list);
+EGwConnection *e_gw_connection_get_proxy_connection (EGwConnection *cnc1, gchar *username, const gchar *password, const gchar *proxy, int* permissions);
+EGwConnectionStatus e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const gchar *container, gint cursor, gboolean forward, gint count, const gchar *cursor_seek, GList **list);
 
 G_END_DECLS
 
diff --git a/servers/groupwise/e-gw-container.c b/servers/groupwise/e-gw-container.c
index 8d8b9c6..4d2a911 100644
--- a/servers/groupwise/e-gw-container.c
+++ b/servers/groupwise/e-gw-container.c
@@ -29,15 +29,15 @@
 #include "e-gw-message.h"
 
 struct _EGwContainerPrivate {
-	char *name;
-	char *id;
-	char *parent;
+	gchar *name;
+	gchar *id;
+	gchar *parent;
 	guint32 unread ;
 	guint32 total ;
-	int sequence;
-	char *owner;
+	gint sequence;
+	gchar *owner;
 	GList *user_list;
-	char *modified;
+	gchar *modified;
 	EGwContainerType type ;
 	gboolean is_root ;
 	gboolean is_writable;
@@ -49,9 +49,9 @@ struct _EGwContainerPrivate {
 
 static GObjectClass *parent_class = NULL;
 
-static void e_gw_container_set_sequence (EGwContainer *container, int sequence);
-static void e_gw_container_set_modified (EGwContainer *container, const char *modified);
-static void e_gw_container_set_owner(EGwContainer *container, const char *owner);
+static void e_gw_container_set_sequence (EGwContainer *container, gint sequence);
+static void e_gw_container_set_modified (EGwContainer *container, const gchar *modified);
+static void e_gw_container_set_owner(EGwContainer *container, const gchar *owner);
 static void e_gw_container_set_is_shared_by_me (EGwContainer *container, gboolean is_shared_by_me);
 static void e_gw_container_set_is_shared_to_me (EGwContainer *container, gboolean is_shared_to_me);
 
@@ -189,9 +189,9 @@ e_gw_container_new_from_soap_parameter (SoupSoapParameter *param)
 gboolean
 e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParameter *param)
 {
-	char *value;
-	int int_value;
-	int rights = 0;
+	gchar *value;
+	gint int_value;
+	gint rights = 0;
 	gboolean byme = FALSE;
 	gboolean tome = FALSE;
 	SoupSoapParameter *subparam;
@@ -211,7 +211,7 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
 			e_gw_container_set_name (container, "");
 	} else {
 			value = soup_soap_parameter_get_string_value (subparam);
-			e_gw_container_set_name (container, (const char *) value);
+			e_gw_container_set_name (container, (const gchar *) value);
 			g_free (value);
 	}
 
@@ -221,7 +221,7 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
 			e_gw_container_set_id (container, "");
 	} else {
 			value = soup_soap_parameter_get_string_value (subparam);
-			e_gw_container_set_id (container, (const char *) value);
+			e_gw_container_set_id (container, (const gchar *) value);
 			g_free (value);
 	}
 
@@ -233,7 +233,7 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
 	} else {
 
 		value = soup_soap_parameter_get_string_value (subparam);
-		e_gw_container_set_parent_id (container, (const char *) value);
+		e_gw_container_set_parent_id (container, (const gchar *) value);
 		g_free (value) ;
 	}
 
@@ -396,7 +396,7 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
 
 		if (subparam) {
 			value = soup_soap_parameter_get_string_value (subparam);
-			e_gw_container_set_modified (container, (const char *) value);
+			e_gw_container_set_modified (container, (const gchar *) value);
 			g_free (value);
 		}
 
@@ -420,7 +420,7 @@ e_gw_container_get_user_list (EGwContainer *container, GList **user_list)
 
 }
 
-int
+gint
 e_gw_container_get_sequence (EGwContainer *container)
 {
 	g_return_val_if_fail (E_IS_GW_CONTAINER (container), 0);
@@ -429,22 +429,22 @@ e_gw_container_get_sequence (EGwContainer *container)
 }
 
 static  void
-e_gw_container_set_sequence (EGwContainer *container, int sequence)
+e_gw_container_set_sequence (EGwContainer *container, gint sequence)
 {
 	g_return_if_fail (E_IS_GW_CONTAINER (container));
 	container->priv->sequence = sequence;
 }
 
-const char *
+const gchar *
 e_gw_container_get_modified (EGwContainer *container)
 {
 	g_return_val_if_fail (E_IS_GW_CONTAINER (container), NULL);
 
-	return (const char *) container->priv->modified;
+	return (const gchar *) container->priv->modified;
 }
 
 static void
-e_gw_container_set_modified (EGwContainer *container, const char *modified)
+e_gw_container_set_modified (EGwContainer *container, const gchar *modified)
 {
 	EGwContainerPrivate *priv;
 
@@ -459,7 +459,7 @@ e_gw_container_set_modified (EGwContainer *container, const char *modified)
 }
 
 static void
-e_gw_container_set_owner(EGwContainer *container, const char *owner)
+e_gw_container_set_owner(EGwContainer *container, const gchar *owner)
 {
 	EGwContainerPrivate *priv;
 
@@ -472,15 +472,15 @@ e_gw_container_set_owner(EGwContainer *container, const char *owner)
 	container->priv->owner = g_strdup (owner);
 }
 
-const char *
+const gchar *
 e_gw_container_get_owner (EGwContainer *container)
 {
 	g_return_val_if_fail (E_GW_CONTAINER (container), NULL);
 
-	return (const char *) container->priv->owner;
+	return (const gchar *) container->priv->owner;
 }
 
-int
+gint
 e_gw_container_get_rights (EGwContainer *container, gchar *email)
 {
 	GList *user_list = NULL;
@@ -548,16 +548,16 @@ e_gw_container_set_is_system_folder (EGwContainer *container, gboolean is_system
 	container->priv->is_system_folder = is_system_folder;
 }
 
-const char *
+const gchar *
 e_gw_container_get_name (EGwContainer *container)
 {
 	g_return_val_if_fail (E_IS_GW_CONTAINER (container), NULL);
 
-	return (const char *) container->priv->name;
+	return (const gchar *) container->priv->name;
 }
 
 void
-e_gw_container_set_name (EGwContainer *container, const char *new_name)
+e_gw_container_set_name (EGwContainer *container, const gchar *new_name)
 {
 	EGwContainerPrivate *priv;
 
@@ -571,16 +571,16 @@ e_gw_container_set_name (EGwContainer *container, const char *new_name)
 	priv->name = g_strdup (new_name);
 }
 
-const char *
+const gchar *
 e_gw_container_get_id (EGwContainer *container)
 {
 	g_return_val_if_fail (E_IS_GW_CONTAINER (container), NULL);
 
-	return (const char *) container->priv->id;
+	return (const gchar *) container->priv->id;
 }
 
 void
-e_gw_container_set_id (EGwContainer *container, const char *new_id)
+e_gw_container_set_id (EGwContainer *container, const gchar *new_id)
 {
 	EGwContainerPrivate *priv;
 
@@ -594,16 +594,16 @@ e_gw_container_set_id (EGwContainer *container, const char *new_id)
 	priv->id = g_strdup (new_id);
 }
 
-const char *
+const gchar *
 e_gw_container_get_parent_id (EGwContainer *container)
 {
 	g_return_val_if_fail (E_IS_GW_CONTAINER (container), NULL);
 
-	return (const char *) container->priv->parent;
+	return (const gchar *) container->priv->parent;
 }
 
 void
-e_gw_container_set_parent_id (EGwContainer *container, const char *parent_id)
+e_gw_container_set_parent_id (EGwContainer *container, const gchar *parent_id)
 {
 	EGwContainerPrivate *priv ;
 
@@ -691,7 +691,7 @@ e_gw_container_get_container_type (EGwContainer *container)
  * flag = 0 :add to acl
  */
 void
-e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, const char *sub, const char *mesg, int flag)
+e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, const gchar *sub, const gchar *mesg, gint flag)
 {
 	gboolean add, edit, del;
 	gchar *email = NULL;
diff --git a/servers/groupwise/e-gw-container.h b/servers/groupwise/e-gw-container.h
index 9cfebcc..e198a6f 100644
--- a/servers/groupwise/e-gw-container.h
+++ b/servers/groupwise/e-gw-container.h
@@ -50,8 +50,8 @@ struct _EGwContainerClass {
 };
 
 struct _EShUsers {
-	char *email;
-	int rights;
+	gchar *email;
+	gint rights;
 };
 
 typedef enum {
@@ -75,12 +75,12 @@ GType         e_gw_container_get_type (void);
 EGwContainer *e_gw_container_new_from_soap_parameter (SoupSoapParameter *param);
 gboolean      e_gw_container_set_from_soap_parameter (EGwContainer *container,
 						      SoupSoapParameter *param);
-const char   *e_gw_container_get_name (EGwContainer *container);
-void          e_gw_container_set_name (EGwContainer *container, const char *new_name);
-const char   *e_gw_container_get_id (EGwContainer *container);
-void          e_gw_container_set_id (EGwContainer *container, const char *new_id);
-const char   *e_gw_container_get_parent_id (EGwContainer *container) ;
-void	      e_gw_container_set_parent_id (EGwContainer *container, const char *parent_id) ;
+const gchar   *e_gw_container_get_name (EGwContainer *container);
+void          e_gw_container_set_name (EGwContainer *container, const gchar *new_name);
+const gchar   *e_gw_container_get_id (EGwContainer *container);
+void          e_gw_container_set_id (EGwContainer *container, const gchar *new_id);
+const gchar   *e_gw_container_get_parent_id (EGwContainer *container) ;
+void	      e_gw_container_set_parent_id (EGwContainer *container, const gchar *parent_id) ;
 guint32       e_gw_container_get_total_count (EGwContainer *container) ;
 guint32       e_gw_container_get_unread_count (EGwContainer *container) ;
 gboolean      e_gw_container_get_is_writable (EGwContainer *container);
@@ -88,15 +88,15 @@ void          e_gw_container_set_is_writable (EGwContainer *container, gboolean
 gboolean     e_gw_container_get_is_frequent_contacts (EGwContainer *container);
 void         e_gw_container_set_is_frequent_contacts (EGwContainer *container, gboolean is_frequent_contacts);
 gboolean    e_gw_container_is_root (EGwContainer *container) ;
-const char *  e_gw_container_get_owner(EGwContainer *container);
-const char *  e_gw_container_get_modified(EGwContainer *container);
-int           e_gw_container_get_sequence(EGwContainer *container);
+const gchar *  e_gw_container_get_owner(EGwContainer *container);
+const gchar *  e_gw_container_get_modified(EGwContainer *container);
+gint           e_gw_container_get_sequence(EGwContainer *container);
 gboolean      e_gw_container_get_is_shared_by_me(EGwContainer *container);
 gboolean      e_gw_container_get_is_shared_to_me(EGwContainer *container);
 int	      e_gw_container_get_rights(EGwContainer *container, gchar *email);
 EGwContainerType e_gw_container_get_container_type (EGwContainer *container) ;
 void	      e_gw_container_get_user_list(EGwContainer *container, GList **user_list);
-void	      e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, const char *sub, const char *mesg, int flag);
+void	      e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, const gchar *sub, const gchar *mesg, gint flag);
 gboolean e_gw_container_get_is_system_folder (EGwContainer *container);
 void e_gw_container_set_is_system_folder (EGwContainer *container, gboolean is_system_folder);
 
diff --git a/servers/groupwise/e-gw-filter.c b/servers/groupwise/e-gw-filter.c
index efa93d6..2b673c0 100644
--- a/servers/groupwise/e-gw-filter.c
+++ b/servers/groupwise/e-gw-filter.c
@@ -31,24 +31,24 @@
 static GObjectClass *parent_class = NULL;
 
 struct _FilterComponent {
-	int operation;
-	char *field_name;
-	char *field_value;
-	int num_of_conditions;
+	gint operation;
+	gchar *field_name;
+	gchar *field_value;
+	gint num_of_conditions;
 };
 
 typedef struct _FilterComponent  FilterComponent;
 
 struct _EGwFilterPrivate {
 	GSList *component_list;
-	int  filter_group_type; /* stores, whether all condtions are to be met or any one of them*/
+	gint  filter_group_type; /* stores, whether all condtions are to be met or any one of them*/
 
 };
 
 
 
 void
-e_gw_filter_add_filter_component (EGwFilter *filter, EGwFilterOpType operation, const char *field_name, const char *field_value)
+e_gw_filter_add_filter_component (EGwFilter *filter, EGwFilterOpType operation, const gchar *field_name, const gchar *field_value)
 {
 	FilterComponent *component;
 
@@ -65,7 +65,7 @@ e_gw_filter_add_filter_component (EGwFilter *filter, EGwFilterOpType operation,
 }
 
 void
-e_gw_filter_group_conditions (EGwFilter *filter, EGwFilterOpType operation, int num_of_condtions)
+e_gw_filter_group_conditions (EGwFilter *filter, EGwFilterOpType operation, gint num_of_condtions)
 {
 	FilterComponent *component;
 
@@ -82,7 +82,7 @@ static void
 append_child_component (FilterComponent* filter_component, SoupSoapMessage *msg)
 {
 
-	char *operation_name;
+	gchar *operation_name;
 
 	g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
 	soup_soap_message_start_element (msg, "element", NULL, NULL);
@@ -143,8 +143,8 @@ static GSList*
 append_complex_component (GSList *component_list, SoupSoapMessage *msg)
 {
 	FilterComponent *filter_component;
-	int num_of_condtions;
-	int i;
+	gint num_of_condtions;
+	gint i;
 
 	filter_component = (FilterComponent* )component_list->data;
 	if (filter_component->operation == E_GW_FILTER_OP_AND || filter_component->operation == E_GW_FILTER_OP_OR
diff --git a/servers/groupwise/e-gw-filter.h b/servers/groupwise/e-gw-filter.h
index 354f968..9bc24c7 100644
--- a/servers/groupwise/e-gw-filter.h
+++ b/servers/groupwise/e-gw-filter.h
@@ -70,9 +70,9 @@ struct _EGwFilterClass {
 
 GType       e_gw_filter_get_type (void);
 EGwFilter*  e_gw_filter_new(void);
-void        e_gw_filter_add_filter_component (EGwFilter *filter, EGwFilterOpType operation, const char *field_name, const char *field_value);
+void        e_gw_filter_add_filter_component (EGwFilter *filter, EGwFilterOpType operation, const gchar *field_name, const gchar *field_value);
 void        e_gw_filter_append_to_soap_message (EGwFilter *filter, SoupSoapMessage *msg);
-void        e_gw_filter_group_conditions (EGwFilter *filter, EGwFilterOpType operation, int num_of_condtions);
+void        e_gw_filter_group_conditions (EGwFilter *filter, EGwFilterOpType operation, gint num_of_condtions);
 
 G_END_DECLS
 
diff --git a/servers/groupwise/e-gw-item.c b/servers/groupwise/e-gw-item.c
index a8395e2..27df1ce 100644
--- a/servers/groupwise/e-gw-item.c
+++ b/servers/groupwise/e-gw-item.c
@@ -34,45 +34,45 @@
 
 struct _EGwItemPrivate {
 	EGwItemType item_type;
-	char *container;
+	gchar *container;
 	GList *category_list; /*list of category ids*/
 
 	/* properties */
-	char *id;
-	char *creation_date;
-	char *delivered_date;
-	char *start_date;
-	char *end_date;
-	char *due_date;
-	char *completed_date;
-	char *modified_date;
+	gchar *id;
+	gchar *creation_date;
+	gchar *delivered_date;
+	gchar *start_date;
+	gchar *end_date;
+	gchar *due_date;
+	gchar *completed_date;
+	gchar *modified_date;
 	gboolean completed;
 	gboolean is_allday_event;
-	char *subject;
-	char *message;
-	char *classification;
-	char *accept_level;
-	char *priority;
-	char *task_priority;
-	char *place;
-	char *source ;
-	char *security;
+	gchar *subject;
+	gchar *message;
+	gchar *classification;
+	gchar *accept_level;
+	gchar *priority;
+	gchar *task_priority;
+	gchar *place;
+	gchar *source ;
+	gchar *security;
 	GSList *recipient_list;
 	GSList *recurrence_dates;
 	GSList *exdate_list;
 	EGwItemRecurrenceRule *rrule;
-	int recurrence_key;
-	int trigger; /* alarm */
+	gint recurrence_key;
+	gint trigger; /* alarm */
 	/*message size*/
-	int size;
+	gint size;
 	EGwItemOrganizer *organizer;
 
 	/*properties for mail*/
-	char *from ;
-	char *to ;
-	char *content_type ;
-	char *msg_body_id;
-	int item_status;
+	gchar *from ;
+	gchar *to ;
+	gchar *content_type ;
+	gchar *msg_body_id;
+	gint item_status;
 	/*Attachments*/
 	gboolean has_attachment;
 	GSList *attach_list ;
@@ -80,14 +80,14 @@ struct _EGwItemPrivate {
 	EGwItemLinkInfo *link_info;
 
 	/* properties for tasks/calendars */
-	char *icalid;
+	gchar *icalid;
 	/* if the self is not the organizer of the item, the
 	 * status is not reflected in the recipientStatus.
 	 * Hence it should be gleaned from the 'status' element
 	 * of the Mail, the parent item.*/
 	guint32 self_status;
 	/* properties for category items*/
-	char *category_name;
+	gchar *category_name;
 
 	/* properties for contacts */
 	FullName *full_name;
@@ -101,7 +101,7 @@ struct _EGwItemPrivate {
 
 	gboolean set_sendoptions;
 	/* Reply Request */
-	char *reply_within;
+	gchar *reply_within;
 	gboolean reply_request_set;
 
 	/* Status Tracking through sent Item */
@@ -116,10 +116,10 @@ struct _EGwItemPrivate {
 	EGwItemReturnNotify notify_deleted;
 
 	/* Expiration Date */
-	char *expires;
+	gchar *expires;
 
 	/* Delay delivery */
-	char *delay_until;
+	gchar *delay_until;
 
 	/* changes */
 	GHashTable *additions;
@@ -129,7 +129,7 @@ struct _EGwItemPrivate {
 	gboolean internet;
 
 	/*padding*/
-	unsigned int padding[10];
+	guint padding[10];
 };
 
 static GObjectClass *parent_class = NULL;
@@ -623,7 +623,7 @@ static void
 set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
         SoupSoapParameter *param_recipient;
-        char *email, *cn;
+        gchar *email, *cn;
 	EGwItemRecipient *recipient;
 	GList *email_list;
 
@@ -650,7 +650,7 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 
                 subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "distType");
                 if (subparam) {
-                        char *dist_type;
+                        gchar *dist_type;
                         dist_type = soup_soap_parameter_get_string_value (subparam);
                         if (!strcmp (dist_type, "TO"))
                                 recipient->type = E_GW_ITEM_RECIPIENT_TO;
@@ -670,7 +670,7 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 		 to none. */
 		subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "recipientStatus");
                 if (subparam) {
-			char *formatted_date, *value;
+			gchar *formatted_date, *value;
 			SoupSoapParameter *temp_param ;
 
 			recipient->status_enabled = TRUE;
@@ -733,7 +733,7 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 		else {
 			/* if recipientStatus is not provided, use the
 			 * self_status, obtained from the mail properties. */
-			if (!strcmp ((const char *)email_list->data, recipient->email))
+			if (!strcmp ((const gchar *)email_list->data, recipient->email))
 				recipient->status = item->priv->self_status & (E_GW_ITEM_STAT_DECLINED |
 										E_GW_ITEM_STAT_ACCEPTED);
 			else
@@ -744,12 +744,12 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
         }
 }
 static EGwItemReturnNotify
-get_notification_value (SoupSoapParameter *param, const char *param_name)
+get_notification_value (SoupSoapParameter *param, const gchar *param_name)
 {
 	SoupSoapParameter *subparam;
 
 	if ((subparam = soup_soap_parameter_get_first_child_by_name (param, param_name))) {
-		char *value = NULL;
+		gchar *value = NULL;
 
 		subparam = soup_soap_parameter_get_first_child_by_name (subparam, "mail");
 		if (subparam)
@@ -768,7 +768,7 @@ set_sendoptions_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
 	EGwItemPrivate *priv;
 	SoupSoapParameter *subparam, *child;
-	char *value = NULL;
+	gchar *value = NULL;
 
 	priv = item->priv;
 
@@ -787,7 +787,7 @@ set_sendoptions_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 			if (child)
 				value = soup_soap_parameter_get_string_value (child);
 			if (value) {
-				char *date;
+				gchar *date;
 				date = e_gw_connection_format_date_string (value);
 				priv->reply_request_set = TRUE;
 				priv->reply_within = date;
@@ -825,8 +825,8 @@ set_sendoptions_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 	}
 }
 
-char*
-e_gw_item_get_field_value (EGwItem *item, char *field_name)
+gchar *
+e_gw_item_get_field_value (EGwItem *item, gchar *field_name)
 {
 	gpointer value;
 
@@ -836,7 +836,7 @@ e_gw_item_get_field_value (EGwItem *item, char *field_name)
 	if (item->priv->simple_fields == NULL)
 		return NULL;
 
-	value =  (char *) g_hash_table_lookup (item->priv->simple_fields, field_name);
+	value =  (gchar *) g_hash_table_lookup (item->priv->simple_fields, field_name);
 	if (value)
 		return value;
 
@@ -844,7 +844,7 @@ e_gw_item_get_field_value (EGwItem *item, char *field_name)
 }
 
 void
-e_gw_item_set_field_value (EGwItem *item, char *field_name, char* field_value)
+e_gw_item_set_field_value (EGwItem *item, gchar *field_name, gchar * field_value)
 {
 	g_return_if_fail (field_name != NULL);
 	g_return_if_fail (field_name != NULL);
@@ -912,14 +912,14 @@ e_gw_item_set_member_list (EGwItem *item, GList *list)
 }
 
 void
-e_gw_item_set_address (EGwItem *item, char *address_type, PostalAddress *address)
+e_gw_item_set_address (EGwItem *item, gchar *address_type, PostalAddress *address)
 {
 	if (address_type && address)
 		g_hash_table_insert (item->priv->addresses, address_type, address);
 
 }
 
-PostalAddress *e_gw_item_get_address (EGwItem *item, char *address_type)
+PostalAddress *e_gw_item_get_address (EGwItem *item, gchar *address_type)
 {
 	return (PostalAddress *) g_hash_table_lookup (item->priv->addresses, address_type);
 }
@@ -938,18 +938,18 @@ e_gw_item_get_categories (EGwItem *item)
 }
 
 void
-e_gw_item_set_category_name (EGwItem *item, char *category_name)
+e_gw_item_set_category_name (EGwItem *item, gchar *category_name)
 {
 	item->priv->category_name = category_name;
 }
 
-char*
+gchar *
 e_gw_item_get_category_name (EGwItem *item)
 {
 	return item->priv->category_name;
 }
 
-void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, char *field_name, gpointer field_value)
+void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, gchar *field_name, gpointer field_value)
 {
 	GHashTable *hash_table;
 	EGwItemPrivate *priv;
@@ -982,7 +982,7 @@ set_common_addressbook_item_fields_from_soap_parameter (EGwItem *item, SoupSoapP
 {
 	SoupSoapParameter *subparam, *category_param;
 	GHashTable *simple_fields;
-	char *value;
+	gchar *value;
 	EGwItemPrivate *priv;
 	if (strcmp (soup_soap_parameter_get_name (param), "item") != 0) {
 		g_warning (G_STRLOC ": Invalid SOAP parameter %s", soup_soap_parameter_get_name (param));
@@ -1026,7 +1026,7 @@ set_common_addressbook_item_fields_from_soap_parameter (EGwItem *item, SoupSoapP
 
 			value = soup_soap_parameter_get_string_value (category_param);
 			if (value) {
-				char **components = g_strsplit (value, "@", -1);
+				gchar **components = g_strsplit (value, "@", -1);
 				g_free (value);
 				value = components[0];
 				priv->category_list = g_list_append (priv->category_list, g_strdup (value));
@@ -1044,7 +1044,7 @@ static void
 set_postal_address_from_soap_parameter (PostalAddress *address, SoupSoapParameter *param)
 {
 	SoupSoapParameter *subparam;
-	char *value;
+	gchar *value;
 
 	subparam= soup_soap_parameter_get_first_child_by_name (param, "streetAddress");
 	if (subparam) {
@@ -1094,9 +1094,9 @@ set_postal_address_from_soap_parameter (PostalAddress *address, SoupSoapParamete
 static void
 set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
-	char *value;
-        char *type;
-	char *primary_email;
+	gchar *value;
+        gchar *type;
+	gchar *primary_email;
 	SoupSoapParameter *subparam;
 	SoupSoapParameter *temp;
 	SoupSoapParameter *second_level_child;
@@ -1199,7 +1199,7 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 		g_hash_table_insert (simple_fields, "default_phone", soup_soap_parameter_get_property(subparam, "default"));
 		for ( temp = soup_soap_parameter_get_first_child (subparam); temp != NULL; temp = soup_soap_parameter_get_next_child (temp))
 			{
-				const char *key = NULL;
+				const gchar *key = NULL;
 
 				type =  soup_soap_parameter_get_property (temp, "type");
 				switch (*type) {
@@ -1226,7 +1226,7 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 
 				if (type) {
 					value = soup_soap_parameter_get_string_value (temp);
-					g_hash_table_insert (item->priv->simple_fields, (char*)key, value);
+					g_hash_table_insert (item->priv->simple_fields, (gchar *)key, value);
 					g_free (type);
 				}
 			}
@@ -1277,7 +1277,7 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 	subparam = soup_soap_parameter_get_first_child_by_name (param, "addressList");
 	if (subparam) {
 		for ( temp = soup_soap_parameter_get_first_child (subparam); temp != NULL; temp = soup_soap_parameter_get_next_child (temp)) {
-			const char *add = NULL;
+			const gchar *add = NULL;
 			address = g_new0 (PostalAddress, 1);
 			set_postal_address_from_soap_parameter (address, temp);
 			value = soup_soap_parameter_get_property(temp, "type");
@@ -1290,7 +1290,7 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 				add = "Other";
 
 			if (value)
-				g_hash_table_insert (item->priv->addresses, (char *) add, address);
+				g_hash_table_insert (item->priv->addresses, (gchar *) add, address);
 			else
 				free_postal_address (address);
 			g_free (value);
@@ -1303,7 +1303,7 @@ static void
 set_group_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
 
-	char *value;
+	gchar *value;
 	SoupSoapParameter *subparam, *temp, *second_level_child;
 	GHashTable *simple_fields;
 
@@ -1322,7 +1322,7 @@ set_group_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 
 	subparam = soup_soap_parameter_get_first_child_by_name (param, "members");
 	if (subparam) {
-		char *id, *email;
+		gchar *id, *email;
 		for ( temp = soup_soap_parameter_get_first_child (subparam); temp != NULL; temp = soup_soap_parameter_get_next_child (temp)) {
 			id = email = NULL;
 			second_level_child = soup_soap_parameter_get_first_child_by_name (temp, "email");
@@ -1353,7 +1353,7 @@ static void
 set_resource_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
 
-	char *value;
+	gchar *value;
 	SoupSoapParameter *subparam;
 	GHashTable *simple_fields;
 
@@ -1389,7 +1389,7 @@ static void
 set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
 
-	char *value;
+	gchar *value;
 	SoupSoapParameter *subparam;
 	PostalAddress *address;
 	GHashTable *simple_fields;
@@ -1439,7 +1439,7 @@ set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *p
 }
 
 static void
-append_postal_address_to_soap_message (SoupSoapMessage *msg, PostalAddress *address, char *address_type)
+append_postal_address_to_soap_message (SoupSoapMessage *msg, PostalAddress *address, gchar *address_type)
 {
 	soup_soap_message_start_element (msg, "address", NULL, NULL);
 	soup_soap_message_add_attribute (msg, "type", address_type, NULL, NULL);
@@ -1462,7 +1462,7 @@ append_postal_address_to_soap_message (SoupSoapMessage *msg, PostalAddress *addr
 static void
 append_common_addressbook_item_fields_to_soap_message (GHashTable *simple_fields, GList *category_list,  SoupSoapMessage *msg)
 {
-	char * value;
+	gchar * value;
 
 	value =  g_hash_table_lookup (simple_fields, "name");
 	if (value)
@@ -1484,7 +1484,7 @@ append_common_addressbook_item_fields_to_soap_message (GHashTable *simple_fields
 }
 
 static void
-append_full_name_to_soap_message (FullName *full_name, char *display_name, SoupSoapMessage *msg)
+append_full_name_to_soap_message (FullName *full_name, gchar *display_name, SoupSoapMessage *msg)
 {
 	g_return_if_fail (full_name != NULL);
 	soup_soap_message_start_element (msg, "fullName", NULL, NULL);
@@ -1538,7 +1538,7 @@ append_im_list_to_soap_message (GList *ims, SoupSoapMessage *msg)
 static void
 append_phone_list_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *msg)
 {
-	char *value;
+	gchar *value;
 
 	g_return_if_fail (simple_fields != NULL);
 
@@ -1569,8 +1569,8 @@ append_phone_list_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *m
 static void
 append_office_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *msg)
 {
-	char *value;
-	char *org_name;
+	gchar *value;
+	gchar *org_name;
 	g_return_if_fail (simple_fields != NULL);
 
 	soup_soap_message_start_element (msg, "officeInfo", NULL, NULL);
@@ -1598,7 +1598,7 @@ append_office_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *
 static void
 append_personal_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *msg)
 {
-	char *value;
+	gchar *value;
 
 	g_return_if_fail (simple_fields != NULL);
 
@@ -1617,7 +1617,7 @@ append_personal_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage
 static void
 append_contact_fields_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 {
-	char * value;
+	gchar * value;
 	GHashTable *simple_fields;
 	FullName *full_name;
 	PostalAddress *postal_address;
@@ -1686,10 +1686,10 @@ append_group_fields_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 }
 
 EGwItem *
-e_gw_item_new_from_soap_parameter (const char *email, const char *container, SoupSoapParameter *param)
+e_gw_item_new_from_soap_parameter (const gchar *email, const gchar *container, SoupSoapParameter *param)
 {
 	EGwItem *item;
-        char *item_type, *internet_prop;
+        gchar *item_type, *internet_prop;
 	SoupSoapParameter *subparameter, *child, *category_param, *attachment_param;
 	gboolean is_group_item = TRUE;
 	GList *user_email = NULL;
@@ -1779,8 +1779,8 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 	for (child = soup_soap_parameter_get_first_child (subparameter);
 			child != NULL;
 			child = soup_soap_parameter_get_next_child (child)) {
-		const char *name;
-		char *value = NULL;
+		const gchar *name;
+		gchar *value = NULL;
 
 		name = soup_soap_parameter_get_name (child);
 
@@ -1813,7 +1813,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 
 		} else if (!g_ascii_strcasecmp (name, "status")) {
 			SoupSoapParameter *status_param;
-			const char *status_name;
+			const gchar *status_name;
 			item->priv->self_status = 0;
 			for (status_param = soup_soap_parameter_get_first_child (child); status_param != NULL;
 					status_param = soup_soap_parameter_get_next_child (status_param)) {
@@ -1840,7 +1840,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 			}
 
 		} else if (!g_ascii_strcasecmp (name, "created")) {
-			char *formatted_date;
+			gchar *formatted_date;
 			value = soup_soap_parameter_get_string_value (child);
 			formatted_date = e_gw_connection_format_date_string (value);
 			e_gw_item_set_creation_date (item, formatted_date);
@@ -1848,7 +1848,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 			g_free (formatted_date);
 
 		} else if (!g_ascii_strcasecmp (name, "delivered")) {
-			char *formatted_date;
+			gchar *formatted_date;
 			value = soup_soap_parameter_get_string_value (child);
 			formatted_date = e_gw_connection_format_date_string (value);
 			e_gw_item_set_delivered_date (item, formatted_date);
@@ -1856,7 +1856,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 			g_free (formatted_date);
 
 		} else if (!g_ascii_strcasecmp (name, "modified")) {
-			char *formatted_date;
+			gchar *formatted_date;
 			value = soup_soap_parameter_get_string_value (child);
 			formatted_date = e_gw_connection_format_date_string (value);
 			e_gw_item_set_modified_date (item, formatted_date);
@@ -1918,7 +1918,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 			g_free (value), value = NULL;
 
 		} else if (!g_ascii_strcasecmp (name, "dueDate")) {
-			char *formatted_date;
+			gchar *formatted_date;
 			value = soup_soap_parameter_get_string_value (child);
 			formatted_date = e_gw_connection_format_date_string (value);
 			e_gw_item_set_due_date (item, formatted_date);
@@ -1926,7 +1926,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 			g_free (formatted_date);
 
 		} else if (!g_ascii_strcasecmp (name, "endDate") || !g_ascii_strcasecmp (name, "endDay")) {
-			char *formatted_date;
+			gchar *formatted_date;
 			value = soup_soap_parameter_get_string_value (child);
 			formatted_date = e_gw_connection_format_date_string (value);
 			e_gw_item_set_end_date (item, formatted_date);
@@ -1934,7 +1934,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 			g_free (formatted_date);
 
 		} else if (!g_ascii_strcasecmp (name, "to")) {
-			char *to ;
+			gchar *to ;
 			to = soup_soap_parameter_get_string_value (child) ;
 			e_gw_item_set_to (item, to);
 			g_free (to);
@@ -1948,7 +1948,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 
 				value = soup_soap_parameter_get_string_value (category_param);
 				if (value) {
-					char **components = g_strsplit (value, "@", -1);
+					gchar **components = g_strsplit (value, "@", -1);
 					g_free (value);
 					value = components[0];
 					item->priv->category_list = g_list_append (item->priv->category_list, g_strdup (value));
@@ -1963,8 +1963,8 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 		else if (!g_ascii_strcasecmp (name, "message")) {
 			SoupSoapParameter *part;
 			gsize len;
-			char *msg;
-			char *length;
+			gchar *msg;
+			gchar *length;
 
 			part = soup_soap_parameter_get_first_child_by_name (child, "part");
 			msg = soup_soap_parameter_get_string_value (part);
@@ -2031,7 +2031,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 			item->priv->place = soup_soap_parameter_get_string_value (child);
 
 		else if (!g_ascii_strcasecmp (name, "taskPriority")) {
-			char *priority;
+			gchar *priority;
 
 			priority = soup_soap_parameter_get_string_value (child);
 			e_gw_item_set_task_priority (item, priority);
@@ -2039,7 +2039,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 		}
 
 		else if (!g_ascii_strcasecmp (name, "startDate") || !g_ascii_strcasecmp (name, "startDay")) {
-			char *formatted_date;
+			gchar *formatted_date;
 			value = soup_soap_parameter_get_string_value (child);
 			formatted_date = e_gw_connection_format_date_string (value);
 			e_gw_item_set_start_date (item, formatted_date);
@@ -2075,7 +2075,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 			e_gw_item_set_link_info (item, info);
 
 		} else if (!g_ascii_strcasecmp (name, "alarm")) {
-			char *enabled;
+			gchar *enabled;
 			enabled = soup_soap_parameter_get_property (child, "enabled");
 			if (enabled && !g_ascii_strcasecmp (enabled, "1") ) {
 				value = soup_soap_parameter_get_string_value (child);
@@ -2107,16 +2107,16 @@ e_gw_item_set_item_type (EGwItem *item, EGwItemType new_type)
 	item->priv->item_type = new_type;
 }
 
-const char *
+const gchar *
 e_gw_item_get_container_id (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->container;
+	return (const gchar *) item->priv->container;
 }
 
 void
-e_gw_item_set_container_id (EGwItem *item, const char *new_id)
+e_gw_item_set_container_id (EGwItem *item, const gchar *new_id)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2125,16 +2125,16 @@ e_gw_item_set_container_id (EGwItem *item, const char *new_id)
 	item->priv->container = g_strdup (new_id);
 }
 
-const char *
+const gchar *
 e_gw_item_get_icalid (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->icalid;
+	return (const gchar *) item->priv->icalid;
 }
 
 void
-e_gw_item_set_icalid (EGwItem *item, const char *new_icalid)
+e_gw_item_set_icalid (EGwItem *item, const gchar *new_icalid)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2143,16 +2143,16 @@ e_gw_item_set_icalid (EGwItem *item, const char *new_icalid)
 	item->priv->icalid = g_strdup (new_icalid);
 }
 
-const char *
+const gchar *
 e_gw_item_get_id (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->id;
+	return (const gchar *) item->priv->id;
 }
 
 void
-e_gw_item_set_id (EGwItem *item, const char *new_id)
+e_gw_item_set_id (EGwItem *item, const gchar *new_id)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2161,7 +2161,7 @@ e_gw_item_set_id (EGwItem *item, const char *new_id)
 	item->priv->id = g_strdup (new_id);
 }
 
-int
+gint
 e_gw_item_get_mail_size (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), 0);
@@ -2185,7 +2185,7 @@ e_gw_item_is_from_internet (EGwItem *item)
 	return item->priv->internet;
 }
 
-char *
+gchar *
 e_gw_item_get_creation_date (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2194,7 +2194,7 @@ e_gw_item_get_creation_date (EGwItem *item)
 }
 
 void
-e_gw_item_set_creation_date (EGwItem *item, const char *new_date)
+e_gw_item_set_creation_date (EGwItem *item, const gchar *new_date)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2203,7 +2203,7 @@ e_gw_item_set_creation_date (EGwItem *item, const char *new_date)
 	item->priv->creation_date = g_strdup (new_date);
 }
 
-char *
+gchar *
 e_gw_item_get_delivered_date (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2212,7 +2212,7 @@ e_gw_item_get_delivered_date (EGwItem *item)
 }
 
 void
-e_gw_item_set_delivered_date (EGwItem *item, const char *new_date)
+e_gw_item_set_delivered_date (EGwItem *item, const gchar *new_date)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2221,7 +2221,7 @@ e_gw_item_set_delivered_date (EGwItem *item, const char *new_date)
 	item->priv->delivered_date = g_strdup (new_date);
 }
 
-const char *
+const gchar *
 e_gw_item_get_modified_date (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2230,7 +2230,7 @@ e_gw_item_get_modified_date (EGwItem *item)
 }
 
 void
-e_gw_item_set_modified_date (EGwItem *item, const char *new_date)
+e_gw_item_set_modified_date (EGwItem *item, const gchar *new_date)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2239,7 +2239,7 @@ e_gw_item_set_modified_date (EGwItem *item, const char *new_date)
 	item->priv->modified_date = g_strdup (new_date);
 }
 
-char *
+gchar *
 e_gw_item_get_start_date (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2248,7 +2248,7 @@ e_gw_item_get_start_date (EGwItem *item)
 }
 
 void
-e_gw_item_set_start_date (EGwItem *item, const char *new_date)
+e_gw_item_set_start_date (EGwItem *item, const gchar *new_date)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2257,7 +2257,7 @@ e_gw_item_set_start_date (EGwItem *item, const char *new_date)
 	item->priv->start_date = g_strdup (new_date);
 }
 
-char *
+gchar *
 e_gw_item_get_end_date (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2266,7 +2266,7 @@ e_gw_item_get_end_date (EGwItem *item)
 }
 
 void
-e_gw_item_set_end_date (EGwItem *item, const char *new_date)
+e_gw_item_set_end_date (EGwItem *item, const gchar *new_date)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2275,7 +2275,7 @@ e_gw_item_set_end_date (EGwItem *item, const char *new_date)
 	item->priv->end_date = g_strdup (new_date);
 }
 
-char *
+gchar *
 e_gw_item_get_due_date (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2284,7 +2284,7 @@ e_gw_item_get_due_date (EGwItem *item)
 }
 
 void
-e_gw_item_set_due_date (EGwItem *item, const char *new_date)
+e_gw_item_set_due_date (EGwItem *item, const gchar *new_date)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2293,7 +2293,7 @@ e_gw_item_set_due_date (EGwItem *item, const char *new_date)
 	item->priv->due_date = g_strdup (new_date);
 }
 
-char *
+gchar *
 e_gw_item_get_completed_date (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2302,7 +2302,7 @@ e_gw_item_get_completed_date (EGwItem *item)
 }
 
 void
-e_gw_item_set_completed_date (EGwItem *item, const char *new_date)
+e_gw_item_set_completed_date (EGwItem *item, const gchar *new_date)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2311,16 +2311,16 @@ e_gw_item_set_completed_date (EGwItem *item, const char *new_date)
 	item->priv->completed_date = g_strdup (new_date);
 }
 
-const char *
+const gchar *
 e_gw_item_get_subject (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->subject;
+	return (const gchar *) item->priv->subject;
 }
 
 void
-e_gw_item_set_subject (EGwItem *item, const char *new_subject)
+e_gw_item_set_subject (EGwItem *item, const gchar *new_subject)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2329,16 +2329,16 @@ e_gw_item_set_subject (EGwItem *item, const char *new_subject)
 	item->priv->subject = g_strdup (new_subject);
 }
 
-const char *
+const gchar *
 e_gw_item_get_message (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->message;
+	return (const gchar *) item->priv->message;
 }
 
 void
-e_gw_item_set_message (EGwItem *item, const char *new_message)
+e_gw_item_set_message (EGwItem *item, const gchar *new_message)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2347,7 +2347,7 @@ e_gw_item_set_message (EGwItem *item, const char *new_message)
 	item->priv->message = g_strdup (new_message);
 }
 
-const char *
+const gchar *
 e_gw_item_get_place (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2356,7 +2356,7 @@ e_gw_item_get_place (EGwItem *item)
 }
 
 void
-e_gw_item_set_place (EGwItem *item, const char *new_place)
+e_gw_item_set_place (EGwItem *item, const gchar *new_place)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2365,16 +2365,16 @@ e_gw_item_set_place (EGwItem *item, const char *new_place)
 	item->priv->place = g_strdup (new_place);
 }
 
-const char *
+const gchar *
 e_gw_item_get_classification (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->classification;
+	return (const gchar *) item->priv->classification;
 }
 
 void
-e_gw_item_set_classification (EGwItem *item, const char *new_class)
+e_gw_item_set_classification (EGwItem *item, const gchar *new_class)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2383,16 +2383,16 @@ e_gw_item_set_classification (EGwItem *item, const char *new_class)
 	item->priv->classification = g_strdup (new_class);
 }
 
-const char *
+const gchar *
 e_gw_item_get_security (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->security;
+	return (const gchar *) item->priv->security;
 }
 
 void
-e_gw_item_set_security (EGwItem *item, const char *new_class)
+e_gw_item_set_security (EGwItem *item, const gchar *new_class)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2433,16 +2433,16 @@ e_gw_item_set_is_allday_event (EGwItem *item, gboolean allday_event)
 	item->priv->is_allday_event = allday_event;
 }
 
-const char *
+const gchar *
 e_gw_item_get_accept_level (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->accept_level;
+	return (const gchar *) item->priv->accept_level;
 }
 
 void
-e_gw_item_set_accept_level (EGwItem *item, const char *new_level)
+e_gw_item_set_accept_level (EGwItem *item, const gchar *new_level)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2451,15 +2451,15 @@ e_gw_item_set_accept_level (EGwItem *item, const char *new_level)
 	item->priv->accept_level = g_strdup (new_level);
 }
 
-const char *
+const gchar *
 e_gw_item_get_priority (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
-	return (const char *) item->priv->priority;
+	return (const gchar *) item->priv->priority;
 }
 
 void
-e_gw_item_set_priority (EGwItem *item, const char *new_priority)
+e_gw_item_set_priority (EGwItem *item, const gchar *new_priority)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2468,16 +2468,16 @@ e_gw_item_set_priority (EGwItem *item, const char *new_priority)
 	item->priv->priority = g_strdup (new_priority);
 }
 
-const char *
+const gchar *
 e_gw_item_get_task_priority (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
 
-	return (const char *) item->priv->task_priority;
+	return (const gchar *) item->priv->task_priority;
 }
 
 void
-e_gw_item_set_task_priority (EGwItem *item, const char *new_priority)
+e_gw_item_set_task_priority (EGwItem *item, const gchar *new_priority)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2588,7 +2588,7 @@ e_gw_item_set_rrule (EGwItem  *item, EGwItemRecurrenceRule *new_rrule)
 	item->priv->rrule = new_rrule;
 }
 
-int
+gint
 e_gw_item_get_recurrence_key (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), 0);
@@ -2596,12 +2596,12 @@ e_gw_item_get_recurrence_key (EGwItem *item)
 }
 
 void
-e_gw_item_set_recurrence_key (EGwItem *item, int recur_key)
+e_gw_item_set_recurrence_key (EGwItem *item, gint recur_key)
 {
 	item->priv->recurrence_key = recur_key;
 }
 
-int
+gint
 e_gw_item_get_trigger (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), 0);
@@ -2610,7 +2610,7 @@ e_gw_item_get_trigger (EGwItem *item)
 }
 
 void
-e_gw_item_set_trigger (EGwItem *item, int trigger)
+e_gw_item_set_trigger (EGwItem *item, gint trigger)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2619,27 +2619,27 @@ e_gw_item_set_trigger (EGwItem *item, int trigger)
 
 
 void
-e_gw_item_set_to (EGwItem *item, const char *to)
+e_gw_item_set_to (EGwItem *item, const gchar *to)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 	item->priv->to = g_strdup (to) ;
 }
 
-const char *
+const gchar *
 e_gw_item_get_to (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM(item), NULL) ;
 	return item->priv->to ;
 }
 
-const char *
+const gchar *
 e_gw_item_get_msg_content_type (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL) ;
 	return item->priv->content_type ;
 }
 
-const char *
+const gchar *
 e_gw_item_get_msg_body_id (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2672,14 +2672,14 @@ e_gw_item_get_reply_request (EGwItem *item)
 }
 
 void
-e_gw_item_set_reply_within (EGwItem *item, char *reply_within)
+e_gw_item_set_reply_within (EGwItem *item, gchar *reply_within)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
 	item->priv->reply_within = g_strdup (reply_within);
 }
 
-char *
+gchar *
 e_gw_item_get_reply_within (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2801,14 +2801,14 @@ e_gw_item_get_notify_deleted (EGwItem *item)
 }
 
 void
-e_gw_item_set_expires (EGwItem *item, char *expires)
+e_gw_item_set_expires (EGwItem *item, gchar *expires)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
 	item->priv->expires = g_strdup (expires);
 }
 
-char *
+gchar *
 e_gw_item_get_expires (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2817,14 +2817,14 @@ e_gw_item_get_expires (EGwItem *item)
 }
 
 void
-e_gw_item_set_delay_until (EGwItem *item, char *delay_until)
+e_gw_item_set_delay_until (EGwItem *item, gchar *delay_until)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
 	item->priv->delay_until = g_strdup (delay_until);
 }
 
-char *
+gchar *
 e_gw_item_get_delay_until (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2833,14 +2833,14 @@ e_gw_item_get_delay_until (EGwItem *item)
 }
 
 void
-e_gw_item_set_source (EGwItem *item, char *source)
+e_gw_item_set_source (EGwItem *item, gchar *source)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 	item->priv->source = g_strdup (source);
 }
 
 void
-e_gw_item_set_content_type (EGwItem *item, const char *content_type)
+e_gw_item_set_content_type (EGwItem *item, const gchar *content_type)
 {
 	g_return_if_fail (E_IS_GW_ITEM (item));
 
@@ -2849,7 +2849,7 @@ e_gw_item_set_content_type (EGwItem *item, const char *content_type)
 	item->priv->content_type= g_strdup (content_type);
 }
 
-char *
+gchar *
 e_gw_item_get_content_type (EGwItem *item)
 {
 	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
@@ -2872,7 +2872,7 @@ e_gw_item_get_link_info (EGwItem *item)
 }
 
 static void
-add_return_notification (SoupSoapMessage *msg, char *option, EGwItemReturnNotify value)
+add_return_notification (SoupSoapMessage *msg, gchar *option, EGwItemReturnNotify value)
 {
 	soup_soap_message_start_element (msg, option, NULL, NULL);
 
@@ -2935,8 +2935,8 @@ e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 	soup_soap_message_start_element (msg, "recipients", NULL, NULL);
 	/* add each recipient */
 	for (rl = recipient_list; rl != NULL; rl = rl->next) {
-		char *dist_type;
-		char *status = NULL;
+		gchar *dist_type;
+		gchar *status = NULL;
 
 		EGwItemRecipient *recipient = (EGwItemRecipient *) rl->data;
 
@@ -3025,7 +3025,7 @@ e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 static void
 add_attachment_to_soap_message(EGwItemAttachment *attachment, SoupSoapMessage *msg)
 {
-	char *size = NULL;
+	gchar *size = NULL;
 
 	soup_soap_message_start_element (msg, "attachment", NULL, NULL) ;
 
@@ -3069,7 +3069,7 @@ static void
 e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 {
 	EGwItemPrivate *priv = item->priv;
-	char *dtstring;
+	gchar *dtstring;
 
 	if (priv->id)
 		e_gw_message_write_string_parameter (msg, "id", NULL, priv->id);
@@ -3097,7 +3097,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 
 	soup_soap_message_start_element (msg, "message", NULL, NULL);
 	if (priv->message) {
-		char *str;
+		gchar *str;
 
 		str = g_base64_encode (priv->message, strlen (priv->message));
 		dtstring = g_strdup_printf ("%d", (int)strlen (str));
@@ -3146,17 +3146,17 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 
 		/* byDay */
 		if (rrule->by_day[0]) {
-			int i, max_elements;
+			gint i, max_elements;
 			soup_soap_message_start_element (msg, "byDay", NULL, NULL);
 			max_elements = sizeof (rrule->by_day) / sizeof (rrule->by_day[0]);
 			/* expand into  a sequence of 'day' here  */
 			for (i = 0; i < max_elements && rrule->by_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
-				const char *dow = e_gw_recur_get_day_of_week (rrule->by_day [i]);
+				const gchar *dow = e_gw_recur_get_day_of_week (rrule->by_day [i]);
 
 				if (rrule->by_setpos [i] == E_GW_ITEM_RECUR_END_MARKER)
 					e_gw_message_write_string_parameter (msg, "day", NULL, dow);
 				else {
-					char occur [3];
+					gchar occur [3];
 
 					g_sprintf (occur, "%d", rrule->by_setpos [i]);
 					e_gw_message_write_string_parameter_with_attribute (msg, "day", NULL, dow, "occurrence", occur);
@@ -3167,8 +3167,8 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 
 		/* byMonthDay*/
 		if (rrule->by_month_day) {
-			int i, max_elements;
-			char month_day[3];
+			gint i, max_elements;
+			gchar month_day[3];
 
 			soup_soap_message_start_element (msg, "byMonthDay", NULL, NULL);
 			max_elements = sizeof (rrule->by_month_day)  / sizeof (rrule->by_month_day [i]);
@@ -3183,8 +3183,8 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 		}
 		/* byYearDay */
 	if (rrule->by_year_day) {
-			int i, max_elements;
-			char year_day[4];
+			gint i, max_elements;
+			gchar year_day[4];
 			soup_soap_message_start_element (msg, "byYearDay", NULL, NULL);
 			max_elements = sizeof (rrule->by_year_day)  / sizeof (rrule->by_year_day [i]);
 			/* expand into  a sequence of 'day' here  */
@@ -3198,8 +3198,8 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 		}
 		/* byMonth */
 		if (rrule->by_month) {
-			int i, max_elements;
-			char month[3];
+			gint i, max_elements;
+			gchar month[3];
 			soup_soap_message_start_element (msg, "byMonth", NULL, NULL);
 			max_elements = sizeof (rrule->by_month)  / sizeof (rrule->by_month [i]);
 			/* expand into  a sequence of 'month' here  */
@@ -3217,7 +3217,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 		GSList *date;
 		soup_soap_message_start_element (msg, "rdate", NULL, NULL);
 		for (date = item->priv->recurrence_dates; date != NULL; date = g_slist_next (date)) {
-			e_gw_message_write_string_parameter (msg, "date", NULL, (char *) date->data);
+			e_gw_message_write_string_parameter (msg, "date", NULL, (gchar *) date->data);
 		}
 		soup_soap_message_end_element (msg);
 	}
@@ -3226,7 +3226,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 		GSList *date;
 		soup_soap_message_start_element (msg, "exdate", NULL, NULL);
 		for (date = item->priv->exdate_list; date != NULL; date = g_slist_next (date)) {
-			e_gw_message_write_string_parameter (msg, "date", NULL, (char *) date->data);
+			e_gw_message_write_string_parameter (msg, "date", NULL, (gchar *) date->data);
 		}
 		soup_soap_message_end_element (msg);
 	}
@@ -3249,7 +3249,7 @@ gboolean
 e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 {
 	EGwItemPrivate *priv;
-	char *alarm;
+	gchar *alarm;
 
 	g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
 	g_return_val_if_fail (SOUP_IS_SOAP_MESSAGE (msg), FALSE);
@@ -3284,8 +3284,8 @@ e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 		/*message*/
 		soup_soap_message_start_element (msg, "message", NULL, NULL);
 		if (priv->message) {
-			char *str ;
-			char *str_len ;
+			gchar *str ;
+			gchar *str_len ;
 
 			str = g_base64_encode (priv->message, strlen (priv->message));
 			/*str = g_strdup (priv->message);*/
@@ -3410,12 +3410,12 @@ e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 
 
 static void
-append_contact_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int change_type)
+append_contact_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, gint change_type)
 {
 	GHashTable *changes;
 	EGwItemPrivate *priv;
 	FullName *full_name;
-	char *value;
+	gchar *value;
 	GList *list;
 	PostalAddress *postal_address;
 
@@ -3469,7 +3469,7 @@ append_contact_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int
 }
 
 static void
-append_event_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int change_type)
+append_event_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, gint change_type)
 {
 	GHashTable *changes;
 	EGwItemPrivate *priv;
@@ -3527,7 +3527,7 @@ append_event_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int c
 	if (g_hash_table_lookup (changes, "message")) {
 		soup_soap_message_start_element (msg, "message", NULL, NULL);
 		if (priv->message) {
-			char *str, *message;
+			gchar *str, *message;
 
 			str = g_base64_encode (priv->message, strlen (priv->message));
 			message = g_strdup_printf ("%d", (int)strlen (str));
@@ -3553,7 +3553,7 @@ append_event_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int c
 		e_gw_message_write_string_parameter (msg, "place", NULL, priv->place ? priv->place : "");
 	if (g_hash_table_lookup (changes, "alarm")) {
 		if (priv->trigger != 0) {
-			char *alarm = g_strdup_printf ("%d", priv->trigger);
+			gchar *alarm = g_strdup_printf ("%d", priv->trigger);
 			e_gw_message_write_string_parameter_with_attribute (msg, "alarm", NULL, alarm, "enabled", "1");
 			g_free (alarm);
 		}
@@ -3572,7 +3572,7 @@ gboolean
 e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 {
 	EGwItemPrivate *priv;
-	char *value;
+	gchar *value;
 	g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
 	g_return_val_if_fail (SOUP_IS_SOAP_MESSAGE (msg), FALSE);
 
diff --git a/servers/groupwise/e-gw-item.h b/servers/groupwise/e-gw-item.h
index 3e610e2..18ffa7a 100644
--- a/servers/groupwise/e-gw-item.h
+++ b/servers/groupwise/e-gw-item.h
@@ -88,48 +88,48 @@ struct _EGwItemClass {
 
 /* structures defined to hold contact item fields */
 typedef struct {
-	char *name_prefix;
-	char *first_name;
-	char *middle_name;
-	char *last_name;
-	char *name_suffix;
+	gchar *name_prefix;
+	gchar *first_name;
+	gchar *middle_name;
+	gchar *last_name;
+	gchar *name_suffix;
 } FullName;
 
 typedef struct {
-	char *street_address;
-	char *location;
-	char *city;
-	char *state;
-	char *postal_code;
-	char *country;
+	gchar *street_address;
+	gchar *location;
+	gchar *city;
+	gchar *state;
+	gchar *postal_code;
+	gchar *country;
 } PostalAddress;
 
 typedef struct {
 
-	char *service;
-	char *address;
+	gchar *service;
+	gchar *address;
 }IMAddress;
 
 typedef struct {
-	char *id;
-	char *email;
-	char *name;
+	gchar *id;
+	gchar *email;
+	gchar *name;
 } EGroupMember;
 
 typedef struct {
-	char *email;
-	char *display_name;
+	gchar *email;
+	gchar *display_name;
 } EGwItemOrganizer;
 
 typedef struct {
-	char *id ;
-	char *name ;
-	char *item_reference;
-	char *contentid;
-	char *contentType ;
-	int size ;
-	char *date ;
-	char *data ;
+	gchar *id ;
+	gchar *name ;
+	gchar *item_reference;
+	gchar *contentid;
+	gchar *contentType ;
+	gint size ;
+	gchar *date ;
+	gchar *data ;
 	gboolean hidden;
 } EGwItemAttachment ;
 
@@ -146,88 +146,88 @@ typedef enum {
 } EGwItemTrack;
 
 typedef struct {
-	char *id;
-	char *type;
-	char *thread;
+	gchar *id;
+	gchar *type;
+	gchar *thread;
 } EGwItemLinkInfo;
 
 typedef struct {
-	char *item_id;
-	char *ical_id;
-	char *recur_key;
+	gchar *item_id;
+	gchar *ical_id;
+	gchar *recur_key;
 } EGwItemCalId;
 
 GType       e_gw_item_get_type (void);
 EGwItem    *e_gw_item_new_empty (void);
-EGwItem    *e_gw_item_new_from_soap_parameter (const char *email, const char *container, SoupSoapParameter *param);
+EGwItem    *e_gw_item_new_from_soap_parameter (const gchar *email, const gchar *container, SoupSoapParameter *param);
 
 EGwItemType e_gw_item_get_item_type (EGwItem *item);
 void        e_gw_item_set_item_type (EGwItem *item, EGwItemType new_type);
-const char *e_gw_item_get_container_id (EGwItem *item);
-void        e_gw_item_set_container_id (EGwItem *item, const char *new_id);
-const char *e_gw_item_get_icalid (EGwItem *item);
-void        e_gw_item_set_icalid (EGwItem *item, const char *new_icalid);
-const char *e_gw_item_get_id (EGwItem *item);
-void        e_gw_item_set_id (EGwItem *item, const char *new_id);
-char       *e_gw_item_get_creation_date (EGwItem *item);
-void        e_gw_item_set_creation_date (EGwItem *item, const char *new_date);
-char       *e_gw_item_get_delivered_date (EGwItem *item);
-void        e_gw_item_set_delivered_date (EGwItem *item, const char *new_date);
-const char  *e_gw_item_get_modified_date (EGwItem *item);
-void        e_gw_item_set_modified_date (EGwItem *item, const char *new_date);
-char       *e_gw_item_get_start_date (EGwItem *item);
-void        e_gw_item_set_start_date (EGwItem *item, const char *new_date);
-char       *e_gw_item_get_completed_date (EGwItem *item);
-void        e_gw_item_set_completed_date (EGwItem *item, const char *new_date);
-char       *e_gw_item_get_end_date (EGwItem *item);
-void        e_gw_item_set_end_date (EGwItem *item, const char *new_date);
-char       *e_gw_item_get_due_date (EGwItem *item);
-void        e_gw_item_set_due_date (EGwItem *item, const char *new_date);
-const char *e_gw_item_get_subject (EGwItem *item);
-void        e_gw_item_set_subject (EGwItem *item, const char *new_subject);
-const char *e_gw_item_get_message (EGwItem *item);
-void        e_gw_item_set_message (EGwItem *item, const char *new_message);
-const char *e_gw_item_get_place (EGwItem *item);
-void        e_gw_item_set_place (EGwItem *item, const char *new_place);
-const char *e_gw_item_get_security (EGwItem *item);
-void        e_gw_item_set_security (EGwItem *item, const char *new_class);
+const gchar *e_gw_item_get_container_id (EGwItem *item);
+void        e_gw_item_set_container_id (EGwItem *item, const gchar *new_id);
+const gchar *e_gw_item_get_icalid (EGwItem *item);
+void        e_gw_item_set_icalid (EGwItem *item, const gchar *new_icalid);
+const gchar *e_gw_item_get_id (EGwItem *item);
+void        e_gw_item_set_id (EGwItem *item, const gchar *new_id);
+gchar       *e_gw_item_get_creation_date (EGwItem *item);
+void        e_gw_item_set_creation_date (EGwItem *item, const gchar *new_date);
+gchar       *e_gw_item_get_delivered_date (EGwItem *item);
+void        e_gw_item_set_delivered_date (EGwItem *item, const gchar *new_date);
+const gchar  *e_gw_item_get_modified_date (EGwItem *item);
+void        e_gw_item_set_modified_date (EGwItem *item, const gchar *new_date);
+gchar       *e_gw_item_get_start_date (EGwItem *item);
+void        e_gw_item_set_start_date (EGwItem *item, const gchar *new_date);
+gchar       *e_gw_item_get_completed_date (EGwItem *item);
+void        e_gw_item_set_completed_date (EGwItem *item, const gchar *new_date);
+gchar       *e_gw_item_get_end_date (EGwItem *item);
+void        e_gw_item_set_end_date (EGwItem *item, const gchar *new_date);
+gchar       *e_gw_item_get_due_date (EGwItem *item);
+void        e_gw_item_set_due_date (EGwItem *item, const gchar *new_date);
+const gchar *e_gw_item_get_subject (EGwItem *item);
+void        e_gw_item_set_subject (EGwItem *item, const gchar *new_subject);
+const gchar *e_gw_item_get_message (EGwItem *item);
+void        e_gw_item_set_message (EGwItem *item, const gchar *new_message);
+const gchar *e_gw_item_get_place (EGwItem *item);
+void        e_gw_item_set_place (EGwItem *item, const gchar *new_place);
+const gchar *e_gw_item_get_security (EGwItem *item);
+void        e_gw_item_set_security (EGwItem *item, const gchar *new_class);
 gboolean    e_gw_item_get_completed (EGwItem *item);
 void        e_gw_item_set_completed (EGwItem *item, gboolean new_completed);
 gboolean    e_gw_item_get_is_allday_event (EGwItem *item);
 void	    e_gw_item_set_is_allday_event (EGwItem *item, gboolean is_allday);
-char*       e_gw_item_get_field_value (EGwItem *item, char *field_name);
-void        e_gw_item_set_field_value (EGwItem *item, char *field_name, char* field_value);
+gchar *       e_gw_item_get_field_value (EGwItem *item, gchar *field_name);
+void        e_gw_item_set_field_value (EGwItem *item, gchar *field_name, gchar * field_value);
 GList*      e_gw_item_get_email_list (EGwItem *item);
 void        e_gw_item_set_email_list (EGwItem *item, GList *email_list);
 FullName*   e_gw_item_get_full_name (EGwItem *item);
 void        e_gw_item_set_full_name (EGwItem *item, FullName* full_name);
 GList*      e_gw_item_get_member_list (EGwItem *item);
 void        e_gw_item_set_member_list (EGwItem *item, GList *list);
-PostalAddress* e_gw_item_get_address (EGwItem *item, char *address_type);
-void        e_gw_item_set_address (EGwItem *item, char *addres_type, PostalAddress *address);
+PostalAddress* e_gw_item_get_address (EGwItem *item, gchar *address_type);
+void        e_gw_item_set_address (EGwItem *item, gchar *addres_type, PostalAddress *address);
 GList*      e_gw_item_get_im_list (EGwItem *item);
 void        e_gw_item_set_im_list (EGwItem *item, GList *im_list);
 void        e_gw_item_set_categories (EGwItem *item, GList *category_list);
 GList*      e_gw_item_get_categories (EGwItem *item);
-void	    e_gw_item_set_to (EGwItem *item, const char *to) ;
-const char* e_gw_item_get_to (EGwItem *item) ;
-const char *e_gw_item_get_msg_content_type (EGwItem *item) ;
+void	    e_gw_item_set_to (EGwItem *item, const gchar *to) ;
+const gchar * e_gw_item_get_to (EGwItem *item) ;
+const gchar *e_gw_item_get_msg_content_type (EGwItem *item) ;
 guint32     e_gw_item_get_item_status (EGwItem *item);
-void	    e_gw_item_set_content_type (EGwItem *item, const char *content_type) ;
+void	    e_gw_item_set_content_type (EGwItem *item, const gchar *content_type) ;
 void	    e_gw_item_set_link_info (EGwItem *item, EGwItemLinkInfo *info);
 EGwItemLinkInfo *e_gw_item_get_link_info (EGwItem *item);
 char	    *e_gw_item_get_content_type (EGwItem *item) ;
-const char *e_gw_item_get_msg_body_id (EGwItem *item);
+const gchar *e_gw_item_get_msg_body_id (EGwItem *item);
 int	    e_gw_item_get_mail_size (EGwItem *item);
-void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, char *field_name, gpointer field_value);
+void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, gchar *field_name, gpointer field_value);
 gboolean e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg);
-void e_gw_item_set_category_name (EGwItem *item, char *cateogry_name);
-char* e_gw_item_get_category_name (EGwItem *item);
+void e_gw_item_set_category_name (EGwItem *item, gchar *cateogry_name);
+gchar * e_gw_item_get_category_name (EGwItem *item);
 void e_gw_item_set_sendoptions (EGwItem *item, gboolean set);
 void e_gw_item_set_reply_request (EGwItem *item, gboolean set);
 gboolean e_gw_item_get_reply_request (EGwItem *item);
-void e_gw_item_set_reply_within (EGwItem *item, char *reply_within);
-char *e_gw_item_get_reply_within (EGwItem *item);
+void e_gw_item_set_reply_within (EGwItem *item, gchar *reply_within);
+gchar *e_gw_item_get_reply_within (EGwItem *item);
 void e_gw_item_set_track_info (EGwItem *item, EGwItemTrack track_info);
 EGwItemTrack e_gw_item_get_track_info (EGwItem *item);
 void e_gw_item_set_autodelete (EGwItem *item, gboolean set);
@@ -242,10 +242,10 @@ void e_gw_item_set_notify_opened (EGwItem *item, EGwItemReturnNotify notify);
 EGwItemReturnNotify e_gw_item_get_notify_opened (EGwItem *item);
 void e_gw_item_set_notify_deleted (EGwItem *item, EGwItemReturnNotify notify);
 EGwItemReturnNotify e_gw_item_get_notify_deleted (EGwItem *item);
-void e_gw_item_set_expires (EGwItem *item, char *expires);
-char *e_gw_item_get_expires (EGwItem *item);
-void e_gw_item_set_delay_until (EGwItem *item, char *delay_until);
-char *e_gw_item_get_delay_until (EGwItem *item);
+void e_gw_item_set_expires (EGwItem *item, gchar *expires);
+gchar *e_gw_item_get_expires (EGwItem *item);
+void e_gw_item_set_delay_until (EGwItem *item, gchar *delay_until);
+gchar *e_gw_item_get_delay_until (EGwItem *item);
 void e_gw_item_free_cal_id (EGwItemCalId *calid);
 
 
@@ -253,25 +253,25 @@ void e_gw_item_free_cal_id (EGwItemCalId *calid);
 #define E_GW_ITEM_CLASSIFICATION_PRIVATE      "Private"
 #define E_GW_ITEM_CLASSIFICATION_CONFIDENTIAL "Confidential"
 
-const char *e_gw_item_get_classification (EGwItem *item);
-void        e_gw_item_set_classification (EGwItem *item, const char *new_class);
+const gchar *e_gw_item_get_classification (EGwItem *item);
+void        e_gw_item_set_classification (EGwItem *item, const gchar *new_class);
 
 #define E_GW_ITEM_ACCEPT_LEVEL_BUSY          "Busy"
 #define E_GW_ITEM_ACCEPT_LEVEL_OUT_OF_OFFICE "OutOfOffice"
 #define E_GW_ITEM_ACCEPT_LEVEL_FREE	     "Free"
 
-const char *e_gw_item_get_accept_level (EGwItem *item);
-void        e_gw_item_set_accept_level (EGwItem *item, const char *new_level);
+const gchar *e_gw_item_get_accept_level (EGwItem *item);
+void        e_gw_item_set_accept_level (EGwItem *item, const gchar *new_level);
 
 #define E_GW_ITEM_PRIORITY_HIGH     "High"
 #define E_GW_ITEM_PRIORITY_STANDARD "Standard"
 #define E_GW_ITEM_PRIORITY_LOW      "Low"
 
-const char *e_gw_item_get_priority (EGwItem *item);
-void        e_gw_item_set_priority (EGwItem *item, const char *new_priority);
+const gchar *e_gw_item_get_priority (EGwItem *item);
+void        e_gw_item_set_priority (EGwItem *item, const gchar *new_priority);
 
-const char *e_gw_item_get_task_priority (EGwItem *item);
-void        e_gw_item_set_task_priority (EGwItem *item, const char *new_priority);
+const gchar *e_gw_item_get_task_priority (EGwItem *item);
+void        e_gw_item_set_task_priority (EGwItem *item, const gchar *new_priority);
 
 GSList *e_gw_item_get_recipient_list (EGwItem *item);
 void e_gw_item_set_recipient_list (EGwItem *item, GSList *new_recipient_list);
@@ -292,29 +292,29 @@ void e_gw_item_set_exdate_list (EGwItem  *item, GSList *new_exdate_list);
 void e_gw_item_set_rrule (EGwItem *item, EGwItemRecurrenceRule *rrule);
 EGwItemRecurrenceRule *e_gw_item_get_rrule (EGwItem *item);
 
-int e_gw_item_get_recurrence_key (EGwItem *item);
-void e_gw_item_set_recurrence_key (EGwItem *item, int recurrence_key);
+gint e_gw_item_get_recurrence_key (EGwItem *item);
+void e_gw_item_set_recurrence_key (EGwItem *item, gint recurrence_key);
 
-void e_gw_item_set_source (EGwItem *item, char *source) ;
+void e_gw_item_set_source (EGwItem *item, gchar *source) ;
 
-int e_gw_item_get_trigger (EGwItem *item);
-void e_gw_item_set_trigger (EGwItem *item, int trigger);
+gint e_gw_item_get_trigger (EGwItem *item);
+void e_gw_item_set_trigger (EGwItem *item, gint trigger);
 
 gboolean e_gw_item_has_attachment (EGwItem *item);
 
 gboolean e_gw_item_is_from_internet (EGwItem *item);
 
 typedef struct {
-	char *email;
-	char *display_name;
+	gchar *email;
+	gchar *display_name;
 	gboolean status_enabled;
-	char *delivered_date;
-	char *opened_date;
-	char *accepted_date;
-	char *deleted_date;
-	char *declined_date;
-	char *completed_date;
-	char *undelivered_date;
+	gchar *delivered_date;
+	gchar *opened_date;
+	gchar *accepted_date;
+	gchar *deleted_date;
+	gchar *declined_date;
+	gchar *completed_date;
+	gchar *undelivered_date;
 	enum {
 		E_GW_ITEM_RECIPIENT_TO,
 		E_GW_ITEM_RECIPIENT_CC,
diff --git a/servers/groupwise/e-gw-message.c b/servers/groupwise/e-gw-message.c
index cecfc73..9f825c7 100644
--- a/servers/groupwise/e-gw-message.c
+++ b/servers/groupwise/e-gw-message.c
@@ -27,7 +27,7 @@
 #include "e-gw-message.h"
 
 SoupSoapMessage *
-e_gw_message_new_with_header (const char *uri, const char *session_id, const char *method_name)
+e_gw_message_new_with_header (const gchar *uri, const gchar *session_id, const gchar *method_name)
 {
 	SoupSoapMessage *msg;
 
@@ -63,7 +63,7 @@ e_gw_message_new_with_header (const char *uri, const char *session_id, const cha
 }
 
 void
-e_gw_message_write_string_parameter (SoupSoapMessage *msg, const char *name, const char *prefix, const char *value)
+e_gw_message_write_string_parameter (SoupSoapMessage *msg, const gchar *name, const gchar *prefix, const gchar *value)
 {
 	soup_soap_message_start_element (msg, name, prefix, NULL);
 	soup_soap_message_write_string (msg, value);
@@ -72,11 +72,11 @@ e_gw_message_write_string_parameter (SoupSoapMessage *msg, const char *name, con
 
 void
 e_gw_message_write_string_parameter_with_attribute (SoupSoapMessage *msg,
-						    const char *name,
-						    const char *prefix,
-						    const char *value,
-						    const char *attribute_name,
-						    const char *attribute_value)
+						    const gchar *name,
+						    const gchar *prefix,
+						    const gchar *value,
+						    const gchar *attribute_name,
+						    const gchar *attribute_value)
 {
 	soup_soap_message_start_element (msg, name, prefix, NULL);
 	soup_soap_message_add_attribute (msg, attribute_name, attribute_value, NULL, NULL);
@@ -85,7 +85,7 @@ e_gw_message_write_string_parameter_with_attribute (SoupSoapMessage *msg,
 }
 
 void
-e_gw_message_write_base64_parameter (SoupSoapMessage *msg, const char *name, const char *prefix, const char *value)
+e_gw_message_write_base64_parameter (SoupSoapMessage *msg, const gchar *name, const gchar *prefix, const gchar *value)
 {
 	soup_soap_message_start_element (msg, name, prefix, NULL);
 	soup_soap_message_write_base64 (msg, value, strlen (value));
@@ -93,7 +93,7 @@ e_gw_message_write_base64_parameter (SoupSoapMessage *msg, const char *name, con
 }
 
 void
-e_gw_message_write_int_parameter (SoupSoapMessage *msg, const char *name, const char *prefix, long value)
+e_gw_message_write_int_parameter (SoupSoapMessage *msg, const gchar *name, const gchar *prefix, long value)
 {
 	soup_soap_message_start_element (msg, name, prefix, NULL);
 	soup_soap_message_write_int (msg, value);
@@ -110,7 +110,7 @@ e_gw_message_write_footer (SoupSoapMessage *msg)
 	soup_soap_message_persist (msg);
 
 	if (g_getenv ("GROUPWISE_DEBUG") && (atoi (g_getenv ("GROUPWISE_DEBUG")) == 1)) {
-		const char *header = soup_message_headers_get (SOUP_MESSAGE (msg)->request_headers, "SOAPAction");
+		const gchar *header = soup_message_headers_get (SOUP_MESSAGE (msg)->request_headers, "SOAPAction");
 
 		soup_buffer_free (soup_message_body_flatten (SOUP_MESSAGE (msg)->request_body));
 		if (header && g_str_equal (header, "loginRequest")) {
diff --git a/servers/groupwise/e-gw-message.h b/servers/groupwise/e-gw-message.h
index 00b6403..d6aed50 100644
--- a/servers/groupwise/e-gw-message.h
+++ b/servers/groupwise/e-gw-message.h
@@ -28,20 +28,20 @@
 
 G_BEGIN_DECLS
 
-SoupSoapMessage *e_gw_message_new_with_header (const char *uri, const char *session_id, const char *method_name);
-void             e_gw_message_write_string_parameter (SoupSoapMessage *msg, const char *name,
-						      const char *prefix, const char *value);
+SoupSoapMessage *e_gw_message_new_with_header (const gchar *uri, const gchar *session_id, const gchar *method_name);
+void             e_gw_message_write_string_parameter (SoupSoapMessage *msg, const gchar *name,
+						      const gchar *prefix, const gchar *value);
 void             e_gw_message_write_string_parameter_with_attribute (SoupSoapMessage *msg,
-								     const char *name,
-								     const char *prefix,
-								     const char *value,
-								     const char *attrubute_name,
-								     const char *attribute_value);
+								     const gchar *name,
+								     const gchar *prefix,
+								     const gchar *value,
+								     const gchar *attrubute_name,
+								     const gchar *attribute_value);
 void             e_gw_message_write_base64_parameter (SoupSoapMessage *msg,
-						      const char *name,
-						      const char *prefix,
-						      const char *value);
-void e_gw_message_write_int_parameter (SoupSoapMessage *msg, const char *name, const char *prefix, long value);
+						      const gchar *name,
+						      const gchar *prefix,
+						      const gchar *value);
+void e_gw_message_write_int_parameter (SoupSoapMessage *msg, const gchar *name, const gchar *prefix, long value);
 
 
 void             e_gw_message_write_footer (SoupSoapMessage *msg);
diff --git a/servers/groupwise/e-gw-proxy.c b/servers/groupwise/e-gw-proxy.c
index 6a3863a..0b3f511 100644
--- a/servers/groupwise/e-gw-proxy.c
+++ b/servers/groupwise/e-gw-proxy.c
@@ -35,7 +35,7 @@ e_gw_proxy_construct_proxy_access_list (SoupSoapParameter *param, GList **proxy_
 	SoupSoapParameter *subparam;
 	SoupSoapParameter *type_param;
 	SoupSoapParameter *individual_rights;
-	char *value;
+	gchar *value;
 
 	*proxy_list = NULL;
 	for (subparam = soup_soap_parameter_get_first_child_by_name (param, "entry");
@@ -145,7 +145,7 @@ e_gw_proxy_construct_proxy_list (SoupSoapParameter *param, GList **proxy_info)
 {
 	SoupSoapParameter *subparam;
 	SoupSoapParameter *type_param;
-	char *value;
+	gchar *value;
 
 	for (subparam = soup_soap_parameter_get_first_child_by_name (param, "proxy");
 			subparam != NULL;
@@ -306,7 +306,7 @@ e_gw_proxy_form_modify_proxy_msg (SoupSoapMessage *msg, proxyHandler *new_proxy)
 }
 
 void
-e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, int *permissions)
+e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, gint *permissions)
 {
 	SoupSoapParameter *subparam;
 	SoupSoapParameter *individual_rights;
diff --git a/servers/groupwise/e-gw-proxy.h b/servers/groupwise/e-gw-proxy.h
index 2516087..98dd8f7 100644
--- a/servers/groupwise/e-gw-proxy.h
+++ b/servers/groupwise/e-gw-proxy.h
@@ -49,9 +49,9 @@
 
 
 struct _proxyHandler {
-    char *uniqueid;
-    char *proxy_name;
-    char *proxy_email;
+    gchar *uniqueid;
+    gchar *proxy_name;
+    gchar *proxy_email;
     guint32 flags;
     guint32 permissions;
 };
@@ -63,5 +63,5 @@ void e_gw_proxy_construct_proxy_list (SoupSoapParameter *param, GList **proxy_in
 void e_gw_proxy_form_proxy_add_msg (SoupSoapMessage *msg, proxyHandler *new_proxy);
 void e_gw_proxy_form_proxy_remove_msg (SoupSoapMessage *msg, proxyHandler *removeProxy);
 void e_gw_proxy_form_modify_proxy_msg (SoupSoapMessage *msg, proxyHandler *new_proxy);
-void e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, int *permissions);
+void e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, gint *permissions);
 
diff --git a/servers/groupwise/e-gw-recur-utils.c b/servers/groupwise/e-gw-recur-utils.c
index e8058d3..0014419 100644
--- a/servers/groupwise/e-gw-recur-utils.c
+++ b/servers/groupwise/e-gw-recur-utils.c
@@ -25,9 +25,9 @@
 #endif
 #include "e-gw-recur-utils.h"
 
-static const char *days_of_week[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
+static const gchar *days_of_week[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
 
-const char *
+const gchar *
 e_gw_recur_get_day_of_week (short day)
 {
 
diff --git a/servers/groupwise/e-gw-recur-utils.h b/servers/groupwise/e-gw-recur-utils.h
index b39a516..d7acedb 100644
--- a/servers/groupwise/e-gw-recur-utils.h
+++ b/servers/groupwise/e-gw-recur-utils.h
@@ -23,6 +23,7 @@
 #ifndef E_GW_RECUR_UTILS_H
 #define E_GW_RECUR_UTILS_H
 
+#include <glib.h>
 
 #define E_GW_ITEM_RECURRENCE_FREQUENCY_DAILY "Daily"
 #define E_GW_ITEM_RECURRENCE_FREQUENCY_WEEKLY "Weekly"
@@ -53,10 +54,10 @@
 #define E_GW_ITEM_BY_SETPOS_SIZE 367
 
 typedef struct {
-	char *frequency;
-	char *until;
-	int count;
-	int interval;
+	gchar *frequency;
+	gchar *until;
+	gint count;
+	gint interval;
 	short by_day[E_GW_ITEM_BY_DAY_SIZE];
 	short by_month_day[E_GW_ITEM_BY_MONTHDAY_SIZE];
 	short by_year_day[E_GW_ITEM_BY_YEARDAY_SIZE];
@@ -69,6 +70,6 @@ typedef struct {
 
 
 
-const char *e_gw_recur_get_day_of_week (short day);
+const gchar *e_gw_recur_get_day_of_week (short day);
 
 #endif
diff --git a/servers/groupwise/e-gw-sendoptions.c b/servers/groupwise/e-gw-sendoptions.c
index fe76d50..b37a5fc 100644
--- a/servers/groupwise/e-gw-sendoptions.c
+++ b/servers/groupwise/e-gw-sendoptions.c
@@ -178,7 +178,7 @@ parse_status_tracking_options (SoupSoapParameter *group_param, guint i, EGwSendO
 			     subparam != NULL ;
 			     subparam = soup_soap_parameter_get_next_child_by_name (subparam, "setting")) {
 
-		char *field = NULL, *val = NULL;
+		gchar *field = NULL, *val = NULL;
 		field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
 		val_param = soup_soap_parameter_get_first_child_by_name (subparam, "value");
 
@@ -285,7 +285,7 @@ parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *go
 	for (subparam = soup_soap_parameter_get_first_child_by_name(group_param, "setting") ;
 			     subparam != NULL ;
 			     subparam = soup_soap_parameter_get_next_child_by_name (subparam, "setting")) {
-		char *field = NULL, *val = NULL;
+		gchar *field = NULL, *val = NULL;
 		field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
 		val_param = soup_soap_parameter_get_first_child_by_name (subparam, "value");
 
@@ -323,8 +323,8 @@ parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *go
 					gopts->reply_enabled = TRUE;
 					gopts->reply_convenient = TRUE;
 				} else {
-					char *temp;
-					int i = 0;
+					gchar *temp;
+					gint i = 0;
 
 					val_param = soup_soap_parameter_get_first_child_by_name (val_param, "WithinNDays");
 					temp = soup_soap_parameter_get_string_value (val_param);
@@ -342,7 +342,7 @@ parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *go
 				val = soup_soap_parameter_get_string_value (val_param);
 
 			if (val) {
-				int i = atoi (val);
+				gint i = atoi (val);
 				if (i != 0)
 					gopts->expiration_enabled = TRUE;
 				else
@@ -367,7 +367,7 @@ parse_advanced_settings (SoupSoapParameter *group_param, EGwSendOptionsGeneral *
 	for (subparam = soup_soap_parameter_get_first_child_by_name(group_param, "setting") ;
 			     subparam != NULL ;
 			     subparam = soup_soap_parameter_get_next_child_by_name (subparam, "setting")) {
-		char *field = NULL, *val = NULL;
+		gchar *field = NULL, *val = NULL;
 		field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
 		val_param = soup_soap_parameter_get_first_child_by_name (subparam, "value");
 
@@ -409,7 +409,7 @@ e_gw_sendoptions_store_settings (SoupSoapParameter *param, EGwSendOptions *opts)
 	for (group_param = soup_soap_parameter_get_first_child_by_name(param, "group") ;
 			     group_param != NULL ;
 			     group_param = soup_soap_parameter_get_next_child_by_name (group_param, "group")) {
-		char *temp = NULL;
+		gchar *temp = NULL;
 
 		temp = soup_soap_parameter_get_property (group_param, "type");
 
@@ -437,7 +437,7 @@ e_gw_sendoptions_store_settings (SoupSoapParameter *param, EGwSendOptions *opts)
 }
 
 static void
-e_gw_sendoptions_write_settings (SoupSoapMessage *msg, char *field_name, char *value, char *value_name, gboolean value_direct)
+e_gw_sendoptions_write_settings (SoupSoapMessage *msg, gchar *field_name, gchar *value, gchar *value_name, gboolean value_direct)
 {
 	soup_soap_message_start_element (msg, "setting", NULL, NULL);
 
@@ -458,9 +458,9 @@ e_gw_sendoptions_write_settings (SoupSoapMessage *msg, char *field_name, char *v
 }
 
 static void
-set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking *n_sopts, EGwSendOptionsStatusTracking *o_sopts, char *comp)
+set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking *n_sopts, EGwSendOptionsStatusTracking *o_sopts, gchar *comp)
 {
-	char *value, *comp_name = NULL;
+	gchar *value, *comp_name = NULL;
 
 	if (n_sopts->tracking_enabled != o_sopts->tracking_enabled || n_sopts->track_when != o_sopts->track_when) {
 		if (n_sopts->tracking_enabled) {
@@ -556,7 +556,7 @@ set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking
 static void
 set_general_options_changes (SoupSoapMessage *msg, EGwSendOptionsGeneral *n_gopts, EGwSendOptionsGeneral *o_gopts)
 {
-	char *value;
+	gchar *value;
 
 	if (n_gopts->priority != o_gopts->priority) {
 		if (n_gopts->priority == E_GW_PRIORITY_HIGH)
diff --git a/servers/groupwise/soap-test.c b/servers/groupwise/soap-test.c
index 0e983d0..291b122 100644
--- a/servers/groupwise/soap-test.c
+++ b/servers/groupwise/soap-test.c
@@ -3,7 +3,7 @@
 #include "e-gw-connection.h"
 
 static GMainLoop *main_loop;
-static char *arg_hostname, *arg_username, *arg_password;
+static gchar *arg_hostname, *arg_username, *arg_password;
 
 static void
 display_container (EGwContainer *container)
@@ -45,8 +45,8 @@ idle_cb (gpointer data)
 	return FALSE;
 }
 
-int
-main (int argc, char *argv[])
+gint
+main (gint argc, gchar *argv[])
 {
 	g_type_init ();
 	g_thread_init (NULL);
diff --git a/servers/groupwise/soup-soap-message.c b/servers/groupwise/soup-soap-message.c
index 74b6c94..1817fd8 100644
--- a/servers/groupwise/soup-soap-message.c
+++ b/servers/groupwise/soup-soap-message.c
@@ -62,7 +62,7 @@ soup_soap_message_init (SoupSoapMessage *msg)
 
 
 static xmlNsPtr
-fetch_ns (SoupSoapMessage *msg, const char *prefix, const char *ns_uri)
+fetch_ns (SoupSoapMessage *msg, const gchar *prefix, const gchar *ns_uri)
 {
 	SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
         xmlNsPtr ns = NULL;
@@ -93,9 +93,9 @@ fetch_ns (SoupSoapMessage *msg, const char *prefix, const char *ns_uri)
  * parsed).
  */
 SoupSoapMessage *
-soup_soap_message_new (const char *method, const char *uri_string,
-		       gboolean standalone, const char *xml_encoding,
-		       const char *env_prefix, const char *env_uri)
+soup_soap_message_new (const gchar *method, const gchar *uri_string,
+		       gboolean standalone, const gchar *xml_encoding,
+		       const gchar *env_prefix, const gchar *env_uri)
 {
 	SoupSoapMessage *msg;
 	SoupURI *uri;
@@ -126,9 +126,9 @@ soup_soap_message_new (const char *method, const char *uri_string,
  * Returns: the new #SoupSoapMessage
  */
 SoupSoapMessage *
-soup_soap_message_new_from_uri (const char *method, SoupURI *uri,
-				gboolean standalone, const char *xml_encoding,
-				const char *env_prefix, const char *env_uri)
+soup_soap_message_new_from_uri (const gchar *method, SoupURI *uri,
+				gboolean standalone, const gchar *xml_encoding,
+				const gchar *env_prefix, const gchar *env_uri)
 {
 	SoupSoapMessage *msg;
 	SoupSoapMessagePrivate *priv;
@@ -272,9 +272,9 @@ soup_soap_message_end_body (SoupSoapMessage *msg)
  */
 void
 soup_soap_message_start_element (SoupSoapMessage *msg,
-				 const char *name,
-				 const char *prefix,
-				 const char *ns_uri)
+				 const gchar *name,
+				 const gchar *prefix,
+				 const gchar *ns_uri)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -323,9 +323,9 @@ soup_soap_message_end_element (SoupSoapMessage *msg)
  */
 void
 soup_soap_message_start_fault (SoupSoapMessage *msg,
-			       const char *faultcode,
-			       const char *faultstring,
-			       const char *faultfactor)
+			       const gchar *faultcode,
+			       const gchar *faultstring,
+			       const gchar *faultfactor)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -442,11 +442,11 @@ soup_soap_message_end_header (SoupSoapMessage *msg)
  */
 void
 soup_soap_message_start_header_element (SoupSoapMessage *msg,
-					const char *name,
+					const gchar *name,
 					gboolean must_understand,
-					const char *actor_uri,
-					const char *prefix,
-					const char *ns_uri)
+					const gchar *actor_uri,
+					const gchar *prefix,
+					const gchar *ns_uri)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -482,7 +482,7 @@ soup_soap_message_end_header_element (SoupSoapMessage *msg)
 void
 soup_soap_message_write_int (SoupSoapMessage *msg, glong i)
 {
-	char *str = g_strdup_printf ("%ld", i);
+	gchar *str = g_strdup_printf ("%ld", i);
 	soup_soap_message_write_string (msg, str);
 	g_free (str);
 }
@@ -497,7 +497,7 @@ soup_soap_message_write_int (SoupSoapMessage *msg, glong i)
 void
 soup_soap_message_write_double (SoupSoapMessage *msg, double d)
 {
-	char *str = g_strdup_printf ("%f", d);
+	gchar *str = g_strdup_printf ("%f", d);
 	soup_soap_message_write_string (msg, str);
 	g_free (str);
 }
@@ -512,7 +512,7 @@ soup_soap_message_write_double (SoupSoapMessage *msg, double d)
  * element's content.
  **/
 void
-soup_soap_message_write_base64 (SoupSoapMessage *msg, const char *string, int len)
+soup_soap_message_write_base64 (SoupSoapMessage *msg, const gchar *string, gint len)
 {
         gchar *str = g_base64_encode ((const guchar *)string, len);
         soup_soap_message_write_string (msg, str);
@@ -542,7 +542,7 @@ soup_soap_message_write_time (SoupSoapMessage *msg, const time_t *timeval)
  * Writes the @string as the current element's content.
  */
 void
-soup_soap_message_write_string (SoupSoapMessage *msg, const char *string)
+soup_soap_message_write_string (SoupSoapMessage *msg, const gchar *string)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -562,7 +562,7 @@ soup_soap_message_write_string (SoupSoapMessage *msg, const char *string)
  * element's content.
  */
 void
-soup_soap_message_write_buffer (SoupSoapMessage *msg, const char *buffer, int len)
+soup_soap_message_write_buffer (SoupSoapMessage *msg, const gchar *buffer, gint len)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -581,7 +581,7 @@ soup_soap_message_write_buffer (SoupSoapMessage *msg, const char *buffer, int le
  * specifies the element's type name.
  */
 void
-soup_soap_message_set_element_type (SoupSoapMessage *msg, const char *xsi_type)
+soup_soap_message_set_element_type (SoupSoapMessage *msg, const gchar *xsi_type)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -620,10 +620,10 @@ soup_soap_message_set_null (SoupSoapMessage *msg)
  */
 void
 soup_soap_message_add_attribute (SoupSoapMessage *msg,
-				 const char *name,
-				 const char *value,
-				 const char *prefix,
-				 const char *ns_uri)
+				 const gchar *name,
+				 const gchar *value,
+				 const gchar *prefix,
+				 const gchar *ns_uri)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -644,7 +644,7 @@ soup_soap_message_add_attribute (SoupSoapMessage *msg,
  * Adds a new XML namespace to the current element.
  */
 void
-soup_soap_message_add_namespace (SoupSoapMessage *msg, const char *prefix, const char *ns_uri)
+soup_soap_message_add_namespace (SoupSoapMessage *msg, const gchar *prefix, const gchar *ns_uri)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -664,7 +664,7 @@ soup_soap_message_add_namespace (SoupSoapMessage *msg, const char *prefix, const
  * namespaced child elements fall into.
  */
 void
-soup_soap_message_set_default_namespace (SoupSoapMessage *msg, const char *ns_uri)
+soup_soap_message_set_default_namespace (SoupSoapMessage *msg, const gchar *ns_uri)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -683,7 +683,7 @@ soup_soap_message_set_default_namespace (SoupSoapMessage *msg, const char *ns_ur
  * value of @enc_style.
  */
 void
-soup_soap_message_set_encoding_style (SoupSoapMessage *msg, const char *enc_style)
+soup_soap_message_set_encoding_style (SoupSoapMessage *msg, const gchar *enc_style)
 {
 	SoupSoapMessagePrivate *priv;
 
@@ -735,7 +735,7 @@ soup_soap_message_persist (SoupSoapMessage *msg)
 {
 	SoupSoapMessagePrivate *priv;
 	xmlChar *body;
-	int len;
+	gint len;
 
 	g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
 	priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
@@ -744,7 +744,7 @@ soup_soap_message_persist (SoupSoapMessage *msg)
 
 	/* serialize to SoupMessage class */
 	soup_message_set_request (SOUP_MESSAGE (msg), "text/xml",
-				  SOUP_MEMORY_TAKE, (char *)body, len);
+				  SOUP_MEMORY_TAKE, (gchar *)body, len);
 }
 
 /**
@@ -758,8 +758,8 @@ soup_soap_message_persist (SoupSoapMessage *msg)
  * Return value: The namespace prefix, or %NULL if no namespace exists
  * for the URI given.
  */
-const char *
-soup_soap_message_get_namespace_prefix (SoupSoapMessage *msg, const char *ns_uri)
+const gchar *
+soup_soap_message_get_namespace_prefix (SoupSoapMessage *msg, const gchar *ns_uri)
 {
 	SoupSoapMessagePrivate *priv;
 	xmlNsPtr ns = NULL;
@@ -771,7 +771,7 @@ soup_soap_message_get_namespace_prefix (SoupSoapMessage *msg, const char *ns_uri
 	ns = xmlSearchNsByHref (priv->doc, priv->last_node, (const xmlChar *)ns_uri);
 	if (ns) {
 		if (ns->prefix)
-			return (const char *)ns->prefix;
+			return (const gchar *)ns->prefix;
 		else
 			return "";
 	}
diff --git a/servers/groupwise/soup-soap-message.h b/servers/groupwise/soup-soap-message.h
index f508423..bc8d6f4 100644
--- a/servers/groupwise/soup-soap-message.h
+++ b/servers/groupwise/soup-soap-message.h
@@ -31,61 +31,61 @@ typedef struct {
 
 GType             soup_soap_message_get_type (void);
 
-SoupSoapMessage  *soup_soap_message_new (const char *method, const char *uri_string,
-					 gboolean standalone, const char *xml_encoding,
-					 const char *env_prefix, const char *env_uri);
-SoupSoapMessage  *soup_soap_message_new_from_uri (const char *method, SoupURI *uri,
-						  gboolean standalone, const char *xml_encoding,
-						  const char *env_prefix, const char *env_uri);
+SoupSoapMessage  *soup_soap_message_new (const gchar *method, const gchar *uri_string,
+					 gboolean standalone, const gchar *xml_encoding,
+					 const gchar *env_prefix, const gchar *env_uri);
+SoupSoapMessage  *soup_soap_message_new_from_uri (const gchar *method, SoupURI *uri,
+						  gboolean standalone, const gchar *xml_encoding,
+						  const gchar *env_prefix, const gchar *env_uri);
 
 void              soup_soap_message_start_envelope (SoupSoapMessage *msg);
 void              soup_soap_message_end_envelope (SoupSoapMessage *msg);
 void              soup_soap_message_start_body (SoupSoapMessage *msg);
 void              soup_soap_message_end_body (SoupSoapMessage *msg);
 void              soup_soap_message_start_element (SoupSoapMessage *msg,
-						   const char *name,
-						   const char *prefix,
-						   const char *ns_uri);
+						   const gchar *name,
+						   const gchar *prefix,
+						   const gchar *ns_uri);
 void              soup_soap_message_end_element (SoupSoapMessage *msg);
 void              soup_soap_message_start_fault (SoupSoapMessage *msg,
-						 const char *faultcode,
-						 const char *faultstring,
-						 const char *faultfactor);
+						 const gchar *faultcode,
+						 const gchar *faultstring,
+						 const gchar *faultfactor);
 void              soup_soap_message_end_fault (SoupSoapMessage *msg);
 void              soup_soap_message_start_fault_detail (SoupSoapMessage *msg);
 void              soup_soap_message_end_fault_detail (SoupSoapMessage *msg);
 void              soup_soap_message_start_header (SoupSoapMessage *msg);
 void              soup_soap_message_end_header (SoupSoapMessage *msg);
 void              soup_soap_message_start_header_element (SoupSoapMessage *msg,
-							  const char *name,
+							  const gchar *name,
 							  gboolean must_understand,
-							  const char *actor_uri,
-							  const char *prefix,
-							  const char *ns_uri);
+							  const gchar *actor_uri,
+							  const gchar *prefix,
+							  const gchar *ns_uri);
 void              soup_soap_message_end_header_element (SoupSoapMessage *msg);
 void              soup_soap_message_write_int (SoupSoapMessage *msg, glong i);
 void              soup_soap_message_write_double (SoupSoapMessage *msg, double d);
-void              soup_soap_message_write_base64 (SoupSoapMessage *msg, const char *string, int len);
+void              soup_soap_message_write_base64 (SoupSoapMessage *msg, const gchar *string, gint len);
 void              soup_soap_message_write_time (SoupSoapMessage *msg, const time_t *timeval);
-void              soup_soap_message_write_string (SoupSoapMessage *msg, const char *string);
-void              soup_soap_message_write_buffer (SoupSoapMessage *msg, const char *buffer, int len);
-void              soup_soap_message_set_element_type (SoupSoapMessage *msg, const char *xsi_type);
+void              soup_soap_message_write_string (SoupSoapMessage *msg, const gchar *string);
+void              soup_soap_message_write_buffer (SoupSoapMessage *msg, const gchar *buffer, gint len);
+void              soup_soap_message_set_element_type (SoupSoapMessage *msg, const gchar *xsi_type);
 void              soup_soap_message_set_null (SoupSoapMessage *msg);
 void              soup_soap_message_add_attribute (SoupSoapMessage *msg,
-						   const char *name,
-						   const char *value,
-						   const char *prefix,
-						   const char *ns_uri);
+						   const gchar *name,
+						   const gchar *value,
+						   const gchar *prefix,
+						   const gchar *ns_uri);
 void              soup_soap_message_add_namespace (SoupSoapMessage *msg,
-						   const char *prefix,
-						   const char *ns_uri);
+						   const gchar *prefix,
+						   const gchar *ns_uri);
 void              soup_soap_message_set_default_namespace (SoupSoapMessage *msg,
-							   const char *ns_uri);
-void              soup_soap_message_set_encoding_style (SoupSoapMessage *msg, const char *enc_style);
+							   const gchar *ns_uri);
+void              soup_soap_message_set_encoding_style (SoupSoapMessage *msg, const gchar *enc_style);
 void              soup_soap_message_reset (SoupSoapMessage *msg);
 void              soup_soap_message_persist (SoupSoapMessage *msg);
 
-const char       *soup_soap_message_get_namespace_prefix (SoupSoapMessage *msg, const char *ns_uri);
+const gchar       *soup_soap_message_get_namespace_prefix (SoupSoapMessage *msg, const gchar *ns_uri);
 
 xmlDocPtr         soup_soap_message_get_xml_doc (SoupSoapMessage *msg);
 
diff --git a/servers/groupwise/soup-soap-response.c b/servers/groupwise/soup-soap-response.c
index 157bdc2..37b80fd 100644
--- a/servers/groupwise/soup-soap-response.c
+++ b/servers/groupwise/soup-soap-response.c
@@ -85,7 +85,7 @@ soup_soap_response_new (void)
  * error).
  */
 SoupSoapResponse *
-soup_soap_response_new_from_string (const char *xmlstr)
+soup_soap_response_new_from_string (const gchar *xmlstr)
 {
 	SoupSoapResponse *response;
 
@@ -108,7 +108,7 @@ parse_parameters (SoupSoapResponsePrivate *priv, xmlNodePtr xml_method)
 	for (tmp = soup_xml_real_node (xml_method->children);
 	     tmp != NULL;
 	     tmp = soup_xml_real_node (tmp->next)) {
-		if (!strcmp ((const char *)tmp->name, "Fault")) {
+		if (!strcmp ((const gchar *)tmp->name, "Fault")) {
 			priv->soap_fault = tmp;
 			continue;
 		} else {
@@ -129,7 +129,7 @@ parse_parameters (SoupSoapResponsePrivate *priv, xmlNodePtr xml_method)
  * Return value: %TRUE if successful, %FALSE otherwise.
  */
 gboolean
-soup_soap_response_from_string (SoupSoapResponse *response, const char *xmlstr)
+soup_soap_response_from_string (SoupSoapResponse *response, const gchar *xmlstr)
 {
 	SoupSoapResponsePrivate *priv;
 	xmlDocPtr old_doc = NULL;
@@ -157,7 +157,7 @@ soup_soap_response_from_string (SoupSoapResponse *response, const char *xmlstr)
 		return FALSE;
 	}
 
-	if (strcmp ((const char *)xml_root->name, "Envelope") != 0) {
+	if (strcmp ((const gchar *)xml_root->name, "Envelope") != 0) {
 		xmlFreeDoc (priv->xmldoc);
 		priv->xmldoc = old_doc;
 		return FALSE;
@@ -165,9 +165,9 @@ soup_soap_response_from_string (SoupSoapResponse *response, const char *xmlstr)
 
 	xml_body = soup_xml_real_node (xml_root->children);
 	if (xml_body != NULL) {
-		if (strcmp ((const char *)xml_body->name, "Header") == 0)
+		if (strcmp ((const gchar *)xml_body->name, "Header") == 0)
 			xml_body = soup_xml_real_node (xml_body->next);
-		if (strcmp ((const char *)xml_body->name, "Body") != 0) {
+		if (strcmp ((const gchar *)xml_body->name, "Body") != 0) {
 			xmlFreeDoc (priv->xmldoc);
 			priv->xmldoc = old_doc;
 			return FALSE;
@@ -197,7 +197,7 @@ soup_soap_response_from_string (SoupSoapResponse *response, const char *xmlstr)
  *
  * Return value: the method name.
  */
-const char *
+const gchar *
 soup_soap_response_get_method_name (SoupSoapResponse *response)
 {
 	SoupSoapResponsePrivate *priv;
@@ -206,7 +206,7 @@ soup_soap_response_get_method_name (SoupSoapResponse *response)
 	priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
 	g_return_val_if_fail (priv->xml_method != NULL, NULL);
 
-	return (const char *) priv->xml_method->name;
+	return (const gchar *) priv->xml_method->name;
 }
 
 /**
@@ -217,7 +217,7 @@ soup_soap_response_get_method_name (SoupSoapResponse *response)
  * Sets the method name on the given #SoupSoapResponse.
  */
 void
-soup_soap_response_set_method_name (SoupSoapResponse *response, const char *method_name)
+soup_soap_response_set_method_name (SoupSoapResponse *response, const gchar *method_name)
 {
 	SoupSoapResponsePrivate *priv;
 
@@ -237,12 +237,12 @@ soup_soap_response_set_method_name (SoupSoapResponse *response, const char *meth
  *
  * Return value: the parameter name.
  */
-const char *
+const gchar *
 soup_soap_parameter_get_name (SoupSoapParameter *param)
 {
 	g_return_val_if_fail (param != NULL, NULL);
 
-	return (const char *) param->name;
+	return (const gchar *) param->name;
 }
 
 /**
@@ -253,16 +253,16 @@ soup_soap_parameter_get_name (SoupSoapParameter *param)
  *
  * Return value: the parameter value as an integer
  */
-int
+gint
 soup_soap_parameter_get_int_value (SoupSoapParameter *param)
 {
-	int i;
+	gint i;
 	xmlChar *s;
 	g_return_val_if_fail (param != NULL, -1);
 
 	s = xmlNodeGetContent (param);
 	if (s) {
-		i = atoi ((char *)s);
+		i = atoi ((gchar *)s);
 		xmlFree (s);
 
 		return i;
@@ -280,15 +280,15 @@ soup_soap_parameter_get_int_value (SoupSoapParameter *param)
  * Return value: the parameter value as a string, which must be freed
  * by the caller.
  */
-char *
+gchar *
 soup_soap_parameter_get_string_value (SoupSoapParameter *param)
 {
 	xmlChar *xml_s;
-	char *s;
+	gchar *s;
 	g_return_val_if_fail (param != NULL, NULL);
 
 	xml_s = xmlNodeGetContent (param);
-	s = g_strdup ((char *)xml_s);
+	s = g_strdup ((gchar *)xml_s);
 	xmlFree (xml_s);
 
 	return s;
@@ -324,7 +324,7 @@ soup_soap_parameter_get_first_child (SoupSoapParameter *param)
  * are no children.
  */
 SoupSoapParameter *
-soup_soap_parameter_get_first_child_by_name (SoupSoapParameter *param, const char *name)
+soup_soap_parameter_get_first_child_by_name (SoupSoapParameter *param, const gchar *name)
 {
 	SoupSoapParameter *tmp;
 
@@ -334,7 +334,7 @@ soup_soap_parameter_get_first_child_by_name (SoupSoapParameter *param, const cha
 	for (tmp = soup_soap_parameter_get_first_child (param);
 	     tmp != NULL;
 	     tmp = soup_soap_parameter_get_next_child (tmp)) {
-		if (!strcmp (name, (const char *)tmp->name))
+		if (!strcmp (name, (const gchar *)tmp->name))
 			return tmp;
 	}
 
@@ -376,7 +376,7 @@ soup_soap_parameter_get_next_child (SoupSoapParameter *param)
  */
 SoupSoapParameter *
 soup_soap_parameter_get_next_child_by_name (SoupSoapParameter *param,
-					    const char *name)
+					    const gchar *name)
 {
 	SoupSoapParameter *tmp;
 
@@ -386,7 +386,7 @@ soup_soap_parameter_get_next_child_by_name (SoupSoapParameter *param,
 	for (tmp = soup_soap_parameter_get_next_child (param);
 	     tmp != NULL;
 	     tmp = soup_soap_parameter_get_next_child (tmp)) {
-		if (!strcmp (name, (const char *)tmp->name))
+		if (!strcmp (name, (const gchar *)tmp->name))
 			return tmp;
 	}
 
@@ -402,17 +402,17 @@ soup_soap_parameter_get_next_child_by_name (SoupSoapParameter *param,
  *
  * Return value: the property, which must be freed by the caller.
  */
-char *
-soup_soap_parameter_get_property (SoupSoapParameter *param, const char *prop_name)
+gchar *
+soup_soap_parameter_get_property (SoupSoapParameter *param, const gchar *prop_name)
 {
 	xmlChar *xml_s;
-	char *s;
+	gchar *s;
 
 	g_return_val_if_fail (param != NULL, NULL);
 	g_return_val_if_fail (prop_name != NULL, NULL);
 
 	xml_s = xmlGetProp (param, (const xmlChar *)prop_name);
-	s = g_strdup ((char *)xml_s);
+	s = g_strdup ((gchar *)xml_s);
 	xmlFree (xml_s);
 
 	return s;
@@ -470,7 +470,7 @@ soup_soap_response_get_first_parameter (SoupSoapResponse *response)
  */
 SoupSoapParameter *
 soup_soap_response_get_first_parameter_by_name (SoupSoapResponse *response,
-						const char *name)
+						const gchar *name)
 {
 	SoupSoapResponsePrivate *priv;
 	GList *l;
@@ -482,7 +482,7 @@ soup_soap_response_get_first_parameter_by_name (SoupSoapResponse *response,
 	for (l = priv->parameters; l != NULL; l = l->next) {
 		SoupSoapParameter *param = (SoupSoapParameter *) l->data;
 
-		if (!strcmp (name, (const char *)param->name))
+		if (!strcmp (name, (const gchar *)param->name))
 			return param;
 	}
 
@@ -531,7 +531,7 @@ soup_soap_response_get_next_parameter (SoupSoapResponse *response,
 SoupSoapParameter *
 soup_soap_response_get_next_parameter_by_name (SoupSoapResponse *response,
 					       SoupSoapParameter *from,
-					       const char *name)
+					       const gchar *name)
 {
 	SoupSoapParameter *param;
 
@@ -541,7 +541,7 @@ soup_soap_response_get_next_parameter_by_name (SoupSoapResponse *response,
 
 	param = soup_soap_response_get_next_parameter (response, from);
 	while (param) {
-		const char *param_name = soup_soap_parameter_get_name (param);
+		const gchar *param_name = soup_soap_parameter_get_name (param);
 
 		if (param_name) {
 			if (!strcmp (name, param_name))
@@ -564,16 +564,16 @@ soup_xml_real_node (xmlNode *node)
 }
 
 
-int
+gint
 soup_soap_response_dump_response (SoupSoapResponse *response, FILE *buffer)
 {
 	xmlChar *xmlbuff;
-	int buffersize, ret;
+	gint buffersize, ret;
 
 	SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
 	xmlDocDumpFormatMemory(priv->xmldoc, &xmlbuff, &buffersize, 1);
 
-	ret = fputs ((char *) xmlbuff, buffer);
+	ret = fputs ((gchar *) xmlbuff, buffer);
 	xmlFree (xmlbuff);
 
 	return ret;
diff --git a/servers/groupwise/soup-soap-response.h b/servers/groupwise/soup-soap-response.h
index c17761c..e26f617 100644
--- a/servers/groupwise/soup-soap-response.h
+++ b/servers/groupwise/soup-soap-response.h
@@ -30,38 +30,38 @@ typedef struct {
 GType             soup_soap_response_get_type (void);
 
 SoupSoapResponse *soup_soap_response_new (void);
-SoupSoapResponse *soup_soap_response_new_from_string (const char *xmlstr);
+SoupSoapResponse *soup_soap_response_new_from_string (const gchar *xmlstr);
 
-gboolean          soup_soap_response_from_string (SoupSoapResponse *response, const char *xmlstr);
+gboolean          soup_soap_response_from_string (SoupSoapResponse *response, const gchar *xmlstr);
 
-const char       *soup_soap_response_get_method_name (SoupSoapResponse *response);
+const gchar       *soup_soap_response_get_method_name (SoupSoapResponse *response);
 void              soup_soap_response_set_method_name (SoupSoapResponse *response,
-						      const char *method_name);
+						      const gchar *method_name);
 
 typedef xmlNode SoupSoapParameter;
 
-const char        *soup_soap_parameter_get_name (SoupSoapParameter *param);
-int                soup_soap_parameter_get_int_value (SoupSoapParameter *param);
-char              *soup_soap_parameter_get_string_value (SoupSoapParameter *param);
+const gchar        *soup_soap_parameter_get_name (SoupSoapParameter *param);
+gint                soup_soap_parameter_get_int_value (SoupSoapParameter *param);
+gchar              *soup_soap_parameter_get_string_value (SoupSoapParameter *param);
 SoupSoapParameter *soup_soap_parameter_get_first_child (SoupSoapParameter *param);
 SoupSoapParameter *soup_soap_parameter_get_first_child_by_name (SoupSoapParameter *param,
-								const char *name);
+								const gchar *name);
 SoupSoapParameter *soup_soap_parameter_get_next_child (SoupSoapParameter *param);
 SoupSoapParameter *soup_soap_parameter_get_next_child_by_name (SoupSoapParameter *param,
-							       const char *name);
-char              *soup_soap_parameter_get_property (SoupSoapParameter *param, const char *prop_name);
+							       const gchar *name);
+gchar              *soup_soap_parameter_get_property (SoupSoapParameter *param, const gchar *prop_name);
 
 const GList       *soup_soap_response_get_parameters (SoupSoapResponse *response);
 SoupSoapParameter *soup_soap_response_get_first_parameter (SoupSoapResponse *response);
 SoupSoapParameter *soup_soap_response_get_first_parameter_by_name (SoupSoapResponse *response,
-								   const char *name);
+								   const gchar *name);
 SoupSoapParameter *soup_soap_response_get_next_parameter (SoupSoapResponse *response,
 							  SoupSoapParameter *from);
 SoupSoapParameter *soup_soap_response_get_next_parameter_by_name (SoupSoapResponse *response,
 								  SoupSoapParameter *from,
-								  const char *name);
+								  const gchar *name);
 
-int soup_soap_response_dump_response (SoupSoapResponse *response, FILE *buffer);
+gint soup_soap_response_dump_response (SoupSoapResponse *response, FILE *buffer);
 
 
 G_END_DECLS
diff --git a/src/offline-listener.c b/src/offline-listener.c
index 1824780..defd597 100644
--- a/src/offline-listener.c
+++ b/src/offline-listener.c
@@ -67,7 +67,7 @@ set_online_status (OfflineListener *offline_listener, gboolean is_offline)
 }
 
 static void
-online_status_changed (GConfClient *client, int cnxn_id, GConfEntry *entry, gpointer data)
+online_status_changed (GConfClient *client, gint cnxn_id, GConfEntry *entry, gpointer data)
 {
 	GConfValue *value;
 	gboolean offline;
diff --git a/src/server-logging.c b/src/server-logging.c
index ed03c65..37ca811 100644
--- a/src/server-logging.c
+++ b/src/server-logging.c
@@ -31,7 +31,7 @@
 static BonoboEventSourceClass *parent_class = NULL;
 
 typedef struct {
-	char *domain;
+	gchar *domain;
 	guint id;
 } ServerLoggingHandler;
 
@@ -152,7 +152,7 @@ server_log_handler(const gchar *domain,
 
 void
 server_logging_register_domain (ServerLogging *logging,
-				const char *domain)
+				const gchar *domain)
 {
 	ServerLoggingPrivate *priv;
 	guint handler_id;
diff --git a/src/server-logging.h b/src/server-logging.h
index 3871fc4..97e6288 100644
--- a/src/server-logging.h
+++ b/src/server-logging.h
@@ -59,7 +59,7 @@ struct _ServerLoggingClass {
 GType server_logging_get_type  (void);
 ServerLogging *server_logging_new (void);
 
-void server_logging_register_domain (ServerLogging *logging, const char *domain);
+void server_logging_register_domain (ServerLogging *logging, const gchar *domain);
 
 G_END_DECLS
 
diff --git a/src/server.c b/src/server.c
index c769345..ada559b 100644
--- a/src/server.c
+++ b/src/server.c
@@ -90,7 +90,7 @@ static GStaticMutex termination_lock = G_STATIC_MUTEX_INIT;
 static gboolean
 termination_handler (gpointer data)
 {
-	int count = 0;
+	gint count = 0;
 
 #if ENABLE_CALENDAR
 	count += e_data_cal_factory_get_n_backends (e_data_cal_factory);
@@ -201,7 +201,7 @@ setup_cals (void)
 static gboolean
 setup_logging (void)
 {
-	int result;
+	gint result;
 
 	logging_iface = server_logging_new ();
 
@@ -230,7 +230,7 @@ setup_logging (void)
 static gboolean
 setup_interface_check (void)
 {
-	int result;
+	gint result;
 
 	interface_check_iface = server_interface_check_new ();
 	result = bonobo_activation_active_server_register (E_DATA_SERVER_INTERFACE_CHECK_OAF_ID,
@@ -242,7 +242,7 @@ setup_interface_check (void)
 
 #ifdef DEBUG_BACKENDS
 static void
-dump_backends (int signal)
+dump_backends (gint signal)
 {
 	e_data_book_factory_dump_active_backends (e_data_book_factory);
 #if ENABLE_CALENDAR
@@ -259,7 +259,7 @@ dump_backends (int signal)
 #undef PREFIX
 #define PREFIX e_util_get_prefix ()
 
-static const char *
+static const gchar *
 sysconfdir (void)
 {
 	return e_util_replace_prefix (PREFIX,
@@ -269,7 +269,7 @@ sysconfdir (void)
 #undef SYSCONFDIR
 #define SYSCONFDIR sysconfdir ()
 
-static const char *
+static const gchar *
 datadir (void)
 {
 	return e_util_replace_prefix (PREFIX,
@@ -279,7 +279,7 @@ datadir (void)
 #undef DATADIR
 #define DATADIR datadir ()
 
-static const char *
+static const gchar *
 libdir (void)
 {
 	return e_util_replace_prefix (PREFIX,
@@ -291,8 +291,8 @@ libdir (void)
 
 #endif
 
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
 {
 	gboolean did_books=FALSE, did_cals=FALSE;
 	OfflineListener *offline_listener = NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]