Skip to content

Commit

Permalink
add interbase folder for user defined function code
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed May 25, 2011
1 parent 83985ee commit 656c41e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Symmetric UDF for Firebird
--------------------------
This folder contains a user defined function (UDF) library that must be installed in the Firebird 2.0
Symmetric UDF for Interbase
----------------------------
This folder contains a user defined function (UDF) library that must be installed in the Interbase 9.0
database for SymmetricDS to work properly. It includes the sym_escape() and sym_hex() functions used
by the database triggers to escape strings and BLOBs.

Expand All @@ -10,11 +10,11 @@ The sym_udf library is copied to the UDF folder under the Firebird installation

For Linux users:

Copy sym_udf.so to /opt/firebird/UDF
Copy sym_udf.so to /opt/interbase/UDF

For Windows users:

Copy sym_udf.dll to C:\Program Files\Firebird\Firebird_2_1\UDF
Copy sym_udf.dll to C:\CodeGear\InterBase\UDF

When SymmetricDS starts up for the first time, it will enable the functions (using the
"create external function" command) and test that they are working.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

FIREBIRD_HOME=/opt/firebird
INTERBASE_HOME=/opt/interbase

gcc -I "$FIREBIRD_HOME"/include -c -O -fpic sym_udf.c
gcc -I "$INTERBASE_HOME"/include -c -O -fpic sym_udf.c
ld -G sym_udf.o -lm -lc -lib_util -o sym_udf.so
cp sym_udf.so "$FIREBIRD_HOME"/UDF/
cp sym_udf.so "$INTERBASE_HOME_HOME"/UDF/
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ char *sym_hex(BLOBCALLBACK blob)
bytes_left = blob->blob_total_length;
while (bytes_left > 0)
{
if (!blob->blob_get_segment(blob->blob_handle, (ISC_UCHAR *)result + total_bytes_read,
if (!blob->blob_get_segment(blob->blob_handle, (char *)result + total_bytes_read,
blob->blob_total_length, &bytes_read))
{
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@ static char backslash_chr = '\\';
static char quote_chr = '"';
static char *empty_str = "";

typedef struct blob {
short (*blob_get_segment) ();
void *blob_handle;
long blob_number_segments;
long blob_max_segment;
long blob_total_length;
void (*blob_put_segment) ();
} *BLOBCALLBACK;

char *sym_escape(char *str);
char *sym_hex(BLOBCALLBACK blob);
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sym_udf", "sym_udf.vcproj", "{418BA575-EDCE-4E3F-BAAA-A6B62118C900}"
Expand All @@ -9,8 +8,8 @@ Global
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{418BA575-EDCE-4E3F-BAAA-A6B62118C900}.Debug|Win32.ActiveCfg = Debug|Win32
{418BA575-EDCE-4E3F-BAAA-A6B62118C900}.Debug|Win32.Build.0 = Debug|Win32
{418BA575-EDCE-4E3F-BAAA-A6B62118C900}.Debug|Win32.ActiveCfg = Release|Win32
{418BA575-EDCE-4E3F-BAAA-A6B62118C900}.Debug|Win32.Build.0 = Release|Win32
{418BA575-EDCE-4E3F-BAAA-A6B62118C900}.Release|Win32.ActiveCfg = Release|Win32
{418BA575-EDCE-4E3F-BAAA-A6B62118C900}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ib_util_ms.lib fbclient_ms.lib"
AdditionalDependencies="ib_util_ms.lib"
ModuleDefinitionFile="sym_udf.def"
GenerateDebugInformation="true"
TargetMachine="1"
Expand Down Expand Up @@ -127,7 +127,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ib_util_ms.lib fbclient_ms.lib"
AdditionalDependencies="ib_util_ms.lib"
ModuleDefinitionFile="sym_udf.def"
GenerateDebugInformation="true"
OptimizeReferences="2"
Expand Down

0 comments on commit 656c41e

Please sign in to comment.