| 1 | /* |
| 2 | * Copyright © 2014, 2016 Red Hat, Inc |
| 3 | * |
| 4 | * SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2.1 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * Authors: |
| 20 | * Alexander Larsson <[email protected]> |
| 21 | * Matthias Clasen <[email protected]> |
| 22 | */ |
| 23 | |
| 24 | #pragma once |
| 25 | |
| 26 | #include <stdio.h> |
| 27 | #include <sys/types.h> |
| 28 | #include <sys/stat.h> |
| 29 | #include <unistd.h> |
| 30 | |
| 31 | #include <gio/gio.h> |
| 32 | #include <errno.h> |
| 33 | |
| 34 | #include "glib-backports.h"cxx . . $ `<file>/src/glib-backports.h`/ |
| 35 | #include "xdp-sealed-fd.h"cxx . . $ `<file>/src/xdp-sealed-fd.h`/ |
| 36 | |
| 37 | #define DESKTOP_PORTAL_OBJECT_PATHcxx . . $ `src/xdp-utils.h:37:9`! "/org/freedesktop/portal/desktop" |
| 38 | |
| 39 | gintcxx . . $ gint# xdp_mkstempatcxx . . $ xdp_mkstempat(711c6947cb9bcc7a). (int dir_fd, |
| 40 | gcharcxx . . $ gchar# *tmpl, |
| 41 | int flags, |
| 42 | int mode); |
| 43 | |
| 44 | gbooleancxx . . $ gboolean# xdp_is_valid_app_idcxx . . $ xdp_is_valid_app_id(5c4306d8553b3696). (const char *string); |
| 45 | |
| 46 | char *xdp_get_app_id_from_desktop_idcxx . . $ xdp_get_app_id_from_desktop_id(a8b8e32347182212). (const char *desktop_id); |
| 47 | |
| 48 | typedef enumcxx . . $ $anonymous_type_8e225346ad0b2bac_0# |
| 49 | { |
| 50 | XDP_ICON_TYPE_DESKTOPcxx . . $ XDP_ICON_TYPE_DESKTOP., |
| 51 | XDP_ICON_TYPE_NOTIFICATIONcxx . . $ XDP_ICON_TYPE_NOTIFICATION., |
| 52 | } XdpIconTypecxx . . $ XdpIconType#; |
| 53 | |
| 54 | gbooleancxx . . $ gboolean# xdp_validate_iconcxx . . $ xdp_validate_icon(d2530f8b074c20c3). (XdpSealedFdcxx . . $ XdpSealedFd# *icon, |
| 55 | XdpIconTypecxx . . $ XdpIconType# icon_type, |
| 56 | char **out_format, |
| 57 | char **out_size); |
| 58 | |
| 59 | gbooleancxx . . $ gboolean# xdp_validate_soundcxx . . $ xdp_validate_sound(e41b30277faed9bf). (XdpSealedFdcxx . . $ XdpSealedFd# *sound); |
| 60 | |
| 61 | typedef void (*XdpPeerDiedCallbackcxx . . $ XdpPeerDiedCallback#) (const char *name); |
| 62 | |
| 63 | typedef int XdpFdcxx . . $ XdpFd#; |
| 64 | G_DEFINE_AUTO_CLEANUP_FREE_FUNCcxx . . $ `<external>/12741050725406041920/gmacros.h:1420:9`!(XdpFd, close, -1) |
| 65 | |
| 66 | void xdp_set_documents_mountpointcxx . . $ xdp_set_documents_mountpoint(85c52e162fed56f9). (const char *path); |
| 67 | const char * xdp_get_documents_mountpointcxx . . $ xdp_get_documents_mountpoint(33a1f659e94feb42). (void); |
| 68 | char * xdp_get_alternate_document_pathcxx . . $ xdp_get_alternate_document_path(a713fe7b9a57cf96). (const char *path, const char *app_id); |
| 69 | |
| 70 | void xdp_connection_track_name_ownerscxx . . $ xdp_connection_track_name_owners(ab8c569ccc4a109e). (GDBusConnectioncxx . . $ GDBusConnection# *connection, |
| 71 | XdpPeerDiedCallbackcxx . . $ XdpPeerDiedCallback# peer_died_cb); |
| 72 | |
| 73 | gbooleancxx . . $ gboolean# xdp_variant_contains_keycxx . . $ xdp_variant_contains_key(3acb228297ef692c). (GVariantcxx . . $ GVariant# *dictionary, |
| 74 | const char *key); |
| 75 | |
| 76 | typedef structcxx . . $ $anonymous_type_8e225346ad0b2bac_1# { |
| 77 | const char *keycxx . . $ $anonymous_type_8e225346ad0b2bac_1#key.; |
| 78 | const GVariantTypecxx . . $ GVariantType# *typecxx . . $ $anonymous_type_8e225346ad0b2bac_1#type.; |
| 79 | gbooleancxx . . $ gboolean# (* validatecxx . . $ $anonymous_type_8e225346ad0b2bac_1#validate.) (const char *key, GVariantcxx . . $ GVariant# *value, GVariantcxx . . $ GVariant# *options, GErrorcxx . . $ GError# **error); |
| 80 | } XdpOptionKeycxx . . $ XdpOptionKey#; |
| 81 | |
| 82 | gbooleancxx . . $ gboolean# xdp_filter_optionscxx . . $ xdp_filter_options(d63f67045969ba55). (GVariantcxx . . $ GVariant# *options_in, |
| 83 | GVariantBuildercxx . . $ GVariantBuilder# *options_out, |
| 84 | const XdpOptionKeycxx . . $ XdpOptionKey# *supported_options, |
| 85 | int n_supported_options, |
| 86 | GErrorcxx . . $ GError# **error); |
| 87 | |
| 88 | typedef enumcxx . . $ $anonymous_type_8e225346ad0b2bac_2# { |
| 89 | XDG_DESKTOP_PORTAL_ERROR_FAILEDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_FAILED. = 0, |
| 90 | XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT., |
| 91 | XDG_DESKTOP_PORTAL_ERROR_NOT_FOUNDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_NOT_FOUND., |
| 92 | XDG_DESKTOP_PORTAL_ERROR_EXISTScxx . . $ XDG_DESKTOP_PORTAL_ERROR_EXISTS., |
| 93 | XDG_DESKTOP_PORTAL_ERROR_NOT_ALLOWEDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_NOT_ALLOWED., |
| 94 | XDG_DESKTOP_PORTAL_ERROR_CANCELLEDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_CANCELLED., |
| 95 | XDG_DESKTOP_PORTAL_ERROR_WINDOW_DESTROYEDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_WINDOW_DESTROYED. |
| 96 | } XdgDesktopPortalErrorEnumcxx . . $ XdgDesktopPortalErrorEnum#; |
| 97 | |
| 98 | #define XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`! xdg_desktop_portal_error_quark () |
| 99 | |
| 100 | GQuarkcxx . . $ GQuark# xdg_desktop_portal_error_quarkcxx . . $ xdg_desktop_portal_error_quark(db52760e79bf9054). (void); |
| 101 | |
| 102 | #define XDP_AUTOLOCKcxx . . $ `src/xdp-utils.h:102:9`!(name) \ |
| 103 | g_autoptr(GMutexLocker) G_PASTE (name ## locker, __LINE__) = \ |
| 104 | g_mutex_locker_new (&G_LOCK_NAME (name)); \ |
| 105 | (void) G_PASTE (name ## locker, __LINE__); |
| 106 | |
| 107 | |
| 108 | char * xdp_maybe_quotecxx . . $ xdp_maybe_quote(2050848944e00d54). (const char *arg, |
| 109 | gbooleancxx . . $ gboolean# quote_escape); |
| 110 | char * xdp_maybe_quote_argvcxx . . $ xdp_maybe_quote_argv(ad8dedb09956fee3). (const char *argv[], |
| 111 | gbooleancxx . . $ gboolean# quote_escape); |
| 112 | |
| 113 | char * xdp_spawncxx . . $ xdp_spawn(7346b297b379bb8a). (GErrorcxx . . $ GError# **error, |
| 114 | const char *argv0, |
| 115 | ...) G_GNUC_NULL_TERMINATEDcxx . . $ `<external>/12741050725406041920/gmacros.h:330:9`!; |
| 116 | char * xdp_spawn_fullcxx . . $ xdp_spawn_full(45b3cf19a9373672). (const char * const *argv, |
| 117 | int source_fd, |
| 118 | int target_fd, |
| 119 | GErrorcxx . . $ GError# **error); |
| 120 | |
| 121 | char * xdp_canonicalize_filenamecxx . . $ xdp_canonicalize_filename(a8b8e32347182212). (const char *path); |
| 122 | gbooleancxx . . $ gboolean# xdp_has_path_prefixcxx . . $ xdp_has_path_prefix(5ae29d726ae57f88). (const char *str, |
| 123 | const char *prefix); |
| 124 | |
| 125 | pid_tcxx . . $ pid_t# xdp_pidfd_to_pidcxx . . $ xdp_pidfd_to_pid(aa2d95a526319da2). (int pidfd, |
| 126 | GErrorcxx . . $ GError# **error); |
| 127 | |
| 128 | gbooleancxx . . $ gboolean# xdp_pidfds_to_pidscxx . . $ xdp_pidfds_to_pids(94ca259b32cf3f78). (const int *pidfds, |
| 129 | pid_tcxx . . $ pid_t# *pids, |
| 130 | gintcxx . . $ gint# count, |
| 131 | GErrorcxx . . $ GError# **error); |
| 132 | |
| 133 | gbooleancxx . . $ gboolean# xdp_pidfd_get_namespacecxx . . $ xdp_pidfd_get_namespace(40904b3abaf3a9b1). (int pidfd, |
| 134 | ino_tcxx . . $ ino_t# *ns, |
| 135 | GErrorcxx . . $ GError# **error); |
| 136 | |
| 137 | gbooleancxx . . $ gboolean# xdp_map_pids_fullcxx . . $ xdp_map_pids_full(3e57b5d6b165cf51). (DIRcxx . . $ DIR# *proc, |
| 138 | ino_tcxx . . $ ino_t# pidns, |
| 139 | pid_tcxx . . $ pid_t# *pids, |
| 140 | guintcxx . . $ guint# n_pids, |
| 141 | uid_tcxx . . $ uid_t# target_uid, |
| 142 | GErrorcxx . . $ GError# **error); |
| 143 | |
| 144 | gbooleancxx . . $ gboolean# xdp_map_pidscxx . . $ xdp_map_pids(5f334dc0f459180). (ino_tcxx . . $ ino_t# pidns, |
| 145 | pid_tcxx . . $ pid_t# *pids, |
| 146 | guintcxx . . $ guint# n_pids, |
| 147 | GErrorcxx . . $ GError# **error); |
| 148 | |
| 149 | gbooleancxx . . $ gboolean# xdp_map_tidscxx . . $ xdp_map_tids(766ff89140cb637c). (ino_tcxx . . $ ino_t# pidns, |
| 150 | pid_tcxx . . $ pid_t# owner_pid, |
| 151 | pid_tcxx . . $ pid_t# *tids, |
| 152 | guintcxx . . $ guint# n_tids, |
| 153 | GErrorcxx . . $ GError# **error); |
| 154 | |
| 155 | #define XDP_EXPORT_TESTcxx . . $ `src/xdp-utils.h:155:9`! XDP_EXPORTcxx . . $ `src/xdp-utils.h:156:9`! |
| 156 | #define XDP_EXPORTcxx . . $ `src/xdp-utils.h:156:9`! __attribute__((visibility("default"))) extern |