]> arthur.barton.de Git - netatalk.git/blobdiff - bin/megatron/nad.c
Merge master
[netatalk.git] / bin / megatron / nad.c
index f9aab5d5335c9bc9134c11fd5f13d4e8c0959d9d..92be35413fc8ed3c17a91ef2dc120e42ea5e55bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nad.c,v 1.15 2006-09-29 09:39:16 didg Exp $
+ * $Id: nad.c,v 1.18 2010-01-27 21:27:53 didg Exp $
  */
 
 #ifdef HAVE_CONFIG_H
 #include "megatron.h"
 #include "nad.h"
 
-struct volinfo vol;
+static struct volinfo  vol;
 static char            hexdig[] = "0123456789abcdef";
 
 static char mtou_buf[MAXPATHLEN + 1], utom_buf[MAXPATHLEN + 1];
-static char *mtoupathcap( mpath )
-    char       *mpath;
+static char *mtoupathcap(char *mpath)
 {
     char       *m, *u, *umax;
     int                i = 0;
@@ -67,8 +66,7 @@ static char *mtoupathcap( mpath )
 #define hextoint( c )  ( isdigit( c ) ? c - '0' : c + 10 - 'a' )
 #define islxdigit(x)   (!isupper(x)&&isxdigit(x))
 
-static char *utompathcap( upath )
-    char       *upath;
+static char *utompathcap( char *upath)
 {
     char       *m, *u;
     int h;
@@ -346,7 +344,7 @@ utompath_error:
     return(utompathcap( upath ));
 }
 
-char *mtoupathiconv(char *mpath)
+static char *mtoupathiconv(char *mpath)
 {
     char        *m, *u;
     size_t       inplen;
@@ -411,7 +409,7 @@ void select_charset( int options)
     int                        hexfork[ NUMFORKS ];
 #endif /* HEXOUTPUT */
 
-struct nad_file_data {
+static struct nad_file_data {
     char               macname[ MAXPATHLEN + 1 ];
     char               adpath[ 2 ][ MAXPATHLEN + 1];
     int                        offset[ NUMFORKS ];
@@ -431,10 +429,7 @@ static void initvol(char *path)
 }
 
 
-int nad_open( path, openflags, fh, options )
-    char               *path;
-    int                        openflags, options;
-    struct FHeader     *fh;
+int nad_open( char *path, int openflags, struct FHeader *fh, int options)
 {
     struct stat                st;
     int                        fork;
@@ -499,8 +494,7 @@ int nad_open( path, openflags, fh, options )
     }
 }
 
-int nad_header_read( fh )
-    struct FHeader     *fh;
+int nad_header_read(struct FHeader *fh)
 {
     u_int32_t          temptime;
     struct stat                st;
@@ -611,8 +605,7 @@ int nad_header_read( fh )
 
 }
 
-int nad_header_write( fh )
-    struct FHeader     *fh;
+int nad_header_write(struct FHeader *fh)
 {
     u_int32_t          temptime;
 
@@ -696,14 +689,11 @@ int nad_header_write( fh )
     return( 0 );
 }
 
-int                    forkeid[] = { ADEID_DFORK, ADEID_RFORK };
+static int             forkeid[] = { ADEID_DFORK, ADEID_RFORK };
 
-int nad_read( fork, forkbuf, bufc )
-    int                        fork;
-    char               *forkbuf;
-    int                        bufc;
+ssize_t nad_read(int fork, char *forkbuf, size_t bufc)
 {
-    int                        cc = 0;
+    ssize_t            cc = 0;
 
 #if DEBUG
     fprintf( stderr, "Entering nad_read\n" );
@@ -723,14 +713,11 @@ int nad_read( fork, forkbuf, bufc )
     return( cc );
 }
 
-int nad_write( fork, forkbuf, bufc )
-    int                        fork;
-    char               *forkbuf;
-    int                        bufc;
+ssize_t nad_write(int fork, char *forkbuf, size_t bufc)
 {
     char               *buf_ptr;
-    int                        writelen;
-    int                        cc = 0;
+    size_t             writelen;
+    ssize_t            cc = 0;
 
 #if DEBUG
     fprintf( stderr, "Entering nad_write\n" );
@@ -758,8 +745,7 @@ int nad_write( fork, forkbuf, bufc )
     return( bufc );
 }
 
-int nad_close( status )
-int                    status;
+int nad_close(int status)
 {
     int                        rv;
     if ( status == KEEP ) {