summaryrefslogtreecommitdiff
path: root/evbuffer-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-10-25 12:29:39 -0400
committerNick Mathewson <nickm@torproject.org>2010-12-20 19:25:15 -0500
commit3f405d2d4b583a4211a685e6425b1d7fc5797538 (patch)
treef42037de284974b15d8aec4e5a6ada5df84a916e /evbuffer-internal.h
parentc2d9884a6adbfcb2c95421671817cd00c5f4d8e5 (diff)
downloadlibevent-3f405d2d4b583a4211a685e6425b1d7fc5797538.tar.gz
Add CreateFileMapping file_segment implementation for win32
Diffstat (limited to 'evbuffer-internal.h')
-rw-r--r--evbuffer-internal.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/evbuffer-internal.h b/evbuffer-internal.h
index ebbbe58e..e5937b05 100644
--- a/evbuffer-internal.h
+++ b/evbuffer-internal.h
@@ -204,6 +204,10 @@ struct evbuffer_chain_reference {
* evbuffer_chain with the EVBUFFER_FILESEGMENT flag set. */
struct evbuffer_chain_file_segment {
struct evbuffer_file_segment *segment;
+#ifdef WIN32
+ /** If we're using CreateFileMapping, this is the handle to the view. */
+ HANDLE view_handle;
+#endif
};
/* Declared in event2/buffer.h; defined here. */
@@ -219,6 +223,10 @@ struct evbuffer_file_segment {
int fd;
/** If we're using mmap, this is the raw mapped memory. */
void *mapping;
+#ifdef WIN32
+ /** If we're using CreateFileMapping, this is the mapping */
+ HANDLE mapping_handle;
+#endif
/** If we're using mmap or IO, this is the content of the file
* segment. */
char *contents;
@@ -226,9 +234,9 @@ struct evbuffer_file_segment {
* this data segment begins. If we're using sendfile, this is the
* offset within the file where this data begins. If we're using IO,
* this is 0. */
- off_t offset;
+ ev_off_t offset;
/** The length of this segment. */
- off_t length;
+ ev_off_t length;
};
#define EVBUFFER_CHAIN_SIZE sizeof(struct evbuffer_chain)