SCM Repository
[diderot] Diff of /branches/pure-cfg/src/lib/diderot.c
Diff of /branches/pure-cfg/src/lib/diderot.c
Parent Directory
|
Revision Log
|
Patch
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.568 |
|
changed lines |
|
Added in v.571 |
|
|