TipcStrToDeliveryMode


Name

TipcStrToDeliveryMode — convert a string to a message delivery mode

Synopsis

T_BOOL TipcStrToDeliveryMode(delivery_mode_str, delivery_mode_return) 
T_STR delivery_mode_str; 
T_IPC_DELIVERY_MODE *delivery_mode_return; 

Arguments

delivery_mode_str — delivery mode string to convert

delivery_mode_return — storage for delivery mode

Return Values

TRUE if the string was successfully converted to a delivery mode, FALSE otherwise.

Diagnostics

If TipcStrToDeliveryMode fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcStrToDeliveryMode converts a string (such as best_effort) to a message delivery mode (such as T_IPC_DELIVERY_BEST_EFFORT). The string can be in any case. For example, all, ALL, and All are all converted to T_IPC_DELIVERY_ALL.

Caution

If TipcStrToDeliveryMode returns FALSE, it does not store a value in delivery_mode_return.

See Also

TipcDeliveryModeToStr

Examples

This example reads a string from standard input, converts it to a delivery mode, then sets the delivery mode of a message:

void read_delivery_mode(msg) 
T_IPC_MSG msg; 
{ 
  T_CHAR str[80]; 
  T_IPC_DELIVERY_MODE delivery_mode; 
 
  printf("Enter delivery mode: "); 
  fflush(stdout); 
 
  if (fgets(str, sizeof(str), stdin) == NULL) { 
    return;  /* error */ 
  }  
  if (strlen(str) > 0) { 
    str[strlen(str) - 1] = ’\0’; /* strip off newline */ 
  } 
 
  if (!TipcStrToDeliveryMode(str, &delivery_mode)) { 
    return;  /* error */ 
  }  
 
  if (!TipcMsgSetDeliveryMode(msg, delivery_mode)) { 
    return;  /* error */ 
  }  
 
} /* read_delivery_mode */ 

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