#include <stdlib.h>
#include "vars.h"

void init_vars(void)
{
  write_hostname_to_log=0;
  input_ident=(char*)malloc(ML_IDENT*sizeof(char));
  input_ident_un=(char*)malloc(ML_IDENT*sizeof(char));
  input_ip=(char*)malloc(8*sizeof(char));
  input_url=(char*)malloc(ML_URL*sizeof(char));
  #ifdef CASE_INDEPENDENT
  input_url_uc=(char*)malloc(ML_URL*sizeof(char)); 
  #endif
  input_url_un=(char*)malloc(ML_URL*sizeof(char));
  input_method=(char*)malloc(ML_METHOD*sizeof(char));
  input_host=(char*)malloc(ML_HOST*sizeof(char));
  change_reason=(char*)malloc((ML_URL+ML_FILE_NAME)*sizeof(char));

  i_url=malloc(sizeof(struct p_url)+1);

  if (input_ident==NULL || input_ident_un==NULL || input_ip==NULL || input_url==NULL || input_url_un==NULL || input_method==NULL || input_host==NULL || i_url==NULL)
    {
     err_mes("ERROR: Can't alocate memory for vars");
     exit(-1);
    }

  change_from=NULL;
  change_to=NULL;
  change_count=0;
}
