LCOV - code coverage report
Current view: top level - examples - keyBasename.c (source / functions) Hit Total Coverage
Test: coverage-filtered.info Lines: 0 13 0.0 %
Date: 2019-09-12 12:28:41 Functions: 0 1 0.0 %

          Line data    Source code
       1             : /**
       2             :  * @file
       3             :  *
       4             :  * @brief
       5             :  *
       6             :  * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
       7             :  */
       8             : 
       9             : #include <kdb.h>
      10             : 
      11             : #include <stdio.h>
      12             : 
      13           0 : int main (void)
      14             : {
      15             :         // clang-format off
      16             : {
      17             : //! [set base basic]
      18           0 : Key * k = keyNew ("user/my/long/name", KEY_END);
      19           0 : keySetBaseName (k, "myname");
      20           0 : printf ("%s\n", keyName (k)); // will print user/my/long/myname
      21           0 : keyDel (k);
      22             : //! [set base basic]
      23             : }
      24             : {
      25             : //! [add base basic]
      26           0 : Key * k = keyNew ("user/my/long", KEY_END);
      27           0 : keyAddBaseName (k, "myname");
      28           0 : printf ("%s\n", keyName (k)); // will print user/my/long/myname
      29           0 : keyDel (k);
      30             : //! [add base basic]
      31             : }
      32             : {
      33             : //! [add base escaped]
      34           0 : Key * k = keyNew ("user/my/long", KEY_END);
      35           0 : keyAddBaseName (k, "myname");
      36           0 : printf ("%s\n", keyName (k)); // will print user/my/long/myname
      37           0 : keyDel (k);
      38             : //! [add base escaped]
      39             : }
      40             : }

Generated by: LCOV version 1.13