Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.o
gfalist
gfalist_*.deb
libsky.a
version.h
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ libsky.a: $(SKY_OBJS)
# $(AR) rcv $@ $*.o
# rm $*.o

gfalist: $(GFALIST_OBJS)
$(CC) $(LFLAGS) $+ -o $@ -lsky
gfalist: $(GFALIST_OBJS) libsky.a
$(CC) $(LFLAGS) $+ -o $@ libsky.a
gfalist.exe: $(CSRC)
$(WINCC) $+ -o $@
gfalist.ttp: $(CSRC)
Expand Down
34 changes: 25 additions & 9 deletions gfalist.1
Original file line number Diff line number Diff line change
@@ -1,36 +1,52 @@
.TH gfalist 1 "06 May 2003"
.TH GFALIST 1 "06 May 2003" "GFA-List"
.SH NAME
gfalist - Reads tokenized GFA BASIC version 3.x source files (.GFA) and converts them to human readable ASCII listings (.LST).

.SH SYNOPSIS
.B gfalist
\fR[\fB-o lstfile\fR]
\fR[\fB-o\fR \fIlstfile\fR]
.RB [ -vcthi ]
.RI gfafile
.I gfafile

.SH DESCRIPTION
Reads an .gfa file as input. Produces a .lst (ASCII)
file as output.

.SH OPTIONS
.TP
.BI "\-o " file
.BR \-o " " \fIfile\fR
Place output in file \c
.I file\c
\&. INLINE data will not be saved.
.TP
.BI "\-i "
Save INLINE data into separate files, named after the pointers, ending .inl.
.BR \-b
bug emulation.
.TP
.B -h,--help
.BR \-c
conversion.
.TP
.BR \-f
force
.B gfalist
to process the input file even when it is not the correct GFA-Basic version.
.TP
.BR \-i
save INLINE data into separate files, named after the pointers, ending .inl.
.TP
.BR \-h ", " \-\-help ", " \-V
makes
.B gfalist
print a short usage information and exit.
.TP
.B -v,--verbose
.BR \-t
timer.
.TP
.BR \-v ", " \-\-verbose
make
.B gfalist
prints information about its processing on Standard Error.
print information about its processing to \fIstderr\fR.

.PP
For detailed help and description of the implemented commands take a
look at the README file and manual which comes with the gfalist package.

Expand Down
46 changes: 28 additions & 18 deletions gfalist.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static unsigned char *rvsimp(struct gfainf *gi, unsigned short type,
{
static unsigned char vbuf[11]; /* vffff_ffff\0 */
unsigned char *dst = vbuf;
char *src = vbuf;
char *src = (char *)vbuf;
sprintf(src, "v%x_%x", type, var);
while (*src != '\0')
switch (*src++) {
Expand Down Expand Up @@ -113,23 +113,31 @@ static void process(char *name, FILE *ost, char *file, unsigned int flags)
if ((flags & TP_VERB) != 0x00)
output(" Processing DI-Block\n");

gf4tp_getdi(&gi, dibuf);

/* Cannot process files older than version 4 yet. */
switch (gh.vers) {
case 1:
case 2:
case 3:
output("Version %d files not supported yet.\n", gh.vers);
if (ist != stdin)
fclose(ist);
/* Check GFA Version. */

if((flags&TP_FORCE)==0) {
/* Cannot process files older than version 4 yet. */
switch (gh.vers) {
case 1:
case 2:
case 3:
output("WARNING: Version %d files not supported yet.\n", gh.vers);
output("If you want to try anyways, please restart gfalist with the -f option.\n");
if(ist!=stdin) fclose(ist);
return;
case 70:
output("WARNING: GF%.14s files not supported yet.\n", gh.mag);
output("If you want to try anyways, please restart gfalist with the -f option.\n");
if(ist!=stdin) fclose(ist);
return;
case 70:
output("GF%.14s files not supported yet.\n", gh.mag);
if (ist != stdin)
fclose(ist);
default:
output("ERROR: GFA file version: %d is unknown and not supported!\n",gh.vers);
output("If you want to try anyways, please restart gfalist with the -f option.\n");
if(ist!=stdin) fclose(ist);
return;
}
}
gf4tp_getdi(&gi, dibuf);

cnt = gh.sep[16] - gh.sep[0];

Expand Down Expand Up @@ -223,8 +231,7 @@ static void process(char *name, FILE *ost, char *file, unsigned int flags)
fclose(ist);
}

int main(int argc, char *argv[])
{
int main(int argc, char *argv[]) {
extern char *optarg;
extern int optind, opterr, optopt;
const char *outfile = NULL;
Expand All @@ -235,7 +242,7 @@ int main(int argc, char *argv[])

gf4tp_init(output, rvsimp);

while ((opt = getopt(argc, argv, "o:vctVbih")) != -1)
while ((opt = getopt(argc, argv, "o:vctVbihf")) != -1)
switch (opt) {
case 'o': /* Output */
if (outfile != NULL) {
Expand All @@ -247,6 +254,9 @@ int main(int argc, char *argv[])
case 'b': /* Bug emulation */
flags |= TP_BUGEM;
break;
case 'f': /* force (do not check for GFA version) */
flags |= TP_FORCE;
break;
case 'v': /* Verbose */
flags |= TP_VERB;
break;
Expand Down
2 changes: 1 addition & 1 deletion sky.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ unsigned char *gf4tp_tp(unsigned char *dst, struct gfainf *gi,
src += 8;
copy64b(u.ull, dcb);

dcs = dst;
dcs = (char *)dst;
sprintf(dcs, "%G", u.d);
while (*dcs != '\0')
switch (*dcs++) {
Expand Down
1 change: 1 addition & 0 deletions sky.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define TP_TIME 0x08 /* Measure time */
#define TP_BUGEM 0x10 /* Emulate bugs */
#define TP_SAVEINLINE 0x20 /* Save INLINE data into .inl files */
#define TP_FORCE 0x40 /* do not check for GFA version */

struct gfahdr {
unsigned char resvd:7;
Expand Down