/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()
|
D | WifiController.h | 50 virtual int get(int idx, int *buffer) = 0; 62 virtual int get(int idx, char *buffer, size_t max) = 0; 71 int get(int idx, int *buffer); 79 int get(int idx, int *buffer); 87 int get(int idx, int *buffer); 95 int get(int idx, int *buffer); 103 int get(int idx, int *buffer); 111 int get(int idx, int *buffer); 119 int get(int idx, int *buffer); 127 int get(int idx, int *buffer); [all …]
|
/system/core/vold/ |
D | misc.c | 33 void *buffer = NULL; in read_file() local 46 buffer = malloc(size); in read_file() 47 if (!buffer) in read_file() 51 ret = read(fd, buffer, size); in read_file() 60 return buffer; in read_file() 62 char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer, int buffer_size) in truncate_sysfs_path() argument 66 strncpy(buffer, path, buffer_size); in truncate_sysfs_path() 69 char *p = &buffer[strlen(buffer)-1]; in truncate_sysfs_path() 71 for (p = &buffer[strlen(buffer) -1]; *p != '/'; p--); in truncate_sysfs_path() 75 return buffer; in truncate_sysfs_path() [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, &buffer[a]); in parent() [all …]
|
D | ProcessKiller.c | 69 static void GetProcessName(int pid, char buffer[PATH_MAX]) in GetProcessName() 72 sprintf(buffer, "/proc/%d/cmdline", pid); in GetProcessName() 73 fd = open(buffer, O_RDONLY); in GetProcessName() 75 strcpy(buffer, "???"); in GetProcessName() 77 int length = read(fd, buffer, PATH_MAX - 1); in GetProcessName() 78 buffer[length] = 0; in GetProcessName() 127 char buffer[PATH_MAX + 100]; in CheckFileMaps() local 130 sprintf(buffer, "/proc/%d/maps", pid); in CheckFileMaps() 131 file = fopen(buffer, "r"); in CheckFileMaps() 135 while (!mapOpen && 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, &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, &buffer[a]); in parent() [all …]
|
/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_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()
|
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 | file_sync_service.c | 151 static int handle_send_file(int s, char *path, mode_t mode, char *buffer) in handle_send_file() argument 190 if(readx(s, buffer, len)) in handle_send_file() 195 if(writex(fd, buffer, len)) { in handle_send_file() 225 static int handle_send_link(int s, char *path, char *buffer) in handle_send_link() argument 244 if(readx(s, buffer, len)) in handle_send_link() 247 ret = symlink(buffer, path); in handle_send_link() 250 ret = symlink(buffer, path); in handle_send_link() 274 static int do_send(int s, char *path, char *buffer) argument 302 ret = handle_send_link(s, path, buffer); 311 ret = handle_send_file(s, path, mode, buffer); [all …]
|
/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() 438 while (read(hcdfile_fd, &buffer[1], 3)) { in proc_patchram() [all …]
|
/system/core/libsysutils/src/ |
D | FrameworkClient.cpp | 31 char *buffer = (char *) alloca(strlen(msg) + strlen(data) + 1); in sendMsg() local 32 if (!buffer) { in sendMsg() 36 strcpy(buffer, msg); in sendMsg() 37 strcat(buffer, data); in sendMsg() 38 return sendMsg(buffer); in sendMsg()
|
/system/extras/tests/sdcard/ |
D | testcase.cpp | 98 char buffer[32000] = {0,}; in runTest() local 99 char *str = buffer; in runTest() 100 size_t size_left = sizeof(buffer); in runTest() 109 write(mIpc[TestCase::WRITE_TO_PARENT], buffer, str - buffer); in runTest() 130 char buffer[32000] = {0,}; in runTest() local 131 while(read(mIpc[READ_FROM_CHILD], buffer, sizeof(buffer)) != 0) in runTest() 133 printf("%s", buffer); in runTest() 135 memset(buffer, 0, sizeof(buffer)); in runTest()
|