diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2018-10-11 21:27:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-11 21:27:56 +0300 |
commit | 2cc264eff5925769a4ae082e9b23f31c00ef23ec (patch) | |
tree | 2f20f7d6ec77b894e5067c81522611f26fa37722 /src/eval.h | |
parent | 6606b3131d20eac229644472abd2d2534ddc05fb (diff) |
modularize C source code (#4372)
* modularize cgroups and cmake; #4339
* modularized freeipmi.plugin
* added comment about referencing parent files
* modularized apps.plugin
* modularized proc and diskspace
* minor fixes
* modularized plugins: checks, freebsd, idlejitter, nfacct, tc, macos, plugins.d
* minor fixes 2
* modularized statsd
* modularized cgroup-network
* moved cgroup-network-helper.sh and cgroup-name.sh to cgroup.plugin
* modularized health plugin
* move rrd related info to rrd.h
* added libnetdata
* do not corrupt config.h
* use dir-objects instead of static libraries
* fixed cmake for new structure
* use absolute paths to fix LGTM
* enable automake subdir-objects and prettify its output
* use relative files at the src directory for all plugins
* fix compiler warning
* synced automake and cmake
* added config.h to cmake
* abstracted basic os functions in libnetdata/os
* fix zfs_common
* removed apps.plugin dependency on freebsd plugin
* health removed from plugins
* modularized the registry
* modularized the rest of it
* include streaming files in cmake
* use libnetdata as library
* enable silent-rules only when they are available
Diffstat (limited to 'src/eval.h')
-rw-r--r-- | src/eval.h | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/src/eval.h b/src/eval.h deleted file mode 100644 index a2c8a78630..0000000000 --- a/src/eval.h +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef NETDATA_EVAL_H -#define NETDATA_EVAL_H 1 - -#define EVAL_MAX_VARIABLE_NAME_LENGTH 300 - -typedef struct eval_variable { - char *name; - uint32_t hash; - struct eval_variable *next; -} EVAL_VARIABLE; - -typedef struct eval_expression { - const char *source; - const char *parsed_as; - - RRDCALC_STATUS *status; - calculated_number *this; - time_t *after; - time_t *before; - - calculated_number result; - - int error; - BUFFER *error_msg; - - // hidden EVAL_NODE * - void *nodes; - - // custom data to be used for looking up variables - struct rrdcalc *rrdcalc; -} EVAL_EXPRESSION; - -#define EVAL_VALUE_INVALID 0 -#define EVAL_VALUE_NUMBER 1 -#define EVAL_VALUE_VARIABLE 2 -#define EVAL_VALUE_EXPRESSION 3 - -// parsing and evaluation -#define EVAL_ERROR_OK 0 - -// parsing errors -#define EVAL_ERROR_MISSING_CLOSE_SUBEXPRESSION 1 -#define EVAL_ERROR_UNKNOWN_OPERAND 2 -#define EVAL_ERROR_MISSING_OPERAND 3 -#define EVAL_ERROR_MISSING_OPERATOR 4 -#define EVAL_ERROR_REMAINING_GARBAGE 5 -#define EVAL_ERROR_IF_THEN_ELSE_MISSING_ELSE 6 - -// evaluation errors -#define EVAL_ERROR_INVALID_VALUE 101 -#define EVAL_ERROR_INVALID_NUMBER_OF_OPERANDS 102 -#define EVAL_ERROR_VALUE_IS_NAN 103 -#define EVAL_ERROR_VALUE_IS_INFINITE 104 -#define EVAL_ERROR_UNKNOWN_VARIABLE 105 - -// parse the given string as an expression and return: -// a pointer to an expression if it parsed OK -// NULL in which case the pointer to error has the error code -extern EVAL_EXPRESSION *expression_parse(const char *string, const char **failed_at, int *error); - -// free all resources allocated for an expression -extern void expression_free(EVAL_EXPRESSION *expression); - -// convert an error code to a message -extern const char *expression_strerror(int error); - -// evaluate an expression and return -// 1 = OK, the result is in: expression->result -// 2 = FAILED, the error message is in: buffer_tostring(expression->error_msg) -extern int expression_evaluate(EVAL_EXPRESSION *expression); - -#endif //NETDATA_EVAL_H |