--- margi2/ringbuffy.c 2001/08/05 11:02:13 1.4 +++ margi2/ringbuffy.c 2002/02/05 09:49:00 1.5 @@ -89,40 +89,6 @@ int ring_write(ringbuffy *rbuf, const ch } -int ring_writek(ringbuffy *rbuf, const char *data, int count) -{ - - long diff, free, pos, rest; - - - if (count <=0 || !rbuf->buffy) return 0; - pos = rbuf->write_pos; - rest = rbuf->size - pos; - diff = rbuf->read_pos - pos; - free = (diff > 0) ? diff-4 : rbuf->size+diff-4; - - if ( free <= 0 ) return 0; - if ( free < count ) count = free; - - if (count >= rest){ - if(memcpy(rbuf->buffy+pos, data, rest)) - return -EFAULT; - if (count - rest) - if(memcpy(rbuf->buffy, data+rest, - count - rest)) - return -EFAULT; - rbuf->write_pos = count - rest; - } else { - memcpy(rbuf->buffy+pos, data, count); - rbuf->write_pos += count; - } - - return count; -} - - - - int ring_read(ringbuffy *rbuf, char *data, int count) {