~ubuntu-branches/ubuntu/vivid/dovecot/vivid

« back to all changes in this revision

Viewing changes to src/auth/db-pgsql.h

  • Committer: Bazaar Package Importer
  • Author(s): Jaldhar H. Vyas
  • Date: 2005-11-05 23:19:19 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051105231919-ydujs4y7687fpor2
Tags: upstream-1.0.alpha4
ImportĀ upstreamĀ versionĀ 1.0.alpha4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __DB_PGSQL_H
2
 
#define __DB_PGSQL_H
3
 
 
4
 
#include <libpq-fe.h>
5
 
 
6
 
struct pgsql_connection;
7
 
struct pgsql_request;
8
 
 
9
 
typedef void pgqsl_query_callback_t(struct pgsql_connection *conn,
10
 
                                    struct pgsql_request *request,
11
 
                                    PGresult *res);
12
 
 
13
 
struct pgsql_settings {
14
 
        const char *connect;
15
 
        const char *password_query;
16
 
        const char *user_query;
17
 
        const char *allowed_chars;
18
 
        const char *default_pass_scheme;
19
 
};
20
 
 
21
 
struct pgsql_connection {
22
 
        struct pgsql_connection *next;
23
 
 
24
 
        pool_t pool;
25
 
        int refcount;
26
 
 
27
 
        char *config_path;
28
 
        struct pgsql_settings set;
29
 
 
30
 
        PGconn *pg;
31
 
 
32
 
        unsigned int connected:1;
33
 
};
34
 
 
35
 
struct pgsql_request {
36
 
        pgqsl_query_callback_t *callback;
37
 
        void *context;
38
 
};
39
 
 
40
 
void db_pgsql_query(struct pgsql_connection *conn, const char *query,
41
 
                    struct pgsql_request *request);
42
 
 
43
 
struct pgsql_connection *db_pgsql_init(const char *config_path);
44
 
void db_pgsql_unref(struct pgsql_connection *conn);
45
 
 
46
 
#endif