summaryrefslogtreecommitdiffstats
path: root/include/sh_dbIO.h
blob: bbb316a5df5e1928e7bd8db43fc7bbe5bc4d3a69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* SAMHAIN file system integrity testing                                   */
/* Copyright (C) 2015 Rainer Wichmann                                      */
/*                                                                         */
/*  This program is free software; you can redistribute it                 */
/*  and/or modify                                                          */
/*  it under the terms of the GNU General Public License as                */
/*  published by                                                           */
/*  the Free Software Foundation; either version 2 of the License, or      */
/*  (at your option) any later version.                                    */
/*                                                                         */
/*  This program is distributed in the hope that it will be useful,        */
/*  but WITHOUT ANY WARRANTY; without even the implied warranty of         */
/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */
/*  GNU General Public License for more details.                           */
/*                                                                         */
/*  You should have received a copy of the GNU General Public License      */
/*  along with this program; if not, write to the Free Software            */
/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              */


#ifndef SH_DBIO_H
#define SH_DBIO_H



/* Read one line, trim newline. Return char count, or -1 on error or eof.
 */
int sh_dbIO_getline (FILE * fd, char * line, const size_t sizeofline);

/* Read given database file for listing
 */
int sh_dbIO_list_db (const char * db_file);

/* Write single record to database
 */
void sh_dbIO_data_write (file_type * buf, char * fileHash);

/* Write whole default database
 */
int sh_dbIO_writeout_update ();

/* write database to given path
 */
int sh_dbIO_writeout_to_path(const char * path);

/* write database to stdout
 */
int sh_dbIO_writeout_stdout (const char * str);

/* version string for database
 */
int sh_dbIO_version_string(const char * str);

/* Load a delta database
 */
int sh_dbIO_load_delta();

int sh_dbIO_list_binary (const char * c);
int sh_dbIO_list_filter (const char * c);

#endif