caction.h File Reference

#include <cybergarage/typedef.h>
#include <cybergarage/xml/cxml.h>
#include <cybergarage/util/clist.h>
#include <cybergarage/util/cstring.h>
#include <cybergarage/upnp/cargument.h>
#include <cybergarage/upnp/cupnp_status.h>

Data Structures

struct  _CgUpnpAction

Defines

#define CG_UPNP_ACTION_ELEM_NAME   "action"
#define CG_UPNP_ACTIONLIST_ELEM_NAME   "actionList"
#define CG_UPNP_ACTION_NAME   "name"
#define cg_upnp_action_next(action)   (CgUpnpAction *)cg_list_next((CgList *)action)
#define cg_upnp_action_isactionnode(node)   cg_xml_node_isname(node, CG_UPNP_ACTION_ELEM_NAME)
#define cg_upnp_action_getactionnode(action)   (action->actionNode)
#define cg_upnp_action_setservice(action, service)   (action->parentService = service)
#define cg_upnp_action_getservice(action)   ((CgUpnpService *)action->parentService)
#define cg_upnp_action_setname(action, value)   cg_xml_node_setchildnode(cg_upnp_action_getactionnode(action), CG_UPNP_ACTION_NAME, value)
#define cg_upnp_action_getname(action)   cg_xml_node_getchildnodevalue(cg_upnp_action_getactionnode(action), CG_UPNP_ACTION_NAME)
#define cg_upnp_action_isname(action, name)   cg_streq(cg_upnp_action_getname(action), name)
#define cg_upnp_action_getargumentlist(action)   (action->argumentList)
#define cg_upnp_action_getarguments(action)   ((CgUpnpArgument *)cg_list_next((CgList *)action->argumentList))
#define cg_upnp_action_hasargumentbyname(action, name)   ((cg_upnp_action_getargumentbyname(action,name) != NULL) ? TRUE : FALSE)
#define cg_upnp_action_setstatuscode(action, code)   cg_upnp_status_setcode(action->upnpStatus, code)
#define cg_upnp_action_getstatuscode(action)   cg_upnp_status_getcode(action->upnpStatus)
#define cg_upnp_action_setstatusdescription(action, value)   cg_upnp_status_setdescription(action->upnpStatus, value)
#define cg_upnp_action_getstatusdescription(action)   cg_upnp_status_getdescription(action->upnpStatus)
#define cg_upnp_action_setlistener(action, func)   (action->listener = func)
#define cg_upnp_action_getlistener(action)   (action->listener)
#define cg_upnp_action_setlistner   cg_upnp_action_setlistener
#define cg_upnp_action_getlistner   cg_upnp_action_getlistener
#define cg_upnp_action_setuserdata(action, value)   (action->userData = value)
#define cg_upnp_action_getuserdata(action)   (action->userData)
#define cg_upnp_actionlist_clear(actionList)   cg_list_clear((CgList *)actionList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_action_delete)
#define cg_upnp_actionlist_size(actionList)   cg_list_size((CgList *)actionList)
#define cg_upnp_actionlist_gets(actionList)   (CgUpnpAction *)cg_list_next((CgList *)actionList)
#define cg_upnp_actionlist_add(actionList, action)   cg_list_add((CgList *)actionList, (CgList *)action)

Typedefs

typedef struct _CgUpnpAction CgUpnpAction
typedef struct _CgUpnpAction CgUpnpActionList
typedef BOOL(* CG_UPNP_ACTION_LISTNER )(CgUpnpAction *)

Functions

CgUpnpActioncg_upnp_action_new ()
void cg_upnp_action_delete (CgUpnpAction *action)
void cg_upnp_action_setactionnode (CgUpnpAction *action, CgXmlNode *node)
CgUpnpArgumentcg_upnp_action_getargumentbyname (CgUpnpAction *action, char *name)
char * cg_upnp_action_getargumentvaluebyname (CgUpnpAction *action, char *name)
BOOL cg_upnp_action_setargumentvaluebyname (CgUpnpAction *action, char *name, char *value)
CgUpnpActionListcg_upnp_actionlist_new ()
void cg_upnp_actionlist_delete (CgUpnpActionList *actionList)

Define Documentation

#define CG_UPNP_ACTION_ELEM_NAME   "action"
#define cg_upnp_action_getactionnode ( action   )     (action->actionNode)

Get the action's XML node (i.e. the XML representation of the action)

Parameters:
action The action in question
Returns:
CgXmlNode*
#define cg_upnp_action_getargumentlist ( action   )     (action->argumentList)

Get the action's list of arguments

Parameters:
action The action in question
Returns:
CgUpnpArgumentList*
#define cg_upnp_action_getarguments ( action   )     ((CgUpnpArgument *)cg_list_next((CgList *)action->argumentList))

Get the first argument from the action's list of arguments. Use as the starting point in iteration loops.

Parameters:
action The action in question
Returns:
CgUpnpArgument*
#define cg_upnp_action_getlistener ( action   )     (action->listener)

Get the action's listener function

Parameters:
action The action in question
Returns:
BOOL (*CG_UPNP_ACTION_LISTNER)(CgUpnpAction *)
#define cg_upnp_action_getlistner   cg_upnp_action_getlistener
Deprecated:
Compatibility macro for typo correction
#define cg_upnp_action_getname ( action   )     cg_xml_node_getchildnodevalue(cg_upnp_action_getactionnode(action), CG_UPNP_ACTION_NAME)

Get the action's name

Parameters:
action The action in question
Returns:
char*
#define cg_upnp_action_getservice ( action   )     ((CgUpnpService *)action->parentService)

Get the action's parent service

Parameters:
action The action in question
Returns:
CgUpnpService*
#define cg_upnp_action_getstatuscode ( action   )     cg_upnp_status_getcode(action->upnpStatus)

Get the action's latest status code

Parameters:
action The action in question
Returns:
int
#define cg_upnp_action_getstatusdescription ( action   )     cg_upnp_status_getdescription(action->upnpStatus)

Get the action's latest status description

Parameters:
action The action in question
Returns:
char*
#define cg_upnp_action_getuserdata ( action   )     (action->userData)

Get the action's arbitrary user data pointer

Parameters:
action The action in question
Returns:
void*
#define cg_upnp_action_hasargumentbyname ( action,
name   )     ((cg_upnp_action_getargumentbyname(action,name) != NULL) ? TRUE : FALSE)

Find out, whether the action has an argument by the given name

Parameters:
action The action in question
name The name to look for
Returns:
TRUE if the action has the argument; otherwise FALSE
#define cg_upnp_action_isactionnode ( node   )     cg_xml_node_isname(node, CG_UPNP_ACTION_ELEM_NAME)

Check, whether the given XML node is an action node

Parameters:
node The CgXmlNode*
#define cg_upnp_action_isname ( action,
name   )     cg_streq(cg_upnp_action_getname(action), name)

Check, whether the action's name matches the one given as parameter.

Parameters:
action The action in question
name The name string to compare
#define CG_UPNP_ACTION_NAME   "name"
#define cg_upnp_action_next ( action   )     (CgUpnpAction *)cg_list_next((CgList *)action)

Get the next action in a list of actions. Use as an iterator.

Parameters:
action The current action
#define cg_upnp_action_setlistener ( action,
func   )     (action->listener = func)

Set the action's listener function

Parameters:
action The action in question
func The listener function of type: BOOL (*CG_UPNP_ACTION_LISTNER)(CgUpnpAction *)
#define cg_upnp_action_setlistner   cg_upnp_action_setlistener
Deprecated:
Compatibility macro for typo correction
#define cg_upnp_action_setname ( action,
value   )     cg_xml_node_setchildnode(cg_upnp_action_getactionnode(action), CG_UPNP_ACTION_NAME, value)

Set the action's name

Parameters:
action The action in question
value The action's name
#define cg_upnp_action_setservice ( action,
service   )     (action->parentService = service)

Set the action's parent service

Parameters:
action The action in question
service The action's parent service
#define cg_upnp_action_setstatuscode ( action,
code   )     cg_upnp_status_setcode(action->upnpStatus, code)

Set the action's latest status code

Parameters:
action The action in question
code The status code (int)
#define cg_upnp_action_setstatusdescription ( action,
value   )     cg_upnp_status_setdescription(action->upnpStatus, value)

Set the action's latest status description

Parameters:
action The action in question
value The status description string
#define cg_upnp_action_setuserdata ( action,
value   )     (action->userData = value)

Set the action's arbitrary user data pointer

Parameters:
action The action in question
value The user data pointer (void*)
#define cg_upnp_actionlist_add ( actionList,
action   )     cg_list_add((CgList *)actionList, (CgList *)action)

Add an action to a list of actions

Parameters:
actionList The list in question
action The action to add to the list
#define cg_upnp_actionlist_clear ( actionList   )     cg_list_clear((CgList *)actionList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_action_delete)

Clear the contents of a list of actions

Parameters:
actionList The list of actions to clear
#define CG_UPNP_ACTIONLIST_ELEM_NAME   "actionList"
#define cg_upnp_actionlist_gets ( actionList   )     (CgUpnpAction *)cg_list_next((CgList *)actionList)

Get the first action in a list of actions. Use as the starting point in iteration loops.

Parameters:
actionList The list in question
Returns:
CgUpnpAction*
#define cg_upnp_actionlist_size ( actionList   )     cg_list_size((CgList *)actionList)

Get the number of actions in a list of actions

Parameters:
actionList The list in question
Returns:
int

Typedef Documentation

typedef struct _CgUpnpAction CgUpnpAction

Function Documentation

void cg_upnp_action_delete ( CgUpnpAction action  ) 

Destroy an action

Parameters:
action The action to destroy
CgUpnpArgument* cg_upnp_action_getargumentbyname ( CgUpnpAction action,
char *  name 
)

Find an argument from the action by the argument's name.

Parameters:
action The action in question
name The name of the argument to look for
Returns:
CgUpnpArgument* if successfull; otherwise NULL
char* cg_upnp_action_getargumentvaluebyname ( CgUpnpAction action,
char *  name 
)

Get a value of the specified argument from the action by the argument's name directly.

Parameters:
action The action in question
name The name of the argument to look for
Returns:
char* if successfull; otherwise NULL
CgUpnpAction* cg_upnp_action_new (  ) 

Create a new action

Returns:
CgUpnpAction*
void cg_upnp_action_setactionnode ( CgUpnpAction action,
CgXmlNode node 
)

Set the action's XML node (i.e. the XML representation of the action)

Parameters:
action The action in question
node The CgXmlNode*
BOOL cg_upnp_action_setargumentvaluebyname ( CgUpnpAction action,
char *  name,
char *  value 
)

Set a value of the specified argument from the action by the argument's name directly.

Parameters:
action The action in question
name The name of the argument to look for
value The value to set
Returns:
TRUE if successfull; otherwise NO
void cg_upnp_actionlist_delete ( CgUpnpActionList actionList  ) 

Destroy a list of actions

Parameters:
actionList The list of actions to destroy
CgUpnpActionList* cg_upnp_actionlist_new (  ) 

Create a new list of actions

Returns:
CgUpnpActionList*

Generated on Tue Feb 23 23:14:22 2010 for CyberLink for C by  doxygen 1.6.1