ngfd-plugin
Typedefs | Functions
context.h File Reference
#include <ngf/value.h>

Go to the source code of this file.

Typedefs

typedef struct _NContext NContext
 Internal context structure.
 
typedef void(* NContextValueChangeFunc) (NContext *context, const char *key, const NValue *old_value, const NValue *new_value, void *userdata)
 Context value change callback function.
 

Functions

void n_context_set_value (NContext *context, const char *key, NValue *value)
 Change or add key/value pair to context.
 
const NValuen_context_get_value (NContext *context, const char *key)
 Get value by key from context.
 
int n_context_subscribe_value_change (NContext *context, const char *key, NContextValueChangeFunc callback, void *userdata)
 Subscribe callback function to key in context structure.
 
void n_context_unsubscribe_value_change (NContext *context, const char *key, NContextValueChangeFunc callback)
 Unsubscribe value change callback.
 

Typedef Documentation

◆ NContext

typedef struct _NContext NContext

Internal context structure.

◆ NContextValueChangeFunc

typedef void(* NContextValueChangeFunc) (NContext *context, const char *key, const NValue *old_value, const NValue *new_value, void *userdata)

Context value change callback function.

Function Documentation

◆ n_context_get_value()

const NValue * n_context_get_value ( NContext context,
const char *  key 
)

Get value by key from context.

Parameters
contextNContext structure.
keyKey.
Returns
Value as NValue or NULL if no value associated with key is found.

◆ n_context_set_value()

void n_context_set_value ( NContext context,
const char *  key,
NValue value 
)

Change or add key/value pair to context.

Parameters
contextNContext structure.
keyKey.
valueValues as NValue type.

◆ n_context_subscribe_value_change()

int n_context_subscribe_value_change ( NContext context,
const char *  key,
NContextValueChangeFunc  callback,
void *  userdata 
)

Subscribe callback function to key in context structure.

Parameters
contextNContext structure.
keyKey.
callbackCallback function.
userdataUserdata.
Returns
TRUE is successful.
See also
NContextValueChangeFunc

◆ n_context_unsubscribe_value_change()

void n_context_unsubscribe_value_change ( NContext context,
const char *  key,
NContextValueChangeFunc  callback 
)

Unsubscribe value change callback.

Parameters
contextNContext structure.
keyKey.
callbackCallback function,
See also
NContextValueChangeFunc