Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:55:32

0001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
0002 /* dbus-pending-call.h Object representing a call in progress.
0003  *
0004  * Copyright (C) 2002, 2003 Red Hat Inc.
0005  *
0006  * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
0007  *
0008  * Licensed under the Academic Free License version 2.1
0009  *
0010  * This program is free software; you can redistribute it and/or modify
0011  * it under the terms of the GNU General Public License as published by
0012  * the Free Software Foundation; either version 2 of the License, or
0013  * (at your option) any later version.
0014  *
0015  * This program is distributed in the hope that it will be useful,
0016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0018  * GNU General Public License for more details.
0019  *
0020  * You should have received a copy of the GNU General Public License
0021  * along with this program; if not, write to the Free Software
0022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0023  *
0024  */
0025 #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
0026 #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
0027 #endif
0028 
0029 #ifndef DBUS_PENDING_CALL_H
0030 #define DBUS_PENDING_CALL_H
0031 
0032 #include <dbus/dbus-macros.h>
0033 #include <dbus/dbus-types.h>
0034 #include <dbus/dbus-connection.h>
0035 
0036 DBUS_BEGIN_DECLS
0037 
0038 /**
0039  * @addtogroup DBusPendingCall
0040  * @{
0041  */
0042 
0043 #define DBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
0044 #define DBUS_TIMEOUT_USE_DEFAULT (-1)
0045 
0046 DBUS_EXPORT
0047 DBusPendingCall* dbus_pending_call_ref       (DBusPendingCall               *pending);
0048 DBUS_EXPORT
0049 void         dbus_pending_call_unref         (DBusPendingCall               *pending);
0050 DBUS_EXPORT
0051 dbus_bool_t  dbus_pending_call_set_notify    (DBusPendingCall               *pending,
0052                                               DBusPendingCallNotifyFunction  function,
0053                                               void                          *user_data,
0054                                               DBusFreeFunction               free_user_data);
0055 DBUS_EXPORT
0056 void         dbus_pending_call_cancel        (DBusPendingCall               *pending);
0057 DBUS_EXPORT
0058 dbus_bool_t  dbus_pending_call_get_completed (DBusPendingCall               *pending);
0059 DBUS_EXPORT
0060 DBusMessage* dbus_pending_call_steal_reply   (DBusPendingCall               *pending);
0061 DBUS_EXPORT
0062 void         dbus_pending_call_block         (DBusPendingCall               *pending);
0063 
0064 DBUS_EXPORT
0065 dbus_bool_t dbus_pending_call_allocate_data_slot (dbus_int32_t     *slot_p);
0066 DBUS_EXPORT
0067 void        dbus_pending_call_free_data_slot     (dbus_int32_t     *slot_p);
0068 DBUS_EXPORT
0069 dbus_bool_t dbus_pending_call_set_data           (DBusPendingCall  *pending,
0070                                                   dbus_int32_t      slot,
0071                                                   void             *data,
0072                                                   DBusFreeFunction  free_data_func);
0073 DBUS_EXPORT
0074 void*       dbus_pending_call_get_data           (DBusPendingCall  *pending,
0075                                                   dbus_int32_t      slot);
0076 
0077 /**
0078  * Clear a variable or struct member that contains a #DBusPendingCall.
0079  * If it does not contain #NULL, the pending call that was previously
0080  * there is unreferenced with dbus_pending_call_unref().
0081  *
0082  * This is very similar to dbus_clear_connection(): see that function
0083  * for more details.
0084  *
0085  * @param pointer_to_pending_call A pointer to a variable or struct member.
0086  * pointer_to_pending_call must not be #NULL, but *pointer_to_pending_call
0087  * may be #NULL.
0088  */
0089 static inline void
0090 dbus_clear_pending_call (DBusPendingCall **pointer_to_pending_call)
0091 {
0092   _dbus_clear_pointer_impl (DBusPendingCall, pointer_to_pending_call,
0093                             dbus_pending_call_unref);
0094 }
0095 
0096 /** @} */
0097 
0098 DBUS_END_DECLS
0099 
0100 #endif /* DBUS_PENDING_CALL_H */