diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-11-11 14:12:43 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-11-11 14:12:43 +0200 |
commit | ca939cbb5e494b18d4faf553e715828872a6c1bc (patch) | |
tree | da27bb03c7a177f040429757ec5c88195c58f8b4 | |
parent | b8cdb89ea0af82b27137ee60ad1ffebd9f66a849 (diff) | |
download | mailutils-ca939cbb5e494b18d4faf553e715828872a6c1bc.tar.gz mailutils-ca939cbb5e494b18d4faf553e715828872a6c1bc.tar.bz2 |
Get rid of the deprecated functions
Below I list the removed functions along with the recipes
on how to replace them.
. mu_body_get_stream
. mu_message_get_stream
. mu_mailer_get_stream
. mu_header_get_stream
These functions should not be used at all.
They will reappear within a couple of releases as synonyms
for the corresponding _get_streamref functions, after which
the latter will be gradually removed. Thus, at the end of
the transition perion _get_streamref's will be replaced by
_get_stream.
. mu_sieve_compile_buffer
Replaced by mu_sieve_compile_text.
Old code:
rc = mu_sieve_compile_buffer (mach, buf, bufsize, fname, line);
New code:
struct mu_locus_point loc = MU_LOCUS_POINT_INITIALIZER;
mu_locus_point_set_file (&loc, fname);
loc.mu_line = line;
rc = mu_sieve_compile_text (mach, buf, bufsize, &loc);
mu_locus_point_deinit (&loc);
. mu_address_to_string
Use mu_address_get_printable instead.
. mu_address_format_string
Use mu_stream_format_address instead. E.g. to print to a string:
char buf[100];
stream_t str;
mu_fixed_memory_stream_create (&str, buf, sizeof(buf), MU_STREAM_WRITE);
rc = mu_stream_format_address (str, addr);
. mu_registrar_get_list
Should not be used. Use mu_registrar_get_iterator if you need to
iterate over the list.
. mu_mailbox_save_attributes
Replaced by mu_mailbox_sync.
. mu_msgset_print
Use mu_stream_msgset_format.
Old code:
rc = mu_msgset_print (mu_stream_t str, mu_msgset_t mset);
New code:
rc = mu_stream_msgset_format (str, mu_msgset_fmt_imap, mset);
-rw-r--r-- | include/mailutils/address.h | 10 | ||||
-rw-r--r-- | include/mailutils/body.h | 1 | ||||
-rw-r--r-- | include/mailutils/header.h | 1 | ||||
-rw-r--r-- | include/mailutils/mailbox.h | 1 | ||||
-rw-r--r-- | include/mailutils/mailer.h | 1 | ||||
-rw-r--r-- | include/mailutils/message.h | 1 | ||||
-rw-r--r-- | include/mailutils/msgset.h | 2 | ||||
-rw-r--r-- | include/mailutils/registrar.h | 1 | ||||
-rw-r--r-- | include/mailutils/sieve.h | 4 | ||||
-rw-r--r-- | libmailutils/address/address.c | 39 | ||||
-rw-r--r-- | libmailutils/base/registrar.c | 14 | ||||
-rw-r--r-- | libmailutils/mailbox/body.c | 7 | ||||
-rw-r--r-- | libmailutils/mailbox/header.c | 22 | ||||
-rw-r--r-- | libmailutils/mailbox/mailbox.c | 6 | ||||
-rw-r--r-- | libmailutils/mailbox/msgstream.c | 33 | ||||
-rw-r--r-- | libmailutils/mailer/mailer.c | 12 | ||||
-rw-r--r-- | libmu_sieve/sieve-gram.y | 15 |
17 files changed, 2 insertions, 168 deletions
diff --git a/include/mailutils/address.h b/include/mailutils/address.h index ea9844c5b..6aa166dd6 100644 --- a/include/mailutils/address.h +++ b/include/mailutils/address.h @@ -148,12 +148,2 @@ extern int mu_stream_format_address (mu_stream_t str, mu_address_t addr); - /* Deprecated calls */ - -extern int mu_address_to_string (mu_address_t, char *, size_t, size_t *) - MU_DEPRECATED; /* Use mu_address_get_printable, if you really have to */ - -extern size_t mu_address_format_string (mu_address_t addr, char *buf, - size_t buflen) - MU_DEPRECATED; /* Use mu_stream_format_address, or any of the - _get_printable functions */ - extern int mu_validate_email (mu_address_t subaddr); diff --git a/include/mailutils/body.h b/include/mailutils/body.h index ba9864631..c8ef641f2 100644 --- a/include/mailutils/body.h +++ b/include/mailutils/body.h @@ -32,3 +32,2 @@ extern int mu_body_clear_modified (mu_body_t); -extern int mu_body_get_stream (mu_body_t, mu_stream_t *) MU_DEPRECATED; extern int mu_body_get_streamref (mu_body_t body, mu_stream_t *pstream); diff --git a/include/mailutils/header.h b/include/mailutils/header.h index f0c0d7043..25b78f543 100644 --- a/include/mailutils/header.h +++ b/include/mailutils/header.h @@ -153,3 +153,2 @@ extern int mu_header_aget_field_value_unfold (mu_header_t header, size_t num, -extern int mu_header_get_stream (mu_header_t, mu_stream_t *) MU_DEPRECATED; extern int mu_header_get_streamref (mu_header_t, mu_stream_t *); diff --git a/include/mailutils/mailbox.h b/include/mailutils/mailbox.h index e54ae88f0..dfc2146ac 100644 --- a/include/mailutils/mailbox.h +++ b/include/mailutils/mailbox.h @@ -72,3 +72,2 @@ extern int mu_mailbox_expunge (mu_mailbox_t); extern int mu_mailbox_sync (mu_mailbox_t); -extern int mu_mailbox_save_attributes (mu_mailbox_t) MU_DEPRECATED; diff --git a/include/mailutils/mailer.h b/include/mailutils/mailer.h index 00287e3c1..9b0ae6eec 100644 --- a/include/mailutils/mailer.h +++ b/include/mailutils/mailer.h @@ -53,3 +53,2 @@ int mu_mailer_set_property (mu_mailer_t, mu_property_t); -extern int mu_mailer_get_stream (mu_mailer_t, mu_stream_t *) MU_DEPRECATED; extern int mu_mailer_get_streamref (mu_mailer_t, mu_stream_t *); diff --git a/include/mailutils/message.h b/include/mailutils/message.h index f2e8b2cb5..c796c4e2d 100644 --- a/include/mailutils/message.h +++ b/include/mailutils/message.h @@ -135,3 +135,2 @@ extern int mu_message_set_body (mu_message_t, mu_body_t, void *); -extern int mu_message_get_stream (mu_message_t, mu_stream_t *) MU_DEPRECATED; extern int mu_message_get_streamref (mu_message_t, mu_stream_t *); diff --git a/include/mailutils/msgset.h b/include/mailutils/msgset.h index f8b5b3f60..6eb0274f5 100644 --- a/include/mailutils/msgset.h +++ b/include/mailutils/msgset.h @@ -87,4 +87,2 @@ int mu_stream_msgset_format (mu_stream_t str, mu_msgset_t mset); -int mu_msgset_print (mu_stream_t str, mu_msgset_t msgset) - MU_DEPRECATED; diff --git a/include/mailutils/registrar.h b/include/mailutils/registrar.h index a9e621235..38789cd40 100644 --- a/include/mailutils/registrar.h +++ b/include/mailutils/registrar.h @@ -65,3 +65,2 @@ void mu_registrar_set_default_record (mu_record_t record); int mu_registrar_get_iterator (mu_iterator_t *); -int mu_registrar_get_list (mu_list_t *) MU_DEPRECATED; diff --git a/include/mailutils/sieve.h b/include/mailutils/sieve.h index 318b14829..d46af6909 100644 --- a/include/mailutils/sieve.h +++ b/include/mailutils/sieve.h @@ -332,6 +332,2 @@ int mu_sieve_compile_text (mu_sieve_machine_t mach, struct mu_locus_point const *pt); -int mu_sieve_compile_buffer (mu_sieve_machine_t mach, - const char *buf, int bufsize, - const char *fname, int line) - MU_DEPRECATED; int mu_sieve_mailbox (mu_sieve_machine_t mach, mu_mailbox_t mbox); diff --git a/libmailutils/address/address.c b/libmailutils/address/address.c index 28d6cca48..f93d63bef 100644 --- a/libmailutils/address/address.c +++ b/libmailutils/address/address.c @@ -482,35 +482,2 @@ DECL_AGET(email) -size_t -mu_address_format_string (mu_address_t addr, char *buf, size_t buflen) -{ - mu_stream_t str; - int rc; - - if (!buf) - rc = mu_nullstream_create (&str, MU_STREAM_WRITE); - else - rc = mu_fixed_memory_stream_create (&str, buf, buflen, MU_STREAM_WRITE); - if (rc == 0) - { - size_t size; - - mu_stream_stat_buffer statbuf; - mu_stream_set_stat (str, MU_STREAM_STAT_MASK (MU_STREAM_STAT_OUT), - statbuf); - rc = mu_stream_format_address (str, addr); - mu_stream_destroy (&str); - if (rc) - return 0; - size = statbuf[MU_STREAM_STAT_OUT]; - if (buf) - { - if (size + 1 >= buflen) - size = buflen - 1; - buf[size] = 0; - } - return size; - } - return 0; -} - static int @@ -634,8 +601,2 @@ mu_address_get_printable (mu_address_t addr, char *buf, size_t len, size_t *n) int -mu_address_to_string (mu_address_t addr, char *buf, size_t len, size_t *n) -{ - return mu_address_get_printable (addr, buf, len, n); -} - -int mu_address_get_count (mu_address_t addr, size_t *pcount) diff --git a/libmailutils/base/registrar.c b/libmailutils/base/registrar.c index debac377d..a99c29f54 100644 --- a/libmailutils/base/registrar.c +++ b/libmailutils/base/registrar.c @@ -96,16 +96,2 @@ _registrar_get_list (mu_list_t *plist) -/* Provided for backward compatibility */ -int -mu_registrar_get_list (mu_list_t *plist) -{ - static int warned; - - if (!warned) - { - mu_error (_("program uses mu_registrar_get_list(), which is deprecated")); - warned = 1; - } - return _registrar_get_list (plist); -} - int diff --git a/libmailutils/mailbox/body.c b/libmailutils/mailbox/body.c index 7fbd25dc7..9fafcdef0 100644 --- a/libmailutils/mailbox/body.c +++ b/libmailutils/mailbox/body.c @@ -348,9 +348,2 @@ body_get_stream (mu_body_t body, mu_stream_t *pstream, int ref) int -mu_body_get_stream (mu_body_t body, mu_stream_t *pstream) -{ - /* FIXME: Deprecation warning */ - return body_get_stream (body, pstream, 0); -} - -int mu_body_get_streamref (mu_body_t body, mu_stream_t *pstream) diff --git a/libmailutils/mailbox/header.c b/libmailutils/mailbox/header.c index 98433b740..3f49d59ca 100644 --- a/libmailutils/mailbox/header.c +++ b/libmailutils/mailbox/header.c @@ -1216,4 +1216,4 @@ header_size (mu_stream_t str, mu_off_t *psize) -static int -_header_get_stream (mu_header_t header, mu_stream_t *pstream, int ref) +int +mu_header_get_streamref (mu_header_t header, mu_stream_t *pstream) { @@ -1240,7 +1240,2 @@ _header_get_stream (mu_header_t header, mu_stream_t *pstream, int ref) } - if (!ref) - { - *pstream = header->stream; - return 0; - } return mu_streamref_create (pstream, header->stream); @@ -1248,15 +1243,2 @@ _header_get_stream (mu_header_t header, mu_stream_t *pstream, int ref) -int -mu_header_get_stream (mu_header_t header, mu_stream_t *pstream) -{ - /* FIXME: Deprecation warning */ - return _header_get_stream (header, pstream, 0); -} - -int -mu_header_get_streamref (mu_header_t header, mu_stream_t *pstream) -{ - return _header_get_stream (header, pstream, 1); -} - diff --git a/libmailutils/mailbox/mailbox.c b/libmailutils/mailbox/mailbox.c index 6065e418a..5d9a54adb 100644 --- a/libmailutils/mailbox/mailbox.c +++ b/libmailutils/mailbox/mailbox.c @@ -571,8 +571,2 @@ mu_mailbox_sync (mu_mailbox_t mbox) int -mu_mailbox_save_attributes (mu_mailbox_t mbox) -{ - return mu_mailbox_sync (mbox); -} - -int mu_mailbox_expunge (mu_mailbox_t mbox) diff --git a/libmailutils/mailbox/msgstream.c b/libmailutils/mailbox/msgstream.c index 2c7c90dfe..b897b637b 100644 --- a/libmailutils/mailbox/msgstream.c +++ b/libmailutils/mailbox/msgstream.c @@ -316,35 +316,2 @@ mkoutstream (mu_message_t msg) - -int -mu_message_get_stream (mu_message_t msg, mu_stream_t *pstream) -{ - int status; - - if (msg == NULL) - return EINVAL; - if (pstream == NULL) - return MU_ERR_OUT_PTR_NULL; - - /* FIXME: Deprecation warning */ - - if (msg->rawstream == NULL) - { - if (msg->_get_stream) - { - status = msg->_get_stream (msg, &msg->rawstream); - if (status) - return status; - } - else - { - status = mkoutstream (msg); - if (status) - return status; - status = mu_streamref_create (&msg->rawstream, msg->outstream); - } - } - *pstream = msg->rawstream; - return 0; -} - int diff --git a/libmailutils/mailer/mailer.c b/libmailutils/mailer/mailer.c index d19857f52..dffdd3ef9 100644 --- a/libmailutils/mailer/mailer.c +++ b/libmailutils/mailer/mailer.c @@ -734,14 +734,2 @@ mu_mailer_set_stream (mu_mailer_t mailer, mu_stream_t stream) int -mu_mailer_get_stream (mu_mailer_t mailer, mu_stream_t * pstream) -{ - /* FIXME: Deprecation warning */ - if (mailer == NULL) - return EINVAL; - if (pstream == NULL) - return MU_ERR_OUT_PTR_NULL; - *pstream = mailer->stream; - return 0; -} - -int mu_mailer_get_streamref (mu_mailer_t mailer, mu_stream_t * pstream) diff --git a/libmu_sieve/sieve-gram.y b/libmu_sieve/sieve-gram.y index c81dcfa62..660fa1f0a 100644 --- a/libmu_sieve/sieve-gram.y +++ b/libmu_sieve/sieve-gram.y @@ -1587,17 +1587,2 @@ mu_sieve_compile_text (mu_sieve_machine_t mach, -int -mu_sieve_compile_buffer (mu_sieve_machine_t mach, - const char *buf, int bufsize, - const char *fname, int line) -{ - int rc; - struct mu_locus_point loc = MU_LOCUS_POINT_INITIALIZER; - mu_locus_point_set_file (&loc, fname); - loc.mu_line = line; - rc = mu_sieve_compile_text (mach, buf, bufsize, &loc); - mu_locus_point_deinit (&loc); - return rc; -} - - |