libcomps: comps multi-dictionary functions

libcomps ..

Loading...
Searching...
No Matches
Functions
comps multi-dictionary functions

## Functions
void | comps_objmdict_set (COMPS_ObjMDict *rt, char *key, COMPS_Object *data)
void | comps_objmdict_set_x (COMPS_ObjMDict *rt, char *key, COMPS_Object *data)
void | comps_objmdict_set_n (COMPS_ObjMDict *rt, char *key, unsigned int len, COMPS_Object *data)
COMPS_ObjList * | comps_objmdict_get (COMPS_ObjMDict *rt, const char *key)
void | comps_objmdict_unset (COMPS_ObjMDict *rt, const char *key)
void | comps_objmdict_clear (COMPS_ObjMDict *rt)
COMPS_HSList * | comps_objmdict_values (COMPS_ObjMDict *rt)
void | comps_objmdict_values_walk (COMPS_ObjMDict *rt, void *udata, void(*walk_f)(void *, void *))
COMPS_ObjMDict * | comps_objmdict_clone (COMPS_ObjMDict *rt)
COMPS_HSList * | comps_objmdict_keys (COMPS_ObjMDict *rt)
COMPS_HSList * | comps_objmdict_pairs (COMPS_ObjMDict *rt)

## Detailed Description

## Function Documentation

## ◆ comps_objmdict_clear()

void comps_objmdict_clear | ( | COMPS_ObjMDict * | rt | ) |

remove all items from multi-dictionary

Parameters

  rt | COMPS_ObjDict object

## ◆ comps_objmdict_clone()

COMPS_ObjMDict * comps_objmdict_clone | ( | COMPS_ObjMDict * | rt | ) |

Makes copy of multi-dictionary

Items in new dictionary is same items with incremented reference counter only

Parameters

  rt | COMPS_ObjDict object

Returns
  new COMPS_ObjDict object

## ◆ comps_objmdict_get()

COMPS_ObjList * comps_objmdict_get | ( | COMPS_ObjMDict * | rt,
|  | const char * | key )

get items from multi-dictionary for specified key

if there's no such items, return NULL. Item's reference counter WON'T be incremented.

Parameters

  rt | COMPS_ObjDict object
  specified | key

Returns
  COMPS_ObjList of specified items

## ◆ comps_objmdict_keys()

COMPS_HSList * comps_objmdict_keys | ( | COMPS_ObjMDict * | rt | ) |

Return list of keys in multi-dictionary

Parameters

  rt | COMPS_ObjMDict object

Returns
  COMPS_HSList of key in multi-dictionary

## ◆ comps_objmdict_pairs()

COMPS_HSList * comps_objmdict_pairs | ( | COMPS_ObjMDict * | rt | ) |

Return list of pairs(key-value) in multi-dictionary

Parameters

  rt | COMPS_ObjMDict object

Returns
  COMPS_HSList of pairs in dictionary

## ◆ comps_objmdict_set()

void comps_objmdict_set | ( | COMPS_ObjMDict * | rt,
|  | char * | key,
|  | COMPS_Object * | data )

set new item to multi-dictionary

if there's already item for specified key, new item will be added into list for specified key. Reference counter of new item is incremented

Parameters

  rt | COMPS_ObjMDict object
  key | key for new item
  data | new item

## ◆ comps_objmdict_set_n()

void comps_objmdict_set_n | ( | COMPS_ObjMDict * | rt,
|  | char * | key,
|  | unsigned int | len,
|  | COMPS_Object * | data )

same as comps_objmdict_set but with key length limited by argument

Parameters

  rt | COMPS_ObjMDict object
  key | key for new item
  len | key length limiter
  data | new item

## ◆ comps_objmdict_set_x()

void comps_objmdict_set_x | ( | COMPS_ObjMDict * | rt,
|  | char * | key,
|  | COMPS_Object * | data )

set new item to multi-dictionary

if there's already item for specified key, new item will be added into list for specified key. Reference counter of new item isn't incremented

Parameters

  rt | COMPS_ObjMDict object
  key | key for new item
  data | new item

## ◆ comps_objmdict_unset()

void comps_objmdict_unset | ( | COMPS_ObjMDict * | rt,
|  | const char * | key )

remove item from multi-dictionary for specified key

item's reference counter will be decremented

Parameters

  rt | COMPS_ObjDict object
  key | item's key

## ◆ comps_objmdict_values()

COMPS_HSList * comps_objmdict_values | ( | COMPS_ObjMDict * | rt | ) |

Return list of all values(items) in multi-dictionary

Parameters

  rt | COMPS_ObjDict object

Returns
  COMPS_HSList of values

## ◆ comps_objmdict_values_walk()

void comps_objmdict_values_walk | ( | COMPS_ObjMDict * | rt,
|  | void * | udata,
|  | void(* | walk_f )(void *, void *) )

Apply function for each item in multi-dictionary

Applied function takes user data (udata param) and item as arguments

Parameters

  rt | COMPS_ObjDict object
  udata | user data
  walk_f | applied function