...return 0; /* return 0 if insert item successful */ } else { return -1; /* return error if insert failure or buffer full */ } } /* remove item from the buffer */ int remove_item(buffer_item *outData) { /* define the remove item method */ if(counter > 0) { /* if buffer have items, remove items from buffer */ *outData = buffer[(counter-1)]; counter--; /* decrease the buffer counter */ return 0; /* return 0 if remove item successful */ } else { return -1; /* return error if insert failure or buffer full */ }...
Words: 532 - Pages: 3