summaryrefslogtreecommitdiff
path: root/src/gen_message_list.sed
blob: eb5037ba683b5c6d8ad2e701c1a3c50f2398d823 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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\(.*\)$/	MUMBLE_MSG(\2, \1) \\/

$ {
a\
\
#endif /* _MESSAGE_LIST_H_ */
}