]> git.ipfire.org Git - thirdparty/squid.git/blame - src/disk.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / disk.h
CommitLineData
fc54b8d2 1/*
bbc27441 2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
fc54b8d2 3 *
bbc27441
AJ
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.
fc54b8d2
FC
7 */
8
bbc27441
AJ
9/* DEBUG: section 06 Disk I/O Routines */
10
fc54b8d2
FC
11#ifndef SQUID_DISK_H_
12#define SQUID_DISK_H_
13
14#include "typedefs.h"
15
16class MemBuf;
65914896 17
1328cfb7 18// POD
65914896
FC
19class dread_ctrl
20{
21public:
22 int fd;
23 off_t offset;
24 int req_len;
25 char *buf;
26 int end_of_file;
27 DRCB *handler;
28 void *client_data;
29};
30
1328cfb7
FC
31// POD
32class dwrite_q
33{
34public:
35 off_t file_offset;
36 char *buf;
37 size_t len;
38 size_t buf_offset;
39 dwrite_q *next;
40 FREE *free_func;
41};
fc54b8d2 42
8a648e8d
FC
43int file_open(const char *path, int mode);
44void file_close(int fd);
fc54b8d2
FC
45
46/* Adapter file_write for object callbacks */
47template <class O>
48void
49FreeObject(void *address)
50{
51 O *anObject = static_cast <O *>(address);
52 delete anObject;
53}
54
8a648e8d
FC
55void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *);
56void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data);
57void file_read(int, char *, int, off_t, DRCB *, void *);
58void disk_init(void);
59void safeunlink(const char *path, int quiet);
60int xrename(const char *from, const char *to); //disk.cc
fc54b8d2
FC
61
62#endif /* SQUID_DISK_H_ */
f53969cc 63