Synopsis:
result=msg_setname(name)
Arguments:
name - The name to associate with the calling task
Description: This function sets a name to associate with the calling task for use in calls to msg_send(). Note that msg_send() can use either the Telecom Engine Task ID or this name after this call has been made. The name used must be a unique name and an error will be generated if more than one task try to use the same task name.
The task name must begin with a non-numeric character, since calls to msg_send() with a task_id/name starting with a numerical character will be assumed to be passing the task ID rather than the name.
The maximum length of the task name is 32 characters. IF more characters than this are given for the task name then it will be truncated.
For example
// This sets the name for the calling task to "resource_handler"
x=msg_setname("resource_handler");
Now other tasks can send messages to the task that made the above call using the task name, e.g.
// Send a message to the task whose name was set to "resource_handler"
msg_send("resource_handler","GET");
Returns: Returns 0 if successfull or -1 if the task name already exists