#include <stdio.h>
#include <inttypes.h>
#include <ctype.h>
#include <string.h>
#include "parse.h"
#include "parse_num.h"
Go to the source code of this file.
Defines | |
#define | debug_printf(args...) do {} while(0) |
#define | U08_MIN 0x00 |
#define | U08_MAX 0xFF |
#define | U16_MIN 0x0000 |
#define | U16_MAX 0xFFFF |
#define | U32_MIN 0x00000000 |
#define | U32_MAX 0xFFFFFFFF |
#define | S08_MIN 0x80 |
#define | S08_MAX 0x7F |
#define | S16_MIN 0x8000 |
#define | S16_MAX 0x7FFF |
#define | S32_MIN 0x80000000 |
#define | S32_MAX 0x7FFFFFFF |
Enumerations | |
enum | num_parse_state_t { START, DEC_NEG, BIN, HEX, FLOAT_POS, FLOAT_NEG, ERROR, FIRST_OK, ZERO_OK, HEX_OK, OCTAL_OK, BIN_OK, DEC_NEG_OK, DEC_POS_OK, FLOAT_POS_OK, FLOAT_NEG_OK } |
Functions | |
int8_t | parse_num (parse_pgm_token_hdr_t *tk, const char *srcbuf, void *res) |
int8_t | get_help_num (parse_pgm_token_hdr_t *tk, char *dstbuf, uint8_t size) |
Variables | |
struct token_ops | token_num_ops |
#define debug_printf | ( | args... | ) | do {} while(0) |
Definition at line 10 of file parse_num.c.
#define S08_MAX 0x7F |
Definition at line 20 of file parse_num.c.
#define S08_MIN 0x80 |
Definition at line 19 of file parse_num.c.
#define S16_MAX 0x7FFF |
Definition at line 22 of file parse_num.c.
#define S16_MIN 0x8000 |
Definition at line 21 of file parse_num.c.
#define S32_MAX 0x7FFFFFFF |
Definition at line 24 of file parse_num.c.
#define S32_MIN 0x80000000 |
Definition at line 23 of file parse_num.c.
#define U08_MAX 0xFF |
Definition at line 14 of file parse_num.c.
#define U08_MIN 0x00 |
Definition at line 13 of file parse_num.c.
#define U16_MAX 0xFFFF |
Definition at line 16 of file parse_num.c.
#define U16_MIN 0x0000 |
Definition at line 15 of file parse_num.c.
#define U32_MAX 0xFFFFFFFF |
Definition at line 18 of file parse_num.c.
#define U32_MIN 0x00000000 |
Definition at line 17 of file parse_num.c.
enum num_parse_state_t |
START | |
DEC_NEG | |
BIN | |
HEX | |
FLOAT_POS | |
FLOAT_NEG | |
ERROR | |
FIRST_OK | |
ZERO_OK | |
HEX_OK | |
OCTAL_OK | |
BIN_OK | |
DEC_NEG_OK | |
DEC_POS_OK | |
FLOAT_POS_OK | |
FLOAT_NEG_OK |
Definition at line 35 of file parse_num.c.
int8_t get_help_num | ( | parse_pgm_token_hdr_t * | tk, | |
char * | dstbuf, | |||
uint8_t | size | |||
) |
int8_t parse_num | ( | parse_pgm_token_hdr_t * | tk, | |
const char * | srcbuf, | |||
void * | res | |||
) |
Definition at line 88 of file parse_num.c.
References BIN, BIN_OK, debug_printf, DEC_NEG, DEC_NEG_OK, DEC_POS_OK, ERROR, FLOAT, FLOAT_NEG, FLOAT_NEG_OK, FLOAT_POS, FLOAT_POS_OK, HEX, HEX_OK, INT16, INT32, INT8, isendoftoken(), OCTAL_OK, S08_MAX, S16_MAX, S32_MAX, START, token_num_data::type, U08_MAX, U16_MAX, UINT16, UINT32, UINT8, and ZERO_OK.
struct token_ops token_num_ops |
Initial value:
{ .parse = parse_num, .complete_get_nb = NULL, .complete_get_elt = NULL, .get_help = get_help_num, }
Definition at line 27 of file parse_num.c.