| | |
| | | * |
| | | * prev and current should be in the same memory buffer |
| | | */ |
| | | |
| | | //组合复合SCPI命令 |
| | | scpi_bool_t composeCompoundCommand(const scpi_token_t * prev, scpi_token_t * current) { |
| | | size_t i; |
| | | |
| | |
| | | return TRUE; |
| | | |
| | | /* Common command or command root - nothing to do */ |
| | | // 当前命令是公共命令(*)或根命令(:) |
| | | if (current->ptr[0] == '*' || current->ptr[0] == ':') |
| | | return TRUE; |
| | | |
| | |
| | | |
| | | current->ptr -= i; |
| | | current->len += i; |
| | | //复合命令组合 |
| | | memmove(current->ptr, prev->ptr, i); |
| | | return TRUE; |
| | | } |
| | |
| | | #if USE_MEMORY_ALLOCATION_FREE && !HAVE_STRNDUP |
| | | char *OUR_strndup(const char *s, size_t n) { |
| | | size_t len = SCPIDEFINE_strnlen(s, n); |
| | | char * result = malloc(len + 1); |
| | | //msvc下需要强转 |
| | | char * result =(char*) malloc(len + 1); |
| | | if (!result) { |
| | | return NULL; |
| | | } |