LCOV - code coverage report
Current view: top level - basic - strbuf.h (source / functions) Hit Total Coverage
Test: main_coverage.info Lines: 1 1 100.0 %
Date: 2019-08-22 15:41:25 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /* SPDX-License-Identifier: LGPL-2.1+ */
       2             : #pragma once
       3             : 
       4             : #include <stddef.h>
       5             : #include <stdint.h>
       6             : #include <sys/types.h>
       7             : 
       8             : #include "macro.h"
       9             : 
      10             : struct strbuf {
      11             :         char *buf;
      12             :         size_t len;
      13             :         struct strbuf_node *root;
      14             : 
      15             :         size_t nodes_count;
      16             :         size_t in_count;
      17             :         size_t in_len;
      18             :         size_t dedup_len;
      19             :         size_t dedup_count;
      20             : };
      21             : 
      22             : struct strbuf_node {
      23             :         size_t value_off;
      24             :         size_t value_len;
      25             : 
      26             :         struct strbuf_child_entry *children;
      27             :         uint8_t children_count;
      28             : };
      29             : 
      30             : struct strbuf_child_entry {
      31             :         uint8_t c;
      32             :         struct strbuf_node *child;
      33             : };
      34             : 
      35             : struct strbuf *strbuf_new(void);
      36             : ssize_t strbuf_add_string(struct strbuf *str, const char *s, size_t len);
      37             : void strbuf_complete(struct strbuf *str);
      38             : void strbuf_cleanup(struct strbuf *str);
      39           4 : DEFINE_TRIVIAL_CLEANUP_FUNC(struct strbuf*, strbuf_cleanup);

Generated by: LCOV version 1.14