Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 105) sorted by relevance

12345

/system/core/logcat/tests/
Dlogcat_test.cpp52 char buffer[5120]; in TEST() local
57 while (fgets(buffer, sizeof(buffer), fp)) { in TEST()
58 if (!strncmp(begin, buffer, sizeof(begin) - 1)) { in TEST()
59 while (char *cp = strrchr(buffer, '\n')) { in TEST()
62 log_id_t id = android_name_to_log_id(buffer + sizeof(begin) - 1); in TEST()
82 char buffer[5120]; in TEST() local
86 while (fgets(buffer, sizeof(buffer), fp)) { in TEST()
87 if ((buffer[0] == '[') && (buffer[1] == ' ') in TEST()
88 && isdigit(buffer[2]) && isdigit(buffer[3]) in TEST()
89 && (buffer[4] == '-')) { in TEST()
[all …]
Dlogcat_benchmark.cpp43 void init(const char *buffer) in TEST() argument
46 if (buffer != NULL) { in TEST()
47 ok = sscanf(buffer, "%d-%d %d:%d:%d.%d ", in TEST()
52 timestamp(const char *buffer) in TEST() argument
54 init(buffer); in TEST()
80 char buffer[5120]; in TEST() local
85 while (fgets(buffer, sizeof(buffer), fp)) { in TEST()
86 if (!strncmp(begin, buffer, sizeof(begin) - 1)) { in TEST()
91 last_buffer = strdup(buffer); in TEST()
92 last.init(buffer); in TEST()
[all …]
/system/core/include/utils/
DFlattenable.h38 static size_t align(void const*& buffer) { in align() argument
40 intptr_t b = intptr_t(buffer); in align()
41 buffer = (void*)((intptr_t(buffer) + (N-1)) & ~(N-1)); in align()
42 return size_t(intptr_t(buffer) - b); in align()
46 static size_t align(void*& buffer) { in align() argument
47 return align<N>( const_cast<void const*&>(buffer) ); in align()
50 static void advance(void*& buffer, size_t& size, size_t offset) { in advance() argument
51 buffer = reinterpret_cast<void*>( intptr_t(buffer) + offset ); in advance()
55 static void advance(void const*& buffer, size_t& size, size_t offset) { in advance() argument
56 buffer = reinterpret_cast<void const*>( intptr_t(buffer) + offset ); in advance()
[all …]
/system/media/audio_utils/
Decho_reference.c49 void *buffer; // main buffer member
71 struct resampler_buffer* buffer) in echo_reference_get_next_buffer() argument
83 buffer->raw = NULL; in echo_reference_get_next_buffer()
84 buffer->frame_count = 0; in echo_reference_get_next_buffer()
88 buffer->frame_count = (buffer->frame_count > er->wr_frames_in) ? in echo_reference_get_next_buffer()
89 er->wr_frames_in : buffer->frame_count; in echo_reference_get_next_buffer()
91 buffer->i16 = (int16_t *)er->wr_src_buf + (er->wr_curr_frame_size - er->wr_frames_in) * in echo_reference_get_next_buffer()
98 struct resampler_buffer* buffer) in echo_reference_release_buffer() argument
109 er->wr_frames_in -= buffer->frame_count; in echo_reference_release_buffer()
115 free(er->buffer); in echo_reference_reset_l()
[all …]
/system/vold/
DDevmapper.cpp43 char *buffer = (char *) malloc(1024 * 64); in dumpState() local
44 if (!buffer) { in dumpState()
48 memset(buffer, 0, (1024 * 64)); in dumpState()
53 free(buffer); in dumpState()
60 free(buffer); in dumpState()
65 struct dm_ioctl *io = (struct dm_ioctl *) buffer; in dumpState()
70 free(buffer); in dumpState()
76 struct dm_name_list *n = (struct dm_name_list *) (((char *) buffer) + io->data_start); in dumpState()
78 free(buffer); in dumpState()
111 free(buffer); in dumpState()
[all …]
Dvdc.c103 char *buffer = malloc(4096); in do_monitor() local
121 free(buffer); in do_monitor()
128 memset(buffer, 0, 4096); in do_monitor()
129 if ((rc = read(sock, buffer, 4096)) <= 0) { in do_monitor()
134 free(buffer); in do_monitor()
144 if (buffer[i] == '\0') { in do_monitor()
148 strncpy(tmp, buffer + offset, 3); in do_monitor()
152 printf("%s\n", buffer + offset); in do_monitor()
162 free(buffer); in do_monitor()
DProcess.cpp66 void Process::getProcessName(int pid, char *buffer, size_t max) { in getProcessName() argument
68 snprintf(buffer, max, "/proc/%d/cmdline", pid); in getProcessName()
69 fd = open(buffer, O_RDONLY); in getProcessName()
71 strcpy(buffer, "???"); in getProcessName()
73 int length = read(fd, buffer, max - 1); in getProcessName()
74 buffer[length] = 0; in getProcessName()
130 char buffer[PATH_MAX + 100]; in checkFileMaps() local
132 sprintf(buffer, "/proc/%d/maps", pid); in checkFileMaps()
133 file = fopen(buffer, "r"); in checkFileMaps()
137 while (fgets(buffer, sizeof(buffer), file)) { in checkFileMaps()
[all …]
/system/core/fastbootd/
Dconfig.c77 static void config_parse(char *buffer) in config_parse() argument
80 char *str = buffer; in config_parse()
81 char *line = buffer; in config_parse()
104 char *buffer; in config_init() local
120 buffer = malloc(len + 1); in config_init()
121 if (buffer == NULL) { in config_init()
127 ret = read(fd, buffer + count, len - count); in config_init()
140 buffer[len] = '\0'; in config_init()
142 config_parse(buffer); in config_init()
144 free(buffer); in config_init()
Dtransport.c30 ssize_t transport_handle_write(struct transport_handle *thandle, char *buffer, size_t len) in transport_handle_write() argument
32 return thandle->transport->write(thandle, buffer, len); in transport_handle_write()
47 char *buffer; in transport_handle_download() local
57 buffer = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in transport_handle_download()
58 if (buffer == MAP_FAILED) { in transport_handle_download()
64 ret = thandle->transport->read(thandle, buffer + n, len - n); in transport_handle_download()
72 munmap(buffer, len); in transport_handle_download()
92 char buffer[COMMAND_BUF_SIZE + 1]; in transport_data_thread() local
95 ret = thandle->transport->read(thandle, buffer, COMMAND_BUF_SIZE); in transport_data_thread()
101 buffer[ret] = 0; in transport_data_thread()
[all …]
Dsocket_client.c47 char buffer[BUFFER_SIZE]; in run_socket_client() local
72 if ((n = read(STDIN_FD, buffer, BUFFER_SIZE)) < 0) { in run_socket_client()
76 if (bulk_write(fd, buffer, n) < 0) { in run_socket_client()
82 if ((n = read(fd, buffer, BUFFER_SIZE)) < 0) { in run_socket_client()
86 if (bulk_write(STDOUT_FD, buffer, n) < 0) { in run_socket_client()
/system/core/libcutils/
Drecord_stream.c37 unsigned char *buffer; member
55 ret->buffer = (unsigned char *)malloc (maxRecordLen + HEADER_SIZE); in record_stream_new()
57 ret->unconsumed = ret->buffer; in record_stream_new()
58 ret->read_end = ret->buffer; in record_stream_new()
59 ret->buffer_end = ret->buffer + maxRecordLen + HEADER_SIZE; in record_stream_new()
67 free(rs->buffer); in record_stream_free()
143 if (p_rs->unconsumed == p_rs->buffer in record_stream_get_next()
153 if (p_rs->unconsumed != p_rs->buffer) { in record_stream_get_next()
159 memmove(p_rs->buffer, p_rs->unconsumed, toMove); in record_stream_get_next()
162 p_rs->read_end = p_rs->buffer + toMove; in record_stream_get_next()
[all …]
Ddebugger.c117 char buffer[1024]; in dump_backtrace_to_file() local
119 while ((n = TEMP_FAILURE_RETRY(read(sock_fd, buffer, sizeof(buffer)))) > 0) { in dump_backtrace_to_file()
120 if (TEMP_FAILURE_RETRY(write(fd, buffer, n)) != n) { in dump_backtrace_to_file()
136 char buffer[100]; /* This is larger than the largest tombstone path. */ in dump_tombstone() local
138 ssize_t n = TEMP_FAILURE_RETRY(read(sock_fd, buffer, sizeof(buffer) - 1)); in dump_tombstone()
146 buffer[n] = '\0'; in dump_tombstone()
147 memcpy(pathbuf, buffer, n + 1); in dump_tombstone()
/system/core/toolbox/
Dlog.c94 char buffer[4096]; in log_main() local
130 buffer[0] = '\0'; in log_main()
133 strlcat(buffer, argv[i], sizeof(buffer)-1); in log_main()
134 strlcat(buffer, " ", sizeof(buffer)-1); in log_main()
137 if(buffer[0] == 0) { in log_main()
141 __android_log_print(priority, tag, "%s", buffer); in log_main()
Ddmesg.c13 char *buffer; in dmesg_main() local
24 buffer = (char *)malloc(klog_buf_len + 1); in dmesg_main()
26 if (!buffer) { in dmesg_main()
31 p = buffer; in dmesg_main()
39 n = klogctl(op, buffer, klog_buf_len); in dmesg_main()
44 buffer[n] = '\0'; in dmesg_main()
/system/vold/tests/
DVolumeManager_test.cpp38 char buffer[MD5_ASCII_LENGTH_PLUS_NULL]; in TEST_F() local
39 char* dst = reinterpret_cast<char*>(&buffer); in TEST_F()
44 … EXPECT_TRUE(VolumeManager::asecHash(exp1, (char*)NULL, sizeof(buffer)) == NULL && errno == ESPIPE) in TEST_F()
48 …EXPECT_TRUE(VolumeManager::asecHash((const char*)NULL, dst, sizeof(buffer)) == NULL && errno == ES… in TEST_F()
51 EXPECT_FALSE(VolumeManager::asecHash(src1, dst, sizeof(buffer)) == NULL) in TEST_F()
58 EXPECT_FALSE(VolumeManager::asecHash(src2, dst, sizeof(buffer)) == NULL) in TEST_F()
/system/core/adb/
Dtest_track_devices.c57 char buffer[1024]; in main() local
71 len = snprintf( buffer, sizeof buffer, "%04x%s", strlen(request), request ); in main()
72 if (unix_write(s, buffer, len) < 0) in main()
76 if (unix_read(s, buffer, 4) != 4) in main()
79 printf( "server answer: %.*s\n", 4, buffer ); in main()
91 if (unix_read(s, buffer, len) != len) in main()
94 printf( "received header %.*s (%d bytes):\n%.*s", 4, head, len, len, buffer ); in main()
Dtest_track_jdwp.c57 char buffer[1024]; in main() local
71 len = snprintf( buffer, sizeof buffer, "%04x%s", strlen(request), request ); in main()
72 if (unix_write(s, buffer, len) < 0) in main()
76 if (unix_read(s, buffer, 4) != 4) in main()
79 printf( "server answer: %.*s\n", 4, buffer ); in main()
91 if (unix_read(s, buffer, len) != len) in main()
94 printf( "received header %.*s (%d bytes):\n%.*s", 4, head, len, len, buffer ); in main()
Dremount_service.c117 char buffer[200]; in remount_service() local
119 snprintf(buffer, sizeof(buffer), "remount of system failed: %s\n",strerror(errno)); in remount_service()
120 write_string(fd, buffer); in remount_service()
125 snprintf(buffer, sizeof(buffer), "remount of vendor failed: %s\n",strerror(errno)); in remount_service()
126 write_string(fd, buffer); in remount_service()
/system/core/libutils/
DTokenizer.cpp38 Tokenizer::Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, in Tokenizer() argument
41 mBuffer(buffer), mOwnBuffer(ownBuffer), mLength(length), in Tokenizer()
42 mCurrent(buffer), mLineNumber(1) { in Tokenizer()
72 char* buffer; in open() local
75 buffer = static_cast<char*>(fileMap->getDataPtr()); in open()
83 buffer = new char[length]; in open()
85 ssize_t nrd = read(fd, buffer, length); in open()
89 delete[] buffer; in open()
90 buffer = NULL; in open()
97 *outTokenizer = new Tokenizer(filename, fileMap, buffer, ownBuffer, length); in open()
/system/extras/tests/sdcard/
Dtestcase.cpp98 char buffer[32000] = {0,}; in runTest() local
99 char *str = buffer; in runTest()
100 size_t size_left = sizeof(buffer); in runTest()
110 write(mIpc[TestCase::WRITE_TO_PARENT], buffer, str - buffer); in runTest()
131 char buffer[32000] = {0,}; in runTest() local
132 while(read(mIpc[READ_FROM_CHILD], buffer, sizeof(buffer)) != 0) in runTest()
134 printf("%s", buffer); in runTest()
136 memset(buffer, 0, sizeof(buffer)); in runTest()
/system/netd/server/
Dndc.c118 char *buffer = malloc(4096); in do_monitor() local
137 free(buffer); in do_monitor()
144 memset(buffer, 0, 4096); in do_monitor()
145 if ((rc = read(sock, buffer, 4096)) <= 0) { in do_monitor()
151 free(buffer); in do_monitor()
161 if (buffer[i] == '\0') { in do_monitor()
165 strncpy(tmp, buffer + offset, 3); in do_monitor()
169 printf("%s\n", buffer + offset); in do_monitor()
179 free(buffer); in do_monitor()
/system/core/logd/
DLogListener.cpp38 char buffer[sizeof_log_id_t + sizeof(uint16_t) + sizeof(log_time) in onDataAvailable() local
40 struct iovec iov = { buffer, sizeof(buffer) }; in onDataAvailable()
41 memset(buffer, 0, sizeof(buffer)); in onDataAvailable()
85 log_id_t log_id = (log_id_t) *((typeof_log_id_t *) buffer); in onDataAvailable()
89 char *msg = ((char *)buffer) + sizeof_log_id_t; in onDataAvailable()
DLogReader.cpp42 char buffer[255]; in onDataAvailable() local
44 int len = read(cli->getSocket(), buffer, sizeof(buffer) - 1); in onDataAvailable()
49 buffer[len] = '\0'; in onDataAvailable()
53 char *cp = strstr(buffer, _tail); in onDataAvailable()
60 cp = strstr(buffer, _start); in onDataAvailable()
68 cp = strstr(buffer, _logIds); in onDataAvailable()
88 cp = strstr(buffer, _pid); in onDataAvailable()
94 if (strncmp(buffer, "dumpAndClose", 12) == 0) { in onDataAvailable()
/system/core/libcutils/tests/
DMemsetTest.cpp102 static void SetFencepost(uint8_t *buffer) { in SetFencepost() argument
104 buffer[i] = 0xde; in SetFencepost()
105 buffer[i+1] = 0xad; in SetFencepost()
109 static void VerifyFencepost(uint8_t *buffer) { in VerifyFencepost() argument
111 if (buffer[i] != 0xde || buffer[i+1] != 0xad) { in VerifyFencepost()
113 if (buffer[i] == 0xde) { in VerifyFencepost()
119 ASSERT_EQ(expected_value, buffer[i]); in VerifyFencepost()
/system/core/libsysutils/src/
DFrameworkClient.cpp34 char *buffer = (char *) alloca(bufflen); in sendMsg() local
35 if (!buffer) { in sendMsg()
39 snprintf(buffer, bufflen, "%s%s", msg, data); in sendMsg()
40 return sendMsg(buffer); in sendMsg()

12345