Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:54:39

0001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
0002 /* dbus-address.h  Server address parser.
0003  *
0004  * Copyright (C) 2003  CodeFactory AB
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_ADDRESS_H
0030 #define DBUS_ADDRESS_H
0031 
0032 #include <dbus/dbus-types.h>
0033 #include <dbus/dbus-errors.h>
0034 
0035 DBUS_BEGIN_DECLS
0036 
0037 /**
0038  * @addtogroup DBusAddress
0039  * @{
0040  */
0041 
0042 /** Opaque type representing one of the semicolon-separated items in an address */
0043 typedef struct DBusAddressEntry DBusAddressEntry;
0044 
0045 DBUS_EXPORT
0046 dbus_bool_t dbus_parse_address            (const char         *address,
0047                        DBusAddressEntry ***entry_result,
0048                        int                *array_len,
0049                        DBusError          *error);
0050 DBUS_EXPORT
0051 const char *dbus_address_entry_get_value  (DBusAddressEntry   *entry,
0052                        const char         *key);
0053 DBUS_EXPORT
0054 const char *dbus_address_entry_get_method (DBusAddressEntry   *entry);
0055 DBUS_EXPORT
0056 void        dbus_address_entries_free     (DBusAddressEntry  **entries);
0057 
0058 DBUS_EXPORT
0059 char* dbus_address_escape_value   (const char *value);
0060 DBUS_EXPORT
0061 char* dbus_address_unescape_value (const char *value,
0062                                    DBusError  *error);
0063 
0064 /**
0065  * Clear a variable or struct member that contains an array of #DBusAddressEntry.
0066  * If it does not contain #NULL, the entries that were previously
0067  * there are freed with dbus_address_entries_free().
0068  *
0069  * This is similar to dbus_clear_connection(): see that function
0070  * for more details.
0071  *
0072  * @param pointer_to_entries A pointer to a variable or struct member.
0073  * pointer_to_entries must not be #NULL, but *pointer_to_entries
0074  * may be #NULL.
0075  */
0076 static inline void
0077 dbus_clear_address_entries (DBusAddressEntry ***pointer_to_entries)
0078 {
0079   _dbus_clear_pointer_impl (DBusAddressEntry *, pointer_to_entries,
0080                             dbus_address_entries_free);
0081 }
0082 
0083 /** @} */
0084 
0085 DBUS_END_DECLS
0086 
0087 #endif /* DBUS_ADDRESS_H */