diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/libs/beast/tools/make_field.sh | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/beast/tools/make_field.sh')
-rwxr-xr-x | src/boost/libs/beast/tools/make_field.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/boost/libs/beast/tools/make_field.sh b/src/boost/libs/beast/tools/make_field.sh new file mode 100755 index 000000000..8e54c1372 --- /dev/null +++ b/src/boost/libs/beast/tools/make_field.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +export LC_COLLATE=C + +echo "// string constants" +echo ' "<unknown-field>",' +cat $1 | sort -f | uniq | sed 's/^/ \"/; s/$/\",/' +echo + +echo "enum class field : unsigned short" +echo "{" +echo " unknown = 0," +echo +#cat $1 | uniq | sort -f | sed 's/./\L&/g; s/^/\t/; s/$/,/' +cat $1 | sort -f | uniq | sed 's/\(.*\)/ \L\1,/; s/-/_/g' +echo "};" +echo + +echo "// pairs" +#cat $1 | uniq | sort -f | sed 's/\(.*\)/\tmatch\(field::\L\1, \"\E\1\"\);/; s/-/_/' +cat $1 | sort -f | uniq | perl -nE 'chomp; $a=lc($_); $a=~s/-/_/g; say " match(field::$a, \"$_\");";' | tr -d "\015" + |