MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / lufread

Function lufread

src/Setup/unzip.cpp:2687–2698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2685
2686
2687size_t lufread(void *ptr,size_t size,size_t n,LUFILE *stream)
2688{ unsigned int toread = (unsigned int)(size*n);
2689 if (stream->is_handle)
2690 { DWORD red; BOOL res = ReadFile(stream->h,ptr,toread,&red,NULL);
2691 if (!res) stream->herr=true;
2692 return red/size;
2693 }
2694 if (stream->pos+toread > stream->len) toread = stream->len-stream->pos;
2695 memcpy(ptr, (char*)stream->buf + stream->pos, toread); DWORD red = toread;
2696 stream->pos += red;
2697 return red/size;
2698}
2699
2700
2701

Callers 7

unzlocal_getByteFunction · 0.85
unzReadCurrentFileFunction · 0.85
unzGetLocalExtrafieldFunction · 0.85
unzGetGlobalCommentFunction · 0.85
GetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected