token_ops Struct Reference

#include <parse.h>


Data Fields

int8_t(* parse )(parse_pgm_token_hdr_t *, const char *, void *)
int8_t(* complete_get_nb )(parse_pgm_token_hdr_t *)
int8_t(* complete_get_elt )(parse_pgm_token_hdr_t *, int8_t, char *, uint8_t)
int8_t(* get_help )(parse_pgm_token_hdr_t *, char *, uint8_t)


Detailed Description

A token is defined by this structure.

parse() takes the token as first argument, then the source buffer starting at the token we want to parse. The 3rd arg is a pointer where we store the parsed data (as binary). It returns the number of parsed chars on success and a negative value on error.

complete_get_nb() returns the number of possible values for this token if completion is possible. If it is NULL or if it returns 0, no completion is possible.

complete_get_elt() copy in dstbuf (the size is specified in the parameter) the i-th possible completion for this token. returns 0 on success or and a negative value on error.

get_help() fills the dstbuf with the help for the token. It returns -1 on error and 0 on success.

Definition at line 74 of file parse.h.


Field Documentation

int8_t(* token_ops::parse)(parse_pgm_token_hdr_t *, const char *, void *)

parse(token ptr, buf, res pts)

return the num of possible choices for this token

Referenced by complete().

int8_t(* token_ops::complete_get_elt)(parse_pgm_token_hdr_t *, int8_t, char *, uint8_t)

return the elt x for this token (token, idx, dstbuf, size)

Referenced by complete().

int8_t(* token_ops::get_help)(parse_pgm_token_hdr_t *, char *, uint8_t)

get help for this token (token, dstbuf, size)

Referenced by complete().


The documentation for this struct was generated from the following file:

Generated on Fri Mar 12 06:32:30 2010 for AVR by  doxygen 1.5.6