Deleted Added
full compact
mksubr (168543) mksubr (175936)
1set -e
2
1#!/bin/sh
2#
3# $FreeBSD: head/usr.bin/kdump/mksubr 175936 2008-02-03 11:33:27Z des $
4#
3# Generates kdump_subr.c
4# mkioctls is a special-purpose script, and works fine as it is
5# now, so it remains independent. The idea behind how it generates
6# its list was heavily borrowed here.
7#
8# Some functions here are automatically generated. This can mean
9# the user will see unusual kdump output or errors while building
10# if the underlying .h files are changed significantly.
11#
12# Key:
13# AUTO: Completely auto-generated with either the "or" or the "switch"
14# method.
15# AUTO - Special: Generated automatically, but with some extra commands
16# that the auto_*_type() functions are inappropriate for.
17# MANUAL: Manually entered and must therefore be manually updated.
18
5# Generates kdump_subr.c
6# mkioctls is a special-purpose script, and works fine as it is
7# now, so it remains independent. The idea behind how it generates
8# its list was heavily borrowed here.
9#
10# Some functions here are automatically generated. This can mean
11# the user will see unusual kdump output or errors while building
12# if the underlying .h files are changed significantly.
13#
14# Key:
15# AUTO: Completely auto-generated with either the "or" or the "switch"
16# method.
17# AUTO - Special: Generated automatically, but with some extra commands
18# that the auto_*_type() functions are inappropriate for.
19# MANUAL: Manually entered and must therefore be manually updated.
20
19# $FreeBSD: head/usr.bin/kdump/mksubr 168543 2007-04-09 19:16:24Z emaste $
21set -e
20
21LC_ALL=C; export LC_ALL
22
23if [ -z "$1" ]
24then
25 echo "usage: sh $0 include-dir"
26 exit 1
27fi

--- 393 unchanged lines hidden (view full) ---

421 * The send and recv functions have a flags argument which can be
422 * set to 0. There is no corresponding #define. The auto_ functions
423 * detect this as "invalid", which is incorrect here.
424 */
425void
426sendrecvflagsname (int flags)
427{
428 int or = 0;
22
23LC_ALL=C; export LC_ALL
24
25if [ -z "$1" ]
26then
27 echo "usage: sh $0 include-dir"
28 exit 1
29fi

--- 393 unchanged lines hidden (view full) ---

423 * The send and recv functions have a flags argument which can be
424 * set to 0. There is no corresponding #define. The auto_ functions
425 * detect this as "invalid", which is incorrect here.
426 */
427void
428sendrecvflagsname (int flags)
429{
430 int or = 0;
429
431
430 if (flags == 0) {
431 (void)printf("0");
432 return;
433 }
434_EOF_
435egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" $include_dir/sys/socket.h | \
436 awk '{ for (i = 1; i <= NF; i++) \
437 if ($i ~ /define/) \
438 break; \
439 ++i; \
440 printf "\tif(!((flags>0)^((%s)>0)))\n\t\tif_print_or(flags, %s, or);\n", $i, $i }'
441cat <<_EOF_
442}
443
444_EOF_
432 if (flags == 0) {
433 (void)printf("0");
434 return;
435 }
436_EOF_
437egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" $include_dir/sys/socket.h | \
438 awk '{ for (i = 1; i <= NF; i++) \
439 if ($i ~ /define/) \
440 break; \
441 ++i; \
442 printf "\tif(!((flags>0)^((%s)>0)))\n\t\tif_print_or(flags, %s, or);\n", $i, $i }'
443cat <<_EOF_
444}
445
446_EOF_