Address Parsing API |
The goal of this API is to facilitate the task of programmers by providing a robust set of utilities to parse email addresses. A task which can rarely be avoided.This API can be used to parse a list of addresses, or a single address. Parsing an address means being able to extract properties from it. Given the address
"John B. Smith" <@gw.com:jbsmith@abcd.com>
this API distinguishes the following address properties:
In order to parse a list of addresses, the string containing the list of addresses is first processed by imadr_parse_list which allocates internal datastructures to hold the address.
If the list successfully parsed and indexed, individual addresses or address properties can be retrieved by calling imadr_get or imadr_get_property.If exactly one address is to be parsed, the more lightweight imadr_parse_one can be used instead of the calls described earlier.
The example C program parse_addresses.c, is a simple interactive utility parses kist of addresses and displays the properties of each address.