]> git.ipfire.org Git - thirdparty/squid.git/blob - src/fs_io.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / fs_io.h
1 /*
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 /* DEBUG: section 06 Disk I/O Routines */
10
11 #ifndef SQUID_FS_IO_H_
12 #define SQUID_FS_IO_H_
13
14 #include "mem/forward.h"
15 #include "typedefs.h" //DRCB, DWCB
16
17 class MemBuf;
18
19 // POD
20 class dread_ctrl
21 {
22 public:
23 int fd;
24 off_t offset;
25 int req_len;
26 char *buf;
27 int end_of_file;
28 DRCB *handler;
29 void *client_data;
30 };
31
32 // POD
33 class dwrite_q
34 {
35 public:
36 off_t file_offset;
37 char *buf;
38 size_t len;
39 size_t buf_offset;
40 dwrite_q *next;
41 FREE *free_func;
42 };
43
44 int file_open(const char *path, int mode);
45 void file_close(int fd);
46 void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *);
47 void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data);
48 void file_read(int, char *, int, off_t, DRCB *, void *);
49 void safeunlink(const char *path, int quiet);
50 int xrename(const char *from, const char *to);
51
52 int fsBlockSize(const char *path, int *blksize);
53 int fsStats(const char *, int *, int *, int *, int *);
54
55 #endif /* SQUID_FS_IO_H_ */
56