1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation.
3 * Copyright (c) 2010, Keith Wiles <keith.wiles@windriver.com>
7 #ifndef _PARSE_PORTLIST_H_
8 #define _PARSE_PORTLIST_H_
11 #include <cmdline_parse.h>
17 /* size of a parsed string */
18 #define PORTLIST_TOKEN_SIZE 128
19 #define PORTLIST_MAX_TOKENS 32
21 typedef struct cmdline_portlist {
25 struct cmdline_token_portlist {
26 struct cmdline_token_hdr hdr;
28 typedef struct cmdline_token_portlist cmdline_parse_token_portlist_t;
30 extern struct cmdline_token_ops cmdline_token_portlist_ops;
32 int cmdline_parse_portlist(cmdline_parse_token_hdr_t *tk,
33 const char *srcbuf, void *res, unsigned ressize);
34 int cmdline_get_help_portlist(cmdline_parse_token_hdr_t *tk,
35 char *dstbuf, unsigned int size);
37 #define TOKEN_PORTLIST_INITIALIZER(structure, field) \
41 &cmdline_token_portlist_ops, /* ops */ \
42 offsetof(structure, field), /* offset */ \
50 #endif /* _PARSE_PORTLIST_H_ */