Permalink
Browse files

Merge pull request #2293 from kodebach/elektra_api

Highlevel API
  • Loading branch information...
markus2330 committed Jan 8, 2019
2 parents f6f4f4f + 2ac3b21 commit 0b862e9ce3c8949232a51877efcc4544f8f684f8
Showing with 5,082 additions and 296 deletions.
  1. +34 −0 .gitignore
  2. +1 −0 .idea/.name
  3. +58 −0 .idea/codeStyles/Project.xml
  4. +5 −0 .idea/codeStyles/codeStyleConfig.xml
  5. +4 −0 .idea/encodings.xml
  6. +12 −0 .idea/inspectionProfiles/Project_Default.xml
  7. +6 −0 .idea/vcs.xml
  8. +1 −1 benchmarks/CMakeLists.txt
  9. +5 −5 benchmarks/opmphm.c
  10. +1 −1 cmake/Modules/LibAddLib.cmake
  11. +3 −0 cmake/Modules/LibAddMacros.cmake
  12. +3 −3 cmake/Modules/LibAddPlugin.cmake
  13. +1 −1 cmake/Modules/LibAddTest.cmake
  14. +1 −199 doc/decisions/high_level_api.md
  15. +33 −2 doc/news/_preparation_next_release.md
  16. +1 −0 doc/tutorials/README.md
  17. +4 −4 examples/CMakeLists.txt
  18. +1 −0 scripts/docker/debian/stretch/Dockerfile.minimal
  19. +1 −1 src/bindings/cpp/benchmarks/CMakeLists.txt
  20. +1 −1 src/bindings/cpp/examples/CMakeLists.txt
  21. +1 −1 src/bindings/glib/CMakeLists.txt
  22. +1 −1 src/bindings/intercept/env/benchmarks/CMakeLists.txt
  23. +1 −1 src/bindings/intercept/env/examples/CMakeLists.txt
  24. +1 −1 src/bindings/intercept/env/src/CMakeLists.txt
  25. +1 −1 src/bindings/io/doc/CMakeLists.txt
  26. +1 −1 src/bindings/io/ev/CMakeLists.txt
  27. +1 −1 src/bindings/io/ev/example/CMakeLists.txt
  28. +1 −1 src/bindings/io/glib/CMakeLists.txt
  29. +1 −1 src/bindings/io/glib/example/CMakeLists.txt
  30. +1 −1 src/bindings/io/uv/CMakeLists.txt
  31. +1 −1 src/bindings/io/uv/example/CMakeLists.txt
  32. +26 −0 src/error/CMakeLists.txt
  33. +366 −32 src/error/exporterrors.cpp
  34. +3 −3 src/error/specification
  35. +58 −0 src/error/specification_highlevel
  36. +6 −0 src/include/CMakeLists.txt
  37. +466 −0 src/include/elektra.h
  38. +58 −0 src/include/elektra/conversion.h
  39. +59 −0 src/include/elektra/error.h
  40. +35 −0 src/include/elektra/types.h
  41. +50 −1 src/include/kdbprivate.h
  42. +2 −0 src/include/kdbtypes.h
  43. +45 −5 src/include/macros/type_create_to_value.h
  44. +3 −0 src/libs/CMakeLists.txt
  45. +7 −5 src/libs/elektra/CMakeLists.txt
  46. +2 −0 src/libs/elektra/libelektra-symbols.map
  47. +5 −0 src/libs/highlevel/CMakeLists.txt
  48. +300 −0 src/libs/highlevel/README.md
  49. +441 −0 src/libs/highlevel/elektra.c
  50. +588 −0 src/libs/highlevel/elektra_array_value.c
  51. +618 −0 src/libs/highlevel/elektra_conversion.c
  52. +254 −0 src/libs/highlevel/elektra_error.c
  53. +532 −0 src/libs/highlevel/elektra_value.c
  54. +1 −1 src/libs/notification/tests/CMakeLists.txt
  55. +1 −1 src/libs/pluginprocess/tests/CMakeLists.txt
  56. +1 −1 src/libs/tools/benchmarks/CMakeLists.txt
  57. +1 −1 src/libs/tools/examples/CMakeLists.txt
  58. +3 −3 src/libs/tools/src/CMakeLists.txt
  59. +1 −1 src/plugins/dbus/CMakeLists.txt
  60. +1 −1 src/tools/gen/gen
  61. BIN src/tools/gen/support/__init__.pyc
  62. BIN src/tools/gen/support/c.pyc
  63. +26 −0 src/tools/gen/support/c_elektra.py
  64. BIN src/tools/gen/support/cpp.pyc
  65. BIN src/tools/gen/support/elektra_gen.pyc
  66. BIN src/tools/gen/support/gen.pyc
  67. BIN src/tools/gen/support/util.pyc
  68. +1 −1 src/tools/hub-zeromq/CMakeLists.txt
  69. +4 −3 src/tools/kdb/CMakeLists.txt
  70. +1 −1 src/tools/qt-gui/CMakeLists.txt
  71. +1 −1 src/tools/rest-backend/benchmarks/CMakeLists.txt
  72. +1 −1 tests/CMakeLists.txt
  73. +1 −1 tests/cframework/CMakeLists.txt
  74. +5 −1 tests/cframework/tests.h
  75. +5 −3 tests/kdb/CMakeLists.txt
  76. +917 −0 tests/kdb/testkdb_highlevel.cpp
@@ -33,3 +33,37 @@ nbproject/
#ignore macOS folder attribute files
.DS_Store
.directory

#ignore pyc files
*.pyc

#ignore CLion project files
## User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

## Generated files
.idea/**/contentModel.xml

## Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# File-based project format
*.iws

# Editor-based Rest Client
.idea/httpRequests

*.iml
modules.xml
.idea/misc.xml
*.ipr
@@ -0,0 +1 @@
Elektra
@@ -0,0 +1,58 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="USE_TAB_CHARACTER" value="true" />
</value>
</option>
<option name="RIGHT_MARGIN" value="140" />
<Objective-C>
<option name="INDENT_NAMESPACE_MEMBERS" value="0" />
<option name="INDENT_C_STRUCT_MEMBERS" value="8" />
<option name="INDENT_CLASS_MEMBERS" value="8" />
<option name="INDENT_INSIDE_CODE_BLOCK" value="8" />
<option name="NAMESPACE_BRACE_PLACEMENT" value="2" />
<option name="FUNCTION_BRACE_PLACEMENT" value="2" />
<option name="BLOCK_BRACE_PLACEMENT" value="2" />
<option name="SPACE_AFTER_POINTER_IN_DECLARATION" value="true" />
<option name="SPACE_AFTER_REFERENCE_IN_DECLARATION" value="true" />
</Objective-C>
<Objective-C-extensions>
<extensions>
<pair source="cpp" header="hpp" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
<codeStyleSettings language="CMake">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="SPACE_BEFORE_METHOD_CALL_PARENTHESES" value="true" />
<option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="8" />
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="ObjectiveC">
<option name="BRACE_STYLE" value="5" />
<option name="CLASS_BRACE_STYLE" value="2" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="SPACE_BEFORE_METHOD_CALL_PARENTHESES" value="true" />
<option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="false" />
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="false" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<indentOptions>
<option name="INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="8" />
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Python">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>
@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
@@ -0,0 +1,12 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="W191" />
</list>
</option>
</inspection_tool>
</profile>
</component>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
@@ -6,7 +6,7 @@ macro (do_benchmark source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${ADDITIONAL_SOURCES} benchmarks.c benchmarks.h ${source}.c)
add_executable (benchmark_${source} ${SOURCES})
add_dependencies (benchmark_${source} kdberrors_generated)
add_dependencies (benchmark_${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (benchmark_${source} elektra-kdb elektra-meta)

@@ -39,7 +39,7 @@ int32_t elektraRandBenchmarkInitSeed;
// benchmarks helpers
static int32_t * getRandomSeed (int32_t * seed);
static FILE * openOutFileWithRPartitePostfix (const char * name, uint8_t r);
static const char * elektraGetString (void * data);
static const char * getString (void * data);
static size_t getPower (size_t p, size_t q);
static int cmpInteger (const void * a, const void * b);
// generate KeySets
@@ -314,7 +314,7 @@ static void benchmarkMapping (char * name)
size_t threadI = 0;
// OPMPHM
OpmphmInit init;
init.getName = elektraGetString;
init.getName = getString;
init.data = (void **) (ks->array);
// OPMPHM
#ifdef USE_OPENMP
@@ -600,7 +600,7 @@ static void benchmarkMappingOpt (char * name)
size_t threadI = 0;
// OPMPHM
OpmphmInit init;
init.getName = elektraGetString;
init.getName = getString;
init.data = (void **) (ks->array);
// OPMPHM
#ifdef USE_OPENMP
@@ -863,7 +863,7 @@ static void benchmarkMappingAllSeeds (char * name)
size_t threadI = 0;
// OPMPHM
OpmphmInit init;
init.getName = elektraGetString;
init.getName = getString;
init.data = (void **) (ks->array);
// OPMPHM

@@ -2264,7 +2264,7 @@ static FILE * openOutFileWithRPartitePostfix (const char * name, uint8_t r)
return out;
}

static const char * elektraGetString (void * data)
static const char * getString (void * data)
{
return keyName ((Key *) data);
}
@@ -12,7 +12,7 @@ function (add_lib name)

if (BUILD_SHARED)
add_library (elektra-${name} SHARED ${ARG_SOURCES})
add_dependencies (elektra-${name} kdberrors_generated)
add_dependencies (elektra-${name} kdberrors_generated elektra_error_codes_generated)

target_link_libraries (elektra-${name} elektra-core ${ARG_LINK_ELEKTRA})
endif (BUILD_SHARED)
@@ -214,6 +214,9 @@ macro (add_headers HDR_FILES)
${SRC_HDR_FILES})

set_source_files_properties (${BINARY_INCLUDE_DIR}/kdberrors.h PROPERTIES GENERATED ON SKIP_AUTOMOC ON)
set_source_files_properties (${BINARY_INCLUDE_DIR}/elektra/errorcodes.h PROPERTIES GENERATED ON SKIP_AUTOMOC ON)
set_source_files_properties (${BINARY_INCLUDE_DIR}/elektra/errors.h PROPERTIES GENERATED ON SKIP_AUTOMOC ON)
set_source_files_properties (${BINARY_INCLUDE_DIR}/elektra/errorsprivate.h PROPERTIES GENERATED ON SKIP_AUTOMOC ON)
list (APPEND ${HDR_FILES}
"${BINARY_INCLUDE_DIR}/kdberrors.h")
endmacro (add_headers)
@@ -121,7 +121,7 @@ function (add_plugintest testname)

set (testexename testmod_${testname})
add_executable (${testexename} ${TEST_SOURCES})
add_dependencies (${testexename} kdberrors_generated)
add_dependencies (${testexename} kdberrors_generated elektra_error_codes_generated)

if (BUILD_SHARED)
if (ARG_LINK_PLUGIN)
@@ -555,7 +555,7 @@ function (add_plugin PLUGIN_SHORT_NAME)
endif (ARG_CPP)

add_library (${PLUGIN_OBJS} OBJECT ${ARG_SOURCES})
add_dependencies (${PLUGIN_OBJS} kdberrors_generated)
add_dependencies (${PLUGIN_OBJS} kdberrors_generated elektra_error_codes_generated)
if (ARG_DEPENDS)
add_dependencies (${PLUGIN_OBJS} ${ARG_DEPENDS})
endif ()
@@ -603,7 +603,7 @@ function (add_plugin PLUGIN_SHORT_NAME)

if (BUILD_SHARED)
add_library (${PLUGIN_NAME} MODULE ${ARG_SOURCES} ${ARG_OBJECT_SOURCES})
add_dependencies (${PLUGIN_NAME} kdberrors_generated)
add_dependencies (${PLUGIN_NAME} kdberrors_generated elektra_error_codes_generated)
if (ARG_DEPENDS)
add_dependencies (${PLUGIN_NAME} ${ARG_DEPENDS})
endif ()
@@ -26,7 +26,7 @@ macro (add_gtest source)
if (BUILD_TESTING)
set (SOURCES ${HDR_FILES} ${source}.cpp ${ARG_SOURCES})
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

if (ARG_LINK_TOOLS)
target_link_elektratools (${source} ${ARG_LINK_ELEKTRA})
Oops, something went wrong.

0 comments on commit 0b862e9

Please sign in to comment.