/*
 *   FreeAdhocUDF - copyright (c) 2004/2006 adhoc dataservice GmbH
 *   Christoph Theuring / Peter Mandrella / Georg Horn
 *   (bug-)reports only to udf@adhoc-data.de
 *      based on FreeUDFLibC - copyright (c) 1999 Gregory Deatz
 *   Declarations script for all FreeAdhocUDF UDFs
 *   length of some cstring = 8190 or 4095 
 *   because so you can use one this UDF 4 (8) times in a piped string
 *   4 x 8190 = 32760 < 32762 (15 bit - 6 byte internal use)
 *   Functions in alphabetical order
 */


/******************************************************************************/
/****                User Defined Functions - BLOb Functions               ****/
/******************************************************************************/

DECLARE EXTERNAL FUNCTION F_BLOB2EXCEL
    BLOB
    RETURNS CSTRING(32760) FREE_IT
    ENTRY_POINT 'excelblob' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBASPCHAR
    BLOB
    RETURNS CSTRING(32760) FREE_IT
    ENTRY_POINT 'blobaspchar' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBCAT
    BLOB, BLOB, BLOB
    RETURNS PARAMETER 3
    ENTRY_POINT 'blobcat' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBCATSTR
    BLOB, CSTRING(32760), BLOB
    RETURNS PARAMETER 3
    ENTRY_POINT 'blobcatstr' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBLEFT
    BLOB,
    INTEGER
    RETURNS CSTRING(8190) FREE_IT
    ENTRY_POINT 'blobleft' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBLINE
    BLOB, INTEGER
    RETURNS CSTRING(8190) FREE_IT
    ENTRY_POINT 'blobline' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBLINECOUNT
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'bloblinecount' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBMAXSEGMENTLENGTH
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'blobmaxsegmentlength' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBMID
    BLOB,
    INTEGER,
    INTEGER
    RETURNS CSTRING(8190) FREE_IT
    ENTRY_POINT 'blobmid' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBREPLACESTRING
    BLOB,
    CSTRING(254),
    CSTRING(254),
    INTEGER,
    INTEGER,
    BLOB
    RETURNS PARAMETER 6
    ENTRY_POINT 'blobreplacestring' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBRIGHT
    BLOB,
    INTEGER
    RETURNS CSTRING(8190) FREE_IT
    ENTRY_POINT 'blobright' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBSEGMENTCOUNT
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'blobsegmentcount' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBSIZE
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'blobsize' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBSUBSTR
    BLOB,
    CSTRING(254)
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'blobsubstr' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_STRBLOB
    CSTRING(32760),
    BLOB
    RETURNS PARAMETER 2
    ENTRY_POINT 'strblob' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBCOMPARE
    BLOB,
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'blobcompare' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBWORDCOUNT
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'blobwordcount' MODULE_NAME 'FreeAdhocUDF';

/* adhoc 2006-12-03 */

DECLARE EXTERNAL FUNCTION F_RBLOBMID
    BLOB,
    INTEGER,
    INTEGER
    RETURNS CSTRING(8190) FREE_IT
    ENTRY_POINT 'r_blobmid' MODULE_NAME 'FreeAdhocUDF';

/* adhoc 2007-02-06 */

DECLARE EXTERNAL FUNCTION F_BLOBSTRPOS
    CSTRING(8190),
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'b_strpos' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBTEXTPOS
    CSTRING(8190),
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'b_textpos' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_BLOBCMP
    BLOB,
    BLOB
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'b_strcmp' MODULE_NAME 'FreeAdhocUDF';


/* adhoc 2007-07-06 */


