summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2019-11-11 12:12:43 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2019-11-11 12:12:43 (GMT)
commitca939cbb5e494b18d4faf553e715828872a6c1bc (patch) (side-by-side diff)
treeda27bb03c7a177f040429757ec5c88195c58f8b4
parentb8cdb89ea0af82b27137ee60ad1ffebd9f66a849 (diff)
downloadmailutils-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);
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--include/mailutils/address.h10
-rw-r--r--include/mailutils/body.h1
-rw-r--r--include/mailutils/header.h1
-rw-r--r--include/mailutils/mailbox.h1
-rw-r--r--include/mailutils/mailer.h1
-rw-r--r--include/mailutils/message.h1
-rw-r--r--include/mailutils/msgset.h2
-rw-r--r--include/mailutils/registrar.h1
-rw-r--r--include/mailutils/sieve.h4
-rw-r--r--libmailutils/address/address.c39
-rw-r--r--libmailutils/base/registrar.c14
-rw-r--r--libmailutils/mailbox/body.c7
-rw-r--r--libmailutils/mailbox/header.c22
-rw-r--r--libmailutils/mailbox/mailbox.c6
-rw-r--r--libmailutils/mailbox/msgstream.c33
-rw-r--r--libmailutils/mailer/mailer.c12
-rw-r--r--libmu_sieve/sieve-gram.y15
17 files changed, 2 insertions, 168 deletions
diff --git a/include/mailutils/address.h b/include/mailutils/address.h
index ea9844c..6aa166d 100644
--- a/include/mailutils/address.h
+++ b/include/mailutils/address.h
@@ -146,16 +146,6 @@ extern int mu_address_union (mu_address_t *a, mu_address_t b);
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 ba98646..c8ef641 100644
--- a/include/mailutils/body.h
+++ b/include/mailutils/body.h
@@ -30,7 +30,6 @@ extern void * mu_body_get_owner (mu_body_t);
extern int mu_body_is_modified (mu_body_t);
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);
extern int mu_body_set_stream (mu_body_t, mu_stream_t, void *owner);
extern int mu_body_set_get_stream (mu_body_t,
diff --git a/include/mailutils/header.h b/include/mailutils/header.h
index f0c0d70..25b78f5 100644
--- a/include/mailutils/header.h
+++ b/include/mailutils/header.h
@@ -151,7 +151,6 @@ extern int mu_header_get_field_value_unfold (mu_header_t header, size_t num,
extern int mu_header_aget_field_value_unfold (mu_header_t header, size_t num,
char **pvalue);
-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 *);
/* FIXME: This function does not exist:
diff --git a/include/mailutils/mailbox.h b/include/mailutils/mailbox.h
index e54ae88..dfc2146 100644
--- a/include/mailutils/mailbox.h
+++ b/include/mailutils/mailbox.h
@@ -70,7 +70,6 @@ extern int mu_mailbox_messages_recent (mu_mailbox_t, size_t *);
extern int mu_mailbox_message_unseen (mu_mailbox_t, size_t *);
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;
extern int mu_mailbox_attach_ticket (mu_mailbox_t mbox);
diff --git a/include/mailutils/mailer.h b/include/mailutils/mailer.h
index 00287e3..9b0ae6e 100644
--- a/include/mailutils/mailer.h
+++ b/include/mailutils/mailer.h
@@ -51,7 +51,6 @@ extern int mu_mailer_get_url_default (const char** url);
extern int mu_mailer_get_property (mu_mailer_t, mu_property_t *);
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 *);
extern int mu_mailer_set_stream (mu_mailer_t, mu_stream_t);
extern int mu_mailer_get_observable (mu_mailer_t, mu_observable_t *);
diff --git a/include/mailutils/message.h b/include/mailutils/message.h
index f2e8b2c..c796c4e 100644
--- a/include/mailutils/message.h
+++ b/include/mailutils/message.h
@@ -133,7 +133,6 @@ extern int mu_message_set_header (mu_message_t, mu_header_t, void *);
extern int mu_message_get_body (mu_message_t, mu_body_t *);
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 *);
extern int mu_message_set_stream (mu_message_t, mu_stream_t, void *);
diff --git a/include/mailutils/msgset.h b/include/mailutils/msgset.h
index f8b5b3f..6eb0274 100644
--- a/include/mailutils/msgset.h
+++ b/include/mailutils/msgset.h
@@ -85,8 +85,6 @@ int mu_msgset_parse_imap (mu_msgset_t set, int mode, const char *s,
int mu_stream_msgset_format (mu_stream_t str,
struct mu_msgset_format const *fmt,
mu_msgset_t mset);
-int mu_msgset_print (mu_stream_t str, mu_msgset_t msgset)
- MU_DEPRECATED;
static inline int
mu_msgset_imap_print (mu_stream_t str, mu_msgset_t mset)
diff --git a/include/mailutils/registrar.h b/include/mailutils/registrar.h
index a9e6212..38789cd 100644
--- a/include/mailutils/registrar.h
+++ b/include/mailutils/registrar.h
@@ -63,7 +63,6 @@ void mu_registrar_set_default_record (mu_record_t record);
/* Registration. */
int mu_registrar_get_iterator (mu_iterator_t *);
-int mu_registrar_get_list (mu_list_t *) MU_DEPRECATED;
int mu_registrar_lookup_scheme (const char *scheme,
mu_record_t *precord);
diff --git a/include/mailutils/sieve.h b/include/mailutils/sieve.h
index 318b148..d46af69 100644
--- a/include/mailutils/sieve.h
+++ b/include/mailutils/sieve.h
@@ -330,10 +330,6 @@ int mu_sieve_compile (mu_sieve_machine_t mach, const char *name);
int mu_sieve_compile_text (mu_sieve_machine_t mach,
const char *buf, size_t bufsize,
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);
int mu_sieve_message (mu_sieve_machine_t mach, mu_message_t message);
int mu_sieve_disass (mu_sieve_machine_t mach);
diff --git a/libmailutils/address/address.c b/libmailutils/address/address.c
index 28d6cca..f93d63b 100644
--- a/libmailutils/address/address.c
+++ b/libmailutils/address/address.c
@@ -480,39 +480,6 @@ mu_address_sget_email (mu_address_t addr, size_t no, char const **sptr)
DECL_GET(email)
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
_address_is_group (mu_address_t addr)
{
@@ -632,12 +599,6 @@ 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)
{
size_t i, count = 0;
diff --git a/libmailutils/base/registrar.c b/libmailutils/base/registrar.c
index debac37..a99c29f 100644
--- a/libmailutils/base/registrar.c
+++ b/libmailutils/base/registrar.c
@@ -94,20 +94,6 @@ _registrar_get_list (mu_list_t *plist)
return status;
}
-/* 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
mu_registrar_get_iterator (mu_iterator_t *pitr)
{
diff --git a/libmailutils/mailbox/body.c b/libmailutils/mailbox/body.c
index 7fbd25d..9fafcde 100644
--- a/libmailutils/mailbox/body.c
+++ b/libmailutils/mailbox/body.c
@@ -346,13 +346,6 @@ 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)
{
return body_get_stream (body, pstream, 1);
diff --git a/libmailutils/mailbox/header.c b/libmailutils/mailbox/header.c
index 98433b7..3f49d59 100644
--- a/libmailutils/mailbox/header.c
+++ b/libmailutils/mailbox/header.c
@@ -1214,8 +1214,8 @@ header_size (mu_stream_t str, mu_off_t *psize)
return status;
}
-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)
{
if (header == NULL)
return EINVAL;
@@ -1238,27 +1238,9 @@ _header_get_stream (mu_header_t header, mu_stream_t *pstream, int ref)
str->hdr = header;
header->stream = (mu_stream_t) str;
}
- if (!ref)
- {
- *pstream = header->stream;
- return 0;
- }
return mu_streamref_create (pstream, header->stream);
}
-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);
-}
-
int
mu_header_set_fill (mu_header_t header, int
diff --git a/libmailutils/mailbox/mailbox.c b/libmailutils/mailbox/mailbox.c
index 6065e41..5d9a54a 100644
--- a/libmailutils/mailbox/mailbox.c
+++ b/libmailutils/mailbox/mailbox.c
@@ -569,12 +569,6 @@ mu_mailbox_sync (mu_mailbox_t mbox)
/* Historic alias: */
int
-mu_mailbox_save_attributes (mu_mailbox_t mbox)
-{
- return mu_mailbox_sync (mbox);
-}
-
-int
mu_mailbox_expunge (mu_mailbox_t mbox)
{
_MBOX_CHECK_Q (mbox, _expunge);
diff --git a/libmailutils/mailbox/msgstream.c b/libmailutils/mailbox/msgstream.c
index 2c7c90d..b897b63 100644
--- a/libmailutils/mailbox/msgstream.c
+++ b/libmailutils/mailbox/msgstream.c
@@ -314,39 +314,6 @@ mkoutstream (mu_message_t msg)
return status;
}
-
-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
mu_message_get_streamref (mu_message_t msg, mu_stream_t *pstream)
{
diff --git a/libmailutils/mailer/mailer.c b/libmailutils/mailer/mailer.c
index d19857f..dffdd3e 100644
--- a/libmailutils/mailer/mailer.c
+++ b/libmailutils/mailer/mailer.c
@@ -732,18 +732,6 @@ 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)
{
if (mailer == NULL)
diff --git a/libmu_sieve/sieve-gram.y b/libmu_sieve/sieve-gram.y
index c81dcfa..660fa1f 100644
--- a/libmu_sieve/sieve-gram.y
+++ b/libmu_sieve/sieve-gram.y
@@ -1585,19 +1585,4 @@ mu_sieve_compile_text (mu_sieve_machine_t mach,
return with_machine (mach, sieve_compile_strbuf, &buf);
}
-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;
-}
-
-

Return to:

Send suggestions and report system problems to the System administrator.