#include <h/signals.h>
#include <errno.h>
#include <signal.h>
-#include <h/mts.h>
static struct swit switches[] = {
#define CRETSW 0
{
int publicsw = -1, zerosw = 0;
int create = 1, unseensw = 1;
- int fd, msgnum, seqp = 0;
+ int fd, msgnum;
+ size_t seqp = 0;
char *cp, *maildir, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments, *seqs[NUMATTRS+1];
struct msgs *mp;
/* read user profile/context */
context_read();
- mts_init(invo_name);
arguments = getarguments(invo_name, argc, argv, 1);
argp = arguments;
if (folder)
adios(NULL, "only one folder at a time!");
else
- folder = pluspath(cp);
+ folder = getcpy(expandfol(cp));
} else {
adios(NULL, "usage: %s [+folder] [switches]",
invo_name);
seqs[seqp] = NULL; /* NULL terminate list of sequences */
- if (!context_find("path"))
- free(path("./", TFOLDER));
-
/* if no folder is given, use default folder */
if (!folder)
- folder = getfolder(0);
- maildir = m_maildir(folder);
+ folder = getdeffol();
+ maildir = toabsdir(folder);
/* check if folder exists */
if (stat(maildir, &st) == NOTOK) {
** Link message into folder, and possibly add
** to the Unseen-Sequence's.
*/
- if ((msgnum = folder_addmsg(&mp, tmpfilenam, 0, unseensw, 0, 0,
- (char *)0)) == -1)
+ if ((msgnum = folder_addmsg(&mp, tmpfilenam, 0, unseensw, 0, 0, NULL))
+ == -1)
done(1);
/*
done(1);
}
- seq_setunseen(mp, 0); /* synchronize any Unseen-Sequence's */
+ seq_setunseen(mp, 1); /* add new msgs to unseen sequences */
seq_save(mp); /* synchronize and save message sequences */
folder_free(mp); /* free folder/message structure */