LEFT | RIGHT |
1 #!/bin/sh | 1 #!/bin/sh |
2 # Copyright 2009 The Go Authors. All rights reserved. | 2 # Copyright 2009 The Go Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style | 3 # Use of this source code is governed by a BSD-style |
4 # license that can be found in the LICENSE file.# Copyright 2009 The Go Authors.
All rights reserved. | 4 # license that can be found in the LICENSE file.# Copyright 2009 The Go Authors.
All rights reserved. |
5 # Use of this source code is governed by a BSD-style | 5 # Use of this source code is governed by a BSD-style |
6 # license that can be found in the LICENSE file. | 6 # license that can be found in the LICENSE file. |
7 | 7 |
8 COMMAND="mksysnum_plan9.sh $@" | 8 COMMAND="mksysnum_plan9.sh $@" |
9 | 9 |
10 cat <<EOF | 10 cat <<EOF |
11 // $COMMAND | 11 // $COMMAND |
12 // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT | 12 // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT |
13 | 13 |
14 package syscall | 14 package syscall |
15 | 15 |
16 const( | 16 const( |
17 EOF | 17 EOF |
18 | 18 |
19 cat $1 | sed -r 's/^#define[ \t]([A-Z0-9_]+)[ \t]+([0-9]+)/\tSYS_\1=\2/g' | grep
-v SYS__ | 19 SP='[ » ]' # space or tab |
| 20 sed "s/^#define${SP}\\([A-Z0-9_][A-Z0-9_]*\\)${SP}${SP}*\\([0-9][0-9]*\\)/SYS_\\
1=\\2/g" \ |
| 21 » < $1 | grep -v SYS__ |
20 | 22 |
21 cat <<EOF | 23 cat <<EOF |
22 ) | 24 ) |
23 EOF | 25 EOF |
LEFT | RIGHT |