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

ngfd-plugin

hook.h
Go to the documentation of this file.
1/*
2 * ngfd - Non-graphic feedback daemon
3 *
4 * Copyright (C) 2010 Nokia Corporation.
5 * Contact: Xun Chen <xun.chen@nokia.com>
6 *
7 * This work is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This work is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this work; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef N_HOOK_H
23#define N_HOOK_H
24
25#include <glib.h>
26
30 typedef enum _NHookPriority
31{
32 N_HOOK_PRIORITY_LAST = -100,
33 N_HOOK_PRIORITY_LOW = -10,
34 N_HOOK_PRIORITY_DEFAULT = 0,
35 N_HOOK_PRIORITY_HIGH = 10,
36 N_HOOK_PRIORITY_FIRST = 100
37} NHookPriority;
38
40 typedef struct _NHook
41{
42 gchar *name;
43 GList *slots;
44} NHook;
45
47 typedef void (*NHookCallback) (NHook *hook, void *data, void *userdata);
48
52 void n_hook_init (NHook *hook);
53
63 int n_hook_connect (NHook *hook, int priority, NHookCallback callback, void *userdata);
64
70 void n_hook_disconnect (NHook *hook, NHookCallback callback, void *userdata);
71
77 int n_hook_fire (NHook *hook, void *data);
78
79#endif /* N_HOOK_H */
_NHookPriority
_NHookPriority
Enum defining the order in which callbacks are executed.
Definition hook.h:31
N_HOOK_PRIORITY_LAST
@ N_HOOK_PRIORITY_LAST
Definition hook.h:32
N_HOOK_PRIORITY_HIGH
@ N_HOOK_PRIORITY_HIGH
Definition hook.h:35
N_HOOK_PRIORITY_DEFAULT
@ N_HOOK_PRIORITY_DEFAULT
Definition hook.h:34
N_HOOK_PRIORITY_FIRST
@ N_HOOK_PRIORITY_FIRST
Definition hook.h:36
N_HOOK_PRIORITY_LOW
@ N_HOOK_PRIORITY_LOW
Definition hook.h:33
n_hook_disconnect
void n_hook_disconnect(NHook *hook, NHookCallback callback, void *userdata)
Disconnects callback function from hook.
n_hook_fire
int n_hook_fire(NHook *hook, void *data)
Executes callback functions associated with hook.
NHookCallback
void(* NHookCallback)(NHook *hook, void *data, void *userdata)
Hook callback function.
Definition hook.h:47
n_hook_init
void n_hook_init(NHook *hook)
Initializes hook structure.
NHookPriority
enum _NHookPriority NHookPriority
Enum defining the order in which callbacks are executed.
NHook
struct _NHook NHook
Internal hook structure.
n_hook_connect
int n_hook_connect(NHook *hook, int priority, NHookCallback callback, void *userdata)
Connect callback function to hook.
_NHook
Internal hook structure.
Definition hook.h:41
_NHook::name
gchar * name
Definition hook.h:42
_NHook::slots
GList * slots
Definition hook.h:43