]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/atp/atp_bufs.c
Merge sf.net
[netatalk.git] / libatalk / atp / atp_bufs.c
index ae79074f386f622b87bb4d387b342a0e68c93237..9c899e23cbc3d20ef454e8e4e0e044e118e83fc3 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: atp_bufs.c,v 1.5 2009-10-13 22:55:37 didg Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
  * Our own memory maintenance for atp
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 
 #include <sys/types.h>
 #include <sys/time.h>
+#include <sys/socket.h>
 
 #include <netatalk/at.h>
 #include <atalk/atp.h>
@@ -42,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
@@ -73,9 +80,7 @@ static int more_bufs(void)
 
 
 #ifdef EBUG
-void atp_print_bufuse( ah, s )
-    ATP                ah;
-    char       *s;
+void atp_print_bufuse(ATP ah, char *s)
 {
     struct atpbuf      *bp;
     int                        i, sentcount, incount, respcount;
@@ -109,7 +114,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)
@@ -122,13 +127,12 @@ struct atpbuf *atp_alloc_buf(void)
     free_list = free_list->atpbuf_next;
 #ifdef EBUG
     ++numbufs;
-#endif EBUG
+#endif /* EBUG */
     return bp;
 }
 
 
-int atp_free_buf( bp )
-    struct atpbuf      *bp;
+int atp_free_buf(struct atpbuf *bp)
 {
     if ( bp == NULL ) {
        return -1;
@@ -137,7 +141,7 @@ int atp_free_buf( bp )
     free_list = bp;
 #ifdef EBUG
     --numbufs;
-#endif EBUG
+#endif /* EBUG */
     return 0;
 }