~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-dict/dict.h

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
enum dict_iterate_flags {
10
10
        DICT_ITERATE_FLAG_RECURSE             = 0x01,
11
11
        DICT_ITERATE_FLAG_SORT_BY_KEY         = 0x02,
12
 
        DICT_ITERATE_FLAG_SORT_BY_VALUE       = 0x04
 
12
        DICT_ITERATE_FLAG_SORT_BY_VALUE       = 0x04,
 
13
        DICT_ITERATE_FLAG_NO_VALUE            = 0x08
13
14
};
14
15
 
15
16
enum dict_data_type {
29
30
void dict_drivers_unregister_all(void);
30
31
 
31
32
/* Open dictionary with given URI (type:data).
32
 
   If URI is invalid, returns NULL. */
33
 
struct dict *dict_init(const char *uri, enum dict_data_type value_type,
34
 
                       const char *username, const char *base_dir);
 
33
   Returns 0 if ok, -1 if URI is invalid. */
 
34
int dict_init(const char *uri, enum dict_data_type value_type,
 
35
              const char *username, const char *base_dir, struct dict **dict_r,
 
36
              const char **error_r);
35
37
/* Close dictionary. */
36
38
void dict_deinit(struct dict **dict);
37
39
/* Wait for all pending asynchronous transaction commits to finish.
67
69
   result. */
68
70
void dict_transaction_commit_async(struct dict_transaction_context **ctx,
69
71
                                   dict_transaction_commit_callback_t *callback,
70
 
                                   void *context);
 
72
                                   void *context) ATTR_NULL(2, 3);
71
73
/* Rollback all changes made in transaction. */
72
74
void dict_transaction_rollback(struct dict_transaction_context **ctx);
73
75
 
77
79
/* Unset a record in dictionary, identified by key*/
78
80
void dict_unset(struct dict_transaction_context *ctx,
79
81
                const char *key);
 
82
/* Append to an existing key in dictionary. Preferably an atomic operation. */
 
83
void dict_append(struct dict_transaction_context *ctx,
 
84
                 const char *key, const char *value);
80
85
/* Increase/decrease a numeric value in dictionary. Note that the value is
81
86
   changed when transaction is being committed, so you can't know beforehand
82
87
   what the value will become. The value is updated only if it already exists,