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

Created new command ('x') to dump a sub-board's index file (for debugging).

parent 790bc348
No related branches found
No related tags found
No related merge requests found
......@@ -108,6 +108,7 @@ char *usage=
"cmd:\n"
" l[n] = list msgs starting at number n\n"
" r[n] = read msgs starting at number n\n"
" x[n] = dump msg index at number n\n"
" v[n] = view msg headers starting at number n\n"
" 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"
......@@ -481,6 +482,29 @@ void listmsgs(ulong start, ulong count)
}
}
/****************************************************************************/
/****************************************************************************/
void dumpindex(ulong start, ulong count)
{
ulong l=0;
idxrec_t idx;
if(!start)
start=1;
if(!count)
count=~0;
fseek(smb.sid_fp,(start-1L)*sizeof(idxrec_t),SEEK_SET);
while(l<count) {
if(!fread(&idx,1,sizeof(idx),smb.sid_fp))
break;
printf("%4lu %04hX %04hX %04Xh %04Xh %06X %.24s\n"
,idx.number,idx.from,idx.to,idx.subj,idx.attr
,idx.offset,ctime(&idx.time));
l++;
}
}
char *binstr(uchar *buf, ushort length)
{
static char str[512];
......@@ -1619,6 +1643,10 @@ int main(int argc, char **argv)
listmsgs(atol(cmd+1),count);
y=strlen(cmd)-1;
break;
case 'X':
dumpindex(atol(cmd+1),count);
y=strlen(cmd)-1;
break;
case 'P':
case 'D':
if((i=smb_lock(&smb))!=0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment