Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
89ecc939
提交
89ecc939
authored
11月 13, 2007
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dos2unix
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@6242
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
797d7c57
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
4713 行增加
和
4713 行删除
+4713
-4713
conio.h
src/mod/applications/mod_expr/conio.h
+161
-161
exprconf.h
src/mod/applications/mod_expr/exprconf.h
+29
-29
expreval.c
src/mod/applications/mod_expr/expreval.c
+268
-268
expreval.h
src/mod/applications/mod_expr/expreval.h
+127
-127
exprfunc.c
src/mod/applications/mod_expr/exprfunc.c
+329
-329
exprilfs.h
src/mod/applications/mod_expr/exprilfs.h
+1064
-1064
exprincl.h
src/mod/applications/mod_expr/exprincl.h
+112
-112
exprinit.c
src/mod/applications/mod_expr/exprinit.c
+115
-115
exprmem.c
src/mod/applications/mod_expr/exprmem.c
+39
-39
exprmem.h
src/mod/applications/mod_expr/exprmem.h
+21
-21
exprobj.c
src/mod/applications/mod_expr/exprobj.c
+237
-237
exprpars.c
src/mod/applications/mod_expr/exprpars.c
+1558
-1558
exprpriv.h
src/mod/applications/mod_expr/exprpriv.h
+215
-215
exprutil.c
src/mod/applications/mod_expr/exprutil.c
+43
-43
exprval.c
src/mod/applications/mod_expr/exprval.c
+395
-395
没有找到文件。
src/mod/applications/mod_expr/conio.h
浏览文件 @
89ecc939
/* A conio implementation for Mingw/Dev-C++.
*
* Written by:
* Hongli Lai <hongli@telekabel.nl>
* tkorrovi <tkorrovi@altavista.net> on 2002/02/26.
* Andrew Westcott <ajwestco@users.sourceforge.net>
*
* Offered for use in the public domain without any warranty.
*/
#ifndef _CONIO_H_
#define _CONIO_H_
#include <stdio.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#define BLINK 0
typedef
enum
{
BLACK
,
BLUE
,
GREEN
,
CYAN
,
RED
,
MAGENTA
,
BROWN
,
LIGHTGRAY
,
DARKGRAY
,
LIGHTBLUE
,
LIGHTGREEN
,
LIGHTCYAN
,
LIGHTRED
,
LIGHTMAGENTA
,
YELLOW
,
WHITE
}
COLORS
;
#define cgets _cgets
#define cprintf _cprintf
#define cputs _cputs
#define cscanf _cscanf
#define ScreenClear clrscr
/* blinkvideo */
void
clreol
(
void
);
void
clrscr
(
void
);
int
_conio_gettext
(
int
left
,
int
top
,
int
right
,
int
bottom
,
char
*
str
);
/* _conio_kbhit */
void
delline
(
void
);
/* gettextinfo */
void
gotoxy
(
int
x
,
int
y
);
/*
highvideo
insline
intensevideo
lowvideo
movetext
normvideo
*/
void
gotoxy
(
int
x
,
int
y
);
void
puttext
(
int
left
,
int
top
,
int
right
,
int
bottom
,
char
*
str
);
// Screen Variables
/* ScreenCols
ScreenGetChar
ScreenGetCursor
ScreenMode
ScreenPutChar
ScreenPutString
ScreenRetrieve
ScreenRows
ScreenSetCursor
ScreenUpdate
ScreenUpdateLine
ScreenVisualBell
_set_screen_lines */
void
_setcursortype
(
int
type
);
void
textattr
(
int
_attr
);
void
textbackground
(
int
color
);
void
textcolor
(
int
color
);
/* textmode */
int
wherex
(
void
);
int
wherey
(
void
);
/* window */
/* The code below was part of Mingw's conio.h */
/*
* conio.h
*
* Low level console I/O functions. Pretty please try to use the ANSI
* standard ones if you are writing new code.
*
* This file is part of the Mingw32 package.
*
* Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.4 $
* $Author: hongli $
* $Date: 2002/04/26 19:31:25 $
*
*/
char
*
_cgets
(
char
*
);
int
_cprintf
(
const
char
*
,
...);
int
_cputs
(
const
char
*
);
int
_cscanf
(
char
*
,
...);
int
_getch
(
void
);
int
_getche
(
void
);
int
_kbhit
(
void
);
int
_putch
(
int
);
int
_ungetch
(
int
);
int
getch
(
void
);
int
getche
(
void
);
int
kbhit
(
void
);
int
putch
(
int
);
int
ungetch
(
int
);
#ifdef __cplusplus
}
#endif
#endif
/* _CONIO_H_ */
/* A conio implementation for Mingw/Dev-C++.
*
* Written by:
* Hongli Lai <hongli@telekabel.nl>
* tkorrovi <tkorrovi@altavista.net> on 2002/02/26.
* Andrew Westcott <ajwestco@users.sourceforge.net>
*
* Offered for use in the public domain without any warranty.
*/
#ifndef _CONIO_H_
#define _CONIO_H_
#include <stdio.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#define BLINK 0
typedef
enum
{
BLACK
,
BLUE
,
GREEN
,
CYAN
,
RED
,
MAGENTA
,
BROWN
,
LIGHTGRAY
,
DARKGRAY
,
LIGHTBLUE
,
LIGHTGREEN
,
LIGHTCYAN
,
LIGHTRED
,
LIGHTMAGENTA
,
YELLOW
,
WHITE
}
COLORS
;
#define cgets _cgets
#define cprintf _cprintf
#define cputs _cputs
#define cscanf _cscanf
#define ScreenClear clrscr
/* blinkvideo */
void
clreol
(
void
);
void
clrscr
(
void
);
int
_conio_gettext
(
int
left
,
int
top
,
int
right
,
int
bottom
,
char
*
str
);
/* _conio_kbhit */
void
delline
(
void
);
/* gettextinfo */
void
gotoxy
(
int
x
,
int
y
);
/*
highvideo
insline
intensevideo
lowvideo
movetext
normvideo
*/
void
gotoxy
(
int
x
,
int
y
);
void
puttext
(
int
left
,
int
top
,
int
right
,
int
bottom
,
char
*
str
);
// Screen Variables
/* ScreenCols
ScreenGetChar
ScreenGetCursor
ScreenMode
ScreenPutChar
ScreenPutString
ScreenRetrieve
ScreenRows
ScreenSetCursor
ScreenUpdate
ScreenUpdateLine
ScreenVisualBell
_set_screen_lines */
void
_setcursortype
(
int
type
);
void
textattr
(
int
_attr
);
void
textbackground
(
int
color
);
void
textcolor
(
int
color
);
/* textmode */
int
wherex
(
void
);
int
wherey
(
void
);
/* window */
/* The code below was part of Mingw's conio.h */
/*
* conio.h
*
* Low level console I/O functions. Pretty please try to use the ANSI
* standard ones if you are writing new code.
*
* This file is part of the Mingw32 package.
*
* Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.4 $
* $Author: hongli $
* $Date: 2002/04/26 19:31:25 $
*
*/
char
*
_cgets
(
char
*
);
int
_cprintf
(
const
char
*
,
...);
int
_cputs
(
const
char
*
);
int
_cscanf
(
char
*
,
...);
int
_getch
(
void
);
int
_getche
(
void
);
int
_kbhit
(
void
);
int
_putch
(
int
);
int
_ungetch
(
int
);
int
getch
(
void
);
int
getche
(
void
);
int
kbhit
(
void
);
int
putch
(
int
);
int
ungetch
(
int
);
#ifdef __cplusplus
}
#endif
#endif
/* _CONIO_H_ */
src/mod/applications/mod_expr/exprconf.h
浏览文件 @
89ecc939
/*
File: exprconf.h
Auth: Brian Allen Vanderburg II
Date: Thursday, October 20, 2005
Desc: Configuration for ExprEval
This file is part of ExprEval.
*/
#ifndef __BAVII_EXPRCONF_H
#define __BAVII_EXPRCONF_H
/*
Error checking level
0: Don't check any errors (don't use errno). Divide by 0
is avoided and the part that divides by 0 is 0. For example
'4+1/0' is 4.
1: Check math errors.
*/
#define EXPR_ERROR_LEVEL_NONE 0
#define EXPR_ERROR_LEVEL_CHECK 1
#ifndef EXPR_ERROR_LEVEL
#define EXPR_ERROR_LEVEL EXPR_ERROR_LEVEL_CHECK
#endif
#endif
/* __BAVII_EXPRCONF_H */
/*
File: exprconf.h
Auth: Brian Allen Vanderburg II
Date: Thursday, October 20, 2005
Desc: Configuration for ExprEval
This file is part of ExprEval.
*/
#ifndef __BAVII_EXPRCONF_H
#define __BAVII_EXPRCONF_H
/*
Error checking level
0: Don't check any errors (don't use errno). Divide by 0
is avoided and the part that divides by 0 is 0. For example
'4+1/0' is 4.
1: Check math errors.
*/
#define EXPR_ERROR_LEVEL_NONE 0
#define EXPR_ERROR_LEVEL_CHECK 1
#ifndef EXPR_ERROR_LEVEL
#define EXPR_ERROR_LEVEL EXPR_ERROR_LEVEL_CHECK
#endif
#endif
/* __BAVII_EXPRCONF_H */
src/mod/applications/mod_expr/expreval.c
浏览文件 @
89ecc939
差异被折叠。
点击展开。
src/mod/applications/mod_expr/expreval.h
浏览文件 @
89ecc939
/*
File: expreval.h
Auth: Brian Allen Vanderburg II
Date: Thursday, April 24, 2003
Desc: Main include file for ExprEval library
This file is part of ExprEval.
*/
/* Include once */
#ifndef __BAVII_EXPREVAL_H
#define __BAVII_EXPREVAL_H
#ifdef __cplusplus
extern
"C"
{
#endif
/* Define type of data to use */
typedef
double
EXPRTYPE
;
/* Defines for various things */
/* Max id size */
#define EXPR_MAXIDENTSIZE 255
/* Error values */
enum
{
EXPR_ERROR_UNKNOWN
=
-
1
,
/* Unknown error */
EXPR_ERROR_NOERROR
=
0
,
/* No Error */
EXPR_ERROR_MEMORY
,
/* Memory allocation failed */
EXPR_ERROR_NULLPOINTER
,
/* Null pointer passed to function */
EXPR_ERROR_NOTFOUND
,
/* Item not found in a list */
EXPR_ERROR_UNMATCHEDCOMMENT
,
/* Unmatched comment tags */
EXPR_ERROR_INVALIDCHAR
,
/* Invalid characters in expression */
EXPR_ERROR_ALREADYEXISTS
,
/* An item already called create */
EXPR_ERROR_ALREADYPARSEDBAD
,
/* Expression parsed already, but unsuccessfully. call free or clear */
EXPR_ERROR_ALREADYPARSEDGOOD
,
/* Expression parsed already, successfully, call free or clear */
EXPR_ERROR_EMPTYEXPR
,
/* Empty expression string passed to parse */
EXPR_ERROR_UNMATCHEDPAREN
,
/* Unmatched parenthesis */
EXPR_ERROR_SYNTAX
,
/* Syntax error in expression */
EXPR_ERROR_MISSINGSEMICOLON
,
/* Missing semicolon at end of expression */
EXPR_ERROR_BADIDENTIFIER
,
/* Identifier was to big or not formed right */
EXPR_ERROR_NOSUCHFUNCTION
,
/* Function does not exist in function list */
EXPR_ERROR_BADNUMBERARGUMENTS
,
/* Bad number of arguments in a function call */
EXPR_ERROR_BADEXPR
,
/* This is a bad expression to evaluate. It has not been parsed or has unsuccessfully */
EXPR_ERROR_UNABLETOASSIGN
,
/* Unable to do an assignment, maybe no variable list */
EXPR_ERROR_DIVBYZERO
,
/* Attempted a division by zero */
EXPR_ERROR_NOVARLIST
,
/* No variable list found but one is needed */
EXPR_ERROR_BREAK
,
/* Expression was broken by break function */
EXPR_ERROR_CONSTANTASSIGN
,
/* Assignment to a constant */
EXPR_ERROR_REFCONSTANT
,
/* Constant used as a reference parameter */
EXPR_ERROR_OUTOFRANGE
,
/* A bad value was passed to a function */
EXPR_ERROR_USER
/* Custom errors should be larger than this */
};
/* Macros */
/* Forward declarations */
typedef
struct
_exprNode
exprNode
;
typedef
struct
_exprFuncList
exprFuncList
;
typedef
struct
_exprValList
exprValList
;
typedef
struct
_exprObj
exprObj
;
/* Function types */
typedef
int
(
*
exprFuncType
)(
exprObj
*
obj
,
exprNode
*
nodes
,
int
nodecount
,
EXPRTYPE
**
refs
,
int
refcount
,
EXPRTYPE
*
val
);
typedef
int
(
*
exprBreakFuncType
)(
exprObj
*
obj
);
/* Functions */
/* Version information function */
void
exprGetVersion
(
int
*
major
,
int
*
minor
);
/* Functions for function lists */
int
exprFuncListCreate
(
exprFuncList
**
flist
);
int
exprFuncListAdd
(
exprFuncList
*
flist
,
char
*
name
,
exprFuncType
ptr
,
int
min
,
int
max
,
int
refmin
,
int
refmax
);
int
exprFuncListFree
(
exprFuncList
*
flist
);
int
exprFuncListClear
(
exprFuncList
*
flist
);
int
exprFuncListInit
(
exprFuncList
*
flist
);
/* Functions for value lists */
int
exprValListCreate
(
exprValList
**
vlist
);
int
exprValListAdd
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
val
);
int
exprValListSet
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
val
);
int
exprValListGet
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
*
val
);
int
exprValListAddAddress
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
*
addr
);
int
exprValListGetAddress
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
**
addr
);
void
*
exprValListGetNext
(
exprValList
*
vlist
,
char
**
name
,
EXPRTYPE
*
value
,
EXPRTYPE
**
addr
,
void
*
cookie
);
int
exprValListFree
(
exprValList
*
vlist
);
int
exprValListClear
(
exprValList
*
vlist
);
int
exprValListInit
(
exprValList
*
vlist
);
/* Functions for expression objects */
int
exprCreate
(
exprObj
**
obj
,
exprFuncList
*
flist
,
exprValList
*
vlist
,
exprValList
*
clist
,
exprBreakFuncType
breaker
,
void
*
userdata
);
int
exprFree
(
exprObj
*
obj
);
int
exprClear
(
exprObj
*
obj
);
int
exprParse
(
exprObj
*
obj
,
char
*
expr
);
int
exprEval
(
exprObj
*
obj
,
EXPRTYPE
*
val
);
int
exprEvalNode
(
exprObj
*
obj
,
exprNode
*
nodes
,
int
curnode
,
EXPRTYPE
*
val
);
exprFuncList
*
exprGetFuncList
(
exprObj
*
obj
);
exprValList
*
exprGetVarList
(
exprObj
*
obj
);
exprValList
*
exprGetConstList
(
exprObj
*
obj
);
exprBreakFuncType
exprGetBreakFunc
(
exprObj
*
obj
);
int
exprGetBreakResult
(
exprObj
*
obj
);
void
*
exprGetUserData
(
exprObj
*
obj
);
void
exprSetUserData
(
exprObj
*
obj
,
void
*
userdata
);
void
exprSetBreakCount
(
exprObj
*
obj
,
int
count
);
void
exprGetErrorPosition
(
exprObj
*
obj
,
int
*
start
,
int
*
end
);
/* Other useful routines */
int
exprValidIdent
(
char
*
name
);
/* Name mangling */
#ifdef __cplusplus
}
#endif
#endif
/* __BAVII_EXPREVAL_H */
/*
File: expreval.h
Auth: Brian Allen Vanderburg II
Date: Thursday, April 24, 2003
Desc: Main include file for ExprEval library
This file is part of ExprEval.
*/
/* Include once */
#ifndef __BAVII_EXPREVAL_H
#define __BAVII_EXPREVAL_H
#ifdef __cplusplus
extern
"C"
{
#endif
/* Define type of data to use */
typedef
double
EXPRTYPE
;
/* Defines for various things */
/* Max id size */
#define EXPR_MAXIDENTSIZE 255
/* Error values */
enum
{
EXPR_ERROR_UNKNOWN
=
-
1
,
/* Unknown error */
EXPR_ERROR_NOERROR
=
0
,
/* No Error */
EXPR_ERROR_MEMORY
,
/* Memory allocation failed */
EXPR_ERROR_NULLPOINTER
,
/* Null pointer passed to function */
EXPR_ERROR_NOTFOUND
,
/* Item not found in a list */
EXPR_ERROR_UNMATCHEDCOMMENT
,
/* Unmatched comment tags */
EXPR_ERROR_INVALIDCHAR
,
/* Invalid characters in expression */
EXPR_ERROR_ALREADYEXISTS
,
/* An item already called create */
EXPR_ERROR_ALREADYPARSEDBAD
,
/* Expression parsed already, but unsuccessfully. call free or clear */
EXPR_ERROR_ALREADYPARSEDGOOD
,
/* Expression parsed already, successfully, call free or clear */
EXPR_ERROR_EMPTYEXPR
,
/* Empty expression string passed to parse */
EXPR_ERROR_UNMATCHEDPAREN
,
/* Unmatched parenthesis */
EXPR_ERROR_SYNTAX
,
/* Syntax error in expression */
EXPR_ERROR_MISSINGSEMICOLON
,
/* Missing semicolon at end of expression */
EXPR_ERROR_BADIDENTIFIER
,
/* Identifier was to big or not formed right */
EXPR_ERROR_NOSUCHFUNCTION
,
/* Function does not exist in function list */
EXPR_ERROR_BADNUMBERARGUMENTS
,
/* Bad number of arguments in a function call */
EXPR_ERROR_BADEXPR
,
/* This is a bad expression to evaluate. It has not been parsed or has unsuccessfully */
EXPR_ERROR_UNABLETOASSIGN
,
/* Unable to do an assignment, maybe no variable list */
EXPR_ERROR_DIVBYZERO
,
/* Attempted a division by zero */
EXPR_ERROR_NOVARLIST
,
/* No variable list found but one is needed */
EXPR_ERROR_BREAK
,
/* Expression was broken by break function */
EXPR_ERROR_CONSTANTASSIGN
,
/* Assignment to a constant */
EXPR_ERROR_REFCONSTANT
,
/* Constant used as a reference parameter */
EXPR_ERROR_OUTOFRANGE
,
/* A bad value was passed to a function */
EXPR_ERROR_USER
/* Custom errors should be larger than this */
};
/* Macros */
/* Forward declarations */
typedef
struct
_exprNode
exprNode
;
typedef
struct
_exprFuncList
exprFuncList
;
typedef
struct
_exprValList
exprValList
;
typedef
struct
_exprObj
exprObj
;
/* Function types */
typedef
int
(
*
exprFuncType
)(
exprObj
*
obj
,
exprNode
*
nodes
,
int
nodecount
,
EXPRTYPE
**
refs
,
int
refcount
,
EXPRTYPE
*
val
);
typedef
int
(
*
exprBreakFuncType
)(
exprObj
*
obj
);
/* Functions */
/* Version information function */
void
exprGetVersion
(
int
*
major
,
int
*
minor
);
/* Functions for function lists */
int
exprFuncListCreate
(
exprFuncList
**
flist
);
int
exprFuncListAdd
(
exprFuncList
*
flist
,
char
*
name
,
exprFuncType
ptr
,
int
min
,
int
max
,
int
refmin
,
int
refmax
);
int
exprFuncListFree
(
exprFuncList
*
flist
);
int
exprFuncListClear
(
exprFuncList
*
flist
);
int
exprFuncListInit
(
exprFuncList
*
flist
);
/* Functions for value lists */
int
exprValListCreate
(
exprValList
**
vlist
);
int
exprValListAdd
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
val
);
int
exprValListSet
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
val
);
int
exprValListGet
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
*
val
);
int
exprValListAddAddress
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
*
addr
);
int
exprValListGetAddress
(
exprValList
*
vlist
,
char
*
name
,
EXPRTYPE
**
addr
);
void
*
exprValListGetNext
(
exprValList
*
vlist
,
char
**
name
,
EXPRTYPE
*
value
,
EXPRTYPE
**
addr
,
void
*
cookie
);
int
exprValListFree
(
exprValList
*
vlist
);
int
exprValListClear
(
exprValList
*
vlist
);
int
exprValListInit
(
exprValList
*
vlist
);
/* Functions for expression objects */
int
exprCreate
(
exprObj
**
obj
,
exprFuncList
*
flist
,
exprValList
*
vlist
,
exprValList
*
clist
,
exprBreakFuncType
breaker
,
void
*
userdata
);
int
exprFree
(
exprObj
*
obj
);
int
exprClear
(
exprObj
*
obj
);
int
exprParse
(
exprObj
*
obj
,
char
*
expr
);
int
exprEval
(
exprObj
*
obj
,
EXPRTYPE
*
val
);
int
exprEvalNode
(
exprObj
*
obj
,
exprNode
*
nodes
,
int
curnode
,
EXPRTYPE
*
val
);
exprFuncList
*
exprGetFuncList
(
exprObj
*
obj
);
exprValList
*
exprGetVarList
(
exprObj
*
obj
);
exprValList
*
exprGetConstList
(
exprObj
*
obj
);
exprBreakFuncType
exprGetBreakFunc
(
exprObj
*
obj
);
int
exprGetBreakResult
(
exprObj
*
obj
);
void
*
exprGetUserData
(
exprObj
*
obj
);
void
exprSetUserData
(
exprObj
*
obj
,
void
*
userdata
);
void
exprSetBreakCount
(
exprObj
*
obj
,
int
count
);
void
exprGetErrorPosition
(
exprObj
*
obj
,
int
*
start
,
int
*
end
);
/* Other useful routines */
int
exprValidIdent
(
char
*
name
);
/* Name mangling */
#ifdef __cplusplus
}
#endif
#endif
/* __BAVII_EXPREVAL_H */
src/mod/applications/mod_expr/exprfunc.c
浏览文件 @
89ecc939
差异被折叠。
点击展开。
src/mod/applications/mod_expr/exprilfs.h
浏览文件 @
89ecc939
差异被折叠。
点击展开。
src/mod/applications/mod_expr/exprincl.h
浏览文件 @
89ecc939
/*
File: exprincl.h
Auth: Brian Allen Vanderburg II
Date: Thursday, April 24, 2003
Desc: Includes, macros, etc needed by this library
This file is part of ExprEval.
*/
#ifndef __BAVII_EXPRINCL_H
#define __BAVII_EXPRINCL_H
/* Includes and macros and whatnot for building the library */
#ifdef _MSC_VER
#if (_MSC_VER >= 1400) // VC8+
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#endif
#ifndef _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#endif
#endif // VC8+
#endif
/* Memory routines. memory.h for VC++, mem.h for BC++ */
#ifdef __TURBOC__
#include <mem.h>
#else
#include <memory.h>
#endif
/* Memory allocation */
#include <malloc.h>
/* String routines */
#include <string.h>
/* Character manipulation routines */
#include <ctype.h>
/* Standard routines */
#include <stdlib.h>
/* Math routines */
#include <math.h>
/* Time */
#include <time.h>
/* Math constants. VC++ does not seem to have these */
#ifndef M_E
#define M_E 2.7182818284590452354
#endif
#ifndef M_LOG2E
#define M_LOG2E 1.4426950408889634074
#endif
#ifndef M_LOG10E
#define M_LOG10E 0.43429448190325182765
#endif
#ifndef M_LN2
#define M_LN2 0.69314718055994530942
#endif
#ifndef M_LN10
#define M_LN10 2.30258509299404568402
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_PI_2
#define M_PI_2 1.57079632679489661923
#endif
#ifndef M_PI_4
#define M_PI_4 0.78539816339744830962
#endif
#ifndef M_1_PI
#define M_1_PI 0.31830988618379067154
#endif
#ifndef M_2_PI
#define M_2_PI 0.63661977236758134308
#endif
#ifndef M_1_SQRTPI
#define M_1_SQRTPI 0.56418958354776
#endif
#ifndef M_2_SQRTPI
#define M_2_SQRTPI 1.12837916709551257390
#endif
#ifndef M_SQRT2
#define M_SQRT2 1.41421356237309504880
#endif
#ifndef M_1_SQRT2
#define M_1_SQRT2 0.70710678118654752440
#endif
#endif
/* __BAVII_EXPRINCL_H */
/*
File: exprincl.h
Auth: Brian Allen Vanderburg II
Date: Thursday, April 24, 2003
Desc: Includes, macros, etc needed by this library
This file is part of ExprEval.
*/
#ifndef __BAVII_EXPRINCL_H
#define __BAVII_EXPRINCL_H
/* Includes and macros and whatnot for building the library */
#ifdef _MSC_VER
#if (_MSC_VER >= 1400) // VC8+
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#endif
#ifndef _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#endif
#endif // VC8+
#endif
/* Memory routines. memory.h for VC++, mem.h for BC++ */
#ifdef __TURBOC__
#include <mem.h>
#else
#include <memory.h>
#endif
/* Memory allocation */
#include <malloc.h>
/* String routines */
#include <string.h>
/* Character manipulation routines */
#include <ctype.h>
/* Standard routines */
#include <stdlib.h>
/* Math routines */
#include <math.h>
/* Time */
#include <time.h>
/* Math constants. VC++ does not seem to have these */
#ifndef M_E
#define M_E 2.7182818284590452354
#endif
#ifndef M_LOG2E
#define M_LOG2E 1.4426950408889634074
#endif
#ifndef M_LOG10E
#define M_LOG10E 0.43429448190325182765
#endif
#ifndef M_LN2
#define M_LN2 0.69314718055994530942
#endif
#ifndef M_LN10
#define M_LN10 2.30258509299404568402
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_PI_2
#define M_PI_2 1.57079632679489661923
#endif
#ifndef M_PI_4
#define M_PI_4 0.78539816339744830962
#endif
#ifndef M_1_PI
#define M_1_PI 0.31830988618379067154
#endif
#ifndef M_2_PI
#define M_2_PI 0.63661977236758134308
#endif
#ifndef M_1_SQRTPI
#define M_1_SQRTPI 0.56418958354776
#endif
#ifndef M_2_SQRTPI
#define M_2_SQRTPI 1.12837916709551257390
#endif
#ifndef M_SQRT2
#define M_SQRT2 1.41421356237309504880
#endif
#ifndef M_1_SQRT2
#define M_1_SQRT2 0.70710678118654752440
#endif
#endif
/* __BAVII_EXPRINCL_H */
src/mod/applications/mod_expr/exprinit.c
浏览文件 @
89ecc939
/*
File: exprinit.c
Auth: Brian Allen Vanderburg II
Date: Thursday, May 1, 2003
Desc: Extra functions and routines for ExprEval
This file is part of ExprEval.
*/
/* Include files */
#include "exprincl.h"
#include "exprpriv.h"
/* Macro for adding a function node type */
#define EXPR_ADDFUNC_TYPE(name, type, argmin, argmax, refmin, refmax) \
err
=
exprFuncListAddType
(
flist
,
name
,
type
,
argmin
,
argmax
,
refmin
,
refmax
);
\
if
(
err
!=
EXPR_ERROR_NOERROR
)
\
return
err
;
/* Macro for adding a constant */
#define EXPR_ADDCONST(name, val) \
err
=
exprValListAdd
(
vlist
,
name
,
val
);
\
if
(
err
!=
EXPR_ERROR_NOERROR
)
\
return
err
;
/* Call this function to initialize these functions into a function list */
int
exprFuncListInit
(
exprFuncList
*
flist
)
{
int
err
;
if
(
flist
==
NULL
)
return
EXPR_ERROR_NULLPOINTER
;
EXPR_ADDFUNC_TYPE
(
"abs"
,
EXPR_NODEFUNC_ABS
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"mod"
,
EXPR_NODEFUNC_MOD
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"ipart"
,
EXPR_NODEFUNC_IPART
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"fpart"
,
EXPR_NODEFUNC_FPART
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"min"
,
EXPR_NODEFUNC_MIN
,
1
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"max"
,
EXPR_NODEFUNC_MAX
,
1
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"pow"
,
EXPR_NODEFUNC_POW
,
2
,
2
,
0
,
0
);
EXPR_ADDFUN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avg"
,
EXPR_NODEFUNC_AVG
,
1
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"clip"
,
EXPR_NODEFUNC_CLIP
,
3
,
3
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"clamp"
,
EXPR_NODEFUNC_CLAMP
,
3
,
3
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"pntchange"
,
EXPR_NODEFUNC_PNTCHANGE
,
5
,
5
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"poly"
,
EXPR_NODEFUNC_POLY
,
2
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"and"
,
EXPR_NODEFUNC_AND
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"or"
,
EXPR_NODEFUNC_OR
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"not"
,
EXPR_NODEFUNC_NOT
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"for"
,
EXPR_NODEFUNC_FOR
,
4
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"many"
,
EXPR_NODEFUNC_MANY
,
1
,
-
1
,
0
,
0
);
return
EXPR_ERROR_NOERROR
;
}
/* Call this function to initialize some constants into a value list */
int
exprValListInit
(
exprValList
*
vlist
)
{
int
err
;
if
(
vlist
==
NULL
)
return
EXPR_ERROR_NULLPOINTER
;
EXPR_ADDCONST
(
"M_E"
,
M_E
);
EXPR_ADDCONST
(
"M_LOG2E"
,
M_LOG2E
);
EXPR_ADDCONST
(
"M_LOG10E"
,
M_LOG10E
);
EXPR_ADDCONST
(
"M_LN2"
,
M_LN2
);
EXPR_ADDCONST
(
"M_LN10"
,
M_LN10
);
EXPR_ADDCONST
(
"M_PI"
,
M_PI
);
EXPR_ADDCONST
(
"M_PI_2"
,
M_PI_2
);
EXPR_ADDCONST
(
"M_PI_4"
,
M_PI_4
);
EXPR_ADDCONST
(
"M_1_PI"
,
M_1_PI
);
EXPR_ADDCONST
(
"M_2_PI"
,
M_2_PI
);
EXPR_ADDCONST
(
"M_1_SQRTPI"
,
M_1_SQRTPI
);
EXPR_ADDCONST
(
"M_2_SQRTPI"
,
M_2_SQRTPI
);
EXPR_ADDCONST
(
"M_SQRT2"
,
M_SQRT2
);
EXPR_ADDCONST
(
"M_1_SQRT2"
,
M_1_SQRT2
);
return
EXPR_ERROR_NOERROR
;
}
/*
File: exprinit.c
Auth: Brian Allen Vanderburg II
Date: Thursday, May 1, 2003
Desc: Extra functions and routines for ExprEval
This file is part of ExprEval.
*/
/* Include files */
#include "exprincl.h"
#include "exprpriv.h"
/* Macro for adding a function node type */
#define EXPR_ADDFUNC_TYPE(name, type, argmin, argmax, refmin, refmax) \
err = exprFuncListAddType(flist, name, type, argmin, argmax, refmin, refmax); \
if(err != EXPR_ERROR_NOERROR) \
return err;
/* Macro for adding a constant */
#define EXPR_ADDCONST(name, val) \
err = exprValListAdd(vlist, name, val); \
if(err != EXPR_ERROR_NOERROR) \
return err;
/* Call this function to initialize these functions into a function list */
int
exprFuncListInit
(
exprFuncList
*
flist
)
{
int
err
;
if
(
flist
==
NULL
)
return
EXPR_ERROR_NULLPOINTER
;
EXPR_ADDFUNC_TYPE
(
"abs"
,
EXPR_NODEFUNC_ABS
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"mod"
,
EXPR_NODEFUNC_MOD
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"ipart"
,
EXPR_NODEFUNC_IPART
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"fpart"
,
EXPR_NODEFUNC_FPART
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"min"
,
EXPR_NODEFUNC_MIN
,
1
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"max"
,
EXPR_NODEFUNC_MAX
,
1
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"pow"
,
EXPR_NODEFU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
);
EXPR_ADDFUNC_TYPE
(
"ceil"
,
EXPR_NODEFUNC_CEIL
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"floor"
,
EXPR_NODEFUNC_FLOOR
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"rand"
,
EXPR_NODEFUNC_RAND
,
0
,
0
,
1
,
1
);
EXPR_ADDFUNC_TYPE
(
"random"
,
EXPR_NODEFUNC_RANDOM
,
2
,
2
,
1
,
1
);
EXPR_ADDFUNC_TYPE
(
"randomize"
,
EXPR_NODEFUNC_RANDOMIZE
,
0
,
0
,
1
,
1
);
EXPR_ADDFUNC_TYPE
(
"deg"
,
EXPR_NODEFUNC_DEG
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"rad"
,
EXPR_NODEFUNC_RAD
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"recttopolr"
,
EXPR_NODEFUNC_RECTTOPOLR
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"recttopola"
,
EXPR_NODEFUNC_RECTTOPOLA
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"poltorectx"
,
EXPR_NODEFUNC_POLTORECTX
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"poltorecty"
,
EXPR_NODEFUNC_POLTORECTY
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"if"
,
EXPR_NODEFUNC_IF
,
3
,
3
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"select"
,
EXPR_NODEFUNC_SELECT
,
3
,
4
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"equal"
,
EXPR_NODEFUNC_EQUAL
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"above"
,
EXPR_NODEFUNC_ABOVE
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"below"
,
EXPR_NODEFUNC_BELOW
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"avg"
,
EXPR_NODEFUNC_AVG
,
1
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"clip"
,
EXPR_NODEFUNC_CLIP
,
3
,
3
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"clamp"
,
EXPR_NODEFUNC_CLAMP
,
3
,
3
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"pntchange"
,
EXPR_NODEFUNC_PNTCHANGE
,
5
,
5
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"poly"
,
EXPR_NODEFUNC_POLY
,
2
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"and"
,
EXPR_NODEFUNC_AND
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"or"
,
EXPR_NODEFUNC_OR
,
2
,
2
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"not"
,
EXPR_NODEFUNC_NOT
,
1
,
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"for"
,
EXPR_NODEFUNC_FOR
,
4
,
-
1
,
0
,
0
);
EXPR_ADDFUNC_TYPE
(
"many"
,
EXPR_NODEFUNC_MANY
,
1
,
-
1
,
0
,
0
);
return
EXPR_ERROR_NOERROR
;
}
/* Call this function to initialize some constants into a value list */
int
exprValListInit
(
exprValList
*
vlist
)
{
int
err
;
if
(
vlist
==
NULL
)
return
EXPR_ERROR_NULLPOINTER
;
EXPR_ADDCONST
(
"M_E"
,
M_E
);
EXPR_ADDCONST
(
"M_LOG2E"
,
M_LOG2E
);
EXPR_ADDCONST
(
"M_LOG10E"
,
M_LOG10E
);
EXPR_ADDCONST
(
"M_LN2"
,
M_LN2
);
EXPR_ADDCONST
(
"M_LN10"
,
M_LN10
);
EXPR_ADDCONST
(
"M_PI"
,
M_PI
);
EXPR_ADDCONST
(
"M_PI_2"
,
M_PI_2
);
EXPR_ADDCONST
(
"M_PI_4"
,
M_PI_4
);
EXPR_ADDCONST
(
"M_1_PI"
,
M_1_PI
);
EXPR_ADDCONST
(
"M_2_PI"
,
M_2_PI
);
EXPR_ADDCONST
(
"M_1_SQRTPI"
,
M_1_SQRTPI
);
EXPR_ADDCONST
(
"M_2_SQRTPI"
,
M_2_SQRTPI
);
EXPR_ADDCONST
(
"M_SQRT2"
,
M_SQRT2
);
EXPR_ADDCONST
(
"M_1_SQRT2"
,
M_1_SQRT2
);
return
EXPR_ERROR_NOERROR
;
}
src/mod/applications/mod_expr/exprmem.c
浏览文件 @
89ecc939
/*
File: exprmem.c
Auth: Brian Allen Vanderburg II
Date: Wednesday, April 30, 2003
Desc: Memory functions for ExprEval
This file is part of ExprEval.
*/
/* Includes */
#include "exprincl.h"
#include "exprmem.h"
/* Allocate memory and zero it */
void
*
exprAllocMem
(
size_t
size
)
{
void
*
data
=
malloc
(
size
);
if
(
data
)
{
memset
(
data
,
0
,
size
);
}
return
data
;
}
/* Free memory */
void
exprFreeMem
(
void
*
data
)
{
if
(
data
)
free
(
data
);
}
/* Allocate a list of nodes */
exprNode
*
exprAllocNodes
(
size_t
count
)
{
return
exprAllocMem
(
count
*
sizeof
(
exprNode
));
}
/*
File: exprmem.c
Auth: Brian Allen Vanderburg II
Date: Wednesday, April 30, 2003
Desc: Memory functions for ExprEval
This file is part of ExprEval.
*/
/* Includes */
#include "exprincl.h"
#include "exprmem.h"
/* Allocate memory and zero it */
void
*
exprAllocMem
(
size_t
size
)
{
void
*
data
=
malloc
(
size
);
if
(
data
)
{
memset
(
data
,
0
,
size
);
}
return
data
;
}
/* Free memory */
void
exprFreeMem
(
void
*
data
)
{
if
(
data
)
free
(
data
);
}
/* Allocate a list of nodes */
exprNode
*
exprAllocNodes
(
size_t
count
)
{
return
exprAllocMem
(
count
*
sizeof
(
exprNode
));
}
src/mod/applications/mod_expr/exprmem.h
浏览文件 @
89ecc939
/*
File: exprmem.h
Auth: Brian Allen Vanderburg II
Date: Wednesday, April 30, 2003
Desc: Memory functions for ExprEval
This file is part of ExprEval.
*/
#ifndef __BAVII_EXPRMEM_H
#define __BAVII_EXPRMEM_H
/* Needed for exprNode */
#include "exprpriv.h"
void
*
exprAllocMem
(
size_t
size
);
void
exprFreeMem
(
void
*
data
);
exprNode
*
exprAllocNodes
(
size_t
count
);
#endif
/* __BAVII_EXPRMEM_H */
/*
File: exprmem.h
Auth: Brian Allen Vanderburg II
Date: Wednesday, April 30, 2003
Desc: Memory functions for ExprEval
This file is part of ExprEval.
*/
#ifndef __BAVII_EXPRMEM_H
#define __BAVII_EXPRMEM_H
/* Needed for exprNode */
#include "exprpriv.h"
void
*
exprAllocMem
(
size_t
size
);
void
exprFreeMem
(
void
*
data
);
exprNode
*
exprAllocNodes
(
size_t
count
);
#endif
/* __BAVII_EXPRMEM_H */
src/mod/applications/mod_expr/exprobj.c
浏览文件 @
89ecc939
差异被折叠。
点击展开。
src/mod/applications/mod_expr/exprpars.c
浏览文件 @
89ecc939
差异被折叠。
点击展开。
src/mod/applications/mod_expr/exprpriv.h
浏览文件 @
89ecc939
差异被折叠。
点击展开。
src/mod/applications/mod_expr/exprutil.c
浏览文件 @
89ecc939
差异被折叠。
点击展开。
src/mod/applications/mod_expr/exprval.c
浏览文件 @
89ecc939
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论