

#include<stdio.h>
#include<netinet/in.h>
#include<stdlib.h>
#include<pthread.h>

#include"sitar.h"
#include"sitar_scan.h"
#include<almemsys/almemsys.h>


extern global_data_t gd;
extern swap_array_t sa;



int satmpcalloc(void)
{
int count;

#ifdef MALLOC_BUG
printf("MALLOC: satmpcalloc():\n");
#endif

for(count = 0; count < gd.td.tbufmax; count++){
   if((sa.tmp_data[count]=(char *)calloc(BUF_LEN * 2, sizeof(char)))==NULL){exit(1);}
   }
return 0;
}




int satmpfree(void)
{
int count;

#ifdef FREE_BUG
printf("FREE: satmpfree():\n");
#endif

for(count = 0; count < gd.td.tbufmax; count ++){
   free(sa.tmp_data[count]);
   }
return 0;
}




int satmpnull(void)
{
int count;

#ifdef FREE_BUG
printf("FREE: satmpfree():\n");
#endif

for(count = 0; count < gd.td.tbufmax; count ++){
   sa.tmp_data[count] = null_free(sa.tmp_data[count]);
   }
return 0;
}



