File: session.h

package info (click to toggle)
imapfilter 1%3A1.0.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 264 kB
  • ctags: 256
  • sloc: ansic: 2,590; sh: 487; makefile: 100
file content (42 lines) | stat: -rw-r--r-- 971 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef SESSION_H
#define SESSION_H


#include "queue.h"

#ifndef NO_SSLTLS
#include <openssl/ssl.h>
#endif


/* IMAP sessions list head. */
XLIST_HEAD(sessionhead, session);

/* IMAP session. */
typedef struct session {
	char *server;		/* Server hostname. */
	char *username;		/* User name. */
	int socket;		/* Socket. */
#ifndef NO_SSLTLS
	SSL *ssl;		/* SSL socket. */
#endif
	unsigned int protocol;	/* IMAP protocol.  Currently IMAP4rev1 and
				 * IMAP4 are supported. */
	unsigned int capabilities;	/* Capabilities of the mail server. */
	struct {		/* Namespace of the mail server's mailboxes. */
		char *prefix;	/* Namespace prefix. */
		char delim;	/* Namespace delimiter. */
	} ns;
	 XLIST_ENTRY(session) links;
} session;


/*	session.c	*/
session *session_new(void);
void session_init(session * ssn);
void session_destroy(session * ssn);
void session_free(session * ssn);
session *session_find(const char *server, const char *user);


#endif				/* SESSION_H */