diff options
author | james <> | 2008-02-13 16:57:29 +0000 |
---|---|---|
committer | james <> | 2008-02-13 16:57:29 +0000 |
commit | e32ce0cfdccf5240ae29ef06a13078ae37ee521a (patch) | |
tree | f036688b6831dd6fd288df03023950597987c031 /src/ring.c | |
parent | 23dc931ca671e938da071d24d8e9b6052e49923a (diff) | |
download | sympathy-e32ce0cfdccf5240ae29ef06a13078ae37ee521a.tar.gz sympathy-e32ce0cfdccf5240ae29ef06a13078ae37ee521a.tar.bz2 sympathy-e32ce0cfdccf5240ae29ef06a13078ae37ee521a.zip |
*** empty log message ***
Diffstat (limited to 'src/ring.c')
-rw-r--r-- | src/ring.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -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 * |