tuxedo 的 libtux.pas

libtux.pas

 

//
// This file was derived from the file
// tuxedo32.pas of BEA Systems Japan,
// that was changed to add fml32
// by Ricardo Temporal in may, 23th, year 2000.
//

{
Copyright (C) 1996-1997 BEA Systems Japan, Ltd. All rights reserved.

This code is copyrighted. Under the copyright laws, this code may not
be copied, in whole or part, without prior written consent of BEA
Systems Japan, Ltd.

BEA Systems Japan grants the right to use or reprint this code as long
as this ENTIRE copyright notice is reproduced in the code or reproduction.
The code is provided AS-IS, AND BEA SYSTEMS JAPAN DISCLAIMS ALL WARRANTIES,
EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN
NO EVENT WILL BEA SYSTEMS JAPAN BE LIABLE FOR ANY DAMAGES WHATSOEVER
(INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
LOSS) ARISING OUT OF THE USE OR INABILITY TO USE THIS CODE, EVEN
IF BEA SYSTEMS JAPAN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
BECAUSE SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF
LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE
LIMITATION MAY NOT APPLY TO YOU.


@author Kazuhisa Ichikawa (kaz.ichikawa@beasys.com)
}

unit libtux;

interface

const
  {Flags for service routines}
  TPNOBLOCK  = $00000001;
  TPSIGRSTRT = $00000002;
  TPNOREPLY  = $00000004;
  TPNOTRAN   = $00000008;
  TPTRAN     = $00000010;
  TPNOTIME   = $00000020;
  TPABSOLUTE = $00000040;
  TPGETANY   = $00000080;
  TPNOCHANGE = $00000100;
  TPCONV     = $00000400;
  TPSENDONLY = $00000800;
  TPRECVONLY = $00001000;
  TPACK      = $00002000;

  {Flags for tpreturn()}
  TPFAIL    = $00000001;
  TPSUCCESS = $00000002;
  TPEXIT    = $08000000;

  {Flags for tpscmt()}
  TP_CMT_LOGGED   = $01;
  TP_CMT_COMPLETE = $02;

  {Flags to tpinit()}
  TPU_MASK       = $00000007;
  TPU_SIG        = $00000001;
  TPU_DIP        = $00000002;
  TPU_IGN        = $00000004;
  TPSA_FASTPATH  = $00000008;
  TPSA_PROTECTED = $00000010;

  {Flags to tpconvert()}
  TPTOSTRING   = $40000000;
  TPCONVCLTID  = $00000001;
  TPCONVTRANID = $00000002;
  TPCONVXID    = $00000004;
  TPCONVMAXSTR = 256;

  {Return values of tpchkauth()}
  TPNOAUTH  = 0;
  TPSYSAUTH = 1;
  TPAPPAUTH = 2;

  {Misc}
  MAXTIDENT = 30;

  {Errors}
  TPEABORT      = 1;
  TPEBADDESC    = 2;
  TPEBLOCK      = 3;
  TPEINVAL      = 4;
  TPELIMIT      = 5;
  TPENOENT      = 6;
  TPEOS         = 7;
  TPEPERM       = 8;
  TPEPROTO      = 9;
  TPESVCERR     = 10;
  TPESVCFAIL    = 11;
  TPESYSTEM     = 12;
  TPETIME       = 13;
  TPETRAN       = 14;
  TPGOTSIG      = 15;
  TPERMERR      = 16;
  TPEITYPE      = 17;
  TPEOTYPE      = 18;
  TPERELEASE    = 19;
  TPEHAZARD     = 20;
  TPEHEURISTIC  = 21;
  TPEEVENT      = 22;
  TPEMATCH      = 23;
  TPEDIAGNOSTIC = 24;
  TPEMIB        = 25;

  { conversations - events }
  TPEV_DISCONIMM = $0001;
  TPEV_SVCERR    = $0002;
  TPEV_SVCFAIL   = $0004;
  TPEV_SVCSUCC   = $0008;
  TPEV_SENDONLY  = $0020;

type
  PPChar     = ^Pchar;
  PShortInt  = ^ShortInt;
  PLongInt   = ^LongInt;
  PInteger   = ^Integer;
  PSingle    = ^Single;
  PExtended  = ^Extended;
  TClientid = record
    Clientdata: array[1..4] of LongInt;
  end;
  PTClientid = ^TClientid;


{XATMI}

type
  TTpsvcinfo = record
    Name: array[0..31] of Char;
    Flags: LongInt;
    Data: PChar;
    Len: LongInt;
    Cd: Integer;
    Appkey: LongInt;
    Cltid: TClientid;
  end;
  PTTpsvcinfo = ^TTpsvcinfo;

function  tpacall       ( Svc, Data: PChar; Len, Flags: LongInt ): Integer; stdcall;
function  tpadvertise   ( Svcname: PChar; Tpsvcinfo: Pointer ): Integer; stdcall;
function  tpalloc       ( Maintype, Subtype: PChar; Size: LongInt ): Pointer; stdcall;
function  tpcall        ( Svc, Idata: PChar; Ilen: LongInt; Odata: PPChar; Olen: PLongInt; Flags:LongInt ): Integer; stdcall;
function  tpcancel      ( Cd: Integer ): Integer; stdcall;
function  tpconnect     ( Svc, Data: PChar; Len, Flags: LongInt ): Integer; stdcall;
function  tpdiscon      ( Cd: Integer ): Integer; stdcall;
procedure tpfree        ( Ptr: PChar ); stdcall;
function  tpgetrply     ( Cd: PInteger; Data: PPChar; Len: PLongInt; Flags: LongInt ): Integer; stdcall;
function  tprealloc     ( Ptr: PChar; Size: LongInt ): PChar; stdcall;
function  tprecv        ( Cd: Integer; Data: PPChar; Len: PLongInt; Flags: LongInt; Revent: PLongInt ): Integer; stdcall;
procedure tpreturn      ( Rval: Integer; Rcode: LongInt; Data: PChar; Len, Flags: LongInt ); stdcall;
function  tpsend        ( Cd: Integer; Data: PChar; Len, Flags: LongInt; Revent: PLongInt ): Integer; stdcall;
procedure tpservice     ( Svcinfo: PTTpsvcinfo ); stdcall;
function  tptypes       ( Ptr, Maintype, Subtype: PChar ): LongInt; stdcall;
function  tpunadvertise ( Svcname: PChar ): Integer; stdcall;

{ATMI}

type
  TTpinit = record
    Usrname: array[0..31] of Char;
    Cltname: array[0..31] of Char;
    Passwd:  array[0..31] of Char;
    Grpname: array[0..31] of Char;
    Flags: LongInt;
    Datalen: LongInt;
    Data: array[0..31] of Char; { OK, I admit that this is an ugly hack }
  end;
  TTpqctl = record
    Flags: LongInt;
    Deq_time: LongInt;
    Priority: LongInt;
    Diagnostic: LongInt;
    Msgid: array[0..31] of Char;
    Corrid: array[0..31] of Char;
    Replyqueue: array[0..16] of Char;
    Failurequeue: array[0..16] of Char;
    Cltid: TClientid;
    Urcode: LongInt;
    Appkey: LongInt;
  end;
  TTpevctl = record
    Flags: LongInt;
    Name1: array[0..31] of Char;
    Name2: array[0..31] of Char;
    Qctl: TTpqctl;
  end;
  TTptranid = record
    Info: array[0..5] of LongInt;
  end;
  PTTpinit   = ^TTpinit;
  PTTpqctl   = ^TTpqctl;
  PTTpevctl  = ^TTpevctl;
  PTTptranid = ^TTptranid;
  Unsolhandler = procedure ( Data: PChar; Len, Flags: LongInt ); stdcall;

function  tpabort       ( Flags: LongInt ): Integer; stdcall;
function  tpbegin       ( Timeout, Flags: LongInt ): Integer; stdcall;
function  tpbroadcast   ( Lmid, Usrname, Cltname, Data: PChar; Len, Flags: LongInt ): Integer; stdcall;
function  tpchkauth     : Integer; stdcall;
function  tpchkunsol    : Integer; stdcall;
function  tpcommit      ( Flags: LongInt ): Integer; stdcall;
function  tpdequeue     ( Qspace, Qname: PChar; Ctl: PTTpqctl; Data: PPChar; Len: PLongInt; Flags: LongInt ): Integer; stdcall;
function  tpenqueue     ( Qspace, Qname: PChar; Ctl: PTTpqctl; Data: PChar; Len, Flags: LongInt ): Integer; stdcall;
procedure tpforward     ( Svc, Data: PChar; Len, Flags: LongInt ); stdcall;
function  tpgetlev      : Integer; stdcall;
function  tpgprio       : Integer; stdcall;
function  tpinit        ( Tpinfo: PTTpinit ): Integer; stdcall;
function  tpnotify      ( Clientid: PTClientid; Data: PChar; Len, Flags: LongInt ): Integer; stdcall;
function  tppost        ( Eventname, Data: PChar; Len, Flags: LongInt ): Integer; stdcall;
function  tpresume      ( Tranid: PTTptranid; Flags: LongInt ): Integer; stdcall;
function  tpsetunsol    ( Disp: Unsolhandler ): Unsolhandler; stdcall;
function  tpsprio       ( Prio: Integer; Flags: LongInt ): Integer; stdcall;
function  tpstrerror    ( Err: Integer ): PChar; stdcall;
function  tpsubscribe   ( Eventexpr, Filter: PChar; Ctl: PTTpevctl; Flags: LongInt ): Integer; stdcall;
function  tpsuspend     ( Tranid: PTTptranid; Flags: LongInt ): Integer; stdcall;
procedure tpsvrdone     ; stdcall;
function  tpsvrinit     ( Argc: Integer; Argv: PPChar ): Integer; stdcall;
function  tpterm        : Integer; stdcall;
function  tpunsubscribe ( Subscription, Flags: LongInt ): Integer; stdcall;

{TX}

type
  Txid = record
    FormatID: LongInt;
    Gtrid_Length: LongInt;
    Bqual_length: LongInt;
    Data: array[0..127] of Char;
  end;
  TTxinfo = record
    XID: TXID;
    When_Return: LongInt;
    Tran_Control: LongInt;
    Tran_Timeout: LongInt;
    Tran_State: LongInt;
  end;
  COMMIT_RETURN       = LongInt;
  TRANSACTION_CONTROL = LongInt;
  TRANSACTION_TIMEOUT = LongInt;

function  tx_begin                   : Integer; stdcall;
function  tx_close                   : Integer; stdcall;
function  tx_commit                  : Integer; stdcall;
function  tx_info                    ( Info: Pointer ): Integer; stdcall;
function  tx_open                    : Integer; stdcall;
function  tx_rollback                : Integer; stdcall;
function  tx_set_commit_return       ( When_return: COMMIT_RETURN ): Integer; stdcall;
function  tx_set_transaction_control ( Control: TRANSACTION_CONTROL ): Integer; stdcall;
function  tx_set_transaction_timeout ( Timeout: TRANSACTION_TIMEOUT ): Integer; stdcall;

{FML}

type
  FLDIDD  = Word;
  FLDLEN = Word;
  FLDOCC = Smallint;
  TFbfr = record
    Magic: Integer;
    Len: FLDLEN;
    Maxlen: FLDLEN;
    Nie: FLDLEN;
    Indxintvl: FLDLEN;
    Val: array[0..7] of Byte;
  end;
  TFldidArray = array[0..99] of FLDIDD;
  PFLDIDD = ^FLDIDD;
  PFLDLEN = ^FLDLEN;
  PFLDOCC = ^FLDOCC;
  PTFbfr = ^TFbfr;
  PFldidArray = ^TFldidArray;


function  Fadd ( Fbfr: PTFbfr; Fieldid: FLDIDD; Value: Pointer; Len: FLDLEN ): Integer; stdcall;
function  Falloc ( F: FLDOCC; V:FLDLEN ): PTFbfr; stdcall;
function  Fchg ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC; Value: Pointer; Len: FLDLEN ): Integer; stdcall;
function  Fcmp ( Fbfr1, Fbfr2: PTFbfr ): Integer; stdcall;
function  Fcpy ( Dest, Src: PTFbfr ): Integer; stdcall;
function  Fdel ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC ): Integer; stdcall;
function  Fdelall ( Fbfr: PTFbfr; Fieldid: FLDIDD ): Integer; stdcall;
function  Fdelete ( Fbfr: PTFbfr; PFieldid: PFldidArray ): Integer; stdcall;
function  Ffind ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC; Len: PFLDLEN ): Pointer; stdcall;
function  Ffindlast ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: PFLDOCC; Len: PFLDLEN ): Pointer; stdcall;
function  Ffindocc ( Fbfr: PTFbfr; Fieldid: FLDIDD; Value: Pointer; Len: FLDLEN ): FLDOCC; stdcall;
function  Fget ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC; Value: Pointer; Maxlen: PFLDLEN ): Integer; stdcall;
function  Fgetalloc ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC; Extralen: PFLDLEN ): Pointer; stdcall;
function  Fgetlast ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: PFLDOCC; Value: Pointer; Maxlen: PFLDLEN ): Integer; stdcall;
function  Finit ( Fbfr: PTFbfr; Buflen: FLDLEN ): Integer; stdcall;
function  Fldid ( Name: PChar ): FLDIDD; stdcall;
function  Fldno ( Fieldid: FLDIDD ): Integer; stdcall;
function  Fldtype ( Fieldid: FLDIDD ): Integer; stdcall;
function  Fmkfldid ( Itype: Integer; Num: FLDIDD ): FLDIDD; stdcall;
function  Fmove ( Dest: PChar; Src: PTFbfr ): Integer; stdcall;
function  Fname ( Fieldid: FLDIDD ): PChar; stdcall;
function  Fneeded ( F: FLDOCC; V: FLDLEN ): LongInt; stdcall;
function  Ffree ( Fbfr: PTFbfr ): Integer; stdcall;
function  Fnext ( Fbfr: PTFbfr; Fieldid: PFLDIDD; Oc: PFLDOCC; Value: Pointer; Len: PFLDLEN ): Integer; stdcall;
function  Fnum ( Fbfr: PTFbfr ): FLDOCC; stdcall;
function  Foccur ( Fbfr: PTFbfr; Fieldid: FLDIDD ): FLDOCC; stdcall;
function  Fpres ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC ): Integer; stdcall;
function  Frealloc ( Fbfr: PTFbfr; Nf: FLDOCC; Nv: FLDLEN ): PTFbfr; stdcall;
function  Fsizeof ( Fbfr: PTFbfr ): LongInt; stdcall;
function  Ftype ( Fieldid: FLDIDD ): PChar; stdcall;
function  Funused ( Fbfr: PTFbfr ): LongInt; stdcall;
function  Fused ( Fbfr: PTFbfr ): LongInt; stdcall;
function  Fvall ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC ): LongInt; stdcall;
function  Fvals ( Fbfr: PTFbfr; FIeldid: FLDIDD; Oc: FLDOCC ): PChar; stdcall;
function  Fconcat ( Dest, Src: PTFbfr ): Integer; stdcall;
function  Fjoin ( Dest, Src: PTFbfr ): Integer; stdcall;
function  Fojoin ( Dest, Src: PTFbfr ): Integer; stdcall;
function  Fproj ( Fbfr: PTFbfr; Fieldid: PFldidArray ): Integer; stdcall;
function  Fprojcpy ( Dest, Src: PTFbfr; Fieldid: PFldidArray ): Integer; stdcall;
function  Fupdate ( Dest, Src: PTFbfr ): Integer; stdcall;
function  CFadd ( Fbfr: PTFbfr; Fieldid: FLDIDD; Value: PChar; Len: FLDLEN; Itype: Integer ): Integer; stdcall;
function  CFchg ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC; Value: PChar; Len: FLDLEN; Itype: Integer ): Integer; stdcall;
function  CFget ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC; Buf: PChar; Len: PFLDLEN; Itype: Integer ): Integer; stdcall;
function  CFgetalloc ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC; Itype: Integer; Extralen: PFLDLEN ): PChar; stdcall;
function  CFfind ( Fbfr: PTFbfr; Fieldid: FLDIDD; Oc: FLDOCC; Len: PFLDLEN; Itype: Integer ): PChar; stdcall;
function  CFfindocc ( Fbfr: PTFbfr; Fieldid: FLDIDD; Value: PChar; Len: FLDLEN; Itype: Integer ): Integer; stdcall;
function  Ftypcvt ( Tolen: PFLDLEN; Totype: Integer; Fromval: PChar; Fromtype: Integer; Fromlen: FLDLEN ): PChar; stdcall;
function  Fidxused ( Fbfr: PTFbfr ): Integer; stdcall;
function  Findex ( Fbfr: PTFbfr; Intvl: FLDOCC ): Integer; stdcall;
function  Frstrindex ( Fbfr: PTFbfr; Numidx: FLDOCC ): Integer; stdcall;
function  Funindex ( Fbfr: PTFbfr ): Integer; stdcall;
function  Fboolco ( Expression: PChar ): PChar; stdcall;
function  Fboolev ( Fbfr: PTFbfr; Tree: PChar ): Integer; stdcall;
function  Ffloatev ( Fbfr: PTFbfr; Tree: PChar ): Double; stdcall;
procedure Fidnm_unload; stdcall;
procedure Fnmid_unload; stdcall;
function  Fchksum ( Fbfr: PTFbfr ): LongInt; stdcall;
function  Fielded ( Fbfr: PTFbfr ): Integer; stdcall;
function  Fstrerror ( Err: Integer ): PChar; stdcall;

{FML32}

type
  FLDIDD32  = Cardinal;
  FLDLEN32 = Cardinal;
  FLDOCC32 = Integer;
  TFbfr32 = record
    Magic: Integer;
    Len: FLDLEN32;
    Maxlen: FLDLEN32;
    Nie: FLDLEN32;
    Indxintvl: FLDLEN32;
    Val: array[0..7] of Byte;
  end;
  TFldidArray32 = array[0..99] of FLDIDD32;
  PFLDIDD32 = ^FLDIDD32;
  PFLDLEN32 = ^FLDLEN32;
  PFLDOCC32 = ^FLDOCC32;
  PTFbfr32 = ^TFbfr32;
  PFldidArray32 = ^TFldidArray32;


function  Fadd32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Value: Pointer; Len: FLDLEN32 ): Integer; stdcall;
function  Falloc32(F: FLDOCC32; V:FLDLEN32 ): PTFbfr32; stdcall;
function  Fchg32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32; Value: Pointer; Len: FLDLEN32 ): Integer; stdcall;
function  Fcmp32(Fbfr1, Fbfr2: PTFbfr32 ): Integer; stdcall;
function  Fcpy32(Dest, Src: PTFbfr32 ): Integer; stdcall;
function  Fdel32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32 ): Integer; stdcall;
function  Fdelall32(Fbfr: PTFbfr32; Fieldid: FLDIDD32 ): Integer; stdcall;
function  Fdelete32(Fbfr: PTFbfr32; PFieldid: PFldidArray ): Integer; stdcall;
function  Ffind32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32; Len: PFLDLEN32 ): Pointer; stdcall;
function  Ffindlast32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: PFLDOCC32; Len: PFLDLEN32 ): Pointer; stdcall;
function  Ffindocc32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Value: Pointer; Len: FLDLEN32 ): FLDOCC32; stdcall;
function  Fget32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32; Value: Pointer; Maxlen: PFLDLEN32 ): Integer; stdcall;
function  Fgetalloc32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32; Extralen: PFLDLEN32 ): Pointer; stdcall;
function  Fgetlast32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: PFLDOCC32; Value: Pointer; Maxlen: PFLDLEN32 ): Integer; stdcall;
function  Finit32(Fbfr: PTFbfr32; Buflen: FLDLEN32 ): Integer; stdcall;
function  Fldid32(Name: PChar ): FLDIDD32; stdcall;
function  Fldno32(Fieldid: FLDIDD32 ): Integer; stdcall;
function  Fldtype32(Fieldid: FLDIDD32 ): Integer; stdcall;
function  Fmkfldid32(Itype: Integer; Num: FLDIDD32 ): FLDIDD32; stdcall;
function  Fmove32(Dest: PChar; Src: PTFbfr32 ): Integer; stdcall;
function  Fname32(Fieldid: FLDIDD32 ): PChar; stdcall;
function  Fneeded32(F: FLDOCC32; V: FLDLEN32 ): LongInt; stdcall;
function  Ffree32(Fbfr: PTFbfr32 ): Integer; stdcall;
function  Fnext32(Fbfr: PTFbfr32; Fieldid: PFLDIDD32; Oc: PFLDOCC32; Value: Pointer; Len: PFLDLEN32 ): Integer; stdcall;
function  Fnum32(Fbfr: PTFbfr32 ): FLDOCC32; stdcall;
function  Foccur32(Fbfr: PTFbfr32; Fieldid: FLDIDD32 ): FLDOCC32; stdcall;
function  Fpres32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32 ): Integer; stdcall;
function  Frealloc32(Fbfr: PTFbfr32; Nf: FLDOCC32; Nv: FLDLEN32 ): PTFbfr32; stdcall;
function  Fsizeof32(Fbfr: PTFbfr32 ): LongInt; stdcall;
function  Ftype32(Fieldid: FLDIDD32 ): PChar; stdcall;
function  Funused32(Fbfr: PTFbfr32 ): LongInt; stdcall;
function  Fused32(Fbfr: PTFbfr32 ): LongInt; stdcall;
function  Fvall32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32 ): LongInt; stdcall;
function  Fvals32(Fbfr: PTFbfr32; FIeldid: FLDIDD32; Oc: FLDOCC32 ): PChar; stdcall;
function  Fconcat32(Dest, Src: PTFbfr32 ): Integer; stdcall;
function  Fjoin32(Dest, Src: PTFbfr32 ): Integer; stdcall;
function  Fojoin32(Dest, Src: PTFbfr32 ): Integer; stdcall;
function  Fproj32(Fbfr: PTFbfr32; Fieldid: PFldidArray ): Integer; stdcall;
function  Fprojcpy32(Dest, Src: PTFbfr32; Fieldid: PFldidArray ): Integer; stdcall;
function  Fupdate32(Dest, Src: PTFbfr32 ): Integer; stdcall;
function  CFadd32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Value: PChar; Len: FLDLEN32; Itype: Integer ): Integer; stdcall;
function  CFchg32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32; Value: PChar; Len: FLDLEN32; Itype: Integer ): Integer; stdcall;
function  CFget32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32; Buf: PChar; Len: PFLDLEN32; Itype: Integer ): Integer; stdcall;
function  CFgetalloc32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32; Itype: Integer; Extralen: PFLDLEN32 ): PChar; stdcall;
function  CFfind32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Oc: FLDOCC32; Len: PFLDLEN32; Itype: Integer ): PChar; stdcall;
function  CFfindocc32(Fbfr: PTFbfr32; Fieldid: FLDIDD32; Value: PChar; Len: FLDLEN32; Itype: Integer ): Integer; stdcall;
function  Ftypcvt32(Tolen: PFLDLEN32; Totype: Integer; Fromval: PChar; Fromtype: Integer; Fromlen: FLDLEN32 ): PChar; stdcall;
function  Fidxused32(Fbfr: PTFbfr32 ): Integer; stdcall;
function  Findex32(Fbfr: PTFbfr32; Intvl: FLDOCC32 ): Integer; stdcall;
function  Frstrindex32(Fbfr: PTFbfr32; Numidx: FLDOCC32 ): Integer; stdcall;
function  Funindex32(Fbfr: PTFbfr32 ): Integer; stdcall;
function  Fboolco32(Expression: PChar ): PChar; stdcall;
function  Fboolev32(Fbfr: PTFbfr32; Tree: PChar ): Integer; stdcall;
function  Ffloatev32(Fbfr: PTFbfr32; Tree: PChar ): Double; stdcall;
procedure Fidnm_unload32; stdcall;
procedure Fnmid_unload32; stdcall;
function  Fchksum32(Fbfr: PTFbfr32 ): LongInt; stdcall;
function  Fielded32(Fbfr: PTFbfr32 ): Integer; stdcall;
function  Fstrerror32(Err: Integer ): PChar; stdcall;

{Miscellaneous}

type
  TNl_catd = record
    Catd_set: PChar;
    Catd_msgs: PChar;
    Catd_data: PChar;
    Catd_set_nr: Integer;
    Catd_type: Char;
  end;
  Nl_item = Integer;
  PTNl_catd = ^TNl_catd;

function  catgets     ( Catd: PTNl_catd; Set_num, Msg_num: Integer; S: PChar ): PChar; stdcall;
function  catopen     ( Name: PChar; Oflag: Integer ): PTNl_catd; stdcall;
function  catclose    ( Catd: PTNl_catd ): Integer; stdcall;
function  gettperrno  : Integer; stdcall;
function  nl_langinfo ( Item: Nl_item ): PChar; stdcall;
function  tuxgetenv   ( Name: PChar ): PChar; stdcall;
function  tuxputenv   ( Envstring: PChar ): Integer; stdcall;
function  tuxreadenv  ( Envfile, Envlabel: PChar ): Integer; stdcall;
function  userlog     ( Format: PChar ): Integer; stdcall;
{$IFDEF WS}
function  bq          ( Cmd: PChar ): Integer; stdcall;
function  setlocale   ( Category: Integer; Locale: PChar ): PChar; stdcall;
{$ENDIF}

{Others}

type
  TTm = record
    Tm_sec:   Integer;
    Tm_min:   Integer;
    Tm_hour:  Integer;
    Tm_mday:  Integer;
    Tm_mon:   Integer;
    Tm_year:  Integer;
    Tm_wday:  Integer;
    Tm_yday:  Integer;
    Tm_isdst: Integer;
  end;
  PTTm = ^TTm;

function  gp_mktime  ( Time: PTTm ): LongInt; stdcall;


implementation

{XATMI}

function  tpacall       ; stdcall ; external 'libtux.dll' name 'tpacall';
function  tpadvertise   ; stdcall ; external 'libtux.dll' name 'tpadvertise';
function  tpalloc       ; stdcall ; external 'libtux.dll' name 'tpalloc';
function  tpcall        ; stdcall ; external 'libtux.dll' name 'tpcall';
function  tpcancel      ; stdcall ; external 'libtux.dll' name 'tpcancel';
function  tpconnect     ; stdcall ; external 'libtux.dll' name 'tpconnect';
function  tpdiscon      ; stdcall ; external 'libtux.dll' name 'tpdiscon';
procedure tpfree        ; stdcall ; external 'libtux.dll' name 'tpfree';
function  tpgetrply     ; stdcall ; external 'libtux.dll' name 'tpgetrply';
function  tprealloc     ; stdcall ; external 'libtux.dll' name 'tprealloc';
function  tprecv        ; stdcall ; external 'libtux.dll' name 'tprecv';
procedure tpreturn      ; stdcall ; external 'libtux.dll' name 'tpreturn';
function  tpsend        ; stdcall ; external 'libtux.dll' name 'tpsend';
procedure tpservice     ; stdcall ; external 'libtux.dll' name 'tpservice';
function  tptypes       ; stdcall ; external 'libtux.dll' name 'tptypes';
function  tpunadvertise ; stdcall ; external 'libtux.dll' name 'tpunadvertise';

{ATMI}

function  tpabort       ; stdcall ; external 'libtux.dll' name 'tpabort';
function  tpbegin       ; stdcall ; external 'libtux.dll' name 'tpbegin';
function  tpbroadcast   ; stdcall ; external 'libtux.dll' name 'tpbroadcast';
function  tpchkauth     ; stdcall ; external 'libtux.dll' name 'tpchkauth';
function  tpchkunsol    ; stdcall ; external 'libtux.dll' name 'tpchkunsol';
function  tpcommit      ; stdcall ; external 'libtux.dll' name 'tpcommit';
function  tpdequeue     ; stdcall ; external 'libtux.dll' name 'tpdequeue';
function  tpenqueue     ; stdcall ; external 'libtux.dll' name 'tpenqueue';
procedure tpforward     ; stdcall ; external 'libtux.dll' name 'tpforward';
function  tpgetlev      ; stdcall ; external 'libtux.dll' name 'tpgetlev';
function  tpgprio       ; stdcall ; external 'libtux.dll' name 'tpgprio';
function  tpinit        ; stdcall ; external 'libtux.dll' name 'tpinit';
function  tpnotify      ; stdcall ; external 'libtux.dll' name 'tpnotify';
function  tppost        ; stdcall ; external 'libtux.dll' name 'tppost';
function  tpresume      ; stdcall ; external 'libtux.dll' name 'tpresume';
function  tpsetunsol    ; stdcall ; external 'libtux.dll' name 'tpsetunsol';
function  tpsprio       ; stdcall ; external 'libtux.dll' name 'tpsprio';
function  tpstrerror    ; stdcall ; external 'libtux.dll' name 'tpstrerror';
function  tpsubscribe   ; stdcall ; external 'libtux.dll' name 'tpsubscribe';
function  tpsuspend     ; stdcall ; external 'libtux.dll' name 'tpsuspend';
procedure tpsvrdone     ; stdcall ; external 'libtux.dll' name 'tpsvrdone';
function  tpsvrinit     ; stdcall ; external 'libtux.dll' name 'tpsvrinit';
function  tpterm        ; stdcall ; external 'libtux.dll' name 'tpterm';
function  tpunsubscribe ; stdcall ; external 'libtux.dll' name 'tpunsubscribe';

{TX}

function  tx_begin                   ; stdcall ; external 'libtux.dll' name 'tx_begin';
function  tx_close                   ; stdcall ; external 'libtux.dll' name 'tx_close';
function  tx_commit                  ; stdcall ; external 'libtux.dll' name 'tx_commit';
function  tx_info                    ; stdcall ; external 'libtux.dll' name 'tx_info';
function  tx_open                    ; stdcall ; external 'libtux.dll' name 'tx_open';
function  tx_rollback                ; stdcall ; external 'libtux.dll' name 'tx_rollback';
function  tx_set_commit_return       ; stdcall ; external 'libtux.dll' name 'tx_set_commit_return';
function  tx_set_transaction_control ; stdcall ; external 'libtux.dll' name 'tx_set_transaction_control';
function  tx_set_transaction_timeout ; stdcall ; external 'libtux.dll' name 'tx_set_transaction_timeout';

{FML}

function  Fadd         ; stdcall ; external 'libfml.dll' name 'Fadd';
function  Falloc       ; stdcall ; external 'libfml.dll' name 'Falloc';
function  Fchg         ; stdcall ; external 'libfml.dll' name 'Fchg';
function  Fcmp         ; stdcall ; external 'libfml.dll' name 'Fcmp';
function  Fcpy         ; stdcall ; external 'libfml.dll' name 'Fcpy';
function  Fdel         ; stdcall ; external 'libfml.dll' name 'Fdel';
function  Fdelall      ; stdcall ; external 'libfml.dll' name 'Fdelall';
function  Fdelete      ; stdcall ; external 'libfml.dll' name 'Fdelete';
function  Ffind        ; stdcall ; external 'libfml.dll' name 'Ffind';
function  Ffindlast    ; stdcall ; external 'libfml.dll' name 'Ffindlast';
function  Ffindocc     ; stdcall ; external 'libfml.dll' name 'Ffindocc';
function  Ffree        ; stdcall ; external 'libfml.dll' name 'Ffree';
function  Fget         ; stdcall ; external 'libfml.dll' name 'Fget';
function  Fgetalloc    ; stdcall ; external 'libfml.dll' name 'Fgetalloc';
function  Fgetlast     ; stdcall ; external 'libfml.dll' name 'Fgetlast';
function  Finit        ; stdcall ; external 'libfml.dll' name 'Finit';
function  Fldid        ; stdcall ; external 'libfml.dll' name 'Fldid';
function  Fldno        ; stdcall ; external 'libfml.dll' name 'Fldno';
function  Fldtype      ; stdcall ; external 'libfml.dll' name 'Fldtype';
function  Fmkfldid     ; stdcall ; external 'libfml.dll' name 'Fmkfldid';
function  Fmove        ; stdcall ; external 'libfml.dll' name 'Fmove';
function  Fname        ; stdcall ; external 'libfml.dll' name 'Fname';
function  Fneeded      ; stdcall ; external 'libfml.dll' name 'Fneeded';
function  Fnext        ; stdcall ; external 'libfml.dll' name 'Fnext';
function  Fnum         ; stdcall ; external 'libfml.dll' name 'Fnum';
function  Foccur       ; stdcall ; external 'libfml.dll' name 'Foccur';
function  Fpres        ; stdcall ; external 'libfml.dll' name 'Fpres';
function  Frealloc     ; stdcall ; external 'libfml.dll' name 'Frealloc';
function  Fsizeof      ; stdcall ; external 'libfml.dll' name 'Fsizeof';
function  Ftype        ; stdcall ; external 'libfml.dll' name 'Ftype';
function  Funused      ; stdcall ; external 'libfml.dll' name 'Funused';
function  Fused        ; stdcall ; external 'libfml.dll' name 'Fused';
function  Fvall        ; stdcall ; external 'libfml.dll' name 'Fvall';
function  Fvals        ; stdcall ; external 'libfml.dll' name 'Fvals';
function  Fconcat      ; stdcall ; external 'libfml.dll' name 'Fconcat';
function  Fjoin        ; stdcall ; external 'libfml.dll' name 'Fjoin';
function  Fojoin       ; stdcall ; external 'libfml.dll' name 'Fojoin';
function  Fproj        ; stdcall ; external 'libfml.dll' name 'Fproj';
function  Fprojcpy     ; stdcall ; external 'libfml.dll' name 'Fprojcpy';
function  Fupdate      ; stdcall ; external 'libfml.dll' name 'Fupdate';
function  CFadd        ; stdcall ; external 'libfml.dll' name 'CFadd';
function  CFchg        ; stdcall ; external 'libfml.dll' name 'CFchg';
function  CFget        ; stdcall ; external 'libfml.dll' name 'CFget';
function  CFgetalloc   ; stdcall ; external 'libfml.dll' name 'CFgetalloc';
function  CFfind       ; stdcall ; external 'libfml.dll' name 'CFfind';
function  CFfindocc    ; stdcall ; external 'libfml.dll' name 'CFfindocc';
function  Ftypcvt      ; stdcall ; external 'libfml.dll' name 'Ftypcvt';
function  Fidxused     ; stdcall ; external 'libfml.dll' name 'Fidxused';
function  Findex       ; stdcall ; external 'libfml.dll' name 'Findex';
function  Frstrindex   ; stdcall ; external 'libfml.dll' name 'Frstrindex';
function  Funindex     ; stdcall ; external 'libfml.dll' name 'Funindex';
function  Fboolco      ; stdcall ; external 'libfml.dll' name 'Fboolco';
function  Fboolev      ; stdcall ; external 'libfml.dll' name 'Fboolev';
function  Ffloatev     ; stdcall ; external 'libfml.dll' name 'Ffloatev';
procedure Fidnm_unload ; stdcall ; external 'libfml.dll' name 'Fidnm_unload';
procedure Fnmid_unload ; stdcall ; external 'libfml.dll' name 'Fnmid_unload';
function  Fchksum      ; stdcall ; external 'libfml.dll' name 'Fchksum';
function  Fielded      ; stdcall ; external 'libfml.dll' name 'Fielded';
function  Fstrerror    ; stdcall ; external 'libfml.dll' name 'Fstrerror';

{FML32}

function Fadd32         ; stdcall ; external 'libfml32.dll' name 'Fadd32';
function Falloc32       ; stdcall ; external 'libfml32.dll' name 'Falloc32';
function Fchg32         ; stdcall ; external 'libfml32.dll' name 'Fchg32';
function Fcmp32         ; stdcall ; external 'libfml32.dll' name 'Fcmp32';
function Fcpy32         ; stdcall ; external 'libfml32.dll' name 'Fcpy32';
function Fdel32         ; stdcall ; external 'libfml32.dll' name 'Fdel32';
function Fdelall32      ; stdcall ; external 'libfml32.dll' name 'Fdelall32';
function Fdelete32      ; stdcall ; external 'libfml32.dll' name 'Fdelete32';
function Ffind32        ; stdcall ; external 'libfml32.dll' name 'Ffind32';
function Ffindlast32    ; stdcall ; external 'libfml32.dll' name 'Ffindlast32';
function Ffindocc32     ; stdcall ; external 'libfml32.dll' name 'Ffindocc32';
function Ffree32        ; stdcall ; external 'libfml32.dll' name 'Ffree32';
function Fget32         ; stdcall ; external 'libfml32.dll' name 'Fget32';
function Fgetalloc32    ; stdcall ; external 'libfml32.dll' name 'Fgetalloc32';
function Fgetlast32     ; stdcall ; external 'libfml32.dll' name 'Fgetlast32';
function Finit32        ; stdcall ; external 'libfml32.dll' name 'Finit32';
function Fldid32        ; stdcall ; external 'libfml32.dll' name 'Fldid32';
function Fldno32        ; stdcall ; external 'libfml32.dll' name 'Fldno32';
function Fldtype32      ; stdcall ; external 'libfml32.dll' name 'Fldtype32';
function Fmkfldid32     ; stdcall ; external 'libfml32.dll' name 'Fmkfldid32';
function Fmove32        ; stdcall ; external 'libfml32.dll' name 'Fmove32';
function Fname32        ; stdcall ; external 'libfml32.dll' name 'Fname32';
function Fneeded32      ; stdcall ; external 'libfml32.dll' name 'Fneeded32';
function Fnext32        ; stdcall ; external 'libfml32.dll' name 'Fnext32';
function Fnum32         ; stdcall ; external 'libfml32.dll' name 'Fnum32';
function Foccur32       ; stdcall ; external 'libfml32.dll' name 'Foccur32';
function Fpres32        ; stdcall ; external 'libfml32.dll' name 'Fpres32';
function Frealloc32     ; stdcall ; external 'libfml32.dll' name 'Frealloc32';
function Fsizeof32      ; stdcall ; external 'libfml32.dll' name 'Fsizeof32';
function Ftype32        ; stdcall ; external 'libfml32.dll' name 'Ftype32';
function Funused32      ; stdcall ; external 'libfml32.dll' name 'Funused32';
function Fused32        ; stdcall ; external 'libfml32.dll' name 'Fused32';
function Fvall32        ; stdcall ; external 'libfml32.dll' name 'Fvall32';
function Fvals32        ; stdcall ; external 'libfml32.dll' name 'Fvals32';
function Fconcat32      ; stdcall ; external 'libfml32.dll' name 'Fconcat32';
function Fjoin32        ; stdcall ; external 'libfml32.dll' name 'Fjoin32';
function Fojoin32       ; stdcall ; external 'libfml32.dll' name 'Fojoin32';
function Fproj32        ; stdcall ; external 'libfml32.dll' name 'Fproj32';
function Fprojcpy32     ; stdcall ; external 'libfml32.dll' name 'Fprojcpy32';
function Fupdate32      ; stdcall ; external 'libfml32.dll' name 'Fupdate32';
function CFadd32        ; stdcall ; external 'libfml32.dll' name 'CFadd32';
function CFchg32        ; stdcall ; external 'libfml32.dll' name 'CFchg32';
function CFget32        ; stdcall ; external 'libfml32.dll' name 'CFget32';
function CFgetalloc32   ; stdcall ; external 'libfml32.dll' name 'CFgetalloc32';
function CFfind32       ; stdcall ; external 'libfml32.dll' name 'CFfind32';
function CFfindocc32    ; stdcall ; external 'libfml32.dll' name 'CFfindocc32';
function Ftypcvt32      ; stdcall ; external 'libfml32.dll' name 'Ftypcvt32';
function Fidxused32     ; stdcall ; external 'libfml32.dll' name 'Fidxused32';
function Findex32       ; stdcall ; external 'libfml32.dll' name 'Findex32';
function Frstrindex32   ; stdcall ; external 'libfml32.dll' name 'Frstrindex32';
function Funindex32     ; stdcall ; external 'libfml32.dll' name 'Funindex32';
function Fboolco32      ; stdcall ; external 'libfml32.dll' name 'Fboolco32';
function Fboolev32      ; stdcall ; external 'libfml32.dll' name 'Fboolev32';
function Ffloatev32     ; stdcall ; external 'libfml32.dll' name 'Ffloatev32';
procedure Fidnm_unload32; stdcall ; external 'libfml32.dll' name 'Fidnm_unload32';
procedure Fnmid_unload32; stdcall ; external 'libfml32.dll' name 'Fnmid_unload32';
function Fchksum32      ; stdcall ; external 'libfml32.dll' name 'Fchksum32';
function Fielded32      ; stdcall ; external 'libfml32.dll' name 'Fielded32';
function Fstrerror32    ; stdcall ; external 'libfml32.dll' name 'Fstrerror32';

{Miscellaneous}


function  catgets     ; stdcall ; external 'libgp.dll' name 'catgets';
function  catopen     ; stdcall ; external 'libgp.dll' name 'catopen';
function  catclose    ; stdcall ; external 'libgp.dll' name 'catclose';
function  gettperrno  ; stdcall ; external 'libtux.dll' name 'gettperrno';
function  nl_langinfo ; stdcall ; external 'libgp.dll' name 'nl_langinfo';
function  tuxgetenv   ; stdcall ; external 'libgp.dll' name 'tuxgetenv';
function  tuxputenv   ; stdcall ; external 'libgp.dll' name 'tuxputenv';
function  tuxreadenv  ; stdcall ; external 'libgp.dll' name 'tuxreadenv';
function  userlog     ; stdcall ; external 'libtux.dll' name 'userlog';
{$IFDEF WS}
function  bq          ; stdcall ; external 'wtuxws32' name 'bq';
function  setlocale   ; stdcall ; external 'wtuxws32' name 'setlocale';
{$ENDIF}

{Others}

function  gp_mktime   ; stdcall ; external 'libgp.dll' name 'gp_mktime';


end.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值