ATMI C Function Reference
AEMsetblockinghook()
—Establishes an application-specific blocking hook function.
#include <atmi.h>
int AEMsetblockinghook(_TM_FARPROC)
AEMsetblockinghook()
is an "ATMI Extension for Mac" that allows a Mac task to install a new function which the ATMI networking software uses to implement blocking ATMI calls. It takes a pointer to the procedure instance address of the blocking function to be installed.
A default function, by which blocking ATMI calls are handled, is included. The function AEMsetblockinghook()
gives the application the ability to execute its own function at "blocking" time in place of the default function. If called with a NULL pointer, the blocking hook function is reset to the default function.
When an application invokes a blocking ATMI operation, the operation is initiated and then a loop is entered which is equivalent to the following pseudocode:
for(;;) {
execute operation in non-blocking mode
if error
break;
if operation complete
break;
while(BlockingHook())
;
}
AEMsetblockinghook()
returns a pointer to the procedure-instance of the previously installed blocking function. The application or library that calls the AEMsetblockinghook()
function should save this return value so that it can be restored if necessary. (If "nesting" is not important, the application may simply discard the value returned by AEMsetblockinghook()
and eventually use AEMsetblockinghook
(NULL) to restore the default mechanism.) AEMsetblockinghook()
returns NULL on error and sets tperrno
to indicate the error condition.
Under failure, AEMsetblockinghook()
sets tperrno
to the following value:
This interface is supported only in Mac clients.
The blocking function is reset after tpterm(3c)
is called by the application.