file: test.c=20
CODE:
=20
#include <stdio.h>=20
#include <stdlib.h>=20
#if TIME_WITH_SYS_TIME=20
# include <sys/time.h>=20
# include <time.h>=20
#else=20
# if HAVE_SYS_TIME_H=20
# include <sys/time.h>=20
# else=20
# include <time.h>=20
# endif=20
#endif=20
#include <string.h>=20
#include <math.h>=20
#include <ibase.h>=20
#include "example.h"=20
#include "ib_util.h"=20
#ifdef CPU386 /* Fast assembler version exists for 386/486 */=20
#pragma inline=20
#endif=20
char* TEST_replace(char *source, char *replace_this, char *replacement){=20
char *result =3D NULL;=20
result =3D (char *)ib_util_malloc(strlen(source)+1);=20
result=3Dstrcpy(result, source);=20
*(result+strlen(source))=3D'\0';=20
return result;=20
}=20
main(){=20
}=20
=20
File: test.def=20
Code:
IBRARY test=20
DESCRIPTION 'test.dll'=20
DATA READ WRITE=20
EXPORTS=20
TEST_replace =20
DECLARE:
DECLARE EXTERNAL FUNCTION REPLACEME=20
CSTRING(5000) CHARACTER SET NONE,=20
CSTRING(200) CHARACTER SET NONE,=20
CSTRING(200) CHARACTER SET NONE=20
RETURNS CSTRING(5000) FREE_IT=20
ENTRY_POINT 'TEST_replace' MODULE_NAME 'test'=20
gcc test.c -shared -fPIC -o test.so -I/opt/firebird/include
-I/opt/firebird/examples -I/opt/firebird/lib
UDF are written on C, has faced a problem.=20
Earlier compiled UDF worked under FireBird 1.5, on FireBird 2.0 - the bas=
e
falls.=20
Has altered malloc on ib_util_malloc with include ib_util.h compiled unde=
r
Windows=20
on VC 6.0 - works on FB 1.5 and FB 2.0=20
Now a problem under Linux and FreeBSD, UDF I compile: mistakes are not pr=
esent,
UDF does not work.=20
but if I try use:=20
on FireBird 1.5.3
opt/firebird/bin/fbguard: bin/fbserver terminated abnormally (127)=20
|