]> arthur.barton.de Git - netatalk.git/blobdiff - bin/megatron/megatron.c
- merge branch-netatalk-afp-3x-dev, HEAD was tagged before
[netatalk.git] / bin / megatron / megatron.c
index eefd26d331267e91bdfdd04c7fc69d15f8e41c52..09035f4c09050d24447c058402e87b76162dcacc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: megatron.c,v 1.7 2002-01-04 04:45:47 sibaz Exp $
+ * $Id: megatron.c,v 1.10 2005-04-28 20:49:20 bfernhomberg Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -17,7 +17,6 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
-#include <atalk/logger.h>
 #include <netatalk/endian.h>
 #include "asingle.h"
 #include "megatron.h"
@@ -192,7 +191,7 @@ int megatron( path, module, newname, flags )
     struct FHeader     fh;
     int                        bufc;
     int                        fork;
-    int                        forkred;
+    unsigned int       forkred;
 
 /*
  * If the source file is not stdin, make sure it exists and
@@ -215,7 +214,7 @@ int megatron( path, module, newname, flags )
  */
 
     memset( &fh, 0, sizeof( fh ));
-    if ( from_open( module, path, &fh ) < 0 ) {
+    if ( from_open( module, path, &fh, flags ) < 0 ) {
        return( -1 );
     }
 
@@ -342,7 +341,14 @@ int main( argc, argv )
          flags |= OPTION_STDOUT;
          continue;
        }
-         
+       if (strcmp(argv[c], "--euc") == 0) {
+         flags |= OPTION_EUCJP;
+         continue;
+       }  
+       if (strcmp(argv[c], "--sjis") == 0) {
+         flags |= OPTION_SJIS;
+         continue;
+       }  
        rc = megatron( argv[ c ], module, newname, flags);
        if ( rc != 0 ) {
            rv = rc;