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