/* Message Types */

#define AB_Get_Addresses ((TAG_USER | ( 581 << 16 )) | 0x000)      /* Obtain a copy        */
#define AB_Dispose       ((TAG_USER | ( 581 << 16 )) | 0x001)      /* Dispose the copy     */

/* Error Returncodes */

#define ERROR_NOMEM      ((TAG_USER | ( 581 << 16 )) | 0x100)
#define ERROR_CLONELIST  ((TAG_USER | ( 581 << 16 )) | 0x101)
#define ERROR_NOCLIENTS  ((TAG_USER | ( 581 << 16 )) | 0x102)
#define ERROR_VERSION    ((TAG_USER | ( 581 << 16 )) | 0x103)


struct ApiMessage                   /* The API message */
{
    struct Message Message;         /* Standard message header            */
    LONG   type;                    /* e.g AB_Dispose or AB_Get_Addresses */
    LONG   rc;                      /* The returncode e.g ERROR_NOMEM.... */
    struct List *AddressList;       /* Pointer to the database copy       */
};

/* Main node */
struct data
{
    struct  Node node;
    char    *last;
    char    *first;
    struct  List address;           /* Pointer to the linked addresslist  */
    char    *comment;
    char    *commentline;           /* Number of comment lines...         */
    char    *title;
    char    *birth;
    struct  List Email;             /* Pointer to the linked email list (struct MList) */
    char    *bank;
    char    *account;
    char    *bankcode;
    char    *userfield;
};

struct Address
{
    struct  Node addrnode;
    char    *description;
    char    *street;
    char    *postcode;
    char    *town;
    struct  List Phone;             /* Pointer to the linked phone list (struct MList) */
    char    *country;
    char    *state;
    char    *fax;
};

struct MList
{
    struct  Node listnode;
    char    *number;
    char    *description;
};
