Home
last modified time | relevance | path

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

1234567

/system/core/libcutils/
Dbuffer.c28 Buffer* buffer = malloc(sizeof(Buffer)); in bufferCreate() local
29 if (buffer == NULL) { in bufferCreate()
32 buffer->capacity = capacity; in bufferCreate()
33 buffer->expected = 0; in bufferCreate()
34 buffer->data = malloc(capacity); in bufferCreate()
35 if (buffer->data == NULL) { in bufferCreate()
36 free(buffer); in bufferCreate()
39 return buffer; in bufferCreate()
42 void bufferFree(Buffer* buffer) { in bufferFree() argument
43 free(buffer->data); in bufferFree()
[all …]
Dbuffer.h56 #define bufferReadComplete(buffer) (buffer->expected == buffer->size) argument
61 #define bufferWriteComplete(buffer) (buffer->remaining == 0) argument
76 void bufferFree(Buffer* buffer);
83 int bufferPrepareForRead(Buffer* buffer, size_t expected);
92 ssize_t bufferRead(Buffer* buffer, int fd);
97 void bufferPrepareForWrite(Buffer* buffer);
106 ssize_t bufferWrite(Buffer* buffer, int fd);
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 …]
/system/core/nexus/
DDhcpState.cpp24 char *DhcpState::toString(int val, char *buffer, int max) { in toString() argument
26 strncpy(buffer, "INIT", max); in toString()
28 strncpy(buffer, "DISCOVERING", max); in toString()
30 strncpy(buffer, "REQUESTING", max); in toString()
32 strncpy(buffer, "BOUND", max); in toString()
34 strncpy(buffer, "RENEWING", max); in toString()
36 strncpy(buffer, "REBINDING", max); in toString()
38 strncpy(buffer, "REBOOT", max); in toString()
40 strncpy(buffer, "RENEW_REQUESTED", max); in toString()
42 strncpy(buffer, "INIT_IPV4LL", max); in toString()
[all …]
DDhcpEvent.cpp24 char *DhcpEvent::toString(int val, char *buffer, int max) { in toString() argument
26 strncpy(buffer, "UNKNOWN", max); in toString()
28 strncpy(buffer, "STOP", max); in toString()
30 strncpy(buffer, "RENEW", max); in toString()
32 strncpy(buffer, "RELEASE", max); in toString()
34 strncpy(buffer, "TIMEOUT", max); in toString()
36 strncpy(buffer, "(internal error)", max); in toString()
38 return buffer; in toString()
41 int DhcpEvent::parseString(const char *buffer) { in parseString() argument
42 if (!strcasecmp(buffer, "UNKNOWN")) in parseString()
[all …]
DSupplicantState.cpp24 char *SupplicantState::toString(int val, char *buffer, int max) { in toString() argument
26 strncpy(buffer, "UNKNOWN", max); in toString()
28 strncpy(buffer, "DISCONNECTED", max); in toString()
30 strncpy(buffer, "INACTIVE", max); in toString()
32 strncpy(buffer, "SCANNING", max); in toString()
34 strncpy(buffer, "ASSOCIATING", max); in toString()
36 strncpy(buffer, "ASSOCIATED", max); in toString()
38 strncpy(buffer, "FOURWAY_HANDSHAKE", max); in toString()
40 strncpy(buffer, "GROUP_HANDSHAKE", max); in toString()
42 strncpy(buffer, "COMPLETED", max); in toString()
[all …]
DDhcpListener.cpp41 char buffer[255]; in onDataAvailable() local
44 if ((rc = read(cli->getSocket(), buffer, sizeof(buffer))) < 0) { in onDataAvailable()
49 if (!strncmp(buffer, "STATE:", 6)) { in onDataAvailable()
50 char *next = buffer; in onDataAvailable()
56 LOGW("Error parsing state '%s'", buffer); in onDataAvailable()
63 } else if (!strncmp(buffer, "ADDRINFO:", 9)) { in onDataAvailable()
64 char *next = buffer + 9; in onDataAvailable()
88 } else if (!strncmp(buffer, "EVENT:", 6)) { in onDataAvailable()
89 char *next = buffer; in onDataAvailable()
95 LOGW("Error parsing event '%s'", buffer); in onDataAvailable()
[all …]
DProperty.h44 virtual int get(int idx, char *buffer, size_t max) = 0;
45 virtual int get(int idx, int *buffer) = 0;
46 virtual int get(int idx, struct in_addr *buffer) = 0;
63 virtual int get(int idx, char *buffer, size_t max) = 0;
64 int get(int idx, int *buffer);
65 int get(int idx, struct in_addr *buffer);
73 char *buffer, size_t max);
75 int get(int idx, char *buffer, size_t max);
87 int get(int idx, char *buffer, size_t max);
88 virtual int get(int idx, int *buffer) = 0;
[all …]
DWifiNetwork.cpp185 char buffer[255]; in refresh() local
189 len = sizeof(buffer); in refresh()
190 if (mSuppl->getNetworkVar(mNetid, "psk", buffer, len)) in refresh()
191 mPsk = strdup(buffer); in refresh()
197 len = sizeof(buffer); in refresh()
198 if (mSuppl->getNetworkVar(mNetid, name, buffer, len)) in refresh()
199 mWepKeys[i] = strdup(buffer); in refresh()
203 len = sizeof(buffer); in refresh()
204 if (mSuppl->getNetworkVar(mNetid, "wep_tx_keyidx", buffer, len)) in refresh()
205 mDefaultKeyIndex = atoi(buffer); in refresh()
[all …]
DProperty.cpp50 int StringProperty::get(int idx, int *buffer) { in get() argument
55 int StringProperty::get(int idx, struct in_addr *buffer) { in get() argument
62 char *buffer, size_t max) : in StringPropertyHelper() argument
64 mBuffer = buffer; in StringPropertyHelper()
78 int StringPropertyHelper::get(int idx, char *buffer, size_t max) { in get() argument
84 strncpy(buffer, mBuffer, max); in get()
102 int IntegerProperty::get(int idx, char *buffer, size_t max) { in get() argument
107 int IntegerProperty::get(int idx, struct in_addr *buffer) { in get() argument
114 int *buffer) : in IntegerPropertyHelper() argument
116 mBuffer = buffer; in IntegerPropertyHelper()
[all …]
DWifiNetwork.h79 virtual int get(int idx, int *buffer) = 0;
91 virtual int get(int idx, char *buffer, size_t max) = 0;
100 int get(int idx, int *buffer);
108 int get(int idx, int *buffer);
116 int get(int idx, int *buffer);
124 int get(int idx, char *buffer, size_t max);
132 int get(int idx, char *buffer, size_t max);
140 int get(int idx, char *buffer, size_t max);
148 int get(int idx, char *buffer, size_t max);
156 int get(int idx, char *buffer, size_t max);
[all …]
Dnexctl.c81 char *buffer = malloc(4096); in do_monitor() local
99 free(buffer); in do_monitor()
106 memset(buffer, 0, 4096); in do_monitor()
107 if ((rc = read(sock, buffer, 4096)) <= 0) { in do_monitor()
112 free(buffer); in do_monitor()
122 if (buffer[i] == '\0') { in do_monitor()
126 strncpy(tmp, buffer + offset, 3); in do_monitor()
130 printf("%s\n", buffer + offset); in do_monitor()
140 free(buffer); in do_monitor()
/system/vold/
DDevmapper.cpp39 char *buffer = (char *) malloc(1024 * 64); in dumpState() local
40 if (!buffer) { in dumpState()
44 memset(buffer, 0, (1024 * 64)); in dumpState()
49 free(buffer); in dumpState()
56 free(buffer); in dumpState()
61 struct dm_ioctl *io = (struct dm_ioctl *) buffer; in dumpState()
66 free(buffer); in dumpState()
72 struct dm_name_list *n = (struct dm_name_list *) (((char *) buffer) + io->data_start); in dumpState()
74 free(buffer); in dumpState()
107 free(buffer); in dumpState()
[all …]
Dlogwrapper.c31 char buffer[4096]; in parent() local
36 while ((sz = read(parent_read, &buffer[b], sizeof(buffer) - 1 - b)) > 0) { in parent()
41 if (buffer[b] == '\r') { in parent()
42 buffer[b] = '\0'; in parent()
43 } else if (buffer[b] == '\n') { in parent()
44 buffer[b] = '\0'; in parent()
46 LOG(LOG_INFO, tag, "%s", &buffer[a]); in parent()
51 if (a == 0 && b == sizeof(buffer) - 1) { in parent()
53 buffer[b] = '\0'; in parent()
54 LOG(LOG_INFO, tag, "%s", &buffer[a]); in parent()
[all …]
Dvdc.c81 char *buffer = malloc(4096); in do_monitor() local
99 free(buffer); in do_monitor()
106 memset(buffer, 0, 4096); in do_monitor()
107 if ((rc = read(sock, buffer, 4096)) <= 0) { in do_monitor()
112 free(buffer); in do_monitor()
122 if (buffer[i] == '\0') { in do_monitor()
126 strncpy(tmp, buffer + offset, 3); in do_monitor()
130 printf("%s\n", buffer + offset); in do_monitor()
140 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/bluetooth/brfpatch/
Dbrfpatch.c77 static void process_line(FILE *file_out, char *buf, char *buffer) { in process_line() argument
78 FAILIF(strncmp(buf, "Send_", 5) != 0, "Not expecting: %s\n", buffer); in process_line()
83 FAILIF(advance(&buf), "Could not find opcode in: %s\n", buffer); in process_line()
85 "Could not find opcode in: %s\n", buffer); in process_line()
97 "Too much data: %s\n", buffer); in process_line()
99 "Error parsing (%d): %s\n", __LINE__, buffer); in process_line()
108 FAILIF(*buf != 'x', "Error parsing: %s\n", buffer); in process_line()
120 "Error parsing (%d): %s\n", __LINE__, buffer); in process_line()
126 "Error parsing (%d): %s\n", __LINE__, buffer); in process_line()
132 "Error parsing (%d): %s\n", __LINE__, buffer); in process_line()
[all …]
/system/core/logwrapper/
Dlogwrapper.c49 char buffer[4096]; in parent() local
54 while ((sz = read(parent_read, &buffer[b], sizeof(buffer) - 1 - b)) > 0) { in parent()
59 if (buffer[b] == '\r') { in parent()
60 buffer[b] = '\0'; in parent()
61 } else if (buffer[b] == '\n') { in parent()
62 buffer[b] = '\0'; in parent()
63 LOG(LOG_INFO, tag, "%s", &buffer[a]); in parent()
68 if (a == 0 && b == sizeof(buffer) - 1) { in parent()
70 buffer[b] = '\0'; in parent()
71 LOG(LOG_INFO, tag, "%s", &buffer[a]); in parent()
[all …]
/system/netd/
Dlogwrapper.c31 char buffer[4096]; in parent() local
36 while ((sz = read(parent_read, &buffer[b], sizeof(buffer) - 1 - b)) > 0) { in parent()
41 if (buffer[b] == '\r') { in parent()
42 buffer[b] = '\0'; in parent()
43 } else if (buffer[b] == '\n') { in parent()
44 buffer[b] = '\0'; in parent()
46 LOG(LOG_INFO, tag, "%s", &buffer[a]); in parent()
51 if (a == 0 && b == sizeof(buffer) - 1) { in parent()
53 buffer[b] = '\0'; in parent()
54 LOG(LOG_INFO, tag, "%s", &buffer[a]); in parent()
[all …]
Dndc.c81 char *buffer = malloc(4096); in do_monitor() local
99 free(buffer); in do_monitor()
106 memset(buffer, 0, 4096); in do_monitor()
107 if ((rc = read(sock, buffer, 4096)) <= 0) { in do_monitor()
112 free(buffer); in do_monitor()
122 if (buffer[i] == '\0') { in do_monitor()
126 strncpy(tmp, buffer + offset, 3); in do_monitor()
130 printf("%s\n", buffer + offset); in do_monitor()
140 free(buffer); in do_monitor()
/system/core/toolbox/
Dlog.c94 char buffer[4096]; in log_main() local
130 buffer[0] = '\0'; in log_main()
133 strncat(buffer, argv[i], sizeof(buffer)-1); in log_main()
134 strncat(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()
/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()
/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/bluetooth/brcm_patchram_plus/
Dbrcm_patchram_plus.c103 unsigned char buffer[1024]; variable
367 read_event(int fd, unsigned char *buffer) in read_event() argument
373 while ((count = read(fd, &buffer[i], len)) < len) { in read_event()
379 len = buffer[2]; in read_event()
381 while ((count = read(fd, &buffer[i], len)) < len) { in read_event()
390 dump(buffer, count); in read_event()
422 read_event(uart_fd, buffer); in proc_reset()
434 read_event(uart_fd, buffer); in proc_patchram()
436 read(uart_fd, &buffer[0], 2); in proc_patchram()
440 while (read(hcdfile_fd, &buffer[1], 3)) { in proc_patchram()
[all …]

1234567