|
Mathematic Expressions Library
0.1
The core math data structures and manipulators
|
#include <stddef.h>#include <limits.h>#include <ctype.h>
Go to the source code of this file.
Data Structures | |
| union | value_data |
| value data container provider More... | |
| struct | value |
| Represents a numeric value or an error. More... | |
Macros | |
| #define | SYS_INT_LONG_T_MIN LONG_MIN |
| #define | SYS_INT_LONG_T_MAX LONG_MAX |
| #define | SYS_INT_LONG_T_STR_SIZE 11 |
The length in chars for a long int string. 4 byte long - . More... | |
| #define | SIZE_T_MAX ( ~( (size_t) (0) ) ) |
| #define | PINDEX_MAX SIZE_T_MAX |
| The max value of pindex_t. More... | |
| #define | PINDEX_BAD PINDEX_MAX |
| Special value of pindex_t that signals a bad value. More... | |
| #define | IS_WHITESPACE(c) ( ((c) == ' ') || ((c) == '\t') ) |
| #define | IS_DIGIT(c) ( ( '0' <= (c) ) && ( (c) <= '9') ) |
| #define | IS_ALPHA(c) isalpha(c) |
| #define | IS_ALNUM(c) isalnum(c) |
Typedefs | |
| typedef int long | sys_int_long |
| typedef size_t | pindex_t |
| Type for an index into an expression string during parsing. More... | |
| typedef size_t | pcount_t |
| Type for an item count during parsing. More... | |
| typedef struct value | value_t |
Enumerations | |
| enum | value_types { VAL_ERROR, VAL_UNDEF, VAL_INF, VAL_LINT } |
| value type selector More... | |
Functions | |
| value_t | value_new_type (enum value_types type) |
| value_t | value_new_lint (sys_int_long lint) |
| value_t | string_to_value (size_t src_str_len, char const *src_str) |
| Create value from a string. More... | |
| void | value_to_string (char *dst_str, value_t src_val) |
| pindex_t | find_matching (size_t str_len, const char *str, pindex_t start) |
| Find the index of the matching closing paren in a string. More... | |
Contains standard types, macros, and functions used throughout the library. Most notably, this is the home of the value_t.
| #define IS_ALNUM | ( | c | ) | isalnum(c) |
| #define IS_ALPHA | ( | c | ) | isalpha(c) |
| #define IS_DIGIT | ( | c | ) | ( ( '0' <= (c) ) && ( (c) <= '9') ) |
| #define IS_WHITESPACE | ( | c | ) | ( ((c) == ' ') || ((c) == '\t') ) |
| #define PINDEX_BAD PINDEX_MAX |
Special value of pindex_t that signals a bad value.
| #define PINDEX_MAX SIZE_T_MAX |
The max value of pindex_t.
| #define SIZE_T_MAX ( ~( (size_t) (0) ) ) |
| #define SYS_INT_LONG_T_MAX LONG_MAX |
| #define SYS_INT_LONG_T_MIN LONG_MIN |
| #define SYS_INT_LONG_T_STR_SIZE 11 |
The length in chars for a long int string. 4 byte long -
.
| typedef size_t pcount_t |
Type for an item count during parsing.
| typedef size_t pindex_t |
Type for an index into an expression string during parsing.
| typedef int long sys_int_long |
| enum value_types |
Find the index of the matching closing paren in a string.
| str_len | Overall string length. |
| str | String to search in. |
| start | Index of the open paren to match. |
| value_t string_to_value | ( | size_t | src_str_len, |
| char const * | src_str | ||
| ) |
Create value from a string.
| src_str_len | The length of the actual buffer (not the number size). |
| src_str | The source string. |
<
<

| value_t value_new_lint | ( | sys_int_long | lint | ) |
| value_t value_new_type | ( | enum value_types | type | ) |