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

SCM Repository

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

Diff of /branches/pure-cfg/src/lib/diderot.c

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

revision 570, Mon Feb 28 20:56:02 2011 UTC revision 571, Mon Feb 28 21:36:12 2011 UTC
# Line 267  Line 267 
267  /* functions to get input-parameter values */  /* functions to get input-parameter values */
268  Status_t Diderot_InputString (const char *name, const char **v, bool hasDflt)  Status_t Diderot_InputString (const char *name, const char **v, bool hasDflt)
269  {  {
270      return DIDEROT_OK;      return DIDEROT_FAIL;
271  }  }
272    
273  Status_t Diderot_Inputf (const char *name, float *v, bool hasDflt)  Status_t Diderot_Inputf (const char *name, float *v, bool hasDflt)
274  {  {
275      return DIDEROT_OK;      float       f;
276    
277        while (true) {
278            if (hasDflt)
279                printf("Enter value for %s (default %f): ", name, *v);
280            else
281                printf("Enter value for %s: ", name);
282            fflush (stdout);
283    
284            int n = scanf("%f\n", &f);
285    printf("n = %d\n", n);
286            if (n == EOF)
287                return DIDEROT_FAIL;
288            else if (n == 1) {
289                *v = f;
290                return DIDEROT_OK;;
291            }
292            else if (hasDflt)
293                return DIDEROT_OK;;
294        }
295    
296  }  }
297    
298  Status_t Diderot_InputVec3f (const char *name, vec3f_t *v, bool hasDflt)  Status_t Diderot_InputVec3f (const char *name, vec3f_t *v, bool hasDflt)
299  {  {
300      return DIDEROT_OK;      return DIDEROT_FAIL;
301  }  }

Legend:
Removed from v.570  
changed lines
  Added in v.571

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