diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-02-13 16:36:53 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-02-13 16:36:53 +0000 |
commit | 9044e24905cfa8794b176a53ea009cf2fa2f9906 (patch) | |
tree | ac60bfec4bfd85c34b4331a5874e9b1c99b3c1d2 | |
parent | bc83411afcf0c4901be8fd5e08a4057f53c69429 (diff) | |
download | mailutils-9044e24905cfa8794b176a53ea009cf2fa2f9906.tar.gz mailutils-9044e24905cfa8794b176a53ea009cf2fa2f9906.tar.bz2 |
(mh_format_str): New function.
-rw-r--r-- | mh/mh_format.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mh/mh_format.c b/mh/mh_format.c index f4311a440..f875f2110 100644 --- a/mh/mh_format.c +++ b/mh/mh_format.c @@ -559,6 +559,23 @@ mh_format (mh_format_t *fmt, message_t msg, size_t msgno, return mach.ind; } +int +mh_format_str (mh_format_t *fmt, char *str, size_t width, char **pret) +{ + message_t msg = NULL; + header_t hdr = NULL; + int rc; + + if (message_create (&msg, NULL)) + return -1; + message_get_header (msg, &hdr); + header_set_value (hdr, "text", str, 1); + rc = mh_format (fmt, msg, 1, width, pret); + message_destroy (&msg, NULL); + return rc; +} + + void mh_format_dump (mh_format_t *fmt) { |