#include "config.h"
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "sequence.h"
Go to the source code of this file.
Functions | |
static void | mh_seq_alloc (struct MhSequences *mhs, int i) |
Allocate more memory for sequences. More... | |
void | mh_seq_free (struct MhSequences *mhs) |
Free some sequences. More... | |
MhSeqFlags | mh_seq_check (struct MhSequences *mhs, int i) |
Get the flags for a given sequence. More... | |
MhSeqFlags | mh_seq_set (struct MhSequences *mhs, int i, MhSeqFlags f) |
Set a flag for a given sequence. More... | |
void | mh_seq_add_one (struct Mailbox *m, int n, bool unseen, bool flagged, bool replied) |
Update the flags for one sequence. More... | |
static void | mh_seq_write_one (FILE *fp, struct MhSequences *mhs, MhSeqFlags f, const char *tag) |
Write a flag sequence to a file. More... | |
void | mh_seq_update (struct Mailbox *m) |
Update sequence numbers. More... | |
static int | mh_seq_read_token (char *t, int *first, int *last) |
Parse a number, or number range. More... | |
int | mh_seq_read (struct MhSequences *mhs, const char *path) |
Read a set of MH sequences. More... | |
int | mh_seq_changed (struct Mailbox *m) |
Has the mailbox changed. More... | |
MH Mailbox Sequences.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file sequence.c.
|
static |
Allocate more memory for sequences.
mhs | Existing sequences |
i | Number required |
Definition at line 49 of file sequence.c.
void mh_seq_free | ( | struct MhSequences * | mhs | ) |
Free some sequences.
mhs | Sequences to free |
Definition at line 67 of file sequence.c.
MhSeqFlags mh_seq_check | ( | struct MhSequences * | mhs, |
int | i | ||
) |
Get the flags for a given sequence.
mhs | Sequences |
i | Index number required |
num | Flags, see MhSeqFlags |
Definition at line 78 of file sequence.c.
MhSeqFlags mh_seq_set | ( | struct MhSequences * | mhs, |
int | i, | ||
MhSeqFlags | f | ||
) |
Set a flag for a given sequence.
mhs | Sequences |
i | Index number |
f | Flags, see MhSeqFlags |
num | Resulting flags, see MhSeqFlags |
Definition at line 92 of file sequence.c.
void mh_seq_add_one | ( | struct Mailbox * | m, |
int | n, | ||
bool | unseen, | ||
bool | flagged, | ||
bool | replied | ||
) |
Update the flags for one sequence.
m | Mailbox |
n | Sequence number to update |
unseen | Update the unseen sequence |
flagged | Update the flagged sequence |
replied | Update the replied sequence |
Definition at line 107 of file sequence.c.
|
static |
Write a flag sequence to a file.
fp | File to write to |
mhs | Sequence list |
f | Flag, see MhSeqFlags |
tag | string tag, e.g. "unseen" |
Definition at line 185 of file sequence.c.
void mh_seq_update | ( | struct Mailbox * | m | ) |
Update sequence numbers.
m | Mailbox |
XXX we don't currently remove deleted messages from sequences we don't know. Should we?
Definition at line 231 of file sequence.c.
|
static |
Parse a number, or number range.
t | String to parse |
first | First number |
last | Last number (if a range, first number if not) |
0 | Success |
-1 | Error |
Definition at line 350 of file sequence.c.
int mh_seq_read | ( | struct MhSequences * | mhs, |
const char * | path | ||
) |
Read a set of MH sequences.
mhs | Existing sequences |
path | File to read from |
0 | Success |
-1 | Error |
Definition at line 375 of file sequence.c.
int mh_seq_changed | ( | struct Mailbox * | m | ) |
Has the mailbox changed.
m | Mailbox |
1 | mh_sequences last modification time is more recent than the last visit to this mailbox |
0 | modification time is older |
-1 | Error |
Definition at line 436 of file sequence.c.