Delta Chat Core C-API
mrjob.h
1 /*******************************************************************************
2  *
3  * Delta Chat Core
4  * Contact: r10s@b44t.com, http://b44t.com
5  *
6  * This program is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License as published by the Free Software
8  * Foundation, either version 3 of the License, or (at your option) any later
9  * version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program. If not, see http://www.gnu.org/licenses/ .
18  *
19  ******************************************************************************/
20 
21 
22 #ifndef __MRJOB_H__
23 #define __MRJOB_H__
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 
29 #define MRJ_DELETE_MSG_ON_IMAP 100 /* low priority ... */
30 #define MRJ_MARKSEEN_MDN_ON_IMAP 102
31 #define MRJ_SEND_MDN 105
32 #define MRJ_MARKSEEN_MSG_ON_IMAP 110
33 #define MRJ_SEND_MSG_TO_IMAP 700
34 #define MRJ_SEND_MSG_TO_SMTP 800
35 #define MRJ_CONNECT_TO_IMAP 900 /* ... high priority*/
36 
40 typedef struct mrjob_t
41 {
44  uint32_t m_job_id;
45  int m_action;
46  uint32_t m_foreign_id;
47  mrparam_t* m_param;
48  /* the following fields are set by the execution routines, m_param may also be modified */
49  time_t m_start_again_at; /* 1=on next loop, >1=on timestamp, 0=delete job (default) */
50 } mrjob_t;
51 
52 void mrjob_init_thread (mrmailbox_t*);
53 void mrjob_exit_thread (mrmailbox_t*);
54 uint32_t mrjob_add__ (mrmailbox_t*, int action, int foreign_id, const char* param); /* returns the job_id or 0 on errors. the job may or may not be done if the function returns. */
55 void mrjob_kill_action__ (mrmailbox_t*, int action); /* delete all pending jobs with the given action */
56 
57 #define MR_AT_ONCE 0
58 #define MR_INCREATION_POLL 2 /* this value does not increase the number of tries */
59 #define MR_STANDARD_DELAY 3
60 void mrjob_try_again_later (mrjob_t*, int initial_delay_seconds);
61 
62 
63 #ifdef __cplusplus
64 } /* /extern "C" */
65 #endif
66 #endif /* __MRJOB_H__ */
67 
An object representing a single mailbox.
Definition: mrmailbox.h:178
An object for handling key=value parameter lists.
Definition: mrparam.h:36