LCOV - code coverage report
Current view: top level - common/stream - blackhole.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 12 0.0 %
Date: 2021-10-27 03:06:47 Functions: 0 3 0.0 %

          Line data    Source code
       1             : /*
       2             :  * This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       5             :  *
       6             :  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
       7             :  */
       8             : 
       9             : #include "monetdb_config.h"
      10             : #include "stream.h"
      11             : #include "stream_internal.h"
      12             : 
      13             : 
      14             : 
      15             : static ssize_t
      16           0 : stream_blackhole_write(stream *restrict s, const void *restrict buf, size_t elmsize, size_t cnt)
      17             : {
      18             :         (void) s;
      19             :         (void) buf;
      20             :         (void) elmsize;
      21           0 :         return (ssize_t) cnt;
      22             : }
      23             : 
      24             : static void
      25           0 : stream_blackhole_close(stream *s)
      26             : {
      27             :         (void) s;
      28             :         /* no resources to close */
      29           0 : }
      30             : 
      31             : stream *
      32           0 : stream_blackhole_create(void)
      33             : {
      34             :         stream *s;
      35           0 :         if ((s = create_stream("blackhole")) == NULL) {
      36             :                 return NULL;
      37             :         }
      38             : 
      39           0 :         s->read = NULL;
      40           0 :         s->write = stream_blackhole_write;
      41           0 :         s->close = stream_blackhole_close;
      42           0 :         s->flush = NULL;
      43           0 :         s->readonly = false;
      44           0 :         return s;
      45             : }

Generated by: LCOV version 1.14