8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 09:20:39 +01:00

Expose frac() in ib_udf but only as udf_frac to not clash with a possible native implementation.

This commit is contained in:
robocop 2009-03-05 06:38:43 +00:00
parent d0d080124f
commit 4ffeaea47a
3 changed files with 236 additions and 218 deletions

View File

@ -53,3 +53,4 @@ EXPORTS
IB_UDF_tan
IB_UDF_tanh
IB_UDF_substrlen
IB_UDF_frac

View File

@ -29,11 +29,11 @@
*****************************************
*
* Functional description:
* Returns the absolute value of a
* number.
* Returns the absolute value of a
* number.
*
*****************************************
DECLARE EXTERNAL FUNCTION abs
DECLARE EXTERNAL FUNCTION abs
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_abs' MODULE_NAME 'ib_udf'; */
@ -45,13 +45,13 @@ DECLARE EXTERNAL FUNCTION abs
*****************************************
*
* Functional description:
* Returns the arccosine of a number
* Returns the arccosine of a number
* between -1 and 1, if the number is
* out of bounds it returns NaN, as handled
* by the _matherr routine.
*
*****************************************
DECLARE EXTERNAL FUNCTION acos
DECLARE EXTERNAL FUNCTION acos
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_acos' MODULE_NAME 'ib_udf'; */
@ -100,7 +100,7 @@ DECLARE EXTERNAL FUNCTION ascii_val
* range NaN is returned.
*
*****************************************
DECLARE EXTERNAL FUNCTION asin
DECLARE EXTERNAL FUNCTION asin
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_asin' MODULE_NAME 'ib_udf'; */
@ -113,10 +113,10 @@ DECLARE EXTERNAL FUNCTION asin
*
* Functional description:
* Returns the arctangent of a number.
*
*
*
*****************************************
DECLARE EXTERNAL FUNCTION atan
DECLARE EXTERNAL FUNCTION atan
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_atan' MODULE_NAME 'ib_udf'; */
@ -132,7 +132,7 @@ DECLARE EXTERNAL FUNCTION atan
* first param / the second param.
*
*****************************************
DECLARE EXTERNAL FUNCTION atan2
DECLARE EXTERNAL FUNCTION atan2
DOUBLE PRECISION, DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_atan2' MODULE_NAME 'ib_udf'; */
@ -144,11 +144,11 @@ DECLARE EXTERNAL FUNCTION atan2
*****************************************
*
* Functional description:
* Returns the result of a binary AND
* Returns the result of a binary AND
* operation performed on the two numbers.
*
*****************************************
DECLARE EXTERNAL FUNCTION bin_and
DECLARE EXTERNAL FUNCTION bin_and
INTEGER, INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_bin_and' MODULE_NAME 'ib_udf'; */
@ -160,11 +160,11 @@ DECLARE EXTERNAL FUNCTION bin_and
*****************************************
*
* Functional description:
* Returns the result of a binary OR
* Returns the result of a binary OR
* operation performed on the two numbers.
*
*****************************************
DECLARE EXTERNAL FUNCTION bin_or
DECLARE EXTERNAL FUNCTION bin_or
INTEGER, INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_bin_or' MODULE_NAME 'ib_udf'; */
@ -176,11 +176,11 @@ DECLARE EXTERNAL FUNCTION bin_or
*****************************************
*
* Functional description:
* Returns the result of a binary XOR
* Returns the result of a binary XOR
* operation performed on the two numbers.
*
*****************************************
DECLARE EXTERNAL FUNCTION bin_xor
DECLARE EXTERNAL FUNCTION bin_xor
INTEGER, INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_bin_xor' MODULE_NAME 'ib_udf'; */
@ -192,12 +192,12 @@ DECLARE EXTERNAL FUNCTION bin_xor
*****************************************
*
* Functional description:
* Returns a double value representing
* the smallest integer that is greater
* Returns a double value representing
* the smallest integer that is greater
* than or equal to the input value.
*
*****************************************
DECLARE EXTERNAL FUNCTION ceiling
DECLARE EXTERNAL FUNCTION ceiling
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_ceiling' MODULE_NAME 'ib_udf'; */
@ -209,17 +209,17 @@ DECLARE EXTERNAL FUNCTION ceiling
*****************************************
*
* Functional description:
* The cos function returns the cosine
* of x. If x is greater than or equal
* to 263, or less than or equal to -263,
* a loss of significance in the result
* of a call to cos occurs, in which case
* the function generates a _TLOSS error
* and returns an indefinite (same as a
* The cos function returns the cosine
* of x. If x is greater than or equal
* to 263, or less than or equal to -263,
* a loss of significance in the result
* of a call to cos occurs, in which case
* the function generates a _TLOSS error
* and returns an indefinite (same as a
* quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION cos
DECLARE EXTERNAL FUNCTION cos
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_cos' MODULE_NAME 'ib_udf'; */
@ -231,17 +231,17 @@ DECLARE EXTERNAL FUNCTION cos
*****************************************
*
* Functional description:
* The cosh function returns the hyperbolic cosine
* of x. If x is greater than or equal
* to 263, or less than or equal to -263,
* a loss of significance in the result
* of a call to cos occurs, in which case
* the function generates a _TLOSS error
* and returns an indefinite (same as a
* The cosh function returns the hyperbolic cosine
* of x. If x is greater than or equal
* to 263, or less than or equal to -263,
* a loss of significance in the result
* of a call to cos occurs, in which case
* the function generates a _TLOSS error
* and returns an indefinite (same as a
* quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION cosh
DECLARE EXTERNAL FUNCTION cosh
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_cosh' MODULE_NAME 'ib_udf'; */
@ -257,7 +257,7 @@ DECLARE EXTERNAL FUNCTION cosh
* input parameter.
*
*****************************************
DECLARE EXTERNAL FUNCTION cot
DECLARE EXTERNAL FUNCTION cot
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_cot' MODULE_NAME 'ib_udf'; */
@ -273,7 +273,7 @@ DECLARE EXTERNAL FUNCTION cot
* of the two input parameters.
*
*****************************************/
DECLARE EXTERNAL FUNCTION div
DECLARE EXTERNAL FUNCTION div
INTEGER, INTEGER
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_div' MODULE_NAME 'ib_udf';
@ -285,16 +285,32 @@ DECLARE EXTERNAL FUNCTION div
*****************************************
*
* Functional description:
* Returns a floating-point value
* representing the largest integer that
* is less than or equal to x
* Returns a floating-point value
* representing the largest integer that
* is less than or equal to x.
*
*****************************************
DECLARE EXTERNAL FUNCTION floor
DECLARE EXTERNAL FUNCTION floor
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_floor' MODULE_NAME 'ib_udf'; */
/*****************************************
*
* u d f _ f r a c
*
*****************************************
*
* Functional description:
* Returns a floating-point value
* representing the fractional part of x.
*
*****************************************/
DECLARE EXTERNAL FUNCTION udf_frac
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_frac' MODULE_NAME 'ib_udf';
/*****************************************
*
* l n
@ -305,7 +321,7 @@ DECLARE EXTERNAL FUNCTION floor
* Returns the natural log of a number.
*
*****************************************
DECLARE EXTERNAL FUNCTION ln
DECLARE EXTERNAL FUNCTION ln
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_ln' MODULE_NAME 'ib_udf'; */
@ -317,11 +333,11 @@ DECLARE EXTERNAL FUNCTION ln
*****************************************
*
* Functional description:
* log (x,y) returns the logarithm
* log (x,y) returns the logarithm
* base x of y.
*
*****************************************
DECLARE EXTERNAL FUNCTION log
DECLARE EXTERNAL FUNCTION log
DOUBLE PRECISION, DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_log' MODULE_NAME 'ib_udf'; */
@ -337,7 +353,7 @@ DECLARE EXTERNAL FUNCTION log
* input parameter.
*
*****************************************
DECLARE EXTERNAL FUNCTION log10
DECLARE EXTERNAL FUNCTION log10
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_log10' MODULE_NAME 'ib_udf'; */
@ -349,18 +365,18 @@ DECLARE EXTERNAL FUNCTION log10
*****************************************
*
* Functional description:
* Returns the input string into lower
* Returns the input string into lower
* case characters. Note: This function
* will not work with international and
* will not work with international and
* non-ascii characters.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************
DECLARE EXTERNAL FUNCTION lower
DECLARE EXTERNAL FUNCTION lower
CSTRING(255)
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf'; */
@ -377,12 +393,12 @@ DECLARE EXTERNAL FUNCTION lower
* string becomes equal to the given number.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************
DECLARE EXTERNAL FUNCTION lpad
DECLARE EXTERNAL FUNCTION lpad
CSTRING(255), INTEGER, CSTRING(1)
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_lpad' MODULE_NAME 'ib_udf'; */
@ -398,12 +414,12 @@ DECLARE EXTERNAL FUNCTION lpad
* string.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION ltrim
DECLARE EXTERNAL FUNCTION ltrim
CSTRING(255)
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_ltrim' MODULE_NAME 'ib_udf';
@ -415,11 +431,11 @@ DECLARE EXTERNAL FUNCTION ltrim
*****************************************
*
* Functional description:
* Returns the remainder part of the
* Returns the remainder part of the
* division of the two input parameters.
*
*****************************************
DECLARE EXTERNAL FUNCTION mod
DECLARE EXTERNAL FUNCTION mod
INTEGER, INTEGER
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_mod' MODULE_NAME 'ib_udf'; */
@ -434,7 +450,7 @@ DECLARE EXTERNAL FUNCTION mod
* Returns the value of pi = 3.1459...
*
*****************************************
DECLARE EXTERNAL FUNCTION pi
DECLARE EXTERNAL FUNCTION pi
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_pi' MODULE_NAME 'ib_udf'; */
@ -445,13 +461,13 @@ DECLARE EXTERNAL FUNCTION pi
*****************************************
*
* Functional description:
* Returns a random number between 0
* Returns a random number between 0
* and 1. Note the random number
* generator is seeded using the current
* generator is seeded using the current
* time.
*
*****************************************
DECLARE EXTERNAL FUNCTION rand
DECLARE EXTERNAL FUNCTION rand
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_rand' MODULE_NAME 'ib_udf'; */
@ -467,12 +483,12 @@ DECLARE EXTERNAL FUNCTION rand
* string becomes equal to the given number.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************
DECLARE EXTERNAL FUNCTION rpad
DECLARE EXTERNAL FUNCTION rpad
CSTRING(255), INTEGER, CSTRING(1)
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_rpad' MODULE_NAME 'ib_udf'; */
@ -488,12 +504,12 @@ DECLARE EXTERNAL FUNCTION rpad
* string.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION rtrim
DECLARE EXTERNAL FUNCTION rtrim
CSTRING(255)
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_rtrim' MODULE_NAME 'ib_udf';
@ -506,11 +522,11 @@ DECLARE EXTERNAL FUNCTION rtrim
*
* Functional description:
* Returns 1, 0, or -1 depending on whether
* the input value is positive, zero or
* the input value is positive, zero or
* negative, respectively.
*
*****************************************
DECLARE EXTERNAL FUNCTION sign
DECLARE EXTERNAL FUNCTION sign
DOUBLE PRECISION
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_sign' MODULE_NAME 'ib_udf'; */
@ -522,15 +538,15 @@ DECLARE EXTERNAL FUNCTION sign
*****************************************
*
* Functional description:
* Returns the sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* Returns the sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* returns an indefinite (same as a quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION sin
DECLARE EXTERNAL FUNCTION sin
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sin' MODULE_NAME 'ib_udf'; */
@ -542,15 +558,15 @@ DECLARE EXTERNAL FUNCTION sin
*****************************************
*
* Functional description:
* Returns the hyperbolic sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* Returns the hyperbolic sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* returns an indefinite (same as a quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION sinh
DECLARE EXTERNAL FUNCTION sinh
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sinh' MODULE_NAME 'ib_udf'; */
@ -565,7 +581,7 @@ DECLARE EXTERNAL FUNCTION sinh
* Returns the square root of a number.
*
*****************************************
DECLARE EXTERNAL FUNCTION sqrt
DECLARE EXTERNAL FUNCTION sqrt
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sqrt' MODULE_NAME 'ib_udf'; */
@ -577,20 +593,20 @@ DECLARE EXTERNAL FUNCTION sqrt
*****************************************
*
* Functional description:
* substr(s,m,n) returns the substring
* substr(s,m,n) returns the substring
* of s which starts at position m and
* ending at position n.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
* Change by Claudio Valderrama: when n>length(s),
* the result will be the original string instead
* of NULL as it was originally designed.
*
*****************************************/
DECLARE EXTERNAL FUNCTION substr
DECLARE EXTERNAL FUNCTION substr
CSTRING(255), SMALLINT, SMALLINT
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf';
@ -607,12 +623,12 @@ DECLARE EXTERNAL FUNCTION substr
* ends at position i+l-1, being l the length.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION substrlen
DECLARE EXTERNAL FUNCTION substrlen
CSTRING(255), SMALLINT, SMALLINT
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_substrlen' MODULE_NAME 'ib_udf';
@ -627,7 +643,7 @@ DECLARE EXTERNAL FUNCTION substrlen
* Returns the length of a given string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION strlen
DECLARE EXTERNAL FUNCTION strlen
CSTRING(32767)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';
@ -639,16 +655,16 @@ DECLARE EXTERNAL FUNCTION strlen
*****************************************
*
* Functional description:
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* (same as a quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION tan
DECLARE EXTERNAL FUNCTION tan
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_tan' MODULE_NAME 'ib_udf'; */
@ -660,16 +676,16 @@ DECLARE EXTERNAL FUNCTION tan
*****************************************
*
* Functional description:
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* (same as a quiet NaN).
*
*
*****************************************
DECLARE EXTERNAL FUNCTION tanh
DECLARE EXTERNAL FUNCTION tanh
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_tanh' MODULE_NAME 'ib_udf'; */

View File

@ -31,11 +31,11 @@
*****************************************
*
* Functional description:
* Returns the absolute value of a
* number.
* Returns the absolute value of a
* number.
*
*****************************************
DECLARE EXTERNAL FUNCTION abs
DECLARE EXTERNAL FUNCTION abs
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_abs' MODULE_NAME 'ib_udf'; */
@ -47,13 +47,13 @@ DECLARE EXTERNAL FUNCTION abs
*****************************************
*
* Functional description:
* Returns the arccosine of a number
* Returns the arccosine of a number
* between -1 and 1, if the number is
* out of bounds it returns NaN, as handled
* by the _matherr routine.
*
*****************************************
DECLARE EXTERNAL FUNCTION acos
DECLARE EXTERNAL FUNCTION acos
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_acos' MODULE_NAME 'ib_udf'; */
@ -102,7 +102,7 @@ DECLARE EXTERNAL FUNCTION ascii_val
* range NaN is returned.
*
*****************************************
DECLARE EXTERNAL FUNCTION asin
DECLARE EXTERNAL FUNCTION asin
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_asin' MODULE_NAME 'ib_udf'; */
@ -115,10 +115,10 @@ DECLARE EXTERNAL FUNCTION asin
*
* Functional description:
* Returns the arctangent of a number.
*
*
*
*****************************************
DECLARE EXTERNAL FUNCTION atan
DECLARE EXTERNAL FUNCTION atan
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_atan' MODULE_NAME 'ib_udf'; */
@ -134,7 +134,7 @@ DECLARE EXTERNAL FUNCTION atan
* first param / the second param.
*
*****************************************
DECLARE EXTERNAL FUNCTION atan2
DECLARE EXTERNAL FUNCTION atan2
DOUBLE PRECISION, DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_atan2' MODULE_NAME 'ib_udf'; */
@ -146,11 +146,11 @@ DECLARE EXTERNAL FUNCTION atan2
*****************************************
*
* Functional description:
* Returns the result of a binary AND
* Returns the result of a binary AND
* operation performed on the two numbers.
*
*****************************************
DECLARE EXTERNAL FUNCTION bin_and
DECLARE EXTERNAL FUNCTION bin_and
INTEGER, INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_bin_and' MODULE_NAME 'ib_udf'; */
@ -162,11 +162,11 @@ DECLARE EXTERNAL FUNCTION bin_and
*****************************************
*
* Functional description:
* Returns the result of a binary OR
* Returns the result of a binary OR
* operation performed on the two numbers.
*
*****************************************
DECLARE EXTERNAL FUNCTION bin_or
DECLARE EXTERNAL FUNCTION bin_or
INTEGER, INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_bin_or' MODULE_NAME 'ib_udf'; */
@ -178,11 +178,11 @@ DECLARE EXTERNAL FUNCTION bin_or
*****************************************
*
* Functional description:
* Returns the result of a binary XOR
* Returns the result of a binary XOR
* operation performed on the two numbers.
*
*****************************************
DECLARE EXTERNAL FUNCTION bin_xor
DECLARE EXTERNAL FUNCTION bin_xor
INTEGER, INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_bin_xor' MODULE_NAME 'ib_udf'; */
@ -194,12 +194,12 @@ DECLARE EXTERNAL FUNCTION bin_xor
*****************************************
*
* Functional description:
* Returns a double value representing
* the smallest integer that is greater
* Returns a double value representing
* the smallest integer that is greater
* than or equal to the input value.
*
*****************************************
DECLARE EXTERNAL FUNCTION ceiling
DECLARE EXTERNAL FUNCTION ceiling
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_ceiling' MODULE_NAME 'ib_udf'; */
@ -211,17 +211,17 @@ DECLARE EXTERNAL FUNCTION ceiling
*****************************************
*
* Functional description:
* The cos function returns the cosine
* of x. If x is greater than or equal
* to 263, or less than or equal to -263,
* a loss of significance in the result
* of a call to cos occurs, in which case
* the function generates a _TLOSS error
* and returns an indefinite (same as a
* The cos function returns the cosine
* of x. If x is greater than or equal
* to 263, or less than or equal to -263,
* a loss of significance in the result
* of a call to cos occurs, in which case
* the function generates a _TLOSS error
* and returns an indefinite (same as a
* quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION cos
DECLARE EXTERNAL FUNCTION cos
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_cos' MODULE_NAME 'ib_udf'; */
@ -233,17 +233,17 @@ DECLARE EXTERNAL FUNCTION cos
*****************************************
*
* Functional description:
* The cosh function returns the hyperbolic cosine
* of x. If x is greater than or equal
* to 263, or less than or equal to -263,
* a loss of significance in the result
* of a call to cos occurs, in which case
* the function generates a _TLOSS error
* and returns an indefinite (same as a
* The cosh function returns the hyperbolic cosine
* of x. If x is greater than or equal
* to 263, or less than or equal to -263,
* a loss of significance in the result
* of a call to cos occurs, in which case
* the function generates a _TLOSS error
* and returns an indefinite (same as a
* quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION cosh
DECLARE EXTERNAL FUNCTION cosh
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_cosh' MODULE_NAME 'ib_udf'; */
@ -259,7 +259,7 @@ DECLARE EXTERNAL FUNCTION cosh
* input parameter.
*
*****************************************
DECLARE EXTERNAL FUNCTION cot
DECLARE EXTERNAL FUNCTION cot
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_cot' MODULE_NAME 'ib_udf'; */
@ -275,7 +275,7 @@ DECLARE EXTERNAL FUNCTION cot
* of the two input parameters.
*
*****************************************/
DECLARE EXTERNAL FUNCTION div
DECLARE EXTERNAL FUNCTION div
INTEGER, INTEGER
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_div' MODULE_NAME 'ib_udf';
@ -287,27 +287,28 @@ DECLARE EXTERNAL FUNCTION div
*****************************************
*
* Functional description:
* Returns a floating-point value
* representing the largest integer that
* is less than or equal to x
* Returns a floating-point value
* representing the largest integer that
* is less than or equal to x.
*
*****************************************
DECLARE EXTERNAL FUNCTION floor
DECLARE EXTERNAL FUNCTION floor
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_floor' MODULE_NAME 'ib_udf'; */
/*****************************************
*
* f r a c
* u d f _ f r a c
*
*****************************************
*
* Functional description:
* Returns the fractional part of the argument.
* Returns a floating-point value
* representing the fractional part of x.
*
*****************************************/
DECLARE EXTERNAL FUNCTION frac
DECLARE EXTERNAL FUNCTION udf_frac
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_frac' MODULE_NAME 'ib_udf';
@ -322,7 +323,7 @@ DECLARE EXTERNAL FUNCTION frac
* Returns the natural log of a number.
*
*****************************************
DECLARE EXTERNAL FUNCTION ln
DECLARE EXTERNAL FUNCTION ln
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_ln' MODULE_NAME 'ib_udf'; */
@ -334,11 +335,11 @@ DECLARE EXTERNAL FUNCTION ln
*****************************************
*
* Functional description:
* log (x,y) returns the logarithm
* log (x,y) returns the logarithm
* base x of y.
*
*****************************************
DECLARE EXTERNAL FUNCTION log
DECLARE EXTERNAL FUNCTION log
DOUBLE PRECISION, DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_log' MODULE_NAME 'ib_udf'; */
@ -354,7 +355,7 @@ DECLARE EXTERNAL FUNCTION log
* input parameter.
*
*****************************************
DECLARE EXTERNAL FUNCTION log10
DECLARE EXTERNAL FUNCTION log10
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_log10' MODULE_NAME 'ib_udf'; */
@ -366,14 +367,14 @@ DECLARE EXTERNAL FUNCTION log10
*****************************************
*
* Functional description:
* Returns the input string into lower
* Returns the input string into lower
* case characters. Note: This function
* will not work with international and
* will not work with international and
* non-ascii characters.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************
@ -394,12 +395,12 @@ DECLARE EXTERNAL FUNCTION "LOWER"
* string becomes equal to the given number.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************
DECLARE EXTERNAL FUNCTION lpad
DECLARE EXTERNAL FUNCTION lpad
CSTRING(255) NULL, INTEGER, CSTRING(1) NULL
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_lpad' MODULE_NAME 'ib_udf'; */
@ -415,12 +416,12 @@ DECLARE EXTERNAL FUNCTION lpad
* string.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION ltrim
DECLARE EXTERNAL FUNCTION ltrim
CSTRING(255) NULL
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_ltrim' MODULE_NAME 'ib_udf';
@ -432,11 +433,11 @@ DECLARE EXTERNAL FUNCTION ltrim
*****************************************
*
* Functional description:
* Returns the remainder part of the
* Returns the remainder part of the
* division of the two input parameters.
*
*****************************************
DECLARE EXTERNAL FUNCTION mod
DECLARE EXTERNAL FUNCTION mod
INTEGER, INTEGER
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_mod' MODULE_NAME 'ib_udf'; */
@ -451,7 +452,7 @@ DECLARE EXTERNAL FUNCTION mod
* Returns the value of pi = 3.1459...
*
*****************************************
DECLARE EXTERNAL FUNCTION pi
DECLARE EXTERNAL FUNCTION pi
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_pi' MODULE_NAME 'ib_udf'; */
@ -462,15 +463,15 @@ DECLARE EXTERNAL FUNCTION pi
*****************************************
*
* Functional description:
* Returns a random number between 0
* and 1.
*
* Returns a random number between 0
* and 1.
*
* Note: Use srand to seed the
* random number generator.
*
* Note: Use srand to seed the
* random number generator.
* This behavior has been changed.
*****************************************
DECLARE EXTERNAL FUNCTION rand
DECLARE EXTERNAL FUNCTION rand
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_rand' MODULE_NAME 'ib_udf'; */
@ -487,12 +488,12 @@ DECLARE EXTERNAL FUNCTION rand
* string becomes equal to the given number.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************
DECLARE EXTERNAL FUNCTION rpad
DECLARE EXTERNAL FUNCTION rpad
CSTRING(255) NULL, INTEGER, CSTRING(1) NULL
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_rpad' MODULE_NAME 'ib_udf'; */
@ -508,12 +509,12 @@ DECLARE EXTERNAL FUNCTION rpad
* string.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION rtrim
DECLARE EXTERNAL FUNCTION rtrim
CSTRING(255) NULL
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_rtrim' MODULE_NAME 'ib_udf';
@ -526,11 +527,11 @@ DECLARE EXTERNAL FUNCTION rtrim
*
* Functional description:
* Returns 1, 0, or -1 depending on whether
* the input value is positive, zero or
* the input value is positive, zero or
* negative, respectively.
*
*****************************************
DECLARE EXTERNAL FUNCTION sign
DECLARE EXTERNAL FUNCTION sign
DOUBLE PRECISION
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_sign' MODULE_NAME 'ib_udf'; */
@ -542,15 +543,15 @@ DECLARE EXTERNAL FUNCTION sign
*****************************************
*
* Functional description:
* Returns the sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* Returns the sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* returns an indefinite (same as a quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION sin
DECLARE EXTERNAL FUNCTION sin
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sin' MODULE_NAME 'ib_udf'; */
@ -562,15 +563,15 @@ DECLARE EXTERNAL FUNCTION sin
*****************************************
*
* Functional description:
* Returns the hyperbolic sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* Returns the hyperbolic sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* returns an indefinite (same as a quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION sinh
DECLARE EXTERNAL FUNCTION sinh
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sinh' MODULE_NAME 'ib_udf'; */
@ -585,7 +586,7 @@ DECLARE EXTERNAL FUNCTION sinh
* Returns the square root of a number.
*
*****************************************
DECLARE EXTERNAL FUNCTION sqrt
DECLARE EXTERNAL FUNCTION sqrt
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sqrt' MODULE_NAME 'ib_udf'; */
@ -598,13 +599,13 @@ DECLARE EXTERNAL FUNCTION sqrt
*****************************************
*
* Functional description:
* Returns a random number between 0
* Returns a random number between 0
* and 1. Note the random number
* generator is seeded using the current
* generator is seeded using the current
* time.
*
*****************************************/
DECLARE EXTERNAL FUNCTION srand
DECLARE EXTERNAL FUNCTION srand
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_srand' MODULE_NAME 'ib_udf';
@ -616,20 +617,20 @@ DECLARE EXTERNAL FUNCTION srand
*****************************************
*
* Functional description:
* substr(s,m,n) returns the substring
* substr(s,m,n) returns the substring
* of s which starts at position m and
* ending at position n.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
* Change by Claudio Valderrama: when n>length(s),
* the result will be the original string instead
* of NULL as it was originally designed.
*
*****************************************/
DECLARE EXTERNAL FUNCTION substr
DECLARE EXTERNAL FUNCTION substr
CSTRING(255) NULL, SMALLINT, SMALLINT
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf';
@ -646,12 +647,12 @@ DECLARE EXTERNAL FUNCTION substr
* ends at position i+l-1, being l the length.
* Note: This function is NOT limited to
* receiving and returning only 255 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION substrlen
DECLARE EXTERNAL FUNCTION substrlen
CSTRING(255) NULL, SMALLINT, SMALLINT
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_substrlen' MODULE_NAME 'ib_udf';
@ -666,7 +667,7 @@ DECLARE EXTERNAL FUNCTION substrlen
* Returns the length of a given string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION strlen
DECLARE EXTERNAL FUNCTION strlen
CSTRING(32767) CHARACTER SET NONE
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';
@ -678,16 +679,16 @@ DECLARE EXTERNAL FUNCTION strlen
*****************************************
*
* Functional description:
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* (same as a quiet NaN).
*
*****************************************
DECLARE EXTERNAL FUNCTION tan
DECLARE EXTERNAL FUNCTION tan
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_tan' MODULE_NAME 'ib_udf'; */
@ -699,16 +700,16 @@ DECLARE EXTERNAL FUNCTION tan
*****************************************
*
* Functional description:
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* (same as a quiet NaN).
*
*
*****************************************
DECLARE EXTERNAL FUNCTION tanh
DECLARE EXTERNAL FUNCTION tanh
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_tanh' MODULE_NAME 'ib_udf'; */