dbus-server.h
上传用户:detong
上传日期:2022-06-22
资源大小:20675k
文件大小:5k
源码类别:

系统编程

开发平台:

Unix_Linux

  1. /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
  2. /* dbus-server.h DBusServer object
  3.  *
  4.  * Copyright (C) 2002, 2003  Red Hat Inc.
  5.  *
  6.  * Licensed under the Academic Free License version 2.1
  7.  * 
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 2 of the License, or
  11.  * (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  * 
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  21.  *
  22.  */
  23. #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
  24. #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
  25. #endif
  26. #ifndef DBUS_SERVER_H
  27. #define DBUS_SERVER_H
  28. #include <dbus/dbus-errors.h>
  29. #include <dbus/dbus-message.h>
  30. #include <dbus/dbus-connection.h>
  31. #include <dbus/dbus-protocol.h>
  32. DBUS_BEGIN_DECLS
  33. /**
  34.  * @addtogroup DBusServer
  35.  * @{
  36.  */
  37. typedef struct DBusServer DBusServer;
  38. /** Called when a new connection to the server is available. Must reference and save the new
  39.  * connection, or close the new connection. Set with dbus_server_set_new_connection_function().
  40.  */
  41. typedef void (* DBusNewConnectionFunction) (DBusServer     *server,
  42.                                             DBusConnection *new_connection,
  43.                                             void           *data);
  44. DBusServer* dbus_server_listen           (const char     *address,
  45.                                           DBusError      *error);
  46. DBusServer* dbus_server_ref              (DBusServer     *server);
  47. void        dbus_server_unref            (DBusServer     *server);
  48. void        dbus_server_disconnect       (DBusServer     *server);
  49. dbus_bool_t dbus_server_get_is_connected (DBusServer     *server);
  50. char*       dbus_server_get_address      (DBusServer     *server);
  51. char*       dbus_server_get_id           (DBusServer     *server);
  52. void        dbus_server_set_new_connection_function (DBusServer                *server,
  53.                                                      DBusNewConnectionFunction  function,
  54.                                                      void                      *data,
  55.                                                      DBusFreeFunction           free_data_function);
  56. dbus_bool_t dbus_server_set_watch_functions         (DBusServer                *server,
  57.                                                      DBusAddWatchFunction       add_function,
  58.                                                      DBusRemoveWatchFunction    remove_function,
  59.                                                      DBusWatchToggledFunction   toggled_function,
  60.                                                      void                      *data,
  61.                                                      DBusFreeFunction           free_data_function);
  62. dbus_bool_t dbus_server_set_timeout_functions       (DBusServer                *server,
  63.                                                      DBusAddTimeoutFunction     add_function,
  64.                                                      DBusRemoveTimeoutFunction  remove_function,
  65.                                                      DBusTimeoutToggledFunction toggled_function,
  66.                                                      void                      *data,
  67.                                                      DBusFreeFunction           free_data_function);
  68. dbus_bool_t dbus_server_set_auth_mechanisms         (DBusServer                *server,
  69.                                                      const char               **mechanisms);
  70. dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t     *slot_p);
  71. void        dbus_server_free_data_slot     (dbus_int32_t     *slot_p);
  72. dbus_bool_t dbus_server_set_data           (DBusServer       *server,
  73.                                             int               slot,
  74.                                             void             *data,
  75.                                             DBusFreeFunction  free_data_func);
  76. void*       dbus_server_get_data           (DBusServer       *server,
  77.                                             int               slot);
  78. /** @} */
  79. DBUS_END_DECLS
  80. #endif /* DBUS_SERVER_H */