Blender  V2.93
BLI_expr_pylike_eval.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2018 Blender Foundation, Alexander Gavrilov
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
32 
34 typedef enum eExprPyLike_EvalStatus {
36  /* Computation errors; result is still set, but may be NaN */
39  /* Expression dependent errors or bugs; result is 0 */
43 
44 void BLI_expr_pylike_free(struct ExprPyLike_Parsed *expr);
47 bool BLI_expr_pylike_is_using_param(struct ExprPyLike_Parsed *expr, int index);
48 ExprPyLike_Parsed *BLI_expr_pylike_parse(const char *expression,
49  const char **param_names,
50  int param_names_len);
52  const double *param_values,
53  int param_values_len,
54  double *r_result);
55 
56 #ifdef __cplusplus
57 }
58 #endif
eExprPyLike_EvalStatus
@ EXPR_PYLIKE_FATAL_ERROR
@ EXPR_PYLIKE_SUCCESS
@ EXPR_PYLIKE_DIV_BY_ZERO
@ EXPR_PYLIKE_MATH_ERROR
@ EXPR_PYLIKE_INVALID
eExprPyLike_EvalStatus BLI_expr_pylike_eval(struct ExprPyLike_Parsed *expr, const double *param_values, int param_values_len, double *r_result)
ExprPyLike_Parsed * BLI_expr_pylike_parse(const char *expression, const char **param_names, int param_names_len)
void BLI_expr_pylike_free(struct ExprPyLike_Parsed *expr)
bool BLI_expr_pylike_is_using_param(struct ExprPyLike_Parsed *expr, int index)
bool BLI_expr_pylike_is_valid(struct ExprPyLike_Parsed *expr)
bool BLI_expr_pylike_is_constant(struct ExprPyLike_Parsed *expr)