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

ngfd-plugin

Classes | Typedefs | Enumerations | Functions
hook.h File Reference
`#include <glib.h>`

Go to the source code of this file.

## Classes
struct | _NHook
| Internal hook structure. More...

## Typedefs
typedef enum _NHookPriority | NHookPriority
| Enum defining the order in which callbacks are executed.
typedef struct _NHook | NHook
| Internal hook structure.
typedef void(* | NHookCallback) (NHook *hook, void *data, void *userdata)
| Hook callback function.

## Enumerations
enum | _NHookPriority { N_HOOK_PRIORITY_LAST = -100 , N_HOOK_PRIORITY_LOW = -10 , N_HOOK_PRIORITY_DEFAULT = 0 , N_HOOK_PRIORITY_HIGH = 10 , N_HOOK_PRIORITY_FIRST = 100 }
| Enum defining the order in which callbacks are executed. More...

## Functions
void | n_hook_init (NHook *hook)
| Initializes hook structure.
int | n_hook_connect (NHook *hook, int priority, NHookCallback callback, void *userdata)
| Connect callback function to hook.
void | n_hook_disconnect (NHook *hook, NHookCallback callback, void *userdata)
| Disconnects callback function from hook.
int | n_hook_fire (NHook *hook, void *data)
| Executes callback functions associated with hook.

## Typedef Documentation

## ◆ NHook

typedef struct _NHook NHook

Internal hook structure.

## ◆ NHookCallback

typedef void(* NHookCallback) (NHook *hook, void *data, void *userdata)

Hook callback function.

## ◆ NHookPriority

typedef enum _NHookPriority NHookPriority

Enum defining the order in which callbacks are executed.

## Enumeration Type Documentation

## ◆ _NHookPriority

enum _NHookPriority

Enum defining the order in which callbacks are executed.

Enumerator
N_HOOK_PRIORITY_LAST |
N_HOOK_PRIORITY_LOW |
N_HOOK_PRIORITY_DEFAULT |
N_HOOK_PRIORITY_HIGH |
N_HOOK_PRIORITY_FIRST |

## Function Documentation

## ◆ n_hook_connect()

int n_hook_connect | ( | NHook * | hook,
|  | int | priority,
|  | NHookCallback | callback,
|  | void * | userdata )

Connect callback function to hook.

Parameters

  hook | Hook.
  priority | Priority of the callback function.
  callback | Callback function.
  userdata | Userdata.

Returns
  TRUE if success.

See also
  NHookPriority
  NHookCallback

## ◆ n_hook_disconnect()

void n_hook_disconnect | ( | NHook * | hook,
|  | NHookCallback | callback,
|  | void * | userdata )

Disconnects callback function from hook.

Parameters

  hook | Hook.
  callback | Callback function.
  userdata | Userdata.

## ◆ n_hook_fire()

int n_hook_fire | ( | NHook * | hook,
|  | void * | data )

Executes callback functions associated with hook.

Parameters

  hook | Hook.
  data | Data to pass the callback functions as userdata.

Returns
  TRUE if success.

## ◆ n_hook_init()

void n_hook_init | ( | NHook * | hook | ) |

Initializes hook structure.

Parameters

  hook | Hook.