48 #include <visp/vpMy.h>
49 #include <visp/vpToken.h>
50 #include <visp/vpLex.h>
55 #ifndef DOXYGEN_SHOULD_SKIP_THIS
66 void fscanf_float (
float *fp)
70 if ((t = lex ()) != T_FLOAT && t != T_INT)
71 lexerr (
"start",
"float expected", NULL);
72 *fp = (t == T_INT) ? (
float) myint : myfloat;
80 void fscanf_Index (Index *ip)
83 lexerr (
"start",
"integer expected", NULL);
92 void fscanf_int (
int *ip)
95 lexerr (
"start",
"integer expected", NULL);
104 void fscanf_string (
char **str)
106 if (lex () != T_STRING)
107 lexerr (
"start",
"string expected", NULL);
109 *str = (
char *) malloc ((mylength + 1) *
sizeof (char));
111 *str = (
char *) realloc (*str, (mylength + 1) *
sizeof (char));
114 printf(
"Unable to read the string: bad memory allocation");
118 strncpy (*str, mytext, mylength);
126 void fscanf_Type (Type *ip)
129 lexerr (
"start",
"integer expected", NULL);