/*
+ * $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.
*
#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;
exit( 1 );
}
-char *
-paprc()
+static char *
+paprc(void)
{
static char s[ 32 + 1 + 32 + 1 + 32 ];
char *name = NULL;
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;
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;
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 );
}