Lines Matching refs:buf

224     char* buf = (char*)malloc(bufsize);
236 free(buf);
246 free(buf);
252 while ((amt = read(fd, buf, bufsize)) != 0 && bytesLeft > 0) {
257 err = dataStream->WriteEntityData(buf, amt);
259 free(buf);
267 memset(buf, 0, bufsize);
271 err = dataStream->WriteEntityData(buf, amt);
273 free(buf);
282 free(buf);
317 char* buf = (char*)malloc(bufsize);
322 while ((amt = read(fd, buf, bufsize)) != 0) {
323 crc = crc32(crc, (Bytef*)buf, amt);
327 free(buf);
445 static void calc_tar_checksum(char* buf) {
447 memset(buf + 148, ' ', 8);
450 for (uint8_t* p = (uint8_t*) buf; p < ((uint8_t*)buf) + 512; p++) {
456 sprintf(buf + 148, "%06o", sum); // the trailing space is already in place
460 static int write_pax_header_entry(char* buf, const char* key, const char* value) {
469 return sprintf(buf, "%d %s=%s\n", len, key, value);
552 char* buf = (char *)calloc(1,BUFSIZE);
553 char* paxHeader = buf + 512; // use a different chunk of it as separate scratch
554 char* paxData = buf + 1024;
556 if (buf == NULL) {
563 strcat(buf + 257, "ustar");
564 strcat(buf + 263, "00");
570 snprintf(buf + 100, 8, "%06o ", s.st_mode & ~S_IFMT);
574 snprintf(buf + 108, 8, "0%lo", (unsigned long)s.st_uid);
575 snprintf(buf + 116, 8, "0%lo", (unsigned long)s.st_gid);
578 snprintf(buf + 124, 12, "%011llo", (isdir) ? 0LL : s.st_size);
581 snprintf(buf + 136, 12, "%0lo", (unsigned long)s.st_mtime);
593 buf[156] = type;
618 strncpy(buf, relpath.string(), 100);
619 strncpy(buf + 345, prefix.string(), 155);
621 strncpy(buf, fullname.string(), 100);
636 memset(paxData, 0, BUFSIZE - (paxData - buf));
650 memcpy(paxHeader, buf, 512);
674 calc_tar_checksum(buf);
675 send_tarfile_chunk(writer, buf, 512);
686 ssize_t nRead = read(fd, buf, toRead);
705 memset(buf + nRead, 0, remainder);
708 send_tarfile_chunk(writer, buf, nRead);
714 free(buf);
743 void* buf = m_buf;
783 while ((amt = in->ReadEntityData(buf, RESTORE_BUF_SIZE)) > 0) {
784 err = write(fd, buf, amt);
790 crc = crc32(crc, (Bytef*)buf, amt);
1199 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);