ngfd-plugin
proplist.h File Reference
#include <ngf/value.h>

Go to the source code of this file.

Typedefs

typedef struct _NProplist NProplist
 Internal proplist structure.
 
typedef void(* NProplistFunc) (const char *key, const NValue *value, gpointer userdata)
 Proplist manipulation function definition.
 

Functions

NProplistn_proplist_new ()
 Initializes new proplist.
 
NProplistn_proplist_copy (const NProplist *source)
 Create copy of existing proplist.
 
NProplistn_proplist_copy_keys (const NProplist *source, GList *keys)
 Create copy of existing proplist, copying only selected keys.
 
void n_proplist_merge (NProplist *target, const NProplist *source)
 Merge two proplists.
 
void n_proplist_merge_keys (NProplist *target, const NProplist *source, GList *keys)
 Merge only selected keys on proplists.
 
void n_proplist_free (NProplist *proplist)
 Free proplist.
 
int n_proplist_size (const NProplist *proplist)
 Return number of keys in the proplist.
 
void n_proplist_foreach (const NProplist *proplist, NProplistFunc func, gpointer userdata)
 Run function on each key in the proplist.
 
gboolean n_proplist_is_empty (const NProplist *proplist)
 Check if the proplist is empty.
 
gboolean n_proplist_has_key (const NProplist *proplist, const char *key)
 Check if the proplist has key.
 
gboolean n_proplist_match_exact (const NProplist *a, const NProplist *b)
 Check if two proplists are identical.
 
void n_proplist_set (NProplist *proplist, const char *key, NValue *value)
 Insert or update key/value pair in proplist.
 
NValuen_proplist_get (const NProplist *proplist, const char *key)
 Get value from proplist.
 
void n_proplist_unset (NProplist *proplist, const char *key)
 Remove key from proplist.
 
void n_proplist_set_string (NProplist *proplist, const char *key, const char *value)
 Set or update string value in proplist.
 
const char * n_proplist_get_string (const NProplist *proplist, const char *key)
 Get string value from proplist.
 
gchar * n_proplist_dup_string (const NProplist *proplist, const char *key)
 Get duplicate of string value from proplist.
 
void n_proplist_set_int (NProplist *proplist, const char *key, gint value)
 Set or update int value in proplist.
 
gint n_proplist_get_int (const NProplist *proplist, const char *key)
 Get int value from proplist.
 
void n_proplist_set_uint (NProplist *proplist, const char *key, guint value)
 Set or update uint value in proplist.
 
guint n_proplist_get_uint (const NProplist *proplist, const char *key)
 Get uint value from proplist.
 
void n_proplist_set_bool (NProplist *proplist, const char *key, gboolean value)
 Set or update boolean value in proplist.
 
gboolean n_proplist_get_bool (const NProplist *proplist, const char *key)
 Get boolean value from proplist.
 
void n_proplist_set_pointer (NProplist *proplist, const char *key, gpointer value)
 Set or update pointer value in proplist.
 
gpointer n_proplist_get_pointer (const NProplist *proplist, const char *key)
 Get pointer value from proplist.
 
void n_proplist_dump (const NProplist *proplist)
 Dump contents of proplist to debug log.
 

Typedef Documentation

◆ NProplist

typedef struct _NProplist NProplist

Internal proplist structure.

◆ NProplistFunc

typedef void(* NProplistFunc) (const char *key, const NValue *value, gpointer userdata)

Proplist manipulation function definition.

Used in n_proplist_foreach

Parameters
keyProplist key
valueValue associated with key
userdataUserdata

Function Documentation

◆ n_proplist_copy()

NProplist * n_proplist_copy ( const NProplist * source)

Create copy of existing proplist.

Parameters
sourceSource proplist
Returns
Copy of source proplist

◆ n_proplist_copy_keys()

NProplist * n_proplist_copy_keys ( const NProplist * source,
GList * keys )

Create copy of existing proplist, copying only selected keys.

Parameters
sourceSource proplist
keysKeys to be copied as GList
Returns
Copy of source proplist containing only selected keys

◆ n_proplist_dump()

void n_proplist_dump ( const NProplist * proplist)

Dump contents of proplist to debug log.

Parameters
proplistProplist
See also
log.h

◆ n_proplist_dup_string()

gchar * n_proplist_dup_string ( const NProplist * proplist,
const char * key )

Get duplicate of string value from proplist.

Parameters
proplistProplist
keyKey
Returns
Newly allocated string of value or NULL if key is not found. Value must be freed afterwards.

◆ n_proplist_foreach()

void n_proplist_foreach ( const NProplist * proplist,
NProplistFunc func,
gpointer userdata )

Run function on each key in the proplist.

Parameters
proplistTarget proplist
funcFunction to be run
userdataUserdata

◆ n_proplist_free()

void n_proplist_free ( NProplist * proplist)

Free proplist.

Parameters
proplistProplist

◆ n_proplist_get()

NValue * n_proplist_get ( const NProplist * proplist,
const char * key )

Get value from proplist.

Parameters
proplistProplist
keyKey
Returns
Value of the key as NValue or NULL if empty

◆ n_proplist_get_bool()

gboolean n_proplist_get_bool ( const NProplist * proplist,
const char * key )

Get boolean value from proplist.

Parameters
proplistProplist
keyKey
Returns
Value or FALSE if key is not found

◆ n_proplist_get_int()

gint n_proplist_get_int ( const NProplist * proplist,
const char * key )

Get int value from proplist.

Parameters
proplistProplist
keyKey
Returns
Value or 0 if key is not found

◆ n_proplist_get_pointer()

gpointer n_proplist_get_pointer ( const NProplist * proplist,
const char * key )

Get pointer value from proplist.

Parameters
proplistProplist
keyKey
Returns
Value or FALSE if key is not found

◆ n_proplist_get_string()

const char * n_proplist_get_string ( const NProplist * proplist,
const char * key )

Get string value from proplist.

Parameters
proplistProplist
keyKey
Returns
Value or NULL if key is not found

◆ n_proplist_get_uint()

guint n_proplist_get_uint ( const NProplist * proplist,
const char * key )

Get uint value from proplist.

Parameters
proplistProplist
keyKey
Returns
Value or 0 if key is not found

◆ n_proplist_has_key()

gboolean n_proplist_has_key ( const NProplist * proplist,
const char * key )

Check if the proplist has key.

Parameters
proplistProplist
keyKey
Returns
TRUE if proplist has key

◆ n_proplist_is_empty()

gboolean n_proplist_is_empty ( const NProplist * proplist)

Check if the proplist is empty.

Parameters
proplistProplist
Returns
TRUE if proplist is empty

◆ n_proplist_match_exact()

gboolean n_proplist_match_exact ( const NProplist * a,
const NProplist * b )

Check if two proplists are identical.

Parameters
aProplist A
bProplist B
Returns
TRUE if proplists are identical

◆ n_proplist_merge()

void n_proplist_merge ( NProplist * target,
const NProplist * source )

Merge two proplists.

Parameters
targetTarget proplist
sourceSource to be merged to target

◆ n_proplist_merge_keys()

void n_proplist_merge_keys ( NProplist * target,
const NProplist * source,
GList * keys )

Merge only selected keys on proplists.

Parameters
targetTarget proplist
sourceSource to be merged to target
keysList of keys to be merged as GList

◆ n_proplist_new()

NProplist * n_proplist_new ( )

Initializes new proplist.

Returns
Empty proplist

◆ n_proplist_set()

void n_proplist_set ( NProplist * proplist,
const char * key,
NValue * value )

Insert or update key/value pair in proplist.

Parameters
proplistProplist
keyKey
valueValue. Proplist takes ownership of the value.

◆ n_proplist_set_bool()

void n_proplist_set_bool ( NProplist * proplist,
const char * key,
gboolean value )

Set or update boolean value in proplist.

Parameters
proplistProplist
keyKey
valueValue

◆ n_proplist_set_int()

void n_proplist_set_int ( NProplist * proplist,
const char * key,
gint value )

Set or update int value in proplist.

Parameters
proplistProplist
keyKey
valueValue

◆ n_proplist_set_pointer()

void n_proplist_set_pointer ( NProplist * proplist,
const char * key,
gpointer value )

Set or update pointer value in proplist.

Parameters
proplistProplist
keyKey
valueValue

◆ n_proplist_set_string()

void n_proplist_set_string ( NProplist * proplist,
const char * key,
const char * value )

Set or update string value in proplist.

Parameters
proplistProplist
keyKey
valueValue

◆ n_proplist_set_uint()

void n_proplist_set_uint ( NProplist * proplist,
const char * key,
guint value )

Set or update uint value in proplist.

Parameters
proplistProplist
keyKey
valueValue

◆ n_proplist_size()

int n_proplist_size ( const NProplist * proplist)

Return number of keys in the proplist.

Parameters
proplistProplist
Returns
Number of keys

◆ n_proplist_unset()

void n_proplist_unset ( NProplist * proplist,
const char * key )

Remove key from proplist.

Parameters
proplistProplist
keyKey