--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/C/iec_std_FB_no_ENENO.h Sun May 08 20:01:15 2016 +0100
@@ -0,0 +1,1548 @@
+
+
+/****
+ * IEC 61131-3 standard function block library
+ */
+
+/* NOTE: The code in this file was generated by iec2c (i.e. matiec C compiler), using as source
+ * the *.txt files in the 'lib' directory.
+ * The only 'manual' change was:
+ * - to merge the generated .h and .c files into this single file
+ * - to remove the forward declarations of the functions
+ * - to change the function prototypes to become 'static'.
+ * e.g.: static void R_TRIG_init__(...)
+ * ^^^^^^
+ *
+ * NOTE: If the structure of the C code generated by iec2c (matiec) should change, then this C 'library'
+ * file will need to be recompiled.
+ * The correct way of going about this would be to have this file be automatically generated during
+ * the build process (i.e. after compiling matiec), but we will leave this for later if it ever
+ * becomes necessary.
+ *
+ * WARNING: There are 2 versions of this file:
+ * - file: iec_std_FB.h
+ * Version to be used when the EN and ENO parameters are implicitly generated
+ * for all functions and function blocks
+ * - file: iec_std_FB_no_ENENO.h
+ * Version to be used when the EN and ENO parameters are NOT implicitly generated
+ * for all functions and function blocks
+ */
+
+#ifndef _IEC_STD_FB_H
+#define _IEC_STD_FB_H
+
+
+#include "accessor.h"
+
+
+// FUNCTION_BLOCK R_TRIG
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CLK)
+ __DECLARE_VAR(BOOL,Q)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(BOOL,M)
+
+} R_TRIG;
+
+// FUNCTION_BLOCK F_TRIG
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CLK)
+ __DECLARE_VAR(BOOL,Q)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(BOOL,M)
+
+} F_TRIG;
+
+// FUNCTION_BLOCK SR
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,S1)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(BOOL,Q1)
+
+ // FB private variables - TEMP, private and located variables
+
+} SR;
+
+// FUNCTION_BLOCK RS
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,S)
+ __DECLARE_VAR(BOOL,R1)
+ __DECLARE_VAR(BOOL,Q1)
+
+ // FB private variables - TEMP, private and located variables
+
+} RS;
+
+// FUNCTION_BLOCK CTU
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(INT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(INT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CU_T;
+
+} CTU;
+
+// FUNCTION_BLOCK CTU_DINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(DINT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(DINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CU_T;
+
+} CTU_DINT;
+
+// FUNCTION_BLOCK CTU_LINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(LINT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(LINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CU_T;
+
+} CTU_LINT;
+
+// FUNCTION_BLOCK CTU_UDINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(UDINT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(UDINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CU_T;
+
+} CTU_UDINT;
+
+// FUNCTION_BLOCK CTU_ULINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(ULINT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(ULINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CU_T;
+
+} CTU_ULINT;
+
+// FUNCTION_BLOCK CTD
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(INT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(INT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+
+} CTD;
+
+// FUNCTION_BLOCK CTD_DINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(DINT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(DINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+
+} CTD_DINT;
+
+// FUNCTION_BLOCK CTD_LINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(LINT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(LINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+
+} CTD_LINT;
+
+// FUNCTION_BLOCK CTD_UDINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(UDINT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(UDINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+
+} CTD_UDINT;
+
+// FUNCTION_BLOCK CTD_ULINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(ULINT,PV)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(ULINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+
+} CTD_ULINT;
+
+// FUNCTION_BLOCK CTUD
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(INT,PV)
+ __DECLARE_VAR(BOOL,QU)
+ __DECLARE_VAR(BOOL,QD)
+ __DECLARE_VAR(INT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+ R_TRIG CU_T;
+
+} CTUD;
+
+// FUNCTION_BLOCK CTUD_DINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(DINT,PV)
+ __DECLARE_VAR(BOOL,QU)
+ __DECLARE_VAR(BOOL,QD)
+ __DECLARE_VAR(DINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+ R_TRIG CU_T;
+
+} CTUD_DINT;
+
+// FUNCTION_BLOCK CTUD_LINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(LINT,PV)
+ __DECLARE_VAR(BOOL,QU)
+ __DECLARE_VAR(BOOL,QD)
+ __DECLARE_VAR(LINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+ R_TRIG CU_T;
+
+} CTUD_LINT;
+
+// FUNCTION_BLOCK CTUD_UDINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(UDINT,PV)
+ __DECLARE_VAR(BOOL,QU)
+ __DECLARE_VAR(BOOL,QD)
+ __DECLARE_VAR(UDINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+ R_TRIG CU_T;
+
+} CTUD_UDINT;
+
+// FUNCTION_BLOCK CTUD_ULINT
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CU)
+ __DECLARE_VAR(BOOL,CD)
+ __DECLARE_VAR(BOOL,R)
+ __DECLARE_VAR(BOOL,LD)
+ __DECLARE_VAR(ULINT,PV)
+ __DECLARE_VAR(BOOL,QU)
+ __DECLARE_VAR(BOOL,QD)
+ __DECLARE_VAR(ULINT,CV)
+
+ // FB private variables - TEMP, private and located variables
+ R_TRIG CD_T;
+ R_TRIG CU_T;
+
+} CTUD_ULINT;
+
+// FUNCTION_BLOCK TP
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,IN)
+ __DECLARE_VAR(TIME,PT)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(TIME,ET)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(SINT,STATE)
+ __DECLARE_VAR(BOOL,PREV_IN)
+ __DECLARE_VAR(TIME,CURRENT_TIME)
+ __DECLARE_VAR(TIME,START_TIME)
+
+} TP;
+
+// FUNCTION_BLOCK TON
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,IN)
+ __DECLARE_VAR(TIME,PT)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(TIME,ET)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(SINT,STATE)
+ __DECLARE_VAR(BOOL,PREV_IN)
+ __DECLARE_VAR(TIME,CURRENT_TIME)
+ __DECLARE_VAR(TIME,START_TIME)
+
+} TON;
+
+// FUNCTION_BLOCK TOF
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,IN)
+ __DECLARE_VAR(TIME,PT)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(TIME,ET)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(SINT,STATE)
+ __DECLARE_VAR(BOOL,PREV_IN)
+ __DECLARE_VAR(TIME,CURRENT_TIME)
+ __DECLARE_VAR(TIME,START_TIME)
+
+} TOF;
+
+// FUNCTION_BLOCK DERIVATIVE
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,RUN)
+ __DECLARE_VAR(REAL,XIN)
+ __DECLARE_VAR(TIME,CYCLE)
+ __DECLARE_VAR(REAL,XOUT)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(REAL,X1)
+ __DECLARE_VAR(REAL,X2)
+ __DECLARE_VAR(REAL,X3)
+
+} DERIVATIVE;
+
+// FUNCTION_BLOCK HYSTERESIS
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(REAL,XIN1)
+ __DECLARE_VAR(REAL,XIN2)
+ __DECLARE_VAR(REAL,EPS)
+ __DECLARE_VAR(BOOL,Q)
+
+ // FB private variables - TEMP, private and located variables
+
+} HYSTERESIS;
+
+// FUNCTION_BLOCK INTEGRAL
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,RUN)
+ __DECLARE_VAR(BOOL,R1)
+ __DECLARE_VAR(REAL,XIN)
+ __DECLARE_VAR(REAL,X0)
+ __DECLARE_VAR(TIME,CYCLE)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(REAL,XOUT)
+
+ // FB private variables - TEMP, private and located variables
+
+} INTEGRAL;
+
+// FUNCTION_BLOCK PID
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,AUTO)
+ __DECLARE_VAR(REAL,PV)
+ __DECLARE_VAR(REAL,SP)
+ __DECLARE_VAR(REAL,X0)
+ __DECLARE_VAR(REAL,KP)
+ __DECLARE_VAR(REAL,TR)
+ __DECLARE_VAR(REAL,TD)
+ __DECLARE_VAR(TIME,CYCLE)
+ __DECLARE_VAR(REAL,XOUT)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(REAL,ERROR)
+ INTEGRAL ITERM;
+ DERIVATIVE DTERM;
+
+} PID;
+
+// FUNCTION_BLOCK RAMP
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,RUN)
+ __DECLARE_VAR(REAL,X0)
+ __DECLARE_VAR(REAL,X1)
+ __DECLARE_VAR(TIME,TR)
+ __DECLARE_VAR(TIME,CYCLE)
+ __DECLARE_VAR(BOOL,BUSY)
+ __DECLARE_VAR(REAL,XOUT)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(REAL,XI)
+ __DECLARE_VAR(TIME,T)
+
+} RAMP;
+
+// FUNCTION_BLOCK RTC
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,IN)
+ __DECLARE_VAR(DT,PDT)
+ __DECLARE_VAR(BOOL,Q)
+ __DECLARE_VAR(DT,CDT)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(BOOL,PREV_IN)
+ __DECLARE_VAR(TIME,OFFSET)
+ __DECLARE_VAR(DT,CURRENT_TIME)
+
+} RTC;
+
+// FUNCTION_BLOCK SEMA
+// Data part
+typedef struct {
+ // FB Interface - IN, OUT, IN_OUT variables
+ __DECLARE_VAR(BOOL,CLAIM)
+ __DECLARE_VAR(BOOL,RELEASE)
+ __DECLARE_VAR(BOOL,BUSY)
+
+ // FB private variables - TEMP, private and located variables
+ __DECLARE_VAR(BOOL,Q_INTERNAL)
+
+} SEMA;
+
+
+
+
+static void R_TRIG_init__(R_TRIG *data__, BOOL retain) {
+ __INIT_VAR(data__->CLK,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->M,__BOOL_LITERAL(FALSE),1)
+}
+
+// Code part
+static void R_TRIG_body__(R_TRIG *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CLK,) && !(__GET_VAR(data__->M,))));
+__SET_VAR(data__->,M,,__GET_VAR(data__->CLK,));
+
+goto __end;
+
+__end:
+ return;
+} // R_TRIG_body__()
+
+
+
+
+
+static void F_TRIG_init__(F_TRIG *data__, BOOL retain) {
+ __INIT_VAR(data__->CLK,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->M,__BOOL_LITERAL(FALSE),1)
+}
+
+// Code part
+static void F_TRIG_body__(F_TRIG *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->,Q,,(!(__GET_VAR(data__->CLK,)) && !(__GET_VAR(data__->M,))));
+__SET_VAR(data__->,M,,!(__GET_VAR(data__->CLK,)));
+
+goto __end;
+
+__end:
+ return;
+} // F_TRIG_body__()
+
+
+
+
+
+static void SR_init__(SR *data__, BOOL retain) {
+ __INIT_VAR(data__->S1,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->Q1,__BOOL_LITERAL(FALSE),retain)
+}
+
+// Code part
+static void SR_body__(SR *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->,Q1,,(__GET_VAR(data__->S1,) || (!(__GET_VAR(data__->R,)) && __GET_VAR(data__->Q1,))));
+
+goto __end;
+
+__end:
+ return;
+} // SR_body__()
+
+
+
+
+
+static void RS_init__(RS *data__, BOOL retain) {
+ __INIT_VAR(data__->S,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R1,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->Q1,__BOOL_LITERAL(FALSE),retain)
+}
+
+// Code part
+static void RS_body__(RS *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->,Q1,,(!(__GET_VAR(data__->R1,)) && (__GET_VAR(data__->S,) || __GET_VAR(data__->Q1,))));
+
+goto __end;
+
+__end:
+ return;
+} // RS_body__()
+
+
+
+
+
+static void CTU_init__(CTU *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTU_body__(CTU *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+
+goto __end;
+
+__end:
+ return;
+} // CTU_body__()
+
+
+
+
+
+static void CTU_DINT_init__(CTU_DINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTU_DINT_body__(CTU_DINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+
+goto __end;
+
+__end:
+ return;
+} // CTU_DINT_body__()
+
+
+
+
+
+static void CTU_LINT_init__(CTU_LINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTU_LINT_body__(CTU_LINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+
+goto __end;
+
+__end:
+ return;
+} // CTU_LINT_body__()
+
+
+
+
+
+static void CTU_UDINT_init__(CTU_UDINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTU_UDINT_body__(CTU_UDINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+
+goto __end;
+
+__end:
+ return;
+} // CTU_UDINT_body__()
+
+
+
+
+
+static void CTU_ULINT_init__(CTU_ULINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTU_ULINT_body__(CTU_ULINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+
+goto __end;
+
+__end:
+ return;
+} // CTU_ULINT_body__()
+
+
+
+
+
+static void CTD_init__(CTD *data__, BOOL retain) {
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+}
+
+// Code part
+static void CTD_body__(CTD *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTD_body__()
+
+
+
+
+
+static void CTD_DINT_init__(CTD_DINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+}
+
+// Code part
+static void CTD_DINT_body__(CTD_DINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTD_DINT_body__()
+
+
+
+
+
+static void CTD_LINT_init__(CTD_LINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+}
+
+// Code part
+static void CTD_LINT_body__(CTD_LINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTD_LINT_body__()
+
+
+
+
+
+static void CTD_UDINT_init__(CTD_UDINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+}
+
+// Code part
+static void CTD_UDINT_body__(CTD_UDINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTD_UDINT_body__()
+
+
+
+
+
+static void CTD_ULINT_init__(CTD_ULINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+}
+
+// Code part
+static void CTD_ULINT_body__(CTD_ULINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTD_ULINT_body__()
+
+
+
+
+
+static void CTUD_init__(CTUD *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTUD_body__(CTUD *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else {
+ if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
+ if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+ } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+ };
+ };
+};
+__SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+__SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTUD_body__()
+
+
+
+
+
+static void CTUD_DINT_init__(CTUD_DINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTUD_DINT_body__(CTUD_DINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else {
+ if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
+ if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+ } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+ };
+ };
+};
+__SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+__SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTUD_DINT_body__()
+
+
+
+
+
+static void CTUD_LINT_init__(CTUD_LINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTUD_LINT_body__(CTUD_LINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else {
+ if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
+ if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+ } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+ };
+ };
+};
+__SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+__SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTUD_LINT_body__()
+
+
+
+
+
+static void CTUD_UDINT_init__(CTUD_UDINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTUD_UDINT_body__(CTUD_UDINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else {
+ if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
+ if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+ } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+ };
+ };
+};
+__SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+__SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTUD_UDINT_body__()
+
+
+
+
+
+static void CTUD_ULINT_init__(CTUD_ULINT *data__, BOOL retain) {
+ __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CV,0,retain)
+ R_TRIG_init__(&data__->CD_T,retain);
+ R_TRIG_init__(&data__->CU_T,retain);
+}
+
+// Code part
+static void CTUD_ULINT_body__(CTUD_ULINT *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
+R_TRIG_body__(&data__->CD_T);
+__SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
+R_TRIG_body__(&data__->CU_T);
+if (__GET_VAR(data__->R,)) {
+ __SET_VAR(data__->,CV,,0);
+} else if (__GET_VAR(data__->LD,)) {
+ __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
+} else {
+ if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
+ if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
+ } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
+ __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
+ };
+ };
+};
+__SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
+__SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
+
+goto __end;
+
+__end:
+ return;
+} // CTUD_ULINT_body__()
+
+
+
+
+
+static void TP_init__(TP *data__, BOOL retain) {
+ __INIT_VAR(data__->IN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PT,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->ET,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->STATE,0,retain)
+ __INIT_VAR(data__->PREV_IN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CURRENT_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->START_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+}
+
+// Code part
+static void TP_body__(TP *data__) {
+// Initialise TEMP variables
+
+#define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
+#define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)
+__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)
+#undef GetFbVar
+#undef SetFbVar
+;
+if ((((__GET_VAR(data__->STATE,) == 0) && !(__GET_VAR(data__->PREV_IN,))) && __GET_VAR(data__->IN,))) {
+ __SET_VAR(data__->,STATE,,1);
+ __SET_VAR(data__->,Q,,__BOOL_LITERAL(TRUE));
+ __SET_VAR(data__->,START_TIME,,__GET_VAR(data__->CURRENT_TIME,));
+} else if ((__GET_VAR(data__->STATE,) == 1)) {
+ if (LE_TIME(2, __time_add(__GET_VAR(data__->START_TIME,), __GET_VAR(data__->PT,)), __GET_VAR(data__->CURRENT_TIME,))) {
+ __SET_VAR(data__->,STATE,,2);
+ __SET_VAR(data__->,Q,,__BOOL_LITERAL(FALSE));
+ __SET_VAR(data__->,ET,,__GET_VAR(data__->PT,));
+ } else {
+ __SET_VAR(data__->,ET,,__time_sub(__GET_VAR(data__->CURRENT_TIME,), __GET_VAR(data__->START_TIME,)));
+ };
+};
+if (((__GET_VAR(data__->STATE,) == 2) && !(__GET_VAR(data__->IN,)))) {
+ __SET_VAR(data__->,ET,,__time_to_timespec(1, 0, 0, 0, 0, 0));
+ __SET_VAR(data__->,STATE,,0);
+};
+__SET_VAR(data__->,PREV_IN,,__GET_VAR(data__->IN,));
+
+goto __end;
+
+__end:
+ return;
+} // TP_body__()
+
+
+
+
+
+static void TON_init__(TON *data__, BOOL retain) {
+ __INIT_VAR(data__->IN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PT,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->ET,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->STATE,0,retain)
+ __INIT_VAR(data__->PREV_IN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CURRENT_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->START_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+}
+
+// Code part
+static void TON_body__(TON *data__) {
+// Initialise TEMP variables
+
+#define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
+#define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)
+__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)
+#undef GetFbVar
+#undef SetFbVar
+;
+if ((((__GET_VAR(data__->STATE,) == 0) && !(__GET_VAR(data__->PREV_IN,))) && __GET_VAR(data__->IN,))) {
+ __SET_VAR(data__->,STATE,,1);
+ __SET_VAR(data__->,Q,,__BOOL_LITERAL(FALSE));
+ __SET_VAR(data__->,START_TIME,,__GET_VAR(data__->CURRENT_TIME,));
+} else {
+ if (!(__GET_VAR(data__->IN,))) {
+ __SET_VAR(data__->,ET,,__time_to_timespec(1, 0, 0, 0, 0, 0));
+ __SET_VAR(data__->,Q,,__BOOL_LITERAL(FALSE));
+ __SET_VAR(data__->,STATE,,0);
+ } else if ((__GET_VAR(data__->STATE,) == 1)) {
+ if (LE_TIME(2, __time_add(__GET_VAR(data__->START_TIME,), __GET_VAR(data__->PT,)), __GET_VAR(data__->CURRENT_TIME,))) {
+ __SET_VAR(data__->,STATE,,2);
+ __SET_VAR(data__->,Q,,__BOOL_LITERAL(TRUE));
+ __SET_VAR(data__->,ET,,__GET_VAR(data__->PT,));
+ } else {
+ __SET_VAR(data__->,ET,,__time_sub(__GET_VAR(data__->CURRENT_TIME,), __GET_VAR(data__->START_TIME,)));
+ };
+ };
+};
+__SET_VAR(data__->,PREV_IN,,__GET_VAR(data__->IN,));
+
+goto __end;
+
+__end:
+ return;
+} // TON_body__()
+
+
+
+
+
+static void TOF_init__(TOF *data__, BOOL retain) {
+ __INIT_VAR(data__->IN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PT,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->ET,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->STATE,0,retain)
+ __INIT_VAR(data__->PREV_IN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CURRENT_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->START_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+}
+
+// Code part
+static void TOF_body__(TOF *data__) {
+// Initialise TEMP variables
+
+#define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
+#define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)
+__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)
+#undef GetFbVar
+#undef SetFbVar
+;
+if ((((__GET_VAR(data__->STATE,) == 0) && __GET_VAR(data__->PREV_IN,)) && !(__GET_VAR(data__->IN,)))) {
+ __SET_VAR(data__->,STATE,,1);
+ __SET_VAR(data__->,START_TIME,,__GET_VAR(data__->CURRENT_TIME,));
+} else {
+ if (__GET_VAR(data__->IN,)) {
+ __SET_VAR(data__->,ET,,__time_to_timespec(1, 0, 0, 0, 0, 0));
+ __SET_VAR(data__->,STATE,,0);
+ } else if ((__GET_VAR(data__->STATE,) == 1)) {
+ if (LE_TIME(2, __time_add(__GET_VAR(data__->START_TIME,), __GET_VAR(data__->PT,)), __GET_VAR(data__->CURRENT_TIME,))) {
+ __SET_VAR(data__->,STATE,,2);
+ __SET_VAR(data__->,ET,,__GET_VAR(data__->PT,));
+ } else {
+ __SET_VAR(data__->,ET,,__time_sub(__GET_VAR(data__->CURRENT_TIME,), __GET_VAR(data__->START_TIME,)));
+ };
+ };
+};
+__SET_VAR(data__->,Q,,(__GET_VAR(data__->IN,) || (__GET_VAR(data__->STATE,) == 1)));
+__SET_VAR(data__->,PREV_IN,,__GET_VAR(data__->IN,));
+
+goto __end;
+
+__end:
+ return;
+} // TOF_body__()
+
+
+
+
+
+static void DERIVATIVE_init__(DERIVATIVE *data__, BOOL retain) {
+ __INIT_VAR(data__->RUN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->XIN,0,retain)
+ __INIT_VAR(data__->CYCLE,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->XOUT,0,retain)
+ __INIT_VAR(data__->X1,0,retain)
+ __INIT_VAR(data__->X2,0,retain)
+ __INIT_VAR(data__->X3,0,retain)
+}
+
+// Code part
+static void DERIVATIVE_body__(DERIVATIVE *data__) {
+// Initialise TEMP variables
+
+if (__GET_VAR(data__->RUN,)) {
+ __SET_VAR(data__->,XOUT,,((((3.0 * (__GET_VAR(data__->XIN,) - __GET_VAR(data__->X3,))) + __GET_VAR(data__->X1,)) - __GET_VAR(data__->X2,)) / (10.0 * TIME_TO_REAL((TIME)__GET_VAR(data__->CYCLE,)))));
+ __SET_VAR(data__->,X3,,__GET_VAR(data__->X2,));
+ __SET_VAR(data__->,X2,,__GET_VAR(data__->X1,));
+ __SET_VAR(data__->,X1,,__GET_VAR(data__->XIN,));
+} else {
+ __SET_VAR(data__->,XOUT,,0.0);
+ __SET_VAR(data__->,X1,,__GET_VAR(data__->XIN,));
+ __SET_VAR(data__->,X2,,__GET_VAR(data__->XIN,));
+ __SET_VAR(data__->,X3,,__GET_VAR(data__->XIN,));
+};
+
+goto __end;
+
+__end:
+ return;
+} // DERIVATIVE_body__()
+
+
+
+
+
+static void HYSTERESIS_init__(HYSTERESIS *data__, BOOL retain) {
+ __INIT_VAR(data__->XIN1,0,retain)
+ __INIT_VAR(data__->XIN2,0,retain)
+ __INIT_VAR(data__->EPS,0,retain)
+ __INIT_VAR(data__->Q,0,retain)
+}
+
+// Code part
+static void HYSTERESIS_body__(HYSTERESIS *data__) {
+// Initialise TEMP variables
+
+if (__GET_VAR(data__->Q,)) {
+ if ((__GET_VAR(data__->XIN1,) < (__GET_VAR(data__->XIN2,) - __GET_VAR(data__->EPS,)))) {
+ __SET_VAR(data__->,Q,,0);
+ };
+} else if ((__GET_VAR(data__->XIN1,) > (__GET_VAR(data__->XIN2,) + __GET_VAR(data__->EPS,)))) {
+ __SET_VAR(data__->,Q,,1);
+};
+
+goto __end;
+
+__end:
+ return;
+} // HYSTERESIS_body__()
+
+
+
+
+
+static void INTEGRAL_init__(INTEGRAL *data__, BOOL retain) {
+ __INIT_VAR(data__->RUN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->R1,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->XIN,0,retain)
+ __INIT_VAR(data__->X0,0,retain)
+ __INIT_VAR(data__->CYCLE,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->XOUT,0,retain)
+}
+
+// Code part
+static void INTEGRAL_body__(INTEGRAL *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->,Q,,!(__GET_VAR(data__->R1,)));
+if (__GET_VAR(data__->R1,)) {
+ __SET_VAR(data__->,XOUT,,__GET_VAR(data__->X0,));
+} else if (__GET_VAR(data__->RUN,)) {
+ __SET_VAR(data__->,XOUT,,(__GET_VAR(data__->XOUT,) + (__GET_VAR(data__->XIN,) * TIME_TO_REAL((TIME)__GET_VAR(data__->CYCLE,)))));
+};
+
+goto __end;
+
+__end:
+ return;
+} // INTEGRAL_body__()
+
+
+
+
+
+static void PID_init__(PID *data__, BOOL retain) {
+ __INIT_VAR(data__->AUTO,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PV,0,retain)
+ __INIT_VAR(data__->SP,0,retain)
+ __INIT_VAR(data__->X0,0,retain)
+ __INIT_VAR(data__->KP,0,retain)
+ __INIT_VAR(data__->TR,0,retain)
+ __INIT_VAR(data__->TD,0,retain)
+ __INIT_VAR(data__->CYCLE,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->XOUT,0,retain)
+ __INIT_VAR(data__->ERROR,0,retain)
+ INTEGRAL_init__(&data__->ITERM,retain);
+ DERIVATIVE_init__(&data__->DTERM,retain);
+}
+
+// Code part
+static void PID_body__(PID *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->,ERROR,,(__GET_VAR(data__->PV,) - __GET_VAR(data__->SP,)));
+__SET_VAR(data__->ITERM.,RUN,,__GET_VAR(data__->AUTO,));
+__SET_VAR(data__->ITERM.,R1,,!(__GET_VAR(data__->AUTO,)));
+__SET_VAR(data__->ITERM.,XIN,,__GET_VAR(data__->ERROR,));
+__SET_VAR(data__->ITERM.,X0,,(__GET_VAR(data__->TR,) * (__GET_VAR(data__->X0,) - __GET_VAR(data__->ERROR,))));
+__SET_VAR(data__->ITERM.,CYCLE,,__GET_VAR(data__->CYCLE,));
+INTEGRAL_body__(&data__->ITERM);
+__SET_VAR(data__->DTERM.,RUN,,__GET_VAR(data__->AUTO,));
+__SET_VAR(data__->DTERM.,XIN,,__GET_VAR(data__->ERROR,));
+__SET_VAR(data__->DTERM.,CYCLE,,__GET_VAR(data__->CYCLE,));
+DERIVATIVE_body__(&data__->DTERM);
+__SET_VAR(data__->,XOUT,,(__GET_VAR(data__->KP,) * ((__GET_VAR(data__->ERROR,) + (__GET_VAR(data__->ITERM.XOUT,) / __GET_VAR(data__->TR,))) + (__GET_VAR(data__->DTERM.XOUT,) * __GET_VAR(data__->TD,)))));
+
+goto __end;
+
+__end:
+ return;
+} // PID_body__()
+
+
+
+
+
+static void RAMP_init__(RAMP *data__, BOOL retain) {
+ __INIT_VAR(data__->RUN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->X0,0,retain)
+ __INIT_VAR(data__->X1,0,retain)
+ __INIT_VAR(data__->TR,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->CYCLE,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->BUSY,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->XOUT,0.0,retain)
+ __INIT_VAR(data__->XI,0,retain)
+ __INIT_VAR(data__->T,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+}
+
+// Code part
+static void RAMP_body__(RAMP *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->,BUSY,,__GET_VAR(data__->RUN,));
+if (__GET_VAR(data__->RUN,)) {
+ if (GE_TIME(2, __GET_VAR(data__->T,), __GET_VAR(data__->TR,))) {
+ __SET_VAR(data__->,BUSY,,0);
+ __SET_VAR(data__->,XOUT,,__GET_VAR(data__->X1,));
+ } else {
+ __SET_VAR(data__->,XOUT,,(__GET_VAR(data__->XI,) + (((__GET_VAR(data__->X1,) - __GET_VAR(data__->XI,)) * TIME_TO_REAL((TIME)__GET_VAR(data__->T,))) / TIME_TO_REAL((TIME)__GET_VAR(data__->TR,)))));
+ __SET_VAR(data__->,T,,__time_add(__GET_VAR(data__->T,), __GET_VAR(data__->CYCLE,)));
+ };
+} else {
+ __SET_VAR(data__->,XOUT,,__GET_VAR(data__->X0,));
+ __SET_VAR(data__->,XI,,__GET_VAR(data__->X0,));
+ __SET_VAR(data__->,T,,__time_to_timespec(1, 0, 0, 0, 0, 0));
+};
+
+goto __end;
+
+__end:
+ return;
+} // RAMP_body__()
+
+
+
+
+
+static void RTC_init__(RTC *data__, BOOL retain) {
+ __INIT_VAR(data__->IN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->PDT,__dt_to_timespec(0, 0, 0, 1, 1, 1970),retain)
+ __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->CDT,__dt_to_timespec(0, 0, 0, 1, 1, 1970),retain)
+ __INIT_VAR(data__->PREV_IN,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->OFFSET,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
+ __INIT_VAR(data__->CURRENT_TIME,__dt_to_timespec(0, 0, 0, 1, 1, 1970),retain)
+}
+
+// Code part
+static void RTC_body__(RTC *data__) {
+// Initialise TEMP variables
+
+#define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
+#define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)
+__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)
+#undef GetFbVar
+#undef SetFbVar
+;
+if (__GET_VAR(data__->IN,)) {
+ if (!(__GET_VAR(data__->PREV_IN,))) {
+ __SET_VAR(data__->,OFFSET,,__time_sub(__GET_VAR(data__->PDT,), __GET_VAR(data__->CURRENT_TIME,)));
+ };
+ __SET_VAR(data__->,CDT,,__time_add(__GET_VAR(data__->CURRENT_TIME,), __GET_VAR(data__->OFFSET,)));
+} else {
+ __SET_VAR(data__->,CDT,,__GET_VAR(data__->CURRENT_TIME,));
+};
+__SET_VAR(data__->,Q,,__GET_VAR(data__->IN,));
+__SET_VAR(data__->,PREV_IN,,__GET_VAR(data__->IN,));
+
+goto __end;
+
+__end:
+ return;
+} // RTC_body__()
+
+
+
+
+
+static void SEMA_init__(SEMA *data__, BOOL retain) {
+ __INIT_VAR(data__->CLAIM,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->RELEASE,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->BUSY,__BOOL_LITERAL(FALSE),retain)
+ __INIT_VAR(data__->Q_INTERNAL,__BOOL_LITERAL(FALSE),retain)
+}
+
+// Code part
+static void SEMA_body__(SEMA *data__) {
+// Initialise TEMP variables
+
+__SET_VAR(data__->,Q_INTERNAL,,(__GET_VAR(data__->CLAIM,) || (__GET_VAR(data__->Q_INTERNAL,) && !(__GET_VAR(data__->RELEASE,)))));
+__SET_VAR(data__->,BUSY,,__GET_VAR(data__->Q_INTERNAL,));
+
+goto __end;
+
+__end:
+ return;
+} // SEMA_body__()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#endif //_IEC_STD_FB_H
\ No newline at end of file
--- a/lib/C/iec_std_functions.h Sat May 07 21:17:49 2016 +0100
+++ b/lib/C/iec_std_functions.h Sun May 08 20:01:15 2016 +0100
@@ -82,28 +82,40 @@
/********************/
/* EN/ENO PARAMS */
/********************/
-
-#define EN_ENO_PARAMS BOOL EN, BOOL *ENO
-#define EN_ENO EN, ENO
-
-#define TEST_EN(TYPENAME)\
- if (!EN) {\
- if (ENO != NULL)\
- *ENO = __BOOL_LITERAL(FALSE);\
- return __INIT_##TYPENAME;\
- }\
- else if (ENO != NULL)\
- *ENO = __BOOL_LITERAL(TRUE);
-
-#define TEST_EN_COND(TYPENAME, COND)\
- if (!EN || (COND)) {\
- if (ENO != NULL)\
- *ENO = __BOOL_LITERAL(FALSE);\
- return __INIT_##TYPENAME;\
- }\
- else if (ENO != NULL)\
- *ENO = __BOOL_LITERAL(TRUE);
-
+#ifdef DISABLE_EN_ENO_PARAMETERS
+
+ /* Do _not_ generate the EN and ENO parameters! */
+ #define EN_ENO_PARAMS
+ #define EN_ENO
+
+ #define TEST_EN(TYPENAME)
+ #define TEST_EN_COND(TYPENAME, COND)
+
+#else
+
+ /* _Do_ generate the EN and ENO parameters! */
+ #define EN_ENO_PARAMS BOOL EN, BOOL *ENO,
+ #define EN_ENO EN, ENO,
+
+ #define TEST_EN(TYPENAME)\
+ if (!EN) {\
+ if (ENO != NULL)\
+ *ENO = __BOOL_LITERAL(FALSE);\
+ return __INIT_##TYPENAME;\
+ }\
+ else if (ENO != NULL)\
+ *ENO = __BOOL_LITERAL(TRUE);
+
+ #define TEST_EN_COND(TYPENAME, COND)\
+ if (!EN || (COND)) {\
+ if (ENO != NULL)\
+ *ENO = __BOOL_LITERAL(FALSE);\
+ return __INIT_##TYPENAME;\
+ }\
+ else if (ENO != NULL)\
+ *ENO = __BOOL_LITERAL(TRUE);
+
+#endif
/*****************************************/
@@ -113,14 +125,14 @@
/*****************************************/
#define __convert_type(from_TYPENAME,to_TYPENAME, oper) \
-static inline to_TYPENAME from_TYPENAME##_TO_##to_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\
+static inline to_TYPENAME from_TYPENAME##_TO_##to_TYPENAME(EN_ENO_PARAMS from_TYPENAME op){\
TEST_EN(to_TYPENAME)\
return (to_TYPENAME)oper(op);\
}
/******** [ANY_NUM | ANY_NBIT]_TO_BOOL ************/
#define __convert_num_to_bool(TYPENAME) \
-static inline BOOL TYPENAME##_TO_BOOL(EN_ENO_PARAMS, TYPENAME op){\
+static inline BOOL TYPENAME##_TO_BOOL(EN_ENO_PARAMS TYPENAME op){\
TEST_EN(BOOL)\
return op == 0 ? 0 : 1;\
}
@@ -129,7 +141,7 @@
/******** [TIME | ANY_DATE]_TO_BOOL ************/
#define __convert_time_to_bool(TYPENAME) \
-static inline BOOL TYPENAME##_TO_BOOL(EN_ENO_PARAMS, TYPENAME op){\
+static inline BOOL TYPENAME##_TO_BOOL(EN_ENO_PARAMS TYPENAME op){\
TEST_EN(BOOL)\
return op.tv_sec == 0 && op.tv_nsec == 0 ? 0 : 1;\
}
@@ -211,13 +223,13 @@
/******** [ANY_DATE]_TO_[ANY_DATE | TIME] ************/
/* Not supported: DT_TO_TIME */
__convert_type(DT, DATE, __date_and_time_to_date)
-static inline DATE DATE_AND_TIME_TO_DATE(EN_ENO_PARAMS, DT op){
- return DT_TO_DATE(EN_ENO, op);
+static inline DATE DATE_AND_TIME_TO_DATE(EN_ENO_PARAMS DT op){
+ return DT_TO_DATE(EN_ENO op);
}
__convert_type(DT, DT, __move_DT)
__convert_type(DT, TOD, __date_and_time_to_time_of_day)
-static inline DATE DATE_AND_TIME_TO_TIME_OF_DAY(EN_ENO_PARAMS, DT op){
- return DT_TO_TOD(EN_ENO, op);
+static inline DATE DATE_AND_TIME_TO_TIME_OF_DAY(EN_ENO_PARAMS DT op){
+ return DT_TO_TOD(EN_ENO op);
}
/* Not supported: DATE_TO_TIME */
__convert_type(DATE, DATE, __move_DATE)
@@ -296,7 +308,7 @@
/******** TRUNC ************/
#define __iec_(to_TYPENAME,from_TYPENAME) \
-static inline to_TYPENAME TRUNC__##to_TYPENAME##__##from_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\
+static inline to_TYPENAME TRUNC__##to_TYPENAME##__##from_TYPENAME(EN_ENO_PARAMS from_TYPENAME op){\
TEST_EN(to_TYPENAME)\
return (to_TYPENAME)__move_##to_TYPENAME(op);\
}
@@ -306,12 +318,12 @@
/******** _TO_BCD ************/
#define __iec_(to_TYPENAME,from_TYPENAME) \
-static inline to_TYPENAME from_TYPENAME##_TO_BCD_##to_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\
+static inline to_TYPENAME from_TYPENAME##_TO_BCD_##to_TYPENAME(EN_ENO_PARAMS from_TYPENAME op){\
TEST_EN(to_TYPENAME)\
return (to_TYPENAME)__uint_to_bcd(op);\
}\
-static inline to_TYPENAME from_TYPENAME##_TO_BCD__##to_TYPENAME##__##from_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\
- return from_TYPENAME##_TO_BCD_##to_TYPENAME(EN_ENO, op);\
+static inline to_TYPENAME from_TYPENAME##_TO_BCD__##to_TYPENAME##__##from_TYPENAME(EN_ENO_PARAMS from_TYPENAME op){\
+ return from_TYPENAME##_TO_BCD_##to_TYPENAME(EN_ENO op);\
}
__ANY_UINT(__to_anynbit_)
#undef __iec_
@@ -319,12 +331,12 @@
/******** BCD_TO_ ************/
#define __iec_(to_TYPENAME,from_TYPENAME) \
-static inline to_TYPENAME from_TYPENAME##_BCD_TO_##to_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\
+static inline to_TYPENAME from_TYPENAME##_BCD_TO_##to_TYPENAME(EN_ENO_PARAMS from_TYPENAME op){\
TEST_EN_COND(to_TYPENAME, __test_bcd(op))\
return (to_TYPENAME)__bcd_to_uint(op);\
}\
-static inline to_TYPENAME BCD_TO_##to_TYPENAME##__##to_TYPENAME##__##from_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\
- return from_TYPENAME##_BCD_TO_##to_TYPENAME(EN_ENO, op);\
+static inline to_TYPENAME BCD_TO_##to_TYPENAME##__##to_TYPENAME##__##from_TYPENAME(EN_ENO_PARAMS from_TYPENAME op){\
+ return from_TYPENAME##_BCD_TO_##to_TYPENAME(EN_ENO op);\
}
__ANY_NBIT(__to_anyuint_)
#undef __iec_
@@ -362,13 +374,13 @@
#define __numeric(fname,TYPENAME, FUNC) \
/* explicitly typed function */\
-static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\
+static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS TYPENAME op){\
TEST_EN(TYPENAME)\
return FUNC(op);\
}\
/* overloaded function */\
-static inline TYPENAME fname##_##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op) {\
- return fname##TYPENAME(EN_ENO, op);\
+static inline TYPENAME fname##_##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME op) {\
+ return fname##TYPENAME(EN_ENO op);\
}
/******************************************************************/
@@ -380,26 +392,26 @@
/**************/
#define __abs_signed(TYPENAME) \
/* explicitly typed function */\
-static inline TYPENAME ABS_##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\
+static inline TYPENAME ABS_##TYPENAME(EN_ENO_PARAMS TYPENAME op){\
TEST_EN(TYPENAME)\
if (op < 0)\
return -op;\
return op;\
}\
/* overloaded function */\
-static inline TYPENAME ABS__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op) {\
- return ABS_##TYPENAME(EN_ENO, op);\
+static inline TYPENAME ABS__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME op) {\
+ return ABS_##TYPENAME(EN_ENO op);\
}
#define __abs_unsigned(TYPENAME) \
/* explicitly typed function */\
-static inline TYPENAME ABS_##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\
+static inline TYPENAME ABS_##TYPENAME(EN_ENO_PARAMS TYPENAME op){\
TEST_EN(TYPENAME)\
return op;\
}\
/* overloaded function */\
-static inline TYPENAME ABS__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op) {\
- return ABS_##TYPENAME(EN_ENO, op);\
+static inline TYPENAME ABS__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME op) {\
+ return ABS_##TYPENAME(EN_ENO op);\
}
__ANY_REAL(__abs_signed)
@@ -480,7 +492,7 @@
/*****************************************************/
#define __arith_expand(fname,TYPENAME, OP)\
-static inline TYPENAME fname(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\
+static inline TYPENAME fname(EN_ENO_PARAMS UINT param_count, TYPENAME op1, ...){\
va_list ap;\
UINT i;\
TEST_EN(TYPENAME)\
@@ -497,13 +509,13 @@
#define __arith_static(fname,TYPENAME, OP)\
/* explicitly typed function */\
-static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
+static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
TEST_EN(TYPENAME)\
return op1 OP op2;\
}\
/* overloaded function */\
-static inline TYPENAME fname##_##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
- return fname##TYPENAME(EN_ENO, op1, op2);\
+static inline TYPENAME fname##_##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
+ return fname##TYPENAME(EN_ENO op1, op2);\
}
/**************/
@@ -536,13 +548,13 @@
/**************/
#define __div(TYPENAME)\
/* The explicitly typed standard functions */\
-static inline TYPENAME DIV_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
+static inline TYPENAME DIV_##TYPENAME(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
TEST_EN_COND(TYPENAME, op2 == 0)\
return op1 / op2;\
}\
/* The overloaded standard functions */\
-static inline TYPENAME DIV__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
- return DIV_##TYPENAME(EN_ENO, op1, op2);\
+static inline TYPENAME DIV__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
+ return DIV_##TYPENAME(EN_ENO op1, op2);\
}
__ANY_NUM(__div)
@@ -552,14 +564,14 @@
/**************/
#define __mod(TYPENAME)\
/* The explicitly typed standard functions */\
-static inline TYPENAME MOD_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
+static inline TYPENAME MOD_##TYPENAME(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
TEST_EN(TYPENAME)\
if (op2 == 0) return 0;\
return op1 % op2;\
}\
/* The overloaded standard functions */\
-static inline TYPENAME MOD__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
- return MOD_##TYPENAME(EN_ENO, op1, op2);\
+static inline TYPENAME MOD__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
+ return MOD_##TYPENAME(EN_ENO op1, op2);\
}
__ANY_INT(__mod)
@@ -569,9 +581,9 @@
/* overloaded function */
#define __iec_(in1_TYPENAME,in2_TYPENAME) \
static inline in1_TYPENAME EXPT__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME\
- (EN_ENO_PARAMS, in1_TYPENAME IN1, in2_TYPENAME IN2){\
+ (EN_ENO_PARAMS in1_TYPENAME IN1, in2_TYPENAME IN2){\
TEST_EN(in1_TYPENAME)\
- return pow(IN1, IN2);\
+ return __expt(IN1, IN2);\
}
#define __in1_anyreal_(in2_TYPENAME) __ANY_REAL_1(__iec_,in2_TYPENAME)
__ANY_NUM(__in1_anyreal_)
@@ -584,7 +596,7 @@
/***************/
/* The explicitly typed standard functions */
#define __iec_(TYPENAME)\
-static inline TYPENAME MOVE_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\
+static inline TYPENAME MOVE_##TYPENAME(EN_ENO_PARAMS TYPENAME op1){\
TEST_EN(TYPENAME)\
return op1;\
}
@@ -593,7 +605,7 @@
/* Overloaded function */
#define __iec_(TYPENAME)\
-static inline TYPENAME MOVE__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\
+static inline TYPENAME MOVE__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME op1){\
TEST_EN(TYPENAME)\
return op1;\
}
@@ -621,7 +633,7 @@
#define __in1_anynbit_(in2_TYPENAME) __ANY_NBIT_1(__iec_,in2_TYPENAME)
#define __shift_(fname, in1_TYPENAME, in2_TYPENAME, OP)\
-static inline in1_TYPENAME fname(EN_ENO_PARAMS, in1_TYPENAME IN, in2_TYPENAME N) {\
+static inline in1_TYPENAME fname(EN_ENO_PARAMS in1_TYPENAME IN, in2_TYPENAME N) {\
TEST_EN(in1_TYPENAME)\
return IN OP N;\
}
@@ -631,7 +643,7 @@
/**************/
#define __iec_(TYPENAME) \
/* Overloaded function */\
-static inline BOOL SHL__BOOL__##TYPENAME(EN_ENO_PARAMS, BOOL IN, TYPENAME N) { \
+static inline BOOL SHL__BOOL__##TYPENAME(EN_ENO_PARAMS BOOL IN, TYPENAME N) { \
TEST_EN(BOOL);\
return (N==0)? IN : __INIT_BOOL; /* shifting by N>1 will always introduce a 0 */\
}
@@ -650,7 +662,7 @@
/**************/
#define __iec_(TYPENAME) \
/* Overloaded function */\
-static inline BOOL SHR__BOOL__##TYPENAME(EN_ENO_PARAMS, BOOL IN, TYPENAME N) { \
+static inline BOOL SHR__BOOL__##TYPENAME(EN_ENO_PARAMS BOOL IN, TYPENAME N) { \
TEST_EN(BOOL);\
return (N==0)? IN : __INIT_BOOL; /* shifting by N>1 will always introduce a 0 */\
}
@@ -669,7 +681,7 @@
/**************/
#define __iec_(TYPENAME) \
/* Overloaded function */\
-static inline BOOL ROR__BOOL__##TYPENAME(EN_ENO_PARAMS, BOOL IN, TYPENAME N) { \
+static inline BOOL ROR__BOOL__##TYPENAME(EN_ENO_PARAMS BOOL IN, TYPENAME N) { \
TEST_EN(BOOL);\
return IN; /* rotating a single bit by any value N will not change that bit! */\
}
@@ -678,7 +690,7 @@
#define __iec_(in1_TYPENAME,in2_TYPENAME) \
-static inline in1_TYPENAME ROR__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS, in1_TYPENAME IN, in2_TYPENAME N){\
+static inline in1_TYPENAME ROR__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS in1_TYPENAME IN, in2_TYPENAME N){\
TEST_EN(in1_TYPENAME)\
N %= 8*sizeof(in1_TYPENAME);\
return (IN >> N) | (IN << (8*sizeof(in1_TYPENAME)-N));\
@@ -692,7 +704,7 @@
/**************/
#define __iec_(TYPENAME) \
/* Overloaded function */\
-static inline BOOL ROL__BOOL__##TYPENAME(EN_ENO_PARAMS, BOOL IN, TYPENAME N) { \
+static inline BOOL ROL__BOOL__##TYPENAME(EN_ENO_PARAMS BOOL IN, TYPENAME N) { \
TEST_EN(BOOL);\
return IN; /* rotating a single bit by any value N will not change that bit! */\
}
@@ -701,7 +713,7 @@
#define __iec_(in1_TYPENAME,in2_TYPENAME) \
-static inline in1_TYPENAME ROL__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS, in1_TYPENAME IN, in2_TYPENAME N){\
+static inline in1_TYPENAME ROL__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS in1_TYPENAME IN, in2_TYPENAME N){\
TEST_EN(in1_TYPENAME)\
N %= 8*sizeof(in1_TYPENAME);\
return (IN << N) | (IN >> (8*sizeof(in1_TYPENAME)-N));\
@@ -743,7 +755,7 @@
/* XOR */
/**************/
#define __xorbool_expand(fname) \
-static inline BOOL fname(EN_ENO_PARAMS, UINT param_count, BOOL op1, ...){ \
+static inline BOOL fname(EN_ENO_PARAMS UINT param_count, BOOL op1, ...){ \
va_list ap; \
UINT i; \
TEST_EN(BOOL) \
@@ -773,20 +785,20 @@
/* NOT */
/**************/
/* The explicitly typed standard functions */
-static inline BOOL NOT_BOOL(EN_ENO_PARAMS, BOOL op1){
+static inline BOOL NOT_BOOL(EN_ENO_PARAMS BOOL op1){
TEST_EN(BOOL)
return !op1;
}
/* Overloaded function */
-static inline BOOL NOT__BOOL__BOOL(EN_ENO_PARAMS, BOOL op1){
+static inline BOOL NOT__BOOL__BOOL(EN_ENO_PARAMS BOOL op1){
TEST_EN(BOOL)
return !op1;
}
/* The explicitly typed standard functions */
#define __iec_(TYPENAME)\
-static inline TYPENAME NOT_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\
+static inline TYPENAME NOT_##TYPENAME(EN_ENO_PARAMS TYPENAME op1){\
TEST_EN(TYPENAME)\
return ~op1;\
}
@@ -795,7 +807,7 @@
/* Overloaded function */
#define __iec_(TYPENAME)\
-static inline TYPENAME NOT__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\
+static inline TYPENAME NOT__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME op1){\
TEST_EN(TYPENAME)\
return ~op1;\
}
@@ -824,7 +836,7 @@
/* The explicitly typed standard functions */
#define __iec_(TYPENAME)\
-static inline TYPENAME SEL_##TYPENAME(EN_ENO_PARAMS, BOOL G, TYPENAME op0, TYPENAME op1){\
+static inline TYPENAME SEL_##TYPENAME(EN_ENO_PARAMS BOOL G, TYPENAME op0, TYPENAME op1){\
TEST_EN(TYPENAME)\
return G ? op1 : op0;\
}
@@ -833,7 +845,7 @@
/* Overloaded function */
#define __iec_(TYPENAME)\
-static inline TYPENAME SEL__##TYPENAME##__BOOL__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, BOOL G, TYPENAME op0, TYPENAME op1){\
+static inline TYPENAME SEL__##TYPENAME##__BOOL__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS BOOL G, TYPENAME op0, TYPENAME op1){\
TEST_EN(TYPENAME)\
return G ? op1 : op0;\
}
@@ -846,7 +858,7 @@
/**************/
#define __extrem_(fname,TYPENAME, COND) \
-static inline TYPENAME fname(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\
+static inline TYPENAME fname(EN_ENO_PARAMS UINT param_count, TYPENAME op1, ...){\
va_list ap;\
UINT i;\
TEST_EN(TYPENAME)\
@@ -914,12 +926,12 @@
/* Limit for numerical data types */
#define __iec_(TYPENAME)\
/* The explicitly typed standard functions */\
-static inline TYPENAME LIMIT_##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\
+static inline TYPENAME LIMIT_##TYPENAME(EN_ENO_PARAMS TYPENAME MN, TYPENAME IN, TYPENAME MX){\
TEST_EN(TYPENAME)\
return IN > MN ? IN < MX ? IN : MX : MN;\
}\
/* Overloaded function */\
-static inline TYPENAME LIMIT__##TYPENAME##__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\
+static inline TYPENAME LIMIT__##TYPENAME##__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME MN, TYPENAME IN, TYPENAME MX){\
TEST_EN(TYPENAME)\
return IN > MN ? IN < MX ? IN : MX : MN;\
}
@@ -931,14 +943,14 @@
/* Limit for time data types */
#define __iec_(TYPENAME)\
/* The explicitly typed standard functions */\
-static inline TYPENAME LIMIT_##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\
+static inline TYPENAME LIMIT_##TYPENAME(EN_ENO_PARAMS TYPENAME MN, TYPENAME IN, TYPENAME MX){\
TEST_EN(TYPENAME)\
return __time_cmp(IN, MN) > 0 ? /* IN>MN ?*/\
__time_cmp(IN, MX) < 0 ? /* IN<MX ?*/\
IN : MX : MN;\
}\
/* Overloaded function */\
-static inline TYPENAME LIMIT__##TYPENAME##__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\
+static inline TYPENAME LIMIT__##TYPENAME##__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS TYPENAME MN, TYPENAME IN, TYPENAME MX){\
TEST_EN(TYPENAME)\
return __time_cmp(IN, MN) > 0 ? /* IN>MN ?*/\
__time_cmp(IN, MX) < 0 ? /* IN<MX ?*/\
@@ -951,13 +963,13 @@
/* Limit for string data types */
/* The explicitly typed standard functions */
-static inline STRING LIMIT_STRING(EN_ENO_PARAMS, STRING MN, STRING IN, STRING MX){
+static inline STRING LIMIT_STRING(EN_ENO_PARAMS STRING MN, STRING IN, STRING MX){
TEST_EN(STRING)
return __STR_CMP(IN, MN) > 0 ? __STR_CMP(IN, MX) < 0 ? IN : MX : MN;
}
/* Overloaded function */
-static inline STRING LIMIT__STRING__STRING__STRING__STRING(EN_ENO_PARAMS, STRING MN, STRING IN, STRING MX){
+static inline STRING LIMIT__STRING__STRING__STRING__STRING(EN_ENO_PARAMS STRING MN, STRING IN, STRING MX){
TEST_EN(STRING)
return __STR_CMP(IN, MN) > 0 ? __STR_CMP(IN, MX) < 0 ? IN : MX : MN;
}
@@ -972,7 +984,7 @@
/* The explicitly typed standard functions */
#define __in1_anyint_(in2_TYPENAME) __ANY_INT_1(__iec_,in2_TYPENAME)
#define __iec_(in1_TYPENAME,in2_TYPENAME) \
-static inline in2_TYPENAME MUX__##in2_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS, in1_TYPENAME K, UINT param_count, ...){\
+static inline in2_TYPENAME MUX__##in2_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS in1_TYPENAME K, UINT param_count, ...){\
va_list ap;\
UINT i;\
in2_TYPENAME tmp;\
@@ -1005,7 +1017,7 @@
/******************************************/
#define __compare_(fname,TYPENAME, COND) \
-static inline BOOL fname(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\
+static inline BOOL fname(EN_ENO_PARAMS UINT param_count, TYPENAME op1, ...){\
va_list ap;\
UINT i;\
TEST_EN(BOOL)\
@@ -1158,19 +1170,19 @@
/* NE */
/**************/
#define __ne_num(fname, TYPENAME) \
-static inline BOOL fname(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
+static inline BOOL fname(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
TEST_EN(BOOL)\
return op1 != op2 ? 1 : 0;\
}
#define __ne_time(fname, TYPENAME) \
-static inline BOOL fname(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
+static inline BOOL fname(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
TEST_EN(BOOL)\
return __time_cmp(op1, op2) != 0 ? 1 : 0;\
}
#define __ne_string(fname, TYPENAME) \
-static inline BOOL fname(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
+static inline BOOL fname(EN_ENO_PARAMS TYPENAME op1, TYPENAME op2){\
TEST_EN(BOOL)\
return __STR_CMP(op1, op2) != 0 ? 1 : 0;\
}
@@ -1225,7 +1237,7 @@
/* A function, with 1 input paramter, implementing a generic OPERATION */
#define __genoper_1p_(fname,ret_TYPENAME, par_TYPENAME, OPERATION) \
-static inline ret_TYPENAME fname(EN_ENO_PARAMS, par_TYPENAME par1){\
+static inline ret_TYPENAME fname(EN_ENO_PARAMS par_TYPENAME par1){\
TEST_EN(ret_TYPENAME)\
return (ret_TYPENAME)OPERATION(par1);\
}
@@ -1240,7 +1252,7 @@
/****************/
#define __left(TYPENAME) \
-static inline STRING LEFT__STRING__STRING__##TYPENAME(EN_ENO_PARAMS, STRING IN, TYPENAME L){\
+static inline STRING LEFT__STRING__STRING__##TYPENAME(EN_ENO_PARAMS STRING IN, TYPENAME L){\
STRING res;\
TEST_EN_COND(STRING, L < 0)\
res = __INIT_STRING;\
@@ -1257,7 +1269,7 @@
/*****************/
#define __right(TYPENAME) \
-static inline STRING RIGHT__STRING__STRING__##TYPENAME(EN_ENO_PARAMS, STRING IN, TYPENAME L){\
+static inline STRING RIGHT__STRING__STRING__##TYPENAME(EN_ENO_PARAMS STRING IN, TYPENAME L){\
STRING res;\
TEST_EN_COND(STRING, L < 0)\
res = __INIT_STRING;\
@@ -1274,7 +1286,7 @@
/***************/
#define __mid(TYPENAME) \
-static inline STRING MID__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, STRING IN, TYPENAME L, TYPENAME P){\
+static inline STRING MID__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS STRING IN, TYPENAME L, TYPENAME P){\
STRING res;\
TEST_EN_COND(STRING, L < 0 || P < 0)\
res = __INIT_STRING;\
@@ -1293,7 +1305,7 @@
/* CONCAT */
/******************/
-static inline STRING CONCAT(EN_ENO_PARAMS, UINT param_count, ...){
+static inline STRING CONCAT(EN_ENO_PARAMS UINT param_count, ...){
UINT i;
STRING res;
va_list ap;
@@ -1344,7 +1356,7 @@
}
#define __iec_(TYPENAME) \
-static inline STRING INSERT__STRING__STRING__STRING__##TYPENAME(EN_ENO_PARAMS, STRING str1, STRING str2, TYPENAME P){\
+static inline STRING INSERT__STRING__STRING__STRING__##TYPENAME(EN_ENO_PARAMS STRING str1, STRING str2, TYPENAME P){\
TEST_EN_COND(STRING, P < 0)\
return (STRING)__insert(str1,str2,(__strlen_t)P);\
}
@@ -1375,7 +1387,7 @@
}
#define __iec_(TYPENAME) \
-static inline STRING DELETE__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, STRING str, TYPENAME L, TYPENAME P){\
+static inline STRING DELETE__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS STRING str, TYPENAME L, TYPENAME P){\
TEST_EN_COND(STRING, L < 0 || P < 0)\
return (STRING)__delete(str,(__strlen_t)L,(__strlen_t)P);\
}
@@ -1416,7 +1428,7 @@
}
#define __iec_(TYPENAME) \
-static inline STRING REPLACE__STRING__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, STRING str1, STRING str2, TYPENAME L, TYPENAME P){\
+static inline STRING REPLACE__STRING__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS STRING str1, STRING str2, TYPENAME L, TYPENAME P){\
TEST_EN_COND(STRING, L < 0 || P < 0)\
return (STRING)__replace(str1,str2,(__strlen_t)L,(__strlen_t)P);\
}
@@ -1444,7 +1456,7 @@
}
#define __iec_(TYPENAME) \
-static inline TYPENAME FIND__##TYPENAME##__STRING__STRING(EN_ENO_PARAMS, STRING str1, STRING str2){\
+static inline TYPENAME FIND__##TYPENAME##__STRING__STRING(EN_ENO_PARAMS STRING str1, STRING str2){\
TEST_EN(TYPENAME)\
return (TYPENAME)__pfind(&str1,&str2);\
}
@@ -1464,47 +1476,47 @@
/**************************************/
-static inline TIME ADD_TIME(EN_ENO_PARAMS, TIME IN1, TIME IN2){
+static inline TIME ADD_TIME(EN_ENO_PARAMS TIME IN1, TIME IN2){
TEST_EN(TIME)
return __time_add(IN1, IN2);
}
-static inline TOD ADD_TOD_TIME(EN_ENO_PARAMS, TOD IN1, TIME IN2){
+static inline TOD ADD_TOD_TIME(EN_ENO_PARAMS TOD IN1, TIME IN2){
TEST_EN(TOD)
return __time_add(IN1, IN2);
}
-static inline DT ADD_DT_TIME(EN_ENO_PARAMS, DT IN1, TIME IN2){
+static inline DT ADD_DT_TIME(EN_ENO_PARAMS DT IN1, TIME IN2){
TEST_EN(DT)
return __time_add(IN1, IN2);
}
-static inline TIME SUB_TIME(EN_ENO_PARAMS, TIME IN1, TIME IN2){
+static inline TIME SUB_TIME(EN_ENO_PARAMS TIME IN1, TIME IN2){
TEST_EN(TIME)
return __time_sub(IN1, IN2);
}
-static inline TIME SUB_DATE_DATE(EN_ENO_PARAMS, DATE IN1, DATE IN2){
+static inline TIME SUB_DATE_DATE(EN_ENO_PARAMS DATE IN1, DATE IN2){
TEST_EN(TIME)
return __time_sub(IN1, IN2);
}
-static inline TOD SUB_TOD_TIME(EN_ENO_PARAMS, TOD IN1, TIME IN2){
+static inline TOD SUB_TOD_TIME(EN_ENO_PARAMS TOD IN1, TIME IN2){
TEST_EN(TOD)
return __time_sub(IN1, IN2);
}
-static inline TIME SUB_TOD_TOD(EN_ENO_PARAMS, TOD IN1, TOD IN2){
+static inline TIME SUB_TOD_TOD(EN_ENO_PARAMS TOD IN1, TOD IN2){
TEST_EN(TIME)
return __time_sub(IN1, IN2);
}
-static inline DT SUB_DT_TIME(EN_ENO_PARAMS, DT IN1, TIME IN2){
+static inline DT SUB_DT_TIME(EN_ENO_PARAMS DT IN1, TIME IN2){
TEST_EN(DT)
return __time_sub(IN1, IN2);
}
-static inline TIME SUB_DT_DT(EN_ENO_PARAMS, DT IN1, DT IN2){
+static inline TIME SUB_DT_DT(EN_ENO_PARAMS DT IN1, DT IN2){
TEST_EN(TIME)
return __time_sub(IN1, IN2);
}
@@ -1512,7 +1524,7 @@
/*** MULTIME ***/
#define __iec_(TYPENAME)\
-static inline TIME MULTIME__TIME__TIME__##TYPENAME(EN_ENO_PARAMS, TIME IN1, TYPENAME IN2){\
+static inline TIME MULTIME__TIME__TIME__##TYPENAME(EN_ENO_PARAMS TIME IN1, TYPENAME IN2){\
TEST_EN(TIME)\
return __time_mul(IN1, (LREAL)IN2);\
}
@@ -1521,7 +1533,7 @@
/*** MUL ***/
#define __iec_(TYPENAME)\
-static inline TIME MUL__TIME__TIME__##TYPENAME(EN_ENO_PARAMS, TIME IN1, TYPENAME IN2){\
+static inline TIME MUL__TIME__TIME__##TYPENAME(EN_ENO_PARAMS TIME IN1, TYPENAME IN2){\
TEST_EN(TIME)\
return __time_mul(IN1, (LREAL)IN2);\
}
@@ -1530,7 +1542,7 @@
/*** DIVTIME ***/
#define __iec_(TYPENAME)\
-static inline TIME DIVTIME__TIME__TIME__##TYPENAME(EN_ENO_PARAMS, TIME IN1, TYPENAME IN2){\
+static inline TIME DIVTIME__TIME__TIME__##TYPENAME(EN_ENO_PARAMS TIME IN1, TYPENAME IN2){\
TEST_EN(TIME)\
return __time_div(IN1, (LREAL)IN2);\
}
@@ -1539,7 +1551,7 @@
/*** DIV ***/
#define __iec_(TYPENAME)\
-static inline TIME DIV__TIME__TIME__##TYPENAME(EN_ENO_PARAMS, TIME IN1, TYPENAME IN2){\
+static inline TIME DIV__TIME__TIME__##TYPENAME(EN_ENO_PARAMS TIME IN1, TYPENAME IN2){\
TEST_EN(TIME)\
return __time_div(IN1, (LREAL)IN2);\
}
@@ -1547,7 +1559,7 @@
#undef __iec_
/*** CONCAT_DATE_TOD ***/
-static inline DT CONCAT_DATE_TOD(EN_ENO_PARAMS, DATE IN1, TOD IN2){
+static inline DT CONCAT_DATE_TOD(EN_ENO_PARAMS DATE IN1, TOD IN2){
TEST_EN(DT)
return __time_add(IN1, IN2);
}