cfgfile: remove EAL dependency
This patch removes the dependency to EAL in cfgfile library. Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
parent
55694b2a9f
commit
250fef469e
@ -42,7 +42,6 @@ DEPDIRS-librte_mbuf := librte_eal librte_mempool
|
|||||||
DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer
|
DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer
|
||||||
DEPDIRS-librte_timer := librte_eal
|
DEPDIRS-librte_timer := librte_eal
|
||||||
DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
|
DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
|
||||||
DEPDIRS-librte_cfgfile := librte_eal
|
|
||||||
DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
|
DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
|
||||||
DEPDIRS-librte_cmdline := librte_eal
|
DEPDIRS-librte_cmdline := librte_eal
|
||||||
DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether
|
DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether
|
||||||
|
@ -38,6 +38,7 @@ LIB = librte_cfgfile.a
|
|||||||
|
|
||||||
CFLAGS += -O3
|
CFLAGS += -O3
|
||||||
CFLAGS += $(WERROR_FLAGS)
|
CFLAGS += $(WERROR_FLAGS)
|
||||||
|
CFLAGS += -I$(SRCDIR)/../librte_eal/common/include
|
||||||
|
|
||||||
EXPORT_MAP := rte_cfgfile_version.map
|
EXPORT_MAP := rte_cfgfile_version.map
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <rte_common.h>
|
#include <rte_common.h>
|
||||||
#include <rte_string_fns.h>
|
|
||||||
|
|
||||||
#include "rte_cfgfile.h"
|
#include "rte_cfgfile.h"
|
||||||
|
|
||||||
@ -258,19 +257,25 @@ rte_cfgfile_load_with_params(const char *filename, int flags,
|
|||||||
|
|
||||||
struct rte_cfgfile_section *sect =
|
struct rte_cfgfile_section *sect =
|
||||||
cfg->sections[curr_section];
|
cfg->sections[curr_section];
|
||||||
int n;
|
|
||||||
char *split[2] = {NULL};
|
char *split[2] = {NULL};
|
||||||
n = rte_strsplit(buffer, sizeof(buffer), split, 2, '=');
|
split[0] = buffer;
|
||||||
if (flags & CFG_FLAG_EMPTY_VALUES) {
|
split[1] = memchr(buffer, '=', len);
|
||||||
if ((n < 1) || (n > 2)) {
|
|
||||||
printf("Error at line %d - cannot split string, n=%d\n",
|
/* when delimeter not found */
|
||||||
lineno, n);
|
if (split[1] == NULL) {
|
||||||
goto error1;
|
printf("Error at line %d - cannot "
|
||||||
}
|
"split string\n", lineno);
|
||||||
|
goto error1;
|
||||||
} else {
|
} else {
|
||||||
if (n != 2) {
|
/* when delimeter found */
|
||||||
printf("Error at line %d - cannot split string, n=%d\n",
|
*split[1] = '\0';
|
||||||
lineno, n);
|
split[1]++;
|
||||||
|
|
||||||
|
if (!(flags & CFG_FLAG_EMPTY_VALUES) &&
|
||||||
|
(*split[1] == '\0')) {
|
||||||
|
printf("Error at line %d - cannot "
|
||||||
|
"split string\n", lineno);
|
||||||
goto error1;
|
goto error1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user