add color support for windows console
[calc.git] / element.h
CommitLineData
a24bd519
LM
1#ifndef __ELEMENT_H__
2#define __ELEMENT_H__
3
4/* global variables */
5
6/* function type */
7
8typedef enum {
9 Val = 0, Sig,
10 Add, Sub,
11 Mul, Div, Mod,
12 Pow, Sqr,
13 Cos, Sin, Tan, Acos, Asin, Atan,
14 Ln, Log, Exp,
15 Erfc, Erf,
16 Abs, Ceil, Floor,
bdcb95da 17 Store, Recall, Inc, Dec, Disp, Memory, Clear,
a24bd519
LM
18 Quit, Help,
19 Ans, E, Pi,
20 Equal, Diff, Ge, Le, Gt, Lt,
21 And, Or, Not,
22 Cond, While, Code, Print,
23 Prog, Arg, Call, List, Edit, Del,
24 Get, Length, Pop, Push, Put, Set, Show,
25 Max, Mean, Median, Min, Order, Prod, Sum, Variance
26} func_t;
27
28/* keyword type */
29
30typedef struct _keyword_t {
31 char *keyword;
32 func_t func;
33 int nbops;
34 int offset;
35 float prio;
36} keyword_t;
37
38/* calculus element type */
39
40typedef struct _element_t {
41 func_t func;
42 int nbops;
43 struct _element_t **ops;
44 double value;
45 int prio;
46 int hidden;
47 char *string;
48} element_t;
49
50#define ERROR_OP ((element_t *)(-1))
51
52/* functions */
53
54element_t *newelement (func_t function, int nbops, int prio);
55void delelement (element_t *root);
56element_t *dupelement (element_t *root);
57
58#endif /* __ELEMENT_H__ */
59
60/* vim: set ts=4 sw=4 et: */