OpcUaCanOpen
CANopen OPC-UA server
muParserDLL.h
Go to the documentation of this file.
1
/*
2
__________
3
_____ __ __\______ \_____ _______ ______ ____ _______
4
/ \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \
5
| Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/
6
|__|_| /|____/ |____| (____ /|__| /____ > \___ >|__|
7
\/ \/ \/ \/
8
Copyright (C) 2011 Ingo Berg
9
10
Permission is hereby granted, free of charge, to any person obtaining a copy of this
11
software and associated documentation files (the "Software"), to deal in the Software
12
without restriction, including without limitation the rights to use, copy, modify,
13
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
14
permit persons to whom the Software is furnished to do so, subject to the following conditions:
15
16
The above copyright notice and this permission notice shall be included in all copies or
17
substantial portions of the Software.
18
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
20
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
22
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
*/
25
#ifndef MU_PARSER_DLL_H
26
#define MU_PARSER_DLL_H
27
28
#include "
muParserFixes.h
"
29
30
#ifdef __cplusplus
31
extern
"C"
32
{
33
#endif
34
39
// Basic types
40
typedef
void
*
muParserHandle_t
;
// parser handle
41
42
#ifndef _UNICODE
43
typedef
char
muChar_t
;
// character type
44
#else
45
typedef
wchar_t
muChar_t
;
// character type
46
#endif
47
48
typedef
int
muBool_t
;
// boolean type
49
typedef
int
muInt_t
;
// integer type
50
typedef
double
muFloat_t
;
// floating point type
51
52
// function types for calculation
53
typedef
muFloat_t
(*
muFun0_t
)();
54
typedef
muFloat_t
(*
muFun1_t
)(
muFloat_t
);
55
typedef
muFloat_t
(*
muFun2_t
)(
muFloat_t
,
muFloat_t
);
56
typedef
muFloat_t
(*
muFun3_t
)(
muFloat_t
,
muFloat_t
,
muFloat_t
);
57
typedef
muFloat_t
(*
muFun4_t
)(
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
58
typedef
muFloat_t
(*
muFun5_t
)(
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
59
typedef
muFloat_t
(*
muFun6_t
)(
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
60
typedef
muFloat_t
(*
muFun7_t
)(
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
61
typedef
muFloat_t
(*
muFun8_t
)(
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
62
typedef
muFloat_t
(*
muFun9_t
)(
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
63
typedef
muFloat_t
(*
muFun10_t
)(
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
64
65
// Function prototypes for bulkmode functions
66
typedef
muFloat_t
(*
muBulkFun0_t
)(int, int);
67
typedef
muFloat_t
(*
muBulkFun1_t
)(int, int,
muFloat_t
);
68
typedef
muFloat_t
(*
muBulkFun2_t
)(int, int,
muFloat_t
,
muFloat_t
);
69
typedef
muFloat_t
(*
muBulkFun3_t
)(int, int,
muFloat_t
,
muFloat_t
,
muFloat_t
);
70
typedef
muFloat_t
(*
muBulkFun4_t
)(int, int,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
71
typedef
muFloat_t
(*
muBulkFun5_t
)(int, int,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
72
typedef
muFloat_t
(*
muBulkFun6_t
)(int, int,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
73
typedef
muFloat_t
(*
muBulkFun7_t
)(int, int,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
74
typedef
muFloat_t
(*
muBulkFun8_t
)(int, int,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
75
typedef
muFloat_t
(*
muBulkFun9_t
)(int, int,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
76
typedef
muFloat_t
(*
muBulkFun10_t
)(int, int,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
,
muFloat_t
);
77
78
typedef
muFloat_t
(*
muMultFun_t
)(
const
muFloat_t
*,
muInt_t
);
79
typedef
muFloat_t
(*
muStrFun1_t
)(
const
muChar_t
*);
80
typedef
muFloat_t
(*
muStrFun2_t
)(
const
muChar_t
*,
muFloat_t
);
81
typedef
muFloat_t
(*
muStrFun3_t
)(
const
muChar_t
*,
muFloat_t
,
muFloat_t
);
82
83
// Functions for parser management
84
typedef
void (*
muErrorHandler_t
)(
muParserHandle_t
a_hParser);
// [optional] callback to an error handler
85
typedef
muFloat_t
* (*muFacFun_t)(
const
muChar_t
*,
void
*);
// [optional] callback for creating new variables
86
typedef
muInt_t
(*
muIdentFun_t
)(
const
muChar_t
*,
muInt_t
*,
muFloat_t
*);
// [optional] value identification callbacks
87
88
//-----------------------------------------------------------------------------------------------------
89
// Constants
90
static
const
int
muOPRT_ASCT_LEFT
= 0;
91
static
const
int
muOPRT_ASCT_RIGHT
= 1;
92
93
static
const
int
muBASETYPE_FLOAT
= 0;
94
static
const
int
muBASETYPE_INT
= 1;
95
96
//-----------------------------------------------------------------------------------------------------
97
//
98
//
99
// muParser C compatible bindings
100
//
101
//
102
//-----------------------------------------------------------------------------------------------------
103
104
105
// Basic operations / initialization
106
API_EXPORT
(
muParserHandle_t
) mupCreate(
int
nBaseType);
107
API_EXPORT
(
void
) mupRelease(
muParserHandle_t
a_hParser);
108
API_EXPORT
(
const
muChar_t
*) mupGetExpr(
muParserHandle_t
a_hParser);
109
API_EXPORT
(
void
) mupSetExpr(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szExpr
);
110
API_EXPORT
(
void
) mupSetVarFactory(
muParserHandle_t
a_hParser,
muFacFun_t
a_pFactory
,
void
*
pUserData
);
111
API_EXPORT
(
const
muChar_t
*) mupGetVersion(
muParserHandle_t
a_hParser);
112
API_EXPORT
(
muFloat_t
) mupEval(
muParserHandle_t
a_hParser);
113
API_EXPORT
(
muFloat_t
*) mupEvalMulti(
muParserHandle_t
a_hParser,
int
*
nNum
);
114
API_EXPORT
(
void
) mupEvalBulk(
muParserHandle_t
a_hParser,
muFloat_t
*
a_fResult
,
int
nSize
);
115
116
// Defining callbacks / variables / constants
117
API_EXPORT
(
void
) mupDefineFun0(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun0_t
a_pFun
,
muBool_t
a_bOptimize
);
118
API_EXPORT
(
void
) mupDefineFun1(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun1_t
a_pFun
,
muBool_t
a_bOptimize
);
119
API_EXPORT
(
void
) mupDefineFun2(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun2_t
a_pFun
,
muBool_t
a_bOptimize
);
120
API_EXPORT
(
void
) mupDefineFun3(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun3_t
a_pFun
,
muBool_t
a_bOptimize
);
121
API_EXPORT
(
void
) mupDefineFun4(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun4_t
a_pFun
,
muBool_t
a_bOptimize
);
122
API_EXPORT
(
void
) mupDefineFun5(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun5_t
a_pFun
,
muBool_t
a_bOptimize
);
123
API_EXPORT
(
void
) mupDefineFun6(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun6_t
a_pFun
,
muBool_t
a_bOptimize
);
124
API_EXPORT
(
void
) mupDefineFun7(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun7_t
a_pFun
,
muBool_t
a_bOptimize
);
125
API_EXPORT
(
void
) mupDefineFun8(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun8_t
a_pFun
,
muBool_t
a_bOptimize
);
126
API_EXPORT
(
void
) mupDefineFun9(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun9_t
a_pFun
,
muBool_t
a_bOptimize
);
127
API_EXPORT
(
void
) mupDefineFun10(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muFun10_t
a_pFun
,
muBool_t
a_bOptimize
);
128
129
// Defining bulkmode functions
130
API_EXPORT
(
void
) mupDefineBulkFun0(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun0_t
a_pFun
);
131
API_EXPORT
(
void
) mupDefineBulkFun1(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun1_t
a_pFun
);
132
API_EXPORT
(
void
) mupDefineBulkFun2(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun2_t
a_pFun
);
133
API_EXPORT
(
void
) mupDefineBulkFun3(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun3_t
a_pFun
);
134
API_EXPORT
(
void
) mupDefineBulkFun4(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun4_t
a_pFun
);
135
API_EXPORT
(
void
) mupDefineBulkFun5(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun5_t
a_pFun
);
136
API_EXPORT
(
void
) mupDefineBulkFun6(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun6_t
a_pFun
);
137
API_EXPORT
(
void
) mupDefineBulkFun7(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun7_t
a_pFun
);
138
API_EXPORT
(
void
) mupDefineBulkFun8(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun8_t
a_pFun
);
139
API_EXPORT
(
void
) mupDefineBulkFun9(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun9_t
a_pFun
);
140
API_EXPORT
(
void
) mupDefineBulkFun10(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muBulkFun10_t
a_pFun
);
141
142
// string functions
143
API_EXPORT
(
void
) mupDefineStrFun1(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muStrFun1_t
a_pFun
);
144
API_EXPORT
(
void
) mupDefineStrFun2(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muStrFun2_t
a_pFun
);
145
API_EXPORT
(
void
) mupDefineStrFun3(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
,
muStrFun3_t
a_pFun
);
146
147
API_EXPORT
(
void
) mupDefineMultFun(
muParserHandle_t
a_hParser,
148
const
muChar_t
*
a_szName
,
149
muMultFun_t
a_pFun
,
150
muBool_t
a_bOptimize
);
151
152
API_EXPORT
(
void
) mupDefineOprt(
muParserHandle_t
a_hParser,
153
const
muChar_t
*
a_szName
,
154
muFun2_t
a_pFun
,
155
muInt_t
a_nPrec
,
156
muInt_t
a_nOprtAsct
,
157
muBool_t
a_bOptimize
);
158
159
API_EXPORT
(
void
) mupDefineConst(
muParserHandle_t
a_hParser,
160
const
muChar_t
*
a_szName
,
161
muFloat_t
a_fVal
);
162
163
API_EXPORT
(
void
) mupDefineStrConst(
muParserHandle_t
a_hParser,
164
const
muChar_t
*
a_szName
,
165
const
muChar_t
*
a_sVal
);
166
167
API_EXPORT
(
void
) mupDefineVar(
muParserHandle_t
a_hParser,
168
const
muChar_t
*
a_szName
,
169
muFloat_t
*
a_fVar
);
170
171
API_EXPORT
(
void
) mupDefineBulkVar(
muParserHandle_t
a_hParser,
172
const
muChar_t
*
a_szName
,
173
muFloat_t
*
a_fVar
);
174
175
API_EXPORT
(
void
) mupDefinePostfixOprt(
muParserHandle_t
a_hParser,
176
const
muChar_t
*
a_szName
,
177
muFun1_t
a_pOprt
,
178
muBool_t
a_bOptimize
);
179
180
181
API_EXPORT
(
void
) mupDefineInfixOprt(
muParserHandle_t
a_hParser,
182
const
muChar_t
*
a_szName
,
183
muFun1_t
a_pOprt
,
184
muBool_t
a_bOptimize
);
185
186
// Define character sets for identifiers
187
API_EXPORT
(
void
) mupDefineNameChars(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szCharset
);
188
API_EXPORT
(
void
) mupDefineOprtChars(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szCharset
);
189
API_EXPORT
(
void
) mupDefineInfixOprtChars(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szCharset
);
190
191
// Remove all / single variables
192
API_EXPORT
(
void
) mupRemoveVar(
muParserHandle_t
a_hParser,
const
muChar_t
*
a_szName
);
193
API_EXPORT
(
void
) mupClearVar(
muParserHandle_t
a_hParser);
194
API_EXPORT
(
void
) mupClearConst(
muParserHandle_t
a_hParser);
195
API_EXPORT
(
void
) mupClearOprt(
muParserHandle_t
a_hParser);
196
API_EXPORT
(
void
) mupClearFun(
muParserHandle_t
a_hParser);
197
198
// Querying variables / expression variables / constants
199
API_EXPORT
(
int
) mupGetExprVarNum(
muParserHandle_t
a_hParser);
200
API_EXPORT
(
int
) mupGetVarNum(
muParserHandle_t
a_hParser);
201
API_EXPORT
(
int
) mupGetConstNum(
muParserHandle_t
a_hParser);
202
API_EXPORT
(
void
) mupGetExprVar(
muParserHandle_t
a_hParser,
unsigned
a_iVar
,
const
muChar_t
**
a_pszName
,
muFloat_t
**
a_pVar
);
203
API_EXPORT
(
void
) mupGetVar(
muParserHandle_t
a_hParser,
unsigned
a_iVar
,
const
muChar_t
**
a_pszName
,
muFloat_t
**
a_pVar
);
204
API_EXPORT
(
void
) mupGetConst(
muParserHandle_t
a_hParser,
unsigned
a_iVar
,
const
muChar_t
**
a_pszName
,
muFloat_t
*
a_pVar
);
205
API_EXPORT
(
void
) mupSetArgSep(
muParserHandle_t
a_hParser,
const
muChar_t
cArgSep
);
206
API_EXPORT
(
void
) mupSetDecSep(
muParserHandle_t
a_hParser,
const
muChar_t
cArgSep
);
207
API_EXPORT
(
void
) mupSetThousandsSep(
muParserHandle_t
a_hParser,
const
muChar_t
cArgSep
);
208
API_EXPORT
(
void
) mupResetLocale(
muParserHandle_t
a_hParser);
209
210
// Add value recognition callbacks
211
API_EXPORT
(
void
) mupAddValIdent(
muParserHandle_t
a_hParser,
muIdentFun_t
);
212
213
// Error handling
214
API_EXPORT
(
muBool_t
) mupError(
muParserHandle_t
a_hParser);
215
API_EXPORT
(
void
) mupErrorReset(
muParserHandle_t
a_hParser);
216
API_EXPORT
(
void
) mupSetErrorHandler(
muParserHandle_t
a_hParser,
muErrorHandler_t
a_pErrHandler
);
217
API_EXPORT
(
const
muChar_t
*) mupGetErrorMsg(
muParserHandle_t
a_hParser);
218
API_EXPORT
(
muInt_t
) mupGetErrorCode(
muParserHandle_t
a_hParser);
219
API_EXPORT
(
muInt_t
) mupGetErrorPos(
muParserHandle_t
a_hParser);
220
API_EXPORT
(
const
muChar_t
*) mupGetErrorToken(
muParserHandle_t
a_hParser);
221
//API_EXPORT(const muChar_t*) mupGetErrorExpr(muParserHandle_t a_hParser);
222
223
// This is used for .NET only. It creates a new variable allowing the dll to
224
// manage the variable rather than the .NET garbage collector.
225
API_EXPORT
(
muFloat_t
*) mupCreateVar();
226
API_EXPORT
(
void
) mupReleaseVar(
muFloat_t
*);
227
228
#ifdef __cplusplus
229
}
230
#endif
231
232
#endif // include guard
muparser
include
muParserDLL.h
Generated on Fri Sep 11 2020 14:30:12 for OpcUaCanOpen by
1.8.14