smf_email_address.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 
32 #ifndef _SMF_EMAIL_ADDRESS_H
33 #define _SMF_EMAIL_ADDRESS_H
34 
35 #include <cmime.h>
36 
37 #include "smf_lookup.h"
38 
43 typedef enum _SMFEmailAddressType {
49 
54 typedef CMimeAddress_T SMFEmailAddress_T;
55 
61 SMFEmailAddress_T *smf_email_address_new(void);
62 
68 void smf_email_address_free(SMFEmailAddress_T *ea);
69 
76 SMFEmailAddress_T *smf_email_address_parse_string(const char *addr);
77 
84 char *smf_email_address_to_string(SMFEmailAddress_T *ea);
85 
92 void smf_email_address_set_type(SMFEmailAddress_T *ea, SMFEmailAddressType_T t);
93 
100 SMFEmailAddressType_T smf_email_address_get_type(SMFEmailAddress_T *ea);
101 
108 void smf_email_address_set_name(SMFEmailAddress_T *ea, const char *name);
109 
116 char *smf_email_address_get_name(SMFEmailAddress_T *ea);
117 
124 void smf_email_address_set_email(SMFEmailAddress_T *ea, const char *email);
125 
132 char *smf_email_address_get_email(SMFEmailAddress_T *ea);
133 
143 int smf_email_address_is_empty(SMFEmailAddress_T *ea);
144 
158 SMFEmailAddress_T *smf_email_address_get_simplified(SMFEmailAddress_T *ea);
159 
160 #endif /* _SMF_EMAIL_ADDRESS_H */