]> granicus.if.org Git - postgresql/blob - src/tools/make_ctags
Repair failure with SubPlans in multi-row VALUES lists.
[postgresql] / src / tools / make_ctags
1 #!/bin/sh
2
3 # src/tools/make_ctags
4
5 trap "rm -f /tmp/$$" 0 1 2 3 15
6 rm -f ./tags
7
8 IS_EXUBERANT=""
9 ctags --version 2>&1 | grep Exuberant && IS_EXUBERANT="Y"
10
11 # List of kinds supported by Exuberant Ctags 5.8
12 # generated by ctags --list-kinds
13 # --c-kinds was called --c-types before 2003
14 #    c  classes
15 #    d  macro definitions
16 #    e  enumerators (values inside an enumeration)
17 #    f  function definitions
18 #    g  enumeration names
19 #    l  local variables [off]
20 #    m  class, struct, and union members
21 #    n  namespaces
22 #    p  function prototypes [off]
23 #    s  structure names
24 #    t  typedefs
25 #    u  union names
26 #    v  variable definitions
27 #    x  external and forward variable declarations [off]
28
29 if [ "$IS_EXUBERANT" ]
30 then    FLAGS="--c-kinds=+dfmstuv"
31 else    FLAGS="-dt"
32 fi
33
34 # this is outputting the tags into the file 'tags', and appending
35 find `pwd`/ -type f -name '*.[chyl]' -print |
36         xargs ctags -a -f tags "$FLAGS"
37
38 # Exuberant tags has a header that we cannot sort in with the other entries
39 # so we skip the sort step
40 # Why are we sorting this?  I guess some tag implementation need this,
41 # particularly for append mode.  bjm 2012-02-24
42 if [ ! "$IS_EXUBERANT" ]
43 then    LC_ALL=C
44         export LC_ALL
45         sort tags >/tmp/$$ && mv /tmp/$$ tags
46 fi
47
48 find . \( -name 'CVS' -prune \) -o \( -name .git -prune \) -o -type d -print |
49 while read DIR
50 do      [ "$DIR" != "." ] && ln -f -s `echo "$DIR" | sed 's;/[^/]*;/..;g'`/tags "$DIR"/tags
51 done