AEWaddtypesw
-install or replace a user defined buffer type at execution time
#include <atmi.h>
#include <tmtypes.h>
int FAR PASCAL AEWaddtypesw(TMTYPESW *newtype)
AEWaddtypesw
() is an "ATMI Extension for Windows" that allows a Windows task to install a new, or replace an existing user defined buffer type at execution time. The argument to this function is a pointer to a TMTYPESW
structure that contains the information for the buffer type to be installed.
If the type
and the subtype
match an existing buffer type already installed, then all the information is replaced with the new buffer type. If the information does not match the type
and the subtype
fields, then the new buffer type is added to the existing types registered with BEA TUXEDO system. For new buffer types, make sure that the WSH(1) and other BEA TUXEDO system processes involved in the call processing have been built with the new buffer type.
The function pointers in the TMTYPESW
array should be obtained by using the MakeProcInstance() function, and these functions should appear in the Module Definition file of the applications in the EXPORTS
section.
The application can also use the BEA TUXEDO system's defined buffer type routines like _dfltinitbuf
(), etc. The application and the BEA TUXEDO system's buffer routines can be intermixed in one user defined buffer type.
AEWaddtypesw
() returns the number of user buffer types in the system on success. AEWaddtypesw
() returns -1 on error and sets tperrno
to indicate the error condition.
Under the following condition, AEWaddtypesw
() fails and sets tperrno
to:
TPEINVAL
]
AEWaddtypesw
() was called and the type
parameter was NULL.
TPESYSTEM
]
This interface is supported only in Windows clients. The preferred way to install a type switch is to add it to the BEA TUXEDO system typeswitch DLL. Please refer to the BEA TUXEDO Administrators Guide for more information.
In the Windows 3.x 16 bit environment, the buffer type information is reset after tpterm
(3) is called by the application. FAR PASCAL is used only for the 16 bit Windows 3.x environment.
#include <windows.h>
#include <atmi.h>
#include <tmtypes.h>
int FAR PASCAL Nfinit(char FAR *, long);
int (FAR PASCAL * lpFinit)(char FAR *, long);
int FAR PASCAL Nfreinit(char FAR *, long);
int (FAR PASCAL * lpFreinit)(char FAR *, long);
int FAR PASCAL Nfuninit(char FAR *, long);
int (FAR PASCAL * lpFuninit)(char FAR *, long);
TMTYPESW newtype =
{
"MYFML", "", 1024, NULL, NULL,
NULL, _fpresend, _fpostsend, _fpostrecv, _fencdec,
_froute
};
lpFinit = MakeProcInstance(Nfinit, hInst);
lpFreinit = MakeProcInstance(Nfreinit, hInst);
lpFuninit = MakeProcInstance(Nfuninit, hInst);
newtype.initbuf = lpFinit;
newtype.reinitbuf = lpFreinit;
newtype.uninitbuf = lpFuninit;
if(AEWaddtypesw(newtype) == -1) {
userlog("AEWaddtypesw failed %s", tpstrerror(tperrno));
}
int
FAR PASCAL
Nfinit(char FAR *ptr, long len)
{
......
return(1);
}
int
FAR PASCAL
Nfreinit(char FAR *ptr, long len)
{
......
return(1);
}
int
FAR PASCAL
Nfuninit(char FAR *ptr, long mdlen)
{
......
return(1);
}
The application Module Definition File:
; EXAMPLE.DEF file
NAME EXAMPLE
DESCRIPTION 'EXAMPLE for Microsoft Windows'
EXETYPE WINDOWS
EXPORTS
Nfinit
Nfreinit
Nfuninit
....
buffer
(3), buildwsh
(1), typesw
(5)