Ver código fonte

* PChar -> PAnsiChar

Michaël Van Canneyt 2 anos atrás
pai
commit
25fe5694bf

+ 1 - 1
packages/postgres/examples/testpg1.pp

@@ -15,7 +15,7 @@ end;
 
 
 Var
-  pghost,pgport,pgoptions,pgtty,dbname : Pchar;
+  pghost,pgport,pgoptions,pgtty,dbname : PAnsiChar;
   nFields,i,j : longint;
   conn : PPGConn;
   res : PPGresult;

+ 2 - 2
packages/postgres/examples/testpg2.pp

@@ -15,11 +15,11 @@ end;
 
 
 Var
-  pghost,pgport,pgoptions,pgtty,dbname : Pchar;
+  pghost,pgport,pgoptions,pgtty,dbname : PAnsiChar;
   nFields,i : longint;
   conn : PPGConn;
   res : PPGresult;
-  dummy : string;
+  dummy : ansistring;
 
 begin
   pghost := NiL;        { host name of the backend server }

+ 62 - 62
packages/postgres/src/postgres.pp

@@ -40,7 +40,7 @@ type
      );
    PExecStatusType= ^TExecStatusType;
 {
-        extern const char  pgresStatus[];
+        extern const AnsiChar  pgresStatus[];
 }
 
 const
@@ -62,7 +62,7 @@ type
    PPQArgBlock= ^TPQArgBlock;
 
    TPGresAttDesc = record
-        name : Pchar;
+        name : PAnsiChar;
         adtid : Oid;
         adtsize : integer;
      end;
@@ -75,13 +75,13 @@ const
 type
    TPGresAttValue = record
         len : longint;
-        value : Pchar;
+        value : PAnsiChar;
      end;
    PPGresAttValue= ^TPGresAttValue;
    PPPGresAttValue= ^PPGresAttValue;
 
    TPGnotify = record
-        relname : array[0..(NAMEDATALEN)-1] of char;
+        relname : array[0..(NAMEDATALEN)-1] of AnsiChar;
         be_pid : longint;
      end;
    PPGnotify= ^TPGnotify;
@@ -99,24 +99,24 @@ type
    PPGlobjfuncs= ^TPGlobjfuncs;
 
    TPGconn = record
-        pghost : Pchar;
-        pgtty : Pchar;
-        pgport : Pchar;
-        pgoptions : Pchar;
-        dbName : Pchar;
+        pghost : PAnsiChar;
+        pgtty : PAnsiChar;
+        pgport : PAnsiChar;
+        pgoptions : PAnsiChar;
+        dbName : PAnsiChar;
         status : TConnStatusType;
-        errorMessage : array[0..(ERROR_MSG_LENGTH)-1] of char;
+        errorMessage : array[0..(ERROR_MSG_LENGTH)-1] of AnsiChar;
         Pfin : PFILE;
         Pfout : PFILE;
         Pfdebug : PFILE;
         sock : longint;
         laddr : TSockAddr;
         raddr : TSockAddr;
-        salt : array[0..(2)-1] of char;
+        salt : array[0..(2)-1] of AnsiChar;
         asyncNotifyWaiting : longint;
         notifyList : PDllist;
-        pguser : Pchar;
-        pgpass : Pchar;
+        pguser : PAnsiChar;
+        pgpass : PAnsiChar;
         lobjfuncs : PPGlobjfuncs;
      end;
    PPGconn= ^TPGconn;
@@ -132,13 +132,13 @@ type
         tuples : PPPGresAttValue;
         tupArrSize : longint;
         resultStatus : TExecStatusType;
-        cmdStatus : array[0..(CMDSTATUS_LEN)-1] of char;
+        cmdStatus : array[0..(CMDSTATUS_LEN)-1] of AnsiChar;
         binary : longint;
         conn : PPGconn;
      end;
    PPGresult= ^TPGresult;
 
-   pqbool = char;
+   pqbool = AnsiChar;
 
    TPQprintopt = record
         header : pqbool;
@@ -147,20 +147,20 @@ type
         html3 : pqbool;
         expanded : pqbool;
         pager : pqbool;
-        fieldSep : Pchar;
-        tableOpt : Pchar;
-        caption : Pchar;
+        fieldSep : PAnsiChar;
+        tableOpt : PAnsiChar;
+        caption : PAnsiChar;
      end;
    PPQprintopt= ^TPQprintopt;
 
 
    TPQconninfoOption = Record
-      keyword   : pchar;
-      environ   : pchar;
-      compiled  : pchar;
-      val       : pchar;
-      Thelabel  : pchar;
-      dispchar  : pchar;
+      keyword   : PAnsiChar;
+      environ   : PAnsiChar;
+      compiled  : PAnsiChar;
+      val       : PAnsiChar;
+      Thelabel  : PAnsiChar;
+      dispchar  : PAnsiChar;
       dispsize  : longint;
    end;
    PPQconninfoOption = ^TPQconninfoOption;
@@ -169,81 +169,81 @@ const
    MAX_MESSAGE_LEN = 8193;
    BYTELEN = 8;
    MAX_FIELDS = 512;
-   DefaultHost     : pchar = 'localhost';
-   DefaultTty      : pchar = '';
-   DefaultOption   : pchar = '';
-   DefaultAuthtype : pchar = '';
-   DefaultPassword : pchar = '';
+   DefaultHost     : PAnsiChar = 'localhost';
+   DefaultTty      : PAnsiChar = '';
+   DefaultOption   : PAnsiChar = '';
+   DefaultAuthtype : PAnsiChar = '';
+   DefaultPassword : PAnsiChar = '';
 
 type
    TTUPLE = pointer;
    PTUPLE = ^TTUPLE;
 
 
-  function  PQconnectdb(conninfo:Pchar):PPGconn;cdecl; external;
+  function  PQconnectdb(conninfo:PAnsiChar):PPGconn;cdecl; external;
   function  PQconndefaults:PPQconninfoOption;cdecl; external;
-  function  PQsetdbLogin(pghost,pgport,pgoptions,pgtty,dbName,login,pwd : pchar):PPGConn;cdecl;external;
+  function  PQsetdbLogin(pghost,pgport,pgoptions,pgtty,dbName,login,pwd : PAnsiChar):PPGConn;cdecl;external;
   procedure PQfinish(conn:PPGconn);cdecl; external;
   procedure PQreset(conn:PPGconn);cdecl; external;
-  function  PQdb(conn:PPGconn):Pchar;cdecl; external;
-  function  PQuser(conn:PPGconn):Pchar;cdecl; external;
-  function  PQhost(conn:PPGconn):Pchar;cdecl; external;
-  function  PQoptions(conn:PPGconn):Pchar;cdecl; external;
-  function  PQport(conn:PPGconn):Pchar;cdecl; external;
-  function  PQtty(conn:PPGconn):Pchar;cdecl; external;
+  function  PQdb(conn:PPGconn):PAnsiChar;cdecl; external;
+  function  PQuser(conn:PPGconn):PAnsiChar;cdecl; external;
+  function  PQhost(conn:PPGconn):PAnsiChar;cdecl; external;
+  function  PQoptions(conn:PPGconn):PAnsiChar;cdecl; external;
+  function  PQport(conn:PPGconn):PAnsiChar;cdecl; external;
+  function  PQtty(conn:PPGconn):PAnsiChar;cdecl; external;
   function  PQstatus(conn:PPGconn):TConnStatusType;cdecl; external;
-  function  PQerrorMessage(conn:PPGconn):Pchar;cdecl; external;
+  function  PQerrorMessage(conn:PPGconn):PAnsiChar;cdecl; external;
   procedure PQtrace(conn:PPGconn; debug_port:PFILE);cdecl; external;
   procedure PQuntrace(conn:PPGconn);cdecl; external;
-  function  PQexec(conn:PPGconn; query:Pchar):PPGresult;cdecl; external;
-  function  PQgetline(conn:PPGconn; str:Pchar; len:longint):longint;cdecl; external;
+  function  PQexec(conn:PPGconn; query:PAnsiChar):PPGresult;cdecl; external;
+  function  PQgetline(conn:PPGconn; str:PAnsiChar; len:longint):longint;cdecl; external;
   function  PQendcopy(conn:PPGconn):longint;cdecl; external;
-  function PQputline(conn:PPGconn; str:Pchar) : longint;cdecl; external;
+  function PQputline(conn:PPGconn; str:PAnsiChar) : longint;cdecl; external;
   function  PQresultStatus(res:PPGresult):TExecStatusType;cdecl; external;
   function  PQntuples(res:PPGresult):longint;cdecl; external;
   function  PQnfields(res:PPGresult):longint;cdecl; external;
-  function  PQfname(res:PPGresult; field_num:longint):Pchar;cdecl; external;
-  function  PQfnumber(res:PPGresult; field_name:Pchar):longint;cdecl; external;
+  function  PQfname(res:PPGresult; field_num:longint):PAnsiChar;cdecl; external;
+  function  PQfnumber(res:PPGresult; field_name:PAnsiChar):longint;cdecl; external;
   function  PQftype(res:PPGresult; field_num:longint):Oid;cdecl; external;
   function  PQfsize(res:PPGresult; field_num:longint):integer;cdecl; external;
-  function  PQcmdStatus(res:PPGresult):Pchar;cdecl; external;
-  function  PQgetvalue(res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl; external;
+  function  PQcmdStatus(res:PPGresult):PAnsiChar;cdecl; external;
+  function  PQgetvalue(res:PPGresult; tup_num:longint; field_num:longint):PAnsiChar;cdecl; external;
   function  PQgetlength(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl; external;
   function  PQgetisnull(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl; external;
   procedure PQclear(res:PPGresult);cdecl; external;
-  procedure PQdisplayTuples(res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:Pchar; printHeader:longint; quiet:longint);cdecl; external;
+  procedure PQdisplayTuples(res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:PAnsiChar; printHeader:longint; quiet:longint);cdecl; external;
   procedure PQprintTuples(res:PPGresult; fout:PFILE; printAttName:longint; terseOutput:longint; width:longint);cdecl; external;
   procedure PQprint(fout:PFILE; res:PPGresult; ps:PPQprintOpt);cdecl; external;
   function  PQnotifies(conn:PPGconn):PPGnotify;cdecl; external;
   function  PQfn(conn:PPGconn; fnid:longint; result_buf:Plongint; result_len:Plongint; result_is_int:longint; args:PPQArgBlock; nargs:longint):PPGresult;cdecl; external;
-  function  fe_getauthsvc(PQerrormsg:Pchar):MsgType;cdecl; external;
-  procedure fe_setauthsvc(name:Pchar; PQerrormsg:Pchar);cdecl; external;
-  function  fe_getauthname(PQerrormsg:Pchar):Pchar;cdecl; external;
-  function  pqGets(s:Pchar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqGetnchar(s:Pchar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqPutnchar(s:Pchar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqPuts(s:Pchar; stream:PFILE; debug:PFILE):longint;cdecl; external;
+  function  fe_getauthsvc(PQerrormsg:PAnsiChar):MsgType;cdecl; external;
+  procedure fe_setauthsvc(name:PAnsiChar; PQerrormsg:PAnsiChar);cdecl; external;
+  function  fe_getauthname(PQerrormsg:PAnsiChar):PAnsiChar;cdecl; external;
+  function  pqGets(s:PAnsiChar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
+  function  pqGetnchar(s:PAnsiChar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
+  function  pqPutnchar(s:PAnsiChar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
+  function  pqPuts(s:PAnsiChar; stream:PFILE; debug:PFILE):longint;cdecl; external;
   function  pqGetc(stream:PFILE; debug:PFILE):longint;cdecl; external;
   function  pqGetInt(result:Plongint; bytes:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
   function  pqPutInt(n:longint; bytes:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
   procedure pqFlush(stream:PFILE; debug:PFILE);cdecl; external;
-  function  PQoidStatus(res : PPGresult) : pchar;cdecl;external;
-  function  PQcmdTuples(res : PPGresult) : pchar;cdecl;external;
+  function  PQoidStatus(res : PPGresult) : PAnsiChar;cdecl;external;
+  function  PQcmdTuples(res : PPGresult) : PAnsiChar;cdecl;external;
   function  lo_open(conn:PPGconn; lobjId:Oid; mode:longint):longint; cdecl; external;
   function  lo_close(conn:PPGconn; fd:longint):longint; cdecl; external;
-  function  lo_read(conn:PPGconn; fd:longint; buf:Pchar; len:longint):longint; cdecl; external;
-  function  lo_write(conn:PPGconn; fd:longint; buf:Pchar; len:longint):longint; cdecl; external;
+  function  lo_read(conn:PPGconn; fd:longint; buf:PAnsiChar; len:longint):longint; cdecl; external;
+  function  lo_write(conn:PPGconn; fd:longint; buf:PAnsiChar; len:longint):longint; cdecl; external;
   function  lo_lseek(conn:PPGconn; fd:longint; offset:longint; whence:longint):longint; cdecl; external;
   function  lo_creat(conn:PPGconn; mode:longint):Oid;cdecl;external;
   function  lo_tell(conn:PPGconn; fd:longint):longint; cdecl; external;
   function  lo_unlink(conn:PPGconn; lobjId:Oid):longint; cdecl; external;
-  function  lo_import(conn:PPGconn; filename:Pchar):Oid;cdecl;external;
-  function  lo_export(conn:PPGconn; lobjId:Oid; filename:Pchar):longint; cdecl; external;
+  function  lo_import(conn:PPGconn; filename:PAnsiChar):Oid;cdecl;external;
+  function  lo_export(conn:PPGconn; lobjId:Oid; filename:PAnsiChar):longint; cdecl; external;
 
 {$ifdef PGSQL6_2_1}
-  Function  PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : pchar):PPGConn; cdecl;external;
+  Function  PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : PAnsiChar):PPGConn; cdecl;external;
 {$else}
-  function PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : pchar):PPGConn;
+  function PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : PAnsiChar):PPGConn;
 {$endif}
 
 implementation
@@ -258,7 +258,7 @@ implementation
 }
 
 {$ifndef PGSQL6_2_1}
-function PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : pchar):PPGConn;
+function PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : PAnsiChar):PPGConn;
 begin
  PQsetdb:=PQsetdbLogin(pghost,pgport,pgoptions,pgtty,dbName,nil,nil);
 end;

+ 46 - 46
packages/postgres/src/postgres3.pp

@@ -28,21 +28,21 @@ const
   { Asynchronous (non-blocking)  }
 (* Const before type ignored *)
 
-  function PQconnectStart(conninfo:Pchar):PPGconn;cdecl;external External_library name 'PQconnectStart';
+  function PQconnectStart(conninfo:PAnsiChar):PPGconn;cdecl;external External_library name 'PQconnectStart';
 
   function PQconnectPoll(conn:PPGconn):PostgresPollingStatusType;cdecl;external External_library name 'PQconnectPoll';
 
   { Synchronous (blocking)  }
 (* Const before type ignored *)
-  function PQconnectdb(conninfo:Pchar):PPGconn;cdecl;external External_library name 'PQconnectdb';
+  function PQconnectdb(conninfo:PAnsiChar):PPGconn;cdecl;external External_library name 'PQconnectdb';
 
-  function PQsetdbLogin(pghost:Pchar; pgport:Pchar; pgoptions:Pchar; pgtty:Pchar; dbName:Pchar;
-             login:Pchar; pwd:Pchar):PPGconn;cdecl;external External_library name 'PQsetdbLogin';
+  function PQsetdbLogin(pghost:PAnsiChar; pgport:PAnsiChar; pgoptions:PAnsiChar; pgtty:PAnsiChar; dbName:PAnsiChar;
+             login:PAnsiChar; pwd:PAnsiChar):PPGconn;cdecl;external External_library name 'PQsetdbLogin';
 
   { was #define dname(params) para_def_expr }
   { argument types are unknown }
   { return type might be wrong }
-  function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
+  function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : PAnsiChar) : ppgconn;
 
   { close the current connection and free the PGconn data structure  }
   procedure PQfinish(conn:PPGconn);cdecl;external External_library name 'PQfinish';
@@ -69,31 +69,31 @@ const
   function PQrequestCancel(conn:PPGconn):longint;cdecl;external External_library name 'PQrequestCancel';
 
   { Accessor functions for PGconn objects  }
-  function PQdb(conn:PPGconn):Pchar;cdecl;external External_library name 'PQdb';
+  function PQdb(conn:PPGconn):PAnsiChar;cdecl;external External_library name 'PQdb';
 
-  function PQuser(conn:PPGconn):Pchar;cdecl;external External_library name 'PQuser';
+  function PQuser(conn:PPGconn):PAnsiChar;cdecl;external External_library name 'PQuser';
 
-  function PQpass(conn:PPGconn):Pchar;cdecl;external External_library name 'PQpass';
+  function PQpass(conn:PPGconn):PAnsiChar;cdecl;external External_library name 'PQpass';
 
-  function PQhost(conn:PPGconn):Pchar;cdecl;external External_library name 'PQhost';
+  function PQhost(conn:PPGconn):PAnsiChar;cdecl;external External_library name 'PQhost';
 
-  function PQport(conn:PPGconn):Pchar;cdecl;external External_library name 'PQport';
+  function PQport(conn:PPGconn):PAnsiChar;cdecl;external External_library name 'PQport';
 
-  function PQtty(conn:PPGconn):Pchar;cdecl;external External_library name 'PQtty';
+  function PQtty(conn:PPGconn):PAnsiChar;cdecl;external External_library name 'PQtty';
 
-  function PQoptions(conn:PPGconn):Pchar;cdecl;external External_library name 'PQoptions';
+  function PQoptions(conn:PPGconn):PAnsiChar;cdecl;external External_library name 'PQoptions';
 
   function PQstatus(conn:PPGconn):TConnStatusType;cdecl;external External_library name 'PQstatus';
 
   function PQtransactionStatus(conn:PPGconn):PGTransactionStatusType;cdecl;external External_library name 'PQtransactionStatus';
 
-  function PQparameterStatus(conn:PPGconn; paramName:Pchar):Pchar;cdecl;external External_library name 'PQparameterStatus';
+  function PQparameterStatus(conn:PPGconn; paramName:PAnsiChar):PAnsiChar;cdecl;external External_library name 'PQparameterStatus';
 
   function PQprotocolVersion(conn:PPGconn):longint;cdecl;external External_library name 'PQprotocolVersion';
 
   function PQserverVersion(conn:PPGconn):longint;cdecl;external External_library name 'PQserverVersion';
 
-  function PQerrorMessage(conn:PPGconn):Pchar;cdecl;external External_library name 'PQerrorMessage';
+  function PQerrorMessage(conn:PPGconn):PAnsiChar;cdecl;external External_library name 'PQerrorMessage';
 
   function PQsocket(conn:PPGconn):longint;cdecl;external External_library name 'PQsocket';
 
@@ -101,7 +101,7 @@ const
 
   function PQclientEncoding(conn:PPGconn):longint;cdecl;external External_library name 'PQclientEncoding';
 
-  function PQsetClientEncoding(conn:PPGconn; encoding:Pchar):longint;cdecl;external External_library name 'PQsetClientEncoding';
+  function PQsetClientEncoding(conn:PPGconn; encoding:PAnsiChar):longint;cdecl;external External_library name 'PQsetClientEncoding';
 
 {$ifdef USE_SSL}
   { Get the SSL structure associated with a connection  }
@@ -119,21 +119,21 @@ const
 
   { === in fe-exec.c ===  }
   { Simple synchronous query  }
-  function PQexec(conn:PPGconn; query:Pchar):PPGresult;cdecl;external External_library name 'PQexec';
-  function PQexecParams(conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;
+  function PQexec(conn:PPGconn; query:PAnsiChar):PPGresult;cdecl;external External_library name 'PQexec';
+  function PQexecParams(conn:PPGconn; command:PAnsiChar; nParams:longint; paramTypes:POid; paramValues:PPAnsiChar;
              paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;external External_library name 'PQexecParams';
 
-  function PQexecPrepared(conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;
+  function PQexecPrepared(conn:PPGconn; stmtName:PAnsiChar; nParams:longint; paramValues:PPAnsiChar; paramLengths:Plongint;
              paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;external External_library name 'PQexecPrepared';
-  function PQdescribePrepared(conn:PPGconn; stmtName:Pchar):PPGresult;cdecl;external External_library name 'PQdescribePrepared';
+  function PQdescribePrepared(conn:PPGconn; stmtName:PAnsiChar):PPGresult;cdecl;external External_library name 'PQdescribePrepared';
 
   { Interface for multiple-result or asynchronous queries  }
-  function PQsendQuery(conn:PPGconn; query:Pchar):longint;cdecl;external External_library name 'PQsendQuery';
+  function PQsendQuery(conn:PPGconn; query:PAnsiChar):longint;cdecl;external External_library name 'PQsendQuery';
 
-  function PQsendQueryParams(conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;
+  function PQsendQueryParams(conn:PPGconn; command:PAnsiChar; nParams:longint; paramTypes:POid; paramValues:PPAnsiChar;
              paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):longint;cdecl;external External_library name 'PQsendQueryParams';
 
-  function PQsendQueryPrepared(conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;
+  function PQsendQueryPrepared(conn:PPGconn; stmtName:PAnsiChar; nParams:longint; paramValues:PPAnsiChar; paramLengths:Plongint;
              paramFormats:Plongint; resultFormat:longint):longint;cdecl;external External_library name 'PQsendQueryPrepared';
 
   function PQgetResult(conn:PPGconn):PPGresult;cdecl;external External_library name 'PQgetResult';
@@ -147,20 +147,20 @@ const
   function PQnotifies(conn:PPGconn):PPGnotify;cdecl;external External_library name 'PQnotifies';
 
   { Routines for copy in/out  }
-  function PQputCopyData(conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;external External_library name 'PQputCopyData';
+  function PQputCopyData(conn:PPGconn; buffer:PAnsiChar; nbytes:longint):longint;cdecl;external External_library name 'PQputCopyData';
 
-  function PQputCopyEnd(conn:PPGconn; errormsg:Pchar):longint;cdecl;external External_library name 'PQputCopyEnd';
+  function PQputCopyEnd(conn:PPGconn; errormsg:PAnsiChar):longint;cdecl;external External_library name 'PQputCopyEnd';
 
-  function PQgetCopyData(conn:PPGconn; buffer:PPchar; async:longint):longint;cdecl;external External_library name 'PQgetCopyData';
+  function PQgetCopyData(conn:PPGconn; buffer:PPAnsiChar; async:longint):longint;cdecl;external External_library name 'PQgetCopyData';
 
   { Deprecated routines for copy in/out  }
-  function PQgetline(conn:PPGconn; _string:Pchar; length:longint):longint;cdecl;external External_library name 'PQgetline';
+  function PQgetline(conn:PPGconn; _string:PAnsiChar; length:longint):longint;cdecl;external External_library name 'PQgetline';
 
-  function PQputline(conn:PPGconn; _string:Pchar):longint;cdecl;external External_library name 'PQputline';
+  function PQputline(conn:PPGconn; _string:PAnsiChar):longint;cdecl;external External_library name 'PQputline';
 
-  function PQgetlineAsync(conn:PPGconn; buffer:Pchar; bufsize:longint):longint;cdecl;external External_library name 'PQgetlineAsync';
+  function PQgetlineAsync(conn:PPGconn; buffer:PAnsiChar; bufsize:longint):longint;cdecl;external External_library name 'PQgetlineAsync';
 
-  function PQputnbytes(conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;external External_library name 'PQputnbytes';
+  function PQputnbytes(conn:PPGconn; buffer:PAnsiChar; nbytes:longint):longint;cdecl;external External_library name 'PQputnbytes';
 
   function PQendcopy(conn:PPGconn):longint;cdecl;external External_library name 'PQendcopy';
 
@@ -182,10 +182,10 @@ const
   { Accessor functions for PGresult objects  }
   function PQresultStatus(res:PPGresult):TExecStatusType;cdecl;external External_library name 'PQresultStatus';
 
-  function PQresStatus(status:TExecStatusType):Pchar;cdecl;external External_library name 'PQresStatus';
-  function PQresultErrorMessage(res:PPGresult):Pchar;cdecl;external External_library name 'PQresultErrorMessage';
+  function PQresStatus(status:TExecStatusType):PAnsiChar;cdecl;external External_library name 'PQresStatus';
+  function PQresultErrorMessage(res:PPGresult):PAnsiChar;cdecl;external External_library name 'PQresultErrorMessage';
 
-  function PQresultErrorField(res:PPGresult; fieldcode:longint):Pchar;cdecl;external External_library name 'PQresultErrorField';
+  function PQresultErrorField(res:PPGresult; fieldcode:longint):PAnsiChar;cdecl;external External_library name 'PQresultErrorField';
 
   function PQntuples(res:PPGresult):longint;cdecl;external External_library name 'PQntuples';
 
@@ -193,9 +193,9 @@ const
 
   function PQbinaryTuples(res:PPGresult):longint;cdecl;external External_library name 'PQbinaryTuples';
 
-  function PQfname(res:PPGresult; field_num:longint):Pchar;cdecl;external External_library name 'PQfname';
+  function PQfname(res:PPGresult; field_num:longint):PAnsiChar;cdecl;external External_library name 'PQfname';
 
-  function PQfnumber(res:PPGresult; field_name:Pchar):longint;cdecl;external External_library name 'PQfnumber';
+  function PQfnumber(res:PPGresult; field_name:PAnsiChar):longint;cdecl;external External_library name 'PQfnumber';
 
   function PQftable(res:PPGresult; field_num:longint):Oid;cdecl;external External_library name 'PQftable';
 
@@ -209,16 +209,16 @@ const
 
   function PQfmod(res:PPGresult; field_num:longint):longint;cdecl;external External_library name 'PQfmod';
 
-  function PQcmdStatus(res:PPGresult):Pchar;cdecl;external External_library name 'PQcmdStatus';
+  function PQcmdStatus(res:PPGresult):PAnsiChar;cdecl;external External_library name 'PQcmdStatus';
 
-  function PQoidStatus(res:PPGresult):Pchar;cdecl;external External_library name 'PQoidStatus';
+  function PQoidStatus(res:PPGresult):PAnsiChar;cdecl;external External_library name 'PQoidStatus';
 
   { old and ugly  }
   function PQoidValue(res:PPGresult):Oid;cdecl;external External_library name 'PQoidValue';
 
   { new and improved  }
-  function PQcmdTuples(res:PPGresult):Pchar;cdecl;external External_library name 'PQcmdTuples';
-  function PQgetvalue(res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl;external External_library name 'PQgetvalue';
+  function PQcmdTuples(res:PPGresult):PAnsiChar;cdecl;external External_library name 'PQcmdTuples';
+  function PQgetvalue(res:PPGresult; tup_num:longint; field_num:longint):PAnsiChar;cdecl;external External_library name 'PQgetvalue';
 
   function PQgetlength(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;external External_library name 'PQgetlength';
 
@@ -244,7 +244,7 @@ const
   function PQmakeEmptyPGresult(conn:PPGconn; status:TExecStatusType):PPGresult;cdecl;external External_library name 'PQmakeEmptyPGresult';
 
   { Quoting strings before inclusion in queries.  }
-  function PQescapeString(till:Pchar; from:Pchar; length:size_t):size_t;cdecl;external External_library name 'PQescapeString';
+  function PQescapeString(till:PAnsiChar; from:PAnsiChar; length:size_t):size_t;cdecl;external External_library name 'PQescapeString';
   function PQescapeBytea(bintext:Pbyte; binlen:size_t; bytealen:Psize_t):Pbyte;cdecl;external External_library name 'PQescapeBytea';
   function PQunescapeBytea(strtext:Pbyte; retbuflen:Psize_t):Pbyte;cdecl;external External_library name 'PQunescapeBytea';
 
@@ -260,7 +260,7 @@ const
   { pad the fields with spaces  }
   { field separator  }
   { display headers?  }
-  procedure PQdisplayTuples(res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:Pchar; printHeader:longint;
+  procedure PQdisplayTuples(res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:PAnsiChar; printHeader:longint;
               quiet:longint);cdecl;external External_library name 'PQdisplayTuples';
 
 (* Const before type ignored *)
@@ -277,9 +277,9 @@ const
 
   function lo_close(conn:PPGconn; fd:longint):longint;cdecl;external External_library name 'lo_close';
 
-  function lo_read(conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;external External_library name 'lo_read';
+  function lo_read(conn:PPGconn; fd:longint; buf:PAnsiChar; len:size_t):longint;cdecl;external External_library name 'lo_read';
 
-  function lo_write(conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;external External_library name 'lo_write';
+  function lo_write(conn:PPGconn; fd:longint; buf:PAnsiChar; len:size_t):longint;cdecl;external External_library name 'lo_write';
 
   function lo_lseek(conn:PPGconn; fd:longint; offset:longint; whence:longint):longint;cdecl;external External_library name 'lo_lseek';
 
@@ -289,12 +289,12 @@ const
 
   function lo_unlink(conn:PPGconn; lobjId:Oid):longint;cdecl;external External_library name 'lo_unlink';
 
-  function lo_import(conn:PPGconn; filename:Pchar):Oid;cdecl;external External_library name 'lo_import';
+  function lo_import(conn:PPGconn; filename:PAnsiChar):Oid;cdecl;external External_library name 'lo_import';
 
-  function lo_export(conn:PPGconn; lobjId:Oid; filename:Pchar):longint;cdecl;external External_library name 'lo_export';
+  function lo_export(conn:PPGconn; lobjId:Oid; filename:PAnsiChar):longint;cdecl;external External_library name 'lo_export';
 
   { === in fe-misc.c ===  }
-  { Determine length of multibyte encoded char at *s  }
+  { Determine length of multibyte encoded AnsiChar at *s  }
   function PQmblen(s:Pbyte; encoding:longint):longint;cdecl;external External_library name 'PQmblen';
 
   { Get encoding id from environment variable PGCLIENTENCODING  }
@@ -308,7 +308,7 @@ implementation
 
 // This function is also defined in postgres3dyn!
 
-  function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
+  function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : PAnsiChar) : ppgconn;
     begin
        PQsetdb:=PQsetdbLogin(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME,'','');
     end;

+ 46 - 46
packages/postgres/src/postgres3dyn.pp

@@ -44,12 +44,12 @@ var
 { make a new client connection to the backend  }
 { Asynchronous (non-blocking)  }
 (* Const before type ignored *)
-  PQconnectStart : function (conninfo:Pchar):PPGconn;cdecl;
+  PQconnectStart : function (conninfo:PAnsiChar):PPGconn;cdecl;
   PQconnectPoll : function (conn:PPGconn):PostgresPollingStatusType;cdecl;
 { Synchronous (blocking)  }
 (* Const before type ignored *)
-  PQconnectdb : function (conninfo:Pchar):PPGconn;cdecl;
-  PQsetdbLogin : function (pghost:Pchar; pgport:Pchar; pgoptions:Pchar; pgtty:Pchar; dbName:Pchar;login:Pchar; pwd:Pchar):PPGconn;cdecl;
+  PQconnectdb : function (conninfo:PAnsiChar):PPGconn;cdecl;
+  PQsetdbLogin : function (pghost:PAnsiChar; pgport:PAnsiChar; pgoptions:PAnsiChar; pgtty:PAnsiChar; dbName:PAnsiChar;login:PAnsiChar; pwd:PAnsiChar):PPGconn;cdecl;
 { was #define dname(params) para_def_expr }
 { argument types are unknown }
 { return type might be wrong }
@@ -71,23 +71,23 @@ var
 { issue a cancel request  }
   PQrequestCancel : function (conn:PPGconn):longint;cdecl;
 { Accessor functions for PGconn objects  }
-  PQdb : function (conn:PPGconn):Pchar;cdecl;
-  PQuser : function (conn:PPGconn):Pchar;cdecl;
-  PQpass : function (conn:PPGconn):Pchar;cdecl;
-  PQhost : function (conn:PPGconn):Pchar;cdecl;
-  PQport : function (conn:PPGconn):Pchar;cdecl;
-  PQtty : function (conn:PPGconn):Pchar;cdecl;
-  PQoptions : function (conn:PPGconn):Pchar;cdecl;
+  PQdb : function (conn:PPGconn):PAnsiChar;cdecl;
+  PQuser : function (conn:PPGconn):PAnsiChar;cdecl;
+  PQpass : function (conn:PPGconn):PAnsiChar;cdecl;
+  PQhost : function (conn:PPGconn):PAnsiChar;cdecl;
+  PQport : function (conn:PPGconn):PAnsiChar;cdecl;
+  PQtty : function (conn:PPGconn):PAnsiChar;cdecl;
+  PQoptions : function (conn:PPGconn):PAnsiChar;cdecl;
   PQstatus : function (conn:PPGconn):TConnStatusType;cdecl;
   PQtransactionStatus : function (conn:PPGconn):PGTransactionStatusType;cdecl;
-  PQparameterStatus : function (conn:PPGconn; paramName:Pchar):Pchar;cdecl;
+  PQparameterStatus : function (conn:PPGconn; paramName:PAnsiChar):PAnsiChar;cdecl;
   PQprotocolVersion : function (conn:PPGconn):longint;cdecl;
   PQserverVersion : function (conn:PPGconn):longint;cdecl;
-  PQerrorMessage : function (conn:PPGconn):Pchar;cdecl;
+  PQerrorMessage : function (conn:PPGconn):PAnsiChar;cdecl;
   PQsocket : function (conn:PPGconn):longint;cdecl;
   PQbackendPID : function (conn:PPGconn):longint;cdecl;
   PQclientEncoding : function (conn:PPGconn):longint;cdecl;
-  PQsetClientEncoding : function (conn:PPGconn; encoding:Pchar):longint;cdecl;
+  PQsetClientEncoding : function (conn:PPGconn; encoding:PAnsiChar):longint;cdecl;
 {$ifdef USE_SSL}
 { Get the SSL structure associated with a connection  }
   PQgetssl : function (conn:PPGconn):PSSL;cdecl;
@@ -102,15 +102,15 @@ var
   PQsetNoticeProcessor : function (conn:PPGconn; proc:PQnoticeProcessor; arg:pointer):PQnoticeProcessor;cdecl;
 { === in fe-exec.c ===  }
 { Simple synchronous query  }
-  PQexec : function (conn:PPGconn; query:Pchar):PPGresult;cdecl;
-  PQexecParams : function (conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;
-  PQexecPrepared : function (conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;
-  PQPrepare : function (conn:PPGconn; stmtName:Pchar; query:Pchar; nParams:longint; paramTypes:POid):PPGresult;cdecl;
-  PQdescribePrepared : function (conn:PPGconn; stmtName:Pchar):PPGresult;cdecl;
+  PQexec : function (conn:PPGconn; query:PAnsiChar):PPGresult;cdecl;
+  PQexecParams : function (conn:PPGconn; command:PAnsiChar; nParams:longint; paramTypes:POid; paramValues:PPAnsiChar;paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;
+  PQexecPrepared : function (conn:PPGconn; stmtName:PAnsiChar; nParams:longint; paramValues:PPAnsiChar; paramLengths:Plongint;paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;
+  PQPrepare : function (conn:PPGconn; stmtName:PAnsiChar; query:PAnsiChar; nParams:longint; paramTypes:POid):PPGresult;cdecl;
+  PQdescribePrepared : function (conn:PPGconn; stmtName:PAnsiChar):PPGresult;cdecl;
 { Interface for multiple-result or asynchronous queries  }
-  PQsendQuery : function (conn:PPGconn; query:Pchar):longint;cdecl;
-  PQsendQueryParams : function (conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):longint;cdecl;
-  PQsendQueryPrepared : function (conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;paramFormats:Plongint; resultFormat:longint):longint;cdecl;
+  PQsendQuery : function (conn:PPGconn; query:PAnsiChar):longint;cdecl;
+  PQsendQueryParams : function (conn:PPGconn; command:PAnsiChar; nParams:longint; paramTypes:POid; paramValues:PPAnsiChar;paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):longint;cdecl;
+  PQsendQueryPrepared : function (conn:PPGconn; stmtName:PAnsiChar; nParams:longint; paramValues:PPAnsiChar; paramLengths:Plongint;paramFormats:Plongint; resultFormat:longint):longint;cdecl;
   PQgetResult : function (conn:PPGconn):PPGresult;cdecl;
 { Routines for managing an asynchronous query  }
   PQisBusy : function (conn:PPGconn):longint;cdecl;
@@ -118,14 +118,14 @@ var
 { LISTEN/NOTIFY support  }
   PQnotifies : function (conn:PPGconn):PPGnotify;cdecl;
 { Routines for copy in/out  }
-  PQputCopyData : function (conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;
-  PQputCopyEnd : function (conn:PPGconn; errormsg:Pchar):longint;cdecl;
-  PQgetCopyData : function (conn:PPGconn; buffer:PPchar; async:longint):longint;cdecl;
+  PQputCopyData : function (conn:PPGconn; buffer:PAnsiChar; nbytes:longint):longint;cdecl;
+  PQputCopyEnd : function (conn:PPGconn; errormsg:PAnsiChar):longint;cdecl;
+  PQgetCopyData : function (conn:PPGconn; buffer:PPAnsiChar; async:longint):longint;cdecl;
 { Deprecated routines for copy in/out  }
-  PQgetline : function (conn:PPGconn; _string:Pchar; length:longint):longint;cdecl;
-  PQputline : function (conn:PPGconn; _string:Pchar):longint;cdecl;
-  PQgetlineAsync : function (conn:PPGconn; buffer:Pchar; bufsize:longint):longint;cdecl;
-  PQputnbytes : function (conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;
+  PQgetline : function (conn:PPGconn; _string:PAnsiChar; length:longint):longint;cdecl;
+  PQputline : function (conn:PPGconn; _string:PAnsiChar):longint;cdecl;
+  PQgetlineAsync : function (conn:PPGconn; buffer:PAnsiChar; bufsize:longint):longint;cdecl;
+  PQputnbytes : function (conn:PPGconn; buffer:PAnsiChar; nbytes:longint):longint;cdecl;
   PQendcopy : function (conn:PPGconn):longint;cdecl;
 { Set blocking/nonblocking connection to the backend  }
   PQsetnonblocking : function (conn:PPGconn; arg:longint):longint;cdecl;
@@ -141,27 +141,27 @@ var
   PQfn : function (conn:PPGconn; fnid:longint; result_buf:Plongint; result_len:Plongint; result_is_int:longint;args:PPQArgBlock; nargs:longint):PPGresult;cdecl;
 { Accessor functions for PGresult objects  }
   PQresultStatus : function (res:PPGresult):TExecStatusType;cdecl;
-  PQresStatus : function (status:TExecStatusType):Pchar;cdecl;
-  PQresultErrorMessage : function (res:PPGresult):Pchar;cdecl;
-  PQresultErrorField : function (res:PPGresult; fieldcode:longint):Pchar;cdecl;
+  PQresStatus : function (status:TExecStatusType):PAnsiChar;cdecl;
+  PQresultErrorMessage : function (res:PPGresult):PAnsiChar;cdecl;
+  PQresultErrorField : function (res:PPGresult; fieldcode:longint):PAnsiChar;cdecl;
   PQntuples : function (res:PPGresult):longint;cdecl;
   PQnfields : function (res:PPGresult):longint;cdecl;
   PQbinaryTuples : function (res:PPGresult):longint;cdecl;
-  PQfname : function (res:PPGresult; field_num:longint):Pchar;cdecl;
-  PQfnumber : function (res:PPGresult; field_name:Pchar):longint;cdecl;
+  PQfname : function (res:PPGresult; field_num:longint):PAnsiChar;cdecl;
+  PQfnumber : function (res:PPGresult; field_name:PAnsiChar):longint;cdecl;
   PQftable : function (res:PPGresult; field_num:longint):Oid;cdecl;
   PQftablecol : function (res:PPGresult; field_num:longint):longint;cdecl;
   PQfformat : function (res:PPGresult; field_num:longint):longint;cdecl;
   PQftype : function (res:PPGresult; field_num:longint):Oid;cdecl;
   PQfsize : function (res:PPGresult; field_num:longint):longint;cdecl;
   PQfmod : function (res:PPGresult; field_num:longint):longint;cdecl;
-  PQcmdStatus : function (res:PPGresult):Pchar;cdecl;
-  PQoidStatus : function (res:PPGresult):Pchar;cdecl;
+  PQcmdStatus : function (res:PPGresult):PAnsiChar;cdecl;
+  PQoidStatus : function (res:PPGresult):PAnsiChar;cdecl;
 { old and ugly  }
   PQoidValue : function (res:PPGresult):Oid;cdecl;
 { new and improved  }
-  PQcmdTuples : function (res:PPGresult):Pchar;cdecl;
-  PQgetvalue : function (res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl;
+  PQcmdTuples : function (res:PPGresult):PAnsiChar;cdecl;
+  PQgetvalue : function (res:PPGresult; tup_num:longint; field_num:longint):PAnsiChar;cdecl;
   PQgetlength : function (res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
   PQgetisnull : function (res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
   PQnparams : function (res:PPGresult):longint;cdecl;
@@ -188,7 +188,7 @@ var
   PQescapeByteaConn : function (conn:PPGconn; from:Pbyte; from_length:size_t; to_length:Psize_t):Pbyte;cdecl;
   PQunescapeBytea : function (strtext:Pbyte; retbuflen:Psize_t):Pbyte;cdecl;
 { These forms are deprecated! }
-  PQescapeString : function (till:Pchar; from:Pchar; length:size_t):size_t;cdecl;
+  PQescapeString : function (till:PAnsiChar; from:PAnsiChar; length:size_t):size_t;cdecl;
   PQescapeBytea : function (bintext:Pbyte; binlen:size_t; bytealen:Psize_t):Pbyte;cdecl;
 
 { === in fe-print.c ===  }
@@ -202,7 +202,7 @@ var
 { pad the fields with spaces  }
 { field separator  }
 { display headers?  }
-  PQdisplayTuples : procedure (res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:Pchar; printHeader:longint;quiet:longint);cdecl;
+  PQdisplayTuples : procedure (res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:PAnsiChar; printHeader:longint;quiet:longint);cdecl;
 (* Const before type ignored *)
 { output stream  }
 { print attribute names  }
@@ -214,18 +214,18 @@ var
 { Large-object access routines  }
   lo_open : function (conn:PPGconn; lobjId:Oid; mode:longint):longint;cdecl;
   lo_close : function (conn:PPGconn; fd:longint):longint;cdecl;
-  lo_read : function (conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;
-  lo_write : function (conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;
+  lo_read : function (conn:PPGconn; fd:longint; buf:PAnsiChar; len:size_t):longint;cdecl;
+  lo_write : function (conn:PPGconn; fd:longint; buf:PAnsiChar; len:size_t):longint;cdecl;
   lo_lseek : function (conn:PPGconn; fd:longint; offset:longint; whence:longint):longint;cdecl;
   lo_creat : function (conn:PPGconn; mode:longint):Oid;cdecl;
   lo_tell : function (conn:PPGconn; fd:longint):longint;cdecl;
   lo_truncate : function (conn:PPGconn; fd:longint; len:size_t):longint;cdecl;
   lo_unlink : function (conn:PPGconn; lobjId:Oid):longint;cdecl;
-  lo_import : function (conn:PPGconn; filename:Pchar):Oid;cdecl;
+  lo_import : function (conn:PPGconn; filename:PAnsiChar):Oid;cdecl;
   lo_import_with_oid : function (conn:PPGconn; filename:Pcchar; lobjId:Oid):Oid;cdecl;
-  lo_export : function (conn:PPGconn; lobjId:Oid; filename:Pchar):longint;cdecl;
+  lo_export : function (conn:PPGconn; lobjId:Oid; filename:PAnsiChar):longint;cdecl;
 { === in fe-misc.c ===  }
-{ Determine length of multibyte encoded char at *s  }
+{ Determine length of multibyte encoded AnsiChar at *s  }
   PQmblen : function (s:Pbyte; encoding:longint):longint;cdecl;
 { Get encoding id from environment variable PGCLIENTENCODING  }
   PQenv2encoding: function :longint;cdecl;
@@ -240,7 +240,7 @@ Function InitialisePostgres3(Const libpath : ansistring) : integer;
 Procedure InitialisePostgres3;
 Procedure ReleasePostgres3;
 
-function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
+function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : PAnsiChar) : ppgconn;
 
 var Postgres3LibraryHandle : TLibHandle= NilHandle;
   Postgres3LoadedLibrary : String = '';
@@ -432,7 +432,7 @@ begin
 end;
 
 // This function is also defined in postgres3!
-function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
+function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : PAnsiChar) : ppgconn;
 begin
    PQsetdb:=PQsetdbLogin(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME,'','');
 end;

+ 26 - 26
packages/postgres/src/postgres3types.inc

@@ -36,7 +36,7 @@ const
 Type
   TSockAddr = Array [1..112] of byte;
   TPGresAttDesc = record
-       name : Pchar;
+       name : PAnsiChar;
        adtid : Oid;
        adtsize : integer;
     end;
@@ -44,7 +44,7 @@ Type
   PPPGresAttDesc= ^PPGresAttDesc;
   TPGresAttValue = record
        len : longint;
-       value : Pchar;
+       value : PAnsiChar;
     end;
   PPGresAttValue= ^TPGresAttValue;
   PPPGresAttValue= ^PPGresAttValue;
@@ -75,24 +75,24 @@ Type
        CONNECTION_SSL_STARTUP,CONNECTION_NEEDED);
 
    TPGconn = record
-        pghost : Pchar;
-        pgtty : Pchar;
-        pgport : Pchar;
-        pgoptions : Pchar;
-        dbName : Pchar;
+        pghost : PAnsiChar;
+        pgtty : PAnsiChar;
+        pgport : PAnsiChar;
+        pgoptions : PAnsiChar;
+        dbName : PAnsiChar;
         status : TConnStatusType;
-        errorMessage : array[0..(ERROR_MSG_LENGTH)-1] of char;
+        errorMessage : array[0..(ERROR_MSG_LENGTH)-1] of AnsiChar;
         Pfin : PFILE;
         Pfout : PFILE;
         Pfdebug : PFILE;
         sock : longint;
         laddr : TSockAddr;
         raddr : TSockAddr;
-        salt : array[0..(2)-1] of char;
+        salt : array[0..(2)-1] of AnsiChar;
         asyncNotifyWaiting : longint;
         notifyList : PDllist;
-        pguser : Pchar;
-        pgpass : Pchar;
+        pguser : PAnsiChar;
+        pgpass : PAnsiChar;
         lobjfuncs : PPGlobjfuncs;
     end;
   PPGconn= ^TPGconn;
@@ -104,7 +104,7 @@ Type
         tuples : PPPGresAttValue;
         tupArrSize : longint;
         resultStatus : TExecStatusType;
-        cmdStatus : array[0..(CMDSTATUS_LEN)-1] of char;
+        cmdStatus : array[0..(CMDSTATUS_LEN)-1] of AnsiChar;
         binary : longint;
         conn : PPGconn;
     end;
@@ -129,17 +129,17 @@ Type
 
   PpgNotify = ^pgNotify;
   pgNotify = record
-          relname : Pchar;
+          relname : PAnsiChar;
           be_pid : longint;
-          extra : Pchar;
+          extra : PAnsiChar;
     end;
 
 { Function types for notice-handling callbacks  }
   PQnoticeReceiver = procedure (arg:pointer; res:PPGresult);cdecl;
-  PQnoticeProcessor = procedure (arg:pointer; message:Pchar);cdecl;
+  PQnoticeProcessor = procedure (arg:pointer; message:PAnsiChar);cdecl;
 { Print options for PQprint()  }
   Ppqbool = ^pqbool;
-  pqbool = char;
+  pqbool = AnsiChar;
 
   P_PQprintOpt = ^_PQprintOpt;
   _PQprintOpt = record
@@ -149,10 +149,10 @@ Type
           html3 : pqbool;
           expanded : pqbool;
           pager : pqbool;
-          fieldSep : Pchar;
-          tableOpt : Pchar;
-          caption : Pchar;
-          fieldName : ^Pchar;
+          fieldSep : PAnsiChar;
+          tableOpt : PAnsiChar;
+          caption : PAnsiChar;
+          fieldName : ^PAnsiChar;
     end;
   PQprintOpt = _PQprintOpt;
   PPQprintOpt = ^PQprintOpt;
@@ -168,12 +168,12 @@ Type
 
      P_PQconninfoOption = ^_PQconninfoOption;
      _PQconninfoOption = record
-          keyword : Pchar;
-          envvar : Pchar;
-          compiled : Pchar;
-          val : Pchar;
-          _label : Pchar;
-          dispchar : Pchar;
+          keyword : PAnsiChar;
+          envvar : PAnsiChar;
+          compiled : PAnsiChar;
+          val : PAnsiChar;
+          _label : PAnsiChar;
+          dispchar : PAnsiChar;
           dispsize : longint;
        end;
      PQconninfoOption = _PQconninfoOption;