Delta Chat Core C-API
mraheader.h
1 /*******************************************************************************
2  *
3  * Delta Chat Core
4  * Copyright (C) 2017 Björn Petersen
5  * Contact: r10s@b44t.com, http://b44t.com
6  *
7  * This program is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the Free Software
9  * Foundation, either version 3 of the License, or (at your option) any later
10  * version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program. If not, see http://www.gnu.org/licenses/ .
19  *
20  ******************************************************************************/
21 
22 
23 #ifndef __MRAHEADER_H__
24 #define __MRAHEADER_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 #include "mrkey.h"
31 
32 
36 typedef struct mraheader_t
37 {
38  char* m_addr;
39  mrkey_t* m_public_key; /* != NULL */
40  int m_prefer_encrypt; /* YES, NO or NOPREFERENCE if attribute is missing */
41 } mraheader_t;
42 
43 
44 mraheader_t* mraheader_new (); /* the returned pointer is ref'd and must be unref'd after usage */
45 mraheader_t* mraheader_new_from_imffields(const char* wanted_from, const struct mailimf_fields* mime);
46 void mraheader_empty (mraheader_t*);
47 void mraheader_unref (mraheader_t*);
48 
49 int mraheader_set_from_string (mraheader_t*, const char* header_str);
50 
51 char* mraheader_render (const mraheader_t*);
52 
53 
54 #ifdef __cplusplus
55 } /* /extern "C" */
56 #endif
57 #endif /* __MRAHEADER_H__ */