コード例 #1
0
Isis_Fit_Engine_Type *isis_find_fit_engine (char *name) /*{{{*/
{
   Isis_Option_Type *opts;
   Isis_Fit_Engine_Type *e;

   if (name == NULL)
     name = Fit_Default_Fit_Method;

   if (NULL == (opts = isis_parse_option_string (name)))
     return NULL;

   name = opts->subsystem;

   if (NULL == (e = find_fit_engine (name)))
     {
        fprintf (stderr, "fit method %s does not exist\n", name);
        isis_free_options (opts);
        return NULL;
     }

   if (e->set_options != NULL)
     {
        if (-1 == e->set_options (e, opts))
          {
             isis_free_options (opts);
             return NULL;
          }
     }

   isis_free_options (opts);

   return e;
}
コード例 #2
0
Isis_Fit_Statistic_Type *isis_find_fit_statistic (char *name) /*{{{*/
{
   Isis_Option_Type *opts;
   Isis_Fit_Statistic_Type *s;

   if (name == NULL)
     name = Fit_Default_Fit_Method;

   if (NULL == (opts = isis_parse_option_string (name)))
     return NULL;

   name = opts->subsystem;

   if (NULL == (s = find_statistic (name)))
     {
        fprintf (stderr, "fit statistic %s does not exist\n", name);
        isis_free_options (opts);
        return NULL;
     }

   s->message_string = NULL;

   if (s->set_options != NULL)
     {
        if (-1 == s->set_options (s, opts))
          {
             isis_free_options (opts);
             return NULL;
          }
     }

   isis_free_options (opts);

   return s;
}
コード例 #3
0
static int process_options (Isis_Kernel_t *k, char *options) /*{{{*/
{
   Isis_Option_Type *o;
   int status;

   if (options == NULL)
     return 0;

   if (NULL == (o = isis_parse_option_string (options)))
     return -1;

   status = isis_process_options (o, Std_Option_Table, (void *)k, 1);
   isis_free_options (o);

   return status;
}
コード例 #4
0
int isis_is_option_present (char *options, char *option, char **value)
{
   unsigned int i, num;
   Isis_Option_Type *opt;
   int status;
   char **option_names;

   if (options == NULL)
     return 0;

   if (option == NULL)
     return 0;

   opt = isis_parse_option_string (options);
   if (opt == NULL)
     return -1;

   option_names = opt->option_names;
   num = opt->num_options;

   status = 0;

   for (i = 0; i < num; i++)
     {
        if (0 != isis_strcasecmp (option, option_names[i]))
          continue;

        status = 1;

        if (value != NULL)
          {
             char *val = opt->option_values[i];

             if (val != NULL)
               {
                  if (NULL == (val = isis_make_string (val)))
                    status = -1;
               }
             *value = val;
          }
        break;
     }

   isis_free_options (opt);
   return status;
}
コード例 #5
0
static int parse_options (Isis_Rmf_t *rmf, char *options) /*{{{*/
{
   Isis_Option_Type *opts;

   if (NULL == (opts = isis_parse_option_string (options)))
     return -1;

   if (-1 == set_options (rmf, opts))
     {
        isis_free_options (opts);
        return -1;
     }

   isis_free_options (opts);

   return 0;
}