1 /*   (C) Copyright 2001, 2002, 2003, 2004, 2005 Stijn van Dongen
2  *   (C) Copyright 2006, 2007, 2008, 2009  Stijn van Dongen
3  *
4  * This file is part of tingea.  You can redistribute and/or modify tingea
5  * under the terms of the GNU General Public License; either version 3 of the
6  * License or (at your option) any later version.  You should have received a
7  * copy of the GPL along with tingea, in the file COPYING.
8 */
9 
10 #ifndef tingea_let
11 #define tingea_let
12 
13 #include "types.h"
14 #include "ting.h"
15 
16 #define TRM_FAIL   0
17 #define TRM_ISNUM  1
18 #define TRM_ISREAL 2
19 #define TRM_ISINF  3
20 #define TRM_ISNAN  4
21 
22 typedef struct telRaam telRaam;
23 
24 telRaam* trmInit
25 (  const char* str
26 )  ;
27 
28 mcxstatus trmExit
29 (  telRaam*  raam
30 )  ;
31 
32 mcxstatus trmParse
33 (  telRaam* raam
34 )  ;
35 
36 int trmEval
37 (  telRaam* raam
38 ,  long* lp
39 ,  double* fp
40 )  ;
41 
42 void trmRegister
43 (  telRaam* raam
44 ,  int      (user_parse)(mcxTing* txt, int offset)
45 ,  mcxenum  (user_eval)(const char* token, long *ival, double *fval)
46 ,  char     user_char
47 )  ;
48 
49 mcxbool trmError
50 (  int  flags
51 )  ;
52 
53 mcxbool trmIsReal
54 (  int  flags
55 )  ;
56 
57 mcxbool trmIsNum
58 (  int  flags
59 )  ;
60 
61 mcxbool trmIsNan
62 (  int  flags
63 )  ;
64 
65 mcxbool trmIsInf
66 (  int  flags
67 )  ;
68 
69 void trmDump
70 (  telRaam* raam
71 ,  const char* msg
72 )  ;
73 
74 void trmDebug
75 (  void
76 )  ;
77 
78 #endif
79 
80