/system/core/libcutils/ |
D | buffer.c | 28 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 …]
|
D | buffer.h | 56 #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);
|
D | record_stream.c | 37 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/ |
D | DhcpState.cpp | 24 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 …]
|
D | DhcpEvent.cpp | 24 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 …]
|
D | SupplicantState.cpp | 24 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 …]
|
D | DhcpListener.cpp | 41 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 …]
|
D | Property.h | 44 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 …]
|
D | WifiNetwork.cpp | 185 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 …]
|
D | Property.cpp | 50 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 …]
|
D | WifiNetwork.h | 79 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 …]
|
D | nexctl.c | 81 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/ |
D | Devmapper.cpp | 39 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 …]
|
D | logwrapper.c | 31 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 …]
|
D | vdc.c | 81 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()
|
D | Process.cpp | 66 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/ |
D | brfpatch.c | 77 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/ |
D | logwrapper.c | 49 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/ |
D | logwrapper.c | 31 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 …]
|
D | ndc.c | 81 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/ |
D | log.c | 94 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/ |
D | test_track_devices.c | 57 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()
|
D | test_track_jdwp.c | 57 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/ |
D | VolumeManager_test.cpp | 38 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/ |
D | brcm_patchram_plus.c | 103 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 …]
|