Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core-c] removed ecal_ prefix of public API header files #1939

Merged
merged 7 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 31 additions & 33 deletions lang/c/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ project(core_c VERSION ${eCAL_VERSION_STRING})
# c interface
######################################
set(ecal_c_src
src/ecal_client_cimpl.cpp
src/ecal_common_cimpl.cpp
src/ecal_common_cimpl.h
src/ecal_core_cimpl.cpp
src/ecal_log_cimpl.cpp
src/ecal_monitoring_cimpl.cpp
src/ecal_process_cimpl.cpp
src/ecal_publisher_cimpl.cpp
src/ecal_server_cimpl.cpp
src/ecal_subscriber_cimpl.cpp
src/ecal_time_cimpl.cpp
src/ecal_timer_cimpl.cpp
src/ecal_util_cimpl.cpp
src/client.cpp
src/common.cpp
src/common.h
src/core.cpp
src/log.cpp
src/monitoring.cpp
src/process.cpp
src/publisher.cpp
src/server.cpp
src/subscriber.cpp
src/time.cpp
src/timer.cpp
src/util.cpp
)

######################################
Expand All @@ -51,29 +51,27 @@ endif()
######################################
# public header
######################################


set(ecal_header_cimpl
include/ecal/cimpl/ecal_callback_cimpl.h
include/ecal/cimpl/ecal_client_cimpl.h
include/ecal/cimpl/ecal_core_cimpl.h
include/ecal/cimpl/ecal_init_cimpl.h
include/ecal/cimpl/ecal_log_cimpl.h
include/ecal/cimpl/ecal_monitoring_cimpl.h
include/ecal/cimpl/ecal_process_cimpl.h
include/ecal/cimpl/ecal_publisher_cimpl.h
include/ecal/cimpl/ecal_server_cimpl.h
include/ecal/cimpl/ecal_service_info_cimpl.h
include/ecal/cimpl/ecal_subscriber_cimpl.h
include/ecal/cimpl/ecal_time_cimpl.h
include/ecal/cimpl/ecal_timer_cimpl.h
include/ecal/cimpl/ecal_util_cimpl.h
include/ecal/ecalc.h
include/ecal/ecalc_export.h
include/ecal/ecalc_types.h
include/ecal_c/pubsub/publisher.h
include/ecal_c/pubsub/subscriber.h
include/ecal_c/service/client.h
include/ecal_c/service/server.h
include/ecal_c/service/service_info.h
include/ecal_c/callback.h
include/ecal_c/core.h
include/ecal_c/ecal.h
include/ecal_c/export.h
include/ecal_c/init.h
include/ecal_c/log.h
include/ecal_c/monitoring.h
include/ecal_c/process.h
include/ecal_c/time.h
include/ecal_c/timer.h
include/ecal_c/tlayer.h
include/ecal_c/types.h
include/ecal_c/util.h
)


set(ecal_c_sources
${ecal_c_src}
${ecal_c_win_src}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
*/

/**
* @file ecal_callback_cimpl.h
* @file callback.h
* @brief eCAL callback interface events, structs and functions
**/

#ifndef ecal_callback_cimpl_h_included
#define ecal_callback_cimpl_h_included
#ifndef callback_h_included
#define callback_h_included

/**
* @brief eCAL subscriber event callback type.
Expand Down Expand Up @@ -189,4 +189,4 @@ typedef void(*ClientEventCallbackCT)(const char* name_, const struct SClientEven
**/
typedef void(*ServerEventCallbackCT)(const char* name_, const struct SServerEventCallbackDataC* data_, void* par_);

#endif /* ecal_callback_cimpl_h_included */
#endif /* callback_h_included */
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
*/

/**
* @file ecal_core_cimpl.h
* @file core.h
* @brief eCAL core function c interface
**/

#ifndef ecal_core_cimpl_h_included
#define ecal_core_cimpl_h_included
#ifndef core_h_included
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep canonical names here (including e.g. the folder structure), to avoid name clashes with other libraries (e.g. type_h_included might be something different libraries might define...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively, we could just do #pragma once where the compiler will do the right thing.
not sure how well defined this is for C compilers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added folder structure (next commit) ..

#define core_h_included

#include <ecal/ecalc_export.h>
#include <ecal/ecalc_types.h>
#include <ecal_c/export.h>
#include <ecal_c/types.h>

#include <ecal/cimpl/ecal_init_cimpl.h>
#include <ecal_c/init.h>

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -122,4 +122,4 @@ extern "C"
}
#endif /*__cplusplus*/

#endif /*ecal_core_cimpl_h_included*/
#endif /*core_h_included*/
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@
*/

/**
* @file ecalc.h
* @file ecal.h
* @brief eCAL main c header file
**/

#ifndef ecalc_h_included
#define ecalc_h_included
#ifndef ecal_h_included
#define ecal_h_included

#ifndef _MSC_VER
#include <string.h>
#endif

// all ecal c includes
#include <ecal/ecalc_export.h>
#include <ecal/ecalc_types.h>
#include <ecal/cimpl/ecal_client_cimpl.h>
#include <ecal/cimpl/ecal_core_cimpl.h>
#include <ecal/cimpl/ecal_log_cimpl.h>
#include <ecal/cimpl/ecal_monitoring_cimpl.h>
#include <ecal/cimpl/ecal_process_cimpl.h>
#include <ecal/cimpl/ecal_publisher_cimpl.h>
#include <ecal/cimpl/ecal_server_cimpl.h>
#include <ecal/cimpl/ecal_subscriber_cimpl.h>
#include <ecal/cimpl/ecal_time_cimpl.h>
#include <ecal/cimpl/ecal_timer_cimpl.h>
#include <ecal/cimpl/ecal_tlayer_cimpl.h>
#include <ecal/cimpl/ecal_util_cimpl.h>
#include <ecal_c/pubsub/publisher.h>
#include <ecal_c/pubsub/subscriber.h>
#include <ecal_c/service/client.h>
#include <ecal_c/service/server.h>
#include <ecal_c/core.h>
#include <ecal_c/export.h>
#include <ecal_c/log.h>
#include <ecal_c/monitoring.h>
#include <ecal_c/process.h>
#include <ecal_c/time.h>
#include <ecal_c/timer.h>
#include <ecal_c/tlayer.h>
#include <ecal_c/types.h>
#include <ecal_c/util.h>

#endif /* ecalc_h_included */
#endif /* ecal_h_included */
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
*/

/**
* @file ecalc_export.h
* @file export.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in c++ we kept the folder structure here (or did we?), maybe it makes sense here, too. @file ecal_c/export

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next commit ..

* @brief eCAL dll / so export commands
**/

#ifndef ecalc_export_h_included
#define ecalc_export_h_included
#ifndef export_h_included
#define export_h_included

#ifdef _MSC_VER
#ifdef ECAL_CORE_C_EXPORTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
*/

/**
* @file ecal_init_cimpl.h
* @file init.h
* @brief eCAL initialize components
**/

#ifndef ecal_init_cimpl_h_included
#define ecal_init_cimpl_h_included
#ifndef init_h_included
#define init_h_included

#define eCAL_Init_Publisher 0x01 /*!< Initialize Publisher API */
#define eCAL_Init_Subscriber 0x02 /*!< Initialize Subscriber API */
Expand All @@ -45,4 +45,4 @@
| eCAL_Init_Logging \
| eCAL_Init_TimeSync) /*!< Initialize default eCAL API */

#endif /*ecal_init_cimpl_h_included*/
#endif /*init_h_included*/
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
*/

/**
* @file ecal_log_cimpl.h
* @file log.h
* @brief eCAL logging c interface
**/

#ifndef ecal_log_cimpl_h_included
#define ecal_log_cimpl_h_included
#ifndef log_h_included
#define log_h_included

#include <ecal/ecalc_export.h>
#include <ecal_c/export.h>

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -69,4 +69,4 @@ extern "C"
}
#endif /*__cplusplus*/

#endif /*ecal_log_cimpl_h_included*/
#endif /*log_h_included*/
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
*/

/**
* @file ecal_monitoring_cimpl.h
* @file monitoring.h
* @brief eCAL monitoring c interface
**/

#ifndef ecal_monitoring_cimpl_h_included
#define ecal_monitoring_cimpl_h_included
#ifndef monitoring_h_included
#define monitoring_h_included

#include <ecal/ecalc_export.h>
#include <ecal_c/export.h>

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -60,4 +60,4 @@ extern "C"
}
#endif /*__cplusplus*/

#endif /*ecal_monitoring_cimpl_h_included*/
#endif /*monitoring_h_included*/
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
*/

/**
* @file ecal_process_cimpl.h
* @file process.h
* @brief eCAL process c interface
**/

#ifndef ecal_process_cimpl_h_included
#define ecal_process_cimpl_h_included
#ifndef process_h_included
#define process_h_included

#include <ecal/ecalc_export.h>
#include <ecal_c/export.h>

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -188,4 +188,4 @@ extern "C"
}
#endif /*__cplusplus*/

#endif /*ecal_process_cimpl_h_included*/
#endif /*process_h_included*/
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
*/

/**
* @file ecal_publisher_cimpl.h
* @file publisher.h
* @brief eCAL publisher c interface
**/

#ifndef ecal_publisher_cimpl_h_included
#define ecal_publisher_cimpl_h_included
#ifndef publisher_h_included
#define publisher_h_included

#include <ecal/ecalc_export.h>
#include <ecal/ecalc_types.h>
#include <ecal_c/export.h>
#include <ecal_c/types.h>

#include <ecal/cimpl/ecal_callback_cimpl.h>
#include <ecal_c/callback.h>

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -157,4 +157,4 @@ extern "C"
}
#endif /*__cplusplus*/

#endif /*ecal_publisher_cimpl_h_included*/
#endif /*publisher_h_included*/
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
*/

/**
* @file ecal_subscriber_cimpl.h
* @file subscriber.h
* @brief eCAL subscriber c interface
**/

#ifndef ecal_subscriber_cimpl_h_included
#define ecal_subscriber_cimpl_h_included
#ifndef subscriber_h_included
#define subscriber_h_included

#include <ecal/ecalc_export.h>
#include <ecal/ecalc_types.h>
#include <ecal_c/export.h>
#include <ecal_c/types.h>

#include <ecal/cimpl/ecal_callback_cimpl.h>
#include <ecal_c/callback.h>

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -235,4 +235,4 @@ extern "C"
}
#endif /*__cplusplus*/

#endif /*ecal_subscriber_cimpl_h_included*/
#endif /*subscriber_h_included*/
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
*/

/**
* @file ecal_client_cimpl.h
* @file client.h
* @brief eCAL client c interface
**/

#ifndef ecal_client_cimpl_h_included
#define ecal_client_cimpl_h_included
#ifndef client_h_included
#define client_h_included

#include <ecal/ecalc_export.h>
#include <ecal/ecalc_types.h>
#include <ecal_c/export.h>
#include <ecal_c/types.h>

#include <ecal/cimpl/ecal_callback_cimpl.h>
#include <ecal/cimpl/ecal_service_info_cimpl.h>
#include <ecal_c/callback.h>
#include <ecal_c/service/service_info.h>

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -168,4 +168,4 @@ extern "C"
}
#endif /*__cplusplus*/

#endif /*ecal_client_cimpl_h_included*/
#endif /*client_h_included*/
Loading
Loading