summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-11 11:31:28 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-11 11:36:34 +0200
commit8aa06f085b1ea12e3e4503364545c06fa037a624 (patch)
treef0072f3db079c9a96157c781a491ce287fecd40e
parenta214b5227f872fc4e733b9a570ebc8973b244b0d (diff)
downloadcmumble-8aa06f085b1ea12e3e4503364545c06fa037a624.tar.gz
cmumble-8aa06f085b1ea12e3e4503364545c06fa037a624.tar.bz2
cmumble-8aa06f085b1ea12e3e4503364545c06fa037a624.zip
Generate underscore messages names without prefix
-rwxr-xr-xsrc/gen_message.sh4
-rw-r--r--src/messages.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gen_message.sh b/src/gen_message.sh
index 147e8a6..47b81e6 100755
--- a/src/gen_message.sh
+++ b/src/gen_message.sh
@@ -4,8 +4,8 @@ echo "#define _MESSAGES_H_"
echo "#define MUMBLE_MSGS \\"
while read message
do
- prefixed_lower_name=$(echo "$message" | sed "s/\(^\|[a-z]\)\([A-Z][A-Z]*\)/\1_\L\2/g")
- echo -e "\tMUMBLE_MSG(${message}, ${prefixed_lower_name}) \\"
+ underscore_name=$(echo "$message" | sed -e "s/\([a-z]\)\([A-Z]\)/\1_\L\2/g" -e "s/[A-Z]*/\L\0/g")
+ echo -e "\tMUMBLE_MSG(${message}, ${underscore_name}) \\"
done
echo
echo "#endif"
diff --git a/src/messages.c b/src/messages.c
index 512839b..2fd846e 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -8,7 +8,7 @@ static const struct {
const ProtobufCMessageDescriptor *descriptor;
const char *name;
} messages[] = {
-#define MUMBLE_MSG(a,b) { &mumble_proto_##b##__descriptor, #a },
+#define MUMBLE_MSG(a,b) { &mumble_proto__##b##__descriptor, #a },
MUMBLE_MSGS
#undef MUMBLE_MSG
};