IBASE SMARC-EVK1 User Manual
Page 82
![background image](https://www.manualsdir.com/files/790410/content/doc082.png)
56
SMARC Evaluation Kit
/* Return 1 if we should continue, 0 if we should abort */
int user_ack(int def)
{
char s[2];
int ret;
if (!fgets(s, 2, stdin))
return 0; /* Nack by default */
switch (s[0]) {
case 'y':
case 'Y':
ret = 1;
break;
case 'n':
case 'N':
ret = 0;
break;
default:
ret = def;
}
/* Flush extra characters */
while (s[0] != '\n') {
int c = fgetc(stdin);
if (c == EOF) {
ret = 0;
break;
}
s[0] = c;
}
return ret;
}
/*
util - helper functions
*/
#ifndef _UTIL_H
#define _UTIL_H
extern int user_ack(int def);
#endif /* _UTIL_H */
Version.h
#define VERSION "3.1.1"