imap-msgpart-url.h revision c502126b6e8a5d0c5431f0314b4d6eb0d43ab53d
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch#ifndef IMAP_MSGPART_URL_H
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch#define IMAP_MSGPART_URL_H
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschstruct imap_url;
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschstruct imap_msgpart_url;
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschstruct imap_msgpart_url *
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschimap_msgpart_url_create(struct mail_user *user, const struct imap_url *url);
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschstruct imap_msgpart_url *
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschimap_msgpart_url_parse(struct mail_user *user, struct mailbox *selected_box,
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch const char *urlstr, const char **error_r);
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschstruct mailbox *
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschimap_msgpart_url_open_mailbox(struct imap_msgpart_url *mpurl,
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch const char **error_r);
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschstruct mailbox *imap_msgpart_url_get_mailbox(struct imap_msgpart_url *mpurl);
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschstruct mail *
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschimap_msgpart_url_open_mail(struct imap_msgpart_url *mpurl, const char **error_r);
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch/* Returns NULL stream when part has zero length, e.g. when partial offset is
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch larger than the size of the referenced part */
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschbool imap_msgpart_url_read_part(struct imap_msgpart_url *mpurl,
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch struct istream **stream_r, uoff_t *size_r,
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch const char **error_r);
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschbool imap_msgpart_url_verify(struct imap_msgpart_url *mpurl,
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch const char **error_r);
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschvoid imap_msgpart_url_free(struct imap_msgpart_url **mpurl);
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch#endif