=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/telnet/ring.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/telnet/ring.c 2014/07/20 10:32:23 1.10 --- src/usr.bin/telnet/ring.c 2014/07/22 07:30:24 1.11 *************** *** 1,4 **** ! /* $OpenBSD: ring.c,v 1.10 2014/07/20 10:32:23 jsg Exp $ */ /* $NetBSD: ring.c,v 1.7 1996/02/28 21:04:07 thorpej Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: ring.c,v 1.11 2014/07/22 07:30:24 jsg Exp $ */ /* $NetBSD: ring.c,v 1.7 1996/02/28 21:04:07 thorpej Exp $ */ /* *************** *** 71,86 **** ((d)->supplytime > (d)->consumetime)) - - - /* Buffer state transition routines */ void ! ring_init(ring, buffer, count) ! Ring *ring; ! unsigned char *buffer; ! int count; { memset(ring, 0, sizeof *ring); --- 71,80 ---- ((d)->supplytime > (d)->consumetime)) /* Buffer state transition routines */ void ! ring_init(Ring *ring, unsigned char *buffer, int count) { memset(ring, 0, sizeof *ring); *************** *** 97,105 **** * Mark the most recently supplied byte. */ ! void ! ring_mark(ring) ! Ring *ring; { ring->mark = ring_decrement(ring, ring->supply, 1); } --- 91,98 ---- * Mark the most recently supplied byte. */ ! void ! ring_mark(Ring *ring) { ring->mark = ring_decrement(ring, ring->supply, 1); } *************** *** 108,116 **** * Is the ring pointing to the mark? */ ! int ! ring_at_mark(ring) ! Ring *ring; { if (ring->mark == ring->consume) { return 1; --- 101,108 ---- * Is the ring pointing to the mark? */ ! int ! ring_at_mark(Ring *ring) { if (ring->mark == ring->consume) { return 1; *************** *** 123,131 **** * Clear any mark set on the ring. */ ! void ! ring_clear_mark(ring) ! Ring *ring; { ring->mark = NULL; } --- 115,122 ---- * Clear any mark set on the ring. */ ! void ! ring_clear_mark(Ring *ring) { ring->mark = NULL; } *************** *** 133,142 **** /* * Add characters from current segment to ring buffer. */ ! void ! ring_supplied(ring, count) ! Ring *ring; ! int count; { ring->supply = ring_increment(ring, ring->supply, count); ring->supplytime = ++ring_clock; --- 124,131 ---- /* * Add characters from current segment to ring buffer. */ ! void ! ring_supplied(Ring *ring, int count) { ring->supply = ring_increment(ring, ring->supply, count); ring->supplytime = ++ring_clock; *************** *** 145,154 **** /* * We have just consumed "c" bytes. */ ! void ! ring_consumed(ring, count) ! Ring *ring; ! int count; { if (count == 0) /* don't update anything */ return; --- 134,141 ---- /* * We have just consumed "c" bytes. */ ! void ! ring_consumed(Ring *ring, int count) { if (count == 0) /* don't update anything */ return; *************** *** 168,181 **** } - /* Buffer state query routines */ /* Number of bytes that may be supplied */ ! int ! ring_empty_count(ring) ! Ring *ring; { if (ring_empty(ring)) { /* if empty */ return ring->size; --- 155,166 ---- } /* Buffer state query routines */ /* Number of bytes that may be supplied */ ! int ! ring_empty_count(Ring *ring) { if (ring_empty(ring)) { /* if empty */ return ring->size; *************** *** 185,193 **** } /* number of CONSECUTIVE bytes that may be supplied */ ! int ! ring_empty_consecutive(ring) ! Ring *ring; { if ((ring->consume < ring->supply) || ring_empty(ring)) { /* --- 170,177 ---- } /* number of CONSECUTIVE bytes that may be supplied */ ! int ! ring_empty_consecutive(Ring *ring) { if ((ring->consume < ring->supply) || ring_empty(ring)) { /* *************** *** 207,215 **** * (but don't give more than enough to get to cross over set mark) */ ! int ! ring_full_count(ring) ! Ring *ring; { if ((ring->mark == NULL) || (ring->mark == ring->consume)) { if (ring_full(ring)) { --- 191,198 ---- * (but don't give more than enough to get to cross over set mark) */ ! int ! ring_full_count(Ring *ring) { if ((ring->mark == NULL) || (ring->mark == ring->consume)) { if (ring_full(ring)) { *************** *** 226,234 **** * Return the number of CONSECUTIVE bytes available for consuming. * However, don't return more than enough to cross over set mark. */ ! int ! ring_full_consecutive(ring) ! Ring *ring; { if ((ring->mark == NULL) || (ring->mark == ring->consume)) { if ((ring->supply < ring->consume) || ring_full(ring)) { --- 209,216 ---- * Return the number of CONSECUTIVE bytes available for consuming. * However, don't return more than enough to cross over set mark. */ ! int ! ring_full_consecutive(Ring *ring) { if ((ring->mark == NULL) || (ring->mark == ring->consume)) { if ((ring->supply < ring->consume) || ring_full(ring)) { *************** *** 248,258 **** /* * Move data into the "supply" portion of of the ring buffer. */ ! void ! ring_supply_data(ring, buffer, count) ! Ring *ring; ! unsigned char *buffer; ! int count; { int i; --- 230,237 ---- /* * Move data into the "supply" portion of of the ring buffer. */ ! void ! ring_supply_data(Ring *ring, unsigned char *buffer, int count) { int i;