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 1262, Sat May 28 23:45:43 2011 UTC revision 1263, Sun May 29 00:09:15 2011 UTC
# Line 73  Line 73 
73                                  //!  intended to be one or more sentences                                  //!  intended to be one or more sentences
74      hestOpt     *hopt;          //!< dynamically managed hest options      hestOpt     *hopt;          //!< dynamically managed hest options
75      hestParm    *hparm;         //!< hest parameters      hestParm    *hparm;         //!< hest parameters
76      opt_def_t   *odef;          //!< dynamically reallocated via odefArr      opt_def_t   **odef;         //!< dynamically reallocated via odefArr
77      uint32_t    odefNum;        //!< length of meaningful values in odef[]      unsigned int odefNum;       //!< length of meaningful values in odef[]
78      airArray    *odefArr;       //!< manages odef and odefNum;      airArray    *odefArr;       //!< manages odef and odefNum;
79      airArray    *mop;           //!< manages hopt, hparm, and odefArr      airArray    *mop;           //!< manages hopt, hparm, and odefArr
80  };  };
# Line 105  Line 105 
105    
106  /*! create the container for all option information  /*! create the container for all option information
107   */   */
108  Diderot_Options_t *Diderot_OptNew (void)  Diderot_Options_t *Diderot_OptNew ()
109  {  {
110      static const char *me = "Diderot_Options_New";      static const char *me = "Diderot_Options_New";
111      Diderot_Options_t *dopts = AIR_CALLOC(1, Diderot_Options_t);      Diderot_Options_t *dopts = AIR_CALLOC(1, Diderot_Options_t);
112      if (!dopts) {      if (dopts == 0) {
113          fprintf(stderr, "%s: unable to allocate output\n", me);          fprintf(stderr, "%s: unable to allocate output\n", me);
114          exit(1);          exit(1);
115      }      }
# Line 204  Line 204 
204          exit(1);          exit(1);
205      }      }
206    /* code here uses "odf" to copy one value of odef[] */    /* code here uses "odf" to copy one value of odef[] */
207      opt_def_t *odf = &(dopts->odef[nidx]);      opt_def_t *odf = dopts->odef[nidx];
208      odf->name = airStrdup(name);      odf->name = airStrdup(name);
209      odf->desc = airStrdup(desc);      odf->desc = airStrdup(desc);
210      if ((odf->name == 0) || (odf->desc == 0)) {      if ((odf->name == 0) || (odf->desc == 0)) {
# Line 228  Line 228 
228                 NULL, desc);                 NULL, desc);
229  }  }
230    
231    /*! \brief add a boolean-valued option to the list of options.
232     *  \param dopts   the list of options
233     *  \param name    the name of the option
234     *  \param desc    a short description string
235     *  \param v       a pointer to the location where the value gets stored
236     *  \param hasDflt true if there is an initial value
237     */
238  void Diderot_OptAddBool (  void Diderot_OptAddBool (
239      Diderot_Options_t *dopts,      Diderot_Options_t *dopts,
240      const char *name, const char *desc,      const char *name, const char *desc,
# Line 400  Line 407 
407    
408      // convert values learned by hest to their Diderot representations      // convert values learned by hest to their Diderot representations
409      for (int i = 0;  i < dopts->odefNum;  i++) {      for (int i = 0;  i < dopts->odefNum;  i++) {
410          opt_def_t *odf = &(dopts->odef[i]);          opt_def_t *odf = dopts->odef[i];
411          switch (odf->ty) {          switch (odf->ty) {
412            case optTypeFlag:            case optTypeFlag:
413            case optTypeBool:            case optTypeBool:

Legend:
Removed from v.1262  
changed lines
  Added in v.1263

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