summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/queue_backend.h
blob: c0c7fdd092c3f2cd0564dcdbf7b3a690a477763c (plain)
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
43
44
/*	$OpenBSD: queue_backend.h,v 1.3 2010/06/01 23:06:23 jacekm Exp $	*/

/*
 * Copyright (c) 2010 Jacek Masiulaniec <jacekm@dobremiasto.net>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#define INVALID_ID	1

struct action_be {
	u_int64_t	 content_id;
	u_int64_t	 action_id;
	time_t		 birth;
	char		*aux;
	char		*status;
};

int		 queue_be_content_create(u_int64_t *);
int		 queue_be_content_open(u_int64_t, int);
void		 queue_be_content_delete(u_int64_t);

int		 queue_be_action_new(u_int64_t, u_int64_t *, char *);
int		 queue_be_action_read(struct action_be *, u_int64_t, u_int64_t);
int		 queue_be_action_status(u_int64_t, u_int64_t, char *);
void		 queue_be_action_delete(u_int64_t, u_int64_t);

int		 queue_be_commit(u_int64_t);

u_int64_t	 queue_be_encode(const char *);
char		*queue_be_decode(u_int64_t);

int		 queue_be_init(char *, uid_t, gid_t);
int		 queue_be_getnext(struct action_be *);