Home
last modified time | relevance | path

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

123

/build/kati/
Dbuf.go67 buf []byte member
72 b.buf = append(b.buf, data...)
77 b.buf = append(b.buf, c)
82 b.buf = append(b.buf, []byte(s)...)
86 func (b *buffer) Bytes() []byte { return b.buf }
87 func (b *buffer) Len() int { return len(b.buf) }
88 func (b *buffer) String() string { return string(b.buf) }
91 if b.buf == nil {
92 b.buf = b.bootstrap[:0]
94 b.buf = b.buf[:0]
[all …]
Dstrutil.go348 var buf []byte
362 if buf == nil {
363 buf = make([]byte, len(line))
364 copy(buf, line)
365 line = buf
378 buf := []byte(line)
379 for i := 0; i < len(buf); i++ {
380 if buf[i] == '\n' && i+1 < len(buf) && buf[i+1] == '\t' {
381 copy(buf[i+1:], buf[i+2:])
382 buf = buf[:len(buf)-1]
[all …]
Dfunc_test.go29 var buf evalBuffer
33 buf.Reset()
34 strip.Eval(&buf, ev)
48 var buf evalBuffer
52 buf.Reset()
53 sort.Eval(&buf, ev)
69 var buf evalBuffer
73 buf.Reset()
74 patsubst.Eval(&buf, ev)
Deval.go183 func (ev *Evaluator) args(buf *evalBuffer, args ...Value) ([][]byte, error) {
186 buf.resetSep()
187 err := arg.Eval(buf, ev)
191 pos = append(pos, buf.Len())
193 v := buf.Bytes()
194 buf.args = buf.args[:0]
197 buf.args = append(buf.args, v[s:p])
200 return buf.args, nil
229 buf := newEbuf()
230 err := v.Eval(buf, ev)
[all …]
Dninja.go199 var buf bytes.Buffer
241 buf.WriteRune(c)
243 return buf.String()
267 var buf bytes.Buffer
273 buf.WriteRune(c)
278 buf.WriteRune(c)
286 buf.WriteRune(c)
295 buf.WriteRune(c)
298 return buf.String(), true
304 var buf bytes.Buffer
[all …]
Dexpr.go158 buf := newEbuf()
159 err := v.varname.Eval(buf, ev)
163 vv := ev.LookupVar(buf.String())
164 buf.release()
239 buf := newEbuf()
240 params, err := ev.args(buf, v.varname, v.pat, v.subst)
247 buf.Reset()
249 err = vv.Eval(buf, ev)
253 vals := splitSpaces(buf.String())
254 buf.release()
[all …]
Dtestutil.h33 static char buf[64]; in GetStringPiece() local
34 sprintf(buf, "%zd", v); in GetStringPiece()
35 return buf; in GetStringPiece()
Dshellutil_test.go36 buf := []byte(tc.in)
37 rot13(buf)
38 if got, want := string(buf), tc.want; got != want {
Dcommand.cc138 string buf; in Eval() local
139 wrapped_->Eval(ev, &buf); in Eval()
141 for (StringPiece tok : WordScanner(buf)) { in Eval()
147 string buf; in Eval() local
148 wrapped_->Eval(ev, &buf); in Eval()
150 for (StringPiece tok : WordScanner(buf)) { in Eval()
Dfileutil.cc86 char buf[4096]; in RunCommand() local
87 ssize_t r = read(pipefd[0], buf, 4096); in RunCommand()
92 s->append(buf, buf+r); in RunCommand()
Dast.go57 var buf evalBuffer
58 buf.resetSep()
59 err := v.Eval(&buf, ev)
63 return &simpleVar{value: []string{buf.String()}, origin: origin}, nil
Dparser.h29 void Parse(StringPiece buf, const Loc& loc, vector<Stmt*>* out_asts);
30 void ParseNotAfterRule(StringPiece buf, const Loc& loc,
Dstrutil.cc366 char buf[PATH_MAX]; in AbsPath() local
367 if (!getcwd(buf, PATH_MAX)) { in AbsPath()
372 CHECK(buf[0] == '/'); in AbsPath()
373 *o = buf; in AbsPath()
512 string buf; in EchoEscape() local
516 buf += "\\\\\\\\"; in EchoEscape()
519 buf += "\\n"; in EchoEscape()
522 buf += "\\\""; in EchoEscape()
525 buf += *in; in EchoEscape()
528 return buf; in EchoEscape()
Dstrutil_test.cc136 char buf[10] = {'f', 'o', '\\', '\0', 'x', 'y'}; in TestFindEndOfLine() local
137 ASSERT_EQ(FindEndOfLine(StringPiece(buf, 6), 0, &lf_cnt), 3); in TestFindEndOfLine()
138 ASSERT_EQ(FindEndOfLine(StringPiece(buf, 2), 0, &lf_cnt), 2); in TestFindEndOfLine()
/build/tools/zipalign/
DZipEntry.cpp405 uint8_t buf[kLFHLen]; in read() local
410 if (fread(buf, 1, kLFHLen, fp) != kLFHLen) { in read()
415 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in read()
421 mVersionToExtract = ZipEntry::getShortLE(&buf[0x04]); in read()
422 mGPBitFlag = ZipEntry::getShortLE(&buf[0x06]); in read()
423 mCompressionMethod = ZipEntry::getShortLE(&buf[0x08]); in read()
424 mLastModFileTime = ZipEntry::getShortLE(&buf[0x0a]); in read()
425 mLastModFileDate = ZipEntry::getShortLE(&buf[0x0c]); in read()
426 mCRC32 = ZipEntry::getLongLE(&buf[0x0e]); in read()
427 mCompressedSize = ZipEntry::getLongLE(&buf[0x12]); in read()
[all …]
DZipEntry.h112 static inline uint16_t getShortLE(const uint8_t* buf) { in getShortLE() argument
113 return buf[0] | (buf[1] << 8); in getShortLE()
115 static inline uint32_t getLongLE(const uint8_t* buf) { in getLongLE() argument
116 return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); in getLongLE()
118 static inline void putShortLE(uint8_t* buf, uint16_t val) { in putShortLE() argument
119 buf[0] = (uint8_t) val; in putShortLE()
120 buf[1] = (uint8_t) (val >> 8); in putShortLE()
122 static inline void putLongLE(uint8_t* buf, uint32_t val) { in putLongLE() argument
123 buf[0] = (uint8_t) val; in putLongLE()
124 buf[1] = (uint8_t) (val >> 8); in putLongLE()
[all …]
DZipFile.cpp210 uint8_t* buf = NULL; in readCentralDir() local
226 buf = new uint8_t[EndOfCentralDir::kMaxEOCDSearch]; in readCentralDir()
227 if (buf == NULL) { in readCentralDir()
248 if (fread(buf, 1, readAmount, mZipFp) != (size_t) readAmount) { in readCentralDir()
256 if (buf[i] == 0x50 && in readCentralDir()
257 ZipEntry::getLongLE(&buf[i]) == EndOfCentralDir::kSignature) in readCentralDir()
270 result = mEOCD.readBuf(buf + i, readAmount - i); in readCentralDir()
344 delete[] buf; in readCentralDir()
710 void *buf = pSourceZip->uncompress(pSourceEntry); in addRecompress() local
711 if (buf == NULL) { in addRecompress()
[all …]
/build/tools/ziptime/
DZipEntry.cpp90 uint8_t buf[kLFHLen]; in rewrite() local
92 if (fread(buf, 1, kLFHLen, fp) != kLFHLen) in rewrite()
95 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in rewrite()
100 ZipEntry::putShortLE(&buf[0x0a], STATIC_TIME); in rewrite()
101 ZipEntry::putShortLE(&buf[0x0c], STATIC_DATE); in rewrite()
106 if (fwrite(buf, 1, kLFHLen, fp) != kLFHLen) in rewrite()
128 uint8_t buf[kCDELen]; in rewrite() local
131 if (fread(buf, 1, kCDELen, fp) != kCDELen) in rewrite()
134 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in rewrite()
139 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/soong/common/
Dandroidmk.go91 buf := &bytes.Buffer{}
93 fmt.Fprintln(buf, "LOCAL_PATH := $(TOP)")
94 fmt.Fprintln(buf, "LOCAL_MODULE_MAKEFILE := $(lastword $(MAKEFILE_LIST))")
97 err := translateAndroidMkModule(ctx, buf, mod)
107 matches := buf.Len() == len(data)
110 for i, value := range buf.Bytes() {
124 return ioutil.WriteFile(mkFile, buf.Bytes(), 0666)
/build/blueprint/loadplugins/
Dloadplugins.go40 buf := &bytes.Buffer{}
42 err := pluginTmpl.Execute(buf, struct {
53 err = ioutil.WriteFile(*output, buf.Bytes(), 0666)
/build/blueprint/
Dninja_writer_test.go111 buf := bytes.NewBuffer(nil)
112 w := newNinjaWriter(buf)
114 if buf.String() != testCase.output {
117 t.Errorf(" got: %q", buf.String())
/build/blueprint/gotestmain/
Dgotestmain.go66 buf := &bytes.Buffer{}
73 err := testMainTmpl.Execute(buf, d)
78 err = ioutil.WriteFile(*output, buf.Bytes(), 0666)
/build/tools/atree/
Dfiles.cpp186 char* buf = NULL; in read_list_file() local
216 buf = (char*)malloc(size+1); in read_list_file()
217 if (buf == NULL) { in read_list_file()
224 if (1 != fread(buf, size, 1, f)) { in read_list_file()
232 p = buf; in read_list_file()
233 q = buf+size; in read_list_file()
244 p = buf; in read_list_file()
320 if (buf != NULL) { in read_list_file()
321 free(buf); in read_list_file()

123