MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Stream_Read

Function Stream_Read

src/Stream.c:11–23  ·  view source on GitHub ↗

#######################################################################################################################* *---------------------------------------------------------Stream----------------------------------------------------------* *#########################################################################################################################*/

Source from the content-addressed store, hash-verified

9*---------------------------------------------------------Stream----------------------------------------------------------*
10*#########################################################################################################################*/
11cc_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
25cc_result Stream_Write(struct Stream* s, const cc_uint8* buffer, cc_uint32 count) {
26 cc_uint32 write;

Callers 15

ZipEntry_ExtractDataFunction · 0.85
Stream_ReadU32_LEFunction · 0.85
Stream_ReadU32_BEFunction · 0.85
GetMachineIDFunction · 0.85
Ogg_NextPageFunction · 0.85
SysFont_ReadFunction · 0.85
Sound_ReadWaveDataFunction · 0.85
Map_ReadBlocksFunction · 0.85
Lvl_ReadCustomBlocksFunction · 0.85
Lvl_LoadFunction · 0.85
Fcm_ReadStringFunction · 0.85
Fcm_LoadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected