Subject Re: [firebird-support] Mapping of libary names in UDF calls
Author Claus Heeg
Hi Boern,

I am doing at LINUX 8.2 FB151
DECLARE EXTERNAL FUNCTION ADD_USER
INTEGER,
CSTRING(256),
CSTRING(32),
CSTRING(9),
CSTRING(32),
CSTRING(32),
CSTRING(32),
CSTRING(32),
CSTRING(32),
CSTRING(9)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'fn_add_user' MODULE_NAME 'rfunc';
my rfunc lib resides here: /opt/firebird/UDF/rfunc
see:
insgesamt 109
drwxr-xr-x 2 root root 192 2004-08-03 17:16 ./
drwxr-xr-x 11 root root 568 2004-08-03 16:52 ../
-r-xr-xr-- 1 root root 14952 2004-07-14 18:45 fbudf.so*
-r--r--r-- 1 root root 6183 2004-07-14 18:45 fbudf.sql
-r-xr-xr-- 1 root root 8696 2004-07-14 18:45 ib_udf.so*
-r--r--r-- 1 root root 18201 2004-07-14 18:45 ib_udf.sql
-rwxr-xr-x 1 root root 52059 2004-08-03 17:16 rfunc*
/opt/firebird/UDF> cd ..
------------------------------------------------------------------------
runs well:
select power(101,10) from rdb$database : 1,1046221254112E20

Bjoern Reimer schrieb:

>Hi,
>
> I'm trying again to get rfunc UDF on working and I fear I don't
> understand the UDF things and Helen's book is at home under my
> bed....
>
> With the fb-UDF
>
>DECLARE EXTERNAL FUNCTION ASCII_CHAR
> INTEGER
>RETURNS CSTRING(1) FREE_IT
>ENTRY_POINT 'IB_UDF_ascii_char' MODULE_NAME 'ib_udf'
>
> works fine.
>
> In my UDF directory is a libary named ib_udf.so. Ok.
>
>
>DECLARE EXTERNAL FUNCTION LIBNAME
>RETURNS CSTRING(256) FREE_IT
>ENTRY_POINT 'fn_libname' MODULE_NAME 'rfunc'
>
> doesn't work.
> Ok, I renamed rfunc to rfunc.so
>
>SELECT LIBVERSION() FROM RDB$DATABASE;
>
> results in
>
>Unsuccessful execution caused by a system error that precludes
>successful execution of subsequent statements.
>Access to UDF library "librfunc.so" is denied by server administrator.
>
> Where did he get this name from?
>
> Ok, I can rename the lib in librfunc.so, but than I'm getting:
>
>Invalid token.
>invalid request BLR at offset 63.
>function LIBVERSION is not defined.
>module name or entrypoint could not be found.
>
>
> Ok, now the server finds the library. It's another error message
> than above, but why?
> What's wrong?
>
> Has anybody a working version of rfunc UDF with fb 1.5.1 on Linux?
>
>
>
> Björn
>
>
>