From: hachti Date: Sun, 1 Jan 2006 19:39:17 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://gitweb.hachti.de/?a=commitdiff_plain;h=77ce3d6adf5a51792f1a11593e7156ee226ee9e1;p=h316.git *** empty log message *** --- diff --git a/pc-tools/ldc/ldc.c b/pc-tools/ldc/ldc.c index 7d67a28..ae9ee51 100644 --- a/pc-tools/ldc/ldc.c +++ b/pc-tools/ldc/ldc.c @@ -32,6 +32,7 @@ int inputfd; int ignore = 0; int dosplit = 0; int splitnum = 0; +int silent = 0; /********************************************************/ @@ -90,7 +91,7 @@ void errf (char *format, ...) void say (char *string) { - printf ("%s\n", string); + if (!silent) printf ("%s\n", string); } void sayf (char *format, ...) @@ -348,16 +349,19 @@ int main (int argc, char **args) //msgf ("Action %c, Arg dazu:%s", action, parm); switch (action) { case 'I': - ignore++; + ignore=1; break; case 't': - tapemode++; + tapemode=1; break; case 'S': - splitnum++; + splitnum=1; case 's': - dosplit++; + dosplit=1; break; + case 'l': + silent=1; + break; default: say ("Usage:\n"); sayf ("%s [-t] [-S] [-n] [-I] [filename]", args[0]); @@ -366,6 +370,7 @@ int main (int argc, char **args) sayf (" -S Split library tape into separate numbered files"); sayf (" -s same as -S but no numbering"); sayf (" -I Ignore errors"); + sayf (" -l be silent"); sayf (""); exit (1); break; diff --git a/pc-tools/ldc/process.c b/pc-tools/ldc/process.c index 4e7a29d..9dd71be 100644 --- a/pc-tools/ldc/process.c +++ b/pc-tools/ldc/process.c @@ -4,9 +4,11 @@ #include "process.h" + //#define DEBUG_DATA /**********************************************************************/ + int get_blocktype (datablock * block){ return block->data[0].blocktype.type; } @@ -54,7 +56,6 @@ char ** extract_labels0(datablock * blockp){ memcpy (akt, ((char *) data) + 4 + c * 6, 6); akt[6]=0; - int dd=5; while (akt[dd]==' ') akt[dd--]=0; // hinten kürzen; dd=0; @@ -309,21 +310,18 @@ case 6:{ char akt[7] = "SYMBOL"; memcpy (akt, dat + 3, 6); twistbytes (data + 1, 4); - - sayf ("%s (6) subroutine or common block definition",akt); - } break; case 7:{ - parstrip ((char *) data + 3, 6); - twistbytes (data + 1, 4); - char akt[7] = "SYMBOL"; - memcpy (akt, ((char *) data) + 3, 6); - twistbytes (data + 1, 4); - - sayf ("%s (7) reference (call) to common item", akt); + char * dat =(char *) data; // Get byte pointer + twistbytes (data + 1, 4); // Do the endian thing + parstrip ((char *) data + 3, 6); // Strip parity bits away + char akt[7] = "SYMBOL"; + memcpy (akt, dat + 3, 6); // Take the name + twistbytes (data + 1, 4); // repair the head + sayf ("%s (7) reference (call) to common item", akt); } break;