MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / BREFILL

Function BREFILL

src/IO/rply.c:307–322  ·  view source on GitHub ↗

refills the buffer */

Source from the content-addressed store, hash-verified

305
306/* refills the buffer */
307static int BREFILL(p_ply ply) {
308 /* move untouched data to beginning of buffer */
309 size_t size = BSIZE(ply);
310 memmove(ply->buffer, BFIRST(ply), size);
311 ply->buffer_last = size;
312 ply->buffer_first = ply->buffer_token = 0;
313 /* fill remaining with new data */
314 size = fread(ply->buffer+size, 1, BUFFERSIZE-size-1, ply->fp);
315 /* place sentinel so we can use str* functions with buffer */
316 ply->buffer[BUFFERSIZE-1] = '\0';
317 /* check if read failed */
318 if (size <= 0) return 0;
319 /* increase size to account for new data */
320 ply->buffer_last += size;
321 return 1;
322}
323
324/* We don't care about end-of-line, generally, because we
325 * separate words by any white-space character.

Callers 4

ply_read_header_magicFunction · 0.85
ply_read_headerFunction · 0.85
ply_read_wordFunction · 0.85
ply_read_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected