1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2018 Intel Corporation
10 #include <rte_common.h>
17 if ((strlen(in) && index("!#%;", in[0])) ||
18 (strncmp(in, "//", 2) == 0) ||
19 (strncmp(in, "--", 2) == 0))
26 cli_process(char *in, char *out __rte_unused, size_t out_size __rte_unused)
34 cli_script_process(const char *file_name,
35 size_t msg_in_len_max,
36 size_t msg_out_len_max)
38 char *msg_in = NULL, *msg_out = NULL;
41 /* Check input arguments */
42 if ((file_name == NULL) ||
43 (strlen(file_name) == 0) ||
44 (msg_in_len_max == 0) ||
45 (msg_out_len_max == 0))
48 msg_in = malloc(msg_in_len_max + 1);
49 msg_out = malloc(msg_out_len_max + 1);
50 if ((msg_in == NULL) ||
58 f = fopen(file_name, "r");
67 if (fgets(msg_in, msg_in_len_max + 1, f) == NULL)
78 printf("%s", msg_out);