PutOptions

Ajoute les nouvelles propriétés d'option aux propriétés d'option actuelles.

Syntaxe

int putOptions(Message* message, MAP_STRING** context) 

Paramètres

  • Message - le message auquel cette fonction s'applique
  • La nouvelle carte d'option à ajouter aux propriétés d'option actuelles

Résultats

Renvoie 0 en cas de succès ou un code d'erreur.

Exemple

Version ASCII
MAP_STRING** mapping; 
Message* message; 
message = createMessage(); 
int nRet; 
mapping = (MAP_STRING **)malloc(3 * sizeof(MAP_STRING *)); 
mapping[0] = (MAP_STRING *)malloc( sizeof(MAP_STRING)); 
mapping[0]->key = "key1" ; 
mapping[0]->value = "value1" ; 
mapping[1] = (MAP_STRING *)malloc( sizeof(MAP_STRING)); 
mapping[1]->key = "key2" ; 
mapping[1]->value = "value2" ; 
mapping[2] = NULL; 
nRet = putOptions( message, mapping) ;
Version Unicode
MAP_STRING** mapping; 
Message* message; 
int nRet; 
UChar key1[32]; 
char* key1String="key1"; 
UChar value1[32]; 
char* value1String="value1"; 
u_charsToUChars(key1String,	key1,	strlen(key1String)); 
key1[ strlen(key1String)]=0; 
u_charsToUChars(value1String,	value1,	strlen(value1String)); 
value1[ strlen(value1String)]=0;
message = createMessage(); 
mapping = (MAP_STRING **)malloc(2 * sizeof(MAP_STRING *)); 
mapping[0] = (MAP_STRING *)malloc( sizeof(MAP_STRING)); 
mapping[0]->key = key1; 
mapping[0]->value = value1 ; 
mapping[1] = NULL; 
nRet = putOptions ( message, mapping) ;