/system/core/toolbox/upstream-netbsd/usr.bin/grep/ |
D | fastgrep.c | 63 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/ |
D | indirect.c | 42 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 …]
|
D | extent.c | 40 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 …]
|
D | allocate.c | 27 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/adb/ |
D | test_track_jdwp.c | 17 unix_write( int fd, const char* buf, int len ) in unix_write() argument 20 while (len > 0) { in unix_write() 21 int len2 = write(fd, buf, len); in unix_write() 28 len -= len2; in unix_write() 35 unix_read( int fd, char* buf, int len ) in unix_read() argument 38 while (len > 0) { in unix_read() 39 int len2 = read(fd, buf, len); in unix_read() 46 len -= len2; in unix_read() 59 int len; in main() local 71 len = snprintf( buffer, sizeof buffer, "%04x%s", strlen(request), request ); in main() [all …]
|
D | test_track_devices.c | 17 unix_write( int fd, const char* buf, int len ) in unix_write() argument 20 while (len > 0) { in unix_write() 21 int len2 = write(fd, buf, len); in unix_write() 28 len -= len2; in unix_write() 35 unix_read( int fd, char* buf, int len ) in unix_read() argument 38 while (len > 0) { in unix_read() 39 int len2 = read(fd, buf, len); in unix_read() 46 len -= len2; in unix_read() 59 int len; in main() local 71 len = snprintf( buffer, sizeof buffer, "%04x%s", strlen(request), request ); in main() [all …]
|
/system/core/libcutils/ |
D | properties.c | 41 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() 119 int len; in property_get() local 121 len = __system_property_get(key, value); in property_get() 122 if(len > 0) { in property_get() 123 return len; in property_get() 126 len = strlen(default_value); in property_get() [all …]
|
D | strdup16to8.c | 29 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()
|
D | strdup8to16.c | 46 size_t len; in strdup8to16() local 50 len = strlen8to16(s); in strdup8to16() 53 if (len && SIZE_MAX/len < sizeof(char16_t)) in strdup8to16() 57 ret = (char16_t *) malloc (sizeof(char16_t) * len); in strdup8to16() 70 size_t len = 0; in strlen8to16() local 85 len++; in strlen8to16() 88 len++; in strlen8to16() 93 len++; in strlen8to16() 98 return len; in strlen8to16()
|
/system/core/toolbox/ |
D | sendevent.c | 25 #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ argument 26 #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ argument 27 #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ argument 29 #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ argument 30 #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ argument 31 #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ argument 32 #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ argument 34 #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ argument
|
D | getsebool.c | 17 int i, get_all = 0, rc = 0, active, pending, len = 0, opt; in getsebool_main() local 31 rc = security_get_boolean_names(&names, &len); in getsebool_main() 38 if (!len) { in getsebool_main() 53 if (!len) { in getsebool_main() 56 len = argc - 1; in getsebool_main() 57 names = malloc(sizeof(char *) * len); in getsebool_main() 62 for (i = 0; i < len; i++) { in getsebool_main() 72 for (i = 0; i < len; i++) { in getsebool_main() 100 for (i = 0; i < len; i++) in getsebool_main()
|
/system/core/libutils/ |
D | String8.cpp | 81 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 …]
|
D | String16.cpp | 112 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/core/libsparse/ |
D | output_file.c | 71 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 …]
|
D | sparse.c | 30 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 …]
|
D | output_file.h | 24 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/toolbox/upstream-netbsd/lib/libc/string/ |
D | swab.c | 48 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/libcutils/tests/ |
D | MemsetTest.cpp | 79 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/core/liblog/ |
D | uio.c | 28 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/libmincrypt/ |
D | rsa.c | 37 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/debuggerd/ |
D | utility.cpp | 34 static int write_to_am(int fd, const char* buf, int len) { in write_to_am() argument 35 int to_write = len; in write_to_am() 37 int written = TEMP_FAILURE_RETRY(write(fd, buf + len - to_write, to_write)); in write_to_am() 45 return len; in write_to_am() 73 size_t len = strlen(buf); in _LOG() local 74 if (len <= 0) { in _LOG() 79 TEMP_FAILURE_RETRY(write(log->tfd, buf, len)); in _LOG() 85 int written = write_to_am(log->amfd, buf, len); in _LOG() 169 int len = snprintf(code_buffer, sizeof(code_buffer), "%" PRIPTR " ", p); in dump_memory() local 177 len += sprintf(code_buffer + len, "---------------- "); in dump_memory() [all …]
|
/system/core/fastboot/ |
D | usb_linux.c | 101 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/extras/f2fs_utils/ |
D | f2fs_ioutils.c | 92 size_t len; member 98 static int dev_write_fd(void *buf, __u64 offset, size_t len) in dev_write_fd() argument 102 if (write(config.fd, buf, len) != len) in dev_write_fd() 130 bi->len = byte_len; in dev_write_sparse() 151 int dev_read(void *buf, __u64 offset, size_t len) in dev_read() argument 156 int dev_write(void *buf, __u64 offset, size_t len) in dev_write() argument 159 return dev_write_fd(buf, offset, len); in dev_write() 161 return dev_write_sparse(buf, offset, len); in dev_write() 166 int dev_fill(void *buf, __u64 offset, size_t len) in dev_fill() argument 170 return dev_write_fd(buf, offset, len); in dev_fill()
|
/system/core/include/cutils/ |
D | trace.h | 188 size_t len; in atrace_begin() local 190 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "B|%d|%s", getpid(), name); in atrace_begin() 191 write(atrace_marker_fd, buf, len); in atrace_begin() 222 size_t len; in atrace_async_begin() local 224 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "S|%d|%s|%" PRId32, in atrace_async_begin() 226 write(atrace_marker_fd, buf, len); in atrace_async_begin() 240 size_t len; in atrace_async_end() local 242 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "F|%d|%s|%" PRId32, in atrace_async_end() 244 write(atrace_marker_fd, buf, len); in atrace_async_end() 258 size_t len; in atrace_int() local [all …]
|
/system/core/init/ |
D | bootchart.c | 50 unix_read(int fd, void* buff, int len) in unix_read() argument 53 do { ret = read(fd, buff, len); } while (ret < 0 && errno == EINTR); in unix_read() 58 unix_write(int fd, const void* buff, int len) in unix_write() argument 61 do { ret = write(fd, buff, len); } while (ret < 0 && errno == EINTR); in unix_write() 68 int len = 0; in proc_read() local 71 len = unix_read(fd, buff, buffsize-1); in proc_read() 74 buff[len > 0 ? len : 0] = 0; in proc_read() 75 return len; in proc_read() 94 file_buff_write( FileBuff buff, const void* src, int len ) in file_buff_write() argument 96 while (len > 0) { in file_buff_write() [all …]
|