]> arthur.barton.de Git - netatalk.git/blobdiff - bin/pap/papstatus.c
Rename cvsignore to gitignore
[netatalk.git] / bin / pap / papstatus.c
index 57c844fd7404b060b7866ac7d767307483e0826f..0ada9c0abd67bb8566e9e825d9fffb16320b6412 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: papstatus.c,v 1.7 2009-10-14 01:38:28 didg Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -23,7 +25,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/file.h>
 #include <netatalk/endian.h>
 #include <netatalk/at.h>
+#include <errno.h>
 #include <atalk/atp.h>
 #include <atalk/pap.h>
 #include <atalk/nbp.h>
 #include <atalk/util.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 
 #define _PATH_PAPRC    ".paprc"
 
-usage( path )
-    char       *path;
+/* Forward Declaration */
+static void getstatus(ATP atp, struct sockaddr_at *sat);
+
+static void usage(char *path)
 {
     char       *p;
 
@@ -56,8 +61,8 @@ usage( path )
     exit( 1 );
 }
 
-char *
-paprc()
+static char *
+paprc(void)
 {
     static char        s[ 32 + 1 + 32 + 1 + 32 ];
     char       *name = NULL;
@@ -78,14 +83,12 @@ paprc()
     return( name );
 }
 
-char                   *printer = NULL;
+static char                    *printer = NULL;
 
-char                   cbuf[ 8 ];
-struct nbpnve          nn;
+static char                    cbuf[ 8 ];
+static struct nbpnve           nn;
 
-main( ac, av )
-    int                ac;
-    char       **av;
+int main( int ac, char **av)
 {
     ATP                        atp;
     int                        wait, c, err = 0;
@@ -157,11 +160,11 @@ main( ac, av )
        getstatus( atp, &nn.nn_sat );
        sleep( wait );
     }
+
+    return 0;
 }
 
-getstatus( atp, sat )
-    ATP                        atp;
-    struct sockaddr_at *sat;
+static void getstatus(ATP atp, struct sockaddr_at *sat)
 {
     struct iovec       iov;
     struct atp_block   atpb;
@@ -197,5 +200,5 @@ getstatus( atp, sat )
        return; /* This is weird, since TIDs must match... */
     }
 
-    printf( "%.*s\n", iov.iov_len - 9, (char *) iov.iov_base + 9 );
+    printf( "%.*s\n", (int)iov.iov_len - 9, (char *) iov.iov_base + 9 );
 }