1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation.
3 * Copyright (c) 2009, Olivier MATZ <zer0@droids-corp.org>
10 #include <cmdline_parse.h>
16 enum cmdline_numtype {
27 struct cmdline_token_num_data {
28 enum cmdline_numtype type;
31 struct cmdline_token_num {
32 struct cmdline_token_hdr hdr;
33 struct cmdline_token_num_data num_data;
35 typedef struct cmdline_token_num cmdline_parse_token_num_t;
37 extern struct cmdline_token_ops cmdline_token_num_ops;
39 int cmdline_parse_num(cmdline_parse_token_hdr_t *tk,
40 const char *srcbuf, void *res, unsigned ressize);
41 int cmdline_get_help_num(cmdline_parse_token_hdr_t *tk,
42 char *dstbuf, unsigned int size);
44 #define TOKEN_NUM_INITIALIZER(structure, field, numtype) \
48 &cmdline_token_num_ops, /* ops */ \
49 offsetof(structure, field), /* offset */ \
61 #endif /* _PARSE_NUM_H_ */