
/*--------------------------------------------------------------
**	User Defined Function definitions for example databases
**--------------------------------------------------------------
*/


DECLARE EXTERNAL FUNCTION lower 
	VARCHAR (256)	
	RETURNS CSTRING(80) FREE_IT
	ENTRY_POINT "fn_lower_c" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION substr 
	CSTRING(256), SMALLINT, SMALLINT
	RETURNS CSTRING(80) FREE_IT
	ENTRY_POINT "fn_substr" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION trim 
	CSTRING(256)
	RETURNS CHAR (80) FREE_IT
	ENTRY_POINT "fn_trim" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION trunc 
	CSTRING(256), SMALLINT
	RETURNS VARCHAR (80) FREE_IT
	ENTRY_POINT "fn_trunc" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION strcat 
	VARCHAR(255), VARCHAR (255)
	RETURNS CSTRING(80) FREE_IT
	ENTRY_POINT "fn_strcat" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION doy 
	RETURNS INTEGER BY VALUE
	ENTRY_POINT "fn_doy" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION moy 
	RETURNS SMALLINT 
	ENTRY_POINT "fn_moy" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION dow 
	RETURNS CSTRING(12) 
	ENTRY_POINT "fn_dow" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION sysdate 
	RETURNS CSTRING(12) FREE_IT
	ENTRY_POINT "fn_sysdate" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION fact 
	DOUBLE PRECISION	
	RETURNS DOUBLE PRECISION BY VALUE
	ENTRY_POINT "fn_fact" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION add2 
	INTEGER,INTEGER	
	RETURNS INTEGER BY VALUE 
	ENTRY_POINT "fn_add2" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION mul 
	DOUBLE PRECISION, DOUBLE PRECISION	
	RETURNS DOUBLE PRECISION BY VALUE 
	ENTRY_POINT "fn_mul" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION abs
	DOUBLE PRECISION
	RETURNS DOUBLE PRECISION BY VALUE
	ENTRY_POINT "fn_abs" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION maxnum 
	DOUBLE PRECISION, DOUBLE PRECISION
	RETURNS DOUBLE PRECISION BY VALUE
	ENTRY_POINT "fn_max" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION sqrt 
	DOUBLE PRECISION
	RETURNS DOUBLE PRECISION
	ENTRY_POINT "fn_sqrt" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION BLOB_BYTECOUNT
	BLOB
	RETURNS INTEGER BY VALUE
	ENTRY_POINT "fn_blob_bytecount" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION BLOB_LINECOUNT
	BLOB
	RETURNS INTEGER BY VALUE
	ENTRY_POINT "fn_blob_linecount" MODULE_NAME "udflib";

DECLARE EXTERNAL FUNCTION BLOB_SUBSTR 
	BLOB, INTEGER, INTEGER 
	RETURNS CSTRING(256) FREE_IT
	ENTRY_POINT "fn_blob_substr" MODULE_NAME "udflib";

