return 0;
hdr = mutt_header_new();
- tmp_envelope = mutt_read_rfc822_header(f, hdr, 0, 0);
+ tmp_envelope = mutt_rfc822_read_header(f, hdr, 0, 0);
if (!(hdr->read || hdr->old))
result = 1;
fstat(fileno(s->fpin), &st);
b = mutt_body_new();
b->length = (LOFF_T) st.st_size;
- b->parts = mutt_parse_message_rfc822(s->fpin, b);
+ b->parts = mutt_rfc822_parse_message(s->fpin, b);
}
else
b = a;
}
mutt_env_to_local(msg->env);
- mutt_write_rfc822_header(ofp, msg->env, NULL, 1, 0);
+ mutt_rfc822_write_header(ofp, msg->env, NULL, 1, 0);
fputc('\n', ofp); /* tie off the header. */
/* now copy the body of the message. */
return;
}
- n = mutt_read_rfc822_header(ifp, NULL, 1, 0);
+ n = mutt_rfc822_read_header(ifp, NULL, 1, 0);
while ((i = fread(buffer, 1, sizeof(buffer), ifp)) > 0)
fwrite(buffer, 1, i, ofp);
mutt_file_fclose(&ofp);
maxuid = h.data->uid;
rewind(fp);
- /* NOTE: if Date: header is missing, mutt_read_rfc822_header depends
+ /* NOTE: if Date: header is missing, mutt_rfc822_read_header depends
* on h.received being set */
- ctx->hdrs[idx]->env = mutt_read_rfc822_header(fp, ctx->hdrs[idx], 0, 0);
- /* content built as a side-effect of mutt_read_rfc822_header */
+ ctx->hdrs[idx]->env = mutt_rfc822_read_header(fp, ctx->hdrs[idx], 0, 0);
+ /* content built as a side-effect of mutt_rfc822_read_header */
ctx->hdrs[idx]->content->length = h.content_length;
ctx->size += h.content_length;
/* It may be that the Status header indicates a message is read, but the
* IMAP server doesn't know the message has been \Seen. So we capture
* the server's notion of 'read' and if it differs from the message info
- * picked up in mutt_read_rfc822_header, we mark the message (and context
+ * picked up in mutt_rfc822_read_header, we mark the message (and context
* changed). Another possibility: ignore Status on IMAP? */
read = h->read;
- newenv = mutt_read_rfc822_header(msg->fp, h, 0, 0);
+ newenv = mutt_rfc822_read_header(msg->fp, h, 0, 0);
mutt_env_merge(h->env, &newenv);
/* see above. We want the new status in h->read, so we unset it manually
mutt_env_to_intl(msg->env, NULL, NULL);
}
- mutt_write_rfc822_header(fout, msg->env, msg->content, -1, 0);
+ mutt_rfc822_write_header(fout, msg->env, msg->content, -1, 0);
if (ResumeEditedDraftFiles)
fprintf(fout, "X-Mutt-Resume-Draft: 1\n");
fputc('\n', fout);
else
hdr->received = t - mutt_date_local_tz(t);
- hdr->env = mutt_read_rfc822_header(ctx->fp, hdr, 0, 0);
+ hdr->env = mutt_rfc822_read_header(ctx->fp, hdr, 0, 0);
loc = ftello(ctx->fp);
if (loc < 0)
curhdr->offset = loc;
curhdr->index = ctx->msgcount;
- curhdr->env = mutt_read_rfc822_header(ctx->fp, curhdr, 0, 0);
+ curhdr->env = mutt_rfc822_read_header(ctx->fp, curhdr, 0, 0);
/* if we know how long this message is, either just skip over the body,
* or if we don't know how many lines there are, count them now (this will
if (!h)
h = mutt_header_new();
- h->env = mutt_read_rfc822_header(f, h, 0, 0);
+ h->env = mutt_rfc822_read_header(f, h, 0, 0);
fstat(fileno(f), &st);
/* parse header */
hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new();
- hdr->env = mutt_read_rfc822_header(fp, hdr, 0, 0);
+ hdr->env = mutt_rfc822_read_header(fp, hdr, 0, 0);
hdr->env->newsgroups = mutt_str_strdup(nntp_data->group);
hdr->received = hdr->date_sent;
mutt_file_fclose(&fp);
/* parse header */
hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new();
- hdr->env = mutt_read_rfc822_header(fp, hdr, 0, 0);
+ hdr->env = mutt_rfc822_read_header(fp, hdr, 0, 0);
hdr->received = hdr->date_sent;
mutt_file_fclose(&fp);
unlink(tempfile);
mutt_hash_delete(ctx->subj_hash, hdr->env->real_subj, hdr);
mutt_env_free(&hdr->env);
- hdr->env = mutt_read_rfc822_header(msg->fp, hdr, 0, 0);
+ hdr->env = mutt_rfc822_read_header(msg->fp, hdr, 0, 0);
if (ctx->id_hash && hdr->env->message_id)
mutt_hash_insert(ctx->id_hash, hdr->env->message_id, hdr);
mx_alloc_memory(ctx);
hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new();
hdr->data = mutt_mem_calloc(1, sizeof(struct NntpHeaderData));
- hdr->env = mutt_read_rfc822_header(fp, hdr, 0, 0);
+ hdr->env = mutt_rfc822_read_header(fp, hdr, 0, 0);
mutt_file_fclose(&fp);
unlink(tempfile);
struct Context;
/**
- * mutt_read_rfc822_line - Read a header line from a file
+ * mutt_rfc822_read_line - Read a header line from a file
*
* Reads an arbitrarily long header field, and looks ahead for continuation
* lines. ``line'' must point to a dynamically allocated string; it is
* increased if more space is required to fit the whole line.
*/
-char *mutt_read_rfc822_line(FILE *f, char *line, size_t *linelen)
+char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen)
{
char *buf = line;
int ch;
p->type = digest ? TYPEMESSAGE : TYPETEXT;
p->disposition = DISPINLINE;
- while (*(line = mutt_read_rfc822_line(fp, line, &linelen)) != 0)
+ while (*(line = mutt_rfc822_read_line(fp, line, &linelen)) != 0)
{
/* Find the value of the current header */
c = strchr(line, ':');
{
fseeko(fp, b->offset, SEEK_SET);
if (mutt_is_message_type(b->type, b->subtype))
- b->parts = mutt_parse_message_rfc822(fp, b);
+ b->parts = mutt_rfc822_parse_message(fp, b);
else if (mutt_str_strcasecmp(b->subtype, "external-body") == 0)
b->parts = mutt_read_mime_header(fp, 0);
else
}
/**
- * mutt_parse_message_rfc822 - parse a Message/RFC822 body
+ * mutt_rfc822_parse_message - parse a Message/RFC822 body
* @param fp stream to read from
* @param parent info about the message/rfc822 body part
*
* NOTE: this assumes that `parent->length' has been set!
*/
-struct Body *mutt_parse_message_rfc822(FILE *fp, struct Body *parent)
+struct Body *mutt_rfc822_parse_message(FILE *fp, struct Body *parent)
{
struct Body *msg = NULL;
parent->hdr = mutt_header_new();
parent->hdr->offset = ftello(fp);
- parent->hdr->env = mutt_read_rfc822_header(fp, parent->hdr, 0, 0);
+ parent->hdr->env = mutt_rfc822_read_header(fp, parent->hdr, 0, 0);
msg = parent->hdr->content;
/* ignore the length given in the content-length since it could be wrong
cur->attach_valid = false;
}
-int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line,
+int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
char *p, short user_hdrs, short weed, short do_2047)
{
int matched = 0;
}
/**
- * mutt_read_rfc822_header - parses an RFC822 header
+ * mutt_rfc822_read_header - parses an RFC822 header
* @param f Stream to read from
* @param hdr Header structure of current message (optional)
* @param user_hdrs If set, store user headers
*
* Caller should free the Envelope using mutt_env_free().
*/
-struct Envelope *mutt_read_rfc822_header(FILE *f, struct Header *hdr,
+struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr,
short user_hdrs, short weed)
{
struct Envelope *e = mutt_env_new();
while ((loc = ftello(f)) != -1)
{
- line = mutt_read_rfc822_line(f, line, &linelen);
+ line = mutt_rfc822_read_line(f, line, &linelen);
if (*line == '\0')
break;
p = strpbrk(line, ": \t");
if (!*p)
continue; /* skip empty header fields */
- mutt_parse_rfc822_line(e, hdr, line, p, user_hdrs, weed, 1);
+ mutt_rfc822_parse_line(e, hdr, line, p, user_hdrs, weed, 1);
}
FREE(&line);
{
if (pat->op == MUTT_HEADER)
{
- buf = mutt_read_rfc822_line(fp, buf, &blen);
+ buf = mutt_rfc822_read_line(fp, buf, &blen);
if (*buf == '\0')
break;
}
case 0:
{
rewind(f);
- h->env = mutt_read_rfc822_header(f, h, 0, 0);
+ h->env = mutt_rfc822_read_header(f, h, 0, 0);
h->content->length = length - h->content->offset + 1;
rewind(f);
while (!feof(f))
mutt_hash_delete(ctx->subj_hash, h->env->real_subj, h);
mutt_label_hash_remove(ctx, h);
mutt_env_free(&h->env);
- h->env = mutt_read_rfc822_header(msg->fp, h, 0, 0);
+ h->env = mutt_rfc822_read_header(msg->fp, h, 0, 0);
if (ctx->subj_hash && h->env->real_subj)
mutt_hash_insert(ctx->subj_hash, h->env->real_subj, h);
mutt_label_hash_add(ctx, h);
fseeko(fp, hdr->offset, SEEK_SET);
newhdr->offset = hdr->offset;
/* enable header weeding for resent messages */
- newhdr->env = mutt_read_rfc822_header(fp, newhdr, 1, resend);
+ newhdr->env = mutt_rfc822_read_header(fp, newhdr, 1, resend);
newhdr->content->length = hdr->content->length;
mutt_parse_part(fp, newhdr->content);
struct Body *mutt_remove_multipart(struct Body *b);
struct Body *mutt_make_multipart(struct Body *b);
struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off, int digest);
-struct Body *mutt_parse_message_rfc822(FILE *fp, struct Body *parent);
+struct Body *mutt_rfc822_parse_message(FILE *fp, struct Body *parent);
struct Body *mutt_read_mime_header(FILE *fp, int digest);
struct Content *mutt_get_content_info(const char *fname, struct Body *b);
-char *mutt_read_rfc822_line(FILE *f, char *line, size_t *linelen);
-struct Envelope *mutt_read_rfc822_header(FILE *f, struct Header *hdr, short user_hdrs, short weed);
+char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen);
+struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, short user_hdrs, short weed);
int is_from(const char *s, char *path, size_t pathlen, time_t *tp);
int mutt_parse_unmono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_push(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buffer *err);
-int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, char *p,
+int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line, char *p,
short user_hdrs, short weed, short do_2047);
int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_unscore(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_write_mime_header(struct Body *a, FILE *f);
int mutt_write_one_header(FILE *fp, const char *tag, const char *value,
const char *pfx, int wraplen, int flags);
-int mutt_write_rfc822_header(FILE *fp, struct Envelope *env, struct Body *attach, int mode, int privacy);
+int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, struct Body *attach, int mode, int privacy);
void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim);
int mutt_yesorno(const char *msg, int def);
void mutt_set_header_color(struct Context *ctx, struct Header *curhdr);
WriteBcc = false;
#endif
#ifdef MIXMASTER
- mutt_write_rfc822_header(tempfp, msg->env, msg->content, 0, !STAILQ_EMPTY(&msg->chain));
+ mutt_rfc822_write_header(tempfp, msg->env, msg->content, 0, !STAILQ_EMPTY(&msg->chain));
#endif
#ifndef MIXMASTER
- mutt_write_rfc822_header(tempfp, msg->env, msg->content, 0, 0);
+ mutt_rfc822_write_header(tempfp, msg->env, msg->content, 0, 0);
#endif
#ifdef USE_SMTP
if (old_write_bcc)
goto cleanup;
fseeko(fpin, a->offset, SEEK_SET);
- a->parts = mutt_parse_message_rfc822(fpin, a);
+ a->parts = mutt_rfc822_parse_message(fpin, a);
transform_to_7bit(a->parts, fpin);
body->hdr = mutt_header_new();
body->hdr->offset = 0;
/* we don't need the user headers here */
- body->hdr->env = mutt_read_rfc822_header(fp, body->hdr, 0, 0);
+ body->hdr->env = mutt_rfc822_read_header(fp, body->hdr, 0, 0);
if (WithCrypto)
body->hdr->security = pgp;
mutt_update_encoding(body);
* anonymous remailer chains.
*/
-int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
+int mutt_rfc822_write_header(FILE *fp, struct Envelope *env,
struct Body *attach, int mode, int privacy)
{
char buffer[LONG_STRING];
goto done;
}
- /* post == 1 => postpone message. Set mode = -1 in mutt_write_rfc822_header()
- * post == 0 => Normal mode. Set mode = 0 in mutt_write_rfc822_header()
+ /* post == 1 => postpone message. Set mode = -1 in mutt_rfc822_write_header()
+ * post == 0 => Normal mode. Set mode = 0 in mutt_rfc822_write_header()
* */
- mutt_write_rfc822_header(msg->fp, hdr->env, hdr->content, post ? -post : 0, 0);
+ mutt_rfc822_write_header(msg->fp, hdr->env, hdr->content, post ? -post : 0, 0);
/* (postponement) if this was a reply of some sort, <msgid> contains the
* Message-ID: of message replied to. Save it using a special X-Mutt-
if (f.magic == MUTT_MMDF || f.magic == MUTT_MBOX)
fprintf(msg->fp, "Status: RO\n");
- /* mutt_write_rfc822_header() only writes out a Date: header with
+ /* mutt_rfc822_write_header() only writes out a Date: header with
* mode == 0, i.e. _not_ postponement; so write out one ourself */
if (post)
fprintf(msg->fp, "%s", mutt_date_make_date(buf, sizeof(buf)));
size_t taglen = mutt_str_strlen(tag);
safe_asprintf(&scratch, "%s: %s", tag, value);
- scratch[taglen] = 0; /* overwrite the colon as mutt_parse_rfc822_line expects */
+ scratch[taglen] = 0; /* overwrite the colon as mutt_rfc822_parse_line expects */
value = mutt_str_skip_email_wsp(&scratch[taglen + 1]);
- mutt_parse_rfc822_line(e, NULL, scratch, value, 1, 0, 1);
+ mutt_rfc822_parse_line(e, NULL, scratch, value, 1, 0, 1);
FREE(&scratch);
}
}