1 /* 2 $Id: functionobj.h 2625 2021-04-25 21:09:11Z soci $ 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along 15 with this program; if not, write to the Free Software Foundation, Inc., 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 18 */ 19 #ifndef FUNCTIONOBJ_H 20 #define FUNCTIONOBJ_H 21 #include "obj.h" 22 23 extern struct Type *const FUNCTION_OBJ; 24 25 typedef enum Function_types { 26 F_NONE, F_FLOOR, F_CEIL, F_ROUND, F_TRUNC, F_FRAC, F_SQRT, F_CBRT, F_LOG, 27 F_LOG10, F_EXP, F_SIN, F_COS, F_TAN, F_ACOS, F_ASIN, F_ATAN, F_RAD, F_DEG, 28 F_COSH, F_SINH, F_TANH, F_HYPOT, F_ATAN2, F_POW, F_SIGN, F_ABS, F_ALL, 29 F_ANY, F_SIZE, F_LEN, F_RANGE, F_REPR, F_FORMAT, F_RANDOM, F_SORT, 30 F_BINARY, F_BYTE, F_CHAR, F_RTA, F_ADDR, F_SINT, F_WORD, F_LINT, F_LONG, 31 F_DINT, F_DWORD 32 } Function_types; 33 34 typedef struct Function { 35 Obj v; 36 const char name[7]; 37 const uint8_t name_len; 38 int name_hash; 39 const Function_types func; 40 } Function; 41 42 #define Function(a) ((Function *)(1 ? (a) : (Obj *)(Function *)(a))) 43 44 struct oper_s; 45 46 extern MUST_CHECK Obj *apply_convert(struct oper_s *); 47 extern MUST_CHECK Obj *apply_convert2(struct oper_s *); 48 extern MUST_CHECK Obj *apply_condition(struct oper_s *); 49 extern void functionobj_init(void); 50 extern void functionobj_names(void); 51 extern void functionobj_destroy(void); 52 extern void random_reseed(Obj *, linepos_t); 53 54 #endif 55