]> arthur.barton.de Git - netatalk.git/blobdiff - etc/papd/lp.c
replaced all #include <sys/syslog.h> with #include <syslog.h>
[netatalk.git] / etc / papd / lp.c
index 5a08554113719cc3eb572c3d51175be6637a0c78..ba1c0ac65700ff8a4bb58449c93fe8fb8053314b 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: lp.c,v 1.11 2002-01-03 17:49:39 sibaz Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  *
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/param.h>
-#include <sys/syslog.h>
+#include <syslog.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <ctype.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #if defined( sun ) && defined( __svr4__ )
 #include </usr/ucbinclude/sys/file.h>
-#else sun __svr4__
+#else /* sun && __svr4__ */
 #include <sys/file.h>
-#endif sun __svr4__
+#endif /* sun && __svr4__ */
 #include <sys/un.h>
 #include <netinet/in.h>
 #undef s_net
 
 #ifdef ABS_PRINT
 #include <math.h>
-#endif ABS_PRINT
+#endif /* ABS_PRINT */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <netdb.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <pwd.h>
 
 #include "printer.h"
@@ -132,7 +138,7 @@ int lp_pagecost()
     printer->p_balance = atof( balance ) + atof( cost );
     return( err < 0 ? -1 : 0 );
 }
-#endif ABS_PRINT
+#endif /* ABS_PRINT */
 
 void lp_host( host )
     char       *host;
@@ -180,7 +186,7 @@ int lp_init( out, sat )
 #ifdef ABS_PRINT
     char       cost[ 22 ];
     char       balance[ 22 ];
-#endif ABS_PRINT
+#endif /* ABS_PRINT */
 
     if ( printer->p_flags & P_AUTH ) {
        authenticated = 0;
@@ -239,7 +245,7 @@ int lp_init( out, sat )
            spoolerror( out, "No ABS funds available." );
            return( -1 );
        }
-#endif ABS_PRINT
+#endif /* ABS_PRINT */
     }
 
     if ( gethostname( hostname, sizeof( hostname )) < 0 ) {
@@ -547,7 +553,7 @@ int lp_conn_unix()
        syslog( LOG_ERR, "lp_conn_unix socket: %m" );
        return( -1 );
     }
-    bzero( &saun, sizeof( struct sockaddr_un ));
+    memset( &saun, 0, sizeof( struct sockaddr_un ));
     saun.sun_family = AF_UNIX;
     strcpy( saun.sun_path, _PATH_DEVPRINTER );
     if ( connect( s, (struct sockaddr *)&saun,
@@ -593,10 +599,10 @@ int lp_conn_inet()
        return( -1 );
     }
 
-    bzero( &sin, sizeof( struct sockaddr_in ));
+    memset( &sin, 0, sizeof( struct sockaddr_in ));
     sin.sin_family = AF_INET;
 /*    sin.sin_addr.s_addr = htonl( INADDR_LOOPBACK ); */
-    bcopy( hp->h_addr, &sin.sin_addr, hp->h_length );
+    memcpy( &sin.sin_addr, hp->h_addr, hp->h_length );
     sin.sin_port = sp->s_port;
 
     if ( connect( privfd, (struct sockaddr *)&sin,