summaryrefslogtreecommitdiff
path: root/src/gen_messages.sed
blob: 0bc51f1474b7023268db21d56a5c9abe8784e5ae (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
25
1 {
i\
#ifndef _MESSAGES_H_ \
#define _MESSAGES_H_ \
\
#define MUMBLE_MSGS \\
}

# Duplicate & Seperate with ","
s/^.*$/\0, \0/

# Lowercase and prefix uppercase characters that follow a lowercase one
:a; s/^\([^,]*, .*[a-z]\)\([A-Z]\)/\1_\L\2\E/g; ta

# Lowercase remaining uppercase characters
s/\([^,]*, [a-z_]*\)\([A-Z]*\)/\1\L\2\E/g

# Put template macro around
s/^.*$/\tMUMBLE_MSG(\0) \\/

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