From 932061c92277c46278b2b4027e1fdb873e1bc19b Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周二, 04 12月 2012 18:28:17 +0800 Subject: [PATCH] Update README - file structure --- scpi/scpi_units.h | 59 ++++++----------------------------------------------------- 1 files changed, 6 insertions(+), 53 deletions(-) diff --git a/scpi/scpi_units.h b/scpi/scpi_units.h index 7144728..c02f947 100644 --- a/scpi/scpi_units.h +++ b/scpi/scpi_units.h @@ -37,64 +37,17 @@ #ifndef SCPI_UNITS_H #define SCPI_UNITS_H -#include "scpi.h" +#include "scpi_types.h" #ifdef __cplusplus extern "C" { #endif - enum _scpi_unit_t { - SCPI_UNIT_NONE, - SCPI_UNIT_VOLT, - SCPI_UNIT_AMPER, - SCPI_UNIT_OHM, - SCPI_UNIT_HERTZ, - SCPI_UNIT_CELSIUS, - SCPI_UNIT_SECONDS, - }; - typedef enum _scpi_unit_t scpi_unit_t; - - struct _scpi_unit_def_t { - const char * name; - scpi_unit_t unit; - double mult; - }; - typedef struct _scpi_unit_def_t scpi_unit_def_t; - -#define SCPI_UNITS_LIST_END {.name = NULL, .unit = SCPI_UNIT_NONE, .mult = 0} - - enum _scpi_special_number_t { - SCPI_NUM_NUMBER, - SCPI_NUM_MIN, - SCPI_NUM_MAX, - SCPI_NUM_DEF, - SCPI_NUM_UP, - SCPI_NUM_DOWN, - SCPI_NUM_NAN, - SCPI_NUM_INF, - SCPI_NUM_NINF, - }; - typedef enum _scpi_special_number_t scpi_special_number_t; - - struct _scpi_special_number_def_t { - const char * name; - scpi_special_number_t type; - }; - typedef struct _scpi_special_number_def_t scpi_special_number_def_t; - - struct _scpi_number_t { - double value; - scpi_unit_t unit; - scpi_special_number_t type; - }; - typedef struct _scpi_number_t scpi_number_t; - - -#define SCPI_SPECIAL_NUMBERS_LIST_END {.name = NULL, .type = SCPI_NUM_NUMBER} - - - bool_t SCPI_ParamNumber(scpi_context_t * context, scpi_number_t * value, bool_t mandatory); - + extern const scpi_unit_def_t scpi_units_def[]; + extern const scpi_special_number_def_t scpi_special_numbers_def[]; + + bool_t SCPI_ParamNumber(scpi_t * context, scpi_number_t * value, bool_t mandatory); + size_t SCPI_NumberToStr(scpi_t * context, scpi_number_t * value, char * str, size_t len); #ifdef __cplusplus } -- Gitblit v1.9.1