~sbeattie/ubuntu/oneiric/dovecot/dovecot-lp792557

« back to all changes in this revision

Viewing changes to src/lib/istream.h

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-05-16 10:18:41 UTC
  • mfrom: (4.1.20 sid)
  • Revision ID: james.westby@ubuntu.com-20110516101841-wo4hf1ewxssic6xj
Tags: 1:2.0.12-1ubuntu1
* Merge from Debian Unstable, remaining changes are:
  + Add mail-stack-delivery as per server-maverick-mail-integration spec:
    - Update debian/rules
    - Convert existing package to a dummy package and new binary in debian/control.
    - Update maintainer scripts.
    - Move previously installed backups and config files to a new package namespace in preinst.
    - Add new debian/mail-stack-delivery.prerm to handle downgrades.
    - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*
  + Use Snakeoil SSL certifications by default:
    - debian/control: Depend on ssl-cert.
    - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - Create debian/dovecot-common.ufw.profile.
    - debian/rules: install profile
    - debian/control: suggest ufw.
  + debian/{control,rules}: enable PIE hardening.
  + debian/dovecot-common.dirs: Added usr/share/doc/dovecot-common
  + Add apport hook:
    - debian/rules, debian/source_dovecot.py
  + Add upstart job:
    - debian/rules, debian/dovecot-common.dovecot.upstart, debian/control,
      debian/dovecot-common.dirs, dovecot-imapd.{postrm, postinst, prerm},
      debian/dovecot-pop3d.{postinst, postrm, prerm}. mail-stack-deliver.postinst:
      Convert init script to upstart. Apart of the server-maverick-upstart-conversion
      specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
struct istream *i_stream_create_fd(int fd, size_t max_buffer_size,
26
26
                                   bool autoclose_fd);
 
27
/* Open the given path only when something is actually tried to be read from
 
28
   the stream. */
 
29
struct istream *i_stream_create_file(const char *path, size_t max_buffer_size);
27
30
struct istream *i_stream_create_mmap(int fd, size_t block_size,
28
31
                                     uoff_t start_offset, uoff_t v_size,
29
32
                                     bool autoclose_fd);
30
33
struct istream *i_stream_create_from_data(const void *data, size_t size);
31
34
struct istream *i_stream_create_limit(struct istream *input, uoff_t v_size);
32
35
 
 
36
/* Set name (e.g. path) for input stream. */
 
37
void i_stream_set_name(struct istream *stream, const char *name);
 
38
/* Get input stream's name. If stream itself doesn't have a name,
 
39
   it looks up further into stream's parents until one of them has a name.
 
40
   Returns "" if stream has no name. */
 
41
const char *i_stream_get_name(struct istream *stream);
 
42
 
33
43
/* i_stream_close() + i_stream_unref() */
34
44
void i_stream_destroy(struct istream **stream);
35
45
 
62
72
/* Change the maximum size for stream's input buffer to grow. Useful only
63
73
   for buffered streams (currently only file). */
64
74
void i_stream_set_max_buffer_size(struct istream *stream, size_t max_size);
 
75
/* Returns the current max. buffer size. */
 
76
size_t i_stream_get_max_buffer_size(struct istream *stream);
65
77
/* Enable/disable i_stream[_read]_next_line() returning the last line if it
66
78
   doesn't end with LF. */
67
79
void i_stream_set_return_partial_line(struct istream *stream, bool set);
88
100
   returned values can be compared to see if anything had changed (eg. in
89
101
   compressed stream st_size could be compressed size) */
90
102
const struct stat *i_stream_stat(struct istream *stream, bool exact);
 
103
/* Similar to i_stream_stat() call. Returns 1 if size was successfully
 
104
   set, 0 if size is unknown, -1 if error. */
 
105
int i_stream_get_size(struct istream *stream, bool exact, uoff_t *size_r);
91
106
/* Returns TRUE if there are any bytes left to be read or in buffer. */
92
107
bool i_stream_have_bytes_left(const struct istream *stream) ATTR_PURE;
 
108
/* Returns TRUE if there are no bytes buffered and read() returns EOF. */
 
109
bool i_stream_is_eof(struct istream *stream);
 
110
/* Returns the absolute offset of the stream. This is the stream's current
 
111
   v_offset + the parent's absolute offset when the stream was created. */
 
112
uoff_t i_stream_get_absolute_offset(struct istream *stream);
93
113
 
94
114
/* Gets the next line from stream and returns it, or NULL if more data is
95
115
   needed to make a full line. i_stream_set_return_partial_line() specifies