Lines Matching refs:nbytes
49 static int fmemopen_read(void *cookie, char *buf, int nbytes);
50 static int fmemopen_write(void *cookie, const char *buf, int nbytes);
167 fmemopen_read(void *cookie, char *buf, int nbytes) in fmemopen_read() argument
171 if (nbytes > ck->len - ck->off) in fmemopen_read()
172 nbytes = ck->len - ck->off; in fmemopen_read()
174 if (nbytes == 0) in fmemopen_read()
177 memcpy(buf, ck->buf + ck->off, nbytes); in fmemopen_read()
179 ck->off += nbytes; in fmemopen_read()
181 return (nbytes); in fmemopen_read()
185 fmemopen_write(void *cookie, const char *buf, int nbytes) in fmemopen_write() argument
189 if (nbytes > ck->size - ck->off) in fmemopen_write()
190 nbytes = ck->size - ck->off; in fmemopen_write()
192 if (nbytes == 0) in fmemopen_write()
195 memcpy(ck->buf + ck->off, buf, nbytes); in fmemopen_write()
197 ck->off += nbytes; in fmemopen_write()
211 return (nbytes); in fmemopen_write()