[Replicant] [libsamsung-ipc] [PATCH 11/26] tools: ipc-modem: move definitions in ipc-modem.h
Denis 'GNUtoo' Carikli
GNUtoo at cyberdimension.org
Mon Mar 28 20:20:25 UTC 2022
This enables to add more definitions later and to also add functions
prototypes there.
This change contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
tools/ipc-modem.c | 18 +-----------------
tools/ipc-modem.h | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 17 deletions(-)
create mode 100644 tools/ipc-modem.h
diff --git a/tools/ipc-modem.c b/tools/ipc-modem.c
index 1fbc778..ae410e6 100644
--- a/tools/ipc-modem.c
+++ b/tools/ipc-modem.c
@@ -37,9 +37,7 @@
#include <samsung-ipc.h>
-#define MODEM_STATE_LPM 0
-#define MODEM_STATE_NORMAL 2
-#define MODEM_STATE_SIM_OK 4
+#include "ipc-modem.h"
int state = MODEM_STATE_LPM;
int seq;
@@ -50,20 +48,6 @@ int call_done;
char call_number[14];
char sim_pin[8];
-enum command {
- CMD_NONE,
- CMD_START,
- CMD_BOOT,
- CMD_POWER_ON,
- CMD_POWER_OFF,
-};
-
-struct cmdline_opts {
- enum command command;
- bool debug;
- bool dry_run;
-};
-
int seq_get(void)
{
if (seq == 0xff)
diff --git a/tools/ipc-modem.h b/tools/ipc-modem.h
new file mode 100644
index 0000000..6d54375
--- /dev/null
+++ b/tools/ipc-modem.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of libsamsung-ipc.
+ *
+ * Copyright (C) 2011 Simon Busch <morphis at gravedo.de>
+ * Copyright (C) 2011 Paul Kocialkowsk <contact at paulk.fr>
+ * Copyright (C) 2022 Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
+ *
+ * libsamsung-ipc 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.
+ *
+ * libsamsung-ipc 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 libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef IPC_MODEM_H
+#define IPC_MODEM_H
+
+#define MODEM_STATE_LPM 0
+#define MODEM_STATE_NORMAL 2
+#define MODEM_STATE_SIM_OK 4
+
+enum command {
+ CMD_NONE,
+ CMD_START,
+ CMD_BOOT,
+ CMD_POWER_ON,
+ CMD_POWER_OFF,
+};
+
+struct cmdline_opts {
+ enum command command;
+ bool debug;
+ bool dry_run;
+};
+
+#endif /* IPC_MODEM */
--
2.35.1
More information about the Replicant
mailing list