This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b35a57d32a6850685ea5c1a93db16cc90258b41f Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jun 26 13:50:19 2021 +0200 src/x2goclient-network{,-ssh}.{c,h}: split options classes out into src/x2goclient-network-options{,-ssh}.{c,h}. This is a consequence of not being able to define multiple sections per file. Since gtk-doc requires file and section names to match (which, honestly, is totally redundant), we need to split up each class into separate files. --- src/x2goclient-network-options-ssh.c | 95 ++++++++++++++++++++++++++++++++++++ src/x2goclient-network-options-ssh.h | 46 +++++++++++++++++ src/x2goclient-network-options.c | 70 ++++++++++++++++++++++++++ src/x2goclient-network-options.h | 47 ++++++++++++++++++ src/x2goclient-network-ssh.c | 58 ---------------------- src/x2goclient-network-ssh.h | 10 +--- src/x2goclient-network.c | 34 ------------- src/x2goclient-network.h | 12 +---- 8 files changed, 261 insertions(+), 111 deletions(-) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c new file mode 100644 index 0000000..49b9883 --- /dev/null +++ b/src/x2goclient-network-options-ssh.c @@ -0,0 +1,95 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-options-ssh.c - X2Go Client options for SSH network + handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#include <glib.h> +#include <glib/gi18n.h> +#include <gmodule.h> +#include <gio/gio.h> + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "x2goclient.h" +#include "x2goclient-network-options-ssh.h" +#include "x2goclient-utils.h" + + +/** + * SECTION:x2goclient-network-options-ssh + * @short_description: Class encapsulating OpenSSH options + * @see_also: #X2GoClientNetworkOptions + * @stability: Unstable + * @include: libx2goclient/x2goclient-network-options-ssh.h + * + * #X2GoClientNetworkOptions is a class used to encapsulate OpenSSH options. + * + * Currently, there are no common options that could be used generically for + * all dependent classes, so it's essentially fully empty (yet providing the + * general skeleton). + * + * An example of a more abstract implementation is #X2GoClientNetworkOptions. + */ +struct _X2GoClientNetworkOptionsSSH { + X2GoClientNetworkOptions parent_instance; + + /* + * Eventually, this class should encapsulate/handle every ssh_config option, + * but for now it's a stub. + */ +}; + +G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS) + +static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { +} + +static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * const self) { +} + +/** + * x2goclient_network_options_ssh_to_array: + * @self: (not optional): an #X2GoClientNetworkOptionsSSH. + * + * Converts the internal state to an #GPtrArray of SSH client options that can + * be passed by prefixing "-o" to each entry when calling the SSH client. + * + * Returns: (transfer full) (element-type utf8): a pointer to the converted + * result as a #GPtrArray. %NULL + * on error. + * + * Since: 0.0.0 + */ +GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self) { + GPtrArray *ret = NULL; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_OPTIONS_SSH (self), ret); + + g_ptr_array_new_with_free_func (&x2goclient_clear_strings); + + /* Implement actual options fetching here. */ + + return (ret); +} diff --git a/src/x2goclient-network-options-ssh.h b/src/x2goclient-network-options-ssh.h new file mode 100644 index 0000000..1d467eb --- /dev/null +++ b/src/x2goclient-network-options-ssh.h @@ -0,0 +1,46 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-options-ssh.h - X2Go Client options for SSH network + handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#ifndef x2goclient_network_options_ssh_h +#define x2goclient_network_options_ssh_h + +#include <glib-object.h> +#include <gmodule.h> + +#include "x2goclient-network-options.h" + +G_BEGIN_DECLS + +#define X2GOCLIENT_TYPE_NETWORK_OPTIONS_SSH (x2goclient_network_options_ssh_get_type ()) +G_DECLARE_FINAL_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT, NETWORK_OPTIONS_SSH, X2GoClientNetworkOptions) + +X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void); + + +GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self); + +G_END_DECLS + +#endif /* x2goclient_network_options_ssh_h */ diff --git a/src/x2goclient-network-options.c b/src/x2goclient-network-options.c new file mode 100644 index 0000000..8dd0116 --- /dev/null +++ b/src/x2goclient-network-options.c @@ -0,0 +1,70 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-options.c - X2Go Client options for high-level network + handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#include <glib.h> +#include <glib/gi18n.h> +#include <gio/gio.h> + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "x2goclient.h" +#include "x2goclient-network-options.h" + + +/** + * SECTION:x2goclient-network-options + * @short_description: Abstract base class encapsulating network options + * @stability: Unstable + * @include: libx2goclient/x2goclient-network-options.h + * + * #X2GoClientNetworkOptions is an abstract base class used to encapsulate + * network options. + * + * Currently, there are no common options that could be used generically for + * all dependent classes, so it's essentially fully empty (yet providing the + * general skeleton). + * + * An example of a more concrete implementation is + * #X2GoClientNetworkOptionsSSH. + * + * Since: 0.0.0 + */ + +/* Not sure if we need this, so comment out for now. */ +/* +typedef struct X2GoClientNetworkOptionsPrivate_ { +} X2GoClientNetworkOptionsPrivate; +*/ + +/* G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) */ +G_DEFINE_ABSTRACT_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) + +static void x2goclient_network_options_class_init (X2GoClientNetworkOptionsClass * const klass) { +} + +static void x2goclient_network_options_init (X2GoClientNetworkOptions * const self) { +} diff --git a/src/x2goclient-network-options.h b/src/x2goclient-network-options.h new file mode 100644 index 0000000..c1653ef --- /dev/null +++ b/src/x2goclient-network-options.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-options.h - X2Go Client options for high-level network + handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#ifndef x2goclient_network_options_h +#define x2goclient_network_options_h + +#include <glib-object.h> +#include <gio/gio.h> + + +G_BEGIN_DECLS + +#define X2GOCLIENT_TYPE_NETWORK_OPTIONS (x2goclient_network_options_get_type ()) +G_DECLARE_DERIVABLE_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, X2GOCLIENT, NETWORK_OPTIONS, GObject) + +struct _X2GoClientNetworkOptionsClass { + GObjectClass parent_class; + + /* Reserved space for future functions... */ + gpointer padding[100]; +}; + +G_END_DECLS + +#endif /* x2goclient_network_options_h */ diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index a356521..03c5885 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -52,64 +52,6 @@ #include "x2goclient-openssh-bugs.h" -/** - * SECTION:x2goclient-network-options-ssh - * @short_description: Class encapsulating OpenSSH options - * @see_also: #X2GoClientNetworkOptions - * @stability: Unstable - * @include: libx2goclient/x2goclient-network-ssh.h - * - * #X2GoClientNetworkOptions is a class used to encapsulate OpenSSH options. - * - * Currently, there are no common options that could be used generically for - * all dependent classes, so it's essentially fully empty (yet providing the - * general skeleton). - * - * An example of a more abstract implementation is #X2GoClientNetworkOptions. - */ -struct _X2GoClientNetworkOptionsSSH { - X2GoClientNetworkOptions parent_instance; - - /* - * Eventually, this class should encapsulate/handle every ssh_config option, - * but for now it's a stub. - */ -}; - -G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS) - -static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { -} - -static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * const self) { -} - -/** - * x2goclient_network_options_ssh_to_array: - * @self: (not optional): an #X2GoClientNetworkOptionsSSH. - * - * Converts the internal state to an #GPtrArray of SSH client options that can - * be passed by prefixing "-o" to each entry when calling the SSH client. - * - * Returns: (transfer full) (element-type utf8): a pointer to the converted - * result as a #GPtrArray. %NULL - * on error. - * - * Since: 0.0.0 - */ -GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self) { - GPtrArray *ret = NULL; - - g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_OPTIONS_SSH (self), ret); - - g_ptr_array_new_with_free_func (&x2goclient_clear_strings); - - /* Implement actual options fetching here. */ - - return (ret); -} - - /* * sockaddr_ho: * @sho_family: address family entry, typed #sa_family_t. Should always be set diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index cdec7ba..05150ca 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -29,18 +29,10 @@ #include <gmodule.h> #include "x2goclient-network.h" +#include "x2goclient-network-options-ssh.h" G_BEGIN_DECLS -#define X2GOCLIENT_TYPE_NETWORK_OPTIONS_SSH (x2goclient_network_options_ssh_get_type ()) -G_DECLARE_FINAL_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT, NETWORK_OPTIONS_SSH, X2GoClientNetworkOptions) - -X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void); - - -GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self); - - #define X2GOCLIENT_TYPE_NETWORK_SSH (x2goclient_network_ssh_get_type ()) G_DECLARE_FINAL_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT, NETWORK_SSH, X2GoClientNetwork) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 4e9e7f9..27cc6b2 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -33,40 +33,6 @@ #include "x2goclient.h" #include "x2goclient-network.h" -/** - * SECTION:x2goclient-network-options - * @short_description: Abstract base class encapsulating network options - * @stability: Unstable - * @include: libx2goclient/x2goclient-network.h - * - * #X2GoClientNetworkOptions is an abstract base class used to encapsulate - * network options. - * - * Currently, there are no common options that could be used generically for - * all dependent classes, so it's essentially fully empty (yet providing the - * general skeleton). - * - * An example of a more concrete implementation is - * #X2GoClientNetworkOptionsSSH. - * - * Since: 0.0.0 - */ - -/* Not sure if we need this, so comment out for now. */ -/* -typedef struct X2GoClientNetworkOptionsPrivate_ { -} X2GoClientNetworkOptionsPrivate; -*/ - -/* G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) */ -G_DEFINE_ABSTRACT_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) - -static void x2goclient_network_options_class_init (X2GoClientNetworkOptionsClass * const klass) { -} - -static void x2goclient_network_options_init (X2GoClientNetworkOptions * const self) { -} - /** * SECTION:x2goclient-network diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index 689d083..ea854cf 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -28,6 +28,8 @@ #include <glib-object.h> #include <gio/gio.h> +#include "x2goclient-network-options.h" + /* * We need this due to a bug in glib/gio. * @@ -39,16 +41,6 @@ G_BEGIN_DECLS -#define X2GOCLIENT_TYPE_NETWORK_OPTIONS (x2goclient_network_options_get_type ()) -G_DECLARE_DERIVABLE_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, X2GOCLIENT, NETWORK_OPTIONS, GObject) - -struct _X2GoClientNetworkOptionsClass { - GObjectClass parent_class; - - /* Reserved space for future functions... */ - gpointer padding[100]; -}; - #define X2GOCLIENT_TYPE_NETWORK (x2goclient_network_get_type ()) G_DECLARE_DERIVABLE_TYPE (X2GoClientNetwork, x2goclient_network, X2GOCLIENT, NETWORK, GObject) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git