D-Bus 1.15.12
dbus-timeout.h
1/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2/* dbus-timeout.h DBusTimeout internal interfaces
3 *
4 * Copyright (C) 2003 CodeFactory AB
5 *
6 * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
7 *
8 * Licensed under the Academic Free License version 2.1
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 *
24 */
25#ifndef DBUS_TIMEOUT_H
26#define DBUS_TIMEOUT_H
27
28#include <dbus/dbus-connection.h>
29#include <dbus/dbus-internals.h>
30
32
38/* Public methods on DBusTimeout are in dbus-connection.h */
39
41
43typedef dbus_bool_t (* DBusTimeoutHandler) (void *data);
44
45DBUS_PRIVATE_EXPORT
46DBusTimeout* _dbus_timeout_new (int interval,
47 DBusTimeoutHandler handler,
48 void *data,
49 DBusFreeFunction free_data_function);
51DBUS_PRIVATE_EXPORT
52void _dbus_timeout_unref (DBusTimeout *timeout);
53DBUS_PRIVATE_EXPORT
55 int interval);
56DBUS_PRIVATE_EXPORT
58
60void _dbus_timeout_list_free (DBusTimeoutList *timeout_list);
61dbus_bool_t _dbus_timeout_list_set_functions (DBusTimeoutList *timeout_list,
62 DBusAddTimeoutFunction add_function,
63 DBusRemoveTimeoutFunction remove_function,
64 DBusTimeoutToggledFunction toggled_function,
65 void *data,
66 DBusFreeFunction free_data_function);
67dbus_bool_t _dbus_timeout_list_add_timeout (DBusTimeoutList *timeout_list,
68 DBusTimeout *timeout);
70 DBusTimeout *timeout);
72 DBusTimeout *timeout,
73 dbus_bool_t enabled);
74
75DBUS_PRIVATE_EXPORT
76dbus_bool_t _dbus_timeout_needs_restart (DBusTimeout *timeout);
77DBUS_PRIVATE_EXPORT
79
83
84#endif /* DBUS_TIMEOUT_H */
void(* DBusTimeoutToggledFunction)(DBusTimeout *timeout, void *data)
Called when dbus_timeout_get_enabled() may return a different value than it did before.
dbus_bool_t(* DBusAddTimeoutFunction)(DBusTimeout *timeout, void *data)
Called when libdbus needs a new timeout to be monitored by the main loop.
void(* DBusRemoveTimeoutFunction)(DBusTimeout *timeout, void *data)
Called when libdbus no longer needs a timeout to be monitored by the main loop.
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
Definition dbus-macros.h:36
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.
Definition dbus-macros.h:37
void(* DBusFreeFunction)(void *memory)
The type of a function which frees a block of memory.
Definition dbus-memory.h:65
dbus_bool_t _dbus_timeout_list_add_timeout(DBusTimeoutList *timeout_list, DBusTimeout *timeout)
Adds a new timeout to the timeout list, invoking the application DBusAddTimeoutFunction if appropriat...
void _dbus_timeout_list_free(DBusTimeoutList *timeout_list)
Frees a DBusTimeoutList.
void _dbus_timeout_list_toggle_timeout(DBusTimeoutList *timeout_list, DBusTimeout *timeout, dbus_bool_t enabled)
Sets a timeout to the given enabled state, invoking the application's DBusTimeoutToggledFunction if a...
DBusTimeoutList * _dbus_timeout_list_new(void)
Creates a new timeout list.
void _dbus_timeout_unref(DBusTimeout *timeout)
Decrements the reference count of a DBusTimeout object and finalizes the object if the count reaches ...
dbus_bool_t _dbus_timeout_list_set_functions(DBusTimeoutList *timeout_list, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)
Sets the timeout functions.
void _dbus_timeout_disable(DBusTimeout *timeout)
Disable the timeout.
DBusTimeout * _dbus_timeout_new(int interval, DBusTimeoutHandler handler, void *data, DBusFreeFunction free_data_function)
Creates a new DBusTimeout, enabled by default.
void _dbus_timeout_restart(DBusTimeout *timeout, int interval)
Change the timeout interval to be interval milliseconds from now (forgetting when the timeout was ini...
dbus_bool_t(* DBusTimeoutHandler)(void *data)
function to run when the timeout is handled
DBusTimeout * _dbus_timeout_ref(DBusTimeout *timeout)
Increments the reference count of a DBusTimeout object.
void _dbus_timeout_restarted(DBusTimeout *timeout)
Mark timeout as restarted (setting timestamps is responsibility of the event loop).
void _dbus_timeout_list_remove_timeout(DBusTimeoutList *timeout_list, DBusTimeout *timeout)
Removes a timeout from the timeout list, invoking the application's DBusRemoveTimeoutFunction if appr...
dbus_bool_t _dbus_timeout_needs_restart(DBusTimeout *timeout)
Returns whether a timeout needs restart time counting in the event loop.
DBusTimeoutList implementation details.
Internals of DBusTimeout.