Home
last modified time | relevance | path

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

12345678910>>...25

/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 …]
/system/extras/ext4_utils/
Dindirect.c42 u32 len; in create_backing() local
45 len = min(region_len * info.block_size, backing_len); in create_backing()
47 sparse_file_add_data(ext4_sparse_file, ptr, len, region_block); in create_backing()
48 ptr += len; in create_backing()
49 backing_len -= len; in create_backing()
55 static void reserve_indirect_block(struct block_allocation *alloc, int len) in reserve_indirect_block() argument
62 if (advance_blocks(alloc, len)) { in reserve_indirect_block()
63 error("failed to advance %d blocks", len); in reserve_indirect_block()
68 static void reserve_dindirect_block(struct block_allocation *alloc, int len) in reserve_dindirect_block() argument
75 while (len > 0) { in reserve_dindirect_block()
[all …]
Dextent.c40 u32 len; in extent_create_backing() local
43 len = min(region_len * info.block_size, backing_len); in extent_create_backing()
45 sparse_file_add_data(ext4_sparse_file, ptr, len, region_block); in extent_create_backing()
46 ptr += len; in extent_create_backing()
47 backing_len -= len; in extent_create_backing()
62 u32 len; in extent_create_backing_file() local
65 len = min(region_len * info.block_size, backing_len); in extent_create_backing_file()
67 sparse_file_add_file(ext4_sparse_file, filename, offset, len, in extent_create_backing_file()
69 offset += len; in extent_create_backing_file()
70 backing_len -= len; in extent_create_backing_file()
[all …]
/system/core/logd/
DLogKlog.cpp46 static char *is_prio(char *s, size_t len) { in is_prio() argument
47 if (!len || !isdigit(*s++)) { in is_prio()
50 --len; in is_prio()
51 static const size_t max_prio_len = (len < 4) ? len : 4; in is_prio()
63 static char *is_timestamp(char *s, size_t len) { in is_timestamp() argument
64 while (len && (*s == ' ')) { in is_timestamp()
66 --len; in is_timestamp()
68 if (!len || !isdigit(*s++)) { in is_timestamp()
71 --len; in is_timestamp()
74 while (len && ((c = *s++))) { in is_timestamp()
[all …]
/system/core/libutils/
DString8.cpp83 static char* allocFromUTF8(const char* in, size_t len) in allocFromUTF8() argument
85 if (len > 0) { in allocFromUTF8()
86 if (len == SIZE_MAX) { in allocFromUTF8()
89 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8()
93 memcpy(str, in, len); in allocFromUTF8()
94 str[len] = 0; in allocFromUTF8()
103 static char* allocFromUTF16(const char16_t* in, size_t len) in allocFromUTF16() argument
105 if (len == 0) return getEmptyString(); in allocFromUTF16()
108 const ssize_t resultStrLen = utf16_to_utf8_length(in, len) + 1; in allocFromUTF16()
120 utf16_to_utf8(in, len, resultStr, resultStrLen); in allocFromUTF16()
[all …]
DString16.cpp113 String16::String16(const String16& o, size_t len, size_t begin) in String16() argument
116 setTo(o, len, begin); in String16()
121 size_t len = strlen16(o); in String16() local
122 SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); in String16()
134 String16::String16(const char16_t* o, size_t len) in String16() argument
136 SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); in String16()
140 memcpy(str, o, len*sizeof(char16_t)); in String16()
141 str[len] = 0; in String16()
159 String16::String16(const char* o, size_t len) in String16() argument
160 : mString(allocFromUTF8(o, len)) in String16()
[all …]
/system/core/libcutils/
Dstrdup16to8.c29 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()
149 size_t len; in strndup16to8() local
[all …]
Dproperties.c41 int len = property_get(key, buf, ""); in property_get_bool() local
42 if (len == 1) { in property_get_bool()
49 } else if (len > 1) { in property_get_bool()
71 int len = property_get(key, buf, ""); in property_get_imax() local
72 if (len > 0) { in property_get_imax()
117 int len; in property_get() local
119 len = __system_property_get(key, value); in property_get()
120 if(len > 0) { in property_get()
121 return len; in property_get()
124 len = strlen(default_value); in property_get()
[all …]
/system/bt/bta/ag/
Dbta_ag_ci.c43 void bta_ag_ci_rx_write(UINT16 handle, char *p_data, UINT16 len) in bta_ag_ci_rx_write() argument
45 UINT16 len_remaining = len; in bta_ag_ci_rx_write()
48 if (len > (RFCOMM_DATA_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1)) in bta_ag_ci_rx_write()
49 len = RFCOMM_DATA_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1; in bta_ag_ci_rx_write()
52 if (len_remaining < len) in bta_ag_ci_rx_write()
53 len = len_remaining; in bta_ag_ci_rx_write()
56 (tBTA_AG_CI_RX_WRITE *)osi_malloc(sizeof(tBTA_AG_CI_RX_WRITE) + len + 1); in bta_ag_ci_rx_write()
61 strncpy(p_data_area, p_data, len); in bta_ag_ci_rx_write()
62 p_data_area[len] = 0; in bta_ag_ci_rx_write()
66 len_remaining -= len; in bta_ag_ci_rx_write()
[all …]
/system/core/libsparse/
Doutput_file.c71 int (*write_data_chunk)(struct output_file *out, unsigned int len,
73 int (*write_fill_chunk)(struct output_file *out, unsigned int len,
75 int (*write_skip_chunk)(struct output_file *out, int64_t len);
87 int64_t len; member
112 int (*write)(void *priv, const void *buf, int len);
139 static int file_pad(struct output_file *out, int64_t len) in file_pad() argument
144 ret = ftruncate64(outn->fd, len); in file_pad()
152 static int file_write(struct output_file *out, void *data, int len) in file_write() argument
157 ret = write(outn->fd, data, len); in file_write()
161 } else if (ret < len) { in file_write()
[all …]
Dsparse.c30 struct sparse_file *sparse_file_new(unsigned int block_size, int64_t len) in sparse_file_new() argument
44 s->len = len; in sparse_file_new()
56 void *data, unsigned int len, unsigned int block) in sparse_file_add_data() argument
58 return backed_block_add_data(s->backed_block_list, data, len, block); in sparse_file_add_data()
62 uint32_t fill_val, unsigned int len, unsigned int block) in sparse_file_add_fill() argument
64 return backed_block_add_fill(s->backed_block_list, fill_val, len, block); in sparse_file_add_fill()
68 const char *filename, int64_t file_offset, unsigned int len, in sparse_file_add_file() argument
72 len, block); in sparse_file_add_file()
76 int fd, int64_t file_offset, unsigned int len, unsigned int block) in sparse_file_add_fd() argument
79 len, block); in sparse_file_add_fd()
[all …]
Doutput_file.h24 struct output_file *output_file_open_fd(int fd, unsigned int block_size, int64_t len,
27 void *priv, unsigned int block_size, int64_t len, int gz, int sparse,
29 int write_data_chunk(struct output_file *out, unsigned int len, void *data);
30 int write_fill_chunk(struct output_file *out, unsigned int len,
32 int write_file_chunk(struct output_file *out, unsigned int len,
34 int write_fd_chunk(struct output_file *out, unsigned int len,
36 int write_skip_chunk(struct output_file *out, int64_t len);
39 int read_all(int fd, void *buf, size_t len);
/system/bt/stack/avrc/
Davrc_bld_tg.c44 UINT16 len = 0; in avrc_bld_get_capability_rsp() local
62 BE_STREAM_TO_UINT16(len, p_data); in avrc_bld_get_capability_rsp()
66 if (len == 0) in avrc_bld_get_capability_rsp()
70 len = 2; /* move past the capability_id and count */ in avrc_bld_get_capability_rsp()
74 p_data = p_start + p_pkt->len; in avrc_bld_get_capability_rsp()
85 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 len = 0; in avrc_bld_list_app_settings_attr_rsp() local
[all …]
/system/bt/stack/gatt/
Datt_protocol.c59 p_buf->len = GATT_HDR_SIZE; /* opcode + 2 bytes mtu */ in attp_build_mtu_cmd()
80 p_buf->len = GATT_OP_CODE_SIZE; in attp_build_exec_write_cmd()
87 p_buf->len += 1; in attp_build_exec_write_cmd()
115 p_buf->len = GATT_HDR_SIZE + 1 + 1; in attp_build_err_cmd()
136 p_buf->len = GATT_OP_CODE_SIZE + 4; in attp_build_browse_cmd()
141 p_buf->len += gatt_build_uuid_to_stream(&p, uuid); in attp_build_browse_cmd()
158 UINT16 len = p_value_type->value_len; in attp_build_read_by_type_value_cmd() local
164 p_buf->len = 5; /* opcode + s_handle + e_handle */ in attp_build_read_by_type_value_cmd()
170 p_buf->len += gatt_build_uuid_to_stream(&p, p_value_type->uuid); in attp_build_read_by_type_value_cmd()
172 if (p_value_type->value_len + p_buf->len > payload_size) in attp_build_read_by_type_value_cmd()
[all …]
Dgatt_cl.c96 cl_req.browse.uuid.len = 2; in gatt_act_discovery()
102 cl_req.find_type_value.uuid.len = 2; in gatt_act_discovery()
106 cl_req.find_type_value.value_len = p_clcb->uuid.len; in gatt_act_discovery()
108 if (p_clcb->uuid.len == LEN_UUID_32) in gatt_act_discovery()
114 memcpy (cl_req.find_type_value.value, &p_clcb->uuid.uu, p_clcb->uuid.len); in gatt_act_discovery()
157 msg.browse.uuid.len = LEN_UUID_16; in gatt_act_read()
242 p_attr->len, in gatt_act_write()
248 if (p_attr->len <= (p_tcb->payload_size - GATT_HDR_SIZE)) in gatt_act_write()
256 p_attr->len, in gatt_act_write()
331 p_rsp_value->len != p_clcb->counter || in gatt_check_write_long_terminate()
[all …]
Dgatt_sr.c124 UINT16 ii, total_len, len; in process_read_multi_rsp() local
147 len = sizeof(BT_HDR) + L2CAP_MIN_OFFSET + mtu; in process_read_multi_rsp()
148 p_buf = (BT_HDR *)osi_calloc(len); in process_read_multi_rsp()
154 p_buf->len = 1; in process_read_multi_rsp()
177 total_len = (p_buf->len + p_rsp->attr_value.len); in process_read_multi_rsp()
182 len = p_rsp->attr_value.len - (total_len - mtu); in process_read_multi_rsp()
184 … GATT_TRACE_DEBUG ("multi read overflow available len=%d val_len=%d", len, p_rsp->attr_value.len ); in process_read_multi_rsp()
188 len = p_rsp->attr_value.len; in process_read_multi_rsp()
193 memcpy (p, p_rsp->attr_value.value, len); in process_read_multi_rsp()
195 p += len; in process_read_multi_rsp()
[all …]
/system/core/adb/
Dadb_io.cpp50 unsigned long len = strtoul(buf, 0, 16); in ReadProtocolString() local
51 s->resize(len, '\0'); in ReadProtocolString()
52 if (!ReadFdExactly(fd, &(*s)[0], len)) { in ReadProtocolString()
68 bool ReadFdExactly(int fd, void* buf, size_t len) { in ReadFdExactly() argument
71 size_t len0 = len; in ReadFdExactly()
73 D("readx: fd=%d wanted=%zu", fd, len); in ReadFdExactly()
74 while (len > 0) { in ReadFdExactly()
75 int r = adb_read(fd, p, len); in ReadFdExactly()
77 len -= r; in ReadFdExactly()
89 VLOG(RWX) << "readx: fd=" << fd << " wanted=" << len0 << " got=" << (len0 - len) in ReadFdExactly()
[all …]
/system/core/fastboot/
Dusb_linux.cpp95 ssize_t Read(void* data, size_t len) override;
96 ssize_t Write(const void* data, size_t len) override;
122 static int check(void *_desc, int len, unsigned type, int size) in check() argument
126 if(len < size) return -1; in check()
128 if(hdr->bLength > len) return -1; in check()
135 char *ptr, int len, int writable, in filter_usb_device() argument
149 if (check(ptr, len, USB_DT_DEVICE, USB_DT_DEVICE_SIZE)) in filter_usb_device()
152 len -= dev->bLength; in filter_usb_device()
155 if (check(ptr, len, USB_DT_CONFIG, USB_DT_CONFIG_SIZE)) in filter_usb_device()
158 len -= cfg->bLength; in filter_usb_device()
[all …]
/system/bt/osi/src/
Dproperties.c26 int len = -1; in osi_property_get() local
28 return len; in osi_property_get()
30 len = strlen(default_value); in osi_property_get()
31 if (len >= PROPERTY_VALUE_MAX) in osi_property_get()
32 len = PROPERTY_VALUE_MAX - 1; in osi_property_get()
34 memcpy(value, default_value, len); in osi_property_get()
35 value[len] = '\0'; in osi_property_get()
36 return len; in osi_property_get()
/system/core/toolbox/upstream-netbsd/lib/libc/string/
Dswab.c48 swab(const void * __restrict from, void * __restrict to, ssize_t len) in swab() argument
54 if (len <= 1) in swab()
60 len /= 2; in swab()
65 if (__predict_false(len == 1)) { in swab()
71 while ((--len % 8) != 0) in swab()
73 len /= 8; in swab()
74 if (len == 0) in swab()
76 while (len-- != 0) { in swab()
/system/core/libmincrypt/
Drsa.c37 for (i = 0; i < key->len; ++i) { in subM()
48 for (i = key->len; i;) { in geM()
66 for (i = 1; i < key->len; ++i) { in montMulAdd()
87 for (i = 0; i < key->len; ++i) { in montMul()
90 for (i = 0; i < key->len; ++i) { in montMul()
106 for (i = 0; i < key->len; ++i) { in modpow()
108 (inout[((key->len - 1 - i) * 4) + 0] << 24) | in modpow()
109 (inout[((key->len - 1 - i) * 4) + 1] << 16) | in modpow()
110 (inout[((key->len - 1 - i) * 4) + 2] << 8) | in modpow()
111 (inout[((key->len - 1 - i) * 4) + 3] << 0); in modpow()
[all …]
/system/core/libcutils/tests/
DMemsetTest.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/liblog/
Dlog_event_list.c38 unsigned len; /* Length or raw buffer. */ member
72 size_t len) { in create_android_log_parser() argument
80 len = (len <= MAX_EVENT_PAYLOAD) ? len : MAX_EVENT_PAYLOAD; in create_android_log_parser()
81 context->len = len; in create_android_log_parser()
82 memcpy(context->storage, msg, len); in create_android_log_parser()
208 ssize_t len; in android_log_write_string8_len() local
221 len = strnlen(value, maxlen); in android_log_write_string8_len()
222 needed = sizeof(uint8_t) + sizeof(int32_t) + len; in android_log_write_string8_len()
225 len = MAX_EVENT_PAYLOAD - context->pos - 1 - sizeof(int32_t); in android_log_write_string8_len()
226 if (len <= 0) { in android_log_write_string8_len()
[all …]
/system/bt/stack/avdt/
Davdt_msg.c60 typedef UINT8 (*tAVDT_MSG_PRS)(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
79 static UINT8 avdt_msg_prs_none(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
80 static UINT8 avdt_msg_prs_single(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
81 static UINT8 avdt_msg_prs_setconfig_cmd(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
82 static UINT8 avdt_msg_prs_reconfig_cmd(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
83 static UINT8 avdt_msg_prs_multi(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
84 static UINT8 avdt_msg_prs_security_cmd(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
85 static UINT8 avdt_msg_prs_discover_rsp(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
86 static UINT8 avdt_msg_prs_svccap(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
87 static UINT8 avdt_msg_prs_all_svccap(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
[all …]
/system/bt/stack/sdp/
Dsdp_utils.c242 if(p_attr->len > 0xFFFF) in sdpu_build_attrib_entry()
245 UINT32_TO_BE_STREAM (p_out, p_attr->len); in sdpu_build_attrib_entry()
251 if(p_attr->len > 0xFF) in sdpu_build_attrib_entry()
254 UINT16_TO_BE_STREAM (p_out, p_attr->len); in sdpu_build_attrib_entry()
261 UINT8_TO_BE_STREAM (p_out, p_attr->len); in sdpu_build_attrib_entry()
265 ARRAY_TO_BE_STREAM (p_out, p_attr->value_ptr, (int)p_attr->len); in sdpu_build_attrib_entry()
272 switch (p_attr->len) in sdpu_build_attrib_entry()
291 UINT8_TO_BE_STREAM (p_out, p_attr->len); in sdpu_build_attrib_entry()
296 ARRAY_TO_BE_STREAM (p_out, p_attr->value_ptr, (int)p_attr->len); in sdpu_build_attrib_entry()
344 p_buf->len = p_rsp - p_rsp_start; in sdpu_build_n_send_error()
[all …]

12345678910>>...25