[PATCH BlueZ v1 4/4] client/bluetoothctl: Declare the controller helper in its own header
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2026-09-10 18:42:36
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Luiz Augusto von Dentz <redacted> bluetoothctl_get_default_controller() is implemented in main.c but was declared in admin.h, the header of one of the submenus that consumes it. Move the declaration to a new client/main.h so main.c also sees it. While at it, drop the bluetooth/bluetooth.h include added to admin.c, which is unused. Assisted-by: opencode:claude-opus-5 --- Makefile.tools | 1 + client/admin.c | 2 +- client/admin.h | 2 -- client/main.c | 1 + client/main.h | 11 +++++++++++ 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 client/main.h
diff --git a/Makefile.tools b/Makefile.tools
index cb113f96161e..6844a52ac739 100644
--- a/Makefile.tools
+++ b/Makefile.tools@@ -12,6 +12,7 @@ client_bluetoothctl_SOURCES = client/main.c \ client/adv_monitor.c \ client/gatt.h client/gatt.c \ client/admin.h client/admin.c \ + client/main.h \ client/player.h client/player.c \ client/mgmt.h client/mgmt.c \ client/assistant.h client/assistant.c \
diff --git a/client/admin.c b/client/admin.c
index a6fba2f1ce1d..98276f56c652 100644
--- a/client/admin.c
+++ b/client/admin.c@@ -16,11 +16,11 @@ #include <string.h> #include <stdlib.h> -#include "bluetooth/bluetooth.h" #include "gdbus/gdbus.h" #include "src/shared/shell.h" #include "admin.h" +#include "main.h" #define _GNU_SOURCE static DBusConnection *dbus_conn;
diff --git a/client/admin.h b/client/admin.h
index 00423d9d35cb..0047770dc737 100644
--- a/client/admin.h
+++ b/client/admin.h@@ -10,5 +10,3 @@ void admin_add_submenu(void); void admin_remove_submenu(void); - -GDBusProxy *bluetoothctl_get_default_controller(void);
diff --git a/client/main.c b/client/main.c
index d8d2e32d9556..8f7a7c4135ca 100644
--- a/client/main.c
+++ b/client/main.c@@ -28,6 +28,7 @@ #include "src/shared/util.h" #include "src/shared/ad.h" #include "gdbus/gdbus.h" +#include "main.h" #include "print.h" #include "agent.h" #include "gatt.h"
diff --git a/client/main.h b/client/main.h
new file mode 100644
index 000000000000..0d2af5c5014c
--- /dev/null
+++ b/client/main.h@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2026 Collabora Ltd. + * + * + */ + +GDBusProxy *bluetoothctl_get_default_controller(void);
--
2.55.0