Example #1
0
static GtUword applycheckfunctiontosimpleoptions(
                                  Checkcmppairfuntype checkfunction,
                                  const Cmppairwiseopt *opt)
{
  if (gt_str_array_size(opt->strings) > 0)
  {
    bool forward = true;
    while (true)
    {
      checkfunction(forward,
                    (const GtUchar *) gt_str_array_get(opt->strings,0),
                    (GtUword) strlen(gt_str_array_get(opt->strings,0)),
                    (const GtUchar *) gt_str_array_get(opt->strings,1UL),
                    (GtUword) strlen(gt_str_array_get(opt->strings,1UL)));
      if (!forward)
      {
        break;
      }
      forward = false;
    }
    return 2UL; /* number of testcases */
  }
  if (gt_str_array_size(opt->files) > 0)
  {
    if (opt->fasta)
    {
      GtUword  i, j;
      for (i = 0; i < gt_str_array_size(opt->fastasequences0); i++)
      {
        for (j = 0; j < gt_str_array_size(opt->fastasequences1); j++)
        {
          checkfunction(true,
                    (const GtUchar *) gt_str_array_get(opt->fastasequences0,i),
                    (GtUword) strlen(gt_str_array_get(opt->fastasequences0,i)),
                    (const GtUchar *) gt_str_array_get(opt->fastasequences1,j),
                    (GtUword) strlen(gt_str_array_get(opt->fastasequences1,j)));
        }
      }
    }
    else
    {
      gt_runcheckfunctionontwofiles(checkfunction,
                                    gt_str_array_get(opt->files,0),
                                    gt_str_array_get(opt->files,1UL));
    }
    return 2UL;
  }
  if (opt->charlistlen != NULL)
  {
    return gt_runcheckfunctiononalphalen(checkfunction,
                                      gt_str_get(opt->charlistlen->charlist),
                                      opt->charlistlen->len);
  }
  if (gt_str_length(opt->text) > 0)
  {
    return gt_runcheckfunctionontext(checkfunction, gt_str_get(opt->text));
  }
  gt_assert(false);
  return 0;
}
Example #2
0
static unsigned long applycheckfunctiontosimpleoptions(
                                  Checkcmppairfuntype checkfunction,
                                  const Cmppairwiseopt *opt)
{
  if (gt_str_array_size(opt->strings) > 0)
  {
    bool forward = true;
    while (true)
    {
      checkfunction(forward,
                    (const GtUchar *) gt_str_array_get(opt->strings,0),
                    (unsigned long) strlen(gt_str_array_get(opt->strings,0)),
                    (const GtUchar *) gt_str_array_get(opt->strings,1UL),
                    (unsigned long) strlen(gt_str_array_get(opt->strings,1UL)));
      if (!forward)
      {
        break;
      }
      forward = false;
    }
    return 2UL; /* number of testcases */
  }
  if (gt_str_array_size(opt->files) > 0)
  {
    gt_runcheckfunctionontwofiles(checkfunction,
                               gt_str_array_get(opt->files,0),
                               gt_str_array_get(opt->files,1UL));
    return 2UL;
  }
  if (opt->charlistlen != NULL)
  {
    return gt_runcheckfunctiononalphalen(checkfunction,
                                      gt_str_get(opt->charlistlen->charlist),
                                      opt->charlistlen->len);
  }
  if (gt_str_length(opt->text) > 0)
  {
    return gt_runcheckfunctionontext(checkfunction,gt_str_get(opt->text));
  }
  gt_assert(false);
  return 0;
}