- some cleanups

- support for win32 (postgreSQL 8)
This commit is contained in:
joost 2005-02-04 18:16:29 +00:00
parent 4f21f8ea34
commit aac3df3cfb
2 changed files with 114 additions and 138 deletions

View File

@ -14,8 +14,14 @@ uses
{$PACKRECORDS C}
{$IFDEF Unix}
const
pqlib = 'libpq.so';
{$ENDIF}
{$IFDEF Win32}
const
pqlib = 'libpq.dll';
{$ENDIF}
{$i dllisttypes.inc}

View File

@ -14,10 +14,17 @@ interface
uses
dynlibs, SysUtils, dllistdyn;
{$PACKRECORDS C}
{$IFDEF Unix}
const
pqlib = 'libpq.so';
{$ENDIF}
{$IFDEF Win32}
const
pqlib = 'libpq.dll';
{$ENDIF}
{$PACKRECORDS C}
{$i postgres3types.inc}
@ -201,25 +208,6 @@ var
{ Get encoding id from environment variable PGCLIENTENCODING }
PQenv2encoding: function :longint;cdecl;
{ PQexec : function (conn:PPGconn; query:Pchar):PPGresult;cdecl;
PQsetdbLogin : function (pghost:Pchar; pgport:Pchar; pgoptions:Pchar; pgtty:Pchar; dbName:Pchar;
login:Pchar; pwd:Pchar):PPGconn;cdecl;
PQerrorMessage : function (conn:PPGconn):Pchar;cdecl;
PQclear : procedure (res:PPGresult);cdecl;
PQresultStatus : function (res:PPGresult):TExecStatusType;cdecl;
PQconnectdb : function (conninfo:Pchar):PPGconn;cdecl;
PQfinish : procedure (conn:PPGconn);cdecl;
PQstatus : function (conn:PPGconn):TConnStatusType;cdecl;
PQgetvalue : function (res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl;
PQfmod : function (res:PPGresult; field_num:longint):longint;cdecl;
PQgetlength : function (res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
PQntuples : function(res:PPGresult):longint;cdecl;
PQnfields : function(res:PPGresult):longint;cdecl;
PQgetisnull : function(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
PQfsize : function (res:PPGresult; field_num:longint):longint;cdecl;
PQftype : function (res:PPGresult; field_num:longint):Oid;cdecl;
PQfname : function (res:PPGresult; field_num:longint):Pchar;cdecl;
}
Procedure InitialisePostgres3;
Procedure ReleasePostgres3;
@ -343,24 +331,6 @@ begin
pointer(PQmblen) := GetProcedureAddress(Postgres3LibraryHandle,'PQmblen');
pointer(PQenv2encoding) := GetProcedureAddress(Postgres3LibraryHandle,'PQenv2encoding');
{ pointer(PQexec) := GetProcedureAddress(Postgres3LibraryHandle,'PQexec');
pointer(PQsetdbLogin) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetdbLogin');
pointer(PQerrorMessage) := GetProcedureAddress(Postgres3LibraryHandle,'PQerrorMessage');
pointer(PQclear) := GetProcedureAddress(Postgres3LibraryHandle,'PQclear');
pointer(PQresultStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQresultStatus');
pointer(PQconnectdb) := GetProcedureAddress(Postgres3LibraryHandle,'PQconnectdb');
pointer(PQfinish) := GetProcedureAddress(Postgres3LibraryHandle,'PQfinish');
pointer(PQstatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQstatus');
pointer(PQgetvalue) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetvalue');
pointer(PQfmod) := GetProcedureAddress(Postgres3LibraryHandle,'PQfmod');
pointer(PQgetlength) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetlength');
pointer(PQntuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQnfields');
pointer(PQnfields) := GetProcedureAddress(Postgres3LibraryHandle,'PQnfields');
pointer(PQgetisnull) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetisnull');
pointer(PQfsize) := GetProcedureAddress(Postgres3LibraryHandle,'PQfsize');
pointer(PQftype) := GetProcedureAddress(Postgres3LibraryHandle,'PQftype');
pointer(PQfname) := GetProcedureAddress(Postgres3LibraryHandle,'PQfname');}
InitialiseDllist;
end;
end;