#######################################################################################################################* *---------------------------------------------------------Stream----------------------------------------------------------* *#########################################################################################################################*/
| 9 | *---------------------------------------------------------Stream----------------------------------------------------------* |
| 10 | *#########################################################################################################################*/ |
| 11 | cc_result Stream_Read(struct Stream* s, cc_uint8* buffer, cc_uint32 count) { |
| 12 | cc_uint32 read; |
| 13 | cc_result res; |
| 14 | |
| 15 | while (count) { |
| 16 | if ((res = s->Read(s, buffer, count, &read))) return res; |
| 17 | if (!read) return ERR_END_OF_STREAM; |
| 18 | |
| 19 | buffer += read; |
| 20 | count -= read; |
| 21 | } |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | cc_result Stream_Write(struct Stream* s, const cc_uint8* buffer, cc_uint32 count) { |
| 26 | cc_uint32 write; |
no outgoing calls
no test coverage detected