dbus-message-internal.h 5.46 KB
Newer Older
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 3 4 5
/* dbus-message-internal.h DBusMessage object internal interfaces
 *
 * Copyright (C) 2002  Red Hat Inc.
 *
6
 * Licensed under the Academic Free License version 2.1
7 8 9 10 11 12 13 14 15 16 17 18 19
 * 
 * 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
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 22 23 24 25
 *
 */
#ifndef DBUS_MESSAGE_INTERNAL_H
#define DBUS_MESSAGE_INTERNAL_H

26
#include <dbus/dbus-marshal-validate.h>
27
#include <dbus/dbus-message.h>
28
#include <dbus/dbus-resources.h>
29
#include <dbus/dbus-list.h>
30

31
DBUS_BEGIN_DECLS
32

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#ifdef DBUS_ENABLE_VERBOSE_MODE
void _dbus_message_trace_ref (DBusMessage *message,
                              int          old_refcount,
                              int          new_refcount,
                              const char  *why);
#else
/* this bypasses any "unused" warnings for the old and new refcount */
#define _dbus_message_trace_ref(m, o, n, w) \
  do \
  {\
    (void) (o); \
    (void) (n); \
  } while (0)
#endif

48 49
typedef struct DBusMessageLoader DBusMessageLoader;

50 51 52
void _dbus_message_get_network_data  (DBusMessage       *message,
				      const DBusString **header,
				      const DBusString **body);
53
void _dbus_message_get_unix_fds      (DBusMessage *message,
54 55
                                      const int **fds,
                                      unsigned *n_fds);
56

57 58
void        _dbus_message_lock                  (DBusMessage  *message);
void        _dbus_message_unlock                (DBusMessage  *message);
59
dbus_bool_t _dbus_message_add_counter           (DBusMessage  *message,
60
                                                 DBusCounter  *counter);
61
void        _dbus_message_add_counter_link      (DBusMessage  *message,
62
                                                 DBusList     *link);
63
void        _dbus_message_remove_counter        (DBusMessage  *message,
64
                                                 DBusCounter  *counter);
65

66
DBusMessageLoader* _dbus_message_loader_new                   (void);
67
DBusMessageLoader* _dbus_message_loader_ref                   (DBusMessageLoader  *loader);
68
void               _dbus_message_loader_unref                 (DBusMessageLoader  *loader);
69

70 71
void               _dbus_message_loader_get_buffer            (DBusMessageLoader  *loader,
                                                               DBusString        **buffer);
72
void               _dbus_message_loader_return_buffer         (DBusMessageLoader  *loader,
73
                                                               DBusString         *buffer);
74 75 76 77 78 79 80 81

dbus_bool_t        _dbus_message_loader_get_unix_fds          (DBusMessageLoader  *loader,
                                                               int               **fds,
                                                               unsigned           *max_n_fds);
void               _dbus_message_loader_return_unix_fds       (DBusMessageLoader  *loader,
                                                               int                *fds,
                                                               unsigned            n_fds);

82 83
dbus_bool_t        _dbus_message_loader_queue_messages        (DBusMessageLoader  *loader);
DBusMessage*       _dbus_message_loader_peek_message          (DBusMessageLoader  *loader);
84
DBusMessage*       _dbus_message_loader_pop_message           (DBusMessageLoader  *loader);
85
DBusList*          _dbus_message_loader_pop_message_link      (DBusMessageLoader  *loader);
86 87
void               _dbus_message_loader_putback_message_link  (DBusMessageLoader  *loader,
                                                               DBusList           *link);
88

89
dbus_bool_t        _dbus_message_loader_get_is_corrupted      (DBusMessageLoader  *loader);
90
DBusValidity       _dbus_message_loader_get_corruption_reason (DBusMessageLoader  *loader);
91

92 93 94 95
void               _dbus_message_loader_set_max_message_size  (DBusMessageLoader  *loader,
                                                               long                size);
long               _dbus_message_loader_get_max_message_size  (DBusMessageLoader  *loader);

96 97 98
void               _dbus_message_loader_set_max_message_unix_fds(DBusMessageLoader  *loader,
                                                                 long                n);
long               _dbus_message_loader_get_max_message_unix_fds(DBusMessageLoader  *loader);
99
int                _dbus_message_loader_get_pending_fds_count (DBusMessageLoader  *loader);
100 101 102
void               _dbus_message_loader_set_pending_fds_function (DBusMessageLoader *loader,
                                                                  void (* callback) (void *),
                                                                  void *data);
103

104 105 106 107
typedef struct DBusInitialFDs DBusInitialFDs;
DBusInitialFDs *_dbus_check_fdleaks_enter (void);
void            _dbus_check_fdleaks_leave (DBusInitialFDs *fds);

108
DBUS_END_DECLS
109

110
#endif /* DBUS_MESSAGE_INTERNAL_H */