msousa@351: #!/bin/sh msousa@351: # msousa@351: # copyright 2011 Mario de Sousa (msousa@fe.up.pt) msousa@351: # msousa@351: # Offered to the public under the terms of the GNU Lesser General Public msousa@351: # License as published by the Free Software Foundation; either version 2 msousa@351: # of the License, or (at your option) any later version. msousa@351: # msousa@351: # This program is distributed in the hope that it will be useful, but msousa@351: # WITHOUT ANY WARRANTY; without even the implied warranty of msousa@351: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser msousa@351: # General Public License for more details. msousa@351: # msousa@351: # This code is made available on the understanding that it will not be msousa@351: # used in safety-critical situations without a full and competent review. msousa@351: # msousa@351: msousa@351: echo "(************************************************)" msousa@351: echo "(************************************************)" msousa@351: echo "(*** ***)" msousa@351: echo "(*** The IEC 61131-3 standard functions ***)" msousa@351: echo "(*** ***)" msousa@351: echo "(*** Auto-generated file. Do not edit! ***)" msousa@351: echo "(*** ***)" msousa@351: echo "(************************************************)" msousa@351: echo "(************************************************)" msousa@351: msousa@351: msousa@351: echo "{disable code generation}" msousa@351: msousa@351: # Lets parse this file with the C pre-processor! msousa@351: #cpp <<"END" | sed "s/ FUNCTION/\nFUNCTION/g" | grep -v '#' msousa@351: # We usee gcc -E instead, as it seems cpp on OSX works differently! However, it needs an input file parameter... msousa@351: #gcc -E <<"END" | sed "s/ FUNCTION/\nFUNCTION/g" | grep -v '#' msousa@351: cpp <<"END" | sed "s/ FUNCTION/\nFUNCTION/g" | grep -v '#' msousa@351: msousa@351: #define __DEFINE_CLASHING_FUNCTIONS msousa@351: msousa@351: /* Macro that expand to subtypes */ msousa@351: #define __ANY(DO) __ANY_DERIVED(DO) __ANY_ELEMENTARY(DO) msousa@351: #define __ANY_DERIVED(DO) msousa@351: #define __ANY_ELEMENTARY(DO) __ANY_MAGNITUDE(DO) __ANY_BIT(DO) __ANY_STRING(DO) __ANY_DATE(DO) msousa@351: #define __ANY_MAGNITUDE(DO) __ANY_NUM(DO) DO(TIME) msousa@351: #define __ANY_BIT(DO) __ANY_NBIT(DO) DO(BOOL) msousa@351: #define __ANY_NBIT(DO) DO(BYTE) DO(WORD) DO(DWORD) DO(LWORD) msousa@351: #define __ANY_STRING(DO) DO(STRING) msousa@351: #define __ANY_DATE(DO) DO(DATE) DO(TOD) DO(DT) msousa@351: #define __ANY_NUM(DO) __ANY_REAL(DO) __ANY_INT(DO) msousa@351: #define __ANY_REAL(DO) DO(REAL) DO(LREAL) msousa@351: #define __ANY_INT(DO) __ANY_SINT(DO) __ANY_UINT(DO) msousa@351: #define __ANY_SINT(DO) DO(SINT) DO(INT) DO(DINT) DO(LINT) msousa@351: #define __ANY_UINT(DO) DO(USINT) DO(UINT) DO(UDINT) DO(ULINT) msousa@351: msousa@351: #define __ANY_1(DO,P1) __ANY_DERIVED_1(DO,P1) __ANY_ELEMENTARY_1(DO,P1) msousa@351: #define __ANY_DERIVED_1(DO,P1) msousa@351: #define __ANY_ELEMENTARY_1(DO,P1) __ANY_MAGNITUDE_1(DO,P1) __ANY_BIT_1(DO,P1) __ANY_STRING_1(DO,P1) __ANY_DATE_1(DO,P1) msousa@351: #define __ANY_MAGNITUDE_1(DO,P1) __ANY_NUM_1(DO,P1) DO(TIME,P1) msousa@351: #define __ANY_BIT_1(DO,P1) __ANY_NBIT_1(DO,P1) DO(BOOL,P1) msousa@351: #define __ANY_NBIT_1(DO,P1) DO(BYTE,P1) DO(WORD,P1) DO(DWORD,P1) DO(LWORD,P1) msousa@351: #define __ANY_STRING_1(DO,P1) DO(STRING,P1) msousa@351: #define __ANY_DATE_1(DO,P1) DO(DATE,P1) DO(TOD,P1) DO(DT,P1) msousa@351: #define __ANY_NUM_1(DO,P1) __ANY_REAL_1(DO,P1) __ANY_INT_1(DO,P1) msousa@351: #define __ANY_REAL_1(DO,P1) DO(REAL,P1) DO(LREAL,P1) msousa@351: #define __ANY_INT_1(DO,P1) __ANY_SINT_1(DO,P1) __ANY_UINT_1(DO,P1) msousa@351: #define __ANY_SINT_1(DO,P1) DO(SINT,P1) DO(INT,P1) DO(DINT,P1) DO(LINT,P1) msousa@351: #define __ANY_UINT_1(DO,P1) DO(USINT,P1) DO(UINT,P1) DO(UDINT,P1) DO(ULINT,P1) msousa@351: msousa@351: msousa@351: msousa@351: /*****************************************************************/ msousa@351: /*****************************************************************/ msousa@351: /***** *****/ msousa@351: /***** IEC 61131-3 *****/ msousa@351: /***** S T A N D A R D F U N C T I O N S *****/ msousa@351: /***** *****/ msousa@351: /*****************************************************************/ msousa@351: /*****************************************************************/ msousa@351: msousa@351: /* NOTE: We only define and declare the explicitly typed standard functions msousa@351: * (e.g., SIN_REAL, SIN_LREAL, ..., ADD_SINT, ADD_INT, ADD_LINT, ...) msousa@351: * We do not declare/define the overloaded functions msousa@351: * (SIN, ADD, ...). msousa@351: * When handling a call to an overloaded function, the iec2c compiler msousa@351: * will determine in stage3 the data type of the parameter being passed, msousa@351: * and in stage4 generate the C code to call the correct msousa@351: * typed standard function. msousa@351: */ msousa@351: msousa@351: /* NOTE on explicit typing of: msousa@351: * - Table 25 - Standard bit shift functions msousa@351: * - Table 29 - Character string Functions msousa@385: * - Table 27 - Standard selection functions (actually, just the MUX function) msousa@351: * msousa@351: * In section 2.5.1.4 (Typing, overloading, and type conversion) of the IEC 61131-3 (version 2) msousa@351: * of the standard, it is stated: msousa@351: * "A standard function, [...] is said to be overloaded when it msousa@351: * can operate on input data elements of various types within a generic type designator as defined in msousa@351: * 2.3.2. For instance, an overloaded addition function on generic type ANY_NUM can operate on data msousa@351: * of types LREAL, REAL, DINT, INT, and SINT." msousa@351: * [...] msousa@351: * "When a function which normally represents an overloaded operator is to be typed, i.e., the types msousa@351: * of its inputs and outputs restricted to a particular elementary or derived data type as defined in msousa@351: * 2.3, this shall be done by appending an "underline" character followed by the required type, as msousa@351: * shown in table 21." msousa@351: * msousa@351: * However, this explanation (as well as the example in table 21) only refers to functions where the same msousa@351: * generic data type is used for the single input and the output parameter. msousa@351: * How can we create explicitly types functions when this is not the case? msousa@351: * It does not seem to be covered by the standard. msousa@351: * msousa@351: * For this reason, we do not define the LEN_SINT, LEN_INT, LEN_STRING, LEN_[ANY_INT], LEN_[ANY_STRING] functions... msousa@351: */ msousa@351: msousa@351: msousa@351: /*****************************************/ msousa@351: /*****************************************/ msousa@351: /* 2.5.1.5.1 Type Conversion Functions */ msousa@351: /*****************************************/ msousa@351: /*****************************************/ msousa@351: msousa@351: /* macros for non-extensible functions */ msousa@351: #define __function_1p(fname,to_TYPENAME,p1_NAME,p1_TYPENAME) \ msousa@351: FUNCTION fname : to_TYPENAME\ msousa@351: VAR_INPUT p1_NAME : p1_TYPENAME; END_VAR\ msousa@351: RETURN; \ msousa@351: END_FUNCTION\ msousa@351: msousa@351: #define __function_2p(fname,to_TYPENAME,p1_NAME,p1_TYPENAME,p2_NAME,p2_TYPENAME) \ msousa@351: FUNCTION fname : to_TYPENAME\ msousa@351: VAR_INPUT p1_NAME : p1_TYPENAME; p2_NAME : p2_TYPENAME; END_VAR\ msousa@351: RETURN; \ msousa@351: END_FUNCTION\ msousa@351: msousa@351: #define __function_3p(fname,to_TYPENAME,p1_NAME,p1_TYPENAME,p2_NAME,p2_TYPENAME,p3_NAME,p3_TYPENAME) \ msousa@351: FUNCTION fname : to_TYPENAME\ msousa@351: VAR_INPUT p1_NAME : p1_TYPENAME; p2_NAME : p2_TYPENAME; p3_NAME : p3_TYPENAME; END_VAR\ msousa@351: RETURN; \ msousa@351: END_FUNCTION\ msousa@351: msousa@351: #define __function_4p(fname,to_TYPENAME,p1_NAME,p1_TYPENAME,p2_NAME,p2_TYPENAME,p3_NAME,p3_TYPENAME,p4_NAME,p4_TYPENAME) \ msousa@351: FUNCTION fname : to_TYPENAME\ msousa@351: VAR_INPUT p1_NAME : p1_TYPENAME; p2_NAME : p2_TYPENAME; p3_NAME : p3_TYPENAME; p4_NAME : p4_TYPENAME; END_VAR\ msousa@351: RETURN; \ msousa@351: END_FUNCTION\ msousa@351: msousa@351: msousa@351: /* macro for extensible functions */ msousa@351: #define __function_1e(fname,to_TYPENAME,p1_NAME,p1_TYPENAME, FIRST_INDEX) \ msousa@351: FUNCTION fname : to_TYPENAME\ msousa@351: VAR_INPUT p1_NAME FIRST_INDEX .. : p1_TYPENAME; END_VAR\ msousa@351: RETURN; \ msousa@351: END_FUNCTION\ msousa@351: msousa@351: #define __function_2e(fname,to_TYPENAME,p1_NAME,p1_TYPENAME,p2_NAME,p2_TYPENAME, FIRST_INDEX) \ msousa@351: FUNCTION fname : to_TYPENAME\ msousa@351: VAR_INPUT p1_NAME : p1_TYPENAME; p2_NAME FIRST_INDEX .. : p2_TYPENAME; END_VAR\ msousa@351: RETURN; \ msousa@351: END_FUNCTION\ msousa@351: msousa@351: msousa@351: msousa@351: msousa@351: msousa@351: msousa@351: #define __to_anynum_(from_TYPENAME) __ANY_NUM_1(__iec_,from_TYPENAME) msousa@351: #define __to_anyint_(from_TYPENAME) __ANY_INT_1(__iec_,from_TYPENAME) msousa@351: #define __to_anybit_(from_TYPENAME) __ANY_BIT_1(__iec_,from_TYPENAME) msousa@351: #define __to_anynbit_(from_TYPENAME) __ANY_NBIT_1(__iec_,from_TYPENAME) msousa@351: #define __to_anysint_(from_TYPENAME) __ANY_SINT_1(__iec_,from_TYPENAME) msousa@351: #define __to_anyuint_(from_TYPENAME) __ANY_UINT_1(__iec_,from_TYPENAME) msousa@351: #define __to_anyreal_(from_TYPENAME) __ANY_REAL_1(__iec_,from_TYPENAME) msousa@351: #define __to_anydate_(from_TYPENAME) __ANY_DATE_1(__iec_,from_TYPENAME) msousa@351: #define __to_time_(from_TYPENAME) __iec_(TIME,from_TYPENAME) msousa@351: #define __to_string_(from_TYPENAME) __iec_(STRING,from_TYPENAME) msousa@351: msousa@351: msousa@351: /*****************/ msousa@351: /* *_TO_** */ msousa@351: /*****************/ msousa@351: #define __iec_(to_TYPENAME,from_TYPENAME) __function_1p(from_TYPENAME##_TO_##to_TYPENAME, to_TYPENAME, IN, from_TYPENAME) msousa@351: msousa@351: /******** [ANY_BIT]_TO_[ANY_NUM | ANY_BIT] ************/ msousa@351: __ANY_BIT(__to_anynum_) msousa@351: __ANY_BIT(__to_anybit_) msousa@351: msousa@351: /******** [ANY_NUM]_TO_[ANY_NUM | ANY_BIT] ************/ msousa@351: __ANY_NUM(__to_anynum_) msousa@351: __ANY_NUM(__to_anybit_) msousa@351: msousa@351: msousa@351: /******** [ANY_BIT | ANY_NUM]_TO_[TIME | ANY_DATE] ************/ msousa@351: __ANY_BIT(__to_time_) msousa@351: __ANY_NUM(__to_time_) msousa@351: __ANY_BIT(__to_anydate_) msousa@351: __ANY_NUM(__to_anydate_) msousa@351: msousa@351: msousa@351: /******** [TIME | ANY_DATE]_TO_[ANY_BIT | ANY_NUM] ************/ msousa@351: __to_anynum_(TIME) msousa@351: __to_anybit_(TIME) msousa@351: __ANY_DATE(__to_anynum_) msousa@351: __ANY_DATE(__to_anybit_) msousa@351: msousa@351: msousa@351: /******** [ANY_DATE]_TO_[ANY_DATE | TIME] ************/ msousa@351: /* Not supported: DT_TO_TIME */ msousa@351: /*__iec_(to_TYPENAME,from_TYPENAME)*/ msousa@351: __iec_(DATE,DT) Laurent@705: __function_1p(DATE_AND_TIME_TO_DATE, DATE, IN, DT) msousa@351: __iec_(DT,DT) msousa@351: __iec_(TOD,DT) Laurent@705: __function_1p(DATE_AND_TIME_TO_TIME_OF_DAY, TOD, IN, DT) msousa@351: /* Not supported: DATE_TO_TIME */ msousa@351: __iec_(DATE,DATE) msousa@351: /* Not supported: DATE_TO_DT */ msousa@351: /* Not supported: DATE_TO_TOD */ msousa@351: /* Not supported: TOD_TO_TIME */ msousa@351: /* Not supported: TOD_TO_DATE */ msousa@351: /* Not supported: TOD_TO_DT */ msousa@351: __iec_(TOD,TOD) msousa@351: msousa@351: /******** TIME_TO_[ANY_DATE] ************/ msousa@351: /* Not supported: TIME_TO_DATE */ msousa@351: /* Not supported: TIME_TO_DT */ msousa@351: /* Not supported: TIME_TO_TOD */ msousa@351: msousa@351: /******** TIME_TO_TIME ************/ msousa@351: __iec_(TIME,TIME) msousa@351: msousa@351: msousa@351: /******** [ANY_BIT]_TO_STRING ************/ msousa@351: __ANY_BIT(__to_string_) msousa@351: msousa@351: msousa@351: /******** [ANY_NUM]_TO_STRING ************/ msousa@351: __ANY_NUM(__to_string_) msousa@351: msousa@351: /******** [ANY_DATE]_TO_STRING ************/ msousa@351: __ANY_DATE(__to_string_) msousa@351: msousa@351: msousa@351: /******** TIME_TO_STRING ************/ msousa@351: __iec_(STRING,TIME) msousa@351: msousa@351: msousa@351: /******** STRING_TO_[ANY_BIT] ************/ msousa@351: __to_anybit_(STRING) msousa@351: msousa@351: msousa@351: /******** STRING_TO_[ANY_NUM] ************/ msousa@351: __to_anynum_(STRING) msousa@351: msousa@351: msousa@351: /******** STRING_TO_[ANY_DATE] ************/ msousa@351: __to_anydate_(STRING) msousa@351: msousa@351: msousa@351: /******** STRING_TO_TIME ************/ msousa@351: __iec_(TIME,STRING) msousa@351: msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: msousa@351: /**************/ msousa@351: /* TRUNC */ msousa@351: /**************/ msousa@351: /* overloaded function! */ msousa@351: #define __iec_(to_TYPENAME,from_TYPENAME) __function_1p(TRUNC, to_TYPENAME, IN, from_TYPENAME) msousa@351: __ANY_REAL(__to_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /*******************/ msousa@351: /* *_TO_BCD_* */ msousa@351: /*******************/ Laurent@704: #define __iec_(to_TYPENAME,from_TYPENAME)\ Laurent@704: __function_1p(from_TYPENAME##_TO_BCD_##to_TYPENAME, to_TYPENAME, IN, from_TYPENAME) /* explicitly typed function */\ Laurent@704: __function_1p(from_TYPENAME##_TO_BCD, to_TYPENAME, IN, from_TYPENAME) /* overloaded function */ msousa@351: __ANY_UINT(__to_anynbit_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /*******************/ msousa@351: /* *_BCD_TO_* */ msousa@351: /*******************/ Laurent@704: #define __iec_(to_TYPENAME,from_TYPENAME)\ Laurent@704: __function_1p(from_TYPENAME##_BCD_TO_##to_TYPENAME, to_TYPENAME, IN, from_TYPENAME) /* explicitly typed function */\ Laurent@704: __function_1p(BCD_TO_##to_TYPENAME, to_TYPENAME, IN, from_TYPENAME) /* overloaded function */ Laurent@704: msousa@351: __ANY_NBIT(__to_anyuint_) msousa@351: #undef __iec_ msousa@351: msousa@351: /***********************************/ msousa@351: /***********************************/ msousa@351: /* 2.5.1.5.2 Numerical Functions */ msousa@351: /***********************************/ msousa@351: /***********************************/ msousa@351: msousa@351: /******************************************************************/ msousa@351: /*** Table 23 - Standard functions of one numeric variable ***/ msousa@351: /******************************************************************/ msousa@351: msousa@351: /**************/ msousa@351: /* ABS */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(ABS_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(ABS, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: __ANY_INT(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* SQRT */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(SQRT_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(SQRT, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* LN */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(LN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(LN, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* LOG */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(LOG_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(LOG, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* EXP */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(EXP_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(EXP, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* SIN */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(SIN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(SIN, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* COS */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(COS_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(COS, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* TAN */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(TAN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(TAN, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* ASIN */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(ASIN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(ASIN, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* ACOS */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(ACOS_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(ACOS, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* ATAN */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(ATAN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(ATAN, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: __ANY_REAL(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: msousa@351: /*****************************************************/ msousa@351: /*** Table 24 - Standard arithmetic functions ***/ msousa@351: /*****************************************************/ msousa@351: msousa@351: #define __arith_expand(fname,TYPENAME) \ msousa@351: __function_1e(fname##_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */\ msousa@351: __function_1e(fname, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ msousa@351: msousa@351: msousa@351: #define __arith_static(fname,TYPENAME) \ msousa@351: __function_1p(fname##_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ msousa@351: __function_1p(fname, TYPENAME, IN, TYPENAME) /* overloaded function */ msousa@351: msousa@351: /**************/ msousa@351: /* ADD */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) __arith_expand(ADD, TYPENAME) msousa@351: __ANY_NUM(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* MUL */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME) __arith_expand(MUL, TYPENAME) msousa@351: __ANY_NUM(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* SUB */ msousa@351: /**************/ laurent@391: #define __iec_(TYPENAME)\ laurent@391: __function_2p(SUB_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* explicitly typed function */\ laurent@391: __function_2p(SUB, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* overloaded function */ msousa@351: __ANY_NUM(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* DIV */ msousa@351: /**************/ msousa@351: #define __iec_(TYPENAME)\ msousa@351: __function_2p(DIV_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* explicitly typed function */\ msousa@351: __function_2p(DIV, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* overloaded function */ msousa@351: __ANY_NUM(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* MOD */ msousa@351: /**************/ msousa@351: #ifdef __DEFINE_CLASHING_FUNCTIONS msousa@351: #define __iec_(TYPENAME)\ msousa@351: __function_2p(MOD_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* explicitly typed function */\ msousa@351: __function_2p(MOD, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* overloaded function */ msousa@351: __ANY_INT(__iec_) msousa@351: #undef __iec_ msousa@351: #endif msousa@351: msousa@351: /**************/ msousa@351: /* EXPT */ msousa@351: /**************/ msousa@351: #define __in1_anyreal_(in2_TYPENAME) __ANY_REAL_1(__iec_,in2_TYPENAME) msousa@351: #define __iec_(in1_TYPENAME,in2_TYPENAME) \ msousa@351: __function_2p(EXPT, in1_TYPENAME, IN1, in1_TYPENAME, IN2, in2_TYPENAME) /* overloaded function */ msousa@351: __ANY_NUM(__in1_anyreal_) msousa@351: #undef __iec_ msousa@351: msousa@351: /***************/ msousa@351: /* MOVE */ msousa@351: /***************/ msousa@351: #define __iec_(TYPENAME) __arith_static(MOVE, TYPENAME) msousa@351: __ANY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: msousa@351: msousa@351: /***********************************/ msousa@351: /***********************************/ msousa@351: /* 2.5.1.5.3 Bit String Functions */ msousa@351: /***********************************/ msousa@351: /***********************************/ msousa@351: msousa@351: /****************************************************/ msousa@351: /*** Table 25 - Standard bit shift functions ***/ msousa@351: /****************************************************/ msousa@351: /* We do not delcare explcitly typed versions of the functions in table 29. msousa@351: * See note at top of this file regarding explicitly typed functions for more details. msousa@351: */ msousa@351: #define __in1_anybit_(in2_TYPENAME) __ANY_BIT_1(__iec_,in2_TYPENAME) msousa@351: msousa@351: msousa@351: /**************/ msousa@351: /* SHL */ msousa@351: /**************/ msousa@351: #define __iec_(in1_TYPENAME,in2_TYPENAME) __function_2p(SHL, in1_TYPENAME, IN, in1_TYPENAME, N, in2_TYPENAME) /* overloaded function */ msousa@351: __ANY_INT(__in1_anybit_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* SHR */ msousa@351: /**************/ msousa@351: #define __iec_(in1_TYPENAME,in2_TYPENAME) __function_2p(SHR, in1_TYPENAME, IN, in1_TYPENAME, N, in2_TYPENAME) /* overloaded function */ msousa@351: __ANY_INT(__in1_anybit_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* ROR */ msousa@351: /**************/ msousa@351: #define __iec_(in1_TYPENAME,in2_TYPENAME) __function_2p(ROR, in1_TYPENAME, IN, in1_TYPENAME, N, in2_TYPENAME) /* overloaded function */ msousa@351: __ANY_INT(__in1_anybit_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* ROL */ msousa@351: /**************/ msousa@351: #define __iec_(in1_TYPENAME,in2_TYPENAME) __function_2p(ROL, in1_TYPENAME, IN, in1_TYPENAME, N, in2_TYPENAME) /* overloaded function */ msousa@351: __ANY_INT(__in1_anybit_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: msousa@351: /*********************/ msousa@351: /*** Table 26 ***/ msousa@351: /*********************/ msousa@351: msousa@351: /**************/ msousa@351: /* AND */ msousa@351: /**************/ msousa@351: #ifdef __DEFINE_CLASHING_FUNCTIONS msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(AND, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(AND_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_BIT(__iec_) msousa@351: #undef __iec_ msousa@351: #endif msousa@351: msousa@351: /*************/ msousa@351: /* OR */ msousa@351: /*************/ msousa@351: #ifdef __DEFINE_CLASHING_FUNCTIONS msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(OR, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(OR_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_BIT(__iec_) msousa@351: #undef __iec_ msousa@351: #endif msousa@351: msousa@351: /**************/ msousa@351: /* XOR */ msousa@351: /**************/ msousa@351: #ifdef __DEFINE_CLASHING_FUNCTIONS msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(XOR, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(XOR_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_BIT(__iec_) msousa@351: #undef __iec_ msousa@351: #endif msousa@351: msousa@351: /**************/ msousa@351: /* NOT */ msousa@351: /**************/ msousa@351: #ifdef __DEFINE_CLASHING_FUNCTIONS msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1p(NOT, TYPENAME, IN, TYPENAME) /* overloaded function */ \ msousa@351: __function_1p(NOT_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */ msousa@351: __ANY_BIT(__iec_) msousa@351: #undef __iec_ msousa@351: #endif msousa@351: msousa@351: msousa@351: msousa@351: msousa@351: msousa@351: msousa@351: /***************************************************/ msousa@351: /***************************************************/ msousa@351: /* 2.5.1.5.4 Selection and comparison Functions */ msousa@351: /***************************************************/ msousa@351: /***************************************************/ msousa@351: msousa@351: /*********************/ msousa@351: /*** Table 27 ***/ msousa@351: /*********************/ msousa@351: msousa@351: /**************/ msousa@351: /* SEL */ msousa@351: /**************/ msousa@351: /* The standard states that the inputs for SEL and MUX must be named starting off from 0, msousa@351: * unlike remaining functions, that start off at 1. msousa@351: */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_3p(SEL, TYPENAME, G, BOOL, IN0, TYPENAME, IN1, TYPENAME) /* overloaded function */ \ msousa@351: __function_3p(SEL_##TYPENAME, TYPENAME, G, BOOL, IN0, TYPENAME, IN1, TYPENAME) /* explicitly typed function */ msousa@351: __ANY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* MAX */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(MAX, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(MAX_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* MIN */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(MIN, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(MIN_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* LIMIT */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_3p(LIMIT, TYPENAME, MN, TYPENAME, IN, TYPENAME, MX, TYPENAME) /* overloaded function */ \ msousa@351: __function_3p(LIMIT_##TYPENAME, TYPENAME, MN, TYPENAME, IN, TYPENAME, MX, TYPENAME) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* MUX */ msousa@351: /**************/ msousa@351: /* The standard states that the inputs for SEL and MUX must be named starting off from 0, msousa@351: * unlike remaining functions, that start off at 1. msousa@351: */ msousa@351: /* The standard considers the explicit typing of MUX function as a special case... msousa@351: * It should look like: msousa@351: * MUX_SINT_REAL, MUX_SINT_STRING, MUX_SINT_[ANY] msousa@351: * MUX_INT_REAL, MUX_INT_STRING, MUX_INT_[ANY] msousa@351: * MUX_[ANY_INT]_[ANY] msousa@351: */ msousa@351: #define __in1_anyint_(in2_TYPENAME) __ANY_INT_1(__iec_,in2_TYPENAME) msousa@351: #define __iec_(in1_TYPENAME,in2_TYPENAME) \ msousa@351: __function_2e(MUX, in2_TYPENAME, K, in1_TYPENAME, IN, in2_TYPENAME, 0) /* overloaded function */ \ msousa@351: __function_2e(MUX_##in1_TYPENAME##_##in2_TYPENAME, in2_TYPENAME, K, in1_TYPENAME, IN, in2_TYPENAME, 0) /* explicitly typed function */ msousa@351: __ANY(__in1_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: msousa@351: /******************************************/ msousa@351: /*** Table 28 ***/ msousa@351: /*** Standard comparison functions ***/ msousa@351: /******************************************/ msousa@351: msousa@351: /**************/ msousa@351: /* GT */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(GT, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(GT_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* GE */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(GE, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(GE_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* EQ */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(EQ, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(EQ_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* LT */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(LT, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(LT_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* LE */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(LE, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ msousa@351: __function_1e(LE_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /**************/ msousa@351: /* NE */ msousa@351: /**************/ msousa@351: /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ msousa@351: /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ msousa@351: #define __iec_(TYPENAME) \ laurent@398: __function_2p(NE, BOOL, IN1, TYPENAME, IN2, TYPENAME) /* overloaded function */ \ laurent@398: __function_2p(NE_##TYPENAME, BOOL, IN1, TYPENAME, IN2, TYPENAME) /* explicitly typed function */ msousa@351: __ANY_ELEMENTARY(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: msousa@351: /*********************************************/ msousa@351: /*********************************************/ msousa@351: /* 2.5.1.5.5 Character string Functions */ msousa@351: /*********************************************/ msousa@351: /*********************************************/ msousa@351: msousa@351: /*************************************/ msousa@351: /*** Table 29 ***/ msousa@351: /*** Character string Functions ***/ msousa@351: /*************************************/ msousa@351: msousa@351: /* We do not delcare explcitly typed versions of the functions in table 29. msousa@351: * See note at top of this file regarding explicitly typed functions for more details. msousa@351: */ msousa@351: msousa@351: #define __A_anyint_(B_TYPENAME) __ANY_INT_1(__iec_,B_TYPENAME) msousa@351: msousa@351: msousa@351: msousa@351: /***************/ msousa@351: /* LEN */ msousa@351: /***************/ msousa@351: #define __iec_(A_TYPENAME,B_TYPENAME) \ msousa@351: __function_1p(LEN, A_TYPENAME, IN, B_TYPENAME) /* overloaded function */ msousa@351: __ANY_STRING(__A_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /****************/ msousa@351: /* LEFT */ msousa@351: /****************/ msousa@351: #define __iec_(A_TYPENAME,B_TYPENAME) \ msousa@351: __function_2p(LEFT, B_TYPENAME, IN, B_TYPENAME, L, A_TYPENAME) /* overloaded function */ msousa@351: __ANY_STRING(__A_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /*****************/ msousa@351: /* RIGHT */ msousa@351: /*****************/ msousa@351: #define __iec_(A_TYPENAME,B_TYPENAME) \ msousa@351: __function_2p(RIGHT, B_TYPENAME, IN, B_TYPENAME, L, A_TYPENAME) /* overloaded function */ msousa@351: __ANY_STRING(__A_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /***************/ msousa@351: /* MID */ msousa@351: /***************/ msousa@351: #define __iec_(A_TYPENAME,B_TYPENAME) \ msousa@351: __function_3p(MID, B_TYPENAME, IN, B_TYPENAME, L, A_TYPENAME, P, A_TYPENAME) /* overloaded function */ msousa@351: __ANY_STRING(__A_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /******************/ msousa@351: /* CONCAT */ msousa@351: /******************/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_1e(CONCAT, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ msousa@351: __ANY_STRING(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /******************/ msousa@351: /* INSERT */ msousa@351: /******************/ msousa@351: #define __iec_(A_TYPENAME,B_TYPENAME) \ msousa@351: __function_3p(INSERT, B_TYPENAME, IN1, B_TYPENAME, IN2, B_TYPENAME, P, A_TYPENAME) /* overloaded function */ msousa@351: __ANY_STRING(__A_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /******************/ msousa@351: /* DELETE */ msousa@351: /******************/ msousa@351: #define __iec_(A_TYPENAME,B_TYPENAME) \ msousa@351: __function_3p(DELETE, B_TYPENAME, IN, B_TYPENAME, L, A_TYPENAME, P, A_TYPENAME) /* overloaded function */ msousa@351: __ANY_STRING(__A_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /*******************/ msousa@351: /* REPLACE */ msousa@351: /*******************/ msousa@351: #define __iec_(A_TYPENAME,B_TYPENAME) \ msousa@351: __function_4p(REPLACE, B_TYPENAME, IN1, B_TYPENAME, IN2, B_TYPENAME, L, A_TYPENAME, P, A_TYPENAME) /* overloaded function */ msousa@351: __ANY_STRING(__A_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /****************/ msousa@351: /* FIND */ msousa@351: /****************/ msousa@351: #define __iec_(A_TYPENAME,B_TYPENAME) \ msousa@351: __function_2p(FIND, A_TYPENAME, IN1, B_TYPENAME, IN2, B_TYPENAME) /* overloaded function */ msousa@351: __ANY_STRING(__A_anyint_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /*********************************************/ msousa@351: /*********************************************/ msousa@351: /* 2.5.1.5.6 Functions of time data types */ msousa@351: /*********************************************/ msousa@351: /*********************************************/ msousa@351: msousa@351: /**************************************/ msousa@351: /*** Table 30 ***/ msousa@351: /*** Functions of time data types ***/ msousa@351: /**************************************/ msousa@351: msousa@1085: __function_2p(ADD_TIME, TIME, IN1, TIME, IN2, TIME) msousa@1085: __function_2p(ADD, TIME, IN1, TIME, IN2, TIME) /* overloaded function */ msousa@1085: __function_2p(ADD_TOD_TIME, TOD, IN1, TOD, IN2, TIME) msousa@1085: __function_2p(ADD, TOD, IN1, TOD, IN2, TIME) /* overloaded function */ msousa@1085: __function_2p(ADD_DT_TIME, DT, IN1, DT, IN2, TIME) msousa@1085: __function_2p(ADD, DT, IN1, DT, IN2, TIME) /* overloaded function */ msousa@1085: msousa@1085: __function_2p(SUB_TIME, TIME, IN1, TIME, IN2, TIME) msousa@1085: __function_2p(SUB, TIME, IN1, TIME, IN2, TIME) /* overloaded function */ msousa@351: __function_2p(SUB_DATE_DATE, TIME, IN1, DATE, IN2, DATE) msousa@1085: __function_2p(SUB, TIME, IN1, DATE, IN2, DATE) /* overloaded function */ msousa@1085: __function_2p(SUB_TOD_TIME, TOD, IN1, TOD, IN2, TIME) msousa@1085: __function_2p(SUB, TOD, IN1, TOD, IN2, TIME) /* overloaded function */ msousa@1085: __function_2p(SUB_TOD_TOD, TIME, IN1, TOD, IN2, TOD ) msousa@1085: __function_2p(SUB, TIME, IN1, TOD, IN2, TOD ) /* overloaded function */ msousa@1085: __function_2p(SUB_DT_TIME, DT, IN1, DT, IN2, TIME) msousa@1085: __function_2p(SUB, DT, IN1, DT, IN2, TIME) /* overloaded function */ msousa@1085: __function_2p(SUB_DT_DT, TIME, IN1, DT, IN2, DT ) msousa@1085: __function_2p(SUB, TIME, IN1, DT, IN2, DT ) /* overloaded function */ msousa@351: msousa@351: msousa@351: /*** MULTIME ***/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_2p(MULTIME_##TYPENAME, TIME, IN1, TIME, IN2, TYPENAME) /* explicitly typed function */\ msousa@351: __function_2p(MULTIME, TIME, IN1, TIME, IN2, TYPENAME) /* overloaded function */ msousa@351: __ANY_NUM(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /*** MUL ***/ msousa@351: /* NOTE: We can not include the explicitly typed function msousa@351: * __function_2p(DIV_##TYPENAME, TIME, IN1, TIME, IN2, TYPENAME) msousa@351: * as it would clash with another function with the exact same name declared above msousa@351: * __function_2p(DIV_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) msousa@351: * and the standard does not define this explicitly defined function as being overloaded msousa@351: * (i.e. having an ANY_***) input or output parameter msousa@351: * Note that our compiler would nevertheless work just fine with this overloaded declaration. msousa@351: */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_2p(MUL, TIME, IN1, TIME, IN2, TYPENAME) /* overloaded function */ msousa@351: __ANY_NUM(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /*** DIVTIME ***/ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_2p(DIVTIME_##TYPENAME, TIME, IN1, TIME, IN2, TYPENAME) /* explicitly typed function */\ msousa@351: __function_2p(DIVTIME, TIME, IN1, TIME, IN2, TYPENAME) /* overloaded function */ msousa@351: __ANY_NUM(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: /*** DIV ***/ msousa@351: /* NOTE: We can not include the explicitly typed function msousa@351: * __function_2p(DIV_##TYPENAME, TIME, IN1, TIME, IN2, TYPENAME) msousa@351: * as it would clash with another function with the exact same name declared above msousa@351: * __function_2p(DIV_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) msousa@351: * and the standard does not define this explicitly defined function as being overloaded msousa@351: * (i.e. having an ANY_***) input or output parameter msousa@351: * Note that our compiler would nevertheless work just fine with this overloaded declaration. msousa@351: */ msousa@351: #define __iec_(TYPENAME) \ msousa@351: __function_2p(DIV, TIME, IN1, TIME, IN2, TYPENAME) /* overloaded function */ msousa@351: __ANY_NUM(__iec_) msousa@351: #undef __iec_ msousa@351: msousa@351: msousa@351: /*** CONCAT_DATE_TOD ***/ msousa@351: __function_2p(CONCAT_DATE_TOD, DT, IN1, DATE, IN2, TOD) msousa@351: msousa@351: msousa@351: msousa@351: msousa@351: /****************************************************/ msousa@351: /****************************************************/ msousa@351: /* 2.5.1.5.6 Functions of enumerated data types */ msousa@351: /****************************************************/ msousa@351: /****************************************************/ msousa@351: msousa@351: /********************************************/ msousa@351: /*** Table 31 ***/ msousa@351: /*** Functions of enumerated data types ***/ msousa@351: /********************************************/ msousa@351: msousa@351: /* Do we support this? */ msousa@351: msousa@351: END msousa@351: msousa@351: echo "{enable code generation}" msousa@351: echo