Skip to content
Snippets Groups Projects
Commit fab97960 authored by rswindell's avatar rswindell
Browse files

Added command (H) to dump hash file.

parent 7b98aa24
Branches
Tags
No related merge requests found
......@@ -105,6 +105,7 @@ char *usage=
" i[f] = import msg from text file f (or use stdin)\n"
" e[f] = import e-mail from text file f (or use stdin)\n"
" n[f] = import netmail from text file f (or use stdin)\n"
" h = dump hash table\n"
" s = display msg base status\n"
" c = change msg base status\n"
" d = delete all msgs\n"
......@@ -587,6 +588,28 @@ void viewmsgs(ulong start, ulong count)
}
}
/****************************************************************************/
/****************************************************************************/
void dump_hashes(void)
{
int retval;
hash_t hash;
if((retval=smb_open_hash(&smb))!=SMB_SUCCESS) {
fprintf(stderr,"\n\7!smb_open_hash returned %d: %s\n", retval, smb.last_error);
return;
}
while(!smb_feof(smb.hash_fp)) {
if(smb_fread(&smb,&hash,sizeof(hash),smb.hash_fp)!=sizeof(hash))
break;
printf("%-25s: %lu\n", "number", hash.number);
printf("%-25s: %lx\n", "flags", hash.flags);
printf("%-25s: %s\n", "source", smb_hfieldtype(hash.source));
printf("%-25s: %s\n", "time", my_timestr(&hash.time));
}
}
/****************************************************************************/
/* Maintain message base - deletes messages older than max age (in days) */
/* or messages that exceed maximum */
......@@ -1565,6 +1588,9 @@ int main(int argc, char **argv)
viewmsgs(atol(cmd+1),count);
y=strlen(cmd)-1;
break;
case 'H':
dump_hashes();
break;
case 'M':
maint();
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment