Ejemplo n.º 1
0
mUpnpXmlNodeList *mupnp_xml_nodelist_new()
{
	mUpnpXmlNodeList *nodeList;

	mupnp_log_debug_l4("Entering...\n");

	nodeList = (mUpnpXmlNodeList *)malloc(sizeof(mUpnpXmlNodeList));

	if ( NULL != nodeList )
	{
		mupnp_list_header_init((mUpnpList *)nodeList);

		nodeList->name = NULL;
		nodeList->value = NULL;
		nodeList->attrList = NULL;
		nodeList->nodeList = NULL;
		nodeList->parentNode = NULL;
		nodeList->userData = NULL;
		nodeList->userDataDestructorFunc = NULL;
	}

	mupnp_log_debug_l4("Leaving...\n");

	return nodeList;
}
Ejemplo n.º 2
0
/**
 * Create a new event listener list
 *
 */
mUpnpEventListenerList* mupnp_eventlistenerlist_new()
{
  mUpnpEventListenerList* eventListenerList;

  mupnp_log_debug_l4("Entering...\n");

  eventListenerList = (mUpnpEventListenerList*)malloc(sizeof(mUpnpEventListenerList));

  if (NULL != eventListenerList)
    mupnp_list_header_init((mUpnpList*)eventListenerList);

  return eventListenerList;

  mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 3
0
mUpnpDeviceList* mupnp_devicelist_new()
{
  mUpnpDeviceList* devList;

  mupnp_log_debug_l4("Entering...\n");

  devList = (mUpnpDeviceList*)malloc(sizeof(mUpnpDeviceList));

  if (NULL != devList)
    mupnp_list_header_init((mUpnpList*)devList);

  return devList;

  mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 4
0
mUpnpActionList *mupnp_actionlist_new()
{
	mUpnpAction *actionList;

	mupnp_log_debug_l4("Entering...\n");

	actionList = (mUpnpAction *)malloc(sizeof(mUpnpAction));

	if ( NULL != actionList )
		mupnp_list_header_init((mUpnpList *)actionList);

	return actionList;

	mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 5
0
mUpnpIconList* mupnp_iconlist_new()
{
  mUpnpIcon* iconList;

  mupnp_log_debug_l4("Entering...\n");

  iconList = (mUpnpIcon*)malloc(sizeof(mUpnpIcon));

  if (NULL != iconList)
    mupnp_list_header_init((mUpnpList*)iconList);

  return iconList;

  mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 6
0
mUpnpXmlAttributeList* mupnp_xml_attributelist_new()
{
  mUpnpXmlAttributeList* attrList;

  mupnp_log_debug_l4("Entering...\n");

  attrList = (mUpnpXmlAttributeList*)malloc(sizeof(mUpnpXmlAttributeList));

  if (NULL != attrList) {
    mupnp_list_header_init((mUpnpList*)attrList);
    attrList->name = NULL;
    attrList->value = NULL;
  }

  return attrList;

  mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 7
0
mUpnpHttpHeaderList *mupnp_http_headerlist_new()
{
	mUpnpHttpHeaderList *headerList;

	mupnp_log_debug_l4("Entering...\n");

	headerList = (mUpnpHttpHeaderList *)malloc(sizeof(mUpnpHttpHeaderList));

	if ( NULL != headerList )
	{
		mupnp_list_header_init((mUpnpList *)headerList);
		headerList->name = NULL;
		headerList->value = NULL;
	}

	return headerList;

	mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 8
0
mUpnpDictionary *mupnp_dictionary_new()
{
	mUpnpDictionary *dictionaryList;

	mupnp_log_debug_l4("Entering...\n");

	dictionaryList = (mUpnpDictionary *)malloc(sizeof(mUpnpDictionary));

	if ( NULL != dictionaryList )
	{
		mupnp_list_header_init((mUpnpList *)dictionaryList);
		dictionaryList->key = NULL;
		dictionaryList->value = NULL;
	}

	mupnp_log_debug_l4("Leaving...\n");

	return dictionaryList;
}
Ejemplo n.º 9
0
BOOL mupnp_http_persistentconnection_init(void)
{
	mupnp_log_debug_l4("Entering...\n");

       if (cache == NULL)
       {
               persistent_connection_mutex = mupnp_mutex_new();

               if (persistent_connection_mutex == NULL)
               {
                       return FALSE;
               }

               mupnp_http_persistentconnection_lock();
               cache = (mUpnpHttpPersistentConnectionList *)malloc(sizeof(mUpnpHttpPersistentConnectionList));

               if (cache == NULL)
               {
                       if (persistent_connection_mutex != NULL)
                       {
                               mupnp_http_persistentconnection_unlock();
                               mupnp_mutex_delete(persistent_connection_mutex);
                               persistent_connection_mutex = NULL;
                       }
                       return FALSE;
               }

               mupnp_list_header_init((mUpnpList *)cache);

               cache->host = NULL;
               cache->port = 0;
               cache->cacheData = NULL;

               cache->timestamp = 0;

               mupnp_http_persistentconnection_unlock();
       }

       return TRUE;

	mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 10
0
mUpnpFileList *mupnp_filelist_new()
{
	mUpnpFileList *fileList;

	mupnp_log_debug_l4("Entering...\n");

	fileList = (mUpnpFileList *)malloc(sizeof(mUpnpFileList));

	if ( NULL != fileList )
	{
		mupnp_list_header_init((mUpnpList *)fileList);
		fileList->name = NULL;
		fileList->path = NULL;
		fileList->content = NULL;
	}

	mupnp_log_debug_l4("Leaving...\n");

	return fileList;
}