Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/lib/istream-data.c @ 6415:b0096861c390 HEAD
Renamed struct _[io]stream to struct [io]stream_private. Also removed _
prefix from _[io]stream_*() functions.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 16 Sep 2007 12:22:27 +0300 |
parents | 6a64e64fa3a3 |
children | 3a960ffa5de8 |
comparison
equal
deleted
inserted
replaced
6414:a6a49d5efc59 | 6415:b0096861c390 |
---|---|
1 /* Copyright (c) 2002-2003 Timo Sirainen */ | 1 /* Copyright (c) 2002-2003 Timo Sirainen */ |
2 | 2 |
3 #include "lib.h" | 3 #include "lib.h" |
4 #include "istream-internal.h" | 4 #include "istream-internal.h" |
5 | 5 |
6 static void _close(struct _iostream *stream ATTR_UNUSED) | 6 static void _close(struct iostream_private *stream ATTR_UNUSED) |
7 { | 7 { |
8 } | 8 } |
9 | 9 |
10 static void _destroy(struct _iostream *stream ATTR_UNUSED) | 10 static void _destroy(struct iostream_private *stream ATTR_UNUSED) |
11 { | 11 { |
12 } | 12 } |
13 | 13 |
14 static ssize_t _read(struct _istream *stream ATTR_UNUSED) | 14 static ssize_t _read(struct istream_private *stream ATTR_UNUSED) |
15 { | 15 { |
16 stream->istream.eof = TRUE; | 16 stream->istream.eof = TRUE; |
17 return -1; | 17 return -1; |
18 } | 18 } |
19 | 19 |
20 static void _seek(struct _istream *stream, uoff_t v_offset, | 20 static void _seek(struct istream_private *stream, uoff_t v_offset, |
21 bool mark ATTR_UNUSED) | 21 bool mark ATTR_UNUSED) |
22 { | 22 { |
23 stream->skip = v_offset; | 23 stream->skip = v_offset; |
24 stream->istream.v_offset = v_offset; | 24 stream->istream.v_offset = v_offset; |
25 } | 25 } |
26 | 26 |
27 struct istream *i_stream_create_from_data(const void *data, size_t size) | 27 struct istream *i_stream_create_from_data(const void *data, size_t size) |
28 { | 28 { |
29 struct _istream *stream; | 29 struct istream_private *stream; |
30 | 30 |
31 stream = i_new(struct _istream, 1); | 31 stream = i_new(struct istream_private, 1); |
32 stream->buffer = data; | 32 stream->buffer = data; |
33 stream->pos = size; | 33 stream->pos = size; |
34 | 34 |
35 stream->iostream.close = _close; | 35 stream->iostream.close = _close; |
36 stream->iostream.destroy = _destroy; | 36 stream->iostream.destroy = _destroy; |
38 stream->read = _read; | 38 stream->read = _read; |
39 stream->seek = _seek; | 39 stream->seek = _seek; |
40 | 40 |
41 stream->istream.blocking = TRUE; | 41 stream->istream.blocking = TRUE; |
42 stream->istream.seekable = TRUE; | 42 stream->istream.seekable = TRUE; |
43 (void)_i_stream_create(stream, -1, 0); | 43 (void)i_stream_create(stream, -1, 0); |
44 stream->statbuf.st_size = size; | 44 stream->statbuf.st_size = size; |
45 return &stream->istream; | 45 return &stream->istream; |
46 } | 46 } |