Clean up protocol code generators
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
# unless this role is already filled by, e.g., WebSocket.
|
||||
#
|
||||
# Usage: env LC_ALL=C awk -f xC-gen-proto.awk -f xC-gen-proto-{c,go,js}.awk \
|
||||
# xC-proto > xC-proto.{c,go,js} | {clang-format,gofmt,...}
|
||||
# -v PrefixCamel=Relay xC-proto > xC-proto.{c,go,js} | {clang-format,gofmt,...}
|
||||
|
||||
# --- Utilities ----------------------------------------------------------------
|
||||
|
||||
@@ -289,12 +289,14 @@ function deftype() {
|
||||
return 0
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
PrefixLower = "relay_"
|
||||
PrefixUpper = "RELAY_"
|
||||
PrefixCamel = "Relay"
|
||||
{
|
||||
if (PrefixCamel) {
|
||||
PrefixLower = tolower(cameltosnake(PrefixCamel)) "_"
|
||||
PrefixUpper = toupper(cameltosnake(PrefixCamel)) "_"
|
||||
}
|
||||
|
||||
print "// Generated by xC-gen-proto.awk. DO NOT MODIFY."
|
||||
# This is not in a BEGIN clause (even though it consumes all input),
|
||||
# so that the code generator can insert the first FILENAME.
|
||||
codegen_begin()
|
||||
|
||||
nexttoken()
|
||||
|
||||
Reference in New Issue
Block a user