rename map to seq

The old terminology didn't make much sense to users.
pull/1/merge
Christian Neukirchen 8 years ago
parent 1fd83bf1a8
commit 2b81707c51

@ -82,7 +82,7 @@ EXAMPLES
CONCEPTS CONCEPTS
Santoku deals with messages (which are files), folders (which are Maildir Santoku deals with messages (which are files), folders (which are Maildir
folders), sequences (which are newline-separated lists of messages, folders), sequences (which are newline-separated lists of messages,
possibly persisted on disk in ~/.santoku/map), and the current message possibly persisted on disk in ~/.santoku/seq), and the current message
(kept as a symlink in ~/.santoku/cur). (kept as a symlink in ~/.santoku/cur).
Messages in the persisted sequence can be referred to using special Messages in the persisted sequence can be referred to using special

@ -134,7 +134,7 @@ As usual with pipes, the sky is the limit.
deals with messages (which are files), deals with messages (which are files),
folders (which are Maildir folders), folders (which are Maildir folders),
sequences (which are newline-separated lists of messages, possibly persisted on disk in sequences (which are newline-separated lists of messages, possibly persisted on disk in
.Pa ~/.santoku/map ) , .Pa ~/.santoku/seq ) ,
and the current message (kept as a symlink in and the current message (kept as a symlink in
.Pa ~/.santoku/cur ) . .Pa ~/.santoku/cur ) .
.Pp .Pp

@ -58,10 +58,10 @@ but append to the mail sequence instead of replacing it.
.El .El
.Sh ENVIRONMENT .Sh ENVIRONMENT
.Bl -tag -width Ds .Bl -tag -width Ds
.It Ev MAILMAP .It Ev MAILSEQ
File were the sequence is stored. File were the sequence is stored.
(Default: (Default:
.Pa ~/.santoku/map ) .Pa ~/.santoku/seq )
.El .El
.Sh EXIT STATUS .Sh EXIT STATUS
.Ex -std .Ex -std

@ -69,10 +69,10 @@ oneline(char *file)
{ {
static int init; static int init;
if (!init) { if (!init) {
// delay loading of the seqmap until we need to scan the first // delay loading of the seq until we need to scan the first
// file, in case someone in the pipe updated the map before // file, in case someone in the pipe updated the map before
char *seqmap = blaze822_seq_open(0); char *seq = blaze822_seq_open(0);
blaze822_seq_load(seqmap); blaze822_seq_load(seq);
cur = blaze822_seq_cur(); cur = blaze822_seq_cur();
init = 1; init = 1;
} }

@ -1,4 +1,5 @@
#include <dirent.h> #include <dirent.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <search.h> #include <search.h>
#include <string.h> #include <string.h>
@ -181,9 +182,9 @@ stdinmode()
if (Sflag) { if (Sflag) {
// XXX locking? // XXX locking?
seqfile = getenv("MAILMAP"); seqfile = getenv("MAILSEQ");
if (!seqfile) if (!seqfile)
seqfile = blaze822_home_file(".santoku/map"); seqfile = blaze822_home_file(".santoku/seq");
snprintf(tmpfile, sizeof tmpfile, "%s-", seqfile); snprintf(tmpfile, sizeof tmpfile, "%s-", seqfile);
snprintf(oldfile, sizeof oldfile, "%s.old", seqfile); snprintf(oldfile, sizeof oldfile, "%s.old", seqfile);
outfile = fopen(tmpfile, "w+"); outfile = fopen(tmpfile, "w+");
@ -223,7 +224,7 @@ stdinmode()
if (Sflag) { if (Sflag) {
fflush(outfile); fflush(outfile);
if (rename(seqfile, oldfile) < 0) { if (rename(seqfile, oldfile) < 0 && errno != ENOENT) {
perror("rename"); perror("rename");
exit(2); exit(2);
} }
@ -270,8 +271,8 @@ main(int argc, char *argv[])
if (optind == argc && !isatty(0)) if (optind == argc && !isatty(0))
return stdinmode(); return stdinmode();
char *map = blaze822_seq_open(0); char *seq = blaze822_seq_open(0);
if (!map) if (!seq)
return 1; return 1;
int i; int i;
@ -291,7 +292,7 @@ hack:
printf("%s\n", a); printf("%s\n", a);
continue; continue;
} }
while ((f = blaze822_seq_next(map, a, &iter))) { while ((f = blaze822_seq_next(seq, a, &iter))) {
if (nflag) { if (nflag) {
printf("%ld\n", iter.line-1); printf("%ld\n", iter.line-1);
} else { } else {

@ -40,9 +40,9 @@ blaze822_seq_open(char *file)
// env $SEQ or something // env $SEQ or something
if (!file) if (!file)
file = getenv("MAILMAP"); file = getenv("MAILSEQ");
if (!file) if (!file)
file = blaze822_home_file(".santoku/map"); file = blaze822_home_file(".santoku/seq");
fd = open(file, O_RDONLY); fd = open(file, O_RDONLY);
if (!fd) if (!fd)
return 0; return 0;

Loading…
Cancel
Save