libkeepalive
Loading...
Searching...
No Matches
keepalive-heartbeat.h
Go to the documentation of this file.
1/****************************************************************************************
2**
3** Copyright (C) 2014 - 2018 Jolla Ltd.
4**
5** Author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
6**
7** All rights reserved.
8**
9** This file is part of nemo-keepalive package.
10**
11** You may use this file under the terms of the GNU Lesser General
12** Public License version 2.1 as published by the Free Software Foundation
13** and appearing in the file license.lgpl included in the packaging
14** of this file.
15**
16** This library is free software; you can redistribute it and/or
17** modify it under the terms of the GNU Lesser General Public
18** License version 2.1 as published by the Free Software Foundation
19** and appearing in the file license.lgpl included in the packaging
20** of this file.
21**
22** This library is distributed in the hope that it will be useful,
23** but WITHOUT ANY WARRANTY; without even the implied warranty of
24** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25** Lesser General Public License for more details.
26**
27****************************************************************************************/
28
33
34#ifndef KEEPALIVE_GLIB_HEARTBEAT_H_
35# define KEEPALIVE_GLIB_HEARTBEAT_H_
36
37# include <stdbool.h>
38
39# ifdef __cplusplus
40extern "C" {
41# elif 0
42} /* fool JED indentation ... */
43# endif
44
45# pragma GCC visibility push(default)
46
52typedef struct heartbeat_t heartbeat_t;
53
58typedef void (*heartbeat_wakeup_fn)(void *aptr);
59
69typedef void (*heartbeat_free_fn)(void *aptr);
70
83
93
103
118 int delay_lo,
119 int delay_hi);
120
134 heartbeat_wakeup_fn notify_cb,
135 void *user_data,
136 heartbeat_free_fn user_free_cb);
137
143
149
150# pragma GCC visibility pop
151
152# ifdef __cplusplus
153};
154# endif
155
156#endif /* KEEPALIVE_GLIB_HEARTBEAT_H_ */
void heartbeat_unref(heartbeat_t *self)
struct heartbeat_t heartbeat_t
Definition keepalive-heartbeat.h:52
void heartbeat_start(heartbeat_t *self)
void(* heartbeat_wakeup_fn)(void *aptr)
Definition keepalive-heartbeat.h:58
heartbeat_t * heartbeat_new(void)
void heartbeat_set_notify(heartbeat_t *self, heartbeat_wakeup_fn notify_cb, void *user_data, heartbeat_free_fn user_free_cb)
void heartbeat_set_delay(heartbeat_t *self, int delay_lo, int delay_hi)
void(* heartbeat_free_fn)(void *aptr)
Definition keepalive-heartbeat.h:69
heartbeat_t * heartbeat_ref(heartbeat_t *self)
void heartbeat_stop(heartbeat_t *self)