-
Notifications
You must be signed in to change notification settings - Fork 6
/
MessQueue.h
74 lines (65 loc) · 3.03 KB
/
MessQueue.h
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* XMail by Davide Libenzi (Intranet and Internet mail server)
* Copyright (C) 1999,..,2010 Davide Libenzi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Davide Libenzi <davidel@xmailserver.org>
*
*/
#ifndef _MESSQUEUE_H
#define _MESSQUEUE_H
#define QUEUE_MESS_DIR "mess"
#define QUEUE_RSND_DIR "rsnd"
#define QUEUE_INFO_DIR "info"
#define QUEUE_TEMP_DIR "temp"
#define QUEUE_SLOG_DIR "slog"
#define QUEUE_CUST_DIR "cust"
#define QUEUE_MPRC_DIR "mprc"
#define QUEUE_FROZ_DIR "froz"
#define STD_QUEUEFS_DIRS_X_LEVEL 23
#define INVALID_QUEUE_HANDLE ((QUEUE_HANDLE) 0)
#define INVALID_QMSG_HANDLE ((QMSG_HANDLE) 0)
typedef struct QUEUE_HANDLE_struct {
} *QUEUE_HANDLE;
typedef struct QMSG_HANDLE_struct {
} *QMSG_HANDLE;
QUEUE_HANDLE QueOpen(char const *pszRootPath, int iMaxRetry, int iRetryTimeout,
int iRetryIncrRatio, int iNumDirsLevel = STD_QUEUEFS_DIRS_X_LEVEL);
int QueClose(QUEUE_HANDLE hQueue);
int QueGetDirsLevel(QUEUE_HANDLE hQueue);
char const *QueGetRootPath(QUEUE_HANDLE hQueue);
char *QueLoadLastLogEntry(char const *pszLogFilePath);
QMSG_HANDLE QueCreateMessage(QUEUE_HANDLE hQueue);
int QueGetFilePath(QUEUE_HANDLE hQueue, QMSG_HANDLE hMessage, char *pszFilePath,
char const *pszQueueDir = NULL);
int QueCloseMessage(QUEUE_HANDLE hQueue, QMSG_HANDLE hMessage);
QMSG_HANDLE QueGetHandle(QUEUE_HANDLE hQueue, int iLevel1, int iLevel2,
char const *pszQueueDir, char const *pszFileName);
char const *QueGetFileName(QMSG_HANDLE hMessage);
char const *QueGetQueueDir(QMSG_HANDLE hMessage);
int QueGetLevel1(QMSG_HANDLE hMessage);
int QueGetLevel2(QMSG_HANDLE hMessage);
int QueGetTryCount(QMSG_HANDLE hMessage);
time_t QueGetLastTryTime(QMSG_HANDLE hMessage);
time_t QueGetMessageNextOp(QUEUE_HANDLE hQueue, QMSG_HANDLE hMessage);
int QueInitMessageStats(QUEUE_HANDLE hQueue, QMSG_HANDLE hMessage);
int QueCleanupMessage(QUEUE_HANDLE hQueue, QMSG_HANDLE hMessage, bool bFreeze = false);
int QueCommitMessage(QUEUE_HANDLE hQueue, QMSG_HANDLE hMessage);
int QueResendMessage(QUEUE_HANDLE hQueue, QMSG_HANDLE hMessage);
QMSG_HANDLE QueExtractMessage(QUEUE_HANDLE hQueue, int iTimeout);
int QueCheckMessage(QUEUE_HANDLE hQueue, QMSG_HANDLE hMessage);
int QueFlushRsndArena(QUEUE_HANDLE hQueue, char const *pszAddressMatch);
#endif