You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/04/27 09:32:21 UTC

[plc4x] branch feature/c-api updated: flatten includes, remove addr sample, use <> includes

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/c-api
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/feature/c-api by this push:
     new 35e7047  flatten includes, remove addr sample, use <> includes
     new 220f1e8  Merge pull request #145 from ottobackwards/c-api-2
35e7047 is described below

commit 35e70476f68d31f054ed07c485818ca592a80632
Author: Otto Fowler <ot...@gmail.com>
AuthorDate: Thu Apr 23 16:28:09 2020 -0400

    flatten includes, remove addr sample, use <> includes
---
 sandbox/plc4c/api/CMakeLists.txt                   |  2 ++
 sandbox/plc4c/api/include/Adder.h                  | 25 --------------
 sandbox/plc4c/api/include/{ => plc4c}/plc4c.h      |  0
 sandbox/plc4c/api/src/Adder.c                      | 24 -------------
 sandbox/plc4c/api/test/AdderTest.c                 | 40 ----------------------
 .../plc4c/{driver/modbus.h => driver_modbus.h}     |  0
 sandbox/plc4c/drivers/modbus/src/driver_modbus.c   |  2 +-
 .../s7/include/plc4c/{driver/s7.h => driver_s7.h}  |  0
 sandbox/plc4c/drivers/s7/src/driver_s7.c           |  2 +-
 .../{driver/simulated.h => driver_simulated.h}     |  0
 .../plc4c/drivers/simulated/src/driver_simulated.c |  2 +-
 .../plc4c/examples/hello-world/src/hello_world.c   |  4 +--
 sandbox/plc4c/spi/src/connection.c                 |  2 +-
 13 files changed, 8 insertions(+), 95 deletions(-)

diff --git a/sandbox/plc4c/api/CMakeLists.txt b/sandbox/plc4c/api/CMakeLists.txt
index cd129f7..fb45343 100644
--- a/sandbox/plc4c/api/CMakeLists.txt
+++ b/sandbox/plc4c/api/CMakeLists.txt
@@ -19,6 +19,7 @@
 
 include_directories("include")
 
+#[[
 file(GLOB sources "src/*.c")
 
 add_library(plc4c-api SHARED ${sources})
@@ -32,3 +33,4 @@ if(BUILD_PHASE STREQUAL test-compile)
     )
     add_test(NAME plc4c-api-test COMMAND plc4c-api-test)
 endif()
+]]
\ No newline at end of file
diff --git a/sandbox/plc4c/api/include/Adder.h b/sandbox/plc4c/api/include/Adder.h
deleted file mode 100644
index 680fddb..0000000
--- a/sandbox/plc4c/api/include/Adder.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _ADDER_H_
-#define _ADDER_H_
-
-int add(int, int);
-
-#endif
\ No newline at end of file
diff --git a/sandbox/plc4c/api/include/plc4c.h b/sandbox/plc4c/api/include/plc4c/plc4c.h
similarity index 100%
rename from sandbox/plc4c/api/include/plc4c.h
rename to sandbox/plc4c/api/include/plc4c/plc4c.h
diff --git a/sandbox/plc4c/api/src/Adder.c b/sandbox/plc4c/api/src/Adder.c
deleted file mode 100644
index 8f14af0..0000000
--- a/sandbox/plc4c/api/src/Adder.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include<stdio.h>
-#include "../include/Adder.h"
-
-int add(int a, int b) {
-    return a + b;
-}
\ No newline at end of file
diff --git a/sandbox/plc4c/api/test/AdderTest.c b/sandbox/plc4c/api/test/AdderTest.c
deleted file mode 100644
index 7033a32..0000000
--- a/sandbox/plc4c/api/test/AdderTest.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include <unity.h>
-#include "../include/Adder.h"
-
-void setUp(void) {
-}
-
-void tearDown(void) {
-}
-
-void test_add(void)
-{
-    TEST_ASSERT_EQUAL_HEX8(2, add(1, 1));
-}
-
-int main(void)
-{
-    UNITY_BEGIN();
-
-    RUN_TEST(test_add);
-
-    return UNITY_END();
-}
\ No newline at end of file
diff --git a/sandbox/plc4c/drivers/modbus/include/plc4c/driver/modbus.h b/sandbox/plc4c/drivers/modbus/include/plc4c/driver_modbus.h
similarity index 100%
rename from sandbox/plc4c/drivers/modbus/include/plc4c/driver/modbus.h
rename to sandbox/plc4c/drivers/modbus/include/plc4c/driver_modbus.h
diff --git a/sandbox/plc4c/drivers/modbus/src/driver_modbus.c b/sandbox/plc4c/drivers/modbus/src/driver_modbus.c
index 1240f42..3ed1537 100644
--- a/sandbox/plc4c/drivers/modbus/src/driver_modbus.c
+++ b/sandbox/plc4c/drivers/modbus/src/driver_modbus.c
@@ -19,7 +19,7 @@
 
 #include <stdlib.h>
 #include <plc4c/spi/types_private.h>
-#include "plc4c/driver/modbus.h"
+#include <plc4c/driver_modbus.h>
 
 plc4c_driver *plc4c_driver_modbus_create() {
     plc4c_driver* driver = (plc4c_driver*) malloc(sizeof(plc4c_driver));
diff --git a/sandbox/plc4c/drivers/s7/include/plc4c/driver/s7.h b/sandbox/plc4c/drivers/s7/include/plc4c/driver_s7.h
similarity index 100%
rename from sandbox/plc4c/drivers/s7/include/plc4c/driver/s7.h
rename to sandbox/plc4c/drivers/s7/include/plc4c/driver_s7.h
diff --git a/sandbox/plc4c/drivers/s7/src/driver_s7.c b/sandbox/plc4c/drivers/s7/src/driver_s7.c
index 5bcc2b0..8e3a5e8 100644
--- a/sandbox/plc4c/drivers/s7/src/driver_s7.c
+++ b/sandbox/plc4c/drivers/s7/src/driver_s7.c
@@ -19,7 +19,7 @@
 
 #include <stdlib.h>
 #include <plc4c/spi/types_private.h>
-#include "plc4c/driver/s7.h"
+#include <plc4c/driver_s7.h>
 
 plc4c_driver *plc4c_driver_s7_create() {
     plc4c_driver* driver = (plc4c_driver*) malloc(sizeof(plc4c_driver));
diff --git a/sandbox/plc4c/drivers/simulated/include/plc4c/driver/simulated.h b/sandbox/plc4c/drivers/simulated/include/plc4c/driver_simulated.h
similarity index 100%
rename from sandbox/plc4c/drivers/simulated/include/plc4c/driver/simulated.h
rename to sandbox/plc4c/drivers/simulated/include/plc4c/driver_simulated.h
diff --git a/sandbox/plc4c/drivers/simulated/src/driver_simulated.c b/sandbox/plc4c/drivers/simulated/src/driver_simulated.c
index 7614980..4684340 100644
--- a/sandbox/plc4c/drivers/simulated/src/driver_simulated.c
+++ b/sandbox/plc4c/drivers/simulated/src/driver_simulated.c
@@ -19,7 +19,7 @@
 
 #include <stdlib.h>
 #include <plc4c/spi/types_private.h>
-#include "plc4c/driver/simulated.h"
+#include <plc4c/driver_simulated.h>
 
 plc4c_driver *plc4c_driver_simulated_create() {
     plc4c_driver* driver = (plc4c_driver*) malloc(sizeof(plc4c_driver));
diff --git a/sandbox/plc4c/examples/hello-world/src/hello_world.c b/sandbox/plc4c/examples/hello-world/src/hello_world.c
index 010a271..e4b669e 100644
--- a/sandbox/plc4c/examples/hello-world/src/hello_world.c
+++ b/sandbox/plc4c/examples/hello-world/src/hello_world.c
@@ -17,8 +17,8 @@
  * under the License.
  */
 #include <stdio.h>
-#include <plc4c.h>
-#include <plc4c/driver/simulated.h>
+#include <plc4c/plc4c.h>
+#include <plc4c/driver_simulated.h>
 
 void onGlobalConnectionSuccess(plc4c_connection *connection) {
     printf("Connected to %s", plc4c_connection_get_connection_string(connection));
diff --git a/sandbox/plc4c/spi/src/connection.c b/sandbox/plc4c/spi/src/connection.c
index 90390f8..4028f07 100644
--- a/sandbox/plc4c/spi/src/connection.c
+++ b/sandbox/plc4c/spi/src/connection.c
@@ -18,7 +18,7 @@
  */
 
 #include <plc4c/connection.h>
-#include "plc4c/spi/types_private.h"
+#include <plc4c/spi/types_private.h>
 
 return_code plc4c_connection_disconnect(plc4c_connection *connection) {
     return OK;