src/lib/ppc405lib/string_stream.c
// Write the area (if any) from the write pointer to the read pointer
Write the area (if any) from the write pointer to the read pointer
Write the area ( if any ) from the write pointer to the read pointer
static size_t
write_head(StringStream* string, const void* buf, size_t size)
{
    size_t written, remainder;
    written = 0;
    if (string->next_read > string->next_write) {
        remainder = string->next_read - string->next_write;
        written = MIN(size, remainder);
        memcpy((void *)(&(string->data[string->next_write])), buf, written);
        string->next_write += written;
    }
    return written;
}
static size_t write_head ( StringStream * string , const void * buf , size_t size ) { size_t written , remainder ; written = 0 ; if ( string -> next_read > string -> next_write ) { remainder = string -> next_read - string -> next_write ; written = MIN ( size , remainder ) ; memcpy ( ( void * ) ( & ( string -> data [ string -> next_write ] ) ) , buf , written ) ; string -> next_write += written ; } return written ; }
Write the area (if any) from the write pointer to the read pointer
Write the area ( if any ) from the write pointer to the read pointer