/*
+ * $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>
#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
#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;
getpid(), s, numbufs, sentcount, incount,
( ah->atph_reqpkt != NULL ) ? 1: 0, respcount );
}
-#endif EBUG
+#endif /* EBUG */
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;
free_list = bp;
#ifdef EBUG
--numbufs;
-#endif EBUG
+#endif /* EBUG */
return 0;
}