diff options
Diffstat (limited to 'maildirflags.c')
| -rw-r--r-- | maildirflags.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/maildirflags.c b/maildirflags.c new file mode 100644 index 0000000..8ac460c --- /dev/null +++ b/maildirflags.c | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* | ||
| 2 | ** Copyright 2000 Double Precision, Inc. | ||
| 3 | ** See COPYING for distribution information. | ||
| 4 | */ | ||
| 5 | |||
| 6 | #include <sys/types.h> | ||
| 7 | #include <string.h> | ||
| 8 | |||
| 9 | static const char rcsid[]="$Id: maildirflags.c,v 1.1 2000/10/07 01:10:19 mrsam Exp $"; | ||
| 10 | |||
| 11 | int maildir_hasflag(const char *filename, char flag) | ||
| 12 | { | ||
| 13 | const char *p=strrchr(filename, '/'); | ||
| 14 | |||
| 15 | if (p) | ||
| 16 | filename=p+1; | ||
| 17 | |||
| 18 | p=strrchr(p, ':'); | ||
| 19 | if (p && strncmp(p, ":2,", 3) == 0 && | ||
| 20 | strchr(p+3, flag)) | ||
| 21 | return (1); | ||
| 22 | return (0); | ||
| 23 | } | ||
