/*
 *   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
 *   Notice: to use with dialect 3 (timestamp-field is TIMESTAMP)
 *   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
 */

SET SQL DIALECT 3;

/******************************************************************************/
/****                User Defined Functions: UUID Functions                ****/
/****       to use ONLY with FireBird 2.x - possibility to return NULL     ****/ 
/******************************************************************************/

DECLARE EXTERNAL FUNCTION F_UUID1COMPRTIMESTAMP
    CSTRING(254)
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'uuid1comprtimestamp' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID1MAC
    RETURNS CSTRING(36) FREE_IT
    ENTRY_POINT 'uuid1mac' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID1MACCOMPR
    RETURNS CSTRING(22) FREE_IT
    ENTRY_POINT 'uuid1maccompr' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID1MACCOMPRMAC
    CSTRING(254)
    RETURNS CSTRING(18) FREE_IT
    ENTRY_POINT 'uuid1maccomprmac' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID1MACMAC
    CSTRING(254)
    RETURNS CSTRING(18) FREE_IT
    ENTRY_POINT 'uuid1macmac' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID1RAND
    RETURNS CSTRING(36) FREE_IT
    ENTRY_POINT 'uuid1rand' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID1RANDCOMPR
    RETURNS CSTRING(22) FREE_IT
    ENTRY_POINT 'uuid1randcompr' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID1TIMESTAMP
    CSTRING(254)
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'uuid1timestamp' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID2UUIDCOMPR
    CSTRING(254)
    RETURNS CSTRING(22) FREE_IT
    ENTRY_POINT 'compressuuid' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID4
    RETURNS CSTRING(36) FREE_IT
    ENTRY_POINT 'uuid4' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUID4COMPR
    RETURNS CSTRING(22) FREE_IT
    ENTRY_POINT 'uuid4compr' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUIDCOMPR2UUID
    CSTRING(254)
    RETURNS CSTRING(36) FREE_IT
    ENTRY_POINT 'expanduuidcompr' MODULE_NAME 'FreeAdhocUDF';


DECLARE EXTERNAL FUNCTION F_UUIDVERSION
    CSTRING(254)
    RETURNS CSTRING(254) FREE_IT
    ENTRY_POINT 'uuidversion' MODULE_NAME 'FreeAdhocUDF';

/* adhoc 2006-12-03 */
