Module Name: src
Committed By: pooka
Date: Wed Nov 13 16:42:00 UTC 2013
Modified Files:
src/sys/rump/include/rump: makerumpdefs.sh
Log Message:
do enums, grab enum modctl
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/rump/include/rump/makerumpdefs.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/rump/include/rump/makerumpdefs.sh
diff -u src/sys/rump/include/rump/makerumpdefs.sh:1.21 src/sys/rump/include/rump/makerumpdefs.sh:1.22
--- src/sys/rump/include/rump/makerumpdefs.sh:1.21 Thu Aug 15 22:10:04 2013
+++ src/sys/rump/include/rump/makerumpdefs.sh Wed Nov 13 16:42:00 2013
@@ -8,7 +8,7 @@ echo Generating rumpdefs.h
rm -f rumpdefs.h
exec > rumpdefs.h
-printf '/* $NetBSD: makerumpdefs.sh,v 1.21 2013/08/15 22:10:04 pooka Exp $ */\n\n'
+printf '/* $NetBSD: makerumpdefs.sh,v 1.22 2013/11/13 16:42:00 pooka Exp $ */\n\n'
printf '/*\n *\tAUTOMATICALLY GENERATED. DO NOT EDIT.\n */\n\n'
printf '#ifndef _RUMP_RUMPDEFS_H_\n'
printf '#define _RUMP_RUMPDEFS_H_\n\n'
@@ -34,6 +34,22 @@ struct rump_'"$2"' {
}' < $1
}
+# likewise not perfect, but as long as it's KNF, we're peachy (though
+# I personally like nectarines more)
+getenum () {
+ sed -n '/enum[ ]*'"$2"'[ ]*{/{
+ a\
+enum rump_'"$2"' {
+ :loop
+ n
+ s/^}.*;$/};/p
+ t
+ s/'$3'/RUMP_&/gp
+ b loop
+ }' < $1
+}
+
+
fromvers ../../../sys/fcntl.h
sed -n '/#define O_[A-Z]* *0x/s/O_/RUMP_O_/gp' \
< ../../../sys/fcntl.h
@@ -89,6 +105,7 @@ sed -n '/#define[ ]*_IO.*[^\]$/{s/_IO/_
fromvers ../../../sys/module.h
getstruct ../../../sys/module.h modctl_load
+getenum ../../../sys/module.h modctl MODCTL
fromvers ../../../ufs/ufs/ufsmount.h
getstruct ../../../ufs/ufs/ufsmount.h ufs_args