/*
 * File automatically generated by
 * gengen 1.4.2 by Lorenzo Bettini 
 * http://www.gnu.org/software/gengen
 */

#include "check_modes.h"

void
check_modes_gen_class::generate_check_modes(ostream &stream, unsigned int indent)
{
  string indent_str (indent, ' ');
  indent = 0;

  stream << "if (args_info->";
  generate_string (mode1_name, stream, indent + indent_str.length ());
  stream << "_mode_counter && args_info->";
  generate_string (mode2_name, stream, indent + indent_str.length ());
  stream << "_mode_counter) {";
  stream << "\n";
  stream << indent_str;
  stream << "  int ";
  generate_string (mode1_name, stream, indent + indent_str.length ());
  stream << "_given[] = {";
  generate_string (mode1_given_fields, stream, indent + indent_str.length ());
  stream << " -1};";
  stream << "\n";
  stream << indent_str;
  stream << "  const char *";
  generate_string (mode1_name, stream, indent + indent_str.length ());
  stream << "_desc[] = {";
  generate_string (mode1_options, stream, indent + indent_str.length ());
  stream << " 0};";
  stream << "\n";
  stream << indent_str;
  stream << "  int ";
  generate_string (mode2_name, stream, indent + indent_str.length ());
  stream << "_given[] = {";
  generate_string (mode2_given_fields, stream, indent + indent_str.length ());
  stream << " -1};";
  stream << "\n";
  stream << indent_str;
  stream << "  const char *";
  generate_string (mode2_name, stream, indent + indent_str.length ());
  stream << "_desc[] = {";
  generate_string (mode2_options, stream, indent + indent_str.length ());
  stream << " 0};";
  stream << "\n";
  stream << indent_str;
  stream << "  error_occurred += check_modes(";
  generate_string (mode1_name, stream, indent + indent_str.length ());
  stream << "_given, ";
  generate_string (mode1_name, stream, indent + indent_str.length ());
  stream << "_desc, ";
  generate_string (mode2_name, stream, indent + indent_str.length ());
  stream << "_given, ";
  generate_string (mode2_name, stream, indent + indent_str.length ());
  stream << "_desc);";
  stream << "\n";
  stream << indent_str;
  stream << "}";
  stream << "\n";
  stream << indent_str;
}
