ca76526b11
if it exists.
106 lines
1.9 KiB
Plaintext
106 lines
1.9 KiB
Plaintext
--- bin/megatron/megatron.c.orig Thu May 2 05:34:04 1996
|
|
+++ bin/megatron/megatron.c Thu Nov 11 17:23:38 1999
|
|
@@ -5,7 +5,7 @@
|
|
#include <fcntl.h>
|
|
#include <ctype.h>
|
|
#include <stdio.h>
|
|
-#include <strings.h>
|
|
+#include <string.h>
|
|
#include <syslog.h>
|
|
#include <netatalk/endian.h>
|
|
#include "megatron.h"
|
|
@@ -22,6 +22,11 @@
|
|
"single2bin",
|
|
"megatron" };
|
|
|
|
+int megatron();
|
|
+int from_open(), from_close(), from_read(), from_write();
|
|
+int to_open(), to_close(), to_read(), to_write();
|
|
+
|
|
+int
|
|
main( argc, argv )
|
|
int argc;
|
|
char **argv;
|
|
@@ -32,7 +37,7 @@
|
|
int module = -1;
|
|
char *progname;
|
|
|
|
- progname = rindex( argv[ 0 ], '/' );
|
|
+ progname = strrchr( argv[ 0 ], '/' );
|
|
if (( progname == NULL ) || ( progname == '\0' )) {
|
|
progname = argv[ 0 ];
|
|
} else progname++;
|
|
@@ -54,13 +59,14 @@
|
|
}
|
|
|
|
for ( c = 1 ; c < argc ; ++c ) {
|
|
- if ( rc = megatron( argv[ c ], module ) != 0 ) {
|
|
+ if (( rc = megatron( argv[ c ], module ) != 0 )) {
|
|
rv = rc;
|
|
}
|
|
}
|
|
return( rv );
|
|
}
|
|
|
|
+int
|
|
megatron( path, module )
|
|
char *path;
|
|
int module;
|
|
@@ -91,7 +97,7 @@
|
|
* Open the source file and fill in the file header structure.
|
|
*/
|
|
|
|
- bzero( (char *)&fh, sizeof( fh ));
|
|
+ memset( (char *)&fh, 0, sizeof( fh ));
|
|
if ( from_open( module, path, &fh ) < 0 ) {
|
|
return( -1 );
|
|
}
|
|
@@ -145,6 +151,7 @@
|
|
return( from_close( module ));
|
|
}
|
|
|
|
+int
|
|
from_open( un, file, fh )
|
|
int un;
|
|
char *file;
|
|
@@ -171,6 +178,7 @@
|
|
}
|
|
}
|
|
|
|
+int
|
|
from_read( un, fork, buf, len )
|
|
int un;
|
|
int fork;
|
|
@@ -198,6 +206,7 @@
|
|
}
|
|
}
|
|
|
|
+int
|
|
from_close( un )
|
|
int un;
|
|
{
|
|
@@ -222,6 +231,7 @@
|
|
}
|
|
}
|
|
|
|
+int
|
|
to_open( to, file, fh )
|
|
int to;
|
|
char *file;
|
|
@@ -245,6 +255,7 @@
|
|
}
|
|
}
|
|
|
|
+int
|
|
to_write( to, fork, bufc )
|
|
int to;
|
|
int fork;
|
|
@@ -268,6 +279,7 @@
|
|
}
|
|
}
|
|
|
|
+int
|
|
to_close( to, keepflag )
|
|
int to;
|
|
int keepflag;
|