aboutsummaryrefslogtreecommitdiffstats
path: root/src/ring.c
diff options
context:
space:
mode:
authorjames <>2008-02-13 16:57:29 +0000
committerjames <>2008-02-13 16:57:29 +0000
commite32ce0cfdccf5240ae29ef06a13078ae37ee521a (patch)
treef036688b6831dd6fd288df03023950597987c031 /src/ring.c
parent23dc931ca671e938da071d24d8e9b6052e49923a (diff)
downloadsympathy-e32ce0cfdccf5240ae29ef06a13078ae37ee521a.tar.gz
sympathy-e32ce0cfdccf5240ae29ef06a13078ae37ee521a.tar.bz2
sympathy-e32ce0cfdccf5240ae29ef06a13078ae37ee521a.zip
*** empty log message ***
Diffstat (limited to 'src/ring.c')
-rw-r--r--src/ring.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/ring.c b/src/ring.c
index ccd97ed..ca412ab 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.4 2008/02/13 16:57:29 james
+ * *** empty log message ***
+ *
* Revision 1.3 2008/02/13 09:12:21 james
* *** empty log message ***
*
@@ -59,6 +62,27 @@ ring_write (Ring * r, void *b, int n)
return writ;
}
+int
+ring_space (Ring * r)
+{
+ int i;
+
+ i = r->size - RING_NEXT_W (r) + r->rptr;
+ i %= r->size;
+ return i;
+}
+
+int
+ring_bytes (Ring * r)
+{
+ int i;
+
+ i = r->size + r->wptr - r->rptr;
+ i %= r->size;
+ return i;
+}
+
+
Ring *