version 1.32, 2017/04/28 13:53:05 |
version 1.33, 2017/11/29 15:53:44 |
|
|
void |
void |
fcntlcmdname (int arg) |
fcntlcmdname (int arg) |
{ |
{ |
|
int noarg = 0; |
|
|
switch (arg1) { |
switch (arg1) { |
_EOF_ |
_EOF_ |
egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z_]+[[:space:]]+[0-9]+[[:space:]]*" \ |
egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z_]+[[:space:]]+[0-9]+[[:space:]]*" \ |
$include_dir/sys/fcntl.h | \ |
$include_dir/sys/fcntl.h | \ |
awk 'BEGIN { o=0 } { for (i = 1; i <= NF; i++) \ |
awk 'BEGIN { o=0; \ |
|
noarg["F_GETFD"] = 1; \ |
|
noarg["F_GETFL"] = 1; \ |
|
noarg["F_ISATTY"] = 1; \ |
|
noarg["F_GETOWN"] = 1; \ |
|
}{ for (i = 1; i <= NF; i++) \ |
if ($i ~ /define/) \ |
if ($i ~ /define/) \ |
break; \ |
break; \ |
++i; \ |
++i; \ |
if (o <= $(i+1)) \ |
if (o > $(i+1)) \ |
printf "\tcase %s:\n\t\t(void)printf(\"%s\");\n\t\tbreak;\n", $i, $i; \ |
|
else \ |
|
exit; \ |
exit; \ |
|
printf "\tcase %s:\n\t\t(void)printf(\"%s\");%s\n\t\tbreak;\n", $i, $i, \ |
|
noarg[$i] ? "\n\t\tnoarg = 1;" : ""; \ |
o = $(i+1) }' |
o = $(i+1) }' |
cat <<_EOF_ |
cat <<_EOF_ |
default: /* Should not reach */ |
default: /* Should not reach */ |
|
|
} else if (arg1 == F_SETFL) { |
} else if (arg1 == F_SETFL) { |
(void)putchar(','); |
(void)putchar(','); |
doflagsname(arg, 0); |
doflagsname(arg, 0); |
} else if (!fancy || (arg1 != F_GETFD && arg1 != F_GETFL && arg1 != F_ISATTY)) |
} else if (!fancy || !noarg) |
(void)printf(",%#x", arg); |
(void)printf(",%#x", arg); |
} |
} |
|
|