Searched refs:buffer (Results 1 - 25 of 87) sorted by relevance

1234

/system/core/libcutils/
H A Dbuffer.c17 #define LOG_TAG "buffer"
24 #include "buffer.h"
28 Buffer* buffer = malloc(sizeof(Buffer)); local
29 if (buffer == NULL) {
32 buffer->capacity = capacity;
33 buffer->expected = 0;
34 buffer->data = malloc(capacity);
35 if (buffer->data == NULL) {
36 free(buffer);
39 return buffer;
42 bufferFree(Buffer* buffer) argument
48 Buffer* buffer = malloc(sizeof(Buffer)); local
60 bufferPrepareForRead(Buffer* buffer, size_t expected) argument
77 bufferRead(Buffer* buffer, int fd) argument
92 bufferPrepareForWrite(Buffer* buffer) argument
96 bufferWrite(Buffer* buffer, int fd) argument
[all...]
H A Dbuffer.h18 * Byte buffer utilities.
31 * Byte buffer of known size. Keeps track of how much data has been read
32 * into or written out of the buffer.
46 /** Actual # of bytes in the buffer. */
49 /** Amount of memory allocated for this buffer. */
54 * Returns true if all data has been read into the buffer.
56 #define bufferReadComplete(buffer) (buffer->expected == buffer->size)
59 * Returns true if the buffer ha
[all...]
H A Drecord_stream.c37 unsigned char *buffer; member in struct:RecordStream
55 ret->buffer = (unsigned char *)malloc (maxRecordLen + HEADER_SIZE);
57 ret->unconsumed = ret->buffer;
58 ret->read_end = ret->buffer;
59 ret->buffer_end = ret->buffer + maxRecordLen + HEADER_SIZE;
67 free(rs->buffer);
72 /* returns NULL; if there isn't a full record in the buffer */
102 /* one full line in the buffer */
134 /* is there one record already in the buffer? */
142 // if the buffer i
[all...]
/system/netd/
H A DIdletimerController.cpp126 char *buffer; local
135 asprintf(&buffer, "%s %s", IPTABLES_PATH, cmd);
136 res = system_nosh(buffer);
137 ALOGV("%s #%d", buffer, res);
138 free(buffer);
149 char *buffer; local
150 asprintf(&buffer, "-t raw -F %s", LOCAL_RAW_PREROUTING);
151 res = runIpxtablesCmd(buffer);
152 free(buffer);
157 asprintf(&buffer, "
177 char *buffer; local
[all...]
H A Dlogwrapper.c31 char buffer[4096]; local
36 while ((sz = read(parent_read, &buffer[b], sizeof(buffer) - 1 - b)) > 0) {
41 if (buffer[b] == '\r') {
42 buffer[b] = '\0';
43 } else if (buffer[b] == '\n') {
44 buffer[b] = '\0';
46 ALOG(LOG_INFO, tag, "%s", &buffer[a]);
51 if (a == 0 && b == sizeof(buffer) - 1) {
52 // buffer i
171 char buffer[255]; local
[all...]
H A Doem_iptables_hook.cpp33 char *buffer; local
42 asprintf(&buffer, "%s %s", IPTABLES_PATH, cmd);
43 res = system_nosh(buffer);
44 free(buffer);
/system/bluetooth/brfpatch/
H A Dbrfpatch.c77 static void process_line(FILE *file_out, char *buf, char *buffer) { argument
78 FAILIF(strncmp(buf, "Send_", 5) != 0, "Not expecting: %s\n", buffer);
83 FAILIF(advance(&buf), "Could not find opcode in: %s\n", buffer); local
85 "Could not find opcode in: %s\n", buffer);
97 "Too much data: %s\n", buffer);
99 "Error parsing (%d): %s\n", __LINE__, buffer);
108 FAILIF(*buf != 'x', "Error parsing: %s\n", buffer);
120 "Error parsing (%d): %s\n", __LINE__, buffer);
126 "Error parsing (%d): %s\n", __LINE__, buffer);
132 "Error parsing (%d): %s\n", __LINE__, buffer);
177 char buffer[1024]; local
[all...]
/system/vold/tests/
H A DVolumeManager_test.cpp38 char buffer[MD5_ASCII_LENGTH_PLUS_NULL]; local
39 char* dst = reinterpret_cast<char*>(&buffer);
44 EXPECT_TRUE(VolumeManager::asecHash(exp1, (char*)NULL, sizeof(buffer)) == NULL && errno == ESPIPE)
45 << "Should return NULL and set errno to ESPIPE when destination buffer is NULL";
47 << "Should return NULL and set errno to ESPIPE when destination buffer length is 0";
48 EXPECT_TRUE(VolumeManager::asecHash((const char*)NULL, dst, sizeof(buffer)) == NULL && errno == ESPIPE)
49 << "Should return NULL and set errno to ESPIPE when source buffer is NULL";
51 EXPECT_FALSE(VolumeManager::asecHash(src1, dst, sizeof(buffer)) == NULL)
58 EXPECT_FALSE(VolumeManager::asecHash(src2, dst, sizeof(buffer)) == NULL)
/system/vold/
H A DDevmapper.cpp43 char *buffer = (char *) malloc(1024 * 64); local
44 if (!buffer) {
48 memset(buffer, 0, (1024 * 64));
53 free(buffer);
60 free(buffer);
65 struct dm_ioctl *io = (struct dm_ioctl *) buffer;
70 free(buffer);
76 struct dm_name_list *n = (struct dm_name_list *) (((char *) buffer) + io->data_start);
78 free(buffer);
111 free(buffer);
134 char *buffer = (char *) malloc(DEVMAPPER_BUFFER_SIZE); local
168 char *buffer = (char *) malloc(DEVMAPPER_BUFFER_SIZE); local
265 char *buffer = (char *) malloc(DEVMAPPER_BUFFER_SIZE); local
[all...]
H A Dlogwrapper.c32 char buffer[4096]; local
37 while ((sz = read(parent_read, &buffer[b], sizeof(buffer) - 1 - b)) > 0) {
42 if (buffer[b] == '\r') {
43 buffer[b] = '\0';
44 } else if (buffer[b] == '\n') {
45 buffer[b] = '\0';
47 ALOG(LOG_INFO, tag, "%s", &buffer[a]);
52 if (a == 0 && b == sizeof(buffer) - 1) {
53 // buffer i
[all...]
H A Dvdc.c85 char *buffer = malloc(4096); local
103 free(buffer);
110 memset(buffer, 0, 4096);
111 if ((rc = read(sock, buffer, 4096)) <= 0) {
116 free(buffer);
126 if (buffer[i] == '\0') {
130 strncpy(tmp, buffer + offset, 3);
134 printf("%s\n", buffer + offset);
144 free(buffer);
H A DDevmapper.h28 unsigned int numSectors, char *buffer, size_t len);
30 static int lookupActive(const char *name, char *buffer, size_t len);
/system/core/logwrapper/
H A Dlogwrapper.c50 char buffer[4096]; local
59 while ((sz = read(parent_read, &buffer[b], sizeof(buffer) - 1 - b)) > 0) {
64 if (buffer[b] == '\r') {
65 buffer[b] = '\0';
66 } else if (buffer[b] == '\n') {
67 buffer[b] = '\0';
68 ALOG(LOG_INFO, btag, "%s", &buffer[a]);
73 if (a == 0 && b == sizeof(buffer) - 1) {
74 // buffer i
[all...]
/system/core/include/cutils/
H A Duevent.h28 ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length);
29 ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, size_t length, uid_t *uid);
/system/core/toolbox/
H A Dlog.c94 char buffer[4096]; local
130 buffer[0] = '\0';
133 strncat(buffer, argv[i], sizeof(buffer)-1);
134 strncat(buffer, " ", sizeof(buffer)-1);
137 if(buffer[0] == 0) {
141 __android_log_print(priority, tag, "%s", buffer);
H A Ddmesg.c13 char buffer[KLOG_BUF_LEN + 1]; local
14 char *p = buffer;
24 n = klogctl(op, buffer, KLOG_BUF_LEN);
29 buffer[n] = '\0';
/system/media/audio_utils/
H A Decho_reference.c47 void *buffer; // main buffer member in struct:echo_reference
48 size_t buf_size; // main buffer size in frames
49 size_t frames_in; // number of frames in main buffer
50 void *wr_buf; // buffer for input conversions
51 size_t wr_buf_size; // size of conversion buffer in frames
52 size_t wr_frames_in; // number of frames in conversion buffer
54 void *wr_src_buf; // resampler input buf (either wr_buf or buffer used by write())
57 int32_t playback_delay; // playback buffer delay indicated by last write()
64 struct resampler_buffer_provider provider; // resampler buffer provide
68 echo_reference_get_next_buffer(struct resampler_buffer_provider *buffer_provider, struct resampler_buffer* buffer) argument
93 echo_reference_release_buffer(struct resampler_buffer_provider *buffer_provider, struct resampler_buffer* buffer) argument
129 echo_reference_write(struct echo_reference_itfe *echo_reference, struct echo_reference_buffer *buffer) argument
291 echo_reference_read(struct echo_reference_itfe *echo_reference, struct echo_reference_buffer *buffer) argument
[all...]
/system/core/include/sysutils/
H A DNetlinkEvent.h41 bool decode(char *buffer, int size, int format = NetlinkListener::NETLINK_FORMAT_ASCII);
50 bool parseBinaryNetlinkMessage(char *buffer, int size);
51 bool parseAsciiNetlinkMessage(char *buffer, int size);
/system/core/libsysutils/src/
H A DFrameworkClient.cpp34 char *buffer = (char *) alloca(bufflen); local
35 if (!buffer) {
39 snprintf(buffer, bufflen, "%s%s", msg, data);
40 return sendMsg(buffer);
/system/core/adb/
H A Dtest_track_devices.c57 char buffer[1024]; local
71 len = snprintf( buffer, sizeof buffer, "%04x%s", strlen(request), request );
72 if (unix_write(s, buffer, len) < 0)
76 if (unix_read(s, buffer, 4) != 4)
79 printf( "server answer: %.*s\n", 4, buffer );
91 if (unix_read(s, buffer, len) != len)
94 printf( "received header %.*s (%d bytes):\n%.*s", 4, head, len, len, buffer );
H A Dtest_track_jdwp.c57 char buffer[1024]; local
71 len = snprintf( buffer, sizeof buffer, "%04x%s", strlen(request), request );
72 if (unix_write(s, buffer, len) < 0)
76 if (unix_read(s, buffer, 4) != 4)
79 printf( "server answer: %.*s\n", 4, buffer );
91 if (unix_read(s, buffer, len) != len)
94 printf( "received header %.*s (%d bytes):\n%.*s", 4, head, len, len, buffer );
H A Dremount_service.c104 char buffer[200]; local
105 snprintf(buffer, sizeof(buffer), "remount failed: %s\n", strerror(errno));
106 write_string(fd, buffer);
/system/extras/tests/bionic/libc/common/
H A Dbench_stdio.c42 static char buffer[1024*1024]; variable
55 int totalSize = sizeof(buffer);
57 fread(buffer, 1, chunkSize, fp);
63 int totalSize = sizeof(buffer);
65 fwrite(buffer, 1, chunkSize, fp);
74 double bandwidth = sizeof(buffer)*1000./1024./time_ms; \
/system/media/audio_utils/include/audio_utils/
H A Decho_reference.h28 size_t frame_count; // number of frames in buffer
29 int32_t delay_ns; // delay for this buffer (see comment below)
30 struct timespec time_stamp; // time stamp for this buffer (see comment below)
50 int (*read)(struct echo_reference_itfe *echo_reference, struct echo_reference_buffer *buffer);
51 int (*write)(struct echo_reference_itfe *echo_reference, struct echo_reference_buffer *buffer);
/system/extras/tests/sdcard/
H A Dtestcase.cpp98 char buffer[32000] = {0,}; local
99 char *str = buffer;
100 size_t size_left = sizeof(buffer);
110 write(mIpc[TestCase::WRITE_TO_PARENT], buffer, str - buffer);
131 char buffer[32000] = {0,}; local
132 while(read(mIpc[READ_FROM_CHILD], buffer, sizeof(buffer)) != 0)
134 printf("%s", buffer);
136 memset(buffer,
[all...]

Completed in 221 milliseconds

1234