]> arthur.barton.de Git - netatalk.git/commitdiff
massive commenting/autoconf changes
authorrufustfirefly <rufustfirefly>
Fri, 29 Jun 2001 14:14:46 +0000 (14:14 +0000)
committerrufustfirefly <rufustfirefly>
Fri, 29 Jun 2001 14:14:46 +0000 (14:14 +0000)
128 files changed:
ChangeLog
bin/adv1tov2/adv1tov2.c
bin/aecho/aecho.c
bin/afile/achfile.c
bin/afile/afile.c
bin/afile/common.c
bin/afile/common.h
bin/afppasswd/afppasswd.c
bin/getzones/getzones.c
bin/megatron/asingle.c
bin/megatron/asingle.h
bin/megatron/hqx.c
bin/megatron/hqx.h
bin/megatron/macbin.c
bin/megatron/macbin.h
bin/megatron/megatron.c
bin/megatron/megatron.h
bin/megatron/nad.c
bin/megatron/nad.h
bin/megatron/updcrc.c
bin/nbp/nbplkup.c
bin/nbp/nbprgstr.c
bin/nbp/nbpunrgstr.c
bin/pap/pap.c
bin/pap/papstatus.c
bin/psorder/pa.c
bin/psorder/pa.h
bin/psorder/psorder.c
bin/psorder/psorder.h
contrib/macusers/macusers
contrib/printing/timeout.c
contrib/timelord/timelord.c
libatalk/adouble/ad_attr.c
libatalk/adouble/ad_date.c
libatalk/adouble/ad_flush.c
libatalk/adouble/ad_lock.c
libatalk/adouble/ad_mmap.c
libatalk/adouble/ad_open.c
libatalk/adouble/ad_private.h
libatalk/adouble/ad_read.c
libatalk/adouble/ad_sendfile.c
libatalk/adouble/ad_size.c
libatalk/adouble/ad_write.c
libatalk/asp/asp_attn.c
libatalk/asp/asp_child.h
libatalk/asp/asp_close.c
libatalk/asp/asp_cmdreply.c
libatalk/asp/asp_getreq.c
libatalk/asp/asp_getsess.c
libatalk/asp/asp_init.c
libatalk/asp/asp_shutdown.c
libatalk/asp/asp_write.c
libatalk/atp/atp_bprint.c
libatalk/atp/atp_bufs.c
libatalk/atp/atp_close.c
libatalk/atp/atp_internals.h
libatalk/atp/atp_open.c
libatalk/atp/atp_packet.c
libatalk/atp/atp_rreq.c
libatalk/atp/atp_rresp.c
libatalk/atp/atp_rsel.c
libatalk/atp/atp_sreq.c
libatalk/atp/atp_sresp.c
libatalk/cnid/cnid_add.c
libatalk/cnid/cnid_close.c
libatalk/cnid/cnid_delete.c
libatalk/cnid/cnid_get.c
libatalk/cnid/cnid_lookup.c
libatalk/cnid/cnid_meta.c
libatalk/cnid/cnid_meta.h
libatalk/cnid/cnid_nextid.c
libatalk/cnid/cnid_open.c
libatalk/cnid/cnid_private.h
libatalk/cnid/cnid_resolve.c
libatalk/cnid/cnid_update.c
libatalk/compat/flock.c
libatalk/compat/getusershell.c
libatalk/compat/inet_aton.c
libatalk/compat/mktemp.c
libatalk/compat/rquota_xdr.c
libatalk/compat/strcasecmp.c
libatalk/compat/strdup.c
libatalk/compat/strstr.c
libatalk/dsi/dsi_attn.c
libatalk/dsi/dsi_close.c
libatalk/dsi/dsi_cmdreply.c
libatalk/dsi/dsi_getsess.c
libatalk/dsi/dsi_getstat.c
libatalk/dsi/dsi_init.c
libatalk/dsi/dsi_opensess.c
libatalk/dsi/dsi_private.h
libatalk/dsi/dsi_read.c
libatalk/dsi/dsi_stream.c
libatalk/dsi/dsi_tcp.c
libatalk/dsi/dsi_tickle.c
libatalk/dsi/dsi_write.c
libatalk/nbp/nbp_conf.h
libatalk/nbp/nbp_lkup.c
libatalk/nbp/nbp_rgstr.c
libatalk/nbp/nbp_unrgstr.c
libatalk/nbp/nbp_util.c
libatalk/netddp/netddp_open.c
libatalk/netddp/netddp_recvfrom.c
libatalk/netddp/netddp_sendto.c
libatalk/pap/pap_child.h
libatalk/pap/pap_close.c
libatalk/pap/pap_init.c
libatalk/pap/pap_open.c
libatalk/pap/pap_read.c
libatalk/pap/pap_sendstatus.c
libatalk/pap/pap_slinit.c
libatalk/pap/pap_tickle.c
sys/generic/sys/cdefs.h
sys/netatalk/aarp.c
sys/netatalk/aarp.h
sys/netatalk/at.h
sys/netatalk/at_control.c
sys/netatalk/at_proto.c
sys/netatalk/at_var.h
sys/netatalk/ddp.h
sys/netatalk/ddp_input.c
sys/netatalk/ddp_output.c
sys/netatalk/ddp_usrreq.c
sys/netatalk/ddp_var.h
sys/netatalk/endian.h
sys/netatalk/phase2.h
sys/solaris/aarp.c
sys/solaris/ddp.c

index 862e8ee38b548180250e1008a63297f7b46aa963..63c7a2bd11b650a9098fe2341d15decfea904156 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,17 @@
-($Id: ChangeLog,v 1.56 2001-06-27 18:22:19 uhees Exp $)
+($Id: ChangeLog,v 1.57 2001-06-29 14:14:46 rufustfirefly Exp $)
+
+2001-06-27  jeff b  <jeff@univrel.pr.uconn.edu>
+       * many, many, files: more malformed ifdef correction, nicer
+       comments, etc, etc, etc
+
+       * etc/afpd/directory.c, etc/afpd/uid.c, etc/afpd/uid.h: fixes
+       for force-uidgid to compile properly. haven't tested it, but
+       no more compile errors. (Jeff)
 
 2001-06-27  uwe hees <hees@viva.de>
        * etc/uams/uams_guest.c: fixed a typo.
 
-2001-06-26  andy m  <morgan@orst.edu
+2001-06-26  andy m  <morgan@orst.edu>
        * etc/papd/file.c: modified markline() to return 1 instead
        of *linelength for successful completion. This should fix
        the remaining binary printing problems in papd.  Thanks go
index e95b30385f4c1c24829c6a5efbc6c990148f2b15..c52ff072e5264092963dae0f5da39dd6810d11bb 100644 (file)
@@ -1,15 +1,22 @@
-/* v1tov2: given a root directory, run down and convert all the
- * files/directories into appledouble v2.  */
+/*
+ * $Id: adv1tov2.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ * v1tov2: given a root directory, run down and convert all the
+ * files/directories into appledouble v2.
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <dirent.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -130,10 +137,10 @@ int main(int argc, char **argv)
   return 0;
 }
 
-#else
+#else /* AD_VERSION == AD_VERSION2 */
 int main(int argc, char **argv)
 {
   fprintf(stderr, "%s not built for v2 AppleDouble files.\n", *argv);
   return -1;
 }
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
index e12094a9b5982120b1bf7a3a618d0fd14f6ca05a..0bf9d4d5ec281811c762194c2314319b80c2c5a0 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: aecho.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -27,7 +29,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -39,7 +41,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 
 #include <netatalk/endian.h>
 #include <netatalk/at.h>
@@ -53,7 +57,7 @@
 /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature */
 #ifndef SOCKLEN_T
 #define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
 
 struct sockaddr_at     target;
 int                    s, nsent = 0, nrecv = 0;
@@ -161,7 +165,7 @@ int main( ac, av )
     memset( &target, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     target.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     target.sat_family = AF_APPLETALK;
     if ( !atalk_aton( av[ optind ], &target.sat_addr )) {
        if ( nbp_name( av[ optind ], &obj, &type, &zone ) || !obj ) {
index 8c4f90178c489769af96fcf6f1c7d10eb1cb3171..7c7f02bcc455ce9e2b3d288772bdf7ba03f6be0c 100644 (file)
@@ -1,4 +1,7 @@
-/*  afile - determine the MacOS creator/type of files
+/*
+ * $Id: achfile.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+    afile - determine the MacOS creator/type of files
 
     Copyright (C) 2001 Sebastian Rittau.
     All rights reserved.
@@ -31,7 +34,9 @@
     SUCH DAMAGE.
 */
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include <atalk/adouble.h>
 
index 72e5bd07ac464875ee6658c2f9ad56b6b0f6870b..ee1487ade6339622a75a2922fde93cee40db158c 100644 (file)
@@ -1,4 +1,7 @@
-/*  afile - determine the MacOS creator/type of files
+/*
+ * $Id: afile.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+    afile - determine the MacOS creator/type of files
 
     Copyright (C) 2001 Sebastian Rittau.
     All rights reserved.
@@ -31,7 +34,9 @@
     SUCH DAMAGE.
 */
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
@@ -39,7 +44,9 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include <atalk/adouble.h>
 
index d0bea8eda537476a85e819e1ce2a9b5686662c7e..6ec68a56443aed671d45adf920eb025349e4f8c6 100644 (file)
@@ -1,4 +1,7 @@
-/*  common functions, defines, and structures for afile, achfile, and acleandir
+/*
+ * $Id: common.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+    common functions, defines, and structures for afile, achfile, and acleandir
 
     Copyright (C) 2001 Sebastian Rittau.
     All rights reserved.
     SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdlib.h>
 #include <string.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include <atalk/adouble.h>
 #include <netatalk/endian.h>
index 0c92da5e1cedffc4fd11c87177b8446274e4672b..836890976097899ba396b938eb546c821a99133f 100644 (file)
@@ -1,4 +1,7 @@
-/*  common functions, defines, and structures for afile, achfile, and acleandir
+/*
+ * $Id: common.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+    common functions, defines, and structures for afile, achfile, and acleandir
 
     Copyright (C) 2001 Sebastian Rittau.
     All rights reserved.
index 67818ff518db6bc2ad68092c088d6cac63cb23a3..32fc575c062c31592187b63f49597c02f95fc249 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: afppasswd.c,v 1.6 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright 1999 (c) Adrian Sun (asun@u.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
  *
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <ctype.h>
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <pwd.h>
 
 #include <netatalk/endian.h>
@@ -40,7 +46,7 @@
 
 #ifdef USE_CRACKLIB
 #include <crack.h>
-#endif
+#endif /* USE_CRACKLIB */
 
 #define OPT_ISROOT  (1 << 0)
 #define OPT_CREATE  (1 << 1)
@@ -181,7 +187,7 @@ found_entry:
         goto update_done;
     } 
   }
-#endif
+#endif /* USE_CRACKLIB */
 
   passwd = getpass("Enter NEW AFP password again: ");
   if (strcmp(passwd, password) == 0) {
@@ -268,7 +274,7 @@ int main(int argc, char **argv)
     fprintf(stderr, "  -f        force an action\n");
 #ifdef USE_CRACKLIB
     fprintf(stderr, "  -n        disable cracklib checking of passwords\n");
-#endif
+#endif /* USE_CRACKLIB */
     fprintf(stderr, "  -u uid    minimum uid to use, defaults to 100\n");
     fprintf(stderr, "  -p path   path to afppasswd file\n");
     return -1;
@@ -292,7 +298,7 @@ int main(int argc, char **argv)
     case 'n': /* disable CRACKLIB check */
       flags |= OPT_NOCRACK;
       break;
-#endif
+#endif /* USE_CRACKLIB */
     case 'p': /* path to afppasswd file */
       path = optarg;
       break;
@@ -306,15 +312,15 @@ int main(int argc, char **argv)
                        (flags & OPT_ISROOT)) != argc)) {
 #ifdef USE_CRACKLIB
     fprintf(stderr, "Usage: afppasswd [-acfn] [-u minuid] [-p path] [username]\n");
-#else if !(defined(USE_CRACKLIB))
+#else /* USE_CRACKLIB */
     fprintf(stderr, "Usage: afppasswd [-acf] [-u minuid] [-p path] [username]\n");
-#endif
+#endif /* USE_CRACKLIB */
     fprintf(stderr, "  -a        add a new user\n");
     fprintf(stderr, "  -c        create and initialize password file or specific user\n");
     fprintf(stderr, "  -f        force an action\n");
 #ifdef USE_CRACKLIB
     fprintf(stderr, "  -n        disable cracklib checking of passwords\n");
-#endif
+#endif /* USE_CRACKLIB */
     fprintf(stderr, "  -u uid    minimum uid to use, defaults to 100\n");
     fprintf(stderr, "  -p path   path to afppasswd file\n");
     return -1;
@@ -350,7 +356,7 @@ int main(int argc, char **argv)
     return -1;
   }
 }
-#else
+#else /* UAM_RNDNUM */
 
 main(int argc, char **argv)
 {
@@ -358,5 +364,5 @@ main(int argc, char **argv)
   fprintf(stderr, "for the Random Number authentication methods.\n");
   return -1;
 }
-#endif
 
+#endif /* UAM_RNDNUM */
index 13384050cbc86c6b1f7ef4893c3d82f6ad9de191..7301be97d1d5d03768d73115356097de6582eef2 100644 (file)
@@ -1,14 +1,22 @@
+/*
+ * $Id: getzones.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/param.h>
 #include <sys/uio.h>
 #include <sys/time.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 #include <stdio.h>
 #include <string.h>
 #include <netatalk/endian.h>
@@ -70,7 +78,7 @@ int main( argc, argv )
     memset( &saddr, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     saddr.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     saddr.sat_family = AF_APPLETALK;
     if (( se = getservbyname( "zip", "ddp" )) == NULL )
        saddr.sat_port = 6;
index b74ce05b4ddcd82fb0079bf4828222ecc868f34e..c8c9e7b31a50637eb1d4bbe37a37318dd8307ed2 100644 (file)
@@ -1,18 +1,26 @@
+/*
+ * $Id: asingle.c,v 1.6 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <sys/time.h>
 #include <sys/param.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <time.h>
 #include <string.h>
 #include <syslog.h>
 #include <ctype.h>
 #include <stdio.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <atalk/adouble.h>
 #include <netatalk/endian.h>
 #include "asingle.h"
@@ -72,7 +80,7 @@ int single_open( singlefile, flags, fh, options )
        strncpy( single.path, singlefile, MAXPATHLEN );
 #if DEBUG
        fprintf( stderr, "opened %s for read\n", single.path );
-#endif
+#endif /* DEBUG */
        if ((( rc = single_header_test()) > 0 ) && 
                ( single_header_read( fh, rc ) == 0 )) {
            return( 0 );
@@ -141,7 +149,7 @@ int single_header_read( fh, version )
     num_entries = ntohs( num_entries );
 #if DEBUG >= 2
     fprintf( stderr, "The number of entries is %d\n", num_entries );
-#endif
+#endif /* DEBUG */
     for ( ; num_entries > 0 ; num_entries-- ) {
        if ( read( single.filed, (char *)entry_buf, AD_ENTRY_LEN )
                != AD_ENTRY_LEN ) {
@@ -164,7 +172,7 @@ int single_header_read( fh, version )
        fprintf( stderr, "entry_id\t%d\n", entry_id );
        fprintf( stderr, "\toffset\t\t%d\n", single.entry[ entry_id ].ade_off );
        fprintf( stderr, "\tlength\t\t%d\n", single.entry[ entry_id ].ade_len );
-#endif
+#endif /* DEBUG */
     }
 
 /*
@@ -187,7 +195,7 @@ int single_header_read( fh, version )
     }
 #if DEBUG
     fprintf( stderr, "date_entry = %d\n", date_entry );
-#endif
+#endif /* DEBUG */
 
 /*
  * Go through and copy all the information you can get from 
@@ -245,7 +253,7 @@ int single_header_read( fh, version )
            type[4] = creator[4] = '\0';
            fprintf( stderr, "type is %s, creator is %s\n", type, creator );
        }
-#endif
+#endif /* DEBUG */
     }
     if (( single.entry[ ADEID_COMMENT ].ade_len == 0 ) || 
            ( single.entry[ ADEID_COMMENT ].ade_off <= AD_HEADER_LEN )) {
index 278f0583e00cdbe1bd49e1bd68e89816eed425a3..44a3ab124b67843046e9b1a30a820a324f7ebf8e 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * $Id: asingle.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _ASINGLE_H
+#define _ASINGLE_H 1
+
 /* Forward Declarations */
 struct FHeader;
 
@@ -6,3 +13,5 @@ int single_close(int readflag);
 int single_header_read(struct FHeader *fh, int version);
 int single_header_test(void);
 int single_read(int fork, char *buffer, int length);
+
+#endif /* _ASINGLE_H */
index b84f6661b6508078c0b7456158b3813cbcfa9304..0a4e60ab1c875dbf92587dc0dca959fb4b76a8cc 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * $Id: hqx.c,v 1.7 2001-06-10 20:12:29 srittau Exp $
+ * $Id: hqx.c,v 1.8 2001-06-29 14:14:46 rufustfirefly Exp $
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdlib.h>
 #include <sys/types.h>
 #ifdef notdef
 #if BSD >= 199006
 # include <machine/endian.h>
-#else
+#else /* BSD >= 199006 */
 # include <netinet/in.h>
-#endif
-#endif notdef
+#endif /* BSD >= 199006 */
+#endif /* notdef */
 #include <time.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <string.h>
 #include <syslog.h>
 #include <ctype.h>
@@ -36,7 +38,7 @@
  */
 #ifndef        STDIN
 #      define  STDIN   "-"
-#endif
+#endif /* ! STDIN */
 
 /*     Yes and no
  */
@@ -76,7 +78,7 @@ int hqx7_fill(u_char *hqx7_ptr);
 
 #if HEXOUTPUT
 FILE           *rawhex, *expandhex;
-#endif
+#endif /* HEXOUTPUT */
 
 struct hqx_file_data {
     u_int32_t          forklen[ NUMFORKS ];
@@ -108,13 +110,13 @@ int hqx_open( hqxfile, flags, fh, options )
 
 #if DEBUG
     fprintf( stderr, "megatron: entering hqx_open\n" );
-#endif
+#endif /* DEBUG */
     if ( flags == O_RDONLY ) {
 
 #if HEXOUTPUT
        rawhex = fopen( "rawhex.unhex", "w" );
        expandhex = fopen( "expandhex.unhex", "w" );
-#endif
+#endif /* HEXOUTPUT */
 
        first_flag = 0;
 
@@ -132,7 +134,7 @@ int hqx_open( hqxfile, flags, fh, options )
 
                pos = lseek( hqx.filed, 0, L_INCR );
                fprintf( stderr, "megatron: current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
                return( 0 );
            }
        }
@@ -202,7 +204,7 @@ int hqx_read( fork, buffer, length )
     }
     fprintf( stderr, "hqx_read: fork is %s\n", forkname[ fork ] );
     fprintf( stderr, "hqx_read: remaining length is %d\n", hqx.forklen[fork] );
-#endif
+#endif /* DEBUG >= 3 */
 
     if ( hqx.forklen[ fork ] < 0 ) {
        fprintf( stderr, "This should never happen, dude!\n" );
@@ -216,7 +218,7 @@ int hqx_read( fork, buffer, length )
 #if DEBUG >= 4
     fprintf( stderr, "hqx_read: storedcrc\t\t%x\n", storedcrc );
     fprintf( stderr, "hqx_read: observed crc\t\t%x\n\n", hqx.forkcrc[fork] );
-#endif
+#endif /* DEBUG >= 4 */
            if ( storedcrc == hqx.forkcrc[ fork ] ) {
                return( 0 );
            }
@@ -233,7 +235,7 @@ int hqx_read( fork, buffer, length )
     }
 #if DEBUG >= 3
     fprintf( stderr, "hqx_read: readlen is %d\n", readlen );
-#endif
+#endif /* DEBUG >= 3 */
 
     cc = hqx_7tobin( buffer, readlen );
     if ( cc > 0 ) {
@@ -243,7 +245,7 @@ int hqx_read( fork, buffer, length )
     }
 #if DEBUG >= 3
     fprintf( stderr, "hqx_read: chars read is %d\n", cc );
-#endif
+#endif /* DEBUG >= 3 */
     return( cc );
 }
 
@@ -267,7 +269,7 @@ int hqx_header_read( fh )
 #if HEXOUTPUT
     int                headerfork;
     headerfork = open( "headerfork", O_WRONLY|O_CREAT, 0622 );
-#endif
+#endif /* HEXOUTPUT */
 
     mask = htons( 0xfcee );
     hqx.headercrc = 0;
@@ -281,7 +283,7 @@ int hqx_header_read( fh )
 
 #if HEXOUTPUT
     write( headerfork, &namelen, sizeof( namelen ));
-#endif
+#endif /* HEXOUTPUT */
 
     if (( headerbuf = 
            (char *)malloc( (unsigned int)( namelen + BHH_HEADSIZ ))) == 0 ) {
@@ -298,7 +300,7 @@ int hqx_header_read( fh )
 
 #if HEXOUTPUT
     write( headerfork, headerbuf, ( namelen + BHH_HEADSIZ ));
-#endif
+#endif /* HEXOUTPUT */
 
 /*
  * stuff from the hqx file header
@@ -352,7 +354,7 @@ int hqx_header_read( fh )
        fprintf( stderr, "observed crc\t\t%x\n", hqx.headercrc );
        fprintf( stderr, "\n" );
     }
-#endif
+#endif /* DEBUG >= 5 */
 
 /*
  * create and modify times are figured from right now
@@ -593,7 +595,7 @@ int hqx_7tobin( outbuf, datalen )
 #if DEBUG
     fprintf( stderr, "hqx_7tobin: datalen entering %d\n", datalen );
     fprintf( stderr, "hqx_7tobin: hqx8i entering %d\n", hqx8i );
-#endif
+#endif /* DEBUG */
 
     if ( first_flag == 0 ) {
        prev_hqx8 = 0;
@@ -606,7 +608,7 @@ int hqx_7tobin( outbuf, datalen )
 
 #if DEBUG
     fprintf( stderr, "hqx_7tobin: hqx8i entering %d\n", hqx8i );
-#endif
+#endif /* DEBUG */
 
     out_first = outbuf;
     out_last = out_first + datalen;
@@ -666,14 +668,14 @@ int hqx_7tobin( outbuf, datalen )
 #if HEXOUTPUT
            putc( hqx8i, rawhex );
             putc( hqx8[ hqx8i ], rawhex );
-#endif
+#endif /* HEXOUTPUT */
 
            if ( prev_hqx8 == RUNCHAR ) {
                if ( hqx8[ hqx8i ] == 0 ) {
                    *out_first = prev_hqx8;
 #if HEXOUTPUT
                    putc( *out_first, expandhex );
-#endif
+#endif /* HEXOUTPUT */
                    prev_out = prev_hqx8;
                    out_first++;
                }
@@ -681,7 +683,7 @@ int hqx_7tobin( outbuf, datalen )
                    *out_first = prev_out;
 #if HEXOUTPUT
                    putc( *out_first, expandhex );
-#endif
+#endif /* HEXOUTPUT */
                    hqx8[ hqx8i ]--;
                    out_first++;
                }
@@ -697,7 +699,7 @@ int hqx_7tobin( outbuf, datalen )
                *out_first = prev_hqx8;
 #if HEXOUTPUT
                putc( *out_first, expandhex );
-#endif
+#endif /* HEXOUTPUT */
                prev_out = prev_hqx8;
                out_first++;
            }
index 3c22449691fe7f7e8ec0bbd330935bcda5b14cd2..73fbdeae63ce180578cef196a1197b3b9afec227 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * $Id: hqx.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _HQX_H
+#define _HQX_H 1
+
 /* Forward Declarations */
 struct FHeader;
 
@@ -9,3 +16,5 @@ int hqx_header_read(struct FHeader *fh);
 int hqx_header_write(struct FHeader *fh);
 int hqx_7tobin(char *outbuf, int datalen);
 int hqx7_fill(u_char *hqx7_ptr);
+
+#endif /* _HQX_H */
index fe7b6bbc4099b2d40fd8ee11cd57e6a2fbdecc4b..b11d088c4713363e372af207c51fd4206ddfb26e 100644 (file)
@@ -1,13 +1,21 @@
+/*
+ * $Id: macbin.c,v 1.8 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <sys/time.h>
 #include <sys/param.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <string.h>
 #include <strings.h>
 #include <syslog.h>
@@ -30,7 +38,7 @@
  */
 #ifndef        STDIN
 #      define  STDIN   "-"
-#endif
+#endif /* STDIN */
 
 /*     Yes and no
  */
@@ -74,7 +82,7 @@ int bin_open( binfile, flags, fh, options )
 
 #if DEBUG
     fprintf( stderr, "entering bin_open\n" );
-#endif
+#endif /* DEBUG */
 
     /* call localtime so that we get the timezone offset */
     bin.gmtoff = 0;
@@ -83,7 +91,7 @@ int bin_open( binfile, flags, fh, options )
     tp = localtime(&t);
     if (tp)
         bin.gmtoff = tp->tm_gmtoff;
-#endif
+#endif /* ! NO_STRUCT_TM_GMTOFF */
 
     if ( flags == O_RDONLY ) { /* input */
        if ( strcmp( binfile, STDIN ) == 0 ) {
@@ -94,7 +102,7 @@ int bin_open( binfile, flags, fh, options )
        }
 #if DEBUG
        fprintf( stderr, "opened %s for read\n", binfile );
-#endif
+#endif /* DEBUG */
        if ((( rc = test_header() ) > 0 ) && 
                ( bin_header_read( fh, rc ) == 0 )) {
            return( 0 );
@@ -109,7 +117,7 @@ int bin_open( binfile, flags, fh, options )
 #if DEBUG
          fprintf( stderr, "sizeof bin.path\t\t\t%d\n", sizeof( bin.path ));
          fprintf( stderr, "maxlen \t\t\t\t%d\n", maxlen );
-#endif
+#endif /* DEBUG */
          strncpy( bin.path, fh->name, maxlen );
          strncpy( bin.path, mtoupath( bin.path ), maxlen );
          strncat( bin.path, ".bin", maxlen - strlen( bin.path ));
@@ -120,7 +128,7 @@ int bin_open( binfile, flags, fh, options )
 #if DEBUG
          fprintf( stderr, "opened %s for write\n", 
                   (options & OPTION_STDOUT) ? "(stdout)" : bin.path );
-#endif
+#endif /* DEBUG */
        }
 
        if ( bin_header_write( fh ) != 0 ) {
@@ -143,7 +151,7 @@ int bin_close( keepflag )
 {
 #if DEBUG
     fprintf( stderr, "entering bin_close\n" );
-#endif
+#endif /* DEBUG */
     if ( keepflag == KEEP ) {
        return( close( bin.filed ));
     } else if ( keepflag == TRASH ) {
@@ -176,7 +184,7 @@ int bin_read( fork, buffer, length )
 #if DEBUG >= 3
     fprintf( stderr, "bin_read: fork is %s\n", forkname[ fork ] );
     fprintf( stderr, "bin_read: remaining length is %d\n", bin.forklen[fork] );
-#endif
+#endif /* DEBUG >= 3 */
 
     if ( bin.forklen[ fork ] < 0 ) {
        fprintf( stderr, "This should never happen, dude!\n" );
@@ -188,14 +196,14 @@ int bin_read( fork, buffer, length )
            pos = lseek( bin.filed, 0, SEEK_CUR );
 #if DEBUG
            fprintf( stderr, "current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
            pos %= HEADBUFSIZ;
            if (pos != 0) {
              pos = lseek( bin.filed, HEADBUFSIZ - pos, SEEK_CUR );
            }
 #if DEBUG
            fprintf( stderr, "current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
        }
        return( 0 );
     }
@@ -208,14 +216,14 @@ int bin_read( fork, buffer, length )
 #if DEBUG >= 3
     fprintf( stderr, "bin_read: readlen is %d\n", readlen );
     fprintf( stderr, "bin_read: cc is %d\n", cc );
-#endif
+#endif /* DEBUG >= 3 */
 
     buf_ptr = buffer;
     while (( readlen > 0 ) && ( cc > 0 )) {
        if (( cc = read( bin.filed, buf_ptr, readlen )) > 0 ) {
 #if DEBUG >= 3
            fprintf( stderr, "bin_read: cc is %d\n", cc );
-#endif
+#endif /* DEBUG >= 3 */
            readlen -= cc;
            buf_ptr += cc;
        }
@@ -227,7 +235,7 @@ int bin_read( fork, buffer, length )
 
 #if DEBUG >= 3
     fprintf( stderr, "bin_read: chars read is %d\n", cc );
-#endif
+#endif /* DEBUG >= 3 */
     return( cc );
 }
 
@@ -251,7 +259,7 @@ int bin_write( fork, buffer, length )
 #if DEBUG >= 3
     fprintf( stderr, "bin_write: fork is %s\n", forkname[ fork ] );
     fprintf( stderr, "bin_write: remaining length is %d\n", bin.forklen[fork] );
-#endif
+#endif /* DEBUG >= 3 */
 
     if (( fork == RESOURCE ) && ( bin.forklen[ DATA ] != 0 )) {
        fprintf( stderr, "Forklength error.\n" );
@@ -268,7 +276,7 @@ int bin_write( fork, buffer, length )
 
 #if DEBUG >= 3
     fprintf( stderr, "bin_write: write length is %d\n", writelen );
-#endif
+#endif /* DEBUG >= 3 */
 
     while (( writelen > 0 ) && ( cc >= 0 )) {
        cc = write( bin.filed, buf_ptr, writelen );
@@ -294,7 +302,7 @@ int bin_write( fork, buffer, length )
        pos = lseek( bin.filed, 0, SEEK_CUR );
 #if DEBUG
        fprintf( stderr, "current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
        pos %= HEADBUFSIZ;
        if (pos != 0) { /* pad only if we need to */
          pos = lseek( bin.filed, HEADBUFSIZ - pos - 1, SEEK_CUR );
@@ -305,12 +313,12 @@ int bin_write( fork, buffer, length )
        }
 #if DEBUG
          fprintf( stderr, "current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
     }
 
 #if DEBUG
        fprintf( stderr, "\n" );
-#endif
+#endif /* DEBUG */
 
     return( length );
 }
@@ -366,7 +374,7 @@ int bin_header_read( fh, revision )
 #ifndef MACBINARY_PLAY_NICE_WITH_OTHERS /* (RLB) */
     memcpy( &fh->finder_info.fdFlags, head_buf + 73, 1 );
     fh->finder_info.fdFlags &= mask;
-#else
+#else /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */
        memcpy( &fh->finder_info.fdFlags, head_buf + 73, 2 );
 #endif /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */
 
@@ -411,7 +419,7 @@ int bin_header_read( fh, revision )
        fprintf( stderr, "resource fork length\t%ld\n", bin.forklen[RESOURCE] );
        fprintf( stderr, "\n" );
     }
-#endif
+#endif /* DEBUG >= 5 */
 
     return( 0 );
 }
@@ -438,7 +446,7 @@ int bin_header_write( fh )
 
 #ifndef MACBINARY_PLAY_NICE_WITH_OTHERS /* (RLB) */
     memcpy( head_buf + 73, &fh->finder_info.fdFlags, 1 );
-#else
+#else /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */
     memcpy( head_buf + 73, &fh->finder_info.fdFlags, 2 );
 #endif /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */
 
@@ -493,7 +501,7 @@ int bin_header_write( fh )
        fprintf( stderr, "resource fork length\t%ld\n", bin.forklen[RESOURCE] );
        fprintf( stderr, "\n" );
     }
-#endif
+#endif /* DEBUG >= 5 */
 
     write_ptr = (char *)head_buf;
     wc = sizeof( head_buf );
@@ -538,7 +546,7 @@ int test_header(void)
 
 #if DEBUG
     fprintf( stderr, "entering test_header\n" );
-#endif
+#endif /* DEBUG */
 
     cc = read( bin.filed, (char *)head_buf, sizeof( head_buf ));
     if ( cc < sizeof( head_buf )) {
@@ -548,7 +556,7 @@ int test_header(void)
 
 #if DEBUG
     fprintf( stderr, "was able to read HEADBUFSIZ bytes\n" );
-#endif
+#endif /* DEBUG */
 
     /* check for macbinary III header */
     if (memcmp(head_buf + 102, "mBIN", 4) == 0)
@@ -558,7 +566,7 @@ int test_header(void)
     if (( head_buf[ 0 ] == 0 ) || ( head_buf[ 74 ] == 0 )) {
 #if DEBUG
       fprintf( stderr, "byte 0 and 74 are both zero\n" );
-#endif
+#endif /* DEBUG */
       bin.headercrc = updcrc( (u_short) 0, head_buf, 124 );
       memcpy(&header_crc, head_buf + 124, sizeof( header_crc ));
       header_crc = ntohs( header_crc );
@@ -568,7 +576,7 @@ int test_header(void)
 
 #if DEBUG
       fprintf( stderr, "header crc didn't pan out\n" );
-#endif
+#endif /* DEBUG */
     }
 
     /* now see if we have a macbinary file. */
@@ -578,7 +586,7 @@ int test_header(void)
     memcpy( &namelen, head_buf + 1, sizeof( namelen ));
 #if DEBUG
     fprintf( stderr, "name length is %d\n", namelen );
-#endif
+#endif /* DEBUG */
     if (( namelen < 1 ) || ( namelen > 63 )) {
        return( -1 );
     }
@@ -600,7 +608,7 @@ int test_header(void)
 
 #if DEBUG
     fprintf( stderr, "byte 82 is zero and name length is cool\n" );
-#endif
+#endif /* DEBUG */
 
     return( 1 );
 }
index 35031c4b0c03689aafd8ce4cdfe3bc9321e1b01e..d84f74111d004a071dc9943549382b2e2610e1ed 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * $Id: macbin.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _MACBIN_H
+#define _MACBIN_H 1
+
 /* Forward Declarations */
 struct FHeader;
 
@@ -9,3 +16,5 @@ int bin_header_read(struct FHeader *fh, int revision);
 int bin_header_write(struct FHeader *fh);
 int test_header(void);
 u_short updcrc();
+
+#endif /* _MACBIN_H */
index bb6bda2d33a7650a67b854a3f4bd1730ce81568a..c5e5583dff985241b05ce5066bee4040a2297dd1 100644 (file)
@@ -1,12 +1,18 @@
+/*
+ * $Id: megatron.c,v 1.6 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/uio.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <time.h>
 #include <ctype.h>
 #include <stdio.h>
@@ -268,7 +274,7 @@ int megatron( path, module, newname, flags )
        fprintf( stderr, "megatron: forkred is \t\t%d\n", forkred );
        fprintf( stderr, "megatron: fh.forklen[%d] is \t%d\n", fork, 
                ntohl( fh.forklen[ fork ] ));
-#endif
+#endif /* DEBUG */
        if (( bufc < 0 ) || ( forkred != ntohl( fh.forklen[ fork ] ))) {
            fprintf( stderr, "%s: Problem with input, dude\n", path );
            to_close( module, TRASH );
@@ -309,7 +315,7 @@ int main( argc, argv )
        fprintf( stderr, "megatron: list of program links messed up\n" );
        return( -1 );
     }
-#endif
+#endif /* DEBUG */
 
     for ( c = 0 ; (( c < converts ) && ( module < 0 )) ; ++c ) {
        if ( strcmp( name[ c ], progname ) == 0 ) module = c;
index 9190d499b164c04136aac5d37d7df826a96bd71b..a884327bf8728829cc0e0a8baf3a57cde2a876fe 100644 (file)
@@ -1,8 +1,15 @@
+/*
+ * $Id: megatron.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _MEGATRON_H
+#define _MEGATRON_H 1
+
 #include <atalk/adouble.h>
 
 #ifndef        STDIN
 #      define  STDIN   "-"
-#endif
+#endif /* ! STDIN */
 
 /*
     Where it matters, data stored in either of these two structs is in
@@ -81,6 +88,8 @@ struct FHeader {
 
 #ifndef S_ISDIR
 #      define S_ISDIR(s)       (( s & S_IFMT ) == S_IFDIR )
-#endif
+#endif /* ! S_ISDIR */
 
 extern char *mtoupath( char *);
+
+#endif /* _MEGATRON_H */
index dff7804e1a0c5811766d38e53b26c5a66e273c9d..97d2a3481802cd3bda4e3ba6fb384adbebb20a13 100644 (file)
@@ -1,6 +1,10 @@
+/*
+ * $Id: nad.c,v 1.8 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -13,7 +17,9 @@
 #include <string.h>
 #include <syslog.h>
 #include <dirent.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 
 #include <atalk/adouble.h>
 #include <netatalk/endian.h>
@@ -34,18 +40,18 @@ char *mtoupath( mpath )
     while ( *m != '\0' ) {
 #if AD_VERSION == AD_VERSION1
        if ( !isascii( *m ) || *m == '/' || ( i == 0 && *m == '.' )) {
-#else
+#else /* AD_VERSION == AD_VERSION1 */
        if (!isprint(*m) || *m == '/' || ( i == 0 && (*m == '.' ))) {
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
            *u++ = ':';
            *u++ = hexdig[ ( *m & 0xf0 ) >> 4 ];
            *u++ = hexdig[ *m & 0x0f ];
        } else {
 #ifdef DOWNCASE
            *u++ = ( isupper( *m )) ? tolower( *m ) : *m;
-#else DOWNCASE
+#else /* DOWNCASE */
            *u++ = *m;
-#endif DOWNCASE
+#endif /* DOWNCASE */
        }
        i++;
        m++;
@@ -78,9 +84,9 @@ char *utompath( upath )
        } else {
 #ifdef DOWNCASE
          *m = diatolower(*u);
-#else DOWNCASE
+#else /* DOWNCASE */
          *m = *u;
-#endif DOWNCASE
+#endif /* DOWNCASE */
        }
        u++;
        m++;
@@ -91,7 +97,7 @@ char *utompath( upath )
 
 #if HEXOUTPUT
     int                        hexfork[ NUMFORKS ];
-#endif
+#endif /* HEXOUTPUT */
 
 struct nad_file_data {
     char               macname[ MAXPATHLEN + 1 ];
@@ -132,7 +138,7 @@ int nad_open( path, openflags, fh, options )
 #if DEBUG
     fprintf(stderr, "%s is adpath[0]\n", nad.adpath[0]);
     fprintf(stderr, "%s is adpath[1]\n", nad.adpath[1]);
-#endif
+#endif /* DEBUG */
        if ( ad_open( nad.adpath[ 0 ], ADFLAGS_DF|ADFLAGS_HF,
                openflags, (int)( st.st_mode & 0666 ), &nad.ad) < 0 ) {
            perror( nad.adpath[ 0 ] );
@@ -149,7 +155,7 @@ int nad_open( path, openflags, fh, options )
     fprintf(stderr, "%s\n", nad.macname);
     fprintf(stderr, "%s is adpath[0]\n", nad.adpath[0]);
     fprintf(stderr, "%s is adpath[1]\n", nad.adpath[1]);
-#endif
+#endif /* DEBUG */
        if ( stat( ".", &st ) < 0 ) {
            perror( "stat of . failed" );
            return( -1 );
@@ -195,7 +201,7 @@ int nad_header_read( fh )
     fprintf( stderr, "size of resource fork\t\t%d\n", 
            ntohl( fh->forklen[ RESOURCE ] ));
     fprintf( stderr, "get info comment\t\t\"%s\"\n", fh->comment );
-#endif
+#endif /* DEBUG */
 
     ad_getdate(&nad.ad, AD_DATE_CREATE, &temptime);
     memcpy( &fh->create_date, &temptime, sizeof( temptime ));
@@ -215,7 +221,7 @@ int nad_header_read( fh )
     temptime = AD_DATE_TO_UNIX(temptime);
     fprintf( stderr, "backup_date seconds\t\t%lu\n", temptime );
     fprintf( stderr, "size of finder_info\t\t%d\n", sizeof( fh->finder_info ));
-#endif
+#endif /* DEBUG */
 
     memcpy(&fh->finder_info.fdType,
            ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_TYPE,
@@ -258,7 +264,7 @@ int nad_header_read( fh )
        fprintf(stderr, "fh script\t\t\t%x\n", fh->finder_xinfo.fdScript);
        fprintf(stderr, "fh xflags\t\t\t%x\n", fh->finder_xinfo.fdXFlags);
     }
-#endif
+#endif /* DEBUG */
 
     nad.offset[ DATA ] = nad.offset[ RESOURCE ] = 0;
 
@@ -292,7 +298,7 @@ int nad_header_write( fh )
            ad_entry( &nad.ad, ADEID_NAME ));
     fprintf( stderr, "ADEID_COMMENT\t\t\t%d\n",
             ad_getentrylen( &nad.ad, ADEID_COMMENT ));
-#endif
+#endif /* DEBUG */
 
     memcpy( &temptime, &fh->create_date, sizeof( temptime ));
     ad_setdate(&nad.ad, AD_DATE_CREATE, temptime);
@@ -306,7 +312,7 @@ int nad_header_write( fh )
     ad_getdate(&nad.ad, AD_DATE_MODIFY, &temptime);
     temptime = AD_DATE_TO_UNIX(temptime);
     fprintf(stderr, "FILEIOFF_MODIFY seconds\t\t%ld\n", temptime );
-#endif
+#endif /* DEBUG */
 
     memset( ad_entry( &nad.ad, ADEID_FINDERI ), 0, ADEDLEN_FINDERI );
     memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_TYPE, 
@@ -338,12 +344,12 @@ int nad_header_write( fh )
                sizeof( fh->finder_info.fdCreator ),
                ad_entry( &nad.ad, ADEID_FINDERI ));
     }
-#endif
+#endif /* DEBUG */
 
 #if HEXOUTPUT
     hexfork[ DATA ] = open( "datafork", O_WRONLY|O_CREAT, 0622 );
     hexfork[ RESOURCE ] = open( "resfork", O_WRONLY|O_CREAT, 0622 );
-#endif
+#endif /* HEXOUTPUT */
 
     nad.offset[ DATA ] = nad.offset[ RESOURCE ] = 0;
     ad_flush( &nad.ad, ADFLAGS_DF|ADFLAGS_HF );
@@ -362,7 +368,7 @@ int nad_read( fork, forkbuf, bufc )
 
 #if DEBUG
     fprintf( stderr, "Entering nad_read\n" );
-#endif
+#endif /* DEBUG */
 
     if (( cc = ad_read( &nad.ad, forkeid[ fork ], nad.offset[ fork ], 
            forkbuf, bufc)) < 0 )  {
@@ -373,7 +379,7 @@ int nad_read( fork, forkbuf, bufc )
 
 #if DEBUG
     fprintf( stderr, "Exiting nad_read\n" );
-#endif
+#endif /* DEBUG */
 
     return( cc );
 }
@@ -389,11 +395,11 @@ int nad_write( fork, forkbuf, bufc )
 
 #if DEBUG
     fprintf( stderr, "Entering nad_write\n" );
-#endif
+#endif /* DEBUG */
 
 #if HEXOUTPUT
     write( hexfork[ fork ], forkbuf, bufc );
-#endif
+#endif /* HEXOUTPUT */
 
     writelen = bufc;
     buf_ptr = forkbuf;
index 632d7f2f0820da909f3dcf7ca8f45eec1ed5b2f2..0e0332dfc99cf771bfe9c5e84cce8db50347cd45 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * $Id: nad.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _NAD_H
+#define _NAD_H 1
+
 /* Forward Declarations */
 struct FHeader;
 
@@ -7,3 +14,5 @@ int nad_header_write(struct FHeader *fh);
 int nad_read(int fork, char *forkbuf, int bufc);
 int nad_write(int fork, char *forkbuf, int bufc);
 int nad_close(int status);
+
+#endif /* _NAD_H */
index a2176b1783acbb8e204bc9ff3710a29cfe1e8ba7..250905057a983a58fc0ca13f6f117c551418b346 100644 (file)
@@ -1,4 +1,7 @@
-/* updcrc(3), crc(1) - calculate crc polynomials
+/*
+ * $Id: updcrc.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ * updcrc(3), crc(1) - calculate crc polynomials
  *
  * Calculate, intelligently, the CRC of a dataset incrementally given a 
  * buffer full at a time.
@@ -27,7 +30,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 /* The CRC polynomial.
  * These 4 values define the crc-polynomial.
 #define INIT_CRC 0L    /* init value:  -1      0       0       */
 #if 0
 #define SWAPPED        /* bit order:   undef   defined defined */
-#endif
+#endif /* 0 */
 #define W      16      /* bits in CRC:16       16      16      */
 
     /* data type that holds a W-bit unsigned integer */
 #if W <= 16
 #  define WTYPE        unsigned short
-#else
+#else /* W <= 16 */
 #  define WTYPE   u_int32_t
-#endif
+#endif /* W <= 16 */
 
     /* the number of bits per char: don't change it. */
 #define B      8
@@ -100,9 +103,9 @@ updcrc( icrc, icp, icnt )
     while( cnt-- ) {
 #ifndef SWAPPED
        crc = (crc<<B) ^ crctab[(crc>>(W-B)) ^ *cp++];
-#else
+#else /* SWAPPED */
        crc = (crc>>B) ^ crctab[(crc & ((1<<B)-1)) ^ *cp++]; 
-#endif SWAPPED
+#endif /* SWAPPED */
     }
 
     return( crc );
@@ -139,7 +142,7 @@ initcrctab()
            printf("  ");
     }
 }
-#endif
+#endif /* MAKETAB */
 
 #ifdef TEST
 
@@ -191,7 +194,7 @@ main( ac, av )
     /* crc should now equal magic */
     buf[0] = buf[1] = buf[2] = buf[3] = 0;
     printf( "magic test: %lx =?= %lx\n", crc, updcrc(-1, buf, W/B));
-#endif MAGICCHECK
+#endif /* MAGICCHECK */
 }
 
-#endif
+#endif /* TEST */
index 910a572f1153240deefc53c3d968b420786e059d..b677e4600234e692c4572d559c9e2d0ad2c932f7 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: nbplkup.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 <netatalk/endian.h>
@@ -34,7 +36,7 @@
 #include <stdio.h>
 #if !defined( sun ) || !defined( i386 )
 #include <stdlib.h>
-#endif sun i386
+#endif /* ! sun || ! i386 */
 
 char *Obj = "=";
 char *Type = "=";
index 2ba614153eb998cbdc71652f93bbf8cb2ea0b3d3..b12039603b6b37c3995b1b4b528eef74853e0351 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: nbprgstr.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
index 5eb465f0674378f97ac74c1f9a07b25d807afbb6..19966b180719c3b7d9e4be897303aa6e03a80685 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: nbpunrgstr.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 <stdio.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <netatalk/endian.h>
 #include <netatalk/at.h>
 #include <atalk/util.h>
index 3fba619c95a8ed2ced37b71680c02c53111150de..e65ab39b0c7cf86f09e47941466c82ffb5c317dd 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: pap.c,v 1.6 2001-06-29 14:14:46 rufustfirefly 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/types.h>
 #include <sys/time.h>
@@ -16,7 +18,9 @@
 #include <atalk/pap.h>
 #include <atalk/nbp.h>
 #include <atalk/util.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <stdio.h>
 #include <string.h>
 #include <string.h>
@@ -34,7 +38,7 @@ int send_file(int fd, ATP atp, int lastfile);
 /* if there is a less hacky way to do this, please do it... */
 #ifdef DEBUG
 #define EBUG
-#endif
+#endif /* DEBUG */
 
 #undef DEBUG
 
@@ -172,7 +176,7 @@ int main( ac, av )
        case 'W' :
            waitforidle = 1;
            break;
-#endif /*FUCKED*/
+#endif /* FUCKED */
 
        case 'c' :
            cuts++;
@@ -284,7 +288,7 @@ DEBUG( printf( "SENDSTATUS >\n" ), fflush( stdout ));
            fprintf( stderr, "Bad status response!\n" );
            exit( 1 );
        }
-#endif /*NONZEROSTATUS*/
+#endif /* NONZEROSTATUS */
 
        if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_STATUS ||
                atpb.atp_rresiovcnt != 1 ) {
@@ -443,7 +447,7 @@ DEBUG( printf( "CLOSE >\n" ), fflush( stdout ));
        fprintf( stderr, "Bad connid in close!\n" );
        exit( 1 );
     }
-#endif /*ZEROCONNID*/
+#endif /* ZEROCONNID */
 
 DEBUG( printf( "< CLOSEREPLY\n" ), fflush( stdout ));
 
@@ -601,7 +605,7 @@ DEBUG( printf( "| DUP %d\n", rseq ), fflush( stdout ));
                        }
                        if ( rseq++ == 0xffff ) rseq = 1;
                    }
-#endif /*notdef*/
+#endif /* notdef */
 
                    data = 1;
                    port = ssat.sat_port;
@@ -666,7 +670,7 @@ DEBUG( printf( "< TICKLE\n" ), fflush( stdout ));
                    fprintf( stderr, "Bad data response!\n" );
                    exit( 1 );
                }
-#endif /*ZEROCONNID*/
+#endif /* ZEROCONNID */
                if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_DATA ) {
                    fprintf( stderr, "Bad data response!\n" );
                    exit( 1 );
@@ -805,7 +809,7 @@ DEBUG( printf( "SENDSTATUS >\n" ), fflush( stdout ));
                fprintf( stderr, "Bad status response!\n" );
                exit( 1 );
            }
-#endif /*NONZEROSTATUS*/
+#endif /* NONZEROSTATUS */
 
            if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_STATUS ||
                    atpb.atp_rresiovcnt != 1 ) {
@@ -826,7 +830,7 @@ DEBUG( printf( "< STATUS\n" ), fflush( stdout ));
                    waitforprinter = 0;
                }
            }
-#endif /*FUCKED*/
+#endif /* FUCKED */
 
            updatestatus( (char *) rniov[ 0 ].iov_base + 9,
                    ((char *)rniov[ 0 ].iov_base)[ 8 ] );
index c232777cf98f211307c3d63e9e14936ce8f676a1..4536b6b7a2949c0a6ef6f6a5d46ecf3a78446a46 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: papstatus.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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>
index f1a52e8f32d68528b824e7847400518ed86d1419..f5a25ececd049b56d55c7b02e7cfe50c0324f3f8 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: pa.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include "pa.h"
 
index d7684e2427fa1623d7e95e999a02c53cee99008a..e86636765b00ea57cd251466ad80773fcd9c01bd 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: pa.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
  *     pa_cancel( h )          Cancel previous match start.
  */
 
+#ifndef _PA_H
+#define _PA_H 1
+
 #ifndef FILE_H
 #include <stdio.h>
-#endif
+#endif /* FILE_H */
 
 #define PA_BUFBLK      1024
 
@@ -68,3 +73,5 @@ extern char *pa_gettok();
 #define pa_cont(h)     (*((h)->cur)=(h)->tmp,(h)->state=PA_MATCHING)
 #define pa_cancel(h)   ((h)->state=PA_NORMAL)
 #define pa_back(h)     (--((h)->cur))
+
+#endif /* _PA_H */
index 176e29122ccb7af1cfaa877eb86ec15b25184d89..7ba4332f9eedfe3e4258189f68428cb562806cc2 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: psorder.c,v 1.5 2001-06-29 14:14:46 rufustfirefly 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 <stdlib.h>
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <sys/file.h>
 #include <ctype.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <stdio.h>
 #include <string.h>
 #include <dirent.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include "pa.h"
 #include "psorder.h"
 
@@ -139,7 +145,7 @@ filesetup( inputfile, infd, tfile, tfd )
 #if DEBUG
     fprintf( stderr, "Input file or stdin and stdout opened.\n" );
     fprintf( stderr, "Input file descriptor is %d .\n", *infd );
-#endif
+#endif /* DEBUG */
 
 /*
        make temporary file
@@ -154,7 +160,7 @@ filesetup( inputfile, infd, tfile, tfd )
 #if DEBUG
     fprintf( stderr, "Temporary file %s created and opened.\n", tfile );
     fprintf( stderr, "Temporary file descriptor is %d .\n", *tfd );
-#endif
+#endif /* DEBUG */
 
     psinfo.firstpage = NULL;
     psinfo.lastpage = NULL;
@@ -205,7 +211,7 @@ readps( inputfd, tempfd, tempfile )
     }
 #if DEBUG
     fprintf( stderr, "%s\n", curtok );
-#endif
+#endif /* DEBUG */
 
 /*
  * not postscript
@@ -213,7 +219,7 @@ readps( inputfd, tempfd, tempfile )
     if ( strcmp( curtok, PPSADOBE ) != 0 ) {
 #if DEBUG
     fprintf( stderr, "in the not postscript section of readps\n" );
-#endif
+#endif /* DEBUG */
        while (( c = pa_getchar( pb )) != 0 ) {
            ccread++;
            (void)putc( c, tempstream );
@@ -230,7 +236,7 @@ readps( inputfd, tempfd, tempfile )
  */
 #if DEBUG
     fprintf( stderr, "in the postscript section of readps\n" );
-#endif
+#endif /* DEBUG */
     while (( c = pa_getchar( pb )) != 0 ) {
        ccread++;
        (void)putc( c, tempstream );
@@ -239,7 +245,7 @@ readps( inputfd, tempfd, tempfile )
        if ((( pc == '\r' ) || ( pc == '\n' )) && ( cc == '%' )) {
 #if DEBUG
            fprintf( stderr, "supposed start of match, cc = %c\n", cc );
-#endif
+#endif /* DEBUG */
            pa_match( pb );
            ccmatch = ccread - 1;
            while ( ( c = pa_getchar( pb ) ) ) {
@@ -253,7 +259,7 @@ readps( inputfd, tempfd, tempfile )
                    curtok = pa_gettok( pb );
 #if DEBUG
                    fprintf( stderr, "%s\n", curtok );
-#endif
+#endif /* DEBUG */
                    if ( handletok( ccmatch, curtok ) < 0 ) {
                        perror( "malloc died" );
                        filecleanup( -1, tempfd, tempfile );
@@ -283,19 +289,19 @@ handletok( count, token )
        incdoc--;
 #if DEBUG
        fprintf( stderr, "found an EndDoc\n" );
-#endif
+#endif /* DEBUG */
 
     } else if ( strncmp( PBEGINDOC, token, strlen( PBEGINDOC )) == 0 ) {
        incdoc++;
 #if DEBUG
        fprintf( stderr, "found a BeginDoc\n" );
-#endif
+#endif /* DEBUG */
 
     } else if ( !incdoc && 
            ( strncmp( PPAGE, token, strlen( PPAGE )) == 0 )) {
 #if DEBUG
        fprintf( stderr, "found a Page\n" );
-#endif
+#endif /* DEBUG */
        if (( newpage = getpspage( count )) == NULL ) {
            return( -1 );
        }
@@ -317,13 +323,13 @@ handletok( count, token )
 #if DEBUG
        fprintf( stderr, "page lable %s, page ord %s\n", newpage->lable,
                newpage->ord );
-#endif
+#endif /* DEBUG */
 
     } else if ( !incdoc && 
            ( strncmp( PPAGES, token, strlen( PPAGES )) == 0 )) {
 #if DEBUG
        fprintf( stderr, "found a Pages\n" );
-#endif
+#endif /* DEBUG */
        psinfo.pages.offset = count;
        psinfo.pages.end = strlen( token ) + count;
        while ( *token++ != ':' );
@@ -331,7 +337,7 @@ handletok( count, token )
        if ( strncmp( ATEND, token, strlen( ATEND )) == 0 ) {
 #if DEBUG
            fprintf( stderr, "it is a Pages: (atend)\n" );
-#endif
+#endif /* DEBUG */
            psinfo.pages.offset = 0;
            psinfo.pages.end = 0;
        } else {
@@ -344,14 +350,14 @@ handletok( count, token )
 #if DEBUG
            fprintf( stderr, "number of pages %s\n", psinfo.pages.num );
            fprintf( stderr, "order control number %s\n", psinfo.pages.order );
-#endif
+#endif /* DEBUG */
        }
 
     } else if ( !incdoc && 
            ( strncmp( PTRAILER, token, strlen( PTRAILER )) == 0 )) {
 #if DEBUG
        fprintf( stderr, "found the Trailer\n" );
-#endif
+#endif /* DEBUG */
        if  ( psinfo.trailer == 0 ) {
            psinfo.trailer = count;
        }
index ab99076e82e4e03795b0522efbf497e9522aef96..bc09943ba44708a140d1bb2a16eb9757ac4147c7 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: psorder.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
 
 #ifndef        STDIN
 #      define  STDIN   "-"
-#endif
+#endif /* ! STDIN */
 #ifndef FALSE
 #      define  FALSE   0
 #      define  TRUE    1
-#endif
+#endif /* ! FALSE */
 
 #define REVCHAR                'd'
 #define FORWCHAR       'u'
index e0adbd96483d9487710265c765151a6eed935eed..468ee0a0d0814947a9c56dfd1aeaab9cdbbb91e8 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/perl
+# $Id: macusers,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
 
 use strict;
 use vars qw($MAC_PROCESS $PS_STR $MATCH_STR $ASIP_PORT $LSOF);
index 730214d4b97e20b113e4690bbb5da3eda50df56f..539ff7ab00b9b2b8fb3cb009d3c89a757c5c7033 100644 (file)
@@ -1,13 +1,19 @@
 /*
- * $Id: timeout.c,v 1.2 2001-05-07 12:49:19 rufustfirefly Exp $
+ * $Id: timeout.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <signal.h>
 #include <ctype.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 char **av;
 
index 6adad416cf33144cd5f014067717f4189ce4c9fc..2e9f48d2e07a93d5f3fbd564a839e352cf3744c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: timelord.c,v 1.4 2001-02-26 15:39:00 rufustfirefly Exp $
+ * $Id: timelord.c,v 1.5 2001-06-29 14:14:46 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1992 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -18,7 +18,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -168,9 +168,9 @@ main( ac, av )
 
 #ifdef ultrix
     openlog( p, LOG_PID );
-#else ultrix
+#else /* ultrix */
     openlog( p, LOG_NDELAY|LOG_PID, LOG_DAEMON );
-#endif ultrix
+#endif /* ultrix */
 
     /* allocate memory */
     memset (&sat.sat_addr, 0, sizeof (sat.sat_addr));
index a08bcd06acc403e03215e7dc400cffb4006f0aa1..d1a8af5b9cfba84b798678165880c8f0e2fac0e2 100644 (file)
@@ -1,6 +1,10 @@
+/*
+ * $Id: ad_attr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
 #include <atalk/adouble.h>
index 00bb27bc55196557b180087d104caf914e4c9ff9..082be9a4837859da636f6db90a23fed488a69372 100644 (file)
@@ -1,6 +1,10 @@
+/*
+ * $Id: ad_date.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
index d5195b4c6689fab7cff8f1cb75b18b9ee05257fc..541c91591272a28f6b233883d3fc0872c4c4ef66 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: ad_flush.c,v 1.3 2001-06-29 14:14:46 rufustfirefly 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 <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <errno.h>
@@ -95,7 +101,7 @@ int ad_flush( ad, adflags )
 {
 #ifndef USE_MMAPPED_HEADERS
     int len;
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
 
     if (( adflags & ADFLAGS_HF ) && ( ad->ad_hf.adf_flags & O_RDWR )) {
        /* sync our header */
@@ -108,9 +114,9 @@ int ad_flush( ad, adflags )
              MS_SYNC | MS_INVALIDATE);
 #else
        msync(ad->ad_data, ad_getentryoff(ad, ADEID_RFORK));
-#endif
+#endif /* MS_SYNC */
 
-#else
+#else /* USE_MMAPPED_HEADERS */
        if ( ad->ad_hf.adf_off != 0 ) {
            if ( lseek( ad->ad_hf.adf_fd, 0L, SEEK_SET ) < 0L ) {
                return( -1 );
@@ -127,7 +133,7 @@ int ad_flush( ad, adflags )
            return( -1 );
        }
        ad->ad_hf.adf_off = len;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
     }
 
     return( 0 );
@@ -154,7 +160,7 @@ int ad_close( ad, adflags )
 #ifdef USE_MMAPPED_HEADERS
         if (ad->ad_data != MAP_FAILED)
          munmap(ad->ad_data, ad_getentryoff(ad, ADEID_RFORK));
-#endif
+#endif /* USE_MMAPPED_HEADERS */
        if ( close( ad->ad_hf.adf_fd ) < 0 ) {
            err = -1;
        }
index 29cf22f0e4bcb72441c0000ab0461a32880b7700..d7ee2a18eccfa94859254ea5b17aa5fe56c42258 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: ad_lock.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1998,1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT for more information.
  *
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <errno.h>
 
 #include <atalk/adouble.h>
index ef2a6824d16cf1945f9d5152bd46fe73f49a77fa..632151c01011ecc849549a40848cf39c108153fd 100644 (file)
@@ -1,4 +1,7 @@
-/* ad_mmap provides interfaces to memory mapped files. as this is the
+/*
+ * $Id: ad_mmap.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ * ad_mmap provides interfaces to memory mapped files. as this is the
  * case, we don't have to deal w/ temporary buffers such as
  * ad_data. the ad_mmap routines are designed to not interact w/ the
  * ad_read/ad_write routines to avoid confusion.
@@ -6,13 +9,17 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <string.h>
 
 #include <atalk/adouble.h>
index cb9a03baebbbff17e3a974e2e79ea268ce962f57..22fc4415b835bb0f62015888f3a68bbae8fd8ca8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_open.c,v 1.7 2001-03-21 14:36:36 rufustfirefly Exp $
+ * $Id: ad_open.c,v 1.8 2001-06-29 14:14:46 rufustfirefly Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <errno.h>
 #include <syslog.h>
 
@@ -47,7 +51,7 @@
 
 #ifndef MAX
 #define MAX(a, b)  ((a) < (b) ? (b) : (a))
-#endif
+#endif /* ! MAX */
 
 /*
  * AppleDouble entry default offsets.
@@ -88,7 +92,7 @@
 /* make sure we don't redefine ADEDOFF_FILEI */
 #ifdef ADEDOFF_FILEI
 #undef ADEDOFF_FILEI
-#endif
+#endif /* ADEDOFF_FILEI */
 
 #define ADEID_NUM_V1         5
 #define ADEDOFF_NAME_V1             (AD_HEADER_LEN + ADEID_NUM_V1*AD_ENTRY_LEN)
@@ -164,7 +168,7 @@ static const struct entry entry_order[] = {
   {ADEID_RFORK, ADEDOFF_RFORK_V2, ADEDLEN_INIT},
   {0, 0, 0}
 };
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
 
 #if AD_VERSION == AD_VERSION2
 
@@ -221,7 +225,7 @@ static __inline__ int ad_v1tov2(struct adouble *ad, const char *path)
   /* okay, unmap our old ad header and point it to our local copy */
   munmap(ad->ad_data, off);
   ad->ad_data = buf;
-#endif
+#endif /* USER_MMAPPED_HEADERS */
 
   /* move the RFORK. this assumes that the RFORK is at the end */
   memmove(buf + off + SHIFTDATA, buf + off, 
@@ -282,7 +286,7 @@ static __inline__ int ad_v1tov2(struct adouble *ad, const char *path)
                     MAP_PRIVATE, ad->ad_hf.adf_fd, 0);
   if (ad->ad_data == MAP_FAILED)
     goto bail_err;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
 
   return 0;
   
@@ -295,7 +299,7 @@ bail_lock:
 bail_err:
   return -1;
 }
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
 
 
 /* read in the entries */
@@ -338,9 +342,9 @@ static __inline__ int ad_header_read(struct adouble *ad)
 {
 #ifdef USE_MMAPPED_HEADERS
     char                buf[AD_ENTRY_LEN*ADEID_MAX];
-#else 
+#else /* USE_MMAPPED_HEADERS */
     char                *buf = ad->ad_data;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
     u_int16_t           nentries;
     int                 len;
     static int          warning = 0;
@@ -393,7 +397,7 @@ static __inline__ int ad_header_read(struct adouble *ad)
     if ((ad->ad_magic != AD_MAGIC) || ((ad->ad_version != AD_VERSION1)
 #if AD_VERSION == AD_VERSION2
                                       && (ad->ad_version != AD_VERSION2)
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
                                       )) {
       errno = EIO;
       syslog(LOG_DEBUG, "ad_open: can't parse AppleDouble header.");
@@ -410,11 +414,11 @@ static __inline__ int ad_header_read(struct adouble *ad)
 #ifdef USE_MMAPPED_HEADERS
     if (len > sizeof(buf))
       len = sizeof(buf);
-#else
+#else /* USE_MMAPPED_HEADERS */
     if (len + AD_HEADER_LEN > sizeof(ad->ad_data))
       len = sizeof(ad->ad_data) - AD_HEADER_LEN;
     buf += AD_HEADER_LEN;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
     if (read(ad->ad_hf.adf_fd, buf, len) != len) {
         if (errno == 0)
            errno = EIO;
@@ -429,7 +433,7 @@ static __inline__ int ad_header_read(struct adouble *ad)
     if (!ad_getentryoff(ad, ADEID_RFORK)
 #ifndef USE_MMAPPED_HEADERS
        || (ad_getentryoff(ad, ADEID_RFORK) > sizeof(ad->ad_data))
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
        ) {
       syslog(LOG_DEBUG, "ad_header_read: problem with rfork entry offset."); 
       return -1;
@@ -443,7 +447,7 @@ static __inline__ int ad_header_read(struct adouble *ad)
                       MAP_PRIVATE, ad->ad_hf.adf_fd, 0);
     if (ad->ad_data == MAP_FAILED) 
       return -1;
-#else
+#else /* USE_MMAPPED_HEADERS */
     buf += len;
     len = ad_getentryoff(ad, ADEID_RFORK) - ad->ad_hf.adf_off;
     if (read(ad->ad_hf.adf_fd, buf, len) != len) {
@@ -452,7 +456,7 @@ static __inline__ int ad_header_read(struct adouble *ad)
        syslog(LOG_DEBUG, "ad_header_read: can't read in entries.");
        return -1;
     }
-#endif
+#endif /* USE_MMAPPED_HEADERS */
     
     /* fix up broken dates */
     if (ad->ad_version == AD_VERSION1) {
@@ -573,7 +577,7 @@ ad_mkdir( path, mode )
 {
 #ifdef DEBUG
     syslog (LOG_INFO, "ad_mkdir: Creating directory with mode %d", mode);
-#endif
+#endif /* DEBUG */
     return mkdir( path, ad_mode( path, mode ) );
 }
 
@@ -600,7 +604,7 @@ int ad_open( path, adflags, oflags, mode, ad )
        adf_lock_init(&ad->ad_hf);
 #ifdef USE_MMAPPED_HEADERS
        ad->ad_data = MAP_FAILED;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
         ad->ad_inited = AD_INITED;
         ad->ad_refcount = 1;
     }
@@ -694,9 +698,9 @@ int ad_open( path, adflags, oflags, mode, ad )
              ad_close(ad, adflags);
              return -1;
            }       
-#else
+#else /* USE_MMAPPED_HEADERS */
            memset(ad->ad_data, 0, sizeof(ad->ad_data));
-#endif
+#endif /* USE_MMAPPED_HEADERS */
 
            eid = entry_order;
            while (eid->id) {
@@ -746,7 +750,7 @@ int ad_open( path, adflags, oflags, mode, ad )
            if ((ad_header_read( ad ) < 0)
 #if AD_VERSION == AD_VERSION2
                || (ad_v1tov2(ad, ad_p) < 0)
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
                ) {
              ad_close( ad, adflags );
              return( -1 );
@@ -765,7 +769,7 @@ int ad_refresh(struct adouble *ad)
 {
 #ifdef USE_MMAPPED_HEADERS
   off_t off;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
 
   if (ad->ad_hf.adf_fd < -1)
     return -1;
@@ -801,7 +805,7 @@ int ad_refresh(struct adouble *ad)
   }
   return 0;
 
-#else
+#else /* USE_MMAPPED_HEADERS */
   return ad_header_read(ad);
-#endif
+#endif /* USE_MMAPPED_HEADERS */
 }
index 3814e649d42ad297f9558834aa1be20996501ab2..7b973fcbcc51ec69c92b76b8834100da156399d5 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * $Id: ad_private.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
 #define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
 
@@ -5,11 +9,11 @@
 
 #ifndef MAP_FAILED
 #define MAP_FAILED ((void *) -1)
-#endif
+#endif /* ! MAP_FAILED */
 
 #ifndef __inline__
 #define __inline__
-#endif
+#endif /* ! __inline__ */
 
 /* this is so that we can keep lists of fds referencing the same file
  * around. that way, we can honor locks created by the same process
@@ -17,7 +21,7 @@
 #ifdef USE_FLOCK_LOCKS
 #define adf_lock_init(a)
 #define adf_lock_free(a)
-#else
+#else /* USE_FLOCK_LOCKS */
 
 #define adf_lock_init(a) do { \
        (a)->adf_lockmax = (a)->adf_lockcount = 0; \
@@ -30,6 +34,6 @@
        free((a)->adf_lock); \
        adf_lock_init(a); \
 } while (0)
-#endif
+#endif /* USE_FLOCK_LOCKS */
 
 #endif /* libatalk/adouble/ad_private.h */
index 1fcda8a11dba36c1e9b823ac04773fc040ac9990..35bcc197026c35bf87412196e99f4f2da47a2e8b 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: ad_read.c,v 1.3 2001-06-29 14:14:46 rufustfirefly 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 <string.h>
 #include <sys/types.h>
 #include <sys/param.h>
 #include <atalk/adouble.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #ifndef MIN
 #define MIN(a,b)       ((a)<(b)?(a):(b))
-#endif
+#endif /* ! MIN */
 
 /* XXX: this would probably benefit from pread. 
  *      locks have to be checked before each stream of consecutive 
@@ -70,7 +74,7 @@ ssize_t ad_read( ad, eid, off, buf, buflen)
          cc = buflen;
          goto ad_read_done;
        }
-#endif 
+#endif /* USE_MMAPPED_HEADERS */       
        if ( ad->ad_hf.adf_off != cc ) {
          if ( lseek( ad->ad_hf.adf_fd, (off_t) cc, SEEK_SET ) < 0 ) {
              return( -1 );
@@ -98,9 +102,9 @@ ssize_t ad_read( ad, eid, off, buf, buflen)
            }
        }
        ad->ad_hf.adf_off += cc;
-#else
+#else /* ! USE_MMAPPED_HEADERS */
 ad_read_done:
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
     }
 
     return( cc );
index 1b96c86226cb525ecb61bbc1268c62648eff4cea..db745d6447c1009158664575db0a329d168fe8bd 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: ad_sendfile.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  *
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
@@ -61,16 +65,16 @@ ssize_t ad_readfile(const struct adouble *ad, const int eid,
   fd = ad_sendfile_init(ad, eid, &off, 0);
 #ifdef __linux__
   cc = sendfile(sock, fd, &off, len);
-#endif
+#endif /* __linux__ */
 
 #ifdef BSD4_4
   if (sendfile(fd, sock, off, len, NULL, &cc, 0) < 0)
     return -1;
-#endif
+#endif /* BSD4_4 */
 
   return cc;
 }
-#endif
+#endif /* HAVE_SENDFILE_READ */
 
 #if 0
 #ifdef HAVE_SENDFILE_WRITE
@@ -91,7 +95,7 @@ ssize_t ad_writefile(struct adouble *ad, const int eid,
     ad_setentrylen(ad, eid, off);
 
   return cc;
-#endif
+#endif /* __linux__ */
 }
-#endif
-#endif
+#endif /* HAVE_SENDFILE_WRITE */
+#endif /* 0 */
index 40f61906db220fb454eb0361c36254fd451879cf..517194f7810d928b1a2d7a2b0963df982bd26eac 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: ad_size.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  *
@@ -7,10 +9,12 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <syslog.h>
index 0d37ebf6cfff342ac95b1ba511d6f96fe1500a63..d680db5ac72894d0781f7d07082e1cfdc8db7910 100644 (file)
@@ -1,25 +1,31 @@
 /*
+ * $Id: ad_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1995 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <errno.h>
 
 #include <atalk/adouble.h>
 
 #ifndef MIN
 #define MIN(a,b)       ((a)<(b)?(a):(b))
-#endif
+#endif /* ! MIN */
 
 /* XXX: this would benefit from pwrite. 
  *      locking has to be checked before each stream of consecutive
@@ -67,7 +73,7 @@ ssize_t ad_write( ad, eid, off, end, buf, buflen )
          cc = buflen;
          goto ad_write_done;
        }         
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
 
        if ( ad->ad_hf.adf_off != cc ) {
          if ( lseek( ad->ad_hf.adf_fd, (off_t) cc, SEEK_SET ) < 0 ) {
@@ -85,9 +91,9 @@ ssize_t ad_write( ad, eid, off, end, buf, buflen )
        if (ad->ad_hf.adf_off < ad_getentryoff(ad, ADEID_RFORK))
          memcpy(ad->ad_data + ad->ad_hf.adf_off, buf,
                 MIN(sizeof(ad->ad_data) - ad->ad_hf.adf_off, cc));
-#else    
+#else /* ! USE_MMAPPED_HEADERS */  
 ad_write_done:
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
          if ( ad->ad_eid[ eid ].ade_len < off + cc ) {
            ad->ad_eid[ eid ].ade_len = off + cc;
          }
index 5bc7a438da6f0e301f266ee101c286b3fffd6ab8..3cc7dd50d9018af01396b1a1027d5d7e4fd3eef1 100644 (file)
@@ -1,11 +1,12 @@
 /*
+ * $Id: asp_attn.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
index d3d3b83420fee4bea8eac3ab6ba08a86d0963e6b..081cd6fe7238f28e296ef470c1e510c0a950e7b9 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: asp_child.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -21,6 +23,9 @@
  *     netatalk@itd.umich.edu
  */
 
+#ifndef _ASP_CHILD_H
+#define _ASP_CHILD_H 1
+
 struct asp_child {
     int                        ac_pid;
     int                        ac_state;
@@ -30,3 +35,5 @@ struct asp_child {
 #define ACSTATE_DEAD   0
 #define ACSTATE_OK     1
 #define ACSTATE_BAD    7
+
+#endif /* _ASP_CHILD_H */
index 8079879ff962064e8df97542a16e5fca1eeb35a0..e3674167c4eebe312ebabd0bcbe2ce52b355724b 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: asp_close.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 <stdlib.h>
 #include <string.h>
index 11c49543e55841246219c73dcf864eb2bb0c57aa..e2c8cf9a1af195acc7769a3f9c8b0af83c15fbcc 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: asp_cmdreply.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 <string.h>
 #include <sys/types.h>
@@ -35,7 +37,7 @@
 
 #if defined(BSD) || defined(BSD4_3)
 #define memmove(a, b, n)   bcopy((b), (a), (n))
-#endif
+#endif /* BSD || BSD4_3 */
 
 int asp_cmdreply( asp, result)
     ASP                asp;
index c8373be247824175e903e81b2a98b30a86ba9120..211c55d4772d129e39449cfc3fa185073ff8034e 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: asp_getreq.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -24,7 +26,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
 #include <sys/types.h>
index da920bc55f5af5ab31f749e576d72c1e7fe7b5ee..2a2826f9d17e722334da77515efb2ffed249fe5a 100644 (file)
@@ -1,16 +1,20 @@
 /*
+ * $Id: asp_getsess.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include <syslog.h>
 #include <errno.h>
@@ -138,7 +142,7 @@ ASP asp_getsession(ASP asp, server_child *server_children,
     memset( &sat, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     sat.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     sat.sat_family = AF_APPLETALK;
     sat.sat_addr.s_net = ATADDR_ANYNET;
     sat.sat_addr.s_node = ATADDR_ANYNODE;
@@ -163,7 +167,7 @@ ASP asp_getsession(ASP asp, server_child *server_children,
     case ASPFUNC_STAT :
 #ifdef EBUG
       printf( "asp stat\n" );
-#endif EBUG
+#endif /* EBUG */
       if ( asp->asp_slen > 0 ) {
        asp->cmdbuf[0] = 0;
        memcpy( asp->cmdbuf + 4, asp->asp_status, asp->asp_slen );
index 2a00d16d0fc2ba285063aed2228f90aab1efaea9..ef8eaa7093a8f68cb71202c831970850cda9c0a2 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: asp_init.c,v 1.3 2001-06-29 14:14:46 rufustfirefly 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>
@@ -48,7 +50,7 @@ ASP asp_init( atp )
     asp->asp_atp = atp;
 #ifdef BSD4_4
     asp->asp_sat.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     asp->asp_sat.sat_family = AF_APPLETALK;
     asp->asp_sat.sat_addr.s_net = ATADDR_ANYNET;
     asp->asp_sat.sat_addr.s_node = ATADDR_ANYNODE;
index fe6dbc8146f0924adc0cda7d0f14a9e40784b962..22cb214e7befd896383ae51a20f2702fb431ef42 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: asp_shutdown.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
 #include <sys/types.h>
index 2c5aea39d59425920ee6131e4e5c09eab68c3b99..8bbf4f5f325ca01da41d7173aac966e73adeffda 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: asp_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly 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 <string.h>
 #include <sys/types.h>
@@ -35,7 +37,7 @@
 
 #if defined(BSD) || defined(BSD4_3)
 #define memmove(a, b, n)   bcopy((b), (a), (n))
-#endif
+#endif /* BSD || BSD4_3 */
 
 int asp_wrtcont(ASP asp, char *buf, int *buflen)
 {
index b1928f8343de10baed91ca567c2144bdeccb77ff..06e7b083dc36f639673bde17af89ff7c7b0b475a 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_bprint.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 */
 
 #define BPLEN  48
 #include <stdio.h>
index 204d5e079ee50377dace1d18b1c7865c0c78ae1a..128736fbc68124b713c39aad7df848713378cf4f 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_bufs.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -27,7 +29,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdlib.h>
 #include <string.h>
@@ -47,7 +49,7 @@ static struct atpbuf  *free_list = NULL;      /* free buffers */
 
 #ifdef EBUG
 static int             numbufs = 0;
-#endif EBUG
+#endif /* EBUG */
 
 /* only call this when the free_list is empty...
  * N_MORE_BUFS must be >= one
@@ -114,7 +116,7 @@ void atp_print_bufuse( ah, s )
        getpid(), s, numbufs, sentcount, incount,
        ( ah->atph_reqpkt != NULL ) ? 1: 0, respcount );
 }
-#endif EBUG
+#endif /* EBUG */
 
 
 struct atpbuf *atp_alloc_buf(void)
@@ -127,7 +129,7 @@ struct atpbuf *atp_alloc_buf(void)
     free_list = free_list->atpbuf_next;
 #ifdef EBUG
     ++numbufs;
-#endif EBUG
+#endif /* EBUG */
     return bp;
 }
 
@@ -142,7 +144,7 @@ int atp_free_buf( bp )
     free_list = bp;
 #ifdef EBUG
     --numbufs;
-#endif EBUG
+#endif /* EBUG */
     return 0;
 }
 
index 2c315bd3d257ca11237bc61986e71ea0fd411fd2..df03b02edd387eee0db12c57963e50c25f6fa886 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: atp_close.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1997 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdlib.h>
 #include <sys/types.h>
@@ -18,7 +20,7 @@
 #include "atp_internals.h"
 #ifdef EBUG
 #include <stdio.h>
-#endif EBUG
+#endif /* EBUG */
 
 int atp_close( ah )
     ATP                ah;
@@ -30,7 +32,7 @@ int atp_close( ah )
     */
 #ifdef EBUG
     print_bufuse( ah, "atp_close");
-#endif EBUG
+#endif /* EBUG */
 
     while ( ah->atph_queue != NULL ) {
        cq = ah->atph_queue;
@@ -63,7 +65,7 @@ int atp_close( ah )
 
 #ifdef EBUG
     print_bufuse( ah, "atp_close end");
-#endif EBUG
+#endif /* EBUG */
 
     i = ah->atph_socket;
     atp_free_buf( (struct atpbuf *) ah );
index 70959d8e89133b1efee669ad0b484bb28f644a39..a3cac683fa769c30c357c0672c96509fa68ecabc 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_internals.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -53,6 +55,6 @@ extern int atp_recv_atp             __P((ATP, struct sockaddr_at *,
                                         int));
 #ifdef EBUG
 extern void atp_print_addr          __P((char *, struct sockaddr_at *));
-#endif
+#endif /* EBUG */
 
-#endif
+#endif /* ATP_INTERNALS_H */
index c43c62e2327a400e35bdfd4c3c596557654034f3..76e65afb48189aa2ef5fd0fb3af871d0fa280485 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_open.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 <stdlib.h>
 #include <string.h>
@@ -53,7 +55,7 @@ ATP atp_open(port, saddr)
 
 #ifdef DEBUG
     printf( "<%d> atp_open\n", getpid());
-#endif
+#endif /* DEBUG */
 
     memset(&addr, 0, sizeof(addr));
     addr.sat_port = port;
@@ -79,7 +81,7 @@ ATP atp_open(port, saddr)
 
 #ifdef EBUG
 srandom( tv.tv_sec );
-#endif
+#endif /* EBUG */
 
     return atp;
 }
index f5e43e58b215d847c137896bfa6683670c3964f9..77ab3afde62d06b8a769214a995631ace2893273 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_packet.c,v 1.3 2001-06-29 14:14:46 rufustfirefly 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 <string.h>
 #include <sys/types.h>
@@ -45,7 +47,7 @@
 /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
 #ifndef SOCKLEN_T
 #define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
 
 #ifdef EBUG
 #include <stdio.h>
@@ -97,7 +99,7 @@ void atp_print_addr( s, saddr )
     saddr->sat_port == ATADDR_ANYPORT ? printf( "*" ) :
       printf( "%d", saddr->sat_port );
 }
-#endif
+#endif /* EBUG */
 
 
 void atp_build_req_packet( pktbuf, tid, ctrl, atpb )
@@ -184,7 +186,7 @@ atp_recv_atp( ah, fromaddr, func, tid, rbuf, wait )
     */
 #ifdef EBUG
     atp_print_bufuse( ah, "recv_atp checking queue" );
-#endif
+#endif /* EBUG */
     for ( pq = NULL, cq = ah->atph_queue; cq != NULL;
       pq = cq, cq = cq->atpbuf_next ) {
        memcpy(&ahdr, cq->atpbuf_info.atpbuf_data + 1, 
@@ -196,7 +198,7 @@ atp_recv_atp( ah, fromaddr, func, tid, rbuf, wait )
        print_func( rfunc );
        atp_print_addr( " from", &cq->atpbuf_addr );
        putchar( '\n' );
-#endif
+#endif /* EBUG */
        if ((( tid & ahdr.atphd_tid ) == ahdr.atphd_tid ) &&
            (( *func & rfunc ) == rfunc )
            && at_addr_eq( fromaddr, &cq->atpbuf_addr )) {
@@ -231,12 +233,12 @@ atp_recv_atp( ah, fromaddr, func, tid, rbuf, wait )
     print_func( *func );
     atp_print_addr( " from", fromaddr );
     putchar( '\n' );
-#endif
+#endif /* EBUG */
 
     do {
 #ifdef EBUG
     fflush( stdout );
-#endif
+#endif /* EBUG */
        faddrlen = sizeof( struct sockaddr_at );
        memset( &faddr, 0, sizeof( struct sockaddr_at ));
 
@@ -257,7 +259,7 @@ atp_recv_atp( ah, fromaddr, func, tid, rbuf, wait )
            atp_print_addr( " from", &faddr );
            putchar( '\n' );
            bprint( rbuf, recvlen );
-#endif
+#endif /* EBUG */
            if ( rfunc == ATP_TREL ) {
                /* remove response from sent list */
                for ( pq = NULL, cq = ah->atph_sent; cq != NULL;
@@ -269,7 +271,7 @@ atp_recv_atp( ah, fromaddr, func, tid, rbuf, wait )
                if ( cq != NULL ) {
 #ifdef EBUG
        printf( "<%d> releasing transaction %hu\n", getpid(), ntohs( rtid ));
-#endif
+#endif /* EBUG */
                    if ( pq == NULL ) {
                        ah->atph_sent = cq->atpbuf_next;
                    } else {
@@ -295,7 +297,7 @@ atp_recv_atp( ah, fromaddr, func, tid, rbuf, wait )
                /* add packet to incoming queue */
 #ifdef EBUG
        printf( "<%d> queuing incoming...\n", getpid() );
-#endif
+#endif /* EBUG */
                if (( inbuf = atp_alloc_buf()) == NULL ) {
                    return -1;
                }
index f7c02b3fea0ba6a779f44a4d3c4d657970132dfa..9e46efcf1036493913ee987fd18f07fb36a64454 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_rreq.c,v 1.3 2001-06-29 14:14:46 rufustfirefly 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 <stdlib.h>
 #include <string.h>
@@ -55,7 +57,7 @@ int atp_rreq( ah, atpb )
 
 #ifdef EBUG
     atp_print_bufuse( ah, "atp_rreq" );
-#endif
+#endif /* EBUG */
 
     while (( rc = atp_rsel( ah, atpb->atp_saddr, ATP_TREQ )) == 0 ) {
        ;
@@ -64,7 +66,7 @@ int atp_rreq( ah, atpb )
     if ( rc != ATP_TREQ ) {
 #ifdef EBUG
        printf( "<%d> atp_rreq: atp_rsel returns err %d\n", getpid(), rc );
-#endif EBUG
+#endif /* EBUG */
        return( rc );
     }
 
index ee29f994937bc9484b1925a32d7ae3e20047297f..5f96ced6ae9ac4dc93901bb22e4dcad06f65ef9c 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_rresp.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 <stdlib.h>
 #include <string.h>
@@ -39,7 +41,7 @@
 
 #ifdef EBUG
 #include <stdio.h>
-#endif
+#endif /* EBUG */
 
 #include "atp_internals.h"
 
@@ -52,7 +54,7 @@ atp_rresp( ah, atpb )
 
 #ifdef EBUG
     atp_print_bufuse( ah, "atp_rresp" );
-#endif
+#endif /* EBUG */
     /* check parameters
     */
     if ( atpb->atp_rresiovcnt <= 0 || atpb->atp_rresiovcnt > 8 ) {
@@ -83,7 +85,7 @@ atp_rresp( ah, atpb )
                len, i );
        bprint( (char *)ah->atph_resppkt[ i ]->atpbuf_info.atpbuf_data,
                len + ATP_HDRSIZE );
-#endif
+#endif /* EBUG */
        memcpy(atpb->atp_rresiov[ i ].iov_base,
               ah->atph_resppkt[ i ]->atpbuf_info.atpbuf_data + ATP_HDRSIZE,
               len );
index f4a9875e8ab08133acdc89c56ef80946f91d616b..ba05bcd504cf68693a97f417dad9cdc06a6ae1c5 100644 (file)
@@ -1,8 +1,14 @@
 /*
+ * $Id: atp_rsel.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1997 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <string.h>
 #include <sys/types.h>
 #include <sys/time.h>
@@ -22,7 +28,7 @@
 
 #ifdef DROP_ATPTREL
 static int     release_count = 0;
-#endif DROP_ATPTREL
+#endif /* DROP_ATPTREL */
 
 
 int
@@ -41,7 +47,7 @@ resend_request( ah )
     putchar( '\n' );
     bprint( ah->atph_reqpkt->atpbuf_info.atpbuf_data,
            ah->atph_reqpkt->atpbuf_dlen );
-#endif
+#endif /* EBUG */
 
     memcpy( &req_hdr, ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1, 
        sizeof( struct atphdr ));
@@ -83,7 +89,7 @@ atp_rsel( ah, faddr, func )
 
 #ifdef EBUG
     atp_print_bufuse( ah, "atp_rsel at top" );
-#endif
+#endif /* EBUG */
     if ( func == 0 ) {
        func = ATP_FUNCANY;
     }
@@ -105,7 +111,7 @@ atp_rsel( ah, faddr, func )
     if ( requesting ) {
 #ifdef EBUG
        printf( "<%d> atp_rsel: request pending\n", getpid());
-#endif
+#endif /* EBUG */
        gettimeofday( &tv, (struct timezone *)0 );
        if ( tv.tv_sec - ah->atph_reqtv.tv_sec > ah->atph_reqto ) {
            if ( resend_request( ah ) < 0 ) {
@@ -138,7 +144,7 @@ atp_rsel( ah, faddr, func )
        printf( "<%d> atp_rsel calling recv_atp,", getpid());
        atp_print_addr( " accepting from: ", &saddr );
        putchar( '\n' );
-#endif EBUG
+#endif /* EBUG */
        if (( recvlen = atp_recv_atp( ah, &saddr, &rfunc, ATP_TIDANY,
                abuf->atpbuf_info.atpbuf_data, 0 )) >= 0 ) {
            break;      /* we received something */
@@ -170,7 +176,7 @@ timeout :
     atp_print_addr( " from: ", &saddr );
     putchar( '\n' );
     bprint( abuf->atpbuf_info.atpbuf_data, recvlen );
-#endif
+#endif /* EBUG */
 
     abuf->atpbuf_dlen = recvlen;
     memcpy( &resp_hdr, abuf->atpbuf_info.atpbuf_data + 1,
@@ -193,14 +199,14 @@ timeout :
            printf( " %hu", cb->atpbuf_info.atpbuf_xo.atpxo_tid );
            atp_print_addr( " (looking for", &saddr );
            printf( " %hu)\n", tid );
-#endif
+#endif /* EBUG */
            if ( tv.tv_sec - cb->atpbuf_info.atpbuf_xo.atpxo_tv.tv_sec
                    > cb->atpbuf_info.atpbuf_xo.atpxo_reltime ) {
                /* discard expired response */
 #ifdef EBUG
                printf( "<%d> expiring tid %hu\n", getpid(),
                        cb->atpbuf_info.atpbuf_xo.atpxo_tid );
-#endif
+#endif /* EBUG */
                if ( pb == NULL ) {
                    ah->atph_sent = cb->atpbuf_next;
                } else {
@@ -229,7 +235,7 @@ timeout :
 #ifdef EBUG
            printf( "<%d> duplicate request -- re-sending XO resp\n",
                    getpid());
-#endif
+#endif /* EBUG */
            /* matches an old response -- just re-send and reset expire */
            cb->atpbuf_info.atpbuf_xo.atpxo_tv = tv;
            for ( i = 0; i < 8; ++i ) {
@@ -276,7 +282,7 @@ timeout :
 #ifdef EBUG
            printf( "<%d> EOM -- seq num %d  current bitmap %d\n",
                getpid(), resp_hdr.atphd_bitmap, ah->atph_rbitmap );
-#endif
+#endif /* EBUG */
            mask = 1 << resp_hdr.atphd_bitmap;
            ah->atph_rbitmap &= ( mask | (mask-1) );
        }
@@ -286,7 +292,7 @@ timeout :
        if ( resp_hdr.atphd_ctrlinfo & ATP_STS ) {
 #ifdef EBUG
            puts( "STS" );
-#endif
+#endif /* EBUG */
            req_hdr.atphd_bitmap = ah->atph_rbitmap;
            memcpy(ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1,
                   &req_hdr, sizeof( struct atphdr ));
@@ -309,7 +315,7 @@ timeout :
        printf( "atp_rsel: ignoring resp bm=%x tid=%d (expected %x/%d)\n",
                resp_hdr.atphd_bitmap, ntohs( resp_hdr.atphd_tid ),
                ah->atph_rbitmap, ah->atph_tid );
-#endif EBUG
+#endif /* EBUG */
     }
 
     if ( !ah->atph_rbitmap && ( req_hdr.atphd_ctrlinfo & ATP_XO )) {
@@ -326,10 +332,10 @@ timeout :
        printf( "<%d> sending TREL", getpid() );
        bprint( ah->atph_reqpkt->atpbuf_info.atpbuf_data,
                ah->atph_reqpkt->atpbuf_dlen );
-#endif
+#endif /* EBUG */
 #ifdef DROP_ATPTREL
        if (( ++release_count % 10 ) != 0 ) {
-#endif DROP_ATPTREL
+#endif /* DROP_ATPTREL */
        netddp_sendto( ah->atph_socket, 
                       ah->atph_reqpkt->atpbuf_info.atpbuf_data,
                       ah->atph_reqpkt->atpbuf_dlen, 0,
@@ -337,7 +343,7 @@ timeout :
                       sizeof( struct sockaddr_at));
 #ifdef DROP_ATPTREL
        }
-#endif DROP_ATPTREL
+#endif /* DROP_ATPTREL */
     }
 
     if ( ah->atph_rbitmap != 0 ) {
index e073fac24d206d82f65f1e5a04977d411cbc8862..48d4555ef7a97f0258636a82c109380adfd86d82 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_sreq.c,v 1.3 2001-06-29 14:14:46 rufustfirefly 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 <stdlib.h>
 #include <string.h>
@@ -55,7 +57,7 @@ atp_sreq( ah, atpb, respcount, flags )
 
 #ifdef EBUG
     atp_print_bufuse( ah, "atp_sreq" );
-#endif
+#endif /* EBUG */
 
     /* check parameters
     */
@@ -96,12 +98,12 @@ atp_sreq( ah, atpb, respcount, flags )
     atp_print_addr( " to", atpb->atp_saddr );
     putchar( '\n' );
     bprint( req_buf->atpbuf_info.atpbuf_data, req_buf->atpbuf_dlen );
-#endif
+#endif /* EBUG */
 
     gettimeofday( &ah->atph_reqtv, (struct timezone *)0 );
 #ifdef DROPPACKETS
 if (( random() % 3 ) != 2 ) {
-#endif
+#endif /* DROPPACKETS */
     if ( netddp_sendto( ah->atph_socket, req_buf->atpbuf_info.atpbuf_data,
            req_buf->atpbuf_dlen, 0, (struct sockaddr *) atpb->atp_saddr,
            sizeof( struct sockaddr_at )) != req_buf->atpbuf_dlen ) {
@@ -110,7 +112,7 @@ if (( random() % 3 ) != 2 ) {
     }
 #ifdef DROPPACKETS
 } else printf( "<%d> atp_sreq: dropped request\n", getpid() );
-#endif
+#endif /* DROPPACKETS */
 
     if ( atpb->atp_sreqto != 0 ) {
        if ( ah->atph_reqpkt != NULL ) {
index ab0f3e1ecca7e955984503da9607e8b0f0c9c613..57c5281e828ec7bbf5624ae1919ef617e940f218 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_sresp.c,v 1.4 2001-06-29 14:14:46 rufustfirefly 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 <stdlib.h>
 #include <string.h>
@@ -55,7 +57,7 @@ int atp_sresp( ah, atpb )
 
 #ifdef EBUG
     atp_print_bufuse( ah, "atp_sresp" );
-#endif
+#endif /* EBUG */
 
     /* check parameters
     */
@@ -82,7 +84,7 @@ int atp_sresp( ah, atpb )
            ah->atph_rxo ? "XO" : "", ah->atph_rtid );
     atp_print_addr( " to", atpb->atp_saddr );
     putchar( '\n' );
-#endif
+#endif /* EBUG */
     if ( ah->atph_rxo ) {
        if (( save_buf = atp_alloc_buf()) == NULL ) {
            return -1;
@@ -94,7 +96,7 @@ int atp_sresp( ah, atpb )
        ctrlinfo = ATP_TRESP;
 #ifdef STS_RESPONSES
        ctrlinfo |= ATP_STS;
-#endif STS_RESPONSES
+#endif /* STS_RESPONSES */
        if ( i == atpb->atp_sresiovcnt-1 ) {
            ctrlinfo |= ATP_EOM;
        }
@@ -105,12 +107,12 @@ int atp_sresp( ah, atpb )
        }
 #ifdef DROPPACKETS
 if (( random() % 3 ) != 2 ) {
-#endif
+#endif /* DROPPACKETS */
 #ifdef EBUG
 printf( "<%d> sending packet tid=%hu serial no.=%d\n", getpid(),
   ah->atph_rtid, i );
 bprint( resp_buf->atpbuf_info.atpbuf_data, resp_buf->atpbuf_dlen );
-#endif
+#endif /* EBUG */
        if ( netddp_sendto( ah->atph_socket, resp_buf->atpbuf_info.atpbuf_data,
          resp_buf->atpbuf_dlen, 0, (struct sockaddr *) atpb->atp_saddr,
          sizeof( struct sockaddr_at )) != resp_buf->atpbuf_dlen ) {
@@ -124,7 +126,7 @@ bprint( resp_buf->atpbuf_info.atpbuf_data, resp_buf->atpbuf_dlen );
        }
 #ifdef DROPPACKETS
 } else printf( "<%d> atp_sresp: dropped serial no. %d\n", getpid(),  i );
-#endif
+#endif /* DROPPACKETS */
        /* allocate a buffer for next packet (if XO mode)
        */
        if ( ah->atph_rxo && ( resp_buf = atp_alloc_buf()) == NULL ) {
@@ -148,7 +150,7 @@ bprint( resp_buf->atpbuf_info.atpbuf_data, resp_buf->atpbuf_dlen );
        ah->atph_sent = save_buf;
 #ifdef EBUG
 printf( "<%d> saved XO response\n", getpid());
-#endif
+#endif /* EBUG */
     }
     return 0;
 }
index 81ac2a7c737b01b1a3729ee3eb8429b076d39fc4..fb06371f099ce46e3c494817d9b2dbb689d3b6e1 100644 (file)
@@ -1,16 +1,28 @@
 /* 
+ * $Id: cnid_add.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
  *
  * cnid_add (db, dev, ino, did, name, hint): 
  * add a name to the CNID database. we use both dev/ino and did/name
- * to keep track of things. */
+ * to keep track of things.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <errno.h>
 #include <syslog.h>
 
index f5e1d0962e40ccea59039b8ad66a3b8d82f90394..9745f853db5d9f75a0dcb8effad783fb78b3fbbc 100644 (file)
@@ -1,5 +1,17 @@
+/*
+ * $Id: cnid_close.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <syslog.h>
 #include <db.h>
 #include <errno.h>
index 735457621ebf535652801810d6ac57c02c360e83..8e3c3497f28b33fa8941fe71ac086bcbb8bf4752 100644 (file)
@@ -1,10 +1,16 @@
 /* 
+ * $Id: cnid_delete.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
  *
  * cnid_delete: delete a CNID from the database 
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
index d1f82977b2008d987e01b1fc28837f0b2963134f..86e4eb6606d0796d5c387712d7a8152c917d53f5 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * $Id: cnid_get.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <string.h>
 #include <sys/param.h>
index d8625444ab81604aa8fbe7773b5caf640f082058..5987c12d84bb0ed820676a9389e19840ab580ea6 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * $Id: cnid_lookup.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <string.h>
 #include <sys/param.h>
index 803a7aca8ccbb337783e63b984d80a47dfd19f5f..c72fbf602da289abee62deb7d32447aafa805190 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: cnid_meta.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
  *
index 5eb3d64c431e0bf987df6c0364f2c42d0348ab2a..8f0b906467b65004f91461d9064d6beb08d28ec3 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * $Id: cnid_meta.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #define CNID_META_CNID_LEN      4
 #define CNID_META_MDATE_LEN     4  /* space for 8 */
 #define CNID_META_CDATE_LEN     4  /* space for 8 */
index f26418fb5d71d4019f377f679183f53567d720d6..8d5057923f380e97a5305613f02d1e4e43885a58 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * $Id: cnid_nextid.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <db.h>
 
 #include <atalk/adouble.h>
index 10dda27de6166c2ac83023d2a39a34f92b64a4d3..796c5495dd95cdb07a2c69004529a4f7bb342078 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: cnid_open.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
  *
  * so, CNID_START begins at 3.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <syslog.h>
@@ -49,7 +59,7 @@
 
 #ifndef MIN
 #define MIN(a, b)  ((a) < (b) ? (a) : (b))
-#endif
+#endif /* ! MIN */
 
 #define ROOTINFO     "RootInfo"
 #define ROOTINFO_LEN 8
@@ -301,7 +311,7 @@ dbversion_retry:
   if (version != htonl(DBVERSION)) {
     /* fix up stuff */
   }
-#endif
+#endif /* 0 */
 
   /* did/macname mapping. btree this one. */
   dbi.bt_compare = compare_mac;
index 3eacb1a7f729efdbc888532aa2d8c26d9b38475b..90f76ca76bc59d69dbf98ac48d575422657a1ac2 100644 (file)
@@ -1,10 +1,16 @@
+/*
+ * $Id: cnid_private.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifndef LIBATALK_CNID_PRIVATE_H
 #define LIBATALK_CNID_PRIVATE_H 1
 
 #include <string.h>
 #include <sys/param.h>
 #include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include <db.h>
 
@@ -91,7 +97,7 @@ typedef struct CNID_private {
 
 #ifndef __inline__
 #define __inline__
-#endif
+#endif /* __inline__ */
 
 /* construct db_cnid data. NOTE: this is not re-entrant.  */
 static __inline__ char *make_cnid_data(const struct stat *st,
index 744a7d703cfe783c61e0735a2ea487ce3011ac70..b36e7ab6fa0e35e6ee36fc6acaebf4387f83ca90 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * $Id: cnid_resolve.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <string.h>
 #include <sys/param.h>
index 1c7a021733e32e2d8a25be6c87c76fb0c365034b..2d332041c580191a169e4fcab9545d8c445a54b8 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * $Id: cnid_update.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <string.h>
 #include <sys/param.h>
index f48d54e1d82f3d11fc00e2a10211f4e526624d87..1a7f644c9a3400f1ceed120bf96a35a0dfbeb5c1 100644 (file)
@@ -1,18 +1,22 @@
 /*
+ * $Id: flock.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 static int     _flock_dummy;
 
 #ifndef HAVE_FLOCK
 
 #include <sys/types.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <errno.h>
 
 #define LOCK_SH         1
index 4e4ed755078e641ca63f8c83725286e526dcc9db..e06647623190b2549cbf08eb1616b697c7a6d394 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: getusershell.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1985 Regents of the University of California.
  * All rights reserved.
  *
@@ -19,7 +21,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)getusershell.c     5.6 (Berkeley) 6/1/90";
@@ -44,7 +46,7 @@ static char *okshells[] = {
     "/bin/sh", "/bin/csh",
 #ifdef _IBMR2
     "/bin/ksh",
-#endif _IBMR2
+#endif /* _IBMR2 */
     0
 };
 
@@ -134,4 +136,4 @@ initshells()
        return (shells);
 }
 
-# endif ultrix
+# endif /* ultrix */
index dee43e799d957df5a10966a1100d21a22ccfe903..919c18278d8d82a740b95df9cac3046a688eda58 100644 (file)
@@ -1,6 +1,10 @@
+/*
+ * $Id: inet_aton.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
 #include <netinet/in.h>
@@ -11,7 +15,7 @@ static int _inet_aton_dummy;
 #if defined(ultrix) || (defined(sun) && defined(__svr4__))
 #ifndef INADDR_NONE
 #define INADDR_NONE ((unsigned) 0xffffffff)
-#endif
+#endif /* ! INADDR_NONE */
 
 int inet_aton(const char *name, struct in_addr *addr)
 {
@@ -20,4 +24,4 @@ int inet_aton(const char *name, struct in_addr *addr)
 
   return 1;
 }
-#endif
+#endif /* ultrix || ( sun && __svr4__ ) */
index 628da6bcd9775d3883cf440a0a052874f0f06d92..b92ffe818f3b2833da000d4de7c1c257457dd79d 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: mktemp.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1987 Regents of the University of California.
  * All rights reserved.
  *
@@ -19,7 +21,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)mktemp.c   5.9 (Berkeley) 6/1/90";
@@ -117,4 +119,4 @@ _gettemp(path, doopen)
        /*NOTREACHED*/
 }
 
-# endif ultrix
+# endif /* ultrix */
index cf311249c052e0af3cc4fbb56836032b0be571c4..3e1f46094f485bfa82ee1395b16642b37aad6c80 100644 (file)
@@ -1,4 +1,7 @@
-/* taken from the quota-1.55 used on linux. here's the bsd copyright:
+/*
+ * $Id: rquota_xdr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ * taken from the quota-1.55 used on linux. here's the bsd copyright:
  *
  * Copyright (c) 1980, 1990 Regents of the University of California. All
  * rights reserved.
@@ -9,7 +12,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h> /* to get __GNU_LIBRARY__ */
 
index 85c70209b0a10506eb4746a1ab3ee31d2162d217..c89371ebaa07925b97aec275f0ed9a3629cc9e9b 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: strcasecmp.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1987 Regents of the University of California.
  * All rights reserved.
  *
@@ -19,7 +21,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 static int     _strcasecmp_dummy;
 
@@ -106,4 +108,4 @@ strncasecmp(s1, s2, n)
        return (0);
 }
 
-# endif ibm032
+# endif /* ibm032 */
index 7c084dd50c3933173a8b46ec065c7d3f8739f5e2..c5b44d879cefbef45993140546d538e85afac153 100644 (file)
@@ -1,6 +1,10 @@
+/*
+ * $Id: strdup.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -18,4 +22,4 @@ char *strdup(const char *string)
 
   return new;
 }
-#endif
+#endif /* ultrix */
index c2bdd860659f487f98b50f96bc4630549ae5d078..4bd6c2004fb0e3cd452dba25e3c0e6271d0e48f1 100644 (file)
@@ -1,4 +1,6 @@
-/*-
+/*
+ * $Id: strstr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990 The Regents of the University of California.
  * All rights reserved.
  *
@@ -36,7 +38,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)strstr.c   5.2 (Berkeley) 1/26/91";
@@ -47,7 +49,7 @@ static int    _strstr_dummy;
 # if defined(ibm032) || (defined(sun) && defined(i386))
 #ifdef sun
 #define const
-#endif sun
+#endif /* sun */
 
 #include <sys/types.h>
 #include <string.h>
@@ -74,4 +76,4 @@ strstr(s, find)
        }
        return ((char *)s);
 }
-# endif ibm03 sun i386
+# endif /* ibm03 sun i386 */
index 29e6c4b105bdc85108c71e06db532adc7f785500..962ebc2ca6c70042e93f4ac1d5cdb314a2bbd13b 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: dsi_attn.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
@@ -18,7 +20,7 @@
 
 #ifndef MIN
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
+#endif /* MIN */
 
 /* send an attention. this may get called at any time, so we can't use
  * DSI buffers to send one. */
index 0f0d951dfe39a6d7b96b9bdceb149afb91aa6138..e833db896aa1ddf73bbfaa73efc7e183b7726fb6 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: dsi_close.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
index 1fb833ab7f33dd800d9ab6aaa6b7ed913ec25d33..fbd084a7e98aebabda20a265e0d3a0ca3a7c1144 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: dsi_cmdreply.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <atalk/dsi.h>
index 24ef45db687e72a470ca0b188b92a5a11197625a..cb112ffd700615480a00641fcf2abe271a95a27d 100644 (file)
@@ -1,16 +1,20 @@
 /*
+ * $Id: dsi_getsess.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <signal.h>
 #include <sys/wait.h>
index 9758ddebe2680ca5dc73008e7b0ef145ceb68abd..3bbec554a623338f297a178a61d39a2d4f70bf2e 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: dsi_getstat.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
index 6a545e94376482884389c2d96b28e7a81d497bbb..6d4dd0d342c6b3241ffc1c805a39bdb5f94959a3 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: dsi_init.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
index e33d1d78490ba5a7f0eaaf872db2e7313340fd88..dfc6f2e421a09cf9e441a9a17eb1919dfa61f365 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: dsi_opensess.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
index 70509f766ef7f7530bd18d25338a2a7d282a2ddf..a0a589e0659971f27db06646b5893a95ff42a95c 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: dsi_private.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
index cc5a27b0251609ede38b4d5cb17302e5efb05e6c..0f33c174b9f7dacd10cc9b90a00c4ed8ef89d414 100644 (file)
@@ -1,15 +1,19 @@
 /*
+ * $Id: dsi_read.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/time.h>
@@ -18,7 +22,7 @@
 
 #ifndef min
 #define min(a,b)   ((a) < (b) ? (a) : (b))
-#endif
+#endif /* ! min */
 
 /* streaming i/o for afp_read. this is all from the perspective of the
  * client. it basically does the reverse of dsi_write. on first entry,
index 30baf6130206aec917643e7ac8a222ed715c1efc..f20045d51c8b761819587e044406fa930401353d 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: dsi_stream.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  *
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #define USE_WRITEV
 
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <string.h>
 #include <errno.h>
 #include <sys/types.h>
 #ifdef USE_WRITEV
 #include <sys/uio.h>
-#endif
+#endif /* USE_WRITEV */
 #include <syslog.h>
 
 #include <atalk/dsi.h>
@@ -95,7 +99,7 @@ int dsi_stream_send(DSI *dsi, void *buf, size_t length)
   struct iovec iov[2];
   size_t  towrite;
   ssize_t len;
-#endif
+#endif /* USE_WRITEV */
 
   block[0] = dsi->header.dsi_flags;
   block[1] = dsi->header.dsi_command;
@@ -150,14 +154,14 @@ int dsi_stream_send(DSI *dsi, void *buf, size_t length)
     }
   }
   
-#else
+#else /* USE_WRITEV */
   /* write the header then data */
   if ((dsi_stream_write(dsi, block, sizeof(block)) != sizeof(block)) ||
       (dsi_stream_write(dsi, buf, length) != length)) {
     sigprocmask(SIG_SETMASK, &oldset, NULL);
     return 0;
   }
-#endif
+#endif /* USE_WRITEV */
 
   sigprocmask(SIG_SETMASK, &oldset, NULL);
   return 1;
index 34f124b98270f18d356064502776982b58d21968..bfa58c845b263b59e67b2655b1dd76333885ea68 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: dsi_tcp.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997, 1998 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  *
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #define USE_TCP_NODELAY
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <errno.h>
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
-#endif
+#endif /* HAVE_STDINT_H */
 
 #include <sys/ioctl.h>
 #include <net/if.h>
 
 #ifdef __svr4__
 #include <sys/sockio.h>
-#endif
+#endif /* __svr4__ */
 
 #ifdef TCPWRAP
 #include <tcpd.h>
 int allow_severity = LOG_INFO;
 int deny_severity = LOG_WARNING;
-#endif
+#endif /* TCPWRAP */
 
 #include <atalk/dsi.h>
 #include <atalk/compat.h>
@@ -55,17 +61,17 @@ int deny_severity = LOG_WARNING;
 
 #ifndef DSI_TCPMAXPEND
 #define DSI_TCPMAXPEND      20       /* max # of pending connections */
-#endif
+#endif /* DSI_TCPMAXPEND */
 
 #ifndef DSI_TCPTIMEOUT
 #define DSI_TCPTIMEOUT      120     /* timeout in seconds for connections */
-#endif
+#endif /* ! DSI_TCPTIMEOUT */
 
 
 /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
 #ifndef SOCKLEN_T
 #define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
 
 static void dsi_tcp_close(DSI *dsi)
 {
@@ -105,7 +111,7 @@ static int dsi_tcp_open(DSI *dsi)
       dsi->socket = -1;
     }
   }
-#endif
+#endif /* TCPWRAP */
 
   if (dsi->socket < 0)
     return -1;
@@ -229,15 +235,15 @@ int dsi_tcp_init(DSI *dsi, const char *hostname, const char *address,
 #ifdef SO_REUSEADDR
     port = 1;
     setsockopt(dsi->serversock, SOL_SOCKET, SO_REUSEADDR, &port, sizeof(port));
-#endif
+#endif /* SO_REUSEADDR */
 
 #ifdef USE_TCP_NODELAY 
 #ifndef SOL_TCP
 #define SOL_TCP IPPROTO_TCP
-#endif
+#endif /* ! SOL_TCP */
     port = 1;
     setsockopt(dsi->serversock, SOL_TCP, TCP_NODELAY, &port, sizeof(port));
-#endif
+#endif /* USE_TCP_NODELAY */
 
     /* now, bind the socket and set it up for listening */
     if ((bind(dsi->serversock, (struct sockaddr *) &dsi->server, 
@@ -265,7 +271,7 @@ int dsi_tcp_init(DSI *dsi, const char *hostname, const char *address,
 
 #ifndef IFF_SLAVE
 #define IFF_SLAVE 0
-#endif
+#endif /* ! IFF_SLAVE */
        if (ioctl(dsi->serversock, SIOCGIFFLAGS, &ifr) < 0)
          continue;
 
index 3018489ed19d44597e9d1b680b928ddec429450b..fd3ca971dc8f55a9e0faa0b995d93bb45a298843 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: dsi_tickle.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <sys/types.h>
index 42dca69745111eec530dfc628d5bc66e220a8eb1..8ce85c2ca547f4cff7977681b4e5e6d549f06a96 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: dsi_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  *
@@ -7,15 +9,19 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 /* this streams writes */
 #include <stdio.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <string.h>
 
 #include <atalk/dsi.h>
@@ -23,7 +29,7 @@
 
 #ifndef MIN
 #define MIN(a,b)     ((a) < (b) ? (a) : (b))
-#endif
+#endif /* ! MIN */
 
 /* initialize relevant things for dsi_write. this returns the amount
  * of data in the data buffer. the interface has been reworked to allow
index 4ea004f227cf66ea5c200778bfb21278b358cf9d..c7bd4035cee1ecfcbec1b710abdfa0235ae01bc5 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: nbp_conf.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -36,4 +38,4 @@ extern unsigned char    nbp_id;
 int nbp_parse __P((char *, struct nbpnve *, int));
 int nbp_match __P((struct nbpnve *, struct nbpnve *, int));
 
-#endif
+#endif /* NBP_CONF_H */
index a6290e850a43375311e40db92c603eb275d496f9..9a3212747941675bb6b2ef2b6b9469ee876f789d 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: nbp_lkup.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1997 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
 #include <sys/types.h>
@@ -21,7 +23,9 @@
 #include <atalk/netddp.h>
 #include <atalk/ddp.h>
 
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 #include <errno.h>
 
 #include  "nbp_conf.h"
@@ -29,7 +33,7 @@
 /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
 #ifndef SOCKLEN_T
 #define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
 
 int nbp_lookup( obj, type, zone, nn, nncnt, ataddr )
     const char         *obj, *type, *zone;
@@ -58,9 +62,9 @@ int nbp_lookup( obj, type, zone, nn, nncnt, ataddr )
     *data++ = DDPTYPE_NBP;
 #ifdef MACOSX_SERVER
     nh.nh_op = from.sat_addr.s_node ? NBPOP_BRRQ : NBPOP_LKUP;
-#else
+#else /* MACOSX_SERVER */
     nh.nh_op = NBPOP_BRRQ;
-#endif
+#endif /* MACOSX_SERVER */
 
     nh.nh_cnt = 1;
     nh.nh_id = ++nbp_id;
@@ -120,7 +124,7 @@ int nbp_lookup( obj, type, zone, nn, nncnt, ataddr )
       addr.sat_addr.s_net = ATADDR_ANYNET;
       addr.sat_addr.s_node = ATADDR_BCAST;
     }
-#endif
+#endif /* MACOSX_SERVER */
     addr.sat_port = nbp_port;
 
     cnt = 0;
index c1f927d4a8c0a9ed06485c63c59a3feb5f0d662b..5fa024925491a138431eb7a579f6535502f4b3af 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: nbp_rgstr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
 #include <sys/types.h>
 #include <atalk/ddp.h>
 #include <atalk/netddp.h>
 
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 #include  "nbp_conf.h"
 
 /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
 #ifndef SOCKLEN_T
 #define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
 
 int nbp_rgstr( sat, obj, type, zone )
     struct sockaddr_at *sat;
index 2209bcc3c663019835365deb66e3d0e7df691cfd..f7b0ccff95b5a1ce5f89f69b7769d1e24bcc2ef5 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: nbp_unrgstr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1997 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
 #include <sys/types.h>
 #include <atalk/netddp.h>
 #include <atalk/ddp.h>
 
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 #include  "nbp_conf.h"
 
 /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
 #ifndef SOCKLEN_T
 #define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
 
 int nbp_unrgstr( obj, type, zone, addr )
     const char         *obj, *type, *zone;
@@ -90,7 +94,7 @@ int nbp_unrgstr( obj, type, zone, addr )
       memcpy(&to.sat_addr, addr, sizeof(struct at_addr));
 #ifdef BSD4_4
     to.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
 
     if ( nbp_port == 0 ) {
        if (( se = getservbyname( "nbp", "ddp" )) == NULL ) {
index 2985b63609bef74dae96dbc30140f0605ed66eb8..6ff8c41a544779a8018864561c4d2434e38d7faa 100644 (file)
@@ -1,14 +1,18 @@
 /*
+ * $Id: nbp_util.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1997 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <string.h>
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -45,7 +49,7 @@ int nbp_parse( data, nn, len )
 
 #ifdef BSD4_4
     nn->nn_sat.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     nn->nn_sat.sat_family = AF_APPLETALK;
     nn->nn_sat.sat_addr.s_net = nt.nt_net;
     nn->nn_sat.sat_addr.s_node = nt.nt_node;
index becaf6d09d0400d2c4a722437008bd6736e3be5d..2cf9007fabb42b06acafda956c9a81bd9e3d8898 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: netddp_open.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -9,7 +11,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 static int _netddp_open_dummy;
 
@@ -21,7 +23,7 @@ static int _netddp_open_dummy;
 #ifdef MACOSX_SERVER
 #include <at/appletalk.h>
 #include <at/ddp.h>
-#endif
+#endif /* MACOSX_SERVER */
 
 #include <netatalk/at.h>
 #include <atalk/netddp.h>
@@ -53,7 +55,7 @@ int netddp_open(struct sockaddr_at *addr, struct sockaddr_at *bridge)
       bridge->sat_addr.s_node = baddress.node;
       bridge->sat_port = baddress.socket;
     }
-#else
+#else /* MACOSX_SERVER */
     int len;
 
     if ((s = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0) 
@@ -75,7 +77,7 @@ int netddp_open(struct sockaddr_at *addr, struct sockaddr_at *bridge)
         close(s);
        return -1;
     }
-#endif
+#endif /* MACOSX_SERVER */
 
     return s;
 }
index 068590bc52efd395ea67d5c8e5b924b71bcd5512..4cc7b914e4a4873ae6b42d8fafd10f68c029171e 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: netddp_recvfrom.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 static int _netddp_recvfrom_dummy;
 
 #ifndef NO_DDP
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
@@ -22,7 +26,7 @@ static int _netddp_recvfrom_dummy;
 #ifdef MACOSX_SERVER
 #include <at/appletalk.h>
 #include <at/ddp.h>
-#endif
+#endif /* MACOSX_SERVER */
 
 #include <netatalk/at.h>
 #include <netatalk/endian.h>
@@ -31,7 +35,7 @@ static int _netddp_recvfrom_dummy;
 
 #ifndef MAX
 #define MAX(a, b)  ((a) < (b) ? (b) : (a))
-#endif
+#endif /* ! MAX */
 
 #ifdef MACOSX_SERVER
 int netddp_recvfrom(int fd, void *buf, int buflen, unsigned int dummy, 
index f6c9c78b607e4f9f17920eb972e7fda93169c36b..a81cfc883991e2b5541ce17887e8de6b401ea188 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: netddp_sendto.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 static int _netddp_sendto_dummy;
 
 #ifndef NO_DDP
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
@@ -23,7 +27,7 @@ static int _netddp_sendto_dummy;
 #ifdef MACOSX_SERVER
 #include <at/appletalk.h>
 #include <at/ddp.h>
-#endif
+#endif /* MACOSX_SERVER */
 
 #include <netatalk/at.h>
 #include <netatalk/endian.h>
@@ -32,7 +36,7 @@ static int _netddp_sendto_dummy;
 
 #ifndef MAX
 #define MAX(a, b)  ((a) < (b) ? (b) : (a))
-#endif
+#endif /* ! MAX */
 
 #ifdef MACOSX_SERVER
 int netddp_sendto(int fd, void *buf, int buflen, unsigned int dummy, 
index 3d3bab806c0c65a9c9098f17ca246e42ae430355..02c76a954ef874502bee551c26008415a320d606 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: pap_child.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -21,6 +23,9 @@
  *     netatalk@itd.umich.edu
  */
 
+#ifndef _PAP_CHILD_H
+#define _PAP_CHILD_H 1
+
 struct pap_child {
     int                        ac_pid;
     int                        ac_state;
@@ -30,3 +35,5 @@ struct pap_child {
 #define ACSTATE_DEAD   0
 #define ACSTATE_OK     1
 #define ACSTATE_BAD    7
+
+#endif /* _PAP_CHILD_H */
index b3c9953ff2f3c12856eb6ae3b17a6edab0dad27f..4c790936cd34f489cd6f35d0609b385157d24171 100644 (file)
@@ -1,8 +1,12 @@
-/* close the connection */
+/*
+ * $Id: pap_close.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
+ * close the connection
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 int pap_close(PAP pap)
 {
index 1709f03b69d6bf5edd1bf316b392ec89fd448e25..5118097ae4eb9e85f438e2aa01af87d53c3645f6 100644 (file)
@@ -1,6 +1,10 @@
+/*
+ * $Id: pap_init.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 PAP pap_init(ATP atp)
 {
@@ -12,7 +16,7 @@ PAP pap_init(ATP atp)
     pap->pap_atp = atp;
 #ifdef BSD4_4
     pap->pap_sat.sat_len = sizeof(struct sockaddr_at);
-#endif
+#endif /* BSD4_4 */
     pap->pap_sat.sat_family = AF_APPLETALK;
     pap->pap_sat.sat_addr.s_net = ATADDR_ANYNET;
     pap->pap_sat.sat_addr.s_node = ATADDR_ANYNODE;
index 8204d228aa7ab2788c21338e0793c962991ca675..bf183281768b15197f0f576dcd1b4cab03188349 100644 (file)
@@ -1,8 +1,12 @@
-/* moved over from bin/pap/pap.c */
+/*
+ * $Id: pap_open.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
+ * moved over from bin/pap/pap.c
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 static struct {
   PAP pap;
index f8cce39aa3543326452e87e1b7e4c01d581e3283..ac8faabe16b98bb04f8a7058880fc453d071ad52 100644 (file)
@@ -1,8 +1,12 @@
-/* taken from bin/pap/pap.c */
+/*
+ * $Id: pap_read.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
+ * taken from bin/pap/pap.c
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 int pap_read(PAP pap)
 {
index 5affb62df12cf5261dca71abc3e1f9d42dd896a9..cd4b7c3fa56ad42c4309c864c6b86d47fea8a286 100644 (file)
@@ -1,6 +1,10 @@
+/*
+ * $Id: pap_sendstatus.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 int pap_sendstatus(PAP pap)
 {
index d9769a1e878edada4a48b1cc0c6fc37bd6320a25..7a8e490da0cdd70de638424abd8557f9536f6b24 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: pap_slinit.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -126,7 +128,7 @@ PAP pap_slinit(PAP pap, server_child *server_children,
     memset( &sat, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     sat.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     sat.sat_family = AF_APPLETALK;
     sat.sat_addr.s_net = ATADDR_ANYNET;
     sat.sat_addr.s_node = ATADDR_ANYNODE;
@@ -151,7 +153,7 @@ PAP pap_slinit(PAP pap, server_child *server_children,
     case PAPFUNC_STAT:
 #ifdef EBUG
       printf( "pap stat\n" );
-#endif EBUG
+#endif /* EBUG */
       if ( pap->pap_slen > 0 ) {
        pap->cmdbuf[0] = 0;
        bcopy( pap->pap_status, pap->cmdbuf + 4, pap->pap_slen );
index 3d8531f3426917795652b4f126e21635528c8278..fb11423ef5d1b3be73eb1ac5b144881bd59c1660 100644 (file)
@@ -1,8 +1,12 @@
-/* send a tickle */
+/*
+ * $Id: pap_tickle.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
+ * send a tickle
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 void pap_tickle(PAP pap, const u_int8_t connid, struct sockaddr_at *sat)
 {
index a5eaedee63a722dfa48d17cd9baf025ccf4009f4..0c2b21edc519f04d09c0c0d823453dca56d5b3e6 100644 (file)
@@ -1,10 +1,14 @@
+/*
+ * $Id: cdefs.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
 #ifndef _SYS_CDEFS_H
 #define _SYS_CDEFS_H 1
 
 #ifdef __STDC__
 #define __P(args)    args  
-#else
+#else /* __STDC__ */
 #define __P(args)    ()
-#endif
+#endif /* __STDC__ */
 
 #endif /* sys/cdefs.h */
index ece86b1a880d710d2bb2b4cf24e9a15a59a02d11..f95fbf1874a96fc710266d8fe11336a26ff52cc7 100644 (file)
@@ -1,8 +1,14 @@
 /*
+ * $Id: aarp.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/syslog.h>
@@ -11,7 +17,7 @@
 #include <sys/time.h>
 #ifndef _IBMR2
 #include <sys/kernel.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
 #include <net/if.h>
 #include <net/route.h>
 #include <net/af.h>
@@ -23,7 +29,7 @@
 #include <net/spl.h>
 #include <sys/errno.h>
 #include <sys/err_rec.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
 
 #include "at.h"
 #include "at_var.h"
 #ifdef GATEWAY
 #define AARPTAB_BSIZ   16
 #define AARPTAB_NB     37
-#else
+#else /* GATEWAY */
 #define AARPTAB_BSIZ   9
 #define AARPTAB_NB     19
-#endif GATEWAY
+#endif /* GATEWAY */
 #define AARPTAB_SIZE   (AARPTAB_BSIZ * AARPTAB_NB)
 struct aarptab         aarptab[AARPTAB_SIZE];
 int                    aarptab_size = AARPTAB_SIZE;
@@ -63,9 +69,9 @@ int                   aarptab_size = AARPTAB_SIZE;
 
 #ifdef sun
 extern struct ether_addr       etherbroadcastaddr;
-#else sun
+#else /* sun */
 extern u_char                  etherbroadcastaddr[6];
-#endif sun
+#endif /* sun */
 
 u_char atmulticastaddr[ 6 ] = {
     0x09, 0x00, 0x07, 0xff, 0xff, 0xff,
@@ -113,7 +119,7 @@ at_ifawithnet( sat, ifa )
                sat->sat_addr.s_net ) {
            break;
        }
-#else BSD4_4
+#else /* BSD4_4 */
        if ( ifa->ifa_addr.sa_family != AF_APPLETALK ) {
            continue;
        }
@@ -122,7 +128,7 @@ at_ifawithnet( sat, ifa )
                ntohs( sat->sat_addr.s_net ) <= ntohs( aa->aa_lastnet )) {
            break;
        }
-#endif BSD4_4
+#endif /* BSD4_4 */
     }
     return( ifa );
 }
@@ -145,13 +151,13 @@ aarpwhohas( ac, sat )
     m->m_len = sizeof( *ea );
     m->m_pkthdr.len = sizeof( *ea );
     MH_ALIGN( m, sizeof( *ea ));
-#else BSD4_4
+#else /* BSD4_4 */
     if (( m = m_get( M_DONTWAIT, MT_DATA )) == NULL ) {
        return;
     }
     m->m_len = sizeof( *ea );
     m->m_off = MMAXOFF - sizeof( *ea );
-#endif BSD4_4
+#endif /* BSD4_4 */
 
     ea = mtod( m, struct ether_aarp *);
     bzero((caddr_t)ea, sizeof( *ea ));
@@ -164,10 +170,10 @@ aarpwhohas( ac, sat )
 #ifdef sun
     bcopy((caddr_t)&ac->ac_enaddr, (caddr_t)ea->aarp_sha,
            sizeof( ea->aarp_sha ));
-#else sun
+#else /* sun */
     bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->aarp_sha,
            sizeof( ea->aarp_sha ));
-#endif sun
+#endif /* sun */
 
     /*
      * We need to check whether the output ethernet type should
@@ -188,22 +194,22 @@ aarpwhohas( ac, sat )
 #ifdef sun
        bcopy((caddr_t)atmulticastaddr, (caddr_t)&eh->ether_dhost,
                sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
        bcopy((caddr_t)atmulticastaddr, (caddr_t)eh->ether_dhost,
                sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
 #if defined( sun ) && defined( i386 )
        eh->ether_type = htons( sizeof( struct llc ) +
                sizeof( struct ether_aarp ));
-#else sun i386
+#else /* sun && i386 */
        eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp );
-#endif sun i386
+#endif /* sun && i386 */
 #ifdef BSD4_4
        M_PREPEND( m, sizeof( struct llc ), M_WAIT );
-#else BSD4_4
+#else /* BSD4_4 */
        m->m_len += sizeof( struct llc );
        m->m_off -= sizeof( struct llc );
-#endif BSD4_4
+#endif /* BSD4_4 */
        llc = mtod( m, struct llc *);
        llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
        llc->llc_control = LLC_UI;
@@ -221,15 +227,15 @@ aarpwhohas( ac, sat )
 #ifdef sun
        bcopy((caddr_t)&etherbroadcastaddr, (caddr_t)&eh->ether_dhost,
                sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
        bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
                sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
 #if defined( sun ) && defined( i386 )
        eh->ether_type = htons( ETHERTYPE_AARP );
-#else sun i386
+#else /* sun && i386 */
        eh->ether_type = ETHERTYPE_AARP;
-#endif sun i386
+#endif /* sun && i386 */
 
        ea->aarp_spa = AA_SAT( aa )->sat_addr.s_node;
        ea->aarp_tpa = sat->sat_addr.s_node;
@@ -237,7 +243,7 @@ aarpwhohas( ac, sat )
 
 #ifdef BSD4_4
     sa.sa_len = sizeof( struct sockaddr );
-#endif BSD4_4
+#endif /* BSD4_4 */
     sa.sa_family = AF_UNSPEC;
     (*ac->ac_if.if_output)(&ac->ac_if, m, &sa );
 }
@@ -248,9 +254,9 @@ aarpresolve( ac, m, destsat, desten )
     struct sockaddr_at *destsat;
 #ifdef sun
     struct ether_addr  *desten;
-#else sun
+#else /* sun */
     u_char             *desten;
-#endif sun
+#endif /* sun */
 {
     struct at_ifaddr   *aa;
     struct ifaddr      ifa;
@@ -270,10 +276,10 @@ aarpresolve( ac, m, destsat, desten )
 #ifdef sun
            bcopy( (caddr_t)&etherbroadcastaddr, (caddr_t)desten,
                    sizeof( etherbroadcastaddr ));
-#else sun
+#else /* sun */
            bcopy( (caddr_t)etherbroadcastaddr, (caddr_t)desten,
                    sizeof( etherbroadcastaddr ));
-#endif sun
+#endif /* sun */
        }
        return( 1 );
     }
@@ -319,7 +325,7 @@ aarpinput( ac, m )
 
 #ifndef BSD4_4
     IF_ADJ( m );
-#endif BSD4_4
+#endif /* BSD4_4 */
 
     if ( m->m_len < sizeof( struct arphdr )) {
        goto out;
@@ -374,13 +380,13 @@ at_aarpinput( ac, m )
        m_freem( m );
        return;
     }
-#else sun
+#else /* sun */
     if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )ac->ac_enaddr,
            sizeof( ac->ac_enaddr ))) {
        m_freem( m );
        return;
     }
-#endif sun
+#endif /* sun */
 
     /*
      * Check if from broadcast address.  This could be a more robust
@@ -393,21 +399,21 @@ at_aarpinput( ac, m )
        m_freem( m );
        return;
     }
-#else sun
+#else /* sun */
     if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )etherbroadcastaddr,
            sizeof( etherbroadcastaddr ))) {
 #ifndef _IBMR2
 #ifdef ultrix
        mprintf( LOG_ERR,
-#else ultrix
+#else /* ultrix */
        log( LOG_ERR,
-#endif ultrix
+#endif /* ultrix */
                "aarp: source is broadcast!\n" );
-#endif _IBMR2
+#endif /* ! _IBMR2 */
        m_freem( m );
        return;
     }
-#endif sun
+#endif /* sun */
 
     op = ntohs( ea->aarp_op );
     bcopy( ea->aarp_tpnet, &net, sizeof( net ));
@@ -469,13 +475,13 @@ at_aarpinput( ac, m )
 #ifndef _IBMR2
 #ifdef ultrix
            mprintf( LOG_ERR,
-#else ultrix
+#else /* ultrix */
            log( LOG_ERR,
-#endif ultrix
+#endif /* ultrix */
                    "aarp: duplicate AT address!! %x:%x:%x:%x:%x:%x\n",
                    ea->aarp_sha[ 0 ], ea->aarp_sha[ 1 ], ea->aarp_sha[ 2 ],
                    ea->aarp_sha[ 3 ], ea->aarp_sha[ 4 ], ea->aarp_sha[ 5 ]);
-#endif _IBMR2
+#endif /* ! _IBMR2 */
            m_freem( m );
            return;
        }
@@ -511,10 +517,10 @@ at_aarpinput( ac, m )
            sat.sat_family = AF_UNSPEC;
            bcopy( aat->aat_enaddr, (*(struct sockaddr *)&sat).sa_data,
                    sizeof( aat->aat_enaddr ));
-#else _IBMR2
+#else /* _IBMR2 */
            sat.sat_family = AF_APPLETALK;
            sat.sat_addr = spa;
-#endif _IBMR2
+#endif /* _IBMR2 */
            (*ac->ac_if.if_output)( &ac->ac_if, aat->aat_hold,
                    (struct sockaddr *)&sat );
            aat->aat_hold = 0;
@@ -545,34 +551,34 @@ at_aarpinput( ac, m )
 #ifdef sun
     bcopy(( caddr_t )&ac->ac_enaddr, ( caddr_t )ea->aarp_sha,
            sizeof( ea->aarp_sha ));
-#else sun
+#else /* sun */
     bcopy(( caddr_t )ac->ac_enaddr, ( caddr_t )ea->aarp_sha,
            sizeof( ea->aarp_sha ));
-#endif sun
+#endif /* sun */
 
     eh = (struct ether_header *)sa.sa_data;
 #ifdef sun
     bcopy(( caddr_t )ea->aarp_tha, ( caddr_t )&eh->ether_dhost,
            sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
     bcopy(( caddr_t )ea->aarp_tha, ( caddr_t )eh->ether_dhost,
            sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
 
     if ( aa->aa_flags & AFA_PHASE2 ) {
 #if defined( sun ) && defined( i386 )
        eh->ether_type = htons( sizeof( struct llc ) +
                sizeof( struct ether_aarp ));
-#else sun i386
+#else /* sun && i386 */
        eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp );
-#endif sun i386
+#endif /* sun && i386 */
 #ifdef BSD4_4
        M_PREPEND( m, sizeof( struct llc ), M_DONTWAIT );
        if ( m == NULL ) {
            m_freem( m );
            return;
        }
-#else BSD4_4
+#else /* BSD4_4 */
        MGET( m0, M_DONTWAIT, MT_HEADER );
        if ( m0 == NULL ) {
            m_freem( m );
@@ -582,7 +588,7 @@ at_aarpinput( ac, m )
        m = m0;
        m->m_off = MMAXOFF - sizeof( struct llc );
        m->m_len = sizeof ( struct llc );
-#endif BSD4_4
+#endif /* BSD4_4 */
        llc = mtod( m, struct llc *);
        llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
        llc->llc_control = LLC_UI;
@@ -594,9 +600,9 @@ at_aarpinput( ac, m )
     } else {
 #if defined( sun ) && defined( i386 )
        eh->ether_type = htons( ETHERTYPE_AARP );
-#else sun i386
+#else /* sun && i386 */
        eh->ether_type = ETHERTYPE_AARP;
-#endif sun i386
+#endif /* sun && i386 */
     }
 
     ea->aarp_tpnode = ea->aarp_spnode;
@@ -605,7 +611,7 @@ at_aarpinput( ac, m )
 
 #ifdef BSD4_4
     sa.sa_len = sizeof( struct sockaddr );
-#endif BSD4_4
+#endif /* BSD4_4 */
     sa.sa_family = AF_UNSPEC;
     (*ac->ac_if.if_output)( &ac->ac_if, m, &sa );
     return;
@@ -701,13 +707,13 @@ aarpprobe( ac )
     m->m_len = sizeof( *ea );
     m->m_pkthdr.len = sizeof( *ea );
     MH_ALIGN( m, sizeof( *ea ));
-#else BSD4_4
+#else /* BSD4_4 */
     if (( m = m_get( M_DONTWAIT, MT_DATA )) == NULL ) {
        return;
     }
     m->m_len = sizeof( *ea );
     m->m_off = MMAXOFF - sizeof( *ea );
-#endif BSD4_4
+#endif /* BSD4_4 */
 
     ea = mtod( m, struct ether_aarp *);
     bzero((caddr_t)ea, sizeof( *ea ));
@@ -720,10 +726,10 @@ aarpprobe( ac )
 #ifdef sun
     bcopy((caddr_t)&ac->ac_enaddr, (caddr_t)ea->aarp_sha,
            sizeof( ea->aarp_sha ));
-#else sun
+#else /* sun */
     bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->aarp_sha,
            sizeof( ea->aarp_sha ));
-#endif sun
+#endif /* sun */
 
     eh = (struct ether_header *)sa.sa_data;
 
@@ -731,22 +737,22 @@ aarpprobe( ac )
 #ifdef sun
        bcopy((caddr_t)atmulticastaddr, (caddr_t)&eh->ether_dhost,
                sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
        bcopy((caddr_t)atmulticastaddr, (caddr_t)eh->ether_dhost,
                sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
 #if defined( sun ) && defined( i386 )
        eh->ether_type = htons( sizeof( struct llc ) +
                sizeof( struct ether_aarp ));
-#else sun i386
+#else /* sun && i386 */
        eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp );
-#endif sun i386
+#endif /* sun && i386 */
 #ifdef BSD4_4
        M_PREPEND( m, sizeof( struct llc ), M_WAIT );
-#else BSD4_4
+#else /* BSD4_4 */
        m->m_len += sizeof( struct llc );
        m->m_off -= sizeof( struct llc );
-#endif BSD4_4
+#endif /* BSD4_4 */
        llc = mtod( m, struct llc *);
        llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
        llc->llc_control = LLC_UI;
@@ -762,21 +768,21 @@ aarpprobe( ac )
 #ifdef sun
        bcopy((caddr_t)&etherbroadcastaddr, (caddr_t)&eh->ether_dhost,
                sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
        bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
                sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
 #if defined( sun ) && defined( i386 )
        eh->ether_type = htons( ETHERTYPE_AARP );
-#else sun i386
+#else /* sun && i386 */
        eh->ether_type = ETHERTYPE_AARP;
-#endif sun i386
+#endif /* sun && i386 */
        ea->aarp_spa = ea->aarp_tpa = AA_SAT( aa )->sat_addr.s_node;
     }
 
 #ifdef BSD4_4
     sa.sa_len = sizeof( struct sockaddr );
-#endif BSD4_4
+#endif /* BSD4_4 */
     sa.sa_family = AF_UNSPEC;
     (*ac->ac_if.if_output)(&ac->ac_if, m, &sa );
     aa->aa_probcnt--;
index 646a13ac55dab5d1f79d6647031ce7ed7bd43133..a391aae8b3128b5b8f1054d225efcb1f532fc53b 100644 (file)
@@ -1,15 +1,19 @@
 /*
+ * $Id: aarp.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
- */
-
-/*
+ *
  * This structure is used for both phase 1 and 2. Under phase 1
  * the net is not filled in. It is in phase 2. In both cases, the
  * hardware address length is (for some unknown reason) 4. If
  * anyone at Apple could program their way out of paper bag, it
  * would be 1 and 3 respectively for phase 1 and 2.
  */
+
+#ifndef _AARP_H
+#define _AARP_H 1
+
 union aapa {
     u_char             ap_pa[4];
     struct ap_node {
@@ -55,4 +59,6 @@ struct aarptab {
 #ifdef KERNEL
 struct aarptab         *aarptnew();
 int                    aarpprobe();
-#endif
+#endif /* KERNEL */
+
+#endif /* _AARP_H */
index 4f0758792fd644690f209ab794e5c5388da04da3..541dcb18d492c2d0f0c6d5192f9be4abf80e09ad 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: at.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  *
  * All Rights Reserved.  See COPYRIGHT.
@@ -11,7 +13,7 @@
 #include <sys/socket.h>
 #include <asm/types.h>
 #include <linux/atalk.h>
-#else
+#else /* linux */
 
 #include <sys/types.h>
 #include <netinet/in.h> /* so that we can deal with sun's s_net #define */
@@ -21,7 +23,7 @@
  */
 #ifdef ATPROTO_DDP
 #undef ATPROTO_DDP
-#endif
+#endif /* ATPROTO_DDP */
 #define ATPROTO_DDP    0
 #define ATPROTO_AARP   254
 
@@ -52,7 +54,7 @@
 struct at_addr {
 #ifdef s_net
 #undef s_net
-#endif
+#endif /* s_net */
     u_short    s_net;
     u_char     s_node;
 };
@@ -73,9 +75,9 @@ struct sockaddr_at {
 #ifdef BSD4_4
     u_char             sat_len;
     u_char             sat_family;
-#else BSD4_4
+#else /* BSD4_4 */
     short              sat_family;
-#endif BSD4_4
+#endif /* BSD4_4 */
     u_char             sat_port;
     struct at_addr     sat_addr;
 #ifdef notdef
@@ -93,9 +95,9 @@ struct sockaddr_at {
            u_short             su_interface;
        } sh_un;
     } sat_hints;
-#else notdef
+#else /* notdef */
     char               sat_zero[ 8 ];
-#endif notdef
+#endif /* notdef */
 };
 
 struct netrange {
@@ -107,7 +109,7 @@ struct netrange {
 #ifdef KERNEL
 extern struct domain   atalkdomain;
 extern struct protosw  atalksw[];
-#endif
+#endif /* KERNEL */
 
 #endif /* linux */
-#endif __AT_HEADER__
+#endif /* __AT_HEADER__ */
index a57c2aa171839eaf54f5fc86be341675c59a2c92..3cc3a1ed74f5d4ae6c8188b710b4748368eacf3e 100644 (file)
@@ -1,13 +1,19 @@
 /*
+ * $Id: at_control.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #ifdef ibm032
 #include <sys/dir.h>
-#endif ibm032
+#endif /* ibm032 */
 #include <sys/user.h>
 #include <sys/types.h>
 #include <sys/errno.h>
@@ -15,7 +21,7 @@
 #include <sys/mbuf.h>
 #ifndef _IBMR2
 #include <sys/kernel.h>
-#endif _IBMR2
+#endif /* ! _IBMR2 */
 #include <sys/socket.h>
 #include <sys/socketvar.h>
 #include <net/if.h>
@@ -26,7 +32,7 @@
 #include <netinet/if_ether.h>
 #ifdef _IBMR2
 #include <net/spl.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
 
 #include "at.h"
 #include "at_var.h"
@@ -38,7 +44,7 @@
                    (a)->sat_family == (b)->sat_family && \
                    (a)->sat_addr.s_net == (b)->sat_addr.s_net && \
                    (a)->sat_addr.s_node == (b)->sat_addr.s_node )
-#else BSD4_4
+#else /* BSD4_4 */
 atalk_hash( sat, hp )
     struct sockaddr_at *sat;
     struct afhash      *hp;
@@ -68,7 +74,7 @@ atalk_netmatch( sat1, sat2 )
     }
     return( sat1->sat_addr.s_net == sat2->sat_addr.s_net );
 }
-#endif BSD4_4
+#endif /* BSD4_4 */
 
 at_control( cmd, data, ifp )
     int                        cmd;
@@ -81,7 +87,7 @@ at_control( cmd, data, ifp )
 #ifdef BSD4_4
     struct at_aliasreq *ifra = (struct at_aliasreq *)data;
     struct at_ifaddr   *aa0;
-#endif BSD4_4
+#endif /* BSD4_4 */
     struct at_ifaddr   *aa = 0;
     struct mbuf                *m;
     struct ifaddr      *ifa;
@@ -108,7 +114,7 @@ at_control( cmd, data, ifp )
            return( EADDRNOTAVAIL );
        }
        /*FALLTHROUGH*/
-#endif BSD4_4
+#endif /* BSD4_4 */
 
     case SIOCSIFADDR:
 #ifdef BSD4_4
@@ -119,11 +125,11 @@ at_control( cmd, data, ifp )
        if ( suser( u.u_cred, &u.u_acflag )) {
            return( EPERM );
        }
-#else BSD4_4
+#else /* BSD4_4 */
        if ( !suser()) {
            return( EPERM );
        }
-#endif BSD4_4
+#endif /* BSD4_4 */
 
        sat = satosat( &ifr->ifr_addr );
        nr = (struct netrange *)sat->sat_zero;
@@ -184,7 +190,7 @@ at_control( cmd, data, ifp )
            aa->aa_ifa.ifa_addr = (struct sockaddr *)&aa->aa_addr;
            aa->aa_ifa.ifa_dstaddr = (struct sockaddr *)&aa->aa_addr;
            aa->aa_ifa.ifa_netmask = (struct sockaddr *)&aa->aa_netmask;
-#endif BSD4_4
+#endif /* BSD4_4 */
 
            /*
             * Set/clear the phase 2 bit.
@@ -227,9 +233,9 @@ at_control( cmd, data, ifp )
     case SIOCGIFADDR:
 #ifdef BSD4_4
        *(struct sockaddr_at *)&ifr->ifr_addr = aa->aa_addr;
-#else BSD4_4
+#else /* BSD4_4 */
        ifr->ifr_addr = aa->aa_addr;
-#endif BSD4_4
+#endif /* BSD4_4 */
        break;
 
     case SIOCSIFADDR:
@@ -272,7 +278,7 @@ at_control( cmd, data, ifp )
        }
        m_free( dtom( aa0 ));
        break;
-#endif BSD4_4
+#endif /* BSD4_4 */
 
     default:
        if ( ifp == 0 || ifp->if_ioctl == 0 )
@@ -290,7 +296,7 @@ at_scrub( ifp, aa )
     struct sockaddr_at netsat;
     int                        error;
     u_short            net;
-#endif BSD4_4
+#endif /* ! BSD4_4 */
 
     if ( aa->aa_flags & AFA_ROUTE ) {
 #ifdef BSD4_4
@@ -299,7 +305,7 @@ at_scrub( ifp, aa )
            return( error );
        }
        aa->aa_ifa.ifa_flags &= ~IFA_ROUTE;
-#else BSD4_4
+#else /* BSD4_4 */
        if ( ifp->if_flags & IFF_LOOPBACK ) {
            rtinit( &aa->aa_addr, &aa->aa_addr, SIOCDELRT, RTF_HOST );
        } else {
@@ -325,7 +331,7 @@ at_scrub( ifp, aa )
                }
            }
        }
-#endif BSD4_4
+#endif /* BSD4_4 */
        aa->aa_flags &= ~AFA_ROUTE;
     }
     return( 0 );
@@ -341,9 +347,9 @@ at_ifinit( ifp, aa, sat )
     struct netrange    nr, onr;
 #ifdef BSD4_4
     struct sockaddr_at oldaddr;
-#else BSD4_4
+#else /* BSD4_4 */
     struct sockaddr    oldaddr;
-#endif BSD4_4
+#endif /* BSD4_4 */
     struct sockaddr_at netaddr;
     int                        s = splimp(), error = 0, i, j, netinc, nodeinc, nnets;
     u_short            net;
@@ -367,7 +373,7 @@ at_ifinit( ifp, aa, sat )
     if ( ifp->if_flags & IFF_LOOPBACK ) {
 #ifdef BSD4_4
        AA_SAT( aa )->sat_len = sat->sat_len;
-#endif BSD4_4
+#endif /* BSD4_4 */
        AA_SAT( aa )->sat_family = AF_APPLETALK;
        AA_SAT( aa )->sat_addr.s_net = sat->sat_addr.s_net;
        AA_SAT( aa )->sat_addr.s_node = sat->sat_addr.s_node;
@@ -456,15 +462,15 @@ at_ifinit( ifp, aa, sat )
     aa->aa_netmask.sat_family = AF_APPLETALK;
     aa->aa_netmask.sat_addr.s_net = 0xffff;
     aa->aa_netmask.sat_addr.s_node = 0;
-#endif BSD4_4
+#endif /* BSD4_4 */
 
     if ( ifp->if_flags & IFF_LOOPBACK ) {
 #ifndef BSD4_4
        rtinit( &aa->aa_addr, &aa->aa_addr, (int)SIOCADDRT,
                RTF_HOST|RTF_UP );
-#else BSD4_4
+#else /* ! BSD4_4 */
        error = rtinit( &(aa->aa_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP );
-#endif BSD4_4
+#endif /* ! BSD4_4 */
     } else {
 #ifndef BSD4_4
        /*
@@ -511,9 +517,9 @@ at_ifinit( ifp, aa, sat )
                }
            }
        }
-#else BSD4_4
+#else /* ! BSD4_4 */
        error = rtinit( &(aa->aa_ifa), (int)RTM_ADD, RTF_UP );
-#endif BSD4_4
+#endif /* ! BSD4_4 */
     }
     if ( error ) {
        aa->aa_addr = oldaddr;
@@ -525,7 +531,7 @@ at_ifinit( ifp, aa, sat )
 
 #ifdef BSD4_4
     aa->aa_ifa.ifa_flags |= IFA_ROUTE;
-#endif BSD4_4
+#endif /* BSD4_4 */
     aa->aa_flags |= AFA_ROUTE;
     splx( s );
     return( 0 );
index f1d6f5e9cd3756ea88ba597ab61167aa4f5229cd..21aa36ad70629f7e7a264f170def0556d17a2799 100644 (file)
@@ -1,9 +1,15 @@
 /*
+ * $Id: at_proto.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  *
  * All Rights Reserved.  See COPYRIGHT.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <sys/protosw.h>
 #include <sys/domain.h>
 #include <sys/types.h>
@@ -19,7 +25,7 @@ extern int            ddp_init();
 extern int             ddp_ifoutput();
 extern int             ddp_ifinput();
 extern int             ddp_ifioctl();
-#endif ultrix
+#endif /* ultrix */
 
 struct protosw         atalksw[] = {
     {
@@ -41,7 +47,7 @@ struct protosw                atalksw[] = {
 #ifdef ultrix
        /* interface hooks */
        ddp_ifoutput,   ddp_ifinput,    ddp_ifioctl,    0,
-#endif ultrix
+#endif /* ultrix */
     },
 };
 
index 606c2418c06c6f83f2b444acc956e8d5f1d22ff4..87fe44a0f20c5325c274618640e9b9a5917bcfca 100644 (file)
@@ -1,9 +1,14 @@
 /*
+ * $Id: at_var.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  *
  * All Rights Reserved.  See COPYRIGHT.
  */
 
+#ifndef _ATVAR_H
+#define _ATVAR_H 1
+
 /*
  * For phase2, we need to keep not only our address on an interface,
  * but also the legal networks on the interface.
@@ -15,11 +20,11 @@ struct at_ifaddr {
     struct sockaddr_at aa_addr;
     struct sockaddr_at aa_broadaddr;
     struct sockaddr_at aa_netmask;
-#else BSD4_4
+#else /* BSD4_4 */
 # define aa_addr               aa_ifa.ifa_addr
 # define aa_broadaddr          aa_ifa.ifa_broadaddr
 # define aa_dstaddr            aa_ifa.ifa_dstaddr
-#endif BSD4_4
+#endif /* BSD4_4 */
     int                        aa_flags;
     u_short            aa_firstnet, aa_lastnet;
     int                        aa_probcnt;
@@ -34,7 +39,7 @@ struct at_aliasreq {
 #define ifra_dstaddr ifra_broadaddr
        struct  sockaddr_at ifra_mask;
 };
-#endif BSD4_4
+#endif /* BSD4_4 */
 
 #define AA_SAT(aa) \
     ((struct sockaddr_at *)&((struct at_ifaddr *)(aa))->aa_addr)
@@ -48,4 +53,6 @@ struct at_aliasreq {
 struct at_ifaddr       *at_ifaddr;
 struct ifqueue         atintrq1, atintrq2;
 int                    atdebug;
-#endif
+#endif /* KERNEL */
+
+#endif /* _ATVAR_H */
index 5a20d5eac8b86a2440b32d19f9dc686dabce228b..4388386c7c785118c786eafc3f835dc317ba95c9 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: ddp.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  *
@@ -66,16 +68,16 @@ struct ddpehdr {
     unsigned           dub_hops:4;
     unsigned           dub_len:10;
     unsigned           dub_sum:16;
-#else
+#else /* BYTE_ORDER == BIG_ENDIAN */
 #if BYTE_ORDER == LITTLE_ENDIAN
     unsigned           dub_sum:16;
     unsigned           dub_len:10;
     unsigned           dub_hops:4;
     unsigned           dub_pad:2;
-#else
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
     OOPS!
-#endif
-#endif
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+#endif /* BYTE_ORDER == BIG_ENDIAN */
        } du_bits;
        unsigned        du_bytes;
     } deh_u;
@@ -104,13 +106,13 @@ struct ddpshdr {
     unsigned           dub_len:10;
     unsigned           dub_dport:8;
     unsigned           dub_sport:8;
-#endif
+#endif /* BYTE_ORDER == BIG_ENDIAN */
 #if BYTE_ORDER == LITTLE_ENDIAN
     unsigned           dub_sport:8;
     unsigned           dub_dport:8;
     unsigned           dub_len:10;
     unsigned           dub_pad:6;
-#endif
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
        } du_bits;
        unsigned        du_bytes;
     } dsh_u;
index 8cb4dd56286f840ec2b37b4f442fb909b826c111..3cb87ec0c073784ce7eef0b27d1ad37c4b9edbc4 100644 (file)
@@ -1,8 +1,14 @@
 /*
+ * $Id: ddp_input.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/mbuf.h>
@@ -13,7 +19,7 @@
 #include <net/route.h>
 #ifdef _IBMR2
 #include <net/spl.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
 
 #include "at.h"
 #include "at_var.h"
@@ -40,17 +46,17 @@ atintr()
     for (;;) {
 #ifndef _IBMR2
        s = splimp();
-#endif _IBMR2
+#endif /* ! _IBMR2 */
 
 #ifdef BSD4_4
        IF_DEQUEUE( &atintrq2, m );
-#else BSD4_4
+#else /* BSD4_4 */
        IF_DEQUEUEIF( &atintrq2, m, ifp );
-#endif BSD4_4
+#endif /* BSD4_4 */
 
 #ifndef _IBMR2
        splx( s );
-#endif _IBMR2
+#endif /* ! _IBMR2 */
 
        if ( m == 0 ) {                 /* no more queued packets */
            break;
@@ -58,7 +64,7 @@ atintr()
 
 #ifdef BSD4_4
        ifp = m->m_pkthdr.rcvif;
-#endif BSD4_4
+#endif /* BSD4_4 */
        for ( aa = at_ifaddr; aa; aa = aa->aa_next ) {
            if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 )) {
                break;
@@ -75,17 +81,17 @@ atintr()
     for (;;) {
 #ifndef _IBMR2
        s = splimp();
-#endif _IBMR2
+#endif /* ! _IBMR2 */
 
 #ifdef BSD4_4
        IF_DEQUEUE( &atintrq1, m );
-#else BSD4_4
+#else /* BSD4_4 */
        IF_DEQUEUEIF( &atintrq1, m, ifp );
-#endif BSD4_4
+#endif /* BSD4_4 */
 
 #ifndef _IBMR2
        splx( s );
-#endif _IBMR2
+#endif /* ! _IBMR2 */
 
        if ( m == 0 ) {                 /* no more queued packets */
            break;
@@ -93,7 +99,7 @@ atintr()
 
 #ifdef BSD4_4
        ifp = m->m_pkthdr.rcvif;
-#endif BSD4_4
+#endif /* BSD4_4 */
        for ( aa = at_ifaddr; aa; aa = aa->aa_next ) {
            if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 ) == 0 ) {
                break;
@@ -137,7 +143,7 @@ ddp_input( m, ifp, elh, phase )
     struct ddpehdr     *deh, ddpe;
 #ifndef BSD4_4
     struct mbuf                *mp;
-#endif BSD4_4
+#endif /* BSD4_4 */
     struct ddpcb       *ddp;
     int                        dlen, mlen;
     u_short            cksum;
@@ -243,11 +249,11 @@ ddp_input( m, ifp, elh, phase )
      */
 #ifdef BSD4_4
     mlen = m->m_pkthdr.len;
-#else BSD4_4
+#else /* BSD4_4 */
     for ( mlen = 0, mp = m; mp; mp = mp->m_next ) {
        mlen += mp->m_len;
     }
-#endif BSD4_4
+#endif /* BSD4_4 */
     if ( mlen < dlen ) {
        ddpstat.ddps_toosmall++;
        m_freem( m );
@@ -273,16 +279,16 @@ ddp_input( m, ifp, elh, phase )
                to.sat_addr.s_node )) {
 #ifdef ultrix
            rtfree( forwro.ro_rt );
-#else ultrix
+#else /* ultrix */
            RTFREE( forwro.ro_rt );
-#endif ultrix
+#endif /* ultrix */
            forwro.ro_rt = (struct rtentry *)0;
        }
        if ( forwro.ro_rt == (struct rtentry *)0 ||
             forwro.ro_rt->rt_ifp == (struct ifnet *)0 ) {
 #ifdef BSD4_4
            forwro.ro_dst.sa_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
            forwro.ro_dst.sa_family = AF_APPLETALK;
            satosat( &forwro.ro_dst )->sat_addr.s_net = to.sat_addr.s_net;
            satosat( &forwro.ro_dst )->sat_addr.s_node = to.sat_addr.s_node;
@@ -315,7 +321,7 @@ ddp_input( m, ifp, elh, phase )
 
 #ifdef BSD4_4
     from.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     from.sat_family = AF_APPLETALK;
 
     if ( elh ) {
index b37c051fc5d21d085503448e759bf494e12a3e1b..5f2f583c5ae059069c2ad249a1a998f4cf760dea 100644 (file)
@@ -1,8 +1,14 @@
 /*
+ * $Id: ddp_output.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/mbuf.h>
@@ -33,7 +39,7 @@ ddp_output( ddp, m )
 #ifndef BSD4_4
     struct mbuf                *m0;
     int                        len;
-#endif BSD4_4
+#endif /* ! BSD4_4 */
     struct ifnet       *ifp;
     struct at_ifaddr   *aa = NULL;
     struct ddpehdr     *deh;
@@ -41,7 +47,7 @@ ddp_output( ddp, m )
 
 #ifdef BSD4_4
     M_PREPEND( m, sizeof( struct ddpehdr ), M_WAIT );
-#else BSD4_4
+#else /* BSD4_4 */
     for ( len = 0, m0 = m; m; m = m->m_next ) {
        len += m->m_len;
     }
@@ -51,13 +57,13 @@ ddp_output( ddp, m )
        return( ENOBUFS );
     }
     m->m_next = m0;
-#endif BSD4_4
+#endif /* BSD4_4 */
 
 #ifndef BSD4_4
 # define align(a)      (((a)+3)&0xfc)
     m->m_off = MMINOFF + align( SZ_ELAPHDR );
     m->m_len = sizeof( struct ddpehdr );
-#endif BSD4_4
+#endif /* ! BSD4_4 */
 
     deh = mtod( m, struct ddpehdr *);
     deh->deh_pad = 0;
@@ -65,9 +71,9 @@ ddp_output( ddp, m )
 
 #ifdef BSD4_4
     deh->deh_len = m->m_pkthdr.len;
-#else BSD4_4
+#else /* BSD4_4 */
     deh->deh_len = len + sizeof( struct ddpehdr );
-#endif BSD4_4
+#endif /* BSD4_4 */
 
     deh->deh_dnet = ddp->ddp_fsat.sat_addr.s_net;
     deh->deh_dnode = ddp->ddp_fsat.sat_addr.s_node;
@@ -134,9 +140,9 @@ ddp_route( m, ro )
     if ( ro->ro_rt && ( ifp = ro->ro_rt->rt_ifp )) {
 #ifdef BSD4_4
        net = satosat( ro->ro_rt->rt_gateway )->sat_addr.s_net;
-#else BSD4_4
+#else /* BSD4_4 */
        net = satosat( &ro->ro_rt->rt_gateway )->sat_addr.s_net;
-#endif BSD4_4
+#endif /* BSD4_4 */
        for ( aa = at_ifaddr; aa; aa = aa->aa_next ) {
            if ( aa->aa_ifp == ifp &&
                    ntohs( net ) >= ntohs( aa->aa_firstnet ) &&
@@ -170,11 +176,11 @@ ddp_route( m, ro )
        if ( m == NULL ) {
            return( ENOBUFS );
        }
-#else BSD4_4
+#else /* BSD4_4 */
        m->m_off -= SZ_ELAPHDR;
        m->m_len += SZ_ELAPHDR;
-#endif BSD4_4
-# endif notdef
+#endif /* BSD4_4 */
+# endif /* notdef */
 
        MGET( m0, M_WAIT, MT_HEADER );
        if ( m0 == 0 ) {
@@ -197,9 +203,9 @@ ddp_route( m, ro )
        } else {
 #ifdef BSD4_4
            elh->el_dnode = satosat( ro->ro_rt->rt_gateway )->sat_addr.s_node;
-#else BSD4_4
+#else /* BSD4_4 */
            elh->el_dnode = satosat( &ro->ro_rt->rt_gateway )->sat_addr.s_node;
-#endif BSD4_4
+#endif /* BSD4_4 */
        }
     }
 
@@ -211,9 +217,9 @@ ddp_route( m, ro )
     } else {
 #ifdef BSD4_4
        gate = *satosat( ro->ro_rt->rt_gateway );
-#else BSD4_4
+#else /* BSD4_4 */
        gate = *satosat( &ro->ro_rt->rt_gateway );
-#endif BSD4_4
+#endif /* BSD4_4 */
     }
     ro->ro_rt->rt_use++;
 
@@ -230,11 +236,11 @@ ddp_route( m, ro )
 #ifdef notdef
        m->m_off += SZ_ELAPHDR;
        m->m_len -= SZ_ELAPHDR;
-#endif notdef
+#endif /* notdef */
        ddp_input( m, ifp, (struct elaphdr *)NULL, 2 );
        return( 0 );
     }
-#endif ultrix
+#endif /* ultrix */
 
 #ifdef _IBMR2
     /*
@@ -256,6 +262,6 @@ ddp_route( m, ro )
        bcopy( &eh, (*(struct sockaddr *)&gate).sa_data,
                sizeof( (*(struct sockaddr *)&gate).sa_data ));
     }
-#endif _IBMR2
+#endif /* _IBMR2 */
     return((*ifp->if_output)( ifp, m, &gate ));
 }
index f678b87da92608aa12267dd24cfc35c830cba0ba..50c020295b32457b3f95b5d4c1e70c7ecc4c108f 100644 (file)
@@ -1,15 +1,21 @@
 /*
+ * $Id: ddp_usrreq.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <sys/errno.h>
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/systm.h>
 #ifdef ibm032
 #include <sys/dir.h>
-#endif ibm032
+#endif /* ibm032 */
 #include <sys/user.h>
 #include <sys/mbuf.h>
 #include <sys/ioctl.h>
@@ -20,7 +26,7 @@
 #include <net/route.h>
 #ifdef _IBMR2
 #include <net/spl.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
 
 #include "at.h"
 #include "at_var.h"
@@ -232,11 +238,11 @@ at_pcbsetaddr( ddp, addr )
                    suser( u.u_cred, &u.u_acflag )) {
                return( EACCES );
            }
-#else BSD4_4
+#else /* BSD4_4 */
            if ( sat->sat_port < ATPORT_RESERVED && ( !suser())) {
                return( EACCES );
            }
-#endif BSD4_4
+#endif /* BSD4_4 */
        }
     } else {
        bzero( (caddr_t)&lsat, sizeof( struct sockaddr_at ));
@@ -345,9 +351,9 @@ at_pcbconnect( ddp, addr )
                sat->sat_addr.s_node )) {
 #ifdef ultrix
            rtfree( ro->ro_rt );
-#else ultrix
+#else /* ultrix */
            RTFREE( ro->ro_rt );
-#endif ultrix
+#endif /* ultrix */
            ro->ro_rt = (struct rtentry *)0;
        }
     }
@@ -359,7 +365,7 @@ at_pcbconnect( ddp, addr )
         ro->ro_rt->rt_ifp == (struct ifnet *)0 ) {
 #ifdef BSD4_4
        ro->ro_dst.sa_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
        ro->ro_dst.sa_family = AF_APPLETALK;
        if ( hintnet != 0 ) {
            satosat( &ro->ro_dst )->sat_addr.s_net = hintnet;
index 3a8f62311a7886295c92f8c0c1d6fe287910b44e..42654a229721577507c084f003fc5e878350b9fa 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: ddp_var.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -36,6 +38,6 @@ struct ddpcb          *ddp_ports[ ATPORT_LAST ];
 struct ddpcb           *ddpcb;
 struct ddpstat         ddpstat;
 struct ddpcb           *ddp_search();
-#endif
+#endif /* KERNEL */
 
 #endif /* netatalk/ddp_var.h */
index f4bf069c962173f17345b7f38b8b5be43dfd0a05..3e183a78a3d674bb6b6e19488c91cec64718895e 100644 (file)
@@ -1,19 +1,21 @@
 /*
+ * $Id: endian.h,v 1.4 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  *
  * This file handles both byte ordering and integer sizes.
  */
 
-#  ifndef _ATALK_ENDIAN_H_
+#ifndef _ATALK_ENDIAN_H_
 #define _ATALK_ENDIAN_H_
 
-#include <sys/types.h>
-#include <netinet/in.h>
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
+
+#include <sys/types.h>
+#include <netinet/in.h>
 
 #ifdef _IBMR2
 #include <sys/machine.h>
@@ -31,13 +33,13 @@ typedef uint64_t       u_int64_t;
 #ifdef sun
 #ifdef BSD4_3
 #include <sys/bitypes.h>
-#else
+#else /* BSD4_3 */
 /* solaris and sunos don't consistently define u_int*_t. */
 typedef unsigned char      u_int8_t;
 typedef unsigned short     u_int16_t;
 typedef unsigned int       u_int32_t;
 typedef int                int32_t;
-#endif
+#endif /* BSD4_3 */
 
 typedef unsigned long long u_int64_t;
 
@@ -56,24 +58,24 @@ typedef unsigned char  u_int8_t;
 typedef unsigned short u_int16_t;
 typedef unsigned int   u_int32_t;
 typedef int            int32_t;
-#endif
+#endif /* ultrix || HAVE_32BIT_LONGS || HAVE_64BIT_LONGS */
 
 #ifdef ultrix
 typedef int            ssize_t;
-#endif
+#endif /* ultrix */
 
 #ifdef HAVE_64BIT_LONGS
 typedef unsigned long u_int64_t;
-#else
+#else /* HAVE_64BIT_LONGS */
 /* check for long long support. currently, i assume that if 64-bit
  * ints exist that their made available via long long */
 #ifdef linux
 #include <endian.h> /* i think this is here for libc4 */
-#else 
+#else /* linux */
 #if defined(HAVE_32BIT_LONGS) && !(defined(BSD4_4) || \
                                  defined(NO_LARGE_VOL_SUPPORT))
 typedef unsigned long long  u_int64_t;
-#endif
+#endif /* HAVE_32BIT_LONGS || !BSD4_4 || NO_LARGE_VOL_SUPPORT */
 #endif /* linux */
 #endif /* HAVE_64BIT_LONGS */
 #endif /* sun */
@@ -87,21 +89,21 @@ typedef unsigned long long  u_int64_t;
 #ifdef sun
 #if defined(i386) || defined(_LITTLE_ENDIAN)
 #define BYTE_ORDER     LITTLE_ENDIAN
-#else /*i386*/
+#else /* i386 || _LITTLE_ENDIAN */
 #define BYTE_ORDER     BIG_ENDIAN
-#endif /*i386*/
-#else
+#endif /* i386 || _LITTLE_ENDIAN */
+#else /* sun */
 #if defined(MIPSEB) || defined(__hppa)
 #define BYTE_ORDER     BIG_ENDIAN
-#else
+#else /* MIPSEB || __hppa */
 #ifdef MIPSEL
 #define BYTE_ORDER     LITTLE_ENDIAN
-#else
+#else /* MIPSEL */
 #error Like, what is your byte order, man?
-#endif /*MIPSEL*/
-#endif /*MIPSEB*/
-#endif /*sun*/
-# endif /*BYTE_ORDER*/
+#endif /* MIPSEL*/
+#endif /* MIPSEB || __hppa */
+#endif /* sun */
+# endif /* BYTE_ORDER */
 
 # ifndef ntohl
 # if defined( sun ) || defined( ultrix ) || defined( _IBMR2 )
@@ -111,23 +113,23 @@ typedef unsigned long long  u_int64_t;
 #define htonl(x)       (x)
 #define htons(x)       (x)
 
-#else
+#else /* BYTE_ORDER == BIG_ENDIAN */
 #if defined( mips ) && defined( KERNEL )
 #define        ntohl(x)        nuxi_l(x)
 #define        ntohs(x)        nuxi_s(x)
 #define        htonl(x)        nuxi_l(x)
 #define        htons(x)        nuxi_s(x)
 
-#else /*mips KERNEL*/
+#else /* mips && KERNEL */
 
 #if !( defined( sun ) && defined( i386 ))
 unsigned short ntohs(), htons();
 unsigned int  ntohl(), htonl();
-#endif
+#endif /* ! ( sun && i386 ) */
 
-#endif /*mips KERNEL*/
-#endif /*BYTE_ORDER*/
-# endif /*sun ultrix _IBMR2*/
-# endif /*ntohl*/
+#endif /* mips && KERNEL */
+#endif /* BYTE_ORDER */
+# endif /* sun ultrix _IBMR2 */
+# endif /* ntohl */
 
-#  endif /*_ATALK_ENDIAN_H_*/
+#endif /* _ATALK_ENDIAN_H_ */
index 54eac74930d5c4308b9440e5a9ff06f37a5003cb..ec9735b846e8db4ba9c354935b83fb7ba3e70448 100644 (file)
@@ -1,15 +1,17 @@
 /*
+ * $Id: phase2.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  */
 
 # if defined( ultrix ) || defined( BSD4_4 )
 #include <net/if_llc.h>
-# else ultrix BSD4_4
+# else /* ultrix || BSD4_4 */
 
 #if defined( sun ) && !defined( __svr4__ )
 #include <net/if_ieee802.h>
-#endif sun __svr4__
+#endif /* sun && !__svr4__ */
 
 /*
  * Copyright (c) 1988 Regents of the University of California.
@@ -68,14 +70,14 @@ struct llc {
 #define LLC_ISO_LSAP   0xfe
 #define LLC_SNAP_LSAP  0xaa
 
-# endif ultrix BSD4_4
+# endif /* ultrix && BSD4_4 */
 
 #if defined( sun ) || defined( ibm032 )
 #define SIOCPHASE1     _IOW(i, 100, struct ifreq)      /* AppleTalk phase 1 */
 #define SIOCPHASE2     _IOW(i, 101, struct ifreq)      /* AppleTalk phase 2 */
-#endif sun ibm032
+#endif /* sun || ibm032 */
 
 #if defined( ultrix ) || defined( BSD4_4 ) || defined( _IBMR2 )
 #define SIOCPHASE1     _IOW('i', 100, struct ifreq)    /* AppleTalk phase 1 */
 #define SIOCPHASE2     _IOW('i', 101, struct ifreq)    /* AppleTalk phase 2 */
-#endif ultrix BSD4_4 _IBMR2
+#endif /* ultrix || BSD4_4 || _IBMR2 */
index 02a8524c4ed607ee416fe7e399708857442945a1..968a7881e7eeb1c3ecb3cb447b8cf90e8355ea70 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * $Id: aarp.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/byteorder.h>
index ea3285eb4ada0e054ac9d47366461b2dc5f1248a..97dea86f917f67b5f3ff6220106569d7285860d4 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * $Id: ddp.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <sys/types.h>
 #include <sys/stream.h>
 #include <sys/cmn_err.h>