namespace.h#
This graph shows which files directly or indirectly include namespace.h:
InputHandler specific namespaces.
- Author
Douglas Quigg (dstroy0 dquigg123@gmail.com)
- Version
1.0
- Date
2023-02-13
- Copyright
Copyright (c) 2023
-
namespace ih_auto#
InputHandler “auto” type namespace.
The source of macros in this namespace is src/config.h. config src namespace src
The idea behind this namespace is to let users set config.h items to whatever they want, sizing variables for the least amount of space, automatically. The preprocessor evaluates the if macros in a way that will leave typedefs that size type aliases to the minimum byte-width required automatically. It also warns users about the change. The only hand-holding that happens is for type sizing, it’s up to you to make sure you have the resources for your settings. Convenience namespace.
Typedefs
-
typedef bool type_match_flags#
Input private member type (future bit array)
-
typedef uint8_t max_cmds_per_tree#
User influenced typedef.
IH_MAX_COMMANDS_PER_TREE is set by the user.
#if (IH_MAX_COMMANDS_PER_TREE <= UINT8_MAX) typedef uint8_t max_cmds_per_tree; #elif (IH_MAX_COMMANDS_PER_TREE > UINT8_MAX && IH_MAX_COMMANDS_PER_TREE <= UINT16_MAX) typedef uint16_t max_cmds_per_tree; #elif (IH_MAX_COMMANDS_PER_TREE > UINT16_MAX && IH_MAX_COMMANDS_PER_TREE <= UINT32_MAX) typedef uint32_t max_cmds_per_tree; #else // no typedef; compile failure #endif
-
typedef uint8_t cmd_id_grp#
User influenced typedef.
IH_MAX_COMMANDS_PER_TREE is set by the user.
#if (IH_MAX_COMMANDS_PER_TREE <= UINT8_MAX) typedef uint8_t cmd_id_grp; #elif (IH_MAX_COMMANDS_PER_TREE > UINT8_MAX && IH_MAX_COMMANDS_PER_TREE <= UINT16_MAX) typedef uint16_t cmd_id_grp; #elif (IH_MAX_COMMANDS_PER_TREE > UINT16_MAX && IH_MAX_COMMANDS_PER_TREE <= UINT32_MAX) typedef uint32_t cmd_id_grp; #else // no typedef; compile failure #endif
-
typedef uint8_t max_args_per_cmd#
User influenced typedef.
IH_MAX_ARGS_PER_COMMAND is set by the user.
#if (IH_MAX_ARGS_PER_COMMAND <= UINT8_MAX) typedef uint8_t max_args_per_cmd; #elif (IH_MAX_ARGS_PER_COMMAND > UINT8_MAX && IH_MAX_ARGS_PER_COMMAND <= UINT16_MAX) typedef uint16_t max_args_per_cmd; #elif (IH_MAX_ARGS_PER_COMMAND > UINT16_MAX && IH_MAX_ARGS_PER_COMMAND <= UINT32_MAX) typedef uint32_t max_args_per_cmd; #else // no typedef; compile failure #endif
-
typedef uint8_t max_tree_depth_per_cmd#
User influenced typedef.
IH_MAX_TREE_DEPTH_PER_COMMAND is set by the user.
#if (IH_MAX_TREE_DEPTH_PER_COMMAND <= UINT8_MAX) typedef uint8_t max_tree_depth_per_cmd; #elif (IH_MAX_TREE_DEPTH_PER_COMMAND > UINT8_MAX && IH_MAX_TREE_DEPTH_PER_COMMAND <= UINT16_MAX) typedef uint16_t max_tree_depth_per_cmd; #elif (IH_MAX_TREE_DEPTH_PER_COMMAND > UINT16_MAX && IH_MAX_TREE_DEPTH_PER_COMMAND <= UINT32_MAX) typedef uint32_t max_tree_depth_per_cmd; #else // no typedef; compile failure #endif
-
typedef uint8_t max_num_child_cmds#
User influenced typedef.
IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT is set by the user.
#if (IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT <= UINT8_MAX) typedef uint8_t max_num_child_cmds; #elif (IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT > UINT8_MAX && IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT <= UINT16_MAX) typedef uint16_t max_num_child_cmds; #elif (IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT > UINT16_MAX && IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT <= UINT32_MAX) typedef uint32_t max_num_child_cmds; #else // no typedef; compile failure #endif
-
typedef uint8_t max_cmd_str_len#
User influenced typedef.
IH_MAX_CMD_STR_LEN is set by the user.
#if (IH_MAX_CMD_STR_LEN <= UINT8_MAX) typedef uint8_t max_cmd_str_len; #elif (IH_MAX_CMD_STR_LEN > UINT8_MAX && IH_MAX_CMD_STR_LEN <= UINT16_MAX) typedef uint16_t max_cmd_str_len; #elif (IH_MAX_CMD_STR_LEN > UINT16_MAX && IH_MAX_CMD_STR_LEN <= UINT32_MAX) typedef uint32_t max_cmd_str_len; #else // no typedef; compile failure #endif
-
typedef uint8_t max_num_delim_seq#
User influenced typedef.
IH_MAX_NUM_PROC_DELIM_SEQ is set by the user.
#if (IH_MAX_NUM_PROC_DELIM_SEQ <= UINT8_MAX) typedef uint8_t max_num_delim_seq; #elif (IH_MAX_NUM_PROC_DELIM_SEQ > UINT8_MAX && IH_MAX_NUM_PROC_DELIM_SEQ <= UINT16_MAX) typedef uint16_t max_num_delim_seq; #elif (IH_MAX_NUM_PROC_DELIM_SEQ > UINT16_MAX && IH_MAX_NUM_PROC_DELIM_SEQ <= UINT32_MAX) typedef uint32_t max_num_delim_seq; #else // no typedef; compile failure #endif
-
typedef uint8_t max_num_start_stop_seq#
User influenced typedef.
IH_MAX_NUM_START_STOP_SEQ is set by the user.
#if (IH_MAX_NUM_START_STOP_SEQ <= UINT8_MAX) typedef uint8_t max_num_start_stop_seq; #elif (IH_MAX_NUM_START_STOP_SEQ > UINT8_MAX && IH_MAX_NUM_START_STOP_SEQ <= UINT16_MAX) typedef uint16_t max_num_start_stop_seq; #elif (IH_MAX_NUM_START_STOP_SEQ > UINT16_MAX && IH_MAX_NUM_START_STOP_SEQ <= UINT32_MAX) typedef uint32_t max_num_start_stop_seq; #else // no typedef; compile failure #endif
-
typedef uint8_t max_proc_input_len#
User influenced typedef.
IH_MAX_PROC_INPUT_LEN is set by the user.
#if (IH_MAX_PROC_INPUT_LEN <= UINT8_MAX) typedef uint8_t max_proc_input_len; #elif (IH_MAX_PROC_INPUT_LEN > UINT8_MAX && IH_MAX_PROC_INPUT_LEN <= UINT16_MAX) typedef uint16_t max_proc_input_len; #elif (IH_MAX_PROC_INPUT_LEN > UINT16_MAX && IH_MAX_PROC_INPUT_LEN <= UINT32_MAX) typedef uint32_t max_proc_input_len; #else // no typedef; compile failure #endif
-
typedef uint8_t max_per_root_memcmp_ranges#
User influenced typedef.
IH_MAX_PER_ROOT_MEMCMP_RANGES is set by the user.
#if (IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT8_MAX) typedef uint8_t max_per_root_memcmp_ranges; #elif (IH_MAX_PER_ROOT_MEMCMP_RANGES > UINT8_MAX && IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT16_MAX) typedef uint16_t max_per_root_memcmp_ranges; #elif (IH_MAX_PER_ROOT_MEMCMP_RANGES > UINT16_MAX && IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT32_MAX) typedef uint32_t max_per_root_memcmp_ranges; #else // no typedef; compile failure #endif
-
typedef uint8_t memcmp_idx_t#
User influenced typedef.
IH_MAX_PER_ROOT_MEMCMP_RANGES is set by the user.
#if (IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT8_MAX) typedef uint8_t memcmp_idx_t; #elif (IH_MAX_PER_ROOT_MEMCMP_RANGES > UINT8_MAX && IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT16_MAX) typedef uint16_t memcmp_idx_t; #elif (IH_MAX_PER_ROOT_MEMCMP_RANGES > UINT16_MAX && IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT32_MAX) typedef uint32_t memcmp_idx_t; #else // no typedef; compile failure #endif
-
typedef bool type_match_flags#
-
namespace ih
User facing namespace.
-
struct CommandRuntimeCalc#
- #include <namespace.h>
Contains arrays and indices determined at runtime.
These structs are associated with wildcard commands; CommandParameters which contains wildcards will have a CommandRuntimeCalc.
Public Members
-
ih_auto::memcmp_idx_t num_prm_with_wc#
the number of CommandParameters structs in this command that contain char(ih::WildcardChar[0]); the WildCard Character
-
ih_auto::memcmp_idx_t *idx_of_prm_with_wc#
indices of CommandParameters struct that contain wcc
-
ih_auto::max_per_root_memcmp_ranges *num_memcmp_ranges_this_row#
the number of memcmp ranges for this Parameters command string, array members always an even number
-
ih_auto::max_per_root_memcmp_ranges **memcmp_ranges_arr#
2d array[row][col], each [row] is for one Parameters command string which contains wcc
-
ih_auto::memcmp_idx_t num_prm_with_wc#
-
struct DelimiterSequences#
- #include <namespace.h>
Holds user defined input data delimiters.
A delimiter sequence is a predefined number or set of numbers that is used to separate input arguments, subcommands or data. The input process needs to know three things about the delimiter sequences you want to use. The number of delimiter sequences there are (up to IH_MAX_NUM_PROC_DELIM_SEQ), the 8-bit byte (char) length of each delimiter sequence, and finally each delimiter sequence which can be up to IH_DELIM_SEQ_PGM_LEN in length.
Public Members
-
size_t num_seq#
the number of token delimiters in delimiter_sequences
-
ih_auto::max_num_delim_seq delimiter_lens[IH_MAX_NUM_PROC_DELIM_SEQ]#
delimiter sequence lens delimiter_lens [IH_MAX_NUM_PROC_DELIM_SEQ]
-
char delimiter_sequences[IH_MAX_NUM_PROC_DELIM_SEQ][IH_DELIM_SEQ_PGM_LEN]#
string-literal “” delimiter sequence array delimiter_sequences [IH_MAX_NUM_PROC_DELIM_SEQ] [IH_DELIM_SEQ_PGM_LEN]
-
size_t num_seq#
-
struct InputParameters#
- #include <namespace.h>
Collaboration diagram for ih::InputParameters:
Input process parameters and constructor parameters.
This struct is an array of pointers to other structs/arrays contained in PROGMEM. It’s required by the input process constructor, all together they define the input process behavior.
Public Members
-
const ProcessName *process_name#
this process’ name, can be NULL; MAX len == IH_PROCESS_NAME_PGM_LEN
-
const EndOfLineChar *eol_char#
end of line term; MAX len == IH_EOL_SEQ_PGM_LEN
-
const ControlCharSeq *input_control_char_sequence#
two char len sequence to input a control char
-
const WildcardChar *wildcard_char#
single char wildcard char
-
const DelimiterSequences *delimiter_sequences#
reference to ih::DelimiterSequences struct
-
const StartStopSequences *start_stop_sequences#
reference to ih::StartStopSequences struct
-
const ProcessName *process_name#
-
struct StartStopSequences#
- #include <namespace.h>
Holds regex-like start-stop match sequence pairs.
A start-stop sequence is a pair of numbers or a pair of a set of numbers which do not have to be identical to one another. The “start” sequence demarcs the beginning of a chunk of data, the “stop” sequence demarcs the end of the chunk of data. The input process needs to know three things about the start-stop sequences you want to use. The number of start-stop sequences there are (up to IH_MAX_NUM_START_STOP_SEQ), the 8-bit byte (char) length of each start-stop sequence, and finally each start-stop sequence which can be up to IH_START_STOP_SEQ_PGM_LEN in length.
Public Members
-
size_t num_seq#
num start/stop sequences
-
ih_auto::max_num_start_stop_seq start_stop_sequence_lens[IH_MAX_NUM_START_STOP_SEQ]#
start stop sequence lens start_stop_sequence_lens [IH_MAX_NUM_START_STOP_SEQ]
-
char start_stop_sequence_pairs[IH_MAX_NUM_START_STOP_SEQ][IH_START_STOP_SEQ_PGM_LEN]#
start/stop sequences. Match start, match end, copy what is between markers start_stop_sequence_pairs [IH_MAX_NUM_START_STOP_SEQ] [IH_START_STOP_SEQ_PGM_LEN]
-
size_t num_seq#
-
struct CommandRuntimeCalc#
-
namespace ihc#
library constants located in PROGMEM.
This namespace’s purpose is to avoid name collision and to consolidate the library’s PROGMEM variables.