mUPnP for C
icon.h File Reference
#include <mupnp/typedef.h>
#include <mupnp/xml/xml.h>
#include <mupnp/util/list.h>

Data Structures

struct  _mUpnpIcon
 

Macros

#define MUPNP_ICON_ELEM_NAME   "icon"
 
#define MUPNP_ICONLIST_ELEM_NAME   "iconList"
 
#define MUPNP_ICON_MIME_TYPE   "mimetype"
 
#define MUPNP_ICON_WIDTH   "width"
 
#define MUPNP_ICON_HEIGHT   "height"
 
#define MUPNP_ICON_DEPTH   "depth"
 
#define MUPNP_ICON_URL   "url"
 
#define mupnp_icon_next(icon)
 
#define mupnp_icon_isiconnode(node)
 
#define mupnp_icon_seticonnode(icon, node)
 
#define mupnp_icon_geticonnode(icon)
 
#define mupnp_icon_setmimetype(icon, value)
 
#define mupnp_icon_getmimetype(icon)
 
#define mupnp_icon_setwidth(icon, value)
 
#define mupnp_icon_getwidth(icon)
 
#define mupnp_icon_setheight(icon, value)
 
#define mupnp_icon_getheight(icon)
 
#define mupnp_icon_setdepth(icon, value)
 
#define mupnp_icon_getdepth(icon)
 
#define mupnp_icon_seturl(icon, value)
 
#define mupnp_icon_geturl(icon)
 
#define mupnp_iconlist_clear(iconList)
 
#define mupnp_iconlist_size(iconList)
 
#define mupnp_iconlist_gets(iconList)
 
#define mupnp_iconlist_add(iconList, icon)
 

Typedefs

typedef struct _mUpnpIcon mUpnpIcon
 
typedef struct _mUpnpIcon mUpnpIconList
 

Functions

mUpnpIconmupnp_icon_new (void)
 
void mupnp_icon_delete (mUpnpIcon *dev)
 
mUpnpIconListmupnp_iconlist_new (void)
 
void mupnp_iconlist_delete (mUpnpIconList *iconList)
 

Macro Definition Documentation

◆ MUPNP_ICON_DEPTH

#define MUPNP_ICON_DEPTH   "depth"

◆ MUPNP_ICON_ELEM_NAME

#define MUPNP_ICON_ELEM_NAME   "icon"

◆ mupnp_icon_getdepth

#define mupnp_icon_getdepth ( icon)
Value:
#define mupnp_icon_geticonnode(icon)
Definition icon.h:91
#define MUPNP_ICON_DEPTH
Definition icon.h:33
#define mupnp_xml_node_getchildnodeintvalue(node, name)
Definition xml.h:144

Get icon's colour depth

◆ mupnp_icon_getheight

#define mupnp_icon_getheight ( icon)
Value:

Get icon height

◆ mupnp_icon_geticonnode

#define mupnp_icon_geticonnode ( icon)
Value:
(icon->iconNode)

Get the XML icon node from an icon struct

Parameters
iconThe icon struct

◆ mupnp_icon_getmimetype

#define mupnp_icon_getmimetype ( icon)
Value:
#define MUPNP_ICON_MIME_TYPE
Definition icon.h:30
const char * mupnp_xml_node_getchildnodevalue(mUpnpXmlNode *node, const char *name)
Definition xml_node.c:216

Get the icon's MIME type

◆ mupnp_icon_geturl

#define mupnp_icon_geturl ( icon)
Value:

Get icon's URL

◆ mupnp_icon_getwidth

#define mupnp_icon_getwidth ( icon)
Value:

Get icon width

◆ MUPNP_ICON_HEIGHT

#define MUPNP_ICON_HEIGHT   "height"

◆ mupnp_icon_isiconnode

#define mupnp_icon_isiconnode ( node)
Value:
#define MUPNP_ICON_ELEM_NAME
Definition icon.h:27
#define mupnp_xml_node_isname(node, nodename)
Definition xml.h:123

Check whether the given node is a member of an icon list

Parameters
nodeList node

◆ MUPNP_ICON_MIME_TYPE

#define MUPNP_ICON_MIME_TYPE   "mimetype"

◆ mupnp_icon_next

#define mupnp_icon_next ( icon)
Value:
mUpnpList * mupnp_list_next(mUpnpList *list)
Definition list.c:234
Definition icon.h:42
The generic list interface in mUPnP.
Definition list.h:56

Get the next icon in list. Use as an iterator.

Parameters
iconNode in a list of icons

◆ mupnp_icon_setdepth

#define mupnp_icon_setdepth ( icon,
value )
Value:
void mupnp_xml_node_setchildnode(mUpnpXmlNode *node, const char *name, const char *value)
Definition xml_node.c:105

Set icon's colour depth

Parameters
iconIcon in question
valueColour depth

◆ mupnp_icon_setheight

#define mupnp_icon_setheight ( icon,
value )
Value:

Set icon height

Parameters
iconIcon in question
valueIcon height

◆ mupnp_icon_seticonnode

#define mupnp_icon_seticonnode ( icon,
node )
Value:
(icon->iconNode = node)

Set the XML icon node to an icon struct

Parameters
iconThe icon struct
nodeXML node

◆ mupnp_icon_setmimetype

#define mupnp_icon_setmimetype ( icon,
value )
Value:

Set the icon's MIME type

Parameters
iconIcon in question
valueMIME type

◆ mupnp_icon_seturl

#define mupnp_icon_seturl ( icon,
value )
Value:

Set icon's URL

Parameters
iconIcon in question
valueIcon's URL

◆ mupnp_icon_setwidth

#define mupnp_icon_setwidth ( icon,
value )
Value:

Set icon width

Parameters
iconIcon in question
valueIcon width

◆ MUPNP_ICON_URL

#define MUPNP_ICON_URL   "url"

◆ MUPNP_ICON_WIDTH

#define MUPNP_ICON_WIDTH   "width"

◆ mupnp_iconlist_add

#define mupnp_iconlist_add ( iconList,
icon )
Value:
mupnp_list_add((mUpnpList*)iconList, (mUpnpList*)icon)
void mupnp_list_add(mUpnpList *headList, mUpnpList *list)
Definition list.c:123

Add an icon to an icon list

Parameters
iconListList of icons
iconIcon to add

◆ mupnp_iconlist_clear

#define mupnp_iconlist_clear ( iconList)
Value:
void mupnp_icon_delete(mUpnpIcon *dev)
Definition icon.c:39
void mupnp_list_clear(mUpnpList *headList, MUPNP_LIST_DESTRUCTORFUNC destructorFunc)
Definition list.c:257
void(* MUPNP_LIST_DESTRUCTORFUNC)(void *)
Definition list.h:29

Clear the contents of an icon list

Parameters
iconListList of icons

◆ MUPNP_ICONLIST_ELEM_NAME

#define MUPNP_ICONLIST_ELEM_NAME   "iconList"

◆ mupnp_iconlist_gets

#define mupnp_iconlist_gets ( iconList)
Value:
Todo
Get the first icon from the list for iteration
Parameters
iconListList of icons

◆ mupnp_iconlist_size

#define mupnp_iconlist_size ( iconList)
Value:
int mupnp_list_size(mUpnpList *headList)
Definition list.c:53

Get the size (number of elements) of an icon list

Parameters
iconListList of icons

Typedef Documentation

◆ mUpnpIcon

typedef struct _mUpnpIcon mUpnpIcon

The generic icon struct

◆ mUpnpIconList

typedef struct _mUpnpIcon mUpnpIconList

Function Documentation

◆ mupnp_icon_delete()

void mupnp_icon_delete ( mUpnpIcon * dev)

Delete an icon struct

Parameters
devIcon to delete

◆ mupnp_icon_new()

mUpnpIcon * mupnp_icon_new ( void )

Create a new icon struct

◆ mupnp_iconlist_delete()

void mupnp_iconlist_delete ( mUpnpIconList * iconList)

Delete a list of icons

Parameters
iconListList of icons

◆ mupnp_iconlist_new()

mUpnpIconList * mupnp_iconlist_new ( void )

Create a new list of icons