From b761aa05a7dc2a038e2279785dbfaca7a7955a45 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 7 Dec 2015 12:26:44 +0100 Subject: [PATCH] common: Move typedef to separate header to avoid circular deps --- common/Makefile.am.inc | 1 + common/xdg-app-common-types.h | 28 ++++++++++++++++++++++++++++ common/xdg-app-dir.c | 1 + common/xdg-app-dir.h | 5 +---- common/xdg-app-run.h | 3 +-- 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 common/xdg-app-common-types.h diff --git a/common/Makefile.am.inc b/common/Makefile.am.inc index 9719ad27..324a8695 100644 --- a/common/Makefile.am.inc +++ b/common/Makefile.am.inc @@ -21,6 +21,7 @@ $(systemd_dbus_built_sources) : data/org.freedesktop.systemd1.xml $(NULL) libxdgapp_common_la_SOURCES = \ + common/xdg-app-common-types.h \ common/xdg-app-dir.c \ common/xdg-app-dir.h \ common/xdg-app-run.c \ diff --git a/common/xdg-app-common-types.h b/common/xdg-app-common-types.h new file mode 100644 index 00000000..ab49c2c7 --- /dev/null +++ b/common/xdg-app-common-types.h @@ -0,0 +1,28 @@ +/* + * Copyright © 2015 Red Hat, Inc + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * Authors: + * Alexander Larsson + */ + +#ifndef __XDG_APP_COMMON_TYPES_H__ +#define __XDG_APP_COMMON_TYPES_H__ + +typedef struct XdgAppDir XdgAppDir; +typedef struct XdgAppDeploy XdgAppDeploy; +typedef struct XdgAppContext XdgAppContext; + +#endif /* __XDG_APP_COMMON_TYPES_H__ */ diff --git a/common/xdg-app-dir.c b/common/xdg-app-dir.c index ac09d2a8..1e345bec 100644 --- a/common/xdg-app-dir.c +++ b/common/xdg-app-dir.c @@ -30,6 +30,7 @@ #include "xdg-app-dir.h" #include "xdg-app-utils.h" +#include "xdg-app-run.h" #include "errno.h" diff --git a/common/xdg-app-dir.h b/common/xdg-app-dir.h index 5dc0b8dc..65cf0f1a 100644 --- a/common/xdg-app-dir.h +++ b/common/xdg-app-dir.h @@ -23,10 +23,7 @@ #include -#include - -typedef struct XdgAppDir XdgAppDir; -typedef struct XdgAppDeploy XdgAppDeploy; +#include #define XDG_APP_TYPE_DIR xdg_app_dir_get_type() #define XDG_APP_DIR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XDG_APP_TYPE_DIR, XdgAppDir)) diff --git a/common/xdg-app-run.h b/common/xdg-app-run.h index e2181648..60855217 100644 --- a/common/xdg-app-run.h +++ b/common/xdg-app-run.h @@ -23,11 +23,10 @@ #include "libglnx/libglnx.h" #include "dbus-proxy/xdg-app-proxy.h" +#include "xdg-app-common-types.h" void xdg_app_run_in_transient_unit (const char *app_id); -typedef struct XdgAppContext XdgAppContext; - #define XDG_APP_METADATA_GROUP_CONTEXT "Context" #define XDG_APP_METADATA_GROUP_SESSION_BUS_POLICY "Session Bus Policy" #define XDG_APP_METADATA_GROUP_ENVIRONMENT "Environment"