- int (*parse)(cmdline_parse_token_hdr_t *, const char *, void *);
- /** return the num of possible choices for this token */
- int (*complete_get_nb)(cmdline_parse_token_hdr_t *);
- /** return the elt x for this token (token, idx, dstbuf, size) */
- int (*complete_get_elt)(cmdline_parse_token_hdr_t *, int, char *, unsigned int);
+ int (*parse)(cmdline_parse_token_hdr_t *, const char *, void *,
+ unsigned int);
+ /** prepare a completion on this token */
+ int (*complete_start)(cmdline_parse_token_hdr_t *, void **);
+ /** fill dstbuf for this token (token, opaque, dstbuf, size) */
+ int (*complete_iterate)(cmdline_parse_token_hdr_t *, void **, char *,
+ unsigned int);
+ /* end of completion, used to free the opaque structure */
+ void (*complete_end)(cmdline_parse_token_hdr_t *, void **);