smf_part.h
Go to the documentation of this file.
1 /* spmfilter - mail filtering framework
2  * Copyright (C) 2009-2012 Axel Steiner and SpaceNet AG
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 3 of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
27 #ifndef _SMF_PART_H
28 #define _SMF_PART_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include <cmime.h>
35 
40 typedef CMimePart_T SMFPart_T;
41 
47 SMFPart_T *smf_part_new(void);
48 
54 void smf_part_free(SMFPart_T *part);
55 
62 void smf_part_set_content_type(SMFPart_T *part, const char *s);
63 
70 char *smf_part_get_content_type(SMFPart_T *part);
71 
78 void smf_part_set_content_disposition(SMFPart_T *part, const char *s);
79 
86 char *smf_part_get_content_disposition(SMFPart_T *part);
87 
94 void smf_part_set_content_transfer_encoding(SMFPart_T *part, const char *s);
95 
102 char *smf_part_get_content_transfer_encoding(SMFPart_T *part);
103 
110 void smf_part_set_content_id(SMFPart_T *part, const char *s);
111 
118 char *smf_part_get_content_id(SMFPart_T *part);
119 
126 void smf_part_set_content(SMFPart_T *part, const char *s);
127 
132 #define smf_part_get_content(part) (part->content);
133 
140 void smf_part_set_postface(SMFPart_T *part, const char *s);
141 
146 #define smf_part_get_postface(part) (part->postface);
147 
156 char *smf_part_to_string(SMFPart_T *part, const char *nl);
157 
167 int smf_part_from_file(SMFPart_T **part, char *filename, const char *nl);
168 
176 int smf_part_to_file(SMFPart_T *part, char *filename);
177 
185 int smf_part_from_string(SMFPart_T **part, const char *content);
186 
187 #ifdef __cplusplus
188 }
189 #endif
190 
191 #endif /* _SMF_PART_H */