title: ctags: To get C function end line number
body: <p>is it possible via ctags to get the function end line number as well</p>
  
  <pre><code>"ctags -x --c-kinds=f filename.c"
  </code></pre>
  
  <p>Above command  lists the function definition start line-numbers. Wanted a way to get the function end line numbers.</p>
  
  <p>Other Approaches: </p>
  
  <pre><code>awk 'NR &gt; first &amp;&amp; /^}$/ { print NR; exit }' first=$FIRST_LINE filename.c
  </code></pre>
  
  <p>This needs the code to be properly formatted </p>
  
  <p>Example:
  filename.c </p>
  
  <pre><code>  1 #include&lt;stdio.h&gt;
    2 #include&lt;stdlib.h&gt;
    3 int main()
    4 {
    5    const char  *name;
    6 
    7     int a=0
    8     printf("name");
    9     printf("sssss: %s",name);
   10 
   11     return 0;
   12 }
   13 
   14 void code()
   15  {
   16         printf("Code \n");
   17  }
   18 
   19 int code2()
   20    {
   21         printf("code2 \n");
   22         return 1
   23    }
   24 
  </code></pre>
  
  <p>Input: filename and the function start line no.</p>
  
  <pre><code>Example:
  
      Input: filename.c  3
      Output: 12
  
      Input : filename.c 19
      Output : 23
  </code></pre>
  
  <p>Is there any better/simple way of doing this ?</p>