projects
/
debian
/
cpmtools
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make it possible to over-ride upstream datarootdir in Makefile
[debian/cpmtools]
/
fsed.cpm.c
diff --git
a/fsed.cpm.c
b/fsed.cpm.c
index dfd94670ba79fe62a5776b91cb051b7b5106eec9..b717bfffc6e8be055151371c8ba68515cbe05e2c 100644
(file)
--- a/
fsed.cpm.c
+++ b/
fsed.cpm.c
@@
-10,6
+10,10
@@
#include <string.h>
#include "cpmfs.h"
#include <string.h>
#include "cpmfs.h"
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
/*}}}*/
extern char **environ;
/*}}}*/
extern char **environ;
@@
-83,7
+87,7
@@
static void map(struct cpmSuperBlock *sb) /*{{{*/
{
const char *msg;
char bmap[18*80];
{
const char *msg;
char bmap[18*80];
- int secmap,pos,sys
tem
,directory;
+ int secmap,pos,sys,directory;
clear();
msg="Data map";
clear();
msg="Data map";
@@
-91,11
+95,11
@@
static void map(struct cpmSuperBlock *sb) /*{{{*/
secmap=(sb->tracks*sb->sectrk+80*18-1)/(80*18);
memset(bmap,' ',sizeof(bmap));
secmap=(sb->tracks*sb->sectrk+80*18-1)/(80*18);
memset(bmap,' ',sizeof(bmap));
- sys
tem
=sb->boottrk*sb->sectrk;
- memset(bmap,'S',sys
tem
/secmap);
+ sys=sb->boottrk*sb->sectrk;
+ memset(bmap,'S',sys/secmap);
directory=(sb->maxdir*32+sb->secLength-1)/sb->secLength;
directory=(sb->maxdir*32+sb->secLength-1)/sb->secLength;
- memset(bmap+sys
tem
/secmap,'D',directory/secmap);
- memset(bmap+(sys
tem
+directory)/secmap,'.',sb->sectrk*sb->tracks/secmap);
+ memset(bmap+sys/secmap,'D',directory/secmap);
+ memset(bmap+(sys+directory)/secmap,'.',sb->sectrk*sb->tracks/secmap);
for (pos=0; pos<(sb->maxdir*32+sb->secLength-1)/sb->secLength; ++pos)
{
for (pos=0; pos<(sb->maxdir*32+sb->secLength-1)/sb->secLength; ++pos)
{
@@
-180,7
+184,7
@@
int main(int argc, char *argv[]) /*{{{*/
}
if (optind!=(argc-1)) usage=1;
}
if (optind!=(argc-1)) usage=1;
- else image=argv[optind];
+ else image=argv[optind
++
];
if (usage)
{
if (usage)
{
@@
-220,25
+224,23
@@
int main(int argc, char *argv[]) /*{{{*/
{
/* display position and load data */ /*{{{*/
clear();
{
/* display position and load data */ /*{{{*/
clear();
- move(2,0); printw("Byte %8
d (0x%08
x) ",pos,pos);
+ move(2,0); printw("Byte %8
lu (0x%08l
x) ",pos,pos);
if (pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
if (pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
- printw("Physical sector %3
d
",((pos/drive.secLength)%drive.sectrk)+1);
+ printw("Physical sector %3
lu
",((pos/drive.secLength)%drive.sectrk)+1);
}
else
{
}
else
{
- printw("Sector %3
d
",((pos/drive.secLength)%drive.sectrk)+1);
+ printw("Sector %3
lu
",((pos/drive.secLength)%drive.sectrk)+1);
printw("(physical %3d) ",drive.skewtab[(pos/drive.secLength)%drive.sectrk]+1);
}
printw("(physical %3d) ",drive.skewtab[(pos/drive.secLength)%drive.sectrk]+1);
}
- printw("Offset %5
d
",pos%drive.secLength);
- printw("Track %5
d
",pos/(drive.secLength*drive.sectrk));
+ printw("Offset %5
lu
",pos%drive.secLength);
+ printw("Track %5
lu
",pos/(drive.secLength*drive.sectrk));
move(LINES-3,0); printw("N)ext track P)revious track");
move(LINES-3,0); printw("N)ext track P)revious track");
- move(LINES-2,0); printw("n)ext record
n
)revious record f)orward byte b)ackward byte");
+ move(LINES-2,0); printw("n)ext record
p
)revious record f)orward byte b)ackward byte");
move(LINES-1,0); printw("i)nfo q)uit");
if (reload)
{
move(LINES-1,0); printw("i)nfo q)uit");
if (reload)
{
- const char *err;
-
if (pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
err=Device_readSector(&drive.dev,pos/(drive.secLength*drive.sectrk),(pos/drive.secLength)%drive.sectrk,buf);
if (pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
err=Device_readSector(&drive.dev,pos/(drive.secLength*drive.sectrk),(pos/drive.secLength)%drive.sectrk,buf);
@@
-413,11
+415,11
@@
int main(int argc, char *argv[]) /*{{{*/
printw("Password: ");
for (i=0; i<8; ++i)
{
printw("Password: ");
for (i=0; i<8; ++i)
{
- char
c
;
+ char
printable
;
if (offset==16+(7-i)) attron(A_REVERSE);
if (offset==16+(7-i)) attron(A_REVERSE);
-
c
=(buf[entrystart+16+(7-i)]^buf[entrystart+13])&0x7f;
- printw("%c",isprint(
c) ? c
: ' ');
+
printable
=(buf[entrystart+16+(7-i)]^buf[entrystart+13])&0x7f;
+ printw("%c",isprint(
printable) ? printable
: ' ');
attroff(A_REVERSE);
}
printw(" XOR value: ");
attroff(A_REVERSE);
}
printw(" XOR value: ");
@@
-592,11
+594,11
@@
int main(int argc, char *argv[]) /*{{{*/
printw("Password: ");
for (i=0; i<8; ++i)
{
printw("Password: ");
for (i=0; i<8; ++i)
{
- char
c
;
+ char
printable
;
if (offset==16+(7-i)) attron(A_REVERSE);
if (offset==16+(7-i)) attron(A_REVERSE);
-
c
=(buf[entrystart+16+(7-i)]^buf[entrystart+13])&0x7f;
- printw("%c",isprint(
c) ? c
: ' ');
+
printable
=(buf[entrystart+16+(7-i)]^buf[entrystart+13])&0x7f;
+ printw("%c",isprint(
printable) ? printable
: ' ');
attroff(A_REVERSE);
}
printw(" XOR value: ");
attroff(A_REVERSE);
}
printw(" XOR value: ");
@@
-684,7
+686,7
@@
int main(int argc, char *argv[]) /*{{{*/
/*}}}*/
case 'P': /* previous track */ /*{{{*/
{
/*}}}*/
case 'P': /* previous track */ /*{{{*/
{
- if (pos>drive.sectrk*drive.secLength)
+ if (pos>
=
drive.sectrk*drive.secLength)
{
pos-=drive.sectrk*drive.secLength;
reload=1;
{
pos-=drive.sectrk*drive.secLength;
reload=1;