| | |
| | | #include<scpi/config.h> |
| | | #include<scpi/types.h> |
| | | |
| | | |
| | | #ifdef _WIN32 |
| | | #include <string.h> |
| | | #define strncasecmp _strnicmp |
| | | #else |
| | | #include <strings.h> |
| | | #endif |
| | | |
| | | #ifdef __cplusplus |
| | | extern "C" { |
| | | #endif |
| | |
| | | scpi_bool_t matchCommand(const char * pattern, const char * cmd, size_t len, int32_t *numbers, size_t numbers_len, int32_t default_value) LOCAL; |
| | | scpi_bool_t composeCompoundCommand(const scpi_token_t * prev, scpi_token_t * current) LOCAL; |
| | | |
| | | |
| | | |
| | | typedef struct { |
| | | bool is_variable; // 是否为可变部分(用[]括起来的) |
| | | char text[32]; // 段内容(不包含[]) |
| | | } Segment; |
| | | |
| | | int parse_pattern(const char* pattern, Segment segments[], int max_segments); |
| | | bool match_command(const char* command, Segment segments[], int seg_count); |
| | | bool test_match(const char* pattern, const char* command); |
| | | |
| | | #define SCPI_DTOSTRE_UPPERCASE 1 |
| | | #define SCPI_DTOSTRE_ALWAYS_SIGN 2 |
| | | #define SCPI_DTOSTRE_PLUS_SIGN 4 |