Commit ba515ddf authored by stefano's avatar stefano

Implement read_yesno().


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18037 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent dd322c68
......@@ -472,3 +472,14 @@ void show_formats(void)
"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
"worse.\n");
}
int read_yesno(void)
{
int c = getchar();
int yesno = (toupper(c) == 'Y');
while (c != '\n' && c != EOF)
c = getchar();
return yesno;
}
......@@ -152,4 +152,10 @@ void show_license(void);
*/
void show_formats(void);
/**
* Returns a positive value if reads from standard input a line
* starting with [yY], otherwise returns 0.
*/
int read_yesno(void);
#endif /* FFMPEG_CMDUTILS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment