diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2022-12-11 21:48:03 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2023-01-03 13:56:25 +0000 |
commit | f0a9f0955846187ca6e6a04a0ca191ba2592d5af (patch) | |
tree | fc8149d03ceb9c094c84bcae4c219f73824bd8aa /src | |
parent | d30ba8414ae28ed1116e4120975497b8add45ea0 (diff) |
plugins: setup new helper macros to define plugins
We also remove the plugin headers completely as they are not really
required anywhere.
Diffstat (limited to 'src')
83 files changed, 273 insertions, 1996 deletions
diff --git a/src/mm-plugin.h b/src/mm-plugin.h index 1c071383..7bcb4313 100644 --- a/src/mm-plugin.h +++ b/src/mm-plugin.h @@ -18,6 +18,7 @@ #ifndef MM_PLUGIN_H #define MM_PLUGIN_H +#include <config.h> #include <glib.h> #include <glib-object.h> @@ -27,18 +28,9 @@ #include "mm-device.h" #include "mm-kernel-device.h" -#define MM_PLUGIN_MAJOR_VERSION 4 +#define MM_PLUGIN_MAJOR_VERSION 5 #define MM_PLUGIN_MINOR_VERSION 0 -#if defined (G_HAVE_GNUC_VISIBILITY) -#define VISIBILITY __attribute__((visibility("protected"))) -#else -#define VISIBILITY -#endif - -#define MM_PLUGIN_DEFINE_MAJOR_VERSION VISIBILITY int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; -#define MM_PLUGIN_DEFINE_MINOR_VERSION VISIBILITY int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; - #define MM_TYPE_PLUGIN (mm_plugin_get_type ()) #define MM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN, MMPlugin)) #define MM_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN, MMPluginClass)) diff --git a/src/plugins/altair/mm-plugin-altair-lte.c b/src/plugins/altair/mm-plugin-altair-lte.c index e58fe176..6049d93b 100644 --- a/src/plugins/altair/mm-plugin-altair-lte.c +++ b/src/plugins/altair/mm-plugin-altair-lte.c @@ -24,15 +24,13 @@ #include <string.h> #include <gmodule.h> -#include "mm-plugin-altair-lte.h" +#include "mm-plugin-common.h" #include "mm-private-boxed-types.h" #include "mm-broadband-modem-altair-lte.h" #include "mm-log.h" -G_DEFINE_TYPE (MMPluginAltairLte, mm_plugin_altair_lte, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_ALTAIR_LTE mm_plugin_altair_lte_get_type () +MM_DEFINE_PLUGIN (ALTAIR_LTE, altair_lte, AltairLte) /*****************************************************************************/ /* Custom commands for AT probing */ @@ -67,8 +65,9 @@ create_modem (MMPlugin *self, } /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) + +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_altair_lte (void) { static const gchar *subsystems[] = { "tty", "net", NULL }; static const mm_uint16_pair products[] = { diff --git a/src/plugins/altair/mm-plugin-altair-lte.h b/src/plugins/altair/mm-plugin-altair-lte.h deleted file mode 100644 index 385a5cc2..00000000 --- a/src/plugins/altair/mm-plugin-altair-lte.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2013 Altair Semiconductor - * - * Author: Ori Inbar <ori.inbar@altair-semi.com> - */ - -#ifndef MM_PLUGIN_ALTAIR_LTE_H -#define MM_PLUGIN_ALTAIR_LTE_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_ALTAIR_LTE (mm_plugin_altair_lte_get_type ()) -#define MM_PLUGIN_ALTAIR_LTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_ALTAIR_LTE, MMPluginAltairLte)) -#define MM_PLUGIN_ALTAIR_LTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_ALTAIR_LTE, MMPluginAltairLteClass)) -#define MM_IS_PLUGIN_ALTAIR_LTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_ALTAIR_LTE)) -#define MM_IS_PLUGIN_ALTAIR_LTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_ALTAIR_LTE)) -#define MM_PLUGIN_ALTAIR_LTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_ALTAIR_LTE, MMPluginAltairLteClass)) - -typedef struct { - MMPlugin parent; -} MMPluginAltairLte; - -typedef struct { - MMPluginClass parent; -} MMPluginAltairLteClass; - -GType mm_plugin_altair_lte_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_ALTAIR_LTE_H */ diff --git a/src/plugins/anydata/mm-plugin-anydata.c b/src/plugins/anydata/mm-plugin-anydata.c index 4b8f0a84..aacd3cc1 100644 --- a/src/plugins/anydata/mm-plugin-anydata.c +++ b/src/plugins/anydata/mm-plugin-anydata.c @@ -22,17 +22,15 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-anydata.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-anydata.h" #if defined WITH_QMI #include "mm-broadband-modem-qmi.h" #endif -G_DEFINE_TYPE (MMPluginAnydata, mm_plugin_anydata, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_ANYDATA mm_plugin_anydata_get_type () +MM_DEFINE_PLUGIN (ANYDATA, anydata, Anydata) /*****************************************************************************/ @@ -66,8 +64,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_anydata (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x16d5, 0 }; diff --git a/src/plugins/anydata/mm-plugin-anydata.h b/src/plugins/anydata/mm-plugin-anydata.h deleted file mode 100644 index 765c19a5..00000000 --- a/src/plugins/anydata/mm-plugin-anydata.h +++ /dev/null @@ -1,43 +0,0 @@ - -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_ANYDATA_H -#define MM_PLUGIN_ANYDATA_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_ANYDATA (mm_plugin_anydata_get_type ()) -#define MM_PLUGIN_ANYDATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydata)) -#define MM_PLUGIN_ANYDATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydataClass)) -#define MM_IS_PLUGIN_ANYDATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_ANYDATA)) -#define MM_IS_PLUGIN_ANYDATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_ANYDATA)) -#define MM_PLUGIN_ANYDATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydataClass)) - -typedef struct { - MMPlugin parent; -} MMPluginAnydata; - -typedef struct { - MMPluginClass parent; -} MMPluginAnydataClass; - -GType mm_plugin_anydata_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_ANYDATA_H */ diff --git a/src/plugins/broadmobi/mm-plugin-broadmobi.c b/src/plugins/broadmobi/mm-plugin-broadmobi.c index 805663fe..2a6502a9 100644 --- a/src/plugins/broadmobi/mm-plugin-broadmobi.c +++ b/src/plugins/broadmobi/mm-plugin-broadmobi.c @@ -20,17 +20,15 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-broadmobi.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" #if defined WITH_QMI # include "mm-broadband-modem-qmi.h" #endif -G_DEFINE_TYPE (MMPluginBroadmobi, mm_plugin_broadmobi, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_BROADMOBI mm_plugin_broadmobi_get_type () +MM_DEFINE_PLUGIN (BROADMOBI, broadmobi, Broadmobi) /*****************************************************************************/ @@ -64,8 +62,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_broadmobi (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x2020, 0 }; diff --git a/src/plugins/broadmobi/mm-plugin-broadmobi.h b/src/plugins/broadmobi/mm-plugin-broadmobi.h deleted file mode 100644 index 1f46cfce..00000000 --- a/src/plugins/broadmobi/mm-plugin-broadmobi.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2020 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_BROADMOBI_H -#define MM_PLUGIN_BROADMOBI_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_BROADMOBI (mm_plugin_broadmobi_get_type ()) -#define MM_PLUGIN_BROADMOBI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_BROADMOBI, MMPluginBroadmobi)) -#define MM_PLUGIN_BROADMOBI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_BROADMOBI, MMPluginBroadmobiClass)) -#define MM_IS_PLUGIN_BROADMOBI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_BROADMOBI)) -#define MM_IS_PLUGIN_BROADMOBI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_BROADMOBI)) -#define MM_PLUGIN_BROADMOBI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_BROADMOBI, MMPluginBroadmobiClass)) - -typedef struct { - MMPlugin parent; -} MMPluginBroadmobi; - -typedef struct { - MMPluginClass parent; -} MMPluginBroadmobiClass; - -GType mm_plugin_broadmobi_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_BROADMOBI_H */ diff --git a/src/plugins/cinterion/mm-plugin-cinterion.c b/src/plugins/cinterion/mm-plugin-cinterion.c index b0f3f992..0dad015f 100644 --- a/src/plugins/cinterion/mm-plugin-cinterion.c +++ b/src/plugins/cinterion/mm-plugin-cinterion.c @@ -27,7 +27,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-cinterion.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-cinterion.h" #include "mm-log-object.h" @@ -39,10 +39,8 @@ #include "mm-broadband-modem-mbim-cinterion.h" #endif -G_DEFINE_TYPE (MMPluginCinterion, mm_plugin_cinterion, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_CINTERION mm_plugin_cinterion_get_type () +MM_DEFINE_PLUGIN (CINTERION, cinterion, Cinterion) /*****************************************************************************/ /* Custom init */ @@ -179,8 +177,8 @@ grab_port (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_cinterion (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", "wwan", NULL }; static const gchar *vendor_strings[] = { "cinterion", "siemens", NULL }; diff --git a/src/plugins/cinterion/mm-plugin-cinterion.h b/src/plugins/cinterion/mm-plugin-cinterion.h deleted file mode 100644 index a8a3b6bb..00000000 --- a/src/plugins/cinterion/mm-plugin-cinterion.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2011 Ammonit Measurement GmbH - * Author: Aleksander Morgado <aleksander@lanedo.com> - */ - -#ifndef MM_PLUGIN_CINTERION_H -#define MM_PLUGIN_CINTERION_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_CINTERION (mm_plugin_cinterion_get_type ()) -#define MM_PLUGIN_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterion)) -#define MM_PLUGIN_CINTERION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterionClass)) -#define MM_IS_PLUGIN_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_CINTERION)) -#define MM_IS_PLUGIN_CINTERION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_CINTERION)) -#define MM_PLUGIN_CINTERION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterionClass)) - -typedef struct { - MMPlugin parent; -} MMPluginCinterion; - -typedef struct { - MMPluginClass parent; -} MMPluginCinterionClass; - -GType mm_plugin_cinterion_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_CINTERION_H */ diff --git a/src/plugins/dell/mm-plugin-dell.c b/src/plugins/dell/mm-plugin-dell.c index 63d8b4da..47b2a69b 100644 --- a/src/plugins/dell/mm-plugin-dell.c +++ b/src/plugins/dell/mm-plugin-dell.c @@ -25,7 +25,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-dell.h" +#include "mm-plugin-common.h" #include "mm-common-novatel.h" #include "mm-private-boxed-types.h" #include "mm-broadband-modem.h" @@ -48,12 +48,12 @@ #include "mm-broadband-modem-mbim-foxconn.h" #endif -#define MAX_PORT_PROBE_TIMEOUTS 3 +#define MM_TYPE_PLUGIN_DELL mm_plugin_dell_get_type () +MM_DEFINE_PLUGIN (DELL, dell, Dell) -G_DEFINE_TYPE (MMPluginDell, mm_plugin_dell, MM_TYPE_PLUGIN) +/*****************************************************************************/ -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MAX_PORT_PROBE_TIMEOUTS 3 #define TAG_DELL_MANUFACTURER "dell-manufacturer" typedef enum { @@ -489,8 +489,8 @@ grab_port (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_dell (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendors[] = { 0x413c, 0 }; diff --git a/src/plugins/dell/mm-plugin-dell.h b/src/plugins/dell/mm-plugin-dell.h deleted file mode 100644 index cc1a539e..00000000 --- a/src/plugins/dell/mm-plugin-dell.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2015 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_DELL_H -#define MM_PLUGIN_DELL_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_DELL (mm_plugin_dell_get_type ()) -#define MM_PLUGIN_DELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_DELL, MMPluginDell)) -#define MM_PLUGIN_DELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_DELL, MMPluginDellClass)) -#define MM_IS_PLUGIN_DELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_DELL)) -#define MM_IS_PLUGIN_DELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_DELL)) -#define MM_PLUGIN_DELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_DELL, MMPluginDellClass)) - -typedef struct { - MMPlugin parent; -} MMPluginDell; - -typedef struct { - MMPluginClass parent; -} MMPluginDellClass; - -GType mm_plugin_dell_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_DELL_H */ diff --git a/src/plugins/dlink/mm-plugin-dlink.c b/src/plugins/dlink/mm-plugin-dlink.c index 72476e2e..264c608e 100644 --- a/src/plugins/dlink/mm-plugin-dlink.c +++ b/src/plugins/dlink/mm-plugin-dlink.c @@ -20,17 +20,15 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-dlink.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" #if defined WITH_QMI # include "mm-broadband-modem-qmi.h" #endif -G_DEFINE_TYPE (MMPluginDlink, mm_plugin_dlink, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_DLINK mm_plugin_dlink_get_type () +MM_DEFINE_PLUGIN (DLINK, dlink, Dlink) /*****************************************************************************/ @@ -64,8 +62,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_dlink (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x2001, 0 }; diff --git a/src/plugins/dlink/mm-plugin-dlink.h b/src/plugins/dlink/mm-plugin-dlink.h deleted file mode 100644 index 13453cb0..00000000 --- a/src/plugins/dlink/mm-plugin-dlink.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2019 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_DLINK_H -#define MM_PLUGIN_DLINK_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_DLINK (mm_plugin_dlink_get_type ()) -#define MM_PLUGIN_DLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_DLINK, MMPluginDlink)) -#define MM_PLUGIN_DLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_DLINK, MMPluginDlinkClass)) -#define MM_IS_PLUGIN_DLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_DLINK)) -#define MM_IS_PLUGIN_DLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_DLINK)) -#define MM_PLUGIN_DLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_DLINK, MMPluginDlinkClass)) - -typedef struct { - MMPlugin parent; -} MMPluginDlink; - -typedef struct { - MMPluginClass parent; -} MMPluginDlinkClass; - -GType mm_plugin_dlink_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_DLINK_H */ diff --git a/src/plugins/fibocom/mm-plugin-fibocom.c b/src/plugins/fibocom/mm-plugin-fibocom.c index 4ef4d483..f85f9911 100644 --- a/src/plugins/fibocom/mm-plugin-fibocom.c +++ b/src/plugins/fibocom/mm-plugin-fibocom.c @@ -20,7 +20,7 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-fibocom.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" #include "mm-broadband-modem-xmm.h" #include "mm-broadband-modem-fibocom.h" @@ -36,10 +36,8 @@ #include "mm-broadband-modem-qmi.h" #endif -G_DEFINE_TYPE (MMPluginFibocom, mm_plugin_fibocom, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_FIBOCOM mm_plugin_fibocom_get_type () +MM_DEFINE_PLUGIN (FIBOCOM, fibocom, Fibocom) /*****************************************************************************/ @@ -102,8 +100,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_fibocom (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x2cb7, 0x1782, 0 }; diff --git a/src/plugins/fibocom/mm-plugin-fibocom.h b/src/plugins/fibocom/mm-plugin-fibocom.h deleted file mode 100644 index e5289979..00000000 --- a/src/plugins/fibocom/mm-plugin-fibocom.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2018 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_FIBOCOM_H -#define MM_PLUGIN_FIBOCOM_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_FIBOCOM (mm_plugin_fibocom_get_type ()) -#define MM_PLUGIN_FIBOCOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocom)) -#define MM_PLUGIN_FIBOCOM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocomClass)) -#define MM_IS_PLUGIN_FIBOCOM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_FIBOCOM)) -#define MM_IS_PLUGIN_FIBOCOM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_FIBOCOM)) -#define MM_PLUGIN_FIBOCOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocomClass)) - -typedef struct { - MMPlugin parent; -} MMPluginFibocom; - -typedef struct { - MMPluginClass parent; -} MMPluginFibocomClass; - -GType mm_plugin_fibocom_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_FIBOCOM_H */ diff --git a/src/plugins/foxconn/mm-plugin-foxconn.c b/src/plugins/foxconn/mm-plugin-foxconn.c index d248fb05..ecc0df2c 100644 --- a/src/plugins/foxconn/mm-plugin-foxconn.c +++ b/src/plugins/foxconn/mm-plugin-foxconn.c @@ -25,7 +25,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-foxconn.h" +#include "mm-plugin-common.h" #include "mm-log-object.h" #include "mm-broadband-modem.h" @@ -37,10 +37,8 @@ #include "mm-broadband-modem-mbim-foxconn.h" #endif -G_DEFINE_TYPE (MMPluginFoxconn, mm_plugin_foxconn, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_FOXCONN mm_plugin_foxconn_get_type () +MM_DEFINE_PLUGIN (FOXCONN, foxconn, Foxconn) /*****************************************************************************/ @@ -86,8 +84,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_foxconn (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", "wwan", NULL }; static const guint16 vendor_ids[] = { diff --git a/src/plugins/foxconn/mm-plugin-foxconn.h b/src/plugins/foxconn/mm-plugin-foxconn.h deleted file mode 100644 index 4a22ceeb..00000000 --- a/src/plugins/foxconn/mm-plugin-foxconn.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2019 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_FOXCONN_H -#define MM_PLUGIN_FOXCONN_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_FOXCONN (mm_plugin_foxconn_get_type ()) -#define MM_PLUGIN_FOXCONN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_FOXCONN, MMPluginFoxconn)) -#define MM_PLUGIN_FOXCONN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_FOXCONN, MMPluginFoxconnClass)) -#define MM_IS_PLUGIN_FOXCONN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_FOXCONN)) -#define MM_IS_PLUGIN_FOXCONN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_FOXCONN)) -#define MM_PLUGIN_FOXCONN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_FOXCONN, MMPluginFoxconnClass)) - -typedef struct { - MMPlugin parent; -} MMPluginFoxconn; - -typedef struct { - MMPluginClass parent; -} MMPluginFoxconnClass; - -GType mm_plugin_foxconn_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_FOXCONN_H */ diff --git a/src/plugins/generic/mm-plugin-generic.c b/src/plugins/generic/mm-plugin-generic.c index 6dd37d59..1791c924 100644 --- a/src/plugins/generic/mm-plugin-generic.c +++ b/src/plugins/generic/mm-plugin-generic.c @@ -28,7 +28,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-generic.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" #include "mm-serial-parsers.h" #include "mm-log-object.h" @@ -41,10 +41,8 @@ #include "mm-broadband-modem-mbim.h" #endif -G_DEFINE_TYPE (MMPluginGeneric, mm_plugin_generic, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_GENERIC mm_plugin_generic_get_type () +MM_DEFINE_PLUGIN (GENERIC, generic, Generic) /*****************************************************************************/ @@ -89,8 +87,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_generic (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", "wwan", NULL }; diff --git a/src/plugins/generic/mm-plugin-generic.h b/src/plugins/generic/mm-plugin-generic.h deleted file mode 100644 index 12f9dd9d..00000000 --- a/src/plugins/generic/mm-plugin-generic.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2009 Red Hat, Inc. - */ - -#ifndef MM_PLUGIN_GENERIC_H -#define MM_PLUGIN_GENERIC_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_GENERIC (mm_plugin_generic_get_type ()) -#define MM_PLUGIN_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_GENERIC, MMPluginGeneric)) -#define MM_PLUGIN_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_GENERIC, MMPluginGenericClass)) -#define MM_IS_PLUGIN_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_GENERIC)) -#define MM_IS_PLUGIN_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_GENERIC)) -#define MM_PLUGIN_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_GENERIC, MMPluginGenericClass)) - -typedef struct { - MMPlugin parent; -} MMPluginGeneric; - -typedef struct { - MMPluginClass parent; -} MMPluginGenericClass; - -GType mm_plugin_generic_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_GENERIC_H */ diff --git a/src/plugins/gosuncn/mm-plugin-gosuncn.c b/src/plugins/gosuncn/mm-plugin-gosuncn.c index 010e93eb..d140e482 100644 --- a/src/plugins/gosuncn/mm-plugin-gosuncn.c +++ b/src/plugins/gosuncn/mm-plugin-gosuncn.c @@ -20,7 +20,7 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-gosuncn.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" #if defined WITH_QMI @@ -31,10 +31,8 @@ # include "mm-broadband-modem-mbim.h" #endif -G_DEFINE_TYPE (MMPluginGosuncn, mm_plugin_gosuncn, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_GOSUNCN mm_plugin_gosuncn_get_type () +MM_DEFINE_PLUGIN (GOSUNCN, gosuncn, Gosuncn) /*****************************************************************************/ @@ -80,8 +78,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_gosuncn (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x305a, 0 }; diff --git a/src/plugins/gosuncn/mm-plugin-gosuncn.h b/src/plugins/gosuncn/mm-plugin-gosuncn.h deleted file mode 100644 index a50e3089..00000000 --- a/src/plugins/gosuncn/mm-plugin-gosuncn.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2020 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_GOSUNCN_H -#define MM_PLUGIN_GOSUNCN_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_GOSUNCN (mm_plugin_gosuncn_get_type ()) -#define MM_PLUGIN_GOSUNCN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_GOSUNCN, MMPluginGosuncn)) -#define MM_PLUGIN_GOSUNCN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_GOSUNCN, MMPluginGosuncnClass)) -#define MM_IS_PLUGIN_GOSUNCN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_GOSUNCN)) -#define MM_IS_PLUGIN_GOSUNCN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_GOSUNCN)) -#define MM_PLUGIN_GOSUNCN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_GOSUNCN, MMPluginGosuncnClass)) - -typedef struct { - MMPlugin parent; -} MMPluginGosuncn; - -typedef struct { - MMPluginClass parent; -} MMPluginGosuncnClass; - -GType mm_plugin_gosuncn_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_GOSUNCN_H */ diff --git a/src/plugins/haier/mm-plugin-haier.c b/src/plugins/haier/mm-plugin-haier.c index a0951c27..e152c666 100644 --- a/src/plugins/haier/mm-plugin-haier.c +++ b/src/plugins/haier/mm-plugin-haier.c @@ -19,13 +19,11 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" -#include "mm-plugin-haier.h" -G_DEFINE_TYPE (MMPluginHaier, mm_plugin_haier, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_HAIER mm_plugin_haier_get_type () +MM_DEFINE_PLUGIN (HAIER, haier, Haier) /*****************************************************************************/ @@ -48,8 +46,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_haier (void) { static const gchar *subsystems[] = { "tty", NULL }; static const guint16 vendor_ids[] = { 0x201e, 0 }; diff --git a/src/plugins/haier/mm-plugin-haier.h b/src/plugins/haier/mm-plugin-haier.h deleted file mode 100644 index e1fdfbb1..00000000 --- a/src/plugins/haier/mm-plugin-haier.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2014 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_HAIER_H -#define MM_PLUGIN_HAIER_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_HAIER (mm_plugin_haier_get_type ()) -#define MM_PLUGIN_HAIER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_HAIER, MMPluginHaier)) -#define MM_PLUGIN_HAIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_HAIER, MMPluginHaierClass)) -#define MM_IS_PLUGIN_HAIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_HAIER)) -#define MM_IS_PLUGIN_HAIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_HAIER)) -#define MM_PLUGIN_HAIER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_HAIER, MMPluginHaierClass)) - -typedef struct { - MMPlugin parent; -} MMPluginHaier; - -typedef struct { - MMPluginClass parent; -} MMPluginHaierClass; - -GType mm_plugin_haier_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_HAIER_H */ diff --git a/src/plugins/huawei/mm-plugin-huawei.c b/src/plugins/huawei/mm-plugin-huawei.c index ad8d32b0..89897e9e 100644 --- a/src/plugins/huawei/mm-plugin-huawei.c +++ b/src/plugins/huawei/mm-plugin-huawei.c @@ -26,7 +26,7 @@ #include <ModemManager-tags.h> #include "mm-port-enums-types.h" #include "mm-log.h" -#include "mm-plugin-huawei.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-huawei.h" #include "mm-modem-helpers-huawei.h" #include "mm-huawei-enums-types.h" @@ -39,10 +39,8 @@ #include "mm-broadband-modem-mbim.h" #endif -G_DEFINE_TYPE (MMPluginHuawei, mm_plugin_huawei, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_HUAWEI mm_plugin_huawei_get_type () +MM_DEFINE_PLUGIN (HUAWEI, huawei, Huawei) /*****************************************************************************/ /* Custom init */ @@ -697,8 +695,8 @@ grab_port (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_huawei (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x12d1, 0 }; diff --git a/src/plugins/huawei/mm-plugin-huawei.h b/src/plugins/huawei/mm-plugin-huawei.h deleted file mode 100644 index daba2055..00000000 --- a/src/plugins/huawei/mm-plugin-huawei.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org - */ - -#ifndef MM_PLUGIN_HUAWEI_H -#define MM_PLUGIN_HUAWEI_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_HUAWEI (mm_plugin_huawei_get_type ()) -#define MM_PLUGIN_HUAWEI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_HUAWEI, MMPluginHuawei)) -#define MM_PLUGIN_HUAWEI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_HUAWEI, MMPluginHuaweiClass)) -#define MM_IS_PLUGIN_HUAWEI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_HUAWEI)) -#define MM_IS_PLUGIN_HUAWEI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_HUAWEI)) -#define MM_PLUGIN_HUAWEI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_HUAWEI, MMPluginHuaweiClass)) - -typedef struct { - MMPlugin parent; -} MMPluginHuawei; - -typedef struct { - MMPluginClass parent; -} MMPluginHuaweiClass; - -GType mm_plugin_huawei_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_HUAWEI_H */ diff --git a/src/plugins/intel/mm-plugin-intel.c b/src/plugins/intel/mm-plugin-intel.c index d83edfba..62e23504 100644 --- a/src/plugins/intel/mm-plugin-intel.c +++ b/src/plugins/intel/mm-plugin-intel.c @@ -19,7 +19,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-intel.h" +#include "mm-plugin-common.h" #include "mm-log-object.h" #include "mm-broadband-modem.h" @@ -27,10 +27,10 @@ #include "mm-broadband-modem-mbim-intel.h" #endif -G_DEFINE_TYPE (MMPluginIntel, mm_plugin_intel, MM_TYPE_PLUGIN) +#define MM_TYPE_PLUGIN_INTEL mm_plugin_intel_get_type () +MM_DEFINE_PLUGIN (INTEL, intel, Intel) -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +/*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, @@ -61,8 +61,10 @@ create_modem (MMPlugin *self, product)); } -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +/*****************************************************************************/ + +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_intel (void) { static const gchar *subsystems[] = { "net", "wwan", NULL }; static const guint16 vendor_ids[] = { 0x8086, 0 }; diff --git a/src/plugins/intel/mm-plugin-intel.h b/src/plugins/intel/mm-plugin-intel.h deleted file mode 100644 index 3d2880b2..00000000 --- a/src/plugins/intel/mm-plugin-intel.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2021-2022 Intel Corporation - */ - -#ifndef MM_PLUGIN_INTEL_H -#define MM_PLUGIN_INTEL_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_INTEL (mm_plugin_intel_get_type ()) -#define MM_PLUGIN_INTEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_INTEL, MMPluginIntel)) -#define MM_PLUGIN_INTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_INTEL, MMPluginIntelClass)) -#define MM_IS_PLUGIN_INTEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_INTEL)) -#define MM_IS_PLUGIN_INTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_INTEL)) -#define MM_PLUGIN_INTEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_INTEL, MMPluginIntelClass)) - -typedef struct { - MMPlugin parent; -} MMPluginIntel; - -typedef struct { - MMPluginClass parent; -} MMPluginIntelClass; - -GType mm_plugin_intel_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_INTEL_H */ diff --git a/src/plugins/iridium/mm-plugin-iridium.c b/src/plugins/iridium/mm-plugin-iridium.c index 741847f8..6141b4e7 100644 --- a/src/plugins/iridium/mm-plugin-iridium.c +++ b/src/plugins/iridium/mm-plugin-iridium.c @@ -26,14 +26,14 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-iridium.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-iridium.h" #include "mm-private-boxed-types.h" -G_DEFINE_TYPE (MMPluginIridium, mm_plugin_iridium, MM_TYPE_PLUGIN) +#define MM_TYPE_PLUGIN_IRIDIUM mm_plugin_iridium_get_type () +MM_DEFINE_PLUGIN (IRIDIUM, iridium, Iridium) -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +/*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, @@ -54,8 +54,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_iridium (void) { static const gchar *subsystems[] = { "tty", NULL }; static const guint16 vendor_ids[] = { 0x1edd, 0 }; diff --git a/src/plugins/iridium/mm-plugin-iridium.h b/src/plugins/iridium/mm-plugin-iridium.h deleted file mode 100644 index b729ce98..00000000 --- a/src/plugins/iridium/mm-plugin-iridium.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2011 - 2012 Ammonit Measurement GmbH - * Author: Aleksander Morgado <aleksander@lanedo.com> - */ - -#ifndef MM_PLUGIN_IRIDIUM_H -#define MM_PLUGIN_IRIDIUM_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_IRIDIUM (mm_plugin_iridium_get_type ()) -#define MM_PLUGIN_IRIDIUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridium)) -#define MM_PLUGIN_IRIDIUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridiumClass)) -#define MM_IS_PLUGIN_IRIDIUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_IRIDIUM)) -#define MM_IS_PLUGIN_IRIDIUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_IRIDIUM)) -#define MM_PLUGIN_IRIDIUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridiumClass)) - -typedef struct { - MMPlugin parent; -} MMPluginIridium; - -typedef struct { - MMPluginClass parent; -} MMPluginIridiumClass; - -GType mm_plugin_iridium_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_IRIDIUM_H */ diff --git a/src/plugins/linktop/mm-plugin-linktop.c b/src/plugins/linktop/mm-plugin-linktop.c index 8276e59f..58dd129a 100644 --- a/src/plugins/linktop/mm-plugin-linktop.c +++ b/src/plugins/linktop/mm-plugin-linktop.c @@ -21,13 +21,11 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-linktop.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-linktop.h" -G_DEFINE_TYPE (MMPluginLinktop, mm_plugin_linktop, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_LINKTOP mm_plugin_linktop_get_type () +MM_DEFINE_PLUGIN (LINKTOP, linktop, Linktop) /*****************************************************************************/ @@ -50,8 +48,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_linktop (void) { static const gchar *subsystems[] = { "tty", NULL }; static const guint16 vendor_ids[] = { 0x230d, 0 }; diff --git a/src/plugins/linktop/mm-plugin-linktop.h b/src/plugins/linktop/mm-plugin-linktop.h deleted file mode 100644 index 6c8e5789..00000000 --- a/src/plugins/linktop/mm-plugin-linktop.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_LINKTOP_H -#define MM_PLUGIN_LINKTOP_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_LINKTOP (mm_plugin_linktop_get_type ()) -#define MM_PLUGIN_LINKTOP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktop)) -#define MM_PLUGIN_LINKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktopClass)) -#define MM_IS_PLUGIN_LINKTOP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_LINKTOP)) -#define MM_IS_PLUGIN_LINKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_LINKTOP)) -#define MM_PLUGIN_LINKTOP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktopClass)) - -typedef struct { - MMPlugin parent; -} MMPluginLinktop; - -typedef struct { - MMPluginClass parent; -} MMPluginLinktopClass; - -GType mm_plugin_linktop_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_LINKTOP_H */ diff --git a/src/plugins/longcheer/mm-plugin-longcheer.c b/src/plugins/longcheer/mm-plugin-longcheer.c index 31774efb..f3c6bc6c 100644 --- a/src/plugins/longcheer/mm-plugin-longcheer.c +++ b/src/plugins/longcheer/mm-plugin-longcheer.c @@ -23,13 +23,11 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" -#include "mm-plugin-longcheer.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-longcheer.h" -G_DEFINE_TYPE (MMPluginLongcheer, mm_plugin_longcheer, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_LONGCHEER mm_plugin_longcheer_get_type () +MM_DEFINE_PLUGIN (LONGCHEER, longcheer, Longcheer) /*****************************************************************************/ /* Custom init */ @@ -200,8 +198,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_longcheer (void) { static const gchar *subsystems[] = { "tty", NULL }; /* Vendors: Longcheer and TAMobile */ diff --git a/src/plugins/longcheer/mm-plugin-longcheer.h b/src/plugins/longcheer/mm-plugin-longcheer.h deleted file mode 100644 index 1a5f2b98..00000000 --- a/src/plugins/longcheer/mm-plugin-longcheer.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_LONGCHEER_H -#define MM_PLUGIN_LONGCHEER_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_LONGCHEER (mm_plugin_longcheer_get_type ()) -#define MM_PLUGIN_LONGCHEER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_LONGCHEER, MMPluginLongcheer)) -#define MM_PLUGIN_LONGCHEER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_LONGCHEER, MMPluginLongcheerClass)) -#define MM_IS_PLUGIN_LONGCHEER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_LONGCHEER)) -#define MM_IS_PLUGIN_LONGCHEER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_LONGCHEER)) -#define MM_PLUGIN_LONGCHEER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_LONGCHEER, MMPluginLongcheerClass)) - -typedef struct { - MMPlugin parent; -} MMPluginLongcheer; - -typedef struct { - MMPluginClass parent; -} MMPluginLongcheerClass; - -GType mm_plugin_longcheer_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_LONGCHEER_H */ diff --git a/src/plugins/mbm/mm-plugin-mbm.c b/src/plugins/mbm/mm-plugin-mbm.c index 6790d8a8..c7897e12 100644 --- a/src/plugins/mbm/mm-plugin-mbm.c +++ b/src/plugins/mbm/mm-plugin-mbm.c @@ -24,17 +24,15 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-mbm.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-mbm.h" #if defined WITH_MBIM #include "mm-broadband-modem-mbim.h" #endif -G_DEFINE_TYPE (MMPluginMbm, mm_plugin_mbm, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_MBM mm_plugin_mbm_get_type () +MM_DEFINE_PLUGIN (MBM, mbm, Mbm) /*****************************************************************************/ @@ -68,8 +66,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_mbm (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const gchar *udev_tags[] = { diff --git a/src/plugins/mbm/mm-plugin-mbm.h b/src/plugins/mbm/mm-plugin-mbm.h deleted file mode 100644 index ac07d7e1..00000000 --- a/src/plugins/mbm/mm-plugin-mbm.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 Ericsson AB - * Copyright (C) 2012 Lanedo GmbH - * - * Author: Per Hallsmark <per.hallsmark@ericsson.com> - */ - -#ifndef MM_PLUGIN_MBM_H -#define MM_PLUGIN_MBM_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_MBM (mm_plugin_mbm_get_type ()) -#define MM_PLUGIN_MBM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_MBM, MMPluginMbm)) -#define MM_PLUGIN_MBM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_MBM, MMPluginMbmClass)) -#define MM_IS_PLUGIN_MBM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_MBM)) -#define MM_IS_PLUGIN_MBM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_MBM)) -#define MM_PLUGIN_MBM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MBM, MMPluginMbmClass)) - -typedef struct { - MMPlugin parent; -} MMPluginMbm; - -typedef struct { - MMPluginClass parent; -} MMPluginMbmClass; - -GType mm_plugin_mbm_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_MBM_H */ diff --git a/src/plugins/meson.build b/src/plugins/meson.build index 3e1bed18..bf670864 100644 --- a/src/plugins/meson.build +++ b/src/plugins/meson.build @@ -36,6 +36,7 @@ if enable_tests endif # plugins +plugins_inc = include_directories('.') plugins = {} plugins_data = [] plugins_udev_rules = [] @@ -48,6 +49,7 @@ plugins_incs = [ top_inc, src_inc, kerneldevice_inc, + plugins_inc, ] plugins_deps = [libmm_glib_dep] diff --git a/src/plugins/mm-plugin-common.h b/src/plugins/mm-plugin-common.h new file mode 100644 index 00000000..607d24db --- /dev/null +++ b/src/plugins/mm-plugin-common.h @@ -0,0 +1,58 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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: + * + * Copyright (C) 2022 Google, Inc. + */ + +#ifndef MM_PLUGIN_COMMON_H +#define MM_PLUGIN_COMMON_H + +#if !defined MM_MODULE_NAME +# error MM_MODULE_NAME must be defined +#endif + +#include <config.h> +#include <glib.h> +#include <glib-object.h> + +#include "mm-plugin.h" + +#define MM_PLUGIN_NAMED_CREATOR_SCOPE static + +#define MM_PLUGIN_CREATOR(my_plugin) \ + G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); \ + G_MODULE_EXPORT MMPlugin * \ + mm_plugin_create (void) \ + { \ + return mm_plugin_create_##my_plugin (); \ + } + +#if defined (G_HAVE_GNUC_VISIBILITY) +# define MM_VISIBILITY __attribute__((visibility("protected"))) +#else +# define MM_VISIBILITY +#endif + +#define MM_DEFINE_PLUGIN(MY_PLUGIN, my_plugin, MyPlugin) \ + G_DECLARE_FINAL_TYPE(MMPlugin##MyPlugin, mm_plugin_##my_plugin, MM, PLUGIN_##MY_PLUGIN, MMPlugin) \ + struct _MMPlugin##MyPlugin { \ + MMPlugin parent; \ + }; \ + G_DEFINE_TYPE (MMPlugin##MyPlugin, mm_plugin_##my_plugin, MM_TYPE_PLUGIN) \ + \ + MM_VISIBILITY int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; \ + MM_VISIBILITY int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; \ + \ + MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin *mm_plugin_create_##my_plugin (void); \ + MM_PLUGIN_CREATOR(my_plugin) + +#endif /* MM_PLUGIN_COMMON_H */ diff --git a/src/plugins/motorola/mm-plugin-motorola.c b/src/plugins/motorola/mm-plugin-motorola.c index fbe9b2fa..987ff40c 100644 --- a/src/plugins/motorola/mm-plugin-motorola.c +++ b/src/plugins/motorola/mm-plugin-motorola.c @@ -22,13 +22,11 @@ #include <libmm-glib.h> #include "mm-private-boxed-types.h" -#include "mm-plugin-motorola.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-motorola.h" -G_DEFINE_TYPE (MMPluginMotorola, mm_plugin_motorola, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_MOTOROLA mm_plugin_motorola_get_type () +MM_DEFINE_PLUGIN (MOTOROLA, motorola, Motorola) /*****************************************************************************/ @@ -51,8 +49,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_motorola (void) { static const gchar *subsystems[] = { "tty", NULL }; static const mm_uint16_pair product_ids[] = { diff --git a/src/plugins/motorola/mm-plugin-motorola.h b/src/plugins/motorola/mm-plugin-motorola.h deleted file mode 100644 index 6812ba36..00000000 --- a/src/plugins/motorola/mm-plugin-motorola.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_MOTOROLA_H -#define MM_PLUGIN_MOTOROLA_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_MOTOROLA (mm_plugin_motorola_get_type ()) -#define MM_PLUGIN_MOTOROLA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorola)) -#define MM_PLUGIN_MOTOROLA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorolaClass)) -#define MM_IS_PLUGIN_MOTOROLA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_MOTOROLA)) -#define MM_IS_PLUGIN_MOTOROLA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_MOTOROLA)) -#define MM_PLUGIN_MOTOROLA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorolaClass)) - -typedef struct { - MMPlugin parent; -} MMPluginMotorola; - -typedef struct { - MMPluginClass parent; -} MMPluginMotorolaClass; - -GType mm_plugin_motorola_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_MOTOROLA_H */ diff --git a/src/plugins/mtk/mm-plugin-mtk.c b/src/plugins/mtk/mm-plugin-mtk.c index 957e38a3..55f1c2ac 100644 --- a/src/plugins/mtk/mm-plugin-mtk.c +++ b/src/plugins/mtk/mm-plugin-mtk.c @@ -21,13 +21,11 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-mtk.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-mtk.h" -G_DEFINE_TYPE (MMPluginMtk, mm_plugin_mtk, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_MTK mm_plugin_mtk_get_type () +MM_DEFINE_PLUGIN (MTK, mtk, Mtk) /*****************************************************************************/ @@ -51,8 +49,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_mtk (void) { static const gchar *subsystems[] = { "tty", NULL }; static const gchar *udev_tags[]={ diff --git a/src/plugins/mtk/mm-plugin-mtk.h b/src/plugins/mtk/mm-plugin-mtk.h deleted file mode 100644 index cc7b0d19..00000000 --- a/src/plugins/mtk/mm-plugin-mtk.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_MTK_H -#define MM_PLUGIN_MTK_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_MTK (mm_plugin_mtk_get_type ()) -#define MM_PLUGIN_MTK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_MTK, MMPluginMtk)) -#define MM_PLUGIN_MTK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_MTK, MMPluginMtkClass)) -#define MM_IS_PLUGIN_MTK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_MTK)) -#define MM_IS_PLUGIN_MTK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_MTK)) -#define MM_PLUGIN_MTK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MTK, MMPluginMtkClass)) - -typedef struct { - MMPlugin parent; -} MMPluginMtk; - -typedef struct { - MMPluginClass parent; -} MMPluginMtkClass; - -GType mm_plugin_mtk_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_MTK_H */ diff --git a/src/plugins/nokia/mm-plugin-nokia-icera.c b/src/plugins/nokia/mm-plugin-nokia-icera.c index 78c8fd4c..bd5c7518 100644 --- a/src/plugins/nokia/mm-plugin-nokia-icera.c +++ b/src/plugins/nokia/mm-plugin-nokia-icera.c @@ -20,13 +20,11 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-nokia-icera.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-icera.h" -G_DEFINE_TYPE (MMPluginNokiaIcera, mm_plugin_nokia_icera, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_NOKIA_ICERA mm_plugin_nokia_icera_get_type () +MM_DEFINE_PLUGIN (NOKIA_ICERA, nokia_icera, NokiaIcera) /*****************************************************************************/ /* Custom commands for AT probing */ @@ -59,8 +57,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_nokia_icera (void) { static const gchar *subsystems[] = { "tty", "net", NULL }; static const guint16 vendor_ids[] = { 0x0421, 0 }; diff --git a/src/plugins/nokia/mm-plugin-nokia-icera.h b/src/plugins/nokia/mm-plugin-nokia-icera.h deleted file mode 100644 index 137692fb..00000000 --- a/src/plugins/nokia/mm-plugin-nokia-icera.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_NOKIA_ICERA_H -#define MM_PLUGIN_NOKIA_ICERA_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_NOKIA_ICERA (mm_plugin_nokia_icera_get_type ()) -#define MM_PLUGIN_NOKIA_ICERA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOKIA_ICERA, MMPluginNokiaIcera)) -#define MM_PLUGIN_NOKIA_ICERA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_NOKIA_ICERA, MMPluginNokiaIceraClass)) -#define MM_IS_PLUGIN_NOKIA_ICERA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_NOKIA_ICERA)) -#define MM_IS_PLUGIN_NOKIA_ICERA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_NOKIA_ICERA)) -#define MM_PLUGIN_NOKIA_ICERA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOKIA_ICERA, MMPluginNokiaIceraClass)) - -typedef struct { - MMPlugin parent; -} MMPluginNokiaIcera; - -typedef struct { - MMPluginClass parent; -} MMPluginNokiaIceraClass; - -GType mm_plugin_nokia_icera_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_NOKIA_ICERA_H */ diff --git a/src/plugins/nokia/mm-plugin-nokia.c b/src/plugins/nokia/mm-plugin-nokia.c index b2700b70..261b3aa4 100644 --- a/src/plugins/nokia/mm-plugin-nokia.c +++ b/src/plugins/nokia/mm-plugin-nokia.c @@ -21,13 +21,11 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-nokia.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-nokia.h" -G_DEFINE_TYPE (MMPluginNokia, mm_plugin_nokia, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_NOKIA mm_plugin_nokia_get_type () +MM_DEFINE_PLUGIN (NOKIA, nokia, Nokia) /*****************************************************************************/ /* Custom commands for AT probing */ @@ -60,8 +58,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_nokia (void) { static const gchar *subsystems[] = { "tty", NULL }; static const guint16 vendor_ids[] = { 0x0421, 0 }; diff --git a/src/plugins/nokia/mm-plugin-nokia.h b/src/plugins/nokia/mm-plugin-nokia.h deleted file mode 100644 index e2f3589b..00000000 --- a/src/plugins/nokia/mm-plugin-nokia.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 Red Hat, Inc. - */ - -#ifndef MM_PLUGIN_NOKIA_H -#define MM_PLUGIN_NOKIA_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_NOKIA (mm_plugin_nokia_get_type ()) -#define MM_PLUGIN_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOKIA, MMPluginNokia)) -#define MM_PLUGIN_NOKIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_NOKIA, MMPluginNokiaClass)) -#define MM_IS_PLUGIN_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_NOKIA)) -#define MM_IS_PLUGIN_NOKIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_NOKIA)) -#define MM_PLUGIN_NOKIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOKIA, MMPluginNokiaClass)) - -typedef struct { - MMPlugin parent; -} MMPluginNokia; - -typedef struct { - MMPluginClass parent; -} MMPluginNokiaClass; - -GType mm_plugin_nokia_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_NOKIA_H */ diff --git a/src/plugins/novatel/mm-plugin-novatel-lte.c b/src/plugins/novatel/mm-plugin-novatel-lte.c index 025707ae..b34686a1 100644 --- a/src/plugins/novatel/mm-plugin-novatel-lte.c +++ b/src/plugins/novatel/mm-plugin-novatel-lte.c @@ -23,14 +23,14 @@ #include <string.h> #include <gmodule.h> -#include "mm-plugin-novatel-lte.h" +#include "mm-plugin-common.h" #include "mm-private-boxed-types.h" #include "mm-broadband-modem-novatel-lte.h" -G_DEFINE_TYPE (MMPluginNovatelLte, mm_plugin_novatel_lte, MM_TYPE_PLUGIN) +#define MM_TYPE_PLUGIN_NOVATEL_LTE mm_plugin_novatel_lte_get_type () +MM_DEFINE_PLUGIN (NOVATEL_LTE, novatel_lte, NovatelLte) -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +/*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, @@ -51,8 +51,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_novatel_lte (void) { static const gchar *subsystems[] = { "tty", "net", NULL }; static const mm_uint16_pair products[] = { { 0x1410, 0x9010 }, /* Novatel E362 */ diff --git a/src/plugins/novatel/mm-plugin-novatel-lte.h b/src/plugins/novatel/mm-plugin-novatel-lte.h deleted file mode 100644 index 8f6c8be1..00000000 --- a/src/plugins/novatel/mm-plugin-novatel-lte.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2012 Google Inc. - * Author: Nathan Williams <njw@google.com> - */ - -#ifndef MM_PLUGIN_NOVATEL_LTE_H -#define MM_PLUGIN_NOVATEL_LTE_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_NOVATEL_LTE (mm_plugin_novatel_lte_get_type ()) -#define MM_PLUGIN_NOVATEL_LTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOVATEL_LTE, MMPluginNovatelLte)) -#define MM_PLUGIN_NOVATEL_LTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_NOVATEL_LTE, MMPluginNovatelLteClass)) -#define MM_IS_PLUGIN_NOVATEL_LTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_NOVATEL_LTE)) -#define MM_IS_PLUGIN_NOVATEL_LTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_NOVATEL_LTE)) -#define MM_PLUGIN_NOVATEL_LTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOVATEL_LTE, MMPluginNovatelLteClass)) - -typedef struct { - MMPlugin parent; -} MMPluginNovatelLte; - -typedef struct { - MMPluginClass parent; -} MMPluginNovatelLteClass; - -GType mm_plugin_novatel_lte_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_NOVATEL_LTE_H */ diff --git a/src/plugins/novatel/mm-plugin-novatel.c b/src/plugins/novatel/mm-plugin-novatel.c index c17f6a9a..a8a570b5 100644 --- a/src/plugins/novatel/mm-plugin-novatel.c +++ b/src/plugins/novatel/mm-plugin-novatel.c @@ -27,7 +27,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-novatel.h" +#include "mm-plugin-common.h" #include "mm-common-novatel.h" #include "mm-private-boxed-types.h" #include "mm-broadband-modem-novatel.h" @@ -37,10 +37,8 @@ #include "mm-broadband-modem-qmi.h" #endif -G_DEFINE_TYPE (MMPluginNovatel, mm_plugin_novatel, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_NOVATEL mm_plugin_novatel_get_type () +MM_DEFINE_PLUGIN (NOVATEL, novatel, Novatel) /*****************************************************************************/ @@ -74,8 +72,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_novatel (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendors[] = { 0x1410, 0 }; diff --git a/src/plugins/novatel/mm-plugin-novatel.h b/src/plugins/novatel/mm-plugin-novatel.h deleted file mode 100644 index b553e278..00000000 --- a/src/plugins/novatel/mm-plugin-novatel.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_NOVATEL_H -#define MM_PLUGIN_NOVATEL_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_NOVATEL (mm_plugin_novatel_get_type ()) -#define MM_PLUGIN_NOVATEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatel)) -#define MM_PLUGIN_NOVATEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatelClass)) -#define MM_IS_PLUGIN_NOVATEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_NOVATEL)) -#define MM_IS_PLUGIN_NOVATEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_NOVATEL)) -#define MM_PLUGIN_NOVATEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatelClass)) - -typedef struct { - MMPlugin parent; -} MMPluginNovatel; - -typedef struct { - MMPluginClass parent; -} MMPluginNovatelClass; - -GType mm_plugin_novatel_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_NOVATEL_H */ diff --git a/src/plugins/option/mm-plugin-hso.c b/src/plugins/option/mm-plugin-hso.c index 9a28ca64..14fd0bd5 100644 --- a/src/plugins/option/mm-plugin-hso.c +++ b/src/plugins/option/mm-plugin-hso.c @@ -22,14 +22,12 @@ #include <libmm-glib.h> #include "mm-private-boxed-types.h" -#include "mm-plugin-hso.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-hso.h" #include "mm-log-object.h" -G_DEFINE_TYPE (MMPluginHso, mm_plugin_hso, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_HSO mm_plugin_hso_get_type () +MM_DEFINE_PLUGIN (HSO, hso, Hso) /*****************************************************************************/ /* Custom init */ @@ -165,8 +163,8 @@ grab_port (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_hso (void) { static const gchar *subsystems[] = { "tty", "net", NULL }; static const gchar *drivers[] = { "hso", NULL }; diff --git a/src/plugins/option/mm-plugin-hso.h b/src/plugins/option/mm-plugin-hso.h deleted file mode 100644 index 5ef13439..00000000 --- a/src/plugins/option/mm-plugin-hso.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 hso) 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_HSO_H -#define MM_PLUGIN_HSO_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_HSO (mm_plugin_hso_get_type ()) -#define MM_PLUGIN_HSO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_HSO, MMPluginHso)) -#define MM_PLUGIN_HSO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_HSO, MMPluginHsoClass)) -#define MM_IS_PLUGIN_HSO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_HSO)) -#define MM_IS_PLUGIN_HSO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_HSO)) -#define MM_PLUGIN_HSO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_HSO, MMPluginHsoClass)) - -typedef struct { - MMPlugin parent; -} MMPluginHso; - -typedef struct { - MMPluginClass parent; -} MMPluginHsoClass; - -GType mm_plugin_hso_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_HSO_H */ diff --git a/src/plugins/option/mm-plugin-option.c b/src/plugins/option/mm-plugin-option.c index 4dcb55a1..b1ada6eb 100644 --- a/src/plugins/option/mm-plugin-option.c +++ b/src/plugins/option/mm-plugin-option.c @@ -22,13 +22,11 @@ #include <libmm-glib.h> #include "mm-private-boxed-types.h" -#include "mm-plugin-option.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-option.h" -G_DEFINE_TYPE (MMPluginOption, mm_plugin_option, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_OPTION mm_plugin_option_get_type () +MM_DEFINE_PLUGIN (OPTION, option, Option) /*****************************************************************************/ @@ -87,8 +85,8 @@ grab_port (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_option (void) { static const gchar *subsystems[] = { "tty", NULL }; static const guint16 vendor_ids[] = { 0x0af0, /* Option USB devices */ diff --git a/src/plugins/option/mm-plugin-option.h b/src/plugins/option/mm-plugin-option.h deleted file mode 100644 index 275fc403..00000000 --- a/src/plugins/option/mm-plugin-option.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_OPTION_H -#define MM_PLUGIN_OPTION_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_OPTION (mm_plugin_option_get_type ()) -#define MM_PLUGIN_OPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_OPTION, MMPluginOption)) -#define MM_PLUGIN_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_OPTION, MMPluginOptionClass)) -#define MM_IS_PLUGIN_OPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_OPTION)) -#define MM_IS_PLUGIN_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_OPTION)) -#define MM_PLUGIN_OPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_OPTION, MMPluginOptionClass)) - -typedef struct { - MMPlugin parent; -} MMPluginOption; - -typedef struct { - MMPluginClass parent; -} MMPluginOptionClass; - -GType mm_plugin_option_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_OPTION_H */ diff --git a/src/plugins/pantech/mm-plugin-pantech.c b/src/plugins/pantech/mm-plugin-pantech.c index 4af1955b..7e3e14ee 100644 --- a/src/plugins/pantech/mm-plugin-pantech.c +++ b/src/plugins/pantech/mm-plugin-pantech.c @@ -20,17 +20,15 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-pantech.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-pantech.h" #if defined WITH_QMI #include "mm-broadband-modem-qmi.h" #endif -G_DEFINE_TYPE (MMPluginPantech, mm_plugin_pantech, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_PANTECH mm_plugin_pantech_get_type () +MM_DEFINE_PLUGIN (PANTECH, pantech, Pantech) /*****************************************************************************/ /* Custom commands for AT probing @@ -128,8 +126,8 @@ grab_port (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_pantech (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x106c, 0 }; diff --git a/src/plugins/pantech/mm-plugin-pantech.h b/src/plugins/pantech/mm-plugin-pantech.h deleted file mode 100644 index fdbdd9ea..00000000 --- a/src/plugins/pantech/mm-plugin-pantech.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_PANTECH_H -#define MM_PLUGIN_PANTECH_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_PANTECH (mm_plugin_pantech_get_type ()) -#define MM_PLUGIN_PANTECH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_PANTECH, MMPluginPantech)) -#define MM_PLUGIN_PANTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_PANTECH, MMPluginPantechClass)) -#define MM_IS_PLUGIN_PANTECH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_PANTECH)) -#define MM_IS_PLUGIN_PANTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_PANTECH)) -#define MM_PLUGIN_PANTECH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_PANTECH, MMPluginPantechClass)) - -typedef struct { - MMPlugin parent; -} MMPluginPantech; - -typedef struct { - MMPluginClass parent; -} MMPluginPantechClass; - -GType mm_plugin_pantech_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_PANTECH_H */ diff --git a/src/plugins/qcom-soc/mm-plugin-qcom-soc.c b/src/plugins/qcom-soc/mm-plugin-qcom-soc.c index ae844dd6..0d2a5619 100644 --- a/src/plugins/qcom-soc/mm-plugin-qcom-soc.c +++ b/src/plugins/qcom-soc/mm-plugin-qcom-soc.c @@ -28,14 +28,12 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-qcom-soc.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-qmi-qcom-soc.h" #include "mm-log-object.h" -G_DEFINE_TYPE (MMPluginQcomSoc, mm_plugin_qcom_soc, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_QCOM_SOC mm_plugin_qcom_soc_get_type () +MM_DEFINE_PLUGIN (QCOM_SOC, qcom_soc, QcomSoc) /*****************************************************************************/ @@ -65,8 +63,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_qcom_soc (void) { static const gchar *subsystems[] = { "wwan", "rpmsg", "net", "qrtr", NULL }; static const gchar *udev_tags[] = { diff --git a/src/plugins/qcom-soc/mm-plugin-qcom-soc.h b/src/plugins/qcom-soc/mm-plugin-qcom-soc.h deleted file mode 100644 index 54da154f..00000000 --- a/src/plugins/qcom-soc/mm-plugin-qcom-soc.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2020 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_QCOM_SOC_H -#define MM_PLUGIN_QCOM_SOC_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_QCOM_SOC (mm_plugin_qcom_soc_get_type ()) -#define MM_PLUGIN_QCOM_SOC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_QCOM_SOC, MMPluginQcomSoc)) -#define MM_PLUGIN_QCOM_SOC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_QCOM_SOC, MMPluginQcomSocClass)) -#define MM_IS_PLUGIN_QCOM_SOC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_QCOM_SOC)) -#define MM_IS_PLUGIN_QCOM_SOC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_QCOM_SOC)) -#define MM_PLUGIN_QCOM_SOC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_QCOM_SOC, MMPluginQcomSocClass)) - -typedef struct { - MMPlugin parent; -} MMPluginQcomSoc; - -typedef struct { - MMPluginClass parent; -} MMPluginQcomSocClass; - -GType mm_plugin_qcom_soc_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_QCOM_SOC_H */ diff --git a/src/plugins/quectel/mm-plugin-quectel.c b/src/plugins/quectel/mm-plugin-quectel.c index 80e1b74d..af087663 100644 --- a/src/plugins/quectel/mm-plugin-quectel.c +++ b/src/plugins/quectel/mm-plugin-quectel.c @@ -20,7 +20,7 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-quectel.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-quectel.h" #if defined WITH_QMI @@ -32,10 +32,8 @@ #include "mm-broadband-modem-mbim-quectel.h" #endif -G_DEFINE_TYPE (MMPluginQuectel, mm_plugin_quectel, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_QUECTEL mm_plugin_quectel_get_type () +MM_DEFINE_PLUGIN (QUECTEL, quectel, Quectel) /*****************************************************************************/ @@ -80,8 +78,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_quectel (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", "wwan", NULL }; static const gchar *vendor_strings[] = { "quectel", NULL }; diff --git a/src/plugins/quectel/mm-plugin-quectel.h b/src/plugins/quectel/mm-plugin-quectel.h deleted file mode 100644 index ec888821..00000000 --- a/src/plugins/quectel/mm-plugin-quectel.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2017 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_QUECTEL_H -#define MM_PLUGIN_QUECTEL_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_QUECTEL (mm_plugin_quectel_get_type ()) -#define MM_PLUGIN_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectel)) -#define MM_PLUGIN_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectelClass)) -#define MM_IS_PLUGIN_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_QUECTEL)) -#define MM_IS_PLUGIN_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_QUECTEL)) -#define MM_PLUGIN_QUECTEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectelClass)) - -typedef struct { - MMPlugin parent; -} MMPluginQuectel; - -typedef struct { - MMPluginClass parent; -} MMPluginQuectelClass; - -GType mm_plugin_quectel_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_QUECTEL_H */ diff --git a/src/plugins/samsung/mm-plugin-samsung.c b/src/plugins/samsung/mm-plugin-samsung.c index 3ce64d73..ee16a09f 100644 --- a/src/plugins/samsung/mm-plugin-samsung.c +++ b/src/plugins/samsung/mm-plugin-samsung.c @@ -24,14 +24,14 @@ #include <string.h> #include <gmodule.h> -#include "mm-plugin-samsung.h" +#include "mm-plugin-common.h" #include "mm-private-boxed-types.h" #include "mm-broadband-modem-samsung.h" -G_DEFINE_TYPE (MMPluginSamsung, mm_plugin_samsung, MM_TYPE_PLUGIN) +#define MM_TYPE_PLUGIN_SAMSUNG mm_plugin_samsung_get_type () +MM_DEFINE_PLUGIN (SAMSUNG, samsung, Samsung) -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +/*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, @@ -52,8 +52,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_samsung (void) { static const gchar *subsystems[] = { "tty", "net", NULL }; static const mm_uint16_pair products[] = { { 0x04e8, 0x6872 }, diff --git a/src/plugins/samsung/mm-plugin-samsung.h b/src/plugins/samsung/mm-plugin-samsung.h deleted file mode 100644 index 85f32028..00000000 --- a/src/plugins/samsung/mm-plugin-samsung.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2011 Samsung Electronics, Inc. - * Copyright (C) 2012 Google Inc. - * Author: Nathan Williams <njw@google.com> - */ - -#ifndef MM_PLUGIN_SAMSUNG_H -#define MM_PLUGIN_SAMSUNG_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_SAMSUNG (mm_plugin_samsung_get_type ()) -#define MM_PLUGIN_SAMSUNG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SAMSUNG, MMPluginSamsung)) -#define MM_PLUGIN_SAMSUNG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_SAMSUNG, MMPluginSamsungClass)) -#define MM_IS_PLUGIN_SAMSUNG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_SAMSUNG)) -#define MM_IS_PLUGIN_SAMSUNG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_SAMSUNG)) -#define MM_PLUGIN_SAMSUNG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SAMSUNG, MMPluginSamsungClass)) - -typedef struct { - MMPlugin parent; -} MMPluginSamsung; - -typedef struct { - MMPluginClass parent; -} MMPluginSamsungClass; - -GType mm_plugin_samsung_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_SAMSUNG_H */ diff --git a/src/plugins/sierra/mm-plugin-sierra-legacy.c b/src/plugins/sierra/mm-plugin-sierra-legacy.c index 521b8ad1..ea69ad88 100644 --- a/src/plugins/sierra/mm-plugin-sierra-legacy.c +++ b/src/plugins/sierra/mm-plugin-sierra-legacy.c @@ -22,15 +22,13 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-sierra-legacy.h" +#include "mm-plugin-common.h" #include "mm-common-sierra.h" #include "mm-broadband-modem-sierra.h" #include "mm-broadband-modem-sierra-icera.h" -G_DEFINE_TYPE (MMPluginSierraLegacy, mm_plugin_sierra_legacy, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_SIERRA_LEGACY mm_plugin_sierra_legacy_get_type () +MM_DEFINE_PLUGIN (SIERRA_LEGACY, sierra_legacy, SierraLegacy) /*****************************************************************************/ @@ -60,8 +58,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_sierra_legacy (void) { static const gchar *subsystems[] = { "tty", "net", NULL }; static const gchar *drivers[] = { "sierra", "sierra_net", NULL }; diff --git a/src/plugins/sierra/mm-plugin-sierra-legacy.h b/src/plugins/sierra/mm-plugin-sierra-legacy.h deleted file mode 100644 index 787118d6..00000000 --- a/src/plugins/sierra/mm-plugin-sierra-legacy.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2015 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_SIERRA_LEGACY_H -#define MM_PLUGIN_SIERRA_LEGACY_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_SIERRA_LEGACY (mm_plugin_sierra_legacy_get_type ()) -#define MM_PLUGIN_SIERRA_LEGACY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SIERRA_LEGACY, MMPluginSierraLegacy)) -#define MM_PLUGIN_SIERRA_LEGACY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_SIERRA_LEGACY, MMPluginSierraLegacyClass)) -#define MM_IS_PLUGIN_SIERRA_LEGACY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_SIERRA_LEGACY)) -#define MM_IS_PLUGIN_SIERRA_LEGACY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_SIERRA_LEGACY)) -#define MM_PLUGIN_SIERRA_LEGACY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SIERRA_LEGACY, MMPluginSierraLegacyClass)) - -typedef struct { - MMPlugin parent; -} MMPluginSierraLegacy; - -typedef struct { - MMPluginClass parent; -} MMPluginSierraLegacyClass; - -GType mm_plugin_sierra_legacy_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_SIERRA_LEGACY_H */ diff --git a/src/plugins/sierra/mm-plugin-sierra.c b/src/plugins/sierra/mm-plugin-sierra.c index e4b4b676..f497aa0a 100644 --- a/src/plugins/sierra/mm-plugin-sierra.c +++ b/src/plugins/sierra/mm-plugin-sierra.c @@ -23,7 +23,7 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-sierra.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" #include "mm-broadband-modem-xmm.h" @@ -36,10 +36,8 @@ #include "mm-broadband-modem-mbim-xmm.h" #endif -G_DEFINE_TYPE (MMPluginSierra, mm_plugin_sierra, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_SIERRA mm_plugin_sierra_get_type () +MM_DEFINE_PLUGIN (SIERRA, sierra, Sierra) /*****************************************************************************/ @@ -102,8 +100,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_sierra (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x1199, 0 }; diff --git a/src/plugins/sierra/mm-plugin-sierra.h b/src/plugins/sierra/mm-plugin-sierra.h deleted file mode 100644 index 59b6e6b9..00000000 --- a/src/plugins/sierra/mm-plugin-sierra.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Lanedo GmbH - */ - -#ifndef MM_PLUGIN_SIERRA_H -#define MM_PLUGIN_SIERRA_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_SIERRA (mm_plugin_sierra_get_type ()) -#define MM_PLUGIN_SIERRA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SIERRA, MMPluginSierra)) -#define MM_PLUGIN_SIERRA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_SIERRA, MMPluginSierraClass)) -#define MM_IS_PLUGIN_SIERRA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_SIERRA)) -#define MM_IS_PLUGIN_SIERRA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_SIERRA)) -#define MM_PLUGIN_SIERRA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SIERRA, MMPluginSierraClass)) - -typedef struct { - MMPlugin parent; -} MMPluginSierra; - -typedef struct { - MMPluginClass parent; -} MMPluginSierraClass; - -GType mm_plugin_sierra_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_SIERRA_H */ diff --git a/src/plugins/simtech/mm-plugin-simtech.c b/src/plugins/simtech/mm-plugin-simtech.c index 9b4f377e..f3a5c89c 100644 --- a/src/plugins/simtech/mm-plugin-simtech.c +++ b/src/plugins/simtech/mm-plugin-simtech.c @@ -22,17 +22,15 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-simtech.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-simtech.h" #if defined WITH_QMI #include "mm-broadband-modem-qmi-simtech.h" #endif -G_DEFINE_TYPE (MMPluginSimtech, mm_plugin_simtech, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_SIMTECH mm_plugin_simtech_get_type () +MM_DEFINE_PLUGIN (SIMTECH, simtech, Simtech) /*****************************************************************************/ @@ -66,8 +64,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_simtech (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x1e0e, /* A-Link (for now) */ diff --git a/src/plugins/simtech/mm-plugin-simtech.h b/src/plugins/simtech/mm-plugin-simtech.h deleted file mode 100644 index eab8630c..00000000 --- a/src/plugins/simtech/mm-plugin-simtech.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_SIMTECH_H -#define MM_PLUGIN_SIMTECH_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_SIMTECH (mm_plugin_simtech_get_type ()) -#define MM_PLUGIN_SIMTECH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtech)) -#define MM_PLUGIN_SIMTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtechClass)) -#define MM_IS_PLUGIN_SIMTECH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_SIMTECH)) -#define MM_IS_PLUGIN_SIMTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_SIMTECH)) -#define MM_PLUGIN_SIMTECH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtechClass)) - -typedef struct { - MMPlugin parent; -} MMPluginSimtech; - -typedef struct { - MMPluginClass parent; -} MMPluginSimtechClass; - -GType mm_plugin_simtech_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_SIMTECH_H */ diff --git a/src/plugins/telit/mm-plugin-telit.c b/src/plugins/telit/mm-plugin-telit.c index d19966d6..4cca3c68 100644 --- a/src/plugins/telit/mm-plugin-telit.c +++ b/src/plugins/telit/mm-plugin-telit.c @@ -23,7 +23,7 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" -#include "mm-plugin-telit.h" +#include "mm-plugin-common.h" #include "mm-common-telit.h" #include "mm-broadband-modem-telit.h" @@ -36,10 +36,8 @@ # include "mm-broadband-modem-mbim-telit.h" #endif -G_DEFINE_TYPE (MMPluginTelit, mm_plugin_telit, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_TELIT mm_plugin_telit_get_type () +MM_DEFINE_PLUGIN (TELIT, telit, Telit) /*****************************************************************************/ @@ -85,8 +83,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_telit (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", "wwan", NULL }; /* Vendors: Telit */ diff --git a/src/plugins/telit/mm-plugin-telit.h b/src/plugins/telit/mm-plugin-telit.h deleted file mode 100644 index 0c61fbb8..00000000 --- a/src/plugins/telit/mm-plugin-telit.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2013 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_TELIT_H -#define MM_PLUGIN_TELIT_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_TELIT (mm_plugin_telit_get_type ()) -#define MM_PLUGIN_TELIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_TELIT, MMPluginTelit)) -#define MM_PLUGIN_TELIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_TELIT, MMPluginTelitClass)) -#define MM_IS_PLUGIN_TELIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_TELIT)) -#define MM_IS_PLUGIN_TELIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_TELIT)) -#define MM_PLUGIN_TELIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_TELIT, MMPluginTelitClass)) - -typedef struct { - MMPlugin parent; -} MMPluginTelit; - -typedef struct { - MMPluginClass parent; -} MMPluginTelitClass; - -GType mm_plugin_telit_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_TELIT_H */ diff --git a/src/plugins/thuraya/mm-plugin-thuraya.c b/src/plugins/thuraya/mm-plugin-thuraya.c index 5097e24e..e8d4149b 100644 --- a/src/plugins/thuraya/mm-plugin-thuraya.c +++ b/src/plugins/thuraya/mm-plugin-thuraya.c @@ -27,15 +27,15 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-thuraya.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" #include "mm-broadband-modem-thuraya.h" #include "mm-private-boxed-types.h" -G_DEFINE_TYPE (MMPluginThuraya, mm_plugin_thuraya, MM_TYPE_PLUGIN) +#define MM_TYPE_PLUGIN_THURAYA mm_plugin_thuraya_get_type () +MM_DEFINE_PLUGIN (THURAYA, thuraya, Thuraya) -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +/*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, @@ -56,8 +56,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_thuraya (void) { static const gchar *subsystems[] = { "tty", NULL }; static const guint16 vendor_ids[] = { 0x1a26, 0 }; diff --git a/src/plugins/thuraya/mm-plugin-thuraya.h b/src/plugins/thuraya/mm-plugin-thuraya.h deleted file mode 100644 index fb86090d..00000000 --- a/src/plugins/thuraya/mm-plugin-thuraya.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2011 - 2012 Ammonit Measurement GmbH - * Author: Aleksander Morgado <aleksander@lanedo.com> - * Copyright (C) 2016 Thomas Sailer <t.sailer@alumni.ethz.ch> - */ - -#ifndef MM_PLUGIN_THURAYA_H -#define MM_PLUGIN_THURAYA_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_THURAYA (mm_plugin_thuraya_get_type ()) -#define MM_PLUGIN_THURAYA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_THURAYA, MMPluginThuraya)) -#define MM_PLUGIN_THURAYA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_THURAYA, MMPluginThurayaClass)) -#define MM_IS_PLUGIN_THURAYA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_THURAYA)) -#define MM_IS_PLUGIN_THURAYA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_THURAYA)) -#define MM_PLUGIN_THURAYA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_THURAYA, MMPluginThurayaClass)) - -typedef struct { - MMPlugin parent; -} MMPluginThuraya; - -typedef struct { - MMPluginClass parent; -} MMPluginThurayaClass; - -GType mm_plugin_thuraya_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_THURAYA_H */ diff --git a/src/plugins/tplink/mm-plugin-tplink.c b/src/plugins/tplink/mm-plugin-tplink.c index 1c03fef0..af74c209 100644 --- a/src/plugins/tplink/mm-plugin-tplink.c +++ b/src/plugins/tplink/mm-plugin-tplink.c @@ -20,17 +20,15 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-tplink.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem.h" #if defined WITH_QMI # include "mm-broadband-modem-qmi.h" #endif -G_DEFINE_TYPE (MMPluginTplink, mm_plugin_tplink, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_TPLINK mm_plugin_tplink_get_type () +MM_DEFINE_PLUGIN (TPLINK, tplink, Tplink) /*****************************************************************************/ @@ -64,8 +62,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_tplink (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x2357, 0 }; diff --git a/src/plugins/tplink/mm-plugin-tplink.h b/src/plugins/tplink/mm-plugin-tplink.h deleted file mode 100644 index 16dc5f5b..00000000 --- a/src/plugins/tplink/mm-plugin-tplink.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2019 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_TPLINK_H -#define MM_PLUGIN_TPLINK_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_TPLINK (mm_plugin_tplink_get_type ()) -#define MM_PLUGIN_TPLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_TPLINK, MMPluginTplink)) -#define MM_PLUGIN_TPLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_TPLINK, MMPluginTplinkClass)) -#define MM_IS_PLUGIN_TPLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_TPLINK)) -#define MM_IS_PLUGIN_TPLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_TPLINK)) -#define MM_PLUGIN_TPLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_TPLINK, MMPluginTplinkClass)) - -typedef struct { - MMPlugin parent; -} MMPluginTplink; - -typedef struct { - MMPluginClass parent; -} MMPluginTplinkClass; - -GType mm_plugin_tplink_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_TPLINK_H */ diff --git a/src/plugins/ublox/mm-plugin-ublox.c b/src/plugins/ublox/mm-plugin-ublox.c index db6d94d3..e606eba1 100644 --- a/src/plugins/ublox/mm-plugin-ublox.c +++ b/src/plugins/ublox/mm-plugin-ublox.c @@ -22,12 +22,10 @@ #include "mm-log-object.h" #include "mm-serial-parsers.h" #include "mm-broadband-modem-ublox.h" -#include "mm-plugin-ublox.h" +#include "mm-plugin-common.h" -G_DEFINE_TYPE (MMPluginUblox, mm_plugin_ublox, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_UBLOX mm_plugin_ublox_get_type () +MM_DEFINE_PLUGIN (UBLOX, ublox, Ublox) /*****************************************************************************/ @@ -229,8 +227,8 @@ ublox_custom_init (MMPortProbe *probe, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_ublox (void) { static const gchar *subsystems[] = { "tty", "net", NULL }; static const guint16 vendor_ids[] = { 0x1546, 0 }; diff --git a/src/plugins/ublox/mm-plugin-ublox.h b/src/plugins/ublox/mm-plugin-ublox.h deleted file mode 100644 index adfc6247..00000000 --- a/src/plugins/ublox/mm-plugin-ublox.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es> - */ - -#ifndef MM_PLUGIN_UBLOX_H -#define MM_PLUGIN_UBLOX_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_UBLOX (mm_plugin_ublox_get_type ()) -#define MM_PLUGIN_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_UBLOX, MMPluginUblox)) -#define MM_PLUGIN_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_UBLOX, MMPluginUbloxClass)) -#define MM_IS_PLUGIN_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_UBLOX)) -#define MM_IS_PLUGIN_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_UBLOX)) -#define MM_PLUGIN_UBLOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_UBLOX, MMPluginUbloxClass)) - -typedef struct { - MMPlugin parent; -} MMPluginUblox; - -typedef struct { - MMPluginClass parent; -} MMPluginUbloxClass; - -GType mm_plugin_ublox_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_UBLOX_H */ diff --git a/src/plugins/via/mm-plugin-via.c b/src/plugins/via/mm-plugin-via.c index b1939092..2a380266 100644 --- a/src/plugins/via/mm-plugin-via.c +++ b/src/plugins/via/mm-plugin-via.c @@ -26,12 +26,12 @@ #include <libmm-glib.h> #include "mm-broadband-modem-via.h" -#include "mm-plugin-via.h" +#include "mm-plugin-common.h" -G_DEFINE_TYPE (MMPluginVia, mm_plugin_via, MM_TYPE_PLUGIN) +#define MM_TYPE_PLUGIN_VIA mm_plugin_via_get_type () +MM_DEFINE_PLUGIN (VIA, via, Via) -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +/*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, @@ -52,8 +52,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_via (void) { static const gchar *subsystems[] = { "tty", NULL }; static const mm_str_pair product_strings[] = { { (gchar *) "via", (gchar *) "cbp7" }, diff --git a/src/plugins/via/mm-plugin-via.h b/src/plugins/via/mm-plugin-via.h deleted file mode 100644 index 68d8c5f6..00000000 --- a/src/plugins/via/mm-plugin-via.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2012 Red Hat, Inc. - */ - -#ifndef MM_PLUGIN_VIA_H -#define MM_PLUGIN_VIA_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_VIA (mm_plugin_via_get_type ()) -#define MM_PLUGIN_VIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_VIA, MMPluginVia)) -#define MM_PLUGIN_VIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_VIA, MMPluginViaClass)) -#define MM_IS_PLUGIN_VIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_VIA)) -#define MM_IS_PLUGIN_VIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_VIA)) -#define MM_PLUGIN_VIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_VIA, MMPluginViaClass)) - -typedef struct { - MMPlugin parent; -} MMPluginVia; - -typedef struct { - MMPluginClass parent; -} MMPluginViaClass; - -GType mm_plugin_via_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_VIA_H */ diff --git a/src/plugins/wavecom/mm-plugin-wavecom.c b/src/plugins/wavecom/mm-plugin-wavecom.c index 8e3f9d2c..328a4a21 100644 --- a/src/plugins/wavecom/mm-plugin-wavecom.c +++ b/src/plugins/wavecom/mm-plugin-wavecom.c @@ -28,13 +28,11 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> -#include "mm-plugin-wavecom.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-wavecom.h" -G_DEFINE_TYPE (MMPluginWavecom, mm_plugin_wavecom, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_WAVECOM mm_plugin_wavecom_get_type () +MM_DEFINE_PLUGIN (WAVECOM, wavecom, Wavecom) /*****************************************************************************/ @@ -57,8 +55,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_wavecom (void) { static const gchar *subsystems[] = { "tty", NULL }; static const guint16 vendor_ids[] = { 0x114f, 0 }; diff --git a/src/plugins/wavecom/mm-plugin-wavecom.h b/src/plugins/wavecom/mm-plugin-wavecom.h deleted file mode 100644 index c1d76309..00000000 --- a/src/plugins/wavecom/mm-plugin-wavecom.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - * 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 Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Copyright (C) 2011 Ammonit Measurement GmbH - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - * - * Author: Aleksander Morgado <aleksander@lanedo.com> - */ - -#ifndef MM_PLUGIN_WAVECOM_H -#define MM_PLUGIN_WAVECOM_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_WAVECOM (mm_plugin_wavecom_get_type ()) -#define MM_PLUGIN_WAVECOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecom)) -#define MM_PLUGIN_WAVECOM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecomClass)) -#define MM_IS_PLUGIN_WAVECOM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_WAVECOM)) -#define MM_IS_PLUGIN_WAVECOM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_WAVECOM)) -#define MM_PLUGIN_WAVECOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecomClass)) - -typedef struct { - MMPlugin parent; -} MMPluginWavecom; - -typedef struct { - MMPluginClass parent; -} MMPluginWavecomClass; - -GType mm_plugin_wavecom_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_WAVECOM_H */ diff --git a/src/plugins/x22x/mm-plugin-x22x.c b/src/plugins/x22x/mm-plugin-x22x.c index 7b49cff8..ccfcd465 100644 --- a/src/plugins/x22x/mm-plugin-x22x.c +++ b/src/plugins/x22x/mm-plugin-x22x.c @@ -23,17 +23,15 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" -#include "mm-plugin-x22x.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-x22x.h" #if defined WITH_QMI #include "mm-broadband-modem-qmi.h" #endif -G_DEFINE_TYPE (MMPluginX22x, mm_plugin_x22x, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_X22X mm_plugin_x22x_get_type () +MM_DEFINE_PLUGIN (X22X, x22x, X22x) /*****************************************************************************/ /* Custom init */ @@ -213,8 +211,8 @@ create_modem (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_x22x (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; /* Vendors: TAMobile and Olivetti */ diff --git a/src/plugins/x22x/mm-plugin-x22x.h b/src/plugins/x22x/mm-plugin-x22x.h deleted file mode 100644 index bea588c6..00000000 --- a/src/plugins/x22x/mm-plugin-x22x.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_X22X_H -#define MM_PLUGIN_X22X_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_X22X (mm_plugin_x22x_get_type ()) -#define MM_PLUGIN_X22X(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_X22X, MMPluginX22x)) -#define MM_PLUGIN_X22X_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_X22X, MMPluginX22xClass)) -#define MM_IS_PLUGIN_X22X(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_X22X)) -#define MM_IS_PLUGIN_X22X_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_X22X)) -#define MM_PLUGIN_X22X_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_X22X, MMPluginX22xClass)) - -typedef struct { - MMPlugin parent; -} MMPluginX22x; - -typedef struct { - MMPluginClass parent; -} MMPluginX22xClass; - -GType mm_plugin_x22x_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_X22X_H */ diff --git a/src/plugins/zte/mm-plugin-zte.c b/src/plugins/zte/mm-plugin-zte.c index a39386e6..44b16b1b 100644 --- a/src/plugins/zte/mm-plugin-zte.c +++ b/src/plugins/zte/mm-plugin-zte.c @@ -22,7 +22,7 @@ #include <libmm-glib.h> #include "mm-log-object.h" -#include "mm-plugin-zte.h" +#include "mm-plugin-common.h" #include "mm-broadband-modem-zte.h" #include "mm-broadband-modem-zte-icera.h" @@ -34,10 +34,8 @@ #include "mm-broadband-modem-mbim.h" #endif -G_DEFINE_TYPE (MMPluginZte, mm_plugin_zte, MM_TYPE_PLUGIN) - -MM_PLUGIN_DEFINE_MAJOR_VERSION -MM_PLUGIN_DEFINE_MINOR_VERSION +#define MM_TYPE_PLUGIN_ZTE mm_plugin_zte_get_type () +MM_DEFINE_PLUGIN (ZTE, zte, Zte) /*****************************************************************************/ /* Custom commands for AT probing */ @@ -142,8 +140,8 @@ grab_port (MMPlugin *self, /*****************************************************************************/ -G_MODULE_EXPORT MMPlugin * -mm_plugin_create (void) +MM_PLUGIN_NAMED_CREATOR_SCOPE MMPlugin * +mm_plugin_create_zte (void) { static const gchar *subsystems[] = { "tty", "net", "usbmisc", NULL }; static const guint16 vendor_ids[] = { 0x19d2, 0 }; diff --git a/src/plugins/zte/mm-plugin-zte.h b/src/plugins/zte/mm-plugin-zte.h deleted file mode 100644 index 353ce86e..00000000 --- a/src/plugins/zte/mm-plugin-zte.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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: - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_PLUGIN_ZTE_H -#define MM_PLUGIN_ZTE_H - -#include "mm-plugin.h" - -#define MM_TYPE_PLUGIN_ZTE (mm_plugin_zte_get_type ()) -#define MM_PLUGIN_ZTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_ZTE, MMPluginZte)) -#define MM_PLUGIN_ZTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_ZTE, MMPluginZteClass)) -#define MM_IS_PLUGIN_ZTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_ZTE)) -#define MM_IS_PLUGIN_ZTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_ZTE)) -#define MM_PLUGIN_ZTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_ZTE, MMPluginZteClass)) - -typedef struct { - MMPlugin parent; -} MMPluginZte; - -typedef struct { - MMPluginClass parent; -} MMPluginZteClass; - -GType mm_plugin_zte_get_type (void); - -G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); - -#endif /* MM_PLUGIN_ZTE_H */ |