projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add m_dirname that implement a non broken libgen-like function.
[apps/madmutt.git]
/
compose.c
diff --git
a/compose.c
b/compose.c
index
2e96e7d
..
a21776e
100644
(file)
--- a/
compose.c
+++ b/
compose.c
@@
-11,22
+11,7
@@
* 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 <errno.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
#include <lib-sys/unix.h>
#include <lib-sys/unix.h>
@@
-35,24
+20,20
@@
#include <lib-ui/curses.h>
#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-ui/curses.h>
#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
+#include <lib-mx/mx.h>
#include "mutt.h"
#include "mutt.h"
+#include "alias.h"
#include "mutt_idna.h"
#include "mutt_idna.h"
-#include "rfc1524.h"
#include "attach.h"
#include "recvattach.h"
#include "sort.h"
#include "charset.h"
#include "attach.h"
#include "recvattach.h"
#include "sort.h"
#include "charset.h"
-#include "mx.h"
#include "buffy.h"
#include "buffy.h"
-#include "compose.h"
-
-#ifdef MIXMASTER
#include "remailer.h"
#include "remailer.h"
-#endif
#ifdef USE_NNTP
#ifdef USE_NNTP
-#include
"nntp.h"
+#include
<nntp/nntp.h>
#endif
static const char *There_are_no_attachments = N_("There are no attachments.");
#endif
static const char *There_are_no_attachments = N_("There are no attachments.");
@@
-69,10
+50,7
@@
enum {
HDR_SUBJECT,
HDR_REPLYTO,
HDR_FCC,
HDR_SUBJECT,
HDR_REPLYTO,
HDR_FCC,
-
-#ifdef MIXMASTER
HDR_MIX,
HDR_MIX,
-#endif
HDR_CRYPT,
HDR_CRYPTINFO,
HDR_CRYPT,
HDR_CRYPTINFO,
@@
-102,12
+80,10
@@
static const char *Prompts[] = {
"Bcc: ",
"Subject: ",
"Reply-To: ",
"Bcc: ",
"Subject: ",
"Reply-To: ",
- "Fcc: "
+ "Fcc: "
,
#ifdef USE_NNTP
#ifdef USE_NNTP
-#ifdef MIXMASTER
- , ""
-#endif
- , "", "", "Newsgroups: ", "Followup-To: ", "X-Comment-To: "
+ "",
+ "", "", "Newsgroups: ", "Followup-To: ", "X-Comment-To: "
#endif
};
#endif
};
@@
-195,9
+171,6
@@
static void redraw_crypt_lines (HEADER * msg)
}
}
}
}
-
-#ifdef MIXMASTER
-
static void redraw_mix_line (string_list_t * chain)
{
int c;
static void redraw_mix_line (string_list_t * chain)
{
int c;
@@
-226,7
+199,6
@@
static void redraw_mix_line (string_list_t * chain)
c += m_strlen(t) + 2;
}
}
c += m_strlen(t) + 2;
}
}
-#endif /* MIXMASTER */
static int check_attachments (ATTACHPTR ** idx, short idxlen)
{
static int check_attachments (ATTACHPTR ** idx, short idxlen)
{
@@
-296,10
+268,7
@@
static void draw_envelope (HEADER * msg, char *fcc)
mutt_paddstr (W, fcc);
redraw_crypt_lines (msg);
mutt_paddstr (W, fcc);
redraw_crypt_lines (msg);
-
-#ifdef MIXMASTER
redraw_mix_line (msg->chain);
redraw_mix_line (msg->chain);
-#endif
SETCOLOR (MT_COLOR_STATUS);
mvaddstr (HDR_ATTACH - 1, SW, _("-- Attachments"));
SETCOLOR (MT_COLOR_STATUS);
mvaddstr (HDR_ATTACH - 1, SW, _("-- Attachments"));
@@
-366,7
+335,7
@@
static int delete_attachment (MUTTMENU * menu, short *idxlen, int x)
idx[x]->content->next = NULL;
idx[x]->content->parts = NULL;
idx[x]->content->next = NULL;
idx[x]->content->parts = NULL;
-
mutt_free_body
(&(idx[x]->content));
+
body_list_wipe
(&(idx[x]->content));
p_delete(&idx[x]->tree);
p_delete(&idx[x]);
for (; x < *idxlen - 1; x++)
p_delete(&idx[x]->tree);
p_delete(&idx[x]);
for (; x < *idxlen - 1; x++)
@@
-400,7
+369,7
@@
static void update_idx (MUTTMENU * menu, ATTACHPTR ** idx, short idxlen)
static unsigned long cum_attachs_size (MUTTMENU * menu)
{
static unsigned long cum_attachs_size (MUTTMENU * menu)
{
- size_t s;
+ s
s
ize_t s;
unsigned short i;
ATTACHPTR **idx = menu->data;
CONTENT *info;
unsigned short i;
ATTACHPTR **idx = menu->data;
CONTENT *info;
@@
-442,7
+411,10
@@
static unsigned long cum_attachs_size (MUTTMENU * menu)
* help when modifying this function.
*/
* help when modifying this function.
*/
-static const char *compose_format_str (char *buf, size_t buflen, char op,
+static void compose_status_line (char *buf, ssize_t buflen, MUTTMENU * menu,
+ const char *p);
+
+static const char *compose_format_str (char *buf, ssize_t buflen, char op,
const char *src, const char *prefix,
const char *ifstring,
const char *elsestring,
const char *src, const char *prefix,
const char *ifstring,
const char *elsestring,
@@
-508,7
+480,8
@@
static void compose_status_line (char *buf, ssize_t buflen, MUTTMENU * menu,
*/
int mutt_compose_menu (HEADER * msg, /* structure for new message */
char *fcc, /* where to save a copy of the message */
*/
int mutt_compose_menu (HEADER * msg, /* structure for new message */
char *fcc, /* where to save a copy of the message */
- size_t fcclen, HEADER * cur)
+ ssize_t fcclen,
+ HEADER * cur __attribute__ ((unused)))
{ /* current message */
char helpstr[SHORT_STRING];
char buf[LONG_STRING];
{ /* current message */
char helpstr[SHORT_STRING];
char buf[LONG_STRING];
@@
-700,7
+673,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
if ((op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
const char *tag = NULL;
if ((op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
const char *tag = NULL;
- c
onst c
har *err = NULL;
+ char *err = NULL;
mutt_env_to_local (msg->env);
mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
mutt_env_to_local (msg->env);
mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
@@
-1050,11
+1023,8
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
break;
}
break;
}
-
-#ifdef MIXMASTER
if (msg->chain && mix_check_message (msg) != 0)
break;
if (msg->chain && mix_check_message (msg) != 0)
break;
-#endif
if (!fccSet && *fcc) {
if ((i = query_quadoption (OPT_COPY,
if (!fccSet && *fcc) {
if ((i = query_quadoption (OPT_COPY,
@@
-1081,14
+1051,6
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
idx[menu->current]->content->unlink =
!idx[menu->current]->content->unlink;
idx[menu->current]->content->unlink =
!idx[menu->current]->content->unlink;
-#if 0
- /* OPTRESOLVE is otherwise ignored on this menu.
- * Where's the bug?
- */
-
- if (option (OPTRESOLVE) && menu->current + 1 < menu->max)
- menu->current++;
-# endif
menu->redraw = REDRAW_INDEX;
/* No send2hook since this doesn't change the message. */
break;
menu->redraw = REDRAW_INDEX;
/* No send2hook since this doesn't change the message. */
break;
@@
-1177,7
+1139,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
p_delete(&idx[idxlen]);
continue;
}
p_delete(&idx[idxlen]);
continue;
}
-
fclose (
fp);
+
m_fclose(&
fp);
if ((idx[idxlen]->content = mutt_make_file_attach (fname)) == NULL) {
mutt_error
if ((idx[idxlen]->content = mutt_make_file_attach (fname)) == NULL) {
mutt_error
@@
-1259,7
+1221,7
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
idx[idxlen]->content->parts = NULL;
if (idx[idxlen]->unowned)
idx[idxlen]->content->unlink = 0;
idx[idxlen]->content->parts = NULL;
if (idx[idxlen]->unowned)
idx[idxlen]->content->unlink = 0;
-
mutt_free_body
(&idx[idxlen]->content);
+
body_list_wipe
(&idx[idxlen]->content);
p_delete(&idx[idxlen]->tree);
p_delete(&idx[idxlen]);
}
p_delete(&idx[idxlen]->tree);
p_delete(&idx[idxlen]);
}
@@
-1359,15
+1321,10
@@
int mutt_compose_menu (HEADER * msg, /* structure for new message */
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
-
-#ifdef MIXMASTER
case OP_COMPOSE_MIX:
case OP_COMPOSE_MIX:
-
mix_make_chain (&msg->chain, &menu->redraw);
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
mix_make_chain (&msg->chain, &menu->redraw);
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
-#endif
-
}
/* Draw formated compose status line */
}
/* Draw formated compose status line */