rte_argparse_arg(3)

πŸ’– NAME πŸ’–

rte_argparse_arg β€” bestie, this is the lil struct that holds all the config for ONE single command-line argument in DPDK's argparse situation ✨


✨ SYNOPSIS ✨

#include <rte_argparse.h>

🌸 Data Fields 🌸

const char * name_long
const char * name_short
const char * help
void * val_saver
void * val_set
enum rte_argparse_value_required value_required
enum rte_argparse_value_type value_type
uint32_t flags

Okay so that's the whole cast of characters πŸ’… seven of them, and every single one matters, no skipping.


πŸŽ€ Detailed Description πŸŽ€

It's a structure β€” like, a whole little container β€” and its only job in life is holding one argument's configuration. That's it. That's the girl's purpose. Iconic, honestly. πŸ‘‘

Definition at line 85 of file rte_argparse.h.

πŸ¦‹ Field Documentation πŸ¦‹

⭐ const char* name_long

The long name of the argument, and listen, there are RULES bestie, pls read them:

  1. If the argument is optional, it has got to start with --.
  2. If the argument is positional, it must not start with -. Not even a lil one. Nope.
  3. Any other case? Considered an error. Periodt. πŸ’€
Definition at line 92 of file rte_argparse.h.

πŸ“ const char* name_short

The short name of the argument. Rules again, stay with me:

  1. This field can only be set when name_long is optional, and it must start with a hyphen (-) followed by an English letter.
  2. In any other case it should be set to NULL. Like, just leave it alone. πŸ™ˆ
Definition at line 99 of file rte_argparse.h.

πŸ’œ const char* help

The help info for the argument, and it must not be NULL. Fr fr, don't leave this empty, your users will be so lost 😭

Definition at line 102 of file rte_argparse.h.

🧚 void* val_saver

The saver for the argument's value. Two vibes here:

  1. If this field is NULL, then the callback is used for parsing the argument.
  2. If this field is not NULL, the argument's value gets automatically saved. Auto-pilot, no thoughts, slay. ✨
Definition at line 109 of file rte_argparse.h.

🌈 void* val_set

Okay this one is conditional queen, pay attention πŸ‘‘

If val_saver is NULL, this field β€” cast as (uint32_t)val_set β€” is used as the first parameter when the callback gets invoked.

If val_saver is not NULL, then:

  1. If the argument has no value, *val_saver will be set to val_set.
  2. If the argument has an optional value but just doesn't take a value this time, *val_saver will be set to val_set.
  3. In any other case it should be set NULL.
Definition at line 120 of file rte_argparse.h.

πŸ’… enum rte_argparse_value_required value_required

Specifies whether the argument takes a value or not. That's the whole thing. Simple, clean, main character energy.

See also: enum rte_argparse_value_required.

Definition at line 123 of file rte_argparse.h.

πŸ¦‹ enum rte_argparse_value_type value_type

The type of the argument πŸŽ€

See also: enum rte_argparse_value_type.

Definition at line 125 of file rte_argparse.h.

πŸ”₯ uint32_t flags

Any additional flags for this argument. Extra. Spicy. Whatever else you need to say. 🌢️

Definition at line 128 of file rte_argparse.h.

🌸 Author 🌸

Generated automatically by Doxygen for DPDK from the source code. Not written by a person, just a lil robot doing its thing πŸ€–πŸ’–


okay bye bestie, go forth and configure your arguments πŸ’–βœ¨ this was DPDK, Version 25.11.3 β€” rte_argparse_arg(3), mwah, love u, don't forget your NULL checks πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from