Remove dependency of parser.c to units.h
Move definition of scpi_bool_def to parser.c/.h
| | |
| | | scpi_bool_t SCPI_ParamArbitraryBlock(scpi_t * context, const char ** value, size_t * len, scpi_bool_t mandatory); |
| | | scpi_bool_t SCPI_ParamCopyText(scpi_t * context, char * buffer, size_t buffer_len, size_t * copy_len, scpi_bool_t mandatory); |
| | | |
| | | extern const scpi_choice_def_t scpi_bool_def[]; |
| | | scpi_bool_t SCPI_ParamBool(scpi_t * context, scpi_bool_t * value, scpi_bool_t mandatory); |
| | | scpi_bool_t SCPI_ParamChoice(scpi_t * context, const scpi_choice_def_t * options, int32_t * value, scpi_bool_t mandatory); |
| | | |
| | |
| | | |
| | | extern const scpi_unit_def_t scpi_units_def[]; |
| | | extern const scpi_choice_def_t scpi_special_numbers_def[]; |
| | | extern const scpi_choice_def_t scpi_bool_def[]; |
| | | |
| | | scpi_bool_t SCPI_ParamNumber(scpi_t * context, const scpi_choice_def_t * special, scpi_number_t * value, scpi_bool_t mandatory); |
| | | |
| | |
| | | #include "scpi/error.h" |
| | | #include "scpi/constants.h" |
| | | #include "scpi/utils.h" |
| | | #include "scpi/units.h" |
| | | |
| | | /** |
| | | * Write data to SCPI output |
| | |
| | | return FALSE; |
| | | } |
| | | |
| | | /* |
| | | * Definition of BOOL choice list |
| | | */ |
| | | const scpi_choice_def_t scpi_bool_def[] = { |
| | | {"OFF", 0}, |
| | | {"ON", 1}, |
| | | SCPI_CHOICE_LIST_END /* termination of option list */ |
| | | }; |
| | | |
| | | /** |
| | | * Read BOOL parameter (0,1,ON,OFF) |
| | | * @param context |
| | |
| | | SCPI_CHOICE_LIST_END, |
| | | }; |
| | | |
| | | /* |
| | | * Special number values definition |
| | | */ |
| | | const scpi_choice_def_t scpi_bool_def[] = { |
| | | {"OFF", 0}, |
| | | {"ON", 1}, |
| | | SCPI_CHOICE_LIST_END /* termination of option list */ |
| | | }; |
| | | |
| | | /** |
| | | * Convert string describing unit to its representation |
| | | * @param units units patterns |