/* This file is part of the Neper software package. */
/* Copyright (C) 2003-2014, Romain Quey. */
/* See the COPYING file in the top-level directory. */

#include "neper_d_.h"

int
neper_d (int fargc, char **fargv, int argc, char **argv)
{
  // Variable declaration ###
  int i, modqty;
  char** mods = NULL;
  struct IN In;

  ned_in_set_zero (&In);

  // Printing program header ###
  ut_print_moduleheader ("-D", fargc, fargv, argc, argv);

  // Reading input data ###
  ut_print_message (0, 1, "Reading input data...\n");
  ned_input (&In, fargc, fargv, argc, argv);

  ut_print_message (0, 0, "Running in `%s' mode...\n", In.runmode);
  
  ut_string_separate (In.modules, NEUT_SEP_NODEP, &mods, &modqty);
  for (i = 0 ; i < modqty; i++)
    ned_testing (In, mods[i]);

  ned_in_free (In);
  ut_free_2d_char (mods, modqty);

  return EXIT_SUCCESS;
}
