📄 wtx.html
字号:
at the end. <p></blockquote><h4>RETURNS</h4><blockquote><p>The last error code or <b>WTX_ERROR</b> if the handle is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./wtx.html#wtxErrMsgGet">wtxErrMsgGet</a></i>( )</b>, <b><i><a href="./wtx.html#wtxErrSet">wtxErrSet</a></i>( )</b>, <b><i><a href="./wtx.html#wtxErrClear">wtxErrClear</a></i>( )</b><hr><a name="wtxErrHandlerAdd"></a><p align=right><a href="rtnIndex.html"><i>WTX C Library : Routines</i></a></p></blockquote><h1><i>wtxErrHandlerAdd</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wtxErrHandlerAdd</i>( )</strong> - add an error handler for the WTX handle</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>WTX_HANDLER_T wtxErrHandlerAdd ( HWTX hWtx, /* WTX API handle */ WTX_HANDLER_FUNC pFunc, /* function to call on error */ void * pClientData /* data to pass function */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a new error handler to the list of registered handlersfor the handle <i>hWtx</i>. The last error handler added is the first onecalled when an error occurs. The function <i>pFunc</i> is called with threearguments, the handle on which the error occurred, the client data<i>pClientData</i>, and a call data parameter which is the error code. If thefunction returns the value TRUE then each previously registered handlerfunction is called in turn until all are called or one returns thevalue FALSE.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following is a sample error handler:<p><pre> BOOL32 errorHandler ( HWTX hWtx, /* WTX API handle */ void * pClientData, /* client data from wtxErrHandlerAdd() call */ void * errCode /* error code passed from wtxErrDispatch() */ ) { /* print an error message */ fprintf (stderr, "Error %s (%d) from server %s\n", wtxErrMsgGet (hWtx), (WTX_ERROR_T) errCode, /* or use wtxErrGet() */ wtxTsNameGet (hWtx)); /* return TRUE allowing previously installed handlers to be called */ return TRUE; }</pre></blockquote><h4>RETURNS</h4><blockquote><p>A new handler ID or NULL on failure.<p></blockquote><h4>ERRORS</h4><blockquote><p><p><dl><dt><b>WTX_ERR_API_MEMALLOC</b><dd> No memory is available to add the new handler.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./wtx.html#wtxErrHandlerRemove">wtxErrHandlerRemove</a></i>( )</b>, <b><i><a href="./wtx.html#wtxErrDispatch">wtxErrDispatch</a></i>( )</b><hr><a name="wtxErrHandlerRemove"></a><p align=right><a href="rtnIndex.html"><i>WTX C Library : Routines</i></a></p></blockquote><h1><i>wtxErrHandlerRemove</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wtxErrHandlerRemove</i>( )</strong> - remove an error handler from the WTX handle</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS wtxErrHandlerRemove ( HWTX hWtx, /* WTX API handle */ WTX_HANDLER_T errHandler /* Error handler to remove */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function removes the error handler referenced by <i>errHandler</i> from the handler list for <i>hWtx</i>. The error handler ID <i>errHandler</i> must be a valid error handler ID returned by a call of <b><i><a href="./wtx.html#wtxErrHandlerAdd">wtxErrHandlerAdd</a></i>( )</b>.<p></blockquote><h4>NOTE</h4><blockquote><p>It is safe for <b><i><a href="./wtx.html#wtxErrHandlerRemove">wtxErrHandlerRemove</a></i>( )</b> to be called from within anerror handler function, even if the call is to remove itself.<p></blockquote><h4>RETURNS</h4><blockquote><p><b>WTX_OK</b> or <b>WTX_ERROR</b>.<p></blockquote><h4>ERRORS</h4><blockquote><p><p><dl><dt><b>WTX_ERR_API_HANDLER_NOT_FOUND</b><dd> <i>errHandler</i> is not a valid handler ID.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./wtx.html#wtxErrHandlerAdd">wtxErrHandlerAdd</a></i>( )</b>, <b><i><a href="./wtx.html#wtxErrDispatch">wtxErrDispatch</a></i>( )</b><hr><a name="wtxErrDispatch"></a><p align=right><a href="rtnIndex.html"><i>WTX C Library : Routines</i></a></p></blockquote><h1><i>wtxErrDispatch</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wtxErrDispatch</i>( )</strong> - dispatch an error with supplied code for the given handle</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS wtxErrDispatch ( HWTX hWtx, /* WTX API handle */ WTX_ERROR_T errCode /* error code to register */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function records the error <i>errCode</i> against the handle <i>hWtx</i> and calls all the registered error handlers for it until one returns FALSE.<p></blockquote><h4>RETURNS</h4><blockquote><p><b>WTX_OK</b> or <b>WTX_ERROR</b> if the handle is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./wtx.html#wtxErrHandlerAdd">wtxErrHandlerAdd</a></i>( )</b><hr><a name="wtxErrMsgGet"></a><p align=right><a href="rtnIndex.html"><i>WTX C Library : Routines</i></a></p></blockquote><h1><i>wtxErrMsgGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wtxErrMsgGet</i>( )</strong> - fetch the last network WTX API error string</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>const char * wtxErrMsgGet ( HWTX hWtx /* WTX API handle */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets a meaningful string for the last WTX API callthat returned <b>WTX_ERROR</b>. The string is only valid after a WTXcall has returned an error.<p></blockquote><h4>NOTE</h4><blockquote><p>The return value is a pointer to internal data and mustnot be freed by the caller. Also the string is only valid untilthe next error occurs or <b><i><a href="./wtx.html#wtxErrClear">wtxErrClear</a></i>( )</b> is called. It mustbe copied by the caller if the value must be stored.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to a string or NULL if an error has occurred. <p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./wtx.html#wtxErrClear">wtxErrClear</a></i>( )</b>, <b><i><a href="./wtx.html#wtxErrGet">wtxErrGet</a></i>( )</b><hr><a name="wtxErrToMsg"></a><p align=right><a href="rtnIndex.html"><i>WTX C Library : Routines</i></a></p></blockquote><h1><i>wtxErrToMsg</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wtxErrToMsg</i>( )</strong> - convert an WTX error code to a descriptive string</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>const char * wtxErrToMsg ( HWTX hWtx, WTX_ERROR_T errCode )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine takes an error code which has been returned by a WTX APIcall and returns a descriptive string. The value returned is a pointerto a string in statically allocated memory. The string must be copied if the value is to be stored and it must not be freed by the caller.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to an error string.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtx.html#top">wtx</a></b><hr><a name="wtxErrClear"></a><p align=right><a href="rtnIndex.html"><i>WTX C Library : Routines</i></a></p></blockquote><h1><i>wtxErrClear</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wtxErrClear</i>( )</strong> - explicitly clear any error status for the tool</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS wtxErrClear ( HWTX hWtx /* WTX API handle */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine clears an error message already recorded. It can becalled before a WTX routine if you want to test for an error afterwardsby checking whether <b><i><a href="./wtx.html#wtxErrGet">wtxErrGet</a></i>( )</b> returns a non-zero value.<p></blockquote><h4>RETURNS</h4><blockquote><p><b>WTX_OK</b> or <b>WTX_ERROR</b>.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./wtx.html#wtxErrGet">wtxErrGet</a></i>( )</b>, <b><i><a href="./wtx.html#wtxErrMsgGet">wtxErrMsgGet</a></i>( )</b>, <b><i><a href="./wtx.html#wtxErrSet">wtxErrSet</a></i>( )</b><hr><a name="wtxErrExceptionFunc"></a><p align=right><a href="rtnIndex.html"><i>WTX C Library : Routines</i></a></p></blockquote><h1><i>wtxErrExceptionFunc</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wtxErrExceptionFunc</i>( )</strong> - a function to handle an error using <b><i><a href="../../vxworks/ref/ansiSetjmp.html#longjmp" >longjmp</a></i>( )</b></p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>BOOL32 wtxErrExceptionFunc ( HWTX hWtx, /* WTX API handle */ void * pClientData, /* pointer to a jump buffer */ void * pCallData /* error code to return via setjmp() */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is called as part of the error handling process shown in thediscussion of C++ style exception catching in the wtx library description(<i>WTX C Library</i>). The <b>WTX_TRY</b> macro, which registers the errorhandler <b><i><a href="./wtx.html#wtxErrExceptionFunc">wtxErrExceptionFunc</a></i>( )</b>, is found in <b>wtx.h</b>. <i>pClientData</i> containsthe address of <i>jumpBuf</i> from <b>WTX_TRY</b> and <i>pCallData</i> is the error code that is returned by <b>WTX_TRY</b> and should be cast to the type <b>WTX_ERROR_T</b>..<p></blockquote><h4>RETURNS</h4><blockquote><p>FALSE if <i>pClientData</i> is NULL, otherwise it does not return.It executes a <b><i><a href="../../vxworks/ref/ansiSetjmp.html#longjmp" >longjmp</a></i>( )</b> back to <i>jumpBuf</i> in the <b>WTX_TRY</b> macro, whichreturns the error code passed back by <i>pCallData</i>.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./wtx.html#wtxErrHandlerAdd">wtxErrHandlerAdd</a></i>( )</b>, <b><i><a href="./wtx.html#wtxErrDispatch">wtxErrDispatch</a></i>( )</b><hr><a name="wtxClientDataGet"></a><p align=right><a href="rtnIndex.html"><i>WTX C Library : Routines</i></a></p></blockquote><h1><i>wtxClientDataGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wtxClientDataGet</i>( )</strong> - get the client data associated with the WTX handle</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS wtxClientDataGet ( HWTX hWtx, /* WTX API handle */ void * * ppClientData /* RETURN: pointer to client data pointer */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the pointer pointed at by <i>ppClientData</i> to thevalue set by the last call to <b><i><a href="./wtx.html#wtxClientDataSet">wtxClientDataSet</a></i>( )</b> for the handle <i>hWtx</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p><b>WTX_OK</b> or <b>WTX_ERROR</b>.<p></blockquote><h4>ERRORS</h4><blockquote><p><p><dl><dt><b>WTX_ERR_API_INVALID_ARG</b><dd>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -