Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:13

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