rte_argparse_arg(3)

πŸ“¦ version 26.03, in nixos 26.05, nixpkgs unstable

πŸ’… rte_argparse_arg (that's section 3 of the manual, bestie)

Okay so. Picture this: you're deep in DPDK land, you're writing a <rte_argparse.h> situation, and you need a struct to hold one single argument's whole configuration. That's literally this page. It's the Library Functions Manual entry, freshly shipped from the DPDK girlies. Sit down, grab a strawberry drink πŸ“, and let's go.


✨ SYNOPSIS ✨

#include <rte_argparse.h>

πŸŽ€ Data Fields πŸŽ€

Here's the whole squad, in order, no cap:

  • 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

🌸 DESCRIPTION 🌸

A structure used to hold argument's configuration. That's it, that's the whole vibe β€” it's the little container that tells the parser everything it needs to know about one argument. 🫢

Where does it live? Definition at line 84 of file rte_argparse.h.

πŸ‘‘ FIELD DOCUMENTATION πŸ‘‘

⭐ const char* name_long

The long name of the argument. Rules, and the parser is so serious about them:

  1. If the argument is optional, it must start with --.
  2. If the argument is positional, it must not start with -.
  3. Other case will be considered as error. πŸ’€ (like, actually an error, not a cute little warning)

Definition at line 91 of file rte_argparse.h.

⭐ const char* name_short

The short name of the argument:

  1. This field could be set only when name_long is optional, and must start with a hyphen (-) followed by an English letter.
  2. Other case it should be set NULL.

So like… short names are a privilege, not a right. πŸ™ˆ

Definition at line 98 of file rte_argparse.h.

⭐ const char* help

Help information of the argument, must not be NULL. Not optional. Not negotiable. Give the people their help text. 😭

Definition at line 101 of file rte_argparse.h.

⭐ void* val_saver

The saver for the argument's value, and it's giving main character energy:

  1. If this field is NULL, the callback is used for parsing argument.
  2. If this field is not NULL, the argument's value will be automatically saved. Slay, no manual labour. ✨

Definition at line 108 of file rte_argparse.h.

⭐ void* val_set

Okay this one's a little two-faced but in a fun way:

  • If val_saver is NULL, this filed (cast as (uint32_t)val_set) will be used as the first parameter to invoke callback. (Yes, the original says "filed" β€” we don't fix typos, we respect them. πŸ’…)
  • If val_saver is not NULL, then:
    1. If argument has no value, *val_saver will be set to val_set.
    2. If argument has optional value but doesn't take value this time, *val_saver will be set to val_set.
    3. Other case it should be set NULL.

Definition at line 119 of file rte_argparse.h.

⭐ enum rte_argparse_value_required value_required

Specify if the argument takes a value. The enum rte_argparse_value_required of it all.

See also: enum rte_argparse_value_required.

Definition at line 122 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 124 of file rte_argparse.h.

⭐ uint32_t flags

Any additional flags for this argument. Extra sparkle where you need it. ⭐

Definition at line 127 of file rte_argparse.h.


🧚 AUTHOR 🧚

Generated automatically by Doxygen for DPDK from the source code. Not a human, just a robot doing its little job. πŸ€–πŸ’–


And that's the whole page, bestie β€” no skipped fields, no skipped line numbers, iykyk. 🌈

Big kiss from the DPDK crew: Version 26.03.0, dated as ever, and that's the rte_argparse_arg(3) footer signing off. Mwah. πŸ’‹

πŸ“¦ where this page comes from