Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/include/rump do enums, grab enum modctl



details:   https://anonhg.NetBSD.org/src/rev/8e829c51d905
branches:  trunk
changeset: 791326:8e829c51d905
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Nov 13 16:42:00 2013 +0000

description:
do enums, grab enum modctl

diffstat:

 sys/rump/include/rump/makerumpdefs.sh |  19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r 1c48d6106242 -r 8e829c51d905 sys/rump/include/rump/makerumpdefs.sh
--- a/sys/rump/include/rump/makerumpdefs.sh     Wed Nov 13 16:24:59 2013 +0000
+++ b/sys/rump/include/rump/makerumpdefs.sh     Wed Nov 13 16:42:00 2013 +0000
@@ -8,7 +8,7 @@
 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 @@
        }' < $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 @@
 
 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



Home | Main Index | Thread Index | Old Index