Jan Breuer
2017-08-07 3cf1b428ae61e6c47abaef1be41f0e2d01374303
Remove dependency of parser.c to units.h

Move definition of scpi_bool_def to parser.c/.h
4个文件已修改
21 ■■■■ 已修改文件
libscpi/inc/scpi/parser.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/inc/scpi/units.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/src/parser.c 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/src/units.c 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/inc/scpi/parser.h
@@ -114,6 +114,7 @@
    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);
libscpi/inc/scpi/units.h
@@ -45,7 +45,6 @@
    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);
libscpi/src/parser.c
@@ -44,7 +44,6 @@
#include "scpi/error.h"
#include "scpi/constants.h"
#include "scpi/utils.h"
#include "scpi/units.h"
/**
 * Write data to SCPI output
@@ -1271,6 +1270,15 @@
    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
libscpi/src/units.c
@@ -285,15 +285,6 @@
    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