LCOV - code coverage report
Current view: top level - src/libs/elektra - global.c (source / functions) Hit Total Coverage
Test: coverage-filtered.info Lines: 15 15 100.0 %
Date: 2019-09-12 12:28:41 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /**
       2             :  * @file
       3             :  *
       4             :  * @brief Helpers for global plugins
       5             :  *
       6             :  * @copyright BSD License (see doc/COPYING or https://www.libelektra.org)
       7             :  */
       8             : 
       9             : #include <kdbglobal.h>
      10             : #include <kdbprivate.h>
      11             : 
      12             : /**
      13             :  * @internal
      14             :  * Helper functions to execute global plugins
      15             :  */
      16             : 
      17      120560 : int elektraGlobalGet (KDB * handle, KeySet * ks, Key * parentKey, int position, int subPosition)
      18             : {
      19      120560 :         int ret = 0;
      20             :         Plugin * plugin;
      21      120560 :         if (handle && (plugin = handle->globalPlugins[position][subPosition]))
      22             :         {
      23       15671 :                 ret = plugin->kdbGet (plugin, ks, parentKey);
      24             :         }
      25      120560 :         return ret;
      26             : }
      27             : 
      28       31029 : int elektraGlobalSet (KDB * handle, KeySet * ks, Key * parentKey, int position, int subPosition)
      29             : {
      30       31029 :         int ret = 0;
      31             :         Plugin * plugin;
      32       31029 :         if (handle && (plugin = handle->globalPlugins[position][subPosition]))
      33             :         {
      34        7808 :                 ret = plugin->kdbSet (plugin, ks, parentKey);
      35             :         }
      36       31029 :         return ret;
      37             : }
      38             : 
      39        5791 : int elektraGlobalError (KDB * handle, KeySet * ks, Key * parentKey, int position, int subPosition)
      40             : {
      41        5791 :         int ret = 0;
      42             :         Plugin * plugin;
      43        5791 :         if (handle && (plugin = handle->globalPlugins[position][subPosition]))
      44             :         {
      45         192 :                 ret = plugin->kdbError (plugin, ks, parentKey);
      46             :         }
      47        5791 :         return ret;
      48             : }

Generated by: LCOV version 1.13