2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-24 10:58:36 +00:00
criu/scripts/protobuf-gen.sh
Pavel Emelyanov 68475dd013 build: Move protobuf-desc-gen.sh into scripts/
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-15 11:26:45 +04:00

8 lines
303 B
Bash

for x in $(cat include/protobuf-desc.h | \
sed -n '/PB_AUTOGEN_START/,/PB_AUTOGEN_STOP/p' | \
fgrep -v 'PB_AUTOGEN_S' | sed -e 's/,//' -e 's/PB_//'); do
x_la=$(echo $x | tr 'A-Z' 'a-z')
x_uf=$(echo $x_la | sed -e 's/^./\u&/' -e 's/_./\U&/g' -e 's/_//g')
echo "CR_PB_DESC($x, $x_uf, $x_la);"
done