help-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

get full prototype of a function


From: john smith
Subject: get full prototype of a function
Date: Wed, 17 Feb 2016 23:45:25 +0100

Is this possible to get a full prototype of a given function in a
standardized, easily parsable form?  The point is I need to get a
number of parameters for a number of functions as I am writing a
custom REPL-like tool that will call functions from an external API.
I need to know how many parameters every function takes in order to
inform user that he gave too few parameters. What I do now is this:

$ gtags -v -f LIST
$ global -f diff.h
foo                 5 diff.h           foo(

But it doesn't show any arguments that foo() takes.  It's written like
this in a source file:

void
foo(
int a,
         int b, int c, char
*f)
{
}

It's possible to do this in ctags:

$ ctags  --fields=+S diff.h
$ less tags
(...)
foo     diff.h  /^foo($/;"      f       signature:( int a, int b, int
c, char *f)

Now I can easily parse `signature:part' and get a number of
parameters.  I could use ctags but I got used to global, is this
possible here?

-- 
<address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]