Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144642581
D35214.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35214.diff
View Options
Index: lib/libsysdecode/flags.c
===================================================================
--- lib/libsysdecode/flags.c
+++ lib/libsysdecode/flags.c
@@ -81,10 +81,11 @@
};
#define X(a) { a, #a },
+#define Y(a, b) { a, #b },
#define XEND { 0, NULL }
#define TABLE_START(n) static struct name_table n[] = {
-#define TABLE_ENTRY X
+#define TABLE_ENTRY Y
#define TABLE_END XEND };
#include "tables.h"
Index: lib/libsysdecode/mktables
===================================================================
--- lib/libsysdecode/mktables
+++ lib/libsysdecode/mktables
@@ -78,7 +78,40 @@
if ($i ~ /define/) \
break; \
++i; \
- printf "TABLE_ENTRY(%s)\n", $i }'
+ printf "TABLE_ENTRY(%s, %s)\n", $i, $i }'
+ fi
+cat <<_EOF_
+TABLE_END
+
+_EOF_
+}
+
+linux_gen_table()
+{
+ local name grep file excl filter
+ name=$1
+ grep=$2
+ file=$3
+ excl=$4
+
+ if [ -z "$excl" ]; then
+ filter="cat"
+ else
+ filter="egrep -v"
+ fi
+ cat <<_EOF_
+TABLE_START(${name})
+_EOF_
+ if [ -e "${include_dir}/${file}" ]; then
+ all_headers="${all_headers:+${all_headers} }${file}"
+ egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
+ $include_dir/$file | ${filter} ${excl} | \
+ awk '{ for (i = 1; i <= NF; i++) \
+ if ($i ~ /define/) \
+ break; \
+ ++i; \
+ sub(/LINUX_/, "", $i); \
+ printf "TABLE_ENTRY(LINUX_%s, %s)\n", $i, $i }'
fi
cat <<_EOF_
TABLE_END
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 11, 1:38 PM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28653080
Default Alt Text
D35214.diff (1 KB)
Attached To
Mode
D35214: libsysdecode: Add linux_gen_table to mktables for future use
Attached
Detach File
Event Timeline
Log In to Comment