コード例 #1
0
ファイル: xml_node_list.c プロジェクト: dwlinux/mupnpc
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;
}
コード例 #2
0
ファイル: eventlistener_list.c プロジェクト: Coramo/mupnp
/**
 * 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");
}
コード例 #3
0
ファイル: device_list.c プロジェクト: Coramo/mupnp
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");
}
コード例 #4
0
ファイル: action_list.c プロジェクト: dwlinux/mupnpc
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");
}
コード例 #5
0
ファイル: icon_list.c プロジェクト: Coramo/mupnp
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");
}
コード例 #6
0
ファイル: xml_attribute_list.c プロジェクト: Coramo/mupnp
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");
}
コード例 #7
0
ファイル: http_header_list.c プロジェクト: dwlinux/mupnpc
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");
}
コード例 #8
0
ファイル: dictionary.c プロジェクト: dwlinux/mupnpc
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;
}
コード例 #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");
}
コード例 #10
0
ファイル: file_list.c プロジェクト: WilliamRen/mupnpc
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;
}