]>
Commit | Line | Data |
---|---|---|
c8be6d7b | 1 | |
2 | /* | |
3b13a8fd | 3 | * $Id: StoreClient.h,v 1.5 2003/01/17 05:49:35 robertc Exp $ |
c8be6d7b | 4 | * |
5 | * | |
6 | * SQUID Web Proxy Cache http://www.squid-cache.org/ | |
7 | * ---------------------------------------------------------- | |
8 | * | |
9 | * Squid is the result of efforts by numerous individuals from | |
10 | * the Internet community; see the CONTRIBUTORS file for full | |
11 | * details. Many organizations have provided support for Squid's | |
12 | * development; see the SPONSORS file for full details. Squid is | |
13 | * Copyrighted (C) 2001 by the Regents of the University of | |
14 | * California; see the COPYRIGHT file for full details. Squid | |
15 | * incorporates software developed and/or copyrighted by other | |
16 | * sources; see the CREDITS file for full details. | |
17 | * | |
18 | * This program is free software; you can redistribute it and/or modify | |
19 | * it under the terms of the GNU General Public License as published by | |
20 | * the Free Software Foundation; either version 2 of the License, or | |
21 | * (at your option) any later version. | |
22 | * | |
23 | * This program is distributed in the hope that it will be useful, | |
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
26 | * GNU General Public License for more details. | |
27 | * | |
28 | * You should have received a copy of the GNU General Public License | |
29 | * along with this program; if not, write to the Free Software | |
30 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. | |
31 | * | |
32 | */ | |
33 | ||
34 | #ifndef SQUID_STORECLIENT_H | |
35 | #define SQUID_STORECLIENT_H | |
36 | ||
37 | #include "StoreIOBuffer.h" | |
38 | ||
39 | typedef void STCB(void *, StoreIOBuffer); /* store callback */ | |
40 | ||
e6ccf245 | 41 | #ifdef __cplusplus |
3b13a8fd | 42 | class StoreEntry; |
e6ccf245 | 43 | #endif |
44 | ||
45 | #ifdef __cplusplus | |
46 | class StoreClient { | |
47 | public: | |
48 | virtual ~StoreClient () {} | |
3b13a8fd | 49 | virtual void created (StoreEntry *newEntry) = 0; |
e6ccf245 | 50 | }; |
51 | #endif | |
52 | ||
c8be6d7b | 53 | /* keep track each client receiving data from that particular StoreEntry */ |
54 | struct _store_client { | |
55 | int type; | |
56 | off_t cmp_offset; | |
57 | STCB *callback; | |
58 | void *callback_data; | |
59 | #if STORE_CLIENT_LIST_DEBUG | |
60 | void *owner; | |
61 | #endif | |
62 | StoreEntry *entry; /* ptr to the parent StoreEntry, argh! */ | |
d3b3ab85 | 63 | StoreIOState::Pointer swapin_sio; |
c8be6d7b | 64 | struct { |
65 | unsigned int disk_io_pending:1; | |
66 | unsigned int store_copying:1; | |
67 | unsigned int copy_event_pending:1; | |
68 | } flags; | |
69 | #if DELAY_POOLS | |
07a9e914 | 70 | delay_id delayId; |
c8be6d7b | 71 | #endif |
72 | dlink_node node; | |
73 | /* Below here is private - do no alter outside storeClient calls */ | |
74 | StoreIOBuffer copyInto; | |
e6ccf245 | 75 | #ifdef __cplusplus |
76 | #endif | |
c8be6d7b | 77 | }; |
78 | ||
e6ccf245 | 79 | SQUIDCEXTERN void storeClientCopy(store_client *, StoreEntry *, StoreIOBuffer, STCB *, void *); |
80 | SQUIDCEXTERN void storeClientDumpStats(store_client * thisClient, StoreEntry * output, int clientNumber); | |
c8be6d7b | 81 | |
82 | #endif /* SQUID_STORECLIENT_H */ |