~james-page/ubuntu/raring/dovecot/autopkgtest

« back to all changes in this revision

Viewing changes to src/lib/ioloop.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 11:11:54 UTC
  • mfrom: (1.15.2) (4.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120611111154-678cwbdj6ktgsv1h
Tags: 1:2.1.7-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/{control,rules}: enable PIE hardening.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
  + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
  + d/control: Drop B-D on systemd.
* Dropped changes:
  + d/patches/fix-racey-restart.patch: part of 2.1.x, no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
   Don't try to add multiple handlers for the same type. It's not checked and
47
47
   the behavior will be undefined. */
48
48
struct io *io_add(int fd, enum io_condition condition,
 
49
                  unsigned int source_linenum,
49
50
                  io_callback_t *callback, void *context);
50
51
#define io_add(fd, condition, callback, context) \
51
52
        CONTEXT_CALLBACK(io_add, io_callback_t, \
52
 
                         callback, context, fd, condition)
 
53
                         callback, context, fd, condition, __LINE__)
53
54
enum io_notify_result io_add_notify(const char *path, io_callback_t *callback,
54
55
                                    void *context, struct io **io_r);
55
56
#ifdef CONTEXT_TYPE_SAFETY
68
69
void io_remove_closed(struct io **io);
69
70
 
70
71
/* Timeout handlers */
71
 
struct timeout *timeout_add(unsigned int msecs, timeout_callback_t *callback,
72
 
                            void *context);
 
72
struct timeout *timeout_add(unsigned int msecs, unsigned int source_linenum,
 
73
                            timeout_callback_t *callback, void *context);
73
74
#define timeout_add(msecs, callback, context) \
74
75
        CONTEXT_CALLBACK(timeout_add, timeout_callback_t, \
75
 
                         callback, context, msecs)
 
76
                         callback, context, msecs, __LINE__)
76
77
/* Remove timeout handler, and set timeout pointer to NULL. */
77
78
void timeout_remove(struct timeout **timeout);
78
79
/* Reset timeout so it's next run after now+msecs. */
103
104
/* Change the current_ioloop. */
104
105
void io_loop_set_current(struct ioloop *ioloop);
105
106
 
106
 
/* This log is used for all further I/O and timeout callbacks that are added
107
 
   until returning to ioloop. */
108
 
struct ioloop_log *io_loop_log_new(struct ioloop *ioloop);
109
 
void io_loop_log_ref(struct ioloop_log *log);
110
 
void io_loop_log_unref(struct ioloop_log **log);
111
 
/* Set the log's prefix. Note that this doesn't immediately call
112
 
   i_set_failure_prefix(). */
113
 
void io_loop_log_set_prefix(struct ioloop_log *log, const char *prefix);
114
 
/* Set the default log prefix to use outside callbacks. */
115
 
void io_loop_set_default_log_prefix(struct ioloop *ioloop, const char *prefix);
 
107
/* This context is used for all further I/O and timeout callbacks that are
 
108
   added until returning to ioloop. When a callback is called, this context is
 
109
   again activated. */
 
110
struct ioloop_context *io_loop_context_new(struct ioloop *ioloop);
 
111
void io_loop_context_ref(struct ioloop_context *ctx);
 
112
void io_loop_context_unref(struct ioloop_context **ctx);
 
113
/* Call the activate callback when this context is activated (I/O callback is
 
114
   about to be called), and the deactivate callback when the context is
 
115
   deactivated (I/O callback has returned). You can add multiple callbacks. */
 
116
void io_loop_context_add_callbacks(struct ioloop_context *ctx,
 
117
                                   io_callback_t *activate,
 
118
                                   io_callback_t *deactivate, void *context);
 
119
/* Remove callbacks with the given callbacks and context. */
 
120
void io_loop_context_remove_callbacks(struct ioloop_context *ctx,
 
121
                                      io_callback_t *activate,
 
122
                                      io_callback_t *deactivate, void *context);
 
123
/* Returns the current context set to ioloop. */
 
124
struct ioloop_context *io_loop_get_current_context(struct ioloop *ioloop);
 
125
 
 
126
/* Move the given I/O into the current I/O loop if it's not already
 
127
   there. New I/O is returned, while the old one is freed. */
 
128
struct io *io_loop_move_io(struct io **io);
 
129
/* Like io_loop_move_io(), but for timeouts. */
 
130
struct timeout *io_loop_move_timeout(struct timeout **timeout);
116
131
 
117
132
#endif