summaryrefslogtreecommitdiff
path: root/src/gen_message.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/gen_message.sh')
-rwxr-xr-xsrc/gen_message.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gen_message.sh b/src/gen_message.sh
index 2fbe75c..32ef978 100755
--- a/src/gen_message.sh
+++ b/src/gen_message.sh
@@ -1,11 +1,11 @@
#!/bin/sh
-
-echo "static const struct { const ProtobufCMessageDescriptor *descriptor; const char *name; } messages[] = {"
+echo "#ifndef _MESSAGES_H_"
+echo "#define _MESSAGES_H_"
+echo "#define MUMBLE_MSGS \\"
while read message
do
- #lower_name=$(echo $message | tr '[:upper:]' '_[:lower:]' | sed "s/^_\(.*\)$/\1/")
-
prefixed_lower_name=$(echo "$message" | sed "s/\(^\|[a-z]\)\([A-Z][A-Z]*\)/\1_\L\2/g")
- echo -e "\t/* ${message} */ { &mumble_proto_${prefixed_lower_name}__descriptor, \"$message\" },"
+ echo -e "\tMUMBLE_MSG(${message}, ${prefixed_lower_name}, \"${message}\") \\"
done
-echo "};"
+echo
+echo "#endif"