bool mupnp_upnpav_dms_condir_init(mUpnpAvServer *dms) { mUpnpDevice *dev; mUpnpService *service; mUpnpAction* action; dev = mupnp_upnpav_dms_getdevice(dms); if (!dev) return false; service = mupnp_device_getservicebytype(dev, CG_UPNPAV_DMS_CONTENTDIRECTORY_SERVICE_TYPE); if (!service) return false; if (mupnp_service_parsedescription(service, CG_UPNPAV_DMS_CONTENTDIRECTORY_SERVICE_DESCRIPTION, mupnp_strlen(CG_UPNPAV_DMS_CONTENTDIRECTORY_SERVICE_DESCRIPTION)) == false) return false; mupnp_service_setactionlistener(service, mupnp_upnpav_dms_condir_actionreceived); for (action=mupnp_service_getactions(service); action; action=mupnp_action_next(action)) mupnp_action_setuserdata(action, dms); mupnp_upnpav_dms_condir_setsystemupdateid(dms, 1); return true; }
mUpnpAction *mupnp_action_new() { mUpnpAction *action; mupnp_log_debug_l4("Entering...\n"); action = (mUpnpAction *)malloc(sizeof(mUpnpAction)); if ( NULL != action ) { mupnp_list_node_init((mUpnpList *)action); action->parentService = NULL; action->actionNode = NULL; action->argumentList = mupnp_argumentlist_new(); action->upnpStatus = mupnp_status_new(); action->listener = NULL; mupnp_action_setuserdata(action, NULL); } mupnp_log_debug_l4("Leaving...\n"); return action; }