Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/lib/common/input.c
ViewVC logotype

Diff of /branches/pure-cfg/src/lib/common/input.c

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

revision 1267, Sun Jun 5 11:25:29 2011 UTC revision 1268, Sun Jun 5 11:25:58 2011 UTC
# Line 224  Line 224 
224      bool *flg)      bool *flg)
225  {  {
226      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)flg, optTypeFlag);      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)flg, optTypeFlag);
227      hestOptAdd(&dopts->hopt, name, NULL, airTypeInt, 0, 0, &odf->hval.b,      hestOptAdd (
228            &dopts->hopt, name, NULL, airTypeInt, 0, 0, &odf->hval.b,
229                 NULL, desc);                 NULL, desc);
230  }  }
231    
# Line 241  Line 242 
242      bool *v, bool hasDflt)      bool *v, bool hasDflt)
243  {  {
244      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeBool);      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeBool);
245      hestOptAdd(&dopts->hopt, name, "bool", airTypeBool, 1, 1, &odf->hval.b,      hestOptAdd (
246            &dopts->hopt, name, "bool", airTypeBool, 1, 1, &odf->hval.b,
247                 hasDflt ? (*v ? "true" : "false") : NULL, desc);                 hasDflt ? (*v ? "true" : "false") : NULL, desc);
248  }  }
249    
# Line 279  Line 281 
281          sprintf(buf, "%ld", (long)*v);          sprintf(buf, "%ld", (long)*v);
282      }      }
283      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeInt);      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeInt);
284      hestOptAdd( &dopts->hopt, name, "int", airTypeLongInt, 1, 1, odf->hval.i,      hestOptAdd (
285            &dopts->hopt, name, "int", airTypeLongInt, 1, 1, odf->hval.i,
286                 hasDflt ? buf : NULL, desc);                 hasDflt ? buf : NULL, desc);
287  }  }
288    
# Line 299  Line 302 
302          sprintf(buf, "%lf", (double)*v);          sprintf(buf, "%lf", (double)*v);
303      }      }
304      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeReal);      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeReal);
305      hestOptAdd(&dopts->hopt, name, "val", airTypeDouble, 1, 1, odf->hval.r,      hestOptAdd (
306            &dopts->hopt, name, "val", airTypeDouble, 1, 1, odf->hval.r,
307                 hasDflt ? buf : NULL, desc);                 hasDflt ? buf : NULL, desc);
308  }  }
309    
# Line 322  Line 326 
326          sprintf(buf, "%lf %lf", (double)(u.r[0]), (double)(u.r[1]));          sprintf(buf, "%lf %lf", (double)(u.r[0]), (double)(u.r[1]));
327      }      }
328      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeReal2);      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeReal2);
329      hestOptAdd(&dopts->hopt, name, "x y", airTypeDouble, 2, 2, odf->hval.r,      hestOptAdd (
330            &dopts->hopt, name, "x y", airTypeDouble, 2, 2, odf->hval.r,
331                 hasDflt ? buf : NULL, desc);                 hasDflt ? buf : NULL, desc);
332  }  }
333    
# Line 346  Line 351 
351                  (double)(u.r[0]), (double)(u.r[1]), (double)(u.r[2]));                  (double)(u.r[0]), (double)(u.r[1]), (double)(u.r[2]));
352      }      }
353      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeReal3);      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeReal3);
354      hestOptAdd(&dopts->hopt, name, "x y z", airTypeDouble, 3, 3, odf->hval.r,      hestOptAdd (
355            &dopts->hopt, name, "x y z", airTypeDouble, 3, 3, odf->hval.r,
356                 hasDflt ? buf : NULL, desc);                 hasDflt ? buf : NULL, desc);
357  }  }
358    
# Line 372  Line 378 
378                  (double)(u.r[2]), (double)(u.r[3]));                  (double)(u.r[2]), (double)(u.r[3]));
379      }      }
380      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeReal4);      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeReal4);
381      hestOptAdd(&dopts->hopt, name, "x y z w", airTypeDouble, 4, 4, odf->hval.r,      hestOptAdd (
382            &dopts->hopt, name, "x y z w", airTypeDouble, 4, 4, odf->hval.r,
383                 hasDflt ? buf : NULL, desc);                 hasDflt ? buf : NULL, desc);
384  }  }
385    
# Line 389  Line 396 
396      char **v, bool hasDflt)      char **v, bool hasDflt)
397  {  {
398      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeString);      opt_def_t *odf = OptAdd(dopts, name, desc, (void*)v, optTypeString);
399      hestOptAdd(&dopts->hopt, name, "str", airTypeString, 1, 1, &odf->hval.s,      hestOptAdd (
400            &dopts->hopt, name, "str", airTypeString, 1, 1, &odf->hval.s,
401                 hasDflt ? *v : NULL, desc);                 hasDflt ? *v : NULL, desc);
402  }  }
403    
# Line 399  Line 407 
407  {  {
408      static const char *me = "Diderot_ProcessOptions";      static const char *me = "Diderot_ProcessOptions";
409    
410      hestParseOrDie(dopts->hopt, argc-1, argv+1, dopts->hparm, argv[0],      hestParseOrDie (
411            dopts->hopt, argc-1, argv+1, dopts->hparm, argv[0],
412                     dopts->progInfo ? dopts->progInfo : "(no program info set)",                     dopts->progInfo ? dopts->progInfo : "(no program info set)",
413                     AIR_TRUE, AIR_TRUE, AIR_TRUE);                     AIR_TRUE, AIR_TRUE, AIR_TRUE);
414      airMopAdd(dopts->mop, dopts->hopt, (airMopper)hestOptFree, airMopAlways);      airMopAdd(dopts->mop, dopts->hopt, (airMopper)hestOptFree, airMopAlways);

Legend:
Removed from v.1267  
changed lines
  Added in v.1268

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0