Changes in X11DRV_KEYBOARD_DetectLayout in order to implement Russian
[wine/multimedia.git] / tools / find_debug_channels
blobc5e72e9c34c517813c9649405c2e4fd5d864bc29
1 #!/bin/bash
3 # This script scans the whole source code for symbols of the form
4 # 'xxx(yyy' where:
5 # xxx is either TRACE, WARN, ERR or WARN
6 # yyy is a C identifier
7 # It outputs on the standard output a sorted list of the
8 # yyy identifiers found in the .c files.
9 # Each identifier is reported once. Header files are not scanned.
11 # The script can be given an argument that specify the files to be
12 # searched according to the following scheme:
13 # - if the argument does not contain a slash (/), the script
14 # will search the tree rooted in the current directory for
15 # files that match that description. You can also pass
16 # wildcard arguments, but remember to quote them to prevent
17 # expansion by the shell
18 # - if the argument does contain a slash, only that file is
19 # searched
20 # - if no argument is given, the argument defaults to "*.c"
21 # that is, all C files are searched.
22 # - if more than a argument is given, only the listed files are
23 # searched. Note that in this case, the script will not
24 # attempt to find them in some subdirectories, but rather
25 # it will try to open them in the current directory.
26 # Thus, if you want to disable the automatic searching when the file
27 # name does not contain a /, either prefix the filename with ./
28 # or add /dev/null as another argument.
30 # Dimitrie O. Paun <dimi@cs.toronto.edu>
33 case "$#" in
34 0 | 1) files=${1:-'*.c'}
35 if [ ${files#*/} = "$files" ]; then
36 files=$(find . -name "$files" -print)
37 fi;;
38 * ) files="$@";;
39 esac
42 grep -h "TRACE *(" $files /dev/null | \
43 sed 's/.*TRACE *( *\([A-Za-z0-9_]*\).*/\1/g'
44 grep -h "ERR *(" $files /dev/null | \
45 sed 's/.*ERR *( *\([A-Za-z0-9_]*\).*/\1/g'
46 grep -h "FIXME *(" $files /dev/null | \
47 sed 's/.*FIXME *( *\([A-Za-z0-9_]*\).*/\1/g'
48 grep -h "WARN *(" $files /dev/null | \
49 sed 's/.*WARN *( *\([A-Za-z0-9_]*\).*/\1/g'
50 ) | sort | uniq