#include "request.h"

void get_config( struct config *config )
{
  FILE *config_file;
  char string[81];
  int counter = 0;

  if ( (config_file = fopen( "./config", "r" ) ) == NULL )
    {
      fprintf( stderr, "error reading config file\n" );
      exit( -1 );
    }

  while( fgets( string, 80, config_file ) )
    {
      if ( strstr(string, "outbound" ) != NULL )
	{
	  while ( (string[counter] != '\t') && (string[counter++] != ' ' ));
	  while ( (string[counter] == '\t') || (string[counter] == ' ' ))
	  	counter++;
	  strcpy( config->store_path, &string[counter] );
	  counter = strlen( config->store_path );
	  while ( counter >= 0 )
	      if (config->store_path[counter] == 10)
		{
		  config->store_path[counter] = '\0';
		  counter--;
		}
	      else
		counter--;
	}
    }

  fclose( config_file );

}




