fleshed out mh.c some more
Showing
2 changed files
with
18 additions
and
4 deletions
1 | 2000-05-18 Sean 'Shaleh' Perry <shaleh@debian.org> | ||
2 | |||
3 | * libmailbox/mh.c: fleshed out mh_open() some more | ||
4 | |||
1 | 2000-05-15 Sean 'Shaleh' Perry <shaleh@debian.org> | 5 | 2000-05-15 Sean 'Shaleh' Perry <shaleh@debian.org> |
2 | 6 | ||
3 | * libmailbox/*: ran some files thru emacs indent, I think I introduced | 7 | * libmailbox/*: ran some files thru emacs indent, I think I introduced | ... | ... |
... | @@ -45,19 +45,29 @@ mh_open (mailbox * mbox) | ... | @@ -45,19 +45,29 @@ mh_open (mailbox * mbox) |
45 | return errno; /* set by opendir() */ | 45 | return errno; /* set by opendir() */ |
46 | 46 | ||
47 | /* process directory */ | 47 | /* process directory */ |
48 | while ((entry = readdir (data->dir)) && (entry != NULL)) | 48 | while (entry = readdir (data->dir)) |
49 | { | 49 | { |
50 | /* TODO: deal with mh dot files */ | 50 | unsigned long seq_num; |
51 | char *foo = NULL; | ||
51 | if (entry->d_name[0] == '.') | 52 | if (entry->d_name[0] == '.') |
52 | continue; | 53 | { |
54 | if (strcmp(entry->d_name, ".mh_sequences" == 0)) | ||
55 | /* TODO: deal with mh sequence files */; | ||
56 | continue; | ||
57 | } | ||
53 | if (entry->d_name[0] == ',') | 58 | if (entry->d_name[0] == ',') |
54 | /* file marked for deletion */; | 59 | /* file marked for deletion */; |
55 | 60 | ||
61 | /* TODO: handle ERANGE */ | ||
62 | seq_num = strtoul (entry->d_name, &foo, 10); | ||
63 | if (*foo != '\0') /* invalid sequence number */ | ||
64 | continue; /* TODO: handle this better? */ | ||
65 | printf ("message: %ld\r", seq_num); | ||
56 | mbox->messages++; | 66 | mbox->messages++; |
57 | } | 67 | } |
58 | 68 | ||
59 | #if 0 | ||
60 | mbox->_data = data; | 69 | mbox->_data = data; |
70 | #if 0 | ||
61 | mbox->_close = mh_close; | 71 | mbox->_close = mh_close; |
62 | mbox->_delete = mh_delete; | 72 | mbox->_delete = mh_delete; |
63 | mbox->_undelete = mh_undelete; | 73 | mbox->_undelete = mh_undelete; | ... | ... |
-
Please register or sign in to post a comment