dbus-resources.h
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-resources.h Resource tracking/limits
*
* Copyright (C) 2003 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef DBUS_RESOURCES_H
#define DBUS_RESOURCES_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-macros-internal.h>
#include <dbus/dbus-errors.h>
#include <dbus/dbus-connection.h>
DBUS_BEGIN_DECLS
typedef struct DBusCounter DBusCounter;
typedef void (* DBusCounterNotifyFunction) (DBusCounter *counter,
void *user_data);
DBUS_EMBEDDED_TESTS_EXPORT
DBusCounter* _dbus_counter_new (void);
DBusCounter* _dbus_counter_ref (DBusCounter *counter);
DBUS_EMBEDDED_TESTS_EXPORT
void _dbus_counter_unref (DBusCounter *counter);
DBUS_EMBEDDED_TESTS_EXPORT
void _dbus_counter_adjust_size (DBusCounter *counter,
long delta);
DBUS_EMBEDDED_TESTS_EXPORT
void _dbus_counter_adjust_unix_fd (DBusCounter *counter,
long delta);
void _dbus_counter_notify (DBusCounter *counter);
DBUS_EMBEDDED_TESTS_EXPORT
long _dbus_counter_get_size_value (DBusCounter *counter);
DBUS_EMBEDDED_TESTS_EXPORT
long _dbus_counter_get_unix_fd_value (DBusCounter *counter);
void _dbus_counter_set_notify (DBusCounter *counter,
long size_guard_value,
long unix_fd_guard_value,
DBusCounterNotifyFunction function,
void *user_data);
/* if DBUS_ENABLE_STATS */
long _dbus_counter_get_peak_size_value (DBusCounter *counter);
long _dbus_counter_get_peak_unix_fd_value (DBusCounter *counter);
DBUS_END_DECLS
#endif /* DBUS_RESOURCES_H */
DBUS_BEGIN_DECLS
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
Definition dbus-macros.h:36
DBUS_END_DECLS
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.
Definition dbus-macros.h:37
_dbus_counter_set_notify
void _dbus_counter_set_notify(DBusCounter *counter, long size_guard_value, long unix_fd_guard_value, DBusCounterNotifyFunction function, void *user_data)
Sets the notify function for this counter; the notify function is called whenever the counter's value...
Definition dbus-resources.c:313
_dbus_counter_new
DBUS_EMBEDDED_TESTS_EXPORT DBusCounter * _dbus_counter_new(void)
Creates a new DBusCounter.
Definition dbus-resources.c:91
_dbus_counter_get_unix_fd_value
DBUS_EMBEDDED_TESTS_EXPORT long _dbus_counter_get_unix_fd_value(DBusCounter *counter)
Gets the current value of the unix fd counter.
Definition dbus-resources.c:292
_dbus_counter_unref
DBUS_EMBEDDED_TESTS_EXPORT void _dbus_counter_unref(DBusCounter *counter)
Decrements refcount of the counter and possibly finalizes the counter.
Definition dbus-resources.c:138
_dbus_counter_get_size_value
DBUS_EMBEDDED_TESTS_EXPORT long _dbus_counter_get_size_value(DBusCounter *counter)
Gets the current value of the size counter.
Definition dbus-resources.c:276
_dbus_counter_adjust_unix_fd
DBUS_EMBEDDED_TESTS_EXPORT void _dbus_counter_adjust_unix_fd(DBusCounter *counter, long delta)
Adjusts the value of the unix fd counter by the given delta which may be positive or negative.
Definition dbus-resources.c:238
_dbus_counter_notify
void _dbus_counter_notify(DBusCounter *counter)
Calls the notify function from _dbus_counter_set_notify(), if that function has been specified and th...
Definition dbus-resources.c:209
_dbus_counter_ref
DBusCounter * _dbus_counter_ref(DBusCounter *counter)
Increments refcount of the counter.
Definition dbus-resources.c:118
_dbus_counter_adjust_size
DBUS_EMBEDDED_TESTS_EXPORT void _dbus_counter_adjust_size(DBusCounter *counter, long delta)
Adjusts the value of the size counter by the given delta which may be positive or negative.
Definition dbus-resources.c:169
DBusCounter
Internals of DBusCounter.
Definition dbus-resources.c:57