"Fossies" - the Fresh Open Source Software Archive

Member "dovecot-2.3.8/src/lib-imap-storage/imap-metadata.h" (8 Oct 2019, 2497 Bytes) of package /linux/misc/dovecot-2.3.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "imap-metadata.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.3.7.2_vs_2.3.8.

    1 #ifndef IMAP_METADATA_H
    2 #define IMAP_METADATA_H
    3 
    4 #define IMAP_METADATA_PRIVATE_PREFIX "/private"
    5 #define IMAP_METADATA_SHARED_PREFIX "/shared"
    6 
    7 struct imap_metadata_iter;
    8 struct imap_metadata_transaction;
    9 
   10 /* Checks whether IMAP metadata entry name is valid */
   11 bool imap_metadata_verify_entry_name(
   12     const char *name, const char **client_error_r);
   13 
   14 /* Set IMAP metadata entry to value. */
   15 int imap_metadata_set(struct imap_metadata_transaction *imtrans,
   16     const char *entry, const struct mail_attribute_value *value);
   17 /* Delete IMAP metadata entry. This is just a wrapper to
   18    imap_metadata_set() with value->value=NULL. */
   19 int imap_metadata_unset(struct imap_metadata_transaction *imtrans,
   20     const char *entry);
   21 /* Returns value for IMAP metadata entry. Returns 1 if value was returned,
   22    0 if value wasn't found (set to NULL), -1 if error */
   23 int imap_metadata_get(struct imap_metadata_transaction *imtrans,
   24     const char *entry, struct mail_attribute_value *value_r);
   25 /* Same as imap_metadata_get(), but the returned value may be either an
   26    input stream or a string. */
   27 int imap_metadata_get_stream(struct imap_metadata_transaction *imtrans,
   28     const char *entry, struct mail_attribute_value *value_r);
   29 
   30 /* Iterate through IMAP metadata entries names under the specified entry. */
   31 struct imap_metadata_iter *
   32 imap_metadata_iter_init(struct imap_metadata_transaction *imtrans,
   33     const char *entry);
   34 /* Returns the next IMAP metadata entry name or NULL if there are no more
   35    entries. */
   36 const char *imap_metadata_iter_next(struct imap_metadata_iter *iter);
   37 int imap_metadata_iter_deinit(struct imap_metadata_iter **_iter);
   38 
   39 struct imap_metadata_transaction *
   40 imap_metadata_transaction_begin(struct mailbox *box);
   41 struct imap_metadata_transaction *
   42 imap_metadata_transaction_begin_mailbox(struct mail_user *user,
   43                     const char *mailbox);
   44 struct imap_metadata_transaction *
   45 imap_metadata_transaction_begin_server(struct mail_user *user);
   46 
   47 /* Allow access only to validated attributes within this transaction. */
   48 void imap_metadata_transaction_validated_only(struct imap_metadata_transaction *imtrans,
   49                           bool set);
   50 
   51 int imap_metadata_transaction_commit(
   52     struct imap_metadata_transaction **_imtrans,
   53     enum mail_error *error_code_r, const char **client_error_r);
   54 void imap_metadata_transaction_rollback(
   55     struct imap_metadata_transaction **_imtrans);
   56 const char *
   57 imap_metadata_transaction_get_last_error(
   58     struct imap_metadata_transaction *imtrans,
   59     enum mail_error *error_code_r);
   60 
   61 #endif