From 061c169d277db5611a9d3ea8351f0d4d0d613b0a Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Fri, 23 Sep 2011 11:45:39 +0200 Subject: Rename message.h to message_list.h --- src/.gitignore | 2 +- src/Makefile.am | 10 +++++----- src/cmumble.h | 2 +- src/gen_message_list.sed | 24 ++++++++++++++++++++++++ src/gen_messages.sed | 24 ------------------------ 5 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 src/gen_message_list.sed delete mode 100644 src/gen_messages.sed diff --git a/src/.gitignore b/src/.gitignore index a4818d0..9a096f7 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,4 +1,4 @@ -messages.h +message_list.h mumble.pb-c.c mumble.pb-c.h protoc-c.sh diff --git a/src/Makefile.am b/src/Makefile.am index 8af2758..ef92bee 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ bin_PROGRAMS = cmumble noinst_HEADERS = cmumble.h varint.h io.h connection.h -nodist_noinst_HEADERS = mumble.pb-c.h messages.h +nodist_noinst_HEADERS = mumble.pb-c.h message_list.h cmumble_SOURCES = cmumble.c messages.c varint.c io.c connection.c nodist_cmumble_SOURCES = mumble.pb-c.c @@ -15,14 +15,14 @@ AM_CFLAGS = $(GCC_CFLAGS) BUILT_SOURCES = $(nodist_cmumble_SOURCES) $(nodist_noinst_HEADERS) MAINTAINERCLEANFILES = mumble.pb-c.c mumble.pb-c.h -CLEANFILES = messages.h -EXTRA_DIST = mumble.proto messages.txt gen_messages.sed +CLEANFILES = message_list.h +EXTRA_DIST = mumble.proto messages.txt gen_message_list.sed # Ship files generated by protoc-c in releases, # so that protoc-c (which pulls in the c++ protobuf) is not needed. EXTRA_DIST += mumble.pb-c.c mumble.pb-c.h -messages.h: $(srcdir)/messages.txt $(srcdir)/gen_messages.sed - $(AM_V_GEN) LC_ALL= LC_COLLATE=C $(SED) -f $(srcdir)/gen_messages.sed $< > $@ +message_list.h: $(srcdir)/messages.txt $(srcdir)/gen_message_list.sed + $(AM_V_GEN) LC_ALL= LC_COLLATE=C $(SED) -f $(srcdir)/gen_message_list.sed $< > $@ mumble.pb-c.c mumble.pb-c.h: $(srcdir)/mumble.proto $(AM_V_GEN) $(builddir)/protoc-c.sh $< $@ diff --git a/src/cmumble.h b/src/cmumble.h index 9f40d31..63e3ffc 100644 --- a/src/cmumble.h +++ b/src/cmumble.h @@ -14,7 +14,7 @@ #include #include "mumble.pb-c.h" -#include "messages.h" +#include "message_list.h" #include "io.h" #include "connection.h" diff --git a/src/gen_message_list.sed b/src/gen_message_list.sed new file mode 100644 index 0000000..e1ffbeb --- /dev/null +++ b/src/gen_message_list.sed @@ -0,0 +1,24 @@ +1 { +i\ +#ifndef _MESSAGE_LIST_H_ \ +#define _MESSAGE_LIST_H_ \ +\ +#define MUMBLE_MSGS \\ +} + +# Backup original message name +h +# Prefix uppercase characters that follow a lowercase one +s/\([a-z]\)\([A-Z]\)/\1_\2/g +# Lowercase uppercase characters +y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ +# Append backup to lowercase underscored message +G +# Put template macro around (delete newline between both msgs, swap order) +s/^\(.*\)\n\(.*\)$/\tMUMBLE_MSG(\2, \1) \\/ + +$ { +a\ +\ +#endif /* _MESSAGE_LIST_H_ */ +} diff --git a/src/gen_messages.sed b/src/gen_messages.sed deleted file mode 100644 index 0013f5d..0000000 --- a/src/gen_messages.sed +++ /dev/null @@ -1,24 +0,0 @@ -1 { -i\ -#ifndef _MESSAGES_H_ \ -#define _MESSAGES_H_ \ -\ -#define MUMBLE_MSGS \\ -} - -# Backup original message name -h -# Prefix uppercase characters that follow a lowercase one -s/\([a-z]\)\([A-Z]\)/\1_\2/g -# Lowercase uppercase characters -y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ -# Append backup to lowercase underscored message -G -# Put template macro around (delete newline between both msgs, swap order) -s/^\(.*\)\n\(.*\)$/\tMUMBLE_MSG(\2, \1) \\/ - -$ { -a\ -\ -#endif /* _MESSAGES_H_ */ -} -- cgit