Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 746) sorted by relevance

12345678910>>...30

/system/core/toolbox/upstream-netbsd/usr.bin/grep/
Dfastgrep.c63 fg->len = strlen(pat); in fgrepcomp()
72 fg->qsBc[i] = fg->len; in fgrepcomp()
73 for (i = 1; i < fg->len; i++) in fgrepcomp()
74 fg->qsBc[fg->pattern[i]] = fg->len - i; in fgrepcomp()
91 fg->len = strlen(pat); in fastcomp()
98 if (fg->len > 0 && pat[fg->len - 1] == '$') { in fastcomp()
100 fg->len--; in fastcomp()
106 fg->len--; in fastcomp()
110 if (fg->len >= 14 && in fastcomp()
112 memcmp(pat + fg->len - 7, "[[:>:]]", 7) == 0) { in fastcomp()
[all …]
Dfile.c146 size_t len; in grep_fgetln() local
163 len = p - bufpos; in grep_fgetln()
164 grep_lnbufgrow(len + 1); in grep_fgetln()
165 memcpy(lnbuf, bufpos, len); in grep_fgetln()
166 lnbuf[len] = '\0'; in grep_fgetln()
167 *lenp = len; in grep_fgetln()
168 bufrem -= len; in grep_fgetln()
174 for (len = bufrem, off = 0; ; len += bufrem) { in grep_fgetln()
176 grep_lnbufgrow(len + LNBUFBUMP); in grep_fgetln()
177 memcpy(lnbuf + off, bufpos, len - off); in grep_fgetln()
[all …]
/system/bt/test/suite/rfcomm/
Drfcomm_unittest.cc34 size_t len = 0; in TEST_F() local
44 len = read(fd, &channel, sizeof(channel)); in TEST_F()
45 EXPECT_TRUE(len == sizeof(channel)) in TEST_F()
46 << "Channel not read from RFCOMM socket. Bytes read: " << len; in TEST_F()
47 len = read(fd, &signal, sizeof(signal)); in TEST_F()
48 EXPECT_TRUE(len == sizeof(signal)) in TEST_F()
49 << "Connection signal not read from RFCOMM socket. Bytes read: " << len; in TEST_F()
57 len = write(fd, HANDSHAKE_COMMAND, sizeof(HANDSHAKE_COMMAND)); in TEST_F()
58 EXPECT_TRUE(len == sizeof(HANDSHAKE_COMMAND)) in TEST_F()
59 << "Unable to send HFP handshake. Bytes written: " << len; in TEST_F()
[all …]
/system/core/logd/
DLogKlog.cpp52 static char* is_prio(char* s, ssize_t len) { in is_prio() argument
53 if ((len <= 0) || !isdigit(*s++)) return nullptr; in is_prio()
54 --len; in is_prio()
55 static const size_t max_prio_len = (len < 4) ? len : 4; in is_prio()
65 static char* is_timestamp(char* s, ssize_t len) { in is_timestamp() argument
66 while ((len > 0) && (*s == ' ')) { in is_timestamp()
68 --len; in is_timestamp()
70 if ((len <= 0) || !isdigit(*s++)) return nullptr; in is_timestamp()
71 --len; in is_timestamp()
74 while ((len > 0) && ((c = *s++))) { in is_timestamp()
[all …]
/system/extras/ioshark/
Dioshark_bench_mmap.c48 size_t len; member
70 mio->table[mio->num_entries].len = in setup_mmap_io_state()
72 total_len -= mio->table[mio->num_entries].len; in setup_mmap_io_state()
73 offset += mio->table[mio->num_entries].len; in setup_mmap_io_state()
91 if (mio->table[i].len > 0) in mmap_getnext_off_len()
97 iolength = MIN(mio->table[i].len, iolength); in mmap_getnext_off_len()
100 mio->table[i].len -= iolength; in mmap_getnext_off_len()
106 mmap_do_io(void *db_node, int prot, off_t offset, size_t len, in mmap_do_io() argument
115 p = get_buf(bufp, buflen, len, 0); in mmap_do_io()
117 p, len, offset); in mmap_do_io()
[all …]
/system/core/libutils/
DString8.cpp57 static char* allocFromUTF8(const char* in, size_t len) in allocFromUTF8() argument
59 if (len > 0) { in allocFromUTF8()
60 if (len == SIZE_MAX) { in allocFromUTF8()
63 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8()
67 memcpy(str, in, len); in allocFromUTF8()
68 str[len] = 0; in allocFromUTF8()
77 static char* allocFromUTF16(const char16_t* in, size_t len) in allocFromUTF16() argument
79 if (len == 0) return getEmptyString(); in allocFromUTF16()
82 const ssize_t resultStrLen = utf16_to_utf8_length(in, len) + 1; in allocFromUTF16()
94 utf16_to_utf8(in, len, resultStr, resultStrLen); in allocFromUTF16()
[all …]
/system/core/libcutils/
Dstrdup16to8.cpp29 extern size_t strnlen16to8(const char16_t* utf16Str, size_t len) in strnlen16to8() argument
57 if (len < (SIZE_MAX-1)/3) { in strnlen16to8()
58 while (len != 0) { in strnlen16to8()
59 len--; in strnlen16to8()
73 while (len != 0) { in strnlen16to8()
74 len--; in strnlen16to8()
109 extern char* strncpy16to8(char* utf8Str, const char16_t* utf16Str, size_t len) in strncpy16to8() argument
117 while (len != 0) { in strncpy16to8()
118 len--; in strncpy16to8()
152 size_t len = strnlen16to8(s, n); in strndup16to8() local
[all …]
Dmemset_test.cpp81 static size_t GetIncrement(size_t len, size_t min_incr) { in GetIncrement() argument
82 if (len >= 4096) { in GetIncrement()
84 } else if (len >= 1024) { in GetIncrement()
143 for (size_t len = incr; len <= MAX_TEST_SIZE; len += incr) { in RunMemsetTests() local
144 incr = GetIncrement(len, min_incr); in RunMemsetTests()
150 SetFencepost(&buf_align[len]); in RunMemsetTests()
152 memset(buf_align, 0xff, len); in RunMemsetTests()
154 android_memset16(reinterpret_cast<uint16_t*>(buf_align), value, len); in RunMemsetTests()
156 android_memset32(reinterpret_cast<uint32_t*>(buf_align), value, len); in RunMemsetTests()
158 ASSERT_EQ(0, memcmp(expected_buf.get(), buf_align, len)) in RunMemsetTests()
[all …]
/system/core/libsparse/
Doutput_file.cpp74 int (*write_data_chunk)(struct output_file* out, unsigned int len, void* data);
75 int (*write_fill_chunk)(struct output_file* out, unsigned int len, uint32_t fill_val);
76 int (*write_skip_chunk)(struct output_file* out, int64_t len);
88 int64_t len; member
111 int (*write)(void* priv, const void* buf, size_t len);
135 static int file_pad(struct output_file* out, int64_t len) { in file_pad() argument
139 ret = ftruncate64(outn->fd, len); in file_pad()
147 static int file_write(struct output_file* out, void* data, size_t len) { in file_write() argument
151 while (len > 0) { in file_write()
152 ret = write(outn->fd, data, len); in file_write()
[all …]
Dsparse.cpp30 struct sparse_file* sparse_file_new(unsigned int block_size, int64_t len) { in sparse_file_new() argument
43 s->len = len; in sparse_file_new()
53 int sparse_file_add_data(struct sparse_file* s, void* data, unsigned int len, unsigned int block) { in sparse_file_add_data() argument
54 return backed_block_add_data(s->backed_block_list, data, len, block); in sparse_file_add_data()
57 int sparse_file_add_fill(struct sparse_file* s, uint32_t fill_val, unsigned int len, in sparse_file_add_fill() argument
59 return backed_block_add_fill(s->backed_block_list, fill_val, len, block); in sparse_file_add_fill()
63 unsigned int len, unsigned int block) { in sparse_file_add_file() argument
64 return backed_block_add_file(s->backed_block_list, filename, file_offset, len, block); in sparse_file_add_file()
67 int sparse_file_add_fd(struct sparse_file* s, int fd, int64_t file_offset, unsigned int len, in sparse_file_add_fd() argument
69 return backed_block_add_fd(s->backed_block_list, fd, file_offset, len, block); in sparse_file_add_fd()
[all …]
Doutput_file.h28 struct output_file* output_file_open_fd(int fd, unsigned int block_size, int64_t len, int gz,
31 unsigned int block_size, int64_t len, int gz,
33 int write_data_chunk(struct output_file* out, unsigned int len, void* data);
34 int write_fill_chunk(struct output_file* out, unsigned int len, uint32_t fill_val);
35 int write_file_chunk(struct output_file* out, unsigned int len, const char* file, int64_t offset);
36 int write_fd_chunk(struct output_file* out, unsigned int len, int fd, int64_t offset);
37 int write_skip_chunk(struct output_file* out, int64_t len);
40 int read_all(int fd, void* buf, size_t len);
Dsparse_read.cpp72 virtual int AddToSparseFile(struct sparse_file* s, int64_t len, unsigned int block) = 0;
75 virtual int ReadValue(void* ptr, int len) = 0;
78 virtual int GetCrc32(uint32_t* crc32, int64_t len) = 0;
99 int AddToSparseFile(struct sparse_file* s, int64_t len, unsigned int block) override { in AddToSparseFile() argument
100 return sparse_file_add_fd(s, fd, GetOffset(), len, block); in AddToSparseFile()
103 int ReadValue(void* ptr, int len) override { return read_all(fd, ptr, len); } in ReadValue() argument
105 int GetCrc32(uint32_t* crc32, int64_t len) override { in GetCrc32() argument
108 while (len) { in GetCrc32()
109 chunk = std::min(len, COPY_BUF_SIZE); in GetCrc32()
115 len -= chunk; in GetCrc32()
[all …]
/system/core/adb/
Dadb_io.cpp58 unsigned long len = strtoul(buf, nullptr, 16); in ReadProtocolString() local
59 s->resize(len, '\0'); in ReadProtocolString()
60 if (!ReadFdExactly(fd, &(*s)[0], len)) { in ReadProtocolString()
76 bool ReadFdExactly(int fd, void* buf, size_t len) { in ReadFdExactly() argument
79 size_t len0 = len; in ReadFdExactly()
81 D("readx: fd=%d wanted=%zu", fd, len); in ReadFdExactly()
82 while (len > 0) { in ReadFdExactly()
83 int r = adb_read(fd, p, len); in ReadFdExactly()
85 len -= r; in ReadFdExactly()
97 VLOG(RWX) << "readx: fd=" << fd << " wanted=" << len0 << " got=" << (len0 - len) in ReadFdExactly()
[all …]
/system/core/libstats/
Dstats_event_list.c31 unsigned len; /* Length or raw buffer. */ member
71 ssize_t len; in stats_write_list() local
84 len = context->len = context->pos; in stats_write_list()
88 len -= sizeof(uint8_t) + sizeof(uint8_t); in stats_write_list()
89 if (len < 0) { in stats_write_list()
90 len = 0; in stats_write_list()
99 vec[1].iov_len = len; in stats_write_list()
150 size_t len, i; in __write_to_stats_daemon() local
152 for (len = i = 0; i < nr; ++i) { in __write_to_stats_daemon()
153 len += vec[i].iov_len; in __write_to_stats_daemon()
[all …]
/system/bt/stack/gatt/
Datt_protocol.cc58 p_buf->len = GATT_HDR_SIZE; /* opcode + 2 bytes mtu */ in attp_build_mtu_cmd()
78 p_buf->len = GATT_OP_CODE_SIZE; in attp_build_exec_write_cmd()
85 p_buf->len += 1; in attp_build_exec_write_cmd()
114 p_buf->len = GATT_HDR_SIZE + 1 + 1; in attp_build_err_cmd()
137 p_buf->len = GATT_OP_CODE_SIZE + 4; in attp_build_browse_cmd()
142 p_buf->len += gatt_build_uuid_to_stream(&p, uuid); in attp_build_browse_cmd()
159 uint16_t len = p_value_type->value_len; in attp_build_read_by_type_value_cmd() local
165 p_buf->len = 5; /* opcode + s_handle + e_handle */ in attp_build_read_by_type_value_cmd()
171 p_buf->len += gatt_build_uuid_to_stream(&p, p_value_type->uuid); in attp_build_read_by_type_value_cmd()
173 if (p_value_type->value_len + p_buf->len > payload_size) in attp_build_read_by_type_value_cmd()
[all …]
/system/bt/stack/include/
Dadvertise_data_parser.h53 uint8_t len = ad[position]; in RemoveTrailingZeros() local
60 if (len == 0) { in RemoveTrailingZeros()
65 if (position + len >= ad_len) { in RemoveTrailingZeros()
69 position += len + 1; in RemoveTrailingZeros()
81 uint8_t len = ad[position]; in IsValid() local
86 if (len == 0) { in IsValid()
95 if (position + len >= ad_len) { in IsValid()
101 position += len + 1; in IsValid()
116 uint8_t len = ad[position]; in GetFieldByType() local
118 if (len == 0) break; in GetFieldByType()
[all …]
/system/core/liblog/
Dlog_event_list.cpp43 unsigned len; /* Length or raw buffer. */ member
69 size_t len) { in init_parser_context() argument
70 len = (len <= MAX_EVENT_PAYLOAD) ? len : MAX_EVENT_PAYLOAD; in init_parser_context()
71 context->len = len; in init_parser_context()
72 memcpy(context->storage, msg, len); in init_parser_context()
89 android_log_context create_android_log_parser(const char* msg, size_t len) { in create_android_log_parser() argument
98 init_parser_context(context, msg, len); in create_android_log_parser()
132 int android_log_parser_reset(android_log_context ctx, const char* msg, size_t len) { in android_log_parser_reset() argument
141 init_parser_context(context, msg, len); in android_log_parser_reset()
246 ssize_t len; in android_log_write_string8_len() local
[all …]
/system/bt/osi/src/
Dproperties.cc34 int len = 0; in osi_property_get() local
35 if (!default_value) return len; in osi_property_get()
37 len = strlen(default_value); in osi_property_get()
38 if (len >= PROPERTY_VALUE_MAX) len = PROPERTY_VALUE_MAX - 1; in osi_property_get()
40 memcpy(value, default_value, len); in osi_property_get()
41 value[len] = '\0'; in osi_property_get()
42 return len; in osi_property_get()
/system/nfc/src/nfc/nci/
Dnci_hrcv.cc54 uint8_t *pp, len, op_code; in nci_proc_core_rsp() local
64 len = *pp++; in nci_proc_core_rsp()
82 nfc_ncif_set_config_status(pp, len); in nci_proc_core_rsp()
86 nfc_ncif_proc_conn_create_rsp(p, p_msg->len, *p_old); in nci_proc_core_rsp()
114 uint8_t *pp, len, op_code; in nci_proc_core_ntf() local
119 len = p_msg->len; in nci_proc_core_ntf()
122 if (len == 0) { in nci_proc_core_ntf()
130 len--; in nci_proc_core_ntf()
150 nfc_ncif_proc_credits(pp, len); in nci_proc_core_ntf()
170 uint8_t *pp, len, op_code; in nci_proc_rf_management_rsp() local
[all …]
/system/netd/resolv/
Dhostent.h44 int _hf_gethtbyaddr(const unsigned char* uaddr, int len, int af, getnamaddr* info);
51 #define HENT_ARRAY(dst, anum, ptr, len) do { \ argument
53 if (_len > len) goto nospc; \
56 len -= _len; \
59 #define HENT_COPY(dst, src, slen, ptr, len) do { \ argument
60 if ((size_t) slen > len) goto nospc; \
64 len -= slen; \
67 #define HENT_SCOPY(dst, src, ptr, len) do { \ argument
69 HENT_COPY(dst, src, _len, ptr, len); \
/system/bt/stack/avdt/
Davdt_msg.cc60 typedef uint8_t (*tAVDT_MSG_PRS)(tAVDT_MSG* p_msg, uint8_t* p, uint16_t len);
78 static uint8_t avdt_msg_prs_none(tAVDT_MSG* p_msg, uint8_t* p, uint16_t len);
79 static uint8_t avdt_msg_prs_single(tAVDT_MSG* p_msg, uint8_t* p, uint16_t len);
81 uint16_t len);
83 uint16_t len);
84 static uint8_t avdt_msg_prs_multi(tAVDT_MSG* p_msg, uint8_t* p, uint16_t len);
86 uint16_t len);
88 uint16_t len);
89 static uint8_t avdt_msg_prs_svccap(tAVDT_MSG* p_msg, uint8_t* p, uint16_t len);
91 uint16_t len);
[all …]
/system/core/fastboot/
Dusb_linux.cpp100 ssize_t Read(void* data, size_t len) override;
101 ssize_t Write(const void* data, size_t len) override;
129 static int check(void *_desc, int len, unsigned type, int size) in check() argument
133 if(len < size) return -1; in check()
135 if(hdr->bLength > len) return -1; in check()
142 char *ptr, int len, int writable, in filter_usb_device() argument
156 if (check(ptr, len, USB_DT_DEVICE, USB_DT_DEVICE_SIZE)) in filter_usb_device()
159 len -= dev->bLength; in filter_usb_device()
162 if (check(ptr, len, USB_DT_CONFIG, USB_DT_CONFIG_SIZE)) in filter_usb_device()
165 len -= cfg->bLength; in filter_usb_device()
[all …]
/system/core/adb/daemon/
Dusb_legacy.cpp125 static int usb_ffs_write(usb_handle* h, const void* data, int len) { in usb_ffs_write() argument
126 D("about to write (fd=%d, len=%d)", h->bulk_in.get(), len); in usb_ffs_write()
129 int orig_len = len; in usb_ffs_write()
130 while (len > 0) { in usb_ffs_write()
131 int write_len = std::min(USB_FFS_BULK_SIZE, len); in usb_ffs_write()
138 len -= n; in usb_ffs_write()
145 static int usb_ffs_read(usb_handle* h, void* data, int len, bool allow_partial) { in usb_ffs_read() argument
146 D("about to read (fd=%d, len=%d)", h->bulk_out.get(), len); in usb_ffs_read()
149 int orig_len = len; in usb_ffs_read()
151 while (len > 0) { in usb_ffs_read()
[all …]
/system/bt/btif/src/
Dbtif_sock_util.cc63 int sock_send_all(int sock_fd, const uint8_t* buf, int len) { in sock_send_all() argument
64 int s = len; in sock_send_all()
76 return len; in sock_send_all()
78 int sock_recv_all(int sock_fd, uint8_t* buf, int len) { in sock_recv_all() argument
79 int r = len; in sock_recv_all()
91 return len; in sock_recv_all()
94 int sock_send_fd(int sock_fd, const uint8_t* buf, int len, int send_fd) { in sock_send_fd() argument
114 int ret_len = len; in sock_send_fd()
115 while (len > 0) { in sock_send_fd()
120 iv.iov_len = len; in sock_send_fd()
[all …]
/system/bt/stack/avrc/
Davrc_bld_tg.cc54 uint16_t len = 0; in avrc_bld_get_capability_rsp() local
71 BE_STREAM_TO_UINT16(len, p_data); in avrc_bld_get_capability_rsp()
75 if (len == 0) { in avrc_bld_get_capability_rsp()
78 len = 2; /* move past the capability_id and count */ in avrc_bld_get_capability_rsp()
80 p_data = p_start + p_pkt->len; in avrc_bld_get_capability_rsp()
89 len += p_rsp->count * 3; in avrc_bld_get_capability_rsp()
99 len += (*p_count); in avrc_bld_get_capability_rsp()
101 UINT16_TO_BE_STREAM(p_len, len); in avrc_bld_get_capability_rsp()
102 p_pkt->len = (p_data - p_start); in avrc_bld_get_capability_rsp()
122 uint16_t len = 0; in avrc_bld_list_app_settings_attr_rsp() local
[all …]

12345678910>>...30