Coverage Report

Created: 2023-06-07 07:16

/src/gdbm/tools/input-null.c
Line
Count
Source (jump to first uncovered line)
1
/* This file is part of GDBM, the GNU data base manager.
2
   Copyright (C) 2018-2023 Free Software Foundation, Inc.
3
4
   GDBM is free software; you can redistribute it and/or modify
5
   it under the terms of the GNU General Public License as published by
6
   the Free Software Foundation; either version 3, or (at your option)
7
   any later version.
8
9
   GDBM is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
   GNU General Public License for more details.
13
14
   You should have received a copy of the GNU General Public License
15
   along with GDBM. If not, see <http://www.gnu.org/licenses/>.    */
16
17
#include "gdbmtool.h"
18
19
static ssize_t
20
instream_null_read (instream_t istr, char *buf, size_t size)
21
2.71k
{
22
2.71k
  return 0;
23
2.71k
}
24
25
static void
26
instream_null_close (instream_t istr)
27
2.71k
{
28
2.71k
  free (istr);
29
2.71k
}
30
31
static int
32
instream_null_eq (instream_t a, instream_t b)
33
0
{
34
0
  return a == b;
35
0
}
36
37
instream_t
38
instream_null_create (void)
39
2.71k
{
40
2.71k
  struct instream *istr;
41
42
2.71k
  istr = emalloc (sizeof *istr);
43
2.71k
  istr->in_name = "null";
44
2.71k
  istr->in_inter = 0;
45
2.71k
  istr->in_read = instream_null_read;
46
2.71k
  istr->in_close = instream_null_close;
47
2.71k
  istr->in_eq = instream_null_eq;
48
2.71k
  istr->in_history_size = NULL;
49
2.71k
  istr->in_history_get = NULL;  
50
51
2.71k
  return istr;
52
2.71k
}
53