NeoMutt  2020-11-20
Teaching an old dog new tricks
DOXYGEN
address.h File Reference

Type representing an email address. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void address_free (struct Address **addr)
 Free an Address object. More...
 
struct Addressaddress_new (const char *addr)
 Create an Address from a string. More...
 

Detailed Description

Type representing an email address.

Authors
  • Richard Russon

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, see http://www.gnu.org/licenses/.

Definition in file address.h.

Function Documentation

◆ address_free()

void address_free ( struct Address **  addr)

Free an Address object.

Parameters
[out]addrAddress to free

Definition at line 249 of file address.c.

250 {
251  if (!addr || !*addr)
252  return;
253 
254  FREE(&(*addr)->personal);
255  FREE(&(*addr)->mailbox);
256  FREE(addr);
257 }
#define FREE(x)
Definition: memory.h:40
+ Here is the caller graph for this function:

◆ address_new()

struct Address* address_new ( const char *  addr)

Create an Address from a string.

Parameters
addrEmail address to parse
Return values
ptrNew Address object

Definition at line 237 of file address.c.

238 {
239  struct Address *a = mutt_mem_calloc(1, sizeof(*a));
240  // a->personal = mutt_str_dup(addr);
241  a->mailbox = mutt_str_dup(addr);
242  return a;
243 }
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:370
An email address.
Definition: address.h:34
char * mailbox
Mailbox and host address.
Definition: address.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function: