Home
last modified time | relevance | path

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

12345678910>>...19

/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 …]
Dallocate.c27 u32 len; member
130 reg->block, reg->block + reg->len - 1, reg->len)
148 if (reg->len == 1) { in print_blocks()
151 fprintf(f, " %d-%d", reg->block, reg->block + reg->len - 1); in print_blocks()
158 u32 block, u32 len, int bg_num) in append_region() argument
163 reg->len = len; in append_region()
257 void reduce_allocation(struct block_allocation *alloc, u32 len) in reduce_allocation() argument
259 while (len) { in reduce_allocation()
262 if (last_reg->len > len) { in reduce_allocation()
263 free_blocks(&aux_info.bgs[last_reg->bg], len); in reduce_allocation()
[all …]
/system/core/libutils/
DString8.cpp81 static char* allocFromUTF8(const char* in, size_t len) in allocFromUTF8() argument
83 if (len > 0) { in allocFromUTF8()
84 if (len == SIZE_MAX) { in allocFromUTF8()
87 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8()
91 memcpy(str, in, len); in allocFromUTF8()
92 str[len] = 0; in allocFromUTF8()
101 static char* allocFromUTF16(const char16_t* in, size_t len) in allocFromUTF16() argument
103 if (len == 0) return getEmptyString(); in allocFromUTF16()
105 const ssize_t bytes = utf16_to_utf8_length(in, len); in allocFromUTF16()
117 utf16_to_utf8(in, len, str); in allocFromUTF16()
[all …]
DString16.cpp112 String16::String16(const String16& o, size_t len, size_t begin) in String16() argument
115 setTo(o, len, begin); in String16()
120 size_t len = strlen16(o); in String16() local
121 SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); in String16()
133 String16::String16(const char16_t* o, size_t len) in String16() argument
135 SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); in String16()
139 memcpy(str, o, len*sizeof(char16_t)); in String16()
140 str[len] = 0; in String16()
158 String16::String16(const char* o, size_t len) in String16() argument
159 : mString(allocFromUTF8(o, len)) in String16()
[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
46 UINT16 len_remaining = len; in bta_ag_ci_rx_write()
49 if (len > (RFCOMM_DATA_POOL_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1)) in bta_ag_ci_rx_write()
50 len = RFCOMM_DATA_POOL_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1; in bta_ag_ci_rx_write()
54 if (len_remaining < len) in bta_ag_ci_rx_write()
55 len = len_remaining; in bta_ag_ci_rx_write()
57 …if ((p_buf = (tBTA_AG_CI_RX_WRITE *) GKI_getbuf((UINT16)(sizeof(tBTA_AG_CI_RX_WRITE) + len + 1))) … in bta_ag_ci_rx_write()
63 strncpy(p_data_area, p_data, len); in bta_ag_ci_rx_write()
64 p_data_area[len] = 0; in bta_ag_ci_rx_write()
68 APPL_TRACE_ERROR("ERROR: Unable to allocate buffer to hold AT response code. len=%i", len); in bta_ag_ci_rx_write()
[all …]
/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/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/core/adb/
Dadb_io.cpp46 bool ReadFdExactly(int fd, void* buf, size_t len) { in ReadFdExactly() argument
49 size_t len0 = len; in ReadFdExactly()
51 D("readx: fd=%d wanted=%zu\n", fd, len); in ReadFdExactly()
52 while (len > 0) { in ReadFdExactly()
53 int r = adb_read(fd, p, len); in ReadFdExactly()
55 len -= r; in ReadFdExactly()
67 D("readx: fd=%d wanted=%zu got=%zu\n", fd, len0, len0 - len); in ReadFdExactly()
75 bool WriteFdExactly(int fd, const void* buf, size_t len) { in WriteFdExactly() argument
79 D("writex: fd=%d len=%d: ", fd, (int)len); in WriteFdExactly()
81 dump_hex(reinterpret_cast<const unsigned char*>(buf), len); in WriteFdExactly()
[all …]
/system/core/libcutils/
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 …]
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--) { in strnlen16to8()
72 while (len--) { in strnlen16to8()
107 extern char* strncpy16to8(char* utf8Str, const char16_t* utf16Str, size_t len) in strncpy16to8() argument
115 while (len--) { in strncpy16to8()
146 size_t len; in strndup16to8() local
152 len = strnlen16to8(s, n); in strndup16to8()
158 if (len >= SIZE_MAX-1) in strndup16to8()
161 ret = malloc(len + 1); in strndup16to8()
Dtrace-dev.c197 size_t len; in atrace_begin_body() local
199 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "B|%d|%s", getpid(), name); in atrace_begin_body()
200 write(atrace_marker_fd, buf, len); in atrace_begin_body()
207 size_t len; in atrace_async_begin_body() local
209 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "S|%d|%s|%" PRId32, in atrace_async_begin_body()
211 write(atrace_marker_fd, buf, len); in atrace_async_begin_body()
217 size_t len; in atrace_async_end_body() local
219 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "F|%d|%s|%" PRId32, in atrace_async_end_body()
221 write(atrace_marker_fd, buf, len); in atrace_async_end_body()
227 size_t len; in atrace_int_body() local
[all …]
/system/bt/stack/gatt/
Datt_protocol.c59 p_buf->len = GATT_HDR_SIZE; /* opcode + 2 bytes mtu */ in attp_build_mtu_cmd()
82 p_buf->len = GATT_OP_CODE_SIZE; in attp_build_exec_write_cmd()
90 p_buf->len += 1; in attp_build_exec_write_cmd()
123 p_buf->len = GATT_HDR_SIZE + 1 + 1; in attp_build_err_cmd()
146 p_buf->len = GATT_OP_CODE_SIZE + 4; in attp_build_browse_cmd()
151 p_buf->len += gatt_build_uuid_to_stream(&p, uuid); in attp_build_browse_cmd()
169 UINT16 len = p_value_type->value_len; in attp_build_read_by_type_value_cmd() local
176 p_buf->len = 5; /* opcode + s_handle + e_handle */ in attp_build_read_by_type_value_cmd()
182 p_buf->len += gatt_build_uuid_to_stream(&p, p_value_type->uuid); in attp_build_read_by_type_value_cmd()
184 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 …]
/system/bt/stack/avdt/
Davdt_msg.c58 typedef UINT8 (*tAVDT_MSG_PRS)(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
77 static UINT8 avdt_msg_prs_none(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
78 static UINT8 avdt_msg_prs_single(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
79 static UINT8 avdt_msg_prs_setconfig_cmd(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
80 static UINT8 avdt_msg_prs_reconfig_cmd(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
81 static UINT8 avdt_msg_prs_multi(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
82 static UINT8 avdt_msg_prs_security_cmd(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
83 static UINT8 avdt_msg_prs_discover_rsp(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
84 static UINT8 avdt_msg_prs_svccap(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
85 static UINT8 avdt_msg_prs_all_svccap(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len);
[all …]
/system/core/fastboot/
Dusb_linux.c101 static int check(void *_desc, int len, unsigned type, int size) in check() argument
105 if(len < size) return -1; in check()
107 if(hdr->bLength > len) return -1; in check()
114 char *ptr, int len, int writable, in filter_usb_device() argument
128 if (check(ptr, len, USB_DT_DEVICE, USB_DT_DEVICE_SIZE)) in filter_usb_device()
131 len -= dev->bLength; in filter_usb_device()
134 if (check(ptr, len, USB_DT_CONFIG, USB_DT_CONFIG_SIZE)) in filter_usb_device()
137 len -= cfg->bLength; in filter_usb_device()
181 while (len > 0) { in filter_usb_device()
183 if (check(hdr, len, USB_DT_INTERFACE, USB_DT_INTERFACE_SIZE) == 0) in filter_usb_device()
[all …]
/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.cpp79 static size_t GetIncrement(size_t len, size_t min_incr) { in GetIncrement() argument
80 if (len >= 4096) { in GetIncrement()
82 } else if (len >= 1024) { in GetIncrement()
141 for (size_t len = incr; len <= MAX_TEST_SIZE; len += incr) { in RunMemsetTests() local
142 incr = GetIncrement(len, min_incr); in RunMemsetTests()
148 SetFencepost(&buf_align[len]); in RunMemsetTests()
150 memset(buf_align, 0xff, len); in RunMemsetTests()
152 android_memset16(reinterpret_cast<uint16_t*>(buf_align), value, len); in RunMemsetTests()
154 android_memset32(reinterpret_cast<uint32_t*>(buf_align), value, len); in RunMemsetTests()
156 ASSERT_EQ(0, memcmp(expected_buf, buf_align, len)) in RunMemsetTests()
[all …]
/system/extras/f2fs_utils/
Df2fs_ioutils.c91 size_t len; member
97 static int dev_write_fd(void *buf, __u64 offset, size_t len) in dev_write_fd() argument
101 if (write(config.fd, buf, len) != len) in dev_write_fd()
129 bi->len = byte_len; in dev_write_sparse()
150 int dev_read_version(void *buf, __u64 offset, size_t len) in dev_read_version() argument
155 int dev_read(void *buf, __u64 offset, size_t len) in dev_read() argument
160 int dev_write(void *buf, __u64 offset, size_t len) in dev_write() argument
163 return dev_write_fd(buf, offset, len); in dev_write()
165 return dev_write_sparse(buf, offset, len); in dev_write()
170 int dev_fill(void *buf, __u64 offset, size_t len) in dev_fill() argument
[all …]
/system/core/liblog/
Duio.c28 int len = vecs->iov_len; in readv() local
30 while (len > 0) { in readv()
31 int ret = read( fd, buf, len ); in readv()
42 len -= ret; in readv()
55 int len = vecs->iov_len; in writev() local
57 while (len > 0) { in writev()
58 int ret = write( fd, buf, len ); in writev()
69 len -= ret; in writev()
/system/core/logd/tests/
Dlogd_test.cpp34 static void my_android_logger_get_statistics(char *buf, size_t len) in my_android_logger_get_statistics() argument
36 snprintf(buf, len, "getStatistics 0 1 2 3 4"); in my_android_logger_get_statistics()
43 while ((ret = read(sock, buf, len)) > 0) { in my_android_logger_get_statistics()
44 if ((size_t)ret == len) { in my_android_logger_get_statistics()
47 len -= ret; in my_android_logger_get_statistics()
68 size_t len = 8192; in alloc_statistics() local
72 buf = new char [len]; in alloc_statistics()
73 my_android_logger_get_statistics(buf, len); in alloc_statistics()
75 buf[len-1] = '\0'; in alloc_statistics()
82 bool check = ret <= len; in alloc_statistics()
[all …]

12345678910>>...19