TutErrNumSet


Name

TutErrNumSet — set the value of the global SmartSockets error number

Synopsis

void TutErrNumSet(err_num) 
T_INT4 err_num; 

Arguments

err_num — the value to which the global SmartSockets error number should be set

Return Values

None

Diagnostics

None

Description

The SmartSockets error number is similar to the C-style error number errno. A function that returns a failure status (FALSE or NULL) often needs to provide more information when an error occurs. TutErrNumSet is used to set the global SmartSockets error number. One common use for this function is to set the error number to 0 before calling an API function that may set the error number. It may also be used in user code to provide additional error information to other user-defined code. The value of the error number is not used in SmartSockets internal code, so it does not have an effect on SmartSockets processing.

Caution

When TutErrNumSet is called, the previous value of the error number is overwritten.

See Also

TutErrNumGet

Examples

This example sets the error number if the argument is invalid:

T_BOOL return_data(T_PTR data_ptr) 
{ 
  if (data_ptr == NULL) { 
    TutErrNumSet(T_ERR_NULL_PTR); 
    return FALSE; 
  } 
  ... 
} /* return_data */ 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com