getnum
return getnum("format version", txt+21,
if (getnum("numplayers", txt, 2, MAX_PL, &num_play) < 0) {
if (getnum("currentplayer", txt, 0, num_play-1, &player) < 0) {
if (getnum("doubles", txt, 0, 2, &num_doub) < 0) {
if (getnum(attribute, txt, 0, INT_MAX, &pp->money) < 0) {
if (getnum(attribute, txt, 0, N_SQRS, &tmp) < 0) {
if (getnum(attribute, txt, 0, 2, &tmp) < 0) {
if (getnum(attribute, txt, 0, 3, &tmp) < 0) {
if (getnum(attribute, txt, dp->num_cards, dp->num_cards,
if (getnum(attribute, txt, 0, dp->num_cards,
if (getnum(attribute, txt, 0, 1, &tmp) < 0) {
static int getnum(const char *what, char *txt, int min, int max, int *ret);
if (getnum(attribute, txt, -1, num_play-1, &tmp) < 0) {
if (getnum(attribute, txt, 0, 1, &tmp) < 0) {
if (getnum(attribute, txt, 0, 5, &tmp) < 0) {
return getnum(what, txt, min, max, ret);
static const char * getnum(const char * strp, int * nump, int min,
strp = getnum(strp, &num, 0, HOURSPERDAY * DAYSPERWEEK - 1);
strp = getnum(strp, &num, 0, MINSPERHOUR - 1);
strp = getnum(strp, &num, 0, SECSPERMIN);
strp = getnum(strp, &rulep->r_day, 1, DAYSPERNYEAR);
strp = getnum(strp, &rulep->r_mon, 1, MONSPERYEAR);
strp = getnum(strp, &rulep->r_week, 1, 5);
strp = getnum(strp, &rulep->r_day, 0, DAYSPERWEEK - 1);
strp = getnum(strp, &rulep->r_day, 0, DAYSPERLYEAR - 1);
maxfilelen = getnum(optarg, &endp);
monitorstart = getnum(optarg, &endp);
monitorend = getnum(endp, &endp);
maxoplen = getnum(optarg, &endp);
progressinterval = getnum(optarg, &endp);
readbdy = getnum(optarg, &endp);
style = getnum(optarg, &endp);
truncbdy = getnum(optarg, &endp);
writebdy = getnum(optarg, &endp);
debugstart = getnum(optarg, &endp);
numops = getnum(optarg, &endp);
seed = getnum(optarg, &endp);
static int getnum(char *s, char **e);
simulatedopcount = getnum(optarg, &endp);
closeprob = getnum(optarg, &endp);
if (getnum(&val, &uval, signedconv))
if (getnum(&val, &uval, 1))
static int getnum(intmax_t *, uintmax_t *, int);
if (getnum("pid", *argv, &who)) {
static int getnum(const char *, const char *, int *);
if (getnum("priority", *argv, &prio))
else if (getnum("uid", *argv, &who)) {
p = getnum(&owidth, p, 0);
p = getnum(&skip, p, 0);
p = getnum(&gutter, p, 0);
p = getnum(&propgutter, p, 0);
static char *getnum(int *, char *, int);
static int getnum(const char *);
count = getnum(optarg);
delay = getnum(optarg);
length = getnum(optarg);