[24.03,RFC,2/3] eal: allow export of the cmdline argument parsing options
Checks
Commit Message
Allow other libraries in DPDK to know about the options EAL takes, by
exporting the long and short getopt options via an internal-only
function.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/eal/common/eal_common_options.c | 9 +++++++++
lib/eal/include/rte_eal.h | 14 ++++++++++++++
lib/eal/version.map | 1 +
3 files changed, 24 insertions(+)
@@ -175,6 +175,15 @@ rte_set_application_usage_hook(rte_usage_hook_t usage_func)
return old_func;
}
+__rte_internal
+int
+rte_eal_getopt_params(const char **shortopts, const struct option **longopts)
+{
+ *shortopts = eal_short_options;
+ *longopts = eal_long_options;
+ return 0;
+}
+
#ifndef RTE_EXEC_ENV_WINDOWS
static char **eal_args;
static char **eal_app_args;
@@ -514,6 +514,20 @@ __rte_internal
int
rte_eal_parse_coremask(const char *coremask, int *cores);
+struct option;
+/**
+ * @internal
+ * Return the getopt parameters used by EAL when parsing cmdline arguments
+ *
+ * @shortopts
+ * Pointer for the short options for getopt
+ * @longopts
+ * Pointer for the longer options used by getopt_long
+ */
+__rte_internal
+int
+rte_eal_getopt_params(const char **shortopts, const struct option **longopts);
+
#ifdef __cplusplus
}
#endif
@@ -421,6 +421,7 @@ INTERNAL {
rte_bus_register;
rte_bus_unregister;
rte_eal_get_baseaddr;
+ rte_eal_getopt_params;
rte_eal_parse_coremask;
rte_firmware_read;
rte_intr_allow_others;