Skip to content

Commit

Permalink
refactor!: make struct rte_kvargs_pair and struct rte_kvargs private
Browse files Browse the repository at this point in the history
  • Loading branch information
aatifsyed committed Nov 28, 2024
1 parent 0cbf275 commit 6b129ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
13 changes: 13 additions & 0 deletions lib/kvargs/rte_kvargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@

#include "rte_kvargs.h"

/** A key/value association */
struct rte_kvargs_pair {
char *key; /**< the name (key) of the association */
char *value; /**< the value associated to that key */
};

/** Store a list of key/value associations */
struct rte_kvargs {
char *str; /**< copy of the argument string */
unsigned count; /**< number of entries in the list */
struct rte_kvargs_pair pairs[RTE_KVARGS_MAX]; /**< list of key/values */
};

/*
* Receive a string with a list of arguments following the pattern
* key=value,key=value,... and insert them into the list.
Expand Down
12 changes: 1 addition & 11 deletions lib/kvargs/rte_kvargs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,8 @@ extern "C" {
*/
typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);

/** A key/value association */
struct rte_kvargs_pair {
char *key; /**< the name (key) of the association */
char *value; /**< the value associated to that key */
};

/** Store a list of key/value associations */
struct rte_kvargs {
char *str; /**< copy of the argument string */
unsigned count; /**< number of entries in the list */
struct rte_kvargs_pair pairs[RTE_KVARGS_MAX]; /**< list of key/values */
};
struct rte_kvargs;

/**
* Allocate a rte_kvargs and store key/value associations from a string
Expand Down

0 comments on commit 6b129ae

Please sign in to comment.