diff mbox series

[14/17] Move channel.h away from suricatta

Message ID 1511176210-28928-14-git-send-email-sbabic@denx.de
State Accepted
Headers show
Series [01/17] parser: added function to get net child in tree | expand

Commit Message

Stefano Babic Nov. 20, 2017, 11:10 a.m. UTC
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 corelib/channel_curl.c      |  2 +-
 include/channel.h           | 39 +++++++++++++++++++++++++++++++++++++++
 include/suricatta/channel.h | 39 ---------------------------------------
 suricatta/server_hawkbit.c  |  2 +-
 suricatta/server_hawkbit.h  |  1 -
 5 files changed, 41 insertions(+), 42 deletions(-)
 create mode 100644 include/channel.h
 delete mode 100644 include/suricatta/channel.h
diff mbox series

Patch

diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c
index 705b887..608f5d3 100644
--- a/corelib/channel_curl.c
+++ b/corelib/channel_curl.c
@@ -30,7 +30,7 @@ 
 #include <network_ipc.h>
 #include <util.h>
 #include "sslapi.h"
-#include "suricatta/channel.h"
+#include "channel.h"
 #include "channel_curl.h"
 
 #define SPEED_LOW_BYTES_SEC 8
diff --git a/include/channel.h b/include/channel.h
new file mode 100644
index 0000000..f0c13a7
--- /dev/null
+++ b/include/channel.h
@@ -0,0 +1,39 @@ 
+/*
+ * Author: Christian Storm
+ * Copyright (C) 2016, Siemens AG
+ *
+ * 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.
+ */
+
+#pragma once
+#include "channel_op_res.h"
+
+/* Suricatta Channel Interface.
+ *
+ * Each suricatta channel has to implement this interface.
+ * Cf. `channel_hawkbit.c` for an example implementation targeted towards the
+ * [hawkBit](https://projects.eclipse.org/projects/iot.hawkbit) server.
+ */
+typedef struct channel channel_t;
+struct channel {
+	channel_op_res_t (*open)(channel_t *this, void *cfg);
+	channel_op_res_t (*close)(channel_t *this);
+	channel_op_res_t (*get)(channel_t *this, void *data);
+	channel_op_res_t (*get_file)(channel_t *this, void *data, int file_handle);
+	channel_op_res_t (*put)(channel_t *this, void *data);
+	void *priv;
+};
+
+channel_t *channel_new(void);
diff --git a/include/suricatta/channel.h b/include/suricatta/channel.h
deleted file mode 100644
index f0c13a7..0000000
--- a/include/suricatta/channel.h
+++ /dev/null
@@ -1,39 +0,0 @@ 
-/*
- * Author: Christian Storm
- * Copyright (C) 2016, Siemens AG
- *
- * 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.
- */
-
-#pragma once
-#include "channel_op_res.h"
-
-/* Suricatta Channel Interface.
- *
- * Each suricatta channel has to implement this interface.
- * Cf. `channel_hawkbit.c` for an example implementation targeted towards the
- * [hawkBit](https://projects.eclipse.org/projects/iot.hawkbit) server.
- */
-typedef struct channel channel_t;
-struct channel {
-	channel_op_res_t (*open)(channel_t *this, void *cfg);
-	channel_op_res_t (*close)(channel_t *this);
-	channel_op_res_t (*get)(channel_t *this, void *data);
-	channel_op_res_t (*get_file)(channel_t *this, void *data, int file_handle);
-	channel_op_res_t (*put)(channel_t *this, void *data);
-	void *priv;
-};
-
-channel_t *channel_new(void);
diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c
index 59f4cb3..9649d27 100644
--- a/suricatta/server_hawkbit.c
+++ b/suricatta/server_hawkbit.c
@@ -32,7 +32,7 @@ 
 #include <sys/time.h>
 #include <swupdate_status.h>
 #include "suricatta/suricatta.h"
-#include "suricatta/channel.h"
+#include "channel.h"
 #include "channel_curl.h"
 #include "suricatta/state.h"
 #include "server_hawkbit.h"
diff --git a/suricatta/server_hawkbit.h b/suricatta/server_hawkbit.h
index 51938c9..fba399c 100644
--- a/suricatta/server_hawkbit.h
+++ b/suricatta/server_hawkbit.h
@@ -19,7 +19,6 @@ 
 
 #pragma once
 #include <stdbool.h>
-#include <suricatta/channel.h>
 #include <suricatta/state.h>
 #include <swupdate_dict.h>