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

Data Structures

struct  _mUpnpDictionary
 The generic wrapper struct for mUPnP's dictionarys. More...
 

Macros

#define mupnp_dictionary_element_setkey(dirElem, name)
 
#define mupnp_dictionary_element_getkey(dirElem)
 
#define mupnp_dictionary_element_setvalue(dirElem, val)
 
#define mupnp_dictionary_element_getvalue(dirElem)
 
#define mupnp_dictionary_element_next(dirElem)
 
#define mupnp_dictionary_element_remove(dirElem)
 
#define mupnp_dictionary_clear(dir)
 
#define mupnp_dictionary_size(dir)
 
#define mupnp_dictionary_gets(dir)
 
#define mupnp_dictionary_add(dir, dirElem)
 
#define mupnp_dictionary_remove(dirElem)
 

Typedefs

typedef struct _mUpnpDictionary mUpnpDictionaryElement
 The generic wrapper struct for mUPnP's dictionarys.
 
typedef struct _mUpnpDictionary mUpnpDictionary
 

Functions

mUpnpDictionaryElementmupnp_dictionary_element_new (void)
 
bool mupnp_dictionary_element_delete (mUpnpDictionaryElement *dirElem)
 
mUpnpDictionarymupnp_dictionary_new (void)
 
void mupnp_dictionary_delete (mUpnpDictionary *dir)
 
mUpnpDictionaryElementmupnp_dictionary_get (mUpnpDictionary *dir, const char *key)
 
void mupnp_dictionary_setvalue (mUpnpDictionary *dir, const char *key, const char *value)
 
const char * mupnp_dictionary_getvalue (mUpnpDictionary *dir, const char *key)
 

Macro Definition Documentation

◆ mupnp_dictionary_add

#define mupnp_dictionary_add ( dir,
dirElem )
Value:
void mupnp_list_add(mUpnpList *headList, mUpnpList *list)
Definition list.c:123
The generic list interface in mUPnP.
Definition list.h:56

Add a dictionary into a dictionary list

Parameters
dirThe dictionary list in question
dirElemThe dictionary to add to the list

◆ mupnp_dictionary_clear

#define mupnp_dictionary_clear ( dir)
Value:
bool mupnp_dictionary_element_delete(mUpnpDictionaryElement *dirElem)
Definition dictionary_elem.c:44
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 a dictionary list

Parameters
dirDictionary list in question

◆ mupnp_dictionary_element_getkey

#define mupnp_dictionary_element_getkey ( dirElem)
Value:
mupnp_string_getvalue(dirElem->key)
char * mupnp_string_getvalue(mUpnpString *str)
Definition string.c:177

Get a key

Parameters
dirElemDictionary struct

◆ mupnp_dictionary_element_getvalue

#define mupnp_dictionary_element_getvalue ( dirElem)
Value:
mupnp_string_getvalue(dirElem->value)

Get a value

Parameters
dirElemDictionary struct

◆ mupnp_dictionary_element_next

#define mupnp_dictionary_element_next ( dirElem)
Value:
mUpnpList * mupnp_list_next(mUpnpList *list)
Definition list.c:234
The generic wrapper struct for mUPnP's dictionarys.
Definition dictionary.h:37

◆ mupnp_dictionary_element_remove

#define mupnp_dictionary_element_remove ( dirElem)
Value:
void mupnp_list_remove(mUpnpList *list)
Definition list.c:144

◆ mupnp_dictionary_element_setkey

#define mupnp_dictionary_element_setkey ( dirElem,
name )
Value:
mupnp_string_setvalue(dirElem->key, name)
void mupnp_string_setvalue(mUpnpString *str, const char *value)
Definition string.c:84

Set a key

Parameters
dirElemDictionary struct
nameString to set

◆ mupnp_dictionary_element_setvalue

#define mupnp_dictionary_element_setvalue ( dirElem,
val )
Value:
mupnp_string_setvalue(dirElem->value, val)

Set a value

Parameters
dirElemDictionary struct
valueString to set

◆ mupnp_dictionary_gets

#define mupnp_dictionary_gets ( dir)
Value:

Get the first actual item from a dictionary list to use as an iterator

Parameters
dirThe dictionary list in question

◆ mupnp_dictionary_remove

#define mupnp_dictionary_remove ( dirElem)
Value:

Remove a dictionary from dictionary list

Parameters
dirElemThe dictionary to be removed

◆ mupnp_dictionary_size

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

Get the size of a dictionary list

Parameters
dirThe dictionary list in question

Typedef Documentation

◆ mUpnpDictionary

◆ mUpnpDictionaryElement

The generic wrapper struct for mUPnP's dictionarys.

This wrapper has been created to enable 100% code compatibility between different platforms (Linux, Win32 etc..)

Function Documentation

◆ mupnp_dictionary_delete()

void mupnp_dictionary_delete ( mUpnpDictionary * dir)

Destroy a dictionary list

Parameters
dirThe dictionary list in question

◆ mupnp_dictionary_element_delete()

bool mupnp_dictionary_element_delete ( mUpnpDictionaryElement * dirElem)

Destroy a dictionary.

Parameters
dirElemDictionary to destroy

◆ mupnp_dictionary_element_new()

mUpnpDictionaryElement * mupnp_dictionary_element_new ( void )

Create a new dictionary

◆ mupnp_dictionary_get()

mUpnpDictionaryElement * mupnp_dictionary_get ( mUpnpDictionary * dir,
const char * key )

Get a element of the specified key

Parameters
dirThe dictionary list in question
keyName to search.
Returns
Element of the specified key.

◆ mupnp_dictionary_getvalue()

const char * mupnp_dictionary_getvalue ( mUpnpDictionary * dir,
const char * key )

Get a value of the specified key

Parameters
dirThe dictionary list in question
keyName to search.
Returns
Value of the specified key.

◆ mupnp_dictionary_new()

mUpnpDictionary * mupnp_dictionary_new ( void )

Create a new dictionary list

Returns
Dictionary list

◆ mupnp_dictionary_setvalue()

void mupnp_dictionary_setvalue ( mUpnpDictionary * dir,
const char * key,
const char * value )

Set a new element into a dictionary

Parameters
dirThe dictionary list in question
keyName to set.
valueValue to set.