use status bar widget
[prss.git] / src / io.h
1 /*
2  * Copyright (C) 2011-2012 jeanfi@gmail.com
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301 USA
18  */
19
20 #ifndef _PRSS_IO_H_
21 #define _PRSS_IO_H_
22
23 /*
24  * Convenience functions for copying files.
25  */
26
27
28 enum file_copy_code {
29         FILE_COPY_OK = 0,
30         FILE_COPY_ERROR_OPEN_SRC = 1,
31         FILE_COPY_ERROR_OPEN_DST,
32         FILE_COPY_ERROR_READ,
33         FILE_COPY_ERROR_WRITE,
34         FILE_COPY_ERROR_ALLOC_BUFFER
35 };
36
37 /*
38  * Copies file 'src' to 'dst'.
39  *
40  * Returns FILE_COPY_OK on success otherwise error code.
41  */
42 int fcopy(const char *src, const char *dst);
43
44 char *path_append(const char *odir, const char *name);
45
46 void mkdirs(const char *dirs, mode_t mode);
47
48 char *file_get_content(const char *fpath);
49
50 #endif