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 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, PTR_TO_INT(10)); // 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, "test"); // free the value created vortex_xml_rpc_method_value_free (value);