ngfd-plugin: /build/ngfd/src/ngfd-1.4.1/src/include/ngf/context.h File Reference

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 NValue * | n_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

  context | NContext structure.
  key | Key.

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

  context | NContext structure.
  key | Key.
  value | Values 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

  context | NContext structure.
  key | Key.
  callback | Callback function.
  userdata | Userdata.

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

  context | NContext structure.
  key | Key.
  callback | Callback function,

See also
  NContextValueChangeFunc