📄 ib_intf.pas
字号:
option :OPT;
info_buffer : Pointer;
buf_len : Cardinal): MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_get',IB_INSTALL_DLL]));
end;
function isc_install_get_message_stub(hOption: OPTIONS_HANDLE;
message_no: MSG_NO;
message_txt: Pointer;
message_len: Cardinal):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_get_message',IB_INSTALL_DLL]));
end;
function isc_install_load_external_text_stub(msg_file_name: TEXT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_load_external_text',IB_INSTALL_DLL]));
end;
function isc_install_precheck_stub(hOption: OPTIONS_HANDLE;
src_dir: TEXT;
dest_dir: TEXT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_precheck',IB_INSTALL_DLL]));
end;
function isc_install_set_option_stub(hOption: POPTIONS_HANDLE;
option: OPT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_set_option',IB_INSTALL_DLL]));
end;
function isc_uninstall_execute_stub(uninstall_file_name: TEXT;
status_func: FP_STATUS;
status_data: pointer;
error_func: FP_ERROR;
error_data: pointer):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_uninstall_execute',IB_INSTALL_DLL]));
end;
function isc_uninstall_precheck_stub(uninstall_file_name: TEXT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_uninstall_precheck',IB_INSTALL_DLL]));
end;
function isc_install_unset_option_stub(hOption: POPTIONS_HANDLE;
option: OPT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_unset_option',IB_INSTALL_DLL]));
end;
{$UNDEF FP_STDCALL}
procedure LoadIBInstallLibrary;
{$IFDEF WINDOWS}
function GetProcAddr(ProcName: PChar): Pointer;
begin
Result := GetProcAddress(IBInstallLibrary, ProcName);
if not Assigned(Result) then
{$IFNDEF D6+}
RaiseLastWin32Error;
{$ELSE}
RaiseLastOSError
{$ENDIF}
end;
{$ENDIF}
{$IFDEF LINUX}
function GetProcAddr(ProcName : PChar) : Pointer;
begin
Result := dlsym(IBInstallLibrary, ProcName);
end;
{$ENDIF}
begin
{$IFDEF WINDOWS}
IBInstallLibrary := LoadLibrary(PChar(IB_INSTALL_DLL));
if (IBInstallLibrary > HINSTANCE_ERROR) then
{$ENDIF}
{$IFDEF LINUX}
IBInstallLibrary := dlopen(PChar(IB_INSTALL_DLL), 0);
if (IBInstallLibrary <> nil) then
{$ENDIF}
begin
isc_install_clear_options := GetProcAddr('isc_install_clear_options');
isc_install_execute := GetProcAddr('isc_install_execute');
isc_install_get_info := GetProcAddr('isc_install_get_info');
isc_install_get_message := GetProcAddr('isc_install_get_message');
isc_install_load_external_text := GetProcAddr('isc_install_load_external_text');
isc_install_precheck := GetProcAddr('isc_install_precheck');
isc_install_set_option := GetProcAddr('isc_install_set_option');
isc_uninstall_execute := GetProcAddr('isc_uninstall_execute');
isc_uninstall_precheck := GetProcAddr('isc_uninstall_precheck');
isc_install_unset_option := GetProcAddr('isc_install_unset_option');
end
else
begin
isc_install_clear_options := isc_install_clear_options_stub;
isc_install_execute := isc_install_execute_stub;
isc_install_get_info := isc_install_get_info_stub;
isc_install_get_message := isc_install_get_message_stub;
isc_install_load_external_text := isc_install_load_external_text_stub;
isc_install_precheck := isc_install_precheck_stub;
isc_install_set_option := isc_install_set_option_stub;
isc_uninstall_execute := isc_uninstall_execute_stub;
isc_uninstall_precheck := isc_uninstall_precheck_stub;
isc_install_unset_option := isc_install_unset_option_stub;
end;
{$IFDEF WINDOWS}
InitFPU
{$ENDIF}
end;
procedure FreeIBInstallLibrary;
begin
{$IFDEF WINDOWS}
if IBInstallLibrary > HINSTANCE_ERROR then
begin
FreeLibrary(IBInstallLibrary);
IBInstallLibrary := 0;
end;
{$ENDIF}
{$IFDEF LINUX}
if IBInstallLibrary <> nil then
begin
dlclose(IBInstallLibrary);
IBInstallLibrary := nil;
end;
{$ENDIF}
end;
procedure CheckIBInstallLoaded;
begin
{$IFDEF WINDOWS}
if (IBInstallLibrary <= HINSTANCE_ERROR) then
LoadIBInstallLibrary;
if (IBInstallLibrary <= HINSTANCE_ERROR) then
{$ENDIF}
{$IFDEF LINUX}
if (IBInstallLibrary = nil) then
LoadIBInstallLibrary;
if (IBInstallLibrary = nil) then
{$ENDIF}
raise
EAPICallException.Create(Format(SCantLoadLibrary,[IB_INSTALL_DLL]));
end;
{ TIBClientLibrary }
function TIBClientLibrary.BLOB_get(isc_arg1: PBSTREAM): Int;
begin
if Assigned(FBLOB_get) then
Result:= FBLOB_get(isc_arg1)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['BLOB_get',FLibraryName]));
end;
function TIBClientLibrary.BLOB_put(isc_arg1: char;
isc_arg2: PBSTREAM): Int;
begin
if Assigned(FBLOB_put) then
Result:= FBLOB_put(isc_arg1,isc_arg2)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['BLOB_put',FLibraryName]));
end;
function TIBClientLibrary.GetIBClientVersion: Integer;
begin
Result := FIBClientVersion
end;
function TIBClientLibrary.GetIBClientMinorVersion: Integer;
begin
Result := FIBClientMinorVersion
end;
function TIBClientLibrary.GetLibName: string;
begin
Result:=FLibraryName
end;
function TIBClientLibrary.isc_array_get_slice(status_vector: PISC_STATUS;
db_handle: PISC_DB_HANDLE; trans_handle: PISC_TR_HANDLE;
array_id: PISC_QUAD; descriptor: PISC_ARRAY_DESC; dest_array: PVoid;
slice_length: ISC_LONG): ISC_STATUS;
begin
if Assigned(Fisc_array_get_slice) then
Result:=
Fisc_array_get_slice(
status_vector, db_handle,trans_handle,array_id,descriptor,dest_array,slice_length
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_get_slice',FLibraryName]));
end;
function TIBClientLibrary.isc_array_lookup_bounds(
status_vector: PISC_STATUS; db_handle: PISC_DB_HANDLE;
trans_handle: PISC_TR_HANDLE; table_name, column_name: PChar;
descriptor: PISC_ARRAY_DESC): ISC_STATUS;
begin
if Assigned(Fisc_array_lookup_bounds) then
Result:=
Fisc_array_lookup_bounds(
status_vector, db_handle,trans_handle, table_name, column_name,descriptor
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_lookup_bounds',FLibraryName]));
end;
function TIBClientLibrary.isc_array_lookup_desc(status_vector: PISC_STATUS;
db_handle: PISC_DB_HANDLE; trans_handle: PISC_TR_HANDLE; table_name,
column_name: PChar; descriptor: PISC_ARRAY_DESC): ISC_STATUS;
begin
if Assigned(Fisc_array_lookup_desc) then
Result:=
Fisc_array_lookup_desc(
status_vector, db_handle,trans_handle, table_name, column_name,descriptor
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_lookup_desc',FLibraryName]));
end;
function TIBClientLibrary.isc_array_put_slice(status_vector: PISC_STATUS;
db_handle: PISC_DB_HANDLE; trans_handle: PISC_TR_HANDLE;
array_id: PISC_QUAD; descriptor: PISC_ARRAY_DESC; source_array: PVoid;
slice_length: PISC_LONG): ISC_STATUS;
begin
if Assigned(Fisc_array_put_slice) then
Result:=
Fisc_array_put_slice(
status_vector, db_handle,trans_handle, array_id,descriptor,source_array, slice_length
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_put_slice',FLibraryName]));
end;
function TIBClientLibrary.isc_array_set_desc(status_vector: PISC_STATUS;
table_name, column_name: PChar; sql_dtype, sql_length,
sql_dimensions: PShort; descriptor: PISC_ARRAY_DESC): ISC_STATUS;
begin
if Assigned(Fisc_array_set_desc) then
Result:=
Fisc_array_set_desc(
status_vector, table_name, column_name,sql_dtype, sql_length, sql_dimensions,descriptor
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_set_desc',FLibraryName]));
end;
function TIBClientLibrary.isc_attach_database(status_vector: PISC_STATUS;
db_name_length: Short; db_name: PChar; db_handle: PISC_DB_HANDLE;
parm_buffer_length: Short; parm_buffer: PChar): ISC_STATUS;
begin
FBusy:=True;
try
Result:=
Fisc_attach_database(status_vector, db_name_length,db_name,db_handle, parm_buffer_length, parm_buffer)
finally
FBusy:=False;
end
end;
function TIBClientLibrary.isc_blob_info(status_vector: PISC_STATUS;
blob_handle: PISC_BLOB_HANDLE; item_list_buffer_length: Short;
item_list_buffer: PChar; result_buffer_length: Short;
result_buffer: PChar): ISC_STATUS;
begin
FBusy:=True;
try
Result:=
Fisc_blob_info(status_vector, blob_handle,item_list_buffer_length,
item_list_buffer,result_buffer_length,
result_buffer
)
finally
FBusy:=False;
end
end;
function TIBClientLibrary.isc_blob_lookup_desc(status_vector: PISC_STATUS;
db_handle: PISC_DB_HANDLE; trans_handle: PISC_TR_HANDLE; table_name,
column_name: PChar; descriptor: PISC_BLOB_DESC;
global: PUChar): ISC_STATUS;
begin
FBusy:=True;
try
Result:=
Fisc_blob_lookup_desc(status_vector, db_handle,trans_handle,table_name,
column_name,descriptor, global
)
finally
FBusy:=False;
end
end;
function TIBClientLibrary.isc_blob_set_desc(status_vector: PISC_STATUS;
table_name, column_name: PChar; subtype, charset, segment_size: Short;
descriptor: PISC_BLOB_DESC): ISC_STATUS;
begin
FBusy:=True;
try
Result:=
Fisc_blob_set_desc(
status_vector, table_name, column_name,subtype, charset, segment_size, descriptor
)
finally
FBusy:=False;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -