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
30typedef enum _NHookPriority
31{
38
40typedef struct _NHook
41{
42 gchar *name;
43 GList *slots;
45
47typedef void (*NHookCallback) (NHook *hook, void *data, void *userdata);
48
52void n_hook_init (NHook *hook);
53
63int n_hook_connect (NHook *hook, int priority, NHookCallback callback, void *userdata);
64
70void n_hook_disconnect (NHook *hook, NHookCallback callback, void *userdata);
71
77int n_hook_fire (NHook *hook, void *data);
78
79#endif /* N_HOOK_H */
_NHookPriority
Enum defining the order in which callbacks are executed.
Definition hook.h:31
@ N_HOOK_PRIORITY_LAST
Definition hook.h:32
@ N_HOOK_PRIORITY_HIGH
Definition hook.h:35
@ N_HOOK_PRIORITY_DEFAULT
Definition hook.h:34
@ N_HOOK_PRIORITY_FIRST
Definition hook.h:36
@ N_HOOK_PRIORITY_LOW
Definition hook.h:33
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.
void(* NHookCallback)(NHook *hook, void *data, void *userdata)
Hook callback function.
Definition hook.h:47
void n_hook_init(NHook *hook)
Initializes hook structure.
enum _NHookPriority NHookPriority
Enum defining the order in which callbacks are executed.
struct _NHook NHook
Internal hook structure.
int n_hook_connect(NHook *hook, int priority, NHookCallback callback, void *userdata)
Connect callback function to hook.
Internal hook structure.
Definition hook.h:41
gchar * name
Definition hook.h:42
GList * slots
Definition hook.h:43