Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 63) sorted by relevance

123

/build/make/tools/ziptime/
DZipEntry.cpp89 uint8_t buf[kLFHLen]; in rewrite() local
91 if (fread(buf, 1, kLFHLen, fp) != kLFHLen) in rewrite()
94 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in rewrite()
99 ZipEntry::putShortLE(&buf[0x0a], STATIC_TIME); in rewrite()
100 ZipEntry::putShortLE(&buf[0x0c], STATIC_DATE); in rewrite()
105 if (fwrite(buf, 1, kLFHLen, fp) != kLFHLen) in rewrite()
126 uint8_t buf[kCDELen]; in rewrite() local
129 if (fread(buf, 1, kCDELen, fp) != kCDELen) in rewrite()
132 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in rewrite()
137 ZipEntry::putShortLE(&buf[0x0c], STATIC_TIME); in rewrite()
[all …]
DZipEntry.h53 static inline uint16_t getShortLE(const uint8_t* buf) { in getShortLE() argument
54 return buf[0] | (buf[1] << 8); in getShortLE()
56 static inline uint32_t getLongLE(const uint8_t* buf) { in getLongLE() argument
57 return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); in getLongLE()
59 static inline void putShortLE(uint8_t* buf, uint16_t val) { in putShortLE() argument
60 buf[0] = (uint8_t) val; in putShortLE()
61 buf[1] = (uint8_t) (val >> 8); in putShortLE()
DZipFile.cpp76 uint8_t* buf = NULL; in rewriteCentralDir() local
92 buf = new uint8_t[EndOfCentralDir::kMaxEOCDSearch]; in rewriteCentralDir()
93 if (buf == NULL) { in rewriteCentralDir()
114 if (fread(buf, 1, readAmount, mZipFp) != (size_t) readAmount) { in rewriteCentralDir()
122 if (buf[i] == 0x50 && in rewriteCentralDir()
123 ZipEntry::getLongLE(&buf[i]) == EndOfCentralDir::kSignature) in rewriteCentralDir()
135 result = mEOCD.readBuf(buf + i, readAmount - i); in rewriteCentralDir()
196 delete[] buf; in rewriteCentralDir()
212 status_t ZipFile::EndOfCentralDir::readBuf(const uint8_t* buf, int len) in readBuf() argument
224 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) in readBuf()
[all …]
/build/make/tools/zipalign/
DZipEntry.cpp407 uint8_t buf[kLFHLen]; in read() local
412 if (fread(buf, 1, kLFHLen, fp) != kLFHLen) { in read()
417 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in read()
423 mVersionToExtract = ZipEntry::getShortLE(&buf[0x04]); in read()
424 mGPBitFlag = ZipEntry::getShortLE(&buf[0x06]); in read()
425 mCompressionMethod = ZipEntry::getShortLE(&buf[0x08]); in read()
426 mLastModFileTime = ZipEntry::getShortLE(&buf[0x0a]); in read()
427 mLastModFileDate = ZipEntry::getShortLE(&buf[0x0c]); in read()
428 mCRC32 = ZipEntry::getLongLE(&buf[0x0e]); in read()
429 mCompressedSize = ZipEntry::getLongLE(&buf[0x12]); in read()
[all …]
DZipEntry.h113 static inline uint16_t getShortLE(const uint8_t* buf) { in getShortLE() argument
114 return buf[0] | (buf[1] << 8); in getShortLE()
116 static inline uint32_t getLongLE(const uint8_t* buf) { in getLongLE() argument
117 return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); in getLongLE()
119 static inline void putShortLE(uint8_t* buf, uint16_t val) { in putShortLE() argument
120 buf[0] = (uint8_t) val; in putShortLE()
121 buf[1] = (uint8_t) (val >> 8); in putShortLE()
123 static inline void putLongLE(uint8_t* buf, uint32_t val) { in putLongLE() argument
124 buf[0] = (uint8_t) val; in putLongLE()
125 buf[1] = (uint8_t) (val >> 8); in putLongLE()
[all …]
DZipFile.cpp209 uint8_t* buf = NULL; in readCentralDir() local
225 buf = new uint8_t[EndOfCentralDir::kMaxEOCDSearch]; in readCentralDir()
226 if (buf == NULL) { in readCentralDir()
247 if (fread(buf, 1, readAmount, mZipFp) != (size_t) readAmount) { in readCentralDir()
255 if (buf[i] == 0x50 && in readCentralDir()
256 ZipEntry::getLongLE(&buf[i]) == EndOfCentralDir::kSignature) in readCentralDir()
269 result = mEOCD.readBuf(buf + i, readAmount - i); in readCentralDir()
343 delete[] buf; in readCentralDir()
678 void *buf = pSourceZip->uncompress(pSourceEntry); in addRecompress() local
679 if (buf == NULL) { in addRecompress()
[all …]
/build/soong/ui/terminal/
Dformat.go59 buf := &strings.Builder{}
63 buf.WriteByte(c)
69 buf.WriteByte(c)
76 buf.WriteByte(c)
78 fmt.Fprintf(buf, "%d", counts.StartedActions)
80 fmt.Fprintf(buf, "%d", counts.TotalActions)
82 fmt.Fprintf(buf, "%d", counts.RunningActions)
84 fmt.Fprintf(buf, "%d", counts.TotalActions-counts.StartedActions)
86 fmt.Fprintf(buf, "%d", counts.FinishedActions)
88 fmt.Fprintf(buf, "%.1f", float64(counts.FinishedActions)/time.Since(s.start).Seconds())
[all …]
/build/soong/third_party/zip/
Dzip_test.go25 buf := new(bytes.Buffer)
26 w := NewWriter(buf)
40 s := buf.String()
123 buf []repeatedByte member
127 if len(r.buf) == 0 {
130 last := &r.buf[len(r.buf)-1]
136 if len(r.buf) > 0 {
137 rp = &r.buf[len(r.buf)-1]
156 r.buf = append(r.buf, repeatedByte{r.Size(), b, 1})
157 rp = &r.buf[len(r.buf)-1]
[all …]
Dwriter_test.go69 buf := new(bytes.Buffer)
70 w := NewWriter(buf)
81 r, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))
101 buf := new(bytes.Buffer)
103 n, _ := buf.Write(existingData)
104 w := NewWriter(buf)
116 r, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))
126 var buf bytes.Buffer
127 w := NewWriter(struct{ io.Writer }{&buf})
132 if buf.Len() > 0 {
[all …]
Dreader.go93 buf := bufio.NewReader(rs)
101 err = readDirectoryHeader(f, buf)
232 var buf [fileHeaderLen]byte
233 if _, err := f.zipr.ReadAt(buf[:], f.headerOffset); err != nil {
236 b := readBuf(buf[:])
250 var buf [directoryHeaderLen]byte
251 if _, err := io.ReadFull(r, buf[:]); err != nil {
254 b := readBuf(buf[:])
350 var buf [dataDescriptorLen]byte
362 if _, err := io.ReadFull(r, buf[:4]); err != nil {
[all …]
Dwriter.go71 var buf [directoryHeaderLen]byte
72 b := writeBuf(buf[:])
89 var buf [28]byte // 2x uint16 + 3x uint64
90 eb := writeBuf(buf[:])
96 h.Extra = append(h.Extra, buf[:]...)
111 if _, err := w.cw.Write(buf[:]); err != nil {
131 var buf [directory64EndLen + directory64LocLen]byte
132 b := writeBuf(buf[:])
152 if _, err := w.cw.Write(buf[:]); err != nil {
164 var buf [directoryEndLen]byte
[all …]
Dandroid.go58 var buf []byte
60 buf = make([]byte, dataDescriptor64Len)
62 buf = make([]byte, dataDescriptorLen)
64 b := writeBuf(buf)
74 _, err = w.cw.Write(buf)
206 var buf []byte
208 buf = make([]byte, dataDescriptor64Len)
210 buf = make([]byte, dataDescriptorLen)
212 b := writeBuf(buf)
222 _, err := w.zipw.Write(buf)
Dexample_test.go19 buf := new(bytes.Buffer)
22 w := zip.NewWriter(buf)
82 buf := new(bytes.Buffer)
85 w := zip.NewWriter(buf)
/build/soong/finder/fs/
Dreaddir.go43 buf := make([]byte, blockSize)
47 n, errno := syscall.ReadDirent(fd, buf)
56 entries = parseDirent(buf[:n], entries)
81 func parseDirent(buf []byte, entries []*dirEntryInfo) []*dirEntryInfo {
82 for len(buf) > 0 {
83 reclen, ok := direntReclen(buf)
84 if !ok || reclen > uint64(len(buf)) {
87 rec := buf[:reclen]
88 buf = buf[reclen:]
125 func direntIno(buf []byte) (uint64, bool) {
[all …]
/build/soong/symbol_inject/
Dsymbol_inject_test.go27 buf string
32 buf: "A",
37 buf: "B",
42 buf: "Z",
51 copyAndInject(in, out, testCase.offset, []byte(testCase.buf))
Dsymbol_inject.go79 buf := make([]byte, size)
80 copy(buf, value)
82 return copyAndInject(file.r, w, offset, buf)
95 buf := make([]byte, 8)
96 binary.LittleEndian.PutUint64(buf, value)
98 return copyAndInject(file.r, w, offset, buf)
101 func copyAndInject(r io.ReaderAt, w io.Writer, offset uint64, buf []byte) (err error) {
107 _, err = w.Write(buf)
111 pos := int64(offset) + int64(len(buf))
/build/soong/cmd/diff_target_files/
Dcompare.go59 buf := &bytes.Buffer{}
70 must(fmt.Fprintln(buf, "files modified:"))
72 …must(fmt.Fprintf(buf, " %v (%v bytes -> %v bytes)\n", f[0].Name, f[0].UncompressedSize64, f[1].U…
78 must(fmt.Fprintln(buf, "files removed:"))
80 must(fmt.Fprintf(buf, " - %v (%v bytes)\n", f.Name, f.UncompressedSize64))
86 must(fmt.Fprintln(buf, "files added:"))
88 must(fmt.Fprintf(buf, " + %v (%v bytes)\n", f.Name, f.UncompressedSize64))
94 must(fmt.Fprintf(buf, "total size change: %v bytes\n", sizeChange))
97 return buf.String()
/build/soong/android/
Dexpand.go46 buf := make([]byte, 0, 2*len(s))
53 buf = append(buf, s[i:j]...)
61 buf = append(buf, value...)
66 return string(buf) + s[i:], nil
Dmakevars.go231 buf := &bytes.Buffer{}
233 fmt.Fprint(buf, `# Autogenerated file
277 fmt.Fprintf(buf, "SOONG_%s := %s\n", v.name, v.value)
278 …fmt.Fprintf(buf, "$(eval $(call soong-compare-var,%s,%s,my_check_failed := true))\n\n", v.name, so…
281 fmt.Fprint(buf, `
300 fmt.Fprintf(buf, "SOONG_%s := %s\n", v.name, v.value)
301 fmt.Fprintf(buf, "$(eval $(call soong-compare-var,%s,%s))\n\n", v.name, sort)
304 fmt.Fprintln(buf, "\nsoong-compare-var :=")
306 fmt.Fprintln(buf)
308 return buf.Bytes()
[all …]
/build/soong/ui/status/
Dkati.go39 buf strings.Builder member
55 Output: k.buf.String(),
59 k.buf.Reset()
104 k.buf.WriteString(line)
105 k.buf.WriteString("\n")
132 var buf strings.Builder
133 io.Copy(&buf, pipe)
135 st.Print(buf.String())
/build/soong/cmd/extract_linker/
Dmain_test.go56 buf := bytes.Buffer{}
57 bytesToAsm(&buf, testcase.in)
58 if buf.String() != testcase.out {
59 t.Errorf("input: %#v\n want: %q\n got: %q\n", testcase.in, testcase.out, buf.String())
/build/blueprint/loadplugins/
Dloadplugins.go40 buf := &bytes.Buffer{}
42 err := pluginTmpl.Execute(buf, struct {
53 err = ioutil.WriteFile(*output, buf.Bytes(), 0666)
/build/soong/java/
Dkotlin.go220 buf := &bytes.Buffer{}
222 binary.Write(buf, binary.BigEndian, uint32(len(options)))
224 binary.Write(buf, binary.BigEndian, uint16(len(option[0])))
225 buf.WriteString(option[0])
226 binary.Write(buf, binary.BigEndian, uint16(len(option[1])))
227 buf.WriteString(option[1])
233 if buf.Len() < 256 {
235 header.WriteByte(byte(buf.Len()))
238 binary.Write(header, binary.BigEndian, uint32(buf.Len()))
241 return base64.StdEncoding.EncodeToString(append(header.Bytes(), buf.Bytes()...))
/build/soong/ui/build/
Dsoong.go66 var buf strings.Builder
67 cmd.Stdout = &buf
68 cmd.Stderr = &buf
74 if buf.Len() > 0 {
75 ctx.Verboseln(buf.String())
156 buf, err := ioutil.ReadFile(soongBuildMetricsFile)
161 err = proto.Unmarshal(buf, soongBuildMetrics)
/build/blueprint/parser/
Dmodify_test.go58 buf := new(bytes.Buffer)
59 patchlist.Apply(bytes.NewReader(in), buf)
61 got := buf.String()

123