Lines Matching refs:buf

227     char* buf = (char*)malloc(bufsize);
241 free(buf);
251 free(buf);
257 while ((amt = read(fd, buf, bufsize)) != 0 && bytesLeft > 0) {
262 err = dataStream->WriteEntityData(buf, amt);
264 free(buf);
272 memset(buf, 0, bufsize);
276 err = dataStream->WriteEntityData(buf, amt);
278 free(buf);
287 free(buf);
318 char* buf = (char*)malloc(bufsize);
323 while ((amt = read(fd, buf, bufsize)) != 0) {
324 crc = crc32(crc, (Bytef*)buf, amt);
327 free(buf);
457 static void calc_tar_checksum(char* buf) {
459 memset(buf + 148, ' ', 8);
462 for (uint8_t* p = (uint8_t*) buf; p < ((uint8_t*)buf) + 512; p++) {
468 sprintf(buf + 148, "%06o", sum); // the trailing space is already in place
472 static int write_pax_header_entry(char* buf, const char* key, const char* value) {
481 return sprintf(buf, "%d %s=%s\n", len, key, value);
549 char* buf = (char *)calloc(1,BUFSIZE);
550 char* paxHeader = buf + 512; // use a different chunk of it as separate scratch
551 char* paxData = buf + 1024;
553 if (buf == NULL) {
560 strcat(buf + 257, "ustar");
561 strcat(buf + 263, "00");
567 snprintf(buf + 100, 8, "%06o ", s.st_mode & ~S_IFMT);
571 snprintf(buf + 108, 8, "0%lo", s.st_uid);
572 snprintf(buf + 116, 8, "0%lo", s.st_gid);
579 snprintf(buf + 124, 12, "%011llo", (isdir) ? 0LL : s.st_size);
582 snprintf(buf + 136, 12, "%0lo", s.st_mtime);
594 buf[156] = type;
619 strncpy(buf, relpath.string(), 100);
620 strncpy(buf + 345, prefix.string(), 155);
622 strncpy(buf, fullname.string(), 100);
637 memset(paxData, 0, BUFSIZE - (paxData - buf));
652 memcpy(paxHeader, buf, 512);
676 calc_tar_checksum(buf);
677 send_tarfile_chunk(writer, buf, 512);
685 ssize_t nRead = read(fd, buf, toRead);
704 memset(buf + nRead, 0, remainder);
707 send_tarfile_chunk(writer, buf, nRead);
713 delete [] buf;
742 void* buf = m_buf;
782 while ((amt = in->ReadEntityData(buf, RESTORE_BUF_SIZE)) > 0) {
783 err = write(fd, buf, amt);
789 crc = crc32(crc, (Bytef*)buf, amt);
1198 char* buf = (char*)malloc(bufSize);
1239 nRead = reader.ReadEntityData(buf, bufSize);
1246 if (0 != memcmp(buf, str, bufSize)) {
1248 "%02x %02x %02x %02x '%c%c%c%c'\n", str, buf[0], buf[1], buf[2], buf[3],
1249 buf[0], buf[1], buf[2], buf[3]);
1260 free(buf);