XmlRpcMethodValue * vortex_xml_rpc_method_value_new ( XmlRpcParamType  type,
axlPointer  value 

Allows to create a new XmlRpcMethodValue object from the given type and the given value.

You can use this function to create parameters to be added to method objects (XmlRpcMethodCall) using:

You can also skip this function and go directly to add the value being created by this function to the method call using:

This function returns a new XmlRpcMethodValue reference which should be unrefered using vortex_xml_rpc_method_value_free.

This function will not perform a local copy for the given value unless XML_RPC_STRING_VALUE is provided. In that case a local copy is made to enable the caller to unref the value provided just returing from this function.

This particular behavior is explained from the fact the other types like bool or int doesn't required to perform a local copy, and array and struct values are allocated through the provided interface creating a copy.

But, there is no way to figure out if the string value received was allocated on the heap or it is an stack activated value or simple an static string.

Here are some examples:

 XmlRpcMethodValue * value;

 // Create a method value representing an integer value
 value = vortex_xml_rpc_method_value_new (XML_RPC_INT_VALUE, 
 // free the value created 
 vortex_xml_rpc_method_value_free (value);

 // Create a method value representing an string 
 value = vortex_xml_rpc_method_value_new (XML_RPC_STRING_VALUE,
 // free the value created 
 vortex_xml_rpc_method_value_free (value);

type The type to be created.
value The value associated with the type being created
A new reference to XmlRpcMethodValue object or NULL if it fails. The function could only fail if the given value is NULL or the type provided is not a valid value found in the enumeration, not including XML_RPC_UNKNOWN_VALUE.