/[ascend]/trunk/base/generic/solver/slv.c
ViewVC logotype

Diff of /trunk/base/generic/solver/slv.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 944 by johnpye, Sat Nov 25 05:26:47 2006 UTC revision 945 by johnpye, Sat Nov 25 12:41:03 2006 UTC
# Line 1286  int slv_param_real(slv_parameters_t *p, Line 1286  int slv_param_real(slv_parameters_t *p,
1286    
1287  int slv_param_char(slv_parameters_t *p, const int index  int slv_param_char(slv_parameters_t *p, const int index
1288      ,const SlvParameterInitChar init      ,const SlvParameterInitChar init
1289        ,const char **options
1290  ){  ){
1291      int i, noptions;      int i, noptions;
1292      struct slv_parameter *p1;      struct slv_parameter *p1;
1293      if(p == NULL)return -1;      if(p == NULL)return -1;
1294      p1 = &(p->parms[index]);      p1 = &(p->parms[index]);
1295        p1->type = char_parm;
1296    
1297      /* find the length by hunting for the NULL at the end */      /* find the length by hunting for the NULL at the end */
1298      for(i=0; init.options[i]!=NULL; ++i);      for(i=0; options[i]!=NULL; ++i);/*
1299            CONSOLE_DEBUG("FOUND init.options[%d]='%s'",i,options[i]);
1300        }*/
1301      noptions = i;      noptions = i;
1302      CONSOLE_DEBUG("THERE ARE %d CHAR OPTIONS IN PARAMETER '%s'", noptions, init.meta.codename);      /* CONSOLE_DEBUG("THERE ARE %d CHAR OPTIONS IN PARAMETER '%s'", noptions, init.meta.codename); */
1303    
1304      p1->info.c.high = noptions;      p1->info.c.high = noptions;
1305      p1->info.c.value = strdup(init.val);      p1->info.c.value = strdup(init.val);
1306      p1->info.c.argv = ASC_NEW_ARRAY(char *,noptions);      p1->info.c.argv = ASC_NEW_ARRAY(char *,noptions);
1307    
1308      for(i = 0; i < noptions; ++i){      for(i = 0; i < noptions; ++i){
1309          p1->info.c.argv[i] = ascstrdup(init.options[i]);          p1->info.c.argv[i] = ascstrdup(options + i);
1310      }      }
1311    
1312      slv_define_param_meta(p1, &(init.meta), index);      slv_define_param_meta(p1, &(init.meta), index);

Legend:
Removed from v.944  
changed lines
  Added in v.945

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22