From 70b01964f1adf1a80448672303afb1cff8990606 Mon Sep 17 00:00:00 2001 From: "E. Scott Daniels" Date: Thu, 18 Jun 2020 08:22:58 -0400 Subject: [PATCH] Allow C++ applications to include symtab header The RMR symbol table functions are exposed to xAPPs, however the header file lacked the magic C++ goo that allowed it to be included. This change adds the goo, and changes a parameter name in the prototypes to avoide a collision with C++ reserved words. Issue-ID: RIC-522 Signed-off-by: E. Scott Daniels Change-Id: Idadaa109d191b0de0629737f27d2444a4e581e64 --- CHANGES_CORE.txt | 7 +++++++ CMakeLists.txt | 4 ++-- src/rmr/common/include/rmr_symtab.h | 24 +++++++++++++----------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/CHANGES_CORE.txt b/CHANGES_CORE.txt index 4480a81..7b2679c 100644 --- a/CHANGES_CORE.txt +++ b/CHANGES_CORE.txt @@ -5,6 +5,13 @@ # API and build change and fix summaries. Doc correctsions # and/or changes are not mentioned here; see the commit messages. +2020 June 18; version 4.1.0 + Bump version minor to move away from 4.0.* which will bump for any + patches applied back to bronze. + + Add magic C++ goo to symtab header file allowing C++ xAPPs to use + the symbol table directly. + 2020 May 06; version 4.0.5 Fix the bug in SI95 receive message management semaphore count issue. (RIC-355) diff --git a/CMakeLists.txt b/CMakeLists.txt index be08394..e44affd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,8 +40,8 @@ project( rmr LANGUAGES C ) cmake_minimum_required( VERSION 3.5 ) set( major_version "4" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this -set( minor_version "0" ) -set( patch_level "5" ) +set( minor_version "1" ) +set( patch_level "0" ) set( install_root "${CMAKE_INSTALL_PREFIX}" ) set( install_inc "include/rmr" ) diff --git a/src/rmr/common/include/rmr_symtab.h b/src/rmr/common/include/rmr_symtab.h index 80940e6..2498fb4 100644 --- a/src/rmr/common/include/rmr_symtab.h +++ b/src/rmr/common/include/rmr_symtab.h @@ -28,27 +28,29 @@ #ifndef _rmr_symtab_h #define _rmr_symtab_h -#include - -/* --------- symtab ---------------- */ -#define UT_FL_NOCOPY 0x00 /* use user pointer */ -#define UT_FL_COPY 0x01 /* make a copy of the string data */ -#define UT_FL_FREE 0x02 /* free val when deleting */ +#ifdef __cplusplus +extern "C" { +#endif -/* ------------ symtab ----------------------------- */ +// ------------ prototypes ----------------------------- extern void rmr_sym_clear( void *s ); extern void rmr_sym_dump( void *s ); extern void *rmr_sym_alloc( int size ); -extern void rmr_sym_del( void *s, const char *name, unsigned int class ); +extern void rmr_sym_del( void *s, const char *name, unsigned int st_class ); extern void rmr_sym_ndel( void *vtable, uint64_t key ); extern void rmr_sym_free( void *vtable ); -extern void *rmr_sym_get( void *s, const char *name, unsigned int class ); -extern int rmr_sym_put( void *s, const char *name, unsigned int class, void *val ); +extern void *rmr_sym_get( void *s, const char *name, unsigned int st_class ); +extern int rmr_sym_put( void *s, const char *name, unsigned int st_class, void *val ); extern int rmr_sym_map( void *s, uint64_t key, void *val ); extern void *rmr_sym_pull( void *vtable, uint64_t key ); extern void rmr_sym_stats( void *s, int level ); -extern void rmr_sym_foreach_class( void *vst, unsigned int class, void (* user_fun)( void*, void*, const char*, void*, void* ), void *user_data ); +extern void rmr_sym_foreach_class( void *vst, unsigned int st_class, void (* user_fun)( void*, void*, const char*, void*, void* ), void *user_data ); + + +#ifdef __cplusplus +} +#endif #endif -- 2.16.6