return mhs->flags[i];
}
-#if 0
-
-/* unused */
-
-static short mhs_unset (struct mh_sequences *mhs, int i, short f)
-{
- mhs_alloc (mhs, i);
- mhs->flags[i] &= ~f;
- return mhs->flags[i];
-}
-
-#endif
-
static void mh_read_token (char *t, int *first, int *last)
{
char *p;
for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d",
- dest->path, NONULL (Hostname), (int) getpid (), Counter++);
+ dest->path, NONULL(MCore.shorthost), (int) getpid (), Counter++);
umask (Umask);
if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
if (errno != EEXIST) {
snprintf (sequences, sizeof (sequences), "%s/.mh_sequences", ctx->path);
if ((ofp = fopen (sequences, "r"))) {
while ((buff = mutt_read_line (buff, &sz, ofp, &line))) {
- if (unseen && !strncmp (buff, seq_unseen, m_strlen(seq_unseen))) {
+ if (unseen && !m_strncmp (buff, seq_unseen, m_strlen(seq_unseen))) {
fprintf (nfp, "%s %d\n", buff, n);
unseen_done = 1;
}
else if (flagged
- && !strncmp (buff, seq_flagged, m_strlen(seq_flagged))) {
+ && !m_strncmp (buff, seq_flagged, m_strlen(seq_flagged))) {
fprintf (nfp, "%s %d\n", buff, n);
flagged_done = 1;
}
else if (replied
- && !strncmp (buff, seq_replied, m_strlen(seq_replied))) {
+ && !m_strncmp (buff, seq_replied, m_strlen(seq_replied))) {
fprintf (nfp, "%s %d\n", buff, n);
replied_done = 1;
}
for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
dest->path, subdir, (long) time (NULL),
- (unsigned int) getpid (), Counter++, NONULL (Hostname), suffix);
+ (unsigned int) getpid (), Counter++, NONULL (MCore.shorthost), suffix);
umask (Umask);
if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir,
(long) time (NULL), (unsigned int) getpid (), Counter++,
- NONULL (Hostname), suffix);
+ NONULL (MCore.shorthost), suffix);
snprintf (full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path);
if (safe_rename (msg->path, full) == 0) {
struct maildir *md; /* list of messages in the mailbox */
struct maildir **last, *p;
int i;
- HASH *fnames; /* hash table for quickly looking up the base filename
+ hash_t *fnames; /* hash table for quickly looking up the base filename
for a maildir message */
if (!option (OPTCHECKNEW))
* of each message we scanned. This is used in the loop over the
* existing messages below to do some correlation.
*/
- fnames = hash_create (1031);
+ fnames = hash_new (1031, 0);
for (p = md; p; p = p->next) {
maildir_canon_filename (buf, p->h->path, sizeof (buf));
p->canon_fname = m_strdup(buf);
- hash_insert (fnames, p->canon_fname, p, 0);
+ hash_insert (fnames, p->canon_fname, p);
}
/* check for modifications and adjust flags */
* Check to see if we have enough information to know if the
* message has disappeared out from underneath us.
*/
- else if (((changed & 1) && (!strncmp (ctx->hdrs[i]->path, "new/", 4))) ||
- ((changed & 2) && (!strncmp (ctx->hdrs[i]->path, "cur/", 4)))) {
+ else if (((changed & 1) && (!m_strncmp (ctx->hdrs[i]->path, "new/", 4))) ||
+ ((changed & 2) && (!m_strncmp (ctx->hdrs[i]->path, "cur/", 4)))) {
/* This message disappeared, so we need to simulate a "reopen"
* event. We know it disappeared because we just scanned the
* subdirectory it used to reside in.
}
/* destroy the file name hash */
- hash_destroy (&fnames, NULL);
+ hash_delete (&fnames, NULL);
/* If we didn't just get new mail, update the tables. */
if (occult)
struct maildir *md, *p;
struct maildir **last = NULL;
struct mh_sequences mhs;
- HASH *fnames;
+ hash_t *fnames;
int i;
if (!option (OPTCHECKNEW))
mhs_free_sequences (&mhs);
/* check for modifications and adjust flags */
- fnames = hash_create (1031);
+ fnames = hash_new (1031, 0);
for (p = md; p; p = p->next)
- hash_insert (fnames, p->h->path, p, 0);
+ hash_insert (fnames, p->h->path, p);
for (i = 0; i < ctx->msgcount; i++) {
ctx->hdrs[i]->active = 0;
/* destroy the file name hash */
- hash_destroy (&fnames, NULL);
+ hash_delete (&fnames, NULL);
/* If we didn't just get new mail, update the tables. */
if (occult)
if (!m_strcmp(tunique, unique)) {
snprintf (fname, sizeof (fname), "%s/%s/%s", folder, subfolder,
de->d_name);
- fp = fopen (fname, "r"); /* __FOPEN_CHECKED__ */
+ fp = fopen(fname, "r");
oe = errno;
break;
}