Skip to content

Commit

Permalink
FEATURE: Namespace the main 'hal' library includes
Browse files Browse the repository at this point in the history
Move the header files from 'HAL' library ('hal_api' INTERFACE library) into folder 'include/hal', which creates a namespace - for example 'hal.h' header should now be included as 'hal/hal.h'.
  • Loading branch information
cerna committed Dec 22, 2021
1 parent 02e223c commit 5c8619d
Show file tree
Hide file tree
Showing 252 changed files with 579 additions and 557 deletions.
2 changes: 1 addition & 1 deletion decide_what_to_do/hal/components/attic/boss_plc.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

#include "rtapi.h" // RTAPI realtime OS API.
#include "rtapi_app.h" // RTAPI realtime module decls.
#include "hal.h" // HAL public API decls.
#include "hal/hal.h" // HAL public API decls.


#define TRUE 1
Expand Down
2 changes: 1 addition & 1 deletion decide_what_to_do/hal/components/attic/modmath.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "rtapi.h" /* RTAPI realtime OS API */
#include "rtapi_app.h" /* RTAPI realtime module decls */
#include "hal.h" /* HAL public API decls */
#include "hal/hal.h" /* HAL public API decls */

#include <linux/types.h>
#include "rtapi_math.h"
Expand Down
2 changes: 1 addition & 1 deletion decide_what_to_do/hal/components/attic/supply.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

#include "rtapi.h" /* RTAPI realtime OS API */
#include "rtapi_app.h" /* RTAPI realtime module decls */
#include "hal.h" /* HAL public API decls */
#include "hal/hal.h" /* HAL public API decls */

/* module information */
MODULE_AUTHOR("Matt Shaver");
Expand Down
2 changes: 1 addition & 1 deletion decide_what_to_do/hal/components/hal_pru.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "rtapi.h" /* RTAPI realtime OS API */
#include "rtapi_compat.h" /* RTAPI support functions */
#include "rtapi_app.h" /* RTAPI realtime module decls */
#include "hal.h" /* HAL public API decls */
#include "hal/hal.h" /* HAL public API decls */
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand Down
2 changes: 1 addition & 1 deletion decide_what_to_do/hal/components/hal_prudebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "rtapi.h" /* RTAPI realtime OS API */
#include "rtapi_app.h" /* RTAPI realtime module decls */
#include "hal.h" /* HAL public API decls */
#include "hal/hal.h" /* HAL public API decls */
#include <pthread.h>

#include "prussdrv.h" // UIO interface to uio_pruss
Expand Down
6 changes: 3 additions & 3 deletions decide_what_to_do/hal/lib/hal_alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include "config.h"
#include "rtapi.h" /* RTAPI realtime OS API */
#include "hal.h" /* HAL public API decls */
#include "hal_priv.h" /* HAL private decls */
#include "hal_internal.h"
#include "hal/hal.h" /* HAL public API decls */
#include "hal/hal_priv.h" /* HAL private decls */
#include "hal/hal_internal.h"


hal_oldname_t *halpr_alloc_oldname_struct(void)
Expand Down
2 changes: 1 addition & 1 deletion decide_what_to_do/hal/lib/hal_iter.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "hal_iter.h"
#include "hal/hal_iter.h"


8 changes: 4 additions & 4 deletions decide_what_to_do/hal/lib/hal_plug.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

#include "config.h"
#include "rtapi.h" /* RTAPI realtime OS API */
#include "hal.h" /* HAL public API decls */
#include "hal_priv.h" /* HAL private decls */
#include "hal_ring.h"
#include "hal_internal.h"
#include "hal/hal.h" /* HAL public API decls */
#include "hal/hal_priv.h" /* HAL private decls */
#include "hal/hal_ring.h"
#include "hal/hal_internal.h"



Expand Down
4 changes: 2 additions & 2 deletions decide_what_to_do/hal/vtable-example/vtexport.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#include "rtapi.h"
#include "rtapi_app.h"
#include "hal.h"
#include "hal_priv.h"
#include "hal/hal.h"
#include "hal/hal_priv.h"

#include "vtexample.h"

Expand Down
4 changes: 2 additions & 2 deletions decide_what_to_do/hal/vtable-example/vtuse.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#include "rtapi.h"
#include "rtapi_app.h"
#include "hal.h"
#include "hal_priv.h"
#include "hal/hal.h"
#include "hal/hal_priv.h"

#include "vtexample.h"

Expand Down
6 changes: 3 additions & 3 deletions decide_what_to_do/hal_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include "config.h"
#include "rtapi.h" /* RTAPI realtime OS API */
#include "hal.h" /* HAL public API decls */
#include "hal_priv.h" /* HAL private decls */
#include "hal_internal.h"
#include "hal/hal.h" /* HAL public API decls */
#include "hal/hal_priv.h" /* HAL private decls */
#include "hal/hal_internal.h"

#if defined(ULAPI)
#include <sys/types.h> /* pid_t */
Expand Down
1 change: 0 additions & 1 deletion src/executables/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ add_subdirectory(encdec)
add_subdirectory(fix_uuid)
add_subdirectory(halcmd)
add_subdirectory(halrun)
add_subdirectory(haltalk)
add_subdirectory(inivar)
add_subdirectory(instcomp)
add_subdirectory(linmove)
Expand Down
2 changes: 1 addition & 1 deletion src/executables/comp/src/comp.g
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def prologue(f):
#endif
#include "rtapi_string.h"
#include "rtapi_errno.h"
#include "hal.h"
#include "hal/hal.h"
static int comp_id;
""")
Expand Down
6 changes: 2 additions & 4 deletions src/executables/halcmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ if(BUILD_HALCMD_EXECUTABLE)
add_executable(halcmd)

set(SOURCE_FILES src/halcmd_completion.c src/halcmd_main.c)
set(PRIVATE_HEADER_FILES src/halcmd_completion.h)

find_package(Readline REQUIRED)

target_sources(halcmd PRIVATE ${SOURCE_FILES})

target_include_directories(
halcmd PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
target_sources(halcmd PRIVATE ${SOURCE_FILES} ${PRIVATE_HEADER_FILES})

target_compile_definitions(halcmd PRIVATE "ULAPI")

Expand Down
8 changes: 4 additions & 4 deletions src/executables/halcmd/src/halcmd_completion.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
#include "linux/limits.h"
#include "stdlib.h"
#include "rtapi.h" /* RTAPI realtime OS API */
#include "hal.h" /* HAL public API decls */
#include "hal_priv.h" /* private HAL decls */
#include "hal_ring.h" /* ringbuffer declarations */
#include "hal_group.h" /* halgroups declarations */
#include "hal/hal.h" /* HAL public API decls */
#include "hal/hal_priv.h" /* private HAL decls */
#include "hal/hal_ring.h" /* ringbuffer declarations */
#include "hal/hal_group.h" /* halgroups declarations */

static int argno;

Expand Down
4 changes: 2 additions & 2 deletions src/executables/halcmd/src/halcmd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

#include "config.h"
#include "rtapi.h"
#include "hal.h"
#include "hal_priv.h"
#include "hal/hal.h"
#include "hal/hal_priv.h"
#include "halcmd.h"
#include "halcmd_commands.h"
#include "halcmd_completion.h"
Expand Down
31 changes: 0 additions & 31 deletions src/executables/haltalk/CMakeLists.txt

This file was deleted.

38 changes: 0 additions & 38 deletions src/executables/haltalk/Submakefile

This file was deleted.

10 changes: 5 additions & 5 deletions src/executables/instcomp/src/instcomp.g
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ def prologue(f):
#endif
#include "rtapi_string.h"
#include "rtapi_errno.h"
#include "hal.h"
#include "hal_priv.h"
#include "hal_accessor.h"
#include "hal_internal.h"
#include "hal/hal.h"
#include "hal/hal_priv.h"
#include "hal/hal_accessor.h"
#include "hal/hal_internal.h"
\nstatic int comp_id;
\n""")
for value in userdef_includes:
Expand Down Expand Up @@ -1044,7 +1044,7 @@ def prologue(f):
f.write("#define local_argv(i) (ip->local_argv[i])\n")

if (pin_ptrs):
f.write("#include <hal_accessor_macros.h>\n")
f.write("#include <hal/hal_accessor_macros.h>\n")
f.write("\n")
f.write("\n")

Expand Down
6 changes: 3 additions & 3 deletions src/executables/messagebus/src/messagebus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

//#include "config.h"
#include <rtapi.h>
#include <hal.h>
#include <hal_priv.h>
#include <hal_ring.h>
#include <hal/hal.h>
#include <hal/hal_priv.h>
#include <hal/hal_ring.h>
#include <setup_signals.h>
#include <mk-zeroconf.hh>
//#include <select_interface.h>
Expand Down
6 changes: 3 additions & 3 deletions src/executables/messagebus/src/rtproxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

#include <rtapi.h>
#include <rtapi_hexdump.h>
#include <hal.h>
#include <hal_priv.h>
#include <hal_ring.h>
#include <hal/hal.h>
#include <hal/hal_priv.h>
#include <hal/hal_ring.h>

#include <machinetalk/include/pb-hal.h>
#include <machinetalk/nanopb/pb_decode.h>
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/executables/msgd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ if(BUILD_MSGD_EXECUTABLE)
pkg_check_modules(UUID "uuid" REQUIRED IMPORTED_TARGET)
pkg_check_modules(LIBZMQ "libzmq" REQUIRED IMPORTED_TARGET)

find_library(LIBATOMIC NAMES "atomic" "libatomic" "libatomic.so" "libatomic.so.1" REQUIRED)
find_library(LIBRT NAMES "rt" "librt" "librt.so" REQUIRED)
find_library(ATOMIC NAMES "atomic" "libatomic" "libatomic.so" "libatomic.so.1" REQUIRED)
find_library(RT NAMES "rt" "librt" "librt.so" REQUIRED)

target_link_libraries(
msgd
Expand All @@ -50,8 +50,8 @@ if(BUILD_MSGD_EXECUTABLE)
PkgConfig::UUID
PkgConfig::LIBZMQ
${CMAKE_DL_LIBS}
${LIBATOMIC}
${LIBRT})
${ATOMIC}
${RT})

set_target_properties(
msgd
Expand Down
4 changes: 2 additions & 2 deletions src/executables/mutexwatch/src/mutexwatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "rtapi_common.h"
#include "rtapi_global.h"
#include "shmdrv.h"
#include "hal.h"
#include "hal_priv.h"
#include "hal/hal.h"
#include "hal/hal_priv.h"

hal_data_t *hal_data;

Expand Down
4 changes: 3 additions & 1 deletion src/executables/rtapi_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ if(BUILD_RTAPI_APP_EXECUTABLE)
add_executable(rtapi_app)

set(SOURCE_FILES src/rtapi_app.cc)
set(PRIVATE_HEADER_FILES src/rtapi_app_module.hh)

target_sources(
rtapi_app
PRIVATE ${SOURCE_FILES} $<TARGET_PROPERTY:rtapi_support,INTERFACE_SOURCES>
PRIVATE ${SOURCE_FILES} ${PRIVATE_HEADER_FILES}
$<TARGET_PROPERTY:rtapi_support,INTERFACE_SOURCES>
$<TARGET_PROPERTY:rtapi_compat,INTERFACE_SOURCES>)

target_include_directories(
Expand Down
4 changes: 2 additions & 2 deletions src/executables/rtapi_app/src/rtapi_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

using namespace google::protobuf;

#include "hal.h"
#include "hal_priv.h"
#include "hal/hal.h"
#include "hal/hal_priv.h"
#include "rtapi.h"
#include "rtapi_export.h"
#include "rtapi_flavor.h" // flavor_*
Expand Down
4 changes: 3 additions & 1 deletion src/executables/test_rtapi_vsnprinf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^x86.*")
add_executable(test_rtapi_vsnprintf)

set(SOURCE_FILES src/test_rtapi_vsnprintf.c)
set(PRIVATE_HEADER_FILES src/vsnprintf.h)

target_sources(test_rtapi_vsnprintf PRIVATE ${SOURCE_FILES})
target_sources(test_rtapi_vsnprintf PRIVATE ${SOURCE_FILES}
${PRIVATE_HEADER_FILES})

target_include_directories(
test_rtapi_vsnprintf
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5c8619d

Please sign in to comment.