projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
optimizations, remove horrors.
[apps/madmutt.git]
/
lib-ui
/
hdrline.c
diff --git
a/lib-ui/hdrline.c
b/lib-ui/hdrline.c
index
2bc1bed
..
cb5a5f4
100644
(file)
--- a/
lib-ui/hdrline.c
+++ b/
lib-ui/hdrline.c
@@
-7,21
+7,11
@@
* please see the file GPL in the top level source directory.
*/
* please see the file GPL in the top level source directory.
*/
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <locale.h>
-
-#include <lib-lib/rx.h>
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
#include <lib-mime/mime.h>
#include <lib-mime/mime.h>
-
#include <lib-ui/curses.h>
#include <lib-ui/curses.h>
+#include <lib-mx/mx.h>
#include "mutt.h"
#include "alias.h"
#include "mutt.h"
#include "alias.h"
@@
-225,14
+215,14
@@
static const char *hdr_format_str (char *dest,
char op,
const char *src,
const char *prefix,
char op,
const char *src,
const char *prefix,
- const char *ifstr
ing
,
- const char *els
estring
,
-
unsigned long
data, format_flag flags)
+ const char *ifstr,
+ const char *els
tr
,
+
anytype
data, format_flag flags)
{
{
- struct hdr_format_info *hfi =
(struct hdr_format_info *) data
;
+ struct hdr_format_info *hfi =
data.ptr
;
HEADER *hdr, *htmp;
CONTEXT *ctx;
HEADER *hdr, *htmp;
CONTEXT *ctx;
- char fmt[S
HORT_STRING], buf2[SHORT_
STRING], ch, *p;
+ char fmt[S
TRING], buf2[
STRING], ch, *p;
int do_locales, i;
int optional = (flags & M_FORMAT_OPTIONAL);
int threads = ((Sort & SORT_MASK) == SORT_THREADS);
int do_locales, i;
int optional = (flags & M_FORMAT_OPTIONAL);
int threads = ((Sort & SORT_MASK) == SORT_THREADS);
@@
-405,7
+395,7
@@
static const char *hdr_format_str (char *dest,
case 'f':
buf2[0] = 0;
case 'f':
buf2[0] = 0;
- rfc822_
write_address
(buf2, sizeof (buf2), hdr->env->from, 1);
+ rfc822_
addrcat
(buf2, sizeof (buf2), hdr->env->from, 1);
mutt_format_s (dest, destlen, prefix, buf2);
break;
mutt_format_s (dest, destlen, prefix, buf2);
break;
@@
-448,7
+438,7
@@
static const char *hdr_format_str (char *dest,
int j = 0;
for (i = 0; hdr->env->from && hdr->env->from->personal &&
int j = 0;
for (i = 0; hdr->env->from && hdr->env->from->personal &&
- hdr->env->from->personal[i] && j < S
HORT_S
TRING - 1; i++) {
+ hdr->env->from->personal[i] && j < STRING - 1; i++) {
if (isalpha ((int) hdr->env->from->personal[i])) {
if (!iflag) {
buf2[j++] = hdr->env->from->personal[i];
if (isalpha ((int) hdr->env->from->personal[i])) {
if (!iflag) {
buf2[j++] = hdr->env->from->personal[i];
@@
-638,12
+628,6
@@
static const char *hdr_format_str (char *dest,
{
int count = 0;
{
int count = 0;
- if (option (OPTCOUNTATTACH)) {
- if (!hdr->content->parts)
- mutt_parse_mime_message(ctx, hdr);
- count = mutt_count_body_parts(hdr, 0);
- }
-
/* The recursion allows messages without depth to return 0. */
if (optional)
optional = count != 0;
/* The recursion allows messages without depth to return 0. */
if (optional)
optional = count != 0;
@@
-718,16
+702,14
@@
static const char *hdr_format_str (char *dest,
break;
default:
break;
default:
-
snprintf (dest, destlen, "%%%s%c", prefix, op)
;
+
*dest = 0
;
break;
}
if (optional)
break;
}
if (optional)
- mutt_FormatString (dest, destlen, ifstring, hdr_format_str,
- (unsigned long) hfi, flags);
+ m_strformat(dest, destlen, ifstr, hdr_format_str, data, flags);
else if (flags & M_FORMAT_OPTIONAL)
else if (flags & M_FORMAT_OPTIONAL)
- mutt_FormatString (dest, destlen, elsestring, hdr_format_str,
- (unsigned long) hfi, flags);
+ m_strformat(dest, destlen, elstr, hdr_format_str, data, flags);
return (src);
#undef THREAD_NEW
return (src);
#undef THREAD_NEW
@@
-743,6
+725,5
@@
_mutt_make_string (char *dest, ssize_t destlen, const char *s, CONTEXT * ctx,
hfi.hdr = hdr;
hfi.ctx = ctx;
hfi.hdr = hdr;
hfi.ctx = ctx;
- mutt_FormatString (dest, destlen, s, hdr_format_str, (unsigned long) &hfi,
- flags);
+ m_strformat(dest, destlen, s, hdr_format_str, &hfi, flags);
}
}