

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<pthread.h>

#include"zither.h"
#include<almemsys/almemsys.h>



/* MAIL DATA ALOC */
int mail_malloc(mail_data_t *mdd)
{
if((mdd->swap = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->swap2 = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->server = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->rcptto = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->cp_time = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}

if((mdd->iserver = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->ifrom = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->ircptto = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->icc = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->iuser = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->ihost = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);} 
if((mdd->idata = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->isubject = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->iinfo = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->bccadd = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}
if((mdd->pri = (char *)calloc(BUF_DEFLEN, sizeof(char)))==NULL){exit(1);}

return 0;
}



/* MAIL DATA FREE */
int mail_free(mail_data_t *mdd)
{

free(mdd->swap);
free(mdd->swap2);
free(mdd->server);
free(mdd->rcptto);
free(mdd->cp_time);

free(mdd->iserver);
free(mdd->ifrom);
free(mdd->ircptto);
free(mdd->icc);
free(mdd->iuser);
free(mdd->ihost);
free(mdd->idata);
free(mdd->isubject);
free(mdd->iinfo);
free(mdd->bccadd);
free(mdd->pri);

return 0;
}




